Posts

Showing posts from March, 2010

arrays - URL prevent href button action php -

hi have href tag order array values(up down or down up),so problem when click twice in same button have no action performed.that because of in url have that: when click 1st time on button action done,but click again on same button nothing,but when click 'f5' action action done: exemple in url when click 1 time: http://localhost/home/test.php?dir=down&keyword=1 the second time click url remains same no action done.it done when click on f5. my hyperlink: echo "<a href=\"$_server[php_self]?dir=down&keyword=$keywordkey\"><img src=web/images/remove.png /></a>"; how can resolve ? thank you!!! after click on button first time, give command script sort downwards. once action complete, still have same command provide script i.e. down since same command going code, same thus, results same.

c# - How to use SequenceEqual to compare coordinates? -

if nested int[] contains coordinates x, y, how compare them using sequenceequal? the list group of coordinates. want check every other list see if have same number of coordinates , same coordinate values. if both match, want remove redundant one. otherwise, leave it. private list<list<int[]>> combinelist(list<list<int[]>> matches){ debug.log (matches.count()); foreach(list<int[]> tilegroup in matches){ foreach(list<int[]> other in matches){ if(other == tilegroup) continue; if(sequenceequal(tilegroup, other)){ matches.remove(other); } } } debug.log (matches.count()); return matches; } private bool sequenceequal(list<int[]> groupa, list<int[]> groupb){ if(groupa.count() == groupb.count()){ int = 0, j = 0; dictionary<int, int[]> dicta = new di...

html - Error while Calling Wcf restful service in mvc3? -

following operationcontract in iservice1 : [operationcontract] [webget(uritemplate = "/getstates",responseformat = webmessageformat.json)] list<string> getstates(); implementation of method getstates in service1 class : public list<string> getstates() { db_mvcentities db = new db_mvcentities(); // string temp = countryname.country; string temp = "india"; var countryid = (from n in db.tblcountries n.country == temp select new { n.cid }).single(); int ii = countryid.cid; // int ii = (objectquery<int32>)countryid; // object oo = countryid; //int countryid = convert.toint32(countryid); var stateresult = (from n in db.tblstates n.cid == countryid.cid select n.statename).tolist(); list<s...

vb.net - text center justified in openxml Word document -

i trying apply formatting text using open xml. add bold, 18 pt font , have centered. the bold , font size formatting applies correctly cannot center justification work. first use of open xml, appreciated. dim mainpart maindocumentpart = mydoc.addmaindocumentpart() mainpart.document = new document() dim body new body() dim paragraph new paragraph() dim run_paragraph new run() 'we want put text output document dim text_paragraph new text("executive summary - " + name) 'append elements appropriately. 'bold dim runproperties runproperties = run_paragraph.appendchild(new runproperties()) dim bold new bold bold.val = onoffvalue.fromboolean(true) dim fontsize new fontsize fontsize.val = "22" runproperties.appendchild(fontsize) runproperties.appendchild(bold) 'center dim paragraphproperties paragraphproperties = run_paragraph.appendchild(new paragraphproperties()) dim justification new justification justification.val = justificationvalues.cente...

windows installer - Publishing msi project c# -

we have application did not have setup (click once updates checking, etc). gives little information our customers when installing. have added setup project , works fine while installing vs or folder. however, when publish application (local or web) still using click once. setup.exe begins installation without loading setup project files. how publish project msi installer installation includes setup project? use vs 2010 pro. in c:\users\user\documents\visual studio 2010\projects\solution\project\bin\release there exe file contains .exe need run (outside of click once). if add msi when create it, shouldn't deploy in click once.

osx - Transfer Files From Mac External Hard Drive To PC -

our wedding videographer gave our wedding video (all 200gb of it) on external hard drive formatted mac. my wife , each have pcs , have 2 external hard drives formatted pcs. have mac that's half dead, use group sharing or something, doesn't have internal space store large files. is there way files external hard drive onto 1 of our pcs? not programming problem, anyhow... osx uses hfs plus, not ntfs quick google search , you'll see there products available want: - http://www.pcadvisor.co.uk/how-to/windows/3369574/how-read-mac-os-hfs-drives-in-windows-for-free/

java - RejectExecutionError while running async tasks in a loop -

i using following code private void getonlineconnections() { (int = 0; < contacts.size(); i++) { final persons person = contacts.get(i); string querystring = null; try { querystring = string.format(constants.get_online_url, urlencoder.encode(person.myid, "utf-8")); } catch (unsupportedencodingexception e) { e.printstacktrace(); } responsecallback callback = new responsecallback() { @override public void onsuccess(string response) { response = response.trim(); } @override public void onfailure(string exception) {} }; new myasynctask(querystring, callback); } } myasynctask asynctask. now number of contacts can more 128 or more limit of theadpoolexecutor. how can increase limit won't crash on rejectex...

How do I check if a URL is exists in PHP, without following redirects? -

i have php script call notfound.php executed when web site hits 404, , try create valid url based on logic have written. after create new url check if thats valid url or not.to have tried get_headers , curl , , file_get_contents . file_get_contents return valid answer. problem i'm facing right if new url 404, file_get_contents again go in notfound.php , , take ages new url 404. think going on loop or something. then tried send $context file_get_contents saying follow_location = 0 , didnt work either. i spend whole day looking answers failed :(, 1 got ideas? i don't know why want show valid content if there none. bad seo, in opinion. so best case send headers (404/500 etc) on not found page. on page self show user message. url not exists, recommend following urls (give couple of urls user can choose (always show homepage)). but if want stick design chould set variable ?no-lookup=true. if hits 404 page wont end in loop. if no throw 404 header , use cur...

visual studio 2012 - Dynamic/automatic updated history in TFS/VS -

is possible make history window in visual studio track active selected item in source control explorer window? other source control software have used have option, , makes easy iterate through files in folder , see has changed. it doesn't out of box, , i'm not aware of plug-in that. in vs 2012 team moved history view in editor document rather tool window making mode of working less i'm afraid. that said, i'll pass feedback along team make tfvc provider. being eclipse guy myself familiar mode of working , find useful @ times.

parsing - Parse youtube feed output -

hello having problem retrieving value link . far i've been using line of code. $str = "https://gdata.youtube.com/feeds/api/videos/vdbubcocu_a"; $blow =(explode("'",$str)); print_r($blow); and echoes out "array" appreciate how retrieve value link. thanks. if correct, using php? suggest use google php client library @ https://developers.google.com/youtube/2.0/developers_guide_php for case, see https://developers.google.com/youtube/2.0/developers_guide_php#video_entry_contents $videoentry = $yt->getvideoentry('vdbubcocu_a'); printvideoentry($videoentry); function printvideoentry($videoentry) { echo 'video: ' . $videoentry->getvideotitle() . "\n"; echo 'video id: ' . $videoentry->getvideoid() . "\n"; echo 'updated: ' . $videoentry->getupdated() . "\n"; }

Multiple Launch image of iOS -

my app has terms&condition page. visible first time after app install. after accept terms never shows user. i have make launch image first page, not terms page. should not standard first time after app install. so how can use 2 launch image based on condition? if set portrait mode app (for both iphone , ipad), apple reject that? thanks! i solved this way: - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { nsuserdefaults *defaults = [nsuserdefaults standarduserdefaults]; // ... stuff if( [defaults objectforkey:@"gtcaccepted"] ) { [self performselector:@selector(gtcaccepted)]; // } else { gtcviewcontroller* gtcviewcontroller; // gtcviewcontroller normal uiviewcontroller //universal app if (ui_user_interface_idiom() == uiuserinterfaceidiompad) gtcviewcontroller = [[gtcviewcontroller alloc] initwithnibname:@"gtcvie...

Update query to find out registered ids from an array in php -

i trying find out ids in array registered or updated in database. how can customize query add array of ids $ids , make query check ids in array if 1- registered , visibility 1 , update_time > :update_time here code function getonlinecontacts() { try { $conn = $this->getdbconnection(); $update_time = time() - 120; $ids = array($_post['ids']); $statement = $conn->prepare('select linkedinid users update_time > :update_time , visibility = 1'); $statement->bindparam(':update_time', $update_time, pdo::param_str); $statement->execute(); $conn = null; } catch(pdoexception $e) { throw $e; } } assuming id field named id , try this $ids = implode(",",$_post['ids']); $statement = $conn->prepare('select linkedinid users update_time > :update_time , visibility = 1 , id in(:ids)'); $statement->bindparam(':...

c# - How to show image in DotNetNuke custom module? -

i'm writing custom module upload image. after upload file custom folder. when loading image, image's address correctly doesn't show in image control. how show image in dotnetnuke custom module? //save picture code: fileuppic.postedfile.saveas(mappath("~/images/hotels/" + filename)); //load picture code: while (dr.read()) { imgpic.imageurl = mappath("~/images/hotels/") + dr["picture"].tostring(); } //my imagecontrol : <asp:image id="imgpic" runat="server" /> you're not using file system intended dnn. images should managed through dnn's dotnetnuke.services.filesystem namespace , you're writing lot of code don't need in order save images (try dnnfilepickeruploader control, handles upload , passes fileid). once have fileid persisted object, use load image: private string getpath(int fileid) { stringbuilder sb = new stringbuilder("/portals/"); ...

jquery, ajax: several post-requests instead of one -

i using django , jquery , try change button view after submit without page reloading. when press first time okay, second press lead 2 post-requests, third 3 , etc , button doesn't change anymore. although data in databases changes should every button pressing. please, me find out wrong jquery code , how prevent post requests multiplication function send() { $('.valid').submit(function() { var a_id = $(this).attr('a_id'); var vl = $(this).attr('vl'); $.ajax( { data: {'a_id' : a_id}, type: 'post', url: 'vl/', success: function(data, status) { $('#mark_'+a_id).html('<i class="icon-white icon-ok"></i> correct!') $('#mark_'+a_id).attr("id...

c# - Ref in async Task -

how can pass reference parameter async method in windows store app ? i'm looking this: var = dothis(ref obj.value); public async task dothis(ref int value) { value = 10; } but error: async methods cannot have ref or out parameters has way? note: i need pass obj.value. method used different types of objects, same type of objects, 1 object, pass obj.val_1, obj.val_2 or obj.val_10. values same type (for ex string) if don't care little overhead , possibly prolonged lifetime of objects, emulate ref behavior passing setter , getter method function, this: public async task dostuff(func<int> getter, action<int> setter) { var value1 = getter(); await dosomeotherasyncstuff(); setter(value1 * value1); } and call this: await dostuff(() => obj.value, x => obj.value = x);

django - password field data gets clear after submitting -

i uisng django's auth_user table username , password.to change password field did below in forms.py class userregisterform(forms.modelform): password = forms.charfield(widget=forms.passwordinput()) class meta: model = user after changing password field widget passwordinput ,whatever password enter gets cleared if press save button.i tested it,the data gets saved in db,i able login using same username , password. template.py <tr> <td>password</td><td>{{registerform.password}}* </tr> clarification:before changing password widget,the value entered displayed in field same , not cleared in field if save. after changing password widget getting issue.password showing in bullet point symbol if hit save button,entered password gets cleared field(field become empty saving in model) what problem this. thanks this correct behaviour, of course. not want password returned user: securi...

java - Example of how to change textView Color onTouch? -

been working on prject while, want when user touches screen changes color of textview(digitalclock). i'm bit of noob when comes java need working example if possible? here's code far: public class mainactivity extends activity { private static final random random = new random(); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); getwindow().addflags(windowmanager.layoutparams.flag_keep_screen_on); setcontentview(r.layout.activity_main); handler handler = new randommovehandler((textview) findviewbyid(r.id.digitalclock1)); handler.sendemptymessage(0); } private static class randommovehandler extends handler { private final weakreference<textview> textviewweakreference; private randommovehandler(textview textview) { this.textviewweakreference = new weakreference<textview>(textview); } @override public void handlemessage(message msg) { textview textview = ...

ruby on rails - jQuery .on() not working with jquery-ujs -

so have rails app renders views via jquery-ujs. (data-remote in urls, load of js.erb files things like: $('#whatever').html('<%= j render("form") %>'); in main js file, have event handlers so: $('.action').on('click', function() { console.log("clicked"); }); but on() behaviour not attach new elements inserted jquery-ujs. can go console , paste above code , attaches fine (once elements there), straight after ujs fires, no luck. bug or doing wrong? this jquery 1.9.1 , rails 3.2.13 btw. you need bind on parent document . now, you're binding directly .action element, same using $('.action').click() . because you're adding elements dom later, need delegate handler that's present before elements inserted. can provide selector second parameter of .on event bind .action . have @ 'direct , delegated events' section in jquery's api documentation .on . this should work: $(...

bash on Linux, delete files with certain file extension -

i want delete files specific extension - " .fal ", in folder , subfolders, except 1 named "*original.fal". problem want delete other files have same extension: *original.fal.ds *original.fal.ds.erg *original.fal.ds.erg.neu there other " .fal "s want delete well, don't have "original" in them. names vary time, can't delete specific names. *original.fal doesn't vary. i can here: $find /disk_2/people/z183464/doe-wellen -name "*.fal" \! -name "*original.fal" -type f -exec echo rm {} \; it great if command can delete in folder (and it's subfolders) has been called (executed) when run code gives me error: /disk_2/people/z183464/doe-wellen: directory if not want find dive deep, can restrict -maxdepth .

php - USING if statement do not work as it should -

i have if statment used in code logic of code not work should want when user enter city name without entering district name system must display error message and when user enter city name , district name without entering lat , long system must display error message . what hapen in code if user enter city , lat long system display error message inform user enter lat , long code: if($_post['city']) { $city = $_post['city']; $lat = $_post['lat']; $long = $_post['long']; if($_post['dist'] =="") { $errormsg = "you can not add city without having relation district"; } if($lat || $long ==""){ $errormsg = "you can not add village without coordination";} else { $sql = mysql_query("insert village (id, village_name, district_id, lattitude, longitude)values('', '$city', , '$lat', '$long')")or die(mysql_error())...

c# - Authenticate traffic between application and server -

introduction i have application build-in registration form. registration form post webserver , create account user. let's register page (on server) found @ https://mywebsite/register.php , stops user manually going there , register account himself (when sending post arguments it, there no html form fields or there). the user can put proxy between application , webserver, requests , modify them. might not sound issue of you, functions (the webserver more handling registration requests) need know request came application , not user. my question how know request came application , unmodified? personally, have thought encrypting data (additionally https ) formula (like hardware authenticators do) , decrypt them on webserver. i'd hear thoughts on , possibly solution this. there no difference between browser , malicious user tools. browser can read , send, user can too. clientside (javascript, https) encryption not going help, user can extract encryption me...

c++ - variadic templated Object multiplication -

in below code doing multiplication variadic templates int values , objects. works primitive types. works 2 objects. code doesn't compile when use more 2 arguments objects multiply. multiply(1, 2, 3, 4, 5, 6) //works correcyly multiply( a(1), b(1)) //works correctly multiply( a(1), b(1), b(1) ); //compile time error multiply( a(1), b(1), b(1), b(1) ); //compile time error how solve problem more 2 object multiplication? multiplication done left associative. #include <iostream> #include <assert.h> #include <cstddef> #include <typeinfo> #include <stdlib.h> using namespace std; template <typename...> struct mults; template <typename t1> struct mults<t1> { typedef t1 type; }; template <typename t1, typename... ts> struct mults<t1, ts...> { static typename mults < ts...>::type makets(); //a static t1 maket1(); //b typedef decltype(maket1() * makets()) type; //c }; template <type...

php - Filter posts by multiple checkbox categories - wordpress -

Image
i set widget filter post categories. let's say, have 2 different categories, "countries" , "length of stay" sub categories. here example of have: what want, filter posts multiple categories. so, if user checking country "laos" , length of stay of "2-4days", retrieve posts category "laos" and category "2-4days" has been attached. i tried use query multiple taxonomies pluging. however, plugging retrieving posts "laos" category , posts length of stay of "2-4days". i know, can filter post query, but, need create widget submit button. also, customise remove parent categories , display them title (remove checkbox of "countries" , "length of stay" , add them specific class)? working query: <?php // cat 42=laos cat 57=2-4days <?php $my_query_1 = new wp_query(array('category__and' => array(42,57))); ?> <?php while ($my_query_1->have_po...

javascript - Google Maps v3 directionsRenderer.setMap(null) not working to clear previous directions -

i trying clear previous directions google map. when search, polyline , markers previous search still show. have tried using directionsrenderer.setmap(null), doesn't make difference. ideas i'm doing wrong? (function () { maps.directions = function(googlemap, data, options) { var directionsservice = new google.maps.directionsservice(), directionsrenderer = new google.maps.directionsrenderer(); function getdirections() { directionsservice.route(data.request, function(response, status) { if (status === google.maps.directionsstatus.ok) { directionsrenderer.setdirections(response); } }); } directionsrenderer.setmap(null); directionsrenderer.setmap(googlemap); getdirections(); }; })(); this because initializing new directionsrenderer in every call of function. make directionsrenderer little more global. , first setmap(nu...

Zend Framework Cache creates new file and doesnt load it -

i'm having little problem zend framework full page cache. current bootstrap configuration looks this: $dir = public_path . "/tmp/"; $frontendoptions = array( 'lifetime' => 6000000000, 'content_type_memorization' => true, 'default_options' => array( 'cache_with_get_variables' => true, 'cache_with_post_variables' => true, 'cache_with_session_variables' => true, 'cache_with_cookie_variables' => true, ), 'regexps' => array( '^/.*' => array('cache' => true), ) ); $backendoptions = array( 'cache_dir' => $dir ); // getting zend_cache_frontend_page object $cache = zend_cache::factory('page', 'file', $frontendoptions, ...

networking - Internal error using Network Service Discovery in Android -

during first implementation of nsdmanager using examples , tutorial on developer page , application started discovery , found devices. however seems broken... when program started, after initialization, code enters following method , run: public void discoverservices() { log.d(tag, "initializing discovery on nsd"); mnsdmanager.discoverservices( service_type, nsdmanager.protocol_dns_sd, mdiscoverylistener); } the log-message received. after while (say approx 5 mins.) outputted program: 05-21 11:08:32.518: e/nsdcamera(12236): discovery failed: error code:0 05-21 11:08:32.518: w/dalvikvm(12236): threadid=12: thread exiting uncaught exception (group=0x40c9c930) 05-21 11:08:32.518: e/androidruntime(12236): fatal exception: nsdmanager 05-21 11:08:32.518: e/androidruntime(12236): java.lang.nullpointerexception 05-21 11:08:32.518: e/androidruntime(12236): @ android.net.nsd.nsdmanager$servicehandler.handlemessage(nsdmanager.java:338) 05-21 11:08...

php - sugarcrm 6.5.13 js bugs -

i have installed fresh copy of sugarcrm on centos 5 php v5.2.4 , javascript errors. syntaxerror: missing ; before statement [break on error] {ajaxstatus.s owstatus(sugar.language.get('app_strings','lbl_loading_page' style-...qxfmstw (line 6, col 14) above copied firebug console. when click on account tab lots more errors. has fixed these bugs? uncaught exception: ajaxui error parsing response [break on error] {sugar.themes.setmoduletabs(r.modulelist);} uncaught exception: ajaxui error parsing response a window pops has title reads: an error has occured: , content displays {"content":" are files correctly loading? take @ network console , out errors while loading files. file permissions wrong , ajax tries load receives 404s or 500s

sorting - Sort an array in descending order php -

i have array: array ( [0] => 0px 0px [1] => -101px 0px [2] => -205px -3px [3] => 0px -77px [4] => -100px -80px [5] => -202px -80px ) i sort in order have: array ( [0] => -202px -80px [1] => -100px -80px [2] => 0px -77px [3] => -205px -3px [4] => -101px 0px [5] => 0px 0px ) based on research, ksort() supposed trick im having 1. could please tell me doing wrong. thanks use array_reverse() : http://php.net/array_reverse it reverses array order name suggests.

Can I define C functions that accept native Go types through CGo? -

for work i'm doing integrate existing library, ended needing write additional c code provide interface usable through cgo. in order avoid redundant data copies, able pass standard go types (e.g. go strings) these c adapter functions. i can see there gostring , gointerface types defined in header cgo generates use exported go functions, there way use these types in own function prototypes cgo recognise? at moment, i've ended using void * in c prototypes , passing unsafe.pointer(&value) on go side. less clean i'd though (for 1 thing, gives c code ability write value). update: just clear, know difference between go's native string type , c char * . point since copying string data passed c function anyway, doesn't make sense have code on go side make own copy. i understand string layout change in future version of go, , size may differ platform. cgo exposing type definitions match current platform me via documented _cgo_export.h header gener...

jquery - Disabling hover event with the .not() method -

i have following code , can't figure out why hoverintent event firing although assign selected-food class li element on click. here jsfiddle: http://jsfiddle.net/7upcc/2/ expected behaviour: when list item clicked, selected-food class assigned (works fine) , hidden div containing ingredients not shown on hover. i'm trying achieve .not() method. actual behaviour: hidden div shown on hover although hovered item has selected-food class assigned. html <ul> <li class="food-name">food 1 <div class="food-ingredients"> <ul> <li>ingredient 1</li> <li>ingredient 2</li> <li>ingredient 3</li> </ul> </div> </li> <li class="food-name">food 2 <div class="food-ingredients"> <ul> <li...

javascript - How to keep round corners using Bootstrap -

Image
from following image , want hide second button, using javascript , , need first button have round corners. after hide second button using javascript, first button has rectangular shape on right side: if delete button node, bootstrap sets rounded corners, not useful. this need, using javascript: the standard bootstrap html button structure: <div class="btn-group"> <button class="btn btn-mini action_select customselect" id="btn_bulk_action" data-toggle="button" disabled="disabled">reply<span class="reply2"></span></button> <button class="btn btn-mini action_select" data-toggle="button" id="btn_bulk_action_archive" disabled="disabled" style=" display: none; ">archive<i class="icon-remove"></i></button> </div> it's because buttons i...

android - how can i make the project refactoring programmaticly in java? -

i have template project generates signed apk using ant script , each apk should uploaded market different package name requires refactoring packages whole project , problem able create apk new configuration each time need add refactoring , work programmaticly without manual interaction is there example ? taking in consideration read many articles nothing clear far in section of android documentation, talks proguard, in refactoring. read little this, , check if im right.

c# - Retrieve a hidden form -

i have hidden form want show. don't want create 1 this: form1 f1 = new form1(); since i'm using notification area icon. when opening new window, multiple notification area icons. so there way show hidden form? yes. linq way: var frm = application.openforms.oftype<form>().firstordefault(x => x.gettype() == typeof(form1)); if (frm != null) { frm.show(); } or iterate on application.openforms foreach (var form in application.openforms) { if (form form1) { form.show(); break; } }

c# - check if the monitor is connected -

i've make simple program reports server state of monitor (is on/off or if it's not connected). far i'm using method found on discussion, returns me true every times, if i've disconnected monitor. public static boolean ismonitoractive() { boolean active = false; var query = "select * wmimonitorbasicdisplayparams"; using (var wmisearcher = new managementobjectsearcher("\\root\\wmi", query)) { var results = wmisearcher.get(); foreach (managementobject wmiobj in results) { // "active" property , cast boolean, should // tell if display active. i've interpreted mean "on" active = (boolean)wmiobj["active"]; return active; } } return active; } i've check status of monitor every 2-3 m...

How can I get an inset title for well in Twitter Bootstrap? -

Image
i using twitter bootstrap styling , trying replicate group box title in twitter bootstrap uses on documentation pages. i can find css, there javascript involved here put "example" text dom. ideally ability have div styles image supply title such "my title" can vary "example". has got suggestions? seems missed css class added content!! if want achieve result include following css: .group-example:after { background-color: #f5f5f5; border: 1px solid #dddddd; border-radius: 4px 0 4px 0; color: #9da0a4; content: "example"; font-size: 12px; font-weight: bold; left: -1px; padding: 3px 7px; position: absolute; top: -1px; } .group-example { background-color: #ffffff; border: 1px solid #dddddd; border-radius: 4px 4px 4px 4px; margin: 15px 0; padding: 39px 19px 14px; position: relative; }

jquery - Load HTML with Ajax vs. load only data with Ajax and build the html with Javascript -

i'm working on project needs load via ajax html information on page.but i'm not quite sure how load information. i don't know method better me: 1) load entire html ajax , append page or 2) load data ajax , build html using javascript (+ jquery ) the 1 tend use first method because it's easiest 1 more expensive regarding memory (the biggest file have load has 7kb not much) the second one hardest, involves huge javascript ( jquery ) code build html (i have load attributes element).and because have lots of different html code load have make lots of conditions (e.g. 1 button , 1 title , 1 textarea etc) , have create variables containes html . my question method best use in case? i stick solution cleanly divide data/logic , view. case in first alternative. making changes html generated javascript quite hard. i'd suggest option: use client side templates. load template , data ajax call , fill out template using javascript....

servlets - Filters not working properly -

i made 2 filters auction web application. implemented 2 filters, first performs simple logging operations, , second, check if user authorized access particular resource. the troubles these filters work correctly first time connect website. infact displays name of the user in toolbar, , happens if logged in correctly. afterwards, log out , repeat process, second filter not work @ all. i put println statements check if filters executed, isn't case. first filter works constantly. strange part arises when change xml mapping. infact, when take mapping out both filters, first filter continues working! went nuts day yesterday trying understand this. weirder yet, if rewrite xml mapping filters, work both first log in process, then, once log out , repeat operation, log in filter doesnt work anymore. make web application java7, netbeans 7.2 , tomcat 7. fear may bug netbeans idea, not sure. the xml mapping following: <web-app version="3.0" xmlns="http://java....

c# - How to remove comma separated value from a string? -

i want remove comma separated value string.. suppose have string string x="r, v, l, m" and want remove r above string, , reform string this string x="v, l, m" from above string want remove value logic throw , reform string. should remove value , comma next , reform string... the below specific code.. want remove value logic, want remove , comma next , reform string no empty space on deleted item.. how can achieve this? offidcoll = my_order.customofferappliedonorder.trimend(','); if (offidcoll.split(',').contains(offerid.tostring())) { // here want perform operation. } tombala, applied doesn't work..it returns true if (!string.isnullorempty(my_order.customofferappliedonorder)) { offidcoll = my_order.customofferappliedonorder.trimend(','); if (offidcoll.split(',').contains(offerid.tostring()))...

To show a hidden div with If-else condition for mobile quiz application -

what want do: trying create mobile quiz application display list of questions in form 1 one. what able do: have read through site , able scroll through questions without problems. also, javascript scoring engine working fine. <script type="text/javascript"> $(document).ready(function () { var currentquestion=0; var totalquestions=$('questions').size(); $questions = $('.questions'); $questions.hide(); $('.scorepage').hide(); $($questions.get(currentquestion)).fadein(); //show first question // when users click on "next question button... $('#next').click(function(){ $($questions.get(currentquestion)).fadeout(function(){ //hide current question currentquestion = currentquestion + 1; //go next question if(currentquestion == totalquestions){ //if no more question $('.scorepage').show(); $('.button1').hide(); ...

jsf - Primefaces update table after on-cell editing -

i have data table on-cell editing feature, , want update data table show modified record apply them different style class. here problems: if not update data table when oncelledit event fires, records correctly updated, cannot see applyed style class modified rows. if update data table when oncelledit event fires , use return key update value, works fine, , can see applied style class modified rows. if update data table when on-cell edit event fires , use mouse clic update value (clicking on row or on cell within same row), first value updated correctly; when trying update other values, oncelledit event triggers before can insert new value, event triggers newvalue=oldvalue , subsequent changes. the xhtml page: <h:form id="frm_tbl_riv"> <p:datatable id="tbl_rilevazioni" var="rilevazione" value="#{rilevazioni.rilevazioni}" widgetvar="tbl_rilevazioni_id" editable="true" editmode="cell" ...

winforms - Form doesn't refresh in Powershell GUI application (Enable/Disable Text boxes doesn't work) -

i writing script reads user details active directory, reads users samid , pull details in text boxes display; here using radio button enable/disable textboes. radio button switches between 2 modes, readmode/writemode enables , disables text boxes can edited , changes can committed. here issue, default readmode radio button checked , every text box disabled, when check write mode button , gets enabled , stays there. when check readmode button again , doesn't disable boxes ; tried form refresh , didn't work; please let me know if alternatives. function readad( $object ) { $textbox2.enabled = "false" $textbox3.enabled = "false" $textbox4.enabled = "false" $textbox5.enabled = "false" $textbox6.enabled = "false" $textbox7.enabled = "false" $textbox8.enabled = "false" $textbox9.enabled = "false" $richtextbox1.enabled = "false" $button4.visible = "false" $form1.refresh() } fun...

visual c++ - Reguarding Syntax of VS C++ 2010 and the reason I cannot build it -

would mind pointing out me, has been quite while since have compiled c++ code, reason following code generating error on attempt build it. attempt build basic, entry level, win32 console application , ide has been configured expect much. thank, in advance, whoever might take time point out oversite. code follows: #include "stdafx.h" #include <iostream> using namespace std; bool accept() { int tries = 1; while (tries < 4) { cout << "do want proceed (y or n)?\n"; char answer = 0; cin >> answer; switch (answer) { case 'y': return true; case 'n': return false; default: cout << "sorry, don't understand that.\n"; tries = tries ++; } cout << "i'll take no.\n"; return false; system("pause"); } the error message is: 1...

jquery - Pictures show up one by one, not as an iframe -

here's page i'm having trouble with: http://www.benjamine-immobilier.com/a-vendre/3-pieces-chartres-28 i don't understand why, pictures don't show fancybox. when change name of class of pictures, pictures show on full screen 1 one. when download , install plugin fancybox, menu doesn't work anymore (annonces doesn't show vendre, louer, vendu / loué) i have no idea why. want able see pictures fancybox when click on 1 in sidebar gallery. could me please ? thank much. looks version of jquery 1.9.1 'new'. fancybox uses $.browser built jquery, fancybox has dependency on , dropped in jquery 1.9. in chrome dev tools, console outputting this: uncaught typeerror: cannot read property 'msie' of undefined uncaught typeerror: cannot read property 'version' of undefined i'd suggest either revert older jquery or pull out $.browser function old jquery , load it.

sql server 2008 - sql time from value -

i have column integer values in seconds, ie: seconds 234555 1123 44567 i need select of column return value should in form of 1d 13h 23m how should formulate sql query? not solution anyways declare @day int declare @tmphour int declare @hour int declare @tmpminute int declare @min int select @day = seconds_column/ (24*60*60),@tmphour = seconds_column%(24*60*60) yourtable select @hour = @tmphour / (60*60) select @tmpminute = @tmphour%(60*60) select @min = @tmpminute/60 select cast(@day varchar) + ' day '+ cast(@hour varchar) + ' hour ' + cast(@min varchar) + ' min'

php - Do I need to use google maps api for business -

i'm looking @ adding feature uses google maps , google maps api social networking site. however, unsure if need purchase google maps business, website subscription based. users won't paying using maps, need purchase subscription use site. does know if can use regular google maps api, or need purchase google maps business account? i had @ google terms , couldn't figure out if above allowed. yes, need business account: refer here: http://www.google.com/enterprise/earthmaps/maps-compare.html "reselling services google maps" requires business account api access

opencv - How to extract velocity vectors of a pixels from calcOpticalFlowFarneback -

i have been looking extract velocity vectors of every pixels b/n 2 frames. used opencv function flows: calcopticalflowfarneback(previous_gray, current_gray, optical_flow, 0.5, 3, 15, 3, 5, 1.2, 0); previous_gray = previous frame current_gray = current frame and gives me array in 3rd argument optical_flow can't tell how extract velocity vectors using array. thanks in advance. dawit mat& flow: computed flow image; have same size previmg , type cv_32fc2 this type means have 2 float variables (presumed x , y) each pixel's motion. try this: optical_flow.at<cv::point2f>(1023,767).x optical_flow.at<cv::point2f>(1023,767).y

Android, sending custom SEND intent -

i need send intent sharing link application, standard way send this: intent sendintent = new intent(); sendintent.setaction(intent.action_send); sendintent.putextra(intent.extra_text, "this text send."); sendintent.settype("text/plain"); startactivity(sendintent); my problem want have option share application, if choice application share thing, see applications have ability of sharing content , want see app there to, can use definition in manifest: <intent-filter> <action android:name="android.intent.action.send" /> <category android:name="android.intent.category.default" /> <data android:mimetype="text/plain" /> </intent-filter> the question is, there way send data on bundle spatial application share? this: intent sendintent = new intent(); sendintent.setaction(intent.action_send); sendintent.putextra(intent.extra_text, "this text send."); sendintent.putextra(my_extra, e...

encryption - Error Initializing OpenSSL module in perl -

hi newbie perl. how create pkcs7 signature in perl .any example code helpful. tried use openca::openssl. got error initializing openca::openssl instance. in advance....... code $openssl = openca::openssl->new(path=>'/usr/bin/openssl'); $crl=$openssl->issuecrl( cakey=>'passbook/key.pem', cacert=>'passbook/certificate.pem', passwd=>'somepass', outfile=>'passbook/signature', outform=>'der', ); the error message got use of uninitialized value $initial_skip in concatenation (.) or string @ /usr/local/share/perl/5.14.2/parse/recdescent.pm line 3054."

javascript - Reference backbone functions from within a nested d3 function -

i trying reference backbone function within d3 function inside backbone render function. must reference other backbone functions, backboney things, can't access them referencing using this/that method (i use this/Æ’this): define([ // require.js file modularization ], function(){ return backbone.view.extend({ initialize: function(options){ //code this.render(); }, render: function(options){ // how access backbone view in nested situations var Æ’this = this; //normal rendering if (!options) { // stuff, vars // compile template // d3 stuff var linedata = ({...}); var pathfunction = d3.svg.line() var beatunwindingpaths = [......]; var beatcontainer = d3.select('#beatholder'+this.parent.cid); var beatpath = beatcontainer //.append('g') .insert('path', ':first-child') .data([beatunwindingpaths[0...

java - Pagination with Hibernate Criteria -

i facing problem in pagination. using criteria. display length 10. while clicking pagination shows different results list 9 , 8 that. how avoid kind of pagination problems. need list 10 every time. how control kind of inconsistancy. user setfirstresult() , setmaxresults() this. here short code example: entitymanager em = ..... .................... typedquery<t> query = em.createquery(criteria); query.setfirstresult(pagenumber * pagesize); query.setmaxresults(pagesize);

How do I construct this table relationship in SQL Server? -

Image
sorry, if rather basic question i'm sql server noob in need of help. i have 2 types of loan providers, lender , pingtree . both lender , pingtree can have relationship matchservice , need able store id . at moment i'm struggling work out how can create relationship between them. demonstrate, i've created simple visual of want in real world (ringed in red) , think possible solution in sql server. in essence lender , pingtree have providerid , id stored in match table all advice appreciated. if designing table use provider match table, , store common attributes in provider table. non-common attributes, create them name/value pair table can link provider id. edit: added sample of data structure. matchservice (key matchid + providerid) |matchid |providerid| --------------------------- | 1 | 1 | | 2 | 1 | | 3 | 2 | | 4 | 1 | provider (key providerid) |providerid...