Posts

Showing posts from May, 2013

Button wont click in html/ javascript -

i trying button in html create new string, doesnt anything.. <html> <head> <title>random quote generator</title> <script src="https://code.jquery.com/jquery-1.11.0.min.js"></script> <script src="reffference.js"></script> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-bvyiisifek1dgmjrakycuhahrg32omucww7on3rydg4va+pmstsz/k68vbdejh4u" crossorigin="anonymous"> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-tc5iqib027qvyjsmfhjomalkfuwvxzxupncja7l2mcwnipg9mgcd8wgnicpd7txa" crossorigin="anonymous"></script> </head> <body> <div class="container"> <div class="row text-center"> <h1>random quote generator</h1>

jquery - JSON+Ajax append and create a dynamic Div -

i trying create html page of parts static , loaded json files. i trying create "posts" , attach "comments" them. have 2 json files: posts.json , comments.json. posts.json contains following: [{"name":"liza","date":"december 22 2016","content":"what nice profile.","id":"1"}, {"name":"tom","date":"december 23 2016","content":"good luck in new job.","id":"2"}] comments.json cointains following: [{"name":"bob jacobs","comment":"how nice of say","id":"1"}, {"name":"rob sherman","comment":"indeed nice profile!","id":"1"}, {"name":"roni james","comment":"you couldn't of wished him better :-)","id":"2"}] what trying matc

Android SDK not being installed on Android Studio -

based on last question - downloaded android studio (without sdk) 2.2.3.0 link ( https://dl.google.com/dl/android/studio/install/2.2.3.0/android-studio-ide-145.3537739-windows.exe ). then downloaded android sdk link ( https://dl.google.com/android/repository/tools_r25.2.3-windows.zip ). i extracted android sdk "c:\androidsdk" , , "androidsdk" folder contains folder called "tools". , inside "tools" there's lot of files. when open android studio, download sdk. disconnect internet , open android studio again. choose sdk path manually, "c:\androidsdk" .. here problem, get: target folder neither empty nor point existing sdk installation. so, selected path "c:\androidsdk\tools" instead of , same problem. have tried download android studio version includes sdk? i'm not sure, think you're downloading file developers don't use android studio. should download this file (android-studio-bundle

javascript - Fancybox creating error in Chrome -

i have 2 pages, both of using fancybox jquery lib. 1 page works, no errors. other page (which has identical (i think) syntax) producing error. only occurs in chrome. here working code: $('.fancybox').fancybox({ 'type' : 'inline', 'minwidth' : 920, 'minheight' : 700, 'width' : '90%', 'height' : '90%', 'autosize' : false, 'fittoview' : true, 'margin' : 15, 'padding' : 5, 'closeeffect' : 'fade' }); and failing code: $(document).ready(function({ $('.fancybox').fancybox({ 'type' : 'inline', 'autosize' : false, 'width' : 50, 'height' : 100,

fonts - Visual Studio 2015 Method Signature Intellisense Tooltip Colors -

Image
is there way customize visual studio 2015's intellisense/tooltip when filling method's parameters? specifically, want (more prominently) highlight current parameter's text color. in screenshot below cursor in first parameter's space, "productconfigitem" highlighted in tooltip (basically bolded), want make item stand out more via color change. possible? makes easier determine parameter filling when method has many parameters.

linux - adding i2c device in raspberry pi device tree source -

i learning add i2c devices in device tree of raspberry's kernel 4.4.8. after successful compilation of dt, raspberry pi not allowing me log in board. showing "ssh: connect host 10.1.1.103 port 22: connection refused". i have linked dt sources below dt souce . one one, tried adding in following files. in file bcm2708-rpi-b.dts line 93. (lm75@48). in file bcm2708-rpi-b-plus.dts line no. 87. in file bcm2708.dtsi line no. 44. please me. appreciated. thanks.

C++, finding 3 max values in array, where difference between these values is one of the parameter -

i have find 3 max values in array of real data. problem fact these 3 values must vary particular, minimum value (which parameter). means if have array 10 elements {1,2,3,4,5,6,7,8,9,10} 3 max values in array 8,9,10 if value of parameter example "2" these 3 max values must vary @ least "2", real max values in case 10, 8, 6. believe algorithm of program this: 1) find 3 max values (loop) 2) verify if vary @ least parameter 2a) if yes return these 3 values 2b) if not, go loop, search again 3 values ignore value doesn't fulfill condition? i can't imagine real code in c++ solution. can give piece of advice how it? easier sorting scan array 3 times. first time, find max. next time, find largest number <= (max - p) etc. have studied big-o notation evaluation of algorithm performance? compare time sort & search (n * lg(2)n + n) time search 3 times (3*n) break-even performance happens @ pretty small value of n.

Alexa Skills Kit in Germany: What are the skill intent catch phrases? -

i wiring home control (fhem) alexa. can control shutter blinds, not yet satisfied way have command alexa in natural language. where can find site german phrases start intent in custom skill? example: have skill called "jalousien" (shutter blinds) intent "links hoch" (left up). have "alexa, frage jalousien links hoch" ("alexa, ask shutter blinds left up") "frage" ("ask") catch phrase , sounds weird. other catch-phrases? thanks!

Redux - do I need to keep action types separately? -

i'm defining action types in separate file: export const set_some_id = 'set_some_id'; export const set_some_name = 'set_some_name'; ... then in action creators file doing this: import * atypes './actiontypes.js'; export function setsomeid(id) { return { type: atypes.set_some_id} } export function setsomename(name) { return { type: atypes.set_some_name} } ... i feel should dispense having action types in separate file , in actioncreators.js file: export function setsomeid(id) { return { type: 'set_some_id'} } is necessary, i.e. application grows become apparent right thing do? you can return string without defining types in separate file. however, bad coding practice in general - arbitrary strings, ones used across multiple files, should defined constant variable , imported wherever used. in case, have use action type strings within action creators , within 1 or more of reducers (multiple reducers can set respon

c++ - Why object of type sf::Text returns different getPosition().y and getLocalBounds().top? -

i want precisely set position of sf::text in sfml 2.4.1, after set font, location improper. #include <sfml/graphics.hpp> #include <iostream> #include <stdlib.h> int main() { sf::text text; text.setcharactersize(24); sf::font font; font.loadfromfile("font.ttf"); //without loading font, everything's correct text.setfont(font); text.setstring("a string"); text.setposition(0, 61); std::cout << text.getorigin().y; std::cout << text.getposition().y; std::cout << text.getglobalbounds().top; std::cout << text.getlocalbounds().top; if (text.getlocalbounds().top != text.getposition().y) return -1; return 0; } i tried change origin, didn't help. text.setorigin(0, text.getglobalbounds().height/2.f); //height correct , matches displays on screen(draw code unnecessary) any thoughts why? this happens because first line aligned vertically on height of tallest

html - File upload is not working in framework 7 -

i developing hybrid mobile application on framework 7. have 2 field's on page . upload image & slide bar. have used slide bar increase numeric value( 1 100) . problem when click on slider increase value, upload image icon no more clickable. if upload image first , increase/decrease slider working fine. please me issue. thanks in advance

javascript - Change display and icon when click on <a> element -

i want know how change display style , element class when click on element: , i'm loading " jquery.min.js version: 2.1.4 " , " bootstrap.min.js " before click on element: <ul class"nav navbar-nav" > <li class="nav-item search"> <!-- element --> <a class="nav-link search-toggle" id="nav-link-search" href="#" title="search posts"> <i class="fa fa-fw fa-search"></i> <span class="sr-only"> search </span> </a> </li> </ul> </div> <progress class="nav-progressbar" max="100" title="how of page have seen far. hold , drag change page position." value="0"></progress> </nav> <div class="search-area"> <div class=

php - This is my MySQL query, how to write in CodeIgniter? -

this mysql query , how write in codeigniter select distinct a.user_name wl_customers inner join tbl_bid b on a.customers_id = b.customers_id inner join tbl_portfolio c on b.portfolio_id=c.portfolio_id c.portfolio_id='16' using active records $this->db->select('distinct a.user_name'); $this->db->from('wl_customers a'); $this->db->join('tbl_bid b','a.customers_id=b.customers_id'); $this->db->join('tbl_portfolio c','b.portfolio_id=c.portfolio_id'); $this->db->where('c.portfolio_id',16,false); $query = $this->db->get();

npm - Automate Functional Testing in node.js -

i checked npm libraries test webpages or web-services. of them expect server running. since want automate functional testing, how can setup npm package in such way that it can start server test application stop server so can test locally, on online ci tools travis-ci or circleci. case 1: webservice i wrote npm package starts nodejs http(s) server. can started command line $stubmatic . currently, use 2 approaches test it, manual : manually start command line. run tests. automatic: use exec module run unix command can start application , run pkill command kill application. automation, application need installed on testing machine. case 2: website i have create npm package: fast-xml-parser , created demo page within repo can tested in browser. test demo page, start local server using http-server npm package manually. test application. what can better way write automate functional tests node js applications? note: i never used task runners gulp or grunt.

android - Adding ARToolkit Marker tracking into Tango -

i have been trying integrate artoolkit marker object tracking tango application . so far have created build tango app can access , use artoolkit native library or artoolkit unity wrappers. however, both seem require exclusive access camera in default configurations. how feed same android video feed both libraries? could create dummy camera device doubles out feed? could take tango feed normal, , resend artoolkit special videoconf [edit] artoolkit uses older camera1 api, takes onpreviewframe() callback , passes byte[] data it's own native library call, actual work. along lines of second bullet point, tango provide copy of each frames raw camera data using itangovideooverlay . (artoolkits ndk functionality seems expect nv21, can accept other formats ) if data extractable tango, believe artoolkit ndk functionality can used without owning camera. i afraid neither of method mentioned work. tango has exclusive access camera , believe artoolkit occupies c

powershell - Azure Automation: Onboarding DSC Node: "vmname, The entity was not found." -

i'm trying onboard vm azure automation dsc using register-azurermautomationdscnode cmdlet recommended here non-classic vm's. dsc nodeconfiguration has been both imported , compiled in azure automation. here code: $automationaccountname = "persistentautomationaccount" $vmname = "vm1" $automationresourcegroup = "persistantresources" $vmresourcegroup = "automatingautomation2" $nodeconfigurationname = "helloworlddsc.localhost" register-azurermautomationdscnode -automationaccountname $automationaccountname -azurevmname $vmname -resourcegroupname $automationresourcegroup -azurevmresourcegroup $vmresourcegroup -nodeconfigurationname $nodeconfigurationname but i'm getting following error can't find explanation for: new-azurermresourcegroupdeployment : 10:56:57 - resource microsoft.compute/virtualmachines/extensions 'vm1/microsoft.powershell.dsc' failed message '{ "error": { "cod

Android Layout button behaviour -

i have main activity: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/main_back" tools:context="com.project.mainactivity" > <button android:id="@+id/buttonplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginright="20dp" android:layout_marginend="20dp" android:layout_margintop="100dp" android:background="@drawable/btn_play_back" android:onclick="goplay" android:layout_alignparenttop="true" android:layout_alignparentright="true" android:layout_alignparentend="true" /> </relativelayout> in drawable folder have btn_play_back.png 3

angularjs - Can anyone suggest me how to redirect in angular -

i trying implement angular js joomla. made demo on angular working fine independently, when merge code joomla redirecting wrongly. router problem on angular or joomla? the issue routes specified in script i.e in script have used absolute path after merge unable link/locate route.

android - Location Updates -

iam developing app field signal strengths calculations every second using handler , during handler period records coordinates , record results & coordinates. works fine except when real testing , when increase speed of vehicle recorded coordinates not every second while times every 2-3-4 seconds not accepted me. code below: final locationmanager locationmanager = (locationmanager) getsystemservice(context.location_service); locationmanager.requestlocationupdates(locationmanager.gps_provider, 0, 0, this); publicvoid method_01(locationmanager locationmanager){ final handler handler = new handler(); handler.postdelayed(new runnable() { @override public void run() { location locationdatarate = locationmanager.getlastknownlocation(locationmanager.gps_provider); double latitude = locationdatarate.getlatitude(); double longitude = locationdatarate.getlongitude(); x=y+1; save file (latitude,longitude,x); handler.postdelayed(this, 1000); } }, 1000); } i have tried ch

Creating a Socket Server using Coldfusion -

i want notify iphone app of updates using socket server real time updates , prevent need polling. server side language coldfusion, , after weeks of searching web following threads of people attempting conclusion has come coldfusion doesn't support this. firstly if has suggestions no 1 else has provided proper way coldfusion feel free cut me short , please enlighten me. anyhow, solution occurred me (in sleep!) , before invest time doing wanted ask if critically flawed reason. there isn't in adminstrator supports this, , people rightly point out can't instantiate server socket on page since hang page waiting requests, , server destroyed when page times out. but wrong following solution, create appserver.cfc component, wraps java serversocket. trigger run this: <cfset application.servercfm=new appserver()> <cfthread timeout="2147483647"> <cfset application.servercfm.start()> </cfthread> the server remains indefinately on appli

c# - Parse an xml file by knowing its folder is in -

i'm working on project , need parse xml files knowing folder in, not files name. in folder there 1 file. i'd never assume folder contains single file, , wouldn't assume folder contains xml files. people can manipulate folders, know :-) that's why i'd enumerate files in folder, single out files have .xml extension , parse them follows: string[] allfiles = directory.getfiles(thefoldername); foreach (string filename in allfiles) { if (path.getextension(filename).equals(".xml", stringcomparison.invariantcultureignorecase)) { parsexmlfile(filename); } } and parsexmlfile method looks this: private void parsexmlfile(string file) { xmldocument doc = new xmldocument(); doc.load(file); // continue processing content // ... } please note though file has .xml extension doesn't mean is valid xml file, please add error handling above code.

merge - TortoiseHG Workbench's Tool Resolve adding diff text to file -

i have strange issue can't seem pin down. whenever use tool resolve, first time click 'tool resolve', diffs added file. here's ended being in file after merge conflict fix: tool resolve: function datavalid(data) { return "requests" in data && "suggestion" in data; <<<<<<< dest } ======= }>>>>>>> source original: function datavalid(data) { return "requests" in data && "suggestion" in data; } function shifttypetotitle(shifttype) { // removed logic } my commit remove shifttypetotitle . if tool resolve not able automatically resolve conflict, 3-way diff window opens. can see diff text in there. if close out of window without saving , click "tool resolve" again, diff text gone time! if tool resolve able automatically resolve conflict, have no opportunity cancel without saving , retry can above, in case, diff text committed file. this driving

jquery - Node.js: How to pass route parameters while specifying a url in an AJAX POST request? -

i have post route in node application so, app.post('/portfolio/:name/:id/:comment_parent', function(req, res){ ... }); inside callback body, save entry mysql database. need route params since go column entry database. want make whole process asynchronous using ajax, after searching on internet found no way of passing route params url attribute of ajax post request. idea how accomplish this? solved using ajax script inside ejs template. way can directly append route params url. main problem send these parameters ejs js file, using script tag in ejs helped this.

ios - Realm must not be nil -

i updated app realm 0.9x но 2.0.x have lot of bug reports 8, 9 , 10 ios devices on crashlytics fatal exception: fatal exception: rlmexception realm must not nil stack trace looks this: rlmobjectstore.mm line 81 rlmgetobjects rlmobject.mm line 154 +[rlmobject objectsinrealm:withpredicate:] rlmobject.mm line 146 +[rlmobject objectsinrealm:where:args:] rlmobject.mm line 140 +[rlmobject objectsinrealm:where:] sessions.m line 88 +[sessions resultwithsessionswhere:] sessions.m line 128 +[sessions activesession] sessions.m line 102 +[sessions applaunched] appdelegate.m line 60 -[appdelegate application:didfinishlaunchingwithoptions:] i can't reproduce bug on debug environment. touched around 30-40% of users (not @ all), , looks old users touched. there no realm object in method: /** * create , returns realm configuration sessions database */ +(nonnull rlmrealmconfiguration*)realmconfigurationforsessions {

c# - Data not fetch in to Excel from rdlc -

i have rdlc file generate report in excel/pdf format. when check stored procedure, data working fine. when export in button click, doesn't bring data. missing fields data, show in blank column have data when check stored procedure. can me this? public actionresult exportlist(int ptid, int fyid, int itid) { localreport lr = new localreport(); reportparameter rp = new reportparameter("ptid", ptid.tostring()); reportparameter rp1 = new reportparameter("fyid", fyid.tostring()); reportparameter rp2 = new reportparameter("itid", itid.tostring()); lr.datasources.clear(); string path = path.combine(server.mappath("~/report"), "exportlist.rdlc"); if (system.io.file.exists(path)) { lr.reportpath = path; } else { return view("index"); }

neural network - How to fine tune an FCN-32s for interactive object segmentation -

Image
i'm trying implement proposed model in cvpr paper ( deep interactive object selection ) in data set contains 5 channels each input sample: 1.red 2.blue 3.green 4.euclidean distance map associated positive clicks 5.euclidean distance map associated negative clicks (as follows): to so, should fine tune fcn-32s network using "object binary masks" labels: as see, in first conv layer have 2 channels, did net surgery use pretrained parameters first 3 channels , xavier initialization 2 extras. for rest of fcn architecture, have these questions: should freeze layers before "fc6" (except first conv layer)? if yes, how channels of first conv learned? gradients strong enough reach first conv layer during training process? what should kernel size of "fc6"? should keep 7? saw in "caffe net_surgery" notebook depends on output size of last layer ("pool5"). the main problem number of outputs of "score_fr"

javascript - Twitter intent redirect to mobile.twitter.com -

i working on project able share via twitter or facebook. when working twitter share, found out twitter intent best way. found problem when try share via twitter using mobile device. here sample code: var width = 640, height = 440, left = ($(window).width() - width) / 2, top = ($(window).height() - height) / 2, url = 'https://twitter.com/intent/tweet?text=congrats!&hashtags=labmate!', opts = 'status=1' + ',width=' + width + ',height=' + height + ',top=' + top + ',left=' + left; window.open(url, 'twitter', opts); if user login, nothing wrong, when user not login twitter show login form, , if user misstype either username or password, twitter redirect page. here problem, after twitter redirect page, url change into https:// mobile.twitter.com /login/error?username_or_email=sample%40mail.com&redirect_after_login=%2f

visual studio - Angular 2 with TypeScript in VS 2015 - loading components from different projects -

i have been working through tutorial here: https://angular.io/docs/ts/latest/tutorial/ various blog posts, , have managed running in visual studio. now face have not been able solve. i want move of components separate component library project. how reference of these components in main app component? they reside outside of app directory in project completely. what need able use these external components?

CORS Oauth Request in JQuery to Azure AD to Access Power BI api -

i working on freshdesk based client apps, facts , problem: freshdesk widgets/apps allow jquery/js , html, doesn't give server side support yet developers. i looking list of power bi reports in widget. this requires azure ad oauth token, having trouble making cors request. i how asked freshdesk whitelist domains required microsoft domain's oauth request calls. i still following error xmlhttprequest cannot load https://login.microsoftonline.com/common/oauth2/authorize ?. response preflight request doesn't pass access control check: no 'access-control-allow-origin' header present on requested resource. origin ' https://xxxx.freshdesk.com ' therefore not allowed access. my code below jquery.ajax({ type: 'get', url: authorizeurl, headers: headers1, beforesend: function(xhr){xhr.setrequestheader('access-control-allow-origin','https://login.microsoftonline.com');}, success : function(

Emualtor not attached Android Studio 2.2.2 -

i'm trying attach emulator android studio doesn't appear on list of devices. i've tried execute run button , avd manager. besides i've checked , uncheked tools > android > enable adb integration option doesn't work. trying execute adb kill-server , adb-start server doesn't work neither. finally i've tried start emulator terminal exececuting emulator @name_of_device hax enabled hax ram_size 0x40000000 hax working , emulator runs in fast virt mode. emulator: listening console connections on port: 5554 emulator: serial number of emulator (for adb): emulator-5554 emulator: emulator window out of view , recentered but when execute adb devices, list of devices attached empty does how solve this?

How to run TypeScript for validation without generating js files? -

i'm using typescript v2.0 , ts-node . don't need js files, want use typescript validation in tests. how can run typescript validation, without generating js files? you can use --noemit flag. tsc file.ts --noemit for validation purposes however, may consider using typescript linter instead (such tslint ).

ios - Rx-Swift Clean architecture -

Image
i want design swift app using clean architecture. i have read link below on clean architecture swift http://clean-swift.com/blog/ i have used these templates create app. i wanted ask if best architecture use want code using rx-swift. also appreciate if point out few working examples clean architecture reactive swift. is using uncle bob’s clean architecture swift( http://clean-swift.com/blog/ ) best practise rxswift or should go mvvm architecture any appreciated. thank you. hi i'm using rxswift clean architecture project in case, use them in profile scene looks instagram use case of profile scene user should refresh profile scene user should chance photo's category user should load more photo's pagination problem is, user can change post's category rapidly then last fetched post's should different selected category :( all event cause event asyncronousely so use rxswift in interactor has profileworker(to fetch profile

sql - Need help for join and some calculations on a MySql insert -

i'll try provide context can understand i'm trying achieve here. company uses open source software manage employees leaves (jorani, feel free google :) ). there different types of leave (holidays, sick leave, etc.) , want calculate days "not used" holidays of 2016 , "copy" them type of leave called "remaining holidays 2016". the important tables are: entitleddays (here specify how many days of each type give employee) id employee startdate enddate type days description 661 3 2016-01-01 2017-02-28 1 14.00 holidays 2016 1296 3 2016-01-01 2016-12-31 4 18.00 sick leave 2016 leaves (this table has information leaves taken employees) id startdate enddate status employee cause duration type 2436 2016-08-01 2016-08-01 3 78 ok managers 1.00 1 2766 2016-09-05 2016-09-12 3 63 holidays

url rewriting - apache mod rewrite condition - rule -

i grab url, check if url contains "#!" , redirect same url without "#!" string? tried following - not working? rewritecond %{request_uri} "(.*).html#!$" rewriterule "(.*)" $1 [nc,l,r=301] try one: rewritecond %{request_uri} ".*\.html#!$" rewriterule "^(.*\.html)#!$" $1 [nc,l,r=301]

android - Unable to upload APK to in Firebase Test Lab -

i have upgraded 'blaze" plan of firebase. trying test release apk using firebase test lab, every time upload apk, this. the file not uploaded google cloud storage (gcs). issue might caused incorrect gcs permissions. how solve problem? need change settings in project? ps - know not programming related question. have resort so, after putting issue firebase support, have got no solution. firebase test lab team member here projects using test lab on blaze plan prior septmber 29th own storage bucket used app , test result storage. if such project downgraded spark plan , has billing account removed, storage bucket may become unwritable. you can tell whether or not using own storage bucket examining path on request clients6.google.com/upload/storage/ browser. if not clients6.google.com/upload/storage/.../test-lab-(id) may have problems uploading apks on spark plan. if case, try creating new project. working on fix not necessary.

angular - Angular2 and D3.js Gantt chart -

i have angular2 app attempting implement gantt chart d3.js into. trying use following example http://bl.ocks.org/dk8996/5538271 . uses javascript rather typescript. have got of seeming ok, 1 issue. here whole method: createschedule() { var tasks = [{"startdate":new date("sun dec 09 01:36:45 est 2012"),"enddate":new date("sun dec 09 02:36:45 est 2012"),"taskname":"e job","status":"running"}]; var taskstatus = { "succeeded" : "bar", "failed" : "bar-failed", "running" : "bar-running", "killed" : "bar-killed" }; var tasknames = [ "d job", "p job", "e job", "a job", "n job" ]; tasks.sort(function(a,b) { return a.enddate.gettime() - b.enddate.gettime(); }); var maxdate = tasks[tasks.length -1].enddate; t

python - Hexagonal grid, find all possible paths in n steps -

i have same problem, this question. sadly need possible paths between 2 fields in hexagonal grid in n steps, without loops. right now, if n_steps greater shortest path between fields, have lots of loops. i struggling find fitting recursive function, me write down paths in list of lists. my function looks this: def find_paths_from_to_with_length(self, pos_1,pos_2,n_steps): coordinate_1= self.find_coordinates(pos_1) neighbour_pos_1= self.coordinates[coordinate_1].neighbour_list if n_steps == 1: if pos_2 in neighbour_pos_1: return [[(pos_1,pos_2)]] return [] if pos_1 == pos_2: return [] all_paths = [] node in neighbour_pos_1: neighbor_all_paths = self.find_paths_from_to_with_length(node,pos_2,n_steps-1) path in neighbor_all_paths: print("path: ",path) all_paths.append([(pos_1,node)] + path) return all_paths anyone has solution problem?

Objective-c Property returns 'nil' in Swift 3 -

audio.h @property(nonatomic,readwrite) int count; audio.m _count = 0; count++; viewcontroller.swift var audioswift: audio? print(audioswift?.count) this returns 'nil' , want have modified valued -bdridging-header.h #import "audio.h" what do? thank you! don't post answers in comments. here complete answer: the problem never create audio object, audioswift variable indeed nil. change swift code this: var audioswift = audio() //create new audio object. print(audioswift.count) since code above creates audio object right away, doesn't need optional more. note in both swift , objective-c class names should start upper-case letter, audio class should named audio instead.

jQuery execute php script on button click and analyse results? -

task: when button clicked - disables button, executes php script. based on value php script returns - want perform 1 of 2 actions! 1) if php returns "ok", reload current page; 2) if php returns "notok:notoktext", fill #updateresult div notoktext, reenable button. <button id="updatebutton" onclick="update_btn_click('params');">execute php</button> and here's jquery have far. near doing want. loads div output of php , doesn't wait while loading finishes (php try fetch data server, take time) - re-enables button. function update_btn_click(param) { $('#updatebutton').prop("disabled",true); $('#updatebutton').text("processing..."); $("#updateresult").load("/update.php"); //how wait result , analyse has been returned? //act upon result $('#updatebutton').removeattr('disabled');} function update_btn_click(param) { $(

knockout.js - Magento 2 issue on header minicart -

Image
im having problem on integrating header mini cart custom theme. below screenshots of issue. appreciated. in advance :) screenshots: below default.xml code. <referencecontainer name="header.container"> <container name="header-wrapper" label="page header" as="header-wrapper" htmltag="div" htmlclass="top-header"> <!-- top links cart --> <container name="topcartoptions" label="top cart options" htmltag="div" htmlclass="top-cart-options text-right" before="-"> <block class="magento\cms\block\block" name="block-top-links"> <arguments> <argument name="block_id" xsi:type="string">block-top-links</argument> </arguments> </block> </

postgresql - UPDATE table if column exists -

i have 2 similar not same tables. res_partner odoo. 1 table 10 version , 7. columns differs bit. i need update fields of first table using second table. problem don't know if column exists in 1 table or not. question how can update fields exists in both tables? you can create reference field in odoo. reference fields pointers field on different table when related model field updated field on given table auto update. bests

php - Select value from drop down list and second drop down list auto changed -

i have 1 table in database called company , inside company table there 3 columns name id,company_name , location. have 2 drop down list. first drop down list displaying company name , according company name location change in second drop down list. did code in second drop down getting location name. <?php //$comp=$_post['company']; $servername = "localhost"; $username = "root"; $password = ""; $dbname = "demo_db"; //open connection mysql db $connection = mysqli_connect($servername,$username,$password,$dbname) or die("error " . mysqli_error($connection)); //fetch table rows mysql db $sql = "select * company";// displaying company name in first drop down list $result = mysqli_query($connection, $sql) or die("error in selecting " . mysqli_error($connection)); if (isset($_post['company'])) { $name=$_post['company']; $sql = "

compiler construction - How to get the value of MSB bit of a token returned by LEX -

i have lex specification file below; if input of form r[0-7] return token "reg" yacc file. want "rotate right carry" operation in lex , yacc. need know value of r1[7] , r1[0] can use: r1[0] = cf cf = r1[7] in yacc file, register values stored in regmem. how define number of bits register , how access them?

jquery - .NET MVC - "beforeunload" event with server-side check -

this question has answer here: jquery promise wait ajax end 3 answers in mvc application, when user leaves page need prompt them warning so: $(window).on("beforeunload", function () { return "you lose changes, sure?" }); this jquery works, first need check whether user should warned in first place. check complex , needs performed server side (i've struggled find example of this). possible? i've tried ajax post: $(window).on("beforeunload", function () { $.ajax({ type: "post", url: "@url.action("savecheck")", async: false success: function (result) { //return string here if saving required } }); }); but doesn't work above - "beforeunload" function returns , doesn't care result of ajax post. is th

c# - Epplus - Repeat All Item Labels in Pivot Table -

i create pivot table epplus. made design things on pivot table cant find how repeat item labels in tabular layout *(in excel file pivottable tools - > report layout/repeat item labels) here code. public void write(pivottable pvttbl) { var tbl = getpivotdataastable(pvttbl.pivotdata); var rangepivottable = wsdata.cells["a1"].loadfromdatatable(tbl, true); var pivottable = ws.pivottables.add( ws.cells[1, 1], rangepivottable, "pvttable"); foreach (var rowdim in pvttbl.rows) { var row = pivottable.fields[rowdim]; pivottable.rowfields.add(row); row.subtotalfunctions = esubtotalfunctions.none; } foreach (var coldim in pvttbl.columns) pivottable.columnfields.add(pivottable.fields[coldim]); pivottable.compact = false; pivottable.compactdata = false; pivottable.rowgrandtotals = false; pivottable.useautoformatting = true; pivottable.showmemberpropertytips =

How do I connect to the PredictIt API (type application/xml) using PHP/CURL? -

this code not returning anything: <?php $ch = curl_init(); $header = array('contect-type: application/xml', 'accept: application/xml'); $options = array( curlopt_url => 'https://www.predictit.org/api/marketdata/ticker/rnom16', curlopt_httpheader => $header, curlopt_httpauth => curlauth_basic, curlopt_returntransfer => true ); curl_setopt_array($ch, $options); $data = curl_exec($ch); curl_close($ch); echo '<p>data</p>'; print_r($data); ?> does know what's wrong? thank you.

How to convert this given tutorial video(php core) into codeigniter(elasticsearch:9200) -

Image
i newbie codeigniter , chance learn alot it. wanted include elasticsearch in codeigniter , searched tutorial vedios there nothing can find , last followed tutorial can make changes , include in codeigniter . struck . anyhelp great. thank in advance. <?php require_once 'vendor/autoload.php'; $es= new elasticsearch\client([ 'hosts' => ['127.0.0.1:9200'] ]); i wanted code codeigniter . init.php file inside app folder when follow tutorial. there no tutorials include elasticsearch , codeigniter. i have followed following tutorials ref : https://www.youtube.com/watch?v=3xb1dhlg-lk after trying github demo. given below.i have included files needed , tried add index got error. $insert_data = array('carrier' => $this->input->post('carrier'), 'shipping_type' => $this->input->post('shipping_type'), 'description' => $this->input->post('descripti

java - Dozer# Can Dozer supports Polymorphism? -

please see following structure of sourceclass , destinationclass. public class sourceclass { // mapping goes here protected someobject someobject; public static class someobject { // mapping goes here parameters protected string param1; protected string param2; protected string param3; protected string param4; protected string param5; protected string param6; protected string param7; protected string param8; protected string param9; protected string param10; } } public class destinationclass { protected myobject myobject; } public class myobject { protected string param1; protected string param2; protected string param3; } public class childclass1 extends myobject { string param8; string param9; string param10; } public class childclass2 extends childclass1 { protected string param4; protected string param5; protected string param6

c# - How to customize name, length and value of a discriminator column with Entity Framework 6 -

i try use ef6 existing database must compatible with. database has been generated nhibernate , tables use table-per-hierarchy (tph) inheritance model. discriminator columns named category (instead of discriminator ) , have sql length of 255 (instead of 128). values different ef generate. how can configure ef use existing columns (name, size , values)? i tried define custom convention: protected class discriminatorrenamingconvention : istoremodelconvention<edmproperty> { public void apply(edmproperty property, dbmodel model) { if (property.name == "discriminator") { property.name = "category"; property.maxlength = 255; } } } protected override void onmodelcreating(dbmodelbuilder modelbuilder) { modelbuilder.entity<myentitya>().map(x => x.requires("category").hasvalue("cata")); modelbuilder.entity<myentityb>().map(x => x.requires("category

JAVA: Export ArrayLists into excel table with NEW sheet everytime -

i have 2 arrayslists (x , y) different number of elements. now, want export them among excel-table. x , y should have own columns side side. example: x = [2 , 6 , 0], y = [5 , 8 , 3] x | y ------ 2 | 5 6 | 8 0 | 3 everytime run program, arrays new elements. @ end of programm, has saved in excel table, , everytime in new sheet. when open pogramm 5 times, should have 5 sheets (the name of sheet actual time , date - saved in variable called date). my questions: 1. how can arraylists own colums? 2. how supposed create new sheets , dont overwrite old ones? hssfworkbook workbook = new hssfworkbook(); hssfsheet sheet = workbook.createsheet(date); //everytime, sheet overwritten, need new sheed. workbook.addsheet(date) perfect map<string, object[]> data = new hashmap<string, object[]>(); data.put("1", new object[] {"column 1", "column 2"}); //maybe kind of for-loop arraylists? dont know

batch file - Login to Windows via RunDll32.exe with password? -

how can login locked windows, using command in .bat file? can lock screen java program : rundll32.exe user32.dll,lockworkstation is there way login later automatically (from running java program), if know password? no, doesn't work - design. login dialog runs in secure desktop . that's why see screen darken when switch desktop. the goal of secure desktop protect against sort of manipulation trying achieve. iow, if there bug in windows allow today, patched next week.

java - Enable port 5555 for adb network admining programmatically -

i wondering how can enable port 5555 daemon adb on android? basically, have been setting home network old router can keep devices connected. here's issue: don't want have connect usb every time enable ports, defeats whole purpose. i wondering how forward port using java or jni programmatically clicking button? have seen telnetd app it. want myself. how achieve this? have tried 1 function, here is: public void openport() { try { java.lang.process process = runtime.getruntime().exec("setprop service.adb.tcp.port 5555"); int exitcode = process.waitfor(); if (exitcode != 0) { throw new java.io.ioexception("command exited " + exitcode); } runtime.getruntime().exec("adb tcpip 5555"); toast.maketext(this, "listening on port "+ port + "...", toast.length_long).show(); } catch (exception ex)

c# - Is throwing OutOfMemoryException from application code good design -

i remeber read somewhere throwing of system.systemexception derived exceptions user code bad practice, user code should throw application exceptions. we have native library uses gpu. may return error code indicates we`re out of gpu memory. want translate error code .net exception. this possible exceptions can think of: system.outofmemoryexception system.invalidoperationexception appropiate text custom exception (based on invalidoperationexception) which 1 best , why? raising outofmemoryexception worst choice. reason this exception impossible recover in general case , client, extremely hard determine whether system ran out of memory or abused exception type, because client not expect behavior. raising invalidoperationexception better thing, because client able handle (by offloading computation somewhere else or performing required stuff in cpu, potentially using different library). however, if exception invalidoperationexception , exception type used other

c++ - Are C++14 digit separators allowed in user defined literals? -

while clang compiles following line, g++ 6.1 complains digit separator (see live example on coliru ): auto time = 01'23s; which compiler, if any, correct according c++14 standard (n3796)? otherwise, allowing digit separators (§2.14.2) implementation detail in user-defined literals (§2.14.8) of <chrono> library (§20.12.5.8)? imho should not, since these literals defined on unsigned long long parameters. i remember howard hinnant using 10'000s example during cppcon 2016 talk "a <chrono> tutorial" (at 42 minutes in talk). (please note, did not intend code "1 minute , 23 seconds", only correct accident , since octal literal 0123 64 + 16 + 3 == 83. purpose should write auto time = 1min + 23s; but possible misleading interpretation not part of question.) if @ grammar, user-defined-integer-literal can octal-literal ud-suffix , , octal-literal defined either 0 or octal-literal ’ opt octal-digit . n4140 §2.14.8

ios - Search results not aligned with searchbar for UISearchController -

Image
i trying upgrade uisearchdisplaycontroller uisearchcontroller , having lot of strange problems it. current problem search results not align searchbar. in portrait mode, there small gap between searchbar , first search result: (i have coloured background of results tableview yellow, show extend) for landscape mode, opposite true: searchbar overlaps top of results: strangly enough, if rotate view results view still visible, comes out perfectly. my setup pretty standard approach, searchbar in navigation bar, , search results in separate uitableviewcontroller . code in original view controller: - (void) viewdidload { [super viewdidload]; searchresults *searchresults = [[searchresults alloc] init]; searchcontroller = [[uisearchcontroller alloc] initwithsearchresultscontroller:searchresults]; searchcontroller.searchresultsupdater = searchresults; self.navigationitem.titleview = searchcontroller.searchbar; searchcontroller.hidesnavigationbarduring