Posts

Showing posts from March, 2011

How to pass parameters to controller using ajax and javascript? -

i trying delete item shopping cart using ajax javascript, have trouble passing parameters controller. parameters null in controller. my javascript code shows below: function removerow(itemid, rowid){ if (xmlhttp == null) { alert("your browser not support ajax!"); return; } var query = "action=remove&item=" + itemid; /* alert(query); */ xmlhttp.onreadystatechange = function statechanged() { if (xmlhttp.readystate == 4) { var row = document.getelementbyid(rowid); row.parentnode.removechild(row); } }; xmlhttp.open("get", "addto.htm", true); xmlhttp.setrequestheader("content-type", "application/x-www-form-urlencoded"); xmlhttp.send(query); return false; /* var row = document.getelementbyid(rowid); row.parentnode.remo

mysql - Conditional Sorting of Data using php codes from sql database -

Image
i'm having problem sort table values different categories of books , i'm having 10 categories of books. categories mentioned in table entitled "categories" (1, 2, 3,...10) , each category contains more 100 books. i want sort books 1 category such 1 database , ignore other categories. used following php codes sorted results whole of column "categories" means categories sorted 1 one want sort data single category. $orderby = "order books.category desc"; $addparam = ""; if ($_get["incldead"] == 2) $wherea[] = "visible = 'yes'"; $res = mysql_query("select count(*) books $where") or die(mysql_error()); $row = mysql_fetch_array($res,mysql_num); $count = $row[0]; if ($count) { $pager = pager($booksperpage, $count, "browse.php?" . $addparam); $query = "select books.id, books.category, books.name, books.times_completed, books.size, books.added, books.type, books.comments,books

swing - Multiple screen java applet has buttons that don't work -

i'm making program has 2 screens, title , game screen. if user clicks "play", can proceed next screen. however, on next screen if user tries press button "keep going", nothing happens. want know why , if can fix it. thanks, , here code: import java.applet.*; import java.awt.*; import javax.swing.*; import java.awt.event.*; public class zombiedice extends applet implements actionlistener { panel p_card; panel card1, card2; cardlayout cdlayout = new cardlayout (); int shotguns = 0; int brains = 0; int p1b = 0; int p2b = 0; jlabel pic1; jlabel pic2; jlabel pic3; public void init () { p_card = new panel (); p_card.setlayout (cdlayout); screen1 (); screen2 (); resize (600, 500); setlayout (new borderlayout ()); add ("center", p_card); } public void screen1 () { card1 = new panel (); jlabel logo = new jlabel (createimageicon ("logo.jpg")); jbutton play = new jbutton (createimageicon ("play.j

rest - Can't Get Post Data Codeigniter -

i tried make rest api android app using codeigniter, first don't have trouble using method, parameter data can sent. when came post method, rest api can't header. solution great. thanks here url using method: http://10.34.1.122/a-kit-android/api/cont_a_kit/start_mesin_operasi?id_mesin=10&operasi=1 here url using post method: http://10.34.1.122/a-kit-android/api/cont_a_kit/start_mesin_operasi header : id_mesin = 10, operasi=1 here controller: function start_mesin_operasi() { $idmesin = $this->input->post("id_mesin"); $data = array( 'operasi' => $this->input->post("operasi"), ); header('content-type: application/json'); echo 'id mesin: '.$idmesin; echo json_encode($this->mod_a_kit->start_mesin($idmesin, $data)); } and here model: function start_mesin($id, $data) { $thi

javascript - bitwise OR unexpected result -

this line of code: console.log((90000000000000|0).tostring()); output: -1039687680 ( bin -111101111110000110000000000000 ) according 32-bit signed integer conversion , expect: /--discarded--\/---------significant----------\ 10100011101101011000010000001111010000000000000 = 90000000000000 │ 11000010000001111010000000000000 or 00000000000000000000000000000000 ================================ 11000010000001111010000000000000 = -1107795968 sign/\------significant bits-------/ why obtain -1039687680 instead of -1107795968 ? as mentioned in post linked, it's in two's complement format. negative 11000010000001111010000000000000 xor 1 plus 1 equals positive 11110111111000011000000000000000, 1039687680 finally -1039687680 gained.

javascript - Jquery Children's child elemnt -

$(parentquestion.children('.choice_class:last')); <div class='parentquestion'> ..... <div class="choice_class"> <div class="form-group"> <label class="control-label col-md-3 col-sm-3 col-xs-12"><span class="choice-no">option 1</span><span class="required">*</span> </label> <div class="col-md-6 col-sm-6 col-xs-12"> <input type="text" required="required" class="form-control col-md-7 col-xs-12"> </div> <a href="javascript: void(0);" onclick="addoption(this)" class="btn btn-danger"><span class="glyphicon glyphicon-plus"></span>add choice</a> </div> </div> inside addoption function, using variable, found p

android - Fail to Move a View to a TableRow -

i trying inflate layout resource , move views in table. remove views parents , add them table. works need add them tablerow in table instead. however, when tried that, nothing showed up. to simplify example, use views in xml instead of ones generated in code. in following xml, there tablelayout 1 tablerow , imagebutton: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" ...> <tablelayout android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/table"> <tablerow android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/row_1"></tablerow> </tablelayout> <button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="new button" an

cmake - Need a example to use dll in vs -

i faced problem when migrated project linux windows visual studio seem can not use dll lib directly. through number of materials , known seem should use imported in add_library(...), can not find practical example how use , used this: add_library(hello_lib shared hello.c) add_library(hello_lib shared imported) and error happened cmake error @ sub_haha/cmakelists.txt:6 (add_library): add_library cannot create imported target "haha_lib" because target same name exists. could please give me 1 or some? btw dll lib seem used in mingw makefile on windows.

mainframe - Why the StEPLIB always overrides the JOBLIB,in JCL? -

in jcl steplib overrides joblib.can explain why so? the below excerpts ibm manuals , explain joblib dd statement , how steplib dd statement interacts joblib statement. use joblib dd statement to: create private library. identify private library system search program named in each exec statement pgm parameter in job. if system not find program in private library, search system libraries. relationship of steplib joblib use joblib dd statement define private library system use entire job. if include joblib dd statement job , steplib dd statement individual job step, system first searches step library , system library program requested in exec statement. system ignores joblib library step.

php - URL-BBCode Regex -

i'm trying url bbcode. there 4 possibilities it, , that's current problem: [url]http://stackoverflow.com/[/url] [url='http://stackoverflow.com/']http://stackoverflow.com/[/url] [url="http://stackoverflow.com/"]http://stackoverflow.com/[/url] [url=http://stackoverflow.com/]http://stackoverflow.com/[/url] i need both. is, have far: /\[url(?:\=\'([^\'"]+)\')?](.+?)\[\/url]/i but work case 1 & 2. edit: this works better: /\[url(?:\=(?:[\"|'])?(.*)(?:[^[]+)?)?\](.*)\[\/url\]/i but still not perfect. edit: i guess, got it. may need optimization, seems work: /\[url(?:\=("|\'|)?(.*)?\1)?\](.*)\[\/url\]/i see regexp-tester you can use pattern: $pattern = '~\[url(?|=[\'"]?([^]"\']+)[\'"]?]([^[]+)|](([^[]+)))\[/url]~'; $replacement = '<a href="$1">$2</a>'; $result = preg_replace($pattern, $replacement, $subject); the idea prese

Quickblox 422 No recipient issue using Android SDK -

i using quickblox android chat sdk chat module. have implemented whatever process stated in quickblox site. able register,login , creating session quickblox programmatically , able chat , chat history successfully. got struck users, not able chat getting 422 error "'{"errors":{"base":["no recipients. @ least 1 user should subscribed gcm (android push) (through sdk or rest api)"]}}'" . users, not facing problem. please suggest me solution problem. in means user doesn't have push subscription, can't receive pushes follow guide subscribe user receive push notifications http://quickblox.com/developers/simplesample-messages_users-android#giving_a_user_a_push_notification_subscription

c# - Stop ReSharper or Visual Studio from reformatting my code -

i working on windows form application, , setting text of labels in initializecomponent() method of myform.designed.cs . i'm setting function call looks first line, keeps getting reformatted second line. first line works perfectly, it's it's getting reformatted. this.teamgroup.text = localizedlanguage.getvalue("selectedteamlabel"); this.teamgroup.text = "selected team"; additionally, happening tabindex well. i have: c# 6.0 visual studio 2015 community resharper 10.0.2 jacob, shouldn't modify code inside initializecomponent manually. /// <summary> /// required method designer support - not modify /// contents of method code editor. /// </summary> private void initializecomponent() if want add components use following approach: public yourform () { initializecomponent(); custominitializecomponent(); } private void custominitializecomponent() { teamgroup.text = localized

python - Creating a Parquet file with PySpark on an AWS EMR cluster -

i'm trying spin spark cluster datbricks' csv package can create parquet files , stuff spark obviously. this being done within aws emr, don't think i'm putting these options in correct place. this command want send cluster spins up: spark-shell --packages com.databricks:spark-csv_2.10:1.4.0 --master yarn --driver-memory 4g --executor-memory 2g . i've tried putting on spark step - correct? if cluster spun without being installed, how start pyspark package? correct: pyspark --packages com.databricks:spark-csv_2.10:1.4.0 ? can't tell if installed or not. not sure functions test and in regards using package, correct creating parquet file: df = sqlcontext.read.format('com.databricks.spark.csv').options(header='false').load('s3n://bucketname/nation.tbl', schema = customschema) #is option1 df.write.parquet("s3n://bucketname/nation_parquet.parquet") #or option2 df.select('nation_id', 'name', 'some_int&

Fetching Double Value from SQLite in iOS -

Image
though may seems simple, trying hours on this. hello, everyone, storing double value in sqlite database in ipad application. i fetching records using simple "select * tablename" query. then converting patient_dos value double. but prints when display content of first patient dictionary. "patient_dos" = "1461561219160.408936"; and below value after converting value in double variable using following conversion method. double p_dos = [[dict objectforkey:@"patient_dos"] doublevalue]; result printing description of p_dos: (double) p_dos = 1461561767624.27 my main concern match double, timestamp, of day when patient admitted without hh:mm:ss information. update: you can convert string (which database) double like, nsstring *str = @"1461561219160.408936"; double fl = [str doublevalue]; nslog(@"double vvalue : %f",fl); this printing exact 1461561219160.408936 in console

spring - Gradle task to package a springboot project to ear -

i want package springboot restful webservice project ear file gradle having file structure this: --meta-inf -application.xml --app.war please me gradle task achieve this. gradle provides ear plugin: apply plugin: 'ear' https://docs.gradle.org/current/userguide/ear_plugin.html this should package ear. gradle provides spring-boot plugin: buildscript { dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.3.release") } } apply plugin: 'spring-boot' https://docs.spring.io/spring-boot/docs/current/reference/html/build-tool-plugins-gradle-plugin.html which package runnable jar.

How can I embed my javascript and PHP code for language translation and make a Shopify app? -

i making app converts language of shopify pages @ front-end site browser specific location, during have tried lot not getting actual want. have seen shopify discussion forum api request, have read shopify doesn't allow update shopify data threw api request. how can possible change language @ front-end in browser location country specific. i have created partner account, app name, app secret key creating app. problem start , embed javascript , php code shopify.

active directory - Getting Different values of VARIANT in VC++ -

i querying active directory c++ . have bind iads object server , able retrieve user information. using variant data type retrieve objects. of object bstr strings. attributes badpwdcount, pwdlastset,logoncount not. hence not able retrieve values. please me this. variant var; hr=testiad->get(query,&vari); if(hr==0) { printf(%s\n\n", v_bstr(&vari)); } here don't know how use variant print data types other bstr. variant has member named vt indicates value type contains. instance if vt set vt_unknown variant contains pointer iunknown interface can set or retrieved using punkval member. variant v; getvalueasvariant(&v); if(v.vt == vt_unknown) { iunknown *i = vt.punkval; // ... ... i->release(); } there list of variant types available on msdn website

C function float argument takes different value inside the function -

i sure i'm missing obvious here can't figure out is. in my repository , have file called ddpoly_2.c contains function called "ddpoly2". call function main function in tst5.c. if @ code in tst5_2.c, assigning x value of 2, printing , passing "ddpoly2" third argument (which per calling pattern should far can tell). print x within function "ddpoly2". see following: x outside: 2.000000 x inside : 0.000000 nc: 2 nd: 3 you can see x 2.000000 before function called became 0.0000000 once inside function. must missing overtly obvious here can't figure out is. p.s. compile code using makefile in same directory. edit: including relevant parts of code here. calling function in tst5_2.c: int main(int argc, char *argv[]) { //used determine section gets results printed. float c[] = {1,1,1,0,0}; int nc = 2; float x = 2.0; float pd[] = {0,0,0,0,0}; int nd = 3; printf("x outside: %f\n",x); ddpoly2(c,nc,x,pd

mapreduce - Error in hadoop : "Exception in thread "main" java.lang.ClassNotFoundException" -

i have downloaded hadoop-2.7.1 ( apache hadoop) on ubuntu 14.04.3 lts (gnu/linux 3.19.0-25-generic x86_64) on oracle vm virtualbox. i'm using following commands compile , run code : compile hduser@dt-virtualbox:~/desktop/project/try1$ javac -classpath $hadoop_home/share/hadoop/common/hadoop-common-2.7.1.jar:$hadoop_home/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.7.1.jar:$hadoop_home/share/hadoop/common/lib/commons-cli-1.2.jar -d /home/hduser/desktop/project/try1 *.java} then making jar file of class files , running jar file using: {hduser@dt-virtualbox:~/desktop/project/try1$ hadoop jar table_one.jar drivermap /trial/trial/ output_tryy1} please find below error {exception in thread "main" java.lang.classnotfoundexception: drivermap @ java.net.urlclassloader$1.run(urlclassloader.java:366) @ java.net.urlclassloader$1.run(urlclassloader.java:355) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloa

actionscript 3 - twitter rest api v 1.1 in flash application + php -

first, i've create app twitter , read documentation rest api v1.0 not supported(available) longer , new 1 v1.1 then, i've develop flash app utilize twitter retrieve user's profile , profile base data comparison process. how can build sign-in twitter mechanism when user succesfully sign-in apps profile data , comparison mechanism? ther tutorial work around twitter rest api v1.1? and consumer key, consumer secret, access token secret, access token? sorry if ask lot questions because tutorial found in internet not work properly. so far have found following library in github.com, yet decipher usage of library: https://github.com/susisu/twitter-for-as3

What exactly onCreate() method will do in a Fragment Life Cycle in an Android Application -

this question has answer here: difference , uses of oncreate(), oncreateview() , onactivitycreated() in fragments 2 answers i confusing oncreate() method in both activity , fragment. oncreate() in fragment , differences oncreate() method between activity , fragment.please me learning myself. thanks...... oncreate() the system calls when creating fragment. within implementation, should initialize essential components of fragment want retain when fragment paused or stopped, resumed.

javascript - How to collect strings, sent from angularJS, in NodeRED array? -

i'm trying collect strings send angularjs nodered array. angularjs code looks this this.user = { medname1: '', medtime1: '' }, { medname2: '', medtime2: '' }, { medname3: '', medtime3: '' }; i'm collecting form data in medname1, medtime1,.. , on. i'm trying send data, on websocket, 1 one nodered using following code this.register = function() { $scope.sock.send(this.user.medname1); $scope.sock.send(this.user.medtime1); $scope.sock.send(this.user.medname2); $scope.sock.send(this.user.medtime2); $scope.sock.send(this.user.medname3); $scope.sock.send(this.user.medtime3); } register() called when click on "submit" button. my question - how store these strings in nodered array? . because way i'm sending it, string gets stored in array index 0, overwriting previous string. tried $scope.sock.send(json.stringify(this.user)); but sends entire thing s

php - select the name as selected in dropdown -

query select god god table $sth =$dbh->prepare("select god_id,god_name_ml,god_name_en,image,info_ml,info_en,details_ml, details_en,rounds_ml,rounds_en,mantra_ml,mantra_en,display_order god"); $sth->execute(); query select deity deity table.here god_id foreign key god table $stmt = $dbh->prepare("select deity_id,god_id,deity_name_ml,deity_name_en,info_ml,info_en,details_ml, details_en,mantra_ml,mantra_en,display_order deity deity_id = :deity_id"); $stmt->bindvalue(':deity_id',$deity_id,pdo::param_int); $stmt->execute(); $result = $stmt->fetchall(); $temp_array=$result[0]; $god_id=$temp_array['god_id']; display code displaying god in dropdown god table <?php while ($row = $sth->fetch(pdo::fetch_assoc)) { ?> <option value="<?php echo $row['god_id'];?>"> <?php echo $row['god_name_en']; ?> </option

android - Updating Parent Fragment from Child Fragment -

Image
in android application, have 2 fragments. parent fragment contains list of available filter types , when particular filter type clicked (in parent fragment - yellow background) corresponding child fragment (pink background) opens list of available options selected filter type. requirement once user select/deselect option in child fragment, should reflect/update option count (green color) in parent fragment. please check attached wireframe. you can use otto bus comunications between fragments, fragments-activities, services, etc. maybe, first time can little weird if have not used before powerful , easy use. can find library , tutorial here: http://square.github.io/otto/ an example. in adapter or have item click event cand send object bus. in bus invoque post method , pass object. (i recommended create singleton bus). the singleton bus provider. /** * canal de comunicacion */ public class busprovider { private static final bus rest_bus = new bus(threa

Google Doc - Public shareable link -

i have bunch of documents want determine public links. reading https://support.google.com/drive/answer/2494822?hl=en says can "anyone shareable link". however no matter cannot find option. links can ".... in organisation" need link can embed in iframe on site. can give me pointers. not obvious think fact in google apps environment preventing me getting need. if not see option, administrator has restricted sharing outside sources. need speak domain administrator either change these settings, or figure out alternative method of sharing document. your administrator can find in apps > google apps > drive > sharing settings in admin console. https://support.google.com/a/answer/60781?hl=en

asp.net mvc - need to call controller's action method into another class in c# mvc -

i have created 1 method in controller, need call method anther class , don't know how call it. my sample code :- public class reportcontroller : basecontroller { private readonly ipermissionservice _permissionservice; private readonly icompaniesservice _companyservice; public reportcontroller(ipermissionservice permissionservice, icompaniesservice companyservice) { this._permissionservice = permissionservice; this._companyservice = companyservice; } public void reporting() { // code } } public class home { public void execute() { //i need execute reporting method here } } i have tried many things call method in class method can't work. it's bad design way have code in controller have called in several places. create class in project or in external dll contains code , call class in contr

java - How to handle application/octet-stream contained in MULTIPART_FORM_DATA -

i trying implement rest endpoint able handle following post: -----------------------------6739772541706953700536795627 content-disposition: form-data; name="flowchunknumber" 1 -----------------------------6739772541706953700536795627 content-disposition: form-data; name="flowchunksize" 1048576 -----------------------------6739772541706953700536795627 content-disposition: form-data; name="flowcurrentchunksize" 1474992 -----------------------------6739772541706953700536795627 content-disposition: form-data; name="flowtotalsize" 1474992 -----------------------------6739772541706953700536795627 content-disposition: form-data; name="flowidentifier" 1474992-sam_0391jpg -----------------------------6739772541706953700536795627 content-disposition: form-data; name="flowfilename" sam_0391.jpg -----------------------------6739772541706953700536795627 content-disposition: form-data; name="flowrelativepath" sam_0391

android - Recyclerview ObjectAnimator -

i implemented animation item holder. however, when tried slide view , down, noticed view items animated , don't, it's random. there cause this? private static void transition(recyclerview.viewholder holder) { objectanimator animator = objectanimator.offloat(holder.itemview, "translationx", -150, 0); animator.setduration(500); animator.start(); } @override public void onbindviewholder(movieview holder, int position) { ......... ......... transition(holder); }

javascript - How to increase table inside images using html? -

i have created 1 table using html. table details : first row : inserted 1 image. second row : contents. again write 1 row.third row added.row content large , table automatically increase size first row image not increase. how increase image @ table content based? thanks, kumar r have try add css rule this? table img { width: 100%; height: auto; } maybe it's css problem.

c# - Match exact closest string with regex -

i have string: test. <div> <table style="color:blue;"><tbody><!--start space comments summary--> <tr><td colspan="2">space comments summary</td></tr> <tr><td style="min-width:200px;">area/room</td> <td style="max-width:300px;text-align:left;">comments</td> </tr><tr><td style="min-width:200px;">bathroom</td> <td style="max-width:300px;text-align:left;">some comment</td></tr> <!--end space comments summary--></tbody></table> <div> <table style="color:blue;"><tbody><!--start space summary--> <tr><td colspan="2">space summary</td></tr><tr> <td style="min-width:200px;">space</td> <td style="max-width:300px;text-align:right;">installed price</td></tr> <tr><td s

rdf - How to execute SPARQL Query (Call a service) Over extracted subgraph? -

Image
i have rdf graph several types of relations (relations same prefix , different prefixes also). need call service on graph filtering out relations. example: @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. @prefix mypref: <http://www.mypref.com/>. @prefix otherpref: <http://www.otherpref.com/>. mypref:1 mypref:label "1" ; mypref:solid mypref:2 ; mypref:dotted mypref:4 ; otherpref:dashed mypref:3 ; otherpref:dashed2 mypref:3 . mypref:2 mypref:label "2" ; mypref:solid mypref:3 . mypref:3 mypref:label "3" . mypref:4 mypref:label "4" ; mypref:dotted mypref:3 . i run service call on extracted sub-graph containing solid , dotted relations (in particular case, running service calculating shortest path between 1 3, want exclude direct links). i run service (over entire graph) this: prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. prefix mypref: <http:

html - How can I zoom into a picture and have it disappear using ng-click? -

i want click button , have background image zoom in , disappear; right have image disappearing when button clicked, cannot background image disappear after zooming in has occurred. you can hover and visibility here code: img { width: 300px; height: 300px; -webkit-transition: 6s; -o-transition: 6s; transition: 6s; } img:hover { width: 600px; height: 600px; visibility: hidden; } <!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>test</title> </head> <body> <img src="http://vignette2.wikia.nocookie.net/seccov/images/2/23/firefox-512-300x300.png/revision/latest?cb=20110314020706" alt="firefox" class="img"> </body> </html>

nullpointerexception - Hibernate null pointer(session) when having a lot of mapping classes -

when i'm inserting object generic dao class im getting null pointer in session, happen when have lot of mapping classes (i have 110 tables in db), if same test same code 10 mapping classes in package mappings/hibernate.cfg program works correctly , looks dao tries go faster hibernate session loading? (it's perfonmance problem?) in advance i'm wasting time solve this. this hibernate session: public class hibernatesession { private static final sessionfactory sessionfactory= buildsessionfactory(); private static session session; private static sessionfactory buildsessionfactory() { configuration configuration = new configuration(); configuration.configure(); serviceregistry serviceregistry = new standardserviceregistrybuilder() .applysettings(configuration.getproperties()).build(); sessionfactory sessionfactory = configuration.buildsessionfactory(serviceregistry); return sessionfactory; }

mule - logging from inside dataweave -

just use <xsl:message> inside xsl transformer , system.out.println for datamapper, have logging mechanism dataweave ? if not direct component, have other alternate mechanisms achieve logging inside dataweave ? in mule 3.8 can ,mule allows logging in dataweave %dw 1.0 %output application/json --- { result: log("logging array",[1,2,3,4]) } you can refer latest document here

Issues with Network connectivity with Docker -

i facing issues configuring network in docker. details given below. host machine:- ubuntu server 14.04 lts 64-bit. ip subnet: 10.0.0.0/16, ip address: 10.0.0.206/16 , default gateway: 10.0.0.1/16. machine having docker installed (version 1.6.2 build 7c8fca2) , has default ip in docker0 bridge of 172.17.42.1/16. however, container has received ip 172.17.0.1. problems follows. my host machine , docker container able connect each other , internet other machines not able connect docker container. changing docker0 bridge ip temporary , reverts 172.17.42.1/16 once every reboot. i cannot set static ip address of container changes automatically @ every exit or if host rebooted. checked container's network config file /etc/network/interfaces doing changes in file has no effect eth0 interface. in short, not able connect container outer world (from other physical machines) when have configured networking interface of other machines connect docker host , container. how can fix

How to get installed certificates on a windows machine remotely with Python? -

i wish query remotely windows machines, , certificate store details (installed certificates names, expiry , thumbprints). i'm using python 2.7. how can done? didn't have luck pywin32 or wmi packages. sadly, easiest solution spwan powershell process , request data through invoke-command cmdlet: def run_powershell(scriptblock, cwd=os.getcwd()): log.debug("running powershell block:\r\n%s", scriptblock) log.debug("current directory: %s\r\n" % cwd) psproc = subprocess.popen([r'c:\windows\system32\windowspowershell\v1.0\powershell.exe', '-executionpolicy', 'bypass', '-noprofile', '-c', '-',], cwd=cwd, stdin=subprocess.pipe, stdout=subprocess.pipe, stderr=subprocess.

combinations - Batch - Find Out Permutation -

i new batch , know if can find out combinations of numbers in order. in case have 49 numbers 1 - 49 , , have pick 6 numbers results. for example: 1 2 3 4 5 6 1 2 3 4 5 7 ... 1 2 3 4 5 49 1 2 3 4 6 7 1 2 3 4 6 8 etc... this old code: @echo off > newfile & setlocal enabledelayedexpansion set a=44 set b=45 set c=46 set d=47 set e=48 set f=49 /l %%a in (1 1 !a!) ( /l %%b in (2 1 !b!) ( /l %%c in (3 1 !c!) ( /l %%d in (4 1 !d!) ( /l %%e in (5 1 !e!) ( /l %%f in (6 1 !f!) ( echo.%%a %%b %%c %%d %%e %%f ))))))) >> newfile goto :eof however returns: 1 2 3 4 5 6 1 2 3 4 5 7 ... 1 2 3 4 5 49 1 2 3 4 6 6 two 6's appeared. i don't seem able fix it, please help, much! when post question should post efforts solve it, describe method used , problems had; otherwise may similar answers no explanations @ all, one: edit : users dbenham , aschipfl indicated, original code have small bug: set /a i=m-1 line should placed after :nextset label. r

networking - What is the difference between end to end latency and network latency -

i have seen results in research paper compares 2 networks. network has end end latency in comparison network b. on other hand network latency of network b in comparison network a. what can difference between two? what mathematical relation between two?

html - In jQuery UI, why doesn't .ui-state-default apply to .ui-icon? -

Image
i've been trying theme jquery ui theme roller. think have found bug. if change icon colour clickable: default state not applying accordion icons or framework icons. bug in jquery ui or bug in themeroller? set icon colour black ( #000000 ) in clickable: default state icon in accordion not black icon in framework icons not black in dom can see <span class="ui-icon"> has parent div class ui-state-default not styled correct colour specified in theme roller

php - Use slash in config.yml variable -

i'm trying set variable in config.yml of 8p guzzle bundle ( https://github.com/8p/guzzlebundle ) this: guzzle: clients: identity_api: base_url: "%some.url%:5000/v2.0" and doing typical get: $client = $this->container->get('guzzle.client.identity_api'); $response = $client->get('/users') but receiving error telling me url requested is: http://somedomain.com:5000/users i think slash , i'm trying scape backslash nothing. my mistake, following http://docs.guzzlephp.org/en/latest/quickstart.html#making-a-request base_uri uri result http://foo.com /bar http://foo.com/bar http://foo.com/foo /bar http://foo.com/bar http://foo.com/foo bar http://foo.com/bar http://foo.com/foo/ bar http://foo.com/foo/bar http://foo.com http://baz.com http://baz.com http://foo.com/?bar bar http://foo.com/bar i have remove sl

javascript - How to call a action method from Jquery? -

i have action method returns stringbuilder object has html table output. output fired tab click(having n number of tabs, on tab click name of tab passed jquery function). please find below code <li onclick="binddata1(this.id);" id="tab1"> <a href="#tabs-2">text</a></li> code: function binddata1(techname) { $.ajax({ url: '@url.action("actionmethod", "controller")', data: { id: techname } }).done(function() { if (data != undefined) { //bind page } else alert('error'); }); } function binddata1(techname) { $.ajax({ type: "post", url: '/controllername/actionmethodname', data: { 'techname': "techname" }, success: function (data) { if(data.success) { $("#contentwrapper&qu

ajax - Angular2 routing, how to avoid errors while data is loading -

i have route: @routeconfig ([ {path: '/dn/', name: 'details', component: detailscomponent} ]) detailscomponent loads data in ngoninit method. data shown in components template constructs like {{data.prop1.prop2}} but long data not loaded, errors because data.prop1.prop2 not yet exist. what preferred way in angular2 solve problem? with <span *ngif="data">{{data.prop1.prop2}}</span> or asyncroute, or setting template dynamically? you can use elvis operator {{data?.prop1?.prop2}} this way angular doesn't try evaluate prop1 until data has value != null .

magento - Varnish as a Proxy for Nginx on port 443 -

i have nginx , varnish working fine on server. varnish listening port 80 , nginx 8080. however, had run whole website on ssl 443 (i'm using magento). i trying create proxy , make 443 request go varnish using config https://gist.github.com/medinadato/572e931796ec8e38939db25fe73b0552 . please note lines 1-4 set varnish , 27 (location / {) redirect requests. the problem set infinite loop happens when nginx tries redirect request. i've tried fix on lines 93-97 , 37 it's still happening. any appreciated. it's hard happening without seeing varnish vcl. 1 thing try remove in nginx config line 43 downward. run either varnishlog , or varnishncsa verify varnish server in fact receiving request nginx.

Create a Url and redirect to the url in Asp.Net MVC -

i have notification controller saves data in table public void enterdata() { notification notify = new notification(); notify.url = "../controller/action/1?dataid=2" db.notification.add(notify); db.savechanges(); } after saving data, have go page when user clicks notification. public actionresult message(id) { notification notify = db.notification.find(id); . . return redirect(notify.url); } it works in pages, pages redirection makes error. in advance. you can use redirecttoaction like return redirecttoaction("action","controller", new routevaluedictionary( new {parametername = value} ) );

sending ios voip notification using java-apns(notnoop) -

i trying implement voip notification server using java. tried javapns , java-apns .the problems facing are: 1.with javapns able send voip notification unable receive on device. push.alert(message,"path/to/voip_certificate_p12.p12", "password",true,"voip_device_id"); 2.with java-apns( notnoop )library unable compile code. i getting error: not initialize class com.notnoop.apns.internal.utilities tried different java-apns jar versions , slf4j jar versions, getting same error. have gone through post regarding issue not resolve issue. any great. there library implements push-kit framework in java? i figured out send voip notifications voip application on ios. able achieve desired result javapns library. here list of things 1 needs do: get knowledge of type of certificates need , have.if there doubt certificate please clear there , only. once done #1. double check :p(looks funny highly recommended.50% of problems caused wrong certifi

javascript - How to bind HTML component with ng-repeat based on a pre-defined condition -

i new angularjs. have made html component reused across whole app. let's component gives out basic info of product. basic structure of html below: <div class="visible-sm-block"> <div class="row"> <div class="col-sm-2"> <img class="img-circle img-responsive" alt="image of product" ng-src="{{}}"/> </div> <div class="col-sm-10"> <label>{{productname}}</label> <p>{{companyname}}</p> <p>{{shippedto}}</p> </div> </div> </div> the product.js file goes as: (function() { 'use strict'; angular .module('product') .directive('productdetails', productdetails); /** @nginject */ function productdetails() { var directive = { restrict: 'e',

authentication - NPM install git repo fails because it uses my mac username instead of 'git' -

i'm trying install private repo, i'm running: npm git+ssh://git.remoterepo.net/somerepo.git i have ssh key @ ~/.ssh/id_rsa has no passphrase , it's configured @ remote git repo (gitlab). however each time prompts me: [mac_user]@git.remoterepo.net's password: it should using git@git.remoterepo.net (git username). if ssh git username can log in: ssh git@git.remoterepo.net but if ssh [mac_user]@git.remoterepo.net prompts me password , can't. i've tried npm git@git+ssh://git.remoterepo.net/somerepo.git still uses wrong username.. how can make npm install use git username instead of mac login one? i've tried https no luck (hangs or gives 401 unauthorized). thanks! try using npm git+ssh://git@git.remoterepo.net/somerepo.git. search git@ in https://docs.npmjs.com/cli/install

html - It's possible to change the order of bootstrap col div in responsive? -

i have 3 col-md-4(1) col-md-4(2) col-md-4(3) in col-md-12 . in mobile or tablet. want show middle col-md-4(2) first , col-md-4(1) col-md-4(3) . how respect bootstrap? <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mtjoasx8j1au+a5wdvnpi2lkffwweaa8hdddjzlplegxhjvme1fgjwpgmkzs7" crossorigin="anonymous"> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0msbjdehialfmubbqp6a4qrprq5ovfw37prr3j5elqxss1yvqotnepnhvp9aj7xs" crossorigin="anonymous"></script> <div class="container"> <div class="row"> <div class="col-md-12"> <div class="col-md-4"> <p>abcd</p> </div> <div class="col-md-4"> <p>xyzs</p> </

UIAccessibility on subview of UIWINDOW -

hi have added viewcontroller view uiwindows below [[[uiapplication sharedapplication] keywindow] addsubview:self.myviewcontroller.view]; but myviewcontroller view uiaccessibility not working. getting whatever backside of window. i figured solution, should add subview on topmost window. uiwindow* window = [uiapplication sharedapplication].keywindow; if (!window) window = [[uiapplication sharedapplication].windows objectatindex:0]; [[[window subviews] objectatindex:0] addsubview:self.myviewcontroller.view];

Docker Best Practises: at what size application should you refrain from containerising? -

in ongoing quest containerize things, i've played , installed pretty hefty images. not crazy jessie frazelle does, still. i have 1 1.8 gb in size @ hit me whether may heading anti-pattern territory. mean, end? dockerize entire suite of oracle products?! is there advisory, guideline, best practise guide, states @ point should stick old servers, vms or similar? i ran across blog said sql database servers pretty 1 it's not worth it: nature not immutable , you're looking @ lots of mapped volumes anyway. naturally can't find blog anymore. :( at 1 point ran entire suite of atlassian products ( bitbucket, jira, confluence, bamboo ) in containers, massive docker run command lines mappings , environments settings in. stopped doing when couldn't see advantage. is there rule of thumb? simple formula encompasses, say, immutability , size arrive @ "ok containerise/don't containerise" table?

javascript - how to hide moz scrollbar in dropdown menu -

.no-scroll::-webkit-scrollbar {display:none;} /* safari */ .no-scroll::-moz-scrollbars {display:none;} .no-scroll::-o-scrollbar {display:none;} /* opera */ .no-scroll::-google-ms-scrollbar {display:none;} .no-scroll::-khtml-scrollbar {display:none;} i have ul , li tags drop-down , ul have max-height:400px , after display horizontal scrollbar. want scroll effect not scrollbar. i have success in chrome in mozila not works properly can me please ... one way using div cover scrollbar. add div same background-color container, , place on top of scrollbar. suggest using javascript or preferably jquery position div , remember make 2 elements overlapping; can done setting both of positions absolute instance (and container's position relative). here's quick example: https://jsfiddle.net/jffe4sy3/1/ it's not pretty or generic, works in cases. html: <select id="select_id" class="select" size="5"> <option value="

javascript - Adding console.log to every function automatically -

is there way make function output console.log statement when it's called registering global hook somewhere (that is, without modifying actual function itself) or via other means? here's way augment functions in global namespace function of choice: function augment(withfn) { var name, fn; (name in window) { fn = window[name]; if (typeof fn === 'function') { window[name] = (function(name, fn) { var args = arguments; return function() { withfn.apply(this, args); return fn.apply(this, arguments); } })(name, fn); } } } augment(function(name, fn) { console.log("calling " + name); }); one down side no functions created after calling augment have additional behavior.

java - web.xml - multiple exceptions are not handled -

i have code in web.xml <error-page> <exception-type>java.lang.nosuchmethodexception</exception-type> <location>/jsp/errors/nosuchmethodexception.jsp</location> </error-page> <error-page> <exception-type>java.lang.exception</exception-type> <location>/jsp/errors/error.jsp</location> </error-page> where supposed handle these exceptions separately java.lang.nosuchmethodexception error.jsp being returned. if remove java.lang.exception section works java.lang.nosuchmethodexception . i using jboss 7 as . it looks like, although web application prepared catch both exceptions, captures java.lang.exception first. as workaround, have tried define second error page (the generic one) 500 error code? it's same capturing exception , maybe work you...

php - Return data with no whitespace -

i using laravel 5.2. looking querying usernames eloquent in order create unique profile page. issue having usernames returning white space e.g. john doe need return no white space johndoe or johndoe. thanks. public function show($username) { try { $user = str_replace(' ', '', user::wherename($username)->firstorfail()); dd($user); } catch(modelnotfoundexception $e) { return redirect()->action('homecontroller@index'); } } you can create function on user model returns name without spaces. so: public function getnamewithoutspaces() { return preg_replace('/\s+/', '', $this->name); } this way can name without spaces wherever needed without having use str_replace function time.

c# - Right width of wpf expander header -

Image
i've found solution of problem. width=”{binding relativesource={relativesource mode=findancestor, ancestortype=x:type expander}}, path=actualwidth}” but i've got not correct width. (the width of toggle button not taken consideration) there solutions in xaml this? <page x:class="restore.page1" 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:local="clr-namespace:restore" mc:ignorable="d" d:designheight="300" d:designwidth="300" title="page1"> <grid background="aliceblue" horizontalalignment="stretch"> <expander name="expander_name"> <e

xml - How to modify appointment with soap api in zimbra? -

im trying modify simple zimbra event though it's soap api, zimbra documentation not tell basic data required. i'm lost :[ actually im sending request body, , service.parse_error doesn't ... <modifyappointmentrequest id="1192-1191" ms="2616" rev="2616" comp="0"> <m su="test subject" l="10"> <e a="mail@mail.com" t="f" p="test user"/> <inv uid="_the_uid_" type="appt"> <comp name="test subject" loc="my location" allday="0" status="conf" fb="b" class="pub" transp="o" draft="1"> <at role="req" ptst="ac" rsvp="0" a="mail@mail.com" d="mail@mail.com"/> <s d="20160413t160000" tz="europe/paris"/> <

How to resolve issue starting Ruby on Rails server on Cloud9 ide? -

i'm trying start web server rails app on cloud9 ide workspace , i'm receiving error message: `require': cannot load such file -- rack/handler/server (loaderror) this code running: rails s -p $port -b $ip server i'm new ruby on rails apologies if pretty simple. you're running $ rails s -p $port -b $ip server when should be $ rails s -p $port -b $ip you added extraneous server because you're used running rails server , rails s shorthand former. it looks argument rails causing file named server in rack/handler , , when doesn't find file throws error.