Posts

Showing posts from September, 2014

computation theory - Prove whether this language is decidable or undecidable -

so reviewing notes problem, , cant seem understand how problem works. have m, , m accepts input makes visit every non-halting state. i convinced myself problem decidable, having trouble proving so. rough outline of answer : assume have tm t has 1 halting state, , if wants go through states needs pass through halt state , somehow need show how cycle through states such. any beneficial, thanks! i think you'll find answer it's undecidable. why? let solve halting problem. you given tm m , input x , oracle q problem describe. can solve halting problem m input x using oracle q? first, connect new tm n front of m. here's n does: - deletes tape contents - writes x onto tape m halts on x iff nm halts on inputs. should easy see since n leaves tape m have seen if input had been x. can design n in such way states of n visited. now, modify m m' adding second tape. second tape used keep track of highest-numbered state of m' have visited. add transitions m

How to create a script in Linux that makes a pyramid of asterisks with the pattern 1, 3, 5, 7, 9, 11, 13, 15, 17 centered -

i'm trying write shell script print pyramid of asterisks this: * *** ***** ******* ********* *********** ************* *************** ***************** below attempt far. when run it, errors arithmetic expression required. doing wrong? for (( = 1; <= n, i++ )); (( k = i; k <= n, k++ )); echo -ne " " done (( j = 1; j <= 2 * - 1, j++ )); echo -ne "*" done echo done the syntax of arithmetic for-loop uses 2 semicolons, not semicolon , comma: for (( = 1; <= n; i++ )); (the individual components may contain commas — example, i++, j++ expression increments both i , j — has no specific relevance for .)

c++ - "Proper way" to add a folder to the include path in XCode 4 -

Image
i know there way add "search path" in xcode settings specific project. (* know this) but i'm interested know "proper" way permanently add include folder xcode. what did add <eigen> /usr/include . code goes: #include </usr/include/eigen/eigen> // works ok but should like #include <eigen/eigen> // not work but xcode not seem consider /usr/include part of build path. indeed, gets header files (including ones <stdio.h> ) path /applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.8.sdk/usr/include wow, sweet path. i'm not sure want fiddle /applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.8.sdk/usr/include , @ same time, don't want modify xcode project settings each time want #include <eigen/eigen> . what recommended way add folder xcode's include path, works for every new project automatically? go info wi

NHibernate.Spatial.MySQL: Null geometries and "No persister for: GeoAPI.Geometries.IGeometry" error -

i attempting create simple demo solution using nhibernate.spatial.mysql (version 4.0.4.4001). solution available here: https://github.com/andrerav/nhibernate.spatial.mysql.demo the mapping seems work @ least inserts -- demodataimport project able read geojson files, , insert geometries database, , can verify results using mysql workbench. however, if query data, geometries show null values. furthermore, if perform query such this: var municipalities = sessionmanager.session.query<municipality>() .where(m => m.area.within(county.area)).tolist(); i exception says "no persister for: geoapi.geometries.igeometry". any ideas wrong? to run solution, first create mysql database (mysql 5.7 or newer) called mysqldemo username/password mysqldemo / mysqldemo . demodataimport project dump geojson data database, , demoqueryutil project can used execute queries. mapping: public class municipality { public virtual int id { get; set

ios - How to implement UIAlertcontroller as PopOver(with arrow direction up) in a UIBarbutton -

Image
i know old school question - did searched web , found solutions deprecated. how implement uialertcontroller popover(with arrow direction up) in barbutton . here's code: - (ibaction)eventsortingaction:(uibarbuttonitem *)sender { uialertcontroller * view= [uialertcontroller alertcontrollerwithtitle:@"my title" message:@"select choice" preferredstyle:uialertcontrollerstyleactionsheet]; uialertaction* ok = [uialertaction actionwithtitle:@"ok" style:uialertactionstyledefault handler:^(uialertaction * action) { //do thing here [view dismissviewcontrolleranimated:yes completion:nil]; }]; uialertaction* cancel = [uialertaction actionwithtitle:@"cancel" style:uialertactionstylecancel handler:^(

c - Shortest path with dynamic programming -

i don't want answer problem, need nudge in right direction. given undirected graph g having n ( 1<n<=1000 ) vertices , positive weights. find shortest path vertex 1 vertex n , or state such path doesn’t exist. hint: @ each step, among vertices weren’t yet checked , path vertex 1 found, take 1 has shortest path, vertex 1 it, yet found. first have define state. said: the state solution vertex i , i <= n . smaller state solution j , j<i . find state i , need find smaller states j ( j<i ). having found shortest path i , can find next state - solution i+1 . i took different problem , replaced variable names , words because sounded applicable one. i have write program solution, don't know how start. here questions: is definition of state correct? moreover, since undirected graph, , each vertex bidirectional, weights passed in multidimensional array (i.e int w[n][2] ) w[n][0] weight of 1 vertex , w[n][1] weight of other? how repr

gfortran - How can I get a basic Fortran file to compile on Windows/MinGW using CMake? -

i feel lost trying cmake work on windows. have project ( eccodes ) has fortran , c files. can compile fortran files if don't use cmake. project came ton of cmake files. @ error below , says me, " i (cmake) cannot compile simple fortran program though can compile fortran files when aren't using cmake." can make sense of this? i'm trying use mingw64 since can't use cygwin on project windows build. on mac os x , gnu/linux builds fine, have run project on windows... error:the fortran compiler "c:/gcc-5.1.0-tdm64-1-fortran/bin/gfortran.exe" not able compile simple test program. fails following output: change dir: c:/users/knauthg/.clion2016.1/system/cmake/generated/eccodes-45f4e5f3/45f4e5f3/__default__/cmakefiles/cmaketmp run build command:"c:/mingw64/bin/mingw32-make.exe" "cmtc_93cb8/fast" c:/mingw64/bin/mingw32-make.exe -f cmakefiles\cmtc_93cb8.dir\build.make cmakefiles/cmtc_93cb8.dir/build mingw32-make.exe[1]: enterin

c++ - use std::find to find a std::tuple in a std::vector -

so have vector of tuple coordinates made following code: vector<tuple<int, int>> coordinates; (int = 0; < 7; i++){ (int j = 0; j < 6; j++){ coordinates.push_back(make_tuple(i, j)); } } i'm trying fill board either 'x', 'o', or '.' following: void displayboard(vector<tuple<int,int>>& board, vector<tuple<int,int>>& p1, vector<tuple<int,int>>& p2){ // prints out board cout << " b c d e f g\n"; // top row (int = 1; < 43; i++){ if (i % 7 == 0) { if (find(p1.begin(), p1.end(), board[i])) cout << "| x |\n"; else if (find(p2.begin(), p2.end(), board[i])) cout << "| o |\n"; else cout << "| . |\n"; } else { if (find(p1.begin(), p1.end(), board[i])) cout << "| x "; else if (find(p2.begin(), p2.end(), board[i])) cout << "| o ";

textures - How to wipe dirt away from glass? Unity3D -

i need wipe away dirt pane of glass. thinking change texture @ area wiped, or dirt separate object gets destroyed reveal clean glass, can't figure out how either of without changing entire pane of glass @ once. look writing shader takes takes clean texture, dirty texture, , third texture lerp between clean , dirty texture. you need draw third texture on cpu using texture2d.setpixel() & texture2d.getpixel() , make pixels around finger darker based on distance.

Unable to receive Push Notification messages when the MobileFirst app (Android) is stopped -

i have implemented push notification feature in mobilefirst android app. however, find app cannot receive push notification messages if app stopped. app run again, missing message not receive. i have read other articles similar issue in stackoverflow or other websites. however, cannot find solution case. it if clarify mean "stopped". stopped in swiped out applications view, or forced-stopped application settings. force-stopped applications (via settings >> applications >> your-application >> kill app) no longer receive notifications, (android) design. this because intent service handles received notifications has been killed due force-stopping. this unlike closing application swiping out, not kill intent service app continue receive notifications if not running (because intent service still running).

php - path of a script from another one -

i have structure: -folder1 -folder2 -script1.php -folder3 -script2.php now i'm trying call script1 script2 : // script2.php file_get_contents(" path ? "); note: path doesn't work /folder1/folder2/script1.php/ . can writing plus domain name this: http://example.com/folder1/folder2/script1.php/ but want know how can without writing domain name? in script 2 can use: file_get_contents("../folder2/script1.php"); or can include script 1 in script 2: include("../folder2/script1.php"); better approach create class.

sql server - Avoid key clash on SQL Merge Update statement -

i have table 2 columns, prime_guestid , dup_guestid indicate links between guestid's , id(s) replacing (duplicate records) now want go through number of other relationship tables of format , update occurrences of dup_guestid it's prime_guestid. however if prime_guestid has entry given thingid instead need delete row relationship table. currently i'm using following script, though while works cases fails if 2 dup_guestid's update same prime_guestid given thingid. seems merge statement queues changes before making them, therefore clash check won't detect them. merge thing_relation t using guest_relation g on t.guestid = g.dup_guestid when matched , exists ( -- clash check here select * thing_relation t2 t2.thingid = t.thingid , t2.guestid = g.prime_guestid ) delete when matched update set t.guestid = g.prime_guestid is ther

c++ - Nvidia Jetson TX1 opencv4tegra cmake example -

i've unboxed new nvidia jetson tx1 dev kit, , i'm looking forward seeing how hardware accelerated algorithms in opencv4tegra library fare against standard opencv. have example cmakelists.txt file compiling nvidia library. assume have source in file vision.cpp . basic cmakelists.txt file compile , link against opencv4tegra library?

html - Content overlapping on 480px media query -

i'm using bootstrap 3 , have grid of... description cards if will. thing set height them in order not push columns in undesireable way due content of 1 being larger content of another. works expected issue comes when viewport size gets less 480px, content starts overlap, as shown in image (sorry being in spanish) tried change height auto in (max-width: 480px) doesn't seem job. weird since worked similar grid made. hope snippet can serve in way. thanks lot in advance. @media (max-width: 480px) { .navbar-toggle .icon-bar { width: 35px; margin-bottom: 9px; } .navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus { background-color: transparent; } .navbar-default .navbar-toggle:hover .icon-bar { background-color: black; } .navbar-default .navbar-toggle:focus { background-color: transparent; } .navbar-toggle { border: 0px; margin-top: 35px; margin-right: 30px; width: 50px;

PayPal Rest API Get Capture by Id internal server error 500 -

i have been having issue lately when trying completed capture capture id , received internal server error 500. it's been hit or miss, captures returns fine , lot of time throw exception when call capture.get(apicontext, captureid); here couple debug id: 82e5f57da64a0 3a8dcfc41f6b9 please thanks!

Tomcat Request postData null -

my web app works fine in local tomcat server test. when deploy test environment, app not work right. so remote debug app, found postdata of tomcat request null, while have data in local debug. that's weird. got nothing clue google. i found answer adding tomcat jar in runtime , tracing code. it because test environment tomcat had wrong configuration. it sets maxpostsize=0 of connector in conf/server.xml, causes failreason.post_too_large error , would't parse post data , null postdata.

php - #Jquery : is it possible to pass input value without using id,class,name? -

in 1 of company while giving interview php developer. he asked me, how pass variable in jquery without using name attribute , id , class?? yes, can mention element itself. for example: <p>this paragraph</p> $("p").text("test message"); // select p tags.

javascript - Why I get a location string when requiring a html file in webpack? -

var uib = $uibmodal.open( { template: require('./create/create.html'), } ) i want content in create.html , show in modal,but shows ./create/create.html ,the string of location in modal. i've add html loader in webpack.config.js: { test: /\.html$/, loader: 'raw-loader', }, you should use templateurl var uib = $uibmodal.open({ templateurl: require('./create/create.html'), }); when want declare html code in js time can use template if want call html page create.html time have call templateurl also can write code in template :- var uib = $uibmodal.open({ template: '<html><h3> hie in js </h3></html>' });

Firebase data modeling guidance -

at risk of being tagged duplicate, here goes. i have items , tags. items can have many tags, , each tag can child tag of tag. i want list tags tree, , items inside each tag. in essence, tag folder items, except item can in multiple locations. is right way? /items/ i123 : { label : "i item", tags : { tagid: t234} } /tags/ t234 : { label : "i tag", parent: {tagid: t567} } im bit unsure i'm doing right. did read through demoralizing document , tutorial @ firebase of course , did @ other similar questions. i'm stuck in rdbms-think , seem unable grok nosql concepts, that's why hope guidance here use case here. thanks. per request commenters, more info on use case. i'm trying display tree of tags, this i tag 1 second tag child tag here child's child tag child tag root level tag again // etc... idea there items, , items can in multiple tags. display here in file browser, really. except

php - MySQL - 'field' doesn't have a default value -

im using laravel framework , gives error db error message: [2016-04-25 06:07:34] local.error: exception 'pdoexception' message 'sqlstate[hy000]: general error: 1364 field 'remarks' doesn't have default value' in ... the field 'remarks' has default value of 'none' set in phpmyadmin. dont understand why gives error when has default value set. believe 'none' string value it's not null value. $aid = db::table('attachments')->insertgetid([ 'document_type_code'=>$document_id, 'report_no'=>'report '.$document_id, 'file_attachment_link'=>$filepath, 'file_attachment_upload'=>$file->getclientoriginalname(), 'uploaded_at'=> $now, 'uploaded_by' => 1, //auth::user()->id 'version_number' => 1, ]); none not default string value. means there no default value set. you can either pass value in insert statement or

python 2.7 - How do I remove the * from a password field in a web2py password field. I only need it blank -

i have password field needs changes every once in while. have regular: form = sqlform(db.table, id) i want print form view following change: how stop web2py showing * symbols , show nothing @ user has enter new data every time editing form occurs. currently shows ****** values of ****** in html. do need make customer view issue? users getting confused form thinking still contains working password when doesn't. you can customize widget of password field: db.mytable.password.widget = lambda f, v: sqlform.widgets.password.widget(f, v, _value='') this can done in table definition: db.define_table('mytable', ..., field('password', 'password', widget=lambda f, v: sqlform.widgets.password.widget(f, v, _value='')), ...) if want make change password fields in applications, can instead monkey patch sqlhtml module: from gluon import sqlhtml sqlhtml.default_password_display = ''

database - Automatic MySQL backup using batch File -

i trying make auto backup of mysql database ; searched many links got many references didn't find single option work me(accept paid software). trying link . now have batch script (below given) , edit according credentials creating empty sql file. don't know why? new mysql , it's auto backup mechanism poor. @echo off set timestamp=%date:~10,4%%date:~4,2%%date:~7,2% rem export databases file c:\path\backup\databases.[year][month][day].sql "c:\wamp\bin\mysql\mysql5.6.12\bin\mysqldump.exe" –-user=root –-password=xyz --all-databases --result-file="d:\dbbackup.%timestamp%.sql" rem change working directory location of db dump file. c: cd \path-to\backup\ rem compress db dump file cab file (use "expand file.cab" decompress). makecab "databases.%timestamp%.sql" "databases.%timestamp%.sql.cab" rem delete uncompressed db dump file. del /q /f "databases.%timestamp%.sql" i run batch file create backup empty sql f

angularjs - Angular Select DropDown not showing selected name during start -

dropdown not getting highlighted in ie10, shows empty select box, once clicked, displays name. it's working fine on other browsers including ie11. if remove data-ng-bind , assign name old way, works fine. not data-ng-bind. this.setting = { drop:'first'; } <select data-ng-model="ctrl.setting.drop" data-ng-change="ctrl.logic()"> <option value="first" data-ng-bind="'name1'"></option> <option value="second" data-ng-bind="'name2'"></option> </select> not sure i'm doing wrong.

angularjs - How to link Laravel controller function with Angular View -

i working on laravel web application , embedded angularjs searching data database. used array search.in angularjs module point search function $scope.url = 'students@search'; not working me. i want know how tell angularjs $scope.url point search function in controller user can search data easily. have search function in students controller: public function search(){ $data = file_get_contents("php://input"); $objdata = json_decode($data); // static array demo $values = array('php', 'web', 'angularjs', 'js'); // check if keywords in our array if(in_array($objdata->data, $values)) { echo 'i have found you\'re looking for!'; } else { echo 'sorry, no match!'; } } myapp.js file : function searchctrl($scope, $http) { $scope.url = 'students@search'; // u

extjs - Custom store implementing errors -

i'm trying implement custom store extjs 3.4. use this forum post extjs4 version. now code looks this: ext.define('teststore', { extend: 'ext.data.store', //model: 'testmodel', fields: [ {name: 'date'}, {name: 'number'}, {name: 'percent'} ], storeid: 'teststore', generatedata: function() { var me = this, data = []; // generate 10 records for( var i=0;i<10;i++) { data.push([ me.randomdate(new date(2012, 0, 1), new date()), math.floor( math.random() * 1000 ), ( ( math.random() * 1000 ) / 3.2 ).tofixed( 1 ) ]); } console.log(data); return data; }, randomdate: function(start, end) { return new date( start.gettime() + math.random() * (end.gettime() - start.gettime()) ); }, constructor: function() {

java - setListAdapter() not working -

import android.app.activity; import android.os.bundle; import android.app.listactivity; import android.database.cursor; import android.net.uri; import android.provider.contactscontract; import android.widget.simplecursoradapter; public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); uri allcontacts = uri.parse("content://contacts/people"); cursor c = managedquery(allcontacts, null, null, null, null); string[] columns = new string[] { contactscontract.contacts.display_name, contactscontract.contacts._id}; int[] views = new int[] {r.id.contactname, r.id.contactid}; simplecursoradapter adapter = new simplecursoradapter(this, r.layout.activity_main, c, columns,views); this.setlistadapter(adapter); } } it shows

ms word - How to implement numbering sequence in java -

i working on swt application, have functionality implement ms word numbering sequence in application. at time user can modify existing sequence, whole structure should adjust accordingly , should save in database. please @ above screen shot. i thinking string manipulation. seems not optimal one. please suggest me best way... i able create tree structure, parent child relation. question how implement numbering sequence, if user changes level how adjust whole tree? user has possibility change number sequence like before increasing level 1. main chapter 1 1.1. sub chapter1 1.2. sub chapter 2 2. main chapter 2 status after increasing level 1. mian chapter 1 1.1. sub chapter 2 2. sub chapter 1 3. main chapter 2 similarly user can decrease level also. given table of contents mimics tree structure, can linked list of node objects so, class node { int index; string text; node next; node contents; } then

Create tab buttons in iOS -

Image
this image reference , want create tab buttons in image in navigation bar. idea how create? create segmented control : uisegmentedcontrol : displays element comprises multiple segments, each of functions discrete button. each segment can display either text or image, not both. uisegmentedcontrol ensures width of each segment proportional, based on total number of segments, unless set specific width. more info: segmented controls

android - Check activity alias into target activity -

i've got activity called a. want add 2 activity-alias called b , c. possible know if called b or c in code? want apply different behavior when it's called b or c. you can provide additional information each <actvity-alias> in manifest , evaluate activityinfo of packagemanager : to illustrate this, let's assume want display 2 textview s in target activity , set content depending on alias used. in manifest , put following elements: <activity android:name=".halloactivity" android:label="@string/hallodefault" > </activity> <activity-alias android:name=".salutactivity" android:targetactivity=".halloactivity" android:label="@string/salutalias"> <meta-data android:name="locale" android:value="fr" /> </activity-alias> <activity-alias android:name=".helloactivity" android:targetactivity=".halloactivity"

ruby - Unable to autoload constant controller (in production). No error in development -

file name - app/controllers/invoice/inventory/department/pharmacy_invoices_controller.rb file content - class invoice::inventory::department::pharmacyinvoicescontroller < applicationcontroller ... end i no error in development in production error - f, [2016-04-25t13:08:00.754597 #13500] fatal -- : loaderror (unable autoload constant invoice::inventory::department::pharmacyinvoicescontroller, expected /xxxxxx/yyyyyyy/app/controllers/invoice/inventory/department/pharmacy_invoices_controller.rb define it): i did ssh , checked every file on server. same development, obvious. can't figure out why throwing such error in production. this covered in rails docs, in autoloading , reloading constants , nesting . this because defining nesting can done in 2 ways , different in terms of how seen rails. can check using module.nesting : module foo class bar module.nesting end end => [foo::bar, foo] class foo::bar module.nesting end => [foo::bar]

python - Modifying ancestor nested Meta class in descendant -

suppose have: class a(object): class meta: = "a parameter" class b(a): class meta: = "a parameter" b = "b parameter" how can avoid having rewrite whole meta class, when want append b = "b parameter" it? you subclass a.meta : class b(a): class meta(a.meta): b = "b parameter" now b.meta inherits attributes a.meta , , have declare overrides or new attributes.

android - Update text column based on content with a single lookup in SQLite -

in ios , android projects, have sqlite table looks this: id words ----------- 1 apple, banana, orange, peach, strawberry 2 car, plane, orange 3 sheep, car, plane, horse, cow . ... . . the words column text column holds comma deliminated list of words. i want update word list of particular row adding word front of list. list should have no more 5 items delete last word if necessary. for example, if updating row id 1 cherry get cherry, apple, banana, orange, peach or if doing same update on row id 2 cherry, car, plane, orange my question i know query row, process text, , update row. however, require 2 table lookups, 1 query , 1 update. possible single update lookup? i know there replace() function not replacing here. i'm not incrementing integer . didn't see obvious in sqlite core functions . correct solution the words column text column holds comma deliminated list of words. 1 nf. column contains atomic data. no

angularjs - provide is not defined -

my angularjs2 gives me angular2-polyfills.js:138 error: provide not defined main.ts . codes is: import {bootstrap} 'angular2/platform/browser'; import {appcomponent} './app'; import {router_providers,router_directives} 'angular2/router'; import {platform_directives} 'angular2/core'; bootstrap(appcomponent, [provide(platform_directives, {usevalue: [router_directives], multi:true})]); anyone has idea? update in angular2 rc.4 , later provide deprecated. use object literal syntax instead: bootstrap(appcomponent, [{provide: someservice, useclass: someotherservice}]) @component({ providers: [{provide: someservice, useclass: someotherservice}], ... }) original you need import it. it's exported angular2/core : import {platform_directives, provide} 'angular2/core';

crash - How to make message auto retry when using Rabbitmq and set ttl = 0? -

we have scenario this: there may many workers (a.k.a consumers) in several nodes, @ meanwhile, webapp submit online jobs these workers. need process these jobs evenly , know if there available workers each single job. therefore, want use rabbitmq schedule jobs , set each job message ttl = 0 notice if there no worker each job. want rabbitmq handle job rescheduling when worker node crashing. however, if ttl set 0, rabbitmq drop job message @ worker crashing or network failed. i know can use dlx handle dead messages, fussy build module handle these exceptions cause must make high availability it. important can not distinguish scheduling failure , rescheduling faiture, different handle! do guys have other ideas? rabbitmq cannot explicitly know if there available workers, consumers is. knows how many consumers consuming queue, or connected etc. if have 5 workers, getting messages in round-robin fashion, described in tutorial. part but want rabbitmq handle job resc

ios - how to make a single class for table view and inherit in all other classes? -

i want have table view in around 5 screens same layout. should best approach? should make single class , inherit other view controllers class? or make table view in each screens separate coding? you should create subclass of uitableviewcell , use cell layout through app. if need uitableview have same properties throughout, create uitableview extension (in swift) extension uitableview { class func defaulttableview() -> uitableview { let tableview = uitableview() // setup default tableview properies here return tableview } }

android - Fragment manager Getting into custom adapter -

in adapter want navigate different fragments public navadapter(context context, arraylist<navitems> navitems) { this.navitems = navitems; this.context = context; } in above adapter constructor managed context , how fragmentmanager ? youractivity mainactivity = (youractivity) context; fragmentmanager manager = mainactivity.getsupportfragmentmanager(); you can use fregmantmanager , perform transaction .

cakephp - How to use fonts in email templates? -

how use fonts oswald , dosis, in email templates content sending using php mail function in cakephp? oswald , dosis both web-fonts sure know. problem e-mail clients not support web fonts @ all, or have bad support @ best. you can include web-fonts (url:s) , corresponding css in header of email, make sure have backup font arial, verdana or sans. a rule of thumb regarding css keep as can inline of major email readers gmail webmail , msn webmail ignores html header together.

Checking whether certain item is in certain array using javascript -

i have 10 different arrays. each array has different numbers. array1 = [1,2,3,4,5] array2 = [6,7,8,9,10] ... array 10 = [51,52,53,54] let's pass in 7. want know array , want return array number. in case going 2. should write switch statement each array? appreciate in javascript. try: var arrays = [array1, array2, ..., array10]; for(var i=0; i<arrays.length; ++i) { if (arrays[i].indexof(value) != -1) { console.log('found in array' + (i+1)); } }

windows 10 issue - restart loop -

i have updated windows windows 10 , working fine, today when started computer went in restart loop , till showing loading blue screen , after black screen 15 20 seconds, , again goes restart. tried f8 , f2 go in safe mode, goes in asus utify bios utility , not getting how can operate it. please me out of this. windows 10 safe mode not invokes f8/shiftf8 because of changes (if use uefi , ssd example). exact situation, should use install/recovery disk , select recover once on installation window.

ios - Instance member can not be used in swift -

Image
the project create json object. code below : public class registerin { private var appid : string = "" private static let jk_appid : string = "appid" init(appid: string) { self.appid = appid } class getjsonobject : registerin { let jsonobject : [string : anyobject] = [ jk_appid : appid //< following error shows on line ] } } this line appears 1 you declare "getjsonobject" class (not method) derived registerin class inside super class. why? 2 let jsonobject : [string : anyobject] = [ registerin.jk_appid : appid ] you can use const values here not instance memeber (of derived class) 3 this code works in playground: import uikit public class registerin { var appid : string = "" private static let jk_appid : string = "appid" init(appid: string

node.js - Creating an AWS SQS queue -

i trying create sqs queue on aws ec2 instance using node.js. same instance, can access s3 , list buckets, etc. using node.js. instance has iam role granting full access s3 , sqs. executing below code fails , cannot figure out why. more interesting pc code works. var aws = require('aws-sdk'); aws.config.update({region:'eu-central-1'}); //console.log("awsv "+aws.version); --> 2.3.5 var sqs = new aws.sqs(); var params = { queuename: "myqueue1" }; sqs.createqueue(params, function(err, data) { if (err) console.log(err, err.stack); // error occurred else { if(data) console.log(data); // successful response else console.log("other unknown error"); } }); error message: /home/ubuntu/aws-nodejs-sample/node_modules/aws-sdk/lib/http/node.js:121 callback(); ^ typeerror: undefined not function @ writable.writer._write (/home/ubuntu/aws-nodejs-sample/no

c# - Multiple Select but Object reference not set to an instance of an object -

i'm still newbie this.. i'm trying make multiple select in condition if selected rows contains string wanted, i've value, when tried same value in rows, throws object reference not set instance of object, i'm trying is, if i've selected rows need, want clear cells, not remove rows. i'm using right click event, found in case in stackoverflow. hope can understanding, , explanation... here code if (e.button == mousebuttons.right) { rw = dgv_jadwal_sewa.hittest(e.x, e.y).rowindex; cellvaluenota = (int)dgv_jadwal_sewa.rows[rw].cells[5].value; string cl = convert.tostring(cellvaluenota); dgv_jadwal_sewa.rows[rw].selected = true; contextmenustrip m = new contextmenustrip(); m.items.add("cancel"); m.itemclicked += new toolstripitemclickedeventhandler(m_itemclicked); m.show(dgv_jadwal_sewa, new point(e.x, e.y)); } public void cancel_

c# - VIsual Web Developer Radio Button - Update Live -

i trying develop form/website using microsoft visual web developer 2010 express. in first section group of radio buttons control subject line field. have been able add radiobuttoncheckedcontrol attribute set subject line work if page refreshed. there command live update form? in ascx file there following: <asp:radiobutton id="radiouniform" runat="server" text="uniform infringement" groupname="reason" oncheckedchanged="radiouniform_checkedchanged" /> and in ascx.cs file there following: protected void radiouniform_checkedchanged(object sender, eventargs e) { commentsubject.text = "uniform infringement"; } so after couple of quick google searches (as i've done previous nights) found solution. after oncheckedchanged part of radio button code, add autopostback="true" .

javascript - Regular Expressions - Select all before first whitespace character assuming it includes both characters and digits -

i've built little google maps widget speed process of people inputting address form, however, because seems google maps isn't particularly accurate when comes actual house numbers, i've added ability override / prepend house number selected location. here's quick example... i select location on map , returns: 13b main street, london, l0n d0n, united kingdom which great, however, assuming person filling out form doesn't live @ 13b 13a, i'm trying use regular expression override / replace section of string. i have following: /([^\s]+)/ selects first word or until first white space character again worked fine, until noticed google maps doesn't return building number meaning main street become replaced street if no building number returned. so basically, i'm trying build regular expression meets following conditions. it's first word (before whitespace character) , must either solely number or combination of both not characters.

symfony - Symfony2, FOSUserBundle, authentication with cookies disabled -

how can authentication in symfony2 without cookies in brouser? how can generate http://some.site/hello/roman?phpsessid=9ebca8bd62c830d3e79272b4f585ff8f or http://some.site/9ebca8bd62c830d3e79272b4f585ff8f/hello/roman or other url available sessionid parameter. thank help. you have to 2 things. first must extend session storage session query param. namespace elao\backbundle\session; use symfony\component\dependencyinjection\containerinterface; use symfony\component\httpfoundation\session\storage\nativefilesessionstorage; class storage extends nativesessionstorage { public function __construct($savepath = null, array $options = array(), containerinterface $container) { $request = $container->get('request'); if ($request->query->has('sessionid')) { $request->cookies->set(session_name(), 1); // have simulate cookie, in order bypass "hasprevioussession" security check session_id($re

In magento 1.9.2.4 , values of attributes in are not showing in layered navigation -

Image
in magento 1.9.2.4 , values of attributes in not showing in layered navigation this problem version patch. have upload patch_v1.9.1.x app , skin.

omnet++ - Model error: TraCI server > "SUMO 0.19.0" reports API version 7 -

i run sumo 0.19 omnet++ 4.6 .. error error in module (veins::traciscenariomanagerlaunchd) aodvsim.manager (id=6) @ event #1, t=0: model error: traci server "sumo 0.19.0" reports api version 7, unsupported. recommend using sumo 0.25.0.. so mean , , mean api version 7 .. how can change ? can using sumo 0.25 or sumo 0.26 ... in advance you using wrong version of sumo. veins 4.4 have use sumo 0.25.0. version can downloaded here .

Consuming WCF service in Java does not generate an interface -

we have pretty big wcf service use quite time, until we've been connecting via c#. have need connect java. found out if use eclipse , go new/other/web service client can put wsdl link there auto generate code. doing straight away did not produce though. obtained 2 files, 1 of had empty body. first issue auto generation tool - creates something, don't see log of succeeded , failed in creating. searched , found out had change bindings basichttpbinding, , make sure httpgetenabled set " true ". after change, auto generation in java produces lot of code, data contract schemas , on. , 4 files under ' org.tempuri ' namespace: basichttpbinding_imyservicestub.java imyserviceproxy.java myservice.java myservicelocator.java however looking @ tutorials, seems should fifth one, imyservice.java - did not get. and, have errors in generated code pointing out indeed imyservice cannot resolved, being used in few places, definition not auto-generated. since have no

javascript - Passing value from Zend controller and fetching it in JS response -

i have ajax call following: $.post("/user/signindo",{'username':username,"password":password},function(data) { // able have in data object, able access these properties , display them once response there alert(data.id); alert(data.username); alert(data.firstname); } and zend controller action: public function signindoaction() { // doing here values passed view } the action doesn't needs return since checks whether login data ok. however, need here somehow in action when response returned javascript, somehow fetches data need work within js script file. how can zend framework? can me out please? first need ban layout in response. that, put following code in method module::onbootstap() : public function onbootstrap(mvcevent $e) { $sharedevents = $e->getapplication()->geteventmanager()->getsharedmanager(); $sharedevents->attach(__namespace__, 'dispatch', function($e) { $result = $e->getre

jmeter - Does InfluxDB run on Windows -

i want install influxdb on windows jmeter. can 1 guide me how can done. because cannot find specific link windows version of influxdb. windows supported influxdb ? thankyou. yes, influxdb runs fine on windows well. you can windows installable here . additional info: if unable locate config file, can make influxdb display default config. for ex: influxd.exe config this command displays default values. create config file default values , modify need. then restart influxdb below command make changes effective. influxd.exe -config /path/to/config/file

IOS Swift - Window size shrinks when running in iphone 5s -

Image
this happens when run in iphone 5s. tried know including checking launchimage s. resolution according apples standards. in simulator no problems. anyone have solution this? iphone 5s - os 9.2.1 xcode 7.2.1 putting launch screen fixes this. answer given nimit parekh