Posts

Showing posts from September, 2015

Java - Combining two arrays? -

what i'm trying ask user list of items, , create 2 arrays - 1 itemname , 1 itemprice. program right deals itemprice , there's no indication of how can combine 2 arrays in 1 output list of both arrays combined, this: bread - 1.20 milk - 2.00 here have far, 2 arrays, name array isn't included in anything. thanks! public class taxclass { private input newlist; /** * constructor objects of class tax * enter number of items */ public taxclass(int anyamount) { newlist = new input(anyamount); } /** * mutator method add items , cost * enter sales tax percentage */ public void additems(double anytax){ double salestax = anytax; newlist.setarray(salestax); } } public class input { private scanner keybd; private string[] costarray; private string[] itemarray; /** * constructor objects of class scanner */ public input(int anyamountofitems) { keybd = new scanner(system.in); costarray = new string[anyamountofitems]; itemarray = new string[an...

Python __call__ special method practical example -

i know __call__ method in class triggered when instance of class called. however, have no idea when can use special method, because 1 can create new method , perform same operation done in __call__ method , instead of calling instance, can call method. i appreciate if gives me practical usage of special method. django forms module uses __call__ method nicely implement consistent api form validation. can write own validator form in django function. def custom_validator(value): #your validation logic django has default built-in validators such email validators, url validators etc., broadly fall under umbrella of regex validators. implement these cleanly, django resorts callable classes (instead of functions). implements default regex validation logic in regexvalidator , extends these classes other validations. class regexvalidator(object): def __call__(self, value): # validation logic class urlvalidator(regexvalidator): def __call__(self, valu...

arrays - jQuery - Retrieve values from HTML elements and return their sum -

i got form several checkbox 's user can choose multiple values, so: <div> <input id="myinput1" type="checkbox" value="choice_id_1" /> <label for="myinput1">5</label> </div> <div> <input id="myinput2" type="checkbox" value="choice_id_2" /> <label for="myinput2">10</label> </div> <div> <input id="myinput3" type="checkbox" value="choice_id_3" /> <label for="myinput3">10</label> </div> i need values each :selected checkbox label , return total sum (ie: total = 25) . so far have been trying strings labels .text() method, make array results, converting them int parsefloat() , sum array elements... obviosly no success. this got (for sure not best approach i'm open diferent solutions) : function totalsum() { var prices = $("...

graphics - OpenGL -- What is the most efficient way to draw an oval in OpenGL? -

i have been using triangle_fan , drawing 90 triangles. what's better way? look @ page drawing . explain 2 different methods. edit: i forgetting nurbs. use them . have here

ruby - Tailor MCollective agent actions based on the machine's facts -

lets have mcollective agent named "foo" action "bar", in logic of action want x when fact "chicken" "true", , y when fact "beef" true. basically, how access facts mcollective agent? you can access configured fact source like: if pluginmanager["facts_plugin"]["yourfact"] == "foo" # else # else end do anywhere in agent u need access facts. hth, if not please ask on mcollective users list on google groups

QT, convert raw image to jpg using Hardware acceleration (gpu) -

i need convert raw image buffer jpg image buffer. at moment, operation in following way: qimage tmpimage = qimage(rawimgbuffer, img_width, img_height, image.format ); //image.format=rgb888 qbuffer bufferjpeg(&ba); bufferjpeg.open(qiodevice::writeonly); tmpimage.save(&bufferjpeg, "jpg"); qbytearray finaljpgbuffer = bufferjpeg.data(); it works fine cpu load high (i have lot of threads operation lot of time each second). reading qt documentation found article: hardware acceleration &amp embedded platforms . if understood, can use qpainter class execute gpu operations... possible convertion (from raw jpg) using class? (or similar qt class use hardware acceleration (gpu))!! my application need platform indipendent. thanx @ all. i don't think qimage uses gpu generate jpeg. wouldn't (except on limited cpus) since transfer time of getting data out of gpu dominate. reason using hardware acceleration display result in gpu ready d...

How can I edit my VIM config so that Vim treats ".ejs" files the same as it currently treats my html files? -

what put in vim config? how change it? i want .html extension...because html... i think need au bufread,bufnewfile *.ejs setfiletype html au short autocmd docs it's idea put inside test if has("autocmd") au bufread,bufnewfile *.ejs setfiletype html endif to avoid error messages if ever use cut-down version of vim doesn't support feature. finally, if have default filetype rule like: au bufread,bufnewfile * setfiletype text then *.ejs rule must above it.

iphone - are you able to type into a UILabel -

hi wondering if able use ios keyboard update textfield user types? you each character type through uitextfielddelegate delegate methods, once set of character through delegate method , update uilabel .

jquery - Bring in HTML from a separate file -

i have site changes content of page when hover on navigation links: http://www.dolphinbeams.com/ basically divs on 1 page , use jquery display them necessary. however, ensure compatibility non-javascript browsers, have created separate html files each of pages. each page has same body content, different body id , title. i'm wondering if there's easy way can have body content in separate file (for editing), bring in pages. simplest way achieve this? keep in mind don't know php, though i'd consider if it's easiest way. i'd ensure content still visible in case javascript disabled. rename index html .php. add line want page display: <? include("contentfile.html"); ?> no other php knowledge required. for example have divs appear , disappear. might this: <div id="content1"> <? include("content1.html"); ?> </div> <div id="content2"> ...

iphone - problem with table view grouped table view -

tableview problem: using 3 uilable displaying productname, description , image. data displayed when scrolling table labels filled text actual text.. how can handle this? code: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath; { static nsstring *cellidentifier = @"cell"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { cell = [[[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:cellidentifier] autorelease]; } uiimageview *imageview = [[uiimageview alloc]initwithframe:cgrectmake(2, 2, 41, 41)]; [cell setaccessorytype:uitableviewcellaccessorydisclosureindicator]; nsdictionary *adict1 = [[nsdictionary alloc]init]; adict1 = [tabledata objectatindex:indexpath.row]; nsstring *prdstus = [adict1 objectforkey:@"productstatus"]; nslog(@"product status %@ ",prdstus); ...

vb.net - Speech Recognition MS word Add-in for local language in VB or C# -

i want create speech recognition add-in work ms word local language (other english) does system.speech work me or else required? thanks in advance system.speech should enough speech part if can transliterate to/from english. you need office automation libraries work word.

asp.net - Help needed in MySql Select Query -

suppose table has column "user_id" of integer type. how select list of user_id except minimum user_id in mysql ??? the except keyword not working in mysql in ms sql actually user_id selection based on clause select user_id table ref_id=54 , want user_id except min one.plz help i think looking solution this.. here each row except row have iuserid min value select * tbluser tbluser.iuserid not in (select min(iuserid) tbluser)

wpf - Save something in settingsfile or.. ? in C# -

i implementing application , have few lists stuff in it, same, don't want implement in real logic stuff. is there way save these items in application? i've read things saving these items in settingsfile. is best way, or there better ways? , how can this? save in xml. can bind directly xml in wpf. see: http://joshsmithonwpf.wordpress.com/2007/06/04/binding-to-xml/

c# - sending data over RS-232 -

i have application communicates via rs-232 serial port. is there application or library can use send data local serial port? i need able locally debug application. if looking virtulize serial port in code, trick you. http://com0com.sourceforge.net/ as .net code, "serialport" class incredibly easy use, reference (iv'e used many times) can found here. http://msmvps.com/blogs/coad/archive/2005/03/23/serialport-_2800_rs_2d00_232-serial-com-port_2900_-in-c_2300_-.net.aspx using .net serial class, can need in few lines of code. aware though, need use delegates update ui.

sockets - Java TCP Client-send blocked? -

i writing java tcp client talks c server. have alternate sends , receives between two. here code. the server sends length of binary msg(len) client(java) client sends "ok" string server sends binary , client allocates byte array of 'len' bytes recieve it. it again sends "ok". step 1. works. "len" value. client gets "send blocked" , server waits receive data. can take look. in try block have defined: socket echosocket = new socket("192.168.178.20",2400); outputstream os = echosocket.getoutputstream(); inputstream ins = echosocket.getinputstream(); bufferedreader br = new bufferedreader(new inputstreamreader(ins)); string frompu = null; if( (frompu = br.readline()) != null){ system.out.println("pu returns as="+frompu); len = integer.parseint(frompu.trim()); system.out.println(...

licensing - license-key for software -

i @ first experience of releasing windows application , don't have cue how should move on. here question: i have own website running on hosting. implement customer portal after receiving order provide username , password via email users can download activation code. know big question...how protect application against duplication? know "best" solution apply license system software? how can force application excuted on specific pc? complex achive? in scenario should create new build each user activation key unblock right build? if understand each profile have own build file along activation code , sort of service agreement information (i.e. 1 year of free updateds). again see complex manage, every changes in application need compile, build , upload new version...? ok... application right simple exe file folders , xml configuration files in future...? is possible share among user single application file can activated using user activation code (in scenario user h...

plsql - Pl/sql script to compute the free space in the users tablespace in oracle -

select tablespace_name, sum(bytes)/1024/1024 "mb free" dba_free_space tablespace_name = 'users' group tablespace_name; hi everyone, above query use showing free space in user tablespace how write separate pl/sql script store in separate table tablespace name , time stamp. kindly me need run on job scheduler every hour. thanks in advance assuming you've created table want store data in, simply create or replace procedure snap_free_space begin insert new_table( tablespace_name, free_bytes, collection_time ) select tablespace_name, sum(bytes), sysdate dba_free_space group tablespace_name; end;

command line - How to control "Browser mode" in Internet Explorer 9 by commandline -

i still haven't been able find solution problem. have application launches browser window underlying third party addin using doesn't support ie9 yet. know can switch browser mode ie8 tapping f12 , select this. is there way control on startup in command line? cause have problem when running application when opens new windows , automatically tries execute third party addin required. and no haven't option, forced use third party addin support installation of ie9 well. i don't know if have control on content being rendered in browser, if do, ie lets use meta tags force browser rendering mode of specific ie version. more info @ msdn right here also, further down page there instructions on how set web server tell ie mode use when it's requesting page. (if of use you) unfortunately information can find on subject (and did comprehensive search own project) indicates there no such option, or @ least not in general release of ie. here's microsoft...

jquery - How to Get RadButton Toggle State's Text Property At Client Side ? [Telerik ASP.NET AJAX Controls] -

i want text property of using jquery or other way... please me.... you should selected togglestate, , text togglestate. here sample code snippet: var button = $find("radbutton1"); var text = button.get_selectedtogglestate().get_text(); alert(text);

c++ - Access Violation when calling LockFileEx() -

i have filemapping class allows me lock file exclusive use process using win32 api function lockfileex() . bool filemapping::lockfile(bool wait) { if (isfilelocked()) return true; // want exclusive lock. dword flags = lockfile_exclusive_lock; // if don't want thread block, have set appropriate flag. if (!wait) flags |= lockfile_fail_immediately; m_isfilelocked = lockfileex(m_filedesc, flags, 0, (dword) m_mappinglength, (dword) (((uint64_t) m_mappinglength) >> 32), null); return m_isfilelocked; } whenever lockfileex() call access violation: unhandled exception @ 0x7466c2ec in tftpserver.exe: 0xc0000005: access violation reading location 0x00000008. the file handle m_filedesc valid handle (mapping file memory handle works) , m_mappinglength size_t containing length of mapped file portion in bytes. does have idea how fix this? your last argument null , while should pointer overlapped structure. err...

tsql - SQL Server T-SQL TRIM END -

i need trim ; string inside t-sql. if has it. below : declare @_tags nvarchar(max); set @_tags = 'bla; bla;'; --select trimend(@_tags, ';'); so, if @_tags ends ; , ; trimmed. how can that? to remove if last char ; : select case when right(@_tags, 1) = ';' replace (@_tags, ';', '') else @_tags end to remove end 1 only: select case when right(@_tags, 1) = ';' stuff(@_tags, len(@_tags), 1, '') else @_tags end

State or workflow diagram component for .NET -

i'm looking component or library .net, allow me either visually edit, or @ least visualise simple state or workflow diagrams or charts. preferably free, comercial fine too. anyone have recomendation or experience? here commercial ones i'm aware of: addflow flowchart.net ilog.net nevron diagram and know 1 free bit outdated: http://code.google.com/p/diagramnet/

asp.net - how to set the focus to a control by default? -

i have login control , create user control web page...i want cursor in user name text box of login control when page loads...how can that?? <asp:loginview id="loginview1" runat="server"> <loggedintemplate> bingo..!!! youuuuu did it...<asp:loginname id="loginname1" runat="server" />. </loggedintemplate> <anonymoustemplate> <asp:dropshadowextender id="dropshadowextender1" runat="server" targetcontrolid="panel1" rounded="true" opacity=".38"> </asp:dropshadowextender> <asp:panel id="panel1" runat="server" backcolor="silver"> ...

javascript - Knockout.js dynamic composable table -

i'm trying make "dynamic table" knockout js , i'm having bit of difficulty. want have "common row template" nested template variable columns. this: <script type="text/x-jquery-tmpl" id="commonrow"> <td><input type="text" data-bind="value: nome" /></td> <td data-bind="template: { name: $item.labelone + 'row' }"></td> <td><button class="fancybox edit" data-bind="click: edit">modifica</button></td> <td><button class="remove" data-bind="click: remove">rimuovi</button></td> </script> so second <td> render template, this: <script type="text/x-jquery-tmpl" id="scalarow"> <td><input type="text" data-bind="value: pianifuoriterra" /></td> <td><input type="text" data-bind="value: f...

android - How do I place the text inside an EditText widget at the top? -

i have following xml edittext , button take whole screen. problem can't find way make typed text in edittext put @ top. right it's put in centre of edittext. <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:background="@drawable/herinnering_background" android:layout_width="fill_parent" android:layout_height="fill_parent"> <edittext android:id="@+id/invoertekst" android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="1" android:hint="@string/prompt_tekst" /> <button android:id="@+id/klaar" android:layout_width="fill_parent" an...

Python, empty file after csv writer.. again -

my python program loops through bunch of csv-files, read them, , write specific columns in file csv file. while program runs, can see files being written in correct manner, once program finished, files i've written become empty. the solution other similar threads seems closing file write properly, cant seem figure out im doing wrong. anyone? import os import csv def ensure_dir(f): d = os.path.dirname(f) if not os.path.exists(d): os.makedirs(d) readpath = os.path.join("d:\\", "project") savepath=os.path.join("d:\\", "save") ensure_dir(savepath) contents_1=os.listdir(readpath) in contents_1[1:len(contents_1)]: readpath_2=os.path.join(readpath, i) if os.path.isdir(readpath_2)== true : contents_2=os.listdir(readpath_2) in contents_2: readpath_3=os.path.join(readpath_2, i) if os.path.isfile(readpath_3)== true : savefile=savepath + "\\" + ...

STARTTLS error while sending email using Indy in Delphi XE -

i'm trying send email application using following code: var mailmessage : tidmessage; smtp : tidsmtp . . . //setup smtp smtp.host := 'smtp.gmail.com'; smtp.port := 25; //setup mail message mailmessage.from.address := 'fromme@gmail.com'; mailmessage.recipients.emailaddresses := 'tosomeone@hotmail.com'; mailmessage.subject := 'test'; mailmessage.body.text := 'hello, test'; smtp.connect; smtp.send(mailmessage); when run it, generates following error **error: must issue starttls command first. i29sm34080394wbp.22** how can solve this? by putting answers can following code. don't forget nathanial woolls mentioned here put libeay32.dll , ssleay32.dll libraries instance here project folder or path following places . uses idmessage, idsmtp, idsslopenssl, idglobal, idexplicittlsclientserverbase; procedure sendemail(const recipients: string; const subject: string; const body: string); ...

Debugging an SQLite query from a C program -

i have sql table 1 of columns has several comma separated values. code below supposed go through of them , return true if particular value present in list, seems work values other first value in entry. ideas screwed up? query works fine when running directly on database file using sqlite3, i'm sure problem function. bool group_exists(char *group) { int retv; char *param_1, *param_2; bool exists = false; sqlite3_stmt *p_stmn; param_1 = malloc(buffer_size); param_2 = malloc(buffer_size); sprintf(param_1, "%s,%%", group); sprintf(param_2, "%%,%s,%%", group); sqlite3_prepare_v2(db, "select groups users groups ? or groups ?", -1, &p_stmn, null); sqlite3_bind_text(p_stmn, 1, param_1, -1, null); sqlite3_bind_text(p_stmn, 1, param_2, -1, null); retv = sqlite3_step(p_stmn); if (retv == sqlite_row) { exists = true; } else if (retv != sqlite_done) { retval_crash(); } fr...

svn - tiding subversion Perl repo with PerlTidy? -

i clean existing subversion repository containing badly formatted perl code. since not sure if comparisons old code necessary, ideally have same formatting revisions. on other hand creating new repo checking out old revisions, reformatting perltidy , checking in have keep original log messages. are there tools/recipes it? what want do? clean old revisions? don't it. you'll destroy history, , though should generating same perl script (just tidied up), end funking released revision. besides isn't worth effort. i recommend checkout current revisions, run perl tidy, , check in changes. won't change old code, give clean stuff work on. of course, if perl code poorly formatted want run whole thing perl tidy, have more issues. prevents making mess of code again? i recommend @ jenkins part of continuous build process. don't compile perl code, use jenkins run tests make sure new perl scripts , modifications perl scripts have been tidied up. if perl...

plone - How to make varnish round-robin zeo clients -

i use plone.recipe.varnisin buildout configure varnish round-robin between 2 zeo clients. in buildout.cfg have tried: [varnish-build] recipe = zc.recipe.cmmi url = http://downloads.sourceforge.net/project/varnish/varnish/2.1.3/varnish-2.1.3.tar.gz [varnish-instance] recipe = plone.recipe.varnish daemon = ${buildout:directory}/parts/varnish-build/sbin/varnishd bind = 127.0.0.1:8000 balancer = round-robin backends = client1:127.0.0.1:8080 client2:127.0.0.1:8081 cache-size = 1g and [varnish-build] recipe = zc.recipe.cmmi url = http://downloads.sourceforge.net/project/varnish/varnish/2.1.3/varnish-2.1.3.tar.gz [varnish-instance] recipe = plone.recipe.varnish daemon = ${buildout:directory}/parts/varnish-build/sbin/varnishd bind = 127.0.0.1:8000 balancer = round-robin backends = cluster:127.0.0.1:8080 cluster:127.0.0.1:8081 cache-size = 1g neither work, both give me "error 404 unknown virtual host". can manually edit varnish.vcl to ...

c# - Disposing FileStream and BinaryReader -

i have class manages access binary file. want open file on first request , keep open until instance of class gets disposed. have implemented so: public class someservice : idisposable { private binaryreader _reader; public int servicefunction(...) { if (_reader == null) createreader(); // _reader , return result } private void createreader() { var stream = new filestream("myfile", filemode.open, fileaccess.read); _reader = new binaryreader(stream); } public void dispose() { if (_reader != null) _reader.dispose(); } } i use class way: using (var service = new someservice()) { foreach (var item in somelist) { // other stuff if (eventuallytrue) { int result = service.servicefunction(item.someproperty); // other stuff } } } questions: is enough call _reader.dispose() or necessary dispose fil...

c# - Is there any builtin stable sort routine and swap function in .NET? -

is there in-built stable sort routine in .net? i know c++ has in-built sort routine under "algorithms" std::sort() . likewise, have use along c#? also, there in-built swap function in .net? using "c# stable sort" in google revealed post top result: is sorting algorithm used .net's `array.sort()` method stable algorithm? so answer is: enumerable.orderby stable sort function, not built c#, part of .net framework libraries. concerning "swap": don't know of prebuilt generic swap function in .net framework, here find implementation in less 10 lines of code: static void swap<t>(ref t lhs, ref t rhs) { t temp; temp = lhs; lhs = rhs; rhs = temp; }

iphone - NSManagedObjectContext, best way to pass it around? Access it? -

i have question regarding how pass around nsmanagedobjectcontext . in app, seems it's appdelegate handles nsmanagedobjectcontext , shouldn't create other nsmanagedobjectcontexts in other viewcontrollers . so question is... there convention or smart method this? thanks. the way pass nsmanagedobjectcontext have ivar in each view controller pass to. modify initialiser include assignment, this.... mynewviewcontroller.h @interface mynewviewcontroller : uiviewcontroller { nsmanagedobjectcontext *managedobjectcontext; } ... mynewviewcontroller.m @implementation mynewviewcontroller - (id)initwithnibname:(nsstring *)nibnameornil bundle:(nsbundle *)nibbundleornil andcontext:(nsmanagedobjectcontext *)ctx { self = [super initwithnibname:nibnameornil bundle:nibbundleornil]; if (self) { managedobjectcontext = ctx; } return self; } .... then when call view controller, use modified initialiser. like... mynewviewcontroll...

ruby on rails - Separate Worker Server for Delayed Job Using Capistrano on Linode? -

i have app heavily relies on background processing , have delayed_job workers on separate linode instance performance reasons. have found this helpful post being able run dj workers on different server without having boot apache , looks that's how i'll setting things up. my question how go configuring capistrano deploy app both servers, running actual web facing end one, , using other 1 dj? this? role :web, "domain.com" role :app, "domain.com", "workers.domain.com" role :db, "domain.com", :primary => true you can set separate server role delayed jobs adding recipe: set :delayed_job_server_role, :utility then, attach role worker (utility) server: role :web, "domain.com" role :app, "domain.com" role :db, "domain.com", :primary => true role :utility, "workers.domain.com" for more info: https://github.com/collectiveidea/delayed_job/wiki/rails-3-and-capistrano

php - Problems with $_POST values -

hey got problem might solved, can't seem find on it. i have form: <form action="<?php echo $_server['self']; ?>" method="post"> first name: <input name="firstnamepass" type="text" size="35" /><br /> surname: <input name="surnamepass" type="text" size="35" /><br /> email: <input name="emailpass" type="text" size="35" /><br /> <input type="submit" value="search member" /> now have php getting post data: if(isset($_post['firstnamepass'])) echo "surname set <br />"; if(isset($_post['surnamepass'])) echo "surname set <br />"; if(isset($_post['emailpass'])) echo "email set <br />"; problem is, seems set if haven't set value it. ideas? way around it? thanks help. use empty function instea...

objective c - AVAudiosession to play itunes library music? -

is possible play music iphone's itunes library avaudiosession? i've checked through ipod library access programming guide, , can find explainations on how play music using mpmusicplayercontroller, not how @ music data. this caused me more, , found article on how it: getting musical data of ipod-track

ios - How to display multiple EAGLView from one screen of iPhone/iPad? -

just effects of "photo booth" application in macosx. is possible display 4 eaglviews @ same time ? it easier render same eaglview using glviewport. can render in part of backbuffer without changing anything. glviewport (http://www.khronos.org/opengles/documentation/opengles1_0/html/glviewport.html) takes lowerleft corner position , size of rectangle.

javascript - Mouse hand cursor disappears in Google Chrome if page is reloaded -

using normal .foo {cursor:pointer;cursor:hand;width:250px;height:250px;background:#aaa;} and <div class="foo"><!--ph--></div> as seen here: http://jsfiddle.net/uzq5d/2/ if hold cursor on gray background reload pages, cursor defaults arrow. is there nifty , lightweight way check if cursor on .foo element on load? or perhaps periodically, on mouse move? jquery allowed. edit: i'm seeing behaviour using chrome on os x. using jquery set cursor works - ie without css cursor - see here see mean --> http://jsfiddle.net/uzq5d/15/

java ee - Nullpointerexception in entitymanager -

hy, i'm having trouble in using entitymanager in java web applicaton. my code is: public class helloworldresource extends serverresource { @persistencecontext(unitname = "testrestletpu") entitymanagerfactory emf; @get public string represent() { entitymanager em = emf.createentitymanager(); if(em.isopen()) return "good"; else return "bad"; } and persistence.xml is <?xml version="1.0" encoding="utf-8"?> <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns /persistence/persistence_2_0.xsd"> <persistence-unit name="testrestletpu" transaction-type="jta"> <jta-data-source>test</jta-data-source> <exclude-unlisted-classes...

How to move all my data on one firefox to another -

all, have 1 firefox installation @ work has specific add-ons, each add-on having it's own preferences , history/data. is there tool/steps move entire data personal pc, not have set-up on again? my workstation windows xp sp3 , personal pc windows 7, professional, 64bit. thanks open explorer , type in: %appdata%\mozilla\firefox\profiles\ if didn't create profile there should 1 folder ".default" @ end of it's name. copy folder same directory on desktop pc. have fun :)

How to define a string with values from a defined list in SCHEME -

please me define string this.. i have list has values (define temp-list (list '398 '150 '1.15 '2875 '-900 '1565 '800 '230 '200 '0 '0 '0)) i should declare as.. (define b "398 150 1.15 2875 -900 1565 800 230 200 0 0 0") how can in scheme? if have srfi 13 loaded, can use string-join so: (define b (string-join (map number->string temp-list)))

java - EL session object property -

${sessionscope.pricer.applicableratecode} public class viewprices implements cloneable, serializable { private static final long serialversionuid = 1; // fields public list<ratecode> applicableratecode = null; } javax.el.propertynotfoundexception: property 'applicableratecode' not found on type com. . .viewprices ${sessionscope.pricer} prints value applicableratecode won't print setter/getter missing in class . jstl el access property using standard accessors methods

cluster computing - insert-ethers command not working on Linux Rocks frontend -

after rocks frontend being installed, tried adding new node frontend using following command #insert-ethers got error: 'bash: insert-ethers: command not found" what can solve problem? p.s: server installed else i`m guessing maybe did not install necessary components. you need root use rocks commands. try su -

java - Passing data from two activities to a third -

i have total 3 activites. pass data first activity this: intent = new intent(getapplicationcontext(), history.class); i.putextra("day", mday); i.putextra("month", mmonth+1); i.putextra("year", myear); startactivity(i); get data: bundle extras = getintent().getextras(); if(extras !=null) { ....... now pass data second activity: intent = new intent(getapplicationcontext(), history.class); i.putextra("hday", mday); i.putextra("hmonth", mmonth); i.putextra("hyear", myear); startactivity(i); and data second activity: bundle extras2 = getintent().getextras(); if(extras2 !=null) { so, have extras data first activity, , extras2 data second activity. when pass data activity both extras not null! have done wrong? the problem third activity has no way of knowing activity sent bundle. need add field iden...

Increasing a number on the first line of a file by 1 with php -

i have script counting number of downloads of file downloaded internet. has log file adds line of text every time file downloaded. i want modify first line number, , every time file downloaded increases number 1 (so it's easy see how many people have downloaded it.) here's code have right (this isn't working): $conten = @file_get_contents(log_file); //first line: $conten[0]; $content = fgets($conten); $fo = @fopen(log_file, 'r+'); if ($fo) { $content++; @fputs($fo, ".$content."); @fclose($fo); } $f = @fopen(log_file, 'a+'); if ($f) { @fputs($f, date("m.d.y g:ia")." ".$_server['remote_addr']." ".$fname."\n"); @fclose($f); } the $f part works fine...it's parts above aren't working want. thanks! file_get_contents() sucks entire file string. try fgets() on string, incorrect - fgets() works on filehandles, not strings. if weren't suppressing errors @ ( n...

php - Java bridge'ed error -

i'm trying move javebridge'ed project new server. running php w java throught sun-java6. don't know how read java error output , hoping 1 of point me in direction figured on server make app happy. fatal error: uncaught [[o:exception]:"java.lang.exception: createinstance failed: new com.elance.proposal.html2image.client.mainbridge. cause: java.lang.classnotfoundexception: com.elance.proposal.html2image.client.mainbridge vm: 1.6.0_06@http://java.sun.com/" at: #-29 org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1680) #-28 org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1526) #-27 java.lang.classloader.loadclassinternal(classloader.java:319) #-26 java.lang.class.forname0(native method) #-25 java.lang.class.forname(class.java:247) #-24 php.java.bridge.util.classforname(util.java:1518) #-23 php.java.bridge.javabridge.createobject(javabridge.java:445) #-22 php.java.bridge.request.handlerequest(reques...

opengl es - Do android textured point sprites work on software renderer? -

i can render non textured point sprites on both emulator , multiple devices (2.1/2.2) when add textured code nothing displayed on software rendered devices (or emulator) fine on hardware accelerated devices. limitation of software renderer or should able have textured point sprites if can point sprites @ all? thanks ok, emulator not support gl_oes_point_sprite extension.

php - How to use multiple configuration files using Yii -

i want use different configuration file development , production server. want define different database configuration each server , different logging procedure. so when run on server change index.php file. development: // developement $config=dirname(__file__).'/protected/config/development.php'; // production // $config=dirname(__file__).'/protected/config/production.php'; production: // developement // $config=dirname(__file__).'/protected/config/development.php'; // production $config=dirname(__file__).'/protected/config/production.php'; maybe article give information you. yii framework separate configurations different environments

android - how to get access of my button in one of my viewpager pages? -

i'm new android , java. my viewpager can slide xml layout, don't know how access item in them. i tried using button mybutton = (button) findviewbyid (r.layout.result) , set onclicklistener in mybutton, forced close every time run it. here code: public class main extends activity { private viewpager myviewpager; private viewpageradapter myviewpageradapter; private static int num_awesome_views = 12; button button_1; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); myviewpageradapter = new viewpageradapter(); myviewpager = (viewpager) findviewbyid(r.id.myviewpager); myviewpager.setadapter(myviewpageradapter); button_1 = (button) myviewpager.findviewbyid(r.id.first_button); button_1.setonclicklistener(new onclicklistener() { public void onclick(view v) { finish(); ...

Solr eDisMax query -

i have field "spell" text "quanti disperati si rovescerebbero con barconi sulle nostre.." i can search via edismax one: q={!field f=spell}disperati si rovescerebbero' - ok or q={!prefix f=spell}disperat' - ok but how can search not complete sentence one: q={!field f=spell}disperati si rovescere*' - incorrect try - q={!type=edismax qf=spell v='disperati si rovescerebbero*'}

php - Select data from database and give error -

i want database table row name in error. ( $query->code_airline => other query select database table row) code: <?=$this->db->get_where('ticket_code', array( 'code' => $query->code_airline ))->row()->name?> error: a php error encountered severity: notice message: trying property of non-object filename: core/loader.php(679) : eval()'d code line number: 48 if want use as: <?php //this line 49 $ca = echo $query->code_airline; $query_tc = $this->db->get_where('ticket_code', array( 'code' => $ca ))->row(); echo $query_tc->name; ?> have error: parse error: syntax error, unexpected t_echo in d:\xampp\htdocs\system\core\loader.php(679) : eval()'d code on line 49 how can fix it? update: i use as: <?php $ca = $query->code_airline; $query_tc = $this->db->get_where('ticket_code',array('code'=>$ca)); $row...

ruby - What is an ActiveRecord Rails Relation really? -

i trying understand of internals of rails relations, in order use them in queries. therefore, opened console , did tests: ruby-1.9.2-p180 :036 > skill.where(:second_class => 'wealth ranger').map {|att| att.class} => [skill(id: integer, name: string, description: string, second_class: string, third_class: string, created_at: datetime, updated_at: datetime)] now, not expect output. expect relation or similar. seems traverses every attribute , produces type each one. what relation in ruby's terms really? totally custom structure? if so, there similarities between hashes , arrays, or should considered totally custom structure? edit: after more testing, seems contains objects of class. how operates? activerecord's relation class in rails 3 layer on top of arel . handles collecting parameters "lazy loading" , rails' simplified query methods (compared straight arel). the best description i've seen of it's inner workings...

How to make this pipe work in c++? -

i programming shell in c++. needs able pipe output 1 thing another. example, in linux, can pipe textfile more doing cat textfile | more . my function pipe 1 thing declared this: void pipeinput(string input, string output); i send "cat textfile" input, , "more" output. in c++ examples show how make pipes, fopen() used. send input fopen() ? have seen c++ examples of pipeing using dup2 , without suing dup2 . what's dup2 used for? how know if need use or not? take @ popen(3), way avoid execvp.

php - Tree menu - 4 levels -

i have website 4 level menu structure: sections (in sections tabel), categories (in categories tabel, section_id pointing sections) , pages (in tabel pages have parent_id because page can child of page, , each page belong section). how can build menu? (i use php , mysql) use 4 nested queries. first select sections, each section select categories, , categories select pages without parent, , each page select child pages. also can use 1 query (with right join) array section_id, category_id, page_id, parent_id. don't know how convert array tree array. use this class convert query tree array. an example of use. it's simple : $sql_query = "select field1, field2 table field3='val1' , field4=5 or field5='val2';"; $query2tree = new dqml2tree($sql_query); $sql_tree = $query2tree->make(); print_r($sql_tree);

ios4 - Why do I get this 'Use of undeclare identifier addressbook' error? -

nsarray* allpersons = (nsarray*)abaddressbookcopyarrayofallpeople(addressbook); i use of undeclare identifier addressbook error. why? the error getting answers question. passing addressbook function, haven't defined addressbook .

jquery - How do javascript frameworks treat 304 not-modified? -

i'm curious how works in jquery, in general. when js resource fetched, , server indicates 304 not-modified, framework: load js file cache , execute it not execute it i'm trying support polling solution, , if can jquery nothing upon recieving 304 work done, otherwise, have write resource in safely-reloadable (idempotent) way, harder (imagine adding status div page, wouldn't want again if status hasn't changed) it'll load js file cache , execute, either way, execute each time. sorry, it's harder way you'll need :).

javascript - How to differentiate case of a letter? -

function convert_one2two() { var arrtwo = new array( "a", "e", "i"); var arrone = new array( "a", "e", "i"); str=document.frmconvert.txtone.value; //input 1 (i=0;i<3;i++) //loop letters { strtemp=new regexp(arrone[i], "ig"); str=str.replace(strtemp,arrtwo[i]); //replacing } document.frmconvert.txttwo.value=str.tostring(); //output 2 } <form name="frmconvert" action="" method="get"> <textarea rows="5" cols="90" name="txtone"></textarea> <input name="btnconvertg" value="create two" onclick="convert_one2two();" type="button"> <textarea rows="5" cols="90" name="txttwo"></textarea> </form> i'm using code. but, got problem. if given text contains both upper case , lower case letters , if w...

php - Output Array Items -

i'm using salesforce.com toolkit php , i'm trying output think simple. this working example code $query = "select id, phone contact limit 5"; $response = $mysforceconnection->query($query); foreach ($response->records $record) { echo $record->id." - ".$record->phone; } i've tweaked query , want output name , count. code below not work $query = "select owner.name, count(type) task limit 5"; $response = $mysforceconnection->query($query); foreach ($response->records $record) { echo $record->owner.name; //does not work } this when print_r ($record); stdclass object ( [id] => [any] => array ( [0] => first last [1] => 2177 ) ) i want able output "first last - 2177" foreach ($response->records $record) { echo implode(' - ', $record->any); }

ios4 - Choose email account before sending mail? -

i creating application mail sending functionality. sending mail using mfmailcomposeviewcontroller. want if there multiple mail accounts configured on user device before sending mail should ask sender email account. user wants send mail. is there way or provided default. working on simulator can't test right now. thanks, first need set multiple accounts in mail app. if have multiple accounts there while presenting mfmailcomposer view there in from field allow choose mail account want send mail. default behaviour of mail composer. hope helps :)

mysql - Using for() loop to create unique PHP variables -

i have input form allows me insert new quiz database. form looks this: question title question #1 is_correct_1 choice#1 is_correct_2 choice#2 is_correct_3 choice#3 is_correct_4 choice#4 question #2 . . . different quizzes having varying amounts of questions (although each question have 4 possibilities). determine how many questions have before form constructed. in order accomplish generate form using couple loops. initialize names of different input fields in same manner. see below: // grab number of questions admin page $num_of_qs = $_post['num_of_qs']; // produce form using loops echo '<form method="post" action="' . $_server['php_self'] . '">'; echo '<fieldset><legend>new quiz details</legend><label for="title">quiz title</label>'; echo '<input type="te...

javascript - Using Cufon and @font-face together -

i think time of using custom fonts in web widely! best , easiest way add custom fonts website cufon . easy use , cross-browser. support ie5.5 !!! anyway force client download massive script font , user can't use "find" , "zoom" functions in browser properly. on other hand @font-face supported days , it's more semantic. here spoke @font-face browser support , other issues. my question how use @font-face , cufon , deliver custom fonts more clients best performance. should not load cufon's custom scripts when can load custom font via @font-face , should not load custom font in client side when prefer using cufon in targeted client. (think have system/browser supports @font-face preffer using cufon). i'm asking write script based on @font-face support , other factors developer prefers , loads cufon or custom font. here great @font-face detector: /*! * isfontfacesupported - v0.9 - 12/19/2009 * http://paulirish.com/2009/font-face-feature-det...