Posts

Showing posts from January, 2013

.net - How do I remove all objects in a List<string> on Windows Phone 7 Silverlight C#? -

how remove objects in list on windows phone 7 silverlight c# (latest sdk)? the method mylist.removeall() not exist. thanks. you should able use: mylist.clear()

facebook php sdk - Cakephp 2.1 fatal error -

fatal error: class 'facebookinfo' not found in c:\xampp\htdocs\cake21\app\lib\fb.php on line 22 can me figure thing out. the error says: have not included file contains definition class facebookinfo . make sure have defined class above or used include('filename.php') defines facebookinfo .

jsf 2 - Redirect before loading the page in JSF2 -

this question has answer here: hit bean method , redirect on request 1 answer i have requirement before page going load want check whether query string exists or not if query string exists want redirect page instead of current page how can handle type of requirement in jsf 2. thanks in advance when on jsf 2.2, can use <f:viewaction> this. <f:metadata> <f:viewparam name="paramname" value="#{bean.paramname}" /> <f:viewaction action="#{bean.check}" /> </f:metadata> ( paramname name of query string parameter) private string paramname; // +getter+setter public string check() { if (paramname == null) { return "error.xhtml"; } return null; } when not on jsf 2.2 yet (jsf 2.0/2.1), can use <f:event type="prerenderview"> this. <f:metada

spotify - How do I allow my app to have tracks dropped into it -

at present when dragging track in spotify on app doesn't allow dropping. however, last.fm , moodagent apps allow this. code should including make possible? i assume it's events.linkschanged including doesn't make difference. you need include acceptedlinktypes key in manifest.json file. see documentation details.

c++ - Read value of a text file and write the value into a QDoubleSpinBox -

i want read string (data) out of text file , write data qdoublespinbox. therefore used: void guisubclasskuehnigui::loaddirectory() { qstring loadeddirectory = qfiledialog::getexistingdirectory(this, "/home",tr("create directory"), qfiledialog::dontresolvesymlinks); ui.pathdirectory -> settext(loadeddirectory); qfileinfo geodat1 = loadeddirectory + "/1_geo.m4"; qfileinfo geodat2 = loadeddirectory + "/2_geo.m4"; qstring value; if (geodat1.exists() == true) { qfile geo (loadeddirectory + "/1_geo.m4"); if(geo.open(qiodevice::readonly | qiodevice::text)) { qtextstream stream (&geo); qstring text; { text = stream.readline();

properties - how to create java pojo -

i want read properties file , create pojo it. property key instance variable getters , setters. , property value data type of instance variable. input this classname=temp packagename=com.temp name=java.lang.string output be package com.temp; import java.lang.string; class temp{ private string name //getters , setters } what easiest way this. should create file , write .or there better way. i once generated java file using apache velocity , may want take it. in short template file use generate want.

jsp - Tomcat: get file-path -

i have jsp-application on tomcat. i have application upload files. now want delete files. know relative url "aktionen/100" don´t know absolute path. on localhost "c://daten/client/" example. want them dynamically because if host other path. relying on relative paths bad idea beginning on. make upload folder externally configureable example vm argument or properties file setting. e.g. when start tomcat, add vm argument -dupload.location=/path/to/uploads then can follows: file uploadfolder = new file(system.getproperty("upload.location")); file uploadedfile = new file(uploadfolder, "aktionen/100"); // ... see also: how save , retrieve image on server in java webapp

sql - Select most recent date + inner join -

i trying query recent scan date (the 2 recent ones 3/5/2012 , 3/1/2012 ... i'd return records 3/5/2012, need automated every time new scan run query pulling recent date. i'm joining 2 tables ip. put query below , receiving error "please check sql syntax. column qryreportscondensedpatchesaggregate.scanname invalid in select list because not contained in either aggregate function or group clause." select qryreportscondensedpatchesaggregate.scanname, qryreportscondensedpatchesaggregate.pspplmsseverity, qryreportscondensedpatchesaggregate.smachipaddress, qryreportsscansummarywithdetailsaggregate.patchmissing, max(qryreportscondensedpatchesaggregate.scandate) qryreportscondensedpatchesaggregate inner join qryreportsscansummarywithdetailsaggregate on qryreportscondensedpatchesaggregate.smachipaddress=qryreportsscansummarywithdetailsaggregate.smachipaddress qryreportscondensedpatchesaggregate.scanname '%mgmt%' , qryreportscondensedpatch

amazon ec2 - How to configure direct http access to EC2 instance? -

this basic amazon ec2 question, i'm stumped here goes. i want launch amazon ec2 instance , allow access http on ports 80 , 8888 anywhere. far can't allow instance connect on ports using own ip address (but connect localhost). i configured "default" security group http using standard http option on management console (and ssh). i launched instance in default security group. i connected instance on ssh port 22 twice , in 1 window launch http server on port 80. in other window verify can connect http using "localhost". however when try access http instance (or anywhere else) using either public dns or private ip address het "connection refused". what doing wrong, please? below console fragment showing wget succeeds , 2 fail run instance itself. --2012-03-07 15:43:31-- http://localhost/ resolving localhost... 127.0.0.1 connecting localhost|127.0.0.1|:80... connected. http request sent, awaiting response... 302 moved temporarily l

c# - Tab Control tab will only use Wait Cursor -

so, i'm making game in c#, , i've created window handle custom controls schemes. on page there tab control, 3 tabs: scheme 1, scheme 2, , custom scheme 1 , 2 fine, on custom tab, whenever mouse hovers on it, displays wait cursor. controls inside tab work fine , without lag, displays waitcursor. i can't change cursor property in design window (it goes waitcursor), , i've tried changing in code, won't work. please check following property in tab control , each tab: usewaitcursor set true if usewaitcursor = true parent control propagate property child controls. think issue. please see link below explanation of property: http://msdn.microsoft.com/en-us/library/system.windows.forms.control.usewaitcursor.aspx

sqlite - creating and upgrading data base in android -

i playing sqlite , android. far app has 2 activities.. a main activity: import android.app.activity; import android.content.sharedpreferences; import android.database.sqlite.sqlitedatabase; import android.os.bundle; import android.util.log; public class homefavesactivity extends activity { private static final string tag = "homefavescatovoty"; sqlitedatabase lcdb; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); log.v(tag, "created"); databasemanager db = new databasemanager(this); db.getwritabledatabase(); } } and databasemanager class: import android.content.contentvalues; import android.content.context; import android.database.cursor; import android.database.sqlite.sqlitedatabase; import android.database.sqlite.sqliteopenhelper; import android.util.log; import

Resharper clean code line breaks with properties and fields -

here issue. want put line breaks between properties , not fields. here getting: private string _field1; private string _field2; private string _field3; public string property1 { get; set; } public string property2 { get; set; } public string property3 { get; set; } here want: private string _field1; private string _field2; private string _field3; public string property1 { get; set; } public string property2 { get; set; } public string property3 { get; set; } does have idea how resharper have type of line breaks? have resharper puts lines breaks between of fields , properties or no line breaks. cannot seem find right settings want. go resharper|options , under code editing , navigate c#→formatting style→blank lines . now, need change 2 separate options: change keep max blank lines in code value 0 (zero) change around single line field value 0 (zero) ... , you're done!

hibernate - How do I annotate a Map<String, Entity> when the map key does not come from the entity -

i've read entries in forum discussing how annotate typed map hibernate , i've read hibernate docs referenced here. none of them answer question. code follows: @onetomany @jointable(name="administrator_filters") private map<string, basefilter> filters; i want use arbitrary string key map contains basefilter object (which 1 of entities) , store in join table. hibernate seems require property basefilter object key in map. i see following error cannot define primary key constraint on nullable column in table 'administrator_filters'. i've added nullable=false joincolumn elements in jointable , mapkey annotation, same error. i add property basefilter containing map key, trying not that. hibernate docs say: maps can borrow keys 1 of associated entity properties or have dedicated columns store explicit key. but don't explain how use explicit key. @mapkey(columns = {@column(name = "mapkeycolumn")} , targetelement =

eclipse - Android AVD Custom Resolutions Not Starting -

i running eclipse java developers (32-bit) in windows 7 64-bit (64-bit java ee did not want work). connected android adt plugin, , have created 7 emulators testing program in. have exact same default settings running android 2.2, differences being screen resolutions. 4 of them work (two built-in skins wvga800 , wbga864, , 2 custom resolutions 480x600 , 600x1024) , 3 not (1536x1152, 1920x1152 , 1920x1200). have tried starting them manually avd manager, , have tried starting them when running program eclipse. emulators start up, stay on black screen, never showing "android" text on startup screen. there no startup screen, black, , no matter how long let run, stays black , refuses anything. can't find anywhere possible cause of problem, , tried "adb kill-server, adb start-server" trick, no avail. thoughts?

c++ - FMOD playSound throws an error about invalid parameter -

i've tried building sort of audio manager after openal failed deliver on machines found out fmod. after few hours of changes in code nothing works. playsound call seems bugging. an invalid parameter passed function. this errorcheck output gives me. code...let's start: typedef std::map<std::string, fmod::sound*> soundpool; soundpool m_sounds; fmod::channel* m_soundchannels[max_sounds]; fmod::system* m_soundsystem; and then: fmod::system_create(&m_soundsystem); m_soundsystem->init(32, fmod_init_normal, null); for(int = 0; < max_sounds; i++) m_soundchannels[i] = 0; and later: void cresourcemanager::playsound(std::string filename, float volume) { for(int = 0; < max_sounds; i++) { if(m_soundchannels[i] == 0) { if(volume > 1.0f) volume = 1.0f; fmod_result result = m_soundsystem->playsound(fmod_channel_free, m_sounds[filename], false, &m_soundchannels[

vim - is there a way to see output of previous ":! g++ %" without rerunning? -

when coding, check code running :! g++ % . map command <f5> . takes while compile , want see errors without spending time recompiling. also, want compare new output previous one. is there way see previous output of :! ... ? provided have g++ configured makeprg , can use :copen reopen last list of errors :make command. set makeprg=g++\ % then, compile, use :make when compile completes, errors listed in quickfix window, can (assuming errorformat correctly configured) used jump lines on errors occur. works out of box c/c++. if dismiss quickfix window, retrieve last error list :copen review :help quickfix , :help makeprg full gory details on how works.

RegEx For Finding DOB In A String Of Six Contiguous Numbers (mmddyy) -

sorry in advance if repeat question. didn't see listed elsewhere. i'm trying find regex string recognize date of birth in format of mmddyy . far know though, regex doesn't know individual number sets begin/end if they're right next 1 another. is there simple way regex find (without requiring delimiters/spacing)? how like: ^([0-9]{2})([0-9]{2})([0-9]{2})$ the first group 2 digits month, next group 2 day, , last group year. if wanted smarter, make sure first group starts 0 or 1, , day should start 0, 1, 2 or 3. perhaps: ^([0-1][0-9])([0-3][\d])([\d]{2})$ you might not need use regex if don't want to. every single modern framework these days (python, .net, java, whatever) has libraries , methods parse dates in specified format. have added benefit of type checking , ability build native date object well. update: you use or verify day doesn't go on 31: ^([0-1][0-9])([0-2][\d]|[3][0-1])([\d]{2})$

custom post type - Flexslider Wordpress - Adding Captions and External Links to Featured Images -

so have been attempting integrate captions , links envato flexslider plugin found on @ nettuts. http://wp.tutsplus.com/tutorials/create-a-responsive-slider-plugin-with-flexslider/ adding caption area 'flexslider plug-in' not work. here envato-flexslider.php file magic happens. <?php /* plugin name: envato flexslider plugin uri: description: simple plugin integrates flexslider (http://flex.madebymufffin.com/) wordpress using custom post types! author: joe casabona version: 0.5 author uri: http://www.casabona.org */ /*some set-up*/ define('efs_path', wp_plugin_url . '/' . plugin_basename( dirname(__file__) ) . '/' ); define('efs_name', "envato flexslider"); define ("efs_version", "0.5"); /*files include*/ require_once('slider-img-type.php'); /*add javascript/css files!*/ wp_enqueue_script('flexslider', efs_path.'jquery.flexslider-min.js', array('jq

iphone - retrieve data from NSUserDefaults to TableView -

Image
i save values of 2 labels through nsuserdefaults : - (ibaction) savedata { // store data nsuserdefaults *defaults = [nsuserdefaults standarduserdefaults]; [defaults setobject:autore.text forkey:@"author"]; [defaults setobject:testo.text forkey:@"text"]; [defaults synchronize]; } then try tot retrieve values in tableview : // nsarray @synthesize dataarray; - (void)viewdidload { nsuserdefaults *prefs = [nsuserdefaults standarduserdefaults]; self.dataarray = [nsarray arraywithobjects:[prefs objectforkey:@"author"], [prefs objectforkey:@"text"],nil]; } - (nsinteger)numberofsectionsintableview:(uitableview *)tableview { // there 1 section. return 1; } - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { // return number of time zone names. return [dataarray count]; } - (uitableviewcell *)tableview:(uitableview *)tableview cellforr

infopath2010 - Missing data in Text box in a infopath 2010 form -

i have infopath 2010 form table , couple of text boxes , form configured submit email form in body of email. the form opened in browser , able add text , submit form , see email. form ( data ) in body of email has lost formatting , text field on form set width of 100% , 'multi line ' text , see data in text field see on email body chooped off. i having issues controlling format of form seen in browser , way shows on email body. any appreciated. sri i have had problem to. way got around creating view form , having exact same layout changing controlls calculated fields seems give values. thanks, jack

jquery - Storing and accessing user-specific data across multiple domains -

i've been developing userscript display sidebar on websites develop, tell things whether site meant aa, browser support etc etc. internal use only. limited using classic asp , jquery / javascript. my problems follows: there law coming in means best clients not know cookies being used script. the database team not happy creating new database (or extending main one) script. it has come attention maximum number of cookies per domain around 50 browsers; bearing in mind thinking of storing data on per-site, per-server or servers, take on 50 cookies script alone. i have heard there 'mini database' facilities in html 5 - of our websites on html 4 not option. if go down database route, not able use 1 single database - have 1 database per server. reckon syncing difficult, using 1 page sync servers using many iframes (i believe, although not 100% sure, if user navigates away page prematurely, iframes terminate request data may not updated - feel free correct me if i'

Make Button in Android to repeat process inside activity until counter reaches certain number -

i have button in main view checks if users answer correct. button checkbutton= (button) this.findviewbyid(r.id.checkbutton); checkbutton.setonclicklistener(new onclicklistener() { public void onclick(view v) { // action, setting text } }); if button pressed once checks if answer correct, , if button pressed second time want repeat activity e.g. present user question. onclicklistener inside oncreate method , question generated using switch , unique id (for game difficulty). what best way set repeat activity until it's been repeated 4 times. thanks switch (difficulty_level) { case difficulty_hard: // case difficulty_easy: // } to me, doesn't sound logic belonging in onclicklistener @ all. listener should register click , call function in activity "handlebuttonclicked" have access fields keep track of number of clicks question, if answer correct , appropiate action is. the fact onclickliste

iphone - objective c XMLWriter -

i wanting know how add text variable xml writer. this trying below nsstring *teststring = [[nsstring alloc] initwithstring:@"test test test"]; //allocate serializer id <xmlstreamwriter> xmlwriter = [[xmlwriter alloc] init]; //add root element [xmlwriter writestartelement:@"rows"]; [xmlwriter writestartelement:@"row"]; [xmlwriter writecharacters:@"request: %@ can go in here", teststring]; //this line here [xmlwriter writeendelement]; //close rows element [xmlwriter writeendelement]; so pretty how nslog.. know how can xmlwriter.. or if possible? otherwise guess other option create whole string outside of xmlwriter? think? try this: [xmlwriter writecharacters:[nsstring stringwithformat:@"request: %@ can go in here", teststring]]; //this line here

jquery comment form validation errorPlacement ajax return -

i having problem javascript plugins appear conflicting, slightly. if @ fiddle creating form, notice after input field created, deleted, alert messages start popping on next element (below placed). to clarify: if user has not entered information yet, alerts pop in correct position (floated right side of input field in red text). however, if user has inputted name, deletes name, ajax alert ("this field required") pops in wrong place in field below supposed to. problem appeared after included part of javascript (controls different menu on page): /* jquery content panel switcher js */ var jcps = {}; jcps.fader = function(speed, target, panel) { jcps.show(target, panel); if (panel == null) {panel = ''}; $('.switcher' + panel).click(function() { var _contentid = '#' + $(this).attr('id') + '-content'; var _content = $(_contentid).html(); if (speed == 0) { $(target).html(_content);

Readers & Writers Java Solution queries (conditional semaphore | Passing the Baton) -

i'm trying implement pseudo solution below in java part of assignment. pseudo readers preference program, reader process itself. there accompanying writer process, keep things spartan didn't bother pasting it. process reader[i=1 m] { while (true) { /* implementing <await (nw == 0) nr = nr+1;> */ p(e); if (nw > 0) {dr = dr+1; v(e); p(r);} nr = nr + 1; if (dr > 0) {dr = dr-1; v(r);} else v(e); read database; /* implementing <nr = nr-1;> */ p(e); nr = nr - 1; if (nr == 0 , dw > 0) {dw = dw-1; v(w);} else v(e); } } originally assumed line: /* implementing <await (nw == 0) nr = nr+1;> */ was kind of commenting on occurring, having re-read think it's supposed if statement control p(e) locking semaphore. below i've implemented in code based on above assumption. if (nw == 0) { nr = nr++; try { e.acquire();//p(e) } catch (interruptedexception e) { } }//end if the output r

php - Just installed the news extension and it crashed my Magento -

just installed extension , crashed magento site. i'm tried not working do? just open app->etc->modules-> , find .xml file installed. , open xml file , edit <active>true</active> <active>false</active> then clean cache var->cache hope recover problem. thanks

image - C# Bitmap object, color appearing as transparent -

i'm working on program in c# takes screenshots of potion of user's screen. pert works should, i've run 1 issue. there seems (at least) 1 pixel color appears transparent in output image. instance of color #0d0b0c (rgb 13, 11, 12) appears transparent in saved png. pixelformat set format32bppargb. if set format32bpprgb or format24bpprgb, same pixel color appears black in saved png. i have no idea causing this, thing i've been able "fix" clear graphics object color before doing copyfromscreen(). i'm loathe though few reasons. first, don't know if that's color has issue (what 16,777,216 colors there's quite few possibilities), , second, hate hack fixes, seems hack fix. can shed light on might causing issue? i've messed pixelformat on bitmap creation , copypixeloperation in copyfromscreen method, nothing seems work. fact clearing graphics object color "fixes" seems tell me transparency coming screen data itself, doesn't make

gwt - How meaningfull is Activity.mayStop()? -

i wondering if there non trivial use case com.google.gwt.activity.shared.activity#maystop method. the com.google.gwt.place.shared.placecontroller.delegate#confirm blocking one, cannot use different delegate , using callbacks. not know why implemented in blocking manner because gwt guys user interactions should handled asynchronously. the maystop method called. if activitymanager return same activity , ui not change. activity has check instance if user has unsaved changes , if place change whould result in discarding unsaved data. think check done more before calling placecontroller.goto(new place()) . what think? see http://code.google.com/p/google-web-toolkit/issues/detail?id=6228#c1 tl;dr: asynchronous handling opens door many edge cases, bugs, confusion, , differing needs/wishes how should work. the activity goto not 1 needs checks in maystop . in case is, if check before doing goto (and transit state maystop return null ), in case there activity unsa

iphone - Check for section index titles from table view cell -

i have subclassed uitableviewcell , need draw own disclosure indicator. position of disclosure indicator depends on whether or not table view has section index titles set (the "scroll bar", typically alphabet). does know of way check if table view shows section index titles cell? checking uitableviewcell subclass require big deal of coupling uitableview class, suggest take alternate route - add bool variable set in cellforrowatindexpath: function , call function on cell draw disclosure indicator according value of variable.

ios - AVCapture loses ability to set focus when using ZBar SDK -

this has been stumping me days... in app using avcapture take photo, using zbar sdk scan bar code. problem once load zbar after taking picture, lose ability auto focus when taking picture. if load zbar first, can adjust focus when taking picture, zbar loses ability focus! tried swapping out zbar shopsavvy code scanner sdk , im encountering same problem... here code using set camera turn on auto focus no error occurring, , unable focus! avcapturedevice *device = [[self videoinput] device]; if ([device isfocuspointofinterestsupported] && [device isfocusmodesupported:avcapturefocusmodecontinuousautofocus]) { nserror *error; if ([device lockforconfiguration:&error]) { [device setfocuspointofinterest:point]; [device setfocusmode:avcapturefocusmodecontinuousautofocus]; [device unlockforconfiguration]; } else { if ([[self delegate] respondstoselector:@selector(capturemanager:didfailwitherror:)]) { [[self delegate

c# - WinForms: Detect when cursor enters/leaves the form or its controls -

i need way of detecting when cursor enters or leaves form. form.mouseenter/mouseleave doesn't work when controls fill form, have subscribe mouseenter event of controls (e.g. panels on form). other way of tracking form cursor entry/exit globally? you can try : private void form3_load(object sender, eventargs e) { mousedetector m = new mousedetector(); m.mousemove += new mousedetector.mousemovedlg(m_mousemove); } void m_mousemove(object sender, point p) { point pt = this.pointtoclient(p); this.text = (this.clientsize.width >= pt.x && this.clientsize.height >= pt.y && pt.x > 0 && pt.y > 0)?"in":"out"; } the mousedetector class : using system; using system.collections.generic; using system.linq; using system.text; using system.runtime.interopservices; using system.windows.forms; using system.drawing; class mousedetector { #region apis [dllimport("gdi32&quo

java - How can I use a HashMap as a way to access and copy items from a list? -

i working on videogame friend. account different types of items, had class each item extending item class. there wasn't data in these classes, looking alternative our workspace wasn't cluttered. started learning hashmaps, , thought awesome way add items. set instead of accessing items in hashmap int, make arraylist, access them strings. started adding functionality, creating anonymous items in item class, private static item coal = new item() { weight = .2; setimageid(0, 16); } and adding them hashmap. itemmap.put("coal", coal); after doing few of these, realized there 1 item of each type in list, , if ever wanted have multiples of items modified without modifying original, need make copies. started doing research on how that. use copy constructor, there many variables in item done efficiently. that, wondering if there simple solution. make of items final? i'm spitballing, because totally new area of programming. doing whole

php - Moving an uploaded file onto a remote server -

i trying move uploaded file onto remote server, isn't working; move_uploaded_file($tmp_name, "uploads/$code1/$code.$fileex"); $ftp_server = "ip"; $ftp_user_name = "username"; $ftp_user_pass = "password"; $file = $tmp_name; $remote_file = "/public_html/test/uploads/"; // set basic connection $conn_id = ftp_connect($ftp_server); // login username , password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // upload file if (ftp_put($conn_id, $remote_file, $file, ftp_ascii)) { echo "successfully uploaded $file\n"; } else { echo "there problem while uploading $file\n"; } // close connection ftp_close($conn_id); i erorr; warning: ftp_put() [function.ftp-put]: can't open file: directory in /home/file/public_html/uploaded.php on line 52 your $remote_file variable pointing directory when should point file. try changing $remote_file $remote_file = "/public_html/test

api - freebase getting plain names of types and sorting by commonality -

i'd able list of types common name freebase id { "id": "/m/02mjmr", #obama "type":[] }​ how can return names of types instead of ids? above returns 0: "/common/topic"xp 1: "/people/person"xp 2: "/user/robert/default_domain/presidential_candidate"xp 3: "/book/author"xp 4: "/award/award_winner"xp 5: "/book/book_subject"xp 6: "/user/robert/x2008_presidential_election/candidate"xp 7: "/government/politician"xp 8: "/organization/organization_member"xp 9: "/user/robert/default_domain/my_favorite_things"xp and lastly, how sort them count? or notability possibly? ie, president nobel prize winner author person etc? possibly similar notable types api, looks it's going away? http://wiki.freebase.com/wiki/notable_types_api you can names , instance counts { "id": "/m/02mjmr", "type": [{

Git Cherry-Pick -

i'm newbie git, , understand how git cherry-pick works, here problem: recently, in team, changed directory structure in master, not directory structure in branch. now, when make changes code in branch, want bring them (cherry-pick) master. fine until directory structures in both master , branch same. topdir/some/subdir/file -- master topdir/some/other/subdir/file -- branch file, changes brought master same, not directory structure contained in. when try cherry-pick usual way, error along lines of: git checkout master git cherry-pick commit error: pathspec topdir/some/other/subdir/file not exist now, best way go cherry-picking in scenario? pointers highly appreciated. ok. noticed that, in same scenario, when cherry-pick, git smart enough pick 1 of files correctly commit, not recognize other. to use same example mentioned in original post: in same commit, topdir/some/subdir/file1, topdir/some/subdir1/file2. i go master, has "file1" , "file2&q

windows phone 7 - How do I create a dynamic page based on a selection? -

i trying dynamically fill second panorama page based on item selected home application screen. on application's first start screen there listbox if items each text. if user taps on item text "foobar" template page should load , title of template page should set "foobar" , second panorama page should know it's data should related "foobar". is there anyway this? i have mainpage navigate new page (dynamicpage.xaml). navigation triggered when listbox_selectionchanged event occurs. have title text of dynampicpage.xaml binding titletext variable located in mainpage.xaml.cs. however, when title of dynamicpage.xaml ever set initialization value titletext variable though updating variable right before navigate page. if can provide grateful beginner on wp7 platform. thanks! the binding you're using title going update if titletext property dependency property or if mainpage implementing inotifypropertychanged interface class can notif

How do you set a cookie in a Facebook Tab or Canvas App? -

i know firefox , chrome handle , using p3p header ie allow setting cookies server side. want know if there anyway set cookie in facebook app work in safari if user has never visited site? i need able set cookie session management know whether users authenticated or have data in session. works in browsers except safari when user has never visited site because of safari's "third party cookie" policy. i thought work because facebook renders iframe post app appears not app not set cookie in safari. i hoping others have run problem , can me out. thanks.

javascript - Google Analytics: How to track pages in a single page application? -

currently in website , used html5's pushstate() , popstate in links increase speed. however, doesn't change real url , looks affect , mess google analytics 's code. (doesn't show url change) there possible solution this? thanks, if using newer analytics.js api, google's documentation requires following code trigger event: ga('send', 'pageview', '/some-page'); if using older ga.js api, david walsh suggests ajax websites use _gaq.push method: _gaq.push(['_trackpageview', '/some-page']);

iphone - Displaying new data under selected row in a table view -

i have table view on screen has 5 rows when view opened. when select row, new rows added below selected row (new rows = array count other view). when select row again, has display 5 rows again. in table view when select row rows added based on array count. again click same row has display 5 rows again. how can that? - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { return currentrows; } if(selectedindex == 0) { (int j=1;j<=[passionarray count];j++) { currentrows = currentrows + 1; nslog(@"numberofrowsatindex %d",currentrows); nsindexpath *indexpath1 = [nsindexpath indexpathforrow:j insection:0]; [tableview insertrowsatindexpaths:[nsarray arraywithobjects:indexpath1, nil] withrowanimation:uitableviewrowanimationfade]; selected=yes; } are reloading table , forcing go through data source again refresh actual view? may elsewhere in code

drop down menu - Rails 3 dropdown select boxes? -

i working on simple intranet application made rails 3.1. i have model links has following fields: name:string url:string colour:string i have put colour attribute class in view, so: <a href="linkaddress" class="<%= link.colour %>">link name</a> at moment in new link form have simple form input in user can type , become href class expected. what create dropdown list of preset options, these options red, green , blue (as example). seems simple, don't think there need helper. i have read few other questions , answers on , seem show examples have name followed id number. want have code below: <select name="colour"> <option value="red">red</option> <option value="green">green</option> <option value="blue">blue</option> </select> i'm sure simple can't head around it. i've read rails api info , select_for_tag has confused me!

asp.net - Change the color of a row in Gridview when Checkbox is checked -

i have datagridview template field of checkboxes each row in asp.net app. running code in pageload event. when person checks box on row, rows backcolor or forecolor should highlighted yellow, it's not working. here code: foreach (gridviewrow row in gvsummary.rows) { checkbox cb = (checkbox)row.findcontrol("chkitemselector"); if (cb != null && cb.checked) { row.backcolor = color.yellow; } } how can make work? if want in client side , there no need page_load event . instead should use javascript or better suggestion jquery look @ these : checkbox selector in jquery jquery highlight row checkbox click jquery highlight table row if checkbox checked

2d - How do I make character movement smooth in Java? -

i creating 2d rpg game in java , wondering how character movement can made smooth , not pixel pixel. i have animation thread runs every 20 mills , thats when draws everything. the simplest way of doing this, if you're saying movement calculated x = x + dx make x have higher resolution x axis of display. if x axis 640 pixels, make x have range 0 -> 5120 (640*8) example . when rendering downscale fit screen (add 4 , bit shift). that way can simulate having character move sub-pixel amounts per frame, results in smoother movement.

asp.net - How do I know if a tab is selected? -

Image
i trying report based on different information located in tabs. how know if tab selected? looked like: if(colorlisttab.isselected) { } but no luck! can guys me out this? you use activetab property, example(in activetabchanged ): if(tabcontainer1.activetab.equals(colorlisttab)){ } or use activetabindex : if(tabcontainer1.activetabindex == 1){ //second tab } http://www.dotnetcurry.com/showarticle.aspx?id=178

cmake - Qt program does not link, no moc file generated -

i'm using qt, cmake, , vs2010 compiler. there seems problem when i'm linking small piece of test code. linkers gives following error: plotter.cpp.obj : error lnk2001: unresolved external symbol "public: virtual str uct qmetaobject const * __thiscall plotter::metaobject(void)const " (?metaobject @plotter@@ubepbuqmetaobject@@xz)... (it goes on while) the error occurs when i'm trying inherit qobject in following code: class plotter : public qobject { q_object public: if leave out q_object, program links, can't use class slots @ runtime. noticed no moc file generated plotter.h. cmakelists.txt: cmake_minimum_required (version 2.6) project (ms) set(cmake_build_type "release") find_package(qt4) include(${qt_use_file}) add_definitions(${qt_definitions}) link_libraries( ${qt_libraries} ) set(all_sources plotter.cpp main.cpp dialog.cpp) qt4_automoc(${all_sources}) add_executable(ms ${

objective c - UIActivityIndicator and GCD/Threading -

i fetching list of photos server , displaying them. i'm using gcd thread server calls. got working, want add in uiactivityindicator each uiimageview show doing , appear. i'm not sure best method be. code: uiscrollview *myscrollview = [[uiscrollview alloc] initwithframe:cgrectmake(0, 0, [[uiscreen mainscreen] bounds].size.width, photoview.frame.size.height)]; myscrollview.backgroundcolor = [uicolor whitecolor]; myscrollview.pagingenabled = true; myscrollview.scrollenabled = true; myscrollview.frame = cgrectmake(myscrollview.frame.origin.x, myscrollview.frame.origin.y, (6 * thumbnail_size) + (photo_viewer_offset_colum_1 * 2), myscrollview.frame.size.height); //get list of photos (int = 0; < 6; i++) { dispatch_queue_t queue = dispatch_get_global_queue(dispatch_queue_priority_default, 0); dispatch_async(queue, ^{ nslog(@"async thread %@", [nsthread currentthread]); //retrievethumbnailedgeotaggedphotowithphotoid make server call

vim scripting "i want replacement for tnext in cscope" -

i want replace :tnext command cscope not working expectation. 1) below figure shows code working expected. can reach 2nd instance of symbols. function mycounter() if !exists("s:counter") let s:counter = 1 echo "script executed first time" else let s:counter = s:counter + 1 echo "script executed " . s:counter . " times now" endif endfunction nmap <space>w :ls<cr> nmap <space>i :call mycounter() nmap <space>n :cs find s <c-r>=expand("<cword>")<cr><cr>2<cr> 2) below code not working function mycounter() if !exists("s:counter") let s:counter = 1 echo "script executed first time" else let s:counter = s:counter + 1 echo "script executed " . s:counter . " times now" endif endfunction nmap <space>w :ls<cr> nmap <space>i :call mycount

iphone - UITextField inputview to pop up UIPickerView displaying question mark in pickerview -

here .h file when run code , select text field, pickerview pop's question marks in when select question mark correct values in text field #import <uikit/uikit.h> #import "scrollableviewcontroller.h" #import "mibackgroundtapdelegate.h" //@interface activapc1 : uiviewcontroller { @interface activapc1 : scrollableviewcontroller <mibackgroundtapdelegate, uipickerviewdelegate, uipickerviewdatasource>{ uitextfield *amplitude1; uitextfield *rate1; uitextfield *pulse_width1; uitextfield *impedance1; iboutlet uitextfield *configuration; nsarray *mode; } @property (nonatomic, retain) iboutlet uitextfield *amplitude1; @property (nonatomic, retain) iboutlet uitextfield *rate1; @property (nonatomic, retain) iboutlet uitextfield *pulse_width1; @property (nonatomic, retain) iboutlet uitextfield *impedance1; -(ibaction)next; -(ibaction)skip; -(ibaction)home; -(ibaction)select; -(ibaction)textfielddoneediting:(id) sender; @end here .m file

Should Process.fork affect file io in Ruby? -

i have been using process.fork within observable object, have found interfering output observer object's file output. when comment out process lines, file output contains 16 lines each in order numbered 0-15. however, when uncommented file contains 136 lines of unordered numbers between 0-15. whether process commented out or not, correct numbers printed screen. is behaviour partially expected, or bug? has got ideas how around this? the code below reproduces problem , created stripping original code until there enough demonstrate issue. original reason using process.fork create several processes speed processing. require 'observer' class recorder def initialize(notifier, filename) notifier.add_observer(self) @save_file = file.open(filename, 'w') @i = 0 end def update puts @i @save_file.puts @i @i += 1 end def stop @save_file.close end end class notifier include observable def run 16.times

php - Stream protected media (located outside of httpdocs) with jPlayer -

i have uploaded sample mp3 files directory outside of httpdocs, have ensured accessible php configuring open_basedir correctly , tested directory working. what stream these files via php file non-authenticated users should never have access these files. using jplayer , expect setmedia function should similar this: $("#jquery_jplayer").jplayer("setmedia", { mp3: "stream.php?track=" + id + ".mp3" }); i have tried setting content headers etc in stream.php , looks this: $filepath = "../song_files/mp3/"; $filename = "$_get[track].mp3"; header("content-type: audio/mpeg"); header('content-disposition: attachment; filename="'.$filename.'"'); getfile($filepath + $filename); if load page directly, mp3 file downloads , plays fine, when use above javascript, jplayer doesn't play track. i have had @ post ( streaming mp3 on stdout jplayer using php ) , appears user trying achieve wa

configuration - Visual C++ 2010 Express Service Pack Compiler Update Fails (v7.1 w/ SP1) -

ok, first i'm going give little background little conundrum. lately i've been trying vc++ 2010 express target x64 platforms (it doesn't ship x64 compilers). i've follow sorts of recommendations , setup methods can't seem work. learned sp1 update windows 7.1 sdk (you know, 1 supposedly has compilers need) erases x64 compilers. so, got kb compiler fix microsoft site , tried install , keep getting installation error: -summarized error (collapsed). cleanupblock (removeproduct) failed on product (microsoft visual c++ compilers 2010 standard - enu - x86). msi log: visual c++ 2010 sp1 compiler update windows sdk v7.1_20120310_152656264-{2f8b731a-5f2d-3ea8-8b25-c3e5e43f4bdb}-removeproduct.txt final result: installation failed error code: (0x80070643), fatal error during installation. -error log (expanded). action: downloading items action complete action: performing actions on items entering function: ironspigot::basemspinstaller::performaction ent

Using a set of Mysql results as a comparison in PHP -

this question quite simple i'm not sure of terms involved answer myself. have mysql database containing of product information. make image appear on product pages products have attribute. have created sql query outputs list of product_ids products image show on. however, not know how use set of results in page itself. i have: $cupwinnerids = mysql_query("select product_id `jos_vm_product_type_1` jos_vm_product_type_1.cup_winner ='cup winners';"); while($row = mysql_fetch_array($cupwinnerids)) { echo $row['product_id'] . ","; } this outputs correct ids comma in between them. wrap whole thing $listofids = (...) , can use in product page php file: if $product_id in $listofids ... if not ... having problem understanding how use selection of ids. if try output list directly "array". appreciated. the problem may trying display array using echo, while should use print_r. in case this: $listofids = array(); $cup