Posts

Showing posts from May, 2011

javascript - How to set default value of Column-Toggle Table Widget for a column? -

javascript - How to set default value of Column-Toggle Table Widget for a column? - i have been toying around table widget jquery mobile. there way can set show-hide status of column table header name via widget? if there no such way best solution such problem? jqm doesn't offer out-of-the-box solution this, therefore, have through js. column toggle popup inherits table's id followed -popup . need target when tablecreate event fires alter checkbox(es) property. note thead elements data-priority added column toggle popup. moreover, need target checkbox(es) index using .eq() method or :eq() selector. $(document).on("pagebeforecreate", "#pageid", function () { $("#tableid").on("tablecreate", function () { $("#tableid-popup [type=checkbox]:eq(1)") /* sec checkbox */ .prop("checked", false) /* uncheck */ .checkboxradio("refresh") /* refre

python - preclassified trained twitter comments for categorization -

python - preclassified trained twitter comments for categorization - so have 1 1000000 lines of twitter comments info in csv format. need classify them in categories if talking : "product longevity", "cheap/costly", "on sale/discount" etc. as can see have multiple classes classify these tweets info into. thing how generate/create training info such huge data.silly question wondering whether/not there preclassified/tagged comments info train our model with? if not best approach create training info multi-class classification of text/comments ? while have tried , tested naivebayes sentiment classification smaller dataset, please suggest classifier shall utilize problem (multiple categories classify comments into). thanks!!! the thing how generate/create training info such huge data i suggest finding training info set help categories interested in. let's cost related articles, might want find training info set

c++ - Arduino UNO, CC3000: while(client.connected) -

c++ - Arduino UNO, CC3000: while(client.connected) - i'm playing around arduino uno , cc3000 shield connecting remote web service. though i'm having problem looping script. can see in code below, script should ping web service state of occupied every 5 seconds. though when using while(client.connected) makes arduino stop/hang forever. if while(client.connected) {} empty. if don't include while(client.connected){} web service not pinged, why find myself in quite dilemma. please see arduino sketch file below , serial log below that. #include <adafruit_cc3000.h> #include <ccspi.h> #include <spi.h> #include <string.h> #include "utility/debug.h" // these interrupt , command pins #define adafruit_cc3000_irq 3 // must interrupt pin! // these can 2 pins #define adafruit_cc3000_vbat 5 #define adafruit_cc3000_cs 10 // utilize hardware spi remaining pins // on uno, sck = 13, miso = 12, , mosi = 11 adafruit_cc3000 cc3000 = adafr

bash for loop through no file -

bash for loop through no file - when loop through files starting foo do for f in foo* ; echo "result = $f" ; done the problem when no file start foo get: result = foo* meaning loop executed once, if no file start foo . how possible? how can loop through files (and not loop @ if there no file)? you can stop behaviour setting nullglob: shopt -s nullglob from linked page: nullglob bash shell alternative modifies [[glob]] expansion such patterns match no files expand 0 arguments, rather themselves. you can remove setting -u (unset, whereas s set): shopt -u nullglob test $ touch foo1 foo2 foo3 $ file in foo*; echo "$file"; done foo1 foo2 foo3 $ rm foo* let's see: $ file in foo*; echo "$file"; done foo* setting nullglob : $ shopt -s nullglob $ file in foo*; echo "$file"; done $ and disable behaviour: $ shopt -u nullglob $ file in foo*; echo "$file"; done foo*

java - Selenium WebDriver click on input element to upload file freezes -

java - Selenium WebDriver click on input element to upload file freezes - i have click on element upload csv file selenium webdriver in junit. input looks this: <input type="file" name="upload0" size="56" value="" id="dateiimportschritt2csv_upload0"/> if click on input element os window opens have take file upload. problem if utilize selenium clicking input this: driver.findelement(by.xpath("//div[@id='wwctrl_dateiimportschritt2csv_upload0']/input")).click(); it open os window, freezes whole test without exceptions. if close window manually, test continues. on place in code, have download file. similar, except it's not input element anchor element ( <a> ) , works fine there. so how click input element opens os window without freezing test? tried submit() , window not open method. i'm using: windows 7 firefox 32.0.3 selenium webdriver 2.43.1 junit 4 edit: whole div element

design patterns - How to implement use case controller in a php(and javascript) project -

design patterns - How to implement use case controller in a php(and javascript) project - i'm beginner in php , design patterns. i'm having problem implementing utilize case controller in application containing javascript , php. i'm trying create project of pupil profile manager. have utilize case of "upload marks" in teacher uploads students' marks of particular section. , have assigned responsibility of scheme operations in utilize case class named uploadmarkseventhandler. have mentioned methods , attributes , not supposed produce output yet. here code: class uploadmarkshandler{ private $section; private $central_storage; private $students = array(); private $cookie_name; private isselectsection = false; function __construct(){ } function login($teacher_id, $password){ $password_temp=$this.centr/al_storage.getteacherpassword($teacher_id); if($password_temp==$password){ //set cookies setcookie($teacher_id, $passw

Anti-Phishing software with batch -

Anti-Phishing software with batch - i trying create basic anti-phishing software batch. using delete html files similar gmail login page. here's code: @echo off color fc title anti-phishing cls echo =============== echo [anti-phishing] echo =============== echo if there's no message ,you protected. set /p a=enter html file scan: /f %%x in ('findstr /i /m "gmail google add together account" %a%.html') ( if /i %%x equ %a%.html ( /f %%z in ('findstr /i /b /m "tskill del re-create shutdown ipconfig ren reg" %a%.html') ( if /i %%z equ %a%.html ( cls echo false page detected!! del %a%.html echo %a%.html deleted.... pause >nul ) ) ) ) pause >nul it says cannot open html file. please help me understand mistake. pretty new batch. here code little bit improved: @echo off color fc title anti-phis

c# - after installation NWebsec.Mvc , Project is not running -

c# - after installation NWebsec.Mvc , Project is not running - in mvc 4 application, set of import security headers , other security point, planning utilize "nwebsec", when iam using nwebsec.mvc 2.2.1, it's working have installed nwebsec.mvc 3.1.0, application stop working , not app_start gets phone call can track issue is. help thank you! ref, nwebsec.mvc 3.1.0 c# .net security asp.net-mvc-4

selenium - Running rspec parallel with capybara features -

selenium - Running rspec parallel with capybara features - i have test suite using capybara & rspec using ruby. using parallel_tests gem in order run tests in parallel using sauce. now great, splits workload spec files rather want using capybara features or better, scenarios. spec file looks like publisher_spec.rb feature "adding users publisher" scenario "using public groups" scenario "using private groups" so want run each scenario parallel test, looks @ spec files, forcing me break spec file multiple units. test suite run faster if had 1 scenario / spec file, ruin readibility , ability utilize "before" steps. anyone have solution? selenium rspec capybara qa

java - Accepting multiple integers on a single line using Scanner -

java - Accepting multiple integers on a single line using Scanner - the user needs come in number of integers. rather them come in integer @ time, want create can come in multiple integers on single line, want integers converted in array. example, if user enters: 56 83 12 99 want array created {56, 83, 12, 99} in other languages python or ruby utilize .split(" ") method accomplish this. no such thing exist in java knowledge. advice on how take user input , create array based on that, on single line? using scanner.nextint() method trick: input: 56 83 12 99 code: import java.util.scanner; class illustration { public static void main(string[] args) { scanner sc = new scanner(system.in); int[] numbers = new int[4]; for(int = 0; < 4; ++i) { numbers[i] = sc.nextint(); } } } at @user1803551's request on how scanner.hasnext() can accomplish this: import java.util.*; class ex

ruby on rails - How to convert string to hash WITHOUT EVAL -

ruby on rails - How to convert string to hash WITHOUT EVAL - this question has reply here: how convert string object hash object? 11 answers i have string. {"response_code"=>"success", "authorisation_result"=>"approved", "transaction_number"=>"1234567", "receipt_number"=>"999999", :cents=>100} stored value in hstore in postgresql. so it's raw string not yaml or json. wonering how value hash used insert record. the thought of using eval scares hell out of me, because there potential utilize input here. question might seem replica of how convert string hash in ruby/rails without using eval?, reply there doesn't mesh question. offers eval solution. (i don't understand how reply marked answer) ruby hashes pretty similar json, work example: require

oracle - Coherence Exception in NamedCache.putall after updating coherence to 12.1.3 -

oracle - Coherence Exception in NamedCache.putall after updating coherence to 12.1.3 - i utilize coherence in project next configuration. ok coherence 12.1.2, after updating coherence version 12.1.3, have problem. when set illustration 1000 item on cache 1 1 using namedcache.put() there no error, when set 1000 items on cache calling namedcache.putall once, coherence raises exception. project in java , deployed on jboss. cache configuration: <distributed-scheme> <scheme-name>my-map</scheme-name> <service-name>mymap</service-name> <serializer> <instance> <class-name>com.tangosol.io.pof.configurablepofcontext</class-name> <init-params> <init-param> <param-type>string</param-type> <param-value>pof-config.xml</param-value> </init-

jquery - Pagination using Javascript -

jquery - Pagination using Javascript - trying implement pagination jquery accordion using javascript. found link javascript class implement accordion pagination. however, it's not behaving expected. played while no result. can please help me figure fault is? i'd appreciated much. here created jsfiddle it. javascript code var paginatorhandle = null; jquery(document).ready(function () { jquery("#dalist").accordion({ autoheight: false }); paginatorhandle = jquery("#dalist").paginateaccordion({ "currentpage": 0, "itemsperpage": 3, "paginatorcontrol": jquery("#accordionpaginator") }); // initial paginate phone call paginatorhandle.paginate(); jquery("#accordionpaginator .nextpage").click(function () { paginatorhandle.nextpage(); }); jquery("#accordionpaginator .previouspage").click(function () { paginatorhandle.previouspage(); }); jquery("#accor

c# - Why am I getting "'System.Array' does not contain a definition for 'AsBuffer'" with this WinRT code? -

c# - Why am I getting "'System.Array' does not contain a definition for 'AsBuffer'" with this WinRT code? - according this, next code can used convert byte array bitmapimage: public static async task<bitmapimage> bytearraytobitmapimage(this byte[] bytearray) { if (bytearray != null) { using (var stream = new inmemoryrandomaccessstream()) { await stream.writeasync(bytearray.asbuffer()); var image = new bitmapimage(); stream.seek(0); image.setsource(stream); homecoming image; } } homecoming null; } however, get, "'system.array' not contain definition 'asbuffer' , no extension method 'asbuffer' accepting first argument of type 'system.array' found (are missing using directive or assembly reference?)" is "var stream" assignment vague (implicit typing) , need specify particular info type &qu

opengl - glOrtho appears to have no effect -

opengl - glOrtho appears to have no effect - i drawing square coordinates (-.5, -.5), (-.5, .5), (.5, .5), (.5, -.5) , noticed appeared squashed in 800 x 600 window (which seems exclusively logical). i trying prepare square appeared square, not rectangular. approach phone call glortho() values of left = -ar , right = ar , bottom = -1 , top = 1 ar aspect ratio ( 800/600 ). found phone call made glortho() had no effect, including 1 making (i remove , nil change). my understanding of glortho() maps corners of opengl context values supplied, , stretches between points fit. incorrect, or doing that's preventing phone call glortho() taking effect? class="lang-java prettyprint-override"> import org.lwjgl.bufferutils; import org.lwjgl.lwjglexception; import org.lwjgl.opengl.display; import org.lwjgl.opengl.displaymode; import java.nio.floatbuffer; import static org.lwjgl.opengl.gl11.*; import static org.lwjgl.opengl.gl15.*; public class glorthotes

java - Whats wrong with my QuickSort implementation? -

java - Whats wrong with my QuickSort implementation? - class partitionit { public static void partitionit(int[] a, int l, int r, int pivot) { int i,j; = j = l+1; while(j<= r) { if(a[j] <= a[pivot]) { swap(a,j,i); i++; } j++; } swap(a,pivot,--i); } public static void swap(int[] a, int j, int i) { int temp = a[j]; a[j] = a[i]; a[i] = temp; } public static void displayarray(int[] a) { for(int i:a) system.out.print(i+" "); system.out.println(); } public static void quicksort(int[] a, int l, int r) { if(r <= l) return; int pivot = getpivot(a,l,r); partitionit(a,l,r,pivot); quicksort(a,l,pivot); quicksort(a,pivot+1,r); } public static int getpivot(int[] a,int l,int r) { homecoming l; } public static void main(string[] args) { int[] = {3,2,8,5,1,4,7,6}; int[] b = {1,2,3,4,5,6,7,8,9,0}; int[] c = {

dll - How to exclude a system library from dynamic linking -

dll - How to exclude a system library from dynamic linking - i have local dll want shadow scheme one. how do that? specifically (on linux): /usr/bin/clang++ -o vw main.o -l. -l vw -l allreduce -l /usr/lib -l /usr/lib/x86_64-linux-gnu -l boost_program_options -l pthread -l z but then $ ldd vowpalwabbit/vw libvw.so => /usr/lib64/libvw.so (0x00007ffa22789000) and want point ./libvw.so instead afaik parameter -nostdlib, used plain c. see clang produces crashing code -nostdlib dll linker

maven - build.gradle - error deploying artifact -

maven - build.gradle - error deploying artifact - i'm having issues publishing local nexus maven repository. i admit, don't have much experience using gradle. i have tried understanding documentation , examples given through gradle website (along few stackoverflow questions). i getting next error when seek publish: execution failed task ':publishmavenpublicationtomavenrepository'. > failed publish publication 'maven' repository 'maven' > error deploying artifact 'com.myproject:myproject-sdk:jar': error deploying artifact: resource deploy not found: file: http://git.site.com:8081/nexus/content/repositories/releases/com/myproject/myproject-sdk/3.0.0/myproject-sdk-3.0.0.jar not exist the entire build.gradle file looks this: apply plugin: 'java' apply plugin: 'maven-publish' apply plugin: 'build-version' buildscript { repositories { maven { url "http://git.site.com:8081/nexus/c

windows - How to make a batch file fullscreen? -

windows - How to make a batch file fullscreen? - i want create batch file when opens goes fullscreen, or if not possible @ to the lowest degree bit bigger it's default. try this mode con lines=32766 this alter buffer-size , create total screen in terms of heights. you can utilize next mode con: cols=[yourvalue] lines=[yourvalue] windows file batch-file fullscreen

Ubuntu 2 Node Cluster Postgresql 9.3 with pacemaker and Streaming Replication -

Ubuntu 2 Node Cluster Postgresql 9.3 with pacemaker and Streaming Replication - i'm trying setup 2 node cluster postresql 9.3 , streaming replication. streaming replication configured. master hear , sending slave. can failover manually creating trigger file , failback master update info directory rsync, promote old master slave failover again. at point, working fine. now wanna setup automatic failover virtual (floating) ip pacemaker. master should have vip take client connections read , writes. if postgresql service master goes down, failover should triggered floating ip should moved slave (new master) i seek next configuration guides https://github.com/t-matsuo/resource-agents/wiki/resource-agent-for-postgresql-9.1-streaming-replication https://github.com/t-matsuo/resource-agents/wiki unfortunately postgres not started pacemaker , vip-master assigned first started host. my pacemaker configuration is: property \ no-quorum-policy="ignore" \

java - Cant start tomcat with spring boot on linux -

java - Cant start tomcat with spring boot on linux - suddenly cant start embedded tomcat. i get: [main] error o.a.coyote.http11.http11nioprotocol - failed start end point associated protocolhandler ["http-nio-86"] java.net.socketexception: permission denied i tried changing tomcat port, tried setting permissions: chmod 777 src/ -r i utilize linux mint 17 i have no thought do... this stacktrace: [main] error o.a.coyote.http11.http11nioprotocol - failed start end point associated protocolhandler ["http-nio-86"] java.net.socketexception: permission denied @ sun.nio.ch.net.bind0(native method) ~[na:1.7.0_67] @ sun.nio.ch.net.bind(net.java:444) ~[na:1.7.0_67] @ sun.nio.ch.net.bind(net.java:436) ~[na:1.7.0_67] @ sun.nio.ch.serversocketchannelimpl.bind(serversocketchannelimpl.java:214) ~[na:1.7.0_67] @ sun.nio.ch.serversocketadaptor.bind(serversocketadaptor.java:74) ~[na:1.7.0_67] @ org.apache.tomcat.util.net.nioendpoint

c# - Reading from the stream has failed - MySqlException -

c# - Reading from the stream has failed - MySqlException - i'm trying open connection mysql database using next code piece: string connectionstring = "server=ip_number;database=database_name;uid=uid;password=password"; mysqlconnection connection; connection = new mysqlconnection(connectionstring); connection.open(); and here exception get: i'm using latest mysql connector (downloaded here). missing? thanks in advance, may seek this: connection server: string connectionstring= "datasource=localhost;port=3306;username=uid;password=1234" use "mysql-methodes" insert/update/select... like: public string pathselectdb = "select *from try.data;"; public string pathinsertdb = "insert `try`.`data`"; string constrnig = pathtodb; string query = pathinsertdb +"(`value1`, `value2`) values('"2"','3',');"; mysqlconnection condatabase

how to use a loop to repeat a word in vb.net -

how to use a loop to repeat a word in vb.net - i having problem programme trying code. have tried utilize list box , text box not word repeat appears once. need know doing wrong. these instructions , trying figure out. write programme requests user come in positive integer between 1 , 20 , word. programme first utilize loop validate integer input (refer illustration 2 in powerpoint example) , utilize loop display word same number of times integer input. example, if user enters 5 , “hello”, result show following: hellohellohellohellohello hint: in sec loop, append word result in each iteration of loop. example, if input 5, loop run 5 times , in each iteration of loop, word repeated once. if loop runs 5 times, word repeated 5 times. this have far: private sub btnenter_click(byval sender system.object, byval e system.eventargs) handles btnenter.click dim num double = 0 dim word string = "" dim result string word = txtword.text

string concatenation - how to concatenate two column values and store in a another column mysql php -

string concatenation - how to concatenate two column values and store in a another column mysql php - i want insert 2 column values(year + id(primarykey-autoin) = srf) in 1 column i can able concatenate values using next code select concat(year, id) srf billing_details dont know how insert values in column namely "srf". updated question: now have used next code $sqlselect = "update billing_details set srf = concat(year, id)"; it returns "null" update billing_details set srf = concat(year, id) mysql string-concatenation

html - how to make an icon a drop down list when clicked? -

html - how to make an icon a drop down list when clicked? - i have canvas in have 2 icons aligned right. want when 1 of icon clicked, drop downwards menu should open containing options. but don't know how create drop downwards list when icon clicked.so need help on this. as cannot set html elements within <canvas> , have position html elements appear within canvas. main trick wrap <canvas> element within wrapper <div> so edit added image drop-down also, heavily inspired form bootstrap drop-downs. although it's basic, should work. if want total featured, take above link ( , whole bootstrap fromework pretty good). class="snippet-code-js lang-js prettyprint-override"> $(".dropdown>[data-toggle='dropdown']").on('click', function(){ $(this).parent(".dropdown").toggleclass("open"); }); class="snippet-code-css lang-css prettyprint-override"> #ex-canvas

php - Retrival of fba sellers from amazon (api) -

php - Retrival of fba sellers from amazon (api) - may retrieve count of fba sellers product. through api user may input product name , amazon api have retrieve count of fba product. if yes can reference documentation link please allow me know if need more description... here documentation: http://docs.developer.amazonservices.com/en_us/products/products_getcompetitivepricingforasin.html http://docs.developer.amazonservices.com/en_us/products/products_getlowestofferlistingsforasin.html the operation need run called getcompetitivepricingforasin , / or getlowestofferlistingsforasin you can download several illustration libs here: https://developer.amazonservices.com/gp/mws/api.html/185-9907857-4122940?ie=utf8&group=products&section=products&version=latest a part of response you'll (in getcompetitivepricingforasin): <numberofofferlistings> <offerlistingcount condition="any">11</offerlistingcount> <offerl

javascript - How to get the values from that JSON? -

javascript - How to get the values from that JSON? - i've been trying values of json created php script , treated javascript { "category_id": "1", "parent_id": "0", "name": "root catalog", "is_active": null, "position": "0", "level": "0", "children": [{ "category_id": "2", "parent_id": "1", "name": "categoria raiz", "is_active": "1", "position": "1", "level": "1", "children": [{ "category_id": "14", "parent_id": "2", "name": "nombre1", "is_active": "1", "position": "1", "l