Posts

Showing posts from June, 2014

memcached - Compare and Swap (CAS) implementation in EhCache -

i trying find equivalent of memcache's casmutator.cas in ehcache. essentially, swapping out ehcache memcache , need implement interface calls setting value via cas. have insight this? also, given i'm not purporting expert in of this, if has high level overview of how cas works / doing, appreciated well. the compare , swap method equivalent in ehcache replace(element old, element element) method found in net.sf.ehcache.cache. method compares "old" element against element in cache and, if matches, replaces element in cache "element." following method provides simple usage example assumes "acache" cache object method has access , "acache" used cache objects of type long. // replace cached value associated key newvalue , // return original value public long replace(string key, long newvalue, long maxtries) boolean success = false; long originalvalue; element originalelement; element newelement = new elemen...

yacc - Bison: Give left precedence to a rule? -

with bison have many %left's (+,*, etc) , few %right's (=, +=, etc). these tokens. have rule. its | rval | attrdata rval the problem is, attrdata rval returns rval attrdata 1+1 either (attrdata 1) +1 or attrdata (1+1). apply left rule attrdata doesnt work cause isnt token. tried %prec , error too. i can fix writing | attrdata '(' rval ')' dont want , rather have users write attrdata (1+1) since of time they'll mean (attrdata 1)+1. how give rule left precedence? the thing similar have else, solved forcing braces no confusion (if cond { if cond } else ) you can set explicit precedences may you if else example %nonassoc lower_than_else %nonassoc else %% stmt : if expr stmt %prec lower_than_else ; | if expr stmt else stmt;

php - In Komodo IDE, is it possible to tell a file what's included in it so that IntelliSense works? -

file includes files b , c. c has access stuff defined in , b, c doesn't know that. how can tell c has access intellisense works? perhaps more clear example: if master.php includes library.php , page.php page.php has access library.php , there's no way page.php know that. want manually tell page.php library.php included, , have komodo save in meta data or project file. the basic answer that, depending on komodo settings, automatically gather (though in experience it's not 100% reliable). can set directories automatically import intellisense in ide settings. 2 places check: go edit->preferences->code intelligence in komodo ide , make sure 'include files , directories project base directory' go edit->preferences->languages->php , add other directories import zend framework, instance.

c# - Async CTP and "finally" -

here's code: static class asyncfinally { static async task<int> func( int n ) { try { console.writeline( " func: begin #{0}", n ); await taskex.delay( 100 ); console.writeline( " func: end #{0}", n ); return 0; } { console.writeline( " func: #{0}", n ); } } static async task consumer() { ( int = 1; <= 2; i++ ) { console.writeline( "consumer: before await #{0}", ); int u = await func( ); console.writeline( "consumer: after await #{0}", ); } console.writeline( "consumer: after loop" ); } public static void asynctest() { task t = taskex.runex( consumer ); t.wait(); console.writeline( "after wait" ); } } here's output: consumer: before await #1 fun...

java - Quick question on If statements with multiple conditions -

possible duplicate: && (and) , || (or) in java if statements this question should have known answer years ago if writing if statement in java has if(x != null && y == null && x.equals(z)) safe? assume if statement conditions interpreted left right checking if x != null begin assure no null pointer exception thrown (at least x) on x.equals(z) part of condition. accurate? yes. it's called short-circuited logic: http://en.wikipedia.org/wiki/short-circuit_evaluation .

vb.net - How to remove blank pages from PDF using PDFSHarp? -

how able remove blank page pdf file? have sample pdf file 1st page contains few strings , 2nd page absolutely nothing in it. tried loop pdf pages , element count per page funny thing same number between 2 pages =| how did happen if 1st page has few strings , 2nd page absolutely blank??? this code dim inputdocument pdfdocument = pdfreader.open("") dim elemountcount integer = 0 dim elemountcount2 integer = 0 dim pdfpagecount integer = inputdocument.pagecount for x integer = 0 pdfpagecount - 1 elemountcount = inputdocument.pages(x).contents.elements.count elemountcount2 = inputdocument.pages(x).elements.count next try check length of each element: public bool hascontent(pdfpage page) { for(var = 0; < page.contents.elements.count; i++) { if (page.contents.elements.getdictionary(i).stream.length > 76) { return true; } } return false; }

ASP.NET - What is the easiest generic way to save form data and retrieve it when the user navigates back to the page? -

what easiest way save form data , retrieve when user navigates page? we have application process consists of several web forms. if user clicks go step auto-populate fields. assuming there common generic way without having mess individual controls - it? put forms on same page , enable viewstate. that is, instead of using 3 distinct pages, use single page has panels each of virtual "pages." keep track of page user on (with viewstate-managed property), , show/hide forms appropriate page. the next/back controls should post , increment/decrement current page. since it's same form, , it's posting itself, viewstate persist field values automatically. the thing won't work if click browser's "back" button. block using window.onbeforeunload prevent it.

java - Dynamic Proxy - Class Loader parameter when creating a new proxy instance -

i wondering when call newproxyinstance method when creating dynamic proxy instance, classloader argument for? public static object newproxyinstance(classloader loader, class<?>[] interfaces, invocationhandler h) throws illegalargumentexception many thanks! p.s. i'm not sure how use code formatting tags correctly. the documentation newproxyinstance defines use equivalent to: proxy.getproxyclass(loader, interfaces). getconstructor(new class[] { invocationhandler.class }). newinstance(new object[] { handler }); so, if want bit more detail loader , can @ documentation getproxyclass . basically, serves class loader defines generated proxy class.

c# - Using .Net WebRequest Factory -

as richard willis suggests in http://blog.salamandersoft.co.uk/index.php/2009/10/how-to-mock-httpwebrequest-when-unit-testing/ i'm trying call web request moking behavior. for (i asking me if i'm messing here) implemented iwebrequestcreate , extended webrequest , webresponse. (more details in link codes) but in code had test register ( webrequest.registerprefix ) prefix: [test] public void test() { var = file.readallbytes(@"testdata\webservice\admrond_13jan2011_14jan2011.xml"); webrequest.registerprefix("mockprefix", new webrequestcreatemock()); webrequestfake request = webrequestcreatemock.createrequestfake(some); _remoterepository.populatewithmeterdata(_meter); ... (error in line before) then, got error: invalid uri: hostname not parsed. but why? in populatewithmeterdata(meter meter) have call: webrequest request = webrequest.create(urllistmeteringdata); webresponse ws = request.getresponse(); some su...

jquery - My HTML5 Video not working in ipad -

i trying load jquery created video tag page following code: var viddiv = vpjquery("#videoholder"); var vidcontrol = vpjquery("<video></video>"); vidcontrol.attr("width", "512"); vidcontrol.attr("height","288"); vidcontrol.attr("controls","controls"); vidcontrol.attr("id","vidcontrol"); var vidsource = vpjquery("<source />"); vidsource.attr("src", vidurl); vidsource.attr("type", "video/mp4"); vidcontrol.append(vidsource); viddiv.empty(); viddiv.append(vidcontrol); vpjquery("#vidcontrol > source").attr("src", vidurl); var vidplayer = vpjquery("#vidcontrol").get(0); vidplayer.load(); vidplayer.play(); vidurl mp4 path hosted amazon. works fine in desktop web kit , iphone sim, not ipad sim! play icon line through on ipad, ideas? make sure file format supply supported ipad. guide: http:...

Understanding JDK 1.6 on Ubuntu Linux IPv6 output handling -

i'm running ubuntu 10.10 , hosts configuration following: root@maxim-desktop:~# cat /etc/hosts 192.168.20.20 maxim-desktop # added networkmanager 192.168.10.20 maxim-lp 127.0.0.1 localhost.localdomain localhost ::1 maxim-desktop localhost6.localdomain6 localhost6 # following lines desirable ipv6 capable hosts ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts root@maxim-desktop:~# cat /etc/resolv.conf # generated networkmanager nameserver 192.168.20.1 root@maxim-desktop:~# cat /etc/hostname maxim-desktop root@maxim-desktop:~# hostname maxim-desktop root@maxim-desktop:~# hostname --fqdn root@maxim-desktop:~# ifconfig eth0 link encap:ethernet hwaddr 00:1c:c0:f2:ba:89 inet addr:192.168.20.20 bcast:192.168.0.255 mask:255.255.255.0 inet6 addr: fe80::21c:c0ff:fef2:ba89/64 scope:link broadcast running multicast mtu...

Filtering SharePoint SiteMapDatasource -

i'm using sitemapdatasource in tree view display simple hierarchical site map. need filter map shows links sites , sub sites, , not links things lists, document libraries, etc. thanks! without knowing more situation, possible (assuming these xml type data structures) use kind of xpath query pull , filter information? perhaps can transform via xslt? if can post things like, might give little more insight. there always, possibility of using linq on data source...

.net - Adding an attachment to email using C# -

i'm using following code answer sending email in .net through gmail . trouble i'm having adding attachment email. how add attachment using code below? using system.net.mail; var fromaddress = new mailaddress("from@gmail.com", "from name"); var toaddress = new mailaddress("to@example.com", "to name"); const string frompassword = "frompassword"; const string subject = "subject"; const string body = "body"; var smtp = new smtpclient { host = "smtp.gmail.com", port = 587, enablessl = true, deliverymethod = smtpdeliverymethod.network, usedefaultcredentials = false, credentials = new networkcredential(fromaddress.address, frompassword) }; using (var message = new mailmessage(fromaddress, toaddress) { subject = subject, body = body }) { smtp.send(message); } thanks in advance. the message object created new mailmessage method call has...

best way to store imported xml data in flash as3 -

i hoping guidelines on general best practice storing data xml document. when said , done, whole flash site powered xml, want make sure organized properly. parse xml, , store different sets of data in arrays, i'm sure there's better way it. i'm no expert though, need straightforward. here's initial setup: var myxml:xml; var myloader:urlloader = new urlloader(); myloader.load(new urlrequest("xml/presentation.xml")); myloader.addeventlistener(event.complete, processxml); function processxml(e:event):void { xml.ignorewhitespace = true; myxml = new xml(e.target.data); (var i:int = 0; i<myxml.*.length(); i++){ trace("node " + (i+1) + ", title " + myxml.projects.project[i].title); }; } thanks! imho right, but should create xmllist processing data faster , properly

http - Edge Server Includes (ESI) -

is practice use esi's or older technology? there alternatives better. familiar use of cdn's , cache servers esi typically applications more load front end. esi unknown outside cdn context. however, think there number of interesting use cases use 'closer' origin servers see lot more interest in splitting applications deliver web sites several self-contained services. esi-enabled cache means integrate these services single web site.

javascript - Find the place of a cursor in rectangle -

Image
i don't know how find place part (one of 4 triangles) of cursor in rectangle. this image more efficient explication :s im in javascript (so rectangle div, 0,0 placed) have varaibles : var cursor_x = e.clientx + $(document).scrollleft() var cursor_y = e.clienty + $(document).scrolltop() var rect_w = $( rectangle ).width() var rect_h = $( rectangle ).height() i want know mathematically cursor, in triangle 1, 2, 3 or 4 thx what think easiest way first normalize y computation same square , check on side of diagonals are... var ynorm = y * w / h; var s1 = x > ynorm ? 0 : 1; var s2 = (w - x) > ynorm ? 0 : 1; var area = s1*2 + s2; the final area variable number between 0 , 3 telling in of 4 parts are.

python - In Django, a way for user to upload file to server, then move to Amazon S3? -

i have web project users uploading .wav files. want generate waveform image .wav file once it's uploaded. storage, want use amazon s3. thing is, want use timeside (http://code.google.com/p/timeside/wiki/pythonapi) generate waveform image .wav file. after speaking coder timeside project, said wouldn't appropriate generate waveform image when .wav file coming amazon s3. thinking needs it's thing user uploads .wav file , after timeside has it' thing, copy .wav file , waveform image on amazon s3 , delete files upload server. make sense it? can use python boto library this? or have code own django backend? i agree, work should done on server upon upload. if s3, believe 1 do: http://aws.amazon.com/code/134?_encoding=utf8&jiveredirect=1 . found tutorial perhaps might http://www.holovaty.com/writing/amazon-s3-media/

tfs2010 - TFS 2010 - WebDeploy to IIS6 -

i have setup build configuration in tfs2010 msbuild arguments deploy using webdeploy remote iis6 webserver. can deploy remote web server using webdeploy manually vs2010 without issue. but, when kick off tfs build fails permission denied error when attempting deploy remote box. have added user administrator group on webserver box. i found in security event log domain wasn't set: logon failure: reason: unknown user name or bad password user name: tfssvcuser domain: logon type: 3 logon process: ntlmssp authentication package: ntlm workstation name: tfsserver when run manually domain set. tfssvcuser domain user running such on build server. i running msdeploy 1 right now. any ideas? in end admin tfs box had misread permissions on build server , needed add permissions temp folder or registry, not sure which.

objective c - Working with the frontmost window's controls in a document-based app? -

i've scanned documentation , googled extensively , found nothing on subject. what i'm needing interact specific instance of 1 of nswindows - is, 1 created through nsdocument system put in place creating document-based application in xcode. so there way this? [[nsshareddocumentcontroller frontmostwindow] subview: doaction], perhaps? to obtain frontmost window (aka main window), use -[nsapplication mainwindow] : nswindow *mainwindow = [nsapp mainwindow]; to obtain window corresponding given document: nsdocument *somedocument; // reference document you’re interested in nswindow *window = [[[somedocument windowcontrollers] objectatindex:0] window]; nsdocument creates single window controller manage corresponding document window, -[nsdocument windowcontrollers] returns array single element corresponding window controller. -[nswindowcontroller window] returns window managed window controller.

javascript - XML NodeValue cuts off after 300 characters (in Google Chrome) -

in javascript web app, i'm loading xml files in 2 ways. 1) via ajax call, , 2) response submitting form server. result of each load xmldocument. try , read data out of document. this works fine in ie7. in chrome method (1) works fine, however, when same document loaded via method (2) in cdatasection node value of "nodevalue" limited 300 characters. full text appears in "wholetext". any ideas on why or how can nodevalue work in both situations?

architecture - Does MNesia support synchronization after disconnected operation? -

i'm starting architect project following requirements: the overall system distributed across multiple physical nodes on wan each node using , manipulating common set of data records operations on these records must resilient network outages i'm considering utilizing mnesia/erlang base platform project, i'd know how (mnesia) can handle simultaneous disconnected conflicting operations on data set. an illustrative scenario: nodes , b have connectivity , empty data set. node adds record (1, abc). here, record sets should transparently synchronize , node b has record (1, abc). network connectivity between them lost. node alters record (1, def). node b (later timestamp) alters record (1, ghi). network connectivity restored expected: after transparent synchronization, both nodes contain record (1, ghi). to simplify, let's assume complete change history not required (e.g. it's not important record 1 used contain abc or def, it's important c...

What are some good uses of the Singleton pattern? Is it ever acceptable? -

possible duplicate: singleton: how should used i've read singletons bad. instance, makes code hard test. there acceptable uses of singletons? sometimes want 1 , 1 connection database. making connector singleton ensures not spin multiple connections.

sql - Best way to structure table for commission reports -

i want have table track commissions due our wireless sales. each plan pays different commission, not problem. our reconciliation carriers don't pay (they may miss line or 2). the problem occurs when carriers change how pay commissions. want able go , see there 4 lines not paid in january @ commission rate x. feb same types of plans sold commission rates x-10. if change rate in commission table plan, when go pull data january report incorrect commission rates. i have table sales set date stamp thinking can cross reference somehow. hope followed this. i looking best way structure this. you should "stamp" record commission rate. either stamp actual rate every record... or keep commission id , put each record.

What are the associations between the models in a subscription/recurring billing Rails app? -

this how schema 4 models look: http://pastie.org/1576759 the plan table stores data on actual plans. subscription stores each month user 're-subscribes' service. transaction stores payment related info. how associations work between models ? e.g. user :belongs_to plan, :through => :subscription ? a subscription "has_many" :plans ? i bit fuzzy on how ties respect rails , associations. class subscription < activerecord::base belongs_to :user belongs_to :plan end class user < activerecord::base belongs_to :plan has_many :subscriptions (or has_one, if user has 1 subscription @ time) has_many :transactions end class transaction < activerecord::base belongs_to :user belongs_to :plan end class plan < activerecord::base has_many :subscriptions has_many :users end

php - how to get the server's execution time via curl -

for example, request www.domain.com via curl in php $curl = curl_init('http://www.domain.com'); curl_exec($curl); var_dump(curl_getinfo($curl)); i can 'total_time', 'starttransfer_time', 'connect_time',etc. can't server's execution time (sometime, curl request takes lot time, wasted in transfer). possible or missed parameters? that's not possible. there no way curl know how time spend server processing request, , how lost due transfer. if need information try including on page requesting through curl , parsing out. example, add little message footer of page says page generated in xx.yyyy seconds . or cleaner, add custom http header contains execution time. read header on curl side.

kdevelop - How to create a C project? -

i'm using kdevelop create c++ projects. need create c project. in 3.xx versions, had option create c projects, i'm using kdevelop 4.2 , can see c++ project templates( qt / nogui ). how should configure kdevelop c projects? have checked "show project templates" while in new project dialog box? see question reference (look @ screenshot): kdevelop 4.0 : no project templates

c# - Outlook : How to get email from Recipient field? -

i'm attempting email address typed to field of compose mail window. i try address property of recipient, according vs, should give me email. i instead receiving string looks this: "/c=us/a=att/p=microsoft/o=finance/ou=purchasing/s=furthur/g=joe" how can email address in recipient field? my code far: list <string> emails = new list<string>(); if (thismailitem.recipients.count > 0) { foreach (recipient rec in thismailitem.recipients) { emails.add(rec.address); } } return emails; can try ? emails.add(rec.addressentry.address); reference link edit: i don't have right environment test i'm guessing this, how about string email1address = rec.addressentry.getcontact().email1address; or .email2adress or .email3address also there is, rec.addressentry.getexchangeuser().address that might want try.

java - Why can't i send a MessageConnection message from a Blackberry group address? -

i'm trying send lot of sms texts @ once, works fine when pull numbers contacts themselves, when them group illegalargumentexception says "invalid destination address: trailing characters:" followed recipient's number. i numbers contacts this: private void addcontactgroup(blackberrycontactgroup group) { blackberrycontact contact; for(int i=0;i<group.numcontacts();i++) { _cntctsnmbrs.addelement(group.getaddress(i).trim()); } } and send message: try { _conn = (messageconnection)connector.open("sms://"); final textmessage msgout = (textmessage) _conn.newmessage(messageconnection.text_message, "sms://"+_cntctsnmbrs.elementat(i)+":0"); msgout.setpayloadtext(frmtdmsg); _conn.send(msgout); } catch (final exception e) {} i searched on couldn't find error anywhere. it turns out of rim oses add invisible control characters strings of group's addresses, called s...

compiler theory - Is it possible to convert low level languages to high level ones? -

we know compiler can convert high level languages lower ones,like convert c assembly. but possible other way around? to point, yes. called decompilers. http://en.wikipedia.org/wiki/decompiler

ASP.NET: Disabling postback of the contents of a TextBox -

in page have read-only textbox contains rather large amount of text. noticed on postback text sent server , validated, though client can never modify it. seems silly; there way disable behavior? consider making div or element not post content, if read content

php solution for parsing resulting html after ajax clicks -

i'm using curl login site , grab html 1 of pages. problem page has ajax links on (click on link results html changes). how able make clicks of link , html of final state using php? seems researching need sort of headless browser? there in php can use? i'm not aware of headless browsers supports javascript/ajax can drive php. if want drive real browser php, see http://seleniumhq.org/

auto import all sub modules in a folder then invoke same name functions - python runtime inspect related -

i have open folder on computer, openfunctions\ ____template.py function1.py function2.py ...... functionx.py this folder experimental purpose extend ability of whole app can doing. let’s think quick , dry trying, no security consideration in case. my purpose is, if drop functionx.py following ____template.py , app can know new functions available , invoke functions defined in new joined file in someway – plugin system, should bit different. so wrote ____inspect.py may let application have ability know has been inputed. here ____inspect.py def get_this_file_defined_functions(name_filter = "__"): import inspect, sys f = inspect.getmembers(sys.modules[__name__], inspect.isfunction) return [x x in f if not x[0].startswith(name_filter)] def get_this_module_sub_modules(name_filter = "__"): import os.path, pkgutil pkgpath = os.path.dirname(__file__) m = [name _, name, _ in pkgutil.iter_modules([pkgpath])] ...

c# - Cross-thread operation not valid -

possible duplicate: cross-thread operation not valid: control accessed thread other thread created on okay, know why giving me error: cross-thread operation not valid: control 'form1' accessed thread other thread created on. but... how can make workable? system.threading.thread t = new system.threading.thread(()=> { // hard work , then... listview1.items.add(lots of items); lots more ui work }); t.start(); i don't care when, or how thread finishes, don't care fancy or on complicated atm, unless it'll make things easier when working ui in new thread. you can't. ui operations must performed on owning thread. period. what could do, create items on child thread, call control.invoke , databinding there. or use backgroundworker backgroundworker bw = new backgroundworker(); bw.dowork += (s, e) => { /* create items */ }; bw.runworkercompleted += (s, e) => { /* databind ui element*/ }; ...

math - Avoiding problems with JavaScript's weird decimal calculations -

i just read on mdn 1 of quirks of js's handling of numbers due being "double-precision 64-bit format ieee 754 values" when .2 + .1 0.30000000000000004 (that's article reads, 0.29999999999999993 in firefox). therefore: (.2 + .1) * 10 == 3 evaluates false . this seems problematic. can done avoid bugs due imprecise decimal calculations in js? i've noticed if 1.2 + 1.1 right answer. should avoid kind of math involves values less 1? because seems impractical. there other dangers doing math in js? edit: understand many decimal fractions can't stored binary, way other languages i've encountered appear deal error (like js handles numbers greater 1) seems more intuitive, i'm not used this, why want see how other programmers deal these calculations. in situations these tipically rather make use of epsilon estimation. something (pseudo code) if (abs(((.2 + .1) * 10) - 3) > epsilon) where epsilon 0.00000001, or whatever preci...

use JQuery to get siblings -

i'm trying tag below grab value select , paste input. <td class="ms-formbody" style="width:385px"> <input name="ctl00$placeholdermain$dlfields$ctl00$txtsource" type="text" id="ctl00_placeholdermain_dlfields_ctl00_txtsource" class="ms-input" /> <select name="ctl00$placeholdermain$dlfields$ctl00$ddlsourcefields" id="ctl00_placeholdermain_dlfields_ctl00_ddlsourcefields" class="ms-input"> <option value="some field name 1">some field name 1</option> <option value="some field name 2">some field name 2</option> <option value="some field name 3">some field name 3</option> <option value="some field name 4">some field name 4</option> </select> <a href="javascript: appendfield();">append</a> </td> i can't se...

python - Is wxPython good for a Hardware Simulator? -

for computer architecture assignment, trying replace c++ library called "sim" in python. i using myhdl simulator, c++ program has nice interactive feature lets students see components connected (gates, inputs, outputs, flip flops, etc.) , toggle signal. i attempting create interactive aspect , need pick library use. wondering if wxpython choice in case. gui needs draw gates or devices flip flops , counters, use lines connect them, , have representation of signals (0 , 1 instance or black , white). is wxpython idea, or there better libraries application? it sounds you're simulating logic circuits? depending on kind of ui looking for, i'd wxpython job. may not need that, however. most python distributions include tkinter, simple gui library. there example here of existing (albeit old) digital circuit simulator written in python using tkinter , pmw: http://cvs.savannah.gnu.org/viewvc/pydcs/?root=pydcs i suggest taking @ pygame. although it'...

android - Main Activity is not garbage collected after destruction because it is referenced by InputMethodManager indirectly -

i followed "avoiding memory leaks" article here . however proposed solution not solve leak problem. tested android emulator on windows xp (sdk 2.3.1). dumped heap , checked main activity still in heap (i used mat) here's did: create helloworld app helloworldactivity (it has no child views) run emulator , launch helloworld app. close clicking back-key. cause gc in ddms , dump heap <-- here found helloworldactivity instance. 'path gc roots' shows following path. helloworldactivity <- phonewindow$decorview <- inputmethodmanager inputmethodmanager singleton , 3 references decorview references helloworldactivity. i can't understand why inputmethodmanager still references decorview instance after activity destroyed. is there way make sure main activity destroyed , gc-able after closing it? it seems calling inputmethodmanager's methods 'windowdismissed' , 'startgettingwindowfocus' stuff. something this: ...

How to get html button reference nested in a gridpanel in ExtJS -

<table cellspacing="0" cellpadding="0" border="0" class="x-btn-wrap x-btn x-btn-text-icon" id="ext-comp-1169" style="width: auto;"> profile in code, how can reference button element? in particular case, ext.getcmp('ext-comp-1169') trick. however, should manually assign more sensible id values components using id config option - otherwise auto-assigned ids.

Confused with Java Encapsulation Concept -

good day! i reading java book encapsulation , mentioned getter , setter method. i've read hide attributes, must mark instance variables "private" , make "public" method of getter , setter access data. tried making similar not conventional code follows: public class addressbookentry { private string name; private string address; private string telno; private string email; public void getallinfo() { name = joptionpane.showinputdialog("enter name: "); address = joptionpane.showinputdialog("enter address: "); telno = joptionpane.showinputdialog("enter tel. no: "); email = joptionpane.showinputdialog("enter email address: "); } } does code above exposes variables because assigned directly? how can better? better if make conventional getter , setter method instead , assigned values on other class? "hiding data" means? thank you. yes , ...

apache2 - PHP APC module. Any disadvantages? -

i wanted know if thought if there disadvantages using apc? also, i'd interested in reviewing these options below , getting opinion on them. thanks. ; enable apc extension module extension = apc.so ; options apc module apc.enabled=1 apc.shm_segments=1 apc.optimization=0 apc.shm_size=256m apc.ttl=7200 apc.user_ttl=7200 apc.num_files_hint=1024 apc.mmap_file_mask=/tmp/apc.xxxxxx apc.enable_cli=1 apc.cache_by_default=1 practically none, if you're comparing not using bytecode cache @ all. having said that, here's might need aware of: apc additional piece of software, if there's bug in apc site may affected it. happens time time, apc used software chances you'd encounter bug wasn't found , fixed quite low unless serious dark magic php. beware of scripts change or of applications generate large number of files may not ever used again (some templating systems might that). eat memory , reduce efficiency of caching, use apc.filters ignore such files...

WPF Datagrids slow when using Auto column sizes -

when expand expander in code below, application becomes sluggish , takes 2-3 seconds respond resize/move events triggered user. if set second column <columndefinition width="250"/> response time remains optimal. missing here? (i'm need ui per below without sluggishness) <usercontrol> <grid> <grid.rowdefinitions> <rowdefinition height="auto" /> <rowdefinition /> </grid.rowdefinitions> <grid.columndefinitions> <columndefinition /> <columndefinition width="auto" /> </grid.columndefinitions> <toolbar .. /> <datagrid grid.row="1" itemssource="{binding collection1}" .. /> <expander grid.column="1" grid.rowspan="2"> <datagrid itemssource="{binding collection2}" .. /> </expander> </grid> </usercontrol> fyi: suspect row virtualiz...

Unable update and delete database views in silverlight business application -

in silverlight buspliiness apcation updating database domain context updated should when want update , delete record original table. you must call domaincontext.submitchanges() if mean situation.

objective c - Error: "-[UIView setHostedGraph:]: unrecognized selector" while executing the core plot in iPhone app -

i below error when try compile below code: * terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[uiview sethostedgraph:]: unrecognized selector sent instance 0x6768c10' code: uiview *chartview; chartview = [[uiview alloc] init]; graph = [[cpxygraph alloc] initwithframe: chartview.bounds]; cpgraphhostingview *hostingview = (cpgraphhostingview *)chartview; hostingview.hostedgraph = graph; what wrong? please , suggest. thanks you're casting uiview instance (which not respond -sethostedgraph: ) cpgraphhostingview . - not work. you'll need create actual cpgraphhostingview object, then invoke -sethostedgraph: on it. so, code should this: cgrect someframe = ...; cpgraphhostingview *hostingview = [[cpgraphhostingview alloc] initwithframe:someframe]; graph = [[cpxygraph alloc] initwithframe: hostingview.bounds]; hostingview.hostedgraph = graph;

asp.net - How can i bind a Database field value to a hidden field inside a gridview -

i use following bind field table hidden field inside gridview getting error system.data.datarowview' not contain property name 'accounttype'. this how assigned <asp:templatefield> <itemtemplate> <asp:hiddenfield id="hdnaccnttype" runat="server" value='<%#eval("accounttype") %>' /> </itemtemplate> </asp:templatefield> is correct or have make corrections? my stored procedure: create definer=`root`@`%` procedure `uspgetemployeebankdate`(_empid int(11), _banktypeid varchar(10),_accounttype varchar(10)) begin select empid,banktypeid,date_format(startdate, '%y-%m-%d') startdate,date_format(enddate, '%y-%m-%d') enddate tblemployeebankdata empid=_empid , banktypeid=_banktypeid , accounttype=_accounttype; end sample code if (mlocal_ds.tables[0].rows.count != 0) { foreach (datarow drrow in mlocal_ds.tables[0].rows) {...

ruby on rails - installing passenger on Apache2 using rvm -

i've installed apache2 , runs okay. and i've installed rvm following this link . after that, i've execute follow commands order. of these commands this link installing redmine . rvm install 1.8.7 rvm use 1.8.7 gem install rails -v=2.3.5 gem install postgres-pr pq gem install i18n -v=0.4.2 gem install passenger passenger-install-apache2-module and append apache2.conf loadmodule passenger_module /home/myhome/.rvm/gems/ruby-1.8.7-p330/gems/passenger-3.0.2/ext/apache2/mod_passenger.so passengerroot /home/myhome/.rvm/gems/ruby-1.8.7-p330/gems/passenger-3.0.2 passengerruby /home/myhome/.rvm/wrappers/ruby-1.8.7-p330/ruby this log apache after restart [notice] apache/2.2.16 (ubuntu) php/5.3.3-1ubuntu9.3 suhosin-patch phusion_passenger/3.0.2 configured -- resuming normal operations but!!!, if open redmine root page, shows file list in public directory. think passenger may not work correctly. why? , how fix this? i've tried can 2 days t-t have ad...

jsp - Need to get Oldest MQMessage From MQQueue -

hi new ibm mq. here requirement oldest mqmessage mqqueue regardless of priority set , display in jsp monitoring purpose. in existing code, qmgr = new mqqueuemanager(qmanager); int openoptions = mqc.mqoo_inquire | mqc.mqoo_browse|mqc.mqoo_input_shared; mqqueue eventqueue = qmgr.accessqueue(qname, openoptions, null, null, null); mqmessage retrievedmessage = new mqmessage(); mqgetmessageoptions gmo = new mqgetmessageoptions(); gmo.options = mqc.mqgmo_browse_first; eventqueue.get(retrievedmessage, gmo); here able mqmessage, may not oldest 1 in queue. have no idea this. please me out there way one. if queue fifo browse return oldest message. if queue set priority delivery have browse queue until found first message of lowest priority. code snippet indicates event queue. if refers system.*.event queues should in fifo mode. if administrator changes them priority delivery, system event messages produced @ same priority. the diffic...

How to determine UDP socket buffer size in C#? -

i'll sending udp packets (1500 bytes) of ecg data continuously 5 minutes. safe socket.receivebuffersize use? i'll filtering data , plotting data comes in. want prevent buffer issues. if want prevent issues need use tcp. in case using udp posibly loss data or wrong sequence of packets.

web services - Is there async C++ HTTP framework available? -

to implement rest service, need async c++ http framework, based on reactor or proactor model. think boost asio socket async tcp/udp framework, it's lack of http support. can recommend one? also, can suggest curlpp c++ wrapper libcurl http://curlpp.org/

java - Minimal BPEL/BPMN requirement? -

i'm new bpel/bpmn. is possible write bpel/bpmn aware software without ws-* web services , ejb container such jboss, weblogic, glassfish? i want know if there quickstart tutorials on creating bpel/bpmn programs maven , eclipse. and, open engines apache ode , jbpm provide wysiwyg workflow designer end users behind browser? bpel depending on ws- , if want use standard bpel, cannot avoid web services. bpmn 2.0 provides abstraction, means can use bpmn ws- , java or whatever want long engine supports that. activiti instance bad in ws-* quite when want embed java app. the eclipse bpel designer has deployment descriptor editor , deployer apache ode , jboss riftsaw, latter ode jboss foo.

c# - Entity Framework 4 - Delete Object -

Image
i have 3 tables in database cmsmasterpages cmsmasterpagesadvslots (pure juction table) cmsadvslots here picture of edm: i need find out objects cmsadvslot connected cmsmasterpage (it working in code posted belove), , delete result (cmsadvslot) database. my problem i not able delete objects when found theme. error: object cannot deleted because not found in objectstatemanager. int findmasterpageid = convert.toint32(uxmasterpageslistselector.selectedvalue); cmsmasterpage mymasterpage = context.cmsmasterpages.firstordefault(x => x.masterpageid == findmasterpageid); var resultadvslots = mymasterpage.cmsadvslots; // working until here foreach (var todeleteadv in resultadvslots) { context.deleteobject(mymasterpage.cmsadvslots.any()); // erorr here!! context.savechanges(); } any idea how solve it? time! :-) try this: while (mymasterpage.cmsadvslots.count > 0) { var slo...

java - Calling web services from Mainframe batch programs -

we looking @ doing partial migration away main frame. some of functionality written in mainframe cobol called mainframe batch programs. we move these cobol programs off mainframe. if example moved functionality in cobol programme java or .net web service. way call web service mainframe batch programme? first off, not sure if there way call web services directly cobol, had similar problem trying call web services iseries(as400) using rpg , cl. in end, wrote simple socket program in java, running on server, called webservicebridge, , bridge program took data socket program , constructed webservice call in java. results of piped through socket. if cobol struggles web services, may simple solution. aware bridge need monitored, resilient , available in same way design web services.

delphi - applications shares same BDE -

i encouter problem application when turn in pc running other application using same bde application , application can't store record in database in case, thre configuration make in bde resolving problem . if operating system xp or win7 try editing bde settings in bde administrator in control panel (backup idapi.cfg first, of course!). under configuration|system|init change sharedmemlocation 6bde. restart computer. this allow bde called mulitple programs. may allow 2 programs use bde.

iphone - UINavigationcontroller initWithRootViewController from appDelegate, empty view? -

i ran problem. i want initialize uinavigationcontroller uiviewcontroller. viewcontroller gets loaded .xib using uinavigationcontroller *mynavigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:appdelegate.myviewcontroller]; [self presentmodalviewcontroller:mynavigationcontroller animated:yes]; unfortunately view empty. am doing wrong or there other way achieving aim? if allocating instance of viewcontroller so uiviewcontroller *acontroller = [[uiviewcontroller alloc] initwithnibname:@"myviewcontroller" bundle:[nsbundle mainbundle]]; and having button inside nib, app crashes when tapping on it. thanks lot. myviewcontroller *acontroller = [[myviewcontroller alloc] initwithnibname:@"myviewcontroller" bundle:[nsbundle mainbundle]]; or uiviewcontroller *acontroller = [[myviewcontroller alloc] initwithnibname:@"myviewcontroller" bundle:[nsbundle mainbundle]]; then push since if u type this uiv...

c - Read register value to variable, with one asm command -

how can read register value variable 1 inline assembler command? using gcc on old freebsd system (v2.1 i386). i have such code: static volatile unsigned long r_eax, r_ebx; asm ("movl %%eax, %0\n" :"=r"(r_eax)); asm ("movl %%ebx, %0\n" :"=r"(r_ebx)); as result this: mov %eax,%eax mov %eax,0x1944b8 mov 0x1944b8,%eax mov %ebx,%eax mov %eax,0x1944bc mov 0x1944bc,%eax but need just: mov %eax,0x1944b8 mov %ebx,0x1944bc how can achieve result? this me (as long r_eax / r_ebx static) asm ("movl %%eax, %0\n" "movl %%ebx, %1\n" : "=m"(r_eax), "=m"(r_ebx)); beware that, unless specify assembly language statements within same asm() bracket, compiler might decide sorts of "interesting optimizations" in-between, including modifications these regs.

progressdialog - Android - progress dialog does not close -

i have listactivity class, , when item on list clicked, new activity displayed. new activity takes time load, users know there happening (in form of progress dialog) so, in order this, implemented runnable in class - public class protocollistactivity extends listactivity implements runnable { private progressdialog progdialog; .... protected void onlistitemclick(listview l, view v, int position, long id) { progdialog.show(this, "showing data..", "please wait", true, false); thread thread = new thread(this); thread.start(); } .... public void run() { // code start new activity based on item user has clicked. } initially, when click, , new activity being loaded, progress dialog works nicely, when close previous activity (to list) progress dialog still running. want progress dialog show time new activity being started. can please guide me on how correctly. dialogs needs explicitly removed programmer (or close user)...

drupal - How to update the value of a single field invoking appropriate validation -

i'm making module allow users update single fields on in case, user entity. the code below example of method have been using working , test other elements of module global $user; $account = user_load($user->uid); $edit = (array) $account; $edit['field_lastname']['und'][0]['value'] = 'test'; user_save($account, $edit); however bypasses field validation defined elsewhere in drupal. don't want reproduce validation written elsewhere - it's not drupal way! my question is: there function in drupal 7 can called update value of single field. imagine such function clear appropriate caches, invoke fields validation etc. i aware solution totally different current user object based one. can't life of me find appropriate function in api. wander whether fact looking save function alone problem - , there other necessary steps come before. any gratefully appreciated. check out drupal_form_submit function. lets submit forms co...

multithreading - Multiple thread accessing same DB tables from two different DB connections -

i have threads running on program(each thread has own connection db), want access same tables cause problems? to simple i have: 2 threads t1 , t2 2 db connections c1 , c2 1 table dbtable1 t1 uses c1 , t2 uses c2 t1 keep on inserting, deleting, updating table dbtable1 t2 reading table dbtable1 will there issues? i using ms sql server. databases designed handle concurrent users in these scenarios using transactions .

flash - Set instance in script AS2 -

is possible set instance name mc in script? in as2, movieclips have _name property can , set.

iphone - Customize moreNavigationController -

i trying customize morenavigationcontroller in uitabbarcontroller. have been reading lot of posts , guides style , have managed change tint color of navigation bar , background color of table view there still few things customize. i have changed tint color , background this: tabcontroller.morenavigationcontroller.navigationbar.tintcolor = [uicolor orangecolor]; tabcontroller.morenavigationcontroller.topviewcontroller.view.backgroundcolor = [uicolor colorwithpatternimage:[uiimage imagenamed:@"tableview-background-blue.png"]]; tabcontroller.morenavigationcontroller.view.backgroundcolor = [uicolor colorwithpatternimage:[uiimage imagenamed:@"tableview-background-blue.png"]]; i change seperate color (the border) of uitableview. change tint color of navigation bar appears when clicking "edit". great if change language of whole thing (the "more" , "edit" tab , on) would these changes possible , if so, know how? i t...

java - Why does this not result in 1000? -

possible duplicate: java problem-whats reason behind , probable output long milli=24*60*60*1000; long micro=24*60*60*1000*1000; long result=micro/milli; the result should 1000 not. why work when use 24*60*60*1000*1000l ? can tell me reason this? the trouble calculation done on int s , casted long , , unfortunately 24*60*60*1000*1000 won't fit in int , wraps around. like long micro=24l*60*60*1000*1000; to force last multiplication done on longs.

java - How to displaying twits or dynamic data from social media....? -

can knom how twits displaying in section "sample sentence social media on 'misty' " in site dictionary30.com/meaning/misty they're pulling tweets context twitter. have @ twitter4j with twitter4j pull tweets whatever context want in real time. e.g location based, hashtag based, name based etc! if wanted build on website use jquery render them. make shiney slinder! :)

iphone - emailing an image picked by user from UIpickerController -

what want in app have user select image in library, attach image email , send it. i have read multiple examples, cant seem work this - (ibaction)buttontouched:(id)sender; { // create image picker controller uiimagepickercontroller *imagepicker = [[uiimagepickercontroller alloc] init]; // set source camera imagepicker.sourcetype = uiimagepickercontrollersourcetypephotolibrary; // delegate self imagepicker.delegate = self; // allow editing of image ? // imagepicker.allowsimageediting = no; // show image picker [self presentmodalviewcontroller:imagepicker animated:yes]; } this code tried image @ button press. how email, dont understand how returns image , in format any welcome :) i have same request weeks ago, have display uiimagepickercontroller , let user select image, , save in variable. uiimage *image; next implemente method: // displays email composition interface inside application. populates mail fields. -(void)displaycomposersheet...

java - Wicket: getModelObject returns null -

i in trouble getmodelobject. returning null. model concept not clear me. code is: public class spacechecklistwindow extends webpage { private spacechecklistform spacechecklistform; private page parentpage; private modalwindow modalwindow; public spacechecklistwindow(page parentpage, final modalwindow modalwindow) { this.parentpage = parentpage; this.modalwindow = modalwindow; string[] labels = new string[] { "a", "b", "c", "d", "e", "f" }; list<listmemeber> list = new arraylist<listmemeber>(); for(string label : labels) { list.add(new listmemeber(label)); } addcomponent(list); } private void addcomponent(list<listmemeber> list) { spacechecklistform = new spacechecklistform("form", list); add(spacechecklistform); } private class spacechecklistform extends form { ...