Posts

Showing posts from February, 2014

java - Playframework 2.3.4 gzip not working -

java - Playframework 2.3.4 gzip not working - i have enabled gzip encoding play framework 2.3.4, according documentation https://www.playframework.com/documentation/2.3.x/gzipencoding: i have added dependency in build.sbt: librarydependencies += filters then have created global object: import play.globalsettings; import play.api.mvc.essentialfilter; import play.filters.gzip.gzipfilter; public class global extends globalsettings { public <t extends essentialfilter> class<t>[] filters() { homecoming new class[]{gzipfilter.class}; } } i made test calling: curl -i -h 'accept-encoding: gzip' http://localhost:9000/my-api the result was: http/1.1 200 ok content-length: 3202 content-type: application/json; charset=utf-8 but expecting find next header in answer: content-encoding: gzip somebody else had same problem ? did miss in configuration? your problem -i option; returning headers, there no content zip. if

javascript - Upload base64 string image -

javascript - Upload base64 string image - i have plugin crops image , sends base64 info looks this: data:image/jpeg;base64,/9j/4aaqskzjrgabaqaaaq... . how can upload returned image via file upload field in form server? ps: in short want automaticly add together returned image file input field of form. the same way upload other string server. fact string base64 doesn't alter anything. you can set in <input type="hidden"> , utilize php code decode base64 , save bytes somewhere. javascript php jquery base64

javascript - How to spawn ghostcript into node.js environment -

javascript - How to spawn ghostcript into node.js environment - i have tried different configuration, cannot seem succeed execute "gs" (ghostscript) in node.js environment. var fs = require( "fs" ), child_process = require( 'child_process' ); ... var spawn = child_process.spawn; var opts = [ "-q ", "-dquiet ", "-dsafer ", "-dbatch ", "-dnopause ", "-dnoprompt ", "-dmaxbitmap=500000000 ", "-daligntopixels=0 ", "-dgridfittt=2 ", "-sdevice=jpeg ", "-dtextalphabits=4 ", "-dgraphicsalphabits=4 ", "-r150 ", "-soutputfile=afile.jpg", " afile.pdf" ]; var gs = spawn( "gs", opts, { cwd: "/mnt/drive/" } ); gs.stdout.on( 'data', function

performance - Big O Run Time for nested loops? -

performance - Big O Run Time for nested loops? - how calculate big o run-time efficiency code? gut tells me o(n^3) i'm not sure, i'm not sure if loops independent or dependent. for (i=1; i<=n; i++) (j=1; j<=n; j++) (k=1; k<=n; k++) print ("%d %d %d/n", i, j, k); your gut feeling right. have 3 nested loops iterating on n, each of first n loops create n loops, each of in turn create n more loops. o(n^3). edit: think how play out- first 1, j 1 well, , k loops 1 through n. after k has undergone whole loop, j increment 2, k undergoes loop 1 time 1 time again , on. performance algorithm data-structures runtime big-o

performance - Is there ever a point to swap two variables without using a third? -

performance - Is there ever a point to swap two variables without using a third? - i know not utilize them, there techniques swap 2 variables without using third, such as x ^= y; y ^= x; x ^= y; and x = x + y y = x - y x = x - y in class prof mentioned these popular 20 years ago when memory limited , still used in high-performance applications today. true? understanding why it's pointless utilize such techniques that: it can never bottleneck using 3rd variable. the optimizer anyway. so there ever time not swap 3rd variable? ever faster? compared each other, method uses xor vs method uses +/- faster? architectures have unit addition/subtraction , xor wouldn't mean same speed? or because cpu has unit operation doesn't mean they're same speed? these techniques still of import know programmers write firmware of average washing machine or so. lots of kind of hardware still runs on z80 cpus or similar, no more 4k of memory or so. outside

Bootstrap 3: different glyphicons than expected -

Bootstrap 3: different glyphicons than expected - im getting different glyphicons expected..i have bs 3.0.2. illustration user icon shows circle.. i installed bootstrap using composer: https://packagist.org/packages/twitter/bootstrap .glyphicon { display: inline-block; font-family: "glyphicons halflings"; font-size: 51px; font-style: normal; font-weight: normal; line-height: 2; position: relative; top: 1px; } .glyphicon-asterisk:before { content: "*"; } .glyphicon-plus:before { content: "+"; } .glyphicon-euro:before { content: "€"; } .glyphicon-minus:before { content: "−"; } .glyphicon-cloud:before { content: "☁"; } .glyphicon-envelope:before { content: "✉"; } .glyphicon-pencil:before { content: "✏"; } .glyphicon-glass:before { content: ""; } .glyphicon-music:before { content: ""; } .glyphicon-search:before { content: ""; } .glyphicon-heart:before { content: "

ruby on rails - Unable to navigate to index action in my model -

ruby on rails - Unable to navigate to index action in my model - ok, new rails. trying create ecommerce app scratch. defined order model track orders , orderitem model track each of order in cart. want add together button order page lets me add together more items cart. in show.html.erb order, writing next code: <%= button_to "add cart", products_path %> this link takes me create action of products model, instead of index action. tried alter path root_path lists products in product model, 1 time again link takes me post request instead of get, showing me error. please help! check routes.rb file have route specific request of products model as get "/products" => "products#index" alternatively if have products model in app add together resource: products this automatically adds route index action or else can seek this: <%= button_to "add cart", root_path, method: :get %> ruby-on-

playframework - Play framework, PostgreSQL in memory database, interval not working -

playframework - Play framework, PostgreSQL in memory database, interval not working - i can't next request work play framework select distinct tablename hand (hand.userlogin = {userlogin} or {userlogin} null) , (date >= now() - interval '3 days') order tablename i tested on postresql database , works perfectly, when seek run in in dev mode not work, next error: caused by: org.h2.jdbc.jdbcsqlexception: syntax error in sql statement "select distinct tablename hand (hand.userlogin = ? or ? null) , (date >= current_timestamp - interval '3 minute'[*]) order tablename "; expected "., (, [, ::, *, /, %, +, -, ||, ~, !~, (, not, like, regexp, is, in, between, and, or, ,, )"; my conf file says: db.default.driver=org.h2.driver db.default.url="jdbc:h2:mem:play;mode=postgresql" i don't know getting wrong. removing interval part makes work problem. postgres inte

password encryption - Which algo is used on Intershop ecommerce platform? -

password encryption - Which algo is used on Intershop ecommerce platform? - concerning ecommerce migration, need extract customers business relationship intershop platform. way, suppose password stored encrypt (i hope), maintain working current authentication process need reproduce password hashing algo. does can explain me algo utilize on intershop platform, or transfert me part of code help reproduce under php ? thanks all by default intershop 7 uses pbkdf2. password-encryption

Correct Javascript to get JSON info from Facebook Graph Query -

Correct Javascript to get JSON info from Facebook Graph Query - i trying url photos of facebook page. how 'source' url query , json structure: https://developers.facebook.com/tools/explorer/145634995501895/?method=get&path=19292868552%3ffields%3dalbums.fields(photos.fields(source))&version=v2.1 i using success callback jsonp request: function(response) { (i = 0; < **???response.albums.data.length???**; i++) { alert(**???response.albums.data[i].photos.data[i].source???**) } } can help me find right construction parts astericks? because has 2 [i]'s think i'm getting confused.. you need create sure have in head: <script type='text/javascript' src='//connect.facebook.net/en_us/sdk.js'></script> <script type='text/javascript' src='workfrompage.js'></script> now on workfrompage.js var pre = onload; onload = function(){ if(pre)pre(); if(!fb)reload(); va

Linked-list destructor crashes C++ program -

Linked-list destructor crashes C++ program - i've been working on destructor linked list project numbers inserted in front end , odd numbers inserted in back. deletion works on lastly in first out depending on if odd or even. have working maintain getting error when run destructor. i've walked through debug , deletes of nodes crashes afterwards , i'm not sure why. here code: //headerfile class staque { private: struct staquenode { int value; struct staquenode *next; struct staquenode *prev; }; staquenode *root; public: staque(); ~staque(); void addnode(int addin); void deletenode(int oddin, int evenin); void display(); }; //header.cpp file #include"staque.h" #include<iostream> using namespace std; staque::staque() { root = null; } void staque::addnode(int addin) { staquenode *newnode; staquenode *nodeptr; staquenode *temp = null; newnode = new staquenode; newnode->value = addin; newnode->next = null; newnode->pr

angularjs - Pass a promiss to the resolve-Object of an ui.angular Modal-Dialog -

angularjs - Pass a promiss to the resolve-Object of an ui.angular Modal-Dialog - i have big problem. have problems modal dialog of ui.bootstrap. do. have dialog adding rocker(here called clicker) database. when every thing okay dialog gets closed, if not show error-message. handled in controller of modal-dialog. because of usage of jwt socketio had create socketio mill returns ppromiss. able utilize socketio-instance in modal-controller have set in resolve-object of $modal. the problem is, every time set socketio-eventhandler in modal-controller, browser shows me message controller-method undefined. (no dialog showing, error-message in console) here code. hope can help me! have no thought how solve problem. socketmodule.js socketmodule socketio-factory returns promise. everywhere else in code works. modal dialog has problem approach. var socketiomodule = angular.module('socketiomodule', []); socketiomodule.factory('socket', ['$q', '

Android Studio IDE color scheme settings cannot revoke to default white background -

Android Studio IDE color scheme settings cannot revoke to default white background - i installed latest android studio beta 0.8. played settings -> editor -> colors & fonts , changed scheme name: default 'darcula'. background colour changed dard grey. don't sense comfortable , changed default. only editor area background revoked white, other area such project explorer, properties still dark grey. anyway can reset original white background? thanks only editor area background revoked white, other area such project explorer, properties still dark grey. this because editor , look , feel different views. changing scheme of editor in android studio not alter theme of other views such project explorer, properties etc. whenever darcula color scheme applied editor within file | settings | editor | colors & fonts , pop-up window prompt below: upon choosing yes , color scheme of other views changed alongside editor. so, in order alt

java - Gradle change checkstyle version -

java - Gradle change checkstyle version - java checkstyle plugin updated 6.0 version(java 8 support). looks gradle using older version. how can upgrade gradle checkstyle plugin newer version? checkstyle { toolversion = "6.0" } java gradle checkstyle

html - Center (vertically) a span element -

html - Center (vertically) a span element - i have span within div , i'm trying center (i.e. want text [why larn music]inside span straight in centre (both horizontally , vertically) of div. vertical-align not working far. attached image of current status of text. js fiddle: <iframe width="100%" height="300" src="http://jsfiddle.net/cheetaiean/qzd8k9uf/embedded/" allowfullscreen="allowfullscreen" frameborder="0"></iframe> picture: i tried , added follow text or span margin-top:-350px; it works fine, work you, if not alter span div , add together same margin top minus value , done html css

javascript - Save JQuery.Sortable results to SQL with ASP.NET MVC -

javascript - Save JQuery.Sortable results to SQL with ASP.NET MVC - i've been looking @ number of threads this, i'm not getting it. i have table pulls list sql. i'm using jquery.sortable sore rows on client side. ideally, drag , sort rows in different orders , automatically save them in sql via controller using ajax. here code: <div class="container"> <table id="example" class="table table-responsive table-striped sorted_table"> <thead> <tr> <th>display order</th> <th>image/video</th> <th>title</th> <th>meta data</th> <th>action</th> </tr> </thead> <tbody> @foreach (var item in model) { order++; <tr id="@item.id">

javascript - Why does the browser change the value of the option in a element? -

javascript - Why does the browser change the value of the option in a <select> element? - i have options generated in php. of values include html special chars &amp; or in case &oslash; (danish Ø). for reason browser changes value of option, making hard compare same value passed simple compare function. with alternative 1 selected ("&oslash;strig") , passing "&oslash;strig" below countryfilter function, homecoming false ??? , deugging can see e.value equal "Østrig" , not value set in html?? html: <form> <select id='country' onchange='filter(false);'> <option value=''>* alle *</option> <option value='&oslash;strig'>&oslash;strig</option> <option value='argentina'>argentina</option> <option value='australien'>australien</option> ... javascript: function countryfilter(country) {

php - How can I pipe input to a process? -

php - How can I pipe input to a process? - i trying run programme using php , maintain sending output it. i've tried using exec() documentation page says, hangs, waiting process return. is there exec() allow me maintain sending commands cli application? please note since application closed-source, don't have alternative of changing application lock file or other thing suggested answers similar questions. you looking proc_open command. command runs process connecting standard input , output file descriptors opened pipes in program. write 0 descriptor taken input on stdin process, , outputs can read programme of file. illustration code in linked php documentation should going. however, if trying communicate mysql specifically, rather utilize built in mysql functionality of php php

postgresql 9.3 - Insert hex value in escape format (bytea) -

postgresql 9.3 - Insert hex value in escape format (bytea) - how insert hex value \x320000000d2f2100 in escape format bytea field ? bytea_output settings set escape the bytea_output setting has nil how bytea interpreted server, how it's sent client. do want insert literal string \x320000000d2f2100 (as 7-bit ascii), i.e. producing bytes 0x5c 0x78 0x33 0x32 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x64 0x32 0x66 0x32 0x31 0x30 0x30 ? if so, escape backslash, documented in syntax escape format bytea literals. regress=> select bytea '\\x320000000d2f2100'; bytea ---------------------------------------- \x5c7833323030303030303064326632313030 (1 row) do want insert bytes 0x32 0x00 0x00 0x00 0x0d 0x2f 0x21 0x00 , i.e. hex value? if so, don't escape backslash. doesn't matter setting of bytea_output is. regress=> select bytea '\x320000000d2f2100'; bytea -------------------- \x320000000

android - which key gets fired when user answers a call -

android - which key gets fired when user answers a call - i wondering intercept keycode thats fired when user swipes greenish circle towards other border of screen reply call. far know every activity , view allowed intercept keys pressed key or home key. it nice know whether service able intercept same thing implementing onkeylistener interface. thanks in advance. it not possible intercept actual keypress. can user telephonymanager hear phone call state changes. for illustration might see tahlas answer how add together phonestatelistener. android phonecalls

Error with classes using 2-D Arrays in C++ -

Error with classes using 2-D Arrays in C++ - i'm writing code display array file, done in project .h file .cpp file , main file. header file keeps giving me error redefiniton of 'class token' , precious definition of 'class token' i'm not sure how redefine it. help main.cpp using namespace std; int main() { string filename; int b; int d; int i; int j; token matrix[30][30]; cout << "type name of text file: e.g. 'file.txt'" << endl; getline( cin, filename );//this cin >> name// matrix[30][30].setassign( filename ); cout << endl ; system("pause") ; } token.h // header file token.h using namespace std; class token { private: string assignmat; //char displaymat; //char displaytoken; public: // constructors token(); token( string ); //token( string, char, char ); // public functions void setassign( string ); //void setdisplay( char ); //void settoken( char ); };` token.cpp using namespace s

A easy way to set up a stand-alone Cloudera HBase 5? -

A easy way to set up a stand-alone Cloudera HBase 5? - i know can download hbase apache hbase-0.98.1-hadoop1-bin.tar.gz in http://archive.apache.org/dist/hbase/hbase-0.98.1/, unzip it, , run start-hbase.sh start hbase. but if need cloudera hbase, cdh5, how set stand lone cdh5, there easy way it? want stand lone cloudera hbase, not whole cloudera platform. thank you! the easiest way cloudera environment through sandbox's here. but, if want cloudera's version of hbase utilize cloudera's tar ball's here , extract apache hadoop. take @ interesting offering cloudera called cloudera live hbase cloudera

java - EditText Value is same as that of the first row in ListView -

java - EditText Value is same as that of the first row in ListView - edittext - holder.ednum.settext setting same value both first item , lastitem(fourth) in listview ex if press plus icon first row in listview (please refer image) value gets changed first item lastly item in listview. has holder.ednum, i'm unsure on how prepare issue. please see screenshot perfect thought of problem: bundle com.freshmenu.mylistview; import java.util.list; import android.app.activity; import android.content.context; import android.graphics.bitmap; import android.graphics.bitmapfactory; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.baseadapter; import android.widget.edittext; import android.widget.imagebutton; import android.widget.imageview; import android.widget.textview; import com.pavan.mylistview.r; public class customadapter extends baseadapter { public int max_range = 9; public int min_range

r - Generating a color legend with shifted labels using ggplot2 -

r - Generating a color legend with shifted labels using ggplot2 - i plot maps using grads, , utilize color legend in plot this: i same using ggplot2 in r. if using simply: g <- g + scale_fill_brewer(palette="greens", na.value="na", name=legendtitle) #g saved plot simple options, prepared cut() the output of course of study this: so i'd able 2 things: shift labels between colors, note indicating interval above (note: renaming labels not problem, shifting them is) last label should arrow-like, indicate entries above maximum (10 in example) indicated in darkest color (dark greenish in example). edit: using help reply below, i've come this: part 1. of question solved, if not perfect. i'd rid of white space between colors, idea? part 2... have no thought whatsoever. my code snippet uses: theme(legend.position="bottom", legend.key.width = unit(1, "cm"), legend.key.height = unit(0.3, "cm")) + guide

The schema returned by the new query differs from the base query (C#/SQL - VS 2012) -

The schema returned by the new query differs from the base query (C#/SQL - VS 2012) - for homework task have develop c# application interface sql server database file ( .mdf ), providing datagridview browse contents, , several buttons execute queries. i have been going well, found how add together queries table adapter, how phone call them etc. now having problems making query returns maximum pay in hourlypayrate . i have database employee contains next attributes: employeeid, name, position, hourlypayrate . my query select max(hourlypayrate) employee i right click employeetableadapter , click "add query...", name max , set in query. when click okay next error message: the schema returned new query differs base of operations query. the query executes correctly in query builder, when click "ok" save receive error. looking around se there no definitive answers question. thanks, michael. the solution has been found, wonde

recursion - Return an infinite tree consisting of only nodes in Haskell -

recursion - Return an infinite tree consisting of only nodes in Haskell - given next simple tree info tree = leaf | node tree tree deriving (eq, show) is there way homecoming infinite amount of nodes (a tree nodes , no leaves) using recursion? so far know how homecoming info types such boolean , integer . how start returning tree ? infinitetree :: tree infinitetree = node infinitetree infinitetree haskell recursion tree infinite algebraic-data-types

javascript - How to set a date column as NULL in Parse.com with REST API? -

javascript - How to set a date column as NULL in Parse.com with REST API? - i have custom field of datatype date. trying reset / remove datetime value , set null / blank / default 00... using rest api. however, attempts far have resulted in error. here how json looked in various attempts... { "__type": "date", "iso": null } ; { "__type": "date", "iso": "" } ; { "__type": "date", "iso": "0000-00-00t00:00:00.000z" } ; any guidance or tips appreciated. thanks! object.unset("columnname") object: parse object "columname": name of column want set null refer link javascript json rest parse.com titanium

Java Spring Wizard Form + db query on every page -

Java Spring Wizard Form + db query on every page - i trying build java webapp has 3 pages, each page has drop downwards list info fetched db. page 1 has drop downwards box possible value , b, fetched db. page 1 drop downwards box value used key fetch info page 2 drop downwards list, , likewise page 2 drop downwards box value used key fetch info page 3 drop downwards list. thinking utilize wizard form, chosen value of each page's drop downwards list value can stored in questionnaire object. question on how create utilize of each page drop downwards list value fetch data? may direction here? thanks. looking several method formbackingobject, referencedata seems able job. java spring

How to run Python & Behave tests with some unit test framwork? -

How to run Python & Behave tests with some unit test framwork? - i need run tests (written python , behave) without using console. prefer create simple python script , utilize unit test runner. i'm thinking unittest, pytest , nose solutions welcome:) couldn't find hint on behave's homepage. behave "test runner". utilize "-o " alternative store results somewhere whatever format(her) want use. note: same py.test . python unit-testing testing python-behave

Android: GPS is giving last saved location -

Android: GPS is giving last saved location - i working on getting current location through gps. gps giving me lastly saved location! may because of line! looking improve solution! locationmanager .getlastknownlocation(locationmanager.gps_provider); here sample code if (isgpsenabled) { if (location == null) { locationmanager.requestlocationupdates( locationmanager.gps_provider, min_time_bw_updates, min_distance_change_for_updates, this); log.d("gps enabled", "gps enabled"); if (locationmanager != null) { location = locationmanager .getlastknownlocation(locationmanager.gps_provider); if (location != null) { latitude = location.getlatitude();

mocking - How to mock a validator for unit testing -

mocking - How to mock a validator for unit testing - i have method validate object calling external service: public void validate(ivalidator<mytype> validator) { imapper<mytype> mapper = new mytypemapper(); foreach (var element in this.elements) { validationresult result = validator.validate(mytypeinstance, mapper, new validationconfiguration()); if (result.isvalid) // else // else } } now in unit test have collection of elements. , want if element have given id number validate method should homecoming stub validation messages: // arrange var myaggregate aggregate = elementsnonvalidated.stub(); var mockedvalidator = new mock<ivalidator<mytype>>(); mockedvalidator.setup(a => a.validate( it.is<mytype>(x => x.id == guid.parse("3f2504e0-4f89-11d3-9a0c-0305e82c3301")), new mapper(), new validationconfiguration()

permalinks - Wordpress perma links -

permalinks - Wordpress perma links - ok made plugin contact form, thing have redirection when form submited success page $location = home_url().'/potvrda-prijave/'; wp_safe_redirect($location); exit(); thing when alter permalinks construction 404, knows how grab permalinks alter , alter redirection link? this $location = home_url().'/potvrda-prijave/'; to $location = home_url().'id=21'; since know page id, can utilize get_permalink(): $location = get_permalink( 21 ); edit: looks don't know id...in case, if know title, can use: $location = get_permalink( get_page_by_title( 'your page title' ) ); however, if you're using wp_insert_post() create post in first place, function returns page id of added post. so: $added_post = wp_insert_post( $my_post ); $location = get_permalink( $added_post ); wordpress permalinks

sql server 2008 - how to assign cte value to variable -

sql server 2008 - how to assign cte value to variable - ;with cteima(personid,isemployeeactive) (select count(*) custom.viwssappsempmasterextended vem vem.supervisorpersonid = @p_personid union select cteima.isemployeeactive custom.viwssappsempmasterextended vem bring together cteima on cteima.personid = vem.supervisorpersonid ) set @v_ismanager = (select count(*)from cteima isemployeeactive = 'y') here getting error wrong syntax near keyword 'set' tell me how set values cte variable you can not set values set keyword in select statement. either assign fields query variables in select statement: with cte ( /** .. query here .. **/ ) select @yourvariable = fieldnameorsubquery -- in short: look cte in case fileds in select list should assigned variable! or can assign single row-single column select statement's result variable set keyword: set @yourvariable = (select count(1) yourtable). you can not mix ab

android - Can we set #define or #ifdef for java in eclipse IDE -

android - Can we set #define or #ifdef for java in eclipse IDE - this question has reply here: #ifdef #ifndef in java 7 answers i want add together #define of #ifdef in eclipse java.so can disable or enable code while building specific target. i have used c++ before don't know there way in java eclipse project. please allow me know if possible or not in eclipse. no, java has no preprocessor, , because scenario describe should not occur in java. one of java's original main design ideas (if not the original design idea) coined "write once, run everywhere". means don't compile different bytecode different platforms. instead, there's 1 bytecode applied on every platform. thus, there's no need preprocessor instructions, because scenario should not necessary. if sense need different code on different platforms, there ways accom

XML base data validation rule in java -

XML base data validation rule in java - hi new in xml in java.in recent project need create validation rules in xml,but the problem different user grouping may have different rule example <root> <user-group type="sale"> <parameter-name ="loginname"> <max-length>10</max-length> <min-length>4</min-length> </parameter-name> <parameter-name ="password"> <max-length>10</max-length> <min-length>4</min-length> </parameter-name> </user-group> <user-group type="clerk"> <parameter-name ="loginname"> <max-length>16</max-length> <min-length>4</min-length> </parameter-name> <parameter-name ="password"> <max-length>12</max-length> <min-length>8</min-length> </parameter-name> &l

csv - jquery Seperate list output with comas -

csv - jquery Seperate list output with comas - i cannot output in list separated commas. output 444064451244515. need 44406,44512,44515 <?php // homecoming zip codes within given radius of given zip code // - validate post values if(isset($_post['findzip'])) { $myzip = $_post['myzip']; $radius = $_post['radius']; $api_key = $modx->getoption('zipcode_api'); $url = "https://zipcodedistanceapi.redline13.com/rest/$api_key/radius.json/$myzip/$radius/mile"; // curl stuff $ch = curl_init(); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_url, $url); $response = curl_exec($ch); $response = utf8_encode($response); $zips = $modx->fromjson($response); foreach ($zips['zip_codes'] $zip) { $output .= $zip['zip_code'].split(","); } homecoming $output; } return; as mentioned in comments above, should work:

c++ - Forward declaration of array of QStrings leads to segmentation fault -

c++ - Forward declaration of array of QStrings leads to segmentation fault - in code have 2 forwards declarations, bool array , qstring array in namesace nlog . bool works. qstring produces segmentation fault. header: class log : public qobject { explicit log(); public: enum facility { third_party_fac, test_fac, __facility_last_element }; enum severity { debug_sev, warning_sev, critical_sev, fatal_sev, __severity_last_element }; }; namespace nlog { extern bool logging_enabled[log::__facility_last_element][log::__severity_last_element]; extern qstring severity_name[log::__severity_last_element]; }; class logstaticinitiallizer { public: logstaticinitiallizer(); }; static logstaticinitiallizer initiallizer=logstaticinitiallizer(); source: qstring nlog::severity_name[log::__severity_last_element]; bool nlog::logging_enabled[log::__facility_last_element][log::__severity_last_eleme

android - Why do we have to provide images for all device screen sizes (mobile development)? -

android - Why do we have to provide images for all device screen sizes (mobile development)? - why have provide images screen sizes when developing mobile applications? wouldn't more efficient have 1 big image each unique image , scale image downwards whenever app beingness run on smaller device? create game's file size much smaller. in lots of cases, wouldn't good. if find set of designed icons, you'll see they've been independently designed each resolution: smaller ones deliberately have less detail in, because downscaling doesn't produce results. here 2 gnome icons, same thing, 1 @ 256x256 , 1 @ 48x48. can see 48x48 1 has less detail in writing on letter, writing designed rather differently: on 256x256 1 looks middle page of document, , on 48x48 1 looks opening of letter, address @ top. android ios

jpa - Dynamically loading data according to a session attribute -

jpa - Dynamically loading data according to a session attribute - i'm trying dynamically load dataset accordingly user session attribute, inject , set parameter in namedquery. the namedquery works fine, i'm not getting dataset desired. i mean, when session attribute 9882, dataset loaded corresponds findall query. but, in meantime, if user logs in app - , session attribute 4207 - dataset stills same 9882, means dataset still correspond findall query; , vice-versa: if 1st session attribute 4207, uses findbyprefdep query, expected, dataset still same 9882 session attribute logged after 4207 user. @inject private string sessionprefdep; public collection<t> getitems() { if (items == null) { if (integer.valueof(sessionprefdep) == 4207) { items = this.ejbfacade.findbyprefdep(); } else if (integer.valueof(sessionprefdep) == 9882) { items = this.ejbfacade.findall(); } } homecoming items; } does knows how can accompl

How do I link my javascript to this html to work -

How do I link my javascript to this html to work - i new coding , working on website , can't javascript work. javascript used create transitions between different sections smooth , nice. awesome if guys help me. know problem simple please help out noobie in need. :) html: <html lang="en"> <head> <link rel="stylesheet" type="text/css" href="style.css"> <title><!-- insert title here --></title> </head> <body> <nav> <ul> <li><a href="#1">first</a></li> <li><a href="#2">second</a></li> <li><a href="#3">third</a></li> <li><a href="#4">fourth</a></li> <li><a href="#5">fifth</a></li> </ul> </nav> <div class="sections"> <section id="1"><h1>first</h1></

c# - Is the Observer Pattern applicable when Subject and Observer need to be in separate assemblies? -

c# - Is the Observer Pattern applicable when Subject and Observer need to be in separate assemblies? - i have seen multiple examples of observer pattern subject , observer in same assembly. seems me more 'real world' illustration have subject , observer(s) in separate assemblies on different machines communicating across network or internet. observer pattern applicable in situation or there else should looking at? "separate assemblies" implementation detail. implementation details not matter when deciding whether pattern applies. you can absolutely apply observer pattern across assembly boundaries, or across physical boundaries. you can consider publish/subscribe pattern or mediator pattern alternatives. c# observer-pattern

Migration of Weblogic Portal with NetUIX from bea weblogic server to JBoss -

Migration of Weblogic Portal with NetUIX from bea weblogic server to JBoss - i having project want migrate weblogic server jboss. the project webportal build using beehive , netui, netuix xml portal/portlets. is possible migrate straight jboss limited changes view entire construction can reused in view defined in .portal files. i uncertainty can utilize tiles instead of using portals in jboss, tiles when getting loaded in browser not going phone call individual controller's begin methods , load default content there. i request please help me find solution migration problem. thanks, amit from experience, migration weblogic portal jboss required rewrite of entire application. if using weblogic portal (perhaps 9.x version since mentioned netui), i.e. portal framework on top of weblogic server, there far many libraries specific portal framework p13n , netui alike requires migration no guarantee these supported in jboss. face problem retrieving entitlement

R - Two sets of labels on on axis in a bar plot -

R - Two sets of labels on on axis in a bar plot - i have dataframe looks this: id grouping measure1 measure 2 001 59 559 002 44 623 003 b 129 498 004 c 99 504 005 c 78 378 i want produce bar graph has 2 sets of labels on x-axis: 1 identifying each bar id value, labeling each bar grouping belongs to. info set members of same grouping adjacent in dataframe. the obvious solution of color-coding bars grouping not applicable because using color-coding show measure1 , measure2 (and in cases measure3). if there way show grouping info besides labels, interested hear think 2 sets of labels @ bottom of chart best solution. here's 1 such plot 1 set of labels: i add together grouping labels underneath "patient id" labels. if desperate, utilize photoshop or paint add together labels hoping there way add together sec set of labels using r. try: m

api - how to start to write an SDK for php MVC self created framework -

api - how to start to write an SDK for php MVC self created framework - i don't know how inquire question ,but here comes: my boss wanted me create simple mvc php our online-shopping website , did ( watching youtube , ...) , it's simple , made . now keeps asking me : first create restful api ( uses curl ). second create documented sdk !!. i've searched lot (really ) , right know can understand api i'm not sure what's sdk , how start write code can give me line of code of illustration of how start write ? what means **well documented ** ? i've searched in google , know sdk , api literally mean, problem can't create relation between mvc , api , sdk . how can start write api ? where should begin ? what's point ? can give me illustration ? what sdk supposed ? i've seen lots of videos api , of them talks using rest , rest , should get/post/delete/put , on , forcefulness . but should start ? edit in case , on

ios - "Unexpected @ in program" when copying Facebook's Share Code -

ios - "Unexpected @ in program" when copying Facebook's Share Code - i've copied code facebook's developer site integrate facebook sharing app: nsmutabledictionary<fbgraphobject> *object = [fbgraphobject opengraphobjectforpostwithtype:@whatsyourinneragefb:inner_age title:@sample inner age image:@https://fbstatic-a.akamaihd.net/images/devsite/attachment_blank.png url:@http://samples.ogp.me/578838518886846 description:@];; [fbrequestconnection startforpostwithgraphpath:@"me/objects/whatsyourinneragefb:inner_age" graphobject:object completionhandler:^(fbrequestconnection *connection, id result, nserror *error) {

python - Plotting data from input file from command line -

python - Plotting data from input file from command line - i have been given info file called "density_air.dat" , need take info each column , set them own lists (ie tlist hold values in column starting "-10" , density hold values in column starting "1.341". lists need plotted. having problem populating lists data...any help? from scitools.std import * import sys import pylab pl infile = sys.argv[-1] f = open(infile, 'r') x in range(4): f.readline() tlist = [] density = [] line in f: words = line.split() x in words: tlist.append(words[x]) density.append(words[x]) f.close() plot(tlist, density) the info file is: # density of air @ different temperatures, @ 1 atm pressure level # column 1: temperature in celsius degrees # column 2: density in kg/m^3 -10 1.341 -5 1.316 0 1.293 5 1.269 10 1.247 15 1.225 20 1.204 25 1.184 30 1.164 # source: wikipedia (key

entity framework - ORM or Database that works like version control and tracks history -

entity framework - ORM or Database that works like version control and tracks history - this random thought wondering about. there orm's or databases natively back upwards tracking history? i'm envisioning each row has compound primary key id , version. update "append" new row same id , next available version number. normal select returns recent version of uniquely identified row, "selecthistory" homecoming rows. delete natively soft delete. given not new problem , there's nil new under sun, nail me there's high probability has designed elegant solution abstracts hard parts of away, , done @ either database layer or orm layer. i have existing application built on entity framework. overrides savechanges method of dbcontext set createdby/createddate/modifiedby/modifieddate properties each new/changed entity. client asked how much work involve add together total history tracking. gave them reasonable estimate based on past experience

MATLAB How to Use URLREAD with a Password Protected Website -

MATLAB How to Use URLREAD with a Password Protected Website - i trying utilize urlread grab contents of password protected website. when i'm logged in, url http://media.nba.com/stats/officialboxscores.aspx, , when logged out, url http://media.nba.com/stats/login.aspx?returnurl=%2fstats%2fofficialboxscores.aspx. i've tried urlread('http://media.nba.com/stats/officialboxscores.aspx','username','username','password','password'); with login credentials gives me contents of url before logging in. see question has been asked before, couldn't find solution situation. there way utilize urlread past password protection wall? any help appreciated! you need specify method (use 'post'), , parameters need cell array of name/value pairs. does work : urlread('http://media.nba.com/stats officialboxscores.aspx','post',{'username','username';'password','password'} );

Hide and show the tables in html using jquery/ javascript -

Hide and show the tables in html using jquery/ javascript - i learning design web. problem there 2 combo box instrument compose of acoustic guitar,drum , piano, , level compose of mainstream, primary , beginner etc. if click combo box table named create own schedule appear when click example:the instrument(piano) or level(beginner) disappear. every click on combo box show or hide.. want if click combo box , take instrument piano , level begginer that's time table appear/ display please help: below i've done <!doctype html> <html lang="en"> <script> function toggle() { if( document.getelementbyid("hidethis").style.display=='none' ){ document.getelementbyid("hidethis").style.display = 'table-row'; // set table-row instead of empty string }else{ document.getelementbyid("hidethis").style.disp

python - Does __init__.py create a namespace, or does it take on the pkg-namespace? -

python - Does __init__.py create a namespace, or does it take on the pkg-namespace? - foopkg |- __init__.py |- bar.py |- baz.py __init__.py bar import * baz import * suds.client import client client bar.py class croak: import foopkg foopkg.client() python3.2>> import foopkg attributeerror: 'module' object has no attribute 'client' why?? you importing bar before client. so, @ moment foopkg.client() gets executed foopkg has no client yet. python python-3.x

Does Python's copy.deepcopy really copy everything? -

Does Python's copy.deepcopy really copy everything? - this question has reply here: what difference between shallow copy, deepcopy , normal assignment operation? 3 answers i under impression deepcopy copied recursively downwards tree, came upon situation seemed go against believed. >>> item = "hello" >>> a["hello"] = item >>> b = copy.deepcopy(a) >>> id(a) 31995776 >>> id(b) 32733616 # expected >>> id(a["hello"]) 140651836041376 >>> id(b["hello"]) 140651836041376 # did not expect the id of , b different, expected, internal item still same object. deepcopy re-create depth? or specific way python stores strings? (i got similar result integers well) deepcopy needs create copies of mutable objects, lists , dictionaries. strings , intege

java - Read CSV file and write back CSV File based on condition -

java - Read CSV file and write back CSV File based on condition - i'm new java. i'm required read input data(csv)(large number of records) receive in given below format: a,1 a,2 b,3 b,4 c,5 c,6 a,7 a,8 b,9 b,10 ... i'm using printwriter write info new csv file. there a.ny way can write new csv file way above data? here status based on values a, b,c. a,b,c 1,3,5 2,4,6 7,9 8,10... i think possible if there a,b , c. thought can extended finite number of constants what can like... public void computenewcsv() { list<integer> = new linkedlist<integer>(); list<integer> b = new linkedlist<integer>(); list<integer> c = new linkedlist<integer>(); fileinputstream fis = new fileinputstream("input_file"); bufferedreader br = new bufferedreader(new inputstreamreader(fis, charset.forname("utf-8"))); string line; while ((line = br.readline()) != null) { string split[]