Posts

Showing posts from May, 2012

pixelsense - ScatterViewItem custom size -

pixelsense - ScatterViewItem custom size - i develop surface app using mvvm pattern. have different views , want place them 1 scatterview. want scatterviewitem size correspond size of views? code example: <datatemplate datatype="{x:type vm:pointlistviewmodel}"> <grid> <v:pointlistview> </v:pointlistview> </grid> </datatemplate> <datatemplate datatype="{x:type vm:bluetoothdevicesviewmodel}"> <grid> <v:bluetoothdevicesview></v:bluetoothdevicesview> </grid> </datatemplate> .... <s:scatterview grid.rowspan="3" datacontext="{binding path=workspaces}" itemssource="{binding}" itemtemplate="{binding}" clipto...

ruby - Cannot create firefox browser with watir-webdriver -

ruby - Cannot create firefox browser with watir-webdriver - i have firefox 20 works version of watir-webdriver. utilize next code can open browser or headless phantomjs browser. chrome , phantom work, firefox throws exception. why? how prepare ? require 'rubygems' require 'watir-webdriver' require 'phantomjs' def get_browser(browser_name) browser = nil if browser_name != nil puts "\n#{browser_name} created\n" browser = watir::browser.new browser_name.to_sym else puts "creating phantom browser !" browser = watir::browser.new :phantomjs puts "\nphantom created\n" end homecoming browser end browser_name = argv[0] browser = get_browser(browser_name) puts "\n\n" browser.close exception- c:/code/ruby/lib/ruby/gems/1.8/gems/json_pure-1.4.3/lib/json/pure/generator.rb:393:in `to_json': undefined method `ascii_only?' {}:hash (nomethoderror) c:/code/ruby/lib/r...

jsp tags - Selective Mandatory fields in a jsp -

jsp tags - Selective Mandatory fields in a jsp - i have query jsp. scenario: suppose have 2 fields field one: connection type (selective dropdown) dropdown options: 1. gsm 2. cdma 3. others field two: comments (free text) question: how create mandatory user come in 'comments' free text box if 'connection type' selected 'others' initially disable text area , when onchanging dropdown, selected value. if it's not empty, enable text box. in html <select id="connectiontype" name="connectiontype" onchange="changetext()"> <option value="">select value</option> <option value="gsm">gsm</option> <option value="cdma">cdma</option> </select> <input type="text" id="comments" disabled="true" /> and in javascript, function changetext() { if(document.getelementbyid("connectiontype...

How can I use jquery to increment a table cell by 1 each time the button is clicked? -

How can I use jquery to increment a table cell by 1 each time the button is clicked? - here html: <table class="mytable" summary="table ages"> <tr> <th>name</th> <th>age</th> </tr> <tr> <td>joe</td> <td id="joesage">35</td> </tr> <tr> <td>becky</td> <td id="beckysage">40</td> </tr> <tr> <td>joey</td> <td id="joeysage">50</td> </tr> </table> <button onclick="add">add</button> i need cells joesage, beckysage , joeysage each increment 1 each time add together button clicked. can assist me please? give thanks you. please show have tried or atleast have level of understanding doing. don't deliberately pos...

vbscript - Attendance register using asp classic -

vbscript - Attendance register using asp classic - i looking vb script in asp classic below: i have 1 table named "attendance" in mssql2005 database has records. table includes 2 columns ( sname, sdate ). my question how can show records attendance register, meaning dates should in horizontal column header on top (based on month in selected year if month has 31 date 31 columns). in next row: below date column, if header date match date field sdate should show "p" or should show "a" . it's calendar without daynames. unfortunately thorough search didn't find me built-in solutions yet here show how show attendance register passing single month , year value using vbscript , asp classic this article may helpfull other people looking same solution. i have 2 tables below written staff: contain info staff user in column (staff_id, aname,...) staff_attendance: attendance of staff user save in table date wise unique row. table ...

php - Basic search function that searches a sequel database -

php - Basic search function that searches a sequel database - i'm beginner programmer wants create basic search bar searches sequel database. far created search bar in html document: (i'm using materialize) <nav> <div class="nav-wrapper"> <form method="post"> <div class="input-field"> <div class="valign-wrapper"> <div class="valign" style="width:100%;"> <input type="text" name="search" placeholder="search" required> <label for="search"><i class="mdi-action-search"></i></label> <input type="submit" value="search"/> </div> </div> </div> </form> </div> </nav> i want have search bar search database , display info instantly below on same page....

html - How to center content in footer -

html - How to center content in footer - i building website using wordpress theme. have 2 elements (one floated left, sec floated right) in footer. need create centered (the sec 1 below first one) when resize browser window. tried giving <p> , <div> tag class , style float:none; - hovewer cann check didn't work on webpage. attach image of how want be.. webpage <div class="site-info"> <div style="margin:0 auto; width: 75%;"> <p style="float:left;">&copy; copyright <?= date('y'); ?> hotel Švýcarský dům</p> <div style="float:right;">naleznete nás na sociálních sítích: <a style="display: block; float:right; margin:-4px 0 0 5px;" href=""><img src="/wp-content/themes/adamos/images/gplus.png" /></a> <a style="display: block; float:right; margin:-4px 5px 0 5px;" href=""><img s...

angularjs - ngRepeat doesn't $compile directives correctly -

angularjs - ngRepeat doesn't $compile directives correctly - i have array of items [expression, expression,....] , add/remove expression's array, ngrepeat doesn't $compile directive correctly. what reason it? one of solutions is, have separate array of expressions, , modify one, , every time changes reset "expressions" [] , set new array, when doing there blinking of ui elements (first digest [] , timeout(expressions = new array)). class="snippet-code-js lang-js prettyprint-override"> // main scope.list = [expressions.new(), expressions.new()]; //constructor expressions function expressions(){}; expression.prototype = { id: 'generated', list: [ expression.new(), expression.new(),... ] }; //constructor look function expression(){}; expression.prototype = { id: 'generated', val: '' }; class="snippet-code-html lang-html prettyprint-override"> <!-- mai...

ios - Extending UINavigationBar clickable area -

ios - Extending UINavigationBar clickable area - i created custom uinavigationbar adds custom view navigation bar has functionality isn't provided origin uinavigationbar as part of ui i'm adding uibutton twice height of original uinavigationbar this part of .swift file definition class customnavigationbar: uinavigationbar { // function called each init of class func setup(){ //create button, twice height of original navigation bar allow btn = uibutton.buttonwithtype(uibuttontype.system) uibutton b.settitle("click me", forstate: uicontrolstate.normal) btn.frame = cgrect(0,0,self.frame.width,self.frame.height*2) addsubview(btn) } } now, problem higher half part of button clickable, , bottom part isn't (becuase not within frame of original navigation bar my question - possible extend interactive area of navigation bar? ios swift uinavigationbar

php - Assign new user a plan upon registration in Laravel 5 -

php - Assign new user a plan upon registration in Laravel 5 - when new user registers, should automatically assigned plan subscription. can manually in tinker (laravel 5): $token = input::get('stripetoken'); $user = user::all(); $user->subscription('monthly')->create($token); flash('your business relationship has been created membership'); where, in laravel 5, set such logic? edit public function create(array $data) { homecoming user::create([ 'name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password']), 'company_name' => $data['company_name'], // have added below: $token = input::get('stripetoken'); $user = user::all(); $user->subscription('loop')->create($token); ]); } if using laravels registrar service i'd in there....

actionscript 3 - itemEditEnd event in Flex DataGrid -

actionscript 3 - itemEditEnd event in Flex DataGrid - so, i'm studying how edit/validate input in flex 3 datagrid cell. here's basic illustration used studying: <?xml version="1.0" encoding="utf-8"?> <mx:application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" backgroundsize="100%"> <mx:datagrid editable="true" itemeditend="check(event)"> <mx:columns> <mx:datagridcolumn headertext="name" datafield="name"/> <mx:datagridcolumn headertext="phone" datafield="phone"/> </mx:columns> <mx:dataprovider> <mx:arraycollection> <mx:object name="john" phone="(69)2345-6798"/> <mx:object name="mary" phone="(69)1234-5678"/> ...

facebook - Image is getting cut off when using the share dialog -

facebook - Image is getting cut off when using the share dialog - i have open graph tags setup site , have created image has recommended dimensions of 1200x630. when utilize the debug tool site, image gets cutting off. have tried variety of different sizes can't figure out. my site http://www.milehighinabox.com , seek @ facebook debugger can see cutoff image https://developers.facebook.com/tools/debug/ any help appreciated. facebook facebook-graph-api facebook-social-plugins facebook-sharer

livecode - I want to Perform particular event only once -

livecode - I want to Perform particular event only once - i have button , performs particular task. want perform particular task 1 time during sec mouse click don't want perform particular task. now, after task disable button alternative method above mentioned problem. using next code global e on mouseup replace "\$" "{\xxdollarxx}" in field "mytextfield" set text of field "mytextfield" ss set "" yy set 0 tmp repeat = 1 number of chars in ss if char of ss contains "$" add together 1 tmp if tmp = 1 set cr & char of ss after yy else set char of ss && cr after yy set 0 tmp end if else set char of ss after yy end if end repeat set yy field "mytextfield" disable me end mouseup i think problem duration of script. if script needs lot of time ...

Need an SVM implementation or a Java library -

Need an SVM implementation or a Java library - i have info set 2400 samples , 10,000 features. info binary (+1 or -1). need run past svm algorithm compare algorithm it. however, know not much svms or bundle use. tried reading implement one, it's way on head, , need weights vector. i'm windows user , i've got implementation in java. export info text file 1s , 0s. have access matlab, tells me extremely slow , won't run on 1.6ghz 2gb ram laptop (and need to) fast enough. have run algorithm couple hundred times accurate results. i'm looking quick , easy understand library or svm implementation can utilize in case. thank all. sense free inquire additional questions assist me better. i ended using jni svn lite can found here: http://www.mpi-inf.mpg.de/~mtb/svmlight/ didn't take long figure out how utilize , it's surprisingly fast (seconds). svm

provider for PostgreSQL in .net with support for TransactionScope -

provider for PostgreSQL in .net with support for TransactionScope - is there library connecting postgresql database , have back upwards transactionscope i tried npgsql doesn't yet back upwards transactionscope you seek library devart: http://www.devart.com/dotconnect/postgresql/ .net postgresql ado.net

javascript - Mongodb terminal command working, not working correctly in node js -

javascript - Mongodb terminal command working, not working correctly in node js - hello have devised next query in terminal mongodb database. db.champions.find().sort({wins: -1}).pretty() this correctly outputs in decesnding order according wins i have next code in node js champion.find().sort({wins: -1}).exec(function (err, championdata) { if (err) homecoming console.error(err); res.json(championdata) }); the response sent controller outputs info via angular html doc. doesn't output in ordered format specified (by wins decending) can node js / mongodb guru's please tell me im going wrong. thanks! sorry stupid question, angular ordering results. sorry! javascript node.js mongodb

hadoop - Mapreduce java heap space error during reduce phase -

hadoop - Mapreduce java heap space error during reduce phase - i have simple mapreduce job building tfidf index end java heap space error when reducer @ approx. 70%. tried different approaches, using sorts of structures, telling job utilize more memory in command , running job on smaller sample nil changed slightly. @ end of ideas appreciate tips going on. mapper produces right output reducer fails due java heap space error. this command running (i trying specify amount of memory used): hadoop jar wordcountmpv1.jar -d mapreduce.map.memory.mb=2048 -d mapreduce.reduce.memory.mb=2048 --input /user/myslima3/wiki2 --output /user/myslima3/index my whole mapreduce code: public class indexer extends configured implements tool { /* * vocabulary: key = term, value = index */ private static map<string, integer> vocab = new hashmap<string, integer>(); private static map<string, double> mapidf = new hashmap<string, double>(); priv...

Calculate the relative path of a file in java -

Calculate the relative path of a file in java - http://www.raykor.com/prob2solve.aspx here link question.i have created directories , files required. may have not understood question far have tried best. seek read , understand question , give hint solve same. it isn't clear quesiton is, based on title, best way determine relative path of file in java utilize path relativize(path other) method described here. as example, here's how used solve first problem on site: import java.io.ioexception; import java.nio.file.*; public void printfilesinpath(path start) throws ioexception { files.walk(start) .filter(path -> path.tofile().isfile()) .foreach(path -> system.out.println(start.relativize(path))); } java file

angularjs - ngModel that points to dynamic html -

angularjs - ngModel that points to dynamic html - i have repeater setup looks this <table class="table table-condensed"> <tr ng-repeat="m in resp.availabletemplates"> <td> <input type="checkbox" ng-model="m.selected" /> <span ng-bind-html="m.messagetext"></span> </td> </tr> </table> where m.messagetext string looks hello <input type='text' value=''/>!, <input type='text' value=''/> the user see list of template phrases, check off desired phrases, fill in text areas, , submit sends email filled in phrases provided. by using ng-bind-html, output looks should. when using ng-model, output doesn't display html. how can bind info renders proper html, allows me gather info provided user? try this: <span ng-bind-html="{{m.messagetext}}"></span> ...

php - UTF-8 all the way through -

php - UTF-8 all the way through - i'm setting new server, , want back upwards utf-8 in web application. have tried in past on existing servers , seem end having fall iso-8859-1. where need set encoding/charsets? i'm aware need configure apache, mysql , php - there standard checklist can follow, or perhaps troubleshoot mismatches occur? this new linux server, running mysql 5, php 5 , apache 2. data storage: specify utf8mb4 character set on tables , text columns in database. makes mysql physically store , retrieve values encoded natively in utf-8. note mysql implicitly utilize utf8mb4 encoding if utf8mb4_* collation specified (without explicit character set). in older versions of mysql (< 5.5.3), you'll unfortunately forced utilize utf8 , supports subset of unicode characters. wish kidding. data access: in application code (e.g. php), in whatever db access method use, you'll need set connection charset utf8mb4 . way, mysql no conver...

amazon web services - Strom on Mesos in AWS -

amazon web services - Strom on Mesos in AWS - i running storm cluster on aws. want storm cluster expand automatically when need comes. figured out mesos that. not have much knowledge mesos , deployment on aws. can mesos on aws automatically increment parallelism of topology tasks launching new instances , shutting them downwards when not necessary? if can, how configure mesos same. mesos not straight handle autoscaling itself, allows frameworks running on top of receive new resource offers , react them launching new task instances. haven't used personally, seek storm-mesos framework running storm on mesos: https://github.com/mesos/storm once have storm running on mesos, ready launch new instances resources come available, you're ready autoscale within existing cluster's capacity. you'll want take advantage of amazon's auto-scaling groups (asgs) scale number of mesos nodes based on need. asg scales more mesos nodes, resources nodes automatically o...

centos - How to get PhantomJS to render installed fonts? -

centos - How to get PhantomJS to render installed fonts? - i'm using phantom js render pdfs html source. text contain many different scripts. have issue hebrew. generally when see black squares instead of glyphs font bundle using yum list | grep fonts , install find, example: yum install fonts-hebrew fonts-arabic this has worked scripts not others. after installing fonts-arabic can see glyphs in pdf, hebrew blank. not black squares missing fonts, blank. the html doesn't reference of particular fonts installed these packages, uses css render arial , fall sans-serif. glyphs render fine in local browser, how can phantomjs renderer pick hebrew fonts? additional info: on centos 5.5, running phantomjs 1.9 steps followed solve this 1.checked if standard arabic back upwards available: yum grouplist 2.then if available install standard arabic support: yum groupinstall 'arabic support'. this solved issue. fonts centos phantomjs

Error with Equation parsing (java) -

Error with Equation parsing (java) - i have code: public class parse { static double eval(string exp) { scriptenginemanager mgr = new scriptenginemanager(); scriptengine engine = mgr.getenginebyname("javascript"); string stringresult = null; seek { arraylist<variable> vars = askforvars(parse1(exp)); arraylist<string> usednames = new arraylist<string>(); (variable v : vars) { if (!usednames.contains(v.name)) { stringresult = replacestring(exp, v.name, "" + v.valueused); usednames.add(v.name); } homecoming double.parsedouble(engine.eval(stringresult.tostring()) .tostring()); } } grab (exception ex) { ex.printstacktrace(); } homecoming 0.0; } static arraylist<variable> parse1(string exp) { ...

mouseevent - RaphaelJS: mouseup and mousedown calling the same function? -

mouseevent - RaphaelJS: mouseup and mousedown calling the same function? - i'm learning raphael , wonder how phone call same function both events, mousedown , mouse up, in order draw 2 dots every click. you can test code here: jsfiddle var w = window.innerwidth; var h = window.innerheight; var paper = raphael(0, 0, w, h); var canvas = paper.rect(0, 0, w, h,12); canvas.attr('fill', 'lightgrey'); canvas.mouseup(function (event, a, b) { // bounding rect of paper var bnds = event.target.getboundingclientrect(); var targetbox = this.getbbox(); // adjust mouse x/y var mx = event.clientx - bnds.left; var = event.clienty - bnds.top; // split x/y bounding w/h location %s , apply factor actual paper w/h var fx = mx/bnds.width * canvas.attrs.width + targetbox.x; var fy = my/bnds.height * canvas.attrs.height + targetbox.y; // cleanup output fx = number(fx).toprecision(3); fy = number(fy).toprecision(3); pape...

c++ - pointer to pointer assignment not working if used in a separate method -

c++ - pointer to pointer assignment not working if used in a separate method - within main, if line commented out used instead of 1 above it, lose pointer , nil gets printed console. must missing fundamental property concerning pointers thought when pass pointers x , y foo(), assignment of them work same if same logic done locally in main. missing , create assignment work correctly within foo()? #include <cstdio> #include <cstdlib> #include <iostream> #include <string> using std::cout; using std::endl; using std::string; const int maxsize = 3; struct item{ string key; string value; }; struct node{ int count; item *item[maxsize + 1]; node *branch[maxsize + 1]; }; void foo(item *x, item*y) { y = x; } int main(int argc, char *argv[]) { item *x = new item(); x->key = "hi"; x->value = "there"; item *y = new item(); y = x; //foo(x, y); node *p = new node(); p->item...

c# - Suggesting contacts (emails) in 'send to' field WP8.1 -

c# - Suggesting contacts (emails) in 'send to' field WP8.1 - so i'm trying create 'to' field suggesting email addresses matching user input string (like in screen in link) - same way in creating new email. it'll great if solution work in windows 8.1 (i'm developing universal app). screen: http://i.imgur.com/rofanov.png you can utilize next (it's not sophisticated, eg doesn't handle typing quickly, can prepare that). sure add together contacts capability project. xaml <page x:class="contactssearch.mainpage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:contactssearch" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:ignorable="d" background="{t...

Java equivalent of scala query in mongodb -

Java equivalent of scala query in mongodb - what equivalent cde in java: var result = collectionname.findone() println(result.get("name").tostring) to elaborate, sample db: { "_id" : objectid("4ca039f7a5b75ab98a44b149"), "name" : "kaustubh", "country" : "india" } { "_id" : objectid("4ca03a85a12344a5e47bcc5c"), "name" : "rahul", "country" : "pakistan" } { "_id" : objectid("4ca03a9ea12344a5e47bcc5d"), "name" : "swapnil", "country" : "lanka" } { "_id" : objectid("4ca03b19a12344a5e47bcc5e"), "name" : "sagar", "country" : "nepal" } i running next query on it: query.put("country", "india"); dbcursor cursor = collection.find(query); while (cursor.hasnext()) { system.out.println(cursor.next()); } ...

Change the way Android Browser sort its Bookmarks programmatically -

Change the way Android Browser sort its Bookmarks programmatically - i'm writing bookmark manager app , got kinda stuck when trying resort bookmarks (the ones beingness used default browser contentprovider). i know can query browser contentprovider , resort info please (.title + " asc", .visits + " desc", etc) sort bookmarks list shown on app , not actual bookmarks shown on android browser. there several app (sort browser bookmarks) on market, "bookmark sort & backup" illustration know it's possible. can please give me little direction on how possible? line of code, tutorial? appreciated! thank you, lior update - optional solution: android sort bookmarks specific column bookmarks database. database located in "data -> info -> com.android.browser -> databases -> browser.db". can utilize adb there or apps root explorer. android 2.2 sorts bookmarks according "visits" column, hence visited ...

Extracting specific values from JSON in Python -

Extracting specific values from JSON in Python - i have json object in python result of phone call api (using urllib2) generated follow: results = urllib2.urlopen(req).read() json1 = json.loads(results) this generates json object contains similar next (truncated due size): "http://d.opencalais.com/dochash-1/895ba8ff-4c32-3ae1-9615-9a9a9a1bcb39/cat/1":{ "_typegroup":"topics", "category":"http://d.opencalais.com/cat/calais/entertainment_culture", "classifiername":"calais", "categoryname":"entertainment_culture", "score":1 }, "http://d.opencalais.com/generichasher-1/b6a2d07d-133b-35ad-85e2-54d524e750cf":{ "_typegroup":"entities", "_type":"tvshow", "name":"hard knocks", "_typereference":"http://s.opencalais.com/1/type/em/e/tvshow", "instances...

Sending Skype group messages in Java, using the java-skype api by taskan -

Sending Skype group messages in Java, using the java-skype api by taskan - i can't send chat messages skype groups skype-java apis. although can send messages individuals, grouping messages not working. have tried available skype apis, none working. can 1 please allow me know how send grouping messages skype using java apis? java api skype skype4java

afnetworking - Converting mutableCopy to Swift -

afnetworking - Converting mutableCopy to Swift - i've found guide receive http body, witch contains json formatted error message afnetworking 2. guide in objective-c , i'm trying best convert swift. here's code i'm trying convert swift: - (id)responseobjectforresponse:(nsurlresponse *)response data:(nsdata *)data error:(nserror *__autoreleasing *)error { if (![self validateresponse:(nshttpurlresponse *)response data:data error:error]) { if (*error != nil) { nsmutabledictionary *userinfo = [(*error).userinfo mutablecopy]; nserror *jsonerror; // parse json id json = [nsjsonserialization jsonobjectwithdata:data options:nsjsonreadingallowfragments error:&jsonerror]; // store value in userinfo if json has no error if (jsonerror == nil) userinfo[jsonresponseserializerwithdatakey] = json; nserror *newerror = [nserror...

asp.net - Configuring IIS Client Certificate Mapping Authentication -

asp.net - Configuring IIS Client Certificate Mapping Authentication - i'm trying configure iis client cert mapping on iis 8, windows server 2012. don't see configuration showing in applicationhost.config, , cert i'm trying nowadays isn't offered alternative browser. here's i've tried far: in iis, created top-level site called "packagemanager": ssl settings follows: authentication: enabled anonymous: in configuration editor, section: system.webserver/security/authentication/iisclientcertificatemappingauthentication from: applicationhost.config <location path=’packagemanager’> set following: i wanted manytoonemappings map cert service business relationship (a domain user): here created 2 rules match subject , issuer cn's of godaddy cert: then generated powershell script above follows: set-webconfigurationproperty -pspath 'machine/webroot/apphost' -location 'packagemanager' -filter ...

objective c - iOS today widget for two trargets in same project -

objective c - iOS today widget for two trargets in same project - i have today widget, (that i've localised specific target), shows 1 build target have, main version of app. how can set available other (/all) target in same project? 10x in advance... your today target needs start same bundle id containing target. assuming apps com.mackstein.target1 , com.mackstein.target2 then need 2 today widgets bundle ids like: com.mackstein.target1.today1 , com.mackstein.target2.today2 the easiest way accomplish duplicate existing today1 widget target, tweak bundle id, , include new today2 target in target2 it annoying, haven't found improve solution. ios objective-c ios8-today-widget ios-extensions

No suitable driver found for jdbc:mysql from tomcat 8.0 -

No suitable driver found for jdbc:mysql from tomcat 8.0 - i trying application in tomcat 8.0, error org.springframework.jdbc.cannotgetjdbcconnectionexception: not jdbc connection; nested exception java.sql.sqlexception: no suitable driver found jdbc:mysql://ip:3306/durga_dev?characterencoding=utf-8 at org.springframework.jdbc.datasource.datasourceutils.getconnection(datasourceutils.java:80) ~[spring-jdbc-4.1.6.release.jar:4.1.6.release] @ org.springframework.jdbc.core.jdbctemplate.execute(jdbctemplate.java:630) ~[spring-jdbc-4.1.6.release.jar:4.1.6.release] @ org.springframework.jdbc.core.jdbctemplate.query(jdbctemplate.java:695) ~[spring-jdbc-4.1.6.release.jar:4.1.6.release] @ org.springframework.jdbc.core.jdbctemplate.query(jdbctemplate.java:727) ~[spring-jdbc-4.1.6.release.jar:4.1.6.release] @ org.springframework.jdbc.core.jdbctemplate.query(jdbctemplate.java:737) ~[spring-jdbc-4.1.6.release.jar:4.1.6.release] @ org.springframework.jdbc.core.jdbctemplate.query(jdbctemplate...

node.js - How to use and setup NodeJS for production? -

node.js - How to use and setup NodeJS for production? - i'm php programmer , i'm discovering world of nodejs. i installed node on local computer , that's ok, can create stuff work, i'm not quite used fact of using terminal/cmd programming. think bear that. i'm pretty used fact when need place on internet, purchase domain, 99.9% of them have php installed on, , that's ok, can along great few easy steps. this seems me totally different in nodejs. tried asking hosting if install nodejs on server, said no. i tried find nodejs hosting, exist cost crazy, asking same cost pay total year "normal" hosting single month... even www.openshift.com see there free hosting 3rd level domain , i'm not used not seeing files , not beingness able of doing want. so, i'm not getting quite how nodejs works, can explain me how node can used production , if i'm on right path? do have have special domain or special setup server have node inst...

javascript - Why is there an error, "Uncaught TypeError: undefined is not a function"? -

javascript - Why is there an error, "Uncaught TypeError: undefined is not a function"? - i looked mismatched braces, still not able figure out why error shows line: lab3.init($('#viewport')); in html. html: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>graphics lab</title> <script src="js/graphics.js"></script> <!-- bootstrap core css --> <link href="/css/bootstrap.min.css" rel="stylesheet"> <style> .starter-template { padding: 40px 15px; text-align: center; } #v...

php - Latvian characters into MySQL Database converting -

php - Latvian characters into MySQL Database converting - i have problem. have info in db in latvian (i.e valentīna ) , need display on page. other info saved in cp1257 encoding , looks aÎda macijevska - , displays aīda macijevska so have tried... 1 - ucwords(mb_strtolower(iconv("windows-1257", "utf-8//translit", trim($row['pac_name'])), "utf-8")); 2 - ucwords(mb_strtolower(iconv("windows-1257", "utf-8", trim($row['pac_name'])), "utf-8")); 3 - show without converting db `$row["pac_name"]`; and 3 points display same result - valent?na p.s database has utf8_general_ci collation, gave header utf-8 encoding - header('content-type: text/html; charset=utf-8'); so can please help me problem? assuming using cp1257 , not utf8, need set names cp1257 (or other way client tell mysqld bytes encoded using cp1257) character set cp1257 on each column (or perhaps defaulting ta...

java - Saving on sql using active android not actually saving -

java - Saving on sql using active android not actually saving - everyone i've using activeandroid library in android avoid doing sql coding reason isn0t working here code: this manifest: <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="android.permission.read_external_storage" /> <application android:name=".myapplication" android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme"> <meta-data android:name="aa_db_name" android:value="knownfiles2.db"/> <meta-data android:name="aa_db_version" android:value="5"/> <activity android:name=".mai...

java - Why javac sometimes creates unnecessary copies of variables? -

java - Why javac sometimes creates unnecessary copies of variables? - i have code looks this: boolean[] array = new boolean[200]; int[] indexes = {10, 42, 62, 74}; while(true) { //some code here stringbuilder sb = new stringbuilder(); (int j : indexes) { sb.append(array[j] ? '1' : '0'); } } bytecode this: astore 3 //"indexes" array ... aload 3 astore 8 aload 8 arraylength ... i not sure why javac re-create ref array local var. the for-each loop converted this: { int[] hidden_array_ref = indexes; int hidden_length = hidden_array_ref.length; for(int hidden_counter = 0; hidden_counter < hidden_length; hidden_counter++) { int j = hidden_array_ref[hidden_counter]; sb.append(array[j] ? '1' : '0'); } } in particular, notice int[] hidden_array_ref = indexes; . that's re-create asking about. the compiler way if write like: for(int j : indexes) { index...

javascript - How test software what program opens an Adobe pdf form? -

javascript - How test software what program opens an Adobe pdf form? - what code set adobe form test pdf viewer used open it, , display warning if wrong kind used? the reason if survey opened other acrobat or reader, gets messed , takes lot of work fix. thanks, jim i dont believe can within adobe form. but, find out plugin browser uses open pdf (information can found here javascript observe adobe reader plugin browser) and display pdf info user saying "you need adobe open pdf" if utilize other plugin. check example.. real pdf opens if adobe reader plugin installed , used on browser. http://www.cic.gc.ca/english/pdf/kits/forms/imm5257e.pdf hope helps.. javascript pdf adobe

R fill in NA with previous row value with condition -

R fill in NA with previous row value with condition - i need fill in na rows previous row value, until criteria not changed. simple illustration days of week, meals , prices: day = c("mon", "tues", "wed", "thus", "fri", "sat","sun","mon", "tues", "wed", "thus", "fri", "sat","sun") meal = c("b","b","b","b","b","d","d","d","d","l","l", "l","l","l") cost = c(na, 20, na,na,na,na,na,15,na,na,10,10,na,10) df = data.frame(meal,day ,price ) df meal day cost 1 b mon na 2 b tues 20 3 b wed na 4 b na 5 b fri na 6 d sat na 7 d sun na 8 d mon 15 9 d tues na 10 l wed na 11 l 10 12 l fri 10 13 l sat na 14...