Posts

Showing posts from February, 2015

java - Assigning occurrences of whitespace to variables -

i wondering if possible assign occurrences of characters variable until hit white space character. instance if have string "17 23 4 54 6 343 4" how assign first number 17 variable, , next subsequent numbers. string values = "17 23 4 54 6 343 4"; string[] variables = values.split("\\s"); now you've got array variables holds 17 in variables[0] , 23 in variables[1] , on.

php - SoapFault exception: Could not connect to host -

sometimes fail call web service. this problem happens time. what problem? error: soapfault exception: [http] not connect host in 0 [internal function]: soapclient->__dorequest('<?xml version="...', http://.', '', 1, 0) the problem solved.the problem cache ini_set('soap.wsdl_cache_enabled',0); ini_set('soap.wsdl_cache_ttl',0);

c# - Preserving DateTime values in DataSet returned from WCF service -

i returning dataset wcf web service client. server , client in different time zones. datetime columns server's local time, others in utc. the problem datetime values in returned dataset converted client's local time. there way preserve datetime values server sending back? return datetimeoffset .

returning xml string - how to parse xml file using JQuery/Json -

when alert returning string this: data "<?xml version="1.0" encoding="utf-8" ?> <xml xmlns="http://www.opengis.net/kml/2.2"> <document> <name>john smith</name> <description>stackoverflow</description> <total>50</total> </document> </xml>" update: tried using method getjson , alerts never execute inside find('document').each..... $.getjson(_url, function (data) { alert(data); $(data).find('document').each(function () { debugger var name = $(this).find('name'); var desc = $(this).find('description').text(); var total = $(this).find('total').text() }); }); how read xml file in jquery, below returning me string , can see when alert(data); $.getjson(url, {},

iphone - Unable to retrieve and view results from a SQLite database -

dear fellow iphone , objective-c developers: i trying build skills iphone developer, , presently working on using sqlite database. have created sqlite table follows in grocerylistappdelegate.m class: - (void)applicationdidfinishlaunching:(uiapplication *)application { self.database = [[[isdatabase alloc] initwithfilename:@"testdb.sqlite"] autorelease]; if(![[database tablenames] containsobject:@"groceryitem"]) { [database executesql:@"create table groceryitem(primarykey integer primary key autoincrement, name text not null, number integer not null)"]; [database executesql:@"insert groceryitem (name, number) values ('apples', 5)"]; [database executesql:@"insert groceryitem (name, number) values ('oranges', 3)"]; } [window addsubview:navigationcontroller.view]; [window makekeyandvisible]; } i make sql call in rootviewcontroller.m class: - (void)viewdidload { [super viewdidload]; gro

internationalization - How do the Delphi 2010 IDE's default control fonts work when internationalized? -

i'm using delphi 2010. i've written application in english. provide tstringgrid users can create cross reference of component captions english own language. in every tform's create, traverse form's controls (which have unique tags), changing caption (or hint) property user-provided translations. this implemented , working, @ least in handful of common western languages french, italian, etc. minor screen layout issues (wider buttons, etc.) handle manually occur. not using third-party internationalization tool or delphi's, unless very, bad news in answers question! :-) next time, maybe i'll use tsilang (but not d2010's, heavy me...) when add components in ide, leave default font ide assigns as-is. (it's ms sans serif in locale.) happen when program run in japan, example? delphi rtl change fonts of standard components local font? font display default ascii text on components and allow display characters in their local font in cases they

HTML5 <html> attributes xmlns, lang, xml:lang -

i don't understand html5 specifications lang , xml:lang attributes of opening <html> tag. scrolling bit, understand xmlns "talisman" (has no effect), lang , xml:lang ? should used? if so, should set to? everything i've seen , heard suggests should stick to <!doctype html> <html> <head> <meta charset='utf-8'> (or whatever character set want). if want language associated page can use "lang" attribute on <html> tag. since html5 not xml, really, find weird use xml: namespace stuff.

Java Help with Logic in XML SAX Handler -

i trying set sax handler parse xml following structure: <hours> <set name="business"> <mo> <open>09:00:00</open> <close>17:00:00</close> </mo> <tu> <open>09:00:00</open> <close>17:00:00</close> </tu> <we> <open>09:00:00</open> <close>17:00:00</close> </we> <th> <open>09:00:00</open> <close>17:00:00</close> </th> <fr> <open>09:00:00</open> <close>17:00:00</close> </fr> <sa/> <su/> </set> <set name="lastcollection"> <mo> <close>17:00:00</close> </mo> &

javascript - How to get the inner html value -

<span style="color: red"> advertising cctv/bust</span> <span style="color: red">a</span>tion how value text i used replace function removing once , ignoring second 1 how can one have @ innerhtml in javascript changing text innerhtml

javascript - redirect_to out of an iframe -

i have rails app has form renders in iframe, , create action redirect_to out of iframe , re-render whole page rather in iframe. i curious ideas out there accomplish this. you can it! have replace redirect_to with: render :text => "<script>parent.location.href='/cms';</script>"

jquery - selecting and deleting a row -

for adding rows wrote code this $('#tab1 tbody ').append('<tr id='+i+'><td>'+k+'</td><td>'+l+'</td><td>'+m+'</td></tr>'); in previous snippet i global value.. now if trying select newly added row not recognizing.. selecting wrote this $('#tab1 td').click(function(){ alert(i); $(this).parent().remove(); }); do see mistakes? i think td elements having invalid id's. id should not start numbers . try appending static text before i . also have use .live() event elements generated in js $('#tab1 td').live("click", function(){ alert(i); $(this).parent().remove(); });

java - Function header comments in netbeans -

how generate these kind of function header comments in netbeans? shortcut give template along parameter names? /** * performs decrease key operation * @param index index of node in refarray key decreased * @param amount amount key reduced */ public void decreasekey(int index, int amount) { } just above method, constructor or field, type /** , follow enter immediately. netbeans should generate template javadoc.

c# - How to run an application in background for windows mobile 6? -

this question has answer here: create .net windows service on windows mobile 6.x 2 answers i working on application windows mobile 6. need run application in background . doing using private void app_menu_closing(object sender, canceleventargs e) { this.hide(); e.cancel = true; } now need again launch application stop application not able this. can tell me how this? some options spring mind: if need process window messages: create invisible 0-sized message-only window. if need listen state changes in kernel synchronization objects: don't create window, wait events, in loop if needed, instead. if need listen both: create message window , use msgwaitformultipleobjects react both window messages , kernel events. for service part of question: cannot create true service in c#, need go native happen. can "almost

Access contents of dynamically generated iframe in Selenium -

i want use xpath (or other selenium dsl locator) access dynamically created iframe . goal make assertions contents of dynamic iframe. the iframe not have id , has following html attributes: src="javascript:""" style="position: absolute; left: -2000px;" if can somehow selectframe iframe , can asserttext or use xpath test iframe innards. however, simple approaches seem fail. selectframe("index=0") fails reason. perhaps need way waitfor iframe loaded. can't seem create locator identifier iframe , can't waitfor it. have tried these tips selenium docs? selectframe ( locator ) selects frame within current window. (you may invoke command multiple times select nested frames.) select parent frame, use "relative=parent" locator; select top frame, use "relative=top". may use dom expression identify frame want directly, this: dom=frames["main"].frames["subframe"]

php - Text Area Not Updating Correctly -

i have wysiwyg text area located inside of jquery created tab layer when click submit updates field in database, , posts text area through value. however, when try must click submit button once again when page reloads have value update in text area. this problem of submitting twice happens when add wysiwyg editor text area, updates fine when not wysiwyg editor. i have tried of major wysiwyg editors out there see if editor starting think having text area in jquery area might affecting wysiwyg editor. so guys think? you redirect page upon submission, refresh content on page. using simple header('location: /page.php?msg=success'); work well. this method follows post/redirect/get design pattern. i have seen example you're posting form ajax tinymce. tinymce not use textarea, creates iframe editor in , passes textarea on submit. in order these functions work jquery need make sure you're using tinymce jquery plugin . additionally insert data editor nee

How to convert a ByteArrayOutputStream into a PDF and save in hard disk in Java? -

how convert bytearrayoutputstream pdf , save in hard disk in java? please give sampple. what mean "convert bytearrayoutputstream pdf"? bytearrayoutputstream containing pdf data wanna write on disk? maybe : string filename = "c:\\test.pdf"; fileoutputstream output = new fileoutputstream(filename); output.write(bytearrayoutputstream.tobytearray()); output.close();

java - Adding a user with a password in Active Directory LDAP -

this first time on stackoverflow, hope responses here. using windows active directory 2008 store new user java using spring-ldap api my problem unable add user password. read somewhere in ad set password, should use unicodepwd attribute. source: http://geekswithblogs.net/lance/archive/2005/08/19/ldapauthenticationasp.aspx public void insertcontact(contactdto contactdto) { try{ attributes personattributes = new basicattributes(); basicattribute personbasicattribute = new basicattribute("objectclass"); personbasicattribute.add("person"); personbasicattribute.add("user"); personattributes.put(personbasicattribute); personattributes.put("givenname", contactdto.getcommonname()); personattributes.put("cn", contactdto.getcommonname()); personattributes.put("sn", contactdto.getlastname()); personattributes.put("description", contactdto.getdescription());

Error Turning Asp.net Windows Feature On in IIS 7.2 -

hi guys i'm stuck problem. i have install asp.net on iis. i turning windows features on, aswer "an error has occurred. not of features changed" pc asks reboot after nothing installed wpa not installed, tried reinstall iis (that works) asp.net not want turn on can me? i got stung same symptoms , steps. solution here helped: http://forums.iis.net/p/1174328/1967812.aspx#1967812 basically, problem comes when install component installs or updates .net framework on machine. in case, had installed vs2012 , several components. the link suggests uninstall , re-install .net framework. me, enough repair .net 4.5 install, reboot , problems enabling new window features went away. good luck!

android - How to get height of text with fixed width and get text length which fits in a frame? -

well, i've managed fit questions in title. need break long text in columns/frames , layout them in view. i've been digging solutions couple of days now, can't find examples or clear documentation on how complete of tasks. i've seen mentions of staticlayout, don't know how use properly. text height i've tried textpaint's gettextbounds method, doesn't have width limit , looks measures single line (well, maybe doing wrong). maybe has example of staticlayout or it's subclass usage? everything looks simple "on paper": create "frame", check how characters fits in it, fill frame , position it, repeat until end of text , yet can't find on how :) i don't know exact answer question, can calculate width , height of text based on font type , size using methods available in graphical library. i've done in c# , java. in c# it's called "measurestring", , in java, "fontmetrics". edit: see

winapi - Windows version macros in windows drivers -

_win64 can used find platform 32-bit or 64-bit. are there macros available in drivers (kernel mode code) can used tell version of operating system. xp, 2003, vista or 7? the info need here . check out sdkddkver.h in build environment. useful: ntddi_version .

java - Recursion, Arraylist -

my homework create recursive static method receives arraylist of integers parameter. there elements have value of 0 , want switch 5, elements have value of 1 removed, , elements have value of 2 moved end. rest stays is. i can think of ways without using recursion, how solve problem using recursion? thank you. your base case list of length 1, easy deal with. a list of length 2, know last 1 element has been processed, harder deal with. a list of length n, know last n-1 elements have been processed, should manageable. so, can take list, pass list minus first element down next level of recursion, when processed sub-list back, deal 1 first element. @steven schlansker right, though, not recursion-friendly task.

filter - invoke a Java program in Apache HTTP Server -

is there way invoke java program particular url in apache http server? thanks. the architecture this: browser > apache > weblogic application server. requirement invoke java code in apache before request goes weblogic application server. you want stick java ee filter solution. if, reason, can't , absolutely must @ apache layer, apache offer filters. see here: http://httpd.apache.org/docs/2.2/mod/mod_ext_filter.html

php - error_reporting(E_ALL) problem -

i have put error_reporting(e_all) on top of php page comment gives me following notice rest of page work fine there no problem in page. notice: undefined index: action in /var/www/cafe/view/ingredients.php on line 10 call stack: 0.0007 333108 1. {main}() /var/www/cafe/view/ingredients.php:0 what should remove notice top of page. on instructions page <form method="post" action="instructions.php?action=add&id="> , on top of page action e.g $action=$_get['action']; give me notice – you trying access index action of array, index doesn't exist. example: $some_variable['action'] . try run var_dump($some_variable);die; , you'll see doesn't exist.

jqgrid binding keydown event to cell -

i have grid this jquery("#champdetail").jqgrid({ data: {}, height: 300, width: 800, colnames: ['id', 'combination no', 'qty', 'smt program', 'smt machine', 'product date', 'tracking no'], colmodel: [{ name: 'id', width: 50 }, { name: 'combinationno', width: 120, sortable: false }, { name: 'qty', width: 80, sortable: false, editable: true, editrules: { custom: true, custom_func: qtycheck} }, { name: 'smtprog', width: 120, sortable: false, editable: true }, { name: 'smtmach', width: 120, sortable: false, editable: true }, { name: 'productdate', width: 120, sortable: false, editable: true }, { name: 'trackingno', width: 100, sortable: false, editable: true } ],…………….. oncellselect: function(rowid, colid) { debugger; if (colid == 3) { v

ios4 - loaded the "rootView" nib but didn't get a UITableView.' -

i have developed split view based applicaiton. , trying add image root view controller. for made rootview.xib manually , in mainwindow.xib loaded rootviewcontroller xib. when try building error. any in approach or other approach add image root view controller apprecviated you have change super-class of rootviewcontroller uitableviewcontroller uiviewcontroller .

debugging - How does the VIsual Studio watch window gets the value for a variable? -

lets have variable x of type abc instantiated. when see value of x shows me value x.tostring() method. where else value displayed in value column come from? any appreciated, thanks, dattebayo the text see under value column in watch window come 1 of 3 sources. the object's tostring() method, you've mentioned a debuggerdisplayattribute on type abc, tells debugger how present user. if "abc" class decorated debuggertypeproxy attribute, see either .tostring or debuggerdisplay string proxy type has. to best of knowledge, 3 options.

php getting array levels in the recursion -

i have next tree-array: $arr = array( 'id' => 1431, 'children' => array( 1432 => array( 'id' => 1432, 'children' => array( 1433 => array( 'id' => 1433, 'children' => array(), ), 1434 => array( 'id' => 1434, 'children' => array(), ), ) ), 1435 => array(), 'id' => 1435, 'children' => array( 1436 => array( 'id' => 1436, 'children' => array( 1437 => array( 'id' => 1437, 'children' => array(), ), 1438 => array( 'id' => 1438, 'children' => array(), ), 1439 => array( 'id' => 1439, 'children' => array(), ), ), ), ), ), ); my task generations array array. output should next: array( [1] = array( [1432]

c# - Call a generic method with a generic method -

i annoyed because call generic method generic method.. here code: public list<y> getlist<y>( string atablename, bool awithnochoice) { this.tablename = atablename; this.withnochoice = awithnochoice; datatable dt = returnresults.returndatatable("spp_getspecificparameterslist", this); //extension de la classe datatable list<y> resultlist = (list<y>)dt.tolist<y>(); return resultlist; } so in fact when call tolist extension datatable class (learned here ) the compiler says y not non-abstract type , can't use .tolist<> generic method.. what doing wrong? thanks reading.. change method signature to: public list<y> getlist<y>( string atablename, bool awithnochoice) y: new() the reason need because custom extension-method use imposes new() constraint on generic type argument. needs to, since creates instances of type populat

ios - use instruments - leaks with a device -

i'm starting use instruments-leaks iphone 3g. when try run app instruments on iphone obtain target failed run: remote exception encountered: 'failed task pid 280' ideas? the time succeed in running app instruments run slow, couldn't test it. steps run app on device searching leaks? the solution me make sure profile scheme using "debug" , not "release" build configuration. in xcode 4 select product/edit scheme top menu click on "profile" button on left. on "info" pane see setting build configuration- set "debug"

What is a good jQuery plugin to show a contact form on hover over an image/icon? -

i'm in need of jquery(/ajax) script shows contact form when hover on image,icon or link of kind. tooltip contact form support? thanks in advance! you can jquery ui here example; http://jqueryui.com/demos/dialog/#modal-form when click on 'create user' in example, pop form i hope helps!

tsql - IS IN (Select statement, 'value', 'value') -

i trying run following sql delete t_ath_poshld t_ath_poshld.a_insid in (select t_ath_poshld.a_insid t_ath_poshld left join t_ath_ins on t_ath_poshld.a_insid = t_ath_ins.a_insid t_ath_ins.a_insclscde1 = 'cash' , t_ath_poshld.a_insid not in (select a_insid t_ath_ccy) , a_accid in (select a_accid t_ath_extacc, '1212oeic', '5667033zs')) and in particular, trying check whether accid in set of values, coming table , 2 hardcoded. how achieve this? in (select a_accid t_ath_extacc, '1212oeic', '5667033zs') doesn't work, 'incorrect syntax error'. thanks you need use union add 2 hardcoded values resultset passing in clause. in (select a_accid t_ath_extacc union select '1212oeic' union select '5667033zs')

Load jQuery tabs from Ajax -

i have loading image works using code below. shows animated gif , waits html fetched url. once fetched hides loading div , loads html bite div. html returned contained within jquery tabs when html displayed tabs not rendered , li elements shown. is possible fetch html contains jquery tabs via ajax , render these tabs? if doing wrong? <div id="loader" style="text-align:center; display:none;"> <img src="img/ajax-loader.gif" alt="loading" /> </div> <div id="bite"></div> $(document).ready(function () { $('#loader').show(); $.ajax({ url:'http://www.domain.com/bitesized/main.php?uid=<?php echo $uid; ?>', complete: function(data){ $('#loader').hide(); $('#bite').html(data.responsetext); // these divs ids available after load above , meant render tabs $("#tabs").tabs(); $("#fragment-a").tabs();

ipad - location based process in iphone sdk? -

i want local push notification (giving alert) when user comes in particular locations(in range).is possible it? example , tutorial please? nope. local alerts can scheduled ahead of time, if app isn't running, has no way of checking location. makes sense because gps hard on battery, among other reasons. a quick glance @ reference docs uilocalnotification confirms this http://developer.apple.com/library/ios/#documentation/iphone/reference/uilocalnotification_class/reference/reference.html edit: actually! http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/backgroundexecution/backgroundexecution.html (scroll down "tracking user’s location") there bunch of location-based background stuff can do. don't think can schedule alert based on location, might able receive location notification , fire alert if you're in right area.

asp.net mvc - MVC Logic, Views and Helpers - A Specific Story -

me , colleague discussing how generate link on page. should use html helpers or keep simple view logic in view? for project using castle monorail , nvelocity view engine. grateful considers both options below , gives opinions. in story, link used on single page. option 1 - helper helper code var action = snail.isactive ? "confirmdeactivate" : "confirmactivate"; var routevalues = new dictionary<string, string> { {"action", action}, {"querystring", "id=" + snail.id} }; var href = urlhelper.for(routevalues); var link = new xelement("a"); link.setattributevalue("href", href); link.setvalue(action.substring(7)); return link.tostring(); and in view, call helper so: <li>$html.snailactivationswitchlink($item)</li> option 2 - in view #if($snail.isactive) <a href="$url

url rewriting - Converting mod_rewrite rules in .htaccess to httpd.conf -

i have set of html files at: www.example.com , "main site" (in beta) at: www.example.com/abcd/ (for these mod_rewrite rules needed) the mod_rewrite rules run fine in directory within .htaccess. need put them in httpd.conf: the rules in .htaccess: rewriteengine on rewritebase /abcd/ rewriterule ^.*/codelibrary/(.*)$ codelibrary/$1 [l] rewriterule ^.*/in_upload/images/(.*)$ in_upload/images/$1 [l] ... copying below httpd.conf file didnt work: <virtualhost *:80> serveralias www.example.com serveradmin nobody@example.com documentroot /var/www/html serversignature on <ifmodule mod_rewrite.c> rewriteengine on rewritebase /abcd/ ... it gave error: rewritebase: valid in per-directory config files do need modify rules this? rewriterule ^.*/abcd/codelibrary/(.*)$ abcd/codelibrary/$1 [l] rewriterule ^.*/abcd/in_upload/images/(.*)$ abcd/in_upload/images/$1 [l] edit1 i tried convert following lines from: ... rewriterule (.*)

tex - Open Source WYSIWYG Math Editor -

i'm looking open source library / program, wysiwyg math equation editor. i.e. can make changes formula & see looks in real time. the output not have visually equivalent tex, needs decent -- , real time. the closest i've found far texmacs, it's source code base quite huge , (imho) hard read. know of similar, smaller code base ( < 10k loc)? thanks! mathjax open source javascript display engine mathematics works in modern browsers. http://www.mathjax.org/

VS 2010. Post-build. Copy files in to multiple directories/multiple output path -

i have mvc project , want split output. i want copy dll files of project (all content directory bin) 1 directory, , views (content of directory view) output directory. settings of project in vs 2010 not allow me simply. i may specify 1 output path in settings , can't specify directories or file types copy , where. i think should leave output directory default , need split output way want using post-build command. maybe did similar , have ideas how best? the solution is 1) set output path directory want copy *dll files in project properties 2) using post-build event copy content of directory view whatever directory want in case 1) output path set to ..\mydestinationprojectname\bin\ 2) post-build event copy view directory looks this xcopy "$(projectdir)\views" "$(solutiondir)\mydestinationprojectname\plugins\views\$(projectname)\" /s /i /y

java - EHCache implementation with Spring DAO -

i trying implement ehcache spring dao . have requirement need show same output when coming form 2nd jsp page 1st jsp page , ideally if put data retrived earlier database cache can retrieve in stead of making database connection once again , bring data . below list of jar files version using ehcache spring.jar ehcache-core-2.2.0.jar slf4j-api-1.6.0.jar slf4j-log4j12-1.6.1.jar slf4j-jdk14-1.5.11.jar but while building application ant script getting "nosuchmethoderror" . method in jar file . , when putting proper jar file throwing error class missing . can suggest exact version , list of jar files ehcache ? using jdk 1.6 . thanks satyajit i don't know if problem (and details on missing method help), odd have 2 slf4j implementation jars (log4j and jdk14). seem mixing 1.5 , 1.6 level slf4j jars isn't idea.

Django built-in login view and errors -

i'm using django.contrib.auth.views.login and .logout views. handy, worked out of box, deploy again aaa+ etc. the problem arises since i'm not using separate login page, rather have login box in every page (unless user logged in, of course). , so, when username/password combination wrong, error. of these 3 paths should choose? there secret way redirect next not on success on error. if so, please tell me! i write own login view, putting use django's message system in meanwhile i write login page (well, it's missing template) can exploit full awesomeness of django auth system. one of possible solutions (first + third choices in list): you have provide special login page (that define registration/login.html ) , non loged in user each normal page has login form; if user logins (this logic handled in django.contrib.auth.views.login ): for normal page: redirect user page loged in; for login page: if there next param, redirect there, else redirec

relationship between size of project and need to use PHP framework -

what size of php project people think "i need framework this"... take code: <?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = 'password'; $dbname = 'test'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die("cannot connect mysql server"); mysql_select_db($dbname) or die("cannot select database"); $delete_item_id = mysql_real_escape_string($_post['id']); $result = mysql_query("delete `timesheet` id ='".$delete_item_id."'") or die(mysql_error()); ?> this take 5 minutes write hand in notepad++, surely framwork overkill script! or people use frameworks...always use frameworks? i stand in different place people on issue. the size of project irrelevant. size of team , future teams important. a framework, regardless of you've been told, slow down development if quality programmer. gain framework way more important that. firstly,

javascript - use jQuery to find an event object -

jquery has wonderful selectors dom elements, can 'select' event object. that is, if use inline javascript on 'onclick' attribute of element, have selector find event object can act on it. i know this: $("a#some_link").click(function(event){//act on event here}); but how find event object if inline javascript used: <a href="somepage.html" onclick="alert('how event oject?');">click me</a> this question supplement earlier question: calling e.stopimmediatepropagation() onclick attribute onclick = "alert(event.type);return false;" <a id="some_link" href="somepage.html" onclick="alert(event.type);return false;">click me</a> test it

c# - Generic view in razor -

good morrow, i learning razor, , found myself stuck in problem. although know how use inheritance cshtml file actual class, " @inherits basiclistview<usermodel> ", wanted have comodities of cshtml template engine, make base view, generic listing view, per instance. i believe 1 might not able directly, cshtml cshtml, mark inheritance, quite ok, become class anyway. as well, generate class myself , use it's object, may wrong, sounds little workaround me. would care of having elegant solution it? edit: redo question: keeping in mind there strongly-typed view, per example list page, can think on how implement generic-typed view, same porpouse? well, you're view either need work off common interface e.g. @inherits basiclistview<imymodel> or use dynamic: @inherits basiclistview<dynamic>

How to access salesforce api through 3rd party application? -

hi working on cloud based application, assigned work implement salesforce api in application. done authentication process , able push leads in api. problem can authorize developer account thru it, account have taken consumer key , secret. can ny1 please me finding solution, how authorize other salesforce account holders thru app. urgent. thanks you need create package remote access settings (aka key & secret) , install other org(s).

memory - jconsole equivalent for .Net? -

i'm looking dll link to, give .net app profiling abilities equivalent jconsole. specifically, imagine this: you add dll project you call init method this exposes set of endpoints (web, tcp, named pipes, whatever). this doesn't hamper performance of application, can run in production. when in trouble, connect endpoints, , profile. can see gc roots, what's taking memory (retained sets), trigger gc, ... is there this? op: there isn't. simon: jconsole side argument difference between java , .net. java readily presents user information .net obfuscates. perhaps because of differing ideologies , goals, java designed common virtual environment operates on host os .net principally designed windows in mind. .net processes aren't designed run in ambiguous vacuum; run component services or parts of iis, , run on windows, virtual environment makes no provisions provide remote monitoring because you'll degree of free wmi. java doesn't work

How to clear all memcache in app engine. Java environment -

i need clear make data become clean, there api can use? there clearall method on memcacheservice object.

Visual Studio 2010 and Moss 2007 issues -

here scenario: dev environment windows 2003 virtual server, moss2007, vs 2008, sql2005, .net framework 3.5, ajax 2.0. we're in process of upgrading user workstations win 7. decided install vs 2010 alongside vs2008. when tried open existing vs2008 project has custom web parts moss, went through upgrade wizard @ end failed did not note error was. instead, decided recreate project when adding new sharepoint webpart solution received error stating sharepoint must forst installed on server. lah-di-dah, installed!!! what? ended uninstalling vs2010, not point. vs2010 requires sharepoint 2010 work, really? can elaborate on this. thanks. eric you tried open sharepoint solution on new windows 7 workstation? doubt you've got sharepoint installed on workstation, error message might correct when it's saying sharepoint isn't installed. but, can use vs2010 sharepoint 2007 development, written here: http://social.msdn.microsoft.com/forums/en/sharepointdevelopment

Firebug showing "Debugger is already active" error message after update 1.6.0? -

after last firebug update 1.6.0 keep getting error message when debugging (under "script" tab): debugger active the debugger halted @ breakpoint on page. go page okay, "go page" doesn't bring me anywhere , can't seem debug anything. have single instance of firefox running, restarting doesn't issue ... uninstalling add-on , reinstalling doesn't anything. there anyway remove breakpoints command line, what's going on here? edit: going 1.5.x solves problems, going 1.7.x alpha reproduces problem, i'd file bug report, if i'm 1 experiencing it, isn't of bug. we believe problem fixed firebug 1.6.1; 1.6.1b1 available @ http://getfirebug.com/releases/firebug i'd hear more bug reports on particular problem. extension conflict, need folks post result of url "about:support" can compare lists or need try installing firebug in new firefox profile adding extensions until find problem. (i doubt jquery i

css - Use of IMG within a UL LI navigation menu list -

i have menu list, used in website navigation, of menu items contain both text , image right of text: <ul> <li>nav item 1</li> <li>nav item 2 <img src="image.gif" /></li> </ul> i'd menu items containing image text[space]image in correct horizontal alignment. can showing me css achieve this? ul li img { padding-left: 20px; }

Dynamically Dimensioning A VBA Array? -

why unable set size of array based on variable? what's best way around this? dim numberofzombies integer numberofzombies = 20000 dim zombies(numberofzombies) new zombie you can use dynamic array when don't know number of values contain until run-time: dim zombies() integer redim zombies(numberofzombies) or 1 statement if you're creating array that's local procedure: redim zombies(numberofzombies) integer fixed-size arrays require number of elements contained known @ compile-time. why can't use variable set size of array—by definition, values of variable variable , known @ run-time. you use constant if knew value of variable not going change: const numberofzombies = 2000 but there's no way cast between constants , variables. have distinctly different meanings.

jquery - $.ajax using JsonResult - Returns "toJSON - function (key) { return this.valueOf(); }" -

here have: controller [httppost] public actionresult getnumbers(int id) { list<int> privids = new list<int>(); //my numbers! privids.add(2); privids.add(3); return json(privids); } javascript var id = 1; url = "/home/getnumbers/"; var getdata = { 'id': id }; $.ajax({ type: "post", url: url, data: getdata, datatype: "json", success: function (result) { $.each(result, function () { $.each(this, function (index, data) { alert(index + " - " + data); }); }); }, error: function (request, status, error) { alert("fail"); } }); the result two alert boxes both containing: tojson - function (key) { return this.valueof(); } the question where numbers? (2 & 3 in example.

asp.net - Passing AppSettings to external javascript file the MVC way? -

i have settings in appsettings (web.config) , need pass them external javascript file. in asp.net think of ashx handler write javascript file response replacing placeholders settings values. is there better way in asp.net mvc? thank you. you send them via jsonresult ? in js, you'd have request sends get / post request particular action (let's call getappsetting() , , corresponding value returned in response. for security reasons, restrict can requested though... public jsonresult getappsetting(string id) { //you check what's been requested here if want make sure you're returning information may not wish send. string appsetting = appsettings[id]; if(string.isnullorempty(appsetting) == false) { return json(appsetting, jsonrequestbehavior.allowget); } //handle non-existent settings here... throw new exception("this setting not exist"); } alternatively, has been suggested chris marisic in comments may want absolutely l

eclipse - Working on sqlite 3 and Android -

possible duplicate: sqlite example program in android i've created sqlite3 database , number of tables using sqlitemanager 3.5.1. however, i've no idea how should able connect, access , use database. moreover, want able modify tables , data in tables. possible put database (with .sqlite extension) within assets directory , work , forth android sqlitemanager? yes, it's possible. here it's explained: using sqlite android app take @ copying assets database path section.

c++ - X-platform reentrant wcstok()? -

right i'm looking reentrant version of wcstok() known gcc , other compilers (if there's any). so far use wcstok_s() 1 msvc , need compile code on other platforms well. while pages suggest wcstok_r() couldn't find in gcc headers. other (man)pages mention strtok_s() without specific wide char version mention it's said used for multibyte strings only(?). so, i'm open suggestions. writing own wrapper/version last way out solution only. edit aschepler: sample code doesn't compile due too many arguments - should compile despite being pointless: #include <cwchar> // includes wchar.h int main(void) { wchar_t *a, *b, *c; wcstok(a, b, &c); return 0; } the function wcstok specified c89 (and therefore c++) reentrant , has same signature , same behavior microsoft's wcstok_s . wcstok should declared in <wchar.h> and/or <cwchar> . wchar_t* wcstok(wchar_t* s, const wchar_t* delim, wchar_t** ptr); but looks

Testing embedded spaces in c -

i want create function in c programming, test embedded spaces in c. if found embedded spaces in string return 1 else 0 examples: 'sjdfnsdj' >>>>> return 0 'sdsd sdsdf' >>>>> return 1 ' ssadsa' >>> return 0 'dfjksdnf sdfsdfdf' >>>> return 1 ' sadf asdad' >>>> return 1 embedded spaces means spaces between 2 strings or after string not before string you use strchr scan string space character after you skipped leading spaces. assuming char buf[] holds string test int i=0; while ( buf[i] == ' ' && buf[i] != '\0' ) i++; return strchr( &buf[i], ' ' ) != null; edit: post has been retagged homework. instead of using strchr can loop 1 skip leading spaces. find out whether there further spaces after first non space char.

php - Tagging friends in status updates from Facebook API -

i came across this blog post said it's possible tag in status update facebook app (= api): however, doesn't seem work me. it tried in 3 different ways: $post = $facebook->api('/me/feed', 'post', array( 'access_token' => $session['access_token'], 'message' => 'hello @[562372646:lionel cordier], how you?' )); or $access_token = $session['access_token']; $message = 'hello @[562372646:lionel cordier], how you?'; $curl_post = 'access_token='.$access_token.'&message='.$message; $ch = curl_init(); curl_setopt($ch, curlopt_url, 'https://graph.facebook.com/me/feed'); curl_setopt($ch, curlopt_header, 1); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_post, 1); curl_setopt($ch, curlopt_postfields, $curl_post); $data = curl_exec($ch); curl_close($ch); or $access_token = $session['access_token']; $message = 'hello @[562372646:lion

autoload - How to load variables only when needed in PHP -

i have class multiple public properties objects being used in different parts of system. problem need load of public properties in each place i'm using objects of class, because loading entire list of properties every time take forever. is there way can use __autoload or similar function call functions load different variables @ time called? e.g. class bread { public $ingredients, $price, $color; public function magicloading($var) { switch($var) { case "ingredients" : return loadingredients(); case "price" : return loadprice(); case "color" : return loadcolor(); default : break; } } public function loadingredients() { $this->ingredients = ... } } foreach($bread->ingredients $ingredient) { //do stuff here } in code, rename function magicloading __get , add return statement in ' load... ' methods check variables have not been ini

Draw Pixels in a square from inside out - Java -

Image
i want draw square of pixels pending on how many items in array. square represents array amount small squares represent small arrays , large squares represent large arrays. finding difficult conceptualize how go this? edit: using java 2d. the spiral starts @ 1 , advances anti-clockwise towards outside of square (i.e. 2,3,4,5 etc). each square can represented amount of data square represents. public class test { enum direction { right, up, left, down } public static void main(string... args) throws ioexception { bufferedimage image = new bufferedimage(100, 100, bufferedimage.type_int_argb); int rgb = color.black.getrgb(); point p = new point(50, 50); direction d = direction.right; int currentsegmentlength = 1; (int = 0; < 100; += 2) { paintsegment(image, rgb, p, d, currentsegmentlength); d = nextsegmentdirection(d); paintsegment

c# - Why is my Button event is not occuring? -

i having issue button event not occuring basically have cart items listed in listbox. when delete button clicked item deleted list box. i tried debugging, seems not call method when button clicked. in ticketscreen.xaml file specify button in template: <datatemplate x:key="tickettemplate"> <stackpanel orientation="horizontal" horizontalalignment="left" height="50"> ... <button name="remove" width="35" height="35" fontfamily="resources/#charlemagnestd-regular.otf" fontsize="24" click="removecartitem" grid.column="5" mousemove="remove_mousemove">x</button> ... </stackpanel> </datatemplate> my list box following: <listbox name="ticketitems" itemssource="{binding}" itemtemplate="{staticresource tickettemplate}"

iphone - Delay reloadData on UITableView -

i have uitableview. on tap of button want display custom view, then, once view visible, remove particular item tableview. custom view hides tableview remove occur after new view visible. currently, have this, adds custom view , should remove item, , reload table, reload occurring animation ends (i have animation block, changing views alpha), can see update. [self.view addsubview:customview]; [itemarray removeobject:object]; [self.tableview reloaddata]; how can delay reload until after view visible? thanks. you mention you're animating view yourself; should call reloaddata when animation completes using like: [uiview setanimationdelegate:self]; [uiview setanimationdidstopselector:@selector(methodthatcallsreloaddata)]; // or [uiview setanimationdelegate:self.tableview]; [uiview setanimationdidstopselector:@selector(reloaddata)]; or if you're using block-based api: [uiview animatewithduration:... completion:^(bool finished) { [self.tableview reload

java - Spring built-in replication support for session-scoped beans? -

i've posted this in spring forums, figured i'd give folks here shot @ adding reputation: for plain old servlet apps operating in clustered environment (session replication/failover), it's practice "re-set" session attributes if they've been modified: userpreferences prefs = (userpreferences)session.getattribute("userpreferences"); prefs.setinstantemail(true); session.setattribute("userpreferences", prefs); this acts flag container session state has changed , replication required. here's reference wls documentation on subject. an app i'm modifying uses spring support pojo+injection style of development , i'm not clear on how above practice translates. per spring docs, scoped beans dependencies , app uses <aop:scoped-proxy/> inject session-scoped dependency. however, without direct access session, how changes dependency flagged container replication can occur? there built either proxy or web context support it

html - Image Alignment with Galleria.js in Opera Browser -

i trust can issue. have problem users visiting site (www.amigaos.net) using popular opera browser; if test in ie great, mac user avoid inferior browsers. i using galleria v 1.1.95 , have opera beta 11 installed, understand layout problem (from user feedback) happens in previous versions well. so if visit www.amigaos.net using opera , click games top menu, galleria.js loads gallery , straightaway should notice main gallery image left-aligned in stage incorrect behaviour. both safari , firefox centre image. i don't know should looking in galleria.classic.css, html or .js - how opera correctly position image in centre of stage? advice please. thanks in advance. the problem see (image not appearing @ all) caused galleria.js setting height:0. fails read height of stage ( <div class="galleria-stage"> ) in opera - offsetheight of element returns 0 after giving parent explicit height. (this turns out known bug in opera positioned child top , bottom s