Posts

Showing posts from May, 2012

Flask-SQLAlchemy + create_all() failed on many-to-many relationship creation -

Flask-SQLAlchemy + create_all() failed on many-to-many relationship creation - i have next application structure: run.py |->app |->models |-> user.py (declares role-to-user relationship table , user model) |-> role.py (declares role model) |-> main.py (contains initialization , required imports) |-> extensions (here sqlalchemy variable declared imported later) when trying create initial db construction next way: from app.models import * app.extensions import db app.main import myapp #app initialized packages assets, db, security, etc. myapp.test_request_context(): db.create_all() i've got exception: noreferencedtableerror: foreign key associated column 'users_to_roles.user_id' not find table 'users' generate foreign key target column 'id' i tried dow next way: @app.before_first_request def initialize_database(): db.create_all() with no success i tried move role same file user m

VBScript XCopy to local disk not working -

VBScript XCopy to local disk not working - i trying develop simple script copies files specific drives. the script following: check physical drive letter if drive exists re-create files. if no drive move step 2. check network drive letter if drive exists re-create files. if no drive move step 3. create new network mapping copy files drive when network drive exists, or network mapped drive created via script xcopy commands works perfectly. problem step 1 , local drive exists, no files copied drive after calling xcopy. here code: strlocaldrive = "e:" strremoteshare = "\\127.0.0.1\c$\program files (x86)\myfolder\edrive" bolfoundexisting = false source = "c:\program files (x86)\myfolder\edrive\*" destination = "e:\" ' check parameters passed create sense if right(strlocaldrive, 1) <> ":" or left(strremoteshare, 2) <> "\\" 'wscript.echo "usage: cscript mapdrive.vbs drive filesh

svn - Does crucible integrate with teamcity -

svn - Does crucible integrate with teamcity - does crucible integrate teamcity?if not peer code review tool can used teamcity continuous integration? also have question.... gerrit work subversion? saw reitveld had back upwards subversion gerrit has back upwards svn? crucible doesn't integrate straight teamcity, however, jira (atlassian's issue tracker) integrates quite nicely both teamcity , crucible/fisheye. here resources farther reading: jira + crucible integration jira plugin teamcity linking jira teamcity integrating jira fisheye also, no, gerrit supports git. this comment suggests rietveld alternative svn. svn teamcity gerrit atlassian-crucible

How can I generation sine function faster in c -

How can I generation sine function faster in c - is there anyway in can compute sine function faster in c.when generate sine waveform 16,384 samples taking me 3.96 seconds , want less 1 sec. give below logic used sine wave , taking 4 seconds compute.i tried optimization of code of no help. someone please help me out int i; float f,temp = (2 * m_pi) /16384 for(i=0;i<16384;i++) { f = sin(temp * i); } there's no reason have compute f more once, ever. if performance critical, hardcode array of values source. c

html - CSS issue with Opera browser -

html - CSS issue with Opera browser - i have simple page: 5 rows (4 rows explicitly defined height [header, bredcrumb, trademark, footer], 1 row set 100% [content]) display on web page. however, css renders in firefox, chrome, net explorer , safari. opera hates me , adds scrollbar. how construction css fits 5 browsers, without adding scrollbar browser? html: <html> <head> </head> <body> <div class='header'> </div> <div class='breadcrumb'> </div> <div class='content'> <div class='panels'> <div class='panel-a'> </div> <div class='panel-b'> </div> <div class='panel-c'> </div> </div> </div> <div class='trademark'> </div> <div class='footer'> </div> </body> </html> css: div.header, div.breadcrumb, div.content, div.trademark, div.footer { display: table-row;

c# - Windows phone 8 How to add border to item in itemscontrol -

c# - Windows phone 8 How to add border to item in itemscontrol - i'm new windows phone , have stuck in days. what need list border on each items. first seek utilize listbox ,which easy add together border item using listbox.itemcontainerstyle ,but found items in listbox alter color while tab on it,so searching prevent,at lastly found available solutions in answer,but take reply not working on windows phone, , answers says create listbox disabled work.so set ishittestvisible false, cause buttons in item disabled. so came itemscontrol @ last,it has no itemcontainerstyle property in windows phone every result googled says that.i tried set border in template didn't work @ all. this issue driving me crazy,any suggestions please! why not define itemtemplate? can specify how each item should look. example: <listbox.itemtemplate> <datatemplate> <border> <textblock text="{binding title}" fontsize="18

In Rails while using the `where` method, how to match only the year and month? -

In Rails while using the `where` method, how to match only the year and month? - normally, select records same date utilize : bronze.where(regdate: date.new(2014,03,03)) how can utilize select year , month? for month be: date = # set date here bronze.where(regdate: date.beginning_of_month...date.beginning_of_month + 1.month) analogically year. ruby-on-rails ruby-on-rails-4

.net - Retrieving Windows Password Hint from the registry -

.net - Retrieving Windows Password Hint from the registry - i have been trying extract windows login password hint windows 7 programmatically , came know can retrieved next location in registry hklm\sam\sam\domains\account\users\"userkey"\userpasswordhint however, not able figure out there way find out userkey logged-on user programmatically? if can current user name, it's quite easy, using same registry tree. take in hklm\sam\sam\domains\account\users\names\{username} . value of entry relate proper userkey . of course of study remember hint may not exist. edit ha! nailed it! as said in comment, it's not values of node contain proper value, it's type of default entry of node. it's hard, if not impossible, obtain c#, types not standard. have troubles approach, changed it. the hexadecimal value phone call userkey is, in fact, lastly part of user sid (this part called rid). far know, every administrator has rid = 500, every invitee

messagebroker - IBM Integration Bus: How to read user defined node (Java) complex (table) property in Java extension code -

messagebroker - IBM Integration Bus: How to read user defined node (Java) complex (table) property in Java extension code - i created java user defined node in integrationtoolkit (9.0.0.1) , assigned several properties. 2 of node properties simple (of string type) , 1 property complex (table property predefined type of user-defined) consisted of 2 simple properties. next documentation able read 2 simple properties in java extension class (that extends mbnode , implements mbnodeinterface) making getters , setters match names of 2 simple properties. documentation states getters , setters should homecoming , set string values whatever real simple type of property may be. obviously, not work complex node property. able read user defined properties defined on message flow level, using cmp (integration buss api) classes, impossible thing user defined node without cmp. @ 1 point began think complex property among user defined properties, (although udps defined on flow level , property

python - New Django App MEDIA_URL pathing incorrect -

python - New Django App MEDIA_URL pathing incorrect - so, i've created new app in django via python manage.py startapp foo my new app not load files in /site_media/ directory, via {{ media_url }} . attempting path app's directory, not /site_media/ directory. example: instead of loading http://sitename/site_media/bootstrap/bootstrap.min.css it tries load http://sitename/foo/bootstrap/bootstrap.min.css here snippet settings.py defines media_url media_url = '/site_media/' i can forcefulness files load correctly in app replacing {{ media_url }} /site_media/ in base.html , show_foo.html , breaks pathing on rest of site. i'm not sure else see seek , diagnose issue, i'm stumped! in case: urls.py in app directory #!/usr/bin/python # -*- coding: utf8 -*- django.conf.urls.defaults import * urlpatterns = patterns('foo_web.foo_track.views', url('^$','view_foo_track',name='foo_home'), url('^n

java - How to solve name conflict of method in two interfaces -

java - How to solve name conflict of method in two interfaces - i have 2 interfaces, have same method different homecoming value such float , double . how can implement both of them in class, not alter method name? //calculate.java public interface calculate { final float pi = 3.141592f; float getcircumference(float r); float getarea(float r); } interface geometryshape{ public static final float pi = 3.14159f; public abstract float getcircumference(float r); public abstract double getarea(float r); public abstract void draw(); } //circ.java public class circ implements calculate, geometryshape{ public float getcircumference(float r){ homecoming calculate.pi * 2 * r; } public float getarea(float r){ homecoming calculate.pi * r * r; } you can't implement both interfaces unless methods differ in parameter types (or method name) when homecoming different types. from jls-8.1.5, a class cannot hav

How software update works in VLC media player -

How software update works in VLC media player - i interested know major steps involving in software update process in vlc player. i'm interested know, whether done through http or ftp server. the vlc player's updating steps follows. vlc player or applications sends http "post" server replies url of update file if update present. then vlc player downloads update file using http "get" method. this process includes check sum verification of file. vlc

asp.net - SENDGRID email confirmation -

asp.net - SENDGRID email confirmation - im trying utilize email verification sendgrid. error im getting while trying register using http://goo.gl/77wxpt tutorial : bad request description: unhandled exception occurred during execution of current web request. please review stack trace more info error , originated in code. exception details: system.exception: bad request source error: if (transportweb != null) { await transportweb.deliverasync(mymessage); } else and source code of identityconfig.cs is: public class emailservice : iidentitymessageservice { public async task sendasync(identitymessage message) { await configsendgridasync(message); } // utilize nuget install sendgrid (basic c# client lib) private async task configsendgridasync(identitymessage message) { var mymessage = new sendgridmessage(); mymessage.addto(message.destination); mymessage.from = new syste

hadoop - Send ordered keys to correct reducer -

hadoop - Send ordered keys to correct reducer - if have keys 0 19, , want create partitioner send records keys 0 , 1 first reducer, 2 , 3 sec reducer , on. there way of doing this? in cases, you need know number of reducers before hand. solution quite generic per level of understanding question, looking @ question, next sequence occurs, reducer0 keys 0,1|reducer1 keys 2,3|reducer2 keys 4,5|reducer3 keys 6,7| reducer4 keys 8,9|reducer5 keys 10,11|reducer6 keys 12,13|reducer7 keys 14,15| reducer8 keys 16,17|reducer9 keys 18,19 in case, integer value of key in partitioner set reducer key/2 if key 13, reducer 13/2 = 6 if key 14, reducer 14/2 = 7 public static class custompartitioner extends partitioner<intwritable, whatever> { @override public int getpartition(intwritable key, whatever value, int numreducetasks) { int keyasinteger = key.get(); homecoming keyasinteger/2; } } hadoop

Wordpress Conditional Radio Button Not Working -

Wordpress Conditional Radio Button Not Working - currently trying convert html wordpress plugin, trying code given below. radio button selected has value style1, statement in else beingness executed. $style=get_option("style"); if($style == "style1") {//code1 } else{ //code2 } p.s. - amateur in wordpress programming. you're trying client-side scripting using server-side scripting language (php). unless decide deal $_post info server, you'll need utilize javascript (or client-side language) accomplish you're trying do. wordpress wordpress-plugin

node.js - How to create a persistent unique index in MongoDB -

node.js - How to create a persistent unique index in MongoDB - disclaimer : i'm using mongoose less 48h. i have model looks : var mongoose = require('mongoose'); var schema = mongoose.schema; //schema definition var categoryschema = new schema({ name: string, url: { type: [string], index: true }, extra: array, frequency: number, last_processed: date }); // model definition var category = mongoose.model('categories', categoryschema); when app launches, has method automatically update collection, using js file structured next (js file not under control): var categories = { retailer: 'ret1', name: 'c1', url: 'url1', extra: ['tag1'], frequency: 2, last_processed: '' }, { retailer: 'ret2', name: 'c2', url: 'url2', extra: ['tag2'], frequency: 2, last_processed: '' }, ........ ]; module.exports = catego

ruby on rails - Resetting delayed job worker after deleting row from db -

ruby on rails - Resetting delayed job worker after deleting row from db - i'm using in heroku application delayed_job_active_record gem. i deleted delayed_jobs table job. locked worker(fields locked_by , locked_at not blank). how can gracefully delete locked delayed_job - , should restart worker, work current job? because worker still running after deleting row. ruby-on-rails heroku delayed-job

C++ Code Possible Issues -

C++ Code Possible Issues - are there errors in code below? #include <vector> #include <iostream> #include <string> #include <algorithm> #include <functional> int main() { std::vector<std::string> myvector; myvector.push_back("one"); myvector.push_back("two"); myvector.push_back("three"); myvector.push_back("four"); myvector.push_back("five"); std::sort(myvector.begin(),myvector.end(),std::less_equal<std::string>()); std::string& str = myvector.back(); std::cout << str << std::endl; std::vector<std::string>::const_iterator = myvector.begin(); myvector.push_back("six"); myvector.push_back("seven"); std::cout << *it << std::endl; homecoming 0; } i see assigning address of lastly element of vector str means if remove element str empty, , can cause united nations expected behaviour , run time iss

cmake use one cmakelist.txt for a project with subdirectories -

cmake use one cmakelist.txt for a project with subdirectories - i construction code in multiple subdirs dont want create new cmakelist.txt in each new subdir. my folder construction this: project >cmakelist.txt >build >src >main.cpp >multiple_subdirs_or_(c|h)pp_files_with_more_subdirs_or_(c|h)pp_files my cmakelist.txt looks this: ... file(glob_recurse cpps relative ${cmake_current_list_dir} "src/*.cpp") file(glob_recurse hpps relative ${cmake_current_list_dir} "src/*.hpp") #remove files main list(remove_item cpps "src/test.cpp") #bins add_executable(test src/test.cpp src/test.cpp ${hpps} ${cpps}) #same problem if used instead of other add_executable add_library(foo object ${cpps} ${hpps}) add_executable(test src/test.cpp $<target_objects:foo>) the problem file: source files created after execution of cmake not compiled , build fails if used. predicted http://www.cmake.org/cmake/help/v3.0/comman

ios - How to get know that CGContext is drawing to screen -

ios - How to get know that CGContext is drawing to screen - i want know current cgcontext used image, pdf or screen drawing. in cocoa utilize [[nsgraphicscontext currentcontext] isdrawingtoscreen] ([nsgraphicscontext currentcontextdrawingtoscreen] on 10.10). how can same info cgcontext? contrary desktop, on ios there's no direct drawing screen views layer backed. question is: how can tell if current context used fill contents of layer? i'm not aware of public api answers this. ios cgcontextref drawingcontext

c++ - How to emulate EBO when using raw storage? -

c++ - How to emulate EBO when using raw storage? - i have component utilize when implementing low-level generic types store object of arbitrary type (may or may not class type) may empty take advantage of empty base of operations optimization: template <typename t, unsigned tag = 0, typename = void> class ebo_storage { t item; public: constexpr ebo_storage() = default; template < typename u, typename = std::enable_if_t< !std::is_same<ebo_storage, std::decay_t<u>>::value > > constexpr ebo_storage(u&& u) noexcept(std::is_nothrow_constructible<t,u>::value) : item(std::forward<u>(u)) {} t& get() & noexcept { homecoming item; } constexpr const t& get() const& noexcept { homecoming item; } t&& get() && noexcept { homecoming std::move(item); } }; template <typename t, unsigned tag> class ebo_storage< t, tag, std::enable_if_t<std::is_class<t

wpf - Row dragging in DataGrid -

wpf - Row dragging in DataGrid - i have datagrid in wpf application, right when click on cell highlights whole row , when drag downwards rows highlights of rows in between. what need dragging on row re-create value cell start on over rows drag on , highlight rows in specific column. the exact words in request "like excel". is there written command this? have searched , have not found looking for. if command not exist, starting place? a starting place larn how code drag , drop. i created treeview drag , drop functionality. might ideas on how drag , drop works project. you can download here: https://drive.google.com/file/d/0b5wyqsalui0bymj4skezxzdmuk0/view?usp=sharing if need help sense free ask.... best of luck..... wpf wpf-controls wpfdatagrid

mysql - SQL query to find columns with more than one string "a href" in them -

mysql - SQL query to find columns with more than one string "a href" in them - i'm organizing articles in big database , face problem - need find articles 2 or more links in them. every link html link , has form <a href="...">...</a> . how select article database links have @ to the lowest degree 2 a href in them? i taught how select 1 a href two?... select * `articles5` content "%a href%" how double this? had tried using own code twice? select * `articles5` content "%a href%a href%" mysql sql string

mysql - How to write the following SQL query? -

mysql - How to write the following SQL query? - property_for_rent (pno, street, area, city, pcode, type, rooms, rent, ono, sno, bno) owner (ono, fname, lname, address, tel_no) find name , address of property owners have houses registered rental agency. there 2 types of property(houses,flat ). "only" have no ideal select fname, lname, address owner ono in ( select ono property_for_rent type = "house" , ono not in ( select ono property_for_rent type <> "house" ) ) this way, tried. there improve way? you can in several ways. 1 way utilize group by , having . method utilize not exists : select o.* owner o not exists (select 1 property_for_rent pfr o.ono = pfr.ono , type <> 'house'); mysql sql

java.util.scanner - Get the Java program to read parenthesis, brackets, and curly braces -

java.util.scanner - Get the Java program to read parenthesis, brackets, and curly braces - i writing programme verifies arithmetic look correctly formed. (for example: right form "2 + (2-1)" , wrong form ")2+(2-1" ) once it's been verified, programme compute results. at moment, can compute in parenthesis easily. if there bracket involved (for example, "2 [ 3 + (1) ]" ) programme verifies look correct, cannot calculate results. here code i'm concerned about void postfixexpression() { stk.clear(); // re-using stack object scanner scan = new scanner(expression); char current; // algorithm doing conversion.... follow bullets while (scan.hasnext()) { string token = scan.next(); if (isnumber(token)) { postfix = postfix + token + " "; } else { current = token.charat(0); if (isparentheses(current)) { if (stk.

javascript - Feature detection of buggy IndexedDB implementations? -

javascript - Feature detection of buggy IndexedDB implementations? - i have indexeddb-based app. easy feature detection on indexeddb - see if window.indexeddb defined or not. however, 2 things have changed recently: safari released broken indexeddb support i rewrote part of app utilize features (compound indexes , multientry indexes) ie not support so need more fine-grained feature detection show reasonable error message safari , ie users. i can imagine testing ie's missing features wouldn't difficult, since @ to the lowest degree problems documented. safari, there multiple bugs , don't know how it's documented anywhere. heck, don't own apple devices can run safari on. , if other browser in future releases buggy indexeddb implementation? has thought or solved these problems before? seems me there should standard indexeddb feature detection library, can't find (modernizr's indexeddb stuff doesn't seem sufficient). for ie can check:

python - Histogram in N dimensions with numpy -

python - Histogram in N dimensions with numpy - i'm trying generate 2 2d histograms using numpy.histogramdd (i'm aware of histogram2d, need 1 scalability n dimensions eventually) both histograms should utilize same range, define before obtaining them. the issue can't code work, either valueerror: many values unpack or valueerror: sequence large; must smaller 32 error using different configurations. here's mwe: import numpy np def rand_data(n): homecoming np.random.uniform(low=1., high=2000., size=(n,)) # random 2d data. n = 100 p = [rand_data(n), rand_data(n)] q = [rand_data(n), rand_data(n)] # number of bins. b = np.sqrt(len(p[0])) * 2 # max , min values x , y x_min = np.sort(np.minimum(p[0], q[0]))[0] x_max = np.sort(np.minimum(p[0], q[0]))[-1] y_min = np.sort(np.minimum(p[1], q[1]))[0] y_max = np.sort(np.minimum(p[1], q[1]))[-1] # range histograms. rang = [np.linspace(x_min, x_max, b), np.linspace(y_min, y_max, b)] # histograms d_1 = np.his

c# - How do I specify common source files and properties and have them appear in Visual Studio -

c# - How do I specify common source files and properties and have them appear in Visual Studio - i have solution many projects share source files , properties. if set sources files in, instance, mutual .props file, source files impact build don't show in visual studio. short illustration is: scratch.csproj: <?xml version="1.0" encoding="utf-8"?> <project toolsversion="12.0" defaulttargets="build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <import project="$(msbuildextensionspath)\$(msbuildtoolsversion)\microsoft.common.props" condition="exists('$(msbuildextensionspath)\$(msbuildtoolsversion)\microsoft.common.props')" /> <itemgroup> <compile include="program.cs"/> </itemgroup> <import project="a.props" /> <import project="$(msbuildtoolspath)\microsoft.csharp.targets" /> </projec

plot - Simple Grouped Barplot in R Studio -

plot - Simple Grouped Barplot in R Studio - i need help simple barplot in rstudio, statistics exam. i have 4 srs estimated mean , variance. have info frame these errors: i create barplot show errors in simulation, both mean , variance. obtain this: for illustration mean errors in bluish bars , variance errors in reddish bars; each simulation. how can plot this? i found plot in figure here , of course of study tried code, if write this: counts <- table(errors$meanerr,errors$varerr) the result is: counts 0.00580614250942646 0.00748139367270056 0.0110175973333068 0.242217731442113 0.00565617345884917 1 0 0 0 0.0235702639434603 0 1 0 0 0.0720161457747945 0 0 1 0 0.33541066066671 0 0

javascript - How to show the tooltip on top of screen -

javascript - How to show the tooltip on top of screen - <html> <span ng-if="item.description!=''&&item.description!=null"><img tooltip-placement="bottom" tooltip-html-unsafe="{{item.description}}" class="tooltip-icon malign" src="app/img/permission.png"/></span> <span ng-if="item.description==''||item.description==null"><img tooltip-placement="bottom" tooltip-html-unsafe="no description available" class="tooltip-icon malign" src="app/img/permission.png"/></span> </html> i facing issues edit , delete tool tip not displaying in front end screen.it breaking behind background screen. then added position:fixed; so after tool tip displaying correctly. if want basic tooltip, may try <img title="this tooltip" javascript jquery html css angularjs

c# - Binding Combobox inside a Listview to a ObservableCollection -

c# - Binding Combobox inside a Listview to a ObservableCollection<string> - xaml <usercontrol x:class="patientsinscrit_gmf.listdisplay" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:custom="clr-namespace:patientsinscrit_gmf" datacontext="{binding relativesource={relativesource self}}"> <grid> <grid.rowdefinitions> <rowdefinition height="25"></rowdefinition> <rowdefinition></rowdefinition> </grid.rowdefinitions> <listview grid.row="1" margin="0,0,0,0" x:name ="filelist">

c - Segmentation fault when calling dlopen from Lua -

c - Segmentation fault when calling dlopen from Lua - i have library opens library calling dlopen, crashes seg fault. involvement comment doesn't happen time, when it's called lua scheme i'm maintaining, if phone call lua interpreter, works no error. lua call: cmdtmpfile = "/home/msv/ericaflr/teste_slurm/echoandsleepjob.sh" local slurmlibopen = assert(package.loadlib("/home/msv/ericaflr/sga-slurm/drmaaloader.so", "luaopen_drmaaloader")) slurmlibopen() -- open library submitjob(cmdtmpfile) --function drmaa.so drmaaloader.so source code: #include <lua.h> #include <lauxlib.h> #include <lualib.h> #include <stdio.h> #include <dlfcn.h> typedef void register(lua_state*); int luaopen_drmaaloader(lua_state *l){ fprintf(stderr, "in loader c\n"); void* lib; lib = dlopen("/home/msv/ericaflr/sga-slurm/drmaa.so", rtl

javascript - How can I return a new object based on a filter? -

javascript - How can I return a new object based on a filter? - i have js: var json = {"products":[{"id":"6066157707315577","reference_prefix":"bb","name":"beaniebaby","product_line":false,"has_ideas":true},{"id":"6066197229601550","reference_prefix":"bbags","name":"blackbags","product_line":false,"has_ideas":false}],"pagination":{"total_records":4,"total_pages":1,"current_page":1}} var stuff = json.products.filter(function(obj) { homecoming obj.has_ideas === true }); console.log(stuff); i need help returning js obj in same format started in (var json = {"products":[...) containing filtered objects if exist. if not, want empty array. how do this? just create object , fill in 'products' property : var jsonobj = {"products":

javascript - IE8 append on $(document).ready() -

javascript - IE8 append on $(document).ready() - i'm aware there similar questions have looked @ several , none have provided , actual solution. i have function populates table row when page loads if there items fill with. works fine in browsers except ie8. if refresh page works should, in ie8 if navigate page table unchanged. have set break points in js in developer tools , function called , reached end without error , when examined objects table did contain rows supposed far object concerned rows not rendered in actual table on page. here code @ bottom of page: <script type="text/javascript"> $(document).ready(function () { addtotickettable('12345'); }); </script> any thoughts? edit yes using tbody , function works fine when called selecting seat on page or refreshing page. it's when navigating page doesn't work correctly. as requested here code addtotickettable function. function addtotickettable(seati

osx - MATLAB script does not terminate on Mac -

osx - MATLAB script does not terminate on Mac - i running on matlab 2014a, , command line not return. a = 0; while (1) = + 1; if (a ~= 2) continue; end; end; there no response when control-c or command-. (or other mutual combination of keyboard keys). how can script terminate? instead of "continue", seek "break". here's reasoning: "continue" temporarily interrupts execution of programme loop, skipping remaining statements in body of loop current pass only. so doesn't exit loop completely, skips remaining code in loop , re-evaluates status of while loop, in case is true. in contrast, break exits loop completely. another way go rewrite loop statement, example: a = 0; while a~=2 = + 1; end not sure why wouldn't cease running ctrl-c though. expect script has run such long time machine might getting progressively less responsive. hinted article: http://www.mathworks.com/help/matlab/matlab_e

How to parse a JSON without key in android? -

How to parse a JSON without key in android? - hi having simple type of json response ,i have worked on json keys in response have values,please see response below json { status: "success", country: [ { 1: "afghanistan" }, { 2: "albania" }, { 3: "algeria" }, { 4: "american samoa" }, { 5: "andorra" }, { 6: "angola" }, { 7: "anguilla" }, { 8: "antarctica" }, { 9: "antigua , barbuda" }, { 10: "argentina" }, {..... . . . . .so on.. so want parse json , want set both values in arraylist of hashmap,i have worked below,but find no path proceed,hope buddy help me. code jsonobj = new jsonobject(jsonstr); if (jsonobj.has("country")) { countryarray = jsonobj.getjsonarray("country"); if (countryarray != null && countryarray.length() != 0) { // looping through conta

delphi - How to see if the function or procedure is private, protected or public without scrolling to the top -

delphi - How to see if the function or procedure is private, protected or public without scrolling to the top - is possible know if function or procedure private, protected or public. must scroll top see if methode private. there tool or in construction (code explorer) see if methode private, protected or public whitout scrolling top. example: unit ..... // 100 line code private // 1000 line code procedure a(); // <-- here can't see if procedure private. must scroll top // 2000 line code ... procedure a(); // <-- here can't see if procedure private. must scroll top begin ... end; the thing can set (private, protected or public) the summary description in code explorer see bluish color procedure , greenish color function nil private, protected or public icon. i changed properties of explore code , have maps of private , protected or pulic. but when go procedure in code there no selected item in explore code in project manager view.

php - XML query to API returns 'Premature end of file' -

php - XML query to API returns 'Premature end of file' - i trying phone call external site (api) homecoming xml response. have tried several ways of doing , end same response: premature end of file . unfortunately not able positive feedback other site. below php commands have tried , results. woud appear me there issue on other site. can re-create url , paste browser , works fine. $url = "https://cli-cert.emdeon.com/servlet/xmlservlet?request=<?xml version='1.0'?>"; $url .= "<request userid='p_panda1' password='practice00' facility='3003154010'>"; $url .= "<object name='clinicalreport' op='search_filedelivery'>"; $url .= "<receivingorganization>3003154010</receivingorganization>"; $url .= "<creation_datetime_from>09/01/2014</creation_datetime_from>"; $url .= "<creation_datetime_to>10/10/2014</creation_datetime_

php - Trim the content of system()? -

php - Trim the content of system()? - i'm trying print out users in active directory using system("dsquery user"); in php, problem getting trimmed downwards have array containing users , nil else, atm code: <?php $test = system("dsquery user"); $teste = explode('cn=', $test); print_r($teste); $user = trim($teste[1], ","); echo "<br \>" . $user; ?> i can fetch 1 user atm because explode deletes else.. help appreciated, wan't have in end this: $user[0] = administrator $user[1] = kbgrt $user[2] = asdasd this output: "cn=administrator,cn=users,dc=domain,dc=local" "cn=guest,cn=users,dc=domain,dc=local" "cn=krbtgt,cn=users,dc=domain,dc=local" "cn=doctor.scripto,cn=users,dc=domain,dc=local" – i hope understand otherwise comment , i'll seek explain in way. its not easy parse output commands, if not designad it. start seek simplify much possible , see

pass by reference - In C++, can the caller of a function ensure its arguments won't be modified? -

pass by reference - In C++, can the caller of a function ensure its arguments won't be modified? - in next c++ code: int foo(int &x); /* function prototype */ main() { int i=5; foo(i); } suppose i'm unable alter foo() in way. is there way, in main(), phone call foo() can't modify i? give re-create of i . way. int j = i; foo(j); c++ pass-by-reference

c - Interfacing issue LPC1769 and MPU6050 -

c - Interfacing issue LPC1769 and MPU6050 - i'm trying interface lpc1769 , mpu6050 , using mcb1700.code.bundle.lpc1769.lpcxpresso libraries. , i'm using lpcxpresso ide. as specified in mpu6050 datasheet coded read sequence, it's working first time only, if seek read sec time, returns 0 values. ( i.e., works 1 time after reset ) i tried many possible ways, no results please give me solution prepare issue. edited.. code i've shown below. both read , burstread code working once i2c.c #include "lpc17xx.h" #include "type.h" #include "i2c.h" volatile uint32_t i2cmasterstate[i2c_port_num] = {i2c_idle,i2c_idle,i2c_idle}; volatile uint32_t timeout[i2c_port_num] = {0, 0, 0}; volatile uint8_t i2cmasterbuffer[i2c_port_num][bufsize]; volatile uint8_t i2cslavebuffer[i2c_port_num][bufsize]; volatile uint32_t i2ccount[i2c_port_num] = {0, 0, 0}; volatile uint32_t i2creadlength[i2c_port_num]; vola