Posts

Showing posts from June, 2015

how to dispatch own events to controls to simulate mouseclicks in c#? -

how to dispatch own events to controls to simulate mouseclicks in c#? - is possible in c# dispatch own events controls? i mean, can in java: mouseevent leftclick = new mouseevent(image, mouseevent.mouse_pressed, 0, 0, 100, 100, 1, false, mouseevent.button1); image.dispatchevent(leftclick); events in c# work little differently. instead of dispatching event object, subscribe event object has available , provide delegate. see events (c# vs. java) reference. however, if want run code attached event, can phone call delegate directly, think people consider bad form. may improve have method performs action , phone call both delegate , wherever wanting simulate click event from. somecontrol.leftmousebuttondown += new leftmousebuttondown(somecontrol_leftmousebuttondown); protected void somecontrol_leftmousebuttondown(object sender, eventargs e) //might typed eventargs instead of generic. { //run code or phone call method. } preferably, utilize click ...

mysql get maser and all details if one detail matches condition -

mysql get maser and all details if one detail matches condition - i have 2 tables product , specs want product , group_concat(all specs) if @ to the lowest degree 1 spec matches where. have far returns 1 spec matches where. select p.id, p.name, p.manufacturer group_concat(s.specvalue order s.pid,',') product p bring together spec s on p.id = s.pid s.specvalue = 'micro' grouping p.id product table | id | name | manufacturer | | 1 | iphone | apple | | 2 | galaxy | samsung | | 3 | note | samsung | ------------------------------ spec table | id | pid | specname | specvlaue | | 1 | 1 | charger | bad | | 2 | 2 | charger | micro | | 3 | 2 | keypad | touch | | 4 | 4 | charger | micro | ----------------------------------- you can utilize next uses in in where clause: select p.id, p.name, p.manufacturer, group_concat(s.specvalue order s.pid,',') allspecs product p bring ...

How to create Zip files in Asp.Net? -

How to create Zip files in Asp.Net? - in asp.net 2.0, need take multiple folders along files. our requirement take folders , need create single zip file. can help me on this. thanks. download sharpziplib, it's 1 of more popular zip libraries add reference icsharpcode.sharpziplib.dll you can go through code samples when download sharpziplib sense of how can zip , unzip files, here's example: public static void main(string[] args) { zipfiles("d:\\sharpzip","d:\\zipped.zip"); } private static void zipfiles(string inputdirectory, string outputdirectory) { if (directory.exists(inputdirectory)) { string[] filenames = directory.getfiles(inputdirectory); using (zipoutputstream zipstream = new zipoutputstream(file.create(outputdirectory))) { zipstream.setlevel(9); byte[] buffer = new byte[4096]; foreach (string file i...

objective c - Animating Background image /layer in iPhone -

objective c - Animating Background image /layer in iPhone - i started working on sample application, have objects(images) animated on uiview. have background image should animate along these objects.two animations should happen @ same time. background image occupies screen space , on top of other images should animated. guide me accomplish this. i tried next things mentioned in link below. (int = 0; < image_count; i++) [_imagearray addobject:[uiimage imagenamed:[nsstring stringwithformat:@"d%d.png", i]]]; _animatedimages = [[uiimageview alloc] initwithframe:cgrectmake( (screen_width / 2) - (image_width / 2), (screen_height / 2) - (image_height / 2) + status_bar_height, image_width, image_height)]; _animatedimages.animationimages = [nsarray arraywitharray:_imagearray]; _an...

javascript - jquery mobile swipe functions -

javascript - jquery mobile swipe functions - i have swipe function set on web app ipad 1 time user swipes right wit finger, takes them lastly page went to. javascript looks <script> $(document).bind('swiperight', function () { history.back(); });</script> now in mind, if wanted create function more exact, alter particular page, incorporate jqm alter page function? <script> $(document).bind('swiperight', function () { $.mobile.changepage( "#home", { transition: "slide"} ); });</script> and set attribute data-direction="reverse"? it should this: $(document).bind('swiperight', function () { $.mobile.changepage("#home", { transition: "slide", reverse: true }); }); javascript jquery ios jquery-mobile

reporting services - Some of the page numbers are repeated when exporting to word -

reporting services - Some of the page numbers are repeated when exporting to word - i have study 50 pages. have 1 list control, , list command contains table control. using grouping in list, page break @ end. want each grouping on 1 page. example, if size of info bit more of pages moves sec page. the problem getting of pages same number info 1 grouping more 1 page. using look in footer: format(globals!pagenumber & "of" & globals!totalpages) when have 50 pages after exporting word 45, becuase 5 or 6 pages repeated, giving "1 of 45" instead of "1 of 50". note using ssrs 2005. reporting-services reportingservices-2005

sql - Running a bat file with BCP command, getting connection error -

sql - Running a bat file with BCP command, getting connection error - i have bat file using bcp command execute stored procedure delimited file. when manually running bat file, next errors: i'm using -t parameter log database windows authentication. there setting may need alter prepare error? the -s argument needed passed bcp command. sql sql-server-2008 sql-server-2008-r2 bcp

javascript - PHP function + Jquery + Ajax -

javascript - PHP function + Jquery + Ajax - i cant create work. have php script on website (not in php, if wrong, please point me). , want phone call js document. <?php function doit($option){ if ('getit' == $option){ $value = '318273918739182739179'; homecoming $value; }else{ homecoming 0; } } ?> and want phone call js file. how pass argument php script via ajax? var getanswer ={ php: function(){ $.ajax({ url:'mywebsite.com/php/return.php', data: {action, 'doit'}, type: 'post', success: function(output){ alert(output); } }) } } in javascript: $.get('yourphpscript.php?argument='+some_arg,function(data){ //data contain result php script }); in yourphpscript: $option = $_get['argument']; if ('getit' == $option){ $value = '31...

eclipse - How to retrieve IFile from headless RCP -

eclipse - How to retrieve IFile from headless RCP - i have headless rcp project. passing xml file command line argument project. how can retrieve ifile info xml file? eclipse eclipse-plugin rcp headless

asp.net mvc: Index was out of range exception in jQuery -

asp.net mvc: Index was out of range exception in jQuery - in jquery need have this: if (@(model.listitems.count) > 0) if ('@(model.listitems[0].date)' != '') ....... which when model.listitems.count 0 won't work, throws index out of range exception in next line. makes sense deed this, because of evaluation of expressions, can deed intend? i have figured out: code becomes: @if (model.listitems.count > 0) { if (model.listitems[0].date!= null) <text> ...... </text> } jquery asp.net-mvc exception

canvas - How would one use Tk to create a paint-like program with oval, rectangle etc buttons? How to save it (2 Parts) -

canvas - How would one use Tk to create a paint-like program with oval, rectangle etc buttons? How to save it (2 Parts) - i wasn't able reply question asked pertaining paint-like application, i'm going seek understand more generally. here original question: tk canvas objects failing bind part 1: helpful if give me illustration of how 1 might create class called paint, example, creates tk canvas , includes series of buttons alter object beingness drawn mouse clicks. simplest way create paint application using tkinter. as can see original problem, may have overcomplicated things. part 2: i'm unsure of how 1 might save these objects , reference them in different class. have 'savemembers' method which, pointed out, creates way may objects. there simple way this? thanks much tries help. canvas python-3.x tkinter paint tk

jQuery ajax success call not affecting the received elements -

jQuery ajax success call not affecting the received elements - i'm using ajax receive info .php file , displaying on page. info received has list of divs ids "question0" "question1" "question2" , on. need success phone call alter css values these elements. here's code, $.ajax({ type: "post", info : { testid: testid[0] }, cache: false, url: "load-test.php", success: function(data){ $(".main-section").html(data); $("#question1").css('display','none'); } }); homecoming false; }); }); the list of divs loaded onto page, css not affected, help! i assume #question1...

google app engine - Session Bean Gets Lost in GAE using JSF and Primefaces -

google app engine - Session Bean Gets Lost in GAE using JSF and Primefaces - note in file appengine-web.xml there required: <sessions-enabled>true</sessions-enabled> i have been digging quite long time on how create jsf , session beans work on google app engine. problem bean gets lost @ every request if utilize in web.xml file: <context-param> <param-name>javax.faces.state_saving_method</param-name> <param-value>client</param-value> </context-param> this makes on local development hidden field created in page of client encode view state in base64. <input type="hidden" name="javax.faces.viewstate" id="javax.faces.viewstate" value="h4siaaaaaaaaae1qo0sdqrae73lxltgclelsldwqleqldwjwmd4qfmfcn3drcmhv9txhcmcrskofjyuwfqkfzf6ewngjwlqjvbwtuyemduwwuzpzpbb1dvbegyxxuq3zuvjexke8sokiq//j6xny+m0eowbdhckvgfxbmqodosiwr1dixdhycugyqq+onfhhfddl0sdmmrrpkiu5vzqekpddvct8gnlfndhjyjogkqlprdx8z92+odst+hxicf...

javascript - html5 messaging multiple instance -

javascript - html5 messaging multiple instance - i have script this function resizecrossdomainiframe(id, other_domain) { var iframe = document.getelementbyid(id); window.addeventlistener('message', function (event) { if (event.origin !== other_domain) return; // take messages specified domain if (event.data === "reload") top.location.reload(); // if kid page sends reload request - reload without questions asked if (isnan(event.data)) { //if isn't integer alert alert(event.data); // show alert if not integer } else { var height = parseint(event.data) + 5; // add together height avoid scrollbar iframe.height = height + "px"; alert(event.data); } }, false); } what dynamically resizes iframe. on first iframe page 1 alert, in within iframe page have links , when go sec page see 2 alerts, when go 3rd page - 3 alerts, 4th link trigger 4 alerts et...

excel - VBA: subroutine with if statement and returning true or false? -

excel - VBA: subroutine with if statement and returning true or false? - solved! i have validate cells not empty, want create subroutine , pass variables need checked. this came with: sub errormessage(errmsg string, errrange string) if range(errrange) = "" msgbox errmsg, , "error:" range(errrange).activate 'this looking :doh:, 'end' line terminates everything.. end end sub now when phone call button, actuall end sub of button? i.e. private sub commandbutton1_click() phone call errormessage("name missing", "d4") 'this function shouldn't called if there msgbox displayed above phone call sendemail end sub how can create happen? edit: ok how sovled it, reason i'm trying avoid tons of lines of code in buttonclick sub, thoughts?? keep in mind thing has check 25 questions blanks before executing sendemail sub.... private sub commandbutton1_click() phone call...

selenium - Automated testing web application -

selenium - Automated testing web application - i looking tool functionally test yii/ node.js web application. first thing looked selenium. app runs on headless ubuntu server setting xvfb , run test painfull , drove me tool. error kept getting is: xlib: extension "randr" missing on display :0 the other tool casperjs along phantomjs . aside 5 min setting up, wrote few tests , integrated jenkins ci. believe there should more tools one. sense i've earned on short term, i'm afraid on long term i'll nail dead end. give me feedback? going wrong road? another thing that's crossing mind setup selenium rc , jenkins on windows machine browsers set up. think give tests improve , more accurate perspective. * able parallel functional tests (interactions) since website socket-driven. selenium handle that? first off, don't utilize selenium rc if can avoid it, it's officially deprecated in favor of selenium webdriver (also known selenium 2)...

ajax - How to get response from cross domain using jsonp -

ajax - How to get response from cross domain using jsonp - i working on ajax login on cross domain , request has been sent correctly , getting response other domain onsuccess function not getting called. have tried writing onsuccess within request like sucess : function(){} but not getting called. my code snippet : new ajax.jsonrequest(this.precheckurl, { callbackparamname: "jsoncallback", parameters: { useremail: this.useremail, userpassword: this.userpassword, format: 'json' }, onsuccess:function(response) { alert('hello'); } }); -thanx. your request looks good, according documentation. readme.md handling failures since there no way inspect happens after create request jsonp technique, we're stuck having create informed guesses what's going on. this illustration makes request invalid url. since callback not invoked within default timeout period (10 seconds) request "cancel...

php - Database timezone -

php - Database timezone - i want set different timezone different database on single cpanel(phpmyadmin).i don't know how set different timezone different database. please help me .. possible or not, thanks in advance... if using php / mysql. place next code @ top of page or index page. date_default_timezone_set('timezone_name'); illustration america/new_york only mysql (works current session) mysql> set time_zone = 'timezone_name'; for global change mysql> set global time_zone = 'timezone_name'; hope helps. thanks!! php mysql sql phpmyadmin timezone

header location doesnt work in php 5.3.21 -

header location doesnt work in php 5.3.21 - this question has reply here: how prepare “headers sent” error in php 11 answers my header location fails work on server wich uses php 5.3.21. work on localhost 5.4.7. backwards compatible.. can tell why wrong? switch ($table) { case "hardcover": header('location:hardcover.php?type=aanvraag&relid='.$relid.''); break; } it part of switch case decides go after have entered value html alternative list. when echo $relid , , $table in same case, echo items. somehow wont redirect header.. result from: ini_set("display_errors", "on"); warning: cannot modify header info - headers sent (output started @ /customers/f/f/e/tdmdev.nl/httpd.www/graficrm/htmlheader.php:7) in /customers/f/f/e/tdmdev.nl/httpd.www/graficrm/aanvradd.php on line 47 line 47 line header ...

wso2esb - ESB 4.6.0. Router Mediator -

wso2esb - ESB 4.6.0. Router Mediator - i used router mediator in esb 4.0.0. when upgraded esb 4.6.0, router mediator doesn't work. , not exists in mediators list. is router mediator still exist in esb 4.6.0? the router mediator has been deprecated. utilize conditional router instead (http://docs.wso2.org/wiki/display/esb460/conditional+router+mediator). wso2esb mediator

php - Text formatting not working properly -

php - Text formatting not working properly - basically have give-and-take forum takes comments users. taken textarea , set database. when set database looks this: <p>this paragraph.</p> <p>this paragraph.</p> when viewing individual post looks this: this paragraph. paragraph. when viewing main page looks this: this paragraph.this paragraph what i'm wondering how create formatting same both individual post , main page viewer can see multiple posts. i'm using php if helps @ all. thanks! also, if helps here's php code i'm using echo text main page: echo '<div style="padding:4px; style="font-size:9pt;"">'; if (strlen($blogentrytext) > 500) { $blogentrytext = substr($blogentrytext, 0, 500). '...<a href="'.website.'projects/commercialize/pipeline/blog/view.php?id='.$blogentryid.'&project='.$coaching.'&cycle='...

Push notification in blackberry 10 cascades -

Push notification in blackberry 10 cascades - i need force notification in blackberry 10 cascades,if close application means can't able show notification in blackberry hub here code button{ notification.body="hai notification testing " notification.notify(); notification { id: notification title: "title" } } when user closes application means means,i need show notification in blackberry hub how , can send me solutions solve this.? this question has been solved here : http://supportforums.blackberry.com/t5/cascades-development/push-notification-in-blackberry-hub/m-p/2186999/highlight/true#m15290 here's code notifications including invoke hub notification notification; n.settitle(tr("your title")); n.setbody(tr("your detailed description")); n.setcategory("vibrate"); invokerequest request; request.settarget("org.xyz.yourap...

Extract number from html page using ant and regex -

Extract number from html page using ant and regex - i have extract number web page using ant. have downloaded page using task. ma page is: <!doctype html public "-//w3c//dtd html 3.2 final//en"> <html> <head> <title>index of .......</title> </head> <body> <h1>index of .....</h1> <pre><img src="/icons/blank.gif" alt=" "> <a href="?n=a">name</a> <a href="?m=d">last modified</a> <a href="?s=a">size</a> <a href="?d=a">description</a> <hr> <img src="/icons/back.gif" alt="[dir]"> <a href="/projects/i/">parent directory</a> 19-dec-2012 11:39 - <img src="/icons/folder.gif" alt="[dir]"> <a href="20120114-1731/">20120114-1731/</a> 14-feb-2012 1...

node.js - Passport.js: how to access user object after authentication? -

node.js - Passport.js: how to access user object after authentication? - i'm using passport.js login user username , password. i'm using sample code passport site. here relevant parts (i think) of code: app.use(passport.initialize()); app.use(passport.session()); passport.serializeuser(function(user, done) { done(null, user); }); passport.deserializeuser(function(obj, done) { done(null, obj); }); passport.use(new localstrategy(function(username, password, done) { user.findone({ username: username }, function(err, user) { if (err) { homecoming done(err); } if (!user) { homecoming done(null, false, { message: 'incorrect username.' }); } if (!user.validpassword(password)) { homecoming done(null, false, { message: 'incorrect password.' }); } homecoming done(null, user); }); } )); app.post('/login', passport.authenticate(...

javascript - JS return's undefined when is checked and I change select option selected -

javascript - JS return's undefined when is checked and I change select option selected - i have html js code: <form action="/resize" method="get" name="resolutionform"> <select name="res" id="res" onchange="checkzoom(this.value); checkcut('centercropcheck')"> <option value="original"> original</option><option value="800x600">800x600</option> </select> <input type="checkbox" id="stretchcheck" name="stretch" onclick="verificastretch(this.id);">esticar <div id="results"> <span>original: </span> <span>200x200</span> <span>zoom: </span> <span>0x</span> <span id="zoom">0x</span></span> </div> </form> <script type="text/javascript"> function elembyid(id){ homecoming d...

api - Is it possible to download #of votes and the rate of votes an image has in reddit? -

api - Is it possible to download #of votes and the rate of votes an image has in reddit? - i found online image scrapper can download imgur images subreddit category, can tell me if reddit api allows me add together number of votes , rate @ votes obtained? yes. believe precise method you're looking get_info in api documentation. alternatively can utilize json version of subreddit listing data. you're looking score , if want average score increment per hour, created_utc (avoid created) well. there wrappers languages of reddit, can create easier. api reddit

python 3.x - how to remove elements from one list if other list contain the indexes of the elements to be removed -

python 3.x - how to remove elements from one list if other list contain the indexes of the elements to be removed - i have 2 lists - lista = [1,2,3,5,0,5,6,0] listb = [4,7] listb contains index numbers. how can remove index 4 , 7(contained in lisb) lista. i want print new_lista [1,2,3,5,5,6] i hope makes sense. alwina use enumerate : new_lista = [j i, j in enumerate(lista) if not in listb] python-3.x

objective c - Get an object's memory address as a long/long long? -

objective c - Get an object's memory address as a long/long long? - what need pretty straightforward : the same way can nslog("%@",someobject); or nsstring* hex = [nsstring stringwithformat:@"%p",someobject]; print hex value of someobject 's memory address, want number variable (to utilize unique identifier). any thought how done? built-in methods? others showed how integer value of adress, want add together som considarations. as long object lives, pointer unique. , sson, object get's deallocated, there no utilize unique identifier derived pointer anymore. infact might harm, if have identifier allocated object address re-used. better maintain track of object adding collection or adding guaranteed unique id object itself. uuids selection that. an implementation that: -(nsstring *)uuid { cfuuidref uuid = cfuuidcreate(kcfallocatordefault); nsstring *uuidstr = (__bridge_transfer nsstring *)cfuuidcreatestring(kcfalloc...

.net - Callback from Dialog window to Main window -

.net - Callback from Dialog window to Main window - i'm developing wpf mvvm application create utilize of mvvmlighttoolkit 3rd party helper.my scenarion follows: i have main window , while closing main window, have show new dialog window(save changes dialog window) confirm user that, whether has save changes made in application state file or not. how can handle scenario in mvvm?. showing new window, i'm making utilize of mvvmlight messenger class.in case, i'm opening save changes dialog window main window code behind.i need phone call main view model based on selected user option(save,save/exit,cancel) save changes dialog window , based on have check whether have close main window or not. best mvvm approach handle scenario? just pass messages from/ viewmodel. view: class="lang-cs prettyprint-override"> private void window_closing(object sender, canceleventargs e) { messenger.default.send(new windowrequestsclosingmessage( thi...

android - How do I set the size of my Bitmap to WRAP_CONTENT and FILL_PARENT? -

android - How do I set the size of my Bitmap to WRAP_CONTENT and FILL_PARENT? - right setting width , height staticly this: mybitmap = bitmap.createbitmap(300, 400, bitmap.config.argb_8888); how can width fill_parent , height wrap_content i have been looking online , confused options available. there's setlayoutparams(), onmeasure(), setminimumwidth(), etc.... can point me in right direction? i making bitmap within custom view within main activity. thanks i create layoutparams this. this or this might helpful. edited, more detail: layoutparams params = new layoutparams(layoutparams.match_parent, layoutparams.wrap_content); imageview iv = new imageview(this); iv.setimagebitmap(mybitmap); iv.setlayoutparams(params); customview.addview(iv); android view bitmap measure

Cannot SSH into new computer running CentOS 6.3 from Fedora 16 -

Cannot SSH into new computer running CentOS 6.3 from Fedora 16 - i installed centos 6.3 on new computer , unable ssh our computer running fedora 16. both on same network. some facts: - can ping fedora machine. - can ssh centos computer on centos computer. - have looked hosts allow , deny, have set selinux permissive, tried iptables disabled on fedora computer i fresh out of ideas... thanks do have fail2ban running? do have denyhosts running? do have iptables allowing tcp 22? do have line in sshd_config refers "allowusers"? (most dont do, , if yours does, need business relationship listed on line) can run command tail -f /var/log/secure on machine @ same time while trying login sec machine , spot issue? if not, paste output log here me comment on. a long shot, might seek service sshd restart , seek 1 time again see if helps. go ahead , run tail /varlog/messages while restarting daemon see if spot unusual while doing that. if spot issue great, ...

ruby - debugging a rails app with rubymine -

ruby - debugging a rails app with rubymine - i have rails app using ruby 1.8.7 , i'm getting error when running in debug mode , setting break point: 54749: exception in debugthread loop: undefined method `errmsg' #<debugger::controlstate:0x10e3def28> backtrace: /users/ohad/.rvm/gems/ruby-1.8.7-p371/gems/ruby-debug-0.10.4/cli/ruby-debug/command.rb:188:in `errmsg' from: /users/ohad/.rvm/gems/ruby-1.8.7-p371/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/breakpoints.rb:81:in `execute' from: /users/ohad/.rvm/gems/ruby-1.8.7-p371/gems/ruby-debug-ide-0.4.17.beta16/lib/ruby-debug-ide/ide_processor.rb:89:in `process_commands' from: /users/ohad/.rvm/gems/ruby-1.8.7-p371/gems/ruby-debug-ide-0.4.17.beta16/lib/ruby-debug-ide/ide_processor.rb:86:in `catch' from: /users/ohad/.rvm/gems/ruby-1.8.7-p371/gems/ruby-debug-ide-0.4.17.beta16/lib/ruby-debug-ide/ide_processor.rb:86:in `process_commands' from: /users/ohad/.rvm/gems/ruby-1.8.7-p371/gems/ruby-d...

ruby on rails - Jobs with Resque gives "Don't know how to build task 'jobs:work'" on Heroku -

ruby on rails - Jobs with Resque gives "Don't know how to build task 'jobs:work'" on Heroku - i followed tutorial @ https://devcenter.heroku.com/articles/queuing-ruby-resque queue , run background jobs in rails app. after queueing jobs, doesn't seem run of jobs since in console can see job has not been processed >resque.info => {:pending=>1, :processed=>0, :queues=>1, :workers=>0, :working=>0, :failed=>0, :servers=>["redis://dory.redistogo.com:9826/0"], :environment=>"production"} if seek (locally) bundle exec rake jobs:work i get rake aborted! don't know how build task 'jobs:work' on heroku, if try heroku run rake jobs:work i 1 time again `don't know how build task' in rakefile, have require 'resque/tasks' , in procfile have resque: env term_child=1 bundle exec rake jobs:work resque: env term_child=1 bundle exec rake jobs:work i have resque ,...

Socket multithreading Implementation C -

Socket multithreading Implementation C - i working on implementing multithread multi client single server socket in c. whatever reason program, when using pthread_create() create new thread, not advance past line of code. have set print lines before , after line of code , of print lines before hand print fine none of them after print. leads me believe pthread_create() somehow buggy. unusual thing can have 1 client connect , sent/receive info server because loop listen() command in not advancing cannot take on additional clients. appreciate help in matter. server code #include <stdio.h> #include <stdlib.h> //for ios #include <string.h> #include <unistd.h> #include <sys/types.h> //for scheme calls #include <sys/socket.h> //for sockets #include <netinet/in.h> //for net #include <pthread.h> void error(const char *msg) { perror(msg); exit(1); } void *threadfunc(int mysockfd) { int n; char buffer[256]; ...

Why JDBC is ill-advised with Android Development -

Why JDBC is ill-advised with Android Development - i have read countless posts regarding utilize of jdbc android. suggests take path of using php scripts , using http clients within android code. it great clear indication why jdbc not advised. jdbc access straight web client, browser or web phone, implies database port exposed on public internet. that's not safe place info be. i think improve approach set 1 or more servlets between clients , database. allow servlet(s) handle security, validation, binding, deciding services invoke fulfill utilize case, marshaling response, , routing next page depending on outcome. this design lets set intermediate layer on net , maintain info safe behind firewall. it's called model-2 mvc. it's been standard idiom java web development more 10 years. you'll lot more utilize out of code if have clean separation of presentation of info how it's produced. uis come , go, services , info linger. ...

C# and Visual Studio Command Prompt -

C# and Visual Studio Command Prompt - whenever run c# console app on visual studio, uses windows' default cmd instead of visual studio cmd. how can alter ? c# visual-studio-2010 command-prompt

Access Visual Basic Code for concatenating multiple fields (text and numbers together) -

Access Visual Basic Code for concatenating multiple fields (text and numbers together) - i have been set task of creating microsoft access database store client feedback , generate printable study when negative feedback logged. on feedback form users can log feedback details, trying develop code concatenate fields taken feedback table (which form's record source set to). aiming develop unique number made of next fields feedback table: company name (this lookup field in feedback table looks company name in company table hence combo-box on form - appears drop downwards menu on form) product name 2 digits of week number 2 digits of month 2 digits of year (these 3 date items extracted field called feedback date in feedback table). a sequential number starting 1 increments if piece of feedback logged on same product same company number changes 2 , on. basically, illustration i'm wanting replicate this: company name_product name_0712131 the output of these conca...

jquery - Twitter Bootstrap Typeahead doesn't load ajax data -

jquery - Twitter Bootstrap Typeahead doesn't load ajax data - i have next code in place initialize typeahead using version 2.3.0: jquery('#search_terms').typeahead({ source: function(query, process) { homecoming jquery.ajax({ url: '/api/path', type: 'get', data: {q: query}, datatype: 'json', success: function (json) { homecoming process(json.suggestion); } }); } }); i've verified typeahead works substituting static data. i've seen json.suggestion evaluates single word expected. ajax response looks this: {"suggestion":"word"} however, bootstrap refuses load response typeahead. missing? admit i'm having problem finding detailed documentation of bootstrap typeahead via ajax other here on so. thanks in advance. we found bootstrap typeahead second-guessing our ajax info own matching...

SQL: how to compare data in different rows and only select unique "pairs" assuming there are only two colums? -

SQL: how to compare data in different rows and only select unique "pairs" assuming there are only two colums? - i have several tables (bold means primary key): dancer(dancer_name, gender, age) dance(dancer_name, dvd_id, song_title) dvd(dvd_id, song_title, cost) song(dancer_name, song_title, genre) launch(dancer_name, dvd_id, year) i want select pairs of dancers song appear in 1 or more dvds , each pair print out once. this close , prints out same pair twice, names in different columns: select distinct dancer1.dancer_name, dancer2.dancer_name, count(*) count dancer dancer1, dancer dancer2, dance dance1, dance dance2 dancer1.dancer_name = dance1.dancer_name , dancer2.dancer_name = dance2.dancer_name , dancer1.dancer_name <> dancer2.dancer_name , dance1.dvd_id = dance2.dvd_id grouping dancer1.dancer_name, dancer2.dancer_name; so instead of getting tom jon jon tom bob sam sam bob i want tom jon bob sam ...

forms - Get values from checkboxes Ruby on Rails, Many to Many -

forms - Get values from checkboxes Ruby on Rails, Many to Many - i'm trying values checkboxes in form. form: <%= form_for @book |f| %> <%= f.label :title %> <%= f.text_field :title %> <%= f.label :description %> <%= f.text_area :description %> <% @users.each |user| %> <%= check_box_tag 'user_ids[]', user.id,false -%> <%= h user.name -%> <% end %> <%= f.submit "save" %> <% end %> the book has_and_belongs_to_many users, want add together user ids checkboxes @book.users . how can that? maintain getting error: can't mass-assign protected attributes: user_ids. in model add together line , seek out attr_accessor :user_ids ruby-on-rails forms checkbox many-to-many

android - TransactionTooLargeException when starting new Activity -

android - TransactionTooLargeException when starting new Activity - i thought intent's limit in size 1mb, reported on docs. anyway, lost 1 day chasing terrible transactiontoolargeexception : e/javabinder(368): !!! failed binder transaction !!! exception when starting activity android/com.android.internal.app.chooseractivity android.os.transactiontoolargeexception @ android.os.binderproxy.transact(native method) @ android.app.applicationthreadproxy.schedulelaunchactivity(applicationthreadnative.java:705) @ com.android.server.am.activitystack.realstartactivitylocked(activitystack.java:690) @ com.android.server.am.activitystack.startspecificactivitylocked(activitystack.java:799) @ com.android.server.am.activitystack.resumetopactivitylocked(activitystack.java:1743) @ com.android.server.am.activitystack.resumetopactivitylocked(activitystack.java:1381) @ com.android.server.am.activitystack.completepauselocked(activitystack.java:1129) @ com.android.server.am.activitystack.ac...

ios - Getting NSTimeZone from CLLocationCoordinates2D -

ios - Getting NSTimeZone from CLLocationCoordinates2D - i want current time of cllocationcoordinate2d . for illustration in city in east coast , should know time @ remote location in california. have cllocationcoordinate2d. neither cllocation nor clplacemark give me nslocale or nstimezone . there way without using 3rd party services? check out github project: https://github.com/alterplay/aptimezones. it help nstimezone's , cllocation. ios objective-c nstimezone

r - Random forest output interpretation -

r - Random forest output interpretation - i have run random forest info , got output in form of matrix. rules applied classify? p.s. want profile of client output, e.g. person new york, works in technology industry, etc. how can interpret results random forest? looking @ rules applied each individual tree assuming utilize randomforest bundle how access fitted trees in forest. library(randomforest) data(iris) rf <- randomforest(species ~ ., iris) gettree(rf, 1) this show output of tree #1 of 500: left girl right girl split var split point status prediction 1 2 3 3 2.50 1 0 2 0 0 0 0.00 -1 1 3 4 5 4 1.65 1 0 4 6 7 4 1.35 1 0 5 8 9 3 4.85 1 0 6 0 0 ...

ruby on rails - why is it dangerous to use find with will_paginate? -

ruby on rails - why is it dangerous to use find with will_paginate? - i found next in faq after sorting out bug. it’s possible trying paginate static array instead of performing paginated query in database. instance, chaining paginate phone call after active record find or methods wrong: the above line homecoming desired result defeats purpose of pagination. here, find query first load records database, unsafe , should avoided. my question why unsafe paginate find? pagination meant prevent unnecessary db load: want elements db, load them. using find load kind of sort. dangerous == heavy db load , potential crash. ruby-on-rails ruby-on-rails-3 will-paginate

html - Keep link box the same size even with different text -

html - Keep link box the same size even with different text - when making menu have hover effects on ancor links. pad these alter size height/width doesn't work. issue due padding boxes different widths due different length text in them. how can create ancor links same size? html

java - Capturing video data from a machine -

java - Capturing video data from a machine - what best way capture video info machine (running either windows or linux)? need run form of programme intercept(make re-create of) forms of video info used application. for illustration suppose running skype , doing video chatting. want write programme intercept video , create backup re-create of video data. possible? there scheme phone call capture info video card? goal analyze these video info later on. don't manually want start recording, rather script in background doing recording. java python video-streaming system-calls image-capture

c# - Modelstate always complains of invalid datetime -

c# - Modelstate always complains of invalid datetime - i have added info annotation in 1 of properties of model [datatype(datatype.date), displayformat(dataformatstring = "{0:dd/mm/yyyy}", applyformatineditmode = true)] public datetime? lastlogindate { get; set; } however, whenever save info edit mode, model state says date invalid if day greater 12. e.g., 01/12/2012 (valid) 31/12/2012 (invalid) how right such 31/12/2012 recognized valid modelstate. c# asp.net-mvc modelstate

android - Running Several asynctask in my MainActivity -

android - Running Several asynctask in my MainActivity - i'm displaying 5 big bitmaps in mainactivity next google instructions avoid memory leaks , not freeze ui thread. http://developer.android.com/training/displaying-bitmaps/process-bitmap.html so, i'm starting 1 asynctask each 1 of 5 big bitmaps in oncreate method... i'm not freezing ui thread (good) because i'm running long processes in 1 thread each 1 "my problem" these 5 big bitmaps part of same figure (face) , when app starts user can see how different layers beingness loaded @ different time. i've thought in splash screen until images loaded i'd know if best way (because splash needed maybe less 1 second) or there improve way, notify ui thread when lastly image loaded , show images...or maybe seek load images in same asynctask ? thanks in advance, paola. finally, i've loaded 5 big bitmaps in same asynctask. i've loaded them in doinbackground method , d...

How to add login link beside welcome message in magento 1.7 -

How to add login link beside welcome message in magento 1.7 - i'm trying move "login" link in toplinks beside default welcome message.c:\xampp\htdocs\myhealthzone\app\design\frontend\default\myhealth\template\page\html\header.phtml in gave code <p class="welcome-msg"> <?php echo $this->__('hi %s', mage::getsingleton('customer/session')->getcustomer()->getfirstname()); ?> <?php echo $this->getadditionalhtml() ?> </p> but session use. please update me how login link here instead of session. try this: <p class="welcome-msg"> <?php $helper = mage::helper('customer'); ?> <?php if ($helper->isloggedin() : ?> <?php echo $this->__('hi %s', mage::getsingleton('customer/session')->getcustomer()->getfirstname()); ?> <?php else :?> <a href="<?php echo $helper->getloginurl(); ?>"><?php echo $thi...

php - Checking if a particular entry already present in MySQL -

php - Checking if a particular entry already present in MySQL - i've table events next fields: `id`-->int,primary , auto_increment `event_id`-->int `mem_1_id`-->int `mem_2_id`-->int `mem_3_id`-->int `mem_4_id`-->int `mem_5_id`-->int `mem_6_id`-->int all mem_x_id (0<x<7) distinct particular event_id in events table. id primary key used. possible example: id event_id mem_1_id mem_2_id mem_3_id mem_4_id mem_5_id mem_6_id 1 11 123 345 567 67 34 56 2 12 234 555 67 43 23 12 2 12 34 55 167 435 233 122 now want check if user's id (from users table) has logged in , viewing page of particular event nowadays or not in events table under event's id . there may multiple entries particular event_id . want search in event_id of event page. my code bel...

mysql - How can I insert data from a table from sql into a dropdown list in zend framework 2? -

mysql - How can I insert data from a table from sql into a dropdown list in zend framework 2? - i need insert multioptions dropdown list, options taken table database. created elements like: $this->add(array( 'name' => 'company', 'type' => 'zend\form\element\select', //'multioptions'=> $options, 'options' => array( 'label' => 'company', ), 'attributes' => array( 'style' => "float:right;", ), )); i want take dropdown list values in table in database. illustration have entity contacts , need take contact company in table named companies in database. after reading on zend framework's site, tried using code: $params = array( 'driver'=>'pdo_mysql', 'host'=>'localhost', ...

asp.net - find controls from emptydatatemplate in gridview -

asp.net - find controls from emptydatatemplate in gridview - i using emptydatatemplate entering new info in grid while there no existing data,but not able find controls in emptydatetemplate protected void gvnavigationdtls_rowcommand(object sender, gridviewcommandeventargs e) { if (e.commandname.equals("einsert")) { gridviewrow emptyrow = gvnavigationdtls.controls[0].controls[0] gridviewrow; if (((textbox)emptyrow.findcontrol("txtcode")).text == "") in page load checked writing next code gvnavigationdtls.databind(); command c = gvnavigationdtls.controls[0].findcontrol("txtcode"); if (c != null) { } but c null,that means not able find command utilize it, please help,thanks in advance protected void gvnavigationdtls_rowcommand(object sender, gridviewcommandeventargs e) { if (e.commandname.equals("einsert"))...

c# - Update a OneNote page, using the developer API -

c# - Update a OneNote page, using the developer API - i tried update page in onenote microsoft reference : http://msdn.microsoft.com/en-us/library/office/jj680118.aspx here's problem. when tried update page right id, throwed me error saying : exception hresult: 0x80042000. here code : static void updatepagecontent() { applicationclass onapplication = new applicationclass(); string strimportxml; strimportxml = @"<?xml version="+"1.0"+" encoding="+"utf-16"+"?>" + " <one:page xmlns:one="+"http://schemas.microsoft.com/office/onenote/12/2004/onenote\""+"" + "id=\"{5be09697-903a-45dd-88d4-8ad301a3d91f}{1}{b0}\">" + " <one:pagesettings rtl=\"false\" color=\"automatic\">" + " <one:pagesize>" + " ...

silverlight - ScaleTransform in VB.Net -

silverlight - ScaleTransform in VB.Net - so, have working in silverlight xaml. how convert done in vb.net codebehind? <grid.rendertransform> <scaletransform x:name="myscale" scalex="0.75" scaley="0.75"/> </grid.rendertransform> the grid transforming layoutroot. thanks. ok, figured it: dim scaledown new scaletransform scaledown.scalex = "0.75" scaledown.scaley = "0.75" layoutroot.rendertransform = scaledown vb.net silverlight silverlight-5.0

windows - Qt code port to marmalade -

windows - Qt code port to marmalade - i know marmalade c++ code porting know how possible port qt code marmalade? can tell how simple "hello world" qt-application ported marmalade? i have setup every thing marmalade on windows machine. have setup qt. please, share kind of info or tutorials here. i'm pretty sure it's not possible iwgx , subcomponents , not s3e. can seek using iwui, don't think work. another thing, qt doesn't back upwards platforms marmalade does, won't reach clients might want to. i found on marmalade forum, might useful. http://www.madewithmarmalade.com/ru/node/57339 hope helps! windows qt mingw porting marmalade

java - Add Clickable JPanel to AbstractTableModel -

java - Add Clickable JPanel to AbstractTableModel - i have class extends abstracttablemodel , i'd insert jpanel clickable text (think hyperlink) 1 of cells. possible? output in cell jpanel looks "javax.swing.jpanel[,0,0,0x0,invalid,layout=java.awt.flowlayout,ali..." i've used same type of jlabel elsewhere in application open new tabs , have same type of action in table. public object getvalueat(int row, int column) { if (row >= getrowcount()) homecoming "???"; switch (column) { case 1: homecoming "???" case 2: homecoming myjpanel; case 3: homecoming "?" ; case 4: homecoming new integer(2); default: homecoming "???" ; } } this isn't how table models wor...

psql - Postgres not looking at the right pg_hba.conf file? -

psql - Postgres not looking at the right pg_hba.conf file? - i uninstalled postgres (not sure if did properly. used homebrew uninstall , manually deleted whatever showed on locate psql in terminal. installed postgres.app , tried running it. prompts password (that don't remember or don't know exists or not) though went pg_hba.conf file found in edmunds-macbook-pro:~ edmundmai$ locate pg_hba /usr/share/postgresql/pg_hba.conf and changed trust everything: # type database user cidr-address method local trust # ipv4 local connections: host 127.0.0.1/32 trust # ipv6 local connections: host ::1/128 trust am missing something? can't psql run because prompts password. i'm willing uninstall if fixes it. try restarting server. editing pg_hba.conf isn't plenty on own. on ubuntu postgres 9.1 ...

hibernate - Two attributes of the same entity -

hibernate - Two attributes of the same entity - i have 2 entities @entity class { @id private long id; //attributes of } @entity class b { xxx private instanceofa_1; xxx private instanceofa_2; } as see, have 2 attributes of type in class b. how annotate these 2 attributes in hibernate ? in end, in database, expect find 2 columns in table b, each column containing key id in table a. i guess simple orm question, didn't manage alone... edit : after response above, suggest next ? @entity class { @id private long id; //attributes of } @entity class b { @manytoone private instanceofa_1; @manytoone private instanceofa_2; } this create next tables ? table id attributes table b a_id_1 a_id_2 how specify name of columns in table b (i.e. a_id_1 , a_id_2) ? this rather typical situation, each of them should annotated @manytoone. @onetoone should used if per relation 1 b can related given a. if database s...

asp.net mvc - Unit Testing in MVC not creating/accessing database -

asp.net mvc - Unit Testing in MVC not creating/accessing database - i have solution mvc project containing services project on top of core project. i added unit tests project , referenced core , services - i'm trying test services. i have basic phone call in test: public class crudtests { private readonly setservices _setservice = new setservices(); [testmethod] public void testmethod() { _setservice.createset("test set", "test set details", null); which ends failing because test can't connect database. config has this: <?xml version="1.0" encoding="utf-8" ?> <configuration> <connectionstrings> <add name="defaultconnection" connectionstring="data source=.\;initial catalog=project.services.tests;integrated security=sspi;attachdbfilename=|datadirectory|\project.services.tests.mdf" providername="system.data.sqlclient...