Posts

Showing posts from April, 2014

Add activity to manifest by ant -

i have 2 android projects, 1 of them can androidlibrary project. in case should add activity manifest file. must ant build script. example: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="ru.yes.app1" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="8" android:targetsdkversion="17" /> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name="ru.yes.app1.activity1" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.mai...

Sending jquery ajax authentication request to glassfish server fails -

i trying send auth request servlet hosted glassfish server 4, receiving message in plain text. the servlet configured basic authentication confidential transport (https) (the authentication , servlet answer work visiting page web browser) here jquery script using ajax: $.ajax ({ type: "get", url: "https://192.168.146.128:8181/path_to_servlet", datatype: 'text', beforesend: function(xhr) { xhr.setrequestheader("authorization", "basic " + btoa("username:password")); }, async: false, success: function (data){ alert(data); } }); and servlet code: protected void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { response.setcontenttype("text"); printwriter out = response.getwriter(); out.println("hello"); out.close(); } the problem request don't answer of type (tryied on ie, chr...

android - Custom Progressbar Drawable -

i want create custom progressbar. i've created style this: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@android:id/background" android:drawable="@drawable/loading_empty"> </item> <item android:id="@android:id/progress"> <clip> <shape> <gradient android:startcolor="#007a00" android:centercolor="#007a00" android:centery="1.0" android:endcolor="#06101d" android:angle="270" /> </shape> </clip> </item> </layer-list> my progressbar background "@drawable/loading_empty". works fine. right know bar green. (see second item). have second drawable, how bar should like. how ...

Jackson Schema Validator com.github.fge.Frozen Class not found Exception -

i using jackson schema validator following code: objectmapper mapperschema = new objectmapper(); objectmapper mapperdata = new objectmapper(); jsonfactory factory = mapperdata.getfactory(); jsonparser jp = factory.createparser(jsondatastring); jsonnode jsondata = mapperdata.readtree(jp); factory = mapperschema.getfactory(); jp = factory.createparser(jsonschemastring); jsonnode jsonschema = mapperschema.readtree(jp); jsonschemafactory schemafactory = jsonschemafactory.bydefault(); jsonschema schema = schemafactory.getjsonschema(jsonschema); processingreport report; report = schema.validate(jsondata); and when running getting below exception: caused by: java.lang.noclassdeffounderror: com/github/fge/frozen @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclass(classloader.java:791) @ java.security.secureclassloader.defineclass(secureclassloader.java:142) @ org.apache.catalina.loade...

Calling a MDI Child's method from the MDI Parent in C# 1 -

in first step login form in mdi container. works well. after login next message form show "out of" mdi container. want show message form in mdi container. // mdi code private void form1_load(object sender, eventargs e) { form2 login = new form2(); login.mdiparent = this; login.show(); } // login button code private void button1_click(object sender, eventargs e) { if (textbox1.text == "admin" && textbox2.text == "123") { form3 message = new form3(); this.hide(); message.show(); } } if mean show form inside mdi container do message.mdiparent = login.mdiparent;

javafx - Java method does not override -

i trying display image fetch database in table view. here how set table view image column: tablecolumn prodimagecol = new tablecolumn("images"); prodimagecol.setcellvaluefactory(new propertyvaluefactory<product, image>("prodimage")); prodimagecol.setminwidth(100); // setting cell factory product image prodimagecol.setcellfactory(new callback<tablecolumn<product, image>, tablecell<product, image>>() { @override public tablecell<product, image> call(tablecolumn<product, image> param) { tablecell<product, image> cell = new tablecell<product, image>() { @override //error here public void updateitem(product item, boolean empty) { if (item != null) { imageview imageview = new imageview(); imageview.setfitheight(50); imageview.setfitwidth(50); ...

MYSQL error while inserting data using php -

i practicing php , sql. @ stage when i'm trying enter record table 2 exiting records. doesn't add , show error "you have error in sql syntax; check manual corresponds mysql server version right syntax use near '=('aqeela','nasreen','hakeem chattah')' @ line 1" why not entering record in data base. there syntax error? $username="root"; $pass=""; $database="addressbook"; $server="127.0.0.1"; $con=mysql_connect($server,$username,$pass); $db_found=mysql_select_db($database,$con); if($db_found) { $sql_insert="insert table_address_book(f_name,l_name,address) values=('aqeela','nasreen','hakeem chattah')"; $result=mysql_query($sql_insert); if(!$result){ print "sorry cannot proceed request<br>".mysql_error(); } else { // print "recorded entered successfuly<br>"; // print "now databases after edi...

c# - Adding child nodes to Treeview Control ASP.Net -

i trying add child nodes parent nodes in treeview control. runs fine in degbugger, looks if getting added, can see parent nodes. can shine little light on this. thanks. foreach (var item in agencylistroot) { treenode parentnode = new treenode(); treenode childnode = new treenode(); if (item.heirid.tostring() == "/1/") { parentnode.text = item.agencyname.tostring(); tv_agencies.nodes.add(parentnode); } if (item.heirid.tostring() == "/1/2/") { childnode.text = item.agencyname.tostring(); parentnode.childnodes.add(childnode); } } may code helps you.. foreach (datarow dr in dttree.select("parent_id null")) // each parent node in table or else { treenode node = new treenode(dr["name"].tostring(), dr["s_no"].tostring()); treeview1.nodes.add(node); // adding parent node treeview string serial_no = dr["s_no"].tostring(...

windows server 2008 - Crystal Reports Class Not Registered ReportDocument -

i have similar problem in post: crystal reports "class not registered" wpf i installing crystal reports version 13.0 on windows 2008 r2 64bit server , getting error when try create reportdocument when running on server: dim rptdoc new crystaldecisions.crystalreports.engine.reportdocument error message retrieving com class factory component clsid {f734a321-8381-4ffd-a614-139e8906dc83} failed due following error: 80040154 class not registered (exception hresult: 0x80040154 (regdb_e_classnotreg)). what tried hasn't worked me: made sure project x86 installed crystal reports runtime engine 32 , 64 bit (crruntime_32bit_13_0_6.msi , crruntime_64bit_13_0_6.msi) on server http://www.sap.com/campaign/ne/free_trial/crystal_reports_visual_studio/wty_int_crvs.epx?level=1&formresultid=ef699e2c- checked registry entry on server {f734a321-8381-4ffd-a614-139e8906dc83} , points c:\program files (x86)\sap businessobjects\crystal reports .net framework 4.0\common\sap...

ruby on rails - Git merge gives conflicts for almost all files changed from only one branch -

i tried merge local branch our development branch, git merge gave me conflict files changed in local branch. had resolve conflicts manually. of files not changed in development. for example, conflict: <<<<<<< head render json: {:created => 'true'}.to_json, status: :created, location: @user ======= render json: {:created => 'true'}.to_json, status: :created, location: @user >>>>>>> development or one: <<<<<<< head # new code ======= >>>>>>> development notice have no new line in 1 of branches. someone knows why happens, , how can avoid it? this happens due local files has changed , not committed before pull/checkout git repository. remove these lines conflicted files , commit then.

c - How is the conversion in the python struct module done? -

i need unpack information in python c structure, doing following code: struct.unpack_from('>i', file.read(4))[0] and afterwards, writing changed values back: new_value = struct.pack('>i', 008200) file.write(new_value) a few examples: 008200 returns syntaxerror: invalid token. 000010 written into: 8 000017 written into: 15 000017 returns syntaxerror. i have no idea kind of conversion is. kind of great. this invalid python code , not related struct module. in python, numbers starting 0 octal (base 8). so, python tries decode 008200 in octal '8' isn't valid. assuming wanted decimal, use 8200. if wanted hex, use 0x8200.

c# - How to bind to property of object returned by converter -

i'm trying bind value, run converter on it, , display property of value. having converter directly return property want wouldn't work, need property changes tracked. what i'm trying achieve this: // note: following not supported wpf // 'binding' cannot set on 'source' property of type 'binding'. // 'binding' can set on dependencyproperty of dependencyobject. text={binding textfield source={binding somevalue, converter={staticresource getobjectfromvalueconverter}}}` ideally, wrapped in simple markup extension. text={l:gettextfield somevalue} problem is, haven't been able find way other bind tag of element converter, , bind target field property follows: tag={binding somevalue, converter={staticresource getobjectfromvalueconverter}} text={binding tag.textfield, relativesource={relativesource self}} this cumbersome, limited (you 1 tag field) , feels abusive. how else can go achieving want whilst monitoring changes of tex...

windows - bat files, functions and caret symbols -

whats's going on? helper.bat @echo off echo %1 call:foo %1 goto:eof :foo echo %1 goto:eof run our script following helper "^^^^" output "^^^^" "^^^^^^^^" why? know '^' symbol smth special in case of cmd.exe, what's going on here? how function call affect on it? call special in case! the batch parser has different phases, in special character phase unquoted carets used escape next character, caret removed. in case, carets quoted, not affected. then carets can affected again in delayed expansion phase, quotes havn't special meaning there, carets used escape exclamation marks. normally after delayed phase done, if use call carets doubled . invisible, call restarts parser , carets removed in special character phase again. in case quoted, therefore stay doubled. try this call call call call echo a^^ "b^" output a^ "b^^^^^^^^^^^^^^^^" the parser explain...

scala - How can I use MockitoSugar to mock an object (singleton) method? -

is there way in scala use mockitosugar in order mock method of object scala singleton? your best bet deal singletons mocking first little rework on structure of singleton itself. use trait define operations , have object extend trait so: trait fooable{ def dofoo:string = "foo" } object foo extends fooable then, in class needs foo object, declare input or can set (di), decalare trait instead this: class myfoouser(foo:fooable = foo){ } that way default uses object, when constructing tests, can give mocked fooable instead. there bunch of ways handle getting fooable classes (this one) , that's not in scope answer. answer using trait first define methods , having object extend trait , referring trait in class needs it. allow mock effectively.

ms access - SQL to Get Only One Record for Each "item" Based on different column -

i have worked week researching question , learning different sql techniques. trying display results in listbox in microsoft access. have columns sqlidofloggers, jobnumber, datedeployed, datereturned, ahulocation, accesspoint , 2 comboboxes cbologgertype , cboorderby filter these results (i did workaround cboorderby using vba, that's why not in posted sql). what want pull 1 record each distinct sqlidoflogger . determine 1 record among several each sqlidoflogger want order them datereturn -eds , pick latest don't want show records datereturn null, i.e. they're still out on job this sql have brings correct information, shows more 1 record each logger: select (select top 1 tblloggers.loggerid tblloggers tblloggers.id = tbluse.idoflogger) sqlidoflogger, (select top 1 tblprojectlist.jobnumber tblprojectlist where( tblprojectlist.id = tbluse.idofproject)) expr1, tbluse.datedeployed, tbluse.datereturned, tbluse.ahulocation, tbluse.accesspoint tbluse (...

R for loop in matrix -

i have 2 365x1 matrix s1 , s2, mean , standard deviation vector. want simulate normal distribution new 365x1 matrix. code used is sim<-matrix(rep(na,365),nrow=365,ncol=1) (i in 1:365){y<-rnorm(1,s1[i,],s2[i,]) sim[i,]<-y[i]} however generates first value. how should fix codes? thank much! no need loop. rnorm vectorised this... s1 <- sample(10,365,repl=true) s2 <- sample(3,365,repl=true) rnorm( 365 , s1 , s2 ) #[1] 5.83648500 1.64208807 0.02800676 -1.76443571 5.15361880 2.88269571 . . . this draw 365 random normal deviates using each of values in mean , standard deviation vectors s1 , s2 in turn.

data structures - C++ - run-time crashing of linear probing program -

i wrote program in c++ hashing using linear probing. code showing no error @ time of compilation when run it, computer shows notification program has stopped working. giving entire code below. please me out. #include<iostream> #include<vector> using namespace std; class acc { public: int idata; double ddata; acc(int id,double dd) { idata = id; ddata = dd; } void displayacc() { cout<<"idata = "<<idata<<"\n"; cout<<"ddata = "<<ddata<<"\n"; } }; class linear_hash { private: vector<acc*> hasharray; int nelem; acc* noelem; public: linear_hash(int max) { nelem = max; hasharray.resize(nelem); noelem = new acc(-1,1.1); for(int = 0;i<max;i++) { hasharray[i] ...

jQuery special characters causing issues -

i have simple script looking heading perform function when heading matched. running issues special characters copyright , registered trademarks. var isdisclosure = $('.disclosure-container h3').html(); if ( isdisclosure == "awesome product<sup>&#174;</sup> disclosures" ) { alert('zomg'); } the html looks in firebug: <h3 class="inline"> awesome product <sup>®</sup> disclosures </h3> upon viewing source html looks this... <h3 class="inline">awesome product<sup>&#174;</sup> disclosures</h3> so when add html if statement, added character , doesn't work... so... if ( isdisclosure == "awesome product<sup>©</sup> disclosures" ) i open searching "awesome product" wildcard or @ end. you use regex test partial match if(/awesome\sproduct<sup>.+</sup>\sdisclosures/i.test(isdisclosur...

Using PHP Order By to sort query results -

the below code displays data table , filters depending on results of 2 combo boxes. able order results id once form submitted, not on initial load (where listed). have tried $sql = "select * places order id"; works when list loads returns error when form submitted. hope makes sense. ideas? thanks! // default query $sql = "select * places"; // check if form submitted if (isset($_post['area'])) { $connector = 'where'; if ($_post['area'] != 'all') { $sql .= " area = '".$_post['area']."' order id"; $connector = 'and'; } if ($_post['theme'] != 'all') { $sql .= " $connector theme = '".$_post['theme']."' or theme2 = '".$_post['theme']."' order id"; } } your order id clause must appear @ end of statement. if both $_post['area'] , $_post['t...

tablelayout - Fixed height of tableRow Android -

i have calendar contains tablelayout 6 rows, each row contains 6 cells of type cellulemensuelle (it extends linearlayout). in beginning, rows have same height, when add textviews cell, increases height of row, how can prevent ? want rows keep initial height here xml file calendrier_calendriermensuel.xml <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content"> <textview android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="3" android:text="lundi" android:background="@drawable/ligne_bor...

xml - how to extract the values of the "For" attribute using E4X and Flex / Flash ActionScript -

i have xml document looks this <someroot xmlns:ix="someurl.com"> <ns:inventorypage title="something"> <ns:inventory id="inventory"> <ns:inventoryview id="inventoryview"> <menu> <ns:gridcreateactionlink override="true" visible="false" runat="server"/> </menu> <columns> <ns:column for="incidentno" linkto="default"/> <ns:column displayas="string" for="location"/> <ns:column for="dateatimeoccur" format="d"/> <ns:column for="description"/> <ns:column for="workflow.personresponsible" displayas="string"/> <ns:column for="workflow.duedate" format="d"/> <ns:column for="dateclosed" format="d"/...

browser - how to install multiple version internet explore 6 & 7 & 8 -

Image
i new web developer , have ie 9 in pc. want install multiple version ie in pc don't know it. search in site , find "try http://www.brothersoft.com/ietester-153799.html " when see site understand can install ie version 3-6 don't know how install ie version 7 & 8 in pc???? you don't have install multiple versions because ie has backwards compatability. press f12 open developer console, , there can choose how want website render like, ie-7 - ie-9 this not support ie6 , below, if person still using not want live in real world suggest pushing them away not supporting browsers...

sql - Teradata: how can I get the primary key and foreign key definition of a table? -

the tables there don't know how crated. want definition of primary key , foreign key of tables. how can that? there several ways pk/fk info in teradata, might fail if there's no pk/fk defined table. , there's high probability (especialy fks) they're not defined in data warehouse. in case need external documentation on datamodel. dbc.indicesv holds indexes, there's 1 row per column per index, e.g. 4 column pk results in 4 rows, defined in "columnposition" order: "uniqueflag" = 'y' indicates it's unique index "indextype" indicates how defined in create table: 'k' = primary key, 'u' = unique constraint, 'p' = primary index, 's' = secondary index dbc.all_ri_childrenv holds defined fks. if it's single table there's "help index my_table" indexes, in case prefer "show table my_table" returns full source code.

ruby on rails - Asset_sync gem skipping PDF files -

i configured asset_sync gem sync of assets amazon s3. deploy on heroku, , whatever reason, seems skipping pdf files in /app/assets directory. haven't told exclude files, why might happen? i've followed guide: https://devcenter.heroku.com/articles/cdn-asset-host-rails31 , , such don't have asset_sync.rb initializer file. i've tried moving pdfs own dir, /app/assets/pdfs , , no dice there either. strangely, have .zip file in /app/assets/images dir, seems pdfs being skipped. rails 3.2.13, ruby 2.0, heroku cedar stack, current release of asset_sync gem turns out had added *.pdf .slugignore file, , heroku tossing out pdf files on deploy. derp!

java - Migrate from org.json to Jackson in NetBeans Project? -

i have simple client application uses json/rest communication. simple, include org.json in project, , use api: import org.json.jsonobject; import org.json.jsonexception; jsonobject jo = new jsonobject(); try { jo.put("user", "john"); jo.put("order", "pizza"); } catch (jsonexception e) { e.printstacktrace(); } jo.tostring(); i migrate approach jackson. how simple steps? thanks. note: don't need instruction "how add lib project". information libs need object-to-json , json-to-object, , how can use magic of jackson in real life example. add jackson.jar in project in netbeans doing: file -> project properties -> libraries -> run-time libraries

linux - Executing a tcpstat command and performing operations on its output simultaneously -

i trying run tcpstat command gives output number of icmp requests being received. , @ same time need check count if exceeds threshold, message should displayed. i tried out this #!/usr/bin/perl @count= system "tcpstat -i eth1 -f icmp[0]==8 -o %c"; $i=0; while ($i<1000) { print "count of packets :".$count[$i]."\n"; $i=$i+1; if($count[$i]>50) { print "thats lot of pings"; } } but doesn't seem work because.. execution of command doesn't end without user interrupt... is possible that? running command , simultaneously performing operations on output? run tcpstat command in shell , pipe output perl script. tcpstat -i eth1 -f icmp[0]==8 -o %c | perl script.pl in way, should expect input <stdin> , remove system call in perl, of course.

javascript - Not sure how to hide a div when clicking OUTSIDE of the div -

this follow-up question question: angularjs input focus kills ng-repeat filter of list basically code using angularjs pop-out div (a drawer) on right filtering list of things. times used ui blocked clicking on blocking div closes drawer. in cases don't block ui , need allow user click outside of drawer cancel search or select else on page. my initial thought attach window.onclick handler when drawer opens , if clicked other drawer should close drawer. that's how in pure javascript app. in angular being bit more difficult. here jsfiddle sample based on @yoshi's jsbin example: http://jsfiddle.net/tpeiffer/kdmn8/ the relevant piece of code sample below. if user clicks outside of drawer invoke $scope.togglesearch $scope.open set false. the code works, , though $scope.open goes true false doesn't modify dom. i'm sure has lifecycle of events or perhaps when modify $scope (since separate event) copy , not original... the ultimate goal on directive ul...

c# - asp.net mvc application logging me out almost randomly -

the application works fine when running locally, when upload hosting (123-reg) , log in, authentication cookie made, , can navigate site few seconds, i'm redirected log in, authentication cookie still exists. it logs out user after random amounts of time, when on hosting. after thorough searching discovered 123-reg's iis generating automatic machine key application , timing out. if generate 1 using this , put in web.config file, works!

javascript - Cannot parse json data from ajax call. Attempted fixes cause me to go in circles. Why? -

update : @messiah told me shorten this. here bare bones version. i cannot parse response ajax call. keep going in circles. google telling me this problem. well, no matter if take out json in ajax call or call parse. give me errors. if parse directly without using json.parse(), get: first 1 is: uncaught typeerror: cannot read property 'time' of undefined okay, means not parsed. currently, getting because trying parse: 1 getting right is: uncaught syntaxerror: unexpected token u okay, means parsed . here ajax call: var reply; function sendrouterequest() { $.ajax({ type: 'get', //contenttype: "application/json; charset=utf-8", url: '/api/getreply', data: data, datatype: 'json', success: function(result) { reply = result; console.log(reply); console.log(reply.time); },...

How can I get column numbers in csv using buffered reader in java? -

so here trying do: my csv has 5 columns a b c d e how can column number of each column in csv using java , column using column number want append data cell.i new concept,so please suggest how move ahead.thanks. use string#split() process every line , collect column values array. (array index + 1) give column number or value @ column n @ (n - 1) index. string line = "a,b,c,d,e"; string[] values = line.split(","); system.out.println ("value @ column 4 = " + values[3]);

c++ - Heap or Red-Black Tree? -

i willing use data structure overflow buffer of constant space. want have efficient insert importantly efficient removal of min element. thinking of using heap since have o(log(n)) find_min() , log(n) insertion , deletion. on other hand know don't understand advantage in comparison red-black tree since has o(log(n)) insert , delete , o(1) find min/max. , advantage of sorted output (i not care that). the question related to: is red-black tree ideal data structure? since have both of structures available std::map , boost::heap why should prefer use heap instead of red-black tree? finally, using red-black tree have o(log(n)) search time entry while heap time o(n) important since duplicates exist. the difference in how use structures. binary heaps fast data structures inserting values , retrieving minimum value. however, don't support efficient searching or deletion of random values. red/black trees balanced binary search trees support efficient insertion, de...

android invoke another apk and get a return result -

i integrating 2 different apks logic pretty simple: app calls app b passing amount app b receives request if app b's "active" activity in (main) activity c set amount allow user process amount once done processing return transaction number app else return result_canceled app a given can can call app b via startactivityforresult, but: what happens in app b when (main) activity c launched when application left sitting in activity d? how detect in middle of activity d in order fail , return result_canceled? in normal processing want return resulting transaction number caller, i've tried passing intent extras in setresult, intent returned app null. does have simple example of this? you can use startactivityforresult() if both calling activity , called activity run in same task . otherwise startactivityforresult() generate immediate call onactivityresult() result_canceled . given above premise, if app starts app b using start...

What is the Ruby equivalent of the "this" function in Java? -

in java there "this" function points method. there equivalent in ruby? instance, there: def method this.method end the equivalent self . implict. self.first_name same first_name within class unless making assignment. class book attr_reader :first_name, :last_name def full_name # same self.first_name + ", " + self.last_name first_name + ", " + last_name end end when making assignment need use self explicitly since ruby has no way of knowing if assigning local variable called first_name or assigning instance.first_name . class book def foo self.first_name = "bar" end end

sql - How to get 6 months from a parametrized date -

i have clause trying date within range parameters so, (al.inserted_date between (:begindate) , (:enddate)) the problem need 6 months before begin date error, ora-00904: "dateadd": invalid identifier, when try, (al.inserted_date between dateadd(month,-6,(:begindate)) , (:enddate)) can point me out doing wrong? you're not using sql server, you're using oracle - that's why it's giving error in oracle format. http://psoug.org/definition/add_months.htm add_months best equivalent you're trying here - (al.inserted_date between add_months((:begindate),-6) , (:enddate))

R unable to load package Snowball, rJava -

i trying r package "lsa" running, in turn requires snowball, in turn fails. i'm running opensuse 12.2 latest r-patched build (currently 3.01). here's thing: libraries load no problem if "sudo r" if try run r way, in emacs ess mode, don't have sudo , attempt fails. here's see: library(lsa) loading required package: snowball error : .onload failed in loadnamespace() 'snowball', details: call: null error: .onload failed in loadnamespace() 'rjava', details: call: dyn.load(file, dllpath = dllpath, ...) error: unable load shared object '/usr/lib64/r/library/rjava/libs/rjava.so': libjvm.so: cannot open shared object file: no such file or directory error: package ‘snowball’ not loaded this @ conclusion of long string of rjava issues. suggestions on how can running without sudo (running sudo r seems dumb, in addition being problem ess mode)

java - How to install sphinx4? -

for vast majority of straightforward, need installing sphinx4 speech recognition software. in particular, using cygwin so. 1) how 1 set environmental path variable java sdk (i had install netbeans) 2) 1 need install ant if ant libraries present in netbeans? 3) there better way import sphinx jars .java project in netbeans through using cygwin? i don't know i've been going wrong , use , for setting of environment variables. 1) right-click my computer icon on desktop , select properties. 2) click advanced tab. 3) click environment variables button. 4) under system variables, click new. 5) enter variable name java_home . 6) enter variable value installation path java development kit. if java installation directory has space in path name, should use shortened path name ( e.g. c:\progra~1\java\jre6 ) in environment variable instead. note windows users on 64-bit systems progra~1 = 'program files' progra~2 = 'program files(x86)...

c# - Microsoft Excel Application entry missing in DCOMCNFG -

entry "microsoft excel application" not there in dcomcnfg (tried in both 32 , 64 bits). how can make shows there? suggestion? assuming have restarted since install, page explains how attempt re-register com server: technet entry on excel dcom config . hth.

python - How to streamline this script -

i have script , work has 2 separate processes spawn listener threads kill process when kill sent listener via pipe. multiprocessing import process, pipe threading import thread import time subalive = true testalive = true def sub_listener(conn): #listens kill main global subalive while true: data = conn.recv() if data == "kill": subalive = false #value kill break def test_listener(conn): #listens kill main global testalive while true: data = conn.recv() if data == "kill": testalive = false #value kill break def subprocess(conn, threadnum): t = thread(target=sub_listener, args=(conn,)) count = 0 threadval = threadnum t.start() while subalive: print "thread %d run number = %d" % (threadval, count) count = count...

AngularJS $http call not outputting Array -

trying grab associative array through angularjs $http call, instead of getting actual array, getting string "array". here $http call: $http({ method : 'post', url : '[myphpfile].php', data : 'data=' + $scope.placementid, headers : { 'content-type' : 'application/x-www-form-urlencoded' } }).success(function(data) { alert(data); }); and [myphpfile].php (omitted other lines): echo somefunctioninanotherfile($_post['data']); i know grabbing array because doing echo var_dump(thearray) in [myphpfile].php , alert(data) in success part of $http call, get: array(8) { ["id"]=> string(1) "2" ["id_key"]=> string(1) "2" ... } but without var_dump, , alert(data["id"]) under success, nothing happens. , doing alert(data[1]) "r", not sure why returned data becomes string ca...

ios - Passing Data to a Navigation controller inside a Tab View controller -

i'm pretty new ios development. i have problem passing data between views in tab bar controller. viewcontroller // first tab in tab bar number pad entering numbers label songcontroller // second tab embed within navigation controller searches database number entered in first tab , displays lyrics in web view i'm try pass value label in viewcontroller method in songcontroller. in viewcontroller.m - (ibaction)gobutton:(id)sender { int songnum = [self.numberlabel.text intvalue]; nsstring *songnumber = [nsstring stringwithformat:@"%d",songnum]; if ([songnumber isequal: @"0"] || [songnumber isequal: @""]) { [self.numberlabel settext:@""]; uialertview *songnotfound = [[uialertview alloc] initwithtitle: @"sorry" message: @"this song not found." delegate: nil cancelbuttontitle:@"ok" ...

php - How can Google Analytic Cookies appear without using Analytics? -

i have never used google analytics on web site. i have implemented online booking system wrote using javascript , php. my php code includes "trace" logs data , events related application. there separate trace log each user session. trace includes list of cookies , values available. i have discovered single instance cookies named utma, utmb, utmz, ld893_bl , utmc present in user session. found utm.. cookies belong google analytics. (still no idea ld903_bl cookie is.) my question this: since web page includes javascript, , code not set these cookies, how can cookies exist domain? mah addendum trace: user agent: mozilla/5.0 (compatible; msie 10.0; windows nt 6.1; wow64; trident/6.0) --- cookies --- mahavailabilitydate : d20130615z-0500p01 mahmode : v01m0400a0000h137394118225684859002 __utma : 208741518.729017776.1373940236.1373940236.1373940236.1 __utmb : 208741518.0.10.1373940236 __utmz : 208741518.1373940236.1.1.utmcsr=(direct)|utmccn=(direct)|...

javascript - jQuery Div inside Div -

i'm trying display photo gallery jquery. code: <script> $("#vsetky").click(function(){ $("#obrazky").show(); }); $("#c").click(function(){ $("#cervene").show(); }); </script> <div id="obrazky"> <div id="cervene"> <img src="1.png"> <img src="1.png"> </div> <div id="zlte"> <img src="2.png"> <img src="2.png"> </div> <div id="zelene"> <img src="3.png"> <img src="3.png"> </div> </div> when #vsetky element clicked... works, every picture displayed. when #c element clicked, there aren't pictures. tried use $("#obrazky > #cervene").show(); i've tried other methods nothing working. me please - doing wrong? what css like? if both #obrazky , #cervene have display...

PHP setcookie function not saving cookies? -

i hoping might able small issue i'm having code i'm working on. please keep in mind, hobby site, aware there security holes. have written function called set_remember_cookies called login script , registration page when user checks "remember me" box. a function on each secured page following: checks see if remember cookies set queries database find user_id associated hashed username in cookie gets password user_id user table gets salt remember_cookies table hashes password + salt , matches against hashed password in cookie again, know insecure store hashed password in cookie, not worried now. my problem set_remember_cookies function, have included below, not setting cookies. on secured pages, first step (checking if cookies exist) fails. have checked in browser cookies, , not stored. can explain me why function not setting cookies? can't find errors, can! thanks! <?php function set_remember_cookies($uid, $identifier, $password) {...

email - procmail not piping e-mail content to a file -

i have postfix server , procmail installed , working. problem when try output content of e-mail file. i have following script: /var/log/user1/fooscript.sh #!/bin/bash echo "trying e-mail" > success.txt echo $1 >> success.txt /var/log/user1/.procmailrc verbose=off pmdir=$home/.procmail logfile=$pmdir/procmail.log includerc=$pmdir/rc.filters /var/log/user1/.procmail/rc.filters :0 * ^from:(.*\<)?(test@gmail\.com)\> | /var/log/user1/fooscript.sh after sending e-mail, /var/log/user1/.procmail/rc.filters contains: from test@gmail.com thu jul 18 05:08:13 2013 folder: /var/log/user1/fooscript.sh 513 but success file shows: trying e-mail (empty line) i've chmod 777 files , directories, don't think permissions issue. any appreciated. your script gets message via standard input (stdin). try: #!/bin/bash echo "trying e-mail" > success.txt # append data read stdin success.txt file ca...

Java Spring AOP with XML doesn't work -

i'm testing spring's aop xml features, can't make work. edit: problem appears when method called constructor of class. my applicationcontext.xml: <beans xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd"> <aop:aspectj-autoproxy/> <bean id="aopclass" class="hu.viper.aoptest.aopclass"/> <bean id="mainclass" class="hu.viper.aoptest.mainclass"/> <aop:config> <aop:aspect ref="aopclass"> <aop:pointcut id="pointcutbefore" expression="execution(* hu.viper.aoptest.mainclass.hello(..))"/> <aop:before method="writeaop" pointcut-ref=...

c# - Why does Runspace.OpenAsync() ignore InitialSessionState? -

i writing code interface powershell. had following: using (var runspace = runspacefactory.createrunspace(initialsessionstate)) { runspace.open(); this code works fine. however, since code in async method, wrote following experiment: public static task opentaskasync(this runspace runspace) { if (runspace.runspacestateinfo.state == runspacestate.opened) return task.fromresult<object>(null); var tcs = new taskcompletionsource<object>(); eventhandler<runspacestateeventargs> statehandler = null; statehandler = (o, e) => { if (e.runspacestateinfo.reason != null) { runspace.statechanged -= statehandler; tcs.trysetexception(e.runspacestateinfo.reason); } else if (e.runspacestateinfo.state == runspacestate.opened) { runspace.statechanged -= statehandler; tcs.trysetresult(null); } }; runspace.statechanged += statehandler; runs...

javascript - why innerHTML dosen't work inside setTimeout? -

$(document).ready(function () { counter.innerhtml = "3"; var t1 = settimeout(function () { counter.innerhtml = "2"; }, 1000); var t2 = settimeout(function () { counter.innerhtml = "1"; }, 1000); var t3 = settimeout(function () { counter.innerhtml = null; }, 1000); }); hello, why innerhtml dosen't work inside settimeout me? there better why count down? thanks! $(document).ready(function () { counter.innerhtml = "3"; var t1 = settimeout(function () { counter.innerhtml = "2"; }, 1000); var t2 = settimeout(function () { counter.innerhtml = "1"; }, 2000); var t3 = settimeout(function () { counter.innerhtml = null; }, 3000); }); try this

php - Why is including multiple files so much slower than bundling into one -

i have been doing tests php, , have noticed performing include on multiple files compare 1 containing functions slower. my test involved creating 1025 files, 1024 of contained text <?php class cls$i {} ?> (where $i file number), , 1 file concatenation of text in files before. had 2 functions, 1 testing each case. test loaded single file took 6ms compile bytecode , make contents available system, however, combination of 1024 files took 600ms . in terms of size, 1024 individual files same size single file. running apc cache bytecode, in practice, shaves off few milliseconds. i created ramdisk held files, marginally (10ms on average) faster. so, having said that, why individual files sooooo slower single file? down significant inefficiencies in loading engine within php, or have made considerable cockup in configuration (on local system, standard ampps installation)? my first guess it's stat system calls going on. what happens if turn apc.stat off in...

.htaccess - mod_rewrite changing real URLs -

rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([^/]*)$ /?a=$1 [l] rewriterule ^([^/]*)/([^/]*)$ /?a=$1&app=$2 [l] rewritecond %{http_host} ^www\.(.*)$ [nc] rewriterule ^(.*)$ http://%1/$1 [r=301,l] this suppose make urls search engine , user friendly, problem if goes http://pattersoncode.ca/realurlhere/ redirects them error page though it's real directory. there anyway stop this? must thinking trying go http://pattersoncode.ca?a=realurlhere . it happening because of incorrect regular expression in line: rewriterule ^([^/]*)$ /?a=$1 [l] which matching 0 or more characters until / found. change to: rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([^/]*)/?$ /?a=$1 [l] and problem fixed. in answer have made trailing slash options both /realurlhere/ , /realurlhere supported.

c++ - weird things using std::vector -

this question has answer here: binary_search in c++ unexpected behaviour 4 answers i wrote simple code insert 2,4,8,16,32,3,9,27,5,6,7 vector object. after insert these numbers, check std::binary_search 8, weirdly returns 0. here code. not know why. me? lot! #include <iostream> #include <math.h> #include <vector> #include <algorithm> using namespace std; void printvector(vector<int>const & p) { (int = 0; < p.size(); i++) cout << p[i] << ' '; cout << endl; } int main() { const int max = 100; int num; vector<int> base; (int = 2; <= 7; i++) { int expo = log(max) / log(i); num = 1; (int iexp = 1; iexp < expo; iexp++) { num *= i; if (!binary_search(base.begin(), base.end(), num)) { // if number not in ve...

c++ - how to search for a string between 4 strings -

i want write program gets 4 strings user , asks user type string see if string exist in 1 of 4 strings have been entered.could please correct mistakes.thank you.(i use dev c++) #include<iostream> #include<conio.h> #include<stdlib.h> using namespace std; int main() { int x,y,i; string z[40],a; (int i=0;i<4;i++) { cout<<"type 4 strings"; cin>>z[i]; } cout<<"type string search "; cin>>a; (int i=0;i<4;i++) { if(strcmp(z[i],a)==0) cout<<z[i]; else cout<<"error"; } getch (); return 0; } you can't mix c style string functions ( strcmp ) c++ std::string - works fine compare c++ std::string types regular if (str1 == str2) ... , there no need use strcmp here.

android - Tux Rider compiles but crashes on startup -

i wanted experiment android development, decided mess around drodin's tux rider app. had create new project in eclipse, drodin's existing 1 wasn't recognized. there, copied , pasted original project in. app compiled fine in eclipse (once downloaded latest google ads sdk , replaced missing, older version in build path). problem is, crashes whenever try run on virtual android 1.6 phone nexus 7 android 4.2.2. when attempted use debug mode virtual phone, app hung @ loading screen, proceeded crash when closed eclipse. what doing wrong? edit here's logcat log: http://pastebin.com/3jdhebw2 , here's traces.txt data/anr: http://pastebin.com/x9vijejm this: 07-18 04:26:30.696: w/dalvikvm(379): threadid=17: thread exiting uncaught exception (group=0x4001aa28) 07-18 04:26:30.705: e/androidruntime(379): uncaught handler: thread thread-9 exiting due uncaught exception 07-18 04:26:30.776: e/androidruntime(379): java.lang.exceptionininitializererror 07-1...

javascript - How to hide/show nav bar when user scrolls up/down -

hide/show nav bar when user scrolls up/down here's example i'm trying achieve: http://haraldurthorleifsson.com/ or http://www.teehanlax.com/story/readability/ the navigation bar slides off screen when scroll down , slides down on screen when scroll up. i've figured out how fade in/fade out achieve exact same animation in example. note: tried slidein() , way stretching animation... jquery: var previousscroll = 0, headerorgoffset = $('#header').offset().top; $('#header-wrap').height($('#header').height()); $(window).scroll(function() { var currentscroll = $(this).scrolltop(); console.log(currentscroll + " , " + previousscroll + " , " + headerorgoffset); if(currentscroll > headerorgoffset) { if (currentscroll > previousscroll) { $('#header').fadeout(); } else { $('#header').fadein(); $('#header').addclass('fixed'); ...

php - Attempting to learn mysqli prepared statements; what am I doing wrong? -

here's error i'm getting... failed prepare statement: (1064) have error in sql syntax; check manual corresponds mysql server version right syntax use near '?.pages slug='?'' @ line 1 and here's code... require_once("../database/config.php"); $pageslug = "home"; $db = new mysqli(_db_host, _db_user, _db_password, _db_name); if ( $db->connect_errno ) { echo "failed connect mysql: (" . $db->connect_errno . ") " . $db->connect_error; exit(); } if ( !$selectquery = $db->prepare("select * ?.pages slug='?'") ) { echo "failed prepare statement: (" . $db->errno . ") " . $db->error; exit(); } if ( !$selectquery->bind_param("ss", _db_name, $pageslug) ) { echo "binding parameters failed: (" . $selectquery->errno . ") ...

In Excel, how to get the count of records with the first column larger than 1 and the second column larger than 2? -

Image
i have excel table many rows. each record/row has 2 columns of number. how count of records (rows) first column larger 1 , second column larger 2? have tried countifs function? =countifs(a:a,">1",b:b,">2") this counts both conditions evaluate true, think desire. example:

php - Web app to call and connect 2 users by phone -

i want build php website 2 users can schedule phone conversation @ time. @ scheduled moment, want web application call , connect both users phone (call them @ respective phone numbers), while website can monitor length of call , save it. is there existing web application can achieve this? if not, possible create such app? you want using asterisk + freepbx form solid foundation , api work ivr's , else want. take peak at: asterisk , freepbx

java - Explain this code (not getting the result i need) -

package javaapplication54; public class javaapplication54 { static int monkey = 8; static int thearray[] = new int[1]; public static void main(string[] args) { // attempted 2 ways try set monkey = thearray[0]; monkey = thearray[0]; thearray[0] = monkey; //i tried result 8; system.out.println(thearray[0]); } } i trying result 8, printing out thearray[0] result zero. run: 0 build successful (total time: 0 seconds) you assigned thearray[0] in line monkey = thearray[0] thearray[0] 0 when first initialized thearray @ line: static int thearray[] = new int[1];