Posts

Showing posts from September, 2013

How to setup maven-site-plugin when aggregator is not the parent? -

i have system has pom aggregator grouping modules. i'm using maven-site 3.3 , maven 3.2.1. one of module parent parent corporate pom built in job. root-aggregator parent-pom component-one component-two component-three i've setup different values project.url , site.url each project, root-aggregator root , parent under it. the problem i'm facing both root-aggregator , parent-pom being copied (stage) same root folder (stagingdirectory). last project overriding files parent-pom. [info] pushing /home/cvgaviao/aggregator-maven/maven.parent/target/site [info] >>> file:///home/cvgaviao/development/staging-site/./ [info] pushing /home/cvgaviao/aggregator-maven/target/site [info] >>> file:///home/cvgaviao/development/staging-site/./ how make maven-site-plugin understand parent pom not root ?

javascript - JQuery not working on Tumblr? -

i'm kind of new jquery. i've been trying use jquery http://jsfiddle.net/54pp2/2/ , <input id="click" type="button" value="click" /> <label id="test">test</label> $(document).ready(function () { var textarray = []; textarray[0] = 'test 1'; textarray[1] = 'test 2'; textarray[2] = 'test 3'; textarray[3] = 'test 4'; var idx = 0; $('input#click').on('click', function() { idx++; var newidx = idx % textarray.length; $('label#test').text(textarray[newidx]); }); }); but when put in theme code, won't work, though jsfiddle shows works fine. if want see: http://dialoguetest.tumblr.com/ (where when click pink button on sidebar, description text changes. can click once, unlike jquery code enables button clicked few times text change.) when tried use jquery, won't work: http://dialo...

windows - Compiling a C code into a single executable compatible with both WinXP and Win7 -

i trying compile c program executable compatible both winxp , win7. since code needs compact possible, i'd use dlls. visual studio express 2012 update4 can generate code winxp, latter won't work on win7. when running on win7, following error: "the program cant run because msvcr110.dll missing..." can me issue? in advance! the program compile under vs2012 should work on both xp , windows 7. problem windows 7 machine not have required runtime deployed on it. prerequisite of linking against dynamic runtime. must deploy runtime machine runs program. once deploy runtime, instance using vs2012 redistributable package, should find code run. note need on machines, not windows 7 machines. fact have not had on windows xp machine means other application has deployed runtime there. quite xp machine development machine , runtime deployed when installed visual studio. as alternative installing redistributable package can place runtime dll, msvcr110.dll, in direct...

c# - SSIS not executing .EXE using Execute Process Task on INT server -

i have executable able run in dev environment isn't being run in int environment. when try run .exe on int remotely using unc path error stating .exe 16-bit application , can't run on int machine. problem error built .exe , know fact isn't 16-bit application. when try run ssis package call .exe on int not receive 16-bit error, .exe not run. i have tried hard coding location of .exe in execute process task , using variable dynamically sets location based on machine running ssis package on. (both work in dev, neither work in int) can call .exe on int dev, isn't surprise since .exe pulled down int dev. any ideas why .exe run on dev environment not int environment? environments same per our system admin. i have answer issue concerned. the problem file transfer process moving exe dev server int server. process handled via robocopy script (which still unable parameters of), appeared causing issue. i not 100% sure caused issue, script wasn't copying on...

Passing select value from a form through php and then out to email -

i trying add form came bootstrap html template. specifically, add select option can't seem passed through php , out email. attach html , php code below. <select id="selectbasic" name="selectbasic" class="form-control "> <option value="zombie">zombie volunteer</option> <option value="sponsor">sponsorship</option> </select> what need have in php file pick value? i tried this... $body = "below details submitted user on website. <br><br> inquiry type: ".$_post['selectbasic']." <br><br> name: ".$_post['name']." <br><br> email: ".$_post['email']." <br><br> business/organization: ".$_post['phone']." <br><br> comment: ".$_post['comment'].""; any appreciated. in advance! here's complete form: <header class="clea...

java - NoClassDefFoundError:StaticLoggerBinder -

while starting web application , hits following error message : infos: starting servlet engine: apache tomcat/7.0.53 mai 16, 2014 3:35:16 pm org.apache.catalina.loader.webappclassloader validatejarfile infos: validatejarfile(c:\users\ayman\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\atomikos\web-inf\lib\geronimo-servlet_2.5_spec-1.2.jar) - jar not loaded. see servlet spec 3.0, section 10.7.2. offending class: javax/servlet/servlet.class mai 16, 2014 3:35:16 pm org.apache.catalina.loader.webappclassloader validatejarfile infos: validatejarfile(c:\users\ayman\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\atomikos\web-inf\lib\javax.servlet-api-3.0.1.jar) - jar not loaded. see servlet spec 3.0, section 10.7.2. offending class: javax/servlet/servlet.class slf4j: class path contains multiple slf4j bindings. slf4j: found binding in [jar:file:/c:/users/ayman/workspace/.metadata/.plugins/org.eclipse.wst.server.core...

java - TestNG - Skipping a test case for a user -

i'm using testng , using iterator data excel. i have many usernames mentioned in excel , each user has different permissions. for example, user1 has access screen1, screen2 , screen3 of tab. user2 has access screen 1,2 not 3 of tab so have created class work both users, problem here screen 3 not available user2, webdriver fails test shows on report, don't want. is there way skip screen3 test case user2? thanks good morning, suggest use groups discrimination in test annotation. example cans see thread: is possible put condition testng run test if member of 2 groups? thanks attention.

tsql - Find recent object changes in SQL Server Database -

i've added , modified several (new , existing resp.) tables , stored procs , particular database , server , in last 3 months . i thinking if there's sql query can determine changes. thanks. i don't think you're going able find you're looking for. sql server doesn't track information out of box. to handle in future, can use kind of source control (redgate, one: http://www.red-gate.com/products/sql-development/sql-source-control ), or can set ddl trigger (one such technique described here: https://dba.stackexchange.com/questions/33541/how-to-keep-history-of-sql-server-stored-procedure-revisions/33544#33544 ).

rsa - Dealing with a PublicKey object in Java -

first, time, , patience since i´m noob in subject... have publickey object: sun rsa public key, 2048 bits modulus: 18077203024541758363929020498733829335491380051700307922133794962061975747420394877143889885945336305414295314139507244695177887549094887061986620463327220586346030432731550617421168238140740600157137764348364595070740870977422155213465409492752709350141858141989090093641680035205975043549124382974765930336756768548921056751935659732417661594872253800976031104054204421629711597470770033907934006101453865340621763385927121144139876123093050849040638804744781745077880021130241262817005818066815987603380244330904985993553253768481242544555268132089382269330678737161421709242927983939704722774178497866252217753513 public exponent: 65537 and need this: miibijanbgkqhkig9w0baqefaaocaq8amiibcgkcaqeajzlzvhyjxagafmqngrsdj3vistkpy3i3 fow4xrx+wkoebov9k7wfgdb2ptvl+fahhy5mvgghzzfggo0thefzdbqdlzezqbg6uw/qdh4cddjb nfhaziexspfsdlz15i5yizcpvkslm7cuf0oguoq8qxnledfd47mrwp7krt2vt...

php - Force data to a form using post -

i know there no way use query string pass information form uses post method, there other options? trying use link (or button) on 1 website link page on another. in process, url/button needs send information target. target website uses post, can't use query string input data. there sort of button attribute let me send data fields in target website? thank in advance. edit: should have mentioned cannot use form tag. reason, environment using not allow tags used. with button: <form action="http://example.com/target.php" method="post"> <input type="hidden" name="foo" value="bar" /> <input type="submit" /> </form> with link: <form id="my_form" action="http://example.com/target.php" method="post"> <input type="hidden" name="foo" value="bar" /> </form> <a href="#" onclick="docume...

php - Oddly some times value float value returns 0 -

i'm beginner @ php trying solve usage of pdo in php... i have pdo query: returns correct value (integer 1) don't know how, returns (0 or null) happens randomly , no idea why. server windows based. double checked database.. multiplier values (integer 1) $q = $db->prepare("select multiplier,balance buoys id=:id"); $aid = $_post['id']; $afishvalue = (float)0.4; $q->execute(array(':id' => $aid)); $res = $q->fetch(pdo::fetch_obj); $aevent = (integer)$res->multiplier; // how value times returns 0 values in database integer 1. $abuoybalance = (float)$res->balance; $afishvalue = (float)$afishvalue * (float)$aevent; most of time $afishvalue returns correctly times returns null. i'm totally stuck , googled hours... no idea next. there few things check: $q->execute(array(':id' => $aid)); $res = $q->fetch(pdo::fetch_obj); on both of above statements, return should checked error event

javascript - How does Sails.js work on heroku? -

i've created simple app sails.js , deployed heroku, works fine. here procfile : web: sails lift but on heroku (as think) there no binary sails installed, how work? update : i've removed main , start sections package.json in case npm start command used, app still runs fine. i've added --prod option in procfile , treated correctly. here git push output (no warn/err procfile) -----> node.js app detected pro tip: specify node version in package.json see https://devcenter.heroku.com/articles/nodejs-support -----> defaulting latest stable node: 0.10.28 -----> downloading , installing node -----> restoring node_modules directory cache -----> pruning cached dependencies not specified in package.json -----> writing custom .npmrc circumvent npm bugs -----> exporting config vars environment -----> installing dependencies -----> caching node_modules directory future builds -----> cleaning node-gyp , npm artifacts -----> ...

Problems connecting to MySQL from PHP -

Image
i’ve created database called database_test & have user named john , password hello123 . host host . <?php // create connection $host = "host"; // host correct. i'm hiding general public. $user = "john"; $password = "hello123"; $database = "database_test"; $con=mysqli_connect($host,$user,$password,$database); // check connection if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } ?> however, i'm getting error: failed connect mysql: access denied user 'john'@'host' (using password: yes) i’ve set permissions user “john” shown below… why getting error? have host correct, username , password correct it’s saying user not have privileges is hostname other localhost or 127.0.0.1 ? if firewall issue. to check if host remotely available, can use mmap . nmap common network utility not installed default on linux machines or mac os x machi...

ruby on rails - Sprockets::FileNotFound -

i working communityengine here faced problem. sprockets::filenotfound in base#site_index //in gemfile use: gem 'community_engine', github: 'bborn/communityengine' , branch: "rails4" i use gem 'sprockets', '~> 2.12.1' depends on 'sprockets', '~> 2.10.0' change gem 'sprockets', '2.10.0' still not working ... (c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/communityengine-3d086183561a/app/views/shared/_end_javascript.html.haml line #1 raised: couldn't find file 'jquery.ui.all' (in c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/communityengine-3d086183561a/app/assets/javascripts/community_engine.js:7) looks using broken version of communityengine. please try updating gem (your issue fixed in this commit ).

WHMCS Domain/TLD setup -

i have hit past 165 domains entered pricing, wont let me add anymore domains. whats work around or issue? (also checked whmcs logs , no records of errors) whmcs has no 'limit' number of tlds if you've reached level cannot add more configuration issue server/apache/php - sort of setting/limit on form submits - check server logs.

No signature of method (or how to add a third-party library) in Android Studio -

Image
i have android studio 0.5.8. here build.gradle file: buildscript { repositories { mavencentral() } dependencies { classpath 'com.android.tools.build:gradle:0.9.+' } } allprojects { repositories { mavencentral() } dependencies { compile files('libs/scala-compiler.jar', 'libs/scala-library.jar', 'libs/scala-reflect.jar') } } i added libs manually because right-mouse-click on *.jar didn't cause add line compile files . i'm getting error now: error: no signature of method: org.gradle.api.internal.artifacts.dsl.dependencies.defaultdependencyhandler.compile() applicable argument types: (org.gradle.api.internal.file.collections.defaultconfigurablefilecollection) values: [file collection] possible solutions: module(java.lang.object) how solve it? remove dependencies block build file posted in question. instead, add library dependencies project structure dialog. in dialog, c...

javascript - Jquery Url Split and grab mid value -

i have url www.xyz.com/partyevent/zalen is there way grab url mid value i.e "partyevent" , spit parts before , after that. want mid value " partyevent " adding class body. $(document).ready(function () { var url = window.location.pathname; var count = url.match(new regexp("/", 'g')); var urlsplit = url.split("/"); var page_class = urlsplit[count.length]; alert(page_class); $('body').addclass(page_class); }); thanks help.. try this: $(function () { var url = window.location.pathname; var urlsplit = url.split("/"); // returns array of ["","partyevent",zalen] var page_class = urlsplit[1]; // need not bother count when u need word after domain alert(page_class); $('body').addclass(page_class); });

how to display mobile website in webbrowser control in windows phone -

this piece of code have written display mobile website in web browser control in windows phone nothing happens browser blank webbro.navigate(new uri("http://m.bajajfinservlending.in/"), null, "user-agent: mozilla/4.0 (compatible; msie 7.0,msie 10.0; windows phone os 7.0,windows phone 8.0; trident/3.1,trident/6.0; iemobile/7.0,iemobile/10.0; arm; touch; nokia; lumia 520)"); this enough. mobile version of website loaded. webbro.navigate(new uri("http://m.bajajfinservlending.in/", urikind.absolute)); to know, mistake have done, copy url , paste desktop browser. same blank response receive had in windows phone web browser. so, problem not in app. it's in url

javascript - Object.keys execution-time -

i did benchmarking on setup (i7 @ 3.07ghz, 6gb ram) object.keys method , noticed interesting results. this code tried: var foo = {}; (var = 0; < 600000; i++) { foo[i] = true; } console.time("foobar"); var keys = object.keys(foo); console.timeend("foobar"); i replaced xxx different values, starting @ 10 000 , going 1 000 000. when came 400k execution-time around 121ms, 500k ~130ms. @ 600k jumped 250ms. why this? you can examine how memory object foo uses. when i = 600000 => foo object occupies around 2.4 mb when i = 500000 => foo object occupies around 2mb so, cpu cache size around 2mb, , when need more memory can handle, performance degrades non-linearly (as linear memory consumption less 2 mb)

c# - Open console window in mono -

i'd mono application able open , close console window @ will. know how on windows it's kernel32.dll i'd platform-independent. if not possible want implement different methods different os's. if not possible @ can resort using self-made console window take way longer implement , won't compatible. want sure whether it's possible or not before work on custom console window. the console window has used output, no input functionality required. (it feature way show log messages.)

c# - Windows Form to Send email -

i'm trying build windows form 3 textboxt sender , object , body to use smtpclient feature on .net , following, let users send me email using windows form. i can't figure out , forgive me because i'm new c# , still learning. using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; using system.net.mail; using system.net; namespace arcadiapatcher { public partial class form2 : form { public form2() { initializecomponent(); } private void button1_click(object sender, eventargs e) { smtpclient smtpclient = new smtpclient(); networkcredential basiccredential = new networkcredential("login", "pass"); mailmessage message = new mailmessage(); mailaddress fromaddress = new mailaddress(text1); smtpclient.host = "mail.domain2.com"; smtpclien...

python - Slowing down a physics defying spring -

i doing tutorial physics class. i made program should have cart on box moved spring , should slow down stop, however, when run it, appears spring accelerating cart (no matter things negate.) i have heard might issue vpython rounding numbers resulting in acceleration, if true, can make numbers 1000 times larger , fix it? thanks! from visual import * visual.graph import * length=1.0 track=box(pos=vector(0,-0.05,0), size=(length, 0.05, 0.10), material=materials.bricks,) # creates track "length"meters in # x direction, 0.05m tall, , 1m deep start=-0.5*length+0.05 cart=box(pos=vector(start+0.01,0,0), size=(0.1,0.05,0.1), color=color.green) k=-4 #spring constant sprl=(start-0.05)-0.1 #sets position of left end of spring spring=helix(pos=(sprl,0,0), axis=((cart.x-0.05)-sprl,0,0), radius=0.02, color=color.yellow) cart.m=0.70 #mass of cart cart.vel=vector(0,0,0) #initial velocity of cart ca...

php - SQL for related videos -

what need query related videos in page shows video youtube. however, should choose related videos database. table structure is: id, privatepublic, singer, title, datetime, gender, difficulty, ytid, lang title : (title of song), ytid : yotube id of video, lang : language of song, difficulty : ranged 0 10. requirements: privatepublic should 1 gender should same current video at top same singer videos should displayed sorted datetime after "singer" section @ 3, should display songs same gender , closest difficulty . max number of videos related should 5. i beginner sql. thank answers. for used integrated php: $qry_select="select songs.* songs (((songs.gender)='".$_session['gender']."')) , (((songs.ytid)<>'".$_session['ytid']."')) , (((songs.privatepubblic)=1)) , (((songs.lang)='".$_session['songlang']."')) order rand() limit 0,5;"; after 2-...

java - Duplicate method Meeting(String) in type Meeting - Error -

hi guys i'm having error regarding duplicate constructors, according assignment need constructor different field. specifications: meeting – location, subject, list of attendees string array, notes , addattendee(string name) method. constructor set single attendee attendee array. constructor accept array of strings assign list of attendees. two more constructors same previous 2 allow setting note field string. here part of code public meeting(string name) { this.name = name; listofattendees[count] = name; count++; // blank constructor no parameter super constructor } // constructor accept array of strings assign list of attendees public meeting(string[] listofattendees) { this.listofattendees = listofattendees; } // constructors note field public meeting(string notes) { // error here! this.notes = notes; } you can not have more 1 method same name , same type of parameters. make 1 constructor name , notes, , if want ass...

c - Multiplication table using recursion without loops -

i've received assignment write recursive function receives 2 integersd user: x , y , prints out multiplication table number x*y . prototyping of function must like: void mult_table (int x, int base, int y) ( base gets 1 upon first time function called). example, if x=4 , y=5 , output be: 1 2 3 4 5 2 4 6 8 10 3 6 9 12 15 4 8 12 16 20 note no loop can used inside function, additional recursive functions can used if needed. my problems are: 1. how iterate base correctly in lines 2 , greater, because in line 1 simple ++ works, second line need 2. can't think stopping case function, because each time i'm print new line x , y values changed. grateful help, suggestions of other ways try , it. void mult_table (int x, int base, int y) { int temp; //temp variable hold x vlaue if (base <= y) //as long base less or equal y, number of line printed { printf(" %d", base); //using base +1 incrementation mult_table(x, base+1,...

concurrency - How to prevent this simple deadlock in java? -

this question has answer here: java synchronization multiple objects/locks 2 answers i have simple example illustrates how cause deadlock: class player { private string name; public player(string name) { super(); this.name = name; } public synchronized void passto(player p) { system.out.println(this.name + " passes " + p.name); // imitate long task (int = 0; < 1000000000; i++) ; p.passback(this); } private synchronized void passback(player p) { system.out.println(this.name + " passes " + p.name); } } public class deadlock { public static void main(string[] args) { final player ivan = new player("ivan"); final player petro = new player("petro"); new thread(new runnable() { public void...

oracle - Repeat table on every single page in rtf template -

i using "add-ins" plugin word 2010 create rtf template application in oracle. @ preview, want head of table repeat on every single page source. give example: column 1: no column 2: student_name column 3: course this head of table want appear top of every page. how should do? i interested in doing too, think answer add following header row \trhdr table row header. row should appear @ top of every page current table appears on. source

mysql - REGEXP not working with character names -

according http://dev.mysql.com/doc/refman/5.1/en/regexp.html , can use [.plus-sign.] instead of [.+.] so why below 2 queries give me different results in mysql 5.6.17 : select case when '+123' regexp '^[.+.][0-9]+$' 1 else 2 end; (gives result 1) select case when '+123' regexp '^[.plus-sign.][0-9]+$' 1 else 2 end; (gives result 2) using character names pretty neat if worked expected. doing wrong? you need use [[ character class ]] this: select '+123' regexp '^[[.plus-sign.]][0-9]+$'; 1

ios - How to send an email with SKPSMTPMessage which will parse ok in email clients? -

i've been trying use skpsmtpmessage ios application i'm creating. app send emails right seems there issues regarding email view on clients. i can see email on gmail example, can't airmail, appears empty email. looking @ code of email, seems "good" me so, can't know what's going on. here code sent email. delivered-to: edited@gmail.com received: 10.194.33.198 smtp id t6csp161338wji; sun, 18 may 2014 01:58:13 -0700 (pdt) x-received: 10.43.138.210 smtp id it18mr25804198icc.23.1400403493134; sun, 18 may 2014 01:58:13 -0700 (pdt) return-path: <bounces+256657-1972-edited=gmail.com@sendgrid.info> received: o1.b99.sendgrid.net (o1.b99.sendgrid.net. [208.115.235.3]) mx.google.com smtp id au7si6505972igc.48.2014.05.18.01.58.12 <edited@gmail.com>; sun, 18 may 2014 01:58:13 -0700 (pdt) received-spf: pass (google.com: domain of bounces+256657-1972-edited=gmail.com@sendgrid.info designates 208.115.235.3 per...

Android inserting value in database in background -

i using asyntask enter value in database. in in backgroud method calling method. private void calllogin() { getdatafromapi getdatafromapi = new getdatafromapi(url); if (!istablefalse) { log.e("mai gaaya syncronise data base mai", "ha mai aya"); string message = getdatafromapi.postsignin().tostring().trim(); syncronisedatabase(message); populatechurchlistonvalidating .populatechurchlist(parsejsontoarraylist()); } else { try { loginvalue = integer.parseint(getdatafromapi.postsignin()); log.e("login value", "" + loginvalue); } catch (numberformatexception nfe) { nfe.printstacktrace(); } } } and syncronisedatabase(message) this private void syncronisedatabase(string messtring) { ...

java - Avoid automatic jdbc connection close in servlet -

i have servlet deployed on jetty 9 server connects mysql 5.6.17 server using connector/j jdbc driver http://dev.mysql.com/downloads/connector/j/5.0.html . this particular servlet fires sql statement inside loop iterates around 10 times. have include drivermanager.getconnection(db_url, user, password); line within loop because connection closes automatically after sql statement has been executed in every iteration of loop. is there way keep connection open, getconnection() need executed once before loop starts , can manually close in block. i have found many posts on particular issue, refer connection pooling concept solution. interested in avoiding connection being closed automatically after each query execution. shouldn't simple parameter? not facing particular performance problem right now, seems waste of processor , network cycles. servlet code : public class checkphonenumberregistrationservlet extends httpservlet { @override protected void dopost(httpservlet...

network programming - C http server stops after unpredictable time -

i writing custom http server in c openwrt router. makes use of uclibc library. using 1 static buffer careful not overflow, , no multi-threading involved. doesn't contain complex data structures, , that: it listen() s on socket reads request after accept() ing gets html page sending http request predefined remote server ( not proxy ) sends result through accepted connection, , closes both. the program stop running after time, (it can on receiving first request, or after working under heavy strain more 2 hours). getting no error messages through console, or anything, program stops. have watched and, expected doesn't consume more , more memory runs... is possible kernel stops if thinks abusing cpu? how overcome that? are there quirks watch in socket programming in c known cause such crashes? can stability issues caused using barrier bracker (bleeding edge) branch of openwrt? although router never stops working... where start source of problem? ...

html - Using Typekit with MAMP -

i'm using mamp local server, , typekit web font service. however, i'm having world of bother, trying font render. i've put little video together, can see i'm possibly going wrong. workflow screencast any appreciated, huge weight lifted off shoulders. thank time. most culprit provide localhost domain typekit, you're viewing webpage directly filesystem ( file:///users/samuelryan/desktop/mysite/index.html ) rather via http://localhost/ expecting. where mamp apache document root? put files there , use http://localhost . domain match , font should load.

mysql - Slow result with LEFT JOIN -

i have simple sql query , if limit more 10, time result exceeds 15 seconds. question is, why it's slow ? here request: select e.id_pays tbl_usager left join tbl_ville b on a.id_ville = b.id_ville left join tbl_departement c on b.id_departement = c.id_departement left join tbl_pays e on c.id_pays = e.id_pays e.id_pays='1' limit 8 first, left join s unnecessary query. where clause turns them inner join s. second, final join unnecessary, because can take value departement table. select d.id_pays tbl_usager u join tbl_ville v on u.id_ville = v.id_ville join tbl_departement d on v.id_departement = d.id_departement d.id_pays = '1' limit 8; that help. next, assume id_* variables primary keys in respective tables. finally, create index on id_pays : create index idx_department_2 on tbl_department(id_pays, id_departement); these should query.

c# - Command.Parameters["@name"].Value Correct syntax -

i attempting use query select table using 1 - 3 parameters; select * plantareacodes (@areacode null or areacode = @areacode) , (@areaname null or areaname @areaname) , (@comments null or comments @comments); here c# code query: mysqlcommand = mysqlconnect.createcommand(); mysqlcommand.commandtext = "select * plantareacodes (@areacode null or areacode = @areacode) , (@areaname null or areaname @areaname) , (@comments null or comments @comments);"; mysqlcommand.parameters.add("@areacode", mysqldbtype.int32); mysqlcommand.parameters.add("@areaname", mysqldbtype.varchar); mysqlcommand.parameters.add("@comments", mysqldbtype.text); mysqlcommand.parameters["@areacode"].value = (string.isnullorempty(convert.tostring(pmodel.areacode)) ? (object)dbnull.value : pmodel.areacode); mysqlcommand.parameters["@areaname"].value = (string.isnullorempty(pmodel.areaname) ? (object)dbnull.value : pmodel.areaname); mysqlcommand.para...

spring - xml beans in android -

i want use xml beans in android. searched around 1 day in google , places read , can't use xml beans in android , android not have , confused! dont know, can use or not , if can't use this, should use instead of xml beans? don't want use maven. xml beans configuration in spring? i can use xml beans in android? if yes xml beans spring? i read, use xml beans slow app. true? if yes should use instead of increase performance app? i goal use xml beans is: i want create bean xml file set of classes(with packages) , want in id tag in bean tag, set method name class. below: () , this, can sms method sendingsms class reflection. mean can send method name , parameter method reflection class , call method. training sample learning android , java bean , reflection in android , use in real project. and see use xml beans in java link ( use beans in java ) want use in android thanks :) maybe can user xstream library in android xml parse slow app? no,i think de...

python - What is the command in zookeeper to make a zookeeper leader voluntarily into a follower in a cluster? -

i have 4 questions regarding zoo-keeper. please give inputs on regard. what command in zookeeper make leader voluntarily follower inside cluster,which in-turn make follower machine in cluster takeover leader? what procedure followed zookeeper election form leader inside cluster? what command check cluster status in zookeeper, in turn can that, there command in zookeeper cluster status zoo-keeper healthy , cluster formed zookeeper? question 1) zookeeper leader stepdown - question, other shutting leader down , brining i'm not of command that. question 2) leader election: discussion of here: leader activation leader activation includes leader election. have 2 leader election algorithms in zookeeper: leaderelection , fastleaderelection (authfastleaderelection variant of fastleaderelection uses udp , allows servers perform simple form of authentication avoid ip spoofing). zookeeper messaging doesn't care exact method of electing leader has long ...

java - jpod library not working outside eclipse -

if run project eclipse - it's ok. if run project runnable jar exception thrown: .exception in thread "main" java.lang.exceptionininitializererror @ de.intarsys.pdf.platform.cwt.font.freetype.freetypefontfactory.getlib rary(unknown source) @ de.intarsys.pdf.platform.cwt.font.freetype.freetypefontfactory.create platformfont(unknown source) @ de.intarsys.pdf.platform.cwt.rendering.csplatformdevice.textsetfont(u nknown source) @ de.intarsys.pdf.content.csdevicebasedinterpreter.render_tf(unknown urce) @ de.intarsys.pdf.content.csinterpreter.process(unknown source) @ de.intarsys.pdf.content.csinterpreter.process(unknown source) @ de.intarsys.pdf.content.csdevicebasedinterpreter.process(unknown sour ce) @ renderdoc.renderpage(renderdoc.java:75) @ renderdoc.renderpages(renderdoc.java:97) @ renderdoc.run(renderdoc.java:139) @ renderdoc.main(renderdoc.java:48) caused by: java.lang.nullpoin...

php - Use global namespace in context on my namespace? -

i have 2 controllers /admin/usercontroller.php /front/usercontroller.php i've marked them namespaces admin , front , problem can't reach other framework classes, have put on every class invoke new \myclass , there way access global classes, except usercontroller? in other words make usercontroller invisible each other possible?, using laravel-4 i've found it! use \app\models use \basecontroller i've needed specify classes of framework use, problem gone, thanks!

c# - Cannot access a closed stream while sending attachment -

i'm trying send email attachment using c#. here method: public void sendemail(string from, string to, smtpclient client) { mailmessage mm = new mailmessage(from, to, "otrzymałeś nowe zamówienie od "+from , "przesyłam nowe zamówienie na sprzęt"); mm.bodyencoding = utf8encoding.utf8; mm.deliverynotificationoptions = deliverynotificationoptions.onfailure; // adding attachment: system.io.memorystream ms = new system.io.memorystream(); system.io.streamwriter writer = new system.io.streamwriter(ms); writer.write("hello sample file"); writer.flush(); writer.dispose(); system.net.mime.contenttype ct = new system.net.mime.contenttype(system.net.mime.mediatypenames.text.plain); system.net.mail.attachment attach = new system.net.mail.attachment(ms, ct); attach.contentdisposition.filename = "myfile.txt"; mm.attachments.add(attach); ...