Posts

Showing posts from April, 2014

How to set default zoom level in php header for pdf while downloading -

i using following header download pdf header('pragma: public'); header('expires: 0'); header('cache-control: must-revalidate, post-check=0, pre-check=0'); header('cache-control: private',false); header('content-type: application/force-download'); header('content-disposition: attachment; filename="business report.pdf"'); header('content-transfer-encoding: binary'); is possible set default zoom level pdf when open pdf

Change setView dynamically according to select box in R shiny app -

i'm developing leaflet map in r shiny. in app want focus of map changed whenever lng , lat value in setview() changed. lng , lat values based on country select drop down box. use static value lng , lat in ifelse() function , app works. problem when want make things more generic: lng , lat mean of longitude , latitude subset of data chosen country, app doesn't show map anymore (from point of view calculation seems right) below simplified , workable r script: global.r: library(devtools) library(leaflet) library(htmlwidgets) library(shiny) library(shinydashboard) library(sp) library(rworldmap) library(rcurl) library(ggmap) df <- read.csv(url("https://docs.google.com/spreadsheets/d/1rrejiuxr4naftquqblppudgwvgegtbjexlpjdday2uw/pub?output=csv"), header = t, stringsasfactors = f) df$time <- as.date(df$time, "%d/%m/%y") ui.r header <- dashboardheader( title = 'shiny memery' ) body <- dashboardbody(

IOS Xamarin can't read XML File -

so i've search everywhere. xamarin docs, goggle, here, w3. need store small data in xml file. created xml, got code lined , when go build it. ios.....can't find file. i've googled answer countless times, , same thing, make sure set content or make sure "embedded resource" i've tried both ways, can't find file access it. ios stupid? no issues in android, took 30 secs. add assets , boom there is. how ios recognize xml file(find it)? the code xdocuent doc = new xdocument.load("storedlogs.xml") < that line it throws error, through break points is. after steps through loop bind data in xml object logs a.id = x.element("id).value...... a.name......... , want basic offline storage. ios stupid? yes :p when add xml file embeddedresource , need read assembly instead of path for example: var readme = typeof(namespace.app).gettypeinfo().assembly .getmanifestresourcestrean("resourcename.xml"); u

sql - Simplify easy LOOP queries to get rid of the LOOP -

are there ways simplify loop there no loop needed? in 1 .. 2 loop if = 1 give_bonus (president_id, 2000000); elsif = 2 give_bonus (ceo_id, 5000000); end if; end loop; you can call procedures: give_bonus (president_id, 2000000); give_bonus (ceo_id, 5000000);

android - is it possible to use web view as a html reader (offline)? -

i searching way zoom both text , picture in layout. according questions web view easy way it. after while found code webview: import android.app.activity; import android.os.bundle; import android.webkit.webview; public class webviewactivity extends activity { private webview webview; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.webview); webview = (webview) findviewbyid(r.id.webview1); webview.getsettings().setjavascriptenabled(true); webview.loadurl("http://www.google.com"); } } i tried use file:/// instead of http:// used path: file:///sdcard/android/data/[my app package name]/about.html it seems working fine me, have serious problems. here problems: is path using works other android devices? i dont know how extract html files first run in path using. is there anyway load files assets? what source code extract files in first run? can use other formats pdf or doc

ios - Entering Values that edit object size -

i have rectangle drawn on screen 3x3 squares inside of it. have variables in class can change number of squares if manually enter in code. want create button take view. user can enter in value square , change number of squares inside rectangle. example if user enters in 4 increase size of squares 4 squares 4 squares. wondering can more information on how implement this.

deployment - Git: auto pull from repository? -

is there way set git such listens updates remote repo , pull whenever changes? use case want deploy web app using git (so version control of deployed application) want put "central" git repo on github rather on web server (github's interface soooo nice). has gotten working? how heroku it? google-fu failing give me relevant results. git has "hooks", actions can executed after other actions. seem looking "post-receive hook". in github admin, can set post-receive url hit (with payload containing data pushed) everytime pushes repo. for it's worth, don't think auto-pull idea -- if wrong pushed branch ? i'd use tool capistrano (or equivalent) such things.

Python: search for a string inside a given url, save to a txt the link it points to -

i'm new python , trying write script looks coupons regarding online courses. flow following: # read .txt list of courses , create vector containing of them # loop through vector and, each course, check if there's discount online (e.i udemycoupon.discountsglobal.com) # if there is, print link pointing creating vector file easy, else seems give me problems. taking example above website, have create, each course, string needed url. tried search web urllib (and urllib2) couldn't (error 403: forbidden). looked other answers none of them seem work. could please tell me how write particular part of script (considering example "complete python programming course 2016: code using python 3")? # have string called "course" containing "complete python programming course 2016: code using python 3" # substitute spaces inside "course" "+" , # utf-8 symbol code (: should %3a) # string link = "http://udemycoupon.discount

c# - Jquery check all dynamic checkboxlist in MVC view -

Image
recently created dynamic checkboxlist , display them in c# mvc razor view. <ul> @for (int = 0; < model.sites.count; i++) { <li> @html.checkboxfor(m => m.sites[i].ischeck) @html.labelfor(m => m.sites[i].ischeck, model.sites[i].sitename) @html.hiddenfor(m => m.sites[i].siteid) @html.hiddenfor(m => m.sites[i].sitename) </li> (int j = 0; j < model.sites[i].roomz.count; j++) { @html.checkboxfor(m => m.sites[i].roomz[j].ischeck) @html.labelfor(m => m.sites[i].roomz[j].ischeck, model.sites[i].roomz[j].roomname) @html.hiddenfor(m => m.sites[i].roomz[j].roomid) @html.hiddenfor(m => m.sites[i].roomz[j].roomname) } } </ul> below image display of checkboxes how use jquery on check sites.ischeck check sub-item under same sites? example check co2 check suite 1&2 modify html ca

ajax - CORS header 'Access-Control-Allow-Origin' missing in php -

this question has answer here: origin not allowed access-control-allow-origin 21 answers in web application, try pass data domain ajax call. shows error cross-origin request blocked: same origin policy disallows reading remote resource @ http://example.com/auth/webschool/test.php. (reason: cors header 'access-control-allow-origin' missing). my ajax code is, $.ajax({ type: "post", url: "http://example.com/auth/webschool/test.php", data: {username: "abcd",password:"abcd"}, datatype: "html", success: function (data) { alert(data); } }); just put line on test.php, hopes work <?php header('access-control-allow-origin: *'); ?>

javascript - jQuery wrap each item except one -

i'm trying wrap content within .product.type-product div, excluding first div (which contains image). i've tried following neither work! , advice helpful. js v1. $('.product.type-product').each(function() { $(this).children('div,h3,span,form').not(':first-child').wrapall('<div class="new columns small-12 medium-12 large-6" />'); } v2. $('.product.type-product').children('div,h3,span,form').not(':first-child').wrapall('<div class="new columns small-12 medium-12 large-6" />'); html <div class="post-886 product type-product status-publish has-post-thumbnail first instock shipping-taxable purchasable product-type-simple"> <div class="image columns small-12 medium-12 large-6"> <img width="800" height="389" src="xxx.jpg" class="attachment-post-thumbnail size-post-thumbnail wp-post-image&qu

linker - Multiple libgcc_s libraries when linking on Solaris with studio 12.5 -

i'm trying move developer studio 12.5 , enable c++11 options. software links openssl using oracle provided library in /usr/sfw. appears depend on older libgcc_s.so 1 used c++ 11 stl. following: cc -o binary -b direct -z origin -std=c++11 object_files.o -lblah/lib -r\$origin/../lib -lotherlib -l/usr/sfw/lib -r/usr/sfw/lib -lcrypto -lsocket unused $addvers specification file '/opt/developerstudio12.5/lib/compilers/cc-gcc/gcc_version.map' object 'libgcc_s.so' version(s): gcc_4.2.0 is there way 2 libgcc_s.so instances coexist in 1 binary references libcrypto going 1 , stl other? looking @ oracle linker , libraries document shows promising options -b group perhaps works dlopen. i realise recompile openssl (or perhaps libressl) nicer use 1 os , colleague reckons sun's build makes use of hardware crypto features on sparc.

c++ - Cmake, Boost parsing command line -

Image
i have problem. using cmake , boost vs 2015. i intend develop tool using cgal , assimp. convert file formats own. however, encountered problem , might simple cant see it. when press f5, debug error 2 images have attached. have attached code. pictures here: #include <boost/asio.hpp> #include <boost/filesystem/path.hpp> #include <boost/iostreams/device/file_descriptor.hpp> #include <boost/iostreams/stream.hpp> #include <boost/program_options.hpp> #include <boost/system/error_code.hpp> #include <iostream> #include <sstream> #include <string> struct cmdoptions { std::string input, output, directory; int points; }; namespace po = boost::program_options; bool process_command_line(int argc, char **argv, cmdoptions &cmdoptions1) { if (argv == nullptr) { return false; } try { po::options_description desc("program usage"); po::options_description desc ("program

gcc - stdarg and printf() in C -

the <stdarg.h> header file used make functions accept undefined number of arguments, right? so, printf() funtion of <stdio.h> must using <stdarg.h> accept avariable number of arguments(please correct me if i'm mistaken). found following lines in stdio.h file of gcc: #if defined __use_xopen || defined __use_xopen2k8 # ifdef __gnuc__ # ifndef _va_list_defined typedef _g_va_list va_list; # define _va_list_defined # endif # else # include <stdarg.h>//////////////////////stdarg.h included!/////////// # endif #endif i can't understand of what's in it, appears including <stdarg.h> so, if printf() uses <stdarg.h> accepting variable number of arguments , stdio.h has printf() , c program using printf() need not include <stdarg.h> it? i tried program had printf() , user-defined function accepting variable number of arguments. the program tried is: #include<stdio.h> //#include<stdarg.h>///if included

c++ - Can I use a mask to iterate files in a directory with Boost? -

i want iterate on files in directory matching "somefiles*.txt". boost::filesystem have built in that, or need regex or against each leaf()? edit : noted in comments, code below valid versions of boost::filesystem prior v3. v3, refer suggestions in comments. boost::filesystem not have wildcard search, have filter files yourself. this code sample extracting content of directory boost::filesystem 's directory_iterator , filtering boost::regex : const std::string target_path( "/my/directory/" ); const boost::regex my_filter( "somefiles.*\.txt" ); std::vector< std::string > all_matching_files; boost::filesystem::directory_iterator end_itr; // default ctor yields past-the-end for( boost::filesystem::directory_iterator i( target_path ); != end_itr; ++i ) { // skip if not file if( !boost::filesystem::is_regular_file( i->status() ) ) continue; boost::smatch what; // skip if no match v2: if( !boost::regex_

Firebase error handling while creating user Swift -

i developing ios application , wanted implement firebase database. i'm facing issue while handling errors during users creation process. default error switch, here code : firauth.auth()?.createuser(withemail: emailfield.text!, password: passwordfield.text!, completion: { (user, error) in if (error != nil) { if let errcode = firautherrorcode(rawvalue: error!._code) { var alertcontroller = uialertcontroller(title: "", message: "", preferredstyle: uialertcontrollerstyle.alert) let okbutton = uialertaction(title: "ok", style: uialertactionstyle.default) { (result: uialertaction) -> void in print("error transmitted") } switch errcode { case .errorcodeinvalidemail: print("invalid email") alertcontroller = uialertcontroller(title: "error",

wso2dss - WSO2 DSS : maximum length SQL statement / compound SQL statement (SQL Server) -

i have created compound sql statement query dataservice. works when statement +/- 600 characters long. when add more functionality sql statement, after saving sql statement full service becomes invalid (statement +/- 3500 characters) is there maximum length on sql statement can added in dataservice ? kind regards tore

d3.js - D3 Line chart using category name (string) in x-axis -

in d3 chart, don't want use date in x-axis. have simple category , count of category value , want create chart using these value. i using below url create line chart http://bl.ocks.org/mbostock/3883245 but in place of year, want show category name in x-axis. you want use ordinal scale instead of time-scale x-axis, have @ this . basically replace var x = d3.scaletime() .rangeround([0, width]); ... x.domain(d3.extent(data, function(d) { return d.date; })); with var x = d3.scaleband() .rangeround([0, width]); ... x.domain(data.map(function(d) { return d.date; })); but hard answer question without code examples of have tried far , hide. if provide example jsfiddle of code better answers , not question gets downvoted.

windows 8 - In powershell The I/O operation has been aborted because of either a thread exit or an application request -

i have been trying run ps script "remotely"on win8 machine.but default winrm disabled , network category "public". must set network category private (set-netconnectionprofile -networkcategory private) , enable winrm (enable-psremoting -force) inorder run ps script. when placed 2 commands along rest of script , tried executing remotely got failed,with error "processing data remote server 10.2.14.119 failed following error message: i/o operation has been aborted because of either thread exit or application request. " but when enabled winrm , set network category private manually using commands in ps on target host there no issue. appreciate answer. in advance regards

r - Creating Custom Folds For Caret CV -

i'm using caret package model , cross validate model <- caret::train(mpg ~ wt + drat + disp + qsec + as.factor(am), data = mtcars, method = "lm", trcontrol = caret::traincontrol(method = "cv", repeats=5, returndata =false)) however, i'd pass traincontrol custom set of indices relating folds. can done via indexout. model <- caret::train(wt ~ + disp + drat, data = mtcars, method = "lm", trcontrol = caret::traincontrol(method = "cv", returndata =false, index = indicies$train, indexout = indicies$test

docker machine - Rancher: creating hosts on AWS EC2 -

i'm trying add ec2 host rancher setup. have seen this tutorial, wanted use docker-machine instead. to extend, have done following: mac:~ user1$ docker-machine create -d amazonec2 --amazonec2-vpc-id vpc-84fd6de0 --amazonec2-region eu-west-1 --amazonec2-ami ami-c5f1beb6 rancher-node-aws-01running pre-create checks... creating machine... (rancher-node-aws-01) launching instance... waiting machine running, may take few minutes... detecting operating system of created instance... waiting ssh available... error creating machine: error detecting os: many retries waiting ssh available. last error: maximum number of retries (60) exceeded note: ami id corresponds rancheros-v0.7.0-hvm-1. as can see, cannot ssh rancheros (ssh port open on aws). ideas why is? the trick use ssh user called 'rancher'. full command be: docker-machine create -d amazonec2 --amazonec2-vpc-id vpc-84fd6de0 --amazonec2-region eu-west-1 --amazonec2-ami ami-c5f1beb6 --amazonec2-ssh-user

android - How can i hide view in Listview according to the position -

i have relative layout , want hide , show on button click (for each item of list view). adapter.java @override public view getview(final int position, view convertview, viewgroup parent) { inflate list_items.xml set data on button click if view hidden view.setvisibility(view.visible); } else { view.setvisibility(view.gone); } } }); return cview; } i have modified of code. try this, may works you. @override public view getview(final int position, view convertview, viewgroup parent) { inflate list_items.xml set data //layout want hide , show barrl = (relativelayout) convertview.findviewbyid(r.id.layout20); button= (button) convertview.findviewbyid(r.id.button); // click button if (button not visible) { barrl.setvisibility(view.visible); } else { barrl.setvisibility(view.gone); } //button h

ios - How to dismiss the UIAlertview on the click of UIViewController or on the UIScrollView in objective c -

Image
i new in ios , facing problem regarding dismiss uialertview. showing image in uialertview , using long press gesture call alertview. code this imagename.userinteractionenabled=yes; uilongpressgesturerecognizer *longpressgesturerecognizer = [[uilongpressgesturerecognizer alloc] init]; [longpressgesturerecognizer addtarget:self action:@selector(imglongpressed:)]; longpressgesturerecognizer.delegate = self; [imagename addgesturerecognizer: longpressgesturerecognizer]; - (void) imglongpressed:(uilongpressgesturerecognizer*)sender { uiimageview *imageview = [[uiimageview alloc] initwithframe:cgrectmake(0, 0, 200, 282)]; uiimage *wonimage = imagename.image; imageview.contentmode=uiviewcontentmodecenter; [imageview setimage:wonimage]; alertview = [[uialertview alloc] initwithtitle:@"" message:@"" delegate:self

d3.js - Forcing nodes to stick together within bubble force layout -

i have created force layout i'm happy with. nodes cluster nicely group (in below case country). working image as view them grouped other data variables move new centers expected. recentered image what isn't happening, i'd like, @ new center nodes cluster own type also, secondary level of attraction. i.e. in above image i'd @ each "age" center, nodes each country attracted each other rather being spread across age area. is possible? advice appreciated!! tia, martin

javascript - Highchart Download Multiple graph on individual page -

in highchart export,currently downloading multiple graphs in single page pdf,but want first graph on first page , second graph on second page(talking pdf). code available in below jsfiddle link click here jsfiddle here relevant answer, need implement in angular code. note : it not run directly here, have follow link because jquery should rander on document load, implement that . so, follow link : working fiddle highcharts.getsvg = function(charts) { var svgarr = [], top = 0, width = 0; $.each(charts, function(i, chart) { var svg = chart.getsvg(); svg = svg.replace('<svg', '<g transform="translate(0,' + top + ')" '); svg = svg.replace('</svg>', '</g>'); top += chart.chartheight; width = math.max(width, chart.chartwidth); svgarr.push(svg); }); return '<svg height="' + top + '" width="' + wi

javascript - Merge duplicate objects in single array using lodash -

i'm trying merge duplicate objects in json array received. the array looks this: { modules: [{ "name": "weazel", "otherprop": ["a", "b"] }, { "name": "weazel", "otherprop": ["c", "b"] }] } for reason can't figure out how merge duplicates. i have tried doing first mapping names lowercase , use unique, removes values otherprops. let result = _.map(json.modules, mod => { mod.name = mod.name.tolower(); return mod; }); result = _.unique(result, 'name'); is there knows how can tackle issue using lodash? var result = _.uniq(json.modules, function(item, key, a) { return item.a; }); //result : [{"name":"weazel","otherprop":["a","b"]}]

c# - ModelState isvalid return false when using querystring -

i new mvc application , need pass vule 1 page page , have used query string using code @url.action("create", "valuemapping",new { templateid =viewbag.templateid} and retriving velue in controller. problem in controller model.isvalid returning false after passing query string. why happenning , way out this. action code parametrs below public actionresult create([bind(include = "valuemappingid,valuemappingtypeid,templateid,usefor,sourcevalue,destinationvalue,orgappsyncid,isactive,createdon,lastupdatedon")] valuemapping valuemapping) {} thanks utpal maity is url.action being used action attribute of form? i'm assuming so, simple link not going include data model need valid. i'm assuming templateid required value, because that's thing makes sense. if you're doing post, query strings out. post body source of data post request. add hidden field store template id: @html.hidden("templateid", viewbag.templatei

javascript - getting row index of a specified row using java script -

i want rowindex of passed row number. tried using rowindex[2]. dont it. here code. please me. in advance.. <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <!-- jquery --> </head> <body> <div id="main"> <button onclick = "replacecontent('tabledata')"> click load </button> <table id="tabledata"> </table> </div> <script> function replacecontent(tableid) { var targetdiv = $('#' + tableid).closest("div").prop("id"); var content = "<table> <tr> <td> one</td></tr><tr> <td> one</td></tr><tr> <td> one</td></tr><tr> <td> one</

java - Scons Build performance for C++ in large code base -

we have been working on our project scons build system few years. scons awesome , has improved our development process lot. there ~15000 c++ source files , project evolves source files in other languages(java/scala) added code base well. developed our own builders manage dependencies , invoke external tool(javac, scalac) build sources, works well. working on optimization of current build system , found performance difference between c++ , java build process: environment setup: build server 24 cores, python 2.7.3, scons 2.2.0 command: scons --duplicate=soft-copy -j8 when building java code, cpu usage high observed top , spanning multiple cores: java build however, when building c++ code, cpu usage ~4% , running on 1 core no matter how many jobs in scons : c++ build i've been googling lot on internet not find useful. hitting gil issue in python? believe each gcc/g++ command should ran in separate sub-process javac in our own builders, there should not gil here. there w

javascript - You tube video api, stop a video -

how make work more 1 video , got work 1 video include: <script type="text/javascript" src="http://www.youtube.com/player_api"></script> add youtube iframe: <iframe id="player" src="http://www.youtube.com/embed/yourid?rel=0&wmode=opaque&enablejsapi=1" frameborder="0"></iframe> magic time: <script> var player; function onyoutubeplayerapiready() { player = new yt.player('player'); } // on jquery event or whatever call play or stop on video. // play player.playvideo(); // stop player.stopvideo(); </script>

java - How to apply the search in list type field in dynamodb? -

we using $all in mongodb repository below: @query(value = "{ 'subscriptions' : {$all : ?0 }}") public list<contentitem> findbysubscription(string[] subscriptioncode); it works mongo need alternative in dynamodb the below solution uses aws sdk dynamodb . currently, think there community version of spring data available dynamodb. so, have provided solution using aws sdk . queryspec class the contains comparison operator can used search values in list data type. contains supported lists: when evaluating "a contains b", "a" can list; however, "b" cannot set, map, or list. example:- queryspec queryspec = new queryspec(); queryspec.withkeyconditionexpression("yearkey = :yearval , title = :title") .withfilterexpression("contains (subscriptions, :subscriptions)") .withvaluemap( new valuemap().withnumber(":yearval", yearke

Scala What is this "_1" in type? -

i understand error: found : row.type (with underlying type _#tableelementtype) required: _1#tableelementtype looks close, "1" in _1#tableelementtype ? can convert 1 in other? edit : useful bits of codes context (play + slick): abstract class genericdao[t <: abstracttable[_]](...) { def table: tablequery[t] def insert(model: t#tableelementtype) = db run (table += model) } trait tableobject[t <: abstracttable[_]] { def rowfromjson(jsobject: jsobject): t#tableelementtype def dao(driver: jdbcprofile, db: database): genericdao[t] } // controller action instance implementing `tableobject` above: val tableobject = tableobjectfactory("test") val row = tableobject.rowfromjson(request.body.asjson.get) val dao = tableobject.dao(driver, db) // tableobject has doa extending genericdao dao.insert(row) example of tableobject : object testtable extends tableobject[test] { def dao(driver: jdbcprofile, db: database) = new testdao(driver, db) def

html - Echoing PHP API Data In 3 Columns -

i getting website design ideas website api. currently setup displays these designs in table 1 column, have on 40 items need displayed in table, id prefer display in 3 columns. have tried using i=0 ++ things etc couldnt work out put it. here code far: <?php $output = json_decode($output); curl_close($ch); echo '<table border="1">'; foreach($output $template) { echo '<tr>'; echo '<td>' . $template->template_name . '</td>'; echo '</tr>' . '<tr>'; echo '<td><a href="'. $template->preview_url .'" target="_blank"><img src="' . $template->thumbnail_url. '"></a>' . '</td>'; echo '<tr>'; echo '<td><form method="get" action=' . $_server['php_self'] . '>';

vb.net - Excel Export exporting same row multiple times -

Image
i've written export procedure vb.net application, exports data displayed in datagridview into excel spreadsheet. however, instead of copying 23 of rows in datagridview , copies same one, 23 times. wrong below for loop that means copies 1 record? for = 0 dgvexport.rowcount - 1 j = 0 dgvexport.columncount - 1 k integer = 1 dgvexport.columns.count xlworksheet.cells(1, k) = dgvexport.columns(k - 1).headertext xlworksheet.cells(i + 2, j + 1) = dgvexport(j, 1).value.tostring next next next i need field names copied, hence headertext line , k variable. a snippet of dgv, show there different records; the resultant export; edit as suggested, changed code following k integer = 1 dgvexport.columns.count xlworksheet.cells(1, k) = dgvexport.columns(k - 1).headertext next = 0 dgvexport.rowcount - 1 j = 0 dgvexport.columncount - 1 xlworksheet.cells(i + 3, j + 1) = dgvexport(j, i).value.tostring next next but error object reference not

merge lists in python adding elements repeated -

i have question, have 2 files, each of them have 2 columns, 1 t , second column function depending on t. want merge them, , write them both in output file, using following (for reason using t = t1+t2 didn't work , that's why i'm using extend). t1 = column1_of_file1 y1 = column2_of_file1 t2 = column1_of_file2 y2 = column2_of_file2 total_t = [] total_y = [] total_t.extend(t1) total_t.extend(t2) total_y.extend(y1) total_y.extend(y2) the problem have there elements in t1 same ones of t2. t1 starts 1 , finishes in 4, i'm listing below last 7 elements of both columns: # t1 y1 ... ... 3.76 -25.8529 3.80 -25.8474 3.84 -25.8422 3.88 -25.8356 3.92 -25.8286 3.96 -25.8133 4.00 -25.7997 and t2 starts values 3.80 , runs 8, corresponding values y2 different: #t2 y2 3.80 -25.7331 3.84 -25.0383 3.88 -24.4059 3.92 -23.8288 3.96 -23.3027 4.00 -22.8242 4.04 -22.3917 ... ... what want

heroku - which one is more reliable in php ftp_connect vs file_put_content(ftp://) -

in php restful api running on heroku dyno, since api accept user upload files view ($_files) -form post- need forward uploaded files ftp server persist them since heroku not have storage. i googled around find best way achieve , found 2 methods code example show both methods // common code: $tmp_file_path = $_files['image']['tmp_name']; $raw_filename = explode('.',$_files['image']['name']); $extention = array_pop($raw_filename); $filename = md5(implode('.',$raw_filename)).$extention; // 1st: ftp_put_content; $content = file_get_contents($tmp_file_path); // additional stream required per http://php.net/manual/en/function.file-put-contents.php#96217 $stream = stream_context_create(['ftp' => ['overwrite' => true]]); $upload_success = file_put_content('ftp://username:password@ftpserver.com/'+$filename, $content, 0, $stream); // 2nd: ftp_put $conn_id = ftp_connect("ftp.simpleinformatics.com"

rspec - Skip Unit Tests -Arcanist -

we (the royal we) have number of unit tests (several thousand). still dependent on external services because when written, service dependencies not stubbed out. vcr used way triage this. i spending time cleaning these old tests (consider zen exercise) , have handful of working branches (each branch constitutes test suite specific component[model/controller/etc.. ]. want able disable unit tests vast number (~100) test files still dependent on external services i able achieve adding --nounit command line arg

c# - Could not find a base address that matches scheme https for the endpoint with binding BasicHttpBinding. Registered base address schemes are [http] -

again 1 of questions. i've searched in every other question, dont me solution. i don't know if maybe dont understand concept of these "a-b-c"-story of iis. <system.servicemodel> <diagnostics> <messagelogging logentiremessage="true" logknownpii="true" logmalformedmessages="true" logmessagesatservicelevel="true" logmessagesattransportlevel="true" /> <endtoendtracing propagateactivity="true" activitytracing="true" messageflowtracing="true" /> </diagnostics> <services> <service name="mearestservice" behaviorconfiguration="httpsbehavior"> <endpoint address="mearestservice.svc" binding="basichttpbinding" bindingconfiguration="serviceendpoint" behaviorconfiguration="web" contract="imearestservice" /> <endpoint address="mex" binding="mex

Running only single changed test file using Karma with Webpack -

i've got working karma setup, using webpack. whenever modify either test file or of dependencies, all of tests run. good, i'd run minimum number of tests . if change test file, should run test file. if change source file, should run whatever test files have source file dependency (via require ). here's relevant portion of karma.config.js : files: [ { pattern: '**/*.test.js', watched: true, included: true, served: true }, ], preprocessors: { '**/*.test.js': ['webpack'] }, webpack: { resolve: { root: path.join(__dirname, '..', 'webpack'), extensions: ['', '.js', '.jsx'], }, module: { loaders: [ { test: /.jsx?$/, loader: 'babel-loader', exclude: [/node_modules/], query: { presets: ['es2015', 'react'] } }, ] }, }, the complete karma.config.js file in gist . i'm fam

instagram - receiving a list of all the people who done like a special picture -

i want receiving list of people done special picture ,but can't . use url: https://api.instagram.com/v1/media/{media-id}/likes?access_token=access-token but result of using url receive json : {"meta": {"code": 200}, "data": []} ََand if liked photo registered case {"meta": {"code": 200}, "data": [{"username": "hamed.m1997", "profile_picture": "https://igcdn-photos-h-a.akamaihd.net/hphotos-ak-xat1/t51.2885-19/s150x150/14712441_723099691174703_691272611174285312_a.jpg", "id": "1522131692", "full_name": "hamed mansouri"}]} thanks ,for help when application in sandbox mode can information , sandbox users. https://www.instagram.com/developer/sandbox/

java - Libgdx reset checked state of a button programatically -

i have 2 buttons (a & b) , i'm trying have code such when click on button click on b, resets normal state(released). each of buttons has 3 states: up, down , checked. if (one_h.ispressed()) { //reset button 2 if pressed two_h.getstyle().up = menuskin10.getdrawable("200 released"); two_h.getstyle().down = menuskin10.getdrawable("200 pressed"); two_h.getstyle().checked = menuskin10.getdrawable("200 gray"); } else if (two_h.ispressed()) { //reset button 1 got ! buttons in libgdx have toggle() state. in case... if (buttona.ispressed()) { if (buttonb.ischecked()) { buttonb.toggle(); //reset normal state } }

http - Pass values for subscription in URL for epay -

now pass parameters creating subscription in epay this: <script charset="utf-8" src="https://ssl.ditonlinebetalingssystem.dk/integration/ewindow/paymentwindow.js" type="text/javascript"></script> <script type="text/javascript"> paymentwindow = new paymentwindow({ 'merchantnumber': "xxxxxx", 'amount': "100", 'currency': "usd", 'subscription': "1", 'recurring': '{"subscription":{"emailaddress":"test@test.com"},"recurringplanlist":[{"recurringplanid":1}]}' }); </script> how can transfer url, this: < href="https://ssl.ditonlinebetalingssystem.dk/integration/ewindow/default.aspx?merchantnumber=xxxxxx&amount=100&currency=usd&windowstate=3">go payment< /a>

generics - Any way to have some type parameters inferred from other type parameters' constraints in C#? -

suppose have following code: interface iwidget { } interface iwidgetfactory<twidget> twidget : iwidget { } twidgetfactory createfactory<twidgetfactory, twidget>() twidgetfactory : iwidgetfactory<twidget> twidget : iwidget { return ... } whenever call createfactory() must pass in both twidgetfactory , twidget type parameters. seems unnecessary, because twidgetfactory has constraint such specialisation of must specify twidget. there way can have twidget inferred automatically when calling createfactory() , if must add kind of helper methods it? (the above simple example, can more complicated in practice, save lot of complexity.) without seeing body of createfactory , difficult tell you're doing. based on return type, suspect createfactory doesn't use twidget type parameter interface. in case, relax generic constraints bit? interface iwidget { } interface iwidgetfactory {} // new non-generic base interface interface iwi

xml - XPath to get node name based on existence of child node -

i have following nodes: <resource> <datafield1> <label>...</label> <alert>...</alert> </datafield1> <datafield2> <label>...</label> </datafield2> <datafield3> <label>...</label> <alert>...</alert> </datafield3> </resource> and show name of 1st , 3rd node because exists child node "alert". datafield1 datafield3 with following xpath can show nodes: //resource/*[alert] result: <datafield1> <label>...</label> <alert>...</alert> </datafield1> <datafield3> <label>...</label> <alert>...</alert> </datafield3> but not want. you need add label : //resource/*[alert]/label

sql - Concatenated where clause -

i cant sql query update database activties table. query:- update activities set cjsid = cjsempnum.staffnumber cjsempnum activites.name = cjsempnum.surname + " " + cjsempnum.forename i think problem clause. in activities number name stored smith john , in cjsempnum stored in 2 seperate columns surname , forename. have tried making inner join? like... update set a.cjsid = cjsempnum.staffnumber cjsempnum inner join activities on a.name = cjsempnum.surname + ' ' + cjsempnum.forename

angularjs - Order JSON data in Angular (Ionic) -

i need ordering json in ng-repeat. want order data item.id (from highest lowest). tried many tips on internet maybe i'm doing wrong because none of them working me... code: $http.get('http://jastrzebieonline.pl/drogi/data/najnowsze.php') .success(function(res){ $scope.news = res; console.log("ok"); }) .error(function(data, status) { console.log("error"); }) <div ng-repeat="item in news"> <a href="{{ item.id }}"> <img src="{{ item.image }}"> <h2>{{ item.title }}</h2> <p>{{ item.date }}</p> <p>{{ item.text }}</p> </div> </a> </div> you can use orderby filter: <div ng-repeat="item in news | orderby:'id'"> <a href="{{ item.id }}"> <img src="{{ item.image }}"> <h2>{{ item.title }}</h2> <p

silverlight - using lightswitch how to adjust the dimension of the inner list in the student card? -

Image
i want adjust white area inside student card in application it's not cut. here screen structure here post render code. /// <reference path="~/generatedartifacts/viewmodel.js" /> myapp.browsestudentsset.searchstudentsset_postrender = function (element, contentitem) { // write code here. }; myapp.browsestudentsset.students_postrender = function (element, contentitem) { }; myapp.browsestudentsset.studentgroup_postrender = function (element, contentitem) { // write code here. $(element).addclass("student-name"); }; myapp.browsestudentsset.rows_postrender = function (element, contentitem) { // write code here. }; myapp.browsestudentsset.takecoursegroup_postrender = function (element, contentitem) { // write code here. $(element).addclass("course-name"); }; myapp.browsestudentsset.takestemplate_postrender = function (element, contentitem) { // write code here. $(element).addclass("course-list-name&quo

entity framework - ef-core - bool index vs historical table -

i´m using aspnet-core, ef-core sql server. have 'order' entity. i'm expecting orders table large , frequent query active orders customer (active orders tiny fraction of whole table) optimize speed of query can decide 2 approaches: 1) don't know if possible haven't done before, thinking creating boolean column named 'isactive' , make index when querying active orders faster. 2) when order becomes not active, move order table, i.e historicalorders, keeping orders table small. which of 2 have better results?, or none of solution , third approach suggested? before think new table historicalorders ,just create column name isactive , test data.you don't need make index column.b'cos indexes eat storage , slows down writes , updates.so must careful when create index.when query data shown below.on below query data selection (or filter) done on sql srever side ( iqueryable ).so fast. note : use asnotracking() too.it boost perfromnace to