Posts

Showing posts from July, 2010

java - HTML: how to deploy applet (preferably .jar file) -

as title explains it, need deploy java app inside html document. i tried: <applet code=gume.class width="120" height="120"> </applet> and: <applet code=gume.class archive="dist/gume.jar" width="400" height="600"> </applet> it optimal, if deploy .jar file (aplication made netbeans , index.html file in root of application's folder).

android - comboseekbar java.lang.NullPointerException initDotsCoordinates? -

i trying implement this custom seekbar. i added comboseekbar these steps: right-click on project properties android add select "android-comboseekbar-master" ok ok this xml layout file: <com.infteh.comboseekbar.comboseekbar android:id="@+id/seekbar" android:layout_width="fill_parent" android:layout_height="wrap_content" app:color="#000" app:textsize="12sp" app:multiline="false" /> and java class: private comboseekbar segmentedseekbar; @override protected void oncreate(bundle savedinstancestate) { .... list<string> seekbarlist = arrays.aslist("a","b","c","d","e"); segmentedseekbar = new comboseekbar(this); segmentedseekbar.setadapter(seekbarlist); .... } after running app on device, error. e/androidruntime(2751): fatal exception: main e/androidruntime(2751): java.lang.run...

c# - Combo Box Data Binding -

hopefully has seen before , can see mistake: i binding combo box selected value data set , first time change combo box selected value, not update in data set i.e. values don't match. if change selected value second time works expected , data set updates match combo box. i using second data set data source populates list of items text (for user) provides index save in first data set. combobox.databindings.add(new system.windows.forms.binding("selectedvalue", dataview1, "mode", true)); combobox.datasource = dataview2; combobox.displaymember = "list_str.str_text"; combobox.valuemember = "list_str.index"; any idea why data set not update first time selected value changes? edit: may not have been clear i'm not binding directly data set - using data view since have multiple tables in data set. possible use data view automatically save data set? should close , open new question? try combobox.selectedindexchange...

javascript - How to make my button stay in its stationary position -

my problem when try select in selectbox button move below select dropdown list. i want make button stay if dropdown list in selectbox appear. current output: http://jsfiddle.net/gzsh6/2/ html: <div class="form-group input-group fixedbtn"> <button type="button" class="btn btn-warning"><span class="glyphicon glyphicon-list-alt"></span>&nbsp; create account</button> </div> </div> css: .fixedbtn { position: fixed; display: block; } i wouldn't bother fixed or absolute positioning can fickle , not extendable. instead, put height on wrapping element , set overflow visible. .col-sm-offset-1.col-sm-12 { height: 32px; overflow: visible; margin-bottom: 1.0em; } here jsfiddle: http://jsfiddle.net/mifi79/jvfv9/2/ the problem absolute positioning answers if add form field above it, break display (here fiddle demo how other solutions break)

c++ - Apple Mach-O linker error: Undefined symbols for architecture armv7 Google Protobuf -

i've been working on project contains 2 parts: a cocoa touch static library (.framework) a demo application uses (.framework) static library i have learned .framework added .framework (i.e., opencv2.framework) must added demo application. i've learned build settings architectures must same , build settings search paths must set. happy can be, i've been building , using .framework in demo application quite time. recently, i've added google protocol buffers .framework. my .framework compiling , seems in .framework. of course, demo application wasn't happy. so i've added libprotobuf-lite.a demo application , added path header files in header search paths . this should trick. instead, receive following errors , far have not been able find answer. here error log: undefined symbols architecture armv7: "vtable google_public::protobuf::message", referenced from: google_public::protobuf::message::message() in test-remote-i...

Input type="file" dont send files when using the jquery validation engine plugin SOLVED -

i'm using jquery-validation-engine plugin validating html form. validations works great, have 1 issue when try send files(images) input type="file". in form have many textfields, selects , 2 input fields file selection , sending on email. without validate plugin work - files , data other fields sent email. when use plugin, data textfield , selects sent. here php code handler files attachment // photo attachment $mime_boundary="==multipart_boundary_x".md5(mt_rand())."x"; $headers = "from: $fromemail\r\n" . "mime-version: 1.0\r\n" . "content-type: multipart/mixed;\r\n" . " boundary=\"{$mime_boundary}\""; $message = "this multi-part message in mime format.\n\n" . "--{$mime_boundary}\n" . "content-type: text/html; charset=\"iso-8859-1\"\n" . "content-transfer-encoding: 7bit\n\n" . $message . ...

python - How can I get actual text from an element that returns u'' when using element.text? -

here's html of element: <input type="text" class="gcpia-ycorb gcpia-ychrb"> whenever try text element using element.text, returns u'' though element has text. there method can use actual text element? element.text will return innerhtml of input element trying fetch. since input element not block level element, rather, uses value attribute store it's content, use alecxe had stated. the_text = element.get_attribute('value')

javascript - Trigger click event on DOM element -

i tried trigger click event on selected dom element code won't work. you can see attempt on jsfiddle . <ul class="list-group"> <a href="#" class="list-group-item" data-key="32">lg gola 8m</a> <a href="#" class="list-group-item" data-key="33">lg 5-6m</a> <a href="#" class="list-group-item" data-key="34">lp 5-6m</a> </ul> $(document).ready(function() { // string tr url parameters var tr = "fix_lg%20gola%208m"; if (tr !== null) { var terminrahmen = $('.list-group-item').filter(function() { return $(this).text() === decodeuri(tr).substring(4); }); // trigger click event on .list-group-item terminrahmen.click(); } // function executed $('.list-group-item').click(function() { alert($(this).text()); }); }); when do...

jquery - Multiple Morris graphics not working -

i'm using morris.js plugin use graphics. need page various donuts graphics, when put more one, last 1 doesn't work. the morris call is: <div id="grapht"></div> and, js is: <script type="text/javascript"> morris.donut({ element: 'grapht', data: [ {value: 50, label: '05'}, {value: 10, label: '07'}, {value: 40, label: '07'}, ], labelcolor: '#000', colors: [ '#ae1c1c', '#000', '#cc9a00' ], formatter: function (x) { return x + "%"} }).on('click', function(i, row){ console.log(i, row); }); </script> now whole code: <div id="grapht"></div> <div id="td"></div> <script type="text/javascript"> morris.donut({ element: 'grapht', data: [ {value: 50, label: '05'}, {value: 10, label: '07'...

java - JOOQ - nested query -

i'm trying write query jooq select region.*, (select count(*) city city.region_id = region.id) num region; i tried few things, no success. far got nothing more than dsl.select().from(tables.region).fetch(); how can add num column result? appreciated. your query this: // how can select region.* dsl.select(region.fields()) // how can add more fields select clause .select( // nested selects select() (from dsl) select(count()) .from(city) .where(city.region_id.eq(region.id)) // how convert org.jooq.select field .asfield("num") ) .from(region) .fetch(); the above implementation assuming static imports: import static org.jooq.impl.dsl.*; import static path.to.generated.tables.*;

python - Django w/ MySQL non-transactional changed tables couldn't be rolled back -

keep getting warning using mysql database: some non-transactional changed tables couldn't rolled back i'm not sure means or if causing problem hoping able fill me in on means. i taking csv file, reading line-by-line , creating django objects using get_or_create . after message, when try recreate it, further csv file before warning occurs. i tried reading error online don't understand means. ideal figure out whats causing if can't wondering if can suppress warning because maybe isn't effect database negatively. this happens when mix transactional , non-transactional tables. changes non- transactional tables not effected rollback statement. for reasons may have happened can turn docs : if not deliberately mixing transactional , nontransactional tables within transaction, cause message table thought transactional not. can happen if try create table using transactional storage engine not supported mysqld server (or disabled startup option)...

java - want ~/.m2/repository/ hierarchy of .jar s to be on CLASSPATH (with out causing [arg list too long] error) -

any body have tactics doing this? hate babysitting classpath. ksh, try for in `find ~/.m2/repository/ -print` export classpath=$i:$classpath done echo $classpath //admittedly, long cd $my_proj/target/test-classes/ java -cp .:$classpath com.my.myapp //but not work [arg list long] error any ideas?

Embeded Hashtags on facebook -

this question has answer here: how can track hashtags new facebook hashtag implementation 2 answers i want posts (ifram) particular hash tag in facebook. twitter widgets. managed twitter , please advice me how proceed using facebook? there no facebook hashtag api.

ruby on rails - Adding a css class to mapped elements -

i have code line on application users.skills.map {|m| m.name} returning user's skills. i skills styled css styles , trying figure out on how can add style each 1 of skills. clue? i not sure understand question, this: users.skills.map {|m| "<p class='your_css_class'>#{m.name}</p>"} does work you?

jQuery animate image swap -

i'm looking have image swap inside image gallery in way when user hovers on image grows in size , swaps out image. @ moment working soft fadein , fadeout effect. how can change faster transition , image looks growing in size? html <li class="carousel-img" data-alt-src="<?php the_sub_field('carousel_image_hover');?>" style="background-image:url( <?php the_sub_field('carousel_image');?> )" > jquery jquery(document).ready(function(e) { var bkgd_bl = ""; jquery('#carousel li').hover(function() { var bkgd = "url('" + jquery(this).attr('data-alt-src') + "')"; bkgd_bl = jquery(this).css('background-image'); jquery(this).stop().fadeout("1000", function() { jquery(this).css({ "background-image": bkgd, "...

java - how to use the linear regression of MLlib of apache spark? -

i'm new apache spark, , document of mllib, found example of scala, don't know scala, knows example in java? thanks! example code import org.apache.spark.mllib.regression.linearregressionwithsgd import org.apache.spark.mllib.regression.labeledpoint // load , parse data val data = sc.textfile("mllib/data/ridge-data/lpsa.data") val parseddata = data.map { line => val parts = line.split(',') labeledpoint(parts(0).todouble, parts(1).split(' ').map(x => x.todouble).toarray) } // building model val numiterations = 20 val model = linearregressionwithsgd.train(parseddata, numiterations) // evaluate model on training examples , compute training error val valuesandpreds = parseddata.map { point => val prediction = model.predict(point.features) (point.label, prediction) } val mse = valuesandpreds.map{ case(v, p) => math.pow((v - p), 2)}.reduce(_ + _)/valuesandpreds.count println("training mean squared error = " + mse) f...

android - The string property has a value that is too long. It cannot exceed 500 characters -

i tried send long string param endpoint method. 1 of params list<string> , contains large number of values, this: 105969550886996847196,109334384788152421649,109172191656045871108,... , more the method simple: @apimethod(name = "getfullobjects") public myobject getfullobjects(list<string> ids) { //body not relevant } it throws this: error code: 400 reason: badrequest message: java.lang.illegalargumentexception: string property ids has value long. cannot exceed 500 characters. do can't pass more 500 characters in 1 param? awful... :/ is there way exceed limit or pass data other way? note: this endpoint method colaborates android app! note 2: if there realy, limitation of 500 characters endpoint param, wchich can't find in documentation gae, wondering how there list of entities passable... of them sure take more 500 chars after serialization string. @xylian, bypass limitation can either break string multiple parameters ...

javascript - Popover a date string and show it on a calendar -

Image
i have little info box on site use several popover show detailed information selection. example have string name , popover picture of person. now have string date , want show date on calendar on popover. i have little mockup shows want: i searched lot on google find plugin not found anything. does know such jquery/ javascript plugin looking for? thanks! if using bootstrap datepicker, can assign span elements events open datepicker control. like this: html <span class="adate">1/1/2014</span> javascript $('.adate').datepicker(); with that, can bind events need (click, hover, etc)

mysql - Joining tables in SQL including count data -

this question has answer here: using sql join , count 5 answers a question came across: "produce list of department names , number of people in each department?" there 2 tables, person , department. 1 of fields in person table name. there aren't department names given yet department table, same person, name field empty (no names under name field). here code: select department.name department inner join count(name) person; you can join both tables considering there exist relationship between them. assuming person table has department name associated it, can use below query count of person per department select department.name deptname, count(p.name) department d left join person p on d.name = p.department_name group d.name

php - Print Form Data Into Array As 'value" -

learning first php search form, gentle! i'm looking fill 'value' number input on search form. have tried either breaks page or has no effect. i'm trying input $input_price value part of argument. here search form <form method="post" action="http://mysite/searchresults"> <fieldset> <!-- text input selection --> <input type="text" value="<?php the_search_query(); ?>" name="s" id="s" /> <!-- end text input selection --> <input type="text" name="input_price"/> <input type="submit" id="searchsubmit" value="search" /> </fieldset> </form> and here receiving page <?php $args['meta_query'][] = array( 'key' => 'price', 'value' => '($input_price)', 'type' => 'numeric', 'co...

c++ - ReadConsoleOutputCharacter gives ERROR_NOT_ENOUGH_MEMORY when requesting more than 0xCFE1 characters, is there a way around that? -

the code: #include <windows.h> #include <stdio.h> int main() { system("mode 128"); int range = 0xcfe2; char* buf = new char[range+1]; dword dwchars; if (!readconsoleoutputcharacter( getstdhandle(std_output_handle), buf, // buffer store symbols range, // read len chars {0,0}, // read row=8, column=6 &dwchars // how many symbols stored )) { printf("getlasterror: %lu\n", getlasterror()); } system("pause"); return 0; } console screen buffers cannot larger 64k. each character in buffer requires 2 bytes, 1 character code , color attributes. therefore never makes sense try read more 32k chars readconsoleoutputcharacter(). you don't have real problem.

elastic map reduce - Can BigQuery's browser interface be white-labeled? -

like people, we're pretty impressed bigquery. we're willing put being based on proprietary "dremel" in exchange not having configure ton of servers in our lan, on ec2, or anywhere else. the rest api excellent, , we're incorporating our apps, still find ourselves using bq browser interface well. we'd incorporate 'generic sql window' our app, without divulging backend bq or data stored in google @ all, matter. does google provide way use bq browser tool in white-label manner ? note also, extending access existing browser tool problematic. relies on user-accounts existing in one's own domain - can't done, in our case, customer's email address. rest interface solves service-level accounts, doesn't sql window/browser tool. if folks @ google listening (and know are), consider benefits of white-labeling browser tool: think you'd find lot of software companies integrating suites of products and, then, running circles aroun...

replication - MongoDB new replicaset resident memory is larger than the existing sets -

from mongodb tutorial of how resync set , wipe files in /data/db , restart mongod process resync data. looks ok, same number of documents existing 2 sets(primary , 1 secondary). however, when check memory on mms. shows me new resynced set/mongod process has different memory status value other two. existing twos using db.serverstatus.mem shows following: "mem" : { "bits" : 64, "resident" : 239, "virtual" : 66348, "supported" : true, "mapped" : 32865, "mappedwithjournal" : 65730 } however, new resynced set shows like: "mem" : { "bits" : 64, "resident" : 1239, "virtual" : 52447, "supported" : true, "mapped" : 25700, "mappedwithjournal" : 51400 } the resynced resident memory 6-10 times more existing ones. wouder if normal because data comes in during resyncing?? , virtual , mapped value diff...

java - using map interface object to execute a query -

i have following code me before making changes: connection connremote = drivermanager.getconnection("jdbc:mysql://11.11.1.111:3306/test",mainuser,mainpass); string maindbsql = null; maindbsql = "select ip_vch table1 table_dt = 1"; // example have following values ip_vch 11.11.11.111,22.22.22.222,33.33.33.333 map<string,connection> connections = new hashmap<>(); devicestmt = connremote.createstatement(); devicers = devicestmt.executequery(maindbsql); while(devicers.next()){ try{ final string ip_address = devicers.getstring("ip_vch"); system.out.println("value of ip_vch field:"+ip_address); connections.put(ip_address,drivermanager.getconnection("jdbc:mysql://" + ip_address + ":3306/test",remoteuser,remotepass)); system.out.println("connection "+ip_address+" successfull"); } catch(sqlexception ex1){ system.out.println(" inner while loop stack trace below:"); ex1.pr...

ruby on rails - Include associated model for all objects (in index action) -

i trying develop ratings application, user able set specific rating comment. have followed following tutorial in order so. here associations: class rating < activerecord::base belongs_to :comment belongs_to :user end class comment < activerecord::base has_many :ratings belongs_to :user end class user < activerecord::base has_many :ratings has_many :comments end my problem here that, in index action of comments controller, need include rating user has done comment. in tutorial shown how select particular rating doing this: @rating = rating.where(comment_id: @comment.id, user_id: @current_user.id).first unless @rating @rating = rating.create(comment_id: @comment.id, user_id: @current_user.id, score: 0) end however, have several ratings, because in controller have: def index @comments = @page.comments #here each comment should have associated rating current_user, or newly created rating if not exist. end you want find comment's...

android - showAsAction="never" not working on API 8 -

i have following menu: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/action_refresh" android:icon="@drawable/ic_action_refresh" android:title="@string/action_refresh" android:titlecondensed="@string/action_refresh" app:showasaction="ifroom|withtext"/> <item android:id="@+id/action_logout" android:icon="@drawable/ic_action_undo" android:title="@string/signout" android:titlecondensed="@string/signout" app:showasaction="never"/> </menu> the first menu shows fine, second 1 doesn't appear @ (does not appear 3 dots other menus). i'm using appcompat. what wrong? on api >= 11 works fine. that item should accessible via hardware menu...

javascript - Need to move the location of an appended view -

i have list gets sorted using absolute positioning. problem user clicks on li supposed open appended view, unfortunately needing abs pos. found js appended , tried changing from this.$item.append(this.getel()); to $('#mygrid').append(this.getel()); so no longer being opened in absolutely positioned this.$item. breaks functionality of rest of script. is there way allow keep scope moved somewhere else in dom once appended. or there better way approach this? i decided move element after added. not ideal might others dealing absolute positioned elements children of absolute positioned elements $(".og-expander").appendto("#mygrid");

c# - How to remove time format from dropdownlist ASP.NET -

Image
i have dropdownlist populated database date value. in database type data 'date' not time, dropdownlist loaded time format dim da = new sqldataadapter("select distinct tahun_lulus_kuliah alumni", conn) dim ds = new dataset ds.clear() da.fill(ds, "alumni") dropdownlist1.datasource = ds.tables("alumni") dropdownlist1.datavaluefield = ("tahun_lulus_kuliah") dropdownlist1.databind() this screenshoot of dropdownlist, , it's possible change format dropdownlist become "yyyy/mm/dd" without time format? thank hope answer you need set dropdownlist.datatextformatstring "{0:yyyy/mm/dd}" . <asp:dropdownlist id="dropdownlist1" ... datatextformatstring="{0:yyyy/mm/dd}"/>

indexing - Accessing an item in an array by using a variable as index not working as expected (Arduino) -

i'll start off saying have 0 experience tinkering arduino code, use xc , pics normally. i'm trying modify bit of code prints characters on oled. problem i'm running when i'm trying value array using variable index. this array i'm trying data from: static const uint16_t f_04b036ptdescriptors[95][3] progmem = { {2, 7, 0}, // {1, 7, 2}, // ! {3, 7, 3}, // " etc here's how i'm using it: void lcd_lib_draw_small_stringp(uint8_t x, uint8_t y, const char* pstr) { uint16_t offset; uint8_t index; for(char c = pgm_read_byte(pstr); c; c = pgm_read_byte(++pstr)) { index = c - ' '; offset = f_04b036ptdescriptors[index][2]; this gives "weird" values offset such -8467 instead of values in 1-300 range stored in array. i've printed out values of c , index , give values expect don't why doesn't work. if specify index instead f_04b036ptdescriptors[45][2] works f...

c - Why Does Clang See a Type Conflict? -

resolved! maybe i'm losing edge, me don't see why clang giving me following error when compile linked list file (llist). error: conflicting types 'remove' int remove(struct node *llist, int val); note: previous declaration here extern int remove(const char *__filename) __throw; my .h file: struct node{ int val; struct node *left, *right; }; struct node* get(struct node *llist, int i); int remove(struct node *llist, int val); struct node* search(int val, struct node *llist); void deletelist(struct node *llist); void add(struct node *llist, struct node *toadd); my .c file: #include <stdio.h> #include <stdlib.h> #include "llist.h" int remove(struct node *llist, int val){ struct node *cur = llist->right; while(cur != llist){ if(cur->val != val) cur = cur->right; else{ cur->left->right = cur->right; cur->right->left = cur->left; free(cur); return 1; } }...

inheritance - C++ Avoiding redefinition of code that needs to return a polymorphic type -

i have set of classes (subclassa, subclassb, etc) inherit superclass. these classes have myriad of methods identical between subclasses, except return reference *this (a.k.a. subclassx&). return type can't deprecated superclass& either, because subclass-specific functions , members wouldn't accessible. i'm looking short, clean way implement don't have replicate method code in each subclass. the best thing i've been able come (pseudo-code), i'm not sure if work: //methods.cpp subclass& general_method_1() {return *this;} subclass& general_method_2() {return *this;} and then: #define subclass subclassa class subclassa : public superclass { #include "methods.cpp" subclassa& specific_method_1() {return *this;} } #define subclass subclassb class subclassb : public superclass { #include "methods.cpp" subclassb& specific_method_2() {return *this;} } not mention seems kind of hackish , d...

mongodb - How can I sort query result of play morphia with multi field? -

i want query item mongodb using morphia, found order method has 1 parameter, can query data multi order field like: list items = item.q().order("-updatetime").order("-createtime"); you separate fields commas. wiki has examples: https://github.com/mongodb/morphia/wiki/query#sort

How to get Django Form to return the same page -

i have form i've been working on, displaying in template called search_test.html, i've gotten working right. want integrate site, on site it's not going own page, it's going sidebar that's present on pages. know when that, line return render_to_response('corpus/search_test.html', {'form': form}, context_instance=requestcontext(request)) is going give me problems, because don't want redirect search_test.html. what can replace 'render_to_response' with, tell stay on same page, still pass form info? know has got simple, i've looked on online , in docs , can't find similar example. (the view code form below.) thank you. def concord_test(request): if request.method == 'post': # if form has been submitted... form = concordanceform(request.post) # form bound post data if form.is_valid(): # validation rules pass searchterm = form.cleaned_data['se...

python - Decision Tree Of SkLearn: Overfitting or Bug? -

i'm analyzing training error , validation error of decision tree model using tree package of sklearn. #compute rms error def compute_error(x, y, model): yfit = model.predict(x.toarray()) return np.mean(y != yfit) def drawlearningcurve(model,xtrain, ytrain, xtest, ytest): sizes = np.linspace(2, 25000, 50).astype(int) train_error = np.zeros(sizes.shape) crossval_error = np.zeros(sizes.shape) i,size in enumerate(sizes): model = model.fit(xtrain[:size,:].toarray(),ytrain[:size]) #compute validation error crossval_error[i] = compute_error(xtest,ytest,model) #compute training error train_error[i] = compute_error(xtrain[:size,:],ytrain[:size],model) sklearn import tree clf = tree.decisiontreeclassifier() drawlearningcurve(clf, xtr, ytr, xte, yte) the problem (i don't know whether problem) if give decision tree model function drawlearningcurve , receive result of training error 0.0 in each loop. related nature of dataset, or of tree package of sklearn? ...

java - Get Value from XML string -

i trying value of "msg" returned xml response, can see "msg" found twice. how can values of "msg" returned response? here sample of returned value "msg" found in error: <?xml version="1.0" encoding="utf-8" ?> <matches software="languagetool" version="2.6-snapshot" builddate="2014-05-26 09:16"> <language shortname="en-us" name="english (us)" /> <error fromy="0" fromx="0" toy="0" tox="4" ruleid="uppercase_sentence_start" msg="this sentence not start uppercase letter" replacements="this" context="this error" contextoffset="0" offset="0" errorlength="4" category="capitalization" locqualityissuetype="typographical" /> <error fromy="0" fromx="8" toy="0" tox="9" ruleid="en...

Python 2.7 error: Indentation error -

i working example file of tkinter layout. keep getting error boggling mind. the code worked until inserted statements: area.pack() area.insert(end, "hello") then got error: indentation error: unexpected indentation. ok, commented 2 statements out (as shown below), exact same code started with, worked fine- keep getting same error again. have played around few hours , can't grasp - im sure- simple thing triggering this. thoughts? #!/usr/bin/python # -*- coding: utf-8 -*- """ zetcode tkinter tutorial in script, use grid manager create more complicated layout. author: jan bodnar last modified: december 2010 website: www.zetcode.com """ tkinter import tk, text, both, w, n, e, s ttk import frame, button, label, style class example(frame): def __init__(self, parent): frame.__init__(self, parent) self.parent = parent self.initui() def initui(self): self.parent.title("windows...

java - Netty 3.2.6 - less readablebytes -

i using 3.2.6 (i know way old current project constraints not allow me upgrade till next 2 months) 1 of server solution. not have control on client. we have framedecoder in pipeline handle custom message has header , body. 1 of header fields contains length of body. specific message, size of 1076 bytes. while getting message, 1024 bytes (readablebytes()) , hence decoder fails. i checked wireshark (with suitable dissector protcol). client sends 1076 bytes , puts same value on header. so, client not seem misbehave. my receive buffer size set higher value following on server bootstrap no apparent effect. bootstrap.setoption("child.receivebuffersize", 1*1024*1024); this seen consistently specific message , other messages (whose sizes range 100 1000 bytes) handled correctly without issues. please let me know else cause issue , how fix same?

java - How to convert plural nouns into singular nouns -

this question has answer here: can programmatically detect pluralizations of english words, , derive singular form? 6 answers in recent project, faced task convert plural nouns singular forms. know pos tagging algortihms , tools can recognize plural forms of nouns , tag them 'nns', did not know algorithm can cenvert them singular forms. have tried stemming, stemming seems aggressive convert word. gives this: parties -> parti but want is: fish -> fish classes -> class parties -> party goods -> goods cups -> cup this seems difficult problem without huge dictionary every english word in it. there mature algortihm can make it? happy learn if there library can libraries in java. thanks. what want lemmatizer instead of stemmer. there multiple implementations in java. find stanford corenlp easiest use command line. morpha popular. ...

javascript - File upload through ajaxform not working -

i trying upload image through ajax call (& php). using ajaxform plugin but, apparently when submit form "file" input value not being passed php script. here html & js: <form action="upload_file.php" method="post" enctype="multipart/form-data" id="select-image"> <input type="file" name="image" size="30"/> <input type="submit" name="upload" value="upload" /> </form> <script> var options = { success: showresponse // post-submit callback }; // bind form using 'ajaxform' $('#select-image').ajaxform(options); // post-submit callback function showresponse(responsetext, statustext, xhr, $form) { alert('status: ' + statustext + '\n\nresponsetext: \n' + responsetext + '\n\nthe output div should have been updated responsetext....

java - Do I Have To Use Eclipse (Or Similar IDE) -

is necessary use eclipse (or similar high-level ide counterpart) professional programmer? i kept running errors eclipse when setting projects , got hooked on jgrasp simplicity; struggling eclipse detracting coding time. understand eclipse offers many features beyond of lightweight environment jgrasp save effort (lending more effeficent use of time), , allows better organization more complex projects. have not yet tried netbeans. but guess asking if walked in on colleague , using jgrasp, @ him funny? ...or take him less seriously. you can use ide of choice. paid/free/opensource/’developed you’/text-editor whatever suits you. as far professional development concerned not developers choice selected in project plan. if have in decision making, tools of choice. “… @ him funny ?..or take him less seriously.?” depends on one’s personal attitude, no. wonder why kids in schools use eclipse/netbeans (heavily loaded ee dev makes them sluggish compared standered version...

html - Change Combo color on focus -

i want change border color on focus combo box. has class .ui-selectonemenu class , on focus ui-state-focus class gets applied same level. trying write selector .ui-selectonemenu .ui-state-focus , tried .ui-selectonemenu :focus both not working. suggestions. doing primefaces .ui-selectonemenu { width:150px; padding:5px; } .ui-selectonemenu:hover, .ui-selectonemenu:focus { background:#ffd800; border:px solid #f00; }

How To Get File In Assets From Android NDK -

i'm trying access image file in assets folder native side. can search through assets folder , subdirectories locating particular file looking for: aassetdir* assetdir = aassetmanager_opendir(asset_manager, "images"); const char* filename; while ((filename = aassetdir_getnextfilename(assetdir)) != null) { __android_log_print(android_log_debug, "debug", filename); } aassetdir_close(assetdir); i using osg. set image texture shader following code: texture->setimage(osgdb::readimagefile(filenamewithpath)); but file name must include absolute path since not located in same directory. found out cannot absolute path assets directory, being compressed along apk. being can't access absolute path, other way use image? note, want keep files in asset folder appose sd card. you can read image asset aassetmanager_open & aasset_read , since asset lies in apk can't filepath name - compressed there. can save data file , read file later o...

graph - How to get friends id,name,profile picture from facebook? -

i creating application. want access friend list id,name,profile picture. access friend name,picture of following url http://graph.facebook.com/me/taggable_friend?access_token= ....... above url display name,id,profile picture id not valid. want access valid id. so, please 1 me.

AngularJS - Updating data from resolve function (routeProvider) -

i have abstract state , other states inherit it. state.general (abstract) |----------->state.general.list // list collection | |-----------state.general.view // display specific element collection since several views use same data, thinking in retrieving data in resolve function injectable in both views. the issue i'm facing when i'm updating collection in state.general.view. if edit element , go state.general.list state, collection not show data have edited. what way go? though init service in state.general resolve function , inject in controllers. how sound? there other solution more appropriate? /* code */ .state('state.general', { abstract: true, url: '/', templateurl: './partials/abstract.html', resolve: { collection: function(apiservice){ return apiservice.query(); } } } .state('state.general.list', { url: ...

php - If there is no value in the table, then query should return 0 -

this query select (max(booking_id),0) bookingid booking; if there no value in table, query should return 0. how this?? two alternatives: using ifnull : select ifnull(max(booking_id),0)) bookingid booking; using coalesce : select coalesce(max(booking_id),0)) bookingid booking; explanation: ifnull can used in mysql. coalesce can used in rdbmss. coalesce returns first parameter in list not null.

php - how to select from a nested join query -

i have these 2 queries , want join them in order let user filter first query according second one first query : select t1 . * car t1 left outer join rent on t1.carid = rent.carid not exists ( select null rent t2 t1.carid = t2.carid ) or not ( rent.startdate > '$to' or rent.enddate < '$from' ) second query: select carid,model,fuelconsumption,type,picture,color,price,region car model ='$m' or type='$t' or price='$p' or color = '$c' order model,type,price,color desc the 2 queries giving correct answers separately i not sure understand request, if want merge 2 queries, should this: select t1.* car t1 left outer join rent on t1.carid = rent.carid ( not exists ( select null rent t2 t1.carid = t2.carid ) or not ( rent.startdate > '$to' or rent.enddate < '$from' ) ) , ( model ='$m' or type='$t' or price='$p' or color = ...

mysql - PHP to CSV - break one row into multiple rows -

i have php code converts db table csv file - works treat. the db info entered modx (cms) login/user sign system. this added 1 row, fine need of columns under each other in csv. can order , organise csv when need collate things. example order users state. here example: id | memeberno | branch name 1 | branch state 1 | branch country 1 | branch name 2 | branch state 2 | branch country 2 etc.... 15 branches. i need line break after each branch out puts this: id | memeberno | branch name 1 | branch state 1 | branch country 1 (line break here???) branch name 2 | branch state 2 | branch country does make sense? rather have php db dont want mess login system. guess needs line break after columns 21 every 6 columns while adding 20 columns in line up. $entire = $_post['entire']; if ($entire == "yes"){ global $modx; $delete =$_post['database']; $modx->db->delete($delete); } if ($entire == "no"){ global $modx; $delete ...

javascript - Best way to detect browser state changes -

and state mean url changes, preserving browser history.back() , being able update page (through callback guess) when there change. i've tried several methods, , each 1 has pros , cons. example, way backbone.js manages urls router because works via window.location.hash (#) , if change url manually it's catched router allowing perform manual changes in easy way. thing don't backbone urls being in format "#/a/b/c/d/e" (against classic http standard "?a=1&b=2&c=3". means url parameters needs in order , don't have name. of course can fix parsing url , treating router expression single string, it's not big problem. also, think using backbone router it's bit overkill (including whole backbone that), i'd other solutions. the next 1 history.js, supossed provide compatibility new html5 standard? don't behaviour as backbone's one. mean, in html5 browser, # converted ? , if change in url whole page reloaded. also, due lack of ...

java - Issue while comparing a long string with a string of array -

main idea: have url (string) , have array few data's (string). want check whether strings inside of array found in url or not using contains() method. my code structure: first of string words stored inside text file. read file , store values inside jtextarea . , jtextarea use gettext() method , storing values inside array. , now, check strings using contains method. here code: this function (working fine) reads text file , write inside jtextarea . jtextarea jta = new jtextarea(300,300); reader reader = null; try { reader = new filereader(new file("res/pass.txt")); jta.read(reader, "the force strong one"); } catch (exception exp) { exp.printstacktrace(); } { try { reader.close(); } catch (exception exp) {} } wait before that, these words stored inside pass.txt earlier. example: red~ green~ yellow~ black~ this function (working fine) know length of array. string getarr=""; int getcount=0, z=0, lens = jta....

vba - Header when creating report from Excel to Word -

Image
i have code creates header in word excel: wdapp.activewindow.activepane.view.seekview = 9 wdapp.selection.typetext thisworkbook.worksheets("rapport").range("i4").text wdapp.activewindow.activepane.view.seekview = 0 selection.paragraphformat.alignment = wdalignparagraphjustify but error occurs on last row. want create row want header nice centerd. this how using code. ( not want ) and how want look option 1: try change order of instructions and, important, need add special line break character @ , 'justification result'. here example: selection.paragraphformat.alignment = wdalignparagraphjustify selection.typetext "here text excel" + chr(11) option 2: however, justification not give result presented aligning words add spaced between each word. result have need add table go this: dim tmptbl table set tmptbl = selection.tables.add(selection.range, 1, 2) tmptbl.cell(1, 1).range .text = "date: " & ...

indexing - How to index columns with same name but different data in solr -

i have 2 table , both tables have delete_status,but these columns have different data code: (data-config.xml) <entity name="category_masters" query="select category_updated,delete_status,category_id,category_name category_masters category_id='${type_masters.category_id}'"> category_id=${category_masters.category_id}"> <field column="category_id" name="id"/> <field column="category_name" name="category_name" indexed="true" stored="true" /> **<field column="delete_status" name="delete_status" indexed="true" stored="true" />** <field column="category_updated" name="category_updated" indexed="true" stored="true" /> </entity> <entity name="type_masters" pk="type_id" query="...

etl - Unzip a list of files whose path has to be read from a table in Pentaho kettle -

Image
i new pentaho kettle , have requirement want unzip set of files , paths files there in table. wondering how go it. this should main job: first transformation connects database , extract paths, after job called (unzip) extracts files. i'll more clear, next transformation called "table input": use "table input" step connect database. when open have create new connecion , put query in canvas. (make query extract values interested column, not every columns). step "copy rows result" gives values form database next job. the following job "unzip": this job receives values previous transformation , pass tose "unzip file" job entry. things know: 1) in main job double click on unzip job icon, go "advanced" , specify "copy previous result parameters" , "execute every input row". of course in job specification have specify path of job. 2) double click on unzip job icon, go paramete...

c# - Parse Xml with same key values -

i working on windows phone 8 application, i have ui looks : main item --- has desc , list of subitems key value main item b --- has desc , list of subitems key value main item c --- has desc , list of subitems key value now on click of move next page display description , sub items. on click of main item a description of main item a sub item 1 --- on click of display desc sub item 2 --- on click of display desc here how xml looks like: <plist version="1.0"> <dict> <key>category</key> <array> <dict> <key>name</key> <string>a</string> <key>description</key> <string>some data</string> <key>subitems</key> <array> <dict> <key>description</key> ...