Posts

Showing posts from January, 2014

linux - Are there any replacement for Synaser Serial Communciation tool for Lazarus compiler? -

i working latest lazarus compiler , have worked synaser serial communication previous version of lazarus. has worked flawlessly, latest version of lazarus synaser code not compiling raising sorts of error. so, question this. there replacement synaser tool lazarus? if not, there update synaser tool? fpc 2.6.2 lazarus 1.0.8 there several serial communication (com port) options available lazarus, first suggest giving synaser try. i'm using lazarus 1.2.4 synaser synapse v40 , latest trunk revision without problems. alternative com port implementations: tcomport port lazarus (cportlaz) serial communications windows api (createfile, readfile, setcommmask, etc) more in hardware access , serial communication lazarus

networking - Android InetAddress.getByName(ip).isReachable(timeout) always returns false -

i see 24 similar questions asking inetaddress.isreachable() instance never returns true, when network otherwise reachable, 1 exception of tests against 127.0.0.1 . if (inetaddress.getbyname("google.com").isreachable(2000)) { system.out.println("visible"); } else { system.out.println("not visible"); } and permissions <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_network_state"/> this code started within thread (of course). app needs know if specific ip accessible (not google, in above example). behaves same in emulator. is there better way test network connectivity?

UIScrollView with iOS Auto Layout Constraints: Wrong size for subviews -

Image
i'm trying generate view in code. here's hierachy of view object uiscrollview uiview uibutton the scrollview should same size window. button should big possible. i'm using ios auto layout, constraint strings of objects this h:|[object]| v:|[object]| i've set translatesautoresizingmaskintoconstraints no each object. the problem button gets default button-size. parent view object (uiview) gets size subviews need. red: uiscrollview / yellow: uiview how can force views big scrollview? when use uiview instead of th uiscrollview works great... here's code: - (void) viewdidload { [super viewdidload]; // scroll view uiscrollview* scrollview = [uiscrollview new]; scrollview.backgroundcolor=[uicolor redcolor]; scrollview.translatesautoresizingmaskintoconstraints = no; //container view uiview *containerview = [uiview new]; containerview.translatesautoresizingmaskintoconst

scala - Pattern matching on tail of arrays -

i trying implement distinct function on arrays this: def distinct(a: array[int]): array[int] = match { case array() => case array(head, tail @ _*) => head +: distinct(tail.toarray).filter(_ != head) } i don't like, have transform tail toarray every time. otherwise compiler complains tail sequence , not array. possible pattern match better in case? it isn't sexy enough pattern matching, go way: def distinct(a: array[int]): array[int] = match { case array() => case htail => htail.head +: distinct(htail.tail).filter(_ != htail.head) }

c# - Winforms version WPF ScaleTransform? -

i'm attempting create of software zoom image in winforms application. noticed answer similar issue stating achieved mousewheel using private void image_mousewheel(object sender, mousewheeleventargs e) { var st = (scaletransform)image.rendertransform; double zoom = e.delta > 0 ? .2 : -.2; st.scalex += zoom; st.scaley += zoom; } that solution need, appears part of system.windows.media, doesn't seem part of winforms architecture. does know of similar option winforms end resembling functionality? google searches haven't turned :( thanks! you might want graphics.scaletransform . idea of arbitrary transformations part of rendering process isn't all-pervasive in windows forms, transform 1 image image via graphics , believe.

javascript - Exists a way to let crawlers ignore parts of a document? -

i aware can control documents crawler/spider can access robots.txt, meta tags, link attributes , on. but in special case want portion of document being ignored. portion can not exist in iframe, "normal" content. <noscript> blocks amazing, mark partial content "don't index this, please." first, thought using document.write() write out parts, learned assumption "spiders not execute javascript" seems wrong. i thinking serving different version of page when detect crawler, not accurate, right? also, can not put content on image. are there tricks avoid getting specific part of document (not specific words spread around document) indexed? [edit] know "if user agent in list of robots", don't idea. possibly there more agnostic approach. part suppressed contains dynamic content , whatever doing, has work "old" browsers ie6 :\ only difference between static content , dynamic content extension of file incl

cypher - Neo4j Auto indexing issues -

i have tried auto indexing , have set neo4j.properties file following: # autoindexing # enable auto-indexing nodes, default false #node_auto_indexing=true # node property keys auto-indexed, if enabled #node_keys_indexable=name,type,currentversion,datetimecreated,currentversiondatetime,versioncount, customername,documentreference,version before had set node_auto_indexing=true false , created own index testing want auto index node properties? and when run cypher query returns 0 rows? start n = node:node_auto_index(name = "mike") return n; what doing wrong here? did create nodes when node_auto_indexing false? if so, these existing nodes won't "automatically" indexed when set property true. have manually add them auto index ( http://docs.neo4j.org/chunked/milestone/auto-indexing.html ) note new nodes created node_auto_indexing=true indexed without manual intervention.

c# - How to get modified Image (img) Source (src) server-side? -

i stuck on giving me headache. new asp.net , can't through seems simple in php. i have img element declare empty src attribute : <img runat="server" id="result_img" /> on client-side, have script changes values of attribute : var img = $("img[id$='result_img']")[0]; img.src = 'pathtoimg'; the image showing , perfect. however, when try modified value on server-side this var urlimage = result_img.src; the 'src' attribute still empty. am doing wrong or impossible in asp ? thanks help i attach event handler click event on save button, or form submission event, , write image hidden field there. or use ajax post server.

c++ - Is it wise to use a pointer to access values in an std::map -

is dangerous returning pointer out of std::map::find data , using opposed getting copy of data? currently, pointer entry in map , pass function display data. i'm concerned items moving causing pointer become invalid. legit concern? here sample function: mystruct* structmanagementclass::getstructptr(int structid) { std::map<int, mystruct>::iterator foundstruct; foundstruct= mystructlist.find(structid); if (foundstruct== mystructlist.end()) { mystruct newstruct; memset(&newstruct, 0, sizeof(mystruct)); mystructlist.structid= structid; mystructlist.insert(pair<int, mystruct>(structid, newstruct)); foundstruct= mystructlist.find(structid); } return (mystruct*) &foundstruct->second; } it undoubtedly more typical return iterator pointer, though makes little difference. as far remaining valid goes: map iterator remains valid until/unless item refers removed/erased map. when ins

ajax - Change encoding on the fly with jquery or php -

i have problem ajax , php querys involving hebrew. when submit form method on php hebrew string, lets "בית", sends me page address: search.php?q=%e1%e9%fa. pulls data database ease. but ajax , jquery address looks this: search.php?q=בית. result, needless - isn't working when trying pull data data base. what type of encoding %e1%e9%fa? , there way of changing on fly in php or jquery? tried googling quite time no success. help appreciated. try following var text = 'בית' var textencoded = encodeuricomponent(text) and send textencoded query parameter

html - Vertical Align inside <p> tag -

Image
i have html: <div id="workallocated"> <h3>work allocated</h3> <p>lorem ipsum</p> <p>lorem ipsum</p> </div> and following css: div#contentarea.profile_edit div { margin-bottom: 20px; } div#contentarea.profile_edit div.col_01 h3 { font-size: 2.4em; margin: 0; } div#workallocated p { margin-bottom: 0px; border-bottom: 1px solid red; } the result looks snapshot: but need looks this: the different vertical align of text inside <p> tags. aligned top-left inside <p> container should middle-left. i've tried tricks change line-height , change display table-cell , apply vertical-align property, none of them work. thanks in advance! set height p's , set line height equal one.

eclipse - google directions on maps api v 2 issue -

i had question hope can answer. creating app allow people directions. now, question is: have make new class (activity) add directions right? , every service distance matrix, , markers, etc. didn't know if necessary. so, pretty shortining asking, every new service, need create new class, or can add existing class. if had line of script learn off of, great. building way world. so, in short, need put directions on app. got google maps work. pretty much, right now, map. there nothing else it. need adding directions. reads this. if interested in adding painted directions on map, follow blog post wrote on topic: google maps v2 android: draw driving direction on map in end of post find working project use in order understand how added map.

html - Request Help: Multiple Boxes -

i having trouble creating multiple boxes future website. css3 coding: #content-box1, #content-box2, #content-box3, #content-box4{ padding:10px; border:1px solid #bbb; position:absolute; margin-top:190px; height:120px; } #content-box1 { margin-left:212px; width:200px; } #content-box2 { margin-left:444px; width:200px; } #content-box3 { margin-left:676px; width:202px; } #content-box4 { margin-left:676px; width:202px; } here's html: <!doctype html> <html><head> <meta charset="utf-8"> <title>complex xhtml , css home page layout test</title> <link href="myflex.css" rel="stylesheet" type="text/css"/> <style type="text/css"> </style> <body> <div id="wrapper"> <div id="header">header</div> <div id="content-box1"&g

java - What can I do to make my program (save as pdf File like Microsoft Excel) -

please, possible make (call) or program same thing when save xls file pdf format. in java program using java api jxl or else i find example import officetools.officefile; // officetools.jar fileinputstream fis = new fileinputstream(new file("test.doc")); fileoutputstream fos = new fileoutputstream(new file("test.pdf")); officefile f = new officefile(fis,"localhost","8100", false); f.convert(fos,"pdf"); but required openoffice there else pdf crator on excel changing extension automaticly on program check example here covert doc, excel, text , images pdf uses itext , apache poi downlaod itext http://itextpdf.com/ downlaod apache poi http://poi.apache.org/download.html you can use example below convert microsoft office word file pdf import java.io.file; import java.io.fileinputstream; import java.io.fileoutputstream; import java.io.outputstream; import com.lowagie.text.document; import com.lowagie.text.doc

javascript - Google Chrome Extension and NPAPI/FireBreath embed webpages -

i developing project intend open multiple webpages in same 1 not using <iframe> . have tried in past using <iframes> end browser ui locking webpage, have been trying find alternatives. i developed small google chrome extension instead having opening webpages, open chrome.windows in position want , works fine, wouldn't want ui around them title bar , buttons sort of 'fullscreen' dimensions defined. chrome.windows.create({ url: app.src, left: wleft, top: wtop, width: wwidth, height: wheight, focused: false, type: "popup" }, function(tab) { self.windowid = tab.id; console.log('window id is: ' + self.windowid); //chrome.windows.update(tab.id, { focused: true, state: "maximized" }) }); while looking chrome extension api read npapi , little more research have found firebreath. since have never did have doubts if there way or possibility, developing plugin npapi/firebreath 1 of following: when opening window chrome

Multiple Relationships in Laravel Query Builder -

i have event model , method called getevents() gets list of events events table in database. each event in turn have delegates associated it, , becomes complicated. there 3 tables, delegate_event (this pivot table, links delegates event based on event_id , delegate_id), delegates (a simple table containing id field , contact_id field) , contacts table contains information on list of contacts. the delegates table uses contact_id link contacts table , pull through various pieces of information associated contact. i using query builder , leftjoin method of information need each event need pull through list of delegates. http://paste.laravel.com/qsa i can't work out how join contacts associated delegates associated event via delegate_event table. can me out here please. thanks. you need many-to-many table event-user because multiple events have multiple users (delegates) associated it. here's have: mtm_event_user: id, event, user events: id, name (of

java - Checking to see if two elements are the same, each element coming from a different string array -

this question has answer here: how compare strings in java? 23 answers the goal of code compare 2 different string[] arrays, , check see how many of elements match. allow methods see whether student has passed or failed test, along determining letter grade. however, every test done results in true being returned them passing , "a" being returned letter grade. elements being compared correctly, still have issue of every element passing .equals(). i.e. answerkey[1] = "b"; studentanswers[1] = "c"; if these 2 elements compared, pass .equals(). public class listofanswers { static final string[] answerkey = {"a", "b", "b", "c", "d", "b", "c", "c", "d", "e", "c", "d", "d"

jquery - Javascript Function Find -

i have been giving javascript @ , i'm finding hard solve this. i need write function findbyname correct name name tom jones passed in. so far have this.. locatorservice.prototype.findbydirector = function() { }; describe('describe text', function () { it('sub text', function() { var locatorservice = new search.locatorservice(data); var expectedresult = [data[0]]; expect(locatorservice.findbyname('tom jones')).to.eql(expectedresult); }); }); var data = [ { title: 'movie 1', startfate: new date('2015-01-01'), cast: [], crew: [ { credit: 'director', name: 'tom jones' }, { credit: 'producer', name: 'bill baily' } ] }, any ideas, new object orientated java script. is thing want? underscore.js good!

sql server 2008 - c# crystal reports database logon error when deployed (works fine on dev-machine) -

i've created crystal report (version 2008) extract data sql 2008 server. has 10 subreports. works fine in crystal designer. wanted write small c# programm run report via crystal runtime, in deployed on different system. here c# code static void main(string[] args) { runreport(convert.toint32(args[0]), args[1].tostring()); } static void runreport(int stoerungid, string version) { reportdocument report = new reportdocument(); report.load(system.configuration.configurationmanager.appsettings["report_basis"]); console.writeline("set parameters..."); report.setparametervalue("id", stoerungid); report.setparametervalue("version", version); report.setdatabaselogon("user","..."); string export_filename = system.configuration.configurationmanager.appsettings["report_export_prefix"] + stoerungid + ".pdf"; console.writeline("export report {0}", export_f

html - Jquery loop through li one by one -

i have following code displays li item 1 one. var show = 1; var current = show - 1; var length = 9; var gallery = $('.quotescroll'); var galleryitems = gallery.children('li'); length = galleryitems.length; setinterval(function(){ current = (current+1)%60; galleryitems.eq(current).slidedown(); galleryitems.eq(current - show).slideup(); }, 10000); the trouble have need loop throught unordered list continuously. how acheive this? edit i found code need, doesn't have nice slide animation. setinterval(function() { var firstli = $('.quotescroll li').first().detach(); $('.quotescroll').append($(firstli)); }, 5000); assuming quotescroll list class: $('.quotescroll li').each(function() { //this refers each li //do stuff each });

push notification - How to handle token in Android? -

i developing android application , implementing push notifications functionality on it. i keep on server users tokens , can send them notification when needed. however , need on how(or more precisely when) send token application server save it. at moment , in first time applications launches , application asks token , sends token along udid server. because of implementation 1st time application launches token not yet retrieved , empty string sent server! of course 2nd time , on token sent normally. (i register udid , token server every time application launches) the code looks : //registering push gcmregistrar.checkdevice(this); gcmregistrar.checkmanifest(this); final string regid = gcmregistrar.getregistrationid(this); if (regid.equals("")) { gcmregistrar.register(this, sender_id); log.i("****************","i registered!!"); } else { log.i("****************","already registered")

Why is MongoDB's local database almost completely in memory? -

Image
i have replicated mongodb setup , seeing lot of page faults. started investigate , found out (through vmmap ) entire local database in memory (that is, part of working set). collection of significance there of course oplog.rs used replication. looking @ queries being run, ones on oplog data lot closer tail head of oplog. why entire thing still in memory? surely should swapped out due large amount of faults. am misunderstanding here? reading vmmap information incorrectly? or going wrong? note testing setup , there other mongod instances running on hardware, therefore total amount of memory used here not sum total in machine. overall, memory usage ~100% though. mongo delegates page management kernel - since uses mapped files, relies on kernel decide page out. local database being touched every time write, or receive read another. oplog capped collection, it's going modifying fixed space in data files (and thus, fixed space in ram), should keep touched , not hi

Asp.net Hyperlink brings complete file path with server -

i have next asp:hyperlink in page <asp:hyperlink runat="server" cssclass="blueii_left" target="_blank" navigateurl='<%#eval("rutacompleta")%>' text='<%#eval("archivo")%>' > </asp:hyperlink> the problem when "rutacompleta" gets evaluated brings like: localhost:62997/someroute/\\complete file path. instead of bringing \\complete file path any ideas??? thanks in advance i think know trying do, have application shows archive list , each item in list direct link pdf file this how setup links <asp:hyperlink id="hyperlink2" runat="server" navigateurl='<%# string.format("~/invoices/{0}.pdf",eval("number")) %>' text='<%# eval("number") %>' target="_blank"></asp:hyperlink> this gets

html - How do I make my footer go down as I add content? -

i structured site this: <body> <div class="main"> <div class="header"> content </div> <div class="section"> content </div> <div class="sidebar"> content </div> <div class="clearing"></div> <div class="footer"> content </div> </div> </body> and css .main { position:relative; width:908px; margin-top:0px; border:solid 0px; margin:0 auto; } .header { position:relative; height:200px; margin: auto; } div.section { float:left; position:absolute; width: 584px; height:500px; margin-top: 0px; margin-left: auto; margin-right: auto; text-align:left; } div.sidebar{ float:right;

c# - asp:Button not responding to clicks with OnClick -

i seem having problem button's onclick, doesn't react @ event. responds onclientclick , executes code, when try relate o function in .aspx.cs class ignores it, , should executing simple code (writing output debug) i've checked every other stackoverflow post find , no 1 had same issue. i know index.aspx executing code inside index.aspx.cs because page_load function outputting debug window, that's not problem. here's important code: <asp:button id="btncreateorder" runat="server" text="create order" onclick="btnclick" /> protected void btnclick(object sender, eventargs e) { system.diagnostics.debug.write("testing3"); } like said page_load function working fine it's not issue of them not being connected. different problem if feel inclined: while you're reading, have problem of not being able find objects html in cs file. what mean is, if reference label:

asp.net mvc 3 - I have 2 controllers intended to be 2 separate web sites (MVC 3)? -

i have 2 controllers (monitoring , audit) contain 4 screens (10 views) each. want create 2 web site example "thesite.org/monitoring" , "thesite.org/audit". in mvc (or/and within iis), how set 2 separate websites (for each controller) , default pages?

Static variables cause crash in OSX network kext -

in mac os x network kernel extension, have noticed if have statically allocated buffer rather dynamic one, leads kernel panic when calling api functions such printf() or send(), ctl_enqueuedata(), many others. if statically allocated buffers can't read or written outside of code. for instance: // ok static char* somevar = null; somevar = osmalloc(50, myosmalloctag); bzero(somevar, 50); // create kernel panic when used outside code static char somevar[50]; bzero(somevar, 50); why that? edit: post code, lengthy , difference between version works , 1 causes panic above. have in mind difference in memory location between static variable , 1 allocated osmalloc. can code within ctl_enqueuedata() access both ? here happened: panic(cpu 0 caller 0xffffff802eeb7e95): kernel trap @ 0xffffff802ee28896, type 14=page fault, registers: cr0: 0x0000000080010033, cr2: 0x0000000000000031, cr3: 0x000000024fbac0a7, cr4: 0x00000000001606e0 rax: 0x000000007fffff01, rbx: 0x0000000000000

javascript - Copy selected text to the clipboard WITHOUT using flash - must be cross-browser -

i want have button selects text in textarea , copies clipboard. can't seem find solutions work in browsers , don't use flash. surely doable? i've seen on place guess use flash, want stay away if possible people don't have it. this have far - selects text: function copycode() { $("#output-code").focus(); $("#output-code").select(); } (the focus not strictly necessary) execcommand('copy') there new option. cross-browser take time until has updated browser. it works using document.execcommand('copy'); function. function you'll copy select text. not work textarea s every selected text on webpage (like in span , p , div , etc.). available in internet explorer 10+, chrome 43+, opera 29+ , firefox 41+ (see execcommand compatibility here ). example // setup variables var textarea = document.getelementbyid("textarea"); var answer = document.getelementbyid("copyanswer"); va

sql - MS Access Combine tables with like fields -

i want combined result of costs , payments sorted date. query i'm trying: select clientid, thedate, payment, cost ( select paymentdate thedate, amount payment, clientid payment union select bookeddate thedate, cost, clientid [all bookings query] ) order thedate desc; it works... however, box pops me enter value "payment" (like field doesn't exist). if leave blank , hit ok, result set "payment" column totally blank, , "cost" column containing amounts both tables. field names i'm using 100% correct. i think problem union trying squash both tables result 3 columns, , trying select 4. i've never done query quite before don't know how around that. what want payments , costs in separate columns. wrong query? you need have 4 columns in each of sub-queries, putting 0 cost column payments , 0 payments column bookings. select clientid, thedate, payment, cost ( select paymentdate thedate, amount payment, 0 cost,

Spring JSON Mapping from Android to Custom Object with jackson -

i'm trying pass jsonarray android spring java server. i've tried 2 ways. 1 passing jsonarray string , catching @pathvariable annotation. this way can [{"id":6,"numdishes":1,"observations":"false"},{"id":2,"numdishes":3,"observations":"false"}] , guess make work way. the code use is: in android httpget request = new httpget(serverurl + action);//action has 2 params httpresponse response = httpclient.execute(target, request); in server arrives /orderservice/addorder/1/[{"id":6,"numdishes":1,"observations":"false"},{"id":2,"numdishes":3,"observations":"false"}] @requestmapping(method=requestmethod.get, value="/addorder/{tablenumber}/{jsonparam}") public void addorder(@pathvariable integer tablenumber, @pathvariable string jsonparam) { log.info("string encoded: " + jsonparam); } an

C Code for Python's property function? -

i curious how python's interpreter makes attribute x out of method x through x=property(x) . if take @ c code, feel better. the type defined in descrobject.c file . you can locate python types these first looking function name in bltinmodule.c ; in case following line defines property() function: setbuiltin("property", &pyproperty_type); then grep pyproperty_type definition in objects subdirectory.

actionscript 3 - AS3 Flash- Adding multiple different movieclips to stage from one class -

i've searched everywhere , can't find answer question , i'll best explain it. i have 2 movieclips in library, 'bluknife' , 'cat' (it's rpg game.). both movieclips linked as3 classes of same names. i know can can add both of these items stage having following code in document class: var knife:bluknife = new bluknife(); stage.addchild(knife); knife.x = stage.stagewidth / 2; knife.y = stage.stageheight / 2; var ct:cat = new cat(); stage.addchild(ct); ct.x = stage.stagewidth / 2; ct.y = stage.stageheight / 2; however don't want stuff in document class, made class want use call of stuff stage , named callitems : package { import flash.display.movieclip; import flash.display.movieclip; import flash.display.stage; public class callitems extends movieclip { public function callitems() { var knife:bluknife = new bluknife(); stage.addchild(knife); knife.x = stage.

mysql update trigger: update "some" other rows -

table "book": bookid | title 1 | java 2 | mysql 3 | zen table "bestpage": pageid | bookid | isbestpage 1 | 1 | 0 2 | 1 | 0 3 | 1 | 1 4 | 2 | 0 5 | 2 | 1 6 | 2 | 0 so books may have "bestpage", only one . need beforeupdate trigger when update row pageid 2, , set isbestpage = 1, other pages book have isbestpage set 0. something like: for each row begin if old.isbestpage = 1 , -- here want tell **only current book** ! set new.isbestpage = 0 or that. is, if mark page bestpage, other pages within book should set not best page. thanks. unfortunately can't in mysql trigger according e.1. restrictions on stored programs within stored function or trigger, not permitted modify table being used (for reading or writing) statement invoked function or trigger. what can though alleviate pain create stored procedure this delimiter $$ create pr

html - Horizontally center list items that have different background image widths -

i having trouble centering list items horizontally within container div. have tried use display:inline on li , li did not help. tried text-align center on ul , li did not give me results. solution there if remove 2 arrow li's html breaks , looks second image posted here instead of automatically centering social media icons. have borders around right troubleshooting purposes. ideally, if remove arrow or facebook list item, others should continue center within container. bit confused on how achieve want after trying float , display:inline-block , inline method , having little results. able achieve want plain text using display:inline, these need background images , arrows have different width social media icons. (could turned sprite suppose instead of individual ones) html: <div id="socialbox"> <ul id="social"> <li id="leftarrow"><a></a></li> <li id="facebook"><a href="

algorithm - How to deal with crossover when sequence matters? -

how 1 go crossing on 2 parents when children must have particular ordering? for example, when applying genetic algorithms travelling salesman problem on fixed graph of vertices / edges, must contend fact not vertices can travel other vertices. makes crossover more difficult because unlike tsp in vertices may travel other vertices, when crossover performed must done @ point produces legal path. alternative crossover anyway , reject illegal paths, risk great computational expensive , few no legal paths. i've read permutation crossover i'm not entirely sure how solves issue. can point me in right direction or advise? ordering should, far possible, not constraint in genetic programming. maybe should contemplate pick format solutions. example, in tsp, consider codon a->b. instead of meaning 'take edge b', consider 'take shortest path b'. way, solutions feasible. have pre-compute shortest path matrix pre-processing. now, not guarantee candidate

excel - Run Macro in more than 1 workbook at the same time -

i using excel 2007. when start macro in workbook, cannot other work in excel. have wait till macro finishes. is possible run multiple macro in multiple workbooks @ same time? if understand right, have 2 separate workbooks, , you'd able work on 1, while running macro on other. this can achieved running 2 separate instances of excel, , opening workbook in each. note, if double click xls, open in same running instance. so need open new instance black , go file->open , navigate desired workbook (i think drag , drop works too)>

visibility - How do I get div not to display if value in another div is empty in Javascript? -

here code. have tried can think of. have tried using div id's , have tried classes. nothing seems work. want number 2 not visible if there no entry beside it. doesn't matter if in table or not. thanks. <style type="text/css"> <!-- .leftone { float: left; height: auto; width: auto; } .rightone { float: left; height: auto; width: auto; } .lefttwo { float: left; height: auto; width: auto; } .righttwo { float: left; height: auto; width: auto; } --> </style> <table width="400" border="0" cellpadding="0" cellspacing="3" id="tableone"> <tr> <td width="200" height="50"><div class="leftone">1.)</div></td> <td width="200" height="50"><div class="rightone">the number one</div></td> </tr> <tr>

javascript - Why does my java script function stop half way without reason -

please note page school project, not meant function payment page. code executes on submit, gets far checking name, if there problem date or cvc code skips , continues if received true value. great deadline approaching. need run entirety of code. example of code it can found @ http://www.come-get-me-games.x11s.org/confirm_booking.php the code area is <script type="text/javascript"> function check(){ var num = document.getelementbyid('cardnumber'); var name = document.getelementbyid('nameoncard'); var dater = document.getelementbyid('expdate'); var cvc = document.getelementbyid('cvc'); if(num.value==="" || num.value===null){ alert('please enter card number'); return false; }else if (name.value==="" || name.value===null){ alert('please enter appears on card'); return false; }else

c# - Running WMI Query results in COMException (0x80080005) -

i have been working on small wmi info grabber job work hundreds of servers , being able grab information can quite beneficial when having on more 5 servers. list<string> output = new list<string>(); objectquery query = new objectquery("select * computersystem"); managementobjectsearcher objectsearcher = new managementobjectsearcher(serverconnect.hardwarescope, query); managementobjectcollection retobject = objectsearcher.get(); foreach (managementobject manobj in retobject) { string[] data = ((string)manobj["description"]).split('-'); string ipmi = data[1].substring(7); string firmware = data[2].substring(5); output.add("ipmi version: " + ipmi); output.add("bmc firmware version: " + firmware); } return output; this using grab basic data computersystem, works on servers crashes on others obtains correct information wanting; however, need prevent crashing comexception. it says breaks out system.

ios - Can Instruments be corrupting memory? -

as move next version of app closer submitting store run leak check on using instruments. on of test devices (ipod touch, iphone, ipad; different os levels, etc.) well, except on iphone 4s running ios 6.1.3, app crashes 75% of time. the device logs showing commonality... doesn't make sense me. the crashes of "unrecognized selector sent instance" variety, limit need scroll, i'll remove front part of message can see commonality more easily. the first run crashed this: reason: '-[uidevicewhitecolor clean]: unrecognized selector sent instance 0x1f84db50' the second run ran fine. the third run crashed this: reason: '-[calayer clean]: unrecognized selector sent instance 0x1f87fab0' the fourth run crashed variation: reason: '-[uiimage clean]: unrecognized selector sent instance 0x1e56b9d0' lest think might calling private apple apis uidevicewhitecolor object, i'm not. have no idea coming from. @ time of crash network conn

'for' loop break in Java is not working -

i have below piece of code: private boolean result = false; public boolean checkhourexist(int hourfrom, int minutefrom, int hourto, int minuteto, int day, int templateid) { list<templates> t = getalltemplateswithdays(); (templates tem : t) { if(day == -1 | tem.temp_dayid == day) { if(tem.temp_hourfrom >= hourfrom & tem.temp_hourto == hourto ) { if(tem.temp_hourfrom == hourfrom) { if(tem.temp_minfrom == minutefrom ) { result= true; break; } else if(minutefrom < tem.temp_minfrom & minuteto >= tem.temp_minto ) { result = true; brea

java - Access variable from another class from a thread -

Image
at moment key event generated in gui passed through several classes , given class running in separate thread. thread waiting key event , when 1 received variable further class chain altered (see diagram). during debug variable not changing. the class thread accessing of course in own thread being called gui has led me think problem concurrency. is there way solve perhaps using atomic integers or locks? i've seen few examples using synchronized functions can't them work don't explain requirements of classes. (by mean give code synchronization not explain how make class "synchronisable"). here code thread in class e, can the thread's object reference set class above receives reference of class class above etc. private processor processor; public void run() { while (true) { if (keyevent != null) { keyevent = null; processor.i = 4; } } } public void setprocesso

asp.net - Creating a new cookie (overwriting the old one) keeps a list of old values? -

edit: sorry! forgot include details. i'm using c# within mvc4 project. so have code here supposed 1. create new cookie if userid parameter set , 1 hasn't been set 2. if cookie has not been set , no userid parameter specified, set userid 1 3. if new userid parameter there update cookie new userid. problem ,if userid first set jake, joe, bob, cookie value looks "bob, joe, jake". normal? seems it'd best clear list. in advance time. public static void storeid() { if ((httpcontext.current.request.cookies["userid"] == null) && (system.web.httpcontext.current.request.params["userid"] != null)) { httpcontext.current.response.cookies["userid"].value = system.web.httpcontext.current.request.params["userid"]; httpcontext.current.response.cookies["userid"].expires = datetime.now.adddays(1); } else if ((httpcontext.current.request.cookies["userid"] == null) &&am