Posts

Showing posts from September, 2013

html5 - Whitespace at the top inside iframe? -

html5 - Whitespace at the top inside iframe? - iframe {margin:none;padding:none;} //inside content there 2 column separated div #left{margin-left 80px} #right {marigin-right 50px} but seems there blank space @ top of content, help? set on actual iframe too: <iframe marginheight="0" marginwidth="0" /> otherwise, content in iframe causing it, it's body { margin-top:0; } content in iframe needs set. html5 css3

ios - How do I send GPS location data (coordinates) from one iPhone to another -

ios - How do I send GPS location data (coordinates) from one iPhone to another - i creating find-my-phone app alerts users there phone @ if lost. problem having sending , receiving location info 1 ios device another. best approach handle situation? should utilize force notifications or background fetch? or there method? not want utilize third-party sites parse.com or quickblox.com. ios gps push-notification location apple-push-notifications

Intellij plugin api method forcePsiPostprocessAndRestoreElement purpose -

Intellij plugin api method forcePsiPostprocessAndRestoreElement purpose - i'm trying modify plugin supports older version of thought (ic-129). 1 of problems i've faced uses forcepsipostprocessandrestoreelement codeinsightutilcore class not exist in older sdk. after reading source code still don't understand method doing. can explain it's meaning or(and) point old way of doing same thing? when modifying psi, formatting applied @ end of write action or @ explicit phone call of dopostponedoperationsandunblockdocument. phone call may necessary if need modify document, otherwise you'll assertion psi modification not yet finish (formatting missing). since formatting alter document , psi, psielement have might invalidated, or @ to the lowest degree range changed. forcepsipostprocessandrestoreelement performs postponed formatting , tries find in updated tree psielement corresponding 1 you've held before, might need farther processing. alternativ

ios - how to call google page after shake -

ios - how to call google page after shake - i tried phone call google page after shake iphone.i tried this - (void)motionbegan:(uieventsubtype)motion withevent:(uievent *)event { if(event.type == uieventsubtypemotionshake) { [self shakemethod]; [self open]; } } -(void)shakemethod { cabasicanimation *shake = [cabasicanimation animationwithkeypath:@"position"]; [shake setduration:1.1]; [shake setrepeatcount:2]; [shake setautoreverses:yes]; [shake setfromvalue:[nsvalue valuewithcgpoint: cgpointmake(lockimage.center.x - 15,lockimage.center.y)]]; [shake settovalue:[nsvalue valuewithcgpoint: cgpointmake(lockimage.center.x + 15, lockimage.center.y)]]; [lockimage.layer addanimation:shake forkey:@"position"]; } -(void)open { [[uiapplication sharedapplication] openurl:[nsurl urlwithstring: @"http://google.co.in"]]; } two me

c# - Await results of several different asynchronous operations using Task.WhenAny -

c# - Await results of several different asynchronous operations using Task.WhenAny - i've been searching solution while seems must simple problem. however, every illustration find creates collection of task s similar 1 (taken how to: extend async walkthrough using task.whenall (c# , visual basic) page on msdn): ienumerable<task<int>> downloadtasksquery = url in urllist select processurlasync(url); i unable want phone call different async methods , await results... more (but not because doesn't seem anything): var gettickettasks = new list<task<ienumerable<iticket>>>(); gettickettasks.add(new task(() => model.getticketsasync(eventdate))); gettickettasks.add(new task(() => model.getguestticketsasync(eventdate))); ... gettickettasks.add(new task(() => model.getotherticketsasync(eventdate))); ienumerable<iticket>[] tickets = await task.whenall(gettickettasks); so how can phone call number of async methods , a

internet explorer - Unidentified 404 not found pages -

internet explorer - Unidentified 404 not found pages - we getting lot of 404 page not found error can't find reason same pattern. not doing redirect 404 pages or not giving link anywhere broken page links. the mutual point errors partly manipulated same pattern; removing first segment of url's. example; this true url's; site.com/category/news/title-of-the-content site.com/another-category/news/another-title-of-the-content ... this getting 404; site.com/category/news/ site.com/another-category/news/ ... we collection user agents 404 errors, , here are; mozilla/5.0 (compatible; msie 9.0; windows nt 6.1; trident/5.0) mozilla/4.0 (compatible; msie 7.0; windows nt 6.2; wow64; trident/6.0; .net4.0e; .net4.0c; .net clr 3.5.30729; .net clr 2.0.50727; .net clr 3.0.30729; infopath.2) mozilla/4.0 (compatible; msie 8.0; windows nt 6.1; trident/4.0; slcc2; .net clr 2.0.50727; .net clr 3.5.30729; .net clr 3.0.30729; i

twitter bootstrap - Can't read 'package:rikulo_commons/html.dart' (Could not find asset rikulo_commons|lib/html.dart.) -

twitter bootstrap - Can't read 'package:rikulo_commons/html.dart' (Could not find asset rikulo_commons|lib/html.dart.) - after next directions at: https://github.com/rikulo/bootjack when seek "generate js" dart editor error message: [info dart2js]: compiling stratoide|web/ide.dart... [error dart2js on stratoide|web/ide.dart]: packages\bootjack\bootjack.dart:8:8: can't read 'package:rikulo_commons/html.dart' (could not find asset rikulo_commons|lib/html.dart.). import 'package:rikulo_commons/html.dart'; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [info dart2js]: took 0:00:01.048060 compile stratoide|web/ide.dart. [info dart2js]: compiling stratoide|web/index.dart... [error dart2js on stratoide|web/index.dart]: packages\bootjack\bootjack.dart:8:8: can't read 'package:rikulo_commons/html.dart' (could not find asset rikulo_commons|lib/html.dart.). import 'package:rikulo_commons/html.dart'; ^^^^^^^^^^^^^^^^

c - Error compiling Linux kernel module using custom system calls -

c - Error compiling Linux kernel module using custom system calls - i'll walk through step step first edit 3 files in linux kernel directory open linux_directory/arch/x86/syscalls/syscall_64.tbl , add together custom calls i'm implementing – using appropriate format declare them here: linux_directory/include/linux/syscalls.h – using appropriate format: open linux_directory/makefile , add together directory i'm storing new scheme calls core-y line: core-y := usr/ my_system_call_directory/ here's i'm having issues. within linux_directory/my_system_call_directory add together c file custom scheme phone call definitions , corresponding makefile . leave definitions empty because within c file kernel module declare extern function (my custom scheme call) , define separate function set extern function: extern long (*start_shuttle)(void); long my_start_shuttle(void) { // stuff here } int init_module(void) { // stuff here

r - Converting column values to row and column names -

r - Converting column values to row and column names - i have dataset 2 columns, x$x0 , x$x1 , below values in dataset x, there more 1234876 observations in datasets because of many duplicate values. x0 x1 ---------------- 0 1 0 2 1 0 1 3 2 1 2 3 . . . . . . 1234876 1230000 i want create matrix using unique values in column1 (x$x0) , unique values in column2 (x$x1). values in x$x0 row names , values in x$x1 column names. then assign value 1 cells relation exits between x$x0 , x$x1 , final results should this..... | 0 1 2 3 .......1230000 -------------------------------- 0 | 1 1 | 1 | 1 1 | 2 | 1 1 | 3 | | . | | . | | . | | 1234876 | |

javascript - Dynamic variable name of scope -

javascript - Dynamic variable name of scope - i seek define dynamic variable name in angularjs foreach, : angular.foreach($scope.posts, function (item) { // counter increment counter++; var idpage = 'feed' + counter; feedservice.parsefeed(url).then(function(res) { $scope.window[idpage] = res.data.responsedata.feed.entries; }); }); so, it's doesn't work , have error : cannot set property 'feed1' of undefined what's right syntax ? does $scope object have window property? if yes, go maxim's answer. if not, seek this: angular.foreach($scope.posts, function (item) { // counter increment counter++; var idpage = 'feed' + counter; feedservice.parsefeed(url).then(function(res) { $scope[idpage] = res.data.responsedata.feed.entries; }); }); edit: working plunkr: http://plnkr.co/edit/evljkisplwkpcyag7l8w?p=preview javascript angularjs syntax

windows 7 - How do I get MKS sed to output this double quote? -

windows 7 - How do I get MKS sed to output this double quote? - the line echo xxx | sed "s/xxx/a""b/" outputs ab rather than a"b as expected. what's fix? use below command: $ echo xxx | sed s/xxx/a\"\"b/ output : a""b please note ("(quote)should escaped, need twice that's trick here) windows-7 cmd mks

php - HTAcess ReWrite Rules Conflicting? -

php - HTAcess ReWrite Rules Conflicting? - i have 2 re-wrtie rules 1 vanity url illustration domain.com/url , 1 edit info aka post. for reason first rule taking place , not both why , how can prepare it?? here's code rewriteengine on # create sure match on files/directories don't exist rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritebase / # rewrite first part after `/` `username` parameter rewriterule ^(.+)$ groups/index.php?gname=$1 [l,qsa] rewriterule ^edit/id/([0-9]+)/?$ groups/view_update.php?pid=$1 [nc,qsa,l] thanks :) rewritecond applicable next rewriterule not rewriterule . alter order of rules. change code this: rewriteengine on # create sure match on files/directories don't exist rewritebase / # rewrite first part after `/` `username` parameter # skip rewrite rules file or directories rewritecond %{request_filename} -f [or] rewritecond %{request_filename} -d rewriterule ^ - [l] rewriterule

javascript - How to set for erb? -

javascript - How to set <a title=""> for erb? - i'm trying erb link display text when mouse hovered on it. <a title="hover">text</a> works on normal text, can't work on link. here's tried, nothing: <a title="hover"> <%= link_to "all", "all/allthings" %> </a> am going have resort using javascript? try this: <%= link_to "all", "all/allthings", title: 'hover' %> more info on: link_to javascript html ruby-on-rails ruby hover

php - __get causes "Cannot assign by reference to overloaded object" -

php - __get causes "Cannot assign by reference to overloaded object" - class { } class b { public function __get($name) { // nil } } // works $a = new a; $x = new stdclass(); $a->test =& $x; // fatal error: cannot assign reference overloaded object on line 21 $b = new b; $y = new stdclass(); $b->test =& $y; how , why existence of magic getter cause error? php overloading getter

sql server - Why should I use stored procedures to perform INSERT, UPDATE and DELETE operations? -

sql server - Why should I use stored procedures to perform INSERT, UPDATE and DELETE operations? - an reply question states "ideally, though, not allow advertisement hoc dml against tables, , command dml through stored procedures." why ideal? problem solve versus granting select, update, insert, delete tables user needs manipulate? views , stored procedures api. allow hide implementation, version changes, provide security , prevent unfortunate client operations "get fields invoices since company started". views , stored procedures allow dba modify schema meet performance requirements without breaking applications. info may need partitioned horizontally or vertically, split across files, fields may have added or removed etc. without stored procedures, these changes require extensive application changes. by controlling stored procedures , views each application uses can provide versioning of schema changes - each application see database api exp

c# - Why does SharpDevelop return me this error: Operator '/' cannot be applied to operands of type 'double' and 'System.Numerics.BigInteger'? -

c# - Why does SharpDevelop return me this error: Operator '/' cannot be applied to operands of type 'double' and 'System.Numerics.BigInteger'? - i'm total novice. i've created c# programme on sharpdevelop uses biginteger structure. here is: using system; using system.numerics; using system.linq; namespace hcc { class programme { public static void main(string[] args) { biginteger[] hcc = new[] { biginteger.parse("2"), biginteger.parse("4"), biginteger.parse("6"), biginteger.parse("12"), biginteger.parse("24"), }; double s; int i; s=0; for(i=0; i<hcc.length; i++) { s=s+1.0/hcc[i]; } console.write(""+s); console.readkey(true); } } } note: i've set first 5 ones, there 1000 big integers.

delphi - Forms create same time -

delphi - Forms create same time - i have 2 forms, , want firstly create main form , if user click button, send variable , create sec form. but in code, when had started application, tried create 2 form, application crushes because sec form has not parameter yet. main form call: procedure tform1.listitemclick(const sender: tobject; const aitem: tlistviewitem); var item: tlistviewitem; begin item:= aitem; zipid:= item.text; form2.show; end; second form: var form2: tform2; zipid: string; implementation {$r *.fmx} uses main; procedure tform2.imageclick(sender: tobject); var image: timage; i: integer; begin image:= sender timage; if rects[image.tag-1].fill.color = talphacolorrec.gray begin rects[image.tag-1].fill.color:= talphacolorrec.blue; rects[image.tag-1].tag:= 1; end else begin rects[image.tag-1].fill.color:= talphacolorrec.gray; rects[image.tag-1].tag:= 0; end; end; procedure tform2.formcreat

sql - Case statement errors with unneccessary conversion -

sql - Case statement errors with unneccessary conversion - i'm scripting view, shown below, i'm experiencing issues lastly 5 selects. i'm pulling table int values contains nulls. i'd null values these 'rep' columns outputted 'n/a' logic in case statements throwing errors trying convert n/a int. i think somewhere along line in case statements, it's setting nulls n/a , trying add together values onto int appreciate help might falling over. many thanks! select --name exercisecultures.name, --weight case when weight null '0' else case when type = 'isolation' case when reps1 < '12' , reps2 < '12' , reps3 < '12' weight else case when exercisecultures.name in ( 'hammer curls', 'concentration curls' ) workoutsessions.weight + ( 2.0 ) else workoutsessions.weight + ( 2.5 )

Java String to array of bytes wrong conversion -

Java String to array of bytes wrong conversion - i have client server java code , client reading in string "input" , should decrypt it, decryption function needs array of bytes, need convert string array of bytes, done using "getbytes()" function, seems function modifying string! how can convert string array of bytes without changing content. string input = inputline.substring(66, inputline.length()); system.out.println("read message +"+input+"+"); byte[] bx = input.getbytes(charset.forname("utf-8")); system.out.println("read message +"+bx.tostring()+"+"); system.out.println("read message +"+bx+"+"); the output of code snippet follows: read message +[b@161cd475+ read message +[b@4e25154f+ read message +[b@4e25154f+ try writing loop print out results. believe java spitting out random memory value output. (int = 0; s <= bx.length;i++) { system.out.prin

javascript - AngularJS : date-time picker (vs) zoom in graph : one or the other not working -

javascript - AngularJS : date-time picker (vs) zoom in graph : one or the other not working - in angularjs application, trying draw graph based on user's selection of period of time (which uses date-time picker). screenshot below : when using 1.7.1 am using bootstrap js date-time picker. issue when utilize jquery version 1.7.1, graph zoom works, date-time picker doesn't work. error in browser console : error: failed execute 'appendchild' on 'node': new kid element null. @ error (native) @ function.f.extend.clean (https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js:4:4522) @ function.f.buildfragment (https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js:4:2303) @ f.fn.extend.dommanip (https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js:4:1672) @ f.fn.extend.append (https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js:3:31818) @ datetimepicker.filldate (http://192.168.0.103:

java - Regex for extract URL values -

java - Regex for extract URL values - i have different list of urls, need find next url <a class=\"subprocess\" href=\"/nikkshow/tlprocessview.do?id=5397458\"> view g </a> 5397458 - number can different. view g - can view or b or c ... after finding url, need extract value "view g" url. i'm new regex please help me solve if backslashes in html code accident, regexp : <a[^>]+href="([^>"]*)"[^>]*>([^<]*)<\/a> example : http://regex101.com/r/xo1wg2/4 with backslashes : <a[^>]+href=\\"([^>"]*)\\"[^>]*>([^<]*)<\/a> example : http://regex101.com/r/xo1wg2/5 java regex parsing screen-scraping

https - SSL/TLS process problems, maybe TLS Record layer issue -

https - SSL/TLS process problems, maybe TLS Record layer issue - i'm developing server handling ssl. can process ssl request browser. request begins this: 0001 0110 0000 0011 0000 0001 meaning: (0001 0110) 22, handshake record. 0000 0011 3, 0000 0001 1, means ssl version 3.1 the server works fine request browser. charles http proxy / http monitor / reverse proxy enables developer view of http , ssl / https traffic between machine , internet. but when turn on charles ssl proxying, charles man-in-the-middle, although request started browser, server got request charles. request begins this: 1000 0000 0110 1110 0000 0001 then don't know how process @ all. me it's not next ssl protocol. ideas? i found reason. it's 'version 2.0 client-hello message'. 'note message must sent straight on wire, not wrapped tls record.' the detail here: http://tools.ietf.org/html/rfc5246#appendix-e.2 ssl https proxy

java - Program should wait after Textfield changed its text -

java - Program should wait after Textfield changed its text - my testprogram should alter textviews text , after done, should wait on sec before next text change. programme runs text changes instant behind each other: t.settext("test!"); handler handler = new handler(); handler.postdelayed(new runnable() { @override public void run() { t.settext("test - after 1 second!"); } },1000); the first text not there close second. hard why wouldn't work limited amount of code can add together post delayed view . don't need handler. t.settext("test!"); t.postdelayed(new runnable() { @override public void run() { t.settext("test - after 1 second!"); } }, 1000); all views in android have built in handler class. java android

android - Maps API release key not working -

android - Maps API release key not working - i finished first app uses maps api , maps fragment. works fine debugging decided create signed apk. signed apk work maps api need new key. here how tried it: 1) generate signed apk 2) create new keystore file ending .jks 3) apk succesfully created (this apk doesn't contain new key yet) configuration on demand incubating feature. :app:prebuild :app:prereleasebuild :app:checkreleasemanifest :app:predebugbuild :app:preparecomandroidsupportappcompatv72100library up-to-date :app:preparecomandroidsupportsupportv42100library up-to-date :app:preparecomgoogleandroidgmsplayservices6171library up-to-date :app:preparereleasedependencies :app:compilereleaseaidl :app:compilereleaserenderscript :app:generatereleasebuildconfig :app:generatereleaseassets up-to-date :app:mergereleaseassets :app:generatereleaseresvalues up-to-date :app:generatereleaseresources :app:mergereleaseresources :app:processreleasemanifest :app:processreleaseresour

amazon s3 - proper s3 directory stucture in java -

amazon s3 - proper s3 directory stucture in java - bucket1 folder1 file1 file2 folder3 file3 folder4 file6 folder2 file4 file5 file 7 file 8 i want folder1, folder2, file7 , file8 only. how that? don't want recursive folders/files in side folder or bucket. not clear on working of marker, delimiter , prefix. i trying: bucketname = "bucket1"; prefix = ""; delimiter = ""; marker = ""; listobjectsrequest listobjectsrequest = new listobjectsrequest() .withbucketname(bucketname).withprefix(prefix) .withdelimiter(delimiter) .withmarker(marker) ; as of knowledge cant this. since there no file , folder architecture here treated object. have iterate on objects , have create own logic solution. java amazon-s3 directory folder subfolder

How to load .html page with python on app-engine -

How to load .html page with python on app-engine - in next example, .html info in same file python code (as variable main_page_html ). if want .html content in own different file, must utilize jinja2 load it? or there simpler approach? import cgi google.appengine.api import users import webapp2 main_page_html = """\ <html> <body> <form action="/sign" method="post"> <div><textarea name="content" rows="3" cols="60"></textarea></div> <div><input type="submit" value="sign guestbook"></div> </form> </body> </html> """ class mainpage(webapp2.requesthandler): def get(self): self.response.write(main_page_html) class guestbook(webapp2.requesthandler): def post(self): self.response.write('<html><body>you wrote:<pre>') self

Removing a certain part of a string in python -

Removing a certain part of a string in python - "submitted 1 year ago bagelpirate /r/books" basically i'm learning web scraping , pulled info html of reddit page. need "bagelpirate" out of string. there way in python? given starting string: s = "submitted 1 year ago bagelpirate /r/books" you (finding position of preceding , next substrings): name = s[s.index(' ')+4:s.index(' /r/books')] or utilize regular expression: import re name = re.search(' (.+) /r/books', s).group(1) that means, 'find "by (something) /r/books" in string , give me part indicated parentheses'. it kind of depends format strings going in. python

jQuery Mobile Panel / jQuery Cookies -

jQuery Mobile Panel / jQuery Cookies - i creating jquery mobile site (1.4.2) , using panels. have set script open panel on load if window width gt 768. works fine exception of users close panel , want maintain closed while doing tasks, thinking of setting cookie value when close panel , run script opens panel if cookie not set. for initial script have next , - <script> $(document).on('pageinit', function() { var width = $(window).width(); if(width > 768) { $('##bluebuttonspanel').panel('open'); } }); </script> using jquery cookie plugin setting cookie - <script> $(document).on('pageinit', function() { if( $('.ui-panel').hasclass('ui-panel-closed') == true ) { $.cookie('panel','is-hidden'); } else { $.cookie('panel','is-visible'); }; }); </script> where confused trying alter value of cookie when clic

c++ - Preprocessor test for equality always evaluates true -

c++ - Preprocessor test for equality always evaluates true - using this: -dme=awesome and this: #if me==awesome #error im awesome! #endif yields this: registers.cpp:59:2: error: #error im awesome! but this: #if me==notsogreat #error im confused! #endif yields this: registers.cpp:59:2: error: #error im confused! note doing -dme=awesome equivalent source file starting with: #define me awesome now let's @ #if me==awesome . token replacement changes me awesome , final version of line is: #if awesome==awesome when utilize == in preprocessor, alphabetic token not #define d else, gets replaced 0 . tests #if 0 == 0 true, error displayed. now, looking at: #if me==notsogreat after token replacement is: #if awesome==notsogreat which 1 time again equivalent #if 0 == 0 , true. if had #define awesome 5 before this, find first test true sec test false. i guess trying observe if me had been defined awesome t

configuration - Prevent TFS to checkin unchanged files -

configuration - Prevent TFS to checkin unchanged files - it seems mutual problem vs checkout files unchanged. lately files included in check-in if 1 doesn't capture files unchanged. is there policy or mechanism prevents check-ins unchanged files? tfs doesn't checkin unchanged files. appear in pending changes if @ history of checkin afterwards, you'll see files not included. don't worry them! of course of study if files are included in checkin, must have changed within files. maybe formatting, line endings, encoding. diff using beyond compare or see changed. configuration visual-studio-2013 tfs2013 checkin

Excel VBA: How do I format just certain words within a cell -

Excel VBA: How do I format just certain words within a cell - i have not yet got head around vba other recording macros. could talk me through how edit text within cell? have cell (y2) filled text want "university of" stand out (either in different colour or making bold). because i'm absolute novice vba, please can reply literally opening vba editor. thank much community! try mate. set vba: sub macro1() range("y2").characters(start:=1, length:=13).font.fontstyle = bold end sub excel vba excel-vba

hibernate - How to use DisplayTag with nested Lists and Properties in Struts 2 -

hibernate - How to use DisplayTag with nested Lists and Properties in Struts 2 - i'm trying display list. within list there list want display. struts code looked this: <s:iterator value="lendinglist"> <tr> <td><s:property value="lendby.matnumber" /> <s:property value="lendby.firstname" /> <s:property value="lendby.name" /></td> <td><s:property value="date" /></td> <td><s:iterator value="publication"> <s:property value="isbn" /> </s:iterator></td> <td><s:iterator value="publication"> <s:property value="title" /> </s:iterator></td> <td><s:property value="returndate" /></td> <td><s:property value="remindpro

c++ - Alternative for virtual template functions -

c++ - Alternative for virtual template functions - i have abstract ui class needs able inquire user input. function templated because different things can asked for. however, function must virtual because want derived classes of ui able provide own implementations (a commandlineui need behave differently webbasedui ). class ui { // ... public: // inquire input template<t> virtual t askfor(const std::string& mesg) const = 0; // inquire provide default fallback template<t> virtual t askfor(const std::string& mesg, const t& def) const = 0; } class commandlineui : ui { // ... public: template<t> virtual t askfor(const std::string& mesg) const { // implementation details } template<t> virtual t askfor(const std::string& mesg, const t& def) const { // implementation details } } the above

php - Value of stream_get_contents isn't actual value -

php - Value of stream_get_contents isn't actual value - i'm trying create online editor cms panel. if click on file online file returned me php/html etc. in it. problem when utilize function stream_get_contents i'm not getting want... this php part file: $fileadresroot = $_server['document_root']; if(empty($_get['name'])) { header('location: ftp-directory'); exit(); } else { $filename = trim($_get['name']); $fileadres = $fileadresroot.'/'.$filename.''; } if(isset($_get['doublename'])) { $filemaps = trim($_get['doublename']); $fileadres = $fileadresroot.'/'.$filemaps.'/'.$filename.''; } $filecontents = fopen($fileadres, 'rb', false); $filecontent = stream_get_contents($fileconte

php internals - why is this valid PHP code -

php internals - why is this valid PHP code - put php interpreter , won't show errors. doesn't right me. can shed lite on why works? i'm looking insight on lexer/parser. <?php -01;[];[];[];4;[[-1]]; although code seems have proper syntax, doesn't is. there lack of line-breaks, looks jumbled together, does have proper syntax semi-colons @ end of each statement. if rewrite code more legible, this: -01; // negative number meaningless 0 padded in front end of it. []; // empty array isn't assigned variable, hence useless; []; // same []; // same 4; // again, number isn't assigned variable nor expression. [[-1]]; // multi-dimensional array -1 inner arrays value, isn't assigned either. valid code, useless. php php-internals

html - element with class not taking its class CSS properties -

html - <a> element with class not taking its class CSS properties - why elements classes not taking respective class (.1stbtn , .2ndbtn) css properties in next example: html: <div class="herocontent"> <a class="1stbtn" href="classes.html">button 1</a> <a class="2ndbtn" href="http://eepurl.com/vsodx">button 2</a> </div> css: .herocontent { display: inline-block; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; font-size: 16px; font-weight: bold; padding: 14px 20px; border: 1px solid red; } .1stbtn { background-color: green; color: black; margin-right: 10px; } .2ndbtn { background: none; border: 1px solid #fff; color: #fff; } .herocontent a:hover { background-color: black; color: white !important; text-decoration: none; } in jsfiddle: http://jsfiddle.net/tej5esho/3/ jus

html - Support IE 8 and IE Edge -

html - Support IE 8 and IE Edge - i want have page load back upwards ie8 , ie11. means ie9 browsers should load page ie8, , ie11 should load ie11. have tried no success: <meta http-equiv="x-ua-compatible" content="ie=7; ie=9" /> is right way include tag? html internet-explorer cross-browser

security - how to asp.net mvc permission by action? -

security - how to asp.net mvc permission by action? - i need create custom authorization , authentication user security looping on area/controller/action list (that dynamically saved in database) , action assign user admin , solution? (i need dynamic authorization , authentication instead of authorization tag on action. how can write it?) one of main selling points of mvc architecture decoupling interface, views or urls, underlying architecture of controllers, actions, etc. you're proposing isn't horrible, it's not ideal, either. if need add together new action? if need remove action. if need move duties of 1 action different action. of these things fundamentally alter permissions, requiring lot of maintenance. this job improve suited roles, , that's roles exist for. if want command can edit widget, don't give them explicit access widgetarea > widgetcontroller > editwidget; give them role of caneditwidget . then, action involves editing widge

Build tree from input file on java -

Build tree from input file on java - i stuck @ next problem: have these input file, , have restore tree schema it. i'm new in java, had read lot , have difficulties task. please give me ideas help. in advance! and next file: http://universumerp.com/sites/default/files/treedata.txt and 1 time 1 time again give thanks you! from file can info represent comma separated values id,parantid,value from first thought 3rd value flag 'haschild' not. decide count on id , parentid. on sentiment need next steps parse file , hierarchy nodes create map parent kid print tree finally import java.io.*; import java.util.*; public class showhierarchy { public static final void main(string[] args) { showhierarchy hierarchy = new showhierarchy(); //1)parse file , hierarchy nodes // added hashmap<integer, hierarchyitem> allitems hierarchy.parsefile("c://tree.txt"); //2) create map parent children hashmap<integer,

call php script from another php script multiple time -

call php script from another php script multiple time - i have code read info database, , phone call php script (hostes on server) sending retrieved data. code: while ($rs = mysql_fetch_array($quary_result)) { $fields = array( 'field1' => $rs['field1'] ); $postvars = http_build_query($fields); $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_post, count($fields)); curl_setopt($ch, curlopt_postfields, $postvars); $result = curl_exec($ch); curl_close($ch); } but code executed once. query 200 results, while executed 1 time. what's wrong? you have impression executed once... your code says this: while $rs = mysql_fetch_array($quary_result) true { } then $result var overwritten @ each entering in while loop. seek converting $result var array of result , print array see if have values like: $result[] = curl_exec($ch); echo '<pre>'; print_r($r

javascript - Disable changing of border-color with given class -

javascript - Disable changing of border-color with given class - if add together "orange" before "orange" readonly . input have reddish borderline input read-only w/c wrong. dont want read-only input (supposedly database mark duplicate or have reddish borderline) current output: apple [read-only] orange // *added user* orange[read-only] //borderline changed reddish when button save clicked wanted output: apple [read-only] orange // *added user* , borderline changed reddish when button save clicked orange[read-only] see fiddle demo , seek click add together row button before row "orange" value input field "orange" value of input. $("#save").off("click").on("click",function(){ var existing = []; var duplicates = $('#mytable td:nth-child(3) input').filter(function() { var value = $(this).val(); if (existing.indexof(value) >= 0) { homecoming

How to create a database that updates by connecting to an online server - Android -

How to create a database that updates by connecting to an online server - Android - i trying create proclamation app organization. using listview display announcements in activity. have listview set up, each item in list have title, , subtitle (describing announcement). when user clicks on announcement, taken new activity title @ top , info in paragraphs under it. however, want app update weekly accessing online database containing list of announcements (i have domain maybe can host under own ip address). thought app update on weekly basis , update device's storage new announcements (so users can view offline). i have no thought start. first android app, beginner - have intermediate experience in java. have lots of experience excel, , sql through ms access. don't know how set java create online database android. thank help! that might not need this link has great info on how connect android app external database. hope helps. android sql-server dat

symfony2 - Not able to get children of children using StofDoctrineExtension Tree -

symfony2 - Not able to get children of children using StofDoctrineExtension Tree - i have database created dynamically trial purposes. created parent(home), set children , created children of children(sub children can say). now want list of sub-children. my code $pages = $this->getdoctrine()->getrepository('bloggerblogbundle:page'); $nodes = $pages->getchildren(); $parent = $nodes[0]; //get parent node $rootnodes = $parent->getchildren(); // children of parent nodes foreach($rootnodes $node) { $nodes = $node->getchildren(); // children of children } now returning $nodes view , in homecoming sub-children of 1 children node instead of sub-children of children. what error making here? please help, !!! you resetting nodes variable on each foreach. to nodes create array , add together subsequent nodes onto end of that. $pages = $this->getdoctrine()->getrepository('bloggerblogbundle:page

python - Delete item from list if it contains a substring from a "blacklist" -

python - Delete item from list if it contains a substring from a "blacklist" - in python, i'd remove list string contains substring found in called "blacklist". for example, assume list following: a = [ 'cat', 'doxxxg', 'monkey', 'hobbbrse', 'fish', 'snake'] and list b is: b = ['xxx', 'bbb'] how list c: c = [ 'cat', 'monkey', 'fish', 'snake'] i've played around various combinations of regex expressions , list comprehensions can't seem work. you bring together blacklist 1 expression: import re blacklist = re.compile('|'.join([re.escape(word) word in b])) then filter words out if match: c = [word word in if not blacklist.search(word)] words in pattern escaped (so . , other meta characters not treated such, literal characters instead), , joined series of | alternatives: >>> '|'.join([re.e

Angularjs $http.post gives 401 error response . Laravel with oauth2-server -

Angularjs $http.post gives 401 error response . Laravel with oauth2-server - i using oauth2-server-laravel bundle angularjs client. have implemented it's password method works fine requests. when seek $http.post on secure link. gives next error 401. {"status":401,"error":"unauthorized","error_message":"access token missing"} this happening post request done angularjs. (i tried sending access_token both post parameter , http header.) when using chrome rest app postman works fine! when remove oauth filter route works fine in angular. so might problem oauth2-server-laravel bundle or angularjs i have added code filters.php back upwards cors. app::before(function($request) { // if($_server['request_method'] === 'options') { $statuscode = 204; $headers = [ 'access-control-allow-origin' => 'http://localhost:8100', 'ac

arrays - Python segmentation fault -

arrays - Python segmentation fault - i running script in python, read file several lines 7 columns. i using regular expressions read trough file , create numpy array it; problem not in reading file reg ex, in loop run on lines. at first created mock file of 1000 lines within script itself, read it, looped on , worked fine. now i've received real info , 50 files ~8000 lines each, , if run script on 1 of these segmentation fault. have noticed different behaviours if input file extension .dat or .txt: if .txt segmentation fault, if .dat after while pc "freezes" , can't move cursor on desktop, have shut downwards forcefully. can explain that? #!/usr/bin/env python __future__ import partition # no more "zero" integer partition bugs!:p import os import numpy np import re import gzip file_binaries = open('binaries_all.txt', "r") stars = open('star.50a.txt', "r") output = file('star_out.dat', "w&q

Swift - Drawing text with drawInRect:withAttributes: -

Swift - Drawing text with drawInRect:withAttributes: - i have unusual problem xcode 6.1 gm. let text: nsstring = "a" allow font = nsfont(name: "helvetica bold", size: 14.0) allow textrect: nsrect = nsmakerect(5, 3, 125, 18) allow textstyle = nsmutableparagraphstyle.defaultparagraphstyle().mutablecopy() nsmutableparagraphstyle textstyle.alignment = nstextalignment.lefttextalignment allow textcolor = nscolor(calibratedred: 0.147, green: 0.222, blue: 0.162, alpha: 1.0) allow textfontattributes = [ nsfontattributename: font, nsforegroundcolorattributename: textcolor, nsparagraphstyleattributename: textstyle ] text.drawinrect(nsoffsetrect(textrect, 0, 1), withattributes: textfontattributes) error in line allow texfontattributes... cannot convert expression's type 'dictionary' type 'dictionaryliteralconvertible' this code worked until xcode 6.1 gm. when i'm tried declare textfontattributes nsdictionary error

.net - Weird multi-thread high CPU usage - "stealing" all threads? -

.net - Weird multi-thread high CPU usage - "stealing" all threads? - i'm having weird issue in multithreaded .net application. sometimes, go state process consumes much cpu can. when grabbed these numbers, total process cpu usage @ 98%. cpu usage of individual threads follow distinct pattern: tid cpu 4324 ~32% 2708 ~ 9% 4936 ~ 3% [about 10 more threads ~3% cpu usage] the tids of course of study vary 1 run another. usage numbers vary on time, 2 @ top remain in position. when happens, application appears produce no more useful work. instance, not take new calls wcf service. nor background threads rely on timer produce expected output in log files (so either don't run, or logging blocked (log4net). i can't seem figure out what's happening. does thread cpu usage pattern suggest particular problem? this happens in 2 of applications, share little of own code. one wcf server, other wcf client. the wcf server uses nhibernate (wit

java - WSDL wsimport error -

java - WSDL wsimport error - i have external application has published wsdl..i'm able nail wsdl in browser when seek generate java objects using wsimport failing multiple errors. i tried contact team supports service mentioned can't back upwards wsimport tool.. question- if i'm unable generate classes, there other access service? i have both wsdl , endpoint. alternative way? java web-services soap wsdl

linux - Division in assembly program -

linux - Division in assembly program - this code : section .bss ;uninitialized info average resb 5 num1 resb 5 num2 resb 5 num3 resb 5 section .text global _start ; create main function externally visible _start: ;user prompt mov eax, 4 mov ebx, 1 mov ecx, messaging mov edx, lenmessaging int 0x80 ;read , store user input mov eax, 3 mov ebx, 0 mov ecx, num1 mov edx, 5 ;5 bytes (numeric, 1 sign) of info int 0x80 mov eax, 4 mov ebx, 1 mov ecx, messaging mov edx, lenmessaging int 0x80 ;read , store user input mov eax, 3 mov ebx, 0 mov ecx, num2 mov edx, 5 ;5 bytes (numeric, 1 sign) of info int 0x80 mov eax, 4 mov ebx, 1 mov ecx, usermsg mov edx, lenusermsg int 0x80 ;read , store user input mov eax, 3 mov ebx, 0 mov ecx, num3 mov edx, 5 ;5 bytes (numeric, 1 sign) of info int 0x80 ;output message mov eax, 4 mov ebx, 1 mov ecx, dispmsg mov edx, lendispmsg int 0x80 ; moving first number eax register , sec number eb

wininet - How can I download the HTML contents of a webpage using C++ -

wininet - How can I download the HTML contents of a webpage using C++ - this question has reply here: what undefined reference/unresolved external symbol error , how prepare it? 23 answers here code #include <iostream> #include <windows.h> #include <wininet.h> using namespace std; int main() { hinternet hsession, hurl; char* buffer = new char[1024]; dword bufferlen, byteswritten; handle filehandle; hsession = internetopena(null, 0, null, null, 0); hurl = internetopenurla(hsession, "http://www.google.co.uk", null, 0, 0, 0); filehandle = createfilea("c:\\temp.txt", generic_write, file_share_write, null, create_new, file_attribute_normal, 0); byteswritten = 0; { internetreadfile(hurl, buffer, 1024, &bufferlen); writefile(filehandle, buffer, bufferlen, &byteswritten

vba - Converting word dialog to VB -

vba - Converting word dialog to VB - it has been long time since doing type of coding. i've been tasked send test page (looks old tv test pattern page) of our printers prior shift start. these pages help our team determine if there physical issues printers (bad toner, fuser, etc) have found code , used in vba (ms word). sub sorterprint01() dim sprinter string dim sprinter1 string dialogs(wddialogfileprintsetup) sprinter = .printer .printer = "\\dc999nt09\usprt_01" .donotsetassysdefault = true .execute application.printout filename = "\\dc999file\share\7yr\support\is_team_local\test sheets\barcode test sorter01.docx" .printer = sprinter .execute end end sub i created form print or specific printer. management not want in word doc , prefer have in vb app (even improve web based). after extensive research have found wddialogfileprintsetup word based dialog , not work in vb6/2008/2013). getting coding , need quick solution. use automation. if

php - Getting the value of an associative array with a select box -

php - Getting the value of an associative array with a select box - i have select box displays keys of associative array, , can observe alternative user chooses. i'm wondering how can create php utilize value of selected key. $eu = array( "italy"=>"rome", "luxembourg"=>"luxembourg", "belgium"=> "brussels", "denmark"=>"copenhagen", "finland"=>"helsinki", "france" => "paris", "slovakia"=>"bratislava", "slovenia"=>"ljubljana", "germany" => "berlin", "greece" => "athens", "ireland"=>"dublin", "netherlands"=>"amsterdam", "portugal"=>"lisbon", "spain"=>"madrid", "sweden"=>"stockholm", "united kingdom"=>"london"

python - How to shuffle a list 6 times? -

python - How to shuffle a list 6 times? - i want shuffle list 6 times maintain getting same result 6 occasions. can help me find fault is? here code used import random lis1=[0,1,2,3] lis2=[] in range(6): random.shuffle(lis1) lis2.append(lis1) print lis2 and here sample result got [[1,3,2,0],[1,3,2,0],[1,3,2,0],[1,3,2,0],[1,3,2,0],[1,3,2,0]] if jumbled lists, how can sort them in ascending order? in,i want - [[0,1,2,3],[2,3,1,0],[2,1,3,0],[1,0,3,2]] into this- [[0,1,2,3],[1,0,3,2],[2,1,3,0],[2,3,1,0]] first, code repeatedly inserts lis1 reference lis2 . since lis1 stays same time, of lis2 elements end pointing same object. prepare this, need alter append() line create re-create of list each time: lis2.append(lis1[:]) now, sort result phone call sort() after loop: lis2.sort() python list random-sample

java - Set bit values in Byte -

java - Set bit values in Byte - i need set bit of bluetooth features listed below using java: headervalue:bluetoothfeatures, tag id:0x10, length:4 bytes, possible values : bit 0 = a, bit 1 = b, bit 2 = c, bit 3 = d, bit 4 = e ....so on till bit 31. to set 7th bit 1: b = (byte) (b | (1 << 6)); to set 6th bit zero: b = (byte) (b & ~(1 << 5)); (the bit positions 0-based, that's why "seventh bit" maps 1 << 6 instead of 1 << 7.) source : change bits value in byte java