Posts

Showing posts from July, 2014

Php Form Builder Framework Populate Form from Session -

i`m using pfbc framework setting forms. have small checkout form need post (step 1 ). once validated , posted form redirects next page (step 2). i want enable customers change form input when using button (browser). somehow dont see manage pre populate fields session. form classes defined in form:php $form = new form("question"); // prevent bootstrap , jquery re-loading, loaded in doc head $form->configure(array("prevent" => array("jquery"), "view" => new view_sidebyside, "labeltoplaceholder" => 0)); $form->addelement(new element_hidden("form", "question")); $form->addelement(new element_html('<hr />')); $form->addelement(new element_select("type:", "type", $options, array("id" => "type", "class" => "form-control", "required" => 1, "data-placeholder" => "kies een type")

json - How do I get the actual value from this in Scala : Right(Vector("abc")) -

i'm using gatling test websocket based service , in order parse json response use following: val initiator = jsonpath.query("$.header.initiator", json).right.map(_.tovector) printing initiator tells me : right(vector(guest3075085133639688955@example.com)) now beginner scala question: how actual string value "guest3075085133639688955@example.com" ? i've understood right container, contains vector 1 value (the value want), how ?! :) i've tried this, prints same thing (right(vect....): initiator.foreach{println} cheers, niklas initiator.right.get either unsafe. because throws java.util.nosuchelementexception if left value. by pattern matching: initiator match { // when right value, vector single element case right(vector(s)) => println(s) // when right value, vector empty or 2 or more elements. case right(v) => ??? // when left value case left(l) => ??? }

mysql - How to determine the correct number of connections -

i trying determine number of connections there on db, found following queries , results net , both have different outputs. can tell me figure correctly shows number of connections on db , how more details on these connections? mysql> select substring_index(host, ':', 1) host_short, -> group_concat(distinct user) users, -> count(*) -> information_schema.processlist -> group host_short -> order count(*), -> host_short; +------------+-------------+----------+ | host_short | users | count(*) | +------------+-------------+----------+ | localhost | root,mailer | 7 | +------------+-------------+----------+ 1 row in set (0.01 sec) mysql> show status 'conn%'; +---------------+-------+ | variable_name | value | +---------------+-------+ | connections | 9885 | +---------------+-------+ 1 row in set (0.00 sec) i found desire result using query bellow- select db_name

indentation on C not working for 1st ten lines of code -

the indentation in program, achieved \t , being displayed after 10th day. don't know what's wrong it. float penny= 0.01; int days = 1; while(31 >= days) { printf("day: %d \t amount: %f\n", days, penny); days += 1; penny *= 2; } it's because of tab character ( \t' ) advances cursor next modulo 8 column: illustration: 01234567012375670123456701234567 <-- column number modulo 8 | | | | day: 9 amount: 2.560000 day: 10 amount: 5.120000 day: 11 amount: 10.240000 usually terminals behave this, i'm not sure if there standard defines this. small program illustrating behaviour: #include <stdio.h> int main() { int i,j,k; (i = 0; < 16; i++) { (j = 0; j < 4; j++) { (k = 0; k < i; k++) { printf ("*"); } printf ("\t"); } printf ("\n"); } } output: * * * * **

jquery ui - Move items from one sortable connected list to the other programmatically -

i have 2 sortable connected lists #left , #right . want move elements #left #right when clicking button. $('#left li').each(function() { var $this = $(this); $this.appendto('#right'); }); above function moves items receive function not triggered. a jsfiddle of current state. found way trigger receive event manually $('#left li').each(function() { var $this = $(this); $this.appendto('#right'); // trigger $('#right').sortable('option', 'receive')(null, { item: $this }); }); new jsfiddle

c++ - Bullet Physics First Chance Exception When Creating New btConvexHullShape -

when create new btconvexhullshape first chance exception. code is: btconvexhullshape* m_collisionshapes; m_collisionshapes = static_cast<btconvexhullshape*>(malloc(sizeof(btconvexhullshape)* max_body_count)); new (&m_collisionshapes[m_activebodycount]) btconvexhullshape(); i tried: std::vector<btconvexhullshape> m_hulls; m_hulls.resize(max_body_count); the exception occurs @ new call , resize call. exception is: unhandled exception @ 0x0102c983 in useful_engine.exe: 0xc0000005: access violation reading location 0xffffffff. and occurs inside of bullet source code at: /**@brief return elementwise product of 2 vectors */ simd_force_inline btvector3 operator*(const btvector3& v1, const btvector3& v2) { #if defined(bt_use_sse_in_api) && defined (bt_use_sse) return btvector3(_mm_mul_ps(v1.mvec128, v2.mvec128)); #elif defined(bt_use_neon) return btvector3(vmulq_f32(v1.mvec128, v2.mvec128)); #else return btvector3(

Binary manipulation without file size multiplication -

(i believe) when binary file made format capable of being edited, (the new "editable" text representation) becomes 10x larger original file. imagine not problem on whole; curious if there way edit binary data without having deal issue; perhaps purely in ram without creating rep? , once binary representation edited, how convert original format reduce size again?

javascript - Does WebdriverJS wait() return a web element? -

i'm trying use webdriverjs wait() method in page objects make sure time access element, webdriver wait until present. currently, code have "looks" correct, won't let me click element once it's returned wait(). based on research i've done, looks there have been others have been able of yet have not been able figure out. i getting error: typeerror: undefined not function - on element.click() method in page object: facilitypage.prototype.selectfacility = function (facilityname) { var self = this; this.driver.wait(function () { return self.driver.iselementpresent(by.linktext(facilityname)).then(function (elm) { console.log('this elm: ', elm); return elm; }); }, 10000).then(function (element) { element.click(); }); }; how call test file: facilitypage.selectfacility('facility 1'); protractor had breaking change in 2.0 killed way of testing availability. new h

Writing a matrix into a file in Java -

i'm trying write graph format file in java. problem i'm able write string types file. uploaded image showing 5 5 matrix, example: {{5,5,0,0,0},{0,1,0,1,0},{1,0,0,0,0},{0,0,1,0,0},{0,1,0,1,0},{0,0,0,0,0}}, while first row describes , gives information on following matrix - 5 rows, 5 columns. my problem i'm able write strings file. have tried use string type , covert int, it's messy bit. lot! so, data represented 2d array of integers? since can write strings file, consider converting data string, e.g.: int[][] data = {{5,5,0,0,0},{0,1,0,1,0},{1,0,0,0,0},{0,0,1,0,0},{0,1,0,1,0},{0,0,0,0,0}}; string str = java.util.arrays.deeptostring(data); it give [[5, 5, 0, 0, 0], [0, 1, ...], ...] .

asp.net - CSS after is dropped when button changes to ASP Button -

query: how can keep 'after' part of code working when change html button asp button. i'm not sure why drops? issue: when change <button <asp:button after part of css no longer works. part of code fails #course .bottom .btn-next:after code: #course .bottom .next { padding-right: 40px; } #course .bottom .btn-next { border-top-left-radius: 10px; border-bottom-left-radius: 10px; } #course .bottom .btn-next:after { left: 100%; top: 50%; border: solid transparent; content: " "; height: 0; width: 0; position: absolute; border-color: rgba(255, 255, 255, 0); border-left-color: #ffffff; border-width: 20px; margin-top: -20px; } research example: is possible have :after pseudo element on button? (relates html not .net button) the problem asp .net button renders , input type="submit" . you render follows (please note without markup taking guess): <button runat="se

oracle - Quering all columns of single table in where condition for same input data -

if want fetch information based on condition on single column, this select * contact firstname = 'james' if want put conditions on multiple columns, this select * contact firstname = 'james' or lastname = 'james' or businessname = 'james' but if have more 50 columns. is there better way other condition or keyword? approach should not involve writing column names. there way in mysql shown here . if you're wanting search varchar2 columns, following script ought help: set pages 0; set lines 200 select case when rn = 1 , rn_desc = 1 'select * '||table_name||' '||column_name||' = ''james'';' when rn = 1 'select * '||table_name||' '||column_name||' = ''james''' when rn_desc = 1 ' , '||column_name||' = ''james'';' else ' , '||column_name||' = ''james''

ios - Grid of labels - how to set constraints in Xcode? -

i'm trying build user interface app , have use 6x3 grid of labels. put them in view. looks this: label label label label label label label label label label label label label label label label label label when i'm trying automatically add missing constraints looks bad. i tried use lot of settings haven't got appriopriate yet. me that? 6x3 grid of labels ? collectionview? , haven't got problem 1000000 constraints? u can add custom collectionview size/color/count of objects .......

javascript - TinyMCE with paste plugin loses formatting in Chrome -

greeting, everyone! i have webpage textarea handles rich text via tinymce. worked fine when users pasted text variety of sources, had issue when users tried paste word content (tons of xml tags added). fixed using "paste" tinymce plugin after getting advice stack overflow posts. firefox works fine. users can paste word or other sources (notepad++, winmerge, etc.) , formatting maintained. however, in chrome, pasting word works fine, pasting other sources loses formatting , left-justifies everything. lot of users paste code snippets textarea , losing formatting makes difficult read. i'm using tinymce 3.5.10. tried 4.2.4 see same behavior there. below code looks using 4.2.4. php source contains textarea element "tinymce-test" id. tinymce.init({ selector: "#tinymce-test", height: "100px", width: "99%", toolbar: "bold, italic, undo, redo", menubar: false, statusbar: false, plugi

scala - Bizzare type inference limitation - multiple type params -

why not compile? trait lol[a, sa] { def flatmap[b, sb](f: => lol[b, sb]): lol[b, sb] = ??? } val p1: lol[int, string] = ??? val p2: lol[double, nothing] = ??? val p5 = p1.flatmap(_ => p2) result: found : int => lol[double,nothing] required: int => lol[double,sb] val p5 = p1.flatmap(_ => p2) ^ things start compile when either: type params of flatmap invocation explicit sa covariant (wtf?) some other type nothing used in p2 (e.g. null ) sb not occur in return type of flatmap or occurs in covariant position of return type (e.g. return type option[sb] ) the above workarounds not acceptable me. @retronym's commentary on si-9453 explains behaviour you're seeing. here's workaround of sorts ... we can synthesize type equivalent nothing won't cause typer retract inference solution, type reallynothing = nothing { type t = unit } ie. nothing dummy refinement. example of question, sc

python - Highlight differences between two xml files in a Tkinter textbox -

Image
i tried kinds of logic , methods , googled lot, yet not able think of satisfactory answer question have. have wrote program shown below highlight specific xml code facing problem. sorry making post bit long. wanted explain problem. edit: running below given program need 2 xml files here: sample1 , sample2 . save files , in below code edit location want save files in c:/users/editthislocation/desktop/sample1.xml from lxml import etree collections import defaultdict collections import ordereddict distutils.filelist import findall lxml._elementpath import findtext tkinter import * import tkinter tk import ttk root = tk() class customtext(tk.text): def __init__(self, *args, **kwargs): tk.text.__init__(self, *args, **kwargs) def highlight_pattern(self, pattern, tag, start, end, regexp=true): start = self.index(start) end = self.index(end) self.mark_set("matchstart", start) self.mark_set(&q

swift2 - Append elements form JSON response to multidimensional array -

i using alamofire , swiftyjson. code: var array = array<array<string>>() alamofire.request(.get, url, parameters: ["posttype": "live"], encoding: parameterencoding.url).responsejson { (_, _, result) in switch result { case .success(let data): let json = json(data) for(_,subjson):(string, json) in json["info"] { let tag = subjson["tag"].string! let location = subjson["location"].string! array.append(array(count: 4, repeatedvalue: concerttag)) } case .failure(_, let error): print("request failed error: \(error)") } } i want create array multidimensional. , add json variables after pass array tableview. so need "array" like: [[tag1; location1],[tag2, location2], .... ] how can this? ideas? thank you you hav

javascript - Translating browser click event `x` and `y` coordinates to coordinates on a scaled Snap svg element -

i needed add piece of text svg rendered snap, @ point user clicks. because svg scaled using 100% width , uses viewbox attribute, needed translate x , y coordinates provided browser's click event x , y coordinates on scaled svg. i managed make work using piece of code: var $canvas = $('svg#myscaledsvg'); var snap = new snap($canvas[0]); snap.mousedown(function(event) { var offset = $canvas.offset(); var matrix = snap.transform().diffmatrix.invert(); var x = matrix.x(event.pagex - offset.left, event.pagey - offset.top); var y = matrix.y(event.pagex - offset.left, event.pagey - offset.top) // below function call renders text element given x , y coords addsometext(x, y); }); now, understand why need subtract offsets. don't understand snap.transform().diffmatrix.invert() does. can enlighten me why works? can't snap documentation, seems rather sparse overall. i'm guessing in case, can swap diffmatrix globa

php - How to use .htaccess to redirect example.com.tw to example.com? -

summary i have bought 2 domains, both 'example.com.tw' , 'example.com'. hope when user input 'example.com.tw' in address bar, can redirect 'example.com' automatically. below try. my try rewritecond %{http_host} ^www\.example\.com\.tw [nc] rewriterule ^ http://www.example.com%{request_uri} [r=301,l,ne] questions is correct above? is there better way improve code above? the issue when user input subdomain (such as: 'news.example.com.tw'), redirect correctly? (will redirect 'news.example.com' successfully?) to remove .tw tld: assuming both domains point same place , subdomains in subdirectories off main domains document root (or point document root of main domain itself). then, in root .htaccess file: rewriteengine on rewritecond %{http_host} ^(.*)\.tw$ rewriterule ^ http://%1%{request_uri} [r=302,l] replace 302 (temporary) 301 (permanent) when sure it's working ok.

f90 error in global climate model -

i compiled model code successfully, gives me error when try run it: forrtl: severe (408): fort: (8): attempt fetch allocatable variable cos_zenith when not allocated. i checked several questions , answers online i'm not sure how should handle problem in case. think error message seems quite clear don't have enough experience fortran don't know if it's bug or have modify code etc. this module of code apparently gives trouble: module mo_zenith ! ! description: ! <say module for> ! ! current code owner: <name of person responsible code> ! ! history: ! ! version date comment ! ------- ---- ------- ! <version> <date> original code. <your name> ! ! code description: ! language: fortran 90. ! software standards: "european standards writing , ! documenting exchangeable fortran 90 code". ! ! modules used: ! use mo_mpi, only: p_parallel_io, p_bcast, p_io use mo_kind

php - integrating twitter feed into a shortcode for wordpress -

i'm trying create simple shortcode wordpress has following variables: - username - no_of_tweets so user write [twitter_feed username="username" no_of_tweets="5"] and displays list of 5 of latest tweets. have been using plugin called twitter feed developers - oauth stuff , idea write code output front end html. i have working except 1 annoying glitch - can't no_of tweets work. this code works, doesn't allow users specify no_of_tweets variable: extract( shortcode_atts( array( 'username' => 'skizzar_sites', 'no_of_tweets' => '3', ), $atts ) ); // code $tweets = gettweets(3, $username); ... if tochange code following (i.e. change "3" in $tweets variable, code stops working: extract( shortcode_atts( array( 'username' => 'skizzar_sites', 'no_of_tweets' => '5', ), $atts ) ); // code

arrays - Mixing data from multiple JSON files -

i'm building project loads fantasy football stats of players. i'm using nfl.com's api , i'm stuck right now. while doing searching saw similar topics answered on stackoverflow, didn't quite fit needs. here's links json files i'm using: http://api.fantasy.nfl.com/v1/players/stats?stattype=seasonstats&season=2014&week=1&format=json http://api.fantasy.nfl.com/v1/players/stats?stattype=seasonstats&season=2014&week=2&format=json http://api.fantasy.nfl.com/v1/players/stats?stattype=seasonstats&season=2014&week=3&format=json here's link unflattened version can see structure properly: http://codebin.org/view/89722b2e as can see, each of links picking different week of season. name, position, , team need pull once, need pull weekly stats each json file each player. i'm not sure how go doing it. this code i'm using: $json = file_get_contents("http://api.fantasy.nfl.com/v1/players/stats?stattype=sea

Dealing with missing property/keys in AJAX GET JSON request -

sometimes json object called ajax request missing key/property of value want display in table. problem when key missing causes "typeerror: cannot read property 'name' of undefined" logged in console , breaks code. tried using || statement didn't work. see code snippet below: function getnextobject() { $.ajax({ url: "http://scrapi.org/object/" + randomnum, success: function(data) { var timeline = data.timelinelist[0].name || "not available"; var medium = data.medium; var culture = data.culture; var geo = data.geography; var date = data.datetext; var gallery = data.gallerylink; var title = data.title; var artist = data.primaryartist.name || "not available"; var image = data.currentimage.imageurl; primaryartist , timelinelist not contained in json object throwing error , causing code break. how can overcome this? the problem code trying .name of these varia

osx - Getting Information about e-mail Attachments with Applescript -

i trying receive information attachments in mail app. far able receive data e-mail selected. additionally receive information attachments. tell application "mail" set selectedmessages selection set themessage item 1 of selectedmessages set themailbox mailbox of themessage set mailaddresses email addresses of account of themailbox return theattachment in themessage's mail attachments end tell the script works if use return mailadresses cannot information attachment. hints? try this, return value contains data themessage themailbox mailaddresses name und mime type of attachments list of each message of selected messages tell application "mail" set selectedmessages selection set mailboxdata {} repeat amessage in selectedmessages set themailbox mailbox of amessage set mailaddresses email addresses of account of themailbox set attachmentdata {} repeat anattachment in (get ma

why php cannot show variable in string template under some circumstances? -

this question has answer here: reference: variable scope, variables accessible , “undefined variable” errors? 3 answers thanks time in advance. newbie in php , encountered strange problem, @ least me strange. showing variable in string template. please see code below: public function welcome() { $data="everyone"; $b = $this->returntemplate(); $a = "<div>dear $data</div>"; } public function returntemplate() { return "<div>dear $data</div>"; } i thought both $a , $b should same value <div>dear everyone</div> in fact $a while $b <div>dear </div> . puzzled me , wonder why? please explain me? thanks in advance , feedback welcome! you encountering 'variable scope'. have defined variable $data in welcome() function, not available anywhere outside of funct

ruby - Grabbing returned variables? -

lets have model called lead , controller method called functions. lead model has method called grab. def functions lead.grab(data) puts newdata end def grab(data) newdata = data + 20 return newdata end why not work? newdata variable passed functions method cannot seem use without undefined error. you should have newdata = lead.grab(data) . variable newdata in grab function out of scope of controller, can't use it. have set variable in controller returned value of lead.grab(data) .

if statement - Add column with FK to an existing table in MySQL 5.6 -

good day everyone. hope can helps me in experiments. i have simple table needs , it's have data inside. create table if not exists main.test ( id int(11) not null, name varchar(30) not null, date_created timestamp not null, primary key (id)); but should update table adding column fk_. how can check if table had has field fk_? if such column not exist do: alter table main.test add column fk int(11), add foreign key (fk) references test2(id_test2) as use java decision of problem using resultset. resultset set = statement.executequery(query); set.next(); int result = set.getint(1); //it return 1 row set.close(); and sql-query: select count(column_name) information_schema.columns table_schema = 'main' , table_name = 'test' , column_name = 'fk"; when i'll result can decide query should use.

forms - PHP Checkbox Verification Keeper -

i have comment section handling name/phone/comment/etc. have checkbox in form well. error exception produce when checkbox set empty. if boxes checked, , other areas aren't satisfied, can't boxes stay checked while errors thrown elsewhere , page reloaded. i tried setting values , $response in if statements yes, if 1 box checked, when page reloads boxes checked. php: if ($_server["request_method"] == "post") { if (empty($_post["response"])) { $responseerr = "response required"; } else { $response = test_input($_post["response"]); } } how prefer respond? choose apply. <span class="error">* <?php echo $responseerr;?> </span> <br> <input type="checkbox" name="response" <?php if (isset($response) && $response=="call") echo "checked";?> value="call">call <input type="checkbox&quo

c++ - Use Web Service In Nginx configuration File -

see configuration location ~* ^/dl/([a-za-z0-9\-\_]+)/([0-9]+)(.*)$ { root /home/godofwar/public_html/; secure_link $1,$2; secure_link_md5 oh4fj4kion6srt5txdc1$3$2; if ($secure_link = "") { return 403; } if ($secure_link = "0") { return 403; } rewrite ^/dl/([a-za-z0-9\-\_]+)/([0-9]+)/(.*)$ /$3 break; } after token , expiry time checked (before rewrite), want call module operation token , user ip sent web service; if output of web service true, file downloaded, , if false, username/password received , sent web service in http auth basic. if output of web service true, file downloaded, , if false, error 404 given for example : http://www.example.com/dl/gghbgdpqluckx17nbby29w/1440849227/user/john/files/video.mp4 /* * after token , expiry time checked * token , user ip sent web service : * ws : http://www.example.com/checktoken/gghbgdpqluckx17nbby29w/52.152.62.145 */ if(true) { rewrite ^/dl/([a-za-z0-9\-\_]+)/([0-9]+)/(.*)$ /$3 break; } else {

java - inputprocessor touch down gives late response? -

so busy kind of pong game android. have paddle , ball. controls player (the paddle) followed: if player touches on left side of screen, paddle goes left if player touches on right side of screen, paddle goes right actually above 2 points work fine, bothers me, when im holding right right finger, , after release , fast holding left left finger, paddle executes 1 time "going left", , stops, while still holding left. (and vice versa) i discovered happens if use 2 fingers. if im holding down right finger, , try go fast press other side, doesnt stop , keeps going left. but important use 2 fingers, since way how game should played. this may explained unclear, can ask in comments more specific questions. player.java: http://pastebin.com/pdfzjtrb myinputprocessor.java: http://pastebin.com/xpzi8jpb i think problem resides in fact have touchdown boolean being shared between left , right sides. if press left side fast enough, touchdown left finger gets se

java - Get list of target Platform programmatically -

how can list of available target definitions workspace programmatically? writing plugin requires display list of available target platforms. the itargetplatformservice osgi service provides information target platforms. get like: servicereference<itargetplatformservice> ref = bundlecontext.getservice(itargetplatformservice.class); itargetplatformservice service = bundlecontext.getservice(ref); where bundlecontext bundlecontext passed start method of plugin's activator. call public itargethandle[] gettargets(iprogressmonitor monitor) method of itargetplatformservice array of target platforms.

jquery - Slick Carousel Blank Slides -

i set overlay slick carousel, when click on image larger carousel appears selected image initialslide. however, slick carousel adding several blank slides after initialslide. know why? also, how can restart overlay carousel upon close? $("#sync1 .item").on("click", function() { var index = $(this).attr("data-slick-index"); $(".overlay-carousel-container").css("display", "block"); $("body").css("overflow", "hidden"); $("#overlaycarousel").slick({ slidestoshow: 1, fade: true, initialslide: index, focusonselect: true }); }) <div class="overlay-carousel-container"> <a class="close">&nbsp;</a> <div class="overlay-wrapper"> <div class="overlay-img-wrapper"> <div class=&

bash - Using expect multiple times in /usr/bin/expect -

i'm trying automate calls message oriented middleware application called disque using disque , i'm running difficulty... everytime want client run command, must expect prompt gives , send command, when try more once, run problems. here expect script in basic non-functioning form: set timeout 20 spawn "./disque" set timeout 10 expect "127.0.0.1:7711> " {send "addjob scriptqueue body 0\r"} set timeout 10 expect "127.0.0.1:7711> " {send "getjob scriptqueue\r"} however, when run above script, first prompt read , first message sent. getjob command never run. here output get: spawn ./disque 127.0.0.1:7711> addjob scriptqueue body 0 also reference, how disque works when manually input 2 strings when i'm prompted: 127.0.0.1:7711> addjob scriptqueue body 0 di530404a85743c0afe1353ae1943df8d86c9f561005a0sq 127.0.0.1:7711> getjob scriptqueue 1) 1) "scriptqueue" 2) "di530404a80

sql - Perl many insert statments into mysql database -

i have code perl looks this: @valid = grep { defined($column_mapping{ $headers[$_] }) } 0 .. $#headers; ... $sql = sprintf 'insert tablename ( %s ) values ( %s )', join( ',', map { $column_mapping{$_} } @headers[@valid] ), join( ',', ('?') x scalar @valid); $sth = $dbh->prepare($sql); ... @row = split /,/, <input>; $sth->execute( @row[@valid] ); (taken mob 's answer previous question.) that dynamically building sql insert statement csv data, , allowing csv data proper headers column mapping picked. i have been looking examples on how insert statment multiple rows of data @ once. my perl script needs run around few hundred million insert statments, , doing 1 @ time seems slow, since server running on has 6gb of ram , slowish internet connection. is there way can upload more 1 row @ time of data? 1 insert statment uploads maybe 50 rows, or 100 rows @ once? cant find out how perl dbi. my $sql_values = join(

batch get csv values and save them into variables for further use -

i want extract values of file this: 4564,cde0 7578,kernel 123465,performer info,kernel i thought putting data csv file easiest option, if there easier way values in variables, open suggestions. have way more 4 lines... i want use values: line 1 need 4564 , cde0 in separate variables. put them in script , continue line 2 , on. i have found several threats deal columns , have following code: for /f "tokens=1-2 delims=," %%a in (test.csv) (@echo %%a %%b) but shows me content without ",". is there way go through line , put 2 values 2 variables? if think easiest way go through csv file loop extract values variables, use them , continue next line, not familiar batch don't know if best way so. thank you at case, multi-dimensional array trick. since batch don't have array feature, can make ourself! this: @echo off setlocal enabledelayedexpansion set var1=0 /f "tokens=1* delims=," %%a in (text.csv) ( set var2=0 se

javascript - Exception while simulating the effect of invoking 'insertPlayerData' ReferenceError: currentUserId is not defined -

playerlist = new mongo.collection('players'); ueraccounts = new mongo.collection('user'); if(meteor.isclient){ template.leaderboard.helpers({ 'player':function(){ var currentuserid = meteor.userid(); return playerlist.find({createdby: currentuserid},{sort: {score: -1,name: 1}}) }, 'selectedclass':function(){ var playerid = this._id; var selectedplayer = session.get('selectedplayer'); if(playerid == selectedplayer){ return "selected" } }, 'showselectedplayer':function(){ var selectedplayer = session.get('selectedplayer'); return playerlist.findone(selectedplayer) } }); template.leaderboard.events({ 'click .player': function(){ var playerid = this._id; session.set('selectedplayer', playerid); }, 'click .increment':function(){ var selectedplaye

javascript - display vertical axis label in line chart using chart.js -

how add vertical axis (y-axis) label line graph created using chart.js , angular-chart.js i need display y-axis label. html <ion-content ng-controller="agecontroller"> <canvas id="line" class="chart chart-line" data="data" labels="labels" legend="true" series="series" click="onclick" colours="['red','yellow']" width="402" height="201" style="width: 402px; height: 201px"> </canvas> </ion-content> js app.controller('agecontroller', ['$scope','$http',function($scope,$http) { $scope.labels = ["january", "february", "march", "april", "may", "june", "july"]; $scope.series = ['series a', 'series b']; $scope.data = [ [65, 59, 80, 81, 56, 55, 40], [28, 48, 40, 19, 86, 27, 90] ];

excel - How to click on a link that keeps on changing depending upon whats entered in searchbox -

i'm unable click on link in page since link keeps on changing after entering number in each search box. tried few vba codes not able achieve it. <a href="../finding/data?data=all&amp;version=0&amp;edocid=0&amp;ssid=05bdpusphl&amp;refnum=15q100595&amp;defaultemail=abc@abc.com&amp;snpid=15834667918&amp;servicecd=e" target=_blank>data</a> sub try() dim ie object dim myhtml_element ihtmlelement dim myurl string dim myurlser string set ie = createobject("internetexplorer.application") on error goto err_clear myurl = "[http://test.com/login][1]" set mybrowser = new internetexplorer mybrowser.silent = true mybrowser.navigate myurl mybrowser.visible = true loop until mybrowser.readystate = readystate_complete set htmldoc = mybrowser.document htmldoc.all.j_username.value = "user" 'enter email id here htmldoc.all.j_password.valu

java - How do I fix the height of a JEditorPane inside a JScrollPane? -

i want restrict height of jeditorpane inside jscrollpane have maximum value, still allow width expand fit content. my reasoning want single line of text allows me embed components. want jtextfield embeddable components, since jtextfield cannot this, i'm using jeditorpane (jtextpane fine, too). i'm trying mimic stackoverflow tag behavior in desktop swing application. embed clickable "tags" in jeditorpane , they'll appear in 1 line, does. as stands, jeditorpane expands vertically, not horizontally sscce: import javax.swing.*; import java.awt.borderlayout; public class tags { /* * method want modify implement behavior: */ public static jcomponent buildtagscomponent() { jscrollpane scrollpane = new jscrollpane(); jeditorpane editorpane = new jeditorpane(); scrollpane.setviewportview(editorpane); return scrollpane; } /* * remainder of code make example complete. */ public static jfra

datetime - Does Magento expect server timezone to match default store timezone? -

take @ mage_core_model_date::gmttimestamp() : /** * forms gmt timestamp * * @param int|string $input date in current timezone * @return int */ public function gmttimestamp($input = null) { if (is_null($input)) { return gmdate('u'); } else if (is_numeric($input)) { $result = $input; } else { $result = strtotime($input); } if ($result === false) { // strtotime() unable parse string (it's not date or has incorrect format) return false; } $date = mage::app()->getlocale()->date($result); $timestamp = $date->get(zend_date::timestamp) - $date->get(zend_date::timezone_secs); unset($date); return $timestamp; } assume $input "today" . assume server timezone utc . $date->get(zend_date::timezone_secs) corresponds difference in seconds between store timezone , utc. if magento default store (i'm testing admin) timezone iz pacific/auckland (gmt+12) ,