Posts

Showing posts from August, 2015

php - Yii - How To Show Other Property Not Its ID -

Image
i have related tables on database picture below: then, have page view file picture below: i want show username, not it's id. here code in view/file/_view.php <div class="view"> <b><?php echo chtml::encode($data->getattributelabel('id_file')); ?>:</b> <?php echo chtml::link(chtml::encode($data->id_file),array('view','id'=>$data->id_file)); ?> <br /> <b><?php echo chtml::encode($data->getattributelabel('nama_file')); ?>:</b> <?php echo chtml::encode($data->nama_file); ?> <br /> <b><?php echo chtml::encode($data->getattributelabel('deskripsi')); ?>:</b> <?php echo chtml::encode($data->deskripsi); ?> <br /> <b><?php echo chtml::encode($data->getattributelabel('id_user')); ?>:</b> <?php echo chtml::encode($data->id_user); ?> <br /> <b><?php echo cht...

java - subclasses common methods implemented in abstract superclass with different constructors -

i know has been discussed here have add question. need make abstract class called abstractgraph, , has extended 2 types of graph implementations: 1 uses matrix, other 1 uses lists. so far have this: abstract class abstractgraph implements graph { public void removealledges(){ //implementation here } } and subclasses: public graphmatrix(){ graphmatrix() { //implementation matrix type } } public graphlist(){ graphlist() { //different implementation lists type } } both implementations have same removealledges() method written same, guess has placed in abstract class. question is, how use references this inside abstract class ? have fill implementations getters , setters ? if so, benefit of using single implementation of method 2 (or more) subclasses. you can use same code removealledges long not depend on underlying structure (e.g., matrix or list) or functionality implemented encapsulated methods use u...

java - Fix (freeze) y axis for Android GraphView package -

i need way fix y axis graph view package. showing real time frequency spectra not possible visualise data y axis adjusts current largest value. please advise. offer bounty answer solves problem. package: http://android-graphview.org/#documentation if know range if y axis, method setmanualyaxisbounds(max,min) can used. example, if using sin function, graphview.setmanualyaxisbounds(1,-1); or if yours percentage graph, graphview.setmanualyaxisbounds(100,0); if have values plotted in array, again method can used max , min values of array (with formatting looks neater).

ios - How to populate data in a tableView as alphabetical order while using section index -

Image
i'm implementing app need show tableview. tableview needs have alphabetical search on right side clicking on letter needs show data starting letter. i've implemented vertical alphabet search , when user clicks on letter takes user particular section. problem every section has same data it's not populating according alphabet. here code this. // here exhibitorarray contains info populate data in tableview. - (nsinteger)numberofsectionsintableview:(uitableview *)tableview { return [self.exhibitorarray count]; } - (nsstring *)tableview:(uitableview *)tableview titleforheaderinsection:(nsinteger)section { return [[[uilocalizedindexedcollation currentcollation] sectiontitles] objectatindex:section]; } - (nsarray *)sectionindextitlesfortableview:(uitableview *)tableview { return [[uilocalizedindexedcollation currentcollation] sectionindextitles]; } - (nsinteger)tableview:(uitableview *)tableview sectionforsectionindextitle:(nsstring *)ti...

linux - Job on specific day of week -

i want have job running on 5 pm every wed, sat , sun... correct? 0 17 * * 0,3,6 my.command.goes.here. ps: using centos as of recent research cron, wrote correct. it not hurt search google crontab manual ;) http://www.linuxmanpages.com/man5/crontab.5.php

android - ScrollBy() is not working -

as title i have fragment layout <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/host_profile_scroll_view" android:layout_width="match_parent" android:layout_height="match_parent" android:fillviewport="true" > </scrollview> declare scrolview: content = (scrollview) rootview.findviewbyid(r.id.host_profile_scroll_view); and set on click listener button public void onclick(view v) { content.scrollby(0, +20); system.out.println(content.canscrollvertically(+20)); } but not working @ , sysout comman print out "false". question cause canscrollvertically false result , how resolved . in advance ! is content of scrollview scrollable? mean code wrote, content of scrollview should have height @ least 20px greater height of scrollview.

crash - How to find or log currently running test in MSTEST.exe -

we have build process including unittest launched via mstest.exe. unittest stuck, messagebox or send error dialog stuck or entire process crashes. don't know how find of tests bad one. is there way how find name of running test in case unittest stuck? is there way how find name of unittest runned last time? i don't want set timeout every single test, because not sure, suitable timeout. a nice solution me log when unittests start when finish. find last logged unittest. there way log it? you can use testcontext.testname it: /// use method run code before running each test. [testinitialize()] public void testinitialize() { yourlogger.logformat("run test {0}", this.testcontext.testname); } /// use testcleanup run code after each test has run [testcleanup()] public void mytestcleanup() { yourlogger.logformat("test {0} done", this.testcontext.testname); }

java - What is the difference between createCompatibleImage with Transparency.OPAQUE and simple BufferedImage constructor with BufferedImage.TYPE_INT_ARGB? -

what difference between version 1 , version 2? seem same in situation, read everywhere version 1 better approach. why? public bufferedimage getimage(icon icon) { int w = icon.geticonwidth(); int h = icon.geticonheight(); // version 1 graphicsdevice gd = graphicsenvironment.getlocalgraphicsenvironment().getdefaultscreendevice(); bufferedimage image = gd.getdefaultconfiguration().createcompatibleimage(w, h, transparency.opaque); // version 2 // bufferedimage image = new bufferedimage(w, h, bufferedimage.type_int_argb); graphics2d g = image.creategraphics(); icon.get().painticon(null, g, 0, 0); g.dispose(); return image; } in general, first approach results in image requires less transformations displayed. in best case possible, "first approach" image have same memory layout actual screen memory layout, meaning in order display image on screen image data can copied is. same true "second approach" image i...

Reading intergers from a text file in c -

i want take input file c program. input should consists of numbers , characters thereafter want differentiate both of them. fscanf returns 0 when encounters non integers, not worthy of being used here, do? #include <stdio.h> #include <ctype.h> int main(){ int num, status; file *fp = fopen("data.txt", "r"); while(eof!=(status = fscanf(fp, "%d", &num))){ if(status == 1){ printf("%d\n", num); } else { //if(status == 0){ (void)fgetc(fp);//replace @chux's suggestion int ch; while(eof!=(ch=fgetc(fp)) && ch != '-' && !isdigit(ch)); if(ch == '-'){ int pch = fgetc(fp); if(isdigit(pch)){ ungetc(pch, fp); ungetc(ch, fp); } } else { ungetc(ch, fp); ...

android - gcm service_not_available on any device emulator -

i have read post argument not resolved problem. i have installed app on samsung s2 , on emulator whit same api (vers. android 4.1.2 on s2 , api level 16 on emulator) the steps: i run emulatore api level 16 google api (google inc.) add account google on emulator internet connection available on emulator receive service_not_available when app run on emulator , work fine if run app on samsung s2. help me pls!

c# - Why should I use SqlCommand.CommandType = StoredProcedure? -

this question has answer here: when executing stored procedure, benefit of using commandtype.storedprocedure versus using commandtype.text? 4 answers question: difference between using standard sqlcommand , sqlcommand.comandtype = storedprocedure ? since i'm not sure if parameters passed command object by name or by order , prefer this: sqlcommand ocmd = new sqlcommand("exec sp_storedprocedure @param1, @param2, @param3", odbconnection); ocmd.parameters.add("param1", sqldbtype.bit).value = var_param1; ocmd.parameters.add("param2", sqldbtype.nvarchar).value = var_param2; ocmd.parameters.add("param3", sqldbtype.nvarchar).value = var_param3; rather sqlcommand ocmd = new sqlcommand("sp_storedprocedure", odbconnection); ocmd.commandtype = storedprocedure; ocmd.parameters.add("param1", sqldbtype.bit)...

java - Can't get Location Manager to work inside Fragment -

i've been trying location manager work few hours inside fragment. found stackoverflow question similar problem, , tried implement solution. answer located here: https://stackoverflow.com/a/18533440/3035598 so literally copied answer said, not working me. when map opens error "google play services missing". caused nullpointerexception can read in answer. i have no idea why not working, since did said. does know what's going wrong? if have provide code, let me know , that, same in link provided. edit: the code use: package com.example.bt6_aedapp; import android.location.location; import android.os.bundle; import android.support.v4.app.fragment; import android.util.log; import android.view.inflateexception; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.imageview; import android.widget.toast; import com.google.android.gms.common.connectionresult; import com.google.android.gms.common...

c# - Serialize Dotnet Collection without Root Element? -

consider following serialized xml: <course> <title>engineering</title> <student> <name>john doe</name> </student> <student> <name>jane doe</name> </student> ... </course> unfortunately not in position modify schema. (ideally should have wrapped student class students root element!) how define entity classes serialization work properly? i tried following code, generates xml students wrapper element. public class course { public string title { get; set; } public list<student> students { get; set; } } public class student { public string name { get; set; } } add xmlelement attribute students list, this: public class course { public string title { get; set; } [xmlelement("student")] public list<student> students { get; set; } }

Rendering the HTML's of different controller in the single (caller) view in RAILS 4.0.2 -

i have link in view , href on link points action in different controller. need when click link need view corresponding different controller rendered in first views div. eg: have menu list in left side of page , content div in rightside of page. each of left side menu corresponds actions/views in different controllers. when click on of left side links should render respective htmls controller, in right side div. thanks the rails-y way of doing use remote: true option in link_to. setup controller respond format.js, , setup js.erb template replace said content. <%= link_to 'page 2', page_2_path, remote: true %> <div class="content"></div> controller: class pagescontroller < applicationcontroller def page_2 end end views: # pages/_page_2.html.haml <h1>some content</h1> # pages/page_2.js.erb $('.container').html('<%= escape_javascript(render(partial: 'pages/page_2')) %>'); f...

Batch setting a title at the top -

how set title batch file batch file @ top. if 1 can help. have looked on google didn't find thing of use. try using this: title "my batch file" let me know if that's want.

css - Is there a bug in the new iOS 7.1 minimal-ui viewport setting? -

Image
the new "minimal ui" setting in ios 7.1 great landscape websites. web app uses fullscreen, absolute positioned div content, give app-like feeling. safari seems add height of url bar @ bottom. have tried on different iphones, same result... here how looks after pages loaded: is bug or doing wrong or missing? click example (view on iphone ios >= 7.1) i had same problem iphone5+ios7.1+minimal-ui. code fixes trouble. window.addeventlistener('scroll', function () { // not scroll when keyboard visible if (document.activeelement === document.body && window.scrolly > 0) { document.body.scrolltop = 0; } }, true);

asp.net mvc - Refresh token doesn't fail after deleting the user -

i'd know if it's failure or bug/feature of asp.net identity. we use asp.net identity 1.0 in our asp.net mvc 5 project. oauth configured this: public partial class startup { static startup() { publicclientid = "self"; usermanagerfactory = () => new usermanager<applicationuser>(new userstore<applicationuser>(new applicationdbcontext())); oauthoptions = new oauthauthorizationserveroptions { tokenendpointpath = new pathstring("/token"), provider = new applicationoauthprovider(publicclientid, usermanagerfactory), refreshtokenprovider = new authenticationtokenprovider() { oncreate = createrefreshtoken, onreceive = receiverefreshtoken }, authorizeendpointpath = new pathstring("/api/account/externallogin"), accesstokenexpiretimespan = timespan.fromdays(14), allowinse...

Android - Why the click event isn't trigged -

i'm facing problem focus on application. i'm trying catch click event animate edittext, reason don't understand, edittext focused click event not trigged. the user has click 2nd time start animation. i've got 2 autocompletetextview in sherlockfragment . is possible come animation i'm doing ? edit: metwhere.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { log.d(tag, "metwhere've been clicked"); if (!mllwherehasbeenclicked) { mllwherehasbeenclicked = true; if (malphaframelayout != null) { animate(malphaframelayout).setduration(anim_duration / 2).alpha(0.9f); } if (mllwhere != null) { oldllwhereypos = viewhelper.gety(mllwhere); log.v(tag, "o...

How to send MMS with MM4 using Java? -

please let me know, there way send mms messages using mm4 protocol in java? i found sample projects sending sms , mms messages on google , github have used mm7 protocol send messages. if there free apis, please let me know them too. mm4 interface used mmsc-to-mmsc connectivity. when send mms recipient outside home mobile network message sent mmsc on mm4 recipients mmsc. mm4 based on smtp additional mms specific headers. operators don't use public internet mm4, go through vpn. to send message on mm4 need construct email message in correct format , send mmsc's smtp port. there ton of examples on internet on how send email java or other language of choice. for specific mms headers, ask operator sample message dump or check out mms related specs from: 3gpp ( http://www.3gpp.org/component/itpgooglesearch/search?q=mm4 ) (see 23.140) oma ( http://technical.openmobilealliance.org/technical/release_program/mms_v1_3.aspx )

java - which one is better to sort linked items , Hashmap or linkedhashmap or any other? -

i have 2 strings twitter json "follower_count" , "user id" i need sort them according favourite count in descending order, i.e greater follower count gets placed first , access "user id" link. , print 1 10. best way in java/android hashmap or linked hashmap or other ? update:- used sorted maps suggested, treemap here progress far: //get first status status = statuses.get(0); //get id of status long l= status.getid(); //get retweeters id ki =twitter.getretweeterids(l, 100, -1); long[] id=ki.getids(); //for every retweeter id, followers count , put in treemap treemap<integer,long> tm = new treemap<integer, long>(); for(int k=0;k<=id.length;k++) { u = twitter.showuser(id[k]); follower=u.getfollowerscount(); tm.put(follower,id[k] ); } navigablemap<integer,long> reversetreemap = tm.descending...

Make .htaccess to keep REAL file path -

okay, want htaccess rewrite profile.html?id=1 profile/1/ , resources , scripts, may loaded profile.html requesting profile/1/js/... . can somehow keep real relative path of file , prettify url @ meantime? in files add / before js, css, images etc. should try files root folder. if javascript file in js folder be: <link rel="stylesheet" href="/js/script.js" />

asp.net - Database Change Notifications using ENABLE_BROKER -

i want "database change notifications in asp.net using signalr , sqldependency" using "enable_broker" in sql server. wise decision using trigger or may cause slowness of database please share knowledge greatful. http://technet.microsoft.com/en-us/library/ms345108(v=sql.90).aspx

Android Library project says nullpointerexception -

i have android library project my_lib my_lib has list activity mylistactivity has resources , stuffs. when run android application 'mylistactivity' works fine. but when create proj test_proj , make my_lib android library project , add test_proj library , added mylistactivity activity in androidmanifest , run getting nullpoiterexception in mylistactivity , i.e @ findviewbyid(r.id.list) returning null. how can fix this code below oncreate of mylistactivity @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); requestwindowfeature(window.feature_no_title); getwindow().addflags(layoutparams.flag_fullscreen); setrequestedorientation(activityinfo.screen_orientation_portrait); setcontentview(r.layout.activity_main); initdata(); rowitems = new arraylist<rowitem>(); (int = 0; < titles.length; i++) { rowitem item = new rowitem(images[i], titles[i], descriptions[i], packagenames[i]); ...

c# - Process WaitForExit not blocking -

i using filesystemwatcher class convert audio listenable format come in. worked while, until right around time upgraded 4.5 on server. now, work, need debug , set breakpoint method not exit before process runs. it takes few milliseconds sox convert audio. setting thread.sleep(10000) doesnt fix issue. downgrading project .net 2.0 did nothing. what's frustrating, process.waitforexit() seemingly not block. while debugging, step right on , wait until file shows in folder. as always, appreciate assistance. attached relevant code: void filecreated(object sender, filesystemeventargs e) { string newname = string.format(@"{0}{1}.mp3", _mp3folderpath, e.name.replace(".wav", "")); string soxargs = @"-t wav -r 8k -c 1"; processstartinfo p = new processstartinfo { filename = _soxpath, arguments = string.format("{0} {1} {2}", soxargs, e.fullpath, newname), ...

php - Count how many char in array numbers -

i've array got preg_match_all. array contain 4 values , each value number. want display value have 10 or more character. example: array_value1 = 1234567890 array_value2 = 01234 array_value3 = 449125 array_value4 = 991234581210 i want show echo array_value1 , array_value4 because formed of 10 or more characters! how can it? i tried count_char or str_len see message "array string conversion". anyone can me? first of have put values inside array: $array = array(1234567890, 01234, 449125, 991234581210); after can use simple foreach: foreach($array $value) { if(strlen((string)$value) >= 10) echo $value; } you should add separator after each echo, or have output like 1234567890991234581210

php - Hacklang tutorial - this type in extend class -

what correct answer hack tutorial exercice 16 ? link tutorial: hacklang tutorial my modified code (not marked solution): <?hh // type 'this' points derived type class mybaseclass { protected int $count = 0; public function add1(): { $this->count += 1; return $this; } } class myderivedclass extends mybaseclass { public function print_count(): void { echo $this->count; } } function test(): void { $x = new myderivedclass(); $x->add1()->print_count(); } i replaced mybaseclass this still not marked correct (green text exercice number) .. correct answer? i'm engineer working on hack. i'm pretty sure have bug in our completion detection logic exercise in tutorial. code looks correct me -- changing return type this is, far can see, supposed do. i'll follow , bug fixed. sorry that!

mysql - Difference between inserto into in each line or just one per table -

i use 2 forms of backup on clients table. use mysqldump , use sqlyog backup. sqlyog creates insert way: insert `tbb111`(`ppu_nome_usu`,`ppu_nome_prg`,`ppu_seq_prg`,`ppu_des_ppu`) values ('rachel','sdmw','0','todas ;01012014;28022014;00001;;;'); insert `tbb111`(`ppu_nome_usu`,`ppu_nome_prg`,`ppu_seq_prg`,`ppu_des_ppu`) values ('rachel','sdmw2251','0','01012013;31122014;'); insert `tbb111`(`ppu_nome_usu`,`ppu_nome_prg`,`ppu_seq_prg`,`ppu_des_ppu`) values ('rachel','sdmw2290','0','todos;01012013;31122014;;;;00000000000;99999999999;;'); and mysqldump creates way: insert `sdm638` values ('1','1','201402','1002','computadores e periféricos','0','0','222222','0','733.4800','539.3200','1272.8000','0.0000','0.0000','0.0000','0.0000','0','0...

prolog - making a difference in X and a atom -

i'm searching solution this. user can use my_predicate(x) or my_predicate(item) . i want achieve both gives different output. have check if it's x or item . i know item can checked this: atom(item) how can check on x . roelof edit 1. weird, on swi-prolog site wont work. my_predicate(x) :- var(x) , write("here name typed in"). my_predicate(x) :- nonvar(x) , write("here x typed in"). var/1 it's simplest metaprogramming tool available in prolog, since allows change program behaviour depending on such fundamental property instantiation of clause' variable. i sometime use construct some_applicative_code(x) :- ( nonvar(x) ; x = some_default_value ), ... to have kind of default value arguments, testing purpose. calling ?- some_applicative_code(_). x bind some_default_value . from edited post, seems inverting logic. expect my_predicate(x) :- nonvar(x) , write("here name typed in"). my_pr...

c# - Get URI from Object -

i using modernui developing wpf application. contains control called link can used navigating through pages. it's used in tab controls displaying pages on multiple tabs (each tab serves link). my requirement generate tabs dynamically in each tab have display same content (same user control). the way set link content through source property accepts object of type uri . suppose if create 5 tabs (5 links) , set same uri each tab usercontrol object shared among tabs.(if make change on 1 tab reflects on other tabs). how should prevent this? there way can use runtime object uri? any suggestions welcome if can done using alternate approach? thanks!! if indeed have 5 different tabs, supposed, design, use 5 different sources. if want have same content initially, should create 5 different instances of uri type object corresponding 5 link s. in addition that, you'll have make sure uri s don't point same thing. if do, change in same thing reflected acro...

c# - Create SQL Server DSN -

i needing create dsn through code connect sql server. tried example in link, fails datasourcekey never null. have different solution or option? http://www.codeproject.com/tips/350601/create-sql-dsn-in-csharp and code: string odbc_path = "software\\odbc\\odbc.ini\\"; string drivername = "sql server"; string dsnname = "dsnfromcode"; string database = "mydbname"; string description = "this dsn created code!"; //this 1 change made source code had ip of server , //am hardcoding server name string server = "brimstone"; bool trustedconnection = false; // lookup driver path driver name string driverpath = "c:\\windows\\system32\\sqlsrv32.dll"; var datasourceskey = registry.localmachine.createsubkey(odbc_path + "odbc data sources"); if (datasourceskey == null) { throw new exception("odbc registry key not exist"); } datasourceskey.setvalue(dsnname, driver...

html5 - Is there no EASY way to enable the user the save the canvas? -

i've tried doing few hours, , i've tried every solution find both on stackoverflow , on other sites, without success. the remarkable thing every solution or @ least distinctly different 1 another. , wc3schools , sites seem have no default way of solving whatsoever. i have simple html-document body: <body onload="draw();"> <canvas id="canvas1" width="500" height="500"></canvas> </body> and js-document: // javascript document function draw() { var canvas1 = document.getelementbyid('canvas1'); if(canvas1.getcontext) { var ctx = canvas1.getcontext('2d'); //here's lot of drawing i've removed make that's relevant more readable. } } so i'm working with, , u can see i've removed of code drawing on canvas since code shouldn't necessary know save canvas (please tell me if is, though). i don't care format i'm saving in or how ...

SSIS ForEach Variable Mapping Error -

i want able send emails using ssis. followed instructions @ " how send records table in e-mail body using ssis package? ". however, getting error: error: foreach variable mapping number 1 variable "user::xy" cannot applied while running package. source table has 5 columns ( bigint , datetime , nvarchar , nvarchar , nvarchar types). another error is: error: type of value being assigned variable "user::xy" differs current variable type. variables may not change type during execution. variable types strict, except variables of type object. what problem be? update: trying find out problem, have done this: while taking data execute sql task , cast int data varchar , use variable string data type , works. how should set variable has int data type, not varchar ? i ran problem & resolved it, although don't know how. running ssis sql server 2008 r2: a) query pulls rows object b) each trying loop through , pull values first...

orchardcms - Orchard infinite scroll -

i trying use "infinite ajax scrolling" orchard module. https://gallery.orchardproject.net/list/modules/orchard.module.orchard.jquery.ias i installed module through admin interface. made necessary modifications described on given link. also, had modification described in comments. the infinite scrolling thing not functioning. created 30 blog posts in order test it. when scroll through blog posts through public website, first page og blog posts loaded , when scroll bottom, nothing happens. pager not visible (expected), no new content appended bottom of list (not expected). when scroll through blog posts using admin interface , scroll down sufficiently, chrome console reports couple of things: uncaught error: syntax error, unrecognized expression: <!doctype html> <html lang="en-us" class="static orchard-blogs"> <head> <meta charset="utf-8" /> <title>proba - manage infinite blog</title> ...

Zoho Invoice API not working -

i trying 3 zoho invoice api's not working. the invoice api's are: list contacts(get method) list customer payments(get method) create customer payment(post method) list contacts(get method) for list contacts have used url https://invoice.zoho.com/api/contacts/?authtoken= &scope=invoiceapi but response is <response status="0"> <code>5</code> <message> <![cdata[ invalid url passed ]]> </message> </response> list customer payments(get method) for list customer payments have used url as https://invoice.zoho.com/api/customerpayments?authtoken= &scope=invoiceapi my response is <response status="0"> <code>5</code> <message> <![cdata[ invalid url passed ]]> </message> </response> create customer payment(post method) to create customer payment using create map fields , post url method below <%{ map1 = map(); map1.put("date...

java - ANTLR 4 Not all tokens being displayed -

this obvious question can't seem find on it. @ moment have grammar type in simple commands broken down html later via java grammar cocodemol; r : file; file : line* ; line : newtype | assignment | clear (linebreak)? | end (linebreak)? ; newtype : types space num* space? '=' space? 'new' space types (linebreak)? ; assignment : num* '.' variables space? '=' space? nums* (linebreak)? ; types : 'body' | 'div' | 'span' | 'html' ; variables : 'width' | 'height' | 'background' | 'margin' | 'margin-left' | 'margin-right' | 'margin-top' | 'margin-bottom' | 'padding' | 'padding-left' | 'padding-right' | 'padding-top' | 'padding-bottom' | 'float' ; declarations : 'new' ; end : 'end' (linebreak)? ; clear : 'clea...

email - Identifying mails between an IMAP server and a client application -

the imap spec gives great hopes uid value may used this: the unique identifier of message must not change during session, , should not change between sessions. change of unique identifiers between sessions must detectable using uidvalidity mechanism discussed below. but alas, @ least microsoft exchange server, experience shows uid of message does occasionally/often change between sessions, though should not , , not detectable using uidvalidity (which stays same). as example of may happen. server, got mail? , server says, sure, here are, ids 4, 5, 7, 8 , 11. (incrementing not necessesarily contiguous, far well.) so, next time, say, got mail newer 11? , server says sure, , gives me 14, 15, 16 , 18, has happened has reassigned id of message known e.g. 5 e.g. 16! looks new mail, old mail new id! this means 1) "should not" bears no value, 2) exchange following spec if interpret "should not" "it's you" , 3) may violating...

iphone - Crop image in oval shape -

Image
i working on app in need give cropping option. once select image camera or gallery should open on editing page have oval image zooming & moving option. once click on apply captured image should cropped in oval shape. now following screen aviary sdk. has square cropping & in need cropping in oval shape. tried customise not able so. can suggest me easiest or best suitable way implement this. thanks. - (uiimage *)croppedphoto { // dealing retina displays non-retina, need check // scale factor, if available. note use size of teh cropping rect // passed in, , not size of view taking screenshot of. cgrect croppingrect = cgrectmake(imgmaskimage.frame.origin.x, imgmaskimage.frame.origin.y, imgmaskimage.frame.size.width, imgmaskimage.frame.size.height); imgmaskimage.hidden=yes; if ([[uiscreen mainscreen] respondstoselector:@selector(scale)]) { uigraphicsbeginimagecontextwithoptions(croppingrect.size, yes, [uiscreen mainscreen].scale); ...

shell - Unable to use wildcard for SSH command -

there number of files have check if exist in directory. follow standard naming convention aside file extension want use wild card e.g: yyyymm=201403 file_list=`cat config.txt` file in $file_list file=`echo $file | cut -f1 -d"~"` search_name=$file$yyyymm answer=`ssh -q userid@servername 'ls /home/to/some/directory/$search_name* | wc -l'` returnstatus=$? if [ $answer=1 ]; echo "file found" else echo "file not found" fi done the wildcard not working, ideas how make visible shell? i had same question now. in despair, gave , used pipes grep , xargs wildcard-like functionality. was (none of these worked - , tried others): ssh -t r@host "rm /path/to/folder/alpha*" ssh -t r@host "rm \"/path/to/folder/alpha*\" " ssh -t r@host "rm \"/path/to/folder/alpha\*\" " is: ssh -t r@host "cd /path/to/folder/ && ls | grep alpha | xarg...

Git Grep Searching -

i trying compare 2 commits of git project. clone repository postfix folder, use: git --grep=xxx where xxx commit number, retrieve hash , use git checkout retrieved hash. however, git grep returns details of particular commit. if example commit had id 24, enough me retrieve commit id 23 in order version of project without fix? background i'm not sure ids you're talking about: git commits not have sequental ids , identified sha-1 names hashes calculated on corresponding commit objects. so might suppose you're talking project embeds externally generated ids. 1 reason might project follows subversion repository default commits created in such repository have subversion url , revision id artifically embedded in messages. what take out of this first things first: in general, answer question no. reason git commit might have more 1 parent—if it's merge commit. hence considering commit , merely stepping backwards (see below how that) not possible. ...

excel - How to get format type of cell using c# in spreadsheetlight -

i using spreadsheetlight library read excelsheet(.xslx) values using c#. i can read cell value using following code (int col = stats.startcolumnindex; col <= stats.endcolumnindex; col++) { var value= sheet.getcellvalueasstring(stats.startrowindex, col); //where sheet current sheet in excel file } i getting cell value. how can data type of cell. have checked in documentation dint filnd solution. note: .xls type of excel files using excellibrary.dll library can datatype of cells using below code for (int = 0; <= cells.lastcolindex; i++) { var type = cells[0, i].format.formattype; } but no similar method there in spreadsheetlight. thanks in advance. here answer developer vincent tang after asked him wasn't sure how use datatype: yes use slcell.datatype. it's enumeration, data, you'll working number, sharedstring , string. text data sharedstring, , possibly string if text directly e...

android - making constant internet connection to server without draining battery -

apps twitter drain phone's battery have wake phone when new tweet comes. app need constant connection server. won't download or upload data constantly.sending tcp keep-alive every 2 minutes can save battery life or way can talk server push notifications? why push doesn't drain battery? if want implement use google cloud messaging: http://developer.android.com/google/gcm/gcm.html basically create google api project sends information google cloud messaging server. server queues messages , send them final device when it's able receive them. device keeps open socket @ times receive these messages there's not big impact on battery drain.

c# - About instantiate a class from inherited class -

what difference between this derivedclass classinst = new derivedclass(); and baseclass classinst = new derivedclass(); i can't seem see difference , compiler doesn't complain, can use interchangeably? the difference between 2 if derivedclass classinst = new derivedclass(); the compiler interprets classinst derivedclass , , allows use specific methods/properties/etc have declared in derived class , not in base class. on other hand, if baseclass classinst = new derivedclass(); the compiler interpret classinst baseclass , , not have access members. do realize actual type of object not change. reference object stays same, no matter of 2 declarations use. thing changes how reference interpreted , , therefore members available; of base class, or derived class.

refresh - How can i reload the multiselect from Jquery? -

enter code here hi want reload multiselect after ajax event. tried : $("#addcategorybutton").click(function(){ category = $("#addcategory").val(); $.ajax({ type: "post", url: "/contributii/addcategory/", data: { addcategory: category } }) .done(function( msg ) { $("#categoryselect").multiselect("refresh"); }); }); but doesnt work. can ? called multiselect: $(document).ready(function () { $("#categoryselect").multiselect({ // multiselect header: false }); });

GPUImageView rendering Blank after Scroll in ListView Android -

i using gpuimageview component android-gpuimage library displaying images (with filtered applied on them) in listview . the images being loaded filters first time in listview when scroll down listview , scrolled cells displayed blank. here code of getview(...) method of custom baseadapter : @override public view getview(int position, view convert_view, viewgroup arg2) { // todo auto-generated method stub if(convert_view == null) { if(inflater == null) inflater = (layoutinflater) this.context.getsystemservice(context.layout_inflater_service); convert_view = inflater.inflate( r.layout.filter_item , null); } textview thumb_file_name_tv = (textview) convert_view.findviewbyid(r.id.filter_item_thumb_tv); gpuimageview thumb_giv = (gpuimageview) convert_view.findviewbyid(r.id.filter_item_thumb_giv); log.d(tag, "image uri = "+imageuri); thumb_file_name_tv.settext(""+filternames.get(position).to...

jqGrid - Highlight current row in cell edit mode? -

in jqgrid cell edit mode ( celledit: true ), there way highlight not selected cell, row cell on well? saw default functionality row highlighted well. further investigation found overriding cell colors somewhere else in code.

in javascript,can we match a string with circulate part by using regex but don't split it -

a string this: "01a123,02a13334,03a99313,01ba9424,……" substring's regex is: /\d{2}[a-z]{1,2}\d*/ can write regex match string without split it? to validate entire line of form, # /^\d{2}[a-z]{1,2}\d*(?:,\d{2}[a-z]{1,2}\d*)*$/ ^ # beginning of string \d{2} [a-z]{1,2} \d* # 2 digits, 1-2 a-z, optional 0-many digits (?: # cluster group start (non-capture group) , # comma ',' \d{2} [a-z]{1,2} \d* # 2 digits, 1-2 a-z, optional 0-many digits )* # cluster group end, optional 0-many times $ # end of string

weblogic12c - Difference between Weblogic 12c Node Manager Versions -

today asked myself differences between 2 node manager versions are. documentation says: java-based node manager provides more security script-based version. but why java-based version more secure? see: node manager dokumentation determining node manager version use: the script based node manager requires simpler security configuration java version. rsh , ssh easier configure ssl method of security used java version of node manager . script version of node manager required smaller footprint java version http://docs.oracle.com/cd/e13222_01/wls/docs92/server_start/nodemgr.html

cocoa - NSSegmentedControl Selected Segment in User Defaults -

having problem storing selectedsegment of segmented control in user defaults. i'm using segment selection binding , doing set , call default: [[nsuserdefaults standarduserdefaults] setobject: [modesegcontroller objectvalue] forkey: @"seltag"]; [modesegcontroller setobjectvalue: [[nsuserdefaults standarduserdefaults] objectforkey: @"seltag"]]; not working. can me out? -thanks paul. use [[nsuserdefaults standarduserdefaults] setvalue: [ nsnumber numberwithinteger:[modesegcontroller selectedsegment] ] forkey: @"seltag"] to show selected segement use in ui [modesegcontroller setselected:...] integer and [modesegcontroller setselectedsegment:[ [nsuserdefaults standarduserdefaults] valueforkey: @"seltag"] integervalue] ] you needn't use tags store/restore selected segment. segments can accessed directly.

authentication - Spring Security privacy policy message after successful login -

i'm looking way include warning page after successful login in spring security app. warning page display message user has logged in pressing "yes" agree terms , conditions bla bla... want ensure can't access resources unless click "yes". how can include in journey? i've implemented custom success handler if help. thank's in advance. this matter of choice implement it. you can creating custom implementation of userdetailsservice . interface has 1 method namely loaduserbyusername , returns instance of userdetails again interface spring security. implementing userdetails interface user pojo/entity can have access useful messages can check user active or enabled or credentials non expired, etc. have @ javadoc . there can handle user has accepted terms , conditions or not. another way create custom spel check whether user has accepted terms or not.

Show product updated date in Magento -

i want show date of last update (not creation date) in magento product page. <?php echo $_product->getupdatedat();?> working but don't want show time — date. is possible? ashley's solution should work, may have wrap in strtotime() first echo date("y-m-d", strtotime($_product->getupdatedat())); i recommend using magento's date model time in timezone (it take care of timestamp). echo mage::getmodel('core/date')->date("y-m-d", $_product->getupdatedat()); take @ app/code/core/mage/core/model/date.php <?php class mage_core_model_date { /** * converts input date date timezone offset * input date must in gmt timezone * * @param string $format * @param int|string $input date in gmt timezone * @return string */ public function date($format = null, $input = null) { if (is_null($format)) { $format = 'y-m-d h:i:s'; } ...

jsf 2 - Java EE 7 Application not deploying on Glassfish 4 Sever after switching from Mojarra to MyFaces -

currently have problem when try deploy our java ee 7 application glassfish 4.0 server. before changed jsf implementation jsf mojarra 2.2.0 myfaces 2.2.2 worked pretty well. heres error log: >2014-03-24t16:05:42.356+0100|schwerwiegend: unable obtain injectionprovider init time facescontext. container implement mojarra injection spi? 2014-03-24t16:05:42.357+0100|schwerwiegend: die anwendung wurde bei systemstart nicht einwandfrei initialisiert, factory konnte nicht gefunden werden: javax.faces.application.applicationfactory. rügriff versucht. 2014-03-24t16:05:42.358+0100|schwerwiegend: startup of context /jortho failed due previous errors 2014-03-24t16:05:42.358+0100|schwerwiegend: exception during cleanup after start failed org.apache.catalina.lifecycleexception: manager has not yet been started @ org.apache.catalina.session.standardmanager.stop(standardmanager.java:934) @ org.apache.catalina.core.standardcontext.stop(standardcontext.java:6099) @ com.sun.enterpr...