Posts

Showing posts from April, 2013

contiki - Thingsquare Router-Node -

i´m newbie thingsquare i'm traying create ip64 gateway mb851 board (stm32w108cc microprocessor) i send , receive data (ipv6 radio) using 2 mb851 boards thingsquare udp-multicast example. i modified mist-mb851 platform include enc28j60-arch.c file implement platform code of spi functions called enc28j60 driver modified ip64-conf.h include enc28j60 driver , fallback interface include "ip64-eth-interface.h" include "enc28j60-ip64-driver.h" define ip64_conf_uip_fallback_interface ip64_eth_interface define ip64_conf_input ip64_eth_interface_input define ip64_conf_dhcp 1 define ip64_conf_eth_driver enc28j60_ip64_driver i modified contiki/platform/mb851 include stm32 peripherallibs create spi driver the enj28j60 driver tested i compile thingsquare router-node example when initialize dhcp process ip64_init();--->ip64_ip

wpf - In combo box selection change, first selection returning all values as 0 and next selections returning the values of the previous row of the database -

i loading 1 combo box value database. when selecting first option combo box, it's fetching other values 0, , when selecting next option combo box it's showing results of previous option below code this combo box dim cmd new sqlcommand("select companyname company", conn) 'company name dim dt new datatable 'company name dim da new sqldataadapter(cmd) 'company name da.fill(dt) 'company name 'company name cmbcompanyname.itemssource = dt.defaultview cmbcompanyname.displaymemberpath = "companyname" cmbcompanyname.selectedvaluepath = "companyname" and below 1 filling fields @ combo selection changed try dim dt new datatable dim connection new sqlconnection("data source=kitt7-pc;initial catalog=project;user id=sa;password=1234") connection.open() dim cmd3 new sqlcommand("select * company companyname='" & cmbcompanyname.text &

powershell - On Windows, are there restrictions on extensions that can be used in PATHEXT? -

i trying set file associations on windows machine files extension .script run without needing extension specified (much .bat , .ps1 , .py files). i have set things using following batch file: reg add hkcu\environment /v pathext /t reg_expand_sz /d "%%pathext%%;.script" reg add hkcu\software\classes\.script /ve /d "script.file" reg add hkcu\software\classes\script.file /ve /d "script file hashbang line" reg add hkcu\software\classes\script.file\shell\open\command /ve /d "\"c:\windows\py.exe\" \"%%1\" %%*" this almost works, when run .script file, runs in new window, rather in current console session. if change extension have chosen shorter, .sf , works fine. is there limitation on file extensions can used in console, have less 3 characters, or something? (in case it's relevant, on windows 7, 64-bit). update : seems happen in powershell. both cmd , tcc (tcc/le) work expected (the script run in console s

c# - button not triggering as required -

my button not automatically triggering, works when click manually, <script type="text/javascript"> $(document).ready(function() { $('#yes').click(function() { $.unblockui(); $('<%= hiddenbutton.clientid %>').trigger('click'); // not working __dopostback('<%=hiddenbutton.clientid %>', ''); // not working button code given below. both trigger , dopostback didn't worked @ all <asp:updatepanel id="updatepanel1" runat="server" updatemode="conditional" childrenastriggers="true"> <contenttemplate> <asp:textbox id="hiddenfield1" runat="server" /> <asp:button id="hiddenbutton" text="click me" runat="server" onclick="deleting_click" /> and added trigger as, <triggers> <asp:asyncpostbacktrigger contr

Open Graph Publish Using Spring Social -

i trying use open graph api of facebook using spring soical in project , trying publish action on facebook using function: facebook.opengraphoperations().publishaction("og.likes", "object", " http://test.com "); getting error: org.springframework.social.resourcenotfoundexception: unknown path components: /namespace:og.likes @ org.springframework.social.facebook.api.impl.facebookerrorhandler.handlefacebookerror(facebookerrorhandler.java:81) @ org.springframework.social.facebook.api.impl.facebookerrorhandler.handleerror(facebookerrorhandler.java:60) @ org.springframework.web.client.resttemplate.handleresponseerror(resttemplate.java:486) @ org.springframework.web.client.resttemplate.doexecute(resttemplate.java:443) @ org.springframework.web.client.resttemplate.execute(resttemplate.java:415) @ org.springframework.web.client.resttemplate.postforobject(resttemplate.java:294) @ org.springframework.social.facebook.api.impl.faceboo

c# - How to clear browser cache on browser back button click in MVC4? -

i know popular question in stackoverflow. have gone through every same question , unable find right answer me. log out controller action result [authorize] public actionresult logout(user filtercontext) { session.clear(); session.abandon(); session.removeall(); response.cache.setcacheability(httpcacheability.nocache); response.cache.setexpires(datetime.utcnow.addhours(-1)); response.cache.setnostore(); formsauthentication.signout(); return redirecttoaction("home", true); } it didn't work me. tried adding- <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="pragma" content="no-cache"/> <meta http-equiv="expires" content="0"/> none of these resolved issue. the problem approach setting late mvc apply it. following 3 lines of code should put in method shows view (conse

php - How to copy value input text to multiple/array input text -

i need copy input text array this: if input "12345": <input type="text" name="data1"> then in text input (array) written "12345" <? foreach ($countries $data2) { <input type="text" name="$data2['location'][]"> } <script language="javascript"> function copy() { document.form1.data2.value=document.form1.data1.value } </script> <form action="" method="post" name="form1"> <input type="text" name="data1" onkeyup="copy()"/> <br /><br> <input type="text" name="data2"> </form> no problem... but if this: <input type="text" name="data2[]"> <input type="text" name="data2[]"> <input type="text" name="data2[]"> or in array php, : <?php foreach ($countries $data2): ?>

angularjs - angular.js resource doesn't resolve: resolved false -

i'm trying use resource on url (which exists, doublechecked posting browser address bar). i'm using resource within directive this: var imagesresource = $resource("/myurl"); var images = imagesresource.get(); problem: images stays unresolved. i've used resource before on various occasions - hasn't caused problems far until now. there no error in console not helpful. any ideas on how fix? don't want fall onto jquery ajax request...

linux - Is the AWS ec2 private key specific to a user in the ec2 instance -

i have ec2 instance. have private putty key. logging in root user. created new user, unable login directly new user using putty key. putty key specific instance user. please help. yes. need add public key user authorized_keys file in order use key user. your putty key have public portion stored on server want access. if works root user, in authorized_keys file root user. find file here /root/.ssh/authorized_keys . file in /home/username/.ssh/authorized_keys other users. if not there can create it, pay attention permissions.

Prototype for C function returning array of strings -

so, trying create nicely readable c function prototype, returns me array of strings (ie char* ). closest came like: const char * const *entrypoints() { static const char* arrays[] = {"test123", "test2"}; return arrays; } however, don't 2 * s in declaration, looks scary :) ... did not find way emphasize fact function returning array of strings ... using [] in function declaration leads funny compile errors (such 'entrypoints' declared function returning array const char* (entrypoints() []) or expected unqualified-id before '[' token const char[]* entrypoints() or const char*[] entrypoints() ... yes, compiler right in both cases), , google seems have no answer this... here am. is there way declare function prototype in nicely readable manner (this go in public api) return array of c strings. not c++. c . plain old c. if not, have stick 2 star approach ... ie. char ** . not (obscurely) awkward, emphasize function returns array

Google maps setMap() and map options -

i new google maps api v3. in google maps official tutorial, of sample code using new google.maps.marker({ map: map //map option }); or new google.maps.marker({ //some options here }).setmap(map); what difference between each other? off top of head: you can create markers , add them map @ later time e.g. after clicking button using setmap() you can have multiple maps on 1 page. can selectively add markers 1 of them using setmap() you can remove markers selectively map using setmap(null)

javascript - Trying to compare two Canvas elements -

i using below code compare 2 canvas elements function createimage(html, can) { var canvas = $( "#" + can ); var ctx = canvas[0].getcontext("2d"); var data = "<svg xmlns='http://www.w3.org/2000/svg' width='1000' height='1000'>" + "<foreignobject width='100%' height='100%'>" + "<div xmlns='http://www.w3.org/1999/xhtml'>" + html + "</div>" + "</foreignobject>" + "</svg>"; var domurl = self.url || self.webkiturl || self; var img = new image(); img.crossorigin = ''; var svg = new blob([data], { type: "image/svg+xml;charset=utf-8" }); var url = domurl.createobjecturl(svg); img.onload = function () { ctx.drawimage(img, 0, 0);

android - Image is stretched in textview on runtime in tabhost -

<tabhost android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent" > <linearlayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <tabwidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginleft="0dip" android:layout_marginright="0dip" > <textview android:id="@+id/view_all" android:layout_width="wrap_content" android:layout_height="fill_parent" android:tag="tab0" android:text="view all" /> <textview

c# - ReadLine(); between values -

i made dice game , few moments ago asked solution here, got. made new problem , in cant seem find answer. heres code. using system; using system.collections.generic; using system.linq; using system.text; namespace noppapeli { class program { static void main(string[] args) { int pyöräytys; int satunnainen; int luku = 0; random noppa = new random((int)datetime.now.ticks); console.writeline("anna arvaus"); int.tryparse(console.readline(),out pyöräytys); console.writeline("haettava numero on: " + pyöräytys); console.readline(); { luku++; satunnainen = noppa.next(1, 7); console.writeline("numero on: " + satunnainen); if (satunnainen == pyöräytys) { satunnainen = pyöräytys; } } whil

java - Updating clob column in oracle with CLOB value -

i want update column clob type, method below; public boolean formveriguncellesil(string sql) throws veritabaniexception { try { session session = getsessionfactory().getcurrentsession(); sqlquery query = session.createsqlquery(sql); query.executeupdate(); return true; } catch (runtimeexception e) { throw new veritabaniexception(e, veriguncellemeexception, "fid_01_02_01"); } } the sql string; update k1form_listgrid3 set textarea4=oracle.sql.clob@77df8d, textt5='anaform',anatablo='1', olusturan_kullanici='184' id=1 i "java.sql.sqlsyntaxerrorexception: ora-01729: database link name expected" error how can fix sql. pls help. oracle interpreting sql set textarea4=oracle.sql.clob@77df8d as database link because of @ symbol, not matter anyway, because you're doing here trying set value of column tostring of clob, not intend. you

Safari and ie8 not loading google fonts -

i have problem google fonts in safari gentium font not displayed correctly, , in ie8 alfa font not displayed @ all. fonts called 'alfa slab one' , 'gentium book basic' this how embed them: <link href='http://fonts.googleapis.com/css?family=alfa+slab+one' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=gentium+book+basic:400italic,400' rel='stylesheet' type='text/css'> and how use them: font-family: 'alfa slab one', cursive !important; font-family: 'gentium book basic', serif !important; font-style: italic; and site: a link

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

the documentation of error mentioned in title says if commands out of sync; can't run command now in client code, calling client functions in wrong order. this can happen, example, if using mysql_use_result() , try execute new query before have called mysql_free_result(). can happen if try execute 2 queries return data without calling mysql_use_result() or mysql_store_result() in between. from here: http://dev.mysql.com/doc/refman/5.0/en/commands-out-of-sync.html but in first query not fetching data mysql database, inserting. , in second query getting data database. here code $connection = mysqli_connect("localhost","username","password","tbl_msgs"); if(mysqli_connect_errno($connection)) { die("failed connect mysql: " . mysqli_connect_error()); } $query = "insert users (total_comments, total_views) values ({$total_comments}, {$total_views});"; $query .= "insert msgs (no

spring integration - Implement parallel process in service activator -

in spring integration application flow splitter--routter--service activator(2 activators) -- aggregator in ,will 2 aggregators work parallelly?? configuration file <!-- splitter config --> <int:splitter input-channel="reqchannel" ref="splitter" method="dosplit" output-channel="routerinput"/> <!-- router config --> <int:router input-channel="routerinput" expression="payload.isforact1 ? 'activator1' : 'activator2'"/> <!-- service activator 1 cinfig--> <int:service-activator input-channel="activator1" ref="processactivator" method="doprocess()" output-channel="processedchannal"/> <!-- service activator 2 cinfig --> <int:service-activator input-channel="activator2" ref="processactivator" method="doprocess()" output-channel="proc

Microsoft Excel if-then formula -

i discounting new autos. g2 msrp (sticker price) column. if g2 less $30,000 discount g2 times .003 , otherwise discount g2 times .002 . this discount subtracted amount. here trying write: if(g2<30000,-(g2*.003), -(g2*.004))) this should correct: if(g2<30000;-(g2*.003);-(g2*.004))

Classes and functions in Python -

while writing code on classes , functions,i took case of function , class same name code executed as: $python test.py to attempted 2 scenarios: i first wrote them in 1 file test.py , got function gets called rather class class abc: def __init__(self): a=3 print def abc(): b=7 print b if __name__=='__main__': abc() output: 7 i wrote function in 1 file test.py , class of same name in file , imported it.when did not write __init__ function, both function class got executed, while when wrote __init__ function, function got executed without __init__ function hello.py: class def: a=2136 print test.py: from hello import def def def(): b=7 print b if __name__=='__main__': def() output: 2136 7 with __init__ function defined hello.py: class def: def __init__(self): a=2136 print test.py from hello im

java - Adding file into existing Zip Archive -

so followed block of code here: http://commons.apache.org/proper/commons-compress/examples.html , said make ziparchiveentry , insert data. can see code below. public void insertfile(file apkfile, file insert, string method) throws androlibexception { ziparchiveoutputstream out = null; ziparchiveentry entry; try { byte[] data = files.tobytearray(insert); out = new ziparchiveoutputstream(new fileoutputstream(apkfile, true)); out.setmethod(integer.parseint(method)); crc32 crc = new crc32(); crc.update(data); entry = new ziparchiveentry(insert.getname()); entry.setsize(data.length); entry.settime(insert.lastmodified()); entry.setcrc(crc.getvalue()); out.putarchiveentry(entry); out.write(data); out.closearchiveentry(); out.close(); } catch (filenotfoundexception ex) { throw new a

c# - Deserializing a child into an object -

i've tried examples on here tearing hair out. i query , returns json, inside json lots of hashes, eg. { "gjwiegjeigj": { ....}, "gjeeigjwoeigj": {...} ... } i want loop through each of these, , deserialize contents object. i've created object, myobject has fields, stuck on deserialising. i can deserialise straight base object using jsonconvert.deserializeobject can't that, need loop through , children. i want array of custom objects fields taken json result of this, don't care title of each 1 (the garbage hash). any ideas? know can loop through, gives me lots of jtokens that's stuck. edit: reading question again, mention both knowing , not knowing fields. sounds don't know fields json string contain. for cases this, suggest use dynamic -- shines. if know field names, class should deserializing without issue. what have tried? show real code, , real exceptions or problems. to deserialize list of dynamic objec

.net - Why am I getting error 'not declared'? -

i'm trying show dropdownlist ( cbb_conj_habitacional ) if selected value of dropdownlist ( cbb_area_verde ) equals 7... but, when try code, following error: name 'cbb_area_verde' not declared , goes cbb_conj_habitacional. protected sub cbb_area_verde_selectedindexchanged(byval sender object, byval e system.eventargs) dim selecionado integer selecionado = cbb_area_verde.selecteditem.value if (selecionado = 7) cbb_conj_habitacional.visible = true end if end sub and yes, i'm in partial class. i know did wrong... "cbb_conj_habitacional" inside of formview, declared findcontrol. dim cbb_conj_habitacional dropdownlist = formview.findcontrol("cbb_conj_habitacional") i hope can someone.

excel - Compilation Error with small script -

Image
i'm trying write cls in excel 2007, here's code: dim jiraservice msxml2.xmlhttp60 set jiraservice = new msxml2.xmlhttp60 jiraservice.open "get", "url", false jiraservice.setrequestheader "content-type", "application/json" jiraservice.setrequestheader "accept", "application/json" jiraservice.send srestresponse = jiraservice.responsetext msgbox srestresponse i'm getting compilation error, indicating set appears invalid. it says external procedure not valid. can me out? you missing appropriate reference guess. click on tools~~>references in vba add project references to; microsoft winhttp services, version 5.1 microsoft xml, v6.0 also in line jiraservice.open "get", "url", false if url variable holds actual url "url" considered string , not variable since between quotes. guess trying this? jiraservice.open "get", url, false followu

c++ - Linker error: ld symbols not found -

i have class defined follows: // grid_search.h template<typename element, typename solution, typename oracle> class grid_search : public optimizerinterface<element, solution, oracle> { private: // ... public: virtual solution search(const spaceinterface<element>& space, oracle oracle); }; and implement in grid_search.cc . use this: // needed definitions typedef double (*oracle_f)(vector<int>&); class testspace : public spaceinterface<int> { /* ... */ } static double f(vector<int>& x) { return 0.0; } // ever f // setup search space , run grid search testspace space(/* ... */); gridsearch<int, vector<int>, oracle_f> *optimizer = new gridsearch<int, vector<int>, oracle_f>(); optimizer->search(space, f); then linker error (note compiles , grid_search.cc found fine): undefined symbols architecture x86_64: "gridsearch<int, std::vector<int, std::allocator<int> >, double (*)(s

jquery - Validate TINYMCE before form submission? -

i using js.validate plugin ( http://bassistance.de/jquery-plugins/jquery-plugin-validation/ ) im using tinymce. upon form submission save content of tinymce it's text area: var content = tinymce.activeeditor.getcontent(); $('#article').val(content); my question is, how can validate using js validate? i've tried: rules: { article: 'required' }, article name of text area. not work, no error coming up. thanks

android - java.lang.NullPointerException in ArrayAdapter -

from google play "crash & anr" see users getting below error. couldn't reproduce error self. have arrayadaper class public class discussarrayadapter extends arrayadapter{ used listitem in activity: first, don't know if proplem in arrayadaper class or in activity. least if advice should error. shell example focus on teh getview method of arrayadapter? the getview method of arrayadaper below. java.lang.nullpointerexception @ com.castvast.discussarrayadapter.getview(discussarrayadapter.java:84) @ android.widget.abslistview.obtainview(abslistview.java:2461) @ android.widget.listview.makeandaddview(listview.java:1775) @ android.widget.listview.fillup(listview.java:712) @ android.widget.listview.correcttoohigh(listview.java:1401) @ android.widget.listview.fillspecific(listview.java:1339) @ android.widget.listview.layoutchildren(listview.java:1618) @ android.widget.abslistview.onlayout(abslistview.java:2296) @ android.view.view.layout(view.java:14055) @ andro

Xcode GLKit printing Text on GLKView without using UIImages -

i have app, small game using opengles glkit. no im wondering how works when want draw text on screen (if possible). how can it? i draw of game objects using images (wrapped in kind of sprite). possible scale, move, , rotate. works fine. but finding out how works print text on glkview gets me deep inside of problems ^^ i dont want use uiimages cause dont know how present uiimages on glkview. there number of ways want: 1) have image text glyphs need in it. example, if application in english, you'd have 26 uppercase , 26 lowercase letters in image. upload texture gpu , use proper texture coordinates or glsubteximage2d() pull out glyphs need. (it's not clear me if meant not wanting uiimage. doesn't have uiimage, though that's easiest.) 2) every time need display text, draw on cpu on fly, , upload entire word, phrase, or sentence texture. create cgbitmapcontext , use core graphics draw text it. upload using glteximage2d() . 3) individual glyphs

java - Setting up android view library in project -

i trying use gauge view github in new project of mine. sample application given library works perfect ! but when try include library new project (properties > buildpath > projects > (add library project)), put view in layout , try reference view in code throws classnotfoundexception the following layout: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".mainactivity" > <org.codeandmagic.android.gauge.gaugeview android:id="@+id/gauge_view1" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" /> </linearlayout> this activity : package com.example.guagetest; import org.codeand

java - Android to android TCP connection failed -

i'm trying make tcp connection between android phones in same subnet. connection works when use android phone server , android emulator client. when switch emulator other android phone timeout. android phones in same local network(192.168.0.0/24). client script: s = new socket(); s.connect(new inetsocketaddress(ip, tcp_server_port), 10000); dataoutputstream dos = new dataoutputstream(s.getoutputstream()); dos.writeutf("coord"); s.close(); server script: while(!end){ //server waiting client here, if needed socket s = ss.accept(); datainputstream dis = new datainputstream(s.getinputstream()); string msg_received = dis.readutf(); log.i("gauta",msg_received); if(msg_received.equals("coord")) { //some work.

c# - Update DataGrid to EF -

i display data datagrid in way: var display = (from r in ve.folders.include("hosting_company1") select new repoclass{ id = r.folder_id,name= r.full_name, hosname= r.hosting_company1.housing_name }).tolist(); dg1.itemssource = display; and in xaml : <datagrid canuseraddrows="false" autogeneratecolumns="false" name="dg1"> <datagrid.columns> <datagridtextcolumn binding="{binding path=id, mode=twoway}" header="id"/> <datagridtextcolumn binding="{binding path=name, mode=twoway}" header="name" /> <datagridtextcolumn binding="{binding path=hosname, mode= twoway}" header="company" /> </datagrid.columns> </datagrid> how update data ef ? if ve datacontext, need call ve.savechanges(). pass observable collection datagrid changes easier manage.

Use cases for hstore vs json datatypes in postgresql -

in postgresql, hstore , json datatypes seem have similar use cases. when choose use 1 vs. other? initial thoughts: you can nest json; can't hstore functions parsing json won't available until 9.3 the json type string. there no built in functions parse it. thing gained when using validity checking. edit downvoting: written when 9.3 still didn't exist.it correct 9.2. question different. check edit history.

ios - Why do the files in the Copy Bundle Resources appear in red? -

Image
the files in copy bundle resources appear instead of sometimes, hence have error : -[nswindowcontroller loadwindow]: failed load window nib file 'document' but managed somehow not have anymore (i don't know how did). i think problem somehow comes fact tried have french application. created fr localization , deleted en localization. if has clue... ! in experience xcode 4.6.3, english version required—localized resources showed red until english localization enabled in resource's file inspector window.

javascript - How to detect if the image path is broken? -

i trying detect if image available in javascript . i have switch statement return different type of images. switch (type){ case 'oldproduct': return "<img src='project/'" + folder + imagename + "/>" break; case 'newproduct': return "<img src='project/'" + folder2 + imagename2 + "/>" break; more cases.... } i wondering if there anyways detect if images exist before return image. <img src='project/'" + folder2 + imagename2 + "/img> src broken path in case. lot! if wanted use javascript , not jquery suggestion load image onto page <img src="yoursrc" id="testimage" style="display:none;"/> then check onerror method "not may not work in old ie" var image = document.getelementbyid('testimage'); im.onerror = function(){ //do on error }; however neater , reliable way run jquery on image. like funct

radio button - Remove ".00" from Simple Calculation via JavaScript -

i'm working on simple form calculation sums whole numbers onclick. the problem script calculates money appends .00 @ end. don't want decimal positions. i not @ javascript wondering how remove ".00" i need whole number no decimals. my gut is has ['set' + (i++)] i'm not 100% sure on that. <head> <title>untitled</title> <style type="text/css"> fieldset { float: left; width: 60px; padding: 5px; margin-right: 4px; } legend { font-weight: bold; } #total { font-size: 11px; width: 40px; } </style> <script type="text/javascript"> function setradios() { function sumradios() { var total = 0, = 1, oform = this.form; while (radgrp = oform.elements['set' + (i++)]) { j = radgrp.length; if (radgrp[--j].checked) { total += number(radgrp[j].value);

internet explorer 6 - Upgrading website from IE6 to IE10: Passing combobox as parameter to JavaScript function -

i upgrading website ie6 ie10. i have function moves user choices 1 combobox another //moves options 1 selection box (combo box) function moveelements(fromcombo,tocombo) { ... code ... } i defined 2 comboboxes <select name="choice1_select" class="form150" size="7" multiple> ... </select> <select name="choice2_select" class="form150" size="7" multiple> ... </select> the code activate move 1 combobox is: moveelements(choice1_select,choice2_select); this code works on ie6 not on ie10. returns error script5009: 'choice1_select' undefined how solve this? ie10 relating choice1_select variable replace code activate move with moveelements(document.getelementbyid("choice1_select"), document.getelementbyid("choice2_select")) change name id in combobox definition <select id="choice1_select" class="form150" size=&q

PHP: MX Lookup via Proxy -

using both nslookup via exec , dns_get_mx. can't find documentation on either mx lookup domain via proxy. is possible? there utilities centos can install facilitate this? thanks check out command "dig", use dig @myproxyserver -t mx domainiwant.com you should able exec , parse

python - search sequence in genome with mismatches -

i have fastq file more 100 million reads in , genome sequence of 10000 in length i want take out sequences fastq file , search in genome sequence allowing 3 mismatches i tried in way using awk got sequences fastq file: 1.fq(few lines) @dh1dqqn1:269:c1ukcacxx:1:1101:1207:2171 1:n:0:ttaggc natccccatcctctgcttgcttttcgggatatgttgtaggattctcagc + 1=adbddhd;f>gf@ffefgggiaeei?d9ddhhigaaf:bg39?bb @dh1dqqn1:269:c1ukcacxx:1:1101:1095:2217 1:n:0:ttaggc taggatttcaaatgggtcgaggtggtccgttaggtataggggcaacagg + ??aabdd4c:dddi+c:c3@:c):1?*):?)?################ $ awk 'nr%4==2' 1.fq natccccatcctctgcttgcttttcgggatatgttgtaggattctcagc taggatttcaaatgggtcgaggtggtccgttaggtataggggcaacagg i have sequences in file,now want take each line of sequence , search in genome sequence allowing 3 mismatches , if finds print sequences example: genome sequence file: ggggaggaatatgatttacagtttatttttcaactgtgcaaaataaccttaactgcagacgttatgacatacatacattc

mysql trigger not working? -

i trying create trigger insert new row conditionally based on insert on table...i can't seem nail syntax. here have far: delimeter $$ create trigger overpricedcar after insert on cars each row begin if (new.sellprice > '80000' )then insert listings values(new.carname,'gold','0',' '); end if; end$$ delimeter ; for reason keep getting error, syntax seems ok, i'm not sure may have gone wrong. edit after correcting typo, trigger 'works'. i have added comment output when trigger happens. have tested it, , output message gets printed screen trigger not complete inserts: delimiter $$ create trigger overpricedcar before insert on cars each row begin if (new.sellprice > '80000' )then insert listings values(new.carname,'gold','0',' '); signal sqlstate '45000' set message_text = "new gold car!"; //

gnuplot - Remove "empty space" in splot with log scaled z axis -

i have gnuplot script generates surface plot data. i've scaled z axis logarithmically, such in example on gnuplot.info 1 - , in example, lot of empty room @ "bottom" of plot. in example, ticks on z axis end @ 1, axis doesn't end there - origin of plot further "down" (in z direction). how set origin data starts? dynamic approach (that's not dependent on me knowing data set in advance) preferred, if it's possible. 1 follow link , search page "surfaces z log scale" find relevant example. this not obvious one, (as usual) there setting that. try set xyplane 1 and help set xyplane for more details.

css selectors - CSS - How to select nth-child of form element? -

i trying re-design registration form of wp website. add exta fields. increase width of <form> container , set <input> field's flow left. want set flow of phone field (which third child of <form> element) none i.e. float: none; . try this: form:nth-child(3) {float: none;} seen not working. selects form rather 3rd field of form. wrong? here registration page of site. please help. you need include descendant combinator (the space): form :nth-child(3) { /* css */ } without space, you're selecting form -element if it's third-child of parent, space you're selecting third-child elements of form . elements direct descendants: form > :nth-child(3) { /* css */ } reference: css selectors, level 3 .

c - ncurses window resizing patterns -

i have seen other questions on dealing window resizing, e.g., ncurses - resizing glitch the code in question has loop redraw contents of window after resize. my question is: possible, rather reprinting window after call clear() , before call refresh() , have curses use text that's in output buffer? i.e., "reflow" text, rather clear/ reprint? i have rather complicated ncurses application multiple windows being updated multiple threads , can't see clean way this. to directly answer question, no there no way "reflow" or have ncurses handle adjustment of text. however use panels library (which part of ncurses) handle windows. panels can attach arbitrary user data via set_panel_userptr . use store callback function each panel can resize content. your resize handler can loop through of panels calling resize callback. as side note, ncurses not thread safe. make sure threads using ncurses safely.

c# - Using a generic value -

i have common problem looks this. user may choose between inputing text or date , have 1 object/class in background storing value. make object/class generic possible can use value without asking date or text , without having convert either string or datetime. possible? what suggetions guys solve properly? think kind of class design question best way design such case? edit: havent started coding out yet. thinking of how of how create class , funktions shall offer. in dll cases user has textbox enter number or text or date. use without having ask it. mean without having many ifs later in code. scenario user has textbox , enter later example send value web service or exanple store database need type. its class design problem. how desin generic possible can ship value without asking is? since keep repeating question, i'll answer it. without further information what you're trying do , answer occurs me use the object type . depending on end doing value, has

html5 - How to make blinking/flashing text with CSS 3? -

currently, have code: @-webkit-keyframes blinker { { opacity: 1.0; } { opacity: 0.0; } } .waitingforconnection { -webkit-animation-name: blinker; -webkit-animation-iteration-count: infinite; -webkit-animation-timing-function: cubic-bezier(.5, 0, 1, 1); -webkit-animation-duration: 1.7s; } it blinks, blinks in "one direction". mean, fades out, , appears opacity: 1.0 , again fades out, appears again, , on... fade out, , "raise" fade again opacity: 1.0 . possible? you first setting opacity: 1; , ending on 0 , starts 0% , ends on 100% instead set opacity 0 @ 50% , rest take care of iteself. demo .blink_me { animation: blinker 1s linear infinite; } @keyframes blinker { 50% { opacity: 0; } } here, setting animation duration should 1 second , setting timing linear means constant throughout, , last using infinite means go on , on. note: if doesn't work you, use browser prefixes -webkit , -moz , on required animat

delphi - Forward declarations for record types -

is there such thing in title? i'm trying in part of converting an api structure , , run haven't encountered before: pfnreadertranslateddispatch = function(var msg: tmsg): bool; stdcall; pfnreaderscroll = function(var prmi: treadermodeinfo; dx, dy: integer): bool; stdcall; treadermodeinfo = record cbsize: dword; hwnd: thandle; fflags: dword; prc: prect; pfnscroll: pfnreaderscroll; fflags2: pfnreadertranslateddispatch; lparam: dword; end; preadermodeinfo = ^treadermodeinfo; those know delphi see obvious problem. how work around this? i think simplest solution: pfnreadertranslateddispatch = function(var msg: tmsg): bool; stdcall; preadermodeinfo = ^treadermodeinfo; pfnreaderscroll = function(prmi: preadermodeinfo; dx, dy: integer): bool; stdcall; treadermodeinfo = record cbsize: dword; hwnd: thandle; fflags: dword; prc: prect; pfnscroll: pfnreaderscroll; fflags2: pfnreadertranslateddispatch; lparam: dword; end; indeed, can reaplce

html - Getting content to clear a responsive image -

i have responsive image outside of body in code below. fills top half of screen , responsive, great, want of content underneath stay underneath image resizes nothing working - rather clear image sits on top of it. ideas or alternative methods try? the html: </head> <img src="/portfolio/images/me.jpg" class="ri"> <body> <header> <div class="contain"> <a href="/"><img src="/portfolio/images/logo.png" alt="logo" width="200" height="200"></a> </div> </header> <div class="contain"> <nav> <ul> <li><a href="/contact">contact</a></li> <li><a href="/work">work</a></li> <li><a href="/details">details</

ruby - Trying to access current user's role -

i need access current users role in order make sure admin. if admin want display following link in view. <% if current_user.role =='admin' %> <li class="manage"> <a href="#" id="manage" style="float:none;"> manage </a> </li> <% end %> my problem in controller (below). how define @user aligns current user? right getting "couldn't find user without id" error def index @user = user.find(params[:id]) respond_to |format| format.html end why want align @user , current_user? 2 different things. current_user user logged in (identified , authenticated). using devise or authentication gem? @user typically user you're trying edit, or display, determined params[:id]. resource you're trying access. begs question; @user mean you?

c++ - One definition rule and different class definitions in two translation units -

there code: file a.hpp: class a; file a.cpp: #include "a.hpp" struct { int x = 777; int y; }; a_zew; file main.cpp: #include "a.hpp" #include <iostream> class { // definition of class different above public: int x; }; int main() { a; // definition of class in main.cpp extern a_zew; // definition of class in a.cpp std::cout << a_zew.x << std::endl; // 777 std::cout << a.x << std::endl; // junk return 0; } so class a defined both in file main.cpp , a.cpp , there 2 objects of these classes defined in each translation unit. definition in both translation units of class a different code compiles. 1 definition rule says there can many definitions of type in program (but single in each translation unit) , these definitions should same. why code compile if definition of class a different in both files? your program has undefined behavior. paragaph 3.2/6 of c++11 standard specifies:

javascript - How get the second td innerHTML -

scenario: i'm using datatable library display alot of information. table have following rows: id type name case what i'm looking when click second row type , value taking , pasted in textbox example id type name case 1 text juan 20001 3 list pedro 20005 if click row has id # 1, need take type innerhtml. not matter apart of row click take second td's html. i tried code: $("tr td").click(function () { alert($(this).html()); }) it worked great, problem user have click row name, better if user can click on of row , take second rows html. suggesstions? myrow.getelementsbyclassname('td')[1].innerhtml should innerhtml of second table cell of myrow long first table cell not contain nested table. you might try adding click handler rows instead of cells too.

jsf 2 - URL is changed to http://localhost:8080/WEB-INF after importing project from Eclipse to NetBeans -

my jsf2.0 web designed on eclipse indigo. after point of time realised netbeans more powerful web dev highlighting xhtml page along xhtml validation @ once. imported project netbeans 7.3. goes when run here, noticed url changed http://localhost:8080/web-inf . where need mention url? running web in glassfish v3.1.2 you might have adjust context root. check netbeans kb article here project-setup-existing-sources 10.(optional) adjust context path. default, context path based on project name. also check glassfish-web.xml for example, glassfish-web.xml file hello1 application specifies following context root: <context-root>/hello1</context-root> see also: https://sites.google.com/site/netbeansscsni/home/section-4--java-ee-web-development/4-1-describe-how-to-create-a-netbeans-project-from-the-source-code-of-an-existing-web-application

how to install ruby 2.0 in debian 6? -

i want o install ruby 2.0 , have followed many tutorials, none of them works, , defaul repo apt-get install ruby brings me 1.8 version (and due debian has restrictions update if not through repo) way it? ive tried way cd /usr/src wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz tar xjf ruby.xxx.tar.bz2 cd rubyxxx ./configure --enable-shared make make install and that, error on next steps, when make ruby -version this -bash: /usr/bin/ruby: no such file or directory the end of tuto install cd ext/openssl/ ruby extconf.rb make install cd ../readline/ ruby extconf.rb make install gem update --system any idea how in debian 6? thanks if it's server, may want take @ rvm ( https://rvm.io/ ). make install simple : curl -l https://get.rvm.io | bash -s stable --rails --autolibs=enabled

java - Why could this code fail? -

while reviewing this question noticed code: class mythread extends thread { private boolean stop = false; public void run() { while(!stop) { dosomework(); } } public void setstop() { this.stop = true; } } however don't understand why fail. other threads not access "actual" stop variable? the instance variable stop needs volatile, otherwise there's no guarantee other threads see changes it. there lot of conflicting interests @ work: threads want consistent view of program state, cpus want able cache data, jvm wants able reorder instructions. making instance variable volatile means can't cached , happens-before relationships established limit instruction reordering. see this other answer (+1) example of reordering may happen without marking variable volatile. (by way using interruption thread cancellation preferable using instance variable.)

Does cCXF support REST services? -

Image
i have created 2 rest services talend open studio esb v5.2, first 1 gets xml file (post) , returns same file response, second 1 inserts file database. want create route connect these 2 rest services don't know how. usualy use component ccxf web services soap, rest? not ccxf, talend open studio esb have rest support. see tutorial: how create rest service . quote: in tutorial, see how build first simple rest data service in both talend open studio esb , talend enterprise esb studio using talend esb rest components , new txmlmap component. there rest components in palette: in palette right: to add rest service components, search " rest " in find component... field , press enter. trestrequest , trestresponse components needed create service provider displayed under esb > rest folder.

java - Obtaining the number of standard seconds in a minute with JodaTime -

i need obtain integer, long or double represents number of standard seconds contained in given number of standard minutes. 1 minute => 60 seconds 2 minutes => 120 seconds .. what preferred way of obtaining number of standard seconds within minute using jodatime? so far, i've been using this: minutes.minutes(2).tostandardseconds().getseconds() i find ".getseconds()" redundant. in c#, have used timespan.fromminutes(2).totalseconds is there similar in jodatime? you can use datetimeconstants . specifically, can use datetimeconstants.seconds_per_minute import org.joda.time.datetimeconstants; system.out.println(datetimeconstants.seconds_per_minute); read more available constants here ..

Lock screen rotation for **ALL** Android Apps on a device -

this first post please correct me if mistake regarding rules :-) heres problem: i trying set fixed screen rotation apps on android device (not app). searched lot found solutions single apps. i had following ideas: 1) use api ==> seems not possible 2) change accelerometer values ==> seems not possible 3) virtually open hardware keyboard ==> seems not possible turning off autorotation keeps apps in portrait mode, apps in landscape mode. can me please? at least android 4.2. (nexus 7) can hold device in landscape mode , disable autorotation. afterwards apps work in landscape mode.

How to display blinking text over an image in Corona SDK? -

i seem have serious problems here - i'm trying display image , transition in, have blinking text on @ bottom. function splash() local item = display.newimage("splashimage.png") item.x = display.contentwidth*0.5 item.y = display.contentheight*0.5 item.alpha=0 transition.to(item, {time =1500, alpha=1, oncomplete=blink}) end -- blinking text function blink() text = display.newtext("this blinking text", 100, 100, "arial", 22) text.x = display.contentwidth/2 text.y = display.contentheight/1.2 text.alpha=0 transition.to(text, {time =1500, alpha=1, oncomplete=blink2}) end function blink2() if (text.alpha > 0) [--this line broken apparently] transition.to(text, {time=1500, alpha=0}) else transition.to(text, {time=1500, alpha=1}) end end txt_blink = timer.performwithdelay(500, blink2, 0) code breaks error "attempt index upvalue 'text' (a nil value)" i'm total