Posts

Showing posts from May, 2014

amazon web services - Changing location of beforeInstall hook script throws "Script does not exist" error at beforeInstall step during deployment -

i had working setup begin with. following appspec.yml file - version: 0.0 os: linux files: - source: beforeinstall.php destination: /var/cake_1.2.0.6311-beta - source: beforeinstall.sh destination: /var/cake_1.2.0.6311-beta hooks: beforeinstall: - location: beforeinstall.sh note - copying beforeinstall.sh , php files because want copy changes made them propagated ec2 instances automatically (even though reflects in next build) at point, had beforeinstall.sh , php files @ location in ec2 instances - /var/cake_1.2.0.6311-beta/ then wanted move these inside deployment directory in ec2 instances. so, created files beforeinstall.sh , php manually, in /var/cake_1.2.0.6311-beta/deployment/ directory in instances , modified appspec.yml file - version: 0.0 os: linux files: - source: beforeinstall.php destination: /var/cake_1.2.0.6311-beta/deployment - source: beforeinstall.sh destination: /var/cake_1.2.0.6311-beta/deployment hooks: beforeinstall:

c# - Passing JSON from Javascript Callback in JINT -

i have library allows developer extend business rule triggers via javascript. there function allows developer (in javascript) subscribe event , pass delegate "call me when happens". i able successfully, running snag when function attempts pass json or javascript object c# layer. basically code functions unit test: func<string, jsvalue> callback = null; func<func<string, jsvalue>, object> registercallback = (o) => callback = o; engine engine = new engine() .setvalue("registercallback", registercallback) .execute("registercallback(function(parameter) { return { \"passed\": parameter }; });"); assert.isnotnull(callback); var result = callback("test"); i c# variable "result" have jsvalue or other object contains data method throws exception: must implement iconvertable on last line. i can verify "callback" set delegate of appropriate type: jint.native.jsvalue lambda_method(syste

hdfs - Scenarios possible in apache nifi -

i trying understand apache nifi in , out keeping files in hdfs , have various scenarios work on. please let me know feasibility of each explanations. adding few understanding each scenario. can check null value present in single column? have checked different processors, , found notnull property, think works on file names, not on columns present within file. can drop column present in hdfs using nifi transformations? can change column values in replace 1 text other? have checked replacetext property same. can delete row file system? please suggest possibilities , how achieve goal. try this: 1.can check null value present in single column? have checked different : yes using replace text processor can check , replace if want replace or use 'route on attribute' if want route based on null value condition. can drop column present in hdfs using nifi transformations? yes using same 'replacetext' processor can put desired fields delimiter used hav

Update database from selected datagridview selected value C# -

i wondering easier way update statement updating database datagridview selected row. i mean, have filled datagridview database values. now, want update values selected cell . my code is: oracleconnection conn = new oracleconnection(sb.tostring()); conn.open(); oracledataadapter sd = new oracledataadapter("select first_name,last_name,group,date person", conn); datatable table = new datatable(); sd.fill(table); datagridview1.datasource = table; conn.close(); filling datagridview works fine, want double click on selected cell , type new value, click enter , have value changed. possible?

javascript - How to track changes in form object in aurelia to activate revert button -

we using aurelia crate single page application creating/editing employee details. in edit employee form, need give functionality revert local changes if any. trick disable button if there no local changes i tried using computedfrom , observing properties , not complex object. here sample code - import {bindable, computedfrom} 'aurelia-framework' export class employee { @bindable employee @computedfrom('employee') enablerevert() { return true; } revert() { // revert functionality goes here } } thanks help! employee.html <button disabled.bind="!haschanged()">revert</button> employee.js attached() { object.assign(this.originalemployee, employee); } haschanged() { // @favio said, iterate on original copy of employee object. (let p in employee) { if (employee[p] !== this.originalemployee[p]) { return true; } } return false; }

Powershell Loop SQL Query -

two issues powershell code aware of , cannot solve. i identifying number of csv files within directory aiming import hash table 1 one , run sql query update original csv. the module in self have got working when not try run loop. i searching through directory , picking csv files name cash. i check imported file contains data , not blank record if ($check.client) { write-host "$($name) contains data" $files = get-childitem $location | where-object {$_ -like "*cash*csv"} at point (trying) running loop run same sql query on each item firstly doesn't seem working loop , secondly on export of compiled data getting error stating a positional parameter cannot found accepts argument '+' again sadly cannot see why there issue this? i throwing out there after severely smashing head against wall , re-interpreting 1000 different ways cannot solution work... ideas? $location = "l:\controls\bcr\" $files = get-childitem $loc

node.js - Multiple files output in fluent-ffmpeg -

is possible add multiple files input fluent-ffmpeg , output provided files..? edit 1: var commonpath = __dirname + '/path/to/file/'; ffmpeg() .input(commonpath + 'file1.mp4') .output(commonpath + 'newfile1.avi') .toformat('avi') .input(commonpath + 'file2.mp4') .output(commonpath + 'newfile2.avi') .toformat('avi') .on('error',function(err){ console.log(err); }) .run(); yes, if go through docs of fluent-ffmpeg , it's specified there can add multiple inputs , outputs using .input() , .output() .

php - Globals in symfony (like BD config) -

how can setup global var in symfony? i'm developing saas multitenant in symfony , need create dynamical connection in order load tenant information display logged user. i need change this: parameters: database_host: 127.0.0.1 database_port: null database_name: xxxxxxx database_user: xxxxxx database_password: xxxx database_driver: pdo_mysql database_path: null is possible config global dynamic var? in doc, said if want have global variables in yaml config files, have surround them '%'. not sure if that's want, here's link : http://symfony.com/doc/current/service_container/parameters.html

mysql - Database storage engine implementation in java -

i implementing database storage engine in java using randomaccessfile class. need implement paging using b plus tree. have few doubts: how implement paging in java using randomaccessfile class? is there java library available implement b-plus tree store pages , handle overflow , underflow of pages? please post links can me implement task.

javascript - jquery update property in an array from another array -

i want update property in array array matching field using jquery. objarray = [ { id: 1, val: 'a'}, { id: 3, val: 'b'}, { id: 5, val: 'c'} ]; after doing processing, getting array this. objnewarray = [ { id: 1, value: 'aa'}, { id: 3, value: 'bb'}, { id: 5, value: 'cc'} ]; now want update objarray val field objnewarray's value field result objarray = [ { id: 1, val: 'aa'}, { id: 3, val: 'bb'}, { id: 5, val: 'cc'} ]; is there other way other looping both arrays ,matching id , updating val property? you use hash table , loop target first , the new object assigning old object. var objarray = [{ id: 1, val: 'a' }, { id: 3, val: 'b' }, { id: 5, val: 'c' }], objnewarray = [{ id: 1, value: 'aa', extra: 42 }, { id: 3, value: 'bb' }, { id: 5, value: 'cc' }], hash = object.create(null); objarray.foreach(function (a) { hash[a.

unix - bc within perl fails to get going -

i trying run bc unix command within perl seems hard right now. using bc because numbers using beyond 64bit in size. here's code snippet. $temp_addr = "a5a5a5a5a5a5a5a5"; $temp_data = "82100000"; $bc_addr = `echo \"ibase=16;obase=16;($temp_addr/8)\" | bc`; $bc_data = `echo \"ibase=16;obase=16;($temp_data*200)\" | bc`; die "$bc_data, $bc_addr"; the output code when run like... 02 08 20 08 03 09 14 , 02 00 14 05 04 06 12 13 04 04 15 18 07 11 15 02 00 now expecting o/p in hex , valid 1 @ that. 1 flies on head. when run bc in shell directly things fine. set obase=16 before ibase=16 , work charm. otherwise setting obase 0x16, not want.

html - CSS "page-break-after" on an undefined div -

i have search engine produces variety of widgets (each in it's own div), each time different amount of widgets. when print results page widgets can cut in middle page break, , each widget inside page , not cut page break. we tried: @media print { .widget {page-break-after: always;} } and cut of widget, each different page, not want. want page break happen if it's necesary. don't want make page-break specific widget because don't know 1 one has cut. we tried: @media print { .widget {page-break-after: avoid;} } and didn't work. suggestions? from sounds of want use: .widget { page-break-inside: avoid; } that push of widgets span page down next one.

r - Get percentage for cohort day and daycount -

i have cohort retention data frame > cohortdata cohort daycount count 1 25/10/2016 0 238 2 25/10/2016 1 137 3 25/10/2016 2 78 4 25/10/2016 3 32 5 25/10/2016 4 21 6 25/10/2016 5 25 7 26/10/2016 0 134 8 26/10/2016 1 97 9 26/10/2016 2 49 10 26/10/2016 3 22 11 26/10/2016 4 22 12 27/10/2016 0 136 13 27/10/2016 1 88 14 27/10/2016 2 38 15 27/10/2016 3 15 16 28/10/2016 0 138 17 28/10/2016 1 25 18 28/10/2016 2 19 19 29/10/2016 0 144 20 29/10/2016 1 28 21 30/10/2016 0 135 what want add percent column % of count against each cohort , daycount of 0 cohort 25/10/2016 percentage values daycount 0 through 2 238/238, 137/238, 78/238. i have looked @ table.prop not able result want, have

c++ - Google Maps Qt client with heat map -

i writing google maps (and open street maps) client in qt without qml. in principle easy qgraphicswebview. problem comes because trying overlay information (a heat map, locators, etc) on it. i have tried link qgraphicswebview object qgraphicsscene, don't know how make heat map , locators "attached" map coordinates, behave when user moves map, zooms in/out, etc. is there way make graphical elements associated maps coordinates?

How to set start value for a column which is autoincrement in android sqlite -

i developing android application in have autoincrement value table , display value in activity have choosen sqlite database in have created table named bill in have set columns want set start value autoincrement column suppose if set start value 1000 first record should 1000 , should incremented 1. string create_bill_table = "create table " + bill_labels + "(" + bill_id + " integer primary key autoincrement," + bill_date + " text," + bill_farmername + " text," + bill_mobileno + " numeric," + bill_producttype + " text," + bill_productno + " numeric," + bill_productcost + " numeric," + bill_totalamount + "numeric" + ");"; db.execsql(create_bill_table); can tell me how can achieve in sqlite have little knowledge in sqlite database. try this: update sqlite_sequence

php - Laravel 5: How to set parameters Response::json($data) as json_encode($data, JSON_UNESCAPED_UNICODE)? -

laravel 5: have problem unicode. if do return response::json(['data' => 'Что то']); receive {data: \u043e\u0431\u044c\u044f} i want set parameter json_unescaped_unicode response::json() the following not work: response::json(['data' => 'Что то'], json_unescaped_unicode) set json_unescaped_unicode 4th parameter: return response::json(['data' => 'Что то'], 200, [], json_unescaped_unicode);

bluetooth - Game Maker Studio 2 LOCAL multiplayer -

i want make simple multiplayer game game maker studio 2 mobile platforms, should work locally (via wi-fi or bluetooth). e.g. this list of existing games , game classified (bluetooth | wifi direct | online). have experience in programming , gml should not problem me. want know sure whether possible implement wi-fi direct , bluetooth communication? required answer have done it. plug-ins required this? not want reinvent wheel , modify libraries or broken code. need 100% working solution. why game maker studio 2? because want make game friend doesn't have programming skills. so, need game editor game maker studio 2 despite fact have programming experience. , task - solve problem local multiplayer before start make game. maybe there other editors fit these requirements? gamemaker has built-in functions make local multiplayer (i assume mean "wifi"). if familiar udp/tcp, it's plus. can found here : https://docs.yoyogames.com/source/dadiospice/002_reference/

java - How to install a bot from the world Championship in the the Torcs racing game? -

i trying install 1 of champions of car simulator game torcs can select ai-driver. no matter tutorial follow (for example here ), there problems steps listed there not result in driver being listed in torcs program gui. can't pinpoint problem lies, hope can clear steps in order achieve this. a similar question asked here without success. please post step step solution how driver here installed in torcs program can see how being run , run against it? out lot. some steps have taken: install driver here follow steps in readme file in installed driver folder on how install driver. in specific: tar xvjf hymie_2015.tar.bz2 -c $torcs_base/src/drivers cd $torcs_base/src/drivers/hymie_2015 make clean make install at step 5 i'm stuck approach there no make clean command in makefile. can work when running export make_default=$torcs_base/make-default.mk . 6th step fail. tried run .configure , make clean , make , make install in main directory of torcs (as process of

ios - Why don't hear music after recording in swift? -

i'm making karaoke application. if headphones aren't plugged in, app works fine. (my voice , background music record together). successful, when same way headphone listen recording. can't hear background music, hear voice clearly. attached code below used: https://github.com/genedelisa/avfoundationrecorder the issue when headphones plugged in, mic not able pick , record audio, voice. obviously, when headphones not plugged in, not issue. i recommend combine music , voice recording after voice recorded if user using headphones. suggestions on how can found on post: how merge 2 mp3 files ios? also, check if headphones plugged in check out post: are headphones plugged in? ios7

java - Hibernate filters with list parameter and with JPA -

i'm using jpa + hibernate 4.3.11 final. i'm trying use filters in query. part of bean: @filterdefs({ @filterdef(name = "localitafilter", parameters = { @paramdef(name = "localita", type = "long") }) }) @filter(name = "localitafilter", condition = "localitaintervento_id in (:localita)") @entity public class segnalazione extends abstractentity implements serializable { private static final long serialversionuid = 1l; and part of code when try apply filter collections of long values: list<localita> listalocalitaautorizzate = operatorerepository.findlocalitaautorizzate(username); list<long> listaid = listalocalitaautorizzate.stream().map(l -> l.getid()).collect(collectors.tolist()); filter filtro = (filter) entitymanager.unwrap(session.class).enablefilter("localitafilter"); filtro.setparameterlist("localita", listaid); ... unfortunately when

c++ - How Can I get a range of values in a map for given lower bound and upper bound in an std::set? -

say have following code #include <iostream> #include <set> int main () { std::set<int> myset; int inf, sup; inf = 25; sup = 60; (int i=1; i<10; i++) myset.insert(i*10); // 10 20 30 40 50 60 70 80 90 return 0; } i trying figure out if standard library provides methods, or combination of methods allow me 2 iterators it_l, it_u such range [inf,sup] covered. i've tried use lower_bound, upper_bound i've misunderstood how works. idea avoiding write loops (because know write own function task, maybe there's alternative i'm not aware of). update : examples of expected output (in example) inf =25; sup = 60 expect {30,40,50,60} if instead inf=30; sup = 60 expect {30,40,50,60} if inf=25; sup = 65 expect {30,40,50,60} apparently there's misunderstanding, or maybe it's me i'm not correctly expressing want do. when inf , sup please intend them extreme values of real interval. once made such assumption want retr

Concatenate each column value into a string for a subquery -

all i've done lot of background reading on over , off past day or , i'm none wiser on how achieve this. i have looked on site , found ways of concatenating multiple rows 1 column i'm after bit more bespoke, please help... i have 2 tables - 1 list of people , details them such name etc , person reference. the second contains number of alerts person, 1 person can have multiple alerts. contain person reference , type of alert have in string. i want join these 2 tables using inner join on person reference. next want find of alerts each person , concatenate string , show "all alerts" column. so end following output: first name | surname | alerts -----------+---------+-------------------------- tony | stark | alert 1, alert 2, alert 3 i can far going through of alerts in alerts table , put alerts every person string, need concatenated value each person, , haven't figured out how this. i've spent day on , looked xmlpath solutions ,

html - Select Internet window from vba -

i doing macro on vba accessing webpage, providing username , password , when click on "login" button new page open in new window. have 2 distinct webpages active 1 not 1 want anymore. struggling activating new window. also, impossible access directly new window without passing gfirst main 1 though has unique link. thought different ways, never make ! 1 ) use "shell" count different windows open , if 1 of them has link of window want activate, set internet one. issues method : if my_shell.windows(0).document.location = "https://mywebsite" msgbox "0" set ie = my_shell.windows(0) goto laa elseif my_shell.windows(1).document.location = "https://mywebsite" msgbox "1" set ie = my_shell.windows(1) goto laa elseif my_shell.windows(2).document.location = "https://mywebsite" msgbox "2" set ie = my_shell.windows(2) goto laa e

regression - modifiying random forest such that all trees have some (predetermined) features in common -

i looking @ regression problem trying solve using random forest. data set has approx 200 features. two of 200 features important (known business use case), , make sure used in every tree in random forest. question: makes sense theoretical point of view? , if yes, has done before? i appreciate thoughts, references, etc. thanks.

Python Game | TypeError: argument of type 'NoneType' is not iterable -

so i'm working through python book , asked create tic-tac-toe game , understand code do, relatively. come time run program , given weird error typeerror: argument of type 'nonetype' not iterable with full error being: traceback (most recent call last): file "tac tac toe game revised.py", line 182, in <module> main() file "tac tac toe game revised.py", line 173, in main move = human_move(board, human) file "tac tac toe game revised.py", line 100, in human_move while move not in legal: typeerror: argument of type 'nonetype' not iterable here code refers in line 173 def main(): display_instruction() computer,human = pieces() turn = x board = new_board() display_board(board) while not winner(board): if turn == human: move = human_move(board, human) board[move] == human else: move = computer_move(board,computer,human)

angularjs - Gradients with Angular Material md-colors directive -

Image
i'm wondering if there way gradients using angular material md-colors directive? https://material.angularjs.org/1.1.1/api/directive/mdcolors thanks it doesn't seem possible md-colors directive can programatically - codepen markup <div ng-controller="appctrl ctrl" ng-cloak="" ng-app="myapp" layout-fill layout-padding layout="column"> <div style="background: linear-gradient({{ctrl.color1}}, {{ctrl.color2}})" flex></div> </div> js angular.module('myapp',['ngmaterial']) .controller('appctrl', function($mdcolors) { this.color1 = $mdcolors.getthemecolor('primary-600'); this.color2 = $mdcolors.getthemecolor('primary-100'); }); note won't work ie. docs :

apache - Reference: mod_rewrite, URL rewriting and "pretty links" explained -

"pretty links" requested topic, explained. mod_rewrite 1 way make "pretty links", it's complex , syntax terse, hard grok , documentation assumes level of proficiency in http. can explain in simple terms how "pretty links" work , how mod_rewrite can used create them? other common names, aliases, terms clean urls: restful urls, user-friendly urls, seo-friendly urls, slugging, mvc urls (probably misnomer) to understand mod_rewrite first need understand how web server works. web server responds http requests . http request @ basic level looks this: get /foo/bar.html http/1.1 this simple request of browser web server requesting url /foo/bar.html it. important stress not request file , requests arbitrary url. request may this: get /foo/bar?baz=42 http/1.1 this valid request url, , has more nothing files. the web server application listening on port, accepting http requests coming in on port , returning response. web server entirely

php - laravel 5.3 raw SQL statement in Builder -

Image
i have applied laravel builder filter search input user in form, isn't working optimal. scenario: my form looks this: in first input custom query search following builder made. return $builder->where('city', 'like', '%' . $value . '%') ->orwhere('first_name', 'like', '%' . $value . '%') ->orwhere('middle_name', 'like', '%' . $value . '%') ->orwhere('last_name', 'like', '%' . $value . '%'); the 3 dropdown menu's filtered following code: return $builder->where('location', $value); // <-- "selecteer locatie" return $builder->where('level', $value); // <-- "selecteer richting" return $builder->where('graduation', $value); // <-- "selecteer diplomajaar" $value input of user. now whenever filter 3 drop

android - couldn't find "libandenginephysicsbox2dextension.so" -

i making simple android app using andengine , box2d extention. unfortunately, got message: java.lang.unsatisfiedlinkerror: dalvik.system.pathclassloader[dexpathlist[[zip file "/data/app/es.esy.m3na71jnu5cg5e2.gs14049_bsj_mid-2/base.apk"],nativelibrarydirectories= [/data/app/es.esy.m3na71jnu5cg5e2.gs14049_bsj_mid-2/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libandenginephysicsbox2dextension.so" @ java.lang.runtime.loadlibrary(runtime.java:367) @ java.lang.system.loadlibrary(system.java:1076) @ org.andengine.extension.physics.box2d.physicsworld.<clinit>(physicsworld.java:35) @ es.esy.m3na71jnu5cg5e2.gs14049_bsj_mid.pvpactivity.oncreate(pvpactivity.java:70) @ android.app.activity.performcreate(activity.java:6876) @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1135) @ android.app.activitythread.performlaunch

php - composer command does nothing -

Image
i work yii2 in windows 10 using xampp in project, composer command nothing @ all. to understand more, have add this, composer command works in every path exept one project. my composer.json: { "name": "yiisoft/yii2-app-advanced", "description": "yii 2 advanced project template", "keywords": ["yii2", "framework", "advanced", "project template"], "homepage": "http://www.yiiframework.com/", "type": "project", "license": "bsd-3-clause", "support": { "issues": "https://github.com/yiisoft/yii2/issues?state=open", "forum": "http://www.yiiframework.com/forum/", "wiki": "http://www.yiiframework.com/wiki/", "irc": "irc://irc.freenode.net/yii", "source": "https://

SoapUI: Stop load test suite execution from groovy script -

the first step in test suite soap ping request. want stop further test suite execution if ping step not return "alive". what tried do: add groovy step after soap ping step validate ping response , run (tried testrunner , other handlers; compare "true" make executed - change false when find solution): def groovyutils = new com.eviware.soapui.support.groovyutils( context ) def holder = groovyutils.getxmlholder( "ping#response" ) log.info holder["//message"] if(holder["//message"].contains('alive') == true) { log.info "test execution stopped ping unsuccessful." loadtestrunner.cancel("test execution stopped ping unsuccessful.") } i tried add script above teardown tab of corresponding ping load test. neither of worked - test suite executed further down. can give me piece of advice on how accomplish this?

java to send email with attachment -

package abc; import java.io.fileinputstream; import java.io.fileoutputstream; import java.io.ioexception; import org.apache.poi.ss.usermodel.cell; import org.apache.poi.ss.usermodel.cellstyle; import org.apache.poi.ss.usermodel.indexedcolors; import org.apache.poi.hssf.usermodel.hssfcellstyle; import org.apache.poi.hssf.usermodel.hssfsheet; import org.apache.poi.hssf.usermodel.hssfworkbook; import org.apache.poi.ss.usermodel.*; import org.apache.poi.xssf.usermodel.xssfborderformatting; import org.apache.poi.xssf.usermodel.xssfcellstyle; import java.util.iterator; public class read { public static void main(string[] args) throws ioexception { string filepath = "c:\\test.xls"; fileinputstream input = new fileinputstream("filepath"); hssfworkbook wb = new hssfworkbook(); //access workbook //access worksheet, can update / modify it. hssfsheet worksheet = wb.getsheetat(0); cell cell = null; // declar

r - Multiple traces not working in plot_geo -

i trying create scattergeo map using r plotly package version 4.5.2. geographic scope new south wales (australia) , need include district boundaries within state, cannot use 1 of existing plotly geo scopes. my attempted work around plot district boundaries using add_paths() (applied data frame boundary info), , overlay scatter data using add_markers(inherit = false) (to different data frame). however, final result not render many of desired visual attributes markers (e.g. marker colors grey [as per boundary lines], rather green , blue, , sizes attributes ignored). see first screen shot. but when remove add_paths() plot pipeline, markers rendered perfectly. see second screen shot. any suggestions how can make work? reproducible code simplified data frames below. session info below. plotly screenshot - grey boundaries markers rendered incorrectly plotly screenshot - markers rendered correctly no boundaries library(plotly) # data "scatter bubbles" dat <- d

How to create xlsx file from XML, with using XSLT in java -

i able create xls file old format, microsoft spreadsheet 97-2003, rather go newer. how create newer xlsx format? i use javax.xml.transform java package. here chunk of java code tfactory = transformerfactory.newinstance(); transformer = tfactory.newtransformer(new streamsource("file.xslt")); transformer.transform(streamsource, new streamresult(new fileoutputstream(filenamexls))); i have tried using different xsl stylesheet definition, didn't help. this xlst file. <?xml version="1.0" encoding="utf-8" standalone="yes"?> <xsl:stylesheet version="1.0" xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"> <xsl:output method="html" encoding="utf-8" indent="yes" doctype-public="-//w3c//dtd xhtml 1.1 stric

scipy - Python sparse matrix & classifiers -

working naturally sparse data love use scipy sparse type ( csr_matrix instance). confused when @ various classifiers on whether support type or not ! logistic regression, naive bayes seem working as regards svm classifiers ( sklearn.svm.svc instance) understand can predict on same type has first fitted (so if fit on sparse matrix, can use .predict() , .score() sparse data), correct ? a second question pros of using sparse type (appart memory storage) : improving speed of algorithm ? svm.svc doesn't so, unable tell sure, know more on subject ? i have add planning on using cross_val_score , greadsearchcv tune , cross-validate on sparse data, , love be sure functions can support efficiently sparse type. thank !

SQL Server 4004 error for YII framework -

below query works on sql server 2012 on database, yii returns 4004 error linux box.... freetds issue? has configuration same query runs on local machine perfectly.... on live (linux box centos, freetds mssql), below error cdbcommand failed execute sql statement: sqlstate[hy000]: general error: 4004 general sql server error: check messages sql server [4004] (severity 16) [(null)]. sql statement executed was: yii 1.1 used.... with data ( select e.sitekey, f.sitename, d.hrdeptkey,d.hrdeptname, b.hrsdkey,b.hrsdname, c.empsapid subdeptheadsapid, concat(c.empfirstname,' ',c.empmiddlename,' ',c.emplastname) subdeptheadname, l.empsapid deptheadsapid, concat(l.empfirstname,' ',l.empmiddlename,' ',l.emplastname) deptheadname, h.countrykey, h.countryname, i.compkey, i.compname, j.businesstypekey, j.businesstypename hrmastersubdepartment b left join rolemappingemployee on (a.s

php - Why is_dir() function is not checking case sensitive in CPanel server -

Image
i tried code in localserver, works correcly if directory having foldername , won't accept same folder create, if uploaded part in server. if directory having foldername alto , new folder tried name alto created why it. if knows solution. <?php $folder_type=$_post['folder_type']; $folder_name=$_post['folder_name']; $images="images"; $path="../../".$folder_type."/".$folder_name; if (!is_dir("../../".$folder_type."/".$folder_name)) { mkdir("../../".$folder_type."/".$folder_name); mkdir("../../".$folder_type."/".$folder_name."/".$images); $content = file_get_contents('../../default_code.php'); $fp = fopen($path . "/$folder_name.php","wb"); fwrite($fp,$content); fclose($fp); } else { echo "0"; } chmod("../../".$folder_type."/".$folder_name, 0777); ?> to rule out condition @ all. ple

configuration - Swift - How to set up config variables for multiple targets in XCode Project -

i'm starting white label app use many clients (targets). targets share functionalities have different values global variables such services urls, names, cosmetics, etc. in obj-c use constants.h file each target , #macros since project swift 3 native don't know best approach. if use different .plist files each target, have redefine settings manually prefer stay same between targets cfbundleversion, permissions, etc. in these configurations need set arrays , dictionaries don't know if using .xconfig files best approach either. so, if has faced similar in swift , can explain approach appreciated.

preference - How to change the integrated terminal in visual studio code or VSCode -

i want change integrated terminal cmder use vscode on windows 8.1 checked doc , preference file got confuse following lines line change // external terminal // customizes terminal run on windows. "terminal.external.windowsexec": "%comspec%", // customizes terminal application run on os x. "terminal.external.osxexec": "terminal.app", // customizes terminal run on linux. "terminal.external.linuxexec": "xterm", // integrated terminal // path of shell terminal uses on linux. "terminal.integrated.shell.linux": "sh", // command line arguments use when on linux terminal. "terminal.integrated.shellargs.linux": [], // path of shell terminal uses on os x. "terminal.integrated.shell.osx": "sh", // command line arguments use when on os x terminal. "terminal.integrated.shellargs.osx": [], // path of shell terminal uses on windows. when using shells shipped wi

HTTP GET in JSON within an API -

how http request of data in json format, 1 api endpoint , post api endpoint. -(void)getrequest{ //init nsurlsession configuration nsurlsessionconfiguration *defaultconfigobject = [nsurlsessionconfiguration defaultsessionconfiguration]; nsurlsession *defaultsession = [nsurlsession sessionwithconfiguration: defaultconfigobject delegate: nil delegatequeue: [nsoperationqueue mainqueue]]; //create urlrequest nsurl *url = [nsurl urlwithstring:@"your url"]; nsmutableurlrequest *urlrequest = [nsmutableurlrequest requestwithurl:url]; [urlrequest sethttpmethod:@"get"]; [urlrequest setvalue:@"application/x-www-form-urlencoded" forhttpheaderfield:@"content-type"]; //create task nsurlsessiondatatask *datatask = [defaultsession datataskwithrequest:urlrequest completionhandler:^(nsdata *data, nsurlresponse *response, nserror *error) { //handle response here // nslog(@"resultsdictionary %@",response); }]; [datatask resume];

javascript - Sketchfab AJAX json call -

i'm trying collect url sketchfab model thumbnail. view-source: https://api.sketchfab.com/v2/models/b894deeab7904df3a1f6016053604960 when ik go above url, can see information need. now i'm trying make ajax call can dynamicaly use thumbnail url. $.ajax({ url: 'https://api.sketchfab.com/v2/models/b894deeab7904df3a1f6016053604960', type: 'get', crossdomain: true, success: function(data){ alert(data); } }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.2.3/jquery.min.js"></script> somehow, i'm getting [object object] back, don't understand doing wrong. stupid... you getting json data in object form - make readable need stringify it: alert(json.stringify(data)) but shouldn't need this, other make readable, work back.

java - Oracle Toplink not working on Payara App Server -

i've took care of migration glassfish 2 glassfish payara application uses toplink. while application running on glassfish 2 dependency toplink written in pom file this: <dependency> <groupid>toplink.essentials</groupid> <artifactid>toplink-essentials</artifactid> <scope>provided</scope> </dependency> now, can see toplink no longer available default in glassfish payara, i've changed dependency this: <dependency> <groupid>toplink.essentials</groupid> <artifactid>toplink-essentials</artifactid> </dependency> but, after doing keep receiving following error: caused by: java.sql.sqlsyntaxerrorexception: syntax error: encountered "key" @ line 1, column 8. @ org.apache.derby.impl.jdbc.sqlexceptionfactory40.getsqlexception(unknown source) @ org.apache.derby.impl.jdbc.util.generatecssqlexception(unknown source) @ org.apache.derby.impl.jdbc.transactionresourceimpl.wrapin

ios - THREAD WARNING - phonegap -

thread warning: ['notification'] took '1153.449951' ms. plugin should use background thread. how solve? me please! cordova's official documentation states that: if plugin requires great deal of processing or requires blocking call, should use background thread. use code this: - (void)mypluginmethod:(cdvinvokedurlcommand*)command { // check command.arguments here. [self.commanddelegate runinbackground:^{ nsstring* payload = nil; // blocking logic... cdvpluginresult* pluginresult = [cdvpluginresult resultwithstatus:cdvcommandstatus_ok messageasstring:payload]; // sendpluginresult method thread-safe. [self.commanddelegate sendpluginresult:pluginresult callbackid:command.callbackid]; }]; }

c# - I thought 2d Arrays get converted to 1d arrays by the compiler, why is it faster even when taking cache misses into consideration? -

i read top posts here #performance , #optimization , there lot of posts 2d array performance, c , c++ , said best practice switch x , y iteration limit cache-misses. i tried same out in c# , tried 1d approach 2d array , considerably faster. why 1d version lot faster (optimal?) 2d one? generating fewer cache misses? setup: int[,] testarr = new int[testsize, testsize]; int[] testarr1dim = new int[testsize * testsize]; random r = new random(); (int x = 0; x < testsize; x++) { (int y = 0; y < testsize; y++) { int tmp = r.next(); testarr[x, y] = tmp; testarr1dim[(y + x * testsize)] = tmp; } } slow 2d array iteration: (int y = 0; y < testsize; y++) { (int x = 0; x < testsize; x++) { counter += testarr[x, y]+2; } } fast 2d array iteration: bit more twice speed of slow 2d array (int x = 0; x < testsize; x++) { (int y = 0; y < testsiz

c++ - Boost python: Argument Error lvalue between Wrapped and Base class -

in python code below, findfactory returns factorybase instead of factorybasewrapper . , think may cause of problem. know how tell python factorybasewrapper inherit factorybase? tried "bases" in class_ this: class_<factorybasewrapper, bases<factorybase> boost::noncopyable>( "factorybase", no_init ) but doesn't compile. seems need make interface factorybase too. can't, need factorybasewrapper because of pure virtual function in factorybase. thanks python code: _sourcefactory = _myfactorymgr.findfactory(name) foo = _sourcefactory.getorcreatebase(myobj) # problem here boostpython module: class_<factorymgr, boost::noncopyable>("factorymgr",no_init) .def("findfactory",&factorymgr::findfactory, return_value_policy<reference_existing_object>()); class_<factorybasewrapper, boost::noncopyable>( "factorybase", no_init ) .def( "getorcreateindicator", &factorybasewrap

javascript - c# - Dynamics CRM Plugin - Auto-fill data prior to creation -

i'd use plugin fill case entity form data. i'm new working c# , plugins, sense more reliable using javascript form scripting. if bad assumption, please tell me. my goal 1) , check security role of user, 2) based on security role, auto-fill "customer" field generic, hard-coded value. the "customer" field on case form "system required" field. have plugin registered on create of incident, pre-validation & synchronous. when try save without manually filling out "customer" field, unable save , ui points me fact field not filled out yet. am trying not possible? or should using javascript and/or business rules this? plugin expensive. according need, onload javascript function more appropriate. regarding pre-validation stage, validation check against things user privileges; field requirement level checked on client side. pre-validation plugin won't user skip required field. if plugin preference, may set default value

javascript - return to default check box after change -

i working on drawing app. have 2 tools(pencil , eraser) , colors. when check pencil can select color when check eraser , want select color, want check pencil tool again instead eraser tool stays selected. any guidance appriciated. here example , code: code: html: <!-- pencil & eraser --> <div class="graphic-tools"> <!-- <div id="pencil" class="pencil"></div> --> <input checked="checked" id="pencil" type="radio" name="tool" value="pencil" /> <label class="tool pencil" for="pencil"></label> <p class="">potlood</p> <!-- <div id="eraser" class="eraser"></div> --> <input id="eraser" type="radio" name="tool" value="eraser" /> <label class="tool eraser" for="eraser"></label> &l

Simple PHP class -

i learning php , created below class, can't seem figure out why giving me below errors says: 144 warning: missing argument 1 setters::set_a(), called in c:\xampp\htdocs\php\accessmod2.php on line 19 , defined in c:\xampp\htdocs\php\accessmod2.php on line 9 notice: undefined variable: value in c:\xampp\htdocs\php\accessmod2.php on line 11 <?php class setters{ private $a = 144; public function get_a(){ return $this->a; } public function set_a($value){ $this->a = $value; } } $example = new setters(); echo $example->get_a()."<br />"; $example->set_a(15)."<br />"; echo $example->set_a()."<br />"; ?> you have use parameter set() function. in case, think want see if set() function have work. use get() function. so change : echo $example->get_a()."<br />"; $example->set_a(15)."<br />"; echo $example->get

c# - Add textblock text to favorite list on button click -

i have 2 pages: first mainpage.xaml , second favoriteslist.xaml . in mainpage.xaml have text block, shows dynamic text automatically. and have button on mainpage.xaml . from want when click on button, text appears on text block should go favorite list in favoriteslist.xaml page. if text favorite, text appears on text block should removed favorite list on button click. so need implement functionality textblock shows dynamically created need know how develop add favorite functionality. textblock: <textblock x:name="stringtextblock" text="" margin="9,-7,0,0" style="{staticresource phonetexttitle1style}" /> button: <button grid.row="2" x:name="addtofavoritesbutton" content="add" style="{staticresource buttonstyle2}" margin="2" click="addtofavoritesbutton_click"/> c# private void addtofavoritesbutton_click(object sender, routedeventargs e) {