Posts

Showing posts from January, 2011

sql server - php to call MSSQL query and compare two dates? -

sql server - php to call MSSQL query and compare two dates? - ahoy there all, bit stuck , need help. i calling external mssql (not mysql) database linux server , display results after today's date. here code: $today = date("y-m-d");// current date $date = strtotime(date("y-m-d", strtotime($today))); $todaysdate = date( 'm j y g:i:s:000a', $date ); //converts mssql standards $query = "select dateofarrival atable dateofarrival > '". $todaysdate ."'"; when run query, displays results, doesn't give flying hoot where. i guessing because comparing date string? not sure on 1 though. any thoughts? give thanks in advance! update: here echoed query string. $query = "select dateofarrival atable dateofarrival > 'jan 10 2012 12:00:00:000am'"; date examples stored in db: feb 28 2004 12:00:00:000am oct 14 2009 12:00:00:000am may 18 2011 12:00:00:000am apr 10 2012 12:00:00:000am...

java - Tooltip in swing -

java - Tooltip in swing - i made tool tip comportment in swing using html tags _graph.settooltiptext("<html><div style=\"width: 300px; height: 100px;" + " overflow: auto; border: 0;<p style=\"padding:2 5 2 5;\"></div>please wait..."); here _graph object of component. problem is, if info exceeds need scroll not happening.please suggest me create scrollbar. default tooltips basic: lable-like component, limited text-only (except html). mentioned, way more fancy tooltips extend jtooltip , allow graph component homecoming custom tooltip in createtooltip. example , pitfalls discussed on @ otn java html swing scrollbar tooltip

java - Android Autocomplete TextView drop down width -

java - Android Autocomplete TextView drop down width - i want dropdown of auto finish textview cover entire screen width. normal behaviour of autocomplete textview such covers width of edittext (screenshot below). how do ? should default maps app in android. http://developer.android.com/reference/android/widget/autocompletetextview.html#attr_android:dropdownwidth by putting value -1 or fill_parent should work java android

php - Str_replace not removing tags in message string -

php - Str_replace not removing tags in message string - i echoing contents of table using foreach, problem getting date @ top of page, when looking @ 1 line preview date , nil more. if remove date fine , can see first line of template. trying remove date tag preview using each. using next code, doesnt seem doing lot, far can see have things right ?. echo '<div class="messagerow">'; // pulls message foreach above $emlmsg = $row->emailformmessage; // trying remove date replacing blank contents of string value. $dateremove = ''; // str_replace supposed remove {date} tag along paragraph tags wrapped in. $emlmsgfiltered = str_replace(array('<p>{date}</p>'), array($dateremove), $emlmsg); // echo filtered message here, minus date....but still there ?? echo $emlmsgfiltered; echo '</div>'; edit >>>>>> requested, html code <p>{date}</p> <p>dear {name} thanky...

android - How would i store a number/string into R.string.xx? -

android - How would i store a number/string into R.string.xx? - with code, programme forcefulness close(error) ***public view x = findviewbyid(r.string.nfoname);*** @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.information); //edittext ***final edittext infoname=(edittext)findviewbyid(r.id.infoname);*** //clear,confirm button clear = (button)findviewbyid(r.id.buttonclear); button confirm = (button)findviewbyid(r.id.buttonconfirm); //clear button clear.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { // todo auto-generated method stub infoname.settext(""); } }); //confirm button confirm.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { ***x=(view) infoname.gettext();*** } }); } the 1 * source of error program function: if user clicks confirm, name set r.string.nfoname use...

intergrating database for android app -

intergrating database for android app - is there way integrate mobile database app? if so, extremely hard? have not yet started on code, know how can done , measures encompasses such want integrate database android app. i following: user search restaurant nearby...they think know name of restaurant, begin typing letters. if type u, restaurants start "u" show up. 1 time find restaurant looking for, click on , information. can done? give thanks you. afaik, how works, company have database need give url takes search term parameter , returns either xml (or) json response. need invoke url appending search terms (entered user) help httpclient api android, homecoming corresponding results either xml (or) json. if json response can utilize android jsonobject api parse response. if xml response, need utilize sax/dom parsers. android database

ruby - trouble in passing select tag values in a rails application -

ruby - trouble in passing select tag values in a rails application - new on rails, having problem in passing select_tag value(in view file) controller. my view controller file like class projectstatuscontroller < applicationcontroller def index @projects = project.find(:all, :select => "name") end def show lookup = params[:project] @rows = project.find_by_lookup(lookup) end end and view file like <% form_tag("project_status", :controller => "projectstatus", :action => "show", :method=>'get' ) %> <%= select_tag 'project', options_from_collection_for_select(@projects,"id", "name"),:onchange => "this.form.submit();" %> <% end %> <% if !@rows.nil? @rows.each |row| end %> <%= row[:name] %> <% end %> what want accomplish - based on selected value select tag want display information(on same view page) of se...

c++ - Windows 8 / Metro Certification Requirements - How to check? -

c++ - Windows 8 / Metro Certification Requirements - How to check? - in order application certified windows 8, microsoft says need "only utilize apis metro style apps" (reference) is there tool can used check against existing c++ code find out if existing application in compliance? use windows app certification kit (wack), installed part of windows 8 developer preview. can find instructions using on msdn: "how test app windows app certification kit" if want test existing libraries, can create metro-style app references libraries , run wack on app. (note, if want test static library, need exercise plenty of functionality app of functions linked in.) c++ windows-8 windows-runtime microsoft-metro

No omnicompletion for python class members in vim? -

No omnicompletion for python class members in vim? - i want create tags (ctags 5.8) file classes in python.for functions, , class members defined outside class definition omnicompletion works ok. if define info fellow member in constructor ( self.x=2 ) cannot see ctags completion ? class a(object): def __init__(self): self.x = "whatever" # x not seen in ctags/omnicompletion!!! am doing sth wrong ? why there no omnicompletion (ctags file looks ok) ? if understood problem right, can add together attributes in class definition: class a(object): x = none def __init__(self): self.x = whatever this way reading code sees, attributes (you calling them "class members") class has. update: checked $ ctags --version exuberant ctags 5.9~svn20110310, copyright (c) 1996-2009 darren hiebert compiled: mar 18 2011, 10:38:14 the resulting tags file looks this: !_tag_file_format 2 /extended format...

android - After setting new language: TextToSpeech.onInitListener is called before new TextToSpeech(..) instance is returned -

android - After setting new language: TextToSpeech.onInitListener is called before new TextToSpeech(..) instance is returned - i ran unexpected problem oninit(..) new texttospeech instance on android. all code samples found assume new instance returned caller before ononit(..) called, homecoming value usable access new texttospeech instance. after changing default language phone activity restarted (as expected) , create new texttospeech instance usual. in case oninit(..) callback called before new texttospeech(..) returns instance. setup in oninit(..) uses outdated instance or null . public static void starttts() { tts_enabled = false; texttospeech = null; texttospeech = new texttospeech(starter/*context*/,new texttospeech.oninitlistener() { public void oninit(int status) { if(texttospeech==null) throw new runtimeexception("starttts.oninit: texttospeech=null"); boolean r = status==texttospeech.s...

powershell - New-PSSession in Job blocks Job -

powershell - New-PSSession in Job blocks Job - i need start pssession in job. can't utilize invoke-command -asjob due product architecure. i tried like: $block { "job started" $session = new-pssession -computername "host-name" "session started" } $job = start-job -scriptblock $block wait-job -job $job -timeout 10 | out-null receive-job -job $job (i don't have ps on scheme post question, create error in syntax, skip it, please) but, instead of creating remote session job became blocked forever on new-pssession line. wait-job exit timeout, , recieve-job homecoming "job started". i tried: i ensure remoting in main thread working well, , invoke-command -asjob working too. invoke-command , other pssession-based cmdlets have same behavior — blocks job execution. create pssession in main thread , transfer session object or object.id -inputarguments job result: pssession created in main thread can't us...

iphone - NSMutableString appendFormat... adds spaces? -

iphone - NSMutableString appendFormat... adds spaces? - when trying append nsmutablestring appendformat - adds spaces. nsm nsmutablestring, att_1_variable & att_2_variable nsstring [nsm appendformat:@"<tagname att_1=\" %@ \" att_2=\" %@ \">", att_1_variable, att_2_variable]; the result is: <tagname myattribute=" contentofvariable " title=" contentofvariable "> before passing in strings doing: nsstring* att_1_variable = [att_1_variable_orginal stringbytrimmingcharactersinset: [nscharacterset whitespaceandnewlinecharacterset]]; is there way around this? thanks regards christian you're adding spaces yourself, including them in format string. in c escape sequence quotation mark \" , no trailing (or leading) space. want: [nsm appendformat:@"<tagname myattribute=\"%@\" title=\"%@\">", att...

java - Uploading data from Android App to desktop program -

java - Uploading data from Android App to desktop program - i'm pretty new android apologies if i'm missing obvious solution, i'm developing android app used record various info including photographs , intention collected info uploaded desktop application desktop specific jobs carried out. due fact intend save photographs within app in sqlite database bytearray recorded info think info intensive send server, plus wouldn't want desktop app on server, should standalone. i'd prefer utilize usb connection , allow usb upload of info app sqlite db direct database on pc, sql server. best way approach this? android adb used acheive this? any help or suggestions on much appreciated. regards i believe sqllite database (as photos contained there) stored on sd card of device. have options here, first, when desktop applications find folder on device sd card (should mounted on filesystem after connecting device pc), sec utilize bluetooth , initialize...

jquery - Data Persistence with jqMobi -

jquery - Data Persistence with jqMobi - well, i've sorted through google search , i've sorted through stack overflow , of yet don't have thought of how this. i'd build programme iphone using jqmobi + css + html 5. i've worked jquery bunch, spent time jquery mobile , have done tons of css , html, (though little work html5). need able save lists user generates when open program. i'm having no problem dynamically generating , linking pages... when open programme sec time of pages (ie items) i've generated disappear. understand because weren't written in part of base of operations program. occurs me way around save lists file or db , load them when programme starts up. i've seen documentation using titanium studio, (it supports sql lite) generation of pages , general ui suck. additionally getting emulator run code has given me lot of trouble. @ to the lowest degree can using appmobi's app test gives decent emulator work befor...

How to get Cell's currently using frequency GSM/CDMA (Android) -

How to get Cell's currently using frequency GSM/CDMA (Android) - is there android class/ api can current radio frequency of cell whether gsm orcdma. guidelines. thanks i not sure it, check telephonymanager may find solution frequecny. android frequency

c# - LINQ to XML Append Data throws null reference exception -

c# - LINQ to XML Append Data throws null reference exception - here's problem have xml file trying append info to. using linq xml , code using follows: public void appendsalesxmldata(company company) { string filename = "testsales"; string orgid = company.orgid.tostring(); string saleid = company.orgsales[company.orgsales.count - 1].saleid.tostring(); if (!file.exists(string.format(@"c:\data-source\trunk\applications\vintagesiteinspector\xml\{0}.xml", filename))) { createxmlfile(filename); } xdocument thisdoc = xdocument.load(string.format(@"c:\data-source\trunk\applications\vintagesiteinspector\xml\{0}.xml", filename)); <!------- next line throws exception every time. -----> thisdoc.element(filename).add(new xelement("sale")); thisdoc.save(string.format(@"c:\data-source\trunk\applications\vintagesiteinspector\xml\{0...

Vim: is there a command to switch windows -

Vim: is there a command to switch windows - i need : command switch windows because i'm using in function. <c-w>w won't do. using: wincmd k i got needed vim

haskell - catching errors during string parsing -

haskell - catching errors during string parsing - i want parse string int , utilize this: string2int :: string -> int string2int str = read str::int now want grab paring exception/error possible. tried: import qualified control.exception e eval <- seek (print (string2int "a")) :: io (either e.someexception ()) case eval of left e -> { putstrln "exception"; } right n -> { putstrln "good"; } but compiler says couldn't match expected type 'e.someexception()' actual type e.ioexception . what doing wrong? ok don't know how utilize problem: want somthing this: loadfunction = { x <- string2int getline if( failed parsing int ) phone call somefunction y <- string2int getline if( failed parsing int ) phone call somefunction otherfunction x y } i dont know how using answers... you're using try imported old exceptions mechanism, trying utilize result type if u...

cocoa touch - Wifi sync with core data library style -

cocoa touch - Wifi sync with core data library style - i'm new @ wifi sync, start on how wifi sync core info library between iphone , mac apps ? require merge sync, no overwrite. there several similar questions , nice answers them: take @ these : how sync iphone core info web server, , force other devices? core info syncing core data: possible build desktop app create info model iphone app core data? also take on these: http://iphone2009.crowdvine.com/talk/presentation_file/5104/grover_syncing.pdf http://publications.csail.mit.edu/tmp/mit-csail-tr-2005-014.pdf cocoa-touch cocoa core-data synchronization

c# - How to set focus back to form after opening up a process (Notepad)? -

c# - How to set focus back to form after opening up a process (Notepad)? - i open notepad programme using process.start() new opened notepad covers screen. want application maintain focus. i (using same process.start) open ms excel , word focus form need write is: this.focus(); but quirk notepad: open notepad (and other processes this) process process = new process(); process.startinfo.useshellexecute = true; process.enableraisingevents = true; process.startinfo.filename = @"abc.log"; process.start(); now notepad takes focus. i tried these: this.activate() , this.focus() , needless mention [dllimport("user32.dll", charset=charset.auto, exactspelling=true)] public static extern intptr setfocus(handleref hwnd); { intptr hwnd = myprocess.handle; setfocus(new handleref(null, hwnd)); } [dllimport("user32")] private static extern int setforegroundwindow(intptr hwnd); [dllimportattribute("user32.dll")] private st...

c++ - how to access map of vectors? -

c++ - how to access map of vectors? - i have created map of vectors , populated follows. here code. not able post original code. contains vectors of doubles map <int, vector <double> > maptest; (int = 0 ; < id1; i++) { (int j = 0 ; j < id2; j++) { maptest[i].push_back(j*0.01); } } map <int, vector <double> >::iterator maptestitr; cstring teststring; ( j = 0 ; j < id2; j++) { (i = 0 ; < id1; i++) { maptestitr = maptest.find(i); if (maptestitr != maptest.end()) { teststring.format(_t("%f",maptestitr->second.at(j))); } myfile << teststring<< ',' ; } } but values updated '0' (teststring '0'). in ide, values correctly shown in watch. what missing here? std::vector::at() expects integer parameter. specifically, size_t . i don't know type id2 is, code gave doesn't appear size_t . c++ st...

c# - How to create a txt file on a dynamically chosen folder -

c# - How to create a txt file on a dynamically chosen folder - hello, reading question. have string need set on txt file. i want create when user clicks button asks folder, user wants save txt file, , generate on in folder. here code made not know how create user chooses folder. private void generar_txt_disco(string s_content, string s_folder) { //ruta es donde se va guardar streamwriter sr = new streamwriter(s_folder); //vas escribiendo el texto sr.writeline(s_content); //lo cierras sr.close(); } description use savefiledialog or folderbrowserdialog that. (member of system.windows.forms ) savefiledialog prompts user select location saving file. class cannot inherited. folderbrowserdialog prompts user select folder. class cannot inherited. sample folderbrowserdialog private static void generar_txt_disco(string s_content) { using (folderbrowserdialog dialog = new folderbrowse...

matrix - OpenGL Camera rotation flickering -

matrix - OpenGL Camera rotation flickering - since time, stucked photographic camera rotation problem in opengl. i seek rotate photographic camera via mouse movement, photographic camera flickering (the object spoted photographic camera flickering). i initialize photographic camera follows: camera::camera(float x, float y, float z) { memset(transform, 0, 16*sizeof(float)); transform[0] = 1.0f; transform[5] = 1.0f; transform[10] = 1.0f; transform[15] = 1.0f; transform[12] = x; transform[13] = y; transform[14] = z; left=&transform[0]; up=&transform[4]; forward=&transform[8]; position=&transform[12]; old_x = 0; old_y = 0; } here transform transformation matrix. since opengl column major, should right? the next part explains, happening before drawing frame. at first, refresh photographic camera mouse movement, depending on delta x , y of lastly mousepointer position, motion value can positiv or ne...

aop - Where can I find the most updated version of Castle DynamicProxy for .NET 2.0? -

aop - Where can I find the most updated version of Castle DynamicProxy for .NET 2.0? - i'm stuck visual studio 2005 solution; there still way aop in .net 2.0 nowadays? can't find on google. you should able download them straight sourceforge: castle project - browse/dynamicproxy .net-2.0 aop castle-dynamicproxy

iphone - iOS 5 - how to programatically normalize a PCM audio sample? -

iphone - iOS 5 - how to programatically normalize a PCM audio sample? - i recording 16bit linear pcm file using avaudiorecorder , saving caf file. now want normalize sound recorded. cannot find library, either apple or 3rd party, lets me iphone! peak normalization takes general form, you'll have few conversions, optimizations, , error checking add together 16 bit signal: double* const buffer(...); const size_t length(...); double max(0); // find peak (size_t idx(0); idx < length; ++idx) max = std::max(max, buffer[idx]); // process double mul(1.0/max); (size_t idx(0); idx < length; ++idx) buffer[idx] *= mul; iphone ios audio normalization

jsf 2 - f:param not working when used with trinidad 2 -

jsf 2 - f:param not working when used with trinidad 2 - i using jsf 2 trinidad 2(myfaces) , trying utilize f:param in command button <tr:commandbutton text="submit" action={backingbean.actionsubmit}> <f:param name="issubmit" value="yes" /> </tr:commandbutton> basically trying pass param value submit button , perform validation if submit button clicked adding status required attribute input elements check submit button. is there way identify particular button click in jsf2/trinidad2 can check button click in validation method. i using jsf 1.2 think works in jsf 2.0 same way. for commandbutton utilize actionlistener instead of action. <tr:commandbutton text="submit" actionlistener={backingbean.actionsubmit}> within bean can id of button: public void actionsubmit(actionevent event) { event.getcomponent().getid(); } jsf-2 trinidad

javascript - library to output X509 Certificates in java the way openssl does -

javascript - library to output X509 Certificates in java the way openssl does - does know of library outputs x509 certificate way openssl -text ? people used output format, , java x509 tostring() method not nice job of it. meant equivalent of this: $ openssl pkcs12 -clcerts -nokeys -in ~/downloads/mail/webid.fcns.eu.p12 | openssl x509 -noout -text come in import password: mac verified ok certificate: data: version: 3 (0x2) serial number: f5:8a:b2:d1:76:06:14:38 signature algorithm: sha1withrsaencryption issuer: c=fr, st=essonne, o=webid.fcns.eu, cn=webid.fcns.eu/emailaddress=webid@fcns.eu validity not before: jan 19 02:49:27 2012 gmt not after : jan 18 02:49:27 2013 gmt subject: c=fr, cn=rszeno/emailaddress=ruset.zeno@gmail.com subject public key info: public key algorithm: rsaencryption public-key: (2048 bit) modulus: ...

creating a jquery plugin that does not break the chain -

creating a jquery plugin that does not break the chain - i wrote function save headaches when move css around(it converts css strings objects). able utilize drop in .css() function. jquery.fn.ccss = function(css) { homecoming this.each(function(){ var css_obj = {}; var tmx = ""; ocss = css.split(";"); $.each(ocss, function (index, elem){ tmx = elem.trim().split(':'); if (tmx[0].length > 0) css_obj[tmx[0]] = tmx[1].trim(); }); homecoming $(this).css(css_obj); //return $; }); }; })(jquery); my problem when utilize in "fluent" notation null error. uncaught typeerror: cannot phone call method 'addclass' of null i'm bit confused has returned in order not "break chain" you may want line number error is. don't think has function. function worked me. http://jsfiddle.net/r8utv/ << demo especially since addclass ...

iphone - How to make webview transparent? -

iphone - How to make webview transparent? - this question has reply here: how create transparent uiwebview 6 answers i want create webview transparent , show info on background showing images of parent view. can please allow me know how this? uiwebview subclass of uiview , means can set backgroundcolor property transparent uicolor : mywebview.backgroundcolor = [uicolor clearcolor]; iphone cocoa-touch webview

mysql - Design Opinions Needed: Template Databases/Tables for users -

mysql - Design Opinions Needed: Template Databases/Tables for users - i need professional programmers/dbas bounce thought off of , know if would/could work. please read below , give me info may break theory. thanks. overview of website idea: website used sports card collectors chat, reply questions on forums, showcase cards/box breaks, trade/sell to/with other users, , maintain collection of cards. design issue: user can have unlimited number of cards. create big tables. design question: not want limit users on how many cards can have in collection on site. if have 5 copies of 1 card, , rather have 5 records, 1 each card, prerogative. may necessary each of cards may in different condition. however, allowing happen, means having 1 table store records users not close option. know sports card collectors on 1,000,000 cards. i thinking either creating table or database each user, allow faster queries. databases on same server (i don't know host yet, in desig...

iphone - Get AVPlayer that is current playing the audio -

iphone - Get AVPlayer that is current playing the audio - i using avplayer , , user able leave screen controlling audio, come same sound playing. have accomplished this, can't seem regain command of avplayer playing audio. there phone call allows me avplayer running? i'm answering own question because may helpful someone... i created global avplayer making property of appdelegate , initializing there. created instance of appdelegate in viewcontroller , , accessed global avplayer there. leave screen , come in app, , still had command of avplayer . iphone ios avplayer

c++ - File Compiles Fine in One Project But Not in Another -

c++ - File Compiles Fine in One Project But Not in Another - i have big class classa defined in code::blocks project projecta. projecta compiles fine, when seek utilize classa in different project projectb, start getting errors like c:\projecta\classa.cpp|17|error: boost/foreach.hpp: no such file or directory| c:\projecta\classa.cpp|649|error: 'strlen' not declared in scope| also 1 of these every function in cstring c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\include\c++\cstring|76|error: '::memchr' has not been declared| i added both classa.h , classa.cpp projectb , added folder projecta directories searched in projectb. i saw this question addressing similar error, don't utilize c, weird projects start trying compile in c. however, don't want dismiss possibility, know how check whether project compiling in c or c++ in code::blocks. using files multiple projects has been working me until today, i'm @ total l...

winforms - C# smtp configuration in system.net.mail -

winforms - C# smtp configuration in system.net.mail - i have little winforms application sends notification emails. works fine outlook clients bombs if gmail/yahoo/windowslive address entered. i've seen many posts using system.web.mail , schemas visual studio 2010 gives me error when trying utilize (i'm assuming because of .net 2.0). possible configure smtp client code relay of these email providers? im using system.net.mail mailmessage. configuration code below... smtpclient mailsender = new smtpclient("smtp.myclient.com"); mailsender.enablessl = true; mailsender.send(message); it works fine outlook clients because workstation (likely) logged active directory domain , exchange server "trusts" connection because of it. you need add together user's credentials on mail service service, , you'll have them user: mailsender.credentials = new networkcredential(username, password); also, don't forge...

How to instantiate a class in Objective-C that don't inherit from NSObject -

How to instantiate a class in Objective-C that don't inherit from NSObject - given this: person.h: @interface person { } - (void) sayhello; @end person.m: #import "person.h" @implementation person - (void)sayhello { printf("%s", "steve"); } @end how instantiate person? tried this: person *p = [person new]; that doesn't work, nor this: person *p = [person alloc]; [update] i forgot tell, tried inheriting nsobject, new , alloc works. i'm curious if can instantiate class doesn't inherit nsobject? you absolutely can so. class needs implement +alloc itself, way nsobject does. @ base, means using malloc() grab chunk of memory big plenty fit construction defining instance of class. reference-counted memory management nice ( retain / release ); part of nsobject protocol. can adopt protocol , implement these methods too. for reference, can @ the object class, root objc class nsobject , ap...

visual studio 2010 - Add DataGridView using Telerik DOCK Libraries -

visual studio 2010 - Add DataGridView using Telerik DOCK Libraries - raddock raddock1 = new raddock(); raddock1.dock = dockstyle.fill; this.controls.add(raddock1); toolwindow window1 = new toolwindow(); window1.name = "window1"; raddock1.dockwindow(window1, dockposition.left); documentwindow document1 = new documentwindow(); document1.name = "document1"; raddock1.adddocument(document1); i using radcontrols winforms, u can find in provided link: http://www.telerik.com/help/winforms/overview.html in document1 , want dynamically add together datagridview default provided vs2010. how can this. to add together grid need this: datagridview datagridview1 = new datagridview(); document1.controls.add(datagridview1); however, grid empty. fill it, set datasource property. datagridview datagridview1 = new datagridview(); list<colors> colors = new list<colors>(); co...

Update an outdated branch against master in a Git repo -

Update an outdated branch against master in a Git repo - i have git repository has branch (local , remote) has become outdated. bring branch date master branch, don't know how this. there many merge conflicts. how can bring or update out-of-date branch same state master branch? update master branch, need regardless. then, 1 of: rebase old branch against master branch. solve merge conflicts during rebase, , result up-to-date branch merges cleanly against master. merge branch master, , resolve merge conflicts. merge master branch, , resolve merge conflicts. then, merging branch master should clean. none of these improve other, have different trade-off patterns. i utilize rebase approach, gives cleaner overall results later readers, in opinion, nil aside personal taste. to rebase , maintain branch would: git checkout <branch> && git rebase <target> in case, check out old branch, git rebase master to rebuilt against mas...

java - Unable to get properties from properties file? -

java - Unable to get properties from properties file? - i have written class fetchprop extends class propmap fetches values properties file.when run fetchprop junit test case giving me right output i.e fetches properties way want.then have created class createreport calls method of fetchprop helps in generation of report.but when run test case on createreport fetchprop not fetching properties used when run standalone? can 1 suggest may issue ps: have checked path properties file placed , displaying properties file path every time run programme , file has properties want get. it might depend on how fetch properties file. if using like: private properties readprops() throws filenotfoundexception, ioexception { file f = new file("c:\\path\\to\\file\\props.properties"); properties props = new properties(); props.load(new fileinputstream(f)); homecoming props; } ...then might work in unit tests not when running application. might want seek...

html - What specific things cause IE8 to trigger compatibility mode? -

html - What specific things cause IE8 to trigger compatibility mode? - i've got app under circumstances causes ie8 popup compatibility message , reload in compat mode: a problem displaying caused net explorer refresh webpage using compatibility view this rare, , not occur due meta-tags, far can tell. happens response user action alters dom. same problem as: http://superuser.com/questions/215281/how-do-i-stop-i-e-jumping-into-compatability-view, question is: types of things cause this, aid in fixing it. put way, see site thesitewizard.com, 3rd cause of compatibility mode in ie8 described as: and, on occasion, other unfathomable, undocumented reason, on pages validated standards-compliant (or, @ least, in release candidate 1). and question is: unfathomable, undocumented reasons? after long debugging session (using old school alerts pinpoint failing where), seemingly innocous line of dom manipulation culprit: document.getelementbyid("li...

sqlite - Java SE - Advice RE: storing configuration data -

sqlite - Java SE - Advice RE: storing configuration data - i'm writing java se 7 desktop application. need store info such configuration settings , 2 user accounts (an admin , everyone). simplest method seems writing text file don't see effective means protecting info , sensitive. i'm thinking sqlite best tool me wondering if might have suggestions smaller, more lightweight, simpler -- there isn't plenty info needs storing justify whole database seems. thanks! irongleet you can (and should) utilize preferences api that. on windows, write registry (so it's different each user). java sqlite configuration persistence

iphone - NSPredicate query -

iphone - NSPredicate query - i have used nspredicate before different purpose. stuck in next scenario query. i have array persons contains person objects i.e persons array of objects. need collect names_ person objects persons array. know can through loop can through nspredicate or more optimize way? nsmutablearray *names; (int i=0; i<[persons count]; i++) { [names addobject:[[persons objectatindex:i] names_]]; } this 1 line do, [personarray valueforkeypath:@"@unionofobjects.name"] iphone objective-c nspredicate

mysql - Insert a new column in SQL -

mysql - Insert a new column in SQL - i have db consisting of 4 fields.my application retrieve info db. have 1 primary key(the id).i want depending on id, provide other info organized in new table. better? create new table , search 1 time again it, or given fact have found row because of id, create new element table. illustration can create new element named info, , create array,as want 11 rows,and 2 columns info. sql code far this: create table people ( id int not null auto_increment primary key , name varchar( 100 ) not null , sex bool not null default '1', birthyear int not null ) what changes need make? table created. if each row in existing table needs associating 11x2 set of data, you're best off creating table. don't seek stuff 22 items of info single field, it's bad idea. if, however, it's always same (22 items), add together 22 fields. depends on how info going used, searched, joined on, etc. how depen...

How often does JavaScript recompile regex literals in functions? -

How often does JavaScript recompile regex literals in functions? - given function: function dothing(values,things){ var thatregex = /^http:\/\//i; // created 1 time or on every execution? if (values.match(thatregex)) homecoming values; homecoming things; } how javascript engine have create regex? 1 time per execution or 1 time per page load/script parse? to prevent needless answers or comments, favor putting regex outside function, not inside. question behavior of language, because i'm not sure up, or if engine issue. edit: i reminded didn't mention going used in loop. apologies: var newlist = []; foreach(item1 in listofitems1){ foreach(item2 in listofitems2){ newlist.push(dothing(item1, item2)); } } so given it's going used many times in loop, makes sense define regex outside function, that's idea. also note script rather genericized purpose of examining behavior , cost of regex creation there 2 "regular expres...

entity framework - How to update complex model in ASP.NET MVC 3 -

entity framework - How to update complex model in ASP.NET MVC 3 - i trying update complex model in single view. using asp.net mvc3, entity framework code first, unit of work, generic repository pattern.. when seek update model, come error: a referential integrity constraint violation occurred: property values define referential constraints not consistent between principal , dependent objects in relationship. here simplified view model: public class transactionviewmodel { public transaction transaction { get; set; } public bool isusersubmitting { get; set; } public ienumerable<selectlistitem> contracttypes { get; set; } } here simplified complex model, , illustration 1 of navigation property. transaction has 1 1 relationship of navigation properties: public class transaction { [key] public int id { get; set; } public int currentstageid { get; set; } public int? bidid { get; set; } public int? evaluationid { get; set; } ...

iphone - Using dequeueReusableCellWithIdentifier causes images used as a repeating background to leak out of the cell -

iphone - Using dequeueReusableCellWithIdentifier causes images used as a repeating background to leak out of the cell - am trying utilize 3 images background cell. top image, middle (repeating image) , bottom image. if utilize dequeuereusablecellwithidentifier works fine, start scrolling table images don't remain within cell. see attached image. this troublesome code uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:@"cellidentifier"]; if (cell == nil) { cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstylevalue1 reuseidentifier:@"cellidentifier"]; } this works fine, assume memory hog. uitableviewcell *cell = [[uitableviewcell alloc] initwithframe:cgrectzero]; what best way have best of both worlds? i.e. working , not beingness memory intensive. update complete cell row @ index path function uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:@"cellidentifier"]; if (c...

How to Support Multiple Screens in Android without the need to Provide different bitmap drawables for different screen densities -

How to Support Multiple Screens in Android without the need to Provide different bitmap drawables for different screen densities - i need run application on multiple devices diffrent specs. i'm trying work on two: samsung galaxy tab p100 , galaxy tab 7.0 plus differnces i'm care dpi,the first device 240 dpi sec 170 , version first runs 2.2 later 3.2 first set images on hdpi folder images on 7.0 plus smaller , ugly copied them mdpi folder works fine double size of apk. is there way create android auto fit images without need re-create images? if want images fine in either device have provide same images mdpi , hpdi @ differente resolution (see alternative drawables). however if set images in mdpi directory only, android scale theme hpdi screens. remember have utilize dp , not px dimensions (see density independence). you can interested in how android pre-scale , auto-scale resources (see additional density considerations). if want forcefulness au...

css - What happened to `column-span: ` -

css - What happened to `column-span: <integer>` - searching functionality, came across 2001 draft, specified column-span defined none | | <integer> | inherit . don’t none (spans no columns? mean display:none ‽), other that, it’s nice. comes useful picture. code sth. along lines of: article { column-count: 3 } h1 { column-span: } h2 { column-span: 2 } a bit history: abolished in 2005. 2007, re-introduced values 1 | all , wich became none | all 2011 (reintroducting nonsensical none ). my question: why property badly curtailed? there reasoning behind that? (and behind none ) in current draft @ least, property name column-span means “spans several columns” , value none means “no” or “false.” in december 2009 draft, things more natural, property interpreted “number of columns spanned” , initial value 1 , not none . in general, identifiers in css misleading , may reflect various stages of planning—think white-space , affects line breaking in genera...

c - Intel based hardware speed ups for DCT? -

c - Intel based hardware speed ups for DCT? - we writing image processing algorithm targeting intel hardware. prefer generic c implementations, have identified algorithm @ core ton of discrete cosine transforms (dct's) works extremely well. unfortunately, our throughput requirements such generic c implementation 2 orders of magnitude slow. can 1 order of magnitude through other tricks, if can improve dct's order of magnitude have path towards success. is intel mmx way @ hardware acceleration these dct's? there other intel specific libraries and/or hardware can exploit speed these bad boys up? where start look? new job me, , first time digging hard intel hardware, pointers appreciated. take @ intel's integrated performance primitives library. contains wealth of routines optimized heavily take utilize of intel architecture, mmx , sse. among many other things, ipp contains routines dct (documentation here). c image-processing intel dct

actionscript 3 event.target -

actionscript 3 event.target - i have film clip named button1 , in film clip there dynamic text named txt public function mouse_down(event:mouseevent) { if(event.target==button1) { ...//this recognizes when click button without intersecting dynamic text area } if(event.target==button1||event.target==button1.txt) { ...//this works } i know why dosen't recognize clicks made in area contains dynamic click if don't specify it, because txt part of button1, need check if target button1 dosen't work:i have check if target button1.txt thanks help! event.target points object event originated from, if nested in object added listener to. utilize event.currenttarget instead. check out this blog post larn more. actionscript-3 events target movieclip

C# regex data from website -

C# regex data from website - i trying create addon game named tibia. on website tibia.com can search people , see deaths. forexample: http://www.tibia.com/community/?subtopic=characters&name=kixus now want read deaths info using regex in c# application. but cannot seem work out, i've been spending hours , hours on http://myregextester.com/index.php the look utilize : <tr bgcolor=(?:"#d4c0a1"|"#f1e0c6") ><td width="25%" valign="top" >(.*?)?#160;cet</td><td>((?:died|killed) @ level ([^ ]*)|and) (?:<[^>]*>)?([^<]*).</td></tr> but cannot create work. i want timestamp, creature / player level, , creature / player name thanks in advance. -regards it's bad thought utilize regular expressions parse html. they're poor tool job. if you're parsing html, utilize html parser. for .net, usual recommendation utilize html agility pack. c# r...

configuration - How to configure cpanel to notify you by email -

configuration - How to configure cpanel to notify you by email - how can configure cpanel in order notify me email each time after new business relationship created new domain? can alter log sends me? in server configuration , on "basic cpanel & whm setup" tab, have come in contact info (email address) case may happen in future. configuration cpanel

jasper reports - JasperReports: Items is pdf are printing on top of each other instead of beside each other -

jasper reports - JasperReports: Items is pdf are printing on top of each other instead of beside each other - i'm using jasperreports generate pdf files customers. reason items stacking on top of each other instead of printing beside supposed to. here design of report: any help appreciated. it sounds have "position type" set "fix relative top". alter "float". edit: received sample study showing same behavior. looks bug me. in case got desired output appending space. "jg" break 2 lines. "jg " rendered on single line. cannot explain this. it's bug. if hitting same behavior, appending space might solve well. jasper-reports ireport

mysql - Removing dependence on dynamic SQL through Ant scripting -

mysql - Removing dependence on dynamic SQL through Ant scripting - i've been given responsibility on number of stored procedures, take form: create procedure getfoos() begin set @v_sql := ''; set @v_sql := concat(@v_sql, 'select distinct ', getfoofields('f', 'b'), ' '); set @v_sql := concat(@v_sql, 'from foos f '); set @v_sql := concat(@v_sql, ' left bring together bars b on f.barid= b.barid'); set @v_sql := concat(@v_sql, 'where f.somedate null '); set @v_sql := concat(@v_sql, ' , b.someid in (1, 2, 3) '); set @v_sql := concat(@v_sql, ' , b.somebool = true '); set @v_sql := concat(@v_sql, 'order f.name '); prepare s1 @v_sql; execute s1; deallocate prepare s1; end; as can see, dynamic sql beingness used function getfoofields can inlined. function used build string of selected fields: create function getfoofields( ...

Setting default make options for Qt Creator? -

Setting default make options for Qt Creator? - how can override default create parameters , is: make -w each time create project , had modify project settings , adding -j4 create parameters. can set make -w -j4 default ? edit the best way setting makeflags environment variable , i'm picking reply best shut thread down. to set unix, modify *.desktop file of qt creator , prefix line entitled exec= env makeflags=-j4 , aware won't able cease building in qtcreator after setting multithread. in qtcreator go "projects tab" , set "make arguments" like: qt qt-creator qt4.7

javascript - Centering div using jQuery -

javascript - Centering div using jQuery - i have div $("#organizer_listings_container") centered using css margin: 0 auto; uses jquery increment width when user clicks on button. after resizing, i'm using next code center resized div $("#organizer_listings_container") . resizing code // center content when width changes if($("#organizer_listings_container").css("position") != 'absolute') { $("#organizer_listings_container").css("position","absolute"); var left = ( $(window).width() - $("#organizer_listings_container").width() ) / 2 + "px"; $("#organizer_listings_container").css('left', left); // set initial 'left' } left = ( $(window).width() - ( 852 ) ) / 2 + "px"; $("#organizer_listings_container").animate({'left': left}); // animate final 'left' problem: when add together new div (ma...

stream - Storing keys in servlets -

stream - Storing keys in servlets - my servlet generates pair of keys(public , private) when client makes request keys , sends public key client using objectoutputstream, working fine. the client encrypts info using public key , sends servlet again. 1 time again servlets executes origin , new set of keys generated don't want. i want able utilize old private key decrypt message? what should do? create keys 1 time when servlet created, not on every request. can create public , private key pair in servlet's init method , store in instance variable of servlet. there nice description here. servlets stream key

javascript - Close a customized box at ESC keypress with JQuery -

javascript - Close a customized box at ESC keypress with JQuery - i have next html code dialog box: <div id="modal-dialog" class="no-display"> <div class="form"> <div class="close"> </div> <div align="center"> <h2><u>form</u></h2> </div> <form> <label for="yourname">full name:</label><input type="text" name="yourname"> <label for="email">e-mail:</label><input type="text" name="email"> <label for="message">message:</label></textarea><textarea type="text" name="message"></textarea><br/> <div class="clear"></div> ...

mysql - SQL update on duplicate key update -

mysql - SQL update on duplicate key update - i have asked question grouping , update big database table, didn't reply this. i have table: name, date, detail, no , , name, date, detail pk. somehow need update detail , , possible there duplicate key. need sum no duplicate rows. on duplicate key update used insert . how address problem? first things first, multi-column primary key bad idea; you've found out, makes hard manipulate individual fields. ought add together autoincrement bigint column table, become new primary key, , three-column uniqueness constraint can unique index instead. should perform better... it'll allow sort of manipulation need, well. it'll allow perform modifications still allow identify original rows integer index. if that, "one-time update" can done safely, long don't mind creating temporary tables work with. this: create couple of temporary tables same schema, without unique three-column index - can have n...

html - Centering a css block -

html - Centering a css block - this block of css controls position of 3rd party images. generated on fly javascript slider. need center based on image else on page. know left , right dimensions of reference image. need figure out how center block on that. there way center between 200px , 800px? .pagination { display: block; margin:26px auto 0; width:400px; margin-left: auto; margin-right: auto; left: 130px; position:relative; text-align: center; } if know width 400px (as per snippet), do: .pagination { display: block; margin: 26px auto 0; width: 400px; } example @ http://jsfiddle.net/ne9jz/ html css

asp.net - Accessing MYSQL on network -

asp.net - Accessing MYSQL on network - i made programme using asp.net , uses mysql. can utilize using localhost run microsoft visual studio 2008. saves info on computer. want create network can utilize program, save info 1 database. wish explain better. can done using visual studio 2008? you should host programme on server on 1 machine , utilize access other machines. when open mysql database connection, connect 1 mysql server using ipaddress , not using localhost. asp.net mysql networking localhost

html - Changing the order of two DIVs with float - IE bug -

html - Changing the order of two DIVs with float - IE bug - i want alter order of 2 divs css-float. don't want to/i can't alter order in html, because it's external data. next html in firefox, produces contrarious output in ie: <div style="display:inline">berta</div> <div style="float:left; display:inline">albert</div> in firefox: albertberta in ie: bertaalbert question: there way firefox-output in ie? illustration -- in firefox, not in ie. anyway responses. first, utilize valid doctype. stick time , utilize <!doctype html> . , second, @rotora commented, float , inline not nice. let them become block elements display: block; (or maybe inline-block ) , alter floats. first 1 right , sec 1 left (or vice versa). works in ie. html css browser css-float

oracle - If statements in WHERE clause -

oracle - If statements in WHERE clause - is possible in oracle set conditional if statements in clause? i want filter rows end date before today. , if end date empty, should not filter on it. i've tried this: select discount_amount vw_ph_discount_data sysdate > start_date , if end_date not empty sysdate < end_date but "invalid relational operator". you can try: select discount_amount vw_ph_discount_data sysdate > start_date , sysdate < nvl(end_date,sysdate+1) oracle

c# - Deferred loading of object related data -

c# - Deferred loading of object related data - imagine there tree construction of data. load info upon programme start. each node in tree has several properties. want extend info each tree node plugin, maybe loaded, maybe not. my question is, how load , save extended info objects? should save info in 1 place or different places (e.g., 1 xml file vs. two)? edit i think possible utilize dictionary additional info (i.e., var info = node.data["plugina"] ). the info might serialized binaryformatter or xmlserializer . c# oop

maven - Hot swap with Netbeans 7.1 and Glassfish 3.1.1 -

maven - Hot swap with Netbeans 7.1 and Glassfish 3.1.1 - i start in debug mode can utilize hot swap. how can if whenever alter configuration or java file netbeans sends glassfish , automatically redeploys application? some details: 1 - maven war application. 2 - compile on save: both application , test execution. 3 - java debugger: apply code changes after save. to utilize hot-swap capabilities of jpda in netbeans/glassfish environment, need turn off 'deploy on save' feature of netbeans. this feature can configured on per project basis, appears in project's properties dialog. ui folks felt deployment more part of running project compiling project. command turns feature on , off in 'run' properties. you may notice project running in debug mode , apply code changed tool enabled. icon straight under string 'ide' @ top of screenshot. netbeans maven glassfish hotswap

c++ - GLSL per vertex fixed size array -

c++ - GLSL per vertex fixed size array - is possible in desktop glsl pass fixed size array of floats vertex shader attribute? if yes, how? i want have per vertex weights character animation have next in vertex shader: attribute float weights[25]; how fill attribute array c++ & opengl program? have seen in question attribute location of array attribute , add together index location. give illustration on pretty big array? thanks. let's start asked for. on pretty much no hardware exists attribute float weights[25]; compile. while shaders can have arrays of attributes, each array index represents new attribute index. , on hardware exists, maximum number of attribute indices is... 16. you'd need 25, , that's just weights. now, can mitigate plenty remembering can utilize vec4 attributes. thus, store every 4 array elements in single attribute. array attribute vec4 weights[7]; doable. weight-fetching logic have alter of course. even so, don...

android - viewport meta tag: initial-scale property behaves differently when width <= 320 -

android - viewport meta tag: initial-scale property behaves differently when width <= 320 - i have been unable understand how width , initial-scale properties of viewport meta tag works i have next html code. <!doctype html> <html> <head> <title>viewport illustration a</title> <meta name="viewport" content="width=321,initial-scale=1"> <style type="text/css"> body { background: #800000; } p { background: #ffffff; border: 1px solid gray; margin-left: 20%; margin-right: 20%; } </style> </head> <body> <p> lorem ipsum dolor sit down amet, consectetur adipiscing elit. ut european union massa erat, eget bibendum tortor. class aptent taciti sociosqu advertisement litora torquent per conubia nostra, per inceptos himenaeos. aenean lobortis, leo et porttitor venenatis, sapien nunc sodales elit, ut condimentum nibh lacus sed erat. suspendisse potenti. mauris faci...