Posts

Showing posts from April, 2012

jsoup - Edit browser's text field using java -

is possible edit browser's text field using java? i'm using jsoup gather information websites i'm looking more options.could jsoup this? thank you! i don't see how jsoup here. jsoup way parse html. use write out html has text field in input tag has value attribute on it. when render file in browser, page have value. since haven't given information, i'm not sure if exactly want or completely different want do. this last thing you'd want (not first), set values of text field using java's robot class.

css3 - Hover over one div and it effects another -

so want hover on box , have activate div easing effects. can see below .images{} has 0s infinite scroll, , .box:hover > .images{} when change 0s 10s start slideshow. html : <div class="slideshow"> <div class="images"></div> <div class="box"></div> </div> css: .slideshow { position: relative; overflow: hidden; height: 220px; width: 100%; } .box { width:100px; height:100px; position: absolute; left: 0; top: 0; background-color: #333; } .images { background: url('http://jamesebeling.com/testing/jamesebeling/wp-content/uploads/2013/08/buildings.png'); position: absolute; left: 0; top: 0; height: 100%; width: 300%; -webkit-transition: 1s ease-out; -moz-transition: 1s ease-out; -o-transition: 1s ease-out; transition: 1s ease-out; -webkit-animation: slideshow 0s linear infinite; -moz-animation: slideshow 0s linear infinite; } @-webkit-keyframes slideshow {

php - PDO pgsql - Count the rows affected by pgsql function -

i have following function: create function user_delete( in id int4 ) returns void $body$ begin select * "user" user_id = id update; delete user_role user_id = id; delete user_permission user_id = id; delete permission_cache user_id = id; delete access user_id = id; delete "user" user_id = id; end; $body$ language plpgsql volatile; i use php pdo: $stmt = $pdo->prepare('select * user_delete(?)'); $stmt->execute(array($user['id'])); the result contains now array( array('user_delete' => '') ) and the $stmt->rowcount(); is one. is possible fix this: function return nothing (because void), , rowcount return count of affected rows? solution: php: public function delete($id) { try { $this->__call('user_delete', array($id)); } catch (\pdoexception $e) { if ($e->getcode() === 'ue404') throw new notfoundexcept

c# - .NET Flag Enum get Attributes from values -

greetings stackoverflow, if i've got enum type flag attribute values in enum type own attributes, how can retrieve of appropriate attributes? for example: [flags()] enum myenum { [enumdisplayname("enum value 1")] enumvalue1 = 1, [enumdisplayname("enum value 2")] enumvalue2 = 2, [enumdisplayname("enum value 3")] enumvalue3 = 4, } void foo() { var enumvar = myenum.enumvalue2 | myenum.enumvalue3; // collection of enumdisplayname attribute objects enumvar ... } a quick , dirty way using linq: ienumerable<enumdisplaynameattribute> attributes = enum.getvalues(typeof(myenum)) .cast<myenum>() .where(v => enumvar.hasflag(v)) .select(v => typeof(myenum).getfield(v.tostring())) .select(f => f.getcustomattributes(typeof(enumdisplaynameattribute), false)[0]) .cast<enumdisplaynameattribute>(); or in query syntax: ienumerable<enumd

Waiting for user to enter input in Node.js -

i understand rationale in node.js asynchronous events , learning how write code way. however, stuck following situation: i want write code pauses user input. the program not intended server (though it's intended command line). realize atypical use of node. goal migrate program client-side javascript application, find working in node.js both fascinating , useful debugging. brings me example illustrates problem: it reads in text file , outputs each line unless line ends "?". in case, should pause user clarify meant line. program outputs lines first , waits clarifications @ end. is there way force node.js pause command-line input precisely cases conditional fires (i.e., line ends "?")? var fs = require("fs"); var filename = ""; var = 0; var lines = []; // modeled on http://st-on-it.blogspot.com/2011/05/how-to-read-user-input-with-nodejs.html var query = function(text, callback) { process.stdin.resume(); process.stdout.writ

python - How to restore\unfold multiindex in pandas DataFrame -

i close go insane. have dataframe this: subject sessionindex screenindex index key time s019 1 3 1 shift 0.3442 s019 1 3 2 shift.t 0.1514 s019 1 3 3 h 0.0844 s019 1 3 4 e 0.1127 s019 1 3 5 space 0.1201 s091 3 5 821 h 0.1126 s091 3 5 822 0.1425 s091 3 5 823 n 0.0926 s091 3 5 824 d 0.1525 after using: pivot_table(data,values='time', rows=['subject','sessionindex','screenindex','index'], cols=['key']) i have following dataframe: key shift shift.t d ... subject sessionindex screenindex index s019 1

intuit partner platform - Detailed Description of fields in xsd files in Customer Account Data -

customer account data api provides list of xsd files doesn't provide detailed description of fields in xsd file. of fields not trivial understand @ all. please provide detailed description of each field in xsd file? attribute level details mentioned in cad docs. if have question related specific xsds, please raise support ticket. support link - https://developer.intuit.com/docs/9_other_resources/0030_support/0010_submit_support_incidents we update ans in post. thanks

javascript - Search for matching LI items in separate UL -

i'm trying figure out how find 'li' items matching text in 2 different 'ul's when user clicks button can removed. button appended each 'li' , can text , remove original item. 'li' sortable , user can add more, can't done locations of 'li's. right have (i've removed things make more understandable): javascript: $("li") .prepend("<span class='ui-icon'></span>") $(".ui-icon") .click(function() { var itemtext = $(this).closest("li").text(); $(this).closest("li").fadeout(200, function() { $(this).remove(); }); $("li:contains(itemtext)").remove(); //the part i'm having trouble }) html: <ul id="items"> <li> <h3 id="title">title1</h3> <p id="body">body1</p> </li> <li> &l

python - How do I sum tuples in a list where the first value is the same? -

i have list of stocks , positions tuples. positive buy, negative sell. example: p = [('aapl', 50), ('aapl', -50), ('ry', 100), ('ry', -43)] how can sum positions of stocks, current holdings? result = [('aapl', 0), ('ry', 57)] how this? can read collections.defaultdict . >>> collections import defaultdict >>> testdict = defaultdict(int) >>> p = [('aapl', 50), ('aapl', -50), ('ry', 100), ('ry', -43)] >>> key, val in p: testdict[key] += val >>> testdict.items() [('aapl', 0), ('ry', 57)]

jquery - Large CSS Background not showing on iPad -

this question has answer here: (really) long background image not render on ipad safari 2 answers are there arbitrary restrictions on maximum image pixel size in ie , webkit mobile? 1 answer http://i.stack.imgur.com/5oan0.jpg refer link here diagram i'm doing. this site doing. basically, have menu , 4 content areas, when press buttons on menu jquery animate() function animates scrolltop , scrollleft @ content area. for large background (5k 5k pixels) behind content areas, using css background. however, displays on chrome on pc, firefox on android, not on chrome or safari on ipad. shows blank background. when dont use background css , use img tag in html shows instead. what wrong? researched problem , read apple has documentation states can load jpgs gifs smaller 3 me

java - Excessive checks vs Future extensibility tradeoff -

i can sure 'my code' called returnlist() never going return null. not null pointer check when loop in enhanced loop. but, looking maintenance not appear practice, since in future can modify code base inadvertantly or override call , overridden function may not prudent enough return empty collections. public class extendedforloop { public list<integer> returnlist() { // compute. if list == null ? collections.emptycollections : list; } public static void main(string args[]) { (integer : returnlist()) { system.out.println(i); } } so making question generic, question intended know best practices of draw tradeoff line. understand there not defined rule such cases, seeking best practices. adding excessive checks in self written code adds clutter ensures safe future modifications. reducing checks because 'you know wont return null' makes code clean, live risk of accidental modification. i

mysql - PHP MySQLI::bind_result issue -

i'm having issue trying bind result. php keeps outputting error following warning: mysqli_stmt::bind_result(): number of bind variables doesn't match number of fields in prepared statement in /var/www/public_html/test.php on line 38 now before starts referencing other links, have looked , down stackoverflow , done little searching on google well. examples i've found, including php.net, correct... evidently it's not. here have: function __verify($digit4, $woid) { $query = $this->mysql->prepare("select * pc_wo wo left join pc_owner owner on owner.pcid=wo.pcid wo.woid=? , substring(owner.pcphone, -4)=?"); $query->bind_param("is",$woid,$digit4); if ( !$query->execute() ) return false; $query->bind_result($resp); $query->fetch(); var_dump($resp); return true; } edit suppose can't use bind_result wildcard select (*)... use in accordance mysqli_stmt fetch entire array? thank you! t

progress bar - Progressbar with three sections in Android -

Image
i have figured out can set secondary progress progress bar in android defining custom style following xml code: res/drawable/custom_profressbar_horizontal.xml: <?xml version="1.0" encoding="utf-8"?>![enter image description here][1] <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background"> <shape> <corners android:radius="15dip" /> <gradient android:startcolor="#ffffffff" android:centercolor="#ffdddddd" android:centery="0.50" android:endcolor="#ffffffff" android:angle="270" /> </shape> </item> <item android:id="@android:id/secondaryprogress"> <clip> <shape>

Added new Rails controller using "generate controller" but can't load page -

i have rails app has consisted of backend code far (a little custom workflow engine, redis, foreman, etc). today tried add first controller application, can't new controller load. i used: rails generate controller collecteddata new --no-test-framework and got back: create app/controllers/collected_data_controller.rb route "collected_data/new" invoke erb create app/views/collected_data create app/views/collected_data/new.html.erb invoke helper create app/helpers/collected_data_helper.rb invoke assets invoke coffee create app/assets/javascripts/collected_data.js.coffee invoke scss create app/assets/stylesheets/collected_data.css.scss and ran rake routes , got this: collected_data_new /collected_data/new(.:format) collected_data#new but whenever load http://localhost:3000/collected_data/new in browser, get: not found: /collected_data/new here content of routes.rb file: crows::application.routes

javascript - Checkboxes with anchors -

i have ton of check-box's linked anchors. when check-box clicked goes anchor in same page. there better way code this? have 50 check-box's function packed if statements.this working code 2 of them: <input type="checkbox" id="1" value="1" onclick="return send();"/> <input type="checkbox" id="2" value="2" onclick="return send();"/> <script> function send(){ if(document.getelementbyid('1').checked){ window.location='#buy'; return false; } if(document.getelementbyid('2').checked){ window.location='#order'; return false; } //and function goes on , on , on... return true; } </script> and in page want go has <a name="buy"></a> <a name="order"></a> if added hash value of input so: <input type="checkbox" id=&qu

html - Google Maps API Example not working, giving me blank screen -

the google maps api tutorial ( https://developers.google.com/maps/tutorials/fundamentals/adding-a-google-map ) giving me blank screen. have been working on 3 hours , cannot figure out. i copied/pasted code exactly, saved .html file. <!doctype html> <html> <head> <style> #map_canvas{ height: 500px; width: 400px; } </style> <script src="http://maps.googleapis.com/maps/api/js?sensor=false"></script> <script> function initialize() { var map_canvas = document.getelementbyid('map_canvas'); var map_options = { center: new google.maps.latlng(44.5403, -78.5463), zoom: 8, maptypeid: google.maps.maptypeid.roadmap } var map = new google.maps.map(map_canvas, map_options) } google.maps.event.adddomlistener(window, ‘load’, initialize); </script> </head> <body> <div id=&

dns - How to limit request per virtual host on Nginx? -

i have nginx server serving web application customers have domains (cnames) access websites. does nginx have way limit number of accesses 1 of domains period of time? example: restriction need: 2000 requests / domain / minute so, in 1 specific period of time... www.websitea.com.br --- 1456 requests / minute ok! www.websiteb.com.br --- 1822 requests / minute ok! www.websitec.com.br --- 2001 requests / minute locked temporarily does know how make such restriction? you can refer httplimitreqmodule in nginx. limit_req , limit_req_zone may helps.

asp.net - How to Disable non alphabetic characters in Textbox? -

no, don't mean asp validation controls, i'm looking way "disable" non alphabetic characters, when user presses key not letter(except space), not written in textbox. i've used ajaxcontroltoolkit's filteredtextboxextender : http://www.asp.net/ajaxlibrary/ajaxcontroltoolkitsamplesite/filteredtextbox/filteredtextbox.aspx

WPF: DataGrid with a tree-column in an MVVM Windows application -

Image
here rephrased version of issue: here screenshot of result i'm looking (from older, non c#/wpf version of application): looks other grid-tree-views , objectlistview provides. unfortunately have rules have follow: wpf mvvm just datagrid , components must used (no treeview, listview, etc.) the items hold in observablecollection<t> t.property1 , t.property2 etc hold data columns of datagrid . the lower levels of item hold in t.propertychilds of type observablecollection<t> , not known/filled beforehand. must loaded on first exand of item. here screenshot of similar data , i've got far in wpf/c#: it looks standard datagrid. columns can hold, property of t columns showing, columns visible, etc defined own framework around datagrid adds columns public observablecollection<datagridcolumn> columns collection of system.windows.controls.datagrid . my task new class derived datagridcolumn can display , load hierarchical data structure of view

Asp.net ImageResizer with multiple SQLServer plugins -

how can using sqlreader plugins different connection string because want store file in multiple different tables. alot! install multiple instances of sqlreader plugin, each different set of queries , different route prefix.

Ruby and Lambda calculus -

i'm trying understand lambda calculus procs , ruby. here code: puts -> x { -> y {x.call(y) } } # => #<proc:0x2a3beb0@c:/first-ruby.rb:1 (lambda)> puts -> x { x + 2}.call(1) # => 3 what -> signify in above example? call method passing value caller, in first example, value y passed y , in second example, 1 passed x ? in second example, why 1 evaluated x ? what -> signify in above example? -> part of literal syntax lambdas, like, say, ' part of literal syntax strings. is .call method passing value caller, the call method method, which, well, calls (or executes) lambda. arguments call method bound parameters of lambda. so in first example value y passed y , in second example 1 passed x . no, in first example, y passed outer lambda , bound x parameter. in second example, 1 passed lambda , bound x parameter. in second example why how 1 evaluated x ? 1 not evalute x . 1 immediate value,

What facility does java provide for getting input from the command line for the executeUpdate() method in SQL -

scanner input = new scanner(system.in); system.out.println("enter staff name: "); string staffname = input.nextline(); system.out.println("enter department name: "); string department =input.nextline(); stmt.executeupdate("insert staff (staffname,department) " + "values " + staffname,department); this gives me error , asks me check sql manual.is possible? it possible, since happened. strings must enclosed in quotes in sql: insert foo (bar, baz) values ('hello', 'world'); learn use prepared statements instead of string concatenations, make queries work, , not subject sql injection attacks: preparedstatement stmt = connection.preparestatement("insert staff (staffname, department) values (?, ?)"); stmt.setstring(1, staffname); stmt.setstring(2, department); stmt.executeupdate(); using above, don't need mess quotes nor escape them inside strings.

c# - Returning viewmodel from view gives an ampty object in the controller -

i'm working on small project. intention maintain presences of couple of users on specific dates. dates first chosen user. therefor use view model. provide possible data check box in table show user. in view walk every day in given view modeland let view generate tag , editor object (html.editorfor ()). surrounded form creation (@ html.beginform ()). rendering view not problem. the problem when try return view model. viewmodel object receive object null - objects in themselves. has been created default constructor. controller: [httpget] public actionresult opldagenlt() { var lt = _gebruikerrepository.geeftraject(_gebruikerrepository.trajectid); list<datummodel> data = new list<datummodel>(); foreach (opleidingdag opldag in lt.geefopleidingdagenkleinerdanofgelijkaanvandaag()) data.add(new datummodel(opldag)); list<toekomstmodel> toekomst = new list<toekomstmodel>(); foreach (opleidingd

html - Reduce clickable area for link -

i have 1 word on page , each separate letter link. i'd reduce size of clickable area there no space surrounding letters. right it's fine on left , right of each letter, there space above , below each letter. included border around links illustrative purposes (see fiddle below). any ideas on how? html: <body> <div> <h1><a href=#>h</a></h1> <h1><a href=#>e</a></h1> <h1><a href=#>l</a></h1> <h1><a href=#>l</a></h1> <h1><a href=#>o</a></h1> </div> </body> css: body { font-family: 'sigmar one', cursive; font-size: 100px; color: white; text-shadow: 4px 4px 4px #000; background-color:blue; width: 100%; height: 100%; margin: 0; } { border: 1px solid black; } div { position:absolute; hei

php - Allowing views with specific creditials -

i looking methods of blocking users don't have rights viewing particular pages. tried putting function inside of backend controller inside codeigniter core folder , have backend controllers extend it. wanted put function inside of keep dry principal of putting function inside of every controller. i'm looking maybe different way of writting function or different ideas of should function. public function view_allowed($user_data) { if ($user_data->role_id != 4) { return false; } return true; } with call function inside contruct of other controllers , , if statement if returns false direct other page don't have right creditials view page. any questions, comments, concerns? edit 2 : i had make edit because i'm pondering do. purpose of want run function on each controllers construct regular user should not able view , admin can. if following how know redirect different page if user not able view page. <?php if (!defined('ba

filenames - PHP - Get file extension (image) without knowing it -

how can extension of image file without knowing is? have tried using glob, below, returns error: "array notice: undefined offset: 0" $path=baseurl."content/images/profile_images/".$imagename; $results= glob($path.'.*'); $filename = $results[0]; echo $filename; your glob bad , it's returning empty array, hence error. it's not regular expression, it's shell expansion , * wildcard. try match filename begins . . ie. .htaccess . if want match file use: glob($path.'*') if want match file period in it: glob($path.'*.*')

dataset - How much data do I need for recommender system? -

i have develop personality/job suitability online test hr department. basically, users answer questions, on scale of 0-10 example, , after 50 questions, want translate rating in 5 different personality/ job suitability characteristics. i don't have real data start with, first, worth use recommendation engine mymedialite (github). how many samples need train decent performance? i built training course recommender, doing , hand-weighted sum each question increased weight of several courses related question. expert system, built feed-forward neural network, tuned weights based on knowledge of questions , courses' content. i time around use recommender system, i'm wondering how many times have take 50 question test, , assign results manually. 100 examples do? possible. 1000 long. how can know ahead of time? though useless, want not possible give definite number. should focus on learning curve when adding new samples. you can process samples hand , en

objective c - download multiple images on iOS app -

i use code download images ios app web. https://github.com/ashfurrow/afimagedownloader [afimagedownloader imagedownloaderwithurlstring:@"http://static.ashfurrow.com.s3.amazonaws.com/github/worked.jpg" autostart:yes completion:^(uiimage *decompressedimage) { self.imageview.image = decompressedimage; }]; as can see code downloads 1 image... how can download more images @ once? let's images names that: xy.png x number 1 999, , y number 1 4 example: 1651.png, 1652.png, 1653.png, 1654.png - can see, last digit of image names "y", 1 4... rule, image names ends 1, 2, 3, 4. but, 165 "x", next set of images 1661.png, 1662.png, 1663.png, 1664.png i hope got point.. so, need download images names 11.png 9994.png any ideas? how download using above code , save them original name. thanks in advance ever heard of nested loop? static const nsuinteger xlowerbound = 1; static const nsuinteger xupperbound = 999; static const nsuinteger

java - JMockIt security exception signer information does not match -

when running jmockit , trying mock instance in testng loaded signed jar error along lines of (in case of jetty server): failed configuration: @beforeclass startserver java.lang.securityexception: class "javax.servlet.filterregistration"'s signer information not match signer information of other classes in same package @ java.lang.classloader.checkcerts(classloader.java:943) @ java.lang.classloader.predefineclass(classloader.java:657) @ java.lang.classloader.defineclass(classloader.java:785) @ java.security.secureclassloader.defineclass(secureclassloader.java:142) @ java.net.urlclassloader.defineclass(urlclassloader.java:449) @ java.net.urlclassloader.access$100(urlclassloader.java:71) @ java.net.urlclassloader$1.run(urlclassloader.java:361) @ java.net.urlclassloader$1.run(urlclassloader.java:355) ... the dependency order in pom correct, , without mocks tests run fine. tips java securityexception: signer information not match no

Rails: Linking directly to a JavaScript file in production -

i have javascript file in rails project i'd able link directly. when running in development mode, can link "/assets/myfile.js" , works fine. however, in production mode, doesn't appear case. i don't know enough asset pipeline, etc. figure out what's going on here. how can link directly file once i've deployed project production? you should learn asset pipeline, if want working, put in /public, e.g. /public/javascripts, , you'll able link expected.

javascript - Save results of Angular form in JSON locally -

i want make form (in angularjs) when submitted saved locally , can accessed later. code need both read , write json file, or can learn how this? i grevory's local storage service: https://github.com/grevory/angular-local-storage you can take @ html5 web sql: http://www.tutorialspoint.com/html5/html5_web_sql.htm not sure of support, though. as string handling portion, angular has this: http://docs.angularjs.org/api/angular.tojson , http://docs.angularjs.org/api/angular.fromjson

box api - Access to enterprise account via webdav -

if have enterprise box account access at: https://mycompany.app.box.com (with sso authentication) how can access webdav interface account? i have tried variations of following (times out or authentication fails). https://dav.box.com/dav https://dav.mycompany.app.box.com/dav davs://mycompany.app.box.com/dav webdav uses normal box password if have regular (non enterprise) account. if have sso setup, you'll need setup "external password." so, click on gear icon in upper right, , select "account settings." scroll down towards bottom, , click on "create external password."

php - search database for relevant fields -

i need way like mysqli_query("select * table id.contains('some string')") what need retrieve fields relevant. i think might have thought solution this, if else curious, take string , create search array elements.

PHP MYSQL Detect if new row is added -

any idea how can identify if there new client added on database. i thinking identifying thru date_added field. id client_name date_added --------------------------------- 1 abc 2013-01-02 2 xyz 2013-01-03 3 efg 2013-01-02 4 hij 2013-01-05 as can see new client added hij on 2013-01-05. i looking kind of result: client list total no: 4 new client total no: 1 client name: hij it's hard tell based on comment ...my reference date 1 month interval... might looking this select id, client_name, new_count, total_count ( select id, client_name clients date_added between curdate() - interval 1 month , curdate() ) c cross join ( select ( select count(*) new_count clients date_added between curdate() - interval 1 month , curdate() ) new_count, ( select count(*) total_count clients ) total_count ) t obviously can change curdate() other re

java - Join many tables to one [Many-to-many and with extra columns] using Hibernate -

could me please, using hibernate , annotations want join 4 tables (prof, salle , groupe, cours) 1 (creneau). 4 of them have many-to-many relationship 5th table. i googled it, know many-to-many relationship (i found case of 2 tables ) create link table join them, contains keys (in case there columns also) this best link found join tutorial . solution found more appropriate problem repeat tutorial 4 tables (prof-creneau)/(salle/creneau) .... , same link table. is best way achieve (for me seems repetitive) ? classic @manytomany relationship refers between 2 entities. if want many-to-many table relationship, column need join table. here useful example: http://www.mkyong.com/hibernate/hibernate-many-to-many-example-join-table-extra-column-annotation/

i18n by python don't work in web -

both "cn" , "en" works in terminal "en" works in web, "cn" don't work; how make "cn" work in web ? btw: msgfmt, fedora18, httpd; test.py: #!/usr/bin/env python # -*- coding: utf-8 -*- import gettext gettext.install('lang', './locale', unicode=true) gettext.translation('lang', './locale', languages=['cn']).install(true) print "content-type: text/plain\n" print _("hello world!") print "中文" terminal output "cn": [root@localhost cgi-bin]# ./test.py content-type: text/plain 中文 terminal output "en": [root@localhost cgi-bin]# ./test.py content-type: text/plain works. 中文 webpage "en": it works. 中文 webpage "cn": show nothing "curl locahost/cgi-bin/test.py" "cn": return nothing locale/cn/lc_messages/lang.po: # descriptive title. # copyright (c) year organization # first auth

java - Designing The ListView in DrawerLayout -

Image
i have drawerlayout , working well. i'd have design 1 highlighted orange. selected item on listview have background effect. approaches attain one. background image or transparent image covers item ? thanks i found tutorial . purpose of post find resolve on this. not sure how on xml. <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="start" > <framelayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" > </framelayout> <listview android:id="@+id/left_drawer" android:layout_width="240dp&q

How to use cookies for GWT Interface changes -

how store gwt user interface settings in persistent cookies, user can them on next visit? have user interface designed using gwt. user prefer see few columns interface every time visit application.so needs done you can use local storage that. http://www.gwtproject.org/doc/latest/devguidehtml5storage.html html5 storage technology caching data on client-side. there 2 types: localstorage (shared browser tabs, stored on disk, 5 mb per webapp) , sessionstorage (accessible within 1 tab, stored in memory). in case, should use localstorage allow user close browser , reload settings disk. gwt has built-in api using localstorage. see details @ http://www.gwtproject.org/javadoc/latest/com/google/gwt/storage/client/storage.html also let me propose sample code (you'll need provide details more concrete): import com.google.gwt.storage.client.storage; ... storage storage = storage.getlocalstorageifsupported(); if (storage != null) {

asp.net mvc 4 - How to validation kendo ui dropdown list -

i having problem validating kendo dropdownlist if user select "please select" option. please let me how can trigger validation here code have far: @html.labelfor(model => model.consumergenderid) @(html.kendo().dropdownlist() .name("gender") .htmlattributes(new { @style = "align:center; font-size:12px; width:208px; length:35px" }) .optionlabel("please select") .value("-1") .datatextfield("optionname") .datavaluefield("optionid") .datasource(source => { source.read(read => { read.action("getgenderstatus", &q

How to access store value in sencha touch -

i trying store value this: itemtap : function(list, index, target, record) { ext.getstore("namestore").load(); console.dir("test->"+record.get('id')); console.dir("test->"+record.get('address')); } here cannot id, when itemtap. , try this: var store= ext.getstore('namestore'); console.dir("test->"+store.get('id')); console.dir("test->"+store.get('address')); but not data. why this? and what difference between this, 2 type of store value access? i add onclick inside div, itemtap working fine in iphone not working? why this? there alternative present in sencha working both android iphone , others.how value in itemptap, displayed in div display store. edited: itemtap :function(list, index, target, record) { console.log("clicked---"+record.get('cat_id')); } actually, not getting above code. i try this, , getting value

C# Winforms form losing focus when focusing on child control ... sometimes -

i developing windows mobile 6.5 app , have issues form losing focus when focusing on child control of usercontrol added form... sometimes. in app navigate between screens adding , removing user controls main form controls collection. iview nextview = (iview)activator.createinstance(map.view); this.controls.remove((usercontrol)this.currentview); this.currentview = nextview; this.controls.add((usercontrol)this.currentview); my basic flow navigation between screens thus: first add of usercontrol a initialize usercontrol a add usercontrol form.controls focus on grid on a navigate usercontrol b initialize usercontrol b remove usercontrol form.controls add usercontrol b form.controls navigate usercontrol a initialize usercontrol a remove usercontrol b form.controls add usercontrol form.controls focus on grid on a all works fine , on first add of usercontrol form focused , child control has focus well. but when navigate usercontrol

encoding - Combine different headers in PHP for non-English text -

i using php display foreign languages text. echo '<li> no english </li>'; to display non english language written in php use: header('content-type: text/html; charset=windows-1255'); but when getting posted variables form , try echo them, display trash. noticed setting next header, fix : header('content-type: text/html; charset=utf-8'); this header display correctly, fails display first example. how can combine different header settings in same file.? you cannot mix encodings in single document. entire document must in 1 coherent encoding 1 header set denotes encoding. if receive differently encoded strings several sources, convert them 1 uniform encoding (preferably utf-8) using mb_convert_encoding or iconv . if '<li> no english </li>' hardcoded text saved in source code file, save file in different encoding in text editor. see utf-8 way through , handling unicode front in web app .

apache2 - AllowOverride None, and .htaccess works -

well, not problem yet, don't understand why apache reading .htaccess files... do: grep -r "allowoverride" /etc and have: /etc/apache2/apache2.conf:# additional configuration directives. see allowoverride /etc/apache2/sites-available/default: allowoverride none /etc/apache2/sites-available/default: allowoverride none /etc/apache2/sites-available/default: # allowoverride none /etc/apache2/sites-available/default:# allowoverride none /etc/apache2/sites-available/default-ssl: allowoverride none /etc/apache2/sites-available/default-ssl: allowoverride none /etc/apache2/sites-available/default-ssl: allowoverride none /etc/apache2/sites-available/default-ssl: allowoverride none /etc/apache2/conf.d/security:# allowoverride none /etc/apache2/conf.d/localized-error-pages:# allowoverride none /etc/apache2/mods-available/userdir.conf: allowoverride fileinfo authconfig limit indexes /etc/apache2/mods

java - How to change/add JVM custom/system properties & make them reflect without application server restart -

i've dynamic web application reads jvm properties continuously. when made change jcm custom/system properties through application server console (ex. websphere) not getting reflected immediately. requires restart. there script or crooked way update jvm system properties without restarting application server

ios - IIViewDeck & Double Height Status Bar -

hey noticed bug in iiviewdeck ios ( https://github.com/inferis/viewdeck ) if launch app view deck or example app while in-call status bar showing, center view doesn't resize once status bar returns normal height. else logged issue on github ( https://github.com/inferis/viewdeck/issues/402 ) i've tried listening app delegate callback application:didchangestatusbarframe: , calling self.centerview.frame = self.centerviewbounds; didn't work. when logged code, saw apparently resizes already original frame: {{0, 0}, {320, 548}} new frame: {{0, 0}, {320, 548}} after set: {{0, 0}, {320, 548}} ********************* original frame: {{0, 0}, {320, 528}} new frame: {{0, 0}, {320, 528}} after set: {{0, 0}, {320, 528}} ********************* i've tried set autoresize property various view, no avail. i'd fix bug, appreciated. library lot people use, , it'd nice maintain it. i'll sure pass solution onto repo owner i faced problem. decision was:

internet explorer - IE needs to run as Admin just to save file or create folder from Silverlight App -

i have silverligth 5 application cater ms word add, edit , save database in server. editing word file requires downloading server , save local drive in %userprofile%\appdata\thefolder (thefolder programmatically created once application run). problem that, in trusted configured app (in browser; added site in ie trusted zone, signed xap, added registry key , elevate app) user (client side) needs open ie "run administrator" enable full access folder , able save copy of ms word. purpose of local copy that, once upload fails 3 times, can still recover his/her work , later try edit , upload again. how can avoid open ie "run admin". please help

mysql - Is there a way to get joined tables as array? -

i have user table, education table , work experience table: users id first_name last_name education user_id name start_year end_year workexperience user_id name start_year end_year now want nice overview of education , work experience of person. when using regular joins, lot of rows, since number of educations , work experiences multiply number of rows. the best case if id, first_name , last_name once, array inside educations , work experiences. could point me in right direction please? try group by like select users.*, workexperience.*, education.start_year edu_start_year,education.end_year edu_end_year users join education on education.user_id = users.id join workexperience on workexperience.user_id = users.id group id,first_name,last_name you can group id also.

javascript - Reset all my markerLayer in Mapbox -

i use mapbox map show company geoloc on, code is var markerlayer = l.mapbox.markerlayer({ type: 'feature', geometry: { type: 'point', coordinates: [value.geolng, value.geolat] }, properties: { title: 'a single marker', description: 'just 1 of me', } }).addto( $.mapbox.mapobj ); my problem when new json call , return new locations did don't know how can reset/remove old markerlayer , add new map. i have create map obj. width jquery $.mapbox.mapobj hobe posible reset/remove markerlayers object , soe can add new markerlayers on it. you can reset marker layers with markerlayer.clearlayers()

ssl - Kerberos authentication on a self-hosted WCF Data Service -

we have wcf data service self-hosted under windows service (not using iis) working secure using ssl , windows authentication. after time playing around netsh , server certificates, have service secured ssl , have enabled windows authentication on webhttpbinding in our app.config - seeing strange behaviour when attempting authenticate users - can log in fine, others have credentials rejected , prompted http 400 errors. after testing , digging around appear might running this problem , authentication header used kerberos may greater maximum permitted header length (which believe 16k) users - , although there documented workaround iis, there not appear equivalent setting can use self-hosted service, or in our app.config - unless i'm missing something? tried setting maxreceivedmessagesize , maxbuffersize fields maximum values see if make difference, apparently not. binding config: <webhttpbinding> <binding name="dataservicesbinding" max

Using GWT with Morphia/MongoDB -

i wondering if has attempted , been successful @ using morphia jar interacting mongodb database inside of gwt? i've been using below object base pojo's, whenever attempt save down object using updateoperations<derivedpersistententity> or datastore.save() concurrentmodificationexception . package com.greycells.dateone.shared; import com.google.code.morphia.annotations.id; import com.google.code.morphia.annotations.version; public class persistententity { @id private string id; @version private long version = null; public persistententity() { } public string getid() { return id; } public long getversion() { return version; } public void setversion(long version) { this.version = version; } } i've added gwt extension jar have download separately morphia , referenced in gwt.xml , seems of no help. additionally i've tried changing id field of persistententity objectid type can

Magento attribute url not found error 404 /l/ page filter -

everyone have problem attribute url filter page can not found. show error 404 , there /l/ on url. according this page. http://www.siameyewear.com/brands.html @ backend. have enable anchor yes. , check use available attributes. show attribute product listing sort bra bra bra. at page. http://www.siameyewear.com/brands.html on left hand side. see product listing sort by. create magento attribute. problem is. when i'm click on link. ever link under word "shop by" it's show error 404 page can't found. for example. when i'm click on rayban link under word "shop by" it's show error 404 , url http://www.siameyewear.com/brands/l/rayban.html don't know /l/ came from. have try remove /l/ myself. it's still not show correct page. anyone know how fix problem. kindly please help. thank much problem solved. remove stupid seo enterpr...

ms access - Running a database in run time version brings up an error -

i've finished creating database , works on computer. i'm using access 2013 , in vba code have written error handler each function/sub use in databases. users designed have access run-time 2007 , every time run on machine un-trapped error "execution of application has stopped due run-time error". code command button. option compare database private sub command0_click() dim errorstep string docmd.setwarnings false '------------------------------------------------------------------------------------- ' procedure : command0_click ' author : chris sparkes ' date : 13/08/2013 '------------------------------------------------------------------------------------- errorstep = "1 - cleansing records" docmd.openquery "qry1_3" docmd.openquery "qry4-7" docmd.openquery "qry9" call exceloutputreport exit_command0_click: on error goto 0 exit sub command0_click_error: msgbox "error

jquery - FullCalendar AllDaySlot replacement -

i'm using fc in webapp plan employeeshifts. users add slot , assign 1 or several employees slot (or themself). works charm. now i've been asked new feature - "counter" placed in top of each day (basicweek,agendaweek,agendaday should have this). this counter should show how many hours have been planned date , other similar information. my problem how either add new tr in thead - 1 each day - or use alldayslot visually be. add menu top of each day in agendaweek andbasicweek using code below, i've tried add placeholder in loop, no luck. looking forward intelligent input on :d if (view.name === 'agendaweek' || view.name === 'basicweek') { // add "dropdowns" day headers var $headers = $('.fc-widget-header.fc-sun, .fc-widget-header.fc-mon, .fc-widget-header.fc-tue, .fc-widget-header.fc-wed, .fc-widget-header.fc-thu, .fc-widget-header.fc-fri, .fc-widget-header.fc-sat, .fc-day-header.fc-sun, .fc-d