Posts

Showing posts from January, 2013

Best solution / practice for temp files with Google App Engine PHP? -

what's accepted wisdom/tech solution temp files on gae using php, please? i need store , process image (a few hundred k in size) using php momentarily (e.g. < 1 second) needs exist temp file somewhere before it's sent on elsewhere , temp file can deleted. site need autoscale potentially large numbers of users (using gae standard). my idea attempt store temp file in memory (using tempnam() etc) , if failed (e.g. mem full on instance), try , use other storage instead on fly. question what? image has available file curl access (i think?) , send elsewhere, memcache not option (can't access data file pass curl - or can i?), e.g. cloud storage (via 'gs://[bucket-name]/...'). thing is, if i've written file storage, available reading? that's significant cost incurred... any appreciated! thanks, alex gcs provides default application free bucket tied app well. there no quota bucket. using default bucket to use default bucket: d...

linux - Need help in file filtering -

i have list of host names in file , 1 more file complete host names details in file b.i want remove hosts matches hosts in b file.any short script this?please let me know. ex: cat server1 server2 server3 server4 cat b server700 server1 server300 server4 so here in , b ,server1 , server4 matching,so need script removes matching servers names fromb in file something on these lines might out. adjust regular expression on grep command sure match hostnames on details file: cat file_with_hostnames | while read hname; grep -q "$hname" file_with_host_details || echo $hname; done

javascript - onclick send data to another page -

im trying use onclick function send url page in php. have similar function add function remove nothing, removes button page. no errors visible in console either. this function: function remove(id) { $.ajax({ type: 'post', url: 'cart.php?remove='+id, success: function ( response ) { alert( 'removed: '+id ); } }); } i have tried alert('some text'); same thing. button is: onclick="remove(<?php echo $value; ?>)" the button on cart.php being included on main.php

reactjs - How can I modify the props of one child component from a separate child component? -

i working on scheduling application using reactjs & flux. in application, user need able select specific shift , assign employee cover it. employee assignment occur clicking on employee's name in separate list. component structure follows: schedule app component employee list component employee list item component calendar component month component day component shift component after selecting shift clicking on it, (there 2 - 5 shifts on given day) able click on employee list item , have value of employeename prop (this.props.employeename) assigned selected shift's shiftassignee prop (this.props.shiftassignee). the data both calendar , employees generated when application starts, , stored separate objects in local storage 'calendar' , 'employees' respectively. have data updated as part of flux data flow can retain instead of regenerating every time app starts, wiping previous data, that's not immediate concern. the basic struct...

javascript - Setting div Background using Trianglify -

i have problems using trianglify plugin. use set background of div . how can this? couldn't find proper example. here's sample code: <script> var pattern = trianglify({ width: window.innerwidth, height: window.innerheight }); document.body.appendchild(pattern.canvas()) </script> also, can have div s different backgrounds come trianglify? one div here example of setting div background trianglify pattern. cheats bit , sets div child node pattern should work you. var = document.getelementbyid('something'); var dimensions = something.getclientrects()[0]; var pattern = trianglify({ width: dimensions.width, height: dimensions.height }); something.appendchild(pattern.canvas()); the div has id of something , css styles set on div height , width. working example jsfiddle: http://jsfiddle.net/u55cn0fh/ multiple divs we can expand multiple divs so: function addtriangleto(target) { var dimensions = target.getc...

Rounded Edge in Circular progress Bar Android -

Image
i want creat circular progressbar rounded edge. have tried circleprogress library hosted here https://github.com/lzyzsd/circleprogress but donutprogress don't have rounded edge want. custom progreesdrawable not able achieve it. i want design progress bar shown below one corner rounded marked in picture. my custom_progress_bar.xml <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@android:id/progress"> <rotate android:fromdegrees="90" android:todegrees="90" android:pivotx="50%" android:pivoty="50%" > <shape android:innerradiusratio="2.5" android:shape="ring" android:thicknessratio="15.0" > <corners android:radius="5dp" android...

linux - Grep capping size of results lines, for multiple grep phrases? -

i grepping terms this: grep 'term1\|term2\|term3\|term4' and want say, lines found, cap results 100 characters. found examples how when searching 1 term, none accommodating or-ing of search terms. try gnu grep: grep -e 'term1|term2|term3|term4' file | grep -oe '^.{100}'

drop down menu - ASP MVC C# Cascading dropdown using single table -

i have single oracle table 5 columns , need create 5 cascading dropdown lists on mvc view page, using combination of razor , jquery. got first dropdown ok comes model passed on view. having trouble figuring out 2nd dropdown , after. any sample code or examples appropriated thanks mike this resolved. ended using jquery+ajax make cascaded calls controller each call passing previous dropdown boxes values , returning selectlist of items db. thanks

connection - Connect to MySQL database on vagrant machine in PhpStorm -

i can not create connection mysql database in vagrant machine phpstorm. my settings are: database tab: - host: 127.0.0.1 - port: 3306 - user: root - password: root_passsword ssh/ssl tab: - proxy host: 192.168.56.102 - port: 22 - proxy user: vagrant - proxy password: vagrant can me? thanks in ssh/ssl tab, select auth type key pair , copy path private key file define in identityfile . instance c:/virtualm/deb56/puphpet/files/dot/ssh/id_rsa $vagrant $vagrant ssh-config host local hostname 127.0.0.1 user vagrant port 2222 userknownhostsfile /dev/null stricthostkeychecking no passwordauthentication no identityfile "c:/virtualm/deb56/puphpet/files/dot/ssh/id_rsa" identityfile "c:/users/user/.vagrant.d/insecure_private_key" identitiesonly yes loglevel fatal

c - Combine or merge 2 array with loop or function -

i'm new c world. i'm using visual 2010. need create array 2 other arrays, or function merge them; come php i'm sorry if stupid. tested loop without success.. a real example helpful: int arraya[5] = {3,2,1,4,5} int arrayb[5] = {6,3,1,2,9} and printed expected output of third arrayc should : arrayc { [3][6] [2][3] [2][1] [4][2] [5][9] } a straightforward approach can following way #include <stdio.h> #define n 5 int main( void ) { int a[n] = { 3, 2, 2, 4, 5 }; int b[n] = { 6, 3, 1, 2, 9 }; int c[n][2]; ( size_t = 0; < n; i++ ) { c[i][0] = a[i]; c[i][1] = b[i]; } ( size_t = 0; < n; i++ ) printf( "%d, %d\n", c[i][0], c[i][1] ); return 0; } the program output is 3, 6 2, 3 2, 1 4, 2 5, 9 if want write function merge arrays of size can like #include <stdio.h> #include <stdlib.h> #define n 5 int ** merge( int *a, int *b, size_t n ) { int **c = malloc( n * sizeo...

c++ - This while loop does its proper function, but required for something else? -

i making hotel reservation program in c++. when user wants open guest's info file, have input first name , surname of guest. if there isn't data file name in it, tells user file doesn't exist. asks again file name, , user inputs real file name. the problem if inputs file name know real, file doesn't exist. if re-enter file name when prompted, loads file. by way, loop required file open. that's main thing i'm stumped about. tried messing around see if needed it, , apparently. , need first file_ptr.open(filename,ios::in); , along second. don't understand why need both. here specific code while loop: cout << "open member file"; system ("cls"); char filename [100]; ifstream file_ptr; cout << "\n\t\t\t\tsaved members:\n\n"; system ("dir/b *."); cout << "\n\nplease type name of member you\n"; cout << " wish open appears above or\n"; cout << " type z ...

postgresql - How to create postgres database for Rails app manually? -

how can create postgres db rails app in psql, not via rake db:create ? i mean, 1 can write create database project_name , don't know happens in rake task under hood. maybe there lot of additional params . update after first answer decided clarify: know how write , use migrations, awesome, question not them. it's rake db:create task , pg adapter. in other words, want know command in psql equal rake db:create . if select db on pgadmin iii show sql instructions local things load. importanst if have full text index on. must run them database postgres.

html - Why doesn't my @media screen save -

i have been stuck problem or past hour , annoying me. making website responsive different screen sizes every time write code it, test , works. if close browser , reopen or reopen code editor (brackets) page loads nothing happened. have re write again. problem keeps recurring , don't know why wont save. can place code since on 2000 lines , have moved on responsive side of site. but have applied every html file. <meta name="viewport" content="width=device-width, initial-scale=1.0"> and have used starting statement @media in css @media screen , (max-width:) css header img{ margin-left: auto; margin-right: auto; display: block; } footer img{ position:fixed; margin-left: auto; margin-right: auto; display: block; bottom: 5%; left: 40%; right: 40%; } .logo img{ position:fixed; margin-left: auto; margin-right: auto; display: block; bottom: 2%; left: 40%; right: 40%; } .home img...

php - Why does JSON have extra square bracket in output? -

my json (decoded) has square brackets after subdivisions part, can't target target other parts using, example, $resultarray['country']['geoname_id']; . why there pair of square brackets there? string(1461) "{"country":{"iso_code":"ca","names":{"pt-br":"canadá","es":"canadá","ru":"Канада","en":"canada","zh-cn":"加拿大","fr":"canada","de":"kanada","ja":"カナダ"},"confidence":99,"geoname_id":6251999},"location":{"longitude":-79.4886,"latitude":43.7496,"time_zone":"america/toronto","accuracy_radius":10},"subdivisions":[{"iso_code":"on","names":{"en":"ontario","zh-cn":"安大略","pt-br":"ontário",...

Socket error from within Rails app in Docker container connecting to remote MySQL DB -

i have rails app (running in production mode) in docker container linked container running mysql server instance. app running under nginx/passenger "app" user. i've configured production database under rails follows: production: adapter: mysql database: <%= env['mysql_production_database'] %> pool: 5 username: <%= env['mysql_user'] %> password: <%= env['mysql_pass'] %> host: <%= env['mysql_host'] %> port: <%= env['mysql_port'] %> with the environment variables set when container ran. can execute database-related rake commands (migrate, reset, etc.) when attached container (running root). however, when try load app in browser following error: can't connect local mysql server through socket '/var/run/mysqld/mysqld.sock' (2) activerecord (4.2.0) lib/active_record/connection_adapters/mysql_adapter.rb:456:in `real_connect' activerecord (4.2.0) lib/active_record/connec...

Form inside javascript not working -

i using javascript show sort of menu box clickable links changed mind , want use links forms now. <script type="text/javascript"> $('.mouseon-examples div').data('powertipjq', $( [ '<table class="tabulkajazyku"><form id="myformen" action="member" method="post"><input type="hidden" name="jazyk" value="en"><tr><td><a class="odkaz_cerveny odkaz_cerveny_block" href="#" id="mylinken"><img src="/images/flag_en.jpg" class="vlajky"><div class="posun5">en</div></a></td></tr></form><form id="myformes" action="member" method="post"><input type="hidden" name="jazyk" value="es"><tr><td><a class="odkaz_cerveny odkaz_cerveny_block" href="#...

javascript - Why is my images no fadding out? -

i got started jquery , javascript today, it's possible i'm doing basic wrong. have in mark-up, javascript defines section height viewer port height. inside have 4 each 1 containing 1 image, want them fade out 1 after other. here came with, it's doing nothing , have no clue why, tried debugging it, couldn’t find why well. can point out doing wrong? i'd accomplish simple full screen slide-show, because everywhere there ready use templates , i'd know how code scratch. here html <!doctype html> <html> <head lang="pt-br"> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!--css--> <link type="text/css" rel="stylesheet" href="css/reset.css"> <link type="text/css" rel="stylesheet" href="css/main.css"> <!--end css--> <!--script--> ...

java - new object created everytime -

i'm developing shopping cart app in android , novice. have been facing 1 problem now. can add item , adds cart. can edit quantity of item or remove listview after have added cart. so want disable addtocart button if present in cart in order avoid duplicates. every entry product taken new entry. think have not referenced properly. appreciated. this activity gets called every time press item (for example: dell inside laptops category) protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.productdetails); layoutinflater li; final list<product> cart = shoppingcarthelper.getcart();// //items cart int productindex = getintent().getextras().getint( shoppingcarthelper.product_index);// item no in list string product_string = getintent().getextras().getstring("product"); switch (product_string) { case "laptops": catalog = shoppingcarthelper....

VHDL using two components from a second file -

i have problem vhdl code, use mypackage.vhd contains components. here have added use work.mypackage.all; use necessary components part. part uses 2 components, 1 of them gives me error when try compile file. if include 2 components in same format, copy pasted components mypackage.vhd 1 , worked, once delete them use them mypackage.vhd gives me error. cant figure out problem thank in advanced helping. in short: have 2 vhd file, mypackage.vhd,with components , second 1 (alu.vhd) uses mypackage.vhd components (use work.mypackage.all;), looks cant identify alu_1 components mypackage.vhd. dont know why. here error: ** error (suppressible): c:/../alu_32.vhd(47): (vcom-1141) identifier "alu_1" not identify component declaration. the 2 components code uses: alu_32 has no error, alu_1 has error when tries use mypackage.vhd. component alu_1 port ( a, b, c_in, less : in std_logic; alucontrol : in std_logic_vector (3 downto 0); c_out, result...

html - Add extra class on basis of if ... else statement -

in view, i'm trying add additional class specification "active" on basis of page user on. have: <li <%= if current_page?(root_path) class="hvr-bottom active" : class="hvr-bottom" %>><a href=<%= root_path %>>home</a></li> this generates error: syntax error, unexpected keyword_class, expecting keyword_then or ';' or '\n' ... how should adjust code add additional class if specific page visited? your current ternary statement seems missing ? . try following: <li class=<%= current_page?(root_path) ? "hvr-bottom active" : "hvr-bottom" %>> ... </li> hope helps!

java - HTTP 415 Unsupported Media Type -

i have created sample web service make post call. i using jersey jax-rs, , maven. web.xml <servlet> <servlet-name>provider-serlvet</servlet-name> <servlet-class>com.sun.jersey.spi.container.servlet.servletcontainer</servlet-class> <init-param> <param-name>javax.ws.rs.application</param-name> <param-value>org.is.ws.provider.rest.provideraggregateapplication</param-value> </init-param> <init-param> <param-name>com.sun.jersey.api.json.pojomappingfeature</param-name> <param-value>true</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>provider-serlvet</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> pom.xml <!-- jersey jars --> <dependenc...

javascript - Why alert from external JS not appearing -

this question has answer here: why don't self-closing script tags work? 10 answers why no alert appear in following html? my html <!doctype html> <html> <head lang="en"> <meta charset="utf-8"> <title></title> <script src="a.js"/> </head> <body> </body> <html> a.js alert("hello"); you can't have self closing script tag. change script tag to: <script src="a.js"></script>

ios - Creating custom sqlite functions in Swift alone -

how can custom sqlite function added in swift? the following question addresses issue of using functions acos , cos in sqlite query involving coordinates: ios sqlite no such function: acos error the suggestion add custom function. example given in objective-c. other bridging objective-c there native swift function or library allows creation of custom functions? sqlite.swift provides type-safe swift interface creating custom sql functions (disclaimer: wrote , maintain sqlite.swift) . current version bridges objective-c internally, though implementation detail can ignore. future version use swift 2's function pointer api. , while can use c function pointers in swift 1.x @objc_block , unsafebitcast , it's quite bit worse read , maintain. the basic way create cos function: import sqlite import darwin // opens database connection let db = database() // defines "cos" function on connection db.create(function: "cos", argc: 1, determini...

c# - Why EF not updating FK column when entity state is not Added? -

i have such entity: public class entity1 { public short id { get; set; } public int entity2id { get; set; } public virtual entity2 entity2 { get; set; } } and have such 1 many relationship: this.hasrequired(m => m.entity2) .withmany() .hasforeignkey(m => m.entity2id) .willcascadeondelete(false); and here thinkg cannot understand: for example, evertyhting works fine if have changed entity state added firstly: context.entry(entity1).state = system.data.entitystate.added; entity1.entity2.id = 541; // since line `entity1.entity2id` value 0. context.entry(entity1.entity2).state = system.data.entitystate.unchanged; // fine, because `entity1.entity2id` value 541 also. context.entry(entity1).state = system.data.entitystate.unchanged; but, don't want change state added , when removing first line, exception occured: a referential integrity constraint violation occurred: property value...

web services - How do we use uri endpoint mapping in spring integration -

i trying configure spring integration using annotation. instead of payloadqnameendpoint mapping use uri endpoint mapping. found many examples default uri endpoint required annotation example without default end point. let's take annotationactionendpointmapping support in spring ws! see based on division between pojo methods , annotations on them. pojo main word there. kind of framework magic allow separate low-level protocol end-application business logic. other side spring integration's abstractwebserviceinboundgateway implements messageendpoint meaning whole soap hard work done in implementation. isn't pojo. of course topic different story, should understand here messageendpoint , methodendpoint work bit different. @ least messaging logic different levels of soap request. so, can't map <int-ws:inbound-gateway> @action or similar because whole soap endpoint already. from other side, having annotationactionendpointmapping java config, ca...

split user:pass to user and pass in c# -

so have program user uploads list of user:pass in format , need user in it's own string , pass in it's own string. example of tried string account = listbox1.selectedindex.tostring(); char[] delimiterchars = { ':' }; account.split(delimiterchars); i need front part of user string user , part string pass use string.split : var combined = "user:pass"; var split = combined.split(new[]{":"}); var user = split[0]; var password = split[1];

msbuild - TeamCity - The process cannot access the file * because it is being used by another process -

i'm using teamcity build , run mstest project. one job responsible building project, once has finished triggers second job responsible running compiled project using mstest. the problem when second job triggered following error displayed , job fails: starting: c:\...\jetbrains.buildserver.nunitlauncher.exe ... ... ... process cannot acces file 'c:\buildagent\work\{identifier}' because being used process. it seems job fails before mstest invoked.

java - Changes to my classes in Eclipse are not reflected when I run the project -

i wiped disk, have numerous backups of eclipse-related files. need seems here, whenever make changes classes, after quit , restart eclipse, changes aren't reflected when run program. changes still have been saved in .java files, don't compiled when run. things have done: project > clean (numerous times) project > build automatically checked i tried building manually several times no avail all hot code replace options enabled downloaded fresh copy of eclipse restored old eclipse folder before wipe i should using same settings before, when worked, , haven't changed operating procedures. project simple game, nothing outside box. checked build path, things there old class files. so that's situation. thoughts? not sure reasoning behind why happens, quick fix copy class separate project, copy back. fixed issue me.

python - removing items from current csv and saving it into another csv file -

i have csv file has 1000 entries (it delimitered tab). i've listed first few. unique id name 0 60ff3ads keith 1 c6lsi545 shawn 2 o87si523 baoru 3 om022ssi naomi 4 3lls34si alex 5 z7423dsi blahblah i want remove of these entries index number csv file , save csv file. i've not started writing codes yet because i'm not sure how should go doing it.. please kindly advise. a one-liner solve problem: import pandas pd indexes_to_drop = [1, 7, ...] pd.read_csv('original_file.csv', sep='\t').drop(indexes_to_drop, axis=0).to_csv('new_file.csv') check read_csv doc accommodate particular csv flavor if needed

objective c - When I iterate data from an array using for loop I get only the last string and the above strings are overlapped -

name *myname = [[name alloc] init]; (int = 0; i<[namearray count]; i++) { myname.name = [namearray objectatindex:i]; nslog(@"name: %@", myname.name); self.lblname.text = myname.name; } where, name nsobject class. namearray variable stored array objects. self.lblname outlet connected on view controller. question that, when log myname.name gives data when tried show data in viewcontroller(self.lblname.text) gives last object of array. how solve problem? can explain me solution? if want names in 1 label should append, not assign. right displaying last object. self.lblname.text = [nsstring stringwithformat:@"%@ %@",self.lblname.text, myname.name]; maybe better way have string variable , use later on present in uilabel: name *myname = [[name alloc] init]; nsstring *stringforlabel = @""; (int = 0; i<[namearray count]; i++) { myname.name = [namearray objectat...

javascript - Can I use Backbone with React Native? -

i have found several different examples of integrating react (view) backbone on web, not same react native. wondering if possible , if there samples play with. this ( https://github.com/magalhas/backbone-react-component ) seemed starting point, since don't have knowledge, not sure if can still used in react native. thanks. you'll able use parts of backbone, yes. backbone's views operate on dom in web browser, , since react native doesn't have that, you'll unable use backbone view as-is. however, notice backbone.react.component described "a mixin glues backbone models , collections react components". therefore works data layer of application, supplying data view. this useful in theory, in practice i've tried , doesn't work! said, did managed tweak code of backbone.react.component fix though, , demo works: 'use strict'; var react = require('react-native'); var backbone = require('backbone'); var backb...

javascript - How to make latest ember.js efficient and upgrading from 1.4 to latest? -

Image
i'm using ember.js , think programming part kind of cool, filesize on library kind of feels horrific. i had simple list-details view application created in 1.4 ember , picked latest ember.js upgrading project. supposedly need ember-template-compiler also. upgrading tips , advice on file size? i settled 1.8 version instead, seemed kind of compatible version. still upgrading advice helpful. i think first of should port application ember cli, won't need ember-template-compiler in production application. if you've read note compiling templates on server side vs client side there's information: if possible, best practice compile templates server side. faster due less total size (you don't need compiler on client) , less work app needs do. also code minified, jquery etc. goes 1 big file vendor.js , should focus on porting app ember cli solve problem @ least ember-template-compiler file.

tfs - Include branch name in post build event on Team Build -

i perform following steps in tfs build process: do post build event copy files compiled projects predefined directory, i'd directory path include branch name. i'd able refer branch name inside xaml workflow template well. the first 1 rather simple. when you're using new tfs 2013 build server , process template, can add post-build powershell script in build definition configuration, check in script , run during build. the second 1 dependent on whether you're using tfvc or git, in first case, use versioncontrolserver class query branchobjects, check 1 root working folder. aware though, in tfvc multiple branches can referenced in 1 workspace, there may multiple answers query, depending on file use find branchroot. custom codeactivity trick, similar this check in custom checkin policy . the code similar to: ibuilddetail builddetail = context.getextension<ibuilddetail>(); var workspace = builddetail.builddefinition.workspace; var versioncont...

Add repitition as list in case class (scala parser) -

i have following parser: import scala.util.parsing.combinator.regexparsers class simpleparser extends regexparsers { override val skipwhitespace = false private val eol = sys.props("line.separator") def word: parser[string] = "[a-z]+".r ^^ { _.tostring } def freq: parser[list[string]] = repsep(word, eol) ^^ { case word => word } } object testsimpleparser extends simpleparser { def main(args: array[string]) = { parse(freq, """mike |john |sara """.stripmargin) match { case success(matched,_) => println(matched) case failure(msg,_) => println(msg) case error(msg,_) => println(msg) } } } the result of execution list(mike, john, sara) isn't want. i'd have following case class: case class someentity(list: list[string]) and result following: someentity(list(mike), list(john), list(sara)). i want add lists there words new lines....

Display change in value of a cell in adjacent cell using excel VBA -

i have excel sheet display's price on items in column looking amazon api using excel vba. price of may change overtime. trying display difference in prices each time run macro, in cell adjacent cell displays price. not sure how achieve this. can body guide me on how achieve this? this sample, must adapted schema , data layout. prices stored in column a a1 a100 . have macro called refreshdata() updates column a . in b1 enter: =c1-a1 and copy down. macro store current values in column c before refreshing data: sub doupdate() range("a1:a100").copy range("c1") call refreshdata end sub column b display price difference.

angularjs - Dynamic dropdown not working on submit in angular js -

adding combobox or deleting combobox on clicking submit isn't working. calling function in scope when submit clicked. <html lang="en"> <head> <meta charset="utf-8"> <title>text box</title> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script> <script> angular.module('controllerasexample', []).controller('settingscontroller1', function ($scope) { $scope.combobox = [] $scope.adddropdown = function () { $scope.combobox.push(''); } $scope.deletedropdown = function (index) { $scope.combobox.splice(index, 1); } }); </script> </head> <body ng-app="controllerasexample"> <div id="ctrl-as-exmpl" ng-controller="settingscontroller1"> ...

ios - XCode error: cannot overwrite dSYM file -

Image
again , again on every project running i'm getting same error. deleting derived data helps, doesn't. this started after team leader had accepted new license agreement ios team development program, suppose, i'm not sure. what can cause of problem? how can fix it? (null): error: no such file or directory - old dsym file cannot overwritten: old: '/users/.../xcode/deriveddata/project-gzbujuaqsogtbwbatsbvviqtmsqf/build/products/debug-iphonesimulator/project.app.dsym/contents/resources/dwarf/project' update: also, i've noticed duplicated schemes appeared. i problem because had same target (the tests corresponding framework) repeated twice. delete 1 of them , problem disappear.

coding style - How can I define a subprocess in the __init__() part in Python? -

consider following class: import subprocess class fruits(): def __init__(self): self.terminal_width = 80 def start(self): p = subprocess.popen(["mplayer", "other", "args"]) print "subprocess started..." this code works. to gain more insight in best coding practices, i'm using pep 8 linter python. linter complains line p = subprocess.popen(["mplayer", "other", "args"]) : linter says because we're defining variable ( p ), should go __init__() method instead. i'm wondering how this, though. if transfer line __init__() in current form, subprocess start running when fruits() instantiated, not want. can me here? at first creating local variable. ok, lost when execution of method has finished. you want have instance variable. line has this: self.p = subprocess.popen(["mplayer", "other", "args"]) but p poor choice o...

qt - bitbake meta-toolchain-qt5 failed, cannot satisfy x11 although feature was removed -

building qt5 toolchain raspberry pi2 qt apps using yocto fido see tutorial . build machine nuc debian 7.8. succeeded build image perfectly, getting error while building toolchain. my local.conf , removed x11 feature machine = "raspberrypi2" license_flags_whitelist="commercial license" distro = "poky" dl_dir = "${topdir}/../dl" package_classes = "package_ipk" distro_features_remove = "x11 wayland" <========= # set rpi gpu memory 128mb gpu_mem = "128" my bblayers.conf # layer_conf_version increased each time build/conf/bblayers.conf # changes incompatibly lconf_version = "6" bbpath = "${topdir}" bbfiles ?= "" bblayers ?= " \ ${topdir}/../poky/meta-embarcados \ ${topdir}/../poky/meta-embarcados/meta-rpi \ ${topdir}/../poky/meta-qt5 \ ${topdir}/../poky/meta-raspberrypi \ ${topdir}/../poky/meta-openembedded/meta-oe \ ${topdir}/../poky/met...

spring boot - How to run flyway:clean before migrations in a SpringBoot app? -

i using springboot , flyway. migrations work fine wanted able perform clean flyway command when application context gets loaded test profile. is possible configure springboot clean , migrate if active profile test ? you can overwrite flyway autoconfiguration this: @bean @profile("test") public flyway flyway(datasource thedatasource) { flyway flyway = new flyway(); flyway.setdatasource(thedatasource); flyway.setlocations("classpath:db/migration"); flyway.clean(); flyway.migrate(); return flyway; } in spring boot 1.3 (current version 1.3.0.m1, ga release planned september), can use flywaymigrationstrategy bean define actions want run: @bean @profile("test") public flywaymigrationstrategy cleanmigratestrategy() { flywaymigrationstrategy strategy = new flywaymigrationstrategy() { @override public void migrate(flyway flyway) { flyway.clean(); flyway.migrate(); ...

Javascript Not deleting all cookies -

i using following code delete cookie: document.cookie = "cookiename=; expires=thu, 01 jan 1970 00:00:00 utc"; there 2 cookies, 1 in on domain www.websiteaddress.com , other on .websiteaddress.com . when on page www.websiteaddress.com cookie having domain address www.websiteaddress.com gets deleted other 1 not deleted. how can delete both cookies while loading javascript on www.websiteaddress.com you not allowed delete cookies on site. because there no guarantee own both www.websiteaddress.com , .websiteaddress.com . can delete cookies set current domain.

c++ - Private members of objects in an array not-modifiable -

i know there's lot of literature on this, still can't figure out. let me start general description of problem, , i'll post mcve. description : have array of objects - can values of private members, not set them. think it's how i'm writing setter methods, i'm not sure how modify make right. main.cpp store walmart; vip vip; // set vip points 100 vip.setpoints(100); walmart.setvip(vip, 0); cout << "points (before): " << walmart.getvip(0).getpoints() << endl; // set vip points 200 walmart.getvip(0).setpoints(200); cout << "points (after): " << walmart.getvip(0).getpoints() << endl; console output points (before): 100 points (after): 100 // <-- hoping 200! store.cpp void store::setvip(vip vip, int index) { this->vip[index] = vip; } vip store::getvip(int index) { return this->vip[index]; } vip.cpp void vip::setpoints(double points) { this->points = points; } doub...

c++ - std::bad_alloc at memory location (probably sth with creating dynamic tables) -

i've got problem creating dynamic table in c++. program breaks , shouts: unhandled exception @ at 0x75914598 in xxx.exe: microsoft c++ exception: std::bad_alloc @ memory location 0x0107f73c. i know there i'm missing if kind , point me , how repair it. ll has random value, (but if set value in code underneath i'm getting same error, problem following code), ganerated in function (problem code :/). full code: http://pastebin.com/gafjd5um code: #include <iostream> #include <math.h> #include <cstdio> #include <locale.h> #include <conio.h> #include <cstdlib> #include <time.h> #include <vector> class generatepass { private: //int length; int ll=5; char *lowertab; public: void chooselenght(); void createlist(); generatepass() { lowertab = new char[ll]; } ~generatepass() { delete[] lowertab; } }; void generatepass::createlist() { srand( time(...

angularjs - Angular js not updating local files -

i had angular app running fine last night, after opening tonight, app runs, changes made on files i.e store.controller.js , store.html no longer take effect time. for example: <h1>{{product.name}}</h1> var item = [{ name: 'shoe' }] should output "shoe". though, doesn't, it'll list old variable. 'find me'. it's no longer updating controller properly. ideas? can list more code if preferred. //store.html <div class="store-block"> <div ng-repeat="product in products" ng-show="product.canpurchase" class="item-panel"> <h1 class="pull-left">no expression</h1> <h2 class="pull-right">{{product.price | currency}}</h2> <div class="product-image clearfix"> <img ng-src="{{product.images[0]}}" /> </div> <section> <ul class="nav nav-pills pull-righ...

android - How to start an activity from an image button which is there in a fragment of a navigation drawer -

i'm have implemented navigation drawer fragments, i'm trying open activity fragments. there many fragments i'm posting 1 of them on here i.e us, wanna start activity or fragment (whichever more simple) on click of image button. aboutus.java package hind.jai.com.jaihind; import android.app.actionbar; import android.app.fragment; import android.content.intent; import android.os.bundle; import android.support.v4.app.fragmentactivity; import android.support.v4.app.fragmenttabhost; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.button; import android.widget.imagebutton; import android.widget.imageview; /** * created sukhvir on 17/04/2015. */ public class extends android.support.v4.app.fragment { imagebutton img; public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { return inflater.inflate( r...

angularjs - angular.js run code ONLY if window is in focus -

i have setinterval function runs every 5 seconds. want code inside function run if window infocus. i've tried doesnt seem work. $scope.myfunction = function() { var isonfocus = true; window.onblur = function() { isonfocus = false; } window.onfocus = function() { isonfocus = true; } if (isonfocus) { console.log("focused!"); } } setinterval(function() { $scope.myfunction(); }, 5000); i think looking angular's $window wrapper , defining isonfocus outside function lot, too. app.controller('ctrl', function($scope, $window) { var hasfocus; $scope.myfunction = function() { $window.onblur = function() { console.log('>onblur'); hasfocus = false; }; $window.onfocus = function() { console.log('>onfocus'); hasfocus = true; }; console.log(hasfocus ? 'focused' : 'not focused'); }; setinterval(function() {...

pgAdmin3 not see database postgresql -

i created db name " food " in command line in linux mint. import dump db, cant did it. my pgadmin didn't see db. try update list of db in pgadmin, try reinstall pgadmin, restart server. i cant import dump db in command line of official documentation command- "psql dbname < infile"( postgresql documentation ). in general, have upload dump( geonamesdb ) for example name of dump file- "_countries.sql". what should do, pgadmin see db " food ", , can import dump database. i use "createdb" command. help. solved problem. go file /etc/postgresql/9.4/main/postgresql.conf , see port in file 5433. changed 5432. , list of db in console=list of db in pgadmin3. should understand how upload _countries.sql db. @ finaly understand heppend. when installed postgresql @ first, installing bably. reinstall it(postgresql), , when found problem ports(5432, 5433) find lod version postgresql. in computer installen 2 postgresql. i...

Java Swing GUI Test Fest JPanel Fixture Error -

trying use fest test gui, i'm having problem trying access components contained inside custom jpanel (toppanel extends jpanel). code below failing when trying reference "toppane" exists field inside mainjframe. doing wrong here? public class stableappsuitest { private framefixture window; private jpanelfixture contentfixture; @before public void setup() { //assumes main class named "anagrams" , extends jframe: window = new framefixture(new mainjframe("title")); window.show(); contentfixture = window.panel("toppanel"); } @test public void shouldenteranagramandreturntrue() { // contentfixture.textbox("murlinputtextfield").entertext("www.google.com"); } @after public void teardown() { window.cleanup(); } } and here's stacktrace, in case it's hepful: unable find component using matcher org.fest.swing.core.n...