Posts

Showing posts from April, 2014

ios - UITEXTFIELD InputView Uipicker not working in swift -

hello trying pop uipickerview view programmatically when user clicks on textfield. have tried doesn't doing anything. isn't working. nothing happening when click textfield class userprofiletableviewcontroller: uitableviewcontroller,uitextfielddelegate,uipickerviewdelegate,uipickerviewdatasource { var itempicker: uipickerview! = uipickerview() @iboutlet weak var gendertxtfield: uitextfield! var gender = ["male","female"] override func viewdidload() { super.viewdidload() gendertxtfield.delegate = self itempicker!.delegate = self itempicker!.datasource = self itempicker!.backgroundcolor = uicolor.blackcolor() self.gendertxtfield.inputview = itempicker } func numberofcomponentsinpickerview(pickerview: uipickerview) -> int{ return 1 } // returns # of rows in each component.. func pickerview(pickerview: uipickerview, numberofrowsincomponent component:

When the client open the webapp, how to restore his last state with router-ui? -

i use router-ui angular single page i hear $statechangesuccess event store in localstorage current state , params : $scope.$on('$statechangesuccess', function(event, tostate) { localstorage.laststate = tostate.name; localstorage.laststateparams = json.stringify($stateparams); }); my question : when client open webapp, want restore personnal last state can put code ? $state.go(localstorage.laststate, json.parse(localstorage.laststateparams)); // update put code in $statechangesuccess event : $scope.$on('$statechangesuccess', function(event, tostate) { if (tostate.name !== 'welcome') { localstorage.laststate = tostate.name; localstorage.laststateparams = json.stringify($stateparams); } if (tostate.name !== localstorage.laststate) { $state.go(localstorage.laststate, json.parse(localstorage.laststateparams)); } }); the problem solution process @ opening app : localhost (user open app) localhost/

web services - Can using free version of SOAP-UI we build a framework to maintain testcases -

i looking eclipse plug-in soapui . but, smartbear has stopped supporting plug-in. not able download plug-in in eclipse. source need use old version of eclipse indigo. moreover, datasource not available in soapui free version. is there way create framework in soapui free version using groovy scripts, can maintain test cases if changes in future. we focusing on rest api. i confused. suggestions/tutorials/links/ways highly appreciated.

Is there a way to add Julia, R and python to a single text file like R markdown or a notebook that could be manipulated as a text file? -

stated briefly: have text file can smoothly switch among r, python , julia. of importance, looking way run rather display code i know possible add python (and many other languages) r markdown http://goo.gl/4w8xib , not sure add julia. possible use notebooks beaker http://beakernotebook.com/ 3 languages (and more) , issue notebooks not fast manipulate compared can done text file in editor environment (sublime, emacs, vim, atom ...). know little notebooks, , ones know of represented json files, manipulating json file write report user friendly. i'm missing obvious, other way this? thanks with restructured text, there support including code samples , each code-block directive can include relevant language. .. code-block:: ruby ruby code. markdown also supports mentioning language each code block , e.g.: ```javascript var s = "javascript syntax highlighting"; alert(s); ``` ```python s = "python syntax highlighting" print s ``` ``` n

php - Eloquent logic refactor -

today came legacy code. have function generates long runtimes , occurs timeout @ our partner. function checks reserved seats @ theatre instead of data , check empty seats runs query every single seat. (i think) generates huge runtime. here correspondig code: public function printticketchaos(){ $input = input::all(); if( isset($input['date_id']) && !isset($input['reserve_id']) ){ $program_date = \model\programdate::find($input['date_id']); if($input['piece'] > $program_date->available_capacity){ //dd($input['piece'] . ' ??? ' . $program_date->available_capacity); return true; } $reserved_seats = session::get('reserved_seats'); if($reserved_seats != null && count($reserved_seats) > 0){ foreach ($reserved_seats $row => $seats) { foreach ($seats $key

swift - A way to inherit from multiple classes -

i have 2 classes want use in new class. first 1 implements swipe delete , second enables long press gesture: class deleteitem: uitableviewcell { } class opendetail: uitableviewcell { } since swift doesn't allow class inherit multiple classes following example won't work: class itemviewcell: deleteitem, opendetail { } so in order create itemviewcell , having both options, i'll have have 1 of classes inherit each other: class deleteitem: uitableviewcell { } class opendetail: deleteitem { } class itemviewcell: opendetail { } the problem is, if want long press gesture i'll have create new class without inheriting deleteitem . there better way of doing this? this perfect case using protocols , protocol extension. swift protocol interface in java example. protocol can define set of functions has implemented entities want conform protocol, protocol can define properties has present in these entities too. example: protocol itemdeleter { var del

xaml - How to detect hitting the bottom of a grid within a scrollview in Xamarin Forms -

i using xamarin.forms display items websource in grid (within scrollview). when user hits bottom of grid, want load more items , add them grid. know listview preferred displaying data in fashion (and listview has itemappearing event) sadly have use grid. if helps, post code, im not sure if necessary here. thanks in advance edit: here boring layout file: <?xml version="1.0" encoding="utf-8" ?> <contentpage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:class="myproject.mynamespace.layoutname" sizechanged="onpagesizechanged"> <scrollview > <absolutelayout x:name="mylayout"> <grid x:name="gridforitems" rowspacing="6" columnspacing="6"> </grid> </absolutelayout> </scrollview> </contentpage> i add rows, colum

methods - Is Java "pass-by-reference" or "pass-by-value"? -

i thought java pass-by-reference ; i've seen couple of blog posts (for example, this blog ) claim it's not. don't think understand distinction they're making. what explanation? java pass-by-value . unfortunately, decided call location of object "reference". when pass value of object, passing reference it. confusing beginners. it goes this: public static void main( string[] args ) { dog adog = new dog("max"); // pass object foo foo(adog); // adog variable still pointing "max" dog when foo(...) returns adog.getname().equals("max"); // true, java passes value adog.getname().equals("fifi"); // false } public static void foo(dog d) { d.getname().equals("max"); // true // change d inside of foo() point new dog instance "fifi" d = new dog("fifi"); d.getname().equals("fifi"); // true } in example adog.getname() still retur

linux - Perl anonymous pipe no output -

question why nothing printed when using anonymous pipe, unless print actual data pipe ? example use strict; use warnings; $child_process_id = 0; $vmstat_command = 'vmstat 7|'; $child_process_id = open(vmstat, $vmstat_command) || die "error when executing \"$vmstat_command\": $!"; while (<vmstat>) { print "hi" ; } close vmstat or die "bad command: $! $?"; appears hang use strict; use warnings; $child_process_id = 0; $vmstat_command = 'vmstat 7|'; $child_process_id = open(vmstat, $vmstat_command) || die "error when executing \"$vmstat_command\": $!"; while (<vmstat>) { print "hi" . $_ ; # ^^^ added } close vmstat or die "bad command: $! $?"; prints hiprocs -----------memory---------- ---swap-- -----io---- -system-- -----cpu------ hi r b swpd free buff cache si bi bo in cs sy id wa st hi 1 0 0 7264836 144

ios - Graph API not returning all tagged in photos -

so when query graph api this get /v2.5/me/photos it returns 9 of tagged in photos. of them 1 have been uploaded me. on facebook account have many more photos in tagged. test done in graph api explorer user_photos permission token. the primary place using in ios app using fb ios sdk. used work expected, returning tagged in photos. changed when upgraded fb ios sdk version 4. have feeling doing may have bumped apps minimum graph api version in apps dashboard. , in position can't retrieve tagged in photos. app has been approved user_photos permission. any appreciated! thanks @vizllx providing link answer enabled me work out. the linked answer suggests using additional user permission. permission didn't have effect lead me try turning on , accepting permissions worked! disabled them again , went through , figured out had effect. turns out user_friends permission! so tagged in photo not uploaded user querying, there 2 conditions: the user querying has have

Odoo can't transfer (stock move) from different locations -

hello i'm trying make delivery (outgoing stock move) different locations (all internal locations), gives me error: the source location must same moves of picking. the locations are, wh/stock/01 , wh/stock/02. both internal locations , stock view location. actually basic concept of odoo 1 picking have many product move-lines , restriction source , destination both same if not follow got en error. if want change flow can through stock module , in stock module have 1 method "_prepare_pack_ops", customise it. thank you

c# - Unable to insert multiple imagepaths into single database row asp.net -

id upload files , insert filepaths database, unfortunately adds first record. public actionresult create(list<httppostedfilebase> files, image img) { try { transportimages(files); int = 0; foreach (var x in imagepaths) { image _img = new image(); _img.img = imagepaths.elementat(i++); _pictures.images.add(_img); } if (i == imagepaths.count()) { _pictures.entry(img).state = entitystate.modified; _pictures.savechanges(); imagepaths.clear(); return view(); } return view(); } here populate imagepaths list, later should inserted database. private void transportimages(list<httppostedfilebase> images) { if (images.count() > 0) { foreach (httppostedfilebase img in images) {

endeca - Oracle Commerce 11.2 experience manager does not load -

Image
i have installed latest version(11.2) of oracle endeca commerce. deploy application , works fine except when click on experience manager icon, starts loading content never finishes. i tried reinstall components again , again no result. any suggestions appreciated. thanks. this issue related adobe flash player installation. getting same issue in mozilla , chrome ie 10 worked fine. try switching browser , see. issue nothing endeca installation or logs.

java - JOOQ generated pojo missing GeneratedValue annotation -

i'm using jooq generate pojo h2 db table create table public.abc ( id bigint auto_increment primary key, trade_date date, stk_code varchar(63), remarks text, timestamp timestamp not null ); but generated code (below) { ... @id @column(name = "id", unique = true, nullable = false, precision = 19) public long getid() { return this.id; } ... } is missing @generatedvalue annotation makes impossible insert new record spring data rest repository since passed in object complain id field not being set. what config/work around can jooq working properly? below relevant pom file section used generate pojo @ compile time: <plugin> <groupid>org.jooq</groupid> <artifactid>jooq-codegen-maven</artifactid> <executions> <execution> <goals> <goal>generate</goal> </goals> </

html - Centre an Icon within a div - Bootstrap 3 & Font Awesome -

i have simple bootstrap grid row displaying text in 1 column , stacked font-awesome icon set in column. issue i'm having icon-set not vertically aligned in middle of div, text is . can see icon more aligned top of div. there way center align this? i've created fiddle here , re-posted code below: html: <div class="container-fluid"> <div class="row posted-content"> <div class="col-md-10"> <h4 class="text-primary pull-left">hey, text</h4> </div> <div class="col-md-2 comment-count pull-right"> <a class="fa-stack comment-action"> <i class="fa fa-comment-o fa-fw fa-stack-2x"></i> <i class="fa fa-stack-1x">5</i> </a> </div> </div> </div> css: .posted-content { border-radius: 4px; border-color: #e7e7e7; border: 1px solid rgba(0, 0, 0, 0.1)

The type name does not exist in the type c# within InitializeComponent() -

i stuck on error, problem whenever try add object datagrid form , link sql database able preview data fine. upon compiling getting above error the type not exit in type - when double click on error takes me initializecomponent() method. here sample of code error occurring : this.wordsdataset = new spellingapplication.wordsdataset(); this.wordlisttableadapter = new wordapplication.wordsdatasettableadapters.wordlisttableadapter(); so doing @ stage selecting object datagrid toolbox placing on form , linking object sql via small arrow , able preview data , error when compiling. i have read stack overflow threads , unable correct problem within project properties application set .net framework 4.5 , build application target @ x64 per suggested of treads on here. any appreciated , if can clarify answer in simple terms / provide step step instructions appreciated newbie c# / vs2015 hi guys have fix error thanks tread the type name 'datasettableadapters'

haxe - Flashdevelop / HaxePunk: Build halted with errors -

i've been trying follow this tutorial started haxepunk. using flashdevelop , have got trying run program after adding logo.png. however, when run program following output: running process: c:\program files (x86)\flashdevelop\tools\fdbuild\fdbuild.exe "d:\haxe projects\prj_starting\prj_starting.hxproj" -ipc f201d2c5-2ffe-46d4-bb54-c67a3e34ab4a -version "3.2.1" -compiler "c:\program files\haxetoolkit\haxe" -library "c:\program files (x86)\flashdevelop\library" -target "neko" building prj_starting running pre-build command line... cmd: "c:\program files\haxetoolkit\haxe/haxelib" run lime build "project.xml" neko -debug -dfdb [file_contents,c:\program files\haxetoolkit\haxe\lib\lime//.current] build halted errors. done(1) no error specific error given unsure wrong. have followed tutorial , these classes: main.hx import com.haxepunk.engine; import com.haxepunk.hxp; class main extends engine { overr

C#: Calling a php script and beeing able to stop it -

i working on c# program needs call local php script , write output file. problem is, need able stop execution of script. first, tried call cmd.exe , let cmd write output file worked fine. found out, killing cmd process not stop php cli. so tried call php directly, redirect output , write c# code file. here problem seems be, the php cli not terminate when script done . process.waitforexit() not return, when sure script has been executed. i cannot set timeout waitforexit() , because depending on arguments, script may take 3 minutes or eg. 10 hours. i not want kill random php cli, there may others running. what best way call local php script c#, writing output file , beeing able stop execution? here current code: // create process var process = new system.diagnostics.process(); process.enableraisingevents = true; process.startinfo.useshellexecute = false; process.startinfo.filename = "php.exe"; // createexportscriptargument returns "file.php arg1 arg2 ...

java - Docx4j removing whitespaces -

when have org.docx4j.wml.text whitespace it's removed. r creater = wmlobjectfactory.creater(); text createtext2 = wmlobjectfactory.createtext(); createtext2.setspace("preserve"); createtext2.setvalue(" "); creater.getcontent().add(createtext2); p.getcontent().add(toaddindex, creater); the create text value "{space}", isn't added docx file createtext2.setspace("preserve");

sql server - Connect to SQLServer using Firemonkey -

i want connect mssqlserver insert or update data firemonkey android app , i'm using delphi xe8. there way default component? not using other component. im using remote server on id address. thank in advanced. jan, normally, don't access remote database directly device in desktop applications. i suggest request webservice, include parameters insert/update , webservice job you. i hope helps!

playframework - Play migration to 2.4.0 giving sbt.IncompatiblePluginsException: Binary incompatibility in plugins -

i have project has been migrated play 2.2.1 play 2.3.0 when try migrate play 2.4.0, getting below error. [error] sbt.incompatiblepluginsexception: binary incompatibility in plugins dete cted. [error] note conflicts resolved dependencies: [error] org.apache.commons:commons-compress [error] org.tukaani:xz [error] com.google.guava:guava [error] com.typesafe:config [error] org.slf4j:slf4j-api [error] org.fusesource.leveldbjni:leveldbjni [error] com.typesafe:jse_2.10 [error] com.typesafe.sbt:sbt-js-engine [error] com.typesafe.sbt:sbt-web [error] org.javassist:javassist not able resolve it.

cordova - Going back to previous page works in simulator not on iOS device jquerymobile -

i changing page method $.mobile.changepage("preview.html", { transition : "slide", role : "page", changehash:true }); this how preview page looks like <div data-role="page" data-name="preview" class="prew"> <div data-role="content"> //content </div> </div> now when touch screen have go previous page. so created function $('.prew').live('tap', function() { alert('clicked'); history.go(-1);//<--this works in simulator not in device. //window.history.back() ;//<--this works in simulator not on device. //navigator.app.backhistory();<--this works fine on android not on ios. }); edit: have used plugin called photoswipe causes issue . history.go(-1),history.back() or data-rel="back" works fine on other pages.

javascript - Less to css via node script -

found solution see bottom of post trying build less (less css) using build script nodejs i trying build css file less using node script, file structure cannot change , like: /public/css/app.css /resources/assets/less/xenon.less /quicksync/02_lesscompiler.js the contents of less file include other less files same level , onward in filstructure .less file itself, eg: // import bootstrap variables & mixins @import "bs-less/variables.less"; @import "bs-less/mixins.less"; // lesshat @import "other-less/lesshat.less"; ... etc etc from above link tried following: var less = require( 'less' ); var fs = require( 'fs' ); var path = require('path'); var basepath = __dirname + '/..'; var lesspath = basepath + '/resources/assets/less/xenon.less', outputpath = basepath + '/public/css/app.css'; fs.readfile( lesspath ,function(error,data){ data = data.tostring(); console.log( error );

javascript - Iterate Json ResponseText in Coffeescript -

my coffeescript errorlist = @state.errors.responsetext own key, value of errorlist console.log "#{key} -> #{value}" my errorlist variable= {"link":["is invalid"]} when run code, in output iterate each char in errorlist. how can "link -> invalid" ? it seems responsetext property string, isn't yet iterable object. convert (valid) json string object can iterate, should call json.parse. the following should work in case errorlist = json.parse @state.errors.responsetext own key, value of errorlist console.log "#{key} -> #{value}" output: link -> invalid

javascript - Configure globalize.js to use CLDR for validating decimal numbers -

i need validate decimal numbers in serbian culture (a decimal separator comma instead of dot). i looking on internet find solution , posts suggest use globalize.js. can set work me. here code: <script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script> <script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script> <script src="~/lib/cldrjs/dist/cldr.js"></script> <script src="~/lib/cldrjs/dist/cldr/event.js"></script> <script src="~/lib/cldrjs/dist/cldr/supplemental.js"></script> <script src="~/lib/globalize/dist/globalize.js"></script> <script src="~/lib/globalize/dist/globalize/number.js"></script> <script> $.when( $.get("/lib/cldr-data/supplemental/likelysubtags.json"), $.get("/lib/cldr-data/main/sr/numbers.json"), $.get("/lib/cldr-data/

c# - ASP.Net WebAPI app post data always null for json -

despite of including jsonformatter in global.asax file, post method not parse json data model , showing null. var jsonformatter = config.formatters.oftype<jsonmediatypeformatter>().first(); jsonformatter.usedatacontractjsonserializer = true; i using fiddler post data , below raw request: post http://localhost:50121/api/store http/1.1 user-agent: fiddler host: localhost:50121 content-type: "application/json" content-length: 84 {”quantity”:"4",“imagepath”:”http://localhost/”,“price”:"20.00"} model: namespace storebackend.models { public class subcategory { public string quantity { get; set; } public string imagepath { get; set; } public string price { get; set; } } } the post method is: public httpresponsemessage post(subcategory products) { var database = productsclient.getdatabase("test"); //imongocollection<subcategory> collection = database.g

php - Heroku - Push rejected on Laravel 4.2 project Mcrypt error -

i 'm trying upload project laravel 4.2, using buildpack https://github.com/heroku/heroku-buildpack-php , following output. counting objects: 88, done. delta compression using 4 threads. compressing objects: 100% (74/74), done. writing objects: 100% (88/88), 1010.88 kib | 0 bytes/s, done. total 88 (delta 8), reused 0 (delta 0) remote: compressing source files... done. remote: building source: remote: remote: -----> using set buildpack heroku/php remote: -----> php app detected remote: remote: ! warning: 'composer.lock' not date latest remote: changes in 'composer.json'. ensure not getting stale remote: dependencies, run 'composer update' on machine , commit remote: changes git before pushing again. remote: remote: -----> bootstrapping... remote: -----> installing system packages... remote: notice: no runtime required in composer.json; requirements remote: dependencies in composer.lock used selectio

How to combine two datasets in R with same number of rows but different columns without any join condition? -

suppose have 2 datasets: d1: b c 1 0 2 4 2 1 2 3 3 2 1 0 d2: d e 1 3 8 2 1 5 3 2 7 i want have data set combination of 2 should look: b c d e 1 0 2 4 3 8 2 1 2 3 1 5 3 2 1 0 2 7 i've tried merge cross joins them making 3*3. we can use cbind do.call(cbind, list(d1, d2)) or using dplyr library(dplyr) bind_cols(d1, d2)

Php uploading image to server in android -

im using php script allows choose image gallery , upload online web hosting service. image gets uploaded, .jpg file uploaded empty , named 0.jpg , size shown 0 bytes. when try open image shows "the image http://testimage.site88.net/pic/0.jpg cannot displayed because contains errors" what possible reason this? php code follows <?php $name = $_post['name']; //image name $image = $_post['image']; //image in string format //decode image $decodedimage = base64_decode($image); //upload image file_put_contents("pic/".$name.".jpg", $decodedimage); the android code is: import android.app.activity; import android.content.intent; import android.graphics.bitmap; import android.graphics.drawable.bitmapdrawable; import android.net.uri; import android.os.asynctask; import android.os.bundle; import android.provider.mediastore; import android.util.base64; import android.util.log; import android.view.view; i

php echo html and php code -

how can add line of code in <a href='/<?=$value["content_url"];?>' class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true"><?=$value["content_title"];?><span class="caret"></span></a> so this: if (1 == 1) { echo "<a href='/<?=$value["content_url"];?>' class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true"> <?=$value["content_title"];?> <span class="caret"></span></a>"; } else { echo "nothing see!" } because have multiple punctuations end echo quick.. format string properly. updated string. if (1 == 1) { echo "<a href=\"$value[content_url]\" class=\"

javascript - EventSource Polyfill -

i have created self-hosted servicestack service runs in windows service based on showcase chat application . however, not getting further trying write client javascript (using aurelia skeleton) app opposed servicestack.razor application. i have added eventsource polyfill application. however, when import eventsource js file want use eventsource library following exception: error [app-router] error: unable property 'xmlhttprequest' of undefined or null reference error loading http://localhost:9000/dist/chats.js it failing on following line in eventsource.js: var xhr = global.xmlhttprequest; so, having had communication creator of servicestack have added reference ss-utils (which in turn uses eventsource.js). has rectified problem.

java - eclipse Mars : Debug my own framework in an existing project -

i assume question asked many times, couldn't find answer works current situation : developed framework in location develop project in location b. second project uses framework. how can debug project using framework breakpoints in last one? tried : import framework existing project in eclipse of project, can't connect both. create link source in java build path of project. works, since can automatically add imports references framework. however, strange reason, although import added eclipse, doesn't recognize afterwards (import cannot resolved). what don't want (for process reasons) : generate jar framework debugging information. many thanks basically, imported framework in new project, when error appears, open class, click on "attach source" button , select correct framework.

static - Creating pages from html -

i trying print pdf, , each page needs have footer. thinking whether define static table: -------- |_______| | | | | |_______| |_______| the bottom part , top part static , contain header , footer. middle part must dynamic , filled in using actionscript. when end of middle cell reached stuff put in, want create whole new static table. is possible somehow? this may idea create static table content. can fetch data , insert this. need make unique id each page.

fluid - Expanding the fluid_styled_content menu in TYPO3 7 -

i looking way expand fluid_styled_content menu in typo3 7, , not sure how proceed. example type1 menu has following code: <ce:menu.directory pageuids="{pageuids}" as="pages"> <f:if condition="{pages}"> <ul class="ce-menu ce-menu-1"> <f:for each="{pages}" as="page"> <li> <f:link.page pageuid="{page.uid}"> {page.title} </f:link.page> </li> </f:for> </ul> </f:if> </ce:menu.directory> now i'm looking way expand menu shows subpages when available. if page has subpages, show list subpages (as nested ul tree). how can done fluid? i not know view helper using ( <ce:menu.directory /> ). guess takes list of page uid´s , gets there children (menu.directory) , put them array/objectstorage ( {pages} ) - create array of selected pa

c# - Is it possible to get SLAB working with Microsoft.Diagnostics.Tracing.EventSource? -

the official release notes say: improved compatibility eventsource nuget package slab's source must updated , rebuilt work eventsource nuget package (which supports channels, not support sampling). process painless. added references eventsource nuget package projects changed system.diagnostics.tracing microsoft.diagnostics.tracing in source files defined event_source_package constant in unit test project (to disable tests cannot possibly work nuget version). this bit cryptic. seems backwards because can't see references @ microsoft.diagnostics.tracing in nuget download. or sub-bullets things have build (so should say, add, change, define instead of added, changed, defined)? hm, instructions (if instructions) not sufficient: there 3 places microsoft.diagnostics.tracing referenced, gives duplicate warnings there multiple places ambiguities appear between microsoft.practices.enterpriselibrary.semanticlogging.etw.configuratio

google spreadsheet - import data from sheet to another -

hi have spreadsheet file contains names of books @ column , type of books in column b. , @ same file have sheets each 1 contains specific type of books ex: sheet 2 contains history booksk sheet 3 contains science ..etc my question : how import books sheet1 (which contains books) other sheets dependeing on type name (take sheet 1 sheet 2 books type history) i tried formula: =query(importrange("sheet key","sheet1!a:c"),(select* column(b) contains"history")) doesn't work ...... either =filter(books!a:b, books!b:b = "novel") or =query(books!a1:b, "where b = 'novel'") will work.

plot - Gnuplot: Plotting different colors to each point using xticlabels and linepoints -

i'm trying plot graph linepoints , first column string , need use xticlabels plot data second column related it. this data file, third column wish use set point color "0000" 0 0 "0001" 9 0 "0010" 16 0 "0011" 25 1 "0100" 14 0 "0101" 23 0 "0110" 30 0 "0111" 39 1 "1000" 30 0 "1001" 39 0 "1010" 46 2 "1100" 44 0 i used: set palette defined (0 "blue", 1 "yellow", 2 "red") plot "data.dat" using 2:xticlabels(1) linespoints ls 1 notitle how can change command plot each point color use appropriate point color? thanks in advance if understand correctly, need: plot "data.dat" using 0:2:3:xticlabels(1) linespoints ls 1 lc palette notitle

dplyr - R: Quickly Performing Operations on Subsets of a Data Frame, then Re-aggregating the Result Without an Inner Function -

Image
we have large data frame df can split factors. on each subset of data frame created split, need perform operation increase number of rows of subset until it's length . afterwards, rbind subsets bigger version of df . is there way of doing without using inner function? let's our subset operation (in separate .r file) is: foo <- function(df) { magic } we've come few ways of doing this: 1) df <- split(df, factor) df <- lapply(df, foo) rbindlist(df) 2) assign('list.df', list(), envir=.globalenv) assign('i', 1, envir=.globalenv) dplyr::group_by(df, factor) dplyr::mutate(df, foo.list(df.col)) df <- rbindlist(list.df) rm('list.df', envir=.globalenv) rm('i', envir=.globalenv) (in separate file) foo.list <- function(df.cols) { magic; list.df[[i]] <<- magic.df <<- + 1 return(dummy) } the issue first approach time. lapply takes long desirable (on order of hour our data set). the is

php - How to output the response HTML data by a jQuery AJAX request? -

Image
i have online shop shopping cart. cart, <table> , refreshes content after adding article cart. use jquery's ajax method receives html <td><tr> response called php script. firebug's console shows correct response call. can see in code, want add html table . can't work. not understand ajax method? want add these <td><tr> shopping cart table. javascript (using jquery 1.9.1) $.ajax({ url: 'php/addtoshoppingcart.php', type: 'post', datatype: 'html', data: content, complete: function(data) { $('#shop section table tbody').append(data); }, }); firebug console have tried using .done()? $.ajax({ url: 'php/addtoshoppingcart.php', type: 'post', datatype: 'html', data: content, }).done(function ( data ) { $('#shop section table tbody').append(data); });

bash - Difference between chaining `test` and using an `if` statement -

is there difference between: [ -f $foo ] && do_something ...and: if [ -f $foo ]; do_something fi i thought equivalent, [ alias test , exits 0 when condition passes. however, in script have written, i'm checking whether environment variables set and, if not, bail out. in case: [ -z "${my_env1+x}" -a -z "${my_env2+x}" ] && fail "oh no!" ...always seems bail out; when $my_env1 , $my_env2 are set. however, if version works correctly: if [ -z "${my_env1+x}" -a -z "${my_env2+x}" ]; fail "oh no!" fi ...where fail defined as: fail() { >&2 echo "$@" exit 1 } i cannot diagnose source of problem answering question in title, difference between first && second , if first; second; fi know. if first evaluates true, there no difference. if first evaluates false, result of entire expression first && second false. if shell has -e flag set

selenium - JMeter with Webdriver Sampler - Browser window not opening -

i running jmeter webdriver plugin installed on windows 7. current test plan contains webdriver sampler , firefox driver config. when try run test plan, nothing happens. there nothing recorded in view results tree window, , remaining test indicator in top right hand corner counts down 0 without happening. when deactivate webdriver sampler , firefox driver config elements, remaining tests run without problem. is there bug software, or missing something? code below, if helps. var pkg = javaimporter(org.openqa.selenium) wds.sampleresult.samplestart() wds.browser.get(' https://test.test.test.test ') var username = wds.browser.findelement(pkg.by.id('username')).sendkeys([wds.args[0]]) var password = wds.browser.findelement(pkg.by.id('password')).sendkeys([wds.args[1]) wds.sampleresult.sampleend() i have installed firefox 26, recommended supported browser, it's not there's no compatible browser. my main ques

curl - How to force download of an .mp4 file by PHP headers from external url? -

i unable find answer regarding headers. have .mp4 file hosted on website a , force download using button on website b . possible without downloading file website b , serving user? i have pulled necessary data website b, in order download file, user needs right click save on button. here's use (php) $cf contains path file being requested. may want download script stored on server b makes happen , link script download .. http://link.to.script/script.php?file=thefilename.mp4'>download wouldn't put filename in url example. header('content-disposition: attachment; filename="' . basename($cf) . '"'); header("content-length: " . filesize($cf)); header("content-type: application/octet-stream"); readfile(realpath($cf));

How to use environment varialbe PROGRAMFILES(X86) in a GNU makefile? -

i try use environment variable programfiles(x86) of windows 7 inside gnu makefile without success. here minimal example: $(info dir: $(programfiles(x86))) nop: @echo x if execute makefile dir: ) x while expected: dir: c:\program files (x86) x any idea how use environment variable programfiles(x86) in gnu makefile? i using gnu make version 4.1 on cygwin (and version 3.81 on native windows). know that there , environment variable "programfiles", need "programfiles(x86)" etan came nice idea. did slight modification , thus, following works: b1 := ( b2 := ) $(info dir: $(programfiles$(b1)x86$(b2)) ) nop: @echo x however figured out more easy way: curly braces seem trick too: $(info dir: ${programfiles(x86)} ) nop: @echo x for both solutions important write programfiles(x86) instead of upper case programfiles(x86) .

java - Returning a String from a public String (...) class -

here code import java.io.*; import java.lang.*; import java.util.*; public class createfile { private formatter x; scanner keyboard = new scanner(system.in); string s1,s2,s3,s4,s5,s6; string aa,bb,cc,dd,ee,ff; public void openfile() { try { x = new formatter("password.txt"); }catch(exception e) { system.out.println("\nerror"); } } public void add(string s1,string s2,string s3,string s4,string s5,string s6) { bugatti v = new bugatti(); fw m = new fw(); fw2 s = new fw2(); fw3 eb = new fw3(); fw4 e = new fw4(); fw5 r = new fw5(); x.format("%s%s%s%s%s%s",aa,bb,cc,dd,ee,ff); } public void close() { x.close(); } } ok in file have returned aa bb cc dd ee ff , x.format not seeing that!!! have in fact returned in classes defined bugatti

node.js - Passportjs Facebook login flow (passport-facebook vs passport-token) -

Image
working node, express, , passport. okay, team , building rest api dual-sided marketplace type application. have set basic localstrategy email , password login. we want make api user-agent agnostic, can use api via web, android, or ios. but getting confused fb login flow. question is, goes on behind scenes in passportjs. have looked 'passport-facebook' , 'passport-facebook-token' strategies, , can't decide 1 go with. this current understanding of flow: if correct, better off having client access_token fb sending me, or letting fb handle via redirects , callback url? passport-token: passport.use('facebook-token', new facebooktokenstrategy( { clientid: 'xxx', clientsecret: 'xxx' }, function(accesstoken, refreshtoken, profile, done) { // asynchronous //console.log("into passport auth"); process.nexttick(function() { user.findone({'facebook.id': profile.id}, function(error, user)

Hide Jobs from Spring Batch Admin -

i hide jobs "job names registered" list on spring batch admin job's tab. i'm using old version, 'spring-batch-core-2.2.6.release' , 'spring-batch-admin-manager-1.3.0.release', , didn't find helpful on bean definition tag org/springframework/batch/core/configuration/xml/spring-batch-2.2.xsd so before doing 'dirty' things on controller or remove obj #list jobs, on jobs.ftl, unwanted jobs i'm asking i'm not still able find. many thanks the jobs listed come in jobregistry . default, spring batch admin uses automaticjobregistrar loads jobs in application contexts. however, in case, should able override bean ( jobloader ) in override configuration , provide own registrar loads jobs want. can read more overriding beans in spring batch admin in documentation here: http://docs.spring.io/spring-batch-admin/reference/reference.xhtml

c# - Azure mobile app offline sync causing a MobileServicePushFailedException -> CancelledByAuthenticationError -

as part of uwp app we're developing @ work, have azure mobile app (c#, .net backend) connected client supposed sync offline sqlite storage , place crud operation requests queue can processed worker role. trouble is, reason when attempt call pushasync/pullasync on sync context , messages table respectively, throws mobileservicepushfailedexception. when monitoring in locals, pushresult status "cancelledbyauthenticationerror" happens after logging in via 1 of providers, , haven't yet set table require authentication anyway shouldn't causing problems. interestingly enough, when mobile service opposed mobile app running in windows 8.1 project instead of uwp, worked fine, because mobileserviceclient constructor in version of nuget package takes application key 1 of arguments. unfortunately, we're developing uwp, needed migrated , can't use same constructor more. has come across before, or have idea might able find further information on this? haven'

Node.JS + SQL Server + MongoDB + Redis on cloud -

my typical requirement want nodejs application interacts sql server, mongodb , redis on cloud. since application using legacy database cannot replace sql server. nodejs + mongodb + redis supported on heroku. nodejs + mongodb + sql server supported on azure. (redis support there via vm) what recommendations using components together? in case, comes down decision, if need redis or not. while it's possible redis running on windows, or - mentioned - via vm (potentially running on same system, assume?). running natively on windows not supported, , judging few experiments, wouldn't recommend production-use either. if use redis session-storage, might put part on mongodb, , use azure-solution. if need redis else, might end scenario me: we're running node.js+redis+mongodb on linux, , mssql runs on separate windows-machine. connection node.js mssql done via odbc/freetds, performs requirements have (all other solutions in fact didn't work well). reason

sql server 2008 - How to change row color in datagridview by comparing two columns from different tables using vb.net? -

Image
no success! if user of tblcon billmonth of tbltrns exists in tbltrns highlight rows of tblcon red color code: private sub checkexist() each row datagridviewrow in datagridview1.rows conobj = new sqlconnection(constr) conobj.open() dim qry string = "select * tbltrns username=@username , bill_month=@bill_month" cmdobj = new sqlcommand(qry, conobj) cmdobj.parameters.addwithvalue("@bill_month", datetimepicker1.text) cmdobj.parameters.addwithvalue("@username", (row.cells("user").value.tostring)) drobj = cmdobj.executereader() if drobj.hasrows row.defaultcellstyle.backcolor = color.red end if next conobj.close() end sub query grid public function getdata() dataview conobj = new sqlconnection(constr) conobj.open() cmdobj = new sqlcommand dsobj = new dataset daobj = new sqldataadapter() dim selectqry = "select username

java - How to parse or load .obj file in JOGL? -

i'm trying load car object made 3ds max jogl program don't know how that. have searched online haven't gotten result. i tried this got no result. is there tutorial on how that? or how write own loader? or written class can use? here limited loader obj format written in java (but unfortunately using lower-level lwjgl instead of jogl) oskar veerhoek part of the coding universe website . pass file object references obj file class using either loadmodel(file f) method or loadtexturedmodel(file f) method. returned model object contains 3d model described obj file. should pass model object provided utility methods createtextureddisplaylist(model m) , createdisplaylist(model m) , or createvbo(model model) . return renderable vertex buffer object or display list can use part of render. note write own model renderable method if provided don't meet needs, highly recommend understanding/reading provided methods first. an alternative more full-featured t