Posts

php - Strange behaviour of PHPUnit + Xdebug + PhpStorm -

i'm using phpstorm + xdebug + phpunit in shell on debian. works fine there strange behaviour, boring. when run phpunit command in shell, first break phpstorm show me in /usr/local/bin/phpunit in line check php version... but don't have put breakpoint in file. if (version_compare('5.6.0', php_version, '>')) { fwrite( stderr, 'this version of phpunit requires php 5.6; using latest version of php highly recommended.' . php_eol ); die(1); } in addition, file large remains blocked several seconds before can go ahead. any suggestion? make sure run | break @ first line in php scripts un-checked. but not here. if so: setting/preferences | languages & frameworks | php | debug uncheck force break @ first line when script outside project option -- based on description 1 responsible behaviour.

hibernate - grails postgressql not creating tables -

hi using grails 3 following dependency in build.gradle runtime group: 'org.postgresql', name: 'postgresql', version: '9.4.1209' my application.yml has following config hibernate: cache: queries: false use_second_level_cache: true use_query_cache: false region.factory_class: 'org.hibernate.cache.ehcache.ehcacheregionfactory' datasource: pooled: true jmxexport: true driverclassname: org.postgresql.driver username: postgres password: test environments: development: datasource: dbcreate: create-drop url: jdbc:postgresql://localhost:5432/devdb test: datasource: dbcreate: update url: jdbc:postgresql://localhost:5432/testdb production: datasource: dbcreate: update url: jdbc:postgresql://localhost:5432/proddb properties: jmxenabled: true initials...

python - To redirect os.system() output to a .txt file -

i'm new python. have list of unix commmands ("uname -a","uptime","df -h","ifconfig -a","chkconfig --list","netstat -rn","cat /proc/meminfo","ls -l /dev") , want run them , redirect entire output .txt file. searched lot didn't proper solution, or understood things wrongly. i'm able output on stdout loop can't redirect file. def commandsoutput(): command = ("uname -a","uptime","df -h","ifconfig -a","chkconfig --list","netstat -rn","cat /proc/meminfo","ls -l /dev") in command: print (os.system(i)) commandsoutput() this answer uses os.popen , allows write output of command in file: import os def commandsoutput(): commands = ("uname -a","uptime","df -h","ifconfig -a","chkconfig --list","netstat -rn","cat /proc/m...

javascript - How can I show SVG file on React Native? -

i want show svg files (i have bunch of svg images) thing couldn't find way show. tried use image , use components of react-native-svg don't work that. , tried native way it's hard work show svg image. example code: import svg, { use, image, } 'react-native-svg'; <view> <svg width="80" height="80"> <image href={require('./svg/1f604.svg')} /> </svgrn> </view> also know react native doesn't support svg think fix problem tricky way (with/without react-native-svg) after try many ways , libraries decided create new font (with glyphs app) , add svg files it, use "text" component custom font. hope have problem svg in react-native.

c# - How to set max FileSize of uploaded file with if-statement? -

i created <asp:fileupload id="fileuploadpassfoto"> on webpage. (asp.net , c#) i want check if uploaded file(image) bigger 6000kb. if true, file wont accepted , error message displayed. stored uploaded file following: (code behind) system.drawing.image photo = system.drawing.image.fromstream(fileuploadpassfoto.postedfile.inputstream); now want check if image bigger 6000kb. it works photo.size > size(6000kb). any suggestions? you can check this: decimal size = math.round(((decimal)fileuploadpassfoto.postedfile.contentlength / (decimal)1024), 2); if(size > 6000) { // size greater 6000kb }

c# - How to search string for a specific substring and get a number associated with that substring? -

i newbie learning c# , task @ hand: have text file json in it. in text file there multiple lines , each paragraph separated next through empty line. i want number associated substring "label " + number. see below. this example of input text file: {"menu": {"header": "menu", "items": [{"id": 27}, {"id": 0, "label": "label 0"}, null, {"id": 93}, {"id": 85}, {"id": 54}, null, {"id": 46, "label": "label 46"}]}} {"menu": {"header": "menu", "items": [{"id": 81}]}} {"menu": {"header": "menu", "items": [{"id": 70, "label": "label 70"}, {"id": 85, "label": "label 85"}, {"id": 93, "label": "label 93"}, {"id": 2}]}} what i'v...

octave - How to calculate Hamming distance in matlab for two vectors? -

i need calculate hamming distance between 2 vectors in octave. searching in internet, found hamming distance using function: pdist (), doesn't give me result, because pdist() missing function in octave. w= pdist([208 15 217 252 128 35 50 252 209 120 97 140 235 220 32 251], [231 174 143 43 125 66 49 143 48 139 81 103 154 229 93 229],1) i grateful if me please.