Posts

Showing posts from July, 2011

jBPM 6 How to asign process definition to specific users or groups -

i need separate process definitions users , groups example: financial users can start payingprocess. in business-central -> process definitions. can see definitions. maybe little thing i'm stacked hours. this feature available on master branch , available in jbpm 6.1, using deployment descriptor. allow specify role(s) should able use process.

Is it possible to generate a unique BlobOutput name from an Azure WebJobs QueueInput item? -

i have continuous azure webjob running off of queueinput , generating report, , outputting file bloboutput . job run differing sets of data, each requiring unique output file. (the number of inputs guaranteed scale on time, cannot write single job per input.) able run off of queueinput , cannot find way set output based on queueinput value, or value except blob input name. as example, want do, though invalid code , fail. public static void job([queueinput("inputqueue")] inputitem input, [bloboutput("fileoutput/{input.name}")] stream output) { //job work here } i know similar if used blobinput instead of queueinput , prefer use queue job. missing or generating unique output queueinput not possible? there 2 alternatives: use ibinder generate blob name. shown in these samples have autogenerated in queue message object , bind blob name property. see here (the blobnamefromqueuemessage method) how bind queue message property blob name ...

javascript - Meteor: Best Method for Passing Mongo Selector from Client to Server -

i have mongo collection following (foo(x) == keys; bars == values): edit- come relational database background. collection doesn't below, idea... +--------+--------+--------+ | foo1 | foo2 | foo3 | +--------+--------+--------+ | barbar | barbar | bar | | bar | bar | barbar | | bar | barbar | barbar | | ... | ... | ... | it's important me allow client filter data. sometimes, columns have filter, other times no columns have filter , anywhere in between. currently, i'm handling issue follows: client var afoo1filter = ["bar"] var afoo2filter = ["barbar", "barbar"] var afoo3filter = ["barbar", "bar"] //where user can affect array through other code server meteor.publish("foos", function (afoo1filter, afoo2filter, afoo3filter ) { return foocl.find({foo1: {$in: afoo1filter}, foo2: {$in: afoo2filter}, foo3: {$in: afoo3filter}}, ...

How to make call to DLL function from Delphi? -

// list of accounts in domain separated \x00 , ended \x00\x00 function getuserlist(aname: pansichar; var list; size: longint): longint; stdcall; i need call above xe6. would kind enough post example of how can buffer, , put stream or string. the variable "list" supposed fill buffer, can read off list of users. after trying couple of options, have tried options such as: thanks! var buffer: array of byte; icount : integer; sname : ansistring; begin ... setlength(buffer, 4096); icount := getuserlisttest(pansichar(sname)@buffer[0], length(buffer)); // cannot // icount := getuserlist(pansichar(sname), buffer, length(buffer)); that not win32 api function, must third-party function. ask vendor example. a var parameter expects pass variable it. var receives address of variable. @buffer[0] not satisfy requirement, @ returns pointer, , var ends address of pointer itself, not address of variable being pointed at. function expecting point...

sql - PLSQL SELECT INTO FROM parameter -

i created function should return max id table(parameter) create or replace function getmaxid ( p_table in varchar2 ) return number v_maxid number(38); begin select max(id) v_maxid p_table; return v_maxid; end getmaxid however, keep getting error message " ora-00942: table or view not exist " on line: select max(id) v_maxid p_table; like explained earlier, need use dynamic sql perform operation. in case, p_table variable. solution build string contain sql , dynamically execute 1 you've build query. the example below uses, dual, table name arbitrary. here you're looking for, take function outside of block, left can test it.. declare function getmaxid (p_table in varchar2) return number v_maxid number (38); v_select varchar2 (200); cnt sys_refcursor; begin v_select := 'select count(*) ' || p_table; dbms_output.put_line (v_select); execute immediate v_select v_maxid; ...

jdbc - java program not getting inside while loop for unique row result set -

i have result set should contain 1 row (i have tested this). program not getting inside while(rs2.next()) loop, have noticed after debugging. that's why i'm getting sqlexception : not variables bound. resultset constitues = cnx.createstatement().executequery(request.getconstitues()); while(constitues.next()){ preparedstatement ps = cnx.preparestatement(request.setnewconstitue()); preparedstatement ps2 = cnx.preparestatement(request.getdossierfromnumeroparcelle()); ps2.setint(1, constitues.getint("num_ordre")); ps2.setint(2, constitues.getint("num_parcelle")); //rs2 contains 1 row resultset rs2 = ps2.executequery(); // program not entering loop while(rs2.next()){ ps.setint(1, rs2.getint("num_dossier")); ps.setstring(2, rs2.getstring("indice...

ios - newsstand app without subscriptions -

back in ios 5 days newsstand-apps needed have subscription option. if app offers free issues, there had @ least free subscription. after downloading bunch of apps ios app store (newsstand section), many of them don't include option subscribe. apple accept newsstand-apps don't offer subscriptions? i can't find hints in documentation handle topic? anybody knows whats current state of "issue" ? yes. there lot of newsstand not require subscription. same topic discussed here . can tutorial develop free newsstand app here . hope helps. thanks.

css - box-align not working in Chrome or Firefox -

Image
i'm trying set box-align either start or baseline columns resize way want, won't stretch same height, isn't working in chrome of firefox reason. works fine in ie11. demo (shrink page less 1280px see take effect): http://www.weblinxinc.com/beta/hf-racquet-fitness-club/demo/site/internal.htm result in ie11: result in chrome: after consulting w3c's documentation, discovered there's property align-items , solved problem: -webkit-flex-align: baseline; -webkit-align-items: baseline; -ms-flex-align: baseline; align-items: baseline;

How to install Ghost inside an existing node.js application on Azure? -

Image
can install ghost ( http://ghost.org ) runs inside existing node.js express application (like this: {my domain}/blog)? i'm using azure websites host site. please note: prefer generic solution can run on platform... thought mention it's on azure in case provides simple way this. yes can that. you need to: 1. add new blog application basically go portal -> configure tab -> scroll way bottom , add this 2. configure ghost run on sub folder publish ghost whichever folder mapped application in step above. can use ftp, webdeploy or scm ( https://<yousitename>.scm.azurewebsites.net/debugconsole that's choose , folder layout looks igonre deployments folder, it's not related this in config.js ghost, under production environment node make sure have url production: { url: 'http://<yoursitename>.azurewebsites.net/blog', mail: { ...... } } 3. fix main site's web.config g...

html - Appyling btn-link attribute to <a> in Bootstrap w/ focus -

i seem having problems applying btn-link attribute link bootstrap. according docs, button styles can applied button class. if have like: <a class="btn btn-link selected" name="test" href="#">test</a> it should apply btn-link style respective link. seems work fine except "focus" attribute. if @ examples on bootstrap page here , clicking on button btn-link class results in blue box appearing border. above html, not seem case. i can show blue border forcing element state "focus" chrome dev-tools, cannot replicate other way. using selector , applying .focus() doesn't seem work. thoughts?

javascript - Google Analytics Event tracking setup -

can me write proper ga setup following html code? i"m trying track downloads of media kit , capabilities (both pdf's) i'm running analytics.js , it's pretty connfusing me unfortunately. here code. <div class="row"> <div class="twelve columns"> <div class="tabs-content-container"> <div class="eight columns"> <img src="img/brochure.jpg" alt="blog" style="padding-bottom: 10px;"> </div> <div class="four columns"> <h3>download company overview</h3> <p>thank taking time learn more our company. additional information in these brochures tell more our history, products , references.</p> <p>our printable company overview brochure available download. both documents require <a target="_blank" href=...

scala - How to write JSON Reads for models without a matching constructor signature? -

i have following json object: {"values": "123,456,789"} i'd convert json object instance of class foo following signature, using json library of play framework: case class foo(value1: double, value2: double, value3: double) in documentation json combinators , there examples conversions constructor signature of class matches extracted json values. if had such case, i'd have write following reads function: import play.api.libs.json._ import play.api.libs.functional.syntax._ implicit val fooreads: reads[foo] = ( (jspath \ "values").read[string] )(foo.apply _) however, first have split string "123,456,789" to 3 separate strings, , convert each of them double values before can create instance of class foo . how can json combinators? not able find examples that. trying pass in function literal argument not work: // not work implicit val fooreads: reads[foo] = ( (jspath \ "values").read[string] )((values: strin...

javascript - The name <js_variable> does not exist in the current context -

i have following model set there list<string> trying add value to: public class newshipmentmodel { ... public list<string> units_selected { get; set; } public newshipmentmodel() { units_selected = new list<string>(); } } in view, have eventlistener set on checkbox trying take value of checkbox , either add or remove list using javascript , razor: (var = 0; < unitcheckboxes.length; i++) { unitcheckboxes[i].addeventlistener("change", function () { var addition = 0; var unit_serial = this.value; var curr_val = (this.name == "base") ? parseint($("#total-bases-selected").text()) : parseint($("#total-clients-selected").text()); if (this.checked) { addition = 1; @model.units_selected.add(unit_serial); // error here } else { addition = -1; @model.units_sele...

c# - How to Convert DataLoadOptions to human readable string? -

i'm trying debug faulting process. error occurs when our linq sql data context has loadoptions updated. there way convert value of dataloadoptions object human readable text? here's error message: exception (invalidoperationexception): setting load options not allowed after results have been returned query. inner exception: stacktrace: @ system.data.linq.datacontext.set_loadoptions(dataloadoptions value) here's code: if (loadoptions != null) { try { domain.loadoptions = loadoptions; } catch (exception ex) { // log , continue logmanager.save(log.types.error, ex); logmanager.save(log.types.warning, "error setting datacontext loadoptions, related data may not loaded."); } } the method code above called other places, may pass in dataloadoption object. if present, dataloadoption object's loadwith method have been called @ least once, , possibly associatewith method. to assist deb...

matrix - Matlab: subtract vectors in a 3D array by a list of vectors -

i have n groups, each group has m vectors of dimension d. these represented d*m*n matrix a. i have n vectors of dimension d, represented d*n matrix b. now subtract m vectors in group corresponding vector in b (and = 1,...,n). this can done like: c = zeros(size(a)); = 1:n j = 1:m c(:,j,i) = a(:,j,i) - b(:,i); end end however, quite slow because of loop. please suggest me fast way that? thank in advance help. perfect case bsxfun - c = bsxfun(@minus,a,permute(b,[1 3 2]))

linux - Expect/TCL simple proc/variable issue -

i have expect script works have attempted remove duplicate code , use proc string passed proc not seem getting used. as first exposure tcl/expect basic variable passing/usage. i had (worked): expect { "condition" {} timeout { various cleanup operations; send_user "a message"; exit 1 } } and changed (broken): proc exit_on_error {message} { various cleanup operations send_user "$message" exit 1 } expect { "condition" {} timeout { exit_on_error "a message" } } it cleanup operations , exits send_user seems have empty string send_user $message complains wrong number of arguments. bash expanding $message variable in here-doc before sending doc expect. if not rely on using shell variables in expect script, single quote here-doc: expect <<-'done' otherwise, choose 1 of these options protect tcl variable expansio...

android - Osmdroid MylocationNewOverlay - setting the location update frequency -

is there way set location update frequency? , minimum distance? reason: set in relation battery savings. you can create own instance of gpsmylocationprovider , set parameters. gpsmylocationprovider gpslocationprovider = new gpsmylocationprovider(context); gpslocationprovider.setlocationupdatemintime(...); gpslocationprovider.setlocationupdatemindistance(...); mmylocationnewoverlay.enablemylocation(gpslocationprovider);

ruby - How do I set up user authentication using devise and Rails 4? -

i'm trying user authentication devise working, , failing. i tried following steps in railsgirls article , after creating simple new project, adding gem 'devise' , running bundle install , when run rails generate devise:install screenful of errors starting error:get available generators script executes errors: error:c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/active_record/dynamic_matchers.rb:26:in `method_missing': undefined method `devise' user (call 'user.connection' establish connection):class (nomethoderror) has idea might doing wrong? (i tried using instructions in devise wiki, couldn't working way either). i ran same problem today, it's because tried generate model before tried install devise self stash ( or remove ) changes user model , migration file, run this rails generate devise:install after unstash , apply migration, should work fine.

python - ipython notebook and psycopg2 don't work together -

i new using mac os, maybe thats why got such troubles. so firstly found out problem running ipython notebook , solved 2 commands in shell (thx stackoverflow): export lc_all=en_us.utf-8 export lang=en_us.utf-8 now after 2 commands can run ipython notebook. then tried download psycopg2 , after 6 hours found out solution of problem installing package (again thx stackoverflow): export dyld_library_path=/applications/postgres.app/contents/versions/9.3/lib but got new problem: ipython notebook doesn't run in browser after dyl_lybrary_path , can't use both solutions @ same time. guys, please recommend me cure, don't know how manage ....:( thanks! p.s. way in terminal psycopg2 works correctly, problem make work in browser importerror traceback (most recent call last) <ipython-input-1-bd284aa2cf56> in <module>() ----> 1 import psycopg2 /users/kb/anaconda/lib/python2.7/site-packages/psycopg2/__init__.py in <modu...

c++ - User-declared namespace member -

there 3.4.1/14: if variable member of namespace defined outside of scope of namespace name appears in definition of member (after declarator-id) looked if definition of member occurred in namespace. if name treated definition of member name point of declaration? and why following example works: namespace n { extern int j; } int = 2; int n::j = i; //n::j=2 int n::j=i actual appears namespace scope. hence declaration int i=2 not visible unqualified name lookup. why declaration found? your question: int n::j=i actual appears namespace scope. hence declaration int i=2 not visible unqualified name lookup. why declaration found? answer: since i not found in n namespace, looked in global namespace. had i been there in n namespace, have been used initialize n::j . hope following program clarifies doubt. #include <iostream> namespace n { extern int j; extern int k; int x = 3; } int x = 2; int y = 10; int n::j = ...

angularjs - Sometime scope variable not getting set -

this seems pretty strange me hope there's has come across before , point me in right direction. i have variable being set in scope within $interval , value "sticking" , not. someinterval = $interval(function() { somefactory.getsomething($scope.highestnumber) .then(function(response) { if (response.number > $scope.highestnumber) $scope.highestnumber = response.number; }); }, 30000); most of time works - $scope.highestnumber set updated value , 30 seconds later getsomething() called passing updated value. however, every , (and wish duplicate on demand), $scope.highestnumber set new value getsomething() called value had before update executed. have verified catching value of $scope.highestnumber after it's been set new value, , checking what's being passed getsomething() on next cycle. so sequence be... $scope.highestnumber = 10 getsomething(10) called returns response.number = 11 $scope.highestnumber set 11 (verifie...

Drupal 7 push notification . Error when sending push to ios devices -

i have issue when trying send push ios devices. warning: stream_socket_client(): unable set private key file sites/all/modules/push_notifications/certificates/apns-production-48d49d3853.pem' in push_notifications_apns_feedback_service(). help,please. first need certificate file push notification, , need rename " apns-production-48d49d3853.pem " put [you-site]/modules/push_notifications/certificates/ folder

sql - Reference field in MySQL SET Query -

so have table looks likes this +----+----------------------+--------------------------+----------+----------+ | id | fullname | email | username | password | +----+----------------------+--------------------------+----------+----------+ | 1 | john doe | johndoe@example.com | johndoe | password | | 2 | jane doe | janedoe@example.com | janedoe | password | +----+----------------------+--------------------------+----------+----------+ what want change "password" "1". example, table after query: +----+----------------------+--------------------------+----------+----------+ | id | fullname | email | username | password | +----+----------------------+--------------------------+----------+----------+ | 1 | john doe | johndoe@example.com | johndoe | johndoe1 | | 2 | jane doe | janedoe@example.com | janedoe | janedoe1 | +----+-...

Angularjs dropdownlist and form validation -

i have page several dropdown lists , of them may have default entries not valid. it's same problem described here: angularjs doesn't validate invalid dropdown selection however, think there has reasonable way accomplish without having check manually in controller. i'd able this: <select ng-model="thisentry" ng-options="option option in goodoptions"></select> <span class="error" ng-show="goodoptions.indexof(thisentry) == -1">please select valid entry list</span> that sets form invalid user can't submit until it's fixed . code above displays message, don't know how set form invalid @ same time, or in equivalent line of code. seems equivalent of blank entry on form that's handled without having resort javascript code.

filtering - How does the sgolay function work in Matlab R2013a? -

i have question sgolay function in matlab r2013a. database has 165 spectra 2884 variables , take first , second derivatives of them. how might define inputs k , f sgolay ? below example: sgolay used smooth noisy sinusoid , compare resulting first , second derivatives first , second derivatives computed using diff . notice how using diff amplifies noise , generates useless results. k = 4; % order of polynomial fit f = 21; % window length [b,g] = sgolay(k,f); % calculate s-g coefficients dx = .2; xlim = 200; x = 0:dx:xlim-1; y = 5*sin(0.4*pi*x)+randn(size(x)); % sinusoid noise halfwin = ((f+1)/2) -1; n = (f+1)/2:996-(f+1)/2, % zero-th derivative (smoothing only) sg0(n) = dot(g(:,1), y(n - halfwin: n + halfwin)); % 1st differential sg1(n) = dot(g(:,2), y(n - halfwin: n + halfwin)); % 2nd differential sg2(n) = 2*dot(g(:,3)', y(n - halfwin: n + halfwin))'; end sg1 = sg1/dx; % turn differential derivative...

mysqli - How can I insert a new row, but if the combination of 2 values already exist update the row? -

my table looks this create table sample ( id int auto_increment primary key, w_id varchar(20), tc_id varchar(20), foo varchar(20), bar varchar(20) ); i want insert new row table, if combination of w_id , tc_id exists, want update row new values of 'foo' , 'bar' i know there lot of similar questions on here, can't figure out.... made sample in sqlfiddle.com i using 5.6.11-mysql - apache/2.2.22 (win32) php/5.3.25 you can create unique key of combination of w_id , tc_id perform upsert on follows: create table sample ( id int auto_increment primary key, w_id varchar(20), tc_id varchar(20), foo varchar(20), bar varchar(20) ); alter table sample add constraint unique (w_id, tc_id); insert sample (w_id, tc_id,foo,bar) values ('1', '2','123','123'); insert sample (w_id, tc_id,foo,bar) values ('2', '2','123','123'); insert sample (w...

How to share version values between project/plugins.sbt and project/Build.scala? -

i share common version variable between sbtplugin , rest of build here trying: in project/build.scala : object versions { scalajs = "0.5.0-m3" } object mybuild extends build { //use version number } in plugins.sbt : addsbtplugin("org.scala-lang.modules.scalajs" % "scalajs-sbt-plugin" % versions.scalajs) results in plugins.sbt:15: error: not found: value versions addsbtplugin("org.scala-lang.modules.scalajs" % "scalajs-sbt-plugin" % versions.scalajs) is there way share version number specification between plugins.sbt , rest of build, e.g. project/build.scala ? sbt-buildinfo if need share version number between build.sbt , hello.scala , do? don't know you, use sbt-buildinfo wrote. this can configured using buildinfokeys setting expose arbitrary key values version or custom string value. understand not you're asking bear me. meta-build (turtles way down) as jacek noted , stated in ge...

sprite kit - Stop Game auto starting Xcode spritekit -

i have written game in xcode in myscene.m file. have problem however. when ever game loads testing or opened game automatically starts. there code can implement start game when screen in touched? thanks in advance. to execute method when screen touched: -(void)touchesbegan:(nsset *)touches withevent:(uievent *)event { [self startmygame]; } -(void)startmygame { // add game start code here... } you should think code logic. menu screen run before game started. menu options such "start game" give user clear choice start game when ready. food thought...

unity3d - Basic C# Unity2D movement script not functioning -

hi there fellow overflowers! have dived c# in unity, because believe has more functionality unityscript, , come c++ background. referencing code 2d script in sample assets, have tried create own. code below: using unityengine; public class playercontrol : monobehaviour { //variables [hideininspector] public bool facingforward = true; //for flip() function bool isground = true; //for grounded() function public float maxspeed = 5.0f; //terminal sideways velocity public float horizonaxis; //checks a/d movement public float jumpfloat = 1000.0f; //modular, use unity editor public float movefloat = 400.0f; // " " void start() { //transform.position(0,0,0); } void flip() { facingforward = !facingforward; //switches boolean vector3 thescale = transform.localscale; //assigns vector localscale of player thescale.x *= -1; //if x = 1, position becomes -1 , flips transform...

sql - Get multiple rows as comma separated string column AND map values to temp table from junction table -

i've seen several questions how pull multiple rows single comma-separated column t-sql. i'm trying map examples own case in need bring columns 2 tables referencing junction table. can't make work. here's query have: with userscsv (useremails, siteid) (select userssites.siteid, stuff( (select ', ' + users.email users userssites.userid = users.id xml path ('') group userssites.userid ), 1, 2, '') userssites group userssites.siteid ) select * userscsv the hard stuff here based on this answer . i've added with which, understand it, creates sort of temporary table (i'm sure it's more complicated that, humor me.) hold values. obviously, don't need select values, i'm going joining table later. (the whole of need still more complicated i'm trying here.) so, i'm creating temporary table named userscsv 2 columns i'm filling selecting siteid column userssites...

Apigee fault handling for CLASSIFICATION_FAILURE -

in apigee, can fault handling - specifying faultrule , raisefault policy used handle , provide custom message for: { "fault": { "faultstring": "not found", "detail": { "errorcode": "classification_failure" } } } if can done, should 'condition' fault rule 'fault.name = "classification_failure"'? tried , not working. classification_failure system level failure find api proxy given url/uri. request not reach api proxy(hence policies) - precise complaint system. not want handle error that. another way approach case have catch api proxy basepath /** invoked when there no specific url match. can generate custom message in proxy - can message wanted send across in case of classification failure.

mysql - Insert only if new value is the highest -

player 1 has finished game , got score of 10. should save score if it's high score user. how accomplish in single query? tried this: insert highscore("score", "player") values(10, 1) (select max(score) hs highscore player = 1) < 10; thanks the ugly thing mysql not support insert values condition, can cheat doing this: insert highscore (score, player) select 10, 1 dual (select max(score) highscore player = 1) < 10 this insert no rows if score higher 10, otherwise create row values need. it's easier trigger , believe has lower cost.

python - TypeError: method() takes 1 positional argument but 2 were given -

if have class ... class myclass: def method(arg): print(arg) ... use create object ... my_object = myclass() ... on call method("foo") ... >>> my_object.method("foo") traceback (most recent call last): file "<stdin>", line 1, in <module> typeerror: method() takes 1 positional argument (2 given) ... why python tell me gave 2 arguments, when gave one? in python, this: my_object.method("foo") ... syntactic sugar , interpreter translates behind scenes into: myclass.method(my_object, "foo") ... which, can see, indeed have 2 arguments - it's first 1 implicit, point of view of caller. this because methods work object they're called on, there needs way object referred inside method. convention, first argument called self inside method definition: class mynewclass: def method(self, arg): print(self) print(arg) if call method("foo") ...

Updating Multiple Rows in SQL Server -

i have table looks : ------------------------ |id | status |value| ------------------------ |1 | y |10 | |2 | n |10 | |3 | y |10 | |4 | n |10 | |5 | n |10 | ------------------------ for every status = 'n' , i'd add 3 value , set status 'y' . so, outcome table should be: ------------------------ |id | status |value| ------------------------ |1 | y |10 | |2 | y |13 | |3 | y |10 | |4 | y |13 | |5 | y |13 | ------------------------ how can in best way in sql server? update your_table set status = 'y', value = value + 3 status = 'n'

Add array on subprogram in java -

i make subprogram search, if there given string in array. want subprogram have requirements name , array. how can achieve that? my subprogram is: static int findelement(string a, string array){ (int = 0; < array.size(); i++){ if (array.get(i).getname().equalsignorecase(a)) { system.out.println(i); return i; } else return 0; } } i have of course errors since doesn't accept array have inserted it. this typo: static int findelement(string a, string array) i think meant: static int findelement(string a, string[] array) also program has multiple issues it: for (int = 0; < array.size(); i++){ if (array.get(i).getname().equalsignorecase(a)) { system.out.println(i); return i; } else return 0; } you don't want return 1 element doesn't match, want return when don't match. 0 index, typically return -1. value array, use brackets. strings don...

c++ - Difficulties using DemonsRegistrationFilter in ITK -

i'm trying register 2 images using itk library , demonsregistrationfilter. have problems setting 2 images want register. when compile, error: imagetype not declared in scope. i first wanted use python wrapper didn't figure out how have code using c++ i'm not familiar. using template. if can or send me simple working example, great. regards, arnaud since interested in python bindings, may interested in the 0.9 version of simpleitk has added demons registration filters. can build yourself on current git master or download packaged nightly version . this save of these pesky c++ template issue.

java - SQLException: Missing IN or OUT parameter at index:: 1 -

i've made jtextfield, jradiobuttons, , text areas. want them insert data entered in these sql database. i've made following code: connection conn = null; //statement stm = null; preparedstatement pst = null; resultset rs = null; try{ class.forname("oracle.jdbc.oracledriver"); system.out.println("driver loaded."); conn = drivermanager.getconnection("jdbc:oracle:thin:@localhost:1521:orcl", "hr", "hr"); system.out.println("driver connected."); pst=conn.preparestatement("insert directorsdb (director_name, dob, din, pan, uin, birth_place, passport, driving_lic, nationality, occupation, occupation_company, designation, qualification, address_off, address_resi, contact_home, contact_work, contact_mobile, email_personal, email_work, email_other, secretary_name, secretary_contact, secretary_email, dsc, dsc_expiry, father_name, mother_name, appointment_date, pos...

mysql - How do I count number of different types of things in a SQL table? -

i have table storing set of transactions customer | flavor | date purchased | location | blah | blah anna | apple | 2014-01-01 | seattle | 1 | 0 anna | grape | 2014-01-01 | seattle | 1 | 0 ... i'd able select number of different flavors each customer tried. like... who | number of flavors tried anna | 4 beth | 1 cathy | 100 and it's bending brain knot. how group/join/? way victory? if group customer aggregate functions count() applied every single group , not complete resultset. distinct counts different flavors. select customer, count(distinct flavor) `number of flavors tried` your_table group customer

Workflow: Trying to pass an object varable to a class method -

Image
i having tough time trying pass parameter method when go invoke it. i new variable called setupnewcase, populate data. once that, try invoke method. works when don't have value pass it, doesn't work here in case trying pass it. can help? to pass parameters invoked method use parameters property on invokemethod activity. available on activity's properties grid , not directly on designer. you use targetobject when invoking method on instance object since commonmethods class static won't ever instantiate , therefore targetobject should empty.

Ember.js Components - param is not passed in action inside a component -

what i'm trying do: author can delete own post. problem: seems parameter param=this not passed inside components: implemented action removepost in app/components/post-box.js triggers item.deleterecord() item undefined when click delete button. please me. posts.hbs -> post-box.hbs -> post-box.js app/templates/posts.hbs <div class="postscontainer"> <div class="innerpostscontent"> {{#each itemcontroller="post"}} {{!-- here problem: components, param doesn't --}} {{post-box user=user body=body date=date isauthor=isauthor view=view action="removepost" param=this session=session}} {{/each}} </div> </div> app/templates/components/post-box.hbs <div class="eachpost"> <div class="eachpostcontent" {{action 'showdelete'}}> <p class="postauthor"><strong>{{user.id}}</strong></p> <p class=...

javascript - Client-side validation when changing input ids in asp.net mvc -

i'm working on form can contain multiple instances of sub-form. main entry 'publication form' contains multiple instances of sub-page 'publication.' i'm doing using ajax, , every time user clicks 'add row' button, new sub-form item, called custom view. now, every time 'add row' button clicked, javascript counter incremented, , value sent controller, puts viewbag, , sends view file. each item treated differently, use viewbag counter increment it's name , id, example: <input id="pubdetails@(viewbag.upto)" class="text-box single-line" type="text" value="" name="pubdetails@(viewbag.upto)" data-val-required="the full publication details (include isbn, web addresses etc) (include authors) field required." data-val="true"> <span class="field-validation-valid" data-valmsg-replace="true" data-valmsg-for="pubdetails@(viewbag.upto)">...

php - Phalcon - Micro App - Run executeQuery in a custom function -

i have followed api tutorial. http://docs.phalconphp.com/en/latest/reference/tutorial-rest.html i have working. now creating authentication function call @ beginning of each api call. example: $app->get('/api/robots', function() use ($app) { $authdata=isauthorized($app); ... .. so in "index.php" file have function titled "is_authorized" the function runs fine, cannot execute sql within function. the following example not execute within is_authorized function. $phql = "select * members order id"; $robots = $app->modelsmanager->executequery($phql); while above run within initial api call function not run in is_authorized function. there way pass "$app" function can use execute queries? this issue unrelated phalcon , more of issue understanding of how pass reference in php 5.4. see post reason on why running issue. php 5.4 call-time pass-by-reference - easy fix available?

javascript - Dynamic Load CSS and JS files -

Image
good day everyone. i have questions regarding dynamic load css , js file. i know there lot of kind of question around. concerning is: should use back-end program load css , js? example: if($page == "abc.com") { echo "<link href='abc.css' />"; else if($page == "def.com") { echo "<link href='def.css' />"; else { echo "<link href='ghi.css' />"; } use function load specific css in specific page, declares inside <body> section. dynamically add css , js file - codeigniter inside abc.com add_css(array('metro-admin.css', 'abc.css')); echo put_headers(); and source code this. ok have 1 solution, instead of declaring css explicitly within php, let php echo <script> tag in order php not trespass in front-end. if($page == "abc.com") { echo "<script src='abc.js'></script>"; else if($pag...

c# - How to use Linq instead of SQL Injection query for custom search -

i use linq instead of below hardcoded sql injection search sqlserver database tables. how retrieve dynamically generated web controls input texts in c# linq , replace entire sql injection in linq searching. my c# code: protected void search_button_click(object sender, eventargs e) { try { table maintable = select.findcontrol("dynamic_filter_table_id") table; int rc = maintable.rows.count; if (rc == 1) { dropdownlist d1 = maintable.findcontrol("mainddl") dropdownlist; if (d1.selectedvalue.contains("decimal")) { textbox t1 = maintable.findcontrol("txtbox1") textbox; textbox t2 = maintable.findcontrol("txtbox2") textbox; sqldataadapter sql = new sqldataadapter("select f.col1,f.col2,v.col1, col2,col3, col4 , col5, cl6 table1 v , tabl2 f v.col1 = f.col1 , " + ddl...

c# - Exception in self host wcf service - The type initializer for 'System.ServiceModel.Diagnostics.TraceUtility' threw an exception -

Image
i have got following exception, when tried port existing iis-based rest service self-hosted one. the type initializer 'system.servicemodel.diagnostics.traceutility' threw exception. i following self-hosted wcf rest service port existing code, before testing sample code given in this. my inner exception given below. now after commenting out whole <configsections> tag, throws exception: the contract name 'selfhostedrestservice.iservice' not found in list of contracts implemented service 'service'. here configuration file: <?xml version="1.0"?> <configuration> <startup><supportedruntime version="v4.0" sku=".netframework,version=v4.0"/></startup> <!--<configsections> <section name="log4net" type="log4net.config.log4netconfigurationsectionhandler, log4net" /> <sectiongroup name="system.web.extensions" type=...

.net - Join rows using C# Linq -

if there datatable called students subjectid studentname ---------- ------------- 1 mary 1 john 1 sam 2 alaina 2 edward how can below datatable result using linq: subjectid studentname ---------- ------------- 1 mary, john, sam 2 alaina, edward i tried achieving result using foreach loop crawling through each datarow 1 one came across major performance hit. not linq trying hands on it. post answer once concrete appreciated in between. sample working code without using linq not giving desired performance. below foreach loop taking around 15mins if datatable dt2 has around 3500 records. datatable dtfiles = dt2.clone(); //logic filter out files keyword name filter. foreach (datarow row in dt2.rows) { string studentid = row.field<string>("studentid"); string filter = "studentid...

Android editTextValue duplicate in ListView -

i still unsolved problem. there edittext in listview , textview. when scrolling listview edittext duplicate values ​​are output. found cause getview () problem in listview recycle item has been found stack overflow , headaches in person me, tried post. i see , respond however, not solve problem. in addition, in response inflater.inflate (r.layout.listview_item, parent, null) method non-existent detailed answer problem, please me ask thank you. -my android source- public class listviewadpter extends baseadapter { context context; arraylist<listitemvo> itemlist; list<string> editlist; static class viewholder { public textview text; public edittext edittext; } public listviewadpter(context context, arraylist<listitemvo> arr) { this.context = context; this.itemlist = arr; } @override public int getcount() { // todo auto-generated method stub return itemlist.size(); } @override public object getitem(int position) { ...

database - java.sql.SQLException: Listener refused the connection with the following error -

we moved new server need modify connection string. encountering error: java.sql.sqlexception: listener refused connection following error: ora-12514, tns:listener not know of service requested in connect descriptor ip address = check port = check usermame - check password = check where else need modify? in advance.

javascript - split this java script string -

this question has answer here: how read non standard json file using javascript or jquery 2 answers i have following string { "browser": "firefox", "datetime": "28_may_2014_03_35_pm" } { "browser": "firefox", "datetime": "28_may_2014_03_36_pm" } i want elements betwen opening { , closing } braces. it looks quite json encoded objects, see there incongruences, please pay attention @ little edits in starting string: json.parse('[{"browser": "firefox","datetime": "28_may_2014_03_35_pm"},{"browser": "firefox","datetime": "28_may_2014_03_36_pm"}]'); //this convert string actual javascript object.. edit: if json in not proper encoded, you'll have fix here , there offcourse.. ...