Posts

Showing posts from May, 2011

How to show exactly three digits after decimal in legend bar when the values are created by linespace in Matlab -

i have 1 stupid question. have range of value like: n=linspace(1,2,15); now, want show these computed n value 3 digits after decimal in legend bar. have written code: n_rounded = round(n * 1000) / 1000; and in figure set value yticklable: set(h,'yticklabel', n_rounded); but value shown in legend bar didn't show 3 digits after decimal. example shows 1.5 instead of showing 1.500. need show 1.500 how can that? br, try set(h,'yticklabel', num2str(n_rounded, '%.3f\n')); thanks man (comment deleted) line break.

java - Unable to read entire POST request body content formatted as application/json -

i've been having issue jetty processing application/json formatted request body data. essentially, when request body processed jetty, request data cut off. i have relatively large post body of around 74,000 bytes. per advice found online, instantiated new context handler setmaxformcontentsize property set sufficiently large size of 500,000 bytes. servletcontexthandler handler = new servletcontexthandler(server, "/"); handler.setmaxformcontentsize(500000); however, did not seem work correctly. read online property might work form encoded data, not application/json , strict requirement of our application. is there way circumvent issue? there special constraint class can subclass allow processing size increase @ least 500kb? edit #1: should add tried drop size of limit 5 bytes see if cut off more of data in payload. didn't working, seems imply that's ignoring property entirely. edit #2: here read information request stream. @override prote...

performance - Ajax request delay 1 second -

Image
this time problem delay between ajax request, , php file response.i have checked out google chrome statistics, , shows exact 1 second wait time every time function loops , sends ajax request.this makes script pretty unusable cause slows much, browser get's unresponsive till executes full loop. i tried remove mysql queries, exclude mysql problem, , delay still existed.im pretty sure it's not mysql taking long execute. does have idea may delay caused on.maybe it's settings on pc, or ajax? thank maybe explain better. yes!i've figured out.apearantly mysql connection have taken it's time, reason i've used localhost initiate connection instead 127.0.0.1.now it's much faster! :d .no reason blaming ajax, simple 127.0.0.1 did trick.

PHP email content different on PC and iPhone -

i send email (in html format) in php using phpmailer library. my email displayed correctly on pc , iphone, no accents or other problems. but noticed concern in content: indeed, body of email contains characters " =da ". on pc, see " =da " on iphone, these 3 characters replaced " Ú ". the problem appears in body of mail. if display " =da " in email subject, see correctly on pc , iphone. nb : code files in utf-8 , make utf8_decode content of mail before sending (and remember have no worries or other accents). thank in advance help =xx , 2 hex digits commonly seen in emails use 'quoted printable' encoding. since you're using utf-8, won't using quoted printable encoding, sounds iphone may doing conversion anyway. may bug in iphone email client. my suggestion switch quoted printable mode. in phpmailer, this: $mail->encoding = 'quoted-printable';

ios - UITableView with Horizontally wrapping cells -

i looking how to, in swift , interface builder, create uitableview in xcode table has set width (example: padding left , right edges of superview might 8). in table, want cells go across first row. when new cell can no longer fit in first row want go second row. when new cell can no longer fit on second row, want go third row, etc. want table scroll vertically. if can point me examples or documentation on appreciate it. you looking uicollectionview . http://www.raywenderlich.com/78550/beginning-ios-collection-views-swift-part-1 https://developer.apple.com/library/ios/documentation/uikit/reference/uicollectionview_class/

c++ - Small sized binary searches on CUDA GPUs -

i have large device array inputvalues of int64_t type. every 32 elements of array sorted in ascending order. have unsorted search array removevalues . my intention elements in removevalues inside inputvalues , mark them -1 . efficient method achieve this? using 3.5 cuda device if helps. i not looking higher level solution, i.e. not want use thrust or cub, want write using cuda kernels. my initial approach load every 32 values in shared memory in thread block. every thread loads single value removevalues , independent binary search on shared memory array. if found, value set according using if condition. wouldn't approach involve lot of bank conflicts , branch divergence? think branch divergence can addressed using ternary operators while implementing binary search? if solved, how can bank conflict eliminated? since size of sorted arrays 32, possible implement binary search using shuffle instructions? help? edit : have added example show intend achieve. let...

javascript - How to place a new element exactly where a user clicks? -

i project below, set when click on ball(pin), follows , when click second time, ball returns original parent, , newly created ball appended newly created div, appended parent of element in clicked. my goal: have click exact point of newly created ball positioned. issue: have alert shows coordinates of click, , when inspect element after clicking, shows newly created ball has acquired properties. problem is, not every time seem line clicked. i'm getting dom manipulation, please explain in detail, how went solving problem. here code reviewed: http://codepen.io/jobenscott/pen/epzxzq if (elementmouseisover != thefrigginpin) { console.log("the 1 want, doesn't working further"); alert("x: " + relativex + " y:" + relativey); elementmouseparent.append($newhiddenelement); pinnedpinpositioned.appendto($newhiddenelement); pinnedpinpositioned = brandnewpin.css({ left: relativex, // left: e.clientx, ...

soap - Client looks like we got no XML document in soapclient php -

i have problem in using soapclient in php. considering fist try in authenticating user credentials might have basic mistakes in code well. have simple html tags takes user credentials(on client side) , sends them processing page (works in backend) , sends soap message server page using __soapcall . here code. please suggestions client.php <html> <body> <form method='post' action='middle_client.php'> <lable>user name</lable><input type='text' name= 'user' id='user'> <br> <lable>password</lable><input type='password' name= 'pass'> <br> <lable>insurance name</lable><input type='text' name= 'insurance'> <br> <input type='submit' name= 'submit'> </form> <body> </html> middle_client.php <?php use \soapclient; if(is...

c++ - Qt: MainWindow->show() crashes program on call -

i've been working on program using qt in c++ , far good. needed program moved machine. have subversion, committed every file in project folder , checked out on new machine. after jumping through hoops build , running, error: assert: "dst.depth() == 32" in file qgl.cpp,. invalid parameter passed c runtime function qt i tried stepping through program find point crashes , found after had been initialized , show() called class inherits qmainwindow class. c->showview() line calls qmianwindow->show(). ----------main.cpp------------ #include <qapplication> #include "modeli.h" #include "controlleri.h" #include "model.h" #include "controller.h" int main(int argc, char *argv[]) { qapplication a(argc, argv); modeli *m = new model(); controlleri *c = new controller(m); c->showview(); <- error here return a.exec(); } the confusing part of problem p...

javascript - Simplfly jQuery and HTML to show/hide divs on page -

i came basic jquery using series of if-statements show/hide divs on page via html select list. optimize code in couple ways if possible: 1) how can use less code achieve same result? 2) maybe bit broad, how can optimize code new divs don't have manually typed out? in other words, make don't have add $(block-x).hide() $(block-x).show() etc... html: <div class="container"> <form class="form"> <div class="form-group"> <label for="selectlist">filter divs</label> <select id="selectlist" class="form-control"> <option value="1" id="lall" selected="selected">show all</option> <option value="2" id="lone">one</option> <option value="3" id="ltwo">two</option> <option value="4" id="lthree">three</optio...

FIFO behavior for Array.pop in javascript? -

this question has answer here: how implement stack , queue in javascript? 15 answers i want array method similar array.pop() exhibits first in first out behavior, instead of native filo behavior. there easy way so? imagine javascript console: >> array = []; >> array.push(1); >> array.push(2); >> array.push(3); >> array.fifopop(); 1 <-- array.pop() yields 3, instead you can use array.prototype.shift() >> array = []; >> array.push(1); >> array.push(2); >> array.push(3); >> array.shift(); //outputs 1 , removes array https://developer.mozilla.org/fr/docs/web/javascript/reference/objets_globaux/array/shift

python - How to update a plot event driven? -

how can update matplotlib plot event driven? background: wanna program tool displays me measured values receive via serial port. these values send serial connected device when has measured values , not when host requests. current state: seems there no way update plot manually. when call plot() -function more 1 time new plots added. similar matlab or octave, when use "hold on"-option. ends after 10 calls. freezed. when clear figures before update, whole plot disappears. @ least, when plot embedded in window. neither draw() nor show() provide remedy. when use single plot figure, there no easy way update, because after call of show() , program flow sticks @ line, until window closed. update has done in separate thread. both problems solved, when use animation: import sys pyqt4.qtgui import qapplication, qmainwindow, qdockwidget, qvboxlayout,qtabwidget, qwidget pyqt4.qtcore import qt matplotlib import pyplot, animation matplotlib.backends.backend_qt4agg import fi...

html - Can't get javascript to calculate string length -

i have form 1 below, , i'm trying calculate string length of inserted user value javascript. <form class="newcomment" method="post" id="formcourse1" name="commentadd"> <textarea class="scrollwelcome" id="text" rows="4" cols="65" name="course1" placeholder="ciao <?php print($name); ?>! inserisci qui il tuo commento"></textarea> <input type="submit" id="button" name="submit" value="manda"> i've been trying code can't work, won't go if statement. help? thank you function commentlength() { address = oform.elements["course1"].value; var length = address.length; if (length==1) { document.getelementbyid("lengtherror").innerhtml = "one character"; } if (length<5 & length>1) { document.getelementbyid("lengtherr...

python - Abstracting Exisiting Django Models -

i've got 2 models in django application have same fields, different types of information stored in each. for example: class a(models.model) field_a = models.charfield(primary_key = true, max_length = 24) field_b = models.charfield(primary_key = true, max_length = 24) class b(models.model) field_a = models.charfield(primary_key = true, max_length = 24) field_b = models.charfield(primary_key = true, max_length = 24) it seems make sense contain these in abstract model , have these 2 classes sub-classes. assuming this, without needing make db modifications, django isn't able find fields of models longer. could offer advice? if create new abstract class won't interfere database. can see in documentation https://docs.djangoproject.com/en/dev/topics/db/models/#abstract-base-classes abstract classes python classes without database impact. your code looks this: class parent(models.model) field_a = models.charfield(primary_key = tru...

php - Caching big data, alternative query or other indexes? -

Image
i'm problem, working on highscores, , highscores need make ranking based on skill experience , latest update time (to see got highest score first incase skill experience same). the problem query wrote, takes 28 (skills) x 0,7 seconds create personal highscore page see rank on list. requesting in browser not doable, takes way long page load , need solution issue. mysql version: 5.5.47 the query wrote: select rank ( select hs.playerid, (@rowid := @rowid + 1) rank ( select hs.playerid highscores hs inner join overall o on hs.playerid = o.playerid hs.skillid = ? , o.game_mode = ? order hs.skillexperience desc, hs.updatetime asc ) highscore, (select @rowid := 0) r ) data data.playerid = ? as can see first have create whole resultset gives me full ranking game mode , skill, , have select ra...

multithreading - Integration multi-threading test to stress test a server -

i'm new world of c# threads , want stress test particular server method. i'd somehow capture time taken run process , return in way. or, if server returns error message, ramp concurrent threads... is, sort of decay statistics users ramp up. i'm looking simple yet effective... i'm going call process integration test this: [test] public void stresstest_someexpensivemethod_approach() { int no_threads = 10; thread thread = null; myclass myc = new myclass(); (int = 0; < no_threads; i++) { thread = new thread(myc.doexpensivework); thread.name = i.tostring(); thread.priority = threadpriority.highest; thread.start(); } } i have class myclass below. class contains method doexpensivework() . i'm trying call doexpensivework() specified fixed number of threads (say 10 or 20 , ramp there) someexpensivemethod (an expensive process < 1 second though usually) , stores result in list i've ...

ios - Clear NSURLSession Cache -

i'm using nsurlsession perform http post nsmutableurlrequest , using datataskwithrequest:completionhandler: method. when perform request first time, things take reasonable amount of time complete , show feedback in completion handler. on next time same request fired, happens instantaneously little time in between, leads me believe system caching contents of data task. as don't need view returned data, nsurlsession best way this? needs work watchkit, nsurlsession does, why chose in fist place. preferably find way clear cache after each request. if need be, switch nsurlconnection, best. thanks! ephemeral mode not use cache. nsurlsessionconfiguration *ephemeralconfigobject = [nsurlsessionconfiguration ephemeralsessionconfiguration];

javascript - ES6: Destructure methods from class/function? -

i'm wondering if it's possible destructure properties/methods instance of class or function while maintaining scope across destructured variables? example: function counter() { this.state = {count: 0} this.update = (fragment) => { this.state = object.assign({}, this.state, fragment) } this.increment = () => { this.update({count: this.state.count + 1}) } this.decrement = () => { this.update({count: this.state.count - 1}) } } const counter = new counter const { state, increment, decrement } = counter console.log(state) increment() console.log(state) decrement () console.log(state) js bin the result each console.log same: {count: 0} because it's creating new instance , new scope each of variables. is intentional? approaching wrong way? (i'm creating library , assume try use way want make work) in example, destructuring desugars like const state = counter.state; assigning new value counter.state won'...

Javascript: attempting to access variable outside of function getting 'undefined' -

i trying access time_pressed variable outside of function held() returning time_pressed , doing console.log(held()) outside of function. console.log -ing undefined . why not working , how can need access said variable outside of function? here code.. function held(){ var time_pressed; document.onmousedown = function(e){ mousedown_time = gettime(); console.log(mousedown_time); } document.onmouseup = function(e){ time_pressed = gettime() - mousedown_time; console.log('you held mouse down for', time_pressed,'miliseconds.'); } return time_pressed } console.log(held()) consider following function: function held(){ var time_pressed; return time_pressed; } console.log(held()); what expect function return? no value has been defined, value undefined . the thing(s) you're doing in function assigning event handler functions document. means 2 things: those separate functions , they ...

mvvm - WPF Printing multiple pages from a single View Model -

i little bit troubled following problem. have user interface shows graphic (a canvas made of lines, circles, ... these wpf objects). depending on selection user makes in menu, items deleted , added. basic image looks same, few modifications made. the user has possibility select - - 10 different "pages" clicking next/previous button. i using mvvm light , viewmodel contains items of graphic (all lines, ...). now print graphic multiple pages. first page should contain graphic changes page 1, second page contains graphic changes page 2 , on. actual number of pages dynamic. track property currentpage , property pagestotal. whenever push "next" button, causes command executed change variable currentpage , makes sure correct items displayed. now print i'm stuck. dont' mind leaving mvvm zone , doing dirty work in code-behind refuse draw again in old gdi days. any ideas welcome. create usercontrol containing display logic (you graphic, instance...

Magento category list is empty -

i'm adding category using code below. my question is: how modify code add category root category? require_once('../app/mage.php'); mage::app('mysite'); $category = mage::getmodel('catalog/category'); $category->setstoreid(mage::app()->getstore()->getid()); if ($id) { $category->load($id); } $general['name'] = "my category"; $general['description'] = "great category"; $general['meta_title'] = "my category"; //page title $general['meta_keywords'] = "my , category"; $general['meta_description'] = "some description found meta search robots. 2"; $general['is_active'] = 1; $general['is_anchor'] = 0; $general['url_key'] = "cars";//url used category's page magento. $category->adddata($general); try { $category->save(); echo "<p>success! id: ".$category->getid(); } catch (exception $e...

c# - Error: Number of query values and destination fields are not the same - what am I doing wrong? -

i looking solutions error, nothing solve problems. have many items values in following sql code. don't know doing wrong? my access data base has following columns (eveything "short text" except , id obviously) id email kennwort vorname nachname telefonnummer strasse pls ort aktivierungscode edit: took column had date out couldn't figure out how implement sql code... still, same error. added parameters suggested. code: public class webuser { private string _vorname; private string _nachname; private string _email; private string _kennwort; private string _strasse; private string _plz; private string _ort; private string _telefonnummer; private string _aktivierungscode; public webuser() { // // todo: add constructor logic here // } public string email { { return _email; } set { _email= value; } } public string kennwort { {return kennwort; } set { _kennwort = value; } } public string vorname { { return _vo...

javascript - ECMAScript 6 child class prints with parents name -

when console.log(object) expect see name of object's class. seems rather unexpected child class carries name of parent. "use strict"; class parent { constructor () { } } class child extends parent { constructor () { super(); } } class grandchild extends child { constructor () { super(); } } var grandchild = new grandchild(); console.log(grandchild); // parent {} console.log(grandchild.constructor.name); // grandchild console.log(grandchild instanceof parent); // true console.log(grandchild instanceof child); // true console.log(json.stringify(grandchild)); // {} is intended behaviour? console.log that's messing up, or javascript consider instances of descendant class be, first , foremost, instance of root level class? console not standard, can see in mdn entry . standard way class name of instance in es6 use instance.contructor.name . stated in the spec .

c# - System.OutOfMemoryException' was thrown - WebClient.DownloadStringAsynch() -

i'm writing poor mans load tester , thought managing resources correctly (thread pool) when run following code outofmemoryexception on call webclient.downloadstringasynch. using .net4.0 move 4.5. asks: what fix? how use httpwebrequest , send asynch alternative webclient? what using .net 4.5 using await (any difference how .net4 manages threads asynch calls? static void main(string[] args) { system.net.servicepointmanager.defaultconnectionlimit = 200; while (true) { (int = 0; < 100; i++) { task.factory.startnew(loadtestasynchnet40); } console.writeline(".........................sleeping..............................."); thread.sleep(2); } } static void loadtestasynchnet40() { string url = "http://mysrv.com/api/dev/getthis?stuff=thestuff" + "&_=" + datetime.now.ticks; // <--- somtimes throws here... using (var client = new webclient()) { datet...

rpc - What could cause an active TCP close to return without notifying the passive end? -

i'm puzzled behavior of tcp-using application. when application @ 1 end of internet-wide tcp connection calls close() on socket, close() returns. @ other end, however, write() on socket doesn't indicate tcp connection closed. afaik, behavior inconsistent tcp specification: active close() shouldn't return unless , until receives acknowledgement other end of tcp connection (specifically, tcp state @ active end can't transition out of time_wait_1 unless receives appropriate response other end -- @ point write() @ other end should error-return). i've seen behavior when malfunctioning intrusion prevention system (ips) between ends of tcp connection. manufacturer of ips addressing problem. are there other situations in behavior can occur? my environment unix, c, onc rpc, , sockets. you conflating protocol state transitions , api behaviour. there nothing in rfcs says close() api can't return application , protocol actions proceed asynchronously, , ha...

javascript - Why am I unable to push these results to an array? -

i'm trying change results = $("x", xmlresponse).map(function() { to results.push = $("x", xmlresponse).map(function() { but doing prevents autocomplete suggestions appearing. if remove "push" again, autocomplete suggestions appear correctly no issue. how can use results.push here? use .get() return array .map() results = $("game", xmlresponse).map(function() { return { value: $("gametitle", this).text() + ", " + ($.trim($("releasedate", this).text()) || "(unknown date)") }; }).get()

oracle11g - Can anyone help me with performance tuning algorithms (queries) for oracle 11g express? -

i lost finding examples or algorithms showing use of performance tuning oracle 11g express or how used in oracle. have been looking @ youtube videos of them mention tuning , dont show examples or use oracle cmd. (if done in oracle cmd want know how performance tuning process) as quick , dirty way started - run explain_plan tell how oracle thinks execute query (in practice different) , doing full table scan instead of hitting index , appropriate go , create indexes on necessary fields , check explain_plan output again. see oracle says use index rather doing full table scan etc. other things watch out full table scans forced calling functions inside sql. if use rtrim () cost based optimizer has no realistic way know data after calling function can't job , forces full table scan impacting performance. if necessary can either inline function in sql statement or create index on function_name_here(column). place watch out when oracle automatic type conversion. if have data...

c# - Ajax calling MVC action method - No parameterless constructor defined for this object -

i'm making following ajax call action method in asp.net mvc controller: $.ajax({ type: 'post', contenttype: "application/json; charset=utf-8", url: appcontrollerurl + "/saveappdetails", data: {appdetails: json.stringify(appdetailsview.model)}, processdata: true, datatype: "json" }); however http 500 error stating 'no parameterless constructor defined object'. here controller: public class appdetailscontroller { // get: appdetails appdetailscontroller() { } [httppost] public actionresult saveappdetails(string appdetails) { ... } the 'data' ajax call passes controller looks this: appdetails= {"id":{"type":"string"},"appname":{"type":"string"},"guid":21} ... looks actual data need isn't being passed, data string seems formed. what's causing error? ...

selenium - Collect all the div id inside the table webdriver using c# -

<table id="tblrenewalagent" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td> <div class="form-row"> <div id="trstatus" style=""> <div id="trfees" class="form-row" style=""> <div id="trfees1" class="form-row ctrl-column" style=""> <div id="trfilingreceipt" class="form-row" style=""> <div id="trcomments" class="form-row" style=""> <div id="trcontact" class="form-row" style=""> <div id="tremail" class="form-row" style=""> <div id="trphone" class="form-row" style=""> <div id="trcell" class="form-row" style=""> <div class="form-row"> <div class=...

httpclient - two steps create/upload a file to hdfs with webhdfs/httpfs -

i used apache-httpclient , webhdfs create , upload file(.jar) hdfs. @ last, responded 201 , content-length=0. but when found file on hdfs, length 0. what's wrong? , should upload jar file? the rest api this. enter image description here

c# - TabPageCollection.RemoveByKey index 0 out of range -

so i've got weird issue. i'm developing chat application using jabber framework. i'm trying remove tabpage tabcontrol (removing chat tab chat window). each tabpage keyed string of user's jid (user@server.com). whenever try remove tabpage key, argumentoutofrangeexception. below code have explicitly removing chat tab. have function listens closing event of form itself, removes first (and only) control each tabpage before allowing form close. the weird part code works fine when chat form hasn't been closed. each chat tab can explicitly removed using function. problem arises when go remove tab after form has been closed , reopened (with current-open chats being re-added in own tabs). some key things know: i can retrieve index of tabpage want close through chattabs.tabpages.indexofkey(...) i can retrieve tabpage object through chattabs.tabpages[...] using index value indexofkey(...) when try remove page passing value chattabs.tabpages[...] chattabs...

Print a certain part of the Python turtle canvas to an actual printer -

Image
i trying fund out how add function program print (to actual printer) canvas part (not widgets bar @ bottom: see in image below) turtle canvas (that turtle drawing on) every time "print" button pressed. possible python, , if is, how implement ability program? appreciated! :) what want print printer:

c# - How to manually set language in ASP MVC without reconfiguring routing -

Image
edit the mistake in country code. albania's country code sq-al , , not al-al . full list of country codes: http://timtrott.co.uk/culture-codes/ i don't need have different routing different languages. need click of button toggle between 2 languages, albanian, , english. what can't figure out: how change language? i'm not worried on how detect language needs selected, how change language. i have these 2 resource files: resources.resx, resources.al-al.resx always strings resources.resx used, how can change strings resources.al-al.resx used? i tried this: //i'm trying stuff read here in so, none worked far. resource.culture = cultureinfo.createspecificculture("al-al"); httpcontext.session["culture"] = "al-al"; thread.currentthread.currentculture = cultureinfo.createspecificculture("al-al"); return redirecttoaction("index", "home"); and in view have this: @resource.culture @html.label(r...

Aache Spark java.lang.ArrayIndexOutOfBoundsException: 3 -

here files: package org.apache.spark.rdd; import java.util.list; import org.apache.spark.sparkconf; import org.apache.spark.sparkcontext; import org.apache.spark.api.java.javapairrdd; import org.apache.spark.api.java.javardd; import org.apache.spark.api.java.javasparkcontext; import org.apache.spark.api.java.function.function; import org.apache.spark.api.java.function.function2; import org.apache.spark.api.java.function.pairfunction; import scala.tuple2; public class datapreperation { public static void main(string[] args) { sparkconf config = new sparkconf().setmaster("local").setappname("datapreperation"); javasparkcontext sc = new javasparkcontext(config); javardd<string> custrdd = sc.textfile("data/customer.csv"); javardd<string> transrdd = sc.textfile("data/transection.csv"); ////identify distinct rows in customer.csv javapairrdd<string, string> custkp = cust...

How can I get the list of files in a directory using C or C++? -

how can determine list of files in directory inside c or c++ code? i'm not allowed execute 'ls' command , parse results within program. in small , simple tasks not use boost, use dirent.h available windows: dir *dir; struct dirent *ent; if ((dir = opendir ("c:\\src\\")) != null) { /* print files , directories within directory */ while ((ent = readdir (dir)) != null) { printf ("%s\n", ent->d_name); } closedir (dir); } else { /* not open directory */ perror (""); return exit_failure; } it small header file , of simple stuff need without using big template-based approach boost(no offence, boost!). googled , found links here author of windows compatibility layer toni ronkko. in unix standard-header. update 2017 : in c++17 there official way list files of file system: std::filesystem . there excellent answer shreevardhan below source code: #include <string> #include <iostream> #include ...

dataframe - Assistance Required to append to existing R Data Frame Object -

i trying pull historical price information asx200 list of companies. issue have r data frame using keeps getting overwritten (instead of appended to). final dataframe contains data last asx200 ticker. pls see attempt below: library(xml) url <- "http://www.asx200list.com" getasx200 <- readhtmltable(url, which=1, header = true) codes <- getasx200$code codes <- lapply(codes, as.character) (i in 1:200) { url2 <- paste("http://ichart.finance.yahoo.com/table.csv?s=", codes[i], ".ax", sep = "") dat <- read.csv(url2) dat$date <- as.date(dat$date, "%y-%m-%d") dat$code <- codes[i] } collecting list little bit tricky. here's example: library(xml) url <- "http://www.asx200list.com" getasx200 <- readhtmltable(url, which=1, header = true) codes <- getasx200$code codes <- lapply(codes, as.character) datlist <- list() (i in 1:200) { url2 <- paste("http://ichar...

javascript - Error : Webgrease to minify my JS and CSS -

i trying minify solution webgrease tool following syntax . wg.exe -m -in:d:\bexceptions-notification-controller.js -out:d:\bexceptions-notification-controller.min.js when hit shows "an error encountered while processing request.please verify input , try again" enter image description here

jquery - Change HTML tag dir value to none if dir ="rtl" -

<html dir="rtl" lang="ar"></html> $( "html[dir=='rtl']" ).attr("dir", ""); i want change dir value none. if dir="rtl" jquery. have tried above code, not working. solutions. $( "html[dir='rtl']" ).attr("dir", ""); try this. use = instead of == checking equality. or var dir = $("html").attr("dir"); if(dir == "rtl") { $("html").attr("dir", ""); }

php - Laravel 5: Does Eloquent eager load by default? -

i got structure: school -> hasmany -> classes so when tried codes below via artisan tinker app\school::with('schoolclasses')->find(2283)->schoolclasses; i can classes without problem. but when tried without still same result without problem: app\school::find(2283)->schoolclasses; does eloquent eager loads default? if so, how disable it? no, laravel not eager load default. lets take step step. lets ignore ->schoolclasses; moment. app\school::with('schoolclasses')->find(2283); this query database twice. first, school primary key of 2283. then, query database , related schoolclasses . app\school::find(2283); this query database once. school . there no eager loading done far. if debug , keep track of database queries, see query database once while eager loading query twice. when try access schoolclasses doing ->schoolclasses; , works. why same results? bit deceptive, it's not same. when try access schoolcl...

php - YouTube API - how to specify which channel to upload to -

we have script uploads videos youtube have been uploaded our server previously. it's rather large script i'll try , quite concise. code attempting upload... $video = ... // our model instance, queue videos in db table $media = new google_http_mediafileupload(... . . . $fp = fopen($videofile, 'rb'); while (!$status && !feof($fp)) { $chunk = fread($fp, $chunksize); $status = $media->nextchunk($chunk); $video->progress = $media->getprogress(); $video->save(); } fclose($fp); $fp = null; $client->setdefer(false); ...is getting following error youtube api: 0: failed start resumable upload (http 401: youtube.header, unauthorized) from can see, our script working should. gets access token, until point it's attempting upload file seems fine. gets following error youtube , handles error designed. according post, reason error channel doesn't exist account issues oauth/api credentials. youtube api3.0 videos.insert (up...

ios - Why do we set the attribute type of images to Binary Data? -

all images assorted in app , managed asset catalog. don't understand why in order create core data stack images have set attribute type binary data, xcode knows name/string of each image. why can't attributes transformable type or string ?

codenameone - Sharing a chart -

i using chart (line chart specifically) , chartcomponent classes create charts in app, , want share them sharebutton. i got work creating image, getting graphics context, , painting container chartcomponent placed in image's graphics context except line on chart doesn't show up. the chart axes , labels there, no lines. how can create image of whole chart share sharebutton? this problematic on ios. charts relied on new 2d shape api's unsupported on mutable images used draw upon. this fixed in recent updates: https://github.com/codenameone/codenameone/issues/1629

AngularJS Login Module -

i new angularjs , started implementing login/logout assignments. what doing is- $rootscope.$on('$statechangestart', function (event, tostate, toparams,fromstate) { var token = sessionservice.get('token') loginservice.isloggedin({token:token}).$promise.then(function(response){ if(!response.error){ var isloggedinonserver = response.object var requirelogin = tostate.data.requirelogin if(!isloggedinonserver && requirelogin){ console.log("1....") event.preventdefault() $state.go('user.signin'); } console.log(tostate.data.title,['signin','signup','forget'].indexof(tostate.data.title),isloggedinonserver,requirelogin) if(isloggedinonserver && !requirelogin && ['signin','signup','forget'].indexof(tostate.data.title) > -1){ console.log("2....") ...