Posts

Showing posts from August, 2011

javascript - Highcharts add point to line chart with json -

i need add point data mysql database. @ time, data json don't know why in output array, data have double quote(" ") this: ["{name:'chip 3',data:[[moment('2015-05-14 13:26:21','hh:mm:ss').valueof(),29],[moment('2015-05-14 13 :26:51','hh:mm:ss').valueof(),29],[moment('2015-05-14 13:27:21','hh:mm:ss').valueof(),29],[moment('2015-05-14 13:27:51','hh:mm:ss').valueof(),29],[moment('2015-05-14 13:28:21','hh:mm:ss').valueof(),29],[moment('2015-05-14 14:42:54','hh:mm:ss').valueof(),32],]}"] so highcharts can not access data , show data on chart. need remove double quote array or else make highcharts can regconize data. this code in data.php file use , update series data. <?php header("content-type: text/json"); include_once 'include/connection.php'; $db = new db_class(); $query = "select distinct idchip datatable ...

ios - Can't find keyplane that supports type 4 for keyboard--Warning, silence possible? -

"can't find keyplane supports type 4 keyboard iphone-landscapechoco-numberpad; using 76885345_landscapechoco_iphone-simple-pad_default" i'm getting output in debugger when using uitextfield keyboard type number pad . all searchings seem warning benign , can ignored. is possible silence warning preemptively setting uitextfield use keyboard 76885345_landscapechoco_iphone-simple-pad_default used eventually?

html - Two column layout for two forms, with alignment between submit buttons -

i trying use html+css create 2 column layout display 2 parallel forms. input fields of forms flow naturally down each column, except 2 submit buttons, bad when not @ same height each other. i have tried few different techniques, no avail: html tables work creating layout, because elements grouped logically row, it's not possible have separate forms encompass each column. (one of columns has file upload, 1 big form no-go). css tables no similar reasons. using divs "float: left" , "float:right" respectively works layout, , nice grouping 2 forms. however, submit buttons (which last elements of divs) @ different heights. move higher button down height of lower button, vertically aligned. however, can't seem figure out way this, because 2 sibling divs, aren't "aware" of each other's heights. here example jsfiddle of float-based implementation: http://jsfiddle.net/53nvqrfr/ <div style="float: left; width:50%"> ...

python regex match case option -

i utilize match case option. have piece of code search string in list. guess there more elegant way same. searchstring = "maki" itemlist = ["maki", "moki", "maki", "muki", "moki"] resultlist = [] matchcase = 0 item in itemlist: if matchcase: if re.findall(searchstring, item): resultlist.append(item) else: if re.findall(searchstring, item, re.ignorecase): resultlist.append(item) i use re.findall(searchstring, item, flags = 2) because re.ignorecase integer (2) don't know number mean "matchcase" option. you can enforce case insensitive search inside comprehension: searchstring = "maki" itemlist = ["maki", "moki", "maki", "muki", "moki"] resultlist =[] matchcase = 1 if matchcase: resultlist = [x x in itemlist if x == searchstring] else: resultlist = [x x in itemlist if x.lower()...

watchkit - WKInterfaceTable's didSelectRowAtIndex never gets called in WKInterfaceController -

i have wkinterfacecontroller , added table following: // .h @interface interfacecontroller : wkinterfacecontroller @property (weak, nonatomic) iboutlet wkinterfacetable *table; @end // .m - (void)table:(wkinterfacetable *)table didselectrowatindexpath:(nsindexpath *)indexpath{ nslog(@"did select"); } - (void)table:(wkinterfacetable *)table didselectrowatindex:(nsinteger)rowindex{ nslog(@"did select new"); } however neither of 2 methods gets called. unable find protocol declaration wkinterfacetable , neither delegate property on table. is there missing here? i found out method never called because had set segue triggered on selection of row on interface builder. it seems that having no delegation , table protocols once set delegate stops didselectrow method being called.

3d - opengl: Trouble setting up viewport and glortho -

i trying setup opengl views texture rendering. following advice on forum, set viewport , ortho matrix follows: first try compute screen width , height can use while maintaining aspect ratio of image: void resize(int w, int h) { float target_aspect_ratio = image_width / image_height; width = w; height = (int)(width / target_aspect_ratio + 0.5f); if (height > h) { height = h; width = (int)(height * target_aspect_ratio + 0.5f); } off_x = (w - width)/2.f; off_y = (h - height)/2; // want center image. have these offsets glviewport(off_x, off_y, width, height); glmatrixmode(gl_projection); glloadidentity(); glortho(0, width, 0, height, 0.0f, 1.0f); now when want render texture do: void paint() { // texture binding etc. gltexcoord2f(0, 0); glvertex2f(0, 0); gltexcoord2f(1, 0); glvertex2f(width, 0); gltexcoord2f(1, 1); glvertex2f(width, height); gltexcoord2f(0, 1); glvertex2f(0, height)...

javascript - Disable submit button until input fields are filled -

this website link, here have been trying using jquery code enable/disable button not succeed achieve. inspect element see code please , output off course there tushar's solution working perfectly. recommend use formal/standard approach validation. do not disable submit button. use required attribute each radio button either in html like <input id="input_5_0_1" class="form-radio" type="radio" required="required" name="customer_appointment" value="good" /> or using js (its short cut way) like $(document).ready(function () { $('form input').attr('required','required'); }); demo on fiddle this way not able submit until fill fields, though button not disabled. however if have use button disable approach can follow above answer of @tushar edit solution works modern browsers support html5. browsers other mentioned in link http://html5readiness.com/ (e....

c++ - How to find Logical Name for PinPad XFS if it is not mentioned in Manual -

i have started xfs implementation of szzt pinpad .i facing issue wfsopen command giving error “ – 14 “which mentioned wfs_err_hardware_error in manual. please let know if missing out on parameter value same . unable find logical name szzt pinpad in manual . of using same name been mentioned in registry i've had problem. in case, due service provider not being found (more exactly, sp implementation dll). reason behind, in case, was using 64 bits windows 7. in 64bits so, registry localization not in hkey_local_machine\software\xfs in hkey_local_machine\software\wow6432node\xfs btw, xfs setup puts 64bitsregs.reg in c:\xfs (or directory selected install xfs in)

javascript - Library for Validation in GWT -

i have application developed using pure gwt. throughout application need validation email,phone number,ssn or date validation.is there third party js or library available integrate gwt? **note:since getting response in json throughout application,i can't use gwt validation framework(gwtvf)

android - How to update the List whenever the tabs are changing in view pager -

in app using navigation tab using view pager. have able drawn tabs using code posted on: https://github.com/codepath/android_guides/wiki/sliding-tabs-with-pagerslidingtabstrip here have used sliding tab , view pager both navigation tabs.everything working fine list not getting updated when moving other tab. onresume() getting called object list variable getting updated while debugging visually list not getting updated. here snippets of code: for tab1 : in case active tab @override public void onresume() { super.onresume(); if(!internetutil.isconnectedtointernet(getactivity())){ mswiperefreshlayout.setenabled(false); }else{ mswiperefreshlayout.setenabled(true); new getusersfromservertask().execute(); // here making network calls } } on tab2 : archive tab @override public void onresume() { super.onresume(); new getusersarchivedfromservertask().execute(); // network c...

c# - x:Bind syntax for event binding giving error CS0122: inaccessible due to protection level -

i've got basic page in windows 10 universal app i'm using new binding pattern with. i'm loading viewmodel public property on mainpage.xaml.cs code-behind. viewmodel contains bunch of properties binding properties on controls , work fine. public sealed partial class mainpage : page { public mainviewmodel mainvm { get; set; } public mainpage() { this.mainvm = simpleioc.default.getinstance<mainviewmodel>(); this.initializecomponent(); } ... more stuff isn't important ... } now want bind selectionchanged event on listview. i'm using following in viewmodel: public void accountsselectionchanged(object sender, selectionchangedeventargs e) { .... stuff .... } and in xaml: <listview verticalalignment="bottom" itemssource="{x:bind mainvm.accounts}" itemtemplate="{staticresource accountitemtemplate}" selectionmode="single" selectionch...

mysql - How to push new index and value to php array? -

i fetching data table using group payment method. happen in group data comes corresponding data in table . want payment types shown in result . using following query. $query = "select paytype ,sum(totalamount) `tbl_payments` group paytype"; there 5(cash,credit,paypal..) types of payment . want payment methods result , if paytype not find query result should appended ['credit'] =>[0] , means paytype => amount(which should 0 @ case) . please me on this. you didn't tell table paytype containing list of valid payment methods. to payment methods in result, must use left join. : select pt.paytype, sum(p.totalamount) `tbl_paytypes` pt left join `tbl_payments` p on pt.paytype = p.paytype group pt.paytype

php - Paypal Website Payments Pro transaction not getting listed in the Sandbox account -

i have created simple php app requesting(nvp format) paypal accept payment customers through on-site payment credit-card, though when test dummy cards & success message in response, transaction not getting listed in sandbox account "recent activity" page or "view transactions" or "payments received". my payment type sale , calling "dodirectpayment" method. i have enabled "payment pro" sandbox account & account "verified", still transaction entry not getting listed. can guide me detailed explanation issue might causing ? i using reference. https://github.com/georgeold/paypal-nvp-php-code-examples

objective c - Play Video like youtube in iOS 8 -

i want play video youtube in ios using objective c , video file come url. can guide me how or there way video buffering in efficient way. buffering tube can accomplished native objective c "mpmoviecontroller". can check out if works you. mpmovieplayerviewcontroller* mpmovieplayercontroller = [[mpmovieplayerviewcontroller alloc] initwithcontenturl:url]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(movieplaybackcomplete:) name:mpmovieplayerplaybackstatedidchangenotification object:nil]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(movieplaybackcomplete:) name:mpmovieplayerplaybackdidfinishnotification object:nil]; ...

Paypal- Accept International Payments with DoDirectPayment -

i have integrated dodirectpayment api on website (u.s) accept direct payments credit cards. have been receiving complaints customers italy , saying not able make payments. , every time make payment receive message saying 'invalid expiry date' ( confirmed! . customers did put valid expiry date. ), quite strange . i have own html form accepts, cc number, cvv, street, expiry date, city, zip, country code etc. the product availability of paypal shows website payments pro available u.k, u.s , canada https://developer.paypal.com/docs/classic/howto_product_matrix/ . mean people these countries can make payments? if yes, other alternative should chose accept payment country(that supports paypal). if not, there settings have change in merchant account? any appreciated. if think missing specifics/ code/ other data, please ask.

java - How to skip active window from Desktop sharing -

i'm working on virtual class room project , using red5 screen share application sharing desktop users. sharing entire desktop, don't want share particular application window, in personal work. user32extra.instance.showwindow(hwnd,0); // hiding window bufferedimage image = robot.createscreencapture(new rectangle(x, y, width, height)); user32extra.instance.showwindow(hwnd,5); // showing window i'm using winapi hiding particular window, not giving proper result.

caching - Wincache using with php -

i'm using wincache store value persistent. i'm using below code store value $newhighlowarray = array(); //high low calculation if(wincache_ucache_exists("highlow")) { $existhighlowarray = wincache_ucache_get("highlow"); $isexist = true; $newhighlowarray = /* calculations*/; } wincache_ucache_set("highlow", $newhighlowarray); i need store value without time expire, update cache every second because of value changes in stock market. but cache clear of time , time happening 500 internal server error time getting clear cache.how store value persistent out clear cache. please anyone. my hosting server windows server iis7 by default, wincache_ucache_set function uses ttl=0, means entry should never expired. to insight, should check in php_errors log when 500 internal server error. there should information on why request failed.

bash - Sed command to parse xml from log -

i have log file has embedded xml in , trying parse out using sed. happening getting desired xml line after desired xml being picked up. here sample file 2015-05-06 04:07:37.386 [info]process:102 - application submitted ==== 1 <application> <name> test </name> </application> 2015-05-06 04:07:39.386 [info] process:103 - application completed ==== 1 the sed command using sed -n '/<application>/,/<\/application>/p' batchlog.txt >> np.out as mentioned above, getting desired xml getting line after it. how avoid this? the second part question is, if use in shell script, efficient way process each xml chunk (there can many instances of "application" blocks in file. idea replace values within xml tags contained in each block , re-write file, maintaining original content new values within tags. part, example follows. within shell script, parsing log file , come across application tags, want mask values of tag has ssn in *...

javascript - How can I find a string in a two dimensional array? -

i have array looks this. var array[["a","b"],["c","d"],["e","f"]]; i want able search through array string "d" , return corresponding value "c" . try: function find_str(array){ for(var in array){ if(array[i][1] == 'd'){ return array[i][0]; } } } edit: function find_str(array){ for(var i=0;i<array.length;i++){ if(array[i][1] == 'd'){ return array[i][0]; } } }

java - Running a jar file from terminal in ubuntu -

i have jar file , when execute java -jar firstjar.jar i following errors error: invalid or corrupt jarfile firstjar.jar here manifest file manifest-version: 1.0 created-by: 1.7.0_79 (oracle corporation) class-path:mysql-connector-java-5.1.28.jar main-class:javaapplication1 contents of jar file 0 wed may 13 14:09:06 ist 2015 meta-inf/ 140 thu may 14 00:26:26 ist 2015 meta-inf/manifest.mf 2917 wed may 13 13:16:02 ist 2015 javaapplication1.class thanks in advance! perhaps jarfile corrupted in way, possibly due how downloaded or installed. this issue caused manifest file because haven't added space after every colon in here, should be: manifest-version: 1.0 created-by: 1.7.0_79 (oracle corporation) class-path: mysql-connector-java-5.1.28.jar main-class: javaapplication1 after main-class there must blank line see here https://docs.oracle.com/javase/tutorial/deployment/jar/modman.html .

Python string formatting displays issue -

running python 2.6 i need make api call jenkins using following format: j.build_job('my job name', {'branch_name': 'xyz', 'version': '12.2' }) i need pass in 2 variables branch , version upon displaying output test, doesn't insert branch name first field. ('my job name', {'branch_name': '{0}', 'version': '12.2'}) code below: branch="xyz" version="12.2" print ('my job name', {'branch_name': '{0}', 'version': '{1}'.format(branch,version) }) try it. branch="xyz" version="12.2" print ('my job name', {'branch_name': '{0}'.format(branch) , 'version': '{0}'.format(version) }) # ('my job name', {'branch_name': 'xyz', 'version': '12.2'}) or set vars in dict: print ('my job name', {'branch_name': branch , ...

Django AllAuth How do you Customize your own HTML or CSS -

{% extends "account/base.html" %} {% load url future %} {% load i18n %} {% block head_title %}{% trans "signup" %}{% endblock %} {% block content %} </style> <h1><b>free membership</b>sign today</h1> <h1>{% trans "sign up" %}</h1> <p>{% blocktrans %}already have account? please <a href="{{ login_url }}">sign in</a>.{% endblocktrans %}</p> <form class="signup" id="signup_form" method="post" action="{% url 'account_signup' %}"> {% csrf_token %} {{ form.as_p }} {% if redirect_field_value %} <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" /> {% endif %} <button type="submit">{% trans "sign up" %} &raquo;</button> </form> <h1><b>free membership</b>sign today</h1> {% endb...

algorithm - Building a modular approach in JavaScript -

i have following code , matches requirements, however, not modular , not generic. example, might have hundred of stats objects. there way make more generic? actually, in dataseries have 2 arrays of objects. , sorting them based on color (red, green) . therefore, there 4 stats objects initialized. var stats1 = {data: []} var stats2 = {data: []} var stats3 = {data: []} var stats4 = {data: []} stats1.data.push(self.dataseries[0].data.filter(function (x) { return x.color == "green" })) stats2.data.push(self.dataseries[0].data.filter(function (x) { return x.color == "red" })) stats3.data.push(self.dataseries[1].data.filter(function (x) { return x.color == "green" })) stats4.data.push(self.dataseries[1].data.filter(function (x) { return x.color == "red" })) a=[{ data: stats1.data[0] }, { data: stats2.data[0] }, { data: stats3.data[0] }, { data: stats4.data[0] }]; well if know number of data, you've got all: var numberofdata...

java - Hyperjaxb3: How do I get it to use a superclass' id? -

i'm trying generate set of java classes *.xsd files have common mapped-super-class (called dataobject). far i've managed generate classes descendants of dataobject using following in bindings.xjb file: <jaxb:globalbindings localscoping="toplevel"> <xjc:superclass name="com.companyname.model.dataobject"/> <jaxb:serializable uid="1" /> </jaxb:globalbindings> my problem hyperjaxb3 generates own primary key called hjid, dataobject contains primary key , need/want use that. so, how stop hyperjaxb3 generating hjid classes? i've tried various suggestions i've found online, didn't work me. you or mark 1 of existing properties identifier property using hj:id customization element. see following: <xs:complextype name="mytype"> <xs:sequence> <!-- ... --> <xs:element name="id" type="xs:int" minoccurs="0...

curl - Allow access to protected file through PHP -

i have set of tar.gz files inside folder protected against http access via .htaccess. wish allow direct curl downloading of these files via http. have done things images setting header information like: $file='/some/file/protected/by/htaccess.png'; header("content-type: image/png"); readfile($file); my question: there way provide direct access these tar.gz files in similar manner way did images? the reason in way control access users can access these files our site's login system. edit: pointed out machavity, code pointing @ jpg, , had png header. for tar.gz $filename = 'path/to/your/file.tar.gz'; header('content-type: application/x-compressed'); header("cache-control: no-store, no-cache"); header('content-disposition: attachment; filename="' . basename($filename) . '"'); header('content-length: ' . filesize($filename)); readfile($filename);

socket.io - How to create a CocoaPod with nested git submodules? -

i'm trying create cocoapod nested git submodules. can create pod, however, can't fully install it. when run pod install --verbose can see git submodule update --init being run instead of git submodule update --init --recursive doesn't pull nested submodule. does cocoapods support nested submodules, or no? have scoured web potential leads, can't find anything! i should mention lint passes pod lib lint not pod spec lint. pod spec lint complains can't find header file in nested submodule. i'm not sure if related problem above. (also note particular pod i'm working on proof of concept. i'll creating more complex pod depends on socket.io-objc. unfortunately socket.io-objc not available pod, , depends on socketrocket submodule.) here's podspec: pod::spec.new |s| s.name = "debugtools" s.version = "0.1.0" s.summary = "awesome tools debugging ios apps." s.homepage ...

function - Run time error 91-Object variable or With block variable not set -

run-time error '91': object variable or block variable not set sub findfilmnameusingeventhandler() sheet1.activate dim searchrange range dim filmname string dim releasedate integer dim filmtofind string set searchrange = range("b3", range("b2").end(xldown)) filmname = inputbox("type movie") filmtofind = searchrange.find(what:=filmname) 'filmtofind = range("b2:b15").find(what:=filmname) msgbox filmtofind & " movie " end sub` hi, thank reviewing question. i've declared range variable & use search string "filmtofind = searchrange.find(what:=filmname)" & fails run time error run-time error '91': object variable or block variable not set can search same range declared range filmtofind = range("b2:b15").find(what:=filmname) & can find variable. please point mistake? the film entering not exist in list, try error check this: sub something() dim searchrange...

javascript - How to replace all matching characters except the first occurrence -

i trying use regex compare string in javascript. want replace '.'s , '%'s empty character '' catch don't want replace first occurrence of '.' . value.replace(/\%\./g, ''); expected result below: .4.5.6.7. ==> .4567 4.5667.444... ==> 4.56667444 ..3445.4 ==> .34454 you can pass in function replace , , skip first match this: var = 0; value.replace(/[\.\%]/g, function(match) { return match === "." ? (i++ === 0 ? '.' : '') : ''; }); here self-contained version no external variables: value.replace(/[\.\%]/g, function(match, offset, all) { return match === "." ? (all.indexof(".") === offset ? '.' : '') : ''; }) this second version uses offset passed replace() function compare against index of first . found in original string ( all ). if same, regex leaves . . subsequent matches have higher offset first . matched, , re...

html - JavaScript game - score on a separate page -

i creating matching game in javascript (matching correct animals names animal prints) , stuck on 1 last bit.. i want score, can see being added go along, appear on different webpage. how go doing this, when remove 'score' div html page corrupts. any appreciated. heres code.. <html> <head> <script> function randsort (a,b) {return math.random() - 0.5} var questions = [ {text: " animal this?", img: "animalprints/1.jpg", answers: ["cheetah", "tiger", "ladybird"], ans: "0"}, {text: " animal one?", img: "animalprints/2.jpg", answers: ["elephant", "giraffe", "snake"], ans: "1"}, {text: "what animal 1 please?", img: "animalprints/3.jpg", answers: ["bumblebee", "tiger", "lady bird"], ans: "2"}, {text: "what animal 1 please?", img: "animalprints/4.jpg",...

node.js async.series functions not finishing in series -

i'm trying have functions execute in series using async.series. functions run not finish in series. i'm new node.js , i'm struggling figure out. here code i'm using. async.series([ function(callback){ printrevision(peripheral, chars); callback(); }, function(callback){ setinterface(chars); callback(); }, function(callback){ performlooptest(peripheral, chars, 0); callback(); }, function(callback){ verifyresults(); callback(); }], function(err){ console.log(err) } ) function printrevision(peripheral, chars) { if (dis_fwrev_uuid in chars) { chars[dis_fwrev_uuid].read(function(error, data) { // ignore errors; missing fw revision ok if (data) { console.log( "bootloader firmware revision: " + data.tostri...

html - PHP - Redirect back to previous page, without any form -

on website offer visitors 4 languages. have dropdown list @ top-right of site can choose language. when press item in dropdown list sent /en, /pl, /pt, /se (depending on language chose). inside example /pl (polish) folder, put this: <?php session_start(); $_session['lang'] = "pl"; header('location: ../'); exit; ?> i re-direct them front page, check if lang pl, use polish text. but want re-direct them specific page on prior pressing item in dropdown menu. if browsing /news page, want them re-directed there , not front page. i cannot seem this. possible? i know can form, , insert hidden input. without form! here's dropdown menu: <!-- language settings --> <ul class="nav navbar-nav navbar-right"> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><?php echo menu8; ?...

Awk/Unix group by in order -

assume have text file: daisy abc0002 1 kevin abc0001 2 mike abc0001 3 john abc0003 4 pete abc0002 5 we try such result: kevin abc0001 2 mike abc0001 3 daisy abc0002 1 pete abc0002 5 john abc0003 4 there no order among names last column should considered while grouping rows according abc000# labels. suggestion? thanks. for data shown, can use: sort -k2,2 -k3,3 if there might ever multi-digit numbers in third column, specify numeric sorting: sort -k2,2 -k3,3n sort -k2,2 -k3n,3 for example, given input file: daisy abc0002 1 kevin abc0001 2 mike abc0001 3 john abc0003 4 pete abc0002 5 hazel abc0002 34 sarah abc0002 24 alice abc0002 11 zoe abc0002 9 numeric sort in column 3 kevin abc0001 2 mike abc0001 3 daisy abc0002 1 pete abc0002 5 zoe abc0002 9 alice abc0002 11 sarah abc0002 24 hazel abc0002 34 john abc0003 4 non-numeric sort in column 3 kevin abc0001 2 mike abc0001 3 daisy abc0002 1 alice abc0002 11 sarah abc0002 24 hazel abc0002 34 pete abc0002 5...

statistics - How to create a histogram2d of two arrays of different lengths? -

i trying create numpy histogram2d x , y sizes of x , y different. documentation, x , y need have same size, data , application have naturally needs histogram have different x , y dimensions bins = 100 x = np.random.normal(3, 1, 100) y = np.random.normal(1, 1, 150) np.histogram2d(x, y, bins)[0] gives me valueerror: operands not broadcast shapes (100,) (150,)

Django - Runtime database switching -

in work want run server multiple databases. databases switching should occur when acces url http://myapp.webpage.com or http://other.webpage.com . want run 1 server instance , @ moment of http request switch database , return corresponding response. we've been looking mantainable , 'django-friendly' solution. in our investigation have found possible ways this, have not enough information about. option 1: django middleware the django middleware runs each time server receive http request. making database switch here best option using django database routers far know allow change database model or group or models. another option set django model manager instance in middleware , force models re-assign objects attribute added attribute in custom middleware. my last option create new attribute in request object received middleware return database alias settings.py , in each model query use using method . option 2: class-based view mixin create mixin use ...

netlogo - Extension not found error with control flow extension -

Image
i trying use https://github.com/qiemem/controlflowextension alternative if-else. have added extensions folder(c:\program files (x86)\netlogo 5.1.0\extensions). extracted zipped folder github. in netlogo code use following, extensions[controlflowextension-master] but still shows me following error: there no release extension yet. zip file downloaded source code , doesn't contain compiled jar files need use extension netlogo. if want try out, have build yourself. that, need install sbt . then, open command terminal , cd folder unzipped file downloaded github. folder should under netlogo extensions folder , called cf (rename if not case). once in cf folder, run: sbt package this should build cf.jar , allow use extension putting extensions [ cf ] at top of code tab in netlogo model. be aware, though, extension still experimental. there may bugs. syntax still change. why bryan did not put out official release yet.

c++ - Variadic template function name lookup fails to find specializations -

i attempting program string concatenation function utilizes 3d library's string conversion functions, implemented variadic template. the library's conversion function behaves unusually if string (either const char[] literal or std::string) passed it. not possess functions types, want specialize template pull out , not run them through converter. optimization reason if converter handled them. template<typename t> inline string c(t a) { return ogre::stringconverter::tostring( ); } template<> inline string c(string s) { return s; } template<> inline string c(const char s[]) { return s; } template<typename t, typename... args> inline string c(t a, args... args) { return ogre::stringconverter::tostring( ) + c(args...); } template<typename... args> inline string c(string s, args... args) { return s + c(args...); } template<typename... args> inline string c( const char s[], args... args) { return s + c(args...); } ...

python - How to select specific filenames nested within several folders? -

i have working folder on "c:\users\username\desktop\test" python test script located. idea import directory drive ("d:\mydir\mytests\projects") current working directory: import os os import getcwd curdir=os.getcwd() path = os.chdir(os.path.join(curdir,"d:\mydir\mytests\projects")) under "projects" directory there several folders contain subfolders (but not every). trieng make kind of generic code iterate on "projects" directory access every folder or subfolder if exist , find specific files ".proj" extension. found files (".proj") should writen out in form of list (maybe) can run each of them 1 one loop. tried write down code not successfully. suggestion appreciated lot. proj_list = [] dirpath, dirnames, files in os.walk(path): f in files: dest_dir = glob.glob('*.proj') fullpath = os.path.join(dirpath, f.dest_dir) proj_list.append(fullpath) def activate_approval(dialog...

javascript - When I navigate to a route directly i get server output, but when I use a link i get the view rendered correctly -

i'm noob , working on mean.js boilerplate. i've created routes, i'm having issue, where, when navigate route ('/articles') server output this: [{"_id":"5553aa4116a2fddc830b0f66","user":{"_id":"5552398fcf7ada7563db68b7","displayname":"mo bazazi"},"__v":0,"content":"wahattata","title":"fifth examples","created":"2015-05-13t19:47:13.905z"}] but want ge rendered view, when manually type in route - have suggestions? here part of express config use strict'; /** * module dependencies. */ var fs = require('fs'), http = require('http'), https = require('https'), express = require('express'), morgan = require('morgan'), bodyparser = require('body-parser'), session = require('express-session'), compress = require('compressio...

angularjs - Asserting $http request payloads without mocking them -

i'm writing protractor tests verify successful creation of reports in our application. report created via series of complex ui interactions within dialog , saved via ajax post request rest api. i've written tests complex ui interactions within modal, i'm @ loss how test post request within same protractor tests. ideally, i'd able make assertions against payload of post request verify ui sending correct data api. it's important note not want mock http call--i need go through, since subsequent protractor tests navigate report , perform additional checks. first thought somehow hook $httpbackend.passthrough() method, haven't had success that. any ideas how accomplish this? since subsequent protractor tests navigate report , perform additional checks if check report contains data matches submitted, are, albeit indirectly, testing post went through successfully. there reasonable argument enough e2e test: tests application behaves user want. us...

ibm bluemix - Git Repo was created missing many project files -

have strange issue. cloned bluemix app had been working on, removed .git info, modified manifest, package , project files , used 'cf push' create new app. it appeared work, new project created in bluemix , files there when looked in files , logs tab, clicked 'add git' use 'edit code' button. when pane appeared of code files missing git repo (including app.js, views folder, etc ). what easiest way sync files see in files , logs repo project attached through bluemix? thanks, andy this happens "add git" button clone in files boilerplate created app from. in case looks node.js app. we incredibly sorry this. our dev team looking making "add git" button work projects. two work arounds follows. create new app, click "add git", insure baseline new files in git project. this 1 isn't pretty work. checkout git project app have created. add files git project , commit them.

javascript - Angular $locationProvider html5Mode / <base> error -

so i'm running problem angular 1.3.15 , $locationprovider. every time turn html5mode on typeerror: cannot read property 'replace' of undefined error. if leave html5mode off, works fine. my directory structure ( 4.dev being versioned directory name ): public / - index.html 4.dev / css / js / images / partials / etc... i have base tag set this: <base href="/4.dev/"> and i'm configuring $locationprovider so: $locationprovider.html5mode({ enabled: true }); if change base tag href "/" angular doesn't have issues (but assets don't load). suspect issue angular having deals fact index.html file 1 directory rest of site. for reasons won't list here, can't change dir structure , don't want change base tag (because don't want manually stick version number these files). want leave html5mode on. does have solution problem? there way me manually set "base hr...

Aligning Buttons with rails code, css, and html -

Image
i have 2 buttons in form, using css sheet layout tables , want have buttons in last row, want them side side. my current code looks <button><%= link_to "edit", edit_user_path(u.id), { :method =>get } %></button> <button><%= link_to "delete", user_path(u.id), { :method => delete, :class=>destroy, data: {confirm: 'are sure?' } %></button> if change to: <button><%= button_to "edit", edit_user_path(u.id), { :method =>get } %></button> <button><%= button_to "delete", user_path(u.id), { :method => delete, :class=>destroy, data: {confirm: 'are sure?' } %></button> the buttons end side side, button button tag. if change to: <td><%= button_to "edit", edit_user_path(u.id), { :method =>get } %> <%= button_to "delete", user_path(u.id), { :method => delete, :class=>destroy, data: {confirm: ...

PHP static variable as a result of another function -

i trying define php class static variables. trying following avoid using globals. class class_name{ private static $var1 = is_plugin_inactive('plugin/plugin.php'); //check if wordpress has plugin active public static function dosomestuff(){ echo $var1; } } //init class class_name::dosomestuff(); this get's me error parse error: syntax error, unexpected '(', expecting ',' or ';' in my_file.php @ line defining static variable. any please. not sure of exact situation, can do: class class_name { private static $var1 = null; //check if wordpress has plugin active public static function dosomestuff(){ if(is_null(self::$var1)) self::$var1 = is_plugin_inactive('plugin/plugin.php'); echo self::$var1; } } basically call function wanting to, initialize if not already?

Android SendMultipartTextMessage with pendingIntents with Extra values same for all parts -

i sending multi-part (concatenated) messages through android using xamarin studio , sms.telephony.smsmanager android library. to send message doing following: var longmessage = "this cØncatenated message sent through android. should appear single message. it's easy that. has function break message up. took me longer install xamarin did write code , send actual message"; var smsmgr = android.telephony.smsmanager.default; system.collections.generic.ilist<string> parts = smsmgr.dividemessage(longmessage); ilist<pendingintent> pendingintents = new list<pendingintent>(parts.count); (int = 0; < parts.count; i++) { var intent = new intent(deliveryintentaction); intent.putextra("messageparttext", parts[i]); intent.putextra("messagepartid", i.tostring()); pendingintent pi = pendingintent.getbroadcast(this, 0, intent, 0); pendingintents.add(pi); } smsmgr.sendmultiparttextmessage("17057178131",null, parts, pen...

python - How can I join columns in Pandas? -

i´ve got following data frame: ident year month day hour min xxxx yyyy gps snr 0 0 2015 5 13 5 0 20.45 16 0 44 1 0 2015 5 13 4 0 20.43 16 0 44 2 0 2015 5 13 3 0 20.42 16 0 44 3 0 2015 5 13 2 0 20.47 16 0 40 4 0 2015 5 13 1 0 20.50 16 0 44 5 0 2015 5 13 0 0 20.54 16 0 44 6 0 2015 5 12 23 0 20.56 16 0 40 it comes csv file , i´d made dataframe using python pandas. now i´d join columns year+month+day+hour+min make new one, example date-time 2015-5-13-5-0 how can ? date_cols = ['year','month','day','hour','min'] df[date_cols] = df[date_cols].astype(str) df['the...

Python - How to find 'repeat' characters in a string? -

this question has answer here: find occurrences of character in string 6 answers find occurrences of substring in python 10 answers for example in 'gattaca' want find 'a's. i want positions 1,4,6. using '.find' method gives me location of first 'a' not rest. i wondering if there method allowed find 'repeat' characters in string? in [26]: s = 'gattaca' in [27]: [i i,char in enumerate(s) if char=="a"] out[27]: [1, 4, 6]

ios - Parsing JSON in Objective C with key names as incremented integers -

not sure how word question have json need parse formatted so:- "nodes": { "4": { "node_id": 4, "title": "title 1", "description": "", }, "7": { "node_id": 7, "title": "title 2", "description": "", }, "12": { "node_id": 12, "title": "title 3", "description": "", }, normally grab values standard [dictionary objectforkey@"key"] items begin integer (string) finding hard parse correctly. missing simple here? if want access 1 value following. // assume jsonobject "root" dictionary nsdictionary *fourdictionary = jsonobject[@"nodes"]["4"] // object "4":{} now if json in question can have dynamic number of objects trickier. easiest solution pro...

excel vba - script out of range error help needed -

i have snip of code not populate worksheet names printing in pdf. subscript out of range compiling error. ideas? application.screenupdating = false sheets("macros").select dim strpath string, strfilename string dim integer, y integer, x integer dim wkstnames() variant dim icount integer, iwkstcount integer dim printrange range set printrange = range("p222:p248") dim p() variant icount = 1 iwkstcount = thisworkbook.sheets.count redim wkstnames(1 iwkstcount) redim p(1 27) y = 1 iwkstcount x = 1 27 printrange.rows(p(x)).select if activecell = "true" wkstnames(y) = sheets(icount).name icount = icount + 1 next x next y sheets(wkstnames).select ' error occurs here the reason pretty simple actually. redimming array in beginning , line wkstnames(y) = sheets(icount).name not executing , hence getting @ least 1 blank value in array. try , loop through array after created. use code for = lbound(wkstnames) ubound(wks...

java - Frameless AND modal JDialog -

i create modal , frameless dialog window least implementation overhead possible. i cannot dialog.setundecorated(false) if dialog created non-null parent window displayed (see setundecorated(true) jdialog created instance of joptionpane ). the question is: can in swing @ all? if so, how? thanks in advance! edit: ok, stackoverflow, i've found it: http://www.stupidjavatricks.com/2005/09/making-a-custom-frameless-window/ question closed. i cannot dialog.setundecorated(false) that's because want: d.setundecorated(true);

php - Get domain with its subdomain from url -

i'm using function domain , subdomain string. if string expected format, returns null function getdomainfromurl($url) { $host = parse_url($url, php_url_host); return preg_replace('/^www\./', '', $host); } $url = "http://abc.example.com/" -> abc.example.com | ok $url = "http://www.example.com/" -> example.com | ok $url = "abc.example.com" -> fails! the issue parse_url returning false. check make sure response before trying use otherwise $host empty. <?php function getdomainfromurl($url) { $host = (parse_url($url, php_url_host) != '') ? parse_url($url, php_url_host) : $url; return preg_replace('/^www\./', '', $host); } echo getdomainfromurl("http://abc.example.com/") . "\n"; echo getdomainfromurl("http://www.example.com/") . "\n"; echo getdomainfromurl("abc.example.com"); output: abc.example.com example.com...

php - wp_customize and selecting layout -

so i'm trying build conditional statement display different layouts depending on option selected. having bit of trouble. $wp_customize->add_setting('layout', array( 'default' => 'stream', )); // add our default setting. $wp_customize->add_control('layout', array( 'label' => __('select layout', 'ari'), 'section' => 'layout', 'settings' => 'layout', 'type' => 'radio', 'choices' => array( 'stream' => 'stream', 'grid' => 'grid', ), )); // use radio buttons (so far) 2 choices. $wp_customize->add_section('layout' , array( 'title' => __('layout','ari'), )); // add our layout section in customize panel. displaying our layout. <?php if ( get_theme_mod( 'stream' ) ) : ?> <p>stream</...

java return to specific point in program -

i have next question. have program has structure: loadcontext(); showcategories(input); showprojects(input); showdetails(); on each step me user has ability jump previous step. example press 0 , program returns previos step. press 1 - program starts beginning. there instruments in java come specific point? edit: have here console application. main method looks like: loadcontext();//loads categories showcategories(input);//shows available categories , ask category show showprojects(input);// shows projects inside selested category , select project show in details showdetails();//show selected project now want set option. example, in showprojects(input) put 0 , see again categories, select , see category. in showdetails() select 0 , show categories, select 1 , on. you can this: wrap 4 methods in method: private void programstart(){ loadcontext(); showcategories(input); showprojects(input); showdetails(); } then have method...