Posts

Showing posts from August, 2014

com.meteor.cordova-update.tgz: No such file or directory -

i'm trying build meteor 1.1.0.3 app mobiles on new computer command: meteor run android the installing cordova plugins indicator goes 54% , produces error: warning: failed create file warning: project/.meteor/local/cordova-build/local- warning: plugins/com.meteor.cordova-update.tgz: no such file or directory curl: (23) failed writing body (0 != 784) how fix meteor 1.1.0.3? it solved deleting .meteor/local in project , running: meteor install-sdk android meteor install-sdk ios

Is it possible to create a mixed array in vala? -

in vala see when declare array have specify type, like int[] myarray = { 1, 2, 3 }; i wonder if there way have mixed array like smtg[] myarray = { 1, 'two', 3 }; i see in this question in c++ , c# it's not possible started learning vala , have no background c -like language want sure. no. that said, can create array of can hold other types, glib.value or glib.variant , , vala can automatically convert to/from two, like glib.value[] values = { 1, "two", 3.0 } it's terrible idea (you're throwing away compile time type safety), can it.

mysql - php submit button and form radio -

i'm trying script sends information sql, have problem submit button , form radio, can me it? this if doesn't work properly if (isset($_post['test'])) { if(isset( $_post['odp'])) this code of php http://wklej.org/id/1003412/ for one, after viewing code seems best combine 2 if's, below: if ((isset($_post['test']) && isset( $_post['odp'])) { code execute; } what values getting isset( $_post['test']) , isset( $_post['odp'])? may want try echoing them out see if actual values expecting. can try echoing right after 2 if(isset's, may part of executed code not working, , not actual if statements. empty($_post['test']) may work better well, same poster above stated.

java - Correct way of writing "super" -

this question has answer here: can java call parent overridden method in other objects not subtype? 4 answers if have object , want call version of method in parent class there way can call x.super.method() or super.x.method() ? not answer little research. interesting question, fun hacked test code. since comments don't support formatting i'm posting results here. i suspect way use super method invocations , have compile use super unqualified , no prefix expression(s). bar.blarch() compiles , runs expected (see example, below). bar.super.blarch() did not compile (which expected). bar bar = new bar(); system.out.println("bar.super.blarch() ==> " + bar.super.blarch() ); however, error message surprised me. turns out javac complained "cannot find symbol" follows: bar.java:15: error: cannot find symbol system.out

java - How Do I Include A .jar Library In Android Studio Project -

assume have no idea i'm doing. i'm trying include java library created in eclipse no relation android in android application can use classes in said library. tried creating folder called "libs" , including ":app:libs" dependency in project structure screen under modules->app->dependencies. when try build, gives me message "error:a problem occurred configuring project ':app'. cannot evaluate module libs : configuration name 'default' not found." looked around , saw problem appears haven't set default build configuration libs. can't figure out how this. how set default build configuration module libs? you can in different ways. there three standard approaches importing jar file android studio. first 1 traditional way , second 1 standard way , , last 1 remote library . explained these approaches step step screenshots in link: https://stackoverflow.com/a/35369267/5475941 . i hope helps.

No ready kinect found? -

i beginner kinect pogramming. have installed windows sdk. tried run samples in developer tookit. however, said "no ready kinect found". know know why. me this? lot! yuanhui i beginner. got kinect yesterday , encountered same problem you. sdk installed v1.8. here how checked , solved it: look device manager check if drivers setup; check if have latest directx installed, here's the way ; check if .net 4.0 or above has been installed; make sure installation clean, means kinect should unplugged during installation. , make sure restart computer after have sdk , developer toolkit installed.

php - curl_exec returns empty string -

i'm still bit new using curl pull data , i've started using fiddler find options need set. i'm trying see if can pull image site. first hit search page - set search parameters, start hitting links in results. when attempt go link in 1 of results image, empty string returned curl_exec(). the weird thing - @ 1 point, worked - got data , saved image locally. stopped, , have no idea doing have working. naturally, works ok in browser. :( i'm using simple html dom parse through results , curl actual page requests. curl_error() not show error, curl_getinfo() thinks ok too. it's trivial, i'm not sure how troubleshoot beyond am. <?php include 'includes/simple_html_dom.php'; $url = "http://nwweb.co.bell.tx.us/newworld.aegis.webportal/corrections/inmateinquiry.aspx"; // cookie - asp.net_sessionid $ch = curl_init($url); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_header, 1); $r = curl_exec($ch); preg_match_

java - How to keep rolling log file as per file size? -

i working on project in logging bunch of stuff in file , want make sure log file getting rolled fixed limit file reached. have below logback.xml file looks file size not working. see file size 793m limit have 100m <configuration> <appender name="file" class="ch.qos.logback.core.fileappender"> <file>process.log</file> <triggeringpolicy class="ch.qos.logback.core.rolling.sizebasedtriggeringpolicy"> <maxfilesize>100mb</maxfilesize> </triggeringpolicy> <rollingpolicy class="ch.qos.logback.core.rolling.fixedwindowrollingpolicy"> <filenamepattern>process%i.log</filenamepattern> <minindex>1</minindex> <maxindex>9</maxindex> </rollingpolicy> <encoder> <pattern>%date %level [%thread] %msg%n</pattern> &l

android - Can not play video through webView -

people, tell me, try play video on url in webview, not play on devices, on working, @ not. use simple code: webviewshow = (webview)findviewbyid(r.id.webview); string linkshow = getintent().getextras().getstring(param_link_show); webviewshow.getsettings().setjavascriptenabled(true); webviewshow.getsettings().setmediaplaybackrequiresusergesture(false); webviewshow.loadurl(linkshow); we note not working, can not played, , through regular browser. i added android:hardwareaccelerated="true" in androidmanifest make sure add android:hardwareaccelerated="true" app in manifest. how play video url inside android webview in answer show: webview webview = (webview) findviewbyid(r.id.webview1); webview.setwebviewclient(new webviewclient()); webview.getsettings().setjavascriptenabled(true); webview.getsettings().setjavascriptcanopenwindowsautomatically(true); webview.getsettings().setpluginstate(websettings.pluginstate.on); webview.setwebchromeclient(new

javascript - Why is this ball inside a circle not bouncing properly? -

please see fiddle: https://jsfiddle.net/sfarbota/wd5aa1wv/2/ i trying make ball bounce inside circle @ correct angles without losing speed. think have collision detection down, facing 2 issues: the ball slows down each bounce, until stopping. the angles @ bounces appear incorrect. this partially based off of answer given here: https://stackoverflow.com/a/12053397/170309 had translate java , skipped few lines example seemed irrelevant. here code: javascript: function getball(xval, yval, dxval, dyval, rval, colorval) { var ball = { x: xval, lastx: xval, y: yval, lasty: yval, dx: dxval, dy: dyval, r: rval, color: colorval, normx: 0, normy: 0 }; return ball; } var canvas = document.getelementbyid("mycanvas"); var xlabel = document.getelementbyid("x"); var ylabel = document.getelementbyid("y"); var dxlabel = document.getelementbyid("dx"); var dylabel = document.getelementbyid("dy

How to add /.vim directory and all of it's subdirectories to a git repository -

here's ~/.gitignore file: # ignore * # don't ignore these files !*.vimrc !*.vim !*.bashrc !.gitignore the problem .vim directory , want include (and of sub folders) in git repository; however, aren't included current gitignore file. i've tried this: # ignore * # don't ignore these files !*.vimrc !*.vim/ !*.bashrc !.gitignore and this: # ignore * # don't ignore these files !*.vimrc !*.vim/* !*.bashrc !.gitignore how can ensure vim directory , subdirectories included in git repository? try !.vim/ or !.vim/** https://git-scm.com/docs/gitignore has tip: a trailing "/**" matches inside. example, "abc/**" matches files inside directory "abc", relative location of .gitignore file, infinite depth.

c++ - How do I explicitly specify an out-of-tree source in CMake? -

i looked @ post: using cmake statically link library outside of project . i'm still having trouble interpreting means: add_subdirectory(/path/to/the/library/source/directory subproject/grzeslib) i'm assuming "/path/to/the/library/source/directory" means path hard drive, don't understand "subproject/grzeslib" means. tried: include_directories(../path/to/dir) add_subdirectory (../path/to/dir .) but i'm getting elaborate warning. there better way this? the second parameter output directory results of targets subdirectory. from documentation here: https://cmake.org/cmake/help/v3.3/command/add_subdirectory.html " add_subdirectory add subdirectory build. add_subdirectory(source_dir [binary_dir] [exclude_from_all]) add subdirectory build. source_dir specifies directory in source cmakelists.txt , code files located. if relative path evaluated respect current directory (the typical usage), may absolute path.

javascript - Launching an exe from node.js, and send data between them -

ok, i'm creating webpage using socket.io in node.js. works great, , data going each device should. want expand, , use node.js control pc. i've read this: child process , gotten code wich runs executable, , prints output in console. var spawn = require('child_process').spawn; var ahk = spawn('outsidenode.exe'); ahk.stdout.on('data', function(data){ console.log(data.tostring()); }); here code, or script outsidenode.exe gets launched. i'm using autohotkey this. loop,10 { fileappend,external program spawned node.js says hi!,* sleep,1000 } exitapp this works 1 way. node.js captures ahk's output. now, problem i'm having is, how send data node.js? , how recieve in ahk? belive need read stdio. i'm new std's. my current solution using node.js write .txt file disk command want give, , seperate .exe file reads .txt , executes command , exits. works, slow-ish, , feels wrong way. also, want asynchronous, or synchrono

html - set DIV alignment to bottom -

how can make div left3 bottom , left4 bottom align bottom (like left2 bottom ) , stretch left2 top div on full width? i tried vertical-align: bottom; not help. cheers, pete <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>test</title> <style type="text/css"> .wrapper{ margin: 0px auto; width: 940px; background-color: #28cf21; } .header{ width: 100%; background-color: #12bf81; } .left1{ float: left; margin-right: 20px; width: 220px; height: 500px; background-color: #fc0234; } .left2{ float: left; margin-right: 20px; width: 220px; height: 500px; background-color: #f78325; } .left2oben{ float: left; margin-right: 20px; width: 220px; height: 250px; background-color: #f

Polymer - paper-input -

i trying customise disabled paper-input element. remove dashed lines , change labels color. any suggestion? this element trying style: <paper-input ui:field="totallabel" label="total repay" always-float-label="true" disabled="true"> <div prefix="true">£ </div> </paper-input> thanks! paper-input-container has set of custom css mixins defined users override default styles. you can read more how apply custom css mixins here: https://www.polymer-project.org/1.0/docs/devguide/styling.html#custom-css-mixins --paper-input-container-underline-disabled can used update disabled underline. https://github.com/polymerelements/paper-input/blob/v1.1.5/paper-input-container.html#l166 --paper-input-container-disabled can used update general styles of disabled container. https://github.com/polymerelements/paper-input/blob/v1.1.5/paper-input-container.html#l110 to remove underline can write below

java - Can't insert item in database using servlet -

i trying insert values table of database using servlet , jsp , mysql workbench database. when fill in form , submit, shows blank screen, no output displayed , in database values not updated.these following details: 1) controller.java public class controller extends httpservlet { protected void processrequest(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception, sqlexception { response.setcontenttype("text/html;charset=utf-8"); try (printwriter out = response.getwriter()) { string dburl = getservletcontext().getinitparameter("dburl"); string dbuser = getservletcontext().getinitparameter("dbuser"); string dbpassword = getservletcontext().getinitparameter("dbpassword"); string dbdriver = getservletcontext().getinitparameter("dbdriver"); connection conn = dao.getconnectionjdbc(dburl, dbuser, dbpassword, dbdriver); string titl

osx - Transferring Perl Modules from a folder, to the pre-installed perl on Mac -

salutations i having issue right now. have download bioperl, made mistake somewhere in installation process. dont know correct terminology, know perl modules downloaded suppose default perl (aka #!/usr/bin/perl) along use strict, , use warnings. located in directory. /users/jamespk/terminalwork/lib/perl5/5.16.2/bio/alignio/fasta.pm so right now, need transfer modules bioperl in home directoy, ever #!/usr/bin/perl located. anybody have ideas or insights tackling problem ? plus there effective unix command can use transfering these files? still getting use programming on mac. cheers

mysql - website shows unavailable while taking DB backup? -

my website created using drupal 7 on 1 instance of amazon & database on amazon rds . whenever taking backup of database using mysql root user & simultaneously when developer try clear cache on website time website goes offline untill backup gets on around 30 min happens everytime . solution avoid problem. try use parameter when taking backup mysqldump . --lock-tables myisam storage engine. --single-transaction innodb storage engine. --lock-tables lock tables before dumping them. tables locked read local allow concurrent inserts in case of myisam tables. for transactional tables such innodb , bdb, --single-transaction better option, because not need lock tables @ all .--single-transaction produces checkpoint allows dump capture data prior checkpoint while receiving incoming changes. incoming changes not become part of dump. ensures same point-in-time tables.

Java/Eclipse: How Does Java/Eclipse Reserve Heap -

i trying diagnose memory leak (or thought memory leak) in real time audio program, causes output "stutter" when garbage collection routine called. in attempt basics , elaborate successively until found leak, devised thought simplest possible , leak-free program: public class leakdetect { public static void main(string args[]) { while (true) { system.out.println( runtime.getruntime().freememory()); } } } imagine surprise find heap space decreases on time (easily visible on course of seconds) , jumps again, though there no action here other printing available heap memory. i have never had cause wonder this; going on here? does java/eclipse forcibly reserve chunk of memory heap, , subsequently wasteful behind scenes? or, suspect, other programs , os functions (windows 10) eating potential heap space available, , os freeing memory? if so, there way make java/eclipse take harder line keeping os , other software out of space? r

blueimp/jQuery-File-Upload Cannot Download the Image File and Cannot Upload a Bigger Size of Image -

first of , apologize poor english . so project plain php , mysql. , implemented awesome plugin blueimp/jquery-file-upload (using tutotial https://github.com/blueimp/jquery-file-upload/wiki/php-mysql-database-integration ). doing good. can upload anything. but unlucky me have 2 problems. :( 1.first cannot download uploaded image though file stored in db. :( can download videos,.txt , on microsoft office file. 2.second cannot upload larger size of image. :( here's screenshot cannot uplaod please :( can solve problems ??? :( appreciated :) btw tested in localhost.

ios - Unable to click the label in the UITableCell -

in table cell having different controls, problem facing unable tap control cell, in code had used single tap username label when click it's not going usernametap: selector. can me how solve issue - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"messagingcell"; ptsmessagingcell *cell = [self.tableview dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { cell = [[ptsmessagingcell alloc] initmessagingcellwithreuseidentifier:cellidentifier]; nsstring *struserid, *strusername; struserid = userid[indexpath.row]; strusername = username[indexpath.row]; if ([loginusername isequaltostring:strusername]) { cell.rightutilitybuttons = [self rightbuttons]; } else { cell.rightutilitybuttons = [self rightreportbuttons]; } } cell.selectionstyle = uitableviewcellselectionstylenone; nsstring *struserid, *struse

c - Why there is no error after excluding standard library? -

as beginner in c experimenting something, excluded standard library <stdio.h> , still there no error. can explain it? here sample code: main() { printf("hello, world!\n"); } this program working same or without library. why? tl;dr -- you're excluding header file, not standard library. if exclude header file function having forward declaration, you'll receive warning sure mentioning "implicit declaration" of function. in case, (invalid per latest standards), function assumed return int , no check on number of parameters passed there. however, default, generated object file source linked default c library libc has function definition present. in case, function return type matches implicit case, linker happily links object files together. so, finishes linking , works same . that said, main() should int main(void) , @ least conform standards.

linux - How to use gcc to generate all possible binary files from object files -

does know how use gcc generate possible binary files object files ? know can use : "gcc -mm" generate .o files given source files. but how use gcc generate possible binary files object files in project ? example: use "gcc -mm" generate: a.o, b.o, c.o, d.o if 1 trying generate list of binaries files built each of .o files this: a: b.o c.o d.o b: a.o c.o d.o c: a.o b.o d.o d: a.o b.o b.o i can perl script, curious if there way gcc thanks short answer, "no, but..." gcc -mm can give foo.o: bar.h because foo.cc contains directive: #include "bar.h" that's easy. foo.cc can contain declaration: int bar_f1(int); how can gcc know object file contains binary code function? or if there two object files containing functions signature, should use? can't. ...unless... long answer, "yes, if..." if refrain giving source files forward declarations of things in other source files, , refrain giving head

r - How to change the size of legend text in ggplot2? -

Image
i got plot using data , code below i want able change size of legend text (a, b, m1, ,m3). tried using legend.text=element_text(size=0.5) but didn't change. suggestion how reduce size of legend.text? code library(xts) library(zoo) library(ggplot2) library(tidyr) cols <- c("a"="black", "b" = "black","m1"="red","m2"="blue", "m3" = "green") ggplot(df.trial1, aes(x=date, y= a, color="a"))+ geom_line(linetype=3, size=0.2)+ geom_point(aes(x=date, y=b, color="b"), shape = 16, size =1, alpha=0.5)+ geom_point(aes(x=date, y=value, color=method), size =1, alpha=0.5)+ scale_colour_manual(name=" ", values=cols, labels=c("a", "b", 'm1', "m2", "m3"))+ scale_linetype_manual(values = c("dashed")) + scale_x_date(breaks = date_breaks("1 month"), labels = dat

archlinux - Modify or configure output of linux command in bash -

currently learning bash scripting. so, wanted know how can modify output of linux command. specific, entered command , after pressing enter, every line should start '->' or symbol. e.g: in arch-linux, when use pacman or yaourt install packages, "==>" "->" "::" proceeding information. want output similar that. not sure trying but… looking such as: function pprint() { echo "==> " $1 } which can use such in scripts: pprint "hey there" to output following: ===> hey there

android - Uber OAuth Best Practices in Mobile App -

i'd make mobile app makes requests on behalf of user. understand following oauth flow: open user in web view give app access make requests on behalf when hit grant access, server side app receive call authorization code my server side app needs exchange authorization code access token my confusion starts in step 2. uber makes request endpoint authorization code, have no way of knowing user authorization belongs to. can exchange access token , store in db 30 days, have no way of getting user use make requests. one thought have user sign in app email address use key appropriate access token server app, have no way of associating access token email address in db table in first place. i'm wondering best practices here. how mobile app supposed know access token use given user? (i reached out uber api support directly, asked me open stackoverflow question instead) obviously kind of broad question , highly dependent on type of app you're building, want u

php - Custom action Error in Yii2 -

i have controller called textcontroller,i created custom action in controller called trans controller used manage multi languages.the problem arises when submit form.it shows me not found (#404) requested page not exist. confused this...can me???? attaching controller , view here. my controller public function actiontranslate() { // echo 'dddddddddd';die(); for($x = 0; $x < count($_post['english']); $x++ ) { $model = $this->findmodel($_post['text_id'][$x]); $model->trans_text_id = $_post['text_id'][$x]; $model->trans_text_label =$_post['label_id'][$x]; $model->english =$_post['english'][$x]; $model->spanish =$_post['spanish'][$x]; $model->french =$_post['french'][$x] ; $model->german =$_post['german'][$x] ; // echo '<pre>';print_r($model->trans_text_id); $model->save(false); } echo yii::$app->session->setfl

javascript - V8 Engine Embedded -

i following tutorial online nodejs , stated nodejs c++ program embeds v8 js engine in provide features js. whenever v8 engine sees particular keyword not in ecamscript standard, invoke written c++ code particular keyword. my question jquery utilize method well? since jquery written in pure javascript utilize ecmascript standards of js provide dom manipulation, ajax, json parsing, etc.? or dom manipulation , features not in standard in js, features made available through google chrome c++ program or browser. your understanding of how node.js works bit off, no matter because jquery 100% javascript. it's library written in javascript. entirely through javascript. there no native code in jquery. everything jquery built on top of existing javascript functions exist in browser.

C++ - Best practice for overwriting/reconstructing entire std::vector -

if have std::vector want overwrite (not resize). safest way in terms of memory management? example int main() { std::vector<float> x (5, 5.0); x = std::vector<float> (6, 6.0); x = std::vector<float> (4, 4.0); } will create vector of 5 floats of value 5.0. overwrite vector of size 6 values 6.0, overwrite vector of size 4 values 4.0. if i'm performing type of operation indefinite number of times, there risks of corrupting or leaking memory approach? should using clear() before each overwrite? there more efficient way achieve this? i'm sure question has been asked many times google isn't pulling exact scenario looking for. thanks! std::vector has specific member functions doing this. allocators , copy/move aside, each of vector 's constructors has corresponding overload of assign same thing. if want reuse vector 's storage, use it: std::vector<float> x (5, 5.0); x.assign(6, 6.0); x.assign(4, 4.0); of cour

Getting Substring in Python -

i have string fullstr = "my|name|is|will" , , extract substring "name". used string.find find first position of '|' this: pos = fullstr.find('|') and return 2 first position of '|' . want print substring pos position until next '|'. there's rsplit feature, return first char right of string, since there're many '|' in string. how print substring? you can still use find if want, find first position of | , next one: fullstr = "my|name|is|will" begin = fullstr.find('|')+1 end = fullstr.find('|', begin) print fullstr[begin:end] similar way using index : fullstr = "my|name|is|will" begin = fullstr.index('|')+1 end = fullstr.index('|', begin) print fullstr[begin:end] another way find occurrences of | in string using re.finditer , slice indexes: import re = [sub.start() sub in re.finditer('\|', fullstr)] print fullstr[all[0]+1:all

java - Symbol could not be found -

i try call accumulator class in program, symbol cannot found. public static void main(string[] args) { login c = new login(); accumulator d = new accumulator(); ^ ^ } it depends on accumulator class from. did write yourself? can either use ide or accumulator class find out package. example, if had class: package com.myapp; public class accumulator { // code here } you have declare import statement in class want use accumulator , this: package com.myapp.other.package; import com.myapp.accumulator; public class otherclass { public static void main(string[] args) { login c = new login(); accumulator d = new accumulator(); } }

android - Cannot Correctly Parse Json Using retrofit -

i cannot figure out why json parsing not working. here api working with. link full json output http://api.openweathermap.org/data/2.5/forecast/daily?zip=85008&amode=json&units=metric&cnt=7&appid=3c6fee6e3e8b5764212701d9535a36d5 { "city": { "id": 5308655, "name": "phoenix", "coord": { "lon": -112.074043, "lat": 33.44838 }, "country": "us", "population": 0 }, "cod": "200", "message": 0.014, "cnt": 7, "list": [ { "dt": 1454871600, "temp": { "day": 10.46, "min": 10.46, "max": 10.46, "night": 10.46, "eve": 10.

Parallel execution of two suites using web driver and Selenium -

i have 2 testng suites in project. want run both of them in parallel. suite1: class class b suite2: class c class d i want run suite1 , suite2 in parallel on same machine. however, class b of suite1 should run after class a . same second suite: first , second classes need run in serial. how achieve this? in order achieve, need add annotation @test(priority=??). default value 0 priority. if don't mention priority, take test cases "priority=0" , execute. if define priority "priority=", these test cases executed when test cases don't have priority default priority set "priority=0" you dont need 2 xml requirement. follow these , should have same test running parallel. <suite name="test-class suite" parallel="tests" thread-count="2"> <test name="test-class test 1"> <classes> <class name="com.classa" /> <class name="c

git - Chef - Clone a specific tag from GitLab -

i have snippet should clone repo git: git "somerepo" action :sync destination "/var/" repository "http://#{node["somerepo"][:git_user]}:#{node["somerepo"][:git_pass]}@#{node["somerepo"][:git_host]}/#{node["somerepo"][:git_owner]}/somerepo.git" revision "#{node["somerepo"][:git_revision]}" user "root" group "root" end i have these several tags in gitlab repo named like: 12022015 01052016 02042016 i want tags/02042016 cloned/checked out how set settings in svn. please help. kinda searched stackoverflow , wish overlooking previous question this. , if not possible, kindly advise so. :) thank you. as documentation suggests, can supply tag names revision parameter. git "apt-cookbook" repository "https://github.com/chef-cookbooks/apt" revision "v2.9.2" action :sync end as usage of revision parameter not bullet

c# - "Cannot Implicitly convert type 'float' to 'int'" even when I'm not using any ints -

here's code: float smoothnoise(float x, float y) { float fractx = x - (int)x; float fracty = y - (int)y; float x1 = ((int)x + noisewidth) % noisewidth; float y1 = ((int)y + noiseheight) % noiseheight; float x2 = ((int)x + noisewidth - 1f) % noisewidth; float y2 = ((int)y + noiseheight - 1f) % noiseheight; float value = 0f; value += fractx * fracty * noise[x1, y1]; value += fractx * (1f - fracty) * noise[x1, y2]; value += (1f - fractx) * fracty * noise[x2, y1]; value += (1f - fractx) * (1f - fracty) * noise[x2, y2]; return value; } the errors occur on these 4 lines: value += fractx * fracty * noise[x1, y1]; value += fractx * (1f - fracty) * noise[x1, y2]; value += (1f - fractx) * fracty * noise[x2, y1]; value += (1f - fractx) * (1f - fracty) * noise[x2, y2]; as can see, ints use explicitly casted, i'm confused thinks i'm trying implicitly convert int. i should mention there 8 identical errors of kind, 2 each

Perl File::Monitor module notifying multiple notifications for the new file created whereas i expect one notification -

below code snippet! using file creatiing notification using perl module file::monitor. #!/usr/bin/perl use strict; use warnings; use file::monitor; use file::basename; use time::hires qw {usleep}; $pid,@pids; sub textfile_notifier { ($watch_name, $event, $change) = @_; @new_file_paths = $change->files_created; #the change object has property called files_created, #which contains names of new files $path (@new_file_paths) { ($base, $fname, $ext) = fileparse($path, '.log'); # $ext "" if '.txt' extension # not found, otherwise it's '.txt'. if ($ext eq '.log') { print "$path created\n"; #-----------------------------------------forking part #----------------------------------------- defined ($pid = fork()) or die "couldn't fork: $!"; if ($pid == 0) { #then in child process

Make Ansible included playbooks run on same hosts as their parent -

helllo, best way make included playbook run on same hosts playbook called him? i've tried declaring variable in parent playbook host name , passing included playbook, error telling me variable undefined. below playbook: --- # main staging configuration playbook - vars: host_name: "stage_ansible" hosts: "{{ host_name }}" remote_user: ubuntu tasks: - name: test connection ping: remote_user: ubuntu - include: nginxdefinitions.yml vars: service_name: "interaction.qmerce.com" env_name: "stage4" host_name_pass: "{{ host_name }}" ... and error i'm receiving: `error! 'host_name' undefined if want define hosts runtime , avoid hard coding them on playbook, can pass hosts as variables on command line. to so, remove vars definition first play , add following ansible-playbook command line: --extra-vars host_name=localhost or when have multiple hosts: --ext

android - How to add Relative layout in Relative layout dynamically -

my project file has xml root xml . in root xml define relative layout below <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/root_view"> </relativelayout> i have xml file first one.xml , two.xml below one.xml <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:visibility="gone" android:id="@+id/two_video_layout"> <textview android:id="@+id/two_video_title" android:layout_width="wrap_content" android:layout_height="wrap_con

cognos tm1 - Using a feeder based on a condition in TM1 -

can element fed based on if condition? the following rule calculation used evaluating validation values. [{'aop_v1','forecast_v1'},'validation', 'rate'] = n: if(roundp(['phasing total', 'rate'] * 100, 5) = 100 % roundp(['phasing total', 'rate'] * 100, 5) = 0, stet, 1); is there way can feed [{'aop_v1','forecast_v1'},'validation', 'rate'] ['phasing total', 'rate'] when.. roundp(['phasing total', 'rate'] * 100, 5) = 100 % roundp(['phasing total', 'rate'] * 100, 5) = 0 ? phasing total validation you can create conditional feeders using db() function on right hand side of feeder. rather having cube name hard coded in db formula use if() function returns name of cube fed if logical condition evaluates true, or empty string if not: ['feedfrom']=>db(if(yourlogicaltest,'nameofcube',''), !dim1, !

php - How to fetch & store over 100k records to DB from another DB -

i have school database having more 80 000 records , want update , insert newschool database using php, whenever try run query update or insert 2 000 records , after time stopped automatically please help you (should) full dump , import dump later. i'm not sure how php - , think you'd better doing commands on cli: mysqldump -u <username> -p -a -r -e --triggers --single-transaction > backup.sql and on localhost: mysql -u <username> -p < backup.sql the backup statement flags meanings from docs : -u db_username -p db_password don't paste password here, enter after mysql asks it. using password on command line interface can insecure. -a dump tables in databases. same using --databases option , naming databases on command line. -e include event scheduler events dumped databases in output. option requires event privileges databases. the output generated using --events contains create event sta

php - MySQL - JOIN Operation Multiple Tables -

Image
i creating online attendance system, , problem around query below not bringing correct data. i looking bring student id, class id , attendance status e.g present late or absent of class. if attendance has been taken, query run's fine. however, if no attendance has been taken query returns empty set. i looking still return data have 'null' or in 'attendance status' column, if attendance hasn't been taken. this query : and bring these results if attendance has been taken class: however, if attendance hasn't been taken, return empty set. in attendance column print 'null' or make sure data still comes back. at minimum still need class , student id. think may need join , can't head around it. you should use proper syntax of joins! can cause lot of problems , harder understand. what need left join can used using(+) after condition of table want left join - don't it. your query should be: select class.class_id

PHP cURL JSON sending blank paramaters -

i trying send json java web service getting response web service paramaters null see below. there wrong code? $buildapplication = array( 'firsname' => 'keith', 'surname' => 'francis', 'companyname' => 'keiths mobile discos', 'phone' => '07123456789', 'email' => 'keith.francis@freedom-finance.co.uk', 'sourcecode' => 'w00t' ); $data = json_encode($buildapplication); $ch = curl_init('http://10.50.1.71:8080/sme/api/details.json'); curl_setopt($ch, curlopt_customrequest, "post"); curl_setopt($ch, curlopt_postfields, json_encode($data

c# - Service account Authentication in google analytics api -

i use google analytics api .net . use these sample codes here . when use oauth 2.0 , have no problem , every thing works . when want use service account authentication , null here ( x null) var x = daimtoanaltyicsreportinghelper.get(service, "78110423", "10daysago", "today", "ga:sessions", options); what missed ? (i created p12 file , have service account email ) the solution : needed add service account email (which has been made in google developers consol) user management in google analytics panel , give permission .

ios - is there a way to make this if statement shorter? or easier to maintain? -

i made (rock,paper,scissors) app education, there way make if statement shorter? this swift code snippet : var playerselection = "" // possible values r,p,s var cpuselection = "" // possible values r,p,s var resultstring = "" // decide player result if(playerselection == "r") { if(cpuselection == "r") { resultstring = "draw" } else if(cpuselection == "p") { resultstring = "lose" } else if(cpuselection == "s") { resultstring = "win" } } else if(playerselection == "p") { if(cpuselection == "r") { resultstring = "win" } else if(cpuselection == "p") { resultstring = "draw" } else if(cpuselection == "s") { resultstring = "lose" } } else if(playerselection == "s") { if(cpuselect

ibm - MQ Input/Output count increasing when Datapower client is connect using MQ front side handler -

i using mq 7.5.0.2 , datapower client idg7 when mq send messages datapower, datapower receive messages using mq front side handlers , same way send messages using backend url problem facing when ever datapower connects mq, queue input/output count increases (10 ~20) , remains same , handle state inactive. when see queue details using below commands displaying below display qstatus(******) type(handle) queue(********) type(handle) appldesc(websphere mq channel) appltag(websphere datapower mqclient) appltype(system) browse(no) channel(*****) conname(******) astate(none) hstate(inactive) input(shared) inquire(no) output(no) pid(25391) qmurid(0.1149) set(no) tid(54) urid(xa_formatid[] xa_gtrid[] xa_bqual[]) urtype(qmgr) can 1 me in this.it clearing when ever restart queu

Error while creating chart using c# asp.net -

hi first time i'm trying create chart , have error, can 1 me please ? this code ( i'm using line chart ) : protected void page_load(object sender, eventargs e) { chart1.chartareas.add("chtares"); chart1.chartareas[0].axisx.title = "category name"; chart1.chartareas[0].axisx.titlefont = new system.drawing.font("verdana", 11, system.drawing.fontstyle.bold); chart1.chartareas[0].axisy.title = "unitprice"; chart1.chartareas[0].axisy.titlefont = new system.drawing.font("verdana", 11, system.drawing.fontstyle.bold); chart1.chartareas[0].borderdashstyle = chartdashstyle.solid; chart1.chartareas[0].borderwidth = 2; chart1.legends.add("unitprice"); chart1.series.add("unitprice"); chart1.series[0].charttype = system.web.ui.datavisualization.charting.seriescharttype.line; chart1.series[0].points.databindxy(result.defaul