Monday, 15 July 2013

c# - Use MetadataType with Property Grid control? -



c# - Use MetadataType with Property Grid control? -

i have auto generated classes , need utilize metadatatype attribute apply various info annotations classes. works great in mvc app, need utilize same classes in winforms app , need utilize property grid command display / modify object properties. appears property grid not observe metadatatype, there simple way property grid see info annotations?

c# attributes metadata

c# 4.0 - Add behavior to existing implementation - C# / Design Pattern -



c# 4.0 - Add behavior to existing implementation - C# / Design Pattern -

my current implementation service , business layer straight forwards below.

public class myentity { } // business layer public interface ibusiness { ilist<myentity> getentities(); } public class mybusinessone : ibusiness { public ilist<myentity> getentities() { homecoming new list<myentity>(); } } //factory public static class mill { public static t create<t>() t : class { homecoming new mybusinessone() t; // returns instance based on t } } //service layer public class myservice { public ilist<myentity> getentities() { homecoming factory.create<ibusiness>().getentities(); } }

we needed changes in current implementation. reason beingness info grew on time , service & client cannot handle volume of data. needed implement pagination current service. expect more features (like homecoming fault when info more threshold, apply filters etc), design needs updated.

following new proposal.

public interface ibusiness { ilist<myentity> getentities(); } public interface ibehavior { ienumerable<t> apply<t>(ienumerable<t> data); } public abstract class mybusiness { protected list<ibehavior> behaviors = new list<ibehavior>(); public void addbehavior(ibehavior behavior) { behaviors.add(behavior); } } public class paginationbehavior : ibehavior { public int pagesize = 10; public int pagenumber = 2; public ienumerable<t> apply<t>(ienumerable<t> data) { //apply behavior here homecoming info .skip(pagenumber * pagesize) .take(pagesize); } } public class myentity { } public class mybusinessone : mybusiness, ibusiness { public ilist<myentity> getentities() { ienumerable<myentity> result = new list<myentity>(); this.behaviors.foreach(rs => { result = rs.apply<myentity>(result); }); homecoming result.tolist(); } } public static class mill { public static t create<t>(list<ibehavior> behaviors) t : class { // returns instance based on t var instance = new mybusinessone(); behaviors.foreach(rs => instance.addbehavior(rs)); homecoming instance t; } } public class myservice { public ilist<myentity> getentities(int currentpage) { list<ibehavior> behaviors = new list<ibehavior>() { new paginationbehavior() { pagenumber = currentpage, } }; homecoming factory.create<ibusiness>(behaviors).getentities(); } }

experts please suggest me if implementation right or on killing it. if right design pattern - decorator or visitor.

also service returns json string. how can utilize behavior collections serialize selected properties rather entire entity. list of properties comes user request. (kind of column picker)

looks don't have plenty points comment on question. so, gonna create assumption not c# expert.

assumption 1: looks getting info first , applying pagination using behavior object. if so, wrong approach. lets there 500 records , showing 50 records per fetch. instead of fetching 50 records db, fetching 500 records 10 times , on top of adding costly filter. db improve equipped job c# or java.

i not consider pagination behavior respect service. behavior of presentation layer. service should worry 'data granularity'. looks 1 of client wants info in 1 go , others might want subset of data.

option 1: in dao layer, have 2 methods: 1 pagination , other regular fetch. based on incoming params decide method call.

option 2: create 2 methods @ service level. 1 little subset of info , other whole set of data. since said json, should restful service. based on incoming url, phone call right method. if utilize jersey, should easy.

in service, new behaviors can added exposing new methods or adding new params existing methods/functionalities (just create sure changes backward compatible). don't need decorator or visitor pattern. concern no existing user should affected.

c#-4.0 design-patterns

css - Why doesn't border-style: double; render? -



css - Why doesn't border-style: double; render? -

i have h1 on i've defined next styles:

h1 { text-align: center; border: double black 1px; padding: 1em; margin: 1em; }

here's jsfiddle: http://jsfiddle.net/katiek/hs3zq/

i set border-style double, i'm seeing single border rendered. why isn't double border rendering?

double displays 2 straight lines add together pixel amount defined border-width (source).

you'll need utilize @ to the lowest degree 3px.

h1 { text-align: center; border: double black 3px; padding: 1em; margin: 1em; }

http://jsfiddle.net/hs3zq/6/

css

html - Flexible thumbnail overflowing -



html - Flexible thumbnail overflowing -

i have div contrains 3 images. images flexible depending on size of div, overflowing. works in total screen nicely not outside fullscreen.

here's looks before fullscreen:

html:

<div id="controls"> <button id="playbutton">play</button> <div id="defaultbar"> <div id="progressbar"></div> </div> <button id="vol" onclick="level()">vol</button> <button id="mute">mute</button> <button id="full" onclick="togglefullscreen()">full</button> </div> <div id="playlist" class="animated fadeinright"> <div class="thumb"><img src="tbgow.jpg" /></div> <div class="thumb"><img src="tblast.jpg" /></div> <div class="thumb"><img src="tbtwo.jpg"/></div> </div>

css:

#playlist{ position:absolute; display:block; border:1px solid red; height: 90%; width: 30%; top: 0px; right: 0px; z-index: 2; float:right; padding: 2px; margin: 2px; color:white; opacity: 0; } .thumb img{ max-width: 85%; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; border: 2px solid white; opacity:0.1; }

basically how create children element fill fit within parent div (either in or out of fullscreen.

op says works him http://jsfiddle.net/xdx49/27/

if goal have 3 images , images same height have increment height of #playlist div. should able remove height property altogether , should work.

if want more 3 images in future or might taller can experiment overflow property can set scroll bar on #playlist div. can style scroll bar decently ie , webkit browsers css or there jquery plugins total command on browsers.

http://jsfiddle.net/xdx49/5/

demonstrates issue. when element absolutely positioned , has height property content overflow may occur.

<div id="playlist"> <div class="thumb"> <img src="http://placehold.it/100x100" /> </div> <div class="thumb"> <img src="http://placehold.it/100x100" /> </div> <div class="thumb"> <img src="http://placehold.it/100x100" /> </div> </div> #playlist { position:absolute; display:block; border:1px solid red; height: 90%; width: 30%; z-index: 2; padding: 2px; margin: 2px; color:white; } .thumb img { max-width: 85%; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; border: 2px solid white; }

html css html5 css3

javascript - Submit form from a button tag -



javascript - Submit form from a button tag -

i added event listener when form submitted, code:

var formo = document.getelementbyid("ing"); formo.addeventlistener("submit", validation, false);

but i'm submitting form button tag code:

var enviar = document.getelementbyid("submit_btn"); enviar.addeventlistener("click", envioformulario, false); function envioformulario() { this.disabled = true; this.value = "sending"; this.form.submit(); }

with form submitted submit event (the first lines of code) doesn't seems work can create work?

i agree @mathletics comment. validation when click, , submit if passes validation:

var enviar = document.getelementbyid("submit_btn"); enviar.addeventlistener("click", envioformulario, false); function envioformulario() { if (validation()) { this.disabled = true; this.value = "sending"; this.form.submit(); } else { alert("validation failed. didn't submit"); } }

javascript html forms events submit

Typewriter Effect with jQuery sequence messages -



Typewriter Effect with jQuery sequence messages -

i trying typewriter effect jquery display messages in sequence couple of seconds between each message.

here code jsfiddle

var where, when; //added $.fn.teletype = function(opts){ var $this = this, defaults = { animdelay: 50 }, settings = $.extend(defaults, opts); var letters = settings.text.length; //added = '#' + $($this).attr('id'); //added when = settings.animdelay; //added $.each(settings.text, function(i, letter){ settimeout(function(){ $this.html($this.html() + letter); }, settings.animdelay * i); }); }; $(function(){ $('#container1').teletype({ animdelay: 100, text: 'this message 1' }); $('#container2').teletype({ animdelay: 100, text: 'this message 2' }); });

but problem messages run together

how can command time between messages?

jsfiddle updated: http://jsfiddle.net/dnkwp/19/

and code below

var where, when, iteration; //added iteration = 0; bigdelay = 0; $.fn.teletype = function(opts){ iteration++; var $this = this, defaults = { animdelay: 50 }, settings = $.extend(defaults, opts); var letters = settings.text.length; //added = '#' + $($this).attr('id'); //added when = settings.animdelay; //added if (iteration > 1) { bigdelay = bigdelay + settings.text.length * settings.animdelay; settimeout(function () { $.each(settings.text, function(i, letter){ settimeout(function(){ $this.html($this.html() + letter); }, settings.animdelay * i); }); }, bigdelay); } else { $.each(settings.text, function(i, letter){ settimeout(function(){ $this.html($this.html() + letter); }, settings.animdelay * i); }); } }; $(function(){ $('#container1').teletype({ animdelay: 100, text: 'this message 1' }); $('#container2').teletype({ animdelay: 100, text: 'this message 2' }); $('#container3').teletype({ animdelay: 100, text: 'this message 3' }); $('#container4').teletype({ animdelay: 100, text: 'this message 4' }); }); // added reversing function

jquery

ios - Consistency between the same database accessed in the appdelegate and a view controller -



ios - Consistency between the same database accessed in the appdelegate and a view controller -

i've been working core info , uimanageddocument lately, , have questions.

i've uitableviewcontroller in open uimanageddocument. here download info tableviewcotroller , save info database , update tableview. when come in main screen via home button , open app again, want work info database in appdelegate . in appropriate method in appdelegate, open database, fetch entities want , alter properties in objects want. now, works, manage open database , objects want database.

my problem occours when i'm done changing info database in appdelegate. because after appdelegate method completed, seek refetch info in tableview same database, @ point of time database hasn't registered changes made in method called in appdelegate. i've tried calling savetourl overwriting method on uimanageddocument right after changes made within appdelegate , ive tried save: method on managedobjectcontext. what's right way of saving changes database gets updated?

ps: i'm writing on ipad, havnt managed upload code, i'll upload later.

thanks

that right way - create changes in nsmanagedobjectcontext save. remember savetourl asynchronous, problem save has not completed time perform fetch in table view. that's completion block comes in. maybe have completion block set property in table view causes fetch happen. like

// appdelegate [self.maindatabase savetourl:self.maindatabase.fileurl forsaveoperation:uidocumentsaveforoverwriting completionhandler:^(bool success) { if (success) { mytableview.context = self.maindatabase.managedobjectcontext; } }]; // tableview - (void)setcontext:(nsmanagedobjectcontext *)newcontext { _context = newcontext; nsarray *fetchresults = [_context executefetchrequest:somefetchrequest error:&error]; // update model etc. }

ios core-data nsmanagedobjectcontext save uimanageddocument

jquery - Improving speed and data efficiency with javascript calculator. -



jquery - Improving speed and data efficiency with javascript calculator. -

i'm building javascript calculator (with jquery mobile) simplifying routine calculations in microscopy. i'm looking create more efficient code , love input... don't expect dig through whole thing, here link programme reference: http://www.iscopecalc.com

(the javascript calculator @ http://www.iscopecalc.com/js/calc.js )

the calculator consists of 12 inputs user can set. using values received these inputs, calculator generates values 15 different parameters , outputs results in display. currently, whenever state of input changes, bind alter event quick function writes value input cookie. meat of programme comes "updatecalc()" function reads values of inputs (from stored cookies) , recalculates every 1 of parameters displayed , outputs them. i've coped function here ease of access:

function updatecalc(){ readvalues(); //load current calculator state cookies var info = $.cookie(); //puts cookie info object var fluordata = fluorotable[data['fluorophore']]; //fluorophore info taken table @ end of file depending on chosen fluorophore var fluorem = fluordata['fluorem']; var fluorex = fluordata['fluorex']; var cameradata = cameratable[data['camera']]; //camera info taken table @ end of file depending on chosen photographic camera var campix = cameradata['campix']; var chipwidth = cameradata['chipwidth']; var chipheight = cameradata['chipheight']; var chiphpix = cameradata['chiphpix']; var chipvpix = cameradata['chipvpix']; var refind = data['media']; //simple variables taken straight calculator inputs var na = data['naslider']; var obj = data['objective']; var cammag = data['camerarelay']; var csumag = data['csurelay']; var bin = data['binning']; var pinholerad; var fovlimit; var mode; if (data['modality']=='widefield'){ //fovlimit, pinholerad, , csu mag depend on modality chosen fovlimit = 28; pinholerad = nan; mode = 'widefield'; csumag = 1; } else if (data['modality']=='confocal'){ if (data['csumodel']=='x1'){ pinholerad = 25; if(data['borealis']=='true'){ mode = "borealis csu-x1"; fovlimit = 9; } else { mode = "yokogawa csu-x1"; fovlimit = 7; csumag = 1; } } else if (data['csumodel']=='w1'){ mode = "yokogawa csu-w1"; fovlimit = 16; pinholerad = data['w1-disk']/2; csumag = 1; } } //these main outputs , depend on input variables above var latres = 0.61 * fluorem / na; var axres = 1.4 * fluorem * refind / (na*na); var bppinhole = 1000 * pinholerad / (obj * csumag); var au = bppinhole / latres; var totalmag = obj * cammag * csumag; var bppixel = 1000 * campix * bin / totalmag; var samples = latres / bppixel; var pixperpin = bppinhole * 2 / bppixel; var samplit = 1000 * fovlimit / (obj * csumag); var coverage = fovlimit * cammag / chipheight; if (coverage < 1) { chipused = coverage; fov = samplit; } else { chipused = 1; fov = samplit * chipheight / (fovlimit * cammag); } var sampwaste = 1 - fov / samplit; var imgpix = 1000 * fov / (chipvpix / bin); //function goes on update display calculated values... }

it works ok , i'm pleased results here's i'd advice on:

each of input variables affects handful of outputs (for instance, alter in input #3 alter calculation few of outputs... not 15), however, function recalculates outputs everytime of inputs changed, regardless of relevance... i've considered making giant if-then function selectively update outputs have changed based on input changed. take larger amount of code, i'm wondering if (once loaded) code faster when using calculator, of if waste of time , clutter code.

i'm wondering if storing inputs in cookies , reading values cookies reasonable way things , if should maybe create global variable instead stores state of calculator. (the cookies have added benefit of storing users calculator state later visits).

i'm pretty new @ stuff, , comments on how might improve efficiency of code appreciated (feel free link page should read, or method should using instance...)

if you've made far, time!!

javascript jquery jquery-mobile performance

ios - iPad App Crashes on Orientation change -



ios - iPad App Crashes on Orientation change -

i developing ipad app. allow both landscape , portrait mode. ui fine in portrait mode when alter landscape mode, ui gets messed up. saw posts related , added next code in initwith... in uiview.

[[uidevice currentdevice] begingeneratingdeviceorientationnotifications]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(abc) name:uideviceorientationdidchangenotification object:nil];

my ui working fine in portrait mode after doing this. when alter landscape mode, ui fine. after alter portrait mode, app crashes. read posts on related app crashing got know instruments. enabled zombies , found message beingness sent released object , message coming nsnotificationcenter.

is there else need handle apart registering device ? also, there way in can alter implementation uiview uiviewcontroller , implement methods uiviewcontroller has regarding device orientation ? please allow me know steps need follow in order done. thanks!

where registering notifications? need remove observer when alter orientations (either in prepforsegue or willanimaterotationtointerfaceorientation depending on you've got setup) in order prevent messaging no longer valid object. don't want pile several notifications if registering in viewdidappear/viewwillappear.

remove observer using:

[[nsnotificationcenter defaultcenter] removeobserver:self];//removes notifications object (the way i've used before)

or if want specific, like:

[[nsnotificationcenter defaultcenter] removeobserver:self name:uideviceorientationdidchangenotification object:[uidevice currentdevice];//remove notification

ios objective-c nsnotificationcenter device-orientation

android - Error: Change visibility of ''title'' to 'default' or Replace Bookinfo.title with getter -



android - Error: Change visibility of ''title'' to 'default' or Replace Bookinfo.title with getter -

i'm getting error on within fragment on bookinfo.title, bookinfo.author , book.isbn variables. have no thought why. documentation gives me error when trying right it. bookinf, has class consists of getters , setters. i'm getting error on word fragment in class bookdetailsfragment. error says add together @suppresslint 'newapi' bookdetailsfragment. help appreciated thanks.

here's code bookdetailsfragment:

import android.app.fragment; public class bookdetailsfragment extends fragment { @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { //view view = inflater.inflate(r.layout.book_details, container, false); view view = inflater.inflate(r.layout.book_details, null); system.out.println("bookdetailsactivity executed"); //defines textviews in r.layout.book_details textview bktitle = (textview)view.findviewbyid(r.id.booktitle); textview bkauth = (textview)view.findviewbyid(r.id.bookauthor); textview bkisbn = (textview)view.findviewbyid(r.id.bookisbn); //retrieve bundle object passed buyfragtab bundle b = getarguments(); //getting item's clicked position , setting corresponding details bktitle.settext("title: " + bookinfo.title[b.getint("position")]); bkauth.settext("author: " + bookinfo.author[b.getint("position")]); bkisbn.settext("isbn: " + bookinfo.isbn[b.getint("position")]); homecoming view; } }

here's bookinfo class code:

package com.skipster.bookbarter; public class bookinfo { private string title; private string author; private string isbn; public bookinfo(string title, string author, string isbn) { this.title = title; this.author = author; this.isbn = isbn; // todo auto-generated constructor stub } public string gettitle() { homecoming title; } public void settitle(string title) { this.title = title; } public string getauthor() { homecoming author; } public void setauthor(string author) { this.author = author; } public string getisbn() { homecoming isbn; } public void setisbn(string isbn) { this.isbn = isbn; } //returns previous variables programme made phone call @override public string tostring() { homecoming title + " " + author + " " + isbn; } }

here's code bookdetailsactivity:

import android.os.bundle; import android.app.activity; import android.app.fragmentmanager; import android.app.fragmenttransaction; public class bookdetailsactivity extends activity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); //setting layout activity setcontentview(r.layout.book_details_activity_layout); //get fragment manager fragment related operations fragmentmanager fm = getfragmentmanager(); //get fragment transaction object, can add, move or replace fragmnt fragmenttransaction ft = fm.begintransaction(); //instantiating fragment bookdetailsfragment bookdetailsfragment detailsfragment = new bookdetailsfragment(); //creating bundle object pass info (clicked item's position) //from activity fragment bundle b = new bundle(); //setting info bundle object intent b.putint("position", getintent().getintextra("position", 0)); system.out.println("the bundle passed" + b); //setting bundle object fragment detailsfragment.setarguments(b); //adding fragment fragment transaction ft.add(r.id.book_details_fragment_container, detailsfragment); //add fragment transaction backstack ft.addtobackstack(null); //executing transaction ft.commit(); } }

here's code onclicklistener starts intent:

booklv.setonitemclicklistener(new onitemclicklistener() { public void onitemclick(adapterview<?> parent, view view, int position, long id){ string selecttitle, selectauthor, selectisbn = null; //when item clicked, show it's detailed view bookinfo bkrecs = (bookinfo)parent.getitematposition(position); //creating intent object start bookdetailsactivity intent bkintent = new intent("com.skipster.bookbarter.bookdetailsactivity"); //setting info (the clicked item's position intent bkintent.putextra("position", position); system.out.println("data loaded intent"); //start activity startactivity(bkintent); system.out.println("intent activity started"); } });

fragment class added in api 11. looks minsdk version older this. if want utilize fragments in older sdk, should utilize back upwards library, gives back upwards fragments..

for back upwards library refer : http://developer.android.com/tools/extras/support-library.html

android android-intent visibility fragment

php - Email not triggering on redirect to page -



php - Email not triggering on redirect to page -

i have form triggers email on submit want redirect different page on submit.

at moment email comes through next (i.e reloading same page):

<form id="customisesystem" name="enquiry" onsubmit="return formcheck(this);" method="post" action="<?php echo the_permalink(); ?>">

i want alter following:

<form id="customisesystem" name="enquiry" onsubmit="return formcheck(this);" method="post" action="<?php bloginfo('url'); ?>/thank-you">

this doesn't trigger email.

can see going wrong?

this script sends email.

<? if(isset($_post['submit'])) { $to = "rob@domain.com"; $header = 'from: admin@domain.com'; $subject = "quotation"; $enquiry_first_name = $_post['enquiryfirstname']; $enquiry_last_name = $_post['enquirylastname']; $enquiry_title = $_post['enquirytitle']; $enquiry_organisation = $_post['enquiryorganisation']; $enquiry_address = $_post['enquiryaddress']; $enquiry_country = $_post['enquirycountry']; $enquiry_email_address = $_post['enquiryemailaddress']; $enquiry_telephone = $_post['enquirytelephone']; $enquiry_additional_comments = $_post['enquiryadditionalcomments']; $enquiry_product = get_the_title(); if(!empty($_post['hardware'])) { foreach($_post['hardware'] $check) { $hardwareresults .= $check."\n"; } } if(!empty($_post['systems'])) { foreach($_post['systems'] $check) { $systemsresults .= $check."\n"; } } $productresults = ""; $quantities = array_combine($_post['product'], $_post['quantity']); foreach ($quantities $product => $quantity) { if ($quantity > 0) { $productresults .= "$quantity x $product \n"; } } $body = "you have quote request website: name: $enquiry_title $enquiry_first_name $enquiry_last_name type of organisation: $enquiry_organisation address: $enquiry_address, $enquiry_country e-mail: $enquiry_email_address tel: $enquiry_telephone comments: $enquiry_additional_comments send more info on: $systemsresults quotation: $enquiry_product hardware: $hardwareresults accessories: $productresults kind regards"; mail($to, $subject, $body, $header); echo "thank enquiry."; } ?>

keep using <?php echo the_permalink(); ?> sends email

and after email code have used echo "thank enquiry."; replace

header('location: ' . bloginfo('url') . '/thank-you');

edit

to posted info within give thanks page, should pass info mail service page.

there 2 ways can send info on other page in situation

use methods. `/thank-you/?name=abc&age=xyz store values in session , access them on session page

edit

try this

header('location: http://www.yourblog.com/thank-you/?title=' . $enquiry_title);

and in give thanks page, variable, , echo variable want display it.

<?php $title = $_get['title']; ... ?> give thanks message , html construction message titled: <b> <?php echo $title; ?> </b> received. contact shortly .... blah blah

i hope create sense.

php wordpress forms

algorithm - Stackoverflow with Quicksort Java implementation -



algorithm - Stackoverflow with Quicksort Java implementation -

having problems implementing quicksort in java. stackoverflow error when run programme , i'm not sure why. if can point out error, great.

si starting index. ei ending index.

public static void qsort(int[] a, int si, int ei){ //base case if(ei<=si || si>=ei){} else{ int pivot = a[si]; int length = ei - si + 1; int = si+1; int tmp; //partition array for(int j = si+1; j<length; j++){ if(pivot > a[j]){ tmp = a[j]; a[j] = a[i]; a[i] = tmp; i++; } } //put pivot in right position a[si] = a[i-1]; a[i-1] = pivot; //call qsort on right , left sides of pivot qsort(a, 0, i-2); qsort(a, i, a.length-1); } }

first should prepare bounds of qsort recursive phone call suggested keith, since otherwise you're sorting whole array on , on again. must adjust partition loop: j index, going origin of subarray end of (including lastly element). must loop si + 1 ei (including ei).

so corrected code. ran few test cases , seems sort fine.

public static void qsort(int[] a, int si, int ei){ //base case if(ei<=si || si>=ei){} else{ int pivot = a[si]; int = si+1; int tmp; //partition array for(int j = si+1; j<= ei; j++){ if(pivot > a[j]){ tmp = a[j]; a[j] = a[i]; a[i] = tmp; i++; } } //put pivot in right position a[si] = a[i-1]; a[i-1] = pivot; //call qsort on right , left sides of pivot qsort(a, si, i-2); qsort(a, i, ei); } }

java algorithm sorting stack-overflow quicksort

javascript - Caroufredsel infinite linear easing is adding margin after the last image that fits on screen -



javascript - Caroufredsel infinite linear easing is adding margin after the last image that fits on screen -

i'm using caroufredsel jquery plugin @ http://chiaroscurodev.telegraphbranding.com/ , can see, calculating number of whole images fit on screen given width of browser. adds margin after lastly image before scrolling next images.

my code:

$("#carousel").caroufredsel({ width : "100%", auto: { duration : 40000, easing : "linear", timeoutduration : 0, pauseonhover : "immediate" } });

i carousel infinitely scroll 100% of browser without adding margin after each image, constant stream of images.

also, know how implement feature when click image slides carousel image centered in browser?

thanks help.

javascript jquery carousel caroufredsel

c# - PDF to PNG with high resolution -



c# - PDF to PNG with high resolution -

i want convert pdf file png, want output 595*842 high resolution,

i used command:

gswin64.exe -q -sdevice=png16m -dsafer -dmaxbitmap=1000000000 -dtextalphabits=4 -dgraphicsalphabits=4 -dpdffitpage=true -sdevice=pngalpha -dbatch -dnopause -soutputfile=c:\cover.png c:\cover.pdf

i know can utilize -r300 alter dimension 2479*3509 also, i've tried -spapersize=a4 + -r300 didn't work.

how can have output in 595x842 high resolution?

current code:

processinfo = new system.diagnostics.processstartinfo( "gswin64.exe", "-q -sdevice=pngalpha -dbatch -dnopause -soutputfile=c:\\users\\mniyatkhair\\desktop\\cairocopy\\cover.png c:\\users\\mniyatkhair\\desktop\\cairocopy\\holding.pdf" ); // -r300 processinfo.createnowindow = true; processinfo.useshellexecute = true; processinfo.windowstyle = system.diagnostics.processwindowstyle.hidden; process = process.start(processinfo); process.waitforexit();

you can seek increment image resolution (for illustration -r(72*3)) , add together proportional downscale factor -ddownscalefactor=3. work native pdf matrixtransform.

c# ghostscript

android - Multiple definition of main for zlib -



android - Multiple definition of main for zlib -

i trying compile cocos2d-x project, when run build_native.sh error:

/users/default/documents/development/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi/objs-debug/game_shared/__/__/classes/3rdparty/zlib-1.2.3/minigzip.o: multiple definition of 'main' /users/default/documents/development/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs-debug/game_shared/__/__/classes/3rdparty/zlib-1.2.3/example.o: previous definition here /users/default/documents/development/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi/tiff.a(mkg3states.o): multiple definition of 'main' /users/default/documents/development/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs-debug/game_shared/__/__/classes/3rdparty/zlib-1.2.3/example.o: previous definition here collect2: ld returned 1 exit status make: *** [obj/local/armeabi/libgame.so] error 1 make: leaving directory //.....

i can build project without zlib, need it.

edit:

after removing example.c, this:

/users/default/documents/development/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi/tiff.a(mkg3states.o): multiple definition of 'main' /users/default/documents/development/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs-debug/game_shared/__/__/classes/3rdparty/zlib-1.2.3/minigzip.o: previous definition here

can exclude libtiff cocos2d or how can prepare this?

both minigzip , example source code files contain main() function. remove 1 don't need. i'm guessing it's in example.

android android-ndk jni cocos2d-x

what is difference between regular Akka actor and Camel consumer actor? -



what is difference between regular Akka actor and Camel consumer actor? -

a regular akka actor associated mailbox , dispather(thread pool), can set configuration or programmatically. can regular actor through path. regular actor dequeue message form mailbox first , processing message, etc

can same camel consumer actor? differences between regular actor , camel consumer actor?

yes, can same camel consumer actor. difference consumer actor registers camel endpoint.

akka actor consumer

actionscript 3 - Getting delta of array values from constantly updating array -



actionscript 3 - Getting delta of array values from constantly updating array -

having problem getting should rather simple work. updating array new values , need delta or difference between lowest , highest values. length of array should remain constant @ 10. problem 1st , lastly values of delta array seem change. missing?

although in as3, should identical in java or javascript

private var _deltaarray:array= new array(); private function update(myval:int):void{ if (_deltaarray.length < 10) { _deltaarray.push(myval); } if (_deltaarray.length >= 10) { _deltaarray.push(myval); var delta:int =getdelta(_deltaarray); _deltaarray.shift(); } }//end func private function getdelta(a:array):int { var total:number=0; var l:int=a.length if (l > 1) { a.sort(array.numeric); var delta:int=int(a[0]) - int(a[l - 1]); trace('getdelta delta= ' + delta); } homecoming delta; }//end func

this suggestion, why not maintain running count of delta? can code in pseudo-code, but:

private double max = double.min; private double min = double.max; private void update(integer value) { array.push(value); max = value > max ? value : max; min = value < min ? value : min; if (array.length > 10) { array.shift(); } } private int delta() { homecoming max - min; }

arrays actionscript-3 ecmascript-5

html - Fill rest of div after set pixel div -



html - Fill rest of div after set pixel div -

this question has reply here:

css side side div pixel , percent widths 7 answers

i have varying width div. within 2 others, 1 fixed width, other supposed fill rest of area. can't fill. depending on width of outer-box, either small, or big , drops below inner-box-1. how inner-box-2 fill rest of outer-box?

http://jsfiddle.net/y57yp/

html

<div id ="outer-box"> <div id="inner-box-1"></div> <div id="inner-box-2"></div> </div>

css

#outer-box{ width:50%; background:#fcc; position: relative; overflow: auto; } #inner-box-1{ height:50px; width:50px; background:#ccc; float:left; } #inner-box-2{ height:50px; width:80%; background:#555; float:left; }

this 1 of odd answers easy totally non-intuitive. need trigger block formatting context using overflow property in conjunction float property.

see jsfiddle example.

#inner-box-2{ height:50px; background:#555; overflow:auto; }

all did remove width , float #inner-box-2 div , add together overflow:auto

html css

Drupal 7: module to add a simple button in admin menu -



Drupal 7: module to add a simple button in admin menu -

i trying create simple module add together button in admin/config menu. need button run php script on click. far i've browsed dozens tutorials, not able see enabled module in admin/config menu item (even though have used code should redirect node/1).

here code have used:

function send_reminders_menu() { $items['admin/config/reminders'] = array( 'title' => 'reminders command panel', 'page callback' => 'drupal_goto', 'page arguments' => array('node/1'), 'access arguments' => array('access reminders command panel'), 'weight' => 50, 'type' => menu_local_task, ); homecoming $items;

change menu_local_task menu_normal_item.

menu_local_task expects one-level_up menu router item menu_default_local_task admin/config isn't. menu_normal_item adds normal menu item.

lastly, don't forget clear caches when you've made changes. luck!

drupal module

objective c - for loop with array ios -



objective c - for loop with array ios -

i have find way check (at touch of button) if text in textfield nowadays in xml file.

i thought if load xml file array utilize loop see if same result in array.

are not @ practical loops, explain me how can write code kind of problem?

i want if object not nowadays in whole array show alert

thanks

- (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. cose = [[nsarray alloc] initwithobjects:@"giovanni",@"giulio",@"ciccio",@"panzo", nil]; } - (void)didreceivememorywarning { [super didreceivememorywarning]; // dispose of resources can recreated. } -(ibaction)prova { (nsstring *myelement in cose) { if ([myelement isequaltostring:textfield1.text]) { label1.text = textfield1.text; } else { uialertview *alertcellulare = [[uialertview alloc] initwithtitle:@"attenzione!" message:@"connessione assente" delegate:self cancelbuttontitle:@"ok" otherbuttontitles:nil, nil]; [alertcellulare show]; } } }

with fast-enumeration:

-(ibaction)prova { bool nowadays = no; (nsstring *myelement in cose) { if ([myelement isequaltostring:textfield1.text]) { label1.text = textfield1.text; nowadays = yes; break; } } if (!present){ uialertview *alertcellulare = [[uialertview alloc] initwithtitle:@"attenzione!" message:@"connessione assente" delegate:self cancelbuttontitle:@"ok" otherbuttontitles:nil, nil]; [alertcellulare show]; } }

with block based enumeration

-(ibaction)prova { __block bool nowadays = no; [cose enumerateobjectsusingblock:^(nsstring *name, nsuinteger idx, bool *stop){ if ([name isequaltostring:textfield1.text]) { label1.text = textfield1.text; nowadays = yes; *stop = yes; } }]; if (!present){ uialertview *alertcellulare = [[uialertview alloc] initwithtitle:@"attenzione!" message:@"connessione assente" delegate:self cancelbuttontitle:@"ok" otherbuttontitles:nil, nil]; [alertcellulare show]; } }

ios objective-c cocoa-touch for-loop

c++ - '_T' was not declared in this scope? -



c++ - '_T' was not declared in this scope? -

what file should include have _t() macro? converts text iterals think. thought windows.h, have included already.

surprisingly not find reply on goolgle.

i found info asked in msdn under topic unicode programming summary .

the reply tchar.h.

c++ macros include g++ string-literals

Grails passing a list via rest post call -



Grails passing a list via rest post call -

i'm running problem trying grails pass list in post call. i'm using jaxrs plugin , trying pass simple list of integers in query parameter. post phone call looks executing correctly. however, on receiving side, first value of list comes through. signature post method below:

@post metaattributedescriptor post(@queryparam('keyname')string keyname, @queryparam('value')string value, @queryparam('metaattributeid')string metaattributeid)

when phone call query parameter value set [1,2,3,4,5], on receiving side, value set 1. there i'm missing far passing list via rest post call?

edit---

so client side looks this:

def list = [1,2,3,4,5] rest.post([path:'/path_to_service', queryparams: [keyname: 'key', value: list, metaattributeid: 'asdf8asdf7']])

while server side looks this:

@post metaattributedescriptor post(@queryparam('keyname')string keyname, @queryparam('value')string value, @queryparam('metaattributeid')string metaattributeid) println value

that outputs '1' itself. can't figure out why i'm losing rest of list.

grails post jax-rs

memcached - NHibernate.Caches.EnyimMemcached, protobuf-net.Enyim want conflicting versions of Enyim.Caching -



memcached - NHibernate.Caches.EnyimMemcached, protobuf-net.Enyim want conflicting versions of Enyim.Caching -

i'm trying wire nhibernate utilize enyim.memcached provider second-level caching. additionally, want enyim.memcached utilize protobuf-net serializer.

looking @ nuget , web, can find pretty much pieces need:

nuget:

protobuf-net.enyim protobuf-net (dependency of protobuf-net.enyim) enyimmemcached (enyim.caching) v2.12 (dependency of protobuf-net.enyim)

web: (http://sourceforge.net/projects/nhcontrib/files/nhibernate.caches/ -- couldn't find nuget bundle nhibernate.caches.enyimmemcached)

nhibernate.caches.enyimmemcached enyim.caching v2.3

however, when wire up, the located assembly's manifest definition not match assembly reference. error. issue appears be:

nhibernate.caches.enyimmemcached wants enyim.caching v2.3 protobuf-net.enyim wants enyim.caching v2.12

they don't play nice. tried adding assembly redirect, no avail:

<dependentassembly> <assemblyidentity name="enyim.caching" publickeytoken="cec98615db04012e" culture="neutral" /> <bindingredirect oldversion="0.0.0.0-2.3.0.0" newversion="2.3.0.0" /> </dependentassembly>

the "latest" enyim.caching assembly (via enyimmemcached package) has v2.12. d'oh! 2.12 is more recent 2.3. (thanks pointing out marc!)

any thoughts? there nhibernate.caches.enyimmemcached nuget bundle don't know about? or protobuf-net.enyim uses 2.3 instead of 2.12? can't imagine i'm 1 has tried utilize nhibernate-enyim-protobuf-net stack. , i'm surprised assembly binding redirect didn't prepare issue.

update: i'm go after next marc's advice. downloaded source of nhibernate.caches.enyimmemcached , changed enyim.caching reference unsigned v2.3 assembly signed 2.12 assembly. everything's gravy!

"only has v2.12" - tripped me sec there, 2.12 much more recent 2.3; 2.7 jan 2011; 2.12 oct 2012. don't seem able 2.3 @ (even via command-line tools). there no such thing "only ... v2.12", ecause @ time of writing, v2.12 is recent version.

the simplest thing can suggest, though, seek building protobuf transcoder manually, straight referencing whichever version nhibernate works with.

there seems some... oddness surrounding enyim tool; there @ to the lowest degree 2 different versions in wild (with different strong names iirc) - , have different interfaces (int16 vs int32 in few places, , flag vs flags, memory). could nhibernate using "other" one. went build nuget; - if "wrong" one, i'm happy re-evaluate that.

edit:

i downloaded nhch-3.2.0.ga-bin.zip link, , used sn -t <path> check public key; gives:

{path removed}\enyim.caching.dll not represent named assembly

i tried version freshly downloaded nuget via install-package enyimmemcached, gives:

public key token cec98615db04012e

so basically, @ point between 2.3 , 2.12, has started using strong name.

this means these dlls have fundamentally different identity , can never interchangeable. can't that, sadly. if can't update nh, have local build of protobuf tool against non-strong-named dll. if problems building relating missing fellow member flags, seek changing code locally flag.

personally, if had been me, adding, removing or changing public key token worthy of "major" revision update - i.e. going 3.0; since fundamentally breaking change.

nhibernate memcached protobuf-net enyim.caching

vbscript - The batch changes the vbs code making it unreadable for the vbs to use -



vbscript - The batch changes the vbs code making it unreadable for the vbs to use -

the batch changes vbs code making unreadable vbs use. how prepare this?

batch code:

echo const high = 128 >> prio.vbs echo strcomputer = "." >> prio.vbs echo set objwmiservice = getobject("winmgmts:" _ >> prio.vbs echo & "{impersonationlevel=impersonate}!\\" & strcomputer & "\root\cimv2") >> prio.vbs echo set colprocesses = objwmiservice.execquery _ >> prio.vbs echo ("select * win32_process name = 'file.exe'") >> prio.vbs echo each objprocess in colprocesses >> prio.vbs echo objprocess.setpriority(high) >> prio.vbs echo next >> prio.vbs

vbs orginal:

const high = 128 strcomputer = "." set objwmiservice = getobject("winmgmts:" _ & "{impersonationlevel=impersonate}!\\" & strcomputer & "\root\cimv2") set colprocesses = objwmiservice.execquery _ ("select * win32_process name = 'file.exe'") each objprocess in colprocesses objprocess.setpriority(high) next

vbs after :

const high = 128 strcomputer = "." set objwmiservice = getobject("winmgmts:" _ set colprocesses = objwmiservice.execquery _ ("select * win32_process name = 'file.exe'") each objprocess in colprocesses objprocess.setpriority(high) next

help please

& characters have special meaning in cmd (command-chaining), have escape them literal ampersands:

echo ^& "{impersonationlevel=impersonate}!\\" ^& strcomputer ^& "\root\cimv2") >> prio.vbs

batch-file vbscript

visual stuido 2012 my custom add in won't load on startup -



visual stuido 2012 my custom add in won't load on startup -

i have custom add together in working fine measure compile time , other custom stuff.

the problem every day have manually go to

tools -> add-in manager

and enable custom add together in.

any ideas?

thx

visual-studio-2012 visual-studio-addins

mysql - Distinct not working properly -



mysql - Distinct not working properly -

i've wrote query distinct still duplicate records returned.

select distinct `cuisine_types`.`id`, `cuisine_types`.`name`, `cuisine_types`.`image`, ( select group_concat(`tagname` separator ', ') `cuisine_tags` `cuisine_type` = `cuisine_types`.`id` ) tags, ( 3959 * acos( cos( radians(" . $dlat . ") ) * cos( radians( gps_lat ) ) * cos( radians( gps_lon ) - radians(" . $dlon . ") ) + sin( radians(" . $dlat . ") ) * sin( radians( gps_lat ) ) ) ) distance `company` left bring together `cuisine_types` on `company`.`cuisine_type_id` = `cuisine_types`.`id` having distance < " .$dmiles

when seek using group by function query isn't working properly. when utilize group by place above having:

group `cuisine_types`.`name`

examples:

when utilize these values:

$dlat = '52.779716'; $dlon = '21.84803'; $ikm = '30';

it returns:

id = 1 name = snackbar image = tags = patat, snacks distance = 17.4713944772963

when utilize $ikm 3000 returns row well:

id = 1 name = snackbar image = tags = patat, snacks distance = 722.407714147792

so 2 records. when utilize groupby , $ikm = 30; returns nothing. value of 3000 returns 1 row. have 1 record distance of 17 miles thats below 30.

this should prepare problem, issue distance calculation blocked group by function. putting equation in having itself, problem seemed fixed. sorry can't explain in more detail.

select `cuisine_types`.`name`, `cuisine_types`.`id`, `cuisine_types`.`image` `c`.`gps_lat` lat, `c`.`gps_lon` lon, (select group_concat(`tagname` separator ', ') `cuisine_tags` `cuisine_type`=`cuisine_types`.`id`) tags `company` c left bring together `cuisine_types` on c.`cuisine_type_id` = `cuisine_types`.`id` grouping `cuisine_types`.`name` having ( 3959 * acos( cos( radians(52.779716) ) * cos( radians( lat ) ) * cos( radians( lon ) - radians(21.84803) ) + sin( radians(52.779716) ) * sin( radians( lat ) ) ) ) < 2000;

mysql sql distinct having

c# - VLC ActiveX in a local webpage with WPF WebBrowser control -



c# - VLC ActiveX in a local webpage with WPF WebBrowser control -

so seek working vlc activex v.2 under wpf webbrowser control , load locally.

and vlc activex not working...

c#

void mainwindow_loaded(object sender, routedeventargs e) { var file = system.io.path.combine(system.appdomain.currentdomain.basedirectory, "index.html"); using (streamreader sr = new streamreader(file)) { string url = sr.readtoend(); wb.navigatetostring(url); } }

html

<!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="x-ua-compatible" content="ie=9"> <meta http-equiv="cache-control" content="max-age=0" /> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="expires" content="0" /> <meta http-equiv="expires" content="tue, 01 jan 1980 1:00:00 gmt" /> <meta http-equiv="pragma" content="no-cache" /> <title></title> </head> <body> <object width="720" height="408" id='vlc1_ie' events="true" codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab" classid="clsid:9be31822-fdad-461b-ad51-be1d1c159921"> <embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="videolan.vlcplugin.2" width="720" height="408" id="vlc1"> </embed> <param name="src" value="http://content.bitsontherun.com/videos/bkaovayt-52ql9xlp.mp4" /> <param name="showdisplay" value="true" /> <param name="autoplay" value="false" /> </object> </body> </html>

please note if load remotely working fine!

also have tried utilize index.html embedded resource.

so have used

stream docstream = assembly.getexecutingassembly().getmanifestresourcestream("wpfapplication12.index.html"); wb.navigatetostream(docstream);

is possible do? wpf webbrowser command limited execute local web page activex?

any clue?

p.s. i've tried same winform webbrowser command - no joy...

p.s.#2 i've tried project http://www.codeproject.com/articles/3919/using-the-webbrowser-control-simplified , same html vlc activex working fine there. done in c++ , dont know @ all... :(

p.s. #3 i've tried ms media player , vlc activex , ms media player working fine!

<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="videolan.vlcplugin.2" width="720" height="408" id="vlc1"> </embed> <object classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" <param name="url" value="example.wmv" > </object>

p.s.#4 have tried create vlc activex command dynamically using this illustration no joy @ all...

regarding comment:

please note if load remotely working fine!

are using net explorer test? if so, have plugins?

i inquire question because webbrowser command (at to the lowest degree in winforms) not back upwards plugins / add-ons. because works in full-blown browser not mean work in webbrowser. if using activex plugin vlc integration, won't work in webbrowser control.

edit in response comment

when seek code (and note i've changed sec line slightly):

stream docstream = assembly.getexecutingassembly().getmanifestresourcestream("wpfapplication12.index.html"); wb.navigatetostream(docstream);

...are saying doesn't load html at all? or load, video (vlc) command doesn't work?

c# .net browser activex vlc

delphi - Where and When is Application (TApplication) instance created? -



delphi - Where and When is Application (TApplication) instance created? -

where , when application instance created? (same goes screen instance) .

i don't see in forms or system initialization section. in cpu windows before application.initialize, see phone call @_initexe (sysinit) - leads _startexe (system) , whole lot of asm code - not create application instance far can tell.

what missing here?

it's easy plenty work out code. text search tapplication.create. illustration using ide's find in files feature.

but can lazy , debugger it.

enable debug dcus. set breakpoint in tapplication.create. run.

when programme breaks, @ phone call stack. see tapplication object instantiated initcontrols in controls unit. , initcontrols called initialization section of controls unit.

the total phone call stack plain vanilla vcl app looks this:

vcl.forms.tapplication.create(nil) vcl.controls.initcontrols vcl.controls.vcl.controls system.initunits system._startexe(???,???) sysinit._initexe($5a81bc) project1.project1 :749933aa kernel32.basethreadinitthunk + 0x12 :76f09ef2 ntdll.rtlinitializeexceptionchain + 0x63 :76f09ec5 ntdll.rtlinitializeexceptionchain + 0x36

doing same thing tscreen.create, see tscreen object instantiated in initcontrols().

i won't seek , explain of this. think there's plenty info , advice here work out here. although phone call stack xe3 application, same delphi 5 application.

delphi debugging initialization delphi-5

c# - Visual Studio setup project: run CustomActions/process as current user not system account -



c# - Visual Studio setup project: run CustomActions/process as current user not system account -

i'm using setup project in visual studio 2010 c# outlook add-in (office 2010/2013) , other standalone tool. during installation kill instances of outlook, afterwards want restart instance of outlook.

in addin project added installerclass , added installeventhandler(afterinstalleventhandler) execute

process.start("outlook");

while same command opens outlook in other compiled class, in context of installer outlook opens in profile creation assistant.

i tried run said working compiled exe user defined action after commit, same problem occurs.

any solution or explanation appreciated.

solution:

the installation runs in scheme account. therefor created process run in said business relationship not logged in user.

i created additional project (installhelper), includes the

process.start("outlook");

i added installhelper customaction on commit in setup project , changed installerclass false in properties of customaction. copied wirunsql.vbs project folder , added postbuildevent setup project:

@echo off cscript //nologo "$(projectdir)wirunsql.vbs" "$(builtouputpath)" "update customaction set type=1554 type=3602"

3602:

0x800 (msidbcustomactiontypenoimpersonate) 0x400 (msidbcustomactiontypeinscript) 0x200 (msidbcustomactiontypecommit) 0x12 (custom action type 18: exe)

1554:

0x400 (msidbcustomactiontypeinscript) 0x200 (msidbcustomactiontypecommit) 0x12 (custom action type 18: exe)

see: msdn: custom action in-script execution options

the type alter removed bit msidbcustomactiontypenoimpersonate (0x00000800), installhelper created process run logged in user, not system.

alternatively changes possible via opening msi in orca (has repeated after each build, prefer scripted change).

c# visual-studio-2010 setup-project outlook-2013

zend framework2 - use service locator for form or add the dependency and create an object? -



zend framework2 - use service locator for form or add the dependency and create an object? -

i getting hands on zend framework 2. have created user form , utilize form in controller can either include class in controller , create , object using new or can access form using service manager config access form.

i finding reasons using service manager here rather straight instantiating object. ideas??

the thought of service manager have ability replace form @ runtime. decoupling , reusability.

let's have module foo , there form foo\form\something. set foo module in application, need switch form else. if did $form = new foo\form\something in controller, have no simple alternative instantiate form. if register form under foo_form_something, bar module can overwrite service. foo_form_something not load foo\form\something bar\form\something. , there no alter required in controller.

there related coding style, inject form in controller instead of pulling via service manager. perhaps utilize this:

namespace mymodule\controller; class mycontroller { public function myaction() { $form = $this->getservicelocator()->get('foo_form_something'); } }

but makes testing of controllers much harder. easier inject dependency:

namespace mymodule\controller; utilize foo\form\something somethingform; class mycontroller { protected $form; public function __construct(somethingform $foo) { $this->form = $foo } public function myaction() { $form = $this->form; } }

and inject form in controller configuration:

namespace mymodule; class module { public function getcontrollerconfig() { homecoming array( 'factories' => array( 'mymodule\controller\mycontroller' => function($sm) { $form = $sm->getservicelocator()->get('foo_form_something'); $controller = new mymodule\controller\mycontroller($form); homecoming $controller; } ), ); } }

zend-framework2 service-locator servicemanager

Best way to manage synchronous server side data in AngularJS -



Best way to manage synchronous server side data in AngularJS -

i'm using oauth manage session users in angularjs app. angular app needs know info session user because used in $resource objects(to create rest calls /user/:user/projects). want user variable global , synchronous, making async phone call $resource or $http user adds boilerplate code needs session user(because has wait user info homecoming server).

right i'm using dirty hack resolves issue: in index.ejs file(notice user rendered server side ejs)

<script type="text/javascript"> var session_user = <%- user %>; </script>

and

$rootscope.user = session_user

the problem when unit test controller, of course of study session_user not defined.

i'm thinking maybe create service returns session_user variable, can utilize mock testing. other ideas? recommended aproach kind of problems?

it doesn't seem much of dirty hack actually. seem problematic if session user alter without reloading html server (and thereby getting new session user).

angular modules have constant function utilize sort of thing:

angular.module("mymodule", []) .constant("user", window.session_user);

and can treat user injectable value in controllers.

angularjs

c# - C Sharp Stored procedure Timeout on second run -



c# - C Sharp Stored procedure Timeout on second run -

i calling stored procedure via c sharp , unusual reason timeouts on sec run.

the code phone call stored procedure:

private void loaddata() { backgroundworker bw = new backgroundworker(); bw.dowork += new doworkeventhandler(bw_loaddata); bw.runworkercompleted += new runworkercompletedeventhandler(bw_loaddatacomplete); busy.isbusy = true; busy.busycontent = "loading data"; bw.runworkerasync(); } void bw_loaddata(object sender, doworkeventargs e) { sqlconnection con = new sqlconnection(logic.getconnectionstring()); con.open(); sqlcommand com = new sqlcommand("spgetuserdata", con); com.commandtype = system.data.commandtype.storedprocedure; com.parameters.add(new sqlparameter("@uid", uid)); //timeouts here on sec run sqldatareader readuserdata = com.executereader(); while (readuserdata.read()) { origname = readuserdata[0].tostring(); origemail = readuserdata[1].tostring(); origcontact = readuserdata[2].tostring(); origadd1 = readuserdata[3].tostring(); origadd2 = readuserdata[4].tostring(); origstate = readuserdata[5].tostring(); origcity = readuserdata[6].tostring(); origzip = readuserdata[7].tostring(); origcountry = readuserdata[8].tostring(); } con.close(); con.dispose(); e.result = "ok"; } void bw_loaddatacomplete(object sender, runworkercompletedeventargs e) { busy.isbusy = false; txtfullname.text = origname; txtemail.text = origemail ; txtcontact.text= origcontact; txtadd1.text= origadd1; txtadd2.text= origadd2 ; txtstate.text= origstate; txtcity.text= origcity; txtzip.text = origzip; cbocountry.selecteditem = origcountry; }

first method phone call during window load event.. works expected.

private void window_loaded_1(object sender, routedeventargs e) { loaddata(); }

second method phone call in timeout occurs.

void bw_changeemailcomplete(object sender, runworkercompletedeventargs e) { if (e.result.tostring() == "ok") { busy.isbusy = false; messagebox.show("the email address changed successfully", "message", messageboxbutton.ok, messageboximage.information); } else { busy.isbusy = false; messagebox.show("an unexpected error occured or email exist", "error", messageboxbutton.ok, messageboximage.error); } loaddata(); }

and finnaly stored procedure

create proc [dbo].[spgetuserdata] @uid varchar(50) select fullname,email,contact,address1,address2,state,city,zip,country,subdate,sid users uid = @uid

update

still not working after trying , manually disposing info reader

using (sqlconnection con = new sqlconnection(logic.getconnectionstring())) { using (sqlcommand com = new sqlcommand("spgetuserdata", con)) { com.commandtype = system.data.commandtype.storedprocedure; com.parameters.add(new sqlparameter("@uid", uid)); con.open(); using (var readuserdata = com.executereader()) { while (readuserdata.read()) { origname = readuserdata[0].tostring(); origemail = readuserdata[1].tostring(); origcontact = readuserdata[2].tostring(); origadd1 = readuserdata[3].tostring(); origadd2 = readuserdata[4].tostring(); origstate = readuserdata[5].tostring(); origcity = readuserdata[6].tostring(); origzip = readuserdata[7].tostring(); origcountry = readuserdata[8].tostring(); } } } }

you forgot dispose datareader, readuserdata.

put in using statement:

using (var readuserdata = com.executereader()) { while (readuserdata.read()) ... }

(use using sqlconnection too-- using strictly improve manually calling close() and/or dispose().)

c# sql-server wpf sql-server-2012

jquery - Change the cursor to a circle? -



jquery - Change the cursor to a circle? -

i'm building website, , part of have whiteboard feature (which canvas). i'm trying implement eraser function whiteboard, , wanted cursor alter shape when eraser selected matches way in erasing going happen (at point i'm trying erase in circle shape). far i've tried this:

$('#canvasdiv').css('cursor','url(https://example.com/eraser_cursor.png)');

this not work 2 reasons:

although image of cursor circle not centered on cursor seem user erasing else.

once user starts erasing , holds "click" cursor changes different shape.

is there way around this?

there "x y" alternative - cursor: url() x y (as far know works in ff/chrome)

i think !important should prepare it

jquery css canvas cursor

django - Fields undefined -



django - Fields undefined -

i'm new django, decided seek tutorial.

and problem comes: added code polls/models.py

from django.db import models class poll(models.model): question = models.charfield(max_length=200) pub_date = models.datetimefield('date published') class choice(models.model): poll = models.foreignkey(poll) selection = models.charfield(max_length=200) votes = models.integerfield()

now have 4 error messages this:

undefined variable import: charfield models.py /mysite/polls line 4 pydev problem

but models.field class right.

what doing wrong?

don't know if help, python 3.3 , aptana studio 3 used. created project command line told in tutorial , copied .project , .pydevproject files , changed paths , names there.

upd: began work after changed python 3.3 python 2.7. unlimited!

django django-models

iphone - Background animation issue iOS -



iphone - Background animation issue iOS -

i due launch new app within 2 days

the background image animated sky

when switching between settings page (static image) , home page (animated image) screen animation drops off , becomes single black image

can suggest reason or solution?

i not doing coding project, relay feedback programmer

thank you!

henry colour vision apps

iphone ios animation

php - Conditional Causes Code to Fail -



php - Conditional Causes Code to Fail -

i writing little email-to-text script, , seems every time wrap "domail()" function in if-statement, fails, or within function, if wrap mail() function if-statement, fails.

however, if remove conditionals, works charm? should , cause of this?

edit: "...it fails," mean echoes "something went wrong!" should according code.

here code:

<?php error_reporting(e_all); session_start(); if (!$_session['doesexist'] == true) { echo "session doesn't exist!"; die(); } if (!isset($_post['num']) || !isset($_post['carrier']) || !isset($_post['msg'])) { echo "failed!"; die(); } $num = $_post['num']; $car = $_post['carrier']; $msg = $_post['msg']; $subject = ''; $head = 'from: admin@google.com' . "\r\n"; switch ($car) { case "att": $num .= "@txt.att.net"; break; case "verizon": $num .= "@vtext.com"; break; case "tmobile": $num .= "@tmomail.net"; break; } function domail($tonum, $sub, $message, $headers) { if(mail($tonum, $sub, $message, $headers)) { echo "done!"; } else { echo "something went wrong!"; } } domail($num, $subject, $msg, $head); ?>

apparently according comment mail() function may homecoming empty string instead of boolean value of true , such evaluated false in conditional statement empty value considered false.

php

Can we use Microsoft.Phone.DeviceManufacturers namespace in official Windows Phone 8 sdk? -



Can we use Microsoft.Phone.DeviceManufacturers namespace in official Windows Phone 8 sdk? -

who knows if can reference microsoft.phone.devicemanufacturers component within official windows phone 8 sdk? want develop background service using serviceagent class.

from msdn (http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj208461(v=vs.105).aspx)

"this api not intended used straight code."

so, no can't utilize normal sdk app distribute via store - restricted api. may able utilize in app load on dev-unlocked phone.

windows-phone-8

android - Places Autocomplete API to get GPS coordinates from address entered -



android - Places Autocomplete API to get GPS coordinates from address entered -

i have address field in app user needs come in required address. have used google geocoder gps coordinates of address . want create easier user using places autocomplete . places autocomplete returns address , id , reference of place .

is there way gps coordinates of address selected user using places autocomplete api ? have utilize geocoder 1 time again after user selects address places autocomplete ?

or should utilize places api 1 time again after user selects address gps coordinates of address ? dont want send multiple requests places api because of usage limits in place . . expected response places api ..there no gps coordinates in response .

"status": "ok", "predictions": [ { "description": "paris, france", "id" : "691b237b0322f28988f3ce03e321ff72a12167fd", "reference": "ciqyaaaa0q_ja...kt3ufvlddvtqsowz_tc", "terms": [ { "value": "paris", "offset": 0 }, { "value": "france", "offset": 7 } ], "types": [ "geocode" ], "matched_substrings": [ { "offset": 0, "length": 5 } ] }, { "description": "paris, tx, united states", "id" : "518e47f3d7f39277eb3bc895cb84419c2b43b5ac", "reference": "cjqjaaaahnbxzz...bdr3iiofdmtxwo1jhg", "terms": [ { "value": "paris", "offset": 0 }, { "value": "tx", "offset": 7 }, { "value": "united states", "offset": 11 } ], "types": [ "geocode" ], "matched_substrings": [ { "offset": 0, "length": 5 } ] }, { "description": "paris, ontario, canada", "id" : "e7ac9c89d4a590305242b0cb5bf43064027223c9", "reference": "cjqhaaaaiv_ywyt...f8kzhy36twmrbyu_g", "terms": [ { "value": "paris", "offset": 0 }, { "value": "ontario", "offset": 7 }, { "value": "canada", "offset": 16 } ], "types": [ "geocode" ], "matched_substrings": [ { "offset": 0, "length": 5 } ] }

you utilize place details part of places api actual place reference in each suggestion using "reference" value. example:

https://maps.googleapis.com/maps/api/place/details/json?reference=ciqyaaaa0q_ja...kt3ufvlddvtqsowz_tc&sensor=true&key=addyourownkeyhere

this give info place including coordinates (point specific location, bounds area).

android google-places-api google-geocoder google-geocoding-api

Searching for a string in all tables of database in SQL Server 2000 -



Searching for a string in all tables of database in SQL Server 2000 -

there many answers in many places question, such as:

search string in tables, rows , columns of db

however using sql server 2000 , need same thing: search tables in database specific string.

declare @searchstring varchar(32); set @searchstring = 'something'; create table #results(o nvarchar(512), c sysname, value nvarchar(4000)); declare @sql nvarchar(4000), @o nvarchar(512), @c sysname; declare c cursor local fast_forward select quotename(u.name) + '.' + quotename(o.name), quotename(c.name) sysobjects o inner bring together syscolumns c on o.id = c.id inner bring together sysusers u on o.uid = u.uid c.xtype in (35, 99, 167, 175, 231, 239) , o.xtype = 'u'; open c; fetch c @o, @c; while @@fetch_status = 0 begin set @sql = n'insert #results(o,c,value) select @o, @c, convert(nvarchar(4000), ' + @c + ') ' + @o + ' ' + @c + ' ''%' + @searchstring + '%'';'; exec sp_executesql @sql, n'@o nvarchar(512), @c sysname', @o, @c; fetch c @o, @c; end close c; deallocate c; select o, c, value #results; drop table #results;

sql-server sql-server-2000

regex to extract the number from sring -



regex to extract the number from sring -

i have string this

file-myfle_20130207_094852am.csv

how go writing regex extract numbers

20130207094852

like (this pretty mutual among regex tutorials)

\d+

each grouping numbers.

regex

c - copying a string from one pointer to another -



c - copying a string from one pointer to another -

#include <stdio.h> #include <string.h> #include <stdlib.h> char * find_dot(); char * find_end(); int main(int argc, char * argv[]){ char *file_extension[10]; int i; for(i = 1; < argc; i++){ //if alternative if(argv[i][0] == '-'){ switch(argv[i][0]){ default:; } //otherwise, should file }else{ char *dot_location_ptr; char *end_location_ptr; char *filename_ptr = argv[i]; dot_location_ptr = find_dot(filename_ptr); end_location_ptr = find_end(filename_ptr); memcpy(file_extension, dot_location_ptr, end_location_ptr - dot_location_ptr);

where find_dot returns pointer '.' in argument, using strrchr, , find_end returns pointer '\0' in argument.

it compiles, segmentation fault. i'm trying capture file extension string, , compare extension other strings.

char *file_extension[10]; ^

you're not declaring file_extension right. need char array, not array of pointers. drop *.

c pointers

java - NoClassDefFoundError + Appl -



java - NoClassDefFoundError + Appl -

i seek create first applet. called memosaver2.java

also created html:

<html> <object classid="java:memosaver2.class" type="application/x-java-applet" archive="memosaver2.jar" height="300" width="450" > </object> </html>

and this:

<html> <head> <title>memo saver applet</title> </head> <applet code="ch13.memosaver2.class" width = 600 height= 400> java not installed. </applet> </html>

but same error.

noclassdeffounderror memosaver2( wrong name: ch13/memosaver2)

what should running applet browser?

list item /home/me/workspace/myproject/bin applet.html

/home/me/workspace/myproject/bin/test simpleapplet.class

if class simpleapplet in bundle test set html in parent directory (as detailed above), , utilize html.

java html applet noclassdeffounderror

android - How do I use the value of a variable AS a variable -



android - How do I use the value of a variable AS a variable -

haven't come across in coding android yet. how utilize value of 1 variable new variable.

i want take value of variable "file1.mp3" strip off extension , append text variable , utilize variable name file1_title.txt , file1_desc.txt.

so fname[1] might equal file1.mp3

and want create new variable

file1_title.txt equals "song title one"

file1_desc.txt equals "description of file one"

both based on value of fname[1]

fname[2] equals file2.mp3

file2_title.txt equals "song title two"

file2_desc.txt equals "description of file two"

both based on of value fname[2]

etc...

how done android

not sure if you're looking for. basic java string formating.

string attr1 = "song.mp3"; string attr2 = attr1.split(".")[0] + ".txt";

naturally add together necessary null checks.

==update==

so if understand correctly, file name ("asd.mp3") , need song title , description.

string attr1 = "song.mp3"; string songname = ""; string songdesc = ""; string[] splitarray = attr1.split("."); if(splitarray[0] != null){ string songname = attr1.split(".")[0]; file f = new file(path + songname +".txt"); //i didn't quite understand in format data, //especially description. however, in map //where songname key, suggested above, , here write description file(f)

}

android variables

java - JavaFX application working in traditional way but not in web-start or browser launch -



java - JavaFX application working in traditional way but not in web-start or browser launch -

hello stackoverflowers...

this first post. ok here problem:

i working javafx project, "online quizzing application". using netbeans7.3 rc1 , have set build self contained package follows:

<!-- self contained application --> <target name="-post-jfx-deploy"> <fx:deploy width="${javafx.run.width}" height="${javafx.run.height}" nativebundles="all" outdir="${basedir}/${dist.dir}" outfile="${application.title}"> <fx:application name="${application.title}" mainclass="${javafx.main.class}"/> <fx:resources> <fx:fileset dir="${basedir}/${dist.dir}" includes="*.jar"/> </fx:resources> <fx:info title="${application.title}" vendor="${application.vendor}"/> </fx:deploy> </target> <!-- -->

the application has kind of forms come in details questions , options along button attached filechooser select image question/option. when finished, user can generate xml serializing info , save in directory selecting 1 time again filechooser. there several scenes, , 1 contain filechooser.

the application works fine when lauched netbeans , command prompt :

java -jar filename.jar

but when launched web-start or in browser, works till filechooser comes , no other buttons respond. unable move next scene.

i aware signing jars before deploying. after googling little came know can generate keystore , self signed certificate java's keytool. did that:

keytool -genkey -alias myalias -keyalg rsa -validity 360 -keysize 2048 -keystore keystore.jks -dname "cn=mydomain.com,ou=something, o=something, l=something, st=something, c=something"

and generated certificate follows:

keytool -certreq -alias myalias -file certificate.csr -keystore keystore.jks

next used netbeans sign jars setting project -> properties -> deployment, utilize keystore.jks file.

but problem still persists. can provide solution work here?? specifically, know whether missing here. helpful.

here total java console message: you may ignore java.io.filenotfoundexception: .\resources\dbdetails.properties (the scheme cannot find path specified) rest of should have been fine, see there classnotfoundexception dont know why so, although jars there.

thank you.

match: begintraversal match: digest selected jredesc: jredesc[version 1.6+, heap=-1--1, args=null, href=http://java.sun.com/products/autodl/j2se, sel=false, null, null], jreinfo: jreinfo index 0: platform is: 1.7 product is: 1.7.0_13 location is: http://java.sun.com/products/autodl/j2se path is: c:\program files\java\jre7\bin\javaw.exe args is: null native platform is: windows, x86 [ x86, 32bit ] javafx runtime is: javafx 2.2.5 found @ c:\program files\java\jre7\ enabled is: true registered is: true scheme is: true match: ignoring maxheap: -1 match: ignoring initheap: -1 match: digesting vmargs: null match: digested vmargs: [jvmparameters: issecure: true, args: ] match: jvm args after accumulation: [jvmparameters: issecure: true, args: ] match: digest launchdesc: file:/d:/my_projects/javafx/onlinequizzingapp_javafx/dist/online quizzing app.jnlp match: digest properties: [] match: jvm args: [jvmparameters: issecure: true, args: ] match: endtraversal .. match: jvm args final: match: running jreinfo version match: 1.7.0.13 == 1.7.0.13 match: running jvm args match: have:<> satisfy want:<> java.io.filenotfoundexception: .\resources\dbdetails.properties (the scheme cannot find path specified) @ java.io.fileinputstream.open(native method) @ java.io.fileinputstream.<init>(unknown source) @ com.sohail.online_quizzing_app.bootstrap.initialize(bootstrap.java:34) @ com.sohail.online_quizzing_app.onlinequizzingapp.start(onlinequizzingapp.java:57) @ com.sun.javafx.applet.fxapplet2$1.run(fxapplet2.java:131) @ com.sun.javafx.application.platformimpl$4$1.run(platformimpl.java:179) @ com.sun.javafx.application.platformimpl$4$1.run(platformimpl.java:176) @ java.security.accesscontroller.doprivileged(native method) @ com.sun.javafx.application.platformimpl$4.run(platformimpl.java:176) @ com.sun.glass.ui.win.winapplication._runloop(native method) @ com.sun.glass.ui.win.winapplication.access$100(winapplication.java:29) @ com.sun.glass.ui.win.winapplication$3$1.run(winapplication.java:73) @ java.lang.thread.run(unknown source) cacheentry[file:/d:/my_projects/javafx/onlinequizzingapp_javafx/dist/online quizzing app.jnlp]: updateavailable=true,lastmodified=fri feb 15 15:44:02 ist 2013,length=1034 cacheentry[file:/d:/my_projects/javafx/onlinequizzingapp_javafx/dist/online quizzing app.jnlp]: updateavailable=true,lastmodified=fri feb 15 15:44:02 ist 2013,length=1034 cacheentry[file:/d:/my_projects/javafx/onlinequizzingapp_javafx/dist/online quizzing app.jar]: updateavailable=true,lastmodified=fri feb 15 15:43:48 ist 2013,length=231526 java.lang.runtimeexception: java.lang.reflect.invocationtargetexception @ javafx.fxml.fxmlloader$controllermethodeventhandler.handle(fxmlloader.java:1440) @ com.sun.javafx.event.compositeeventhandler.dispatchbubblingevent(compositeeventhandler.java:69) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:217) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:170) @ com.sun.javafx.event.compositeeventdispatcher.dispatchbubblingevent(compositeeventdispatcher.java:38) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:37) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.eventutil.fireeventimpl(eventutil.java:53) @ com.sun.javafx.event.eventutil.fireevent(eventutil.java:28) @ javafx.event.event.fireevent(event.java:171) @ javafx.scene.node.fireevent(node.java:6863) @ javafx.scene.control.button.fire(button.java:179) @ com.sun.javafx.scene.control.behavior.buttonbehavior.mousereleased(buttonbehavior.java:193) @ com.sun.javafx.scene.control.skin.skinbase$4.handle(skinbase.java:336) @ com.sun.javafx.scene.control.skin.skinbase$4.handle(skinbase.java:329) @ com.sun.javafx.event.compositeeventhandler.dispatchbubblingevent(compositeeventhandler.java:64) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:217) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:170) @ com.sun.javafx.event.compositeeventdispatcher.dispatchbubblingevent(compositeeventdispatcher.java:38) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:37) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.eventutil.fireeventimpl(eventutil.java:53) @ com.sun.javafx.event.eventutil.fireevent(eventutil.java:33) @ javafx.event.event.fireevent(event.java:171) @ javafx.scene.scene$mousehandler.process(scene.java:3328) @ javafx.scene.scene$mousehandler.process(scene.java:3168) @ javafx.scene.scene$mousehandler.access$1900(scene.java:3123) @ javafx.scene.scene.impl_processmouseevent(scene.java:1563) @ javafx.scene.scene$scenepeerlistener.mouseevent(scene.java:2265) @ com.sun.javafx.tk.quantum.glassvieweventhandler$mouseeventnotification.run(glassvieweventhandler.java:250) @ com.sun.javafx.tk.quantum.glassvieweventhandler$mouseeventnotification.run(glassvieweventhandler.java:173) @ java.security.accesscontroller.doprivileged(native method) @ com.sun.javafx.tk.quantum.glassvieweventhandler.handlemouseevent(glassvieweventhandler.java:292) @ com.sun.glass.ui.view.handlemouseevent(view.java:528) @ com.sun.glass.ui.view.notifymouse(view.java:922) @ com.sun.glass.ui.win.winapplication._runloop(native method) @ com.sun.glass.ui.win.winapplication.access$100(winapplication.java:29) @ com.sun.glass.ui.win.winapplication$3$1.run(winapplication.java:73) @ java.lang.thread.run(unknown source) caused by: java.lang.reflect.invocationtargetexception @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ sun.reflect.misc.trampoline.invoke(unknown source) @ sun.reflect.generatedmethodaccessor2.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ sun.reflect.misc.methodutil.invoke(unknown source) @ javafx.fxml.fxmlloader$controllermethodeventhandler.handle(fxmlloader.java:1435) ... 52 more caused by: java.lang.noclassdeffounderror: org/apache/commons/codec/binary/base64 @ com.sohail.online_quizzing_app.methods.manageimages.read(manageimages.java:45) @ com.sohail.online_quizzing_app.controller.adminaddquestioncontroller.selectimage(adminaddquestioncontroller.java:84) ... 62 more caused by: java.lang.classnotfoundexception: org.apache.commons.codec.binary.base64 @ sun.plugin2.applet.plugin2classloader$2.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ sun.plugin2.applet.plugin2classloader.findclasshelper(unknown source) @ sun.plugin2.applet.jnlp2classloader.findclass(unknown source) @ sun.plugin2.applet.plugin2classloader.loadclass0(unknown source) @ sun.plugin2.applet.plugin2classloader.loadclass(unknown source) @ sun.plugin2.applet.plugin2classloader.loadclass(unknown source) @ java.lang.classloader.loadclass(unknown source) ... 64 more java.lang.runtimeexception: java.lang.reflect.invocationtargetexception @ javafx.fxml.fxmlloader$controllermethodeventhandler.handle(fxmlloader.java:1440) @ com.sun.javafx.event.compositeeventhandler.dispatchbubblingevent(compositeeventhandler.java:69) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:217) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:170) @ com.sun.javafx.event.compositeeventdispatcher.dispatchbubblingevent(compositeeventdispatcher.java:38) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:37) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.eventutil.fireeventimpl(eventutil.java:53) @ com.sun.javafx.event.eventutil.fireevent(eventutil.java:28) @ javafx.event.event.fireevent(event.java:171) @ javafx.scene.node.fireevent(node.java:6863) @ javafx.scene.control.button.fire(button.java:179) @ com.sun.javafx.scene.control.behavior.buttonbehavior.mousereleased(buttonbehavior.java:193) @ com.sun.javafx.scene.control.skin.skinbase$4.handle(skinbase.java:336) @ com.sun.javafx.scene.control.skin.skinbase$4.handle(skinbase.java:329) @ com.sun.javafx.event.compositeeventhandler.dispatchbubblingevent(compositeeventhandler.java:64) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:217) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:170) @ com.sun.javafx.event.compositeeventdispatcher.dispatchbubblingevent(compositeeventdispatcher.java:38) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:37) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.eventutil.fireeventimpl(eventutil.java:53) @ com.sun.javafx.event.eventutil.fireevent(eventutil.java:33) @ javafx.event.event.fireevent(event.java:171) @ javafx.scene.scene$mousehandler.process(scene.java:3328) @ javafx.scene.scene$mousehandler.process(scene.java:3168) @ javafx.scene.scene$mousehandler.access$1900(scene.java:3123) @ javafx.scene.scene.impl_processmouseevent(scene.java:1563) @ javafx.scene.scene$scenepeerlistener.mouseevent(scene.java:2265) @ com.sun.javafx.tk.quantum.glassvieweventhandler$mouseeventnotification.run(glassvieweventhandler.java:250) @ com.sun.javafx.tk.quantum.glassvieweventhandler$mouseeventnotification.run(glassvieweventhandler.java:173) @ java.security.accesscontroller.doprivileged(native method) @ com.sun.javafx.tk.quantum.glassvieweventhandler.handlemouseevent(glassvieweventhandler.java:292) @ com.sun.glass.ui.view.handlemouseevent(view.java:528) @ com.sun.glass.ui.view.notifymouse(view.java:922) @ com.sun.glass.ui.win.winapplication._runloop(native method) @ com.sun.glass.ui.win.winapplication.access$100(winapplication.java:29) @ com.sun.glass.ui.win.winapplication$3$1.run(winapplication.java:73) @ java.lang.thread.run(unknown source) caused by: java.lang.reflect.invocationtargetexception @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ sun.reflect.misc.trampoline.invoke(unknown source) @ sun.reflect.generatedmethodaccessor2.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ sun.reflect.misc.methodutil.invoke(unknown source) @ javafx.fxml.fxmlloader$controllermethodeventhandler.handle(fxmlloader.java:1435) ... 52 more caused by: java.lang.noclassdeffounderror: org/simpleframework/xml/serializer @ com.sohail.online_quizzing_app.controller.adminaddoptioncontroller.buttoneventsave(adminaddoptioncontroller.java:114) ... 62 more caused by: java.lang.classnotfoundexception: org.simpleframework.xml.serializer @ sun.plugin2.applet.plugin2classloader$2.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ sun.plugin2.applet.plugin2classloader.findclasshelper(unknown source) @ sun.plugin2.applet.jnlp2classloader.findclass(unknown source) @ sun.plugin2.applet.plugin2classloader.loadclass0(unknown source) @ sun.plugin2.applet.plugin2classloader.loadclass(unknown source) @ sun.plugin2.applet.plugin2classloader.loadclass(unknown source) @ java.lang.classloader.loadclass(unknown source) ... 63 more java.lang.runtimeexception: java.lang.reflect.invocationtargetexception @ javafx.fxml.fxmlloader$controllermethodeventhandler.handle(fxmlloader.java:1440) @ com.sun.javafx.event.compositeeventhandler.dispatchbubblingevent(compositeeventhandler.java:69) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:217) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:170) @ com.sun.javafx.event.compositeeventdispatcher.dispatchbubblingevent(compositeeventdispatcher.java:38) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:37) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.eventutil.fireeventimpl(eventutil.java:53) @ com.sun.javafx.event.eventutil.fireevent(eventutil.java:28) @ javafx.event.event.fireevent(event.java:171) @ javafx.scene.node.fireevent(node.java:6863) @ javafx.scene.control.button.fire(button.java:179) @ com.sun.javafx.scene.control.behavior.buttonbehavior.mousereleased(buttonbehavior.java:193) @ com.sun.javafx.scene.control.skin.skinbase$4.handle(skinbase.java:336) @ com.sun.javafx.scene.control.skin.skinbase$4.handle(skinbase.java:329) @ com.sun.javafx.event.compositeeventhandler.dispatchbubblingevent(compositeeventhandler.java:64) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:217) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:170) @ com.sun.javafx.event.compositeeventdispatcher.dispatchbubblingevent(compositeeventdispatcher.java:38) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:37) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.eventutil.fireeventimpl(eventutil.java:53) @ com.sun.javafx.event.eventutil.fireevent(eventutil.java:33) @ javafx.event.event.fireevent(event.java:171) @ javafx.scene.scene$mousehandler.process(scene.java:3328) @ javafx.scene.scene$mousehandler.process(scene.java:3168) @ javafx.scene.scene$mousehandler.access$1900(scene.java:3123) @ javafx.scene.scene.impl_processmouseevent(scene.java:1563) @ javafx.scene.scene$scenepeerlistener.mouseevent(scene.java:2265) @ com.sun.javafx.tk.quantum.glassvieweventhandler$mouseeventnotification.run(glassvieweventhandler.java:250) @ com.sun.javafx.tk.quantum.glassvieweventhandler$mouseeventnotification.run(glassvieweventhandler.java:173) @ java.security.accesscontroller.doprivileged(native method) @ com.sun.javafx.tk.quantum.glassvieweventhandler.handlemouseevent(glassvieweventhandler.java:292) @ com.sun.glass.ui.view.handlemouseevent(view.java:528) @ com.sun.glass.ui.view.notifymouse(view.java:922) @ com.sun.glass.ui.win.winapplication._runloop(native method) @ com.sun.glass.ui.win.winapplication.access$100(winapplication.java:29) @ com.sun.glass.ui.win.winapplication$3$1.run(winapplication.java:73) @ java.lang.thread.run(unknown source) caused by: java.lang.reflect.invocationtargetexception @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ sun.reflect.misc.trampoline.invoke(unknown source) @ sun.reflect.generatedmethodaccessor2.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ sun.reflect.misc.methodutil.invoke(unknown source) @ javafx.fxml.fxmlloader$controllermethodeventhandler.handle(fxmlloader.java:1435) ... 52 more caused by: java.lang.noclassdeffounderror: org/simpleframework/xml/serializer @ com.sohail.online_quizzing_app.controller.adminaddoptioncontroller.buttoneventsave(adminaddoptioncontroller.java:114) ... 62 more caused by: java.lang.classnotfoundexception: org.simpleframework.xml.serializer @ sun.plugin2.applet.plugin2classloader$2.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ sun.plugin2.applet.plugin2classloader.findclasshelper(unknown source) @ sun.plugin2.applet.jnlp2classloader.findclass(unknown source) @ sun.plugin2.applet.plugin2classloader.loadclass0(unknown source) @ sun.plugin2.applet.plugin2classloader.loadclass(unknown source) @ sun.plugin2.applet.plugin2classloader.loadclass(unknown source) @ java.lang.classloader.loadclass(unknown source) ... 63 more java.lang.runtimeexception: java.lang.reflect.invocationtargetexception @ javafx.fxml.fxmlloader$controllermethodeventhandler.handle(fxmlloader.java:1440) @ com.sun.javafx.event.compositeeventhandler.dispatchbubblingevent(compositeeventhandler.java:69) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:217) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:170) @ com.sun.javafx.event.compositeeventdispatcher.dispatchbubblingevent(compositeeventdispatcher.java:38) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:37) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.eventutil.fireeventimpl(eventutil.java:53) @ com.sun.javafx.event.eventutil.fireevent(eventutil.java:28) @ javafx.event.event.fireevent(event.java:171) @ javafx.scene.node.fireevent(node.java:6863) @ javafx.scene.control.button.fire(button.java:179) @ com.sun.javafx.scene.control.behavior.buttonbehavior.mousereleased(buttonbehavior.java:193) @ com.sun.javafx.scene.control.skin.skinbase$4.handle(skinbase.java:336) @ com.sun.javafx.scene.control.skin.skinbase$4.handle(skinbase.java:329) @ com.sun.javafx.event.compositeeventhandler.dispatchbubblingevent(compositeeventhandler.java:64) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:217) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:170) @ com.sun.javafx.event.compositeeventdispatcher.dispatchbubblingevent(compositeeventdispatcher.java:38) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:37) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:35) @ com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:92) @ com.sun.javafx.event.eventutil.fireeventimpl(eventutil.java:53) @ com.sun.javafx.event.eventutil.fireevent(eventutil.java:33) @ javafx.event.event.fireevent(event.java:171) @ javafx.scene.scene$mousehandler.process(scene.java:3328) @ javafx.scene.scene$mousehandler.process(scene.java:3168) @ javafx.scene.scene$mousehandler.access$1900(scene.java:3123) @ javafx.scene.scene.impl_processmouseevent(scene.java:1563) @ javafx.scene.scene$scenepeerlistener.mouseevent(scene.java:2265) @ com.sun.javafx.tk.quantum.glassvieweventhandler$mouseeventnotification.run(glassvieweventhandler.java:250)

java netbeans certificate javafx keystore