Posts

Showing posts from February, 2015

php - How to create a Logout function in Processmaker 3.0 using the Rest API? -

i developing 1 rest api in process-maker 3.0. in user can login using password oauth2.0 authorization. we access token , oauthcredential.json automatically updated. when user logged in credentials (client_id, client_secret, username , password) cookie sets. , directs rest endpoints suggesting in link: http://wiki.processmaker.com/3.0/calling_rest_endpoints when cookies not set or cleared should redirect login page or when user click on logout button redirect login page. code login page '<html><head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <form action="check_login.php" method="post"> client id<br> <input type="text" name="client_id" value="" width=32 /><br> client secret<br&g

node.js - How to set ttl for aerospike record ttl through NodeJS Client -

i using nodejs client aerospike, , trying set ttl record, below code same. insert(key, value) { return new promise(function (resolve, reject) { aerospike.put(key, value, function (err) { if (err.code !== aerospikestatus.aerospike_ok) { reject("failed insert in secondary storage"); } else { resolve(true); } }); }); } i following official documentation, unable find way set ttl through nodejs client. happen know how same? ( http://www.aerospike.com/docs/client/nodejs/usage/kvs/write.html ) actually, there 4 parameters of put function, (key, record, metadata, policy). can see example here . following simple code show how set ttl: var key = new aerospike.key(ns, set, "ask") var rec = { as_bin: 'bin-content' } var meta = { ttl: 1000 } var policy = { key: aerospike.policy.key.send } client.put(key, rec, meta

linux - could not insert module after kernel upgrade in VM -

i running win7 host , ubuntu14.04 vm, on virtualbox upgraded vm kernel. thereafter, after compiling kernel module again against new kernel, not able insmoding it. it gives following error : vm@vm:~/documents/kerneldev/customsockets$ sudo insmod customsocket.ko insmod: error: not insert module customsocket.ko: invalid module format i dont see eror message in dmesg logs. i make sure compiling module against correct kernel running. vm@vm:/lib/modules/3.12.59uml$ pwd /lib/modules/3.12.59uml makefile compile module: obj-m += customsocket.o all: make -c /lib/modules/3.12.59uml/build m=$(pwd) modules clean: make -c /lib/modules/3.12.59uml/build m=$(pwd) clean can pls me out here ? my bad, compiling against wrong kernel version headers. issue has been resolved.

ios - Creating Thumbnail from Video - Improving Speed Performance via MPMoviePlayerController -

this code using. want generate thumbnail after create video via these thumbnail drawing done on "drawimage" uiimageview. while([self.thunbnailarray count]) { id times = [self.thunbnailarray objectatindex:0];////self.thumbnailarray contains duratin of player @ thumbnail generate////// [self.thunbnailarray removeobjectatindex:0]; uiimage* thumbnail = [player1 thumbnailimageattime:[times floatvalue] timeoption:mpmovietimeoptionexact]; uigraphicsbeginimagecontext(drawimage.frame.size);////drawimage uiimageview make drawing [drawimage.layer renderincontext:uigraphicsgetcurrentcontext()]; uiimage *viewimage = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); cgimageref firstimageref = thumbnail.cgimage;/////merge thumbnail , drawing both cgfloat firstwidth = cgimagegetwidth(firstimageref); cgfloat firstheight = cgimagegetheight(firstimageref); c

html - Bootstrap navbar with element on right and left side beside menu icon -

i'm trying build navbar bootstrap. navbar should have 2 elements: close-icon on left side of bar label element on right side of bar, should placed left menu-icon (which shown on small devices). if there no menu-icon, label element should on right side of bar this tried far: jsfiddle : http://jsfiddle.net/0jejx693/1/ <nav class="navbar navbar-default"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span>

How to create a global variable in javascript (using webpack) -

i'm using react js webpack, webpack-dev-server , ecmascript 6. have undeclared variable in file named data.js. however, cannot modify data.js file since standard. there way can make variable global js file? tried declaring window.myvarname in file data.js referenced using import statement still giving error uncaught referenceerror: myvarname not defined define object in file below var data={ myvarname:"" }; and call want data.myvarname;

How to get values from GridView in jQuery Dialog in C# -

there jquery dialog gridview inside in aspx page. have button save on jquery dialog . need values in gridview after click on button in c# . have tried below. not worked. changed value in textbox , click save button. not gave me edited value. nothing returned. aspx page <asp:content id="content1" contentplaceholderid="headcontent" runat="server"> /* java scripts , style sheets here */ <script type="text/javascript"> function showdialog() { $('#dialogdiv').dialog('open'); } $(document).ready(function () { $('#dialogdiv').dialog({ autoopen: false, resizable: true, width: 300, height: 'auto', buttons: { "save": function () { $('#' + '<%= btnsavetype.clientid %>').trigger("click

excel - Issue with Using Contents of Cell Relative to Active Cell as a Condition in a Custom If Function -

i attempting create first user defined function in excel visual basic editor. using excel 2011 on macbook pro 2011 os x el capitan version 10.11.1 i working on creating workbook use functions figure results barrel race in 4 division format. divisions follows: the first division or "1d" fastest times 0.499 seconds off of fastest time. the second division or "2d" next fastest times between 0.5 , 0.999 seconds off of fastest time. the third division or "3d" times between 1 second , 1.499 seconds off of fastest time. lastly, fourth division or "4d" times 1.5 or more seconds off of fastest time. this current code have figure these divisions: function div(pval) if pval = "z" div = "" elseif pval = 999 div = "dq" elseif pval > 100 div = "nt" elseif pval < (range("b2") + 0.5) div = "x1d" elseif activecell.offset(-1, 0) = "x1d" , pval < (range("b2")

c - Why sigchld_handler will get a SIGTSTP too? -

i making small shell program.i want suspend foreground program in sigtstp_handler .and sigchld_handler reap zombie .but when type ctrl z ,even if not have foreground program,the sigchld_handler still sigtstp. signal(sigint, sigint_handler); /* ctrl-c */ signal(sigtstp, sigtstp_handler); /* ctrl-z */ signal(sigchld, sigchld_handler); /* terminated or stopped child */ handler void sigchld_handler(int sig) { int status; pid_t pid; while ((pid = waitpid(-1, &status, wnohang | wuntraced)) > 0 ) { if (wifexited(status)) { /*checks if child terminated */ deletejob(jobs, pid); } if (wifsignaled(status)) { /*checks if child terminated signal not caught */ printf("job [%d] (%d) terminated signal %d\n", pid2jid(pid), pid, wtermsig(status)); deletejob(jobs,pid); } if (wifstopped(status)) { /*checks if child process caused return stopped */ g

Copying files based on file name in Matlab -

i want copy files 1 folder another, if filename begins letter 'w'. below script i've come far, it's not working. there 2 loops in script, because there files in 3 folders (i.e. subjects) , each of these folders has 4 subfolders, want scan through 'w*'-files. files should copied "folderx" "folderxnew". for n_subj = 1:3 cwd_all = { '/data/subject1/'; '/data/subject2'; 'data/subject3'; }; cwd = cwd_all{n_subj}; dirs{1}='folder1'; dirs{2}='folder2'; dirs{3}='folder3'; dirs{4}='folder4'; dirt{1}='folder1new'; dirt{2}='folder2new'; dirt{3}='folder3new'; dirt{4}='folder4new'; nses=1:4 dir = dirs{nses}; files = dir('w*'); copyfile(files, dirt{nses},'f'); end end can try loop: for nses=1:4 files = dir([dirs{nses} '\w*']); =1:length(fil

c# - Is it okay to reference a binary assembly instead of a DLL -

i've inherited legacy application 2 solutions. 1 solution windows forms(ui) application , other windows service. the windows service solution references user interface exe, implementation found existing in application. when running windows service receive following error: ...posting service main loop failed not load file or assembly 'xxx.xxx.xxx.xxx, version=1.0.0.0, culture=neutral, publickeytoken=abcc533bcb766348' or 1 of dependencies. attempt made load program incorrect format i tasked upgrading solution .net version 3.5 .net version 4.5, did successfully, yet reference causing me issues. can educate me on effects of referencing .exe binary c#. cannot change solution being referenced class library has user interface built using .net c# windows forms tools, it's output type 'windows application' any , assistance tremendously appreciated. thanks referencing exe assembly or dll assembly not make difference in .net, both assem

java - ListView getting populated with the same data twice? -

i have list view displays data based on text change.however same data displayed twice.for example if list contains single 'apple' list contain 2 apple's. i.e. same entry twice. this code :- private void showdocno(string response) { parseadvopen pao = new parseadvopen(response); pao.parsejson(); list<map<string, string>> dn_info = new arraylist<map<string, string>>(); map<string, string> dn_map; int counts = parseadvopen.adv_no.length; (int = 0; < counts; ++i) { dn_map = new hashmap<>(); dn_map.put("doc_no", parseadvopen.adv_no[i]); dn_map.put("date", parseadvopen.date[i]); dn_map.put("cust_name", parseadvopen.cust_name[i]); dn_map.put("cust_number", parseadvopen.cust_number[i]); dn_map.put("item_count", parseadvopen.item_count[i]); dn_map.put("total", parseadvopen.sum_total[i]); d

c++ - How do I access a custom type once it is passed to another object? -

i'm new c++ excuse me if use of terminology off. i'm writing app in openframeworks makes use of physics library called ofxmsaphysics. purposes, i've created custom class called "particle," inherits msaphysics particle3d class. here pass pointer custom object physics engine: particle * p = new particle(ofvec3f(gettokencoors(index))); physics.addparticle(p); in custom class have public member called collide set true when 1 particle collides another. this, override 1 of particle3d's virtual methods: void collidedwithparticle(particlet *other, ofvec3f collisionforce) { collide = true; } now i'd check see when 1 particle collides another. physics.getparticle(i) returns particle physics engine, 1 of type particle3d , , not of custom particle type. when loop through particles returned getparticle() , none of them contain "collide" variable. is there way access custom particles once added engine? please let me know if ca

actionscript 3 - Countdown timer in flash frames -

i have countdown timer in flash. timer shows time in dynamic text field mytimer instance name. app in flash have frames next , button user can go next or frame. timer code inserted in action panel directly in first frame. issue this: when click on next or button go other frames,the timer disappear moment in new frame (about 1 second last show timer)? how can fix this? start_bt.addeventlistener(mouseevent.mouse_down, starter); function starter(event:mouseevent):void { var timer:timer = new timer(1000,120); timer.addeventlistener(timerevent.timer, countdown); timer.start(); function countdown(event:timerevent) { var totalsecondsleft:number = 120 - timer.currentcount; if (totalsecondsleft==0) { gotoandstop(18); } mytimer.text = timeformat(totalsecondsleft); } function timeformat(seconds:int):string { var minutes:int; var sminutes:string; var sseconds:string; if (seconds > 59) { minutes = math.floor(seconds / 60);

angularjs - Set Multiple Role Angular js -

how set multiple role in angular.js $routeprovider config.$inject = ['$routeprovider']; function config($routeprovider) { $routeprovider.when('/dashboard', { templateurl: 'views/dashboard.html', controller: "dashboardctrl" }) .when("/readmyforms", { templateurl: "views/readmyforms.html", controller: "readmyforms", role: "admin" }) } i want set multiple role here role: "admin" , role: "manager" add constant service roles .constant('user_roles', { manager:'manager', admin:'admin' }); add data variable in $routeprovider , pass roles authorizedroles data: { authorizedroles: [user_roles.manager, user_roles.admin] } and use $routechangestart action know user allowed on login. hope helps.

c++ - convert Qimage to cvMat 64FC3 format -

i have searched lot on internet have found how convert qimage rgb format, want convert qimage cv mat format cv_64fc3. have bad results when work cv_8uc3 here code : qimage myimage; myimage.load("c://images//polarimage300915163358.bmp"); qlabel mylabel; mylabel.setpixmap(qpixmap::fromimage(myimage)); //mylabel.show(); cv::mat image1 = qimage2mat(myimage); mat img; image1.convertto(img, cv_64fc3, 1.0 / 255.0); and here function used : cv::mat qimage2mat(qimage const& src) { cv::mat tmp(src.height(),src.width(),cv_8uc3,(uchar*)src.bits(),src.bytesperline()); cv::mat result; // deep copy in case (my lack of knowledge open cv) cvtcolor(tmp, result,cv_bgr2rgb); return result; } please me m new both opencv , qt not sure mean bad results, assuming qimage loads image opencv ( bgr ). in documentation tells use argb . so, knowing have 2 options: convert qimage::format_rgb888 qimage using function converttoformat , line cvtc

excel - Export SQL QueryResult to Excell file on Server without installing Office -

i want write result rows of query excell file: insert openrowset('microsoft.ace.oledb.12.0', 'excel 12.0;database=c:\temp\testing.xlsx;', 'select id,companyname [sheet1$]') select id,companyname tbl_company but when running query following error occurs : msg 7302, level 16, state 1, line 3 cannot create instance of ole db provider "microsoft.ace.oledb.12.0" linked server "(null)". what done before running code : 1 - installed "2007 office system driver: data connectivity components" 2 - executed configuration script using excell : sp_configure 'show advanced options', 1; go reconfigure; go sp_configure 'ad hoc distributed queries', 1; go reconfigure; go 3 - change login account sql server service local account 4 - added full access permission on excell file folder local account 5 - restarted sql service but problem remains server : windows server 2008 ms office not installed on ser

cakephp - Want to add href link for each checkbox in cake php -

echo $this->form->input('name_group', array('multiple' => 'checkbox', 'options' => $val,'label' => false,'class' => 'col-lg-4 col-md-4 col-sm-4 col-xs-6 custom_no_padding custom_checkbox','selected' => $selected)); and want output below: <div class="col-lg-4 col-md-4 col-sm-4 col-xs-6 custom_no_padding custom_checkbox"> <input type="checkbox"> <label><a href="test1">value1</label> </div> <div class="col-lg-4 col-md-4 col-sm-4 col-xs-6 custom_no_padding custom_checkbox"> <input type="checkbox"><label><a href="test2">value2</label> </div>

gradle cannto find subproject of dependency -

i have following structure: ./mainproject/ -settings.gradle -build.gradle -subproject/ -build.gradle -/src/... ./libraryproject -settings.gradle -build.gradle -subproject_interfaces/ -build.gradle -src/... -subproject_impl/ -build.gradle -src/... libraryproject/settings.gralde: rootproject.name = 'library' include 'subproject_interfaces','subproject_impl' libraryproject/build.gradle dependencies { compile project(':subproject_interfaces') compile project(':subprojects_impl') } mainproject/settings.gradle include "library" project(':library').projectdir = new file(settingsdir,"../libraryproject") mainproject/subproject/build.gradle dependencies{ compile project(':library') } i can gradle build libraryproject fine. i can gradle build libraryproject via project dependency on mainproject fine. i cannot

sql server 2008 - How to join two tables to select all data with and without the condition in MsSQL -

i have 2 tables. table_sale s_date s_store s_item_id s_qty table_return r_date r_store r_item_id r_qty imagine table_sale have 1000 row , table_return have 250 rows.i want cindition. (s_date=r_date , s_store=r_store , s_item_id=r_item_id) think there 150 rows match condition. there 850 rows table_sale , 100 row in table_return not matching condition. want 150+100+850 data in 1 table. how can make join sir.?please me. you should use full outer join . this... select * table_sale full outer join table_return b on a.s_date = b.r_date , a.s_store = b.r_store , a.s_item_id = b.r_item_id

Batch : Echo Two parameters with space -

i working on batch scripting , facing problem while echo 2 variables. created file test.bat echo %2% echo "calling 2 paramters" echo - %1% %2% when calling, output comes: test.bat 1235 899 899 "calling 2 paramters" - `12352` now expected output must be: 1235 899 please help alter test.bat this: echo "calling 2 paramters" echo - %~1 and call this: test.bat "1235 899" subroutine , batch file arguments have % @ beginning. arguments delimiters need enclosed double quotes. %~1 tilda here used dequoting.

how to add animation to launch screen in iOS 9.3 using Objective c -

Image
how make animated splash screen below image in ios 9.3. basically - can't make animated splash screen. - can duplicate (launchscreen) in storyboard , make entrance vc of app. when view gets loaded - start animation. as final result have " animating splash screen ": app starts -> static launch screen -> transition entrance vc won't visible user because scenes same -> entrance vc view loaded animation. for sum up: treat launch screen's xib first frame of animation

scala - PartialFunction and MatchError -

there 2 ways define pf: 1) literal case {} syntax , 2) explicit class. need following function throw matcherror, in second case doesn't happen. 1) case val test: partialfunction[int, string] = { case x if x > 100 => x.tostring } 2) class val test = new partialfunction[int, string] { def isdefinedat(x: int) = x > 100 def apply(x: int) = x.tostring } should i, in seconds case, manually call isdefinedat , shouldn't called implicitly compiler? you have call isdefinedat manually in apply method: val test = new partialfunction[int, string] { def isdefinedat(x: int) = x > 100 def apply(x: int) = if(isdefinedat(x)) x.tostring else throw new matcherror(x) } if want avoid code, can use first way define partial function. syntactic sugar , result in valid definition of both isdefinedat , apply . described in scala language specification , first definition expand following: val test = new scala.partialfunction[int, string] { def appl

java - how to open excel file in eclipse internal editor -

i need open excel file project explorer in eclipse internal editor. calling below function open file in editor. public static void openfileintoeditor(string filepath) { file filetoopen = new file(filepath); if (filetoopen.exists() && filetoopen.isfile()) { try { ifilestore filestore = efs.getlocalfilesystem().getstore(filetoopen.touri()); iworkbenchpage page = guihandler.getpage(); try { ide.openinternaleditoronfilestore(page, filestore); //ide.openeditoronfilestore(page, filestore); } catch (partinitexception e) { system.out.println("erorr in openfileintoeditor : " + e.getmessage()); } } catch (exception e) { system.out.println("erorr in openfileintoeditor2 : " + e.getmessage()); } } else { } } it works fine text file shows binary code when trying open excel file in internal editor. doing wro

linux - Ubuntu - Notifications/alarm after end of job execution in terminal -

i work lot of simulations take sometime. in meantime, prefer spending time writing article or other jobs. have check periodically when simulation going end. since there lots of experts here, wanted ask best way notify when job execution done terminal. preferably visual notification (like popup)? superuser might more relevant question. example answer . the simplest way use notify-send : sleep 5 && notify-send 'done'

java - ConstraintValidatorContext to define custom error messages -

Image
i want create custom email validator using annotations. this solution useful while creating validator. here's annotation : @target({elementtype.method, elementtype.field, elementtype.annotation_type, elementtype.constructor, elementtype.parameter}) @retention(retentionpolicy.runtime) @constraint(validatedby = {commonsemailvalidator.class}) @documented @reportassingleviolation public @interface exemailvalidator { string message() default " {org.hibernate.validator.constraints.email.message}"; class<?>[] groups() default {}; class<? extends payload>[] payload() default {}; @target({elementtype.method, elementtype.field, elementtype.annotation_type, elementtype.constructor, elementtype.parameter}) @retention(retentionpolicy.runtime) @documented public @interface list { exemailvalidator[] value(); } } and here's class commonsemailvalidator : public class commonsemailvalidator implements constraintvalidator<ex

eclipse - simple webservices using php in android -

this question has answer here: networkonmainthreadexception 5 answers package com.example.simplewebservices; import java.io.ioexception; import org.apache.http.httpresponse; import org.apache.http.client.httpclient; import org.apache.http.client.methods.httppost; import org.apache.http.impl.client.defaulthttpclient; import org.apache.http.util.entityutils; import android.app.activity; import android.os.bundle; import android.view.menu; import android.view.menuitem; import android.widget.textview; public class mainactivity extends activity { @suppresswarnings("deprecation") @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); httpclient httpclient = new defaulthttpclient();

java - Tokenize a string using apache lucene -

how tokenize string based on patter? example. in following string arg1:aaa,bbb , arg2:ccc or arg3:ddd,eee,fff first want tokenize based on , and or so token set 1 arg1:aaa,bbb token set 2 arg2:ccc token set 3 arg3:ddd,eee,fff later want pass these individual token sets method , tokenize based on ":" token set 1 token 1 aaa token 2 bbb token set 2 token 1 ccc token set 3 token 1 ddd token 2 eee token 3 fff how tokenize using custom patter using lucene? to perform custom tokenization implementation, implement own tokenizer . primary method needs implemented tokenstream.incrementtoken() . your tokenizer can incorporated analyzer .

Error using Google App Engine cloudshell to upload Python app -

i'm trying use appcfg upload helloworld app on gcloud using gae. according google's own quickstarter site, syntax is: appcfg.py -a your_project_id_ -v v1 update helloworld/ so did: appcfg.py -a project_name_123456 -v v1 update c:/users/user/helloworld/ which makes error: "appcfg.py: error: not directory: c:/users/user/helloworld" what doing wrong? have app.yaml file in c:/users/user/helloworld, , i've tried lots of different things. thanks

javascript - Google Tag Manager not firing on link click in site footer? -

this first post - have searched answer in other questions couldn't find hoping can specific question? i'm trying track link that's sat in 'floating' bar in footer of this site : the link #browsealoud - when click on screen reader - upon clicking opens pop-up reads out text (to assist sight problems). i have set tag , trigger in google tag manager, , know works fine when insert below link code in body content, event tracked in google analytics. however, link sits in floating grey bar in footer, trigger doesn't fire , can't quite work out why. best solution allow me track link clicks on particular link (which appears on pages)? <a href="#browsealoud" onclick="browsealoud.togglebar(); return false;" class="dark-arrow" data-bapdf="80"><h6>screen reader</h6></a> it looks me though you've fixed this, think can see ga event firing whenever click. in case, think problem the

sql - Java equals() and hashcode() during automatic code generation -

i working on project code gets automatically generated based upon mysql library. jpa, not quite. this example bean: public class templatebean implements bean { private integer templateid; private integer businesspartnerid; public templatebean(final integer businesspartnerid) { this.businesspartnerid = businesspartnerid; } private templatebean(final object nullobject, final integer templateid, final integer businesspartnerid) { this.templateid = templateid; this.businesspartnerid = businesspartnerid; } public templatebean(final resultset rs) throws sqlexception { this(null, rs.getint(1), rs.getint(2)); } public integer gettemplateid() { return templateid; } public void settemplateid(final integer templateid) { this.templateid = templateid; } public integer getbusinesspartnerid() { return businesspartnerid; } public void setbusinesspartnerid(final integer bus

python - 'numpy.ndarray' object is not callable when retrieving matrix diagonal. -

i have 291*291 matrix , automatically retrieved values (0,1), (1,2), (2,3).... (n-1, n). there straightforward way using loops or function? the matrix cosine-similarity between texts in data base: bodies = [d['body'] d in data] tfidf = vectorizer.fit_transform(bodies) matrix =(tfidf * tfidf.t).a since want create vector, how attempting it: vector = [] in range(len(data) -1): vector.append(matrix(i, i+1)) but following error: typeerror: 'numpy.ndarray' object not callable any ideas of how fix it? as matrix square, can use numpy.diagonal offset of 1 acquire desired values mat.diagonal(offset = 1) the positive offset of 1 acquires diagonal 1 above matrix's main diagonal. mini demo : mat = numpy.ones((3,3)) mat[0,1] = 2 mat[1,2] = 3 print(mat.diagonal(offset = 1)) outputs: [ 2. 3.]

user controls - Adding resource dictionaries to a usercontrol library in wpf -

i have created user control class library , used resourcedictionary file in it. now, want use usercontrol in wpf application, have add resourcedictionary file again in projet! if don't add it, brings resourcedictionary file, , show error on mergedictionaries block! missing something!? resource dictionary is: <controltemplate x:key="movethumbtemplate" targettype="{x:type s:movethumb}"> <rectangle fill="transparent" cursor="hand"/> </controltemplate> <style x:key="itemstyle" targettype="contentcontrol"> <setter property="width" value="{binding relativesource={relativesource findancestor,ancestortype={x:type canvas}},path=actualwidth}"/> <setter property="minheight" value="60"/> <setter property="height" value="60"/> <setter property="content" value=&

php - How to find selected value of upper row of a table with jquery? -

Image
i have table this. , rows of table loop php. want option value of upper row when user click option value next row of table. mean is, if click option row number 3, want option value of row number 2. so, try this. $("select[name='service[]']").change(function(event){ console.log("row"+$("table[name='tbl_list'] tr:last").prev().index()); }); but row14 every row clicked. so, how can user selected option value of upper row when click option next row? use closest parent row , prev previous row $("select[name='service[]']").change(function(event) { var val = $(this).closest("tr").prev('tr').find("option:selected").val(); });

java - Reading file from unknown path -

the following code reads text file specific path. import java.io.*; public class game { static fileinputstream fin = null; static datainputstream din = null; static bufferedreader br = null; public void run() { fin = new fileinputstream("c:\\users\\user 1\\desktop\\project java\\players.txt"); din = new datainputstream(fin); br = new bufferedreader(new inputstreamreader(din)); ...} my problem want read players.txt file path, example if run program machine path not same. create config.properties file in class path , store path file in variable this pathtofile = c:\users\user 1\desktop\project java\ nameoffile = players.txt then, create config class , read properties file using properties class supplied oracle . create appropriate setters , getters of aforementioned 2 variables inside config class , read file this: import java.io.*; import packagename.config; public class game { static fileinputstream fin = null; static datainput

c# - Hosting WebHttp binded services in Castle WCF Facility -

i have wcf service, want host in castle wcf facility multiple bindings , 1 of them webhttp. have done same configuration described here specifying castle wcf integration facility endpoint behavior per endpoint . if register iendpointbehavior webhttpbehavior can guess bindings other webhttp fails. i'm not registering it. in way tcp binding works. webhttp binding, doing wrong? here code. string internalendpointaddress = "http://localhost:8899/dummyservice"; contractdescription description = contractdescription.getcontract(typeof(idummyservice)); // create webhttp binding webhttpbinding webhttpbinding = new webhttpbinding(); endpointaddress webendpointaddress = new endpointaddress(internalendpointaddress); serviceendpoint webendpoint = new serviceendpoint(description, webhttpbinding, webendpointaddress); webendpoint.behaviors.add(new webhttpbehavior()); //and here wcf registration. keep clean removed net tcp registration... container.addfacili

tsql - Comparing a time value with a value in ssis -

i use such expression in dereived column, remains red (it not accepted): (dt_dbtime) [datum] =="00:00:00" ? 1 : 2 (if time part of variable [datum] = "00:00:00" 1 else 2) you can't compare dt_dbtime , dt_wstr type. try cast data dt_wstr dt_dbtime type: (dt_dbtime) [datum] == (dt_dbtime)"00:00:00" ? 1 : 2

sql server - How can i get the list of all database name with their username and roles in t-sql? -

i'm trying list of database name username , roles. this: image here's code can dbname: select left(ltrim(rtrim(@@servername)), charindex('\', ltrim(rtrim(@@servername))) -1) servername ,convert(nvarchar,dec.local_net_address) ipadress ,suser_sname(owner_sid) 'localadmin' , db.name dbname sys.dm_exec_connections dec cross join sys.databases db dec.session_id = @@spid , suser_sname(owner_sid) <> 'sa' you can use this: declare @db_users table ( dbname sysname ,username sysname ,logintype sysname ,associatedrole varchar(max) ,create_date datetime ,modify_date datetime ) insert @db_users exec sp_msforeachdb ' use [?] select ''?'' db_name, case prin.name when ''dbo'' prin.name + '' (''+ (select suser_sname(owner_sid) master.sys.databases name =''?'') + '')'' else prin.name end username, prin.type_desc

ScrollView doesn't show the upper part of XML in android -

Image
my xml working perfectly, has listview, set of textviews, imageviews , buttons. added scroll view entire layout. listview stopped functioning , added custom class in order t o make work. working intended, issue top part of layout not visible when xml loads, have scroll see top part of it. issue same still provided solutions don't work: scrollview doesn't show top part xml file: <?xml version="1.0" encoding="utf-8"?> <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <relativelayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/bg_default" android:orientation="vertical" > <linearlayout android:id="@+id/navigation_layout" android:

html - Favicon issue in browsers -

i have favicon <link rel="icon" href="favicon.ico" /> its in root of project. problem when ran first time, gave icon in project correctly when ran again checking changes in ie compatibility, not find icon. ran before in ff , chrome, had issue in ie. tried using <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> but didnt work. try code works me in ie well. <link rel="shortcut icon" href="favicon.ico" />

how does the meteor-accounts oauth workflow happen -

i'm trying use accounts-facebook ionic cli . i'm using client side bundler script can't entire oauth workflow complete. i set standard account-facebook config meteor-angular-socially project , discovered i'm getting stuck @ oauth redirect uri. following method never called in client-side bundle // in script: oauth/oauth_client.js // called popup when oauth flow completed, right before // popup closes. oauth._handlecredentialsecret = function (credentialtoken, secret) { check(credentialtoken, string); check(secret, string); if (! _.has(credentialsecrets,credentialtoken)) { credentialsecrets[credentialtoken] = secret; } else { throw new error("duplicate credential token oauth login"); } }; i following redirect url oauth should load page # http://localhost:3000/_oauth/facebook/?code=[...]&state=[...] <!doctype html> <html> <body> <p id="completedtext" style="display:none;">