Posts

Showing posts from August, 2011

java - javax.net.ssl.KeyManagerFactory is a restricted class error with GAE -

i have spring social application deploying on google app engine , i'm getting following error during 1 of application workflows: java.lang.noclassdeffounderror: javax.net.ssl.keymanagerfactory restricted class. please see google app engine developer's guide more details. @ com.google.appengine.tools.development.agent.runtime.runtime.reject(runtime.java:51) @ org.apache.http.conn.ssl.sslsocketfactory.createsslcontext(sslsocketfactory.java:184) @ org.apache.http.conn.ssl.sslsocketfactory.createdefaultsslcontext(sslsocketfactory.java:209) @ org.apache.http.conn.ssl.sslsocketfactory.<init>(sslsocketfactory.java:333) @ org.apache.http.conn.ssl.sslsocketfactory.getsocketfactory(sslsocketfactory.java:165) @ org.springframework.social.support.httpcomponentsclienthttprequestfactory$httpcomponentsclient_4_1.getinstance(httpcomponentsclienthttprequestfactory.java:185) @ org.springframework.social.support.httpcomponentsclienthttprequestfactory.<...

jquery - Radio box select search form -

hello have search form in mangeto website , http://upgrade.fisapacient.ro looks : <form id="search_mini_form"> <div class="form-search"> <label for="search">search:</label> <div class="input-box"><input id="search" type="text" name="q" value="" class="input-text" autocomplete="off" lang="ro"></div> <button type="submit" title="cauta" class="button"><span><span>cauta</span></span></button> <div id="search_autocomplete" class="search-autocomplete" style="display: none; "></div> <input name="se" type="radio" value="catalogsearch/result/">produse <input name="se" type="radio" value="cauta">site <script type="text/javascript...

Authentication with node.js, nano and CouchDB -

is there way change config parameters in nano after initialization? i'd init nano with: nano = require('nano')('http://127.0.0.1:5984') and later change user , password, after user submits login form. error: nano.cfg.user = params.user.name typeerror: cannot set property 'user' of undefined or should fork nano , write auth function adjust values? i can't test right now, but, looking @ sources, can note 2 things: that configuration is exposed config , not cfg ; that config option connection url . then think need set url configuration option new value authentication parameters: nano.config.url = 'http://' + params.user.name + ':' + params.user.password + '@localhost:5984'; or can keep configuration object in couch.example.js , like: cfg.user = params.user.name; cfg.pass = params.user.password; nano.config.url = cfg.url; update : here's complete example: var cfg = { host: "localhost...

Windows / Perl / Net::SSLeay / OpenSSL: What locations are CA certificates loaded from? -

here's program https request, code @ start i'm going explain below: use 5.012; use lwp::useragent; use http::request::common; use net::ssleay; begin { return unless $^o eq 'mswin32'; # needed on windows print stderr "attempting set https_ca_file pem file path\n"; require mozilla::ca; # load module determine pem file path $pemfile = { $path = $inc{ 'mozilla/ca.pm' }; $path =~ s#\.pm$#/cacert.pem#; $path; }; if ( -f $pemfile ) { $env{https_ca_file} = $pemfile; print stderr "https_ca_file set $pemfile\n"; } else { warn "pem file $pemfile missing"; } } # ========================================================================== $net::ssleay::trace = 2; $ua = lwp::useragent->new; $req = 'https://client.billsafe.de/'; $rsp = $ua->request( $req ); $rsp->is_success ? 'success' : 'failure'; $rsp->status_line; ...

.htaccess - shorten url string -

i'ld shorten link. think .htaccess solution fo this, right? http://www.example.com/myfolder/?option1=hello&name=world&land=how&location=are&city=you how can managed? thanks i think want achive this http://www.example.com/hello/world/ => http://www.example.com/myfolder/?option1=hello&name=world&land=how&location=are&city=you right? if so, can use htaccess this: rewriteengine on rewriterule ^([a-za-z-_0-9]*)?\/([a-za-z-_0-9]*)\/?$ /app/index.php?option1=$1&name=$2 the use somehow complicated, idea is: if open url: http://www.example.com/first/second/ the first: ([a-za-z-_0-9]*) 'captures' word 'first' the second: ([a-za-z-_0-9]*) 'captures' word 'second' and converts /app/index.php?option1=first&name=second check article more info http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html i'm using [a-za-z-_0-9] because url can contain letters, numbers , unde...

javascript - jQuery not changing the background -

my html code is: <ul class="nav"> <li class="nav-one" ><span class="righttab activeright">&nbsp;</span><span class="lefttab activeleft">&nbsp;</span><a href="#featured" class="current">featured</a></li> <li class="nav-two" ><span class="righttab" id="rightnav2">&nbsp;</span><span class="lefttab" id="leftnav2">&nbsp;</span><a href="#core" >core</a></li> <li class="nav-three" ><span class="righttab" id="rightnav3">&nbsp;</span><span class="lefttab" id="leftnav3">&nbsp;</span><a href="#jquerytuts" >jquery</a></li> <li class="nav-four last" ><span class="righttab" id="rig...

android - Where can I see exactly what Xml Attributes do codewise (TextView)? -

http://developer.android.com/reference/android/widget/textview.html#attr_android:password i can't find in android code applied android:password xml attribute. basically, want set transformationmethod manually in code instead of using xml attribute. if call: textview.settransformationmethod(new passwordtransformationmethod()) then happens textview correctly mask characters, until textview focused on in landscape orientation it's full screen keyboard text you're entering. in screen, text in plain text. obviously, xml attribute android:password doing more setting transformation method. can point me xml attributes interpreted in android code, or tell me else need mask characters correctly? the reason can't use xml attribute because i'm doing specific character masking, want hyphens in plain text, while masking else (***-**). this, have extended passwordtransformationmethod ignore hyphens, have call transformationmethod setter manually in code. update: thin...

ruby on rails 3 - Seemingly "orphaned" tasks in Eclipse? -

Image
i new eclipse (indigo) , using aptana studio ruby on rails project. have marked several lines in code "todo" tasks, appear in task view. however, there's w massive list of tasks in view did not create! don't have resource or path values, made me think they're "orphaned" somehow. what these tasks? went through , deleted huge number of them next time started eclipse bigger list there! how rid of these? many thanks, dany. find dropwdown button in "tasks" view. configure filtering: setting should show todos selected project, not projects in workspace.

Anyway to get Visual Studio C++ to autocomplete parameter list? -

very specific issue specific piece of software, hope fine folks can help! i define class in header.h file has few method declarations take parameters class lazy{ void complainforever(char * complaint, float forever = infinity); }; then go lazy.cpp file define function. here psuedo timelapse of how lazy am. void lazy:: // <-- autocomplete kicks in, select method , hit enter void lazy::complainforever // <-- parameter list missing, defeating purpose at point, either have type hand, or copy/paste parameter list header.h file the question this! there keyboard shortcut or method @ having autocomplete take care of parameter list me? thank in advance! why don't try visual assist x . isn't free though.

c - Strcmp comparing to identical strings but not entering loop -

char* timecompare(){ char time[8]; snprintf(time,8,"%i:%02i",hour(),minute()); return time; } char* timefeed = "8:0"; if (strcmp(timecompare(), timefeed) == 0){ serial.println("hello"); } i have code when timecompare() , timefeed both equal not printing hello? pointer problem? instead of comparing timecompare() timefeed compare timecompare() "8:0" loop works... problem timefeed variable? you returning stack allocated variable, time , timecompare() . illegal since stack allocated memory valid in function in variable declared. instead need return heap allocated string. compiler should warning of this. write this: char* timecompare(){ char* time = malloc(8); snprintf(time,8,"%i:%02i",hour(),minute()); return time; } remember free() memory after finished it.

css selectors - Wrap inner anchor tags of only the parent UL with jquery -

i'm having trouble finding right selector nested uls. have following code: <ul class="menu"> <li><a href="">top link 1</a></li> <ul class="menu"> <li><a href="">sub link 1</a></li> <li><a href="">sub link 2</a></li> <li><a href="">sub link 3/a></li> </ul></li> <li><a href="">top link 2</a></li> <li><a href="">top link 3</a></li> </ul> this menu system generated our cms i'm trying use jquery wrap inner "top link" anchors <strong><span> add more styling. i've tried multiple versions of: $('ul.menu:first li a').wrapinner('<strong><span>'); but havent' had luck. seems wrap anchors inside of ul. i'm sure there parent/child selector need us...

Javascript List reducer for CouchDB -

the map out puts key , value, value list of 2 numbers key1 [1,2] key1 [4,8] key2 [1,6] key2 [2,0] the reducer writing reduces key1 [1+4, 2+8] = key1 [5,10] key2 [1+2, 6+0] = key2 [3,6] i wrote script reducer function (key, values) { val1 = 0; val2 = 0; if(values != null) for(val in values) { val1 += parseint(val[0]); val2 += parseint(val[1]); } return [val1,val2]; } this not seem working , doing wrong here ? replace val[0] values[val][0] or better yet: function (key, values) { var val1 = 0; var val2 = 0; if(values != null) { for(var = 0; < values.length; i++) { var val = values[i]; val1 += parseint(val[0]); val2 += parseint(val[1]); } } return [val1,val2]; } it's never idea for...in array because has many other properties.

java - How to get the full command line in JVMTI? -

is possible full command line arguments used launch current java process , during onload phase in jvmti? i have consulted jvmti reference , think not natively provided, guess best shot use byte code instrumentation (bci).

SSIS 2008 r2 how to connect to FTP using SSL -

is there way connect ftp using ssl in ssis. ftp connect in ssis without ssl option, if option of buying not option? i use third-party tool command-line interface or api , transfer using execute process or script task. of time that's easier using rather limited built-in ftp task anyway. many different sftp clients available @ no cost.

Shell script works in bash but not in ksh -

i need write script test if command blablabla exists in classpath. wrote following code: if ! hash blablabla >/dev/null 2>&1; echo not found fi this works fine when script executed in bash. if try in ksh, doesn't work: #! /usr/bin/ksh if ! hash blablabla >/dev/null 2>&1; echo not found fi i expect echo not found executed instead nothing. what's problem? i believe command portable (if matters): command -v -- some_command >/dev/null 2>&1 || printf '%s\n' "not found"

php - Hiding and showing divs depending on variable value -

can please tell me why code below not showing div ticker? shows div main .. thanks lot! <script language="javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('.ticker').hide(); $('.main').show(); $('.other').hide(); }) </script> <?php $main = 'ticker'; if ($main=="ticker"){?> <script type="text/javascript"> //alert('flag'); //this alert shows ok $('.ticker').show(); $('.main').hide(); $('.other').hide(); </script> <?php } ?> <div class="main">main</div> <div class="ticker">ticker</div> <div class="other">other</div> looks you're missing $(document).ready() second script block. ...

Even with ASP.NET 3.5, I am getting "Validation of viewstate MAC failed" error -

i found lost of posts solve error: "validation of viewstate mac failed". read asp.net 2.0 error bug. using vs 2008 asp.net 3.5 sp1. why error coming in version also? i using asp textbox controls. posts have mentioned asp textboxes generate error, have set autopostback of each textbox false. how rid of mess? code added below ** * default.aspx * <%@ page language="c#" autoeventwireup="true" codebehind="default.aspx.cs" inherits="flexstock._default" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <!--<%@ register assembly="mscaptcha" namespace="mscaptcha" tagprefix="cc1" %>--> <link rel="stylesheet" type="text/css" href="~/styles/main.css...

Scala-Java incompatibility referencing static fields in a class with the same name as a static inner class -

take java class: public class fisk { public static class { } public static a = new a(); } this java code works: fisk.a = new fisk.a(); fisk.a b = fisk.a; but calling scala: val fisk = new fisk.a() val strupp = fisk.a results in compiler-error: error: ambiguous reference overloaded definition, [info] both variable in object fisk of type fisk.a [info] , object in object fisk of type object fisk.a [info] match expected type ? [info] val strupp = fisk.a [info] ^ [error] 1 error found anyone knows way around this, or have rename static field? -- andreas scala> fisk.a <console>:8: error: ambiguous reference overloaded definition, both variable in object fisk of type fisk.a , object in object fisk of type object fisk.a match expected type ? fisk.a ^ // static field of fisk scala> fisk.a: fisk.a res1: fisk.a = fisk$a@d86c58 // new constructed instance of typ...

actionscript 3 - Why does delete( DictionaryInstance[ key ] ); fail? -

my app uses dictionary protected _categorytovaluedict:dictionary = new dictionary(); to map something else. now, @ point in application, need remove key dictionary . i implemented simple method: public function setcategorynovalue( cat:tamodelcategory ):void { // delete( _categorytovaluedict[ cat ] ); var old:dictionary = _categorytovaluedict; _categorytovaluedict = new dictionary(); ( var key:* in old ) { if ( key != cat ) { _categorytovaluedict[ key ] = old[ key ]; } } } if use [description of delete operator] delete( _categorytovaluedict[ cat ] ); the app doesn't throw errors in normal mode. serialize external data structure external source [currently sharedobject ], app isn't able de-serialize later on. if use above coded manual iterative removal operation , de-serialize operation works expected , model appears in app. the alternative should identical. sh...

Android Intent issue -

i want show details of calculation in activity when click on button. how achieve this. first activity java code is public void onclick(view v) { if(v.getid()==r.id.button07) { intent intent=new intent(advancedcalculator.this,calculateddata.class); startactivity(intent); } the calculation want is string a,b; integer vis; = txtbox3.gettext().tostring(); b = textview1.gettext().tostring(); vis = (integer.parseint(a)*integer.parseint(b))/100; tv.settext(vis.tostring()); i want result 'tv' shown in next activity when press submit button. need include calculation.and further steps any appreciated thanks in first activity: public void onclick(view v) { //put calculation code here bundle b = new bundle(); b.putstring("answer", youranswer); //you use putinteger, whichever prefer. intent intent=new intent(advancedcalculator.this,calculateddata.class); intent.putextras(b); startactivity(inte...

flex: Ability to drag+drop a movieclip -

in order improve user experience want ability have animated movieclip of turning wheel- , have ability drag , drop anywhere on defined area we have built rotating wheel swc file. how drag+drop. examples have seen, cater dropping of images. again to use flex classes drag , drop you'll need wrap movieclip in uicomponent ; has events related drag , drop. here good instructions . copy relevant pieces: make component draggable add listener mouseevent.mouse_down determine drag initiator , hand-off dragmanager to kick off drag-n-drop, you'll need mouseevent component dragged. public function makedraggable( component:iuicomponent ):void { // mousedown event start drag component.addeventlistener( mouseevent.mouse_down, begindrag ); } public function begindrag( mouseevent:mouseevent ):void { // drag initiator object being dragged (target of mouse event) var draginitiator:iuicomponent = mouseevent.currenttarget iuicomponent...

c# - How do you make NHibernate ignore a property in a POCO -

we have poco, like: public class person { public guid personid { get; set; } public string firstname { get; set; } public string lastname { get; set; } public datetime dateofbirth { get; set; } public string version {get; set; } } and corresponding hbm file <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="nhibernate.firstattempt" namespace="nhibernate.firstattempt.entity" > <class name="person" lazy="false"> <id name="personid"> <generator class="guid" /> </id> <property name="firstname" /> <property name="lastname" /> <property name="dateofbirth" /> </class> </hibernate-mapping> if closely, have version property, there no column in database ? want nhibernate ignore property ...

python - Limiting one Content item per Member in a Folder on Plone 4 -

i have created custom archetypes content type called "résumé" , enforce limitation lets member add 1 item of type inside folder. better redirecting member edit page of or item, if exists in folder. how can enforce limitation , provide functionality? a solution similar usecase plone 3 can found in eestec.base. did overriding createobject.cpy , adding special check this. code in collective svn, @ http://dev.plone.org/collective/browser/eestec.base/trunk/eestec/base/skins/eestec_base_templates/createobject.cpy , lines 20-32.

asp.net - Adding web reference but changing accessor to internal -

i creating wrapper api around existing web api. have added web reference created required classes default accessor set public. goal project encapsulate web api , not have exposed @ outside of wrapper api assembly. is possible change accessor of proxy classes in vs 2010 or there tool should using? thanks.

c++ - Program steps into wrong function -

i have child class bunch of functions implement pure virtual functions in parent class. when debugging, works way should except 1 function. when try step functiona() execution instead enters functionb(), , call stack says i'm in functionc(). functiona() works everywhere else inherit parent class. changing function name nothing, , cleaning / rebuilding nothing. got work adding dummy parameter function, rather real solution. i ran similar months back. it turned out author doing fiendishly clever things during initialization, , compiler hadn't set derived class vtable yet when method call occurred. it bear find it. you're going have take careful @ vtable pointers, , generated assembly language, figure out in initialization process. alternatively, vtable pointer in object may have been overwritten wild copy object.

history - Tracking MySQL Database Changes -

i'm running mysql 5.1.36 , have database used web-based desk system. database has 3 tables i'd track changes for: create table if not exists `tickets` ( `ticketnum` int(11) unsigned not null, `submittedfromip` tinyblob, `submittedfromdevice` varchar(255) default null, `entrydate` datetime default null, `closeddate` datetime default null, `lastname` varchar(50) default null, `firstname` varchar(50) default null, `email` varchar(50) default null, `location` varchar(4) default null, `inventorynumber` varchar(50) default null, `devicename` varchar(50) default null, `description` text, `notes` text, `agent_id` smallint(5) unsigned not null default '1', `totalhoursspent` float not null default '0', `status` smallint(5) unsigned not null default '1', `priority` tinyint(4) not null default '0', `lastupdatedbyagent_id` smallint(5) unsigned default null, primary key (`ticketnum`), key `closeddate` (`closeddate`...

winapi - What is the meaning of the Port Number parameter in Window's ATL Winsock wrapper CSocketAddr::FindINET4Addr -

is udp port used send out dns request, e.g. 53? or can host name example.com have different ip address resolution based off specific port being used, e.g. example.com port 80 1.2.3.4 example.com port 25 5.6.7.8? if so, "port number" parameter port specific name resolution? this method calls window's getaddrinfo ends being 2nd parameter const char* servname string integer port number string, e.g. "53" or "80". the port number used when flag parameter contains ai_numericserv flag: from http://msdn.microsoft.com/en-us/library/ms738520.aspx : when ai_numericserv bit set, pservicename parameter must contain non-null numeric port number, otherwise eai_noname error returned. flag prevents name resolution service being called. the ai_numericserv flag defined on windows sdk windows vista , later. ai_numericserv flag not supported microsoft providers.

iphone - Creating a "developer screen" for game development in cocos2d -

i'm developing game on iphone using cocos2d api. it's going well. 1 issue i'm having though have recompile each time want change variables. tedious, tweaking gameplay. is there implementation sort of developer console screen? mean is: want have type of game screen load, contains list of variables register game screen(with scroller). , want able modify these variables on spot. i remember there being presentation on wwdc event in showed such screen on ipad. developer press button , gamescreen change developer console screen. know presentation had nothing cocos2d, still, if exists in shape or form, love re-use code instead of writing on own. though if had write on own, wouldn't know start. there appreciated well. thx! it (i believe) graeme devine @ apple's wwdc last year had suggestions on how implement such developer console (check video on itunes university). example called game console included example code of wwdc 2010 (232 mb) . i've adde...

flex - How to get the result of a RemoteObject immediately? -

i need make function execute java method , return result. static becouse lot of other functions call function. did this: public static function fkdescription(dest:string):string{ var jremote:remoteobject = new remoteobject(); var s:string; jremote.destination = dest; jremote.getvalues.addeventlistener(resultevent.result,valresult); jremote.getvalues(); function valresult(event:resultevent):void{ s = event.result string; } return s; } but function returns null, because valresult() not been called @ end of main function. shoud make fkdescription() return string came remoteobject? tanks. that's because http calls asynchronous, have way result. want remove result handler it's own function waits result, it. not possible you're trying accomplish right now, returning value right away. check here on how async calls .

facebook - Get User-ID not working sometimes? -

i having issue app made recently. voting app supposed allow voting once per day every user. taking user id , placing every user-id in database, userid = 0 , have no idea why that. getting browser info aswell wanted check might browser related happened on both mozilla , ie. here code below if helps. index.php (code use nonfans) <?php header('p3p:cp="idc dsp cor adm devi taii psa psd ivai ivdi coni our ind cnt"');?> <?php require 'facebook.php'; $app_id = "xxx"; $app_secret = "xxx"; // create our application instance (replace appid , secret). $facebook = new facebook(array( 'appid' => $app_id, 'secret' => $app_secret, 'cookie' => true )); // user id $user = $facebook->getuser(); // may or may not have data based on whether user logged in. // // if have $user id here, means know user logged // facebook, don't know if access token valid. access // token invalid if user logge...

edmx - Cannot insert NULL into a non-identity column in Entity Framework. Funny thing... it's not null? -

i have salesorder table columns id , orderid. id auto-generated int. orderid non-nullable string max length of 20, , use store customer's order number reference. after adding new salesorder , calling savechanges, following error: cannot insert value null column 'orderid', table 'salesorder'; column not allow nulls. insert fails. statement has been terminated. problem is, object i'm saving does have orderid! it's it's trying save entity first before saves values. how ef handles things? my setup ef4.1, using edmx model-first approach. storegeneratedpattern set none. default value set (none) i've tried various values. entity key false, since it's not part of key. i've tried deleting salesorder entity , regenerating database. i see code...i had similar problems when filling objects in loop saving them savechanges. thought fields populated, not. i'd have see code executes before save changes before can offer helpful. ...

Why is my PHP variable not changing when my Javascript code runs? -

i have counter timer , tried block simple bypass download without waiting. so in main class declared boolean $allow_download = false; and in javascript when time elapsed else { textdlshow.style.display = 'none'; divdlshow.style.display = ''; "<?php $allow_download = true;?>"; } and in second class if($allow_download == false) echo "test"; well, when time elapsed boolean not set positive value. suggestions ?? thanks time !! javascript cannot set value of php variable since javascript interpreter cannot parse php (nor variable in same interpreter anyway, since javascript run on client's browser rather on server.) in order need make new request javascript php code can read in order set $allow_download true , serve download. you'll want read on ajax , document.createelement (because 1 way might create iframe pointing @ download location after time has elapsed) , settimeout .

eclipse - Menu button force close android? -

i have , application worked fine when opened menu button , went settings pushed button when added google maps api application button force closes application. has there been 1 else same issue? if how did fix it? or know how fix problem? edit: my log cat errors on button force close 04-29 16:02:13.155: error/androidruntime(16828): fatal exception: main 04-29 16:02:13.155: error/androidruntime(16828): java.lang.runtimeexception: unable resume activity {www.freshapp.com.thumper.html/www.freshapp.com.thumper.html.thumper}: java.lang.nullpointerexception 04-29 16:02:13.155: error/androidruntime(16828): @ android.app.activitythread.performresumeactivity(activitythread.java:3128) 04-29 16:02:13.155: error/androidruntime(16828): @ android.app.activitythread.handleresumeactivity(activitythread.java:3143) 04-29 16:02:13.155: error/androidruntime(16828): @ android.app.activitythread$h.handlemessage(activitythread.java:2059) 04-29 16:02:13.155: error/androidruntime...

objective c - file chooser in iphone -

i fresher in iphone. want make file chooser in iphone. this chooser should able choose file anywhere means other resource folder. you may provide weblinks . please me in matter. i want show files , folders show available in device. thank in advance. the iphone used sandboxing, means accessing files outside of application's sandbox extremely limited. apple not want apps expose filesystem, isn't possible.

C# won't escape "\"? -

possible duplicate: how use “\” in string without making escape sequence - c#? why giving me error in c# when use string like: "\themes\default\layout.png"? @ "d" , "l" location? says unrecognized escape sequence. , how stop giving me error when use: "\"? thans you need escape additional \ : string value = "\\themes\\default\\layout.png"; or use @ symbol: string value = @"\themes\default\layout.png"; which avoid doubling \ . or if dealing paths (which seems are) use path.combine method: string value = path.combine(@"\", "themes", "default", "layout.jpg");

c# - Referring to an item in an IEnumerable with no ID -

so may have coded myself corner, , want know best way out. i have document editor i'm writing, , 1 property of documents being edited list of structures. document stored xml, each of these structures xml node , properties. document class exposes these structures ienumerable. in editor, want literally highlight these structures when mouse nearby. i've done task of identifying 1 close cursor. have able refer instance of structure, , store somewhere. finding closest 1 iterates through ienumerable, , returns structure itself. suppose use structure reference, i'm going wind saying in display code if (thing == nearestthing) , it's going hash code comparison or something, right? that feels wrong way it, don't have proper id these structures either. suggestions? there no problem way. keep in mind though, should make sure == (and greater extend, equals , gethashcode ) reliably produce same results same inputs.

javascript - How to scroll to a div id in GWT -

i have webpage iframe in gwt application running. webpage has <div id="head"> . not possible scroll in iframe (intended) webpage has example height of 1000px. @ bottom there button , want when clicks on button (note: button in gwt application) want scroll top. that means iframe needs force parent window scroll top. tried jsni function this: public static native void scrolltotop() /*-{ $wnd.top.scrollto(0,0); }-*/; but didn't work. new idea scroll div id "header". know how accomplish this? i tried this: document.getelementbyid('header').scrollintoview(); but seems not work (because should in jsni manner?). thanks inputs! it fails because gwt runs in iframe, document references gwt's iframe, , not "html host page". have use $doc in jsni reference document (just $wnd instead of window ). but don't need jsni that; plain old java/gwt do: document.get().getelementbyid("header...

c++ dynamic arrays and pointers -

Image
ok i'm trying create array of pointers point vectors change in size. array of pointers nestled inside class that's inside vector. reason seem having problems memory becoming corrupt. if use vectors run problems stack overflowing caused stuff resizing , calling constructors. here essential layout of i'm gunning for. maybe little sloppy. end problem of memory being currupted in babyclasses pointers, want access "linked" babyclasses via babyclasses vector of babyclasses it's connected to. clever ideas here? and before tells me silly way things, isn't type of functionality basis of oo programming? class baby { public: deque<shared_ptr<baby>> vinputs; int x; int y; int z; baby() { numinputs = 0; isnull = false; wastickled = false; x,y,z = 0; } void addinput(shared_ptr<baby> baby) { if(numinputs == 0) vinputs = deque<shared_ptr<baby>...

css - Right-align the contents of a Facebook like-button iFrame? -

Image
i need right align contents of facebook button sit against ride side of set "width". can in firebug setting table float: right;, doesn't appear work if define value in css. here's in image explain question: edit: here's jsfiddle: http://jsfiddle.net/h66z3/2/ since using button_count layout, there little trick found seems work. wait iframe inserted, , set width 0. automatically resize proper size. can't swear works under circumstances , widths, please test out , see if works you. here sample code page: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <script type='text/javascript'> function loadcode(d, s, id) { var js, fjs = d.getelementsbytagname(s)[0]; if (d.getelementbyid(id)) {return;} js = d.createelement...

atleast one field required jquery validation performance issue -

http://blog.rebeccamurphey.com/2009/04/15/jquery-validation-indicate-that-at-least-one-element-in-a-group-is-required/ jquery validate - require @ least 1 field in group filled i tried above both solution jquery validation..every thing working fine slow..some times ie throwing error "some scripts running slow , may effect system performance or that".. i know causing issue...i have 20 fields on page..and each field calling method more once , 20 times 2 or more that...its guess..i not pretty cause problem..is using solution..is 1 have issue..or missing something.. i tried post question in stackoverflow link..but not supposed that..thats why creating question...please have idea it.. please me... lot.. you use simple jquery script following validation. this loop through input text fields within form, check if have value , submit if 1 or more filled in, if not display error message screen , prevent form being submitted. <script type="text/javascrip...

asp.net - find string using c#? -

i trying find string in below string. http://example.com/tigs/sim/lists/team discussion/dispform.aspx?id=1779 by using http://example.com/tigs/sim/lists string. how can team discussion word it? some times strings http://example.com/tigs/sim/lists/team discussion/dispform.aspx?id=1779 need `team discussion` http://example.com/tigs/alif/lists/artifical lift discussion forum 2/dispform.aspx?id=8 need `artifical lift discussion forum 2` if wanted see regular expression example: string input = "http://example.com/tigs/sim/lists/team discussion/dispform.aspx?id=1779"; string given = "http://example.com/tigs/sim/lists"; system.text.regularexpressions.regex regex = new system.text.regularexpressions.regex(given + @"\/(.+)\/"); system.text.regularexpressions.match match = regex.match(input); console.writeline(match.groups[1]); // team discussion

javascript - Why doesn't setting frame src by js show the display source? -

based on js condition, want either of 2 things happen; either show frame on page or show link "show pdf" on page.. show pdf now while know how show/hide based on js condition, question in case 2nd condition satisfied, not want hide frame thing, ensure not loaded in background well... think using show/hide not stop loading pdf in background.. question how can acheive using javascript? **********here trying********** if(isipad) { $('#content').attr('src','ipad_frame.html'); } else { $('#content').attr('src','xyz.pdf'); } and in html, have <frame src="#" title="content frame" name="content" id="content" /> will work fine? reasons, tested , though goes in if/else part, not show relevant content.. why not add elements dynamically in script container element? (assuming you're using ...

excel vba - Method 'Range' of object '_Global' failed. error -

i'm trying excel figure out columns of worksheet blank. idea delete blank columns. here's code have far: sub macro2() ' ' macro2 macro ' dim totalcols integer dim totalrows integer totalcols = activesheet.usedrange.columns.count totalrows = activesheet.usedrange.rows.count dim integer dim j integer dim numnull integer = 1 totalcols j = 2 totalrows dim location string location = "r" & & ":" & "c" & j if range(location).select = "" numnull = numnull + 1 end if next j if numnull = totalrows - 1 msgbox ("column " & & "is null") end if next end sub at end checks see if numnull (number of null entries in row) = totalrows minus header. had working until statement if range(location).select = "" . compiler says: method 'range' of object '_global' failed does know means or how c...

linux - How to remove unwanted content from string in c++? -

hi have string variable large content. have remove unwanted line string content , keep remaining content is. following output after printing string: string varstring; cout<<"string content :"<<endl<<varstring<<endl; output : string content : /abc/def/ghi/klm/run.so call::myfuncton(int const&) call::my::method(char const&) . . . call::my::newfunction(char *&) now have remove "call::myfuncton(int const&)" line above string variable , keep other data is. can 1 tell tell me how can remove line sting variable? in advance you can use function varstring. find() find position string occurs, , use varstring. erase() erase text.

iphone - How can i select multiple rows from table view and how to get data from that? -

how can select multiple rows table view , need data(cell) selected user. thanks you can add selected cell's [indexpath row] array. , use later. nsmutablearray* selectedcellsarray; // ivar somwhere in implementation selectedcellsarray = [[nsmutablearray alloc] init]; in tableview didselectrowatindexpath delegate method: [selectedcellsarray addobject:[nsnumber numberwithint:[indexpath row]]]; your array have of selected tableview cells indexpath row.

ios - How to clear UIButton background image State? -

-(void) btnaction:(id) sender { nsstring *str =((uibutton*)sender).titlelabel.text; nslog(@"%@",str); nslog(@"%@",[dictionary objectforkey:@"option3"]); correctans=[dictionary objectforkey:@"answer"]; if(str==[dictionary objectforkey:@"option1"]) { selectedans=@"1"; if ([selectedans compare:correctans]==nsorderedsame) { nslog(@"this correct"); [cell.ansbtn1 setbackgroundimage:[uiimage imagenamed:@"option_green.png"] forstate:uicontrolstateselected]; countcorrect++; cell.lblrating.text=[nsstring stringwithformat:@"%i", countcorrect]; } else { [cell.ansbtn1 setbackgroundimage:[uiimage imagenamed:@"option_red.png"] forstate:uicontrolstateselected]; cell.lblrating.text=[nsstring stringwithformat:@"%i", countcorrect]; } } } in initialization of tableview - (uitablevie...