Posts

Showing posts from August, 2013

data structures - Spatial Index/R Tree Support in Perl -

anyone got hints working rtree in perl? either pure rtree implementation performant or hijack gis project? or easier use sqlite's spatial index support? cheers did try tree::r ? there doesn't seem activity on module, may not enough, again, might you're looking for. play few.

f# - using Array.Parallel.map for decreasing running time -

hello everyone i have converted project in c# f# paints mandelbrot set. unfortunately take around 1 minute render full screen try find ways speed up. it 1 call take of time: array.map (fun x -> this.colorarray.[calcz x]) xyarray xyarray (double * double) [] => (array of tuple of double) colorarray array of int32 length = 255 calcz defined as: let calcz (coord:double * double) = let maxiterations = 255 let rec calczhelper (xcoord:double) (ycoord:double) // line break inserted (x:double) (y:double) iters = let newx = x * x + xcoord - y * y let newy = 2.0 * x * y + ycoord match newx, newy, iters | _ when math.abs newx > 2.0 -> iters | _ when math.abs newy > 2.0 -> iters | _ when iters = maxiterations -> iters | _ -> calczhelper xcoord ycoord newx newy (iters + 1) calczhelper (fst coord) (snd coord) (fst coord) (snd coord) 0 as use around half of processor capa...

c++ - Help me understand this usage of boost::bind -

please have @ example posted johannes schaub sort vector of pairs: how sort vector of pairs based on second element of pair? std::sort(a.begin(), a.end(), boost::bind(&std::pair<int, int>::second, _1) < boost::bind(&std::pair<int, int>::second, _2)); i thought understand boost::bind, have trouble one. question 1: the sort algorithm expecting predicate function third parameter. see here, boolean expression. missing?: boost::bind(&std::pair<int, int>::second, _1) < boost::bind(&std::pair<int, int>::second, _2) does boost::bind library overload operator< 2 binds, , returning kind of function pointer (like lambda)? question 2: gets me confused: boost::bind(&std::pair<int, int>::second, _1) usually there kind of function pointer first parameter of bind call, here address of class member? result of particular bind? thanks time & help boost::bind overloads operator ! , relat...

visual c++ - Is this a BUG of VC++ 2010? About declaring a constant object in a header -

several lines of code worth thousand words: i have 3 simple files: header.h, main.cpp, other.cpp ==== code begin ==== // header.h #pragma once const void* p = 0; // main.cpp #include "header.h" int main() { return 0; } // other.cpp #include "header.h" ==== code end ==== when compiling simplest project, vc++ 2010 complains follows: clcompile: other.cpp main.cpp generating code... other.obj : error lnk2005: "void const * const p" (?p@@3pbxb) defined in main.obj d:\test\debug\bug.exe : fatal error lnk1169: 1 or more multiply defined symbols found build failed. time elapsed 00:00:00.29 ========== build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== i sure bug of vc++ 2010, because of following 2 references: the c++ standard says: (at page 140 of n3126) "objects declared const , not explicitly declared extern have internal linkage." the msdn says : "in c, constant values de...

html - What is wrong with this frameset code? -

i using webmin on server. reason it's decided stop displaying on root page, it's blank. it's still returning code, shown below. individual pages in frames work frameset doesn't want display, in browser, reason. i have stripped right down this, running on local server still doesn't show anything: <!doctype html public "-//w3c//dtd html 3.2 final//en"> <html> <head> <title>title</title> </head> <body> <frameset cols="230,*"> <frame name="left" src="test1.html" scrolling="auto"> <frame name="right" src="test2.html" noresize> </frameset> </body> </html> i've tried removing , changing various attributes no luck. the <frameset> element replaces <body> element. can't use both in same document. you should write: <!doctype html public "-//w3c//dtd html 3.2 final//en...

jQuery ajax - blank response returned -

i trying use jquery ajax values database , return them in array. i have used same code several times before time, no response being returned. although post values correct values expect. here javascript code using: $.ajax({ url: '/blogarchive.asmx/changepost' , type: 'post' , contenttype: 'application/json; charset=utf-8' , data: '{filename:"' + filename + '"}' , datatype: 'json' , success: function (data) { var arraylist = data.d; var blogposttitle = $(".blogposttitle")[0]; var blogpostdate = $(".blogpostdate")[0]; var blogpostcontent = $(".blogpostcontent")[0]; $(blogposttitle).html(arraylist[0]); $(blogpostdate).html(arraylist[...

php - SMTP error with PHPMailer -

i getting "smtp error: not connect smtp host." error while trying send mails using gmail smtp , phpmailer.. the code working in local environment getting error in live (bluehost) server.. please help bluehost wont allow gmail smtp connections . quoting article: according bluehost, cannot send emails through smtp connections web applications hosted on bluehost. allow sending through own smtp servers. the work around setup email account in bluehost same email use in google apps. modified code in magento send out using bluehost’s smtp servers: for example: outgoing mail server: (ssl) boxnumber.bluehost.com (server requires authentication) supported incoming mail protocols: * pop3: port 110 * pop3s (ssl/tls): port 995 * imap: port 143 * imaps (ssl/tls): port 993 supported outgoing mail protocols: * smtp: port 26 * smtps (ssl/tls): port 465 and works, sends email out customers right email address sent bluehost’s local smtp servers, when customer...

Customizing the SharePoint 2010 Blog Template -

i want apply branding sharepoint 2010 blog site sub site of our internet. i'm trying achieve creating custom blog site template based on original blog site template. followed following blog post. http://www.sharepointbits.com/blog/sharepoint-2010-custom-site-templates.html and got copy of blog template files "c:...\14\template\sitetemplates\blog", modified files , put in "sitetemplates\" folder. i can see new site template has been created every time when create web site based on custom template uses original blog template files provisioning (for ex: default.aspx). is correct way achieve this? please let me know if i'm doing sth wrong here. thanks in advance. -madhawa have created custom webtemp file in 14\template\1033\xml has custom template name setuppath points copied folder in sitetemplates? also, blog site definition tricky. custom lists built right onet.xml file. wonder if creating custom copy of blog template work copying o...

wpf - 'View cannot be shared by more than one ListView' System.Windows..ListView -

i'm trying set view listview dynamically: exception ' view cannot shared more 1 listview ' although i'm using once. anyways if make instance already, , datatrigger triggers, exception takes place too. this wpf code: <listview itemssource="{binding collection}" selectionmode="extended" alternationcount="2" > <listview.style> <style> <setter property="listview.view" value="{staticresource myview1}" /> <style.triggers> <datatrigger binding="{binding path=mypath1}" value="true"> <setter property="listview.view" value="{staticresource myview2}" /> </datatrigger> <datatrigger binding="{binding path=mypath2}" value="true"> <setter property="listview.view...

c# - Draw an image out of a control -

i have control. it's text box. want draw image @ left of control. image should painted outside control. paint 1 inside. here code: private static image requiredicon = resources.icon_required; protected override void onpaint(painteventargs e) { base.onpaint(e); if (base.enabled && string.isnullorempty(base.text)) { e.graphics.drawimage(requiredicon, 0, 0); } } instead of drawing image, create appropriate control, e.g. picturebox , it's image property set appropriate image resource. it may easier @ design time rather run time. if image should not shown intitially, set it's visible property false @ design time , set true @ run time when image should shown.

multithreading - stop a thread in java after a given time - doesn't work -

i have complex function (optimisation) can potentially enter in loop or take time, , time allowed set user. therefore trying make run function in separate thread, , stop if maximum time passed. use code similar 1 below, doesn't work, int timemax = 2; //time in minutes thread thread_object = new thread_class(... args...); try { thread_object.start(); thread_object.join(timemax*60*1000); } i think i'm not using function "join" properly, or doesn't have understood. idea? thanks! thanks answers, have found better idea here*. works still uses function "stop" deprecated. new code is: thread thread_object = new thread_class(... args...); try { int timemax = 1; thread_object.start(); thread.currentthread().sleep( timemax * 1000 ); if ( thread_object.isalive() ) { thread_object.stop(); thread_object.join(); } } catch (interruptedexception e) { } not yet sure of function of "join", i'll have...

PHP passing $_GET in linux command prompt -

say access via http://localhost/index.php?a=1&b=2&c=3 how execute same in linux command prompt? php -e index.php but passing $_get variables? maybe php -e index.php --a 1 --b 2 --c 3? doubt that'll work. thank you! typically, passing arguments command line script, use either argv global variable or getopt : // bash command: // php -e myscript.php hello echo $argv[1]; // prints hello // bash command: // php -e myscript.php -f=world $opts = getopt('f:'); echo $opts['f']; // prints world $_get refers http method parameters, unavailable in command line, since require web server populate. if want populate $_get anyway, can this: // bash command: // export query_string="var=value&arg=value" ; php -e myscript.php parse_str($_server['query_string'], $_get); print_r($_get); /* outputs: array( [var] => value [arg] => value ) */ you can execute given script, populate $_get c...

GWT request to download file -

i know it's not possible send ajax request or use gwt's requestbuidler send request file download; needing form how reference response when returns lets error. the request send file download if file download big java servlet responds error, how reference error handle appropriately on gwt side. you can add formpanel.submitcompletehandler form , parse results in onsubmitcomplete().

python - Problems with variable referenced before assignment when using os.path.walk -

ok. have background in matlab , i'm switching python. have bit of code under pythnon 2.6.5 on 64-bit linux scrolls through directories, finds files named 'generaldata.dat', retrieves data them , stitches them new data set: import pylab p import os, re import linecache ln def loadgenomemeansize(arg, dirname, files): file in files: filepath = os.path.join(dirname, file) if filepath == os.path.join(dirname,'generaldata.dat'): data = p.genfromtxt(filepath) if data[-1,4] != 0.0: # checking if data set ok data_chopped = data[1000:-1,:] # removing of data grand_mean = data_chopped[:,2].mean() grand_std = p.sqrt((sum(data_chopped[:,4]*data_chopped[:,3]**2) + sum((data_chopped[:,2]-grand_mean)**2))/sum(data_chopped[:,4])) else: break if filepath == os.path.join(dirname,'modelparams.dat'): ...

c++ - print time on each call to std::cout -

how that? example like: std::cout << "something"; then should print time before "something" you use simple function prints timestamp , returns stream further printing: std::ostream& tcout() { // todo: timestamp in desired format return std::cout << timestamp << ": "; } you call function instead of using std::cout directly, whenever want timestamp inserted: tcout() << "hello" << std::endl;

How do I use a relative path in a Python module when the CWD has changed? -

i have python module uses resources in subdirectory of module directory. after searching around on stack overflow , finding related answers, managed direct module resources using import os os.path.join(os.path.dirname(__file__), 'fonts/myfont.ttf') this works fine when call module elsewhere, breaks when call module after changing current working directory. problem contents of __file__ relative path, doesn't take account fact changed directory: >>> mymodule.__file__ 'mymodule/__init__.pyc' >>> os.chdir('..') >>> mymodule.__file__ 'mymodule/__init__.pyc' how can encode absolute path in __file__ , or barring that, how can access resources in module no matter current working directory is? thanks! store absolute path module directory @ beginning of module: package_directory = os.path.dirname(os.path.abspath(__file__)) afterwards, load resources based on package_directory : font_file = os.path.join(...

php - Changing Product Options Layout in Magento -

how change layout of product options box? have created configurable product color options. i notice magento demo store doesn’t display product options consistently. my options box appears spanning entire column 1 character choice. i options display @ least product: http://demo.magentocommerce.com/zolof-the-rock-and-roll-destroyer-lol-cat-t-shirt-1.html any can provide appreciated. thank you. @joseph's answer cosmetic styling, if need edit markup, you'll need template files in app\design\frontend\base\default\template\bundle\catalog\product\view\type\bundle\option\ , depending on configuration, edit checkbox.phtml , radio.phtml , select.phtml , etc. don't forget copy files local theme path upgrade-safe edits. cheers, jonathan

android - Is there a "proper" way to keep a content provider implementation seperate from it's users? -

i have custom contentprovider class, developed in same project file application using it. since application intended 1 of many users of contentprovider , want split in different project. code being developed on android pdk, future clients might developed on sdk (on custom sdk, or sdk plugin, etc). the problem i'm facing, constants in contentprovider class, e.g. content_uri, column names , constants used interpret values returned queries. these of course cannot accessed project. seems me have 3 options @ point: 1) ignore problem, , type in values directly in user application code. makes accessing contentprovider uglier. have change columns, encode columns strings instead of integers, keep code maintainable. 2) put constants in separate class, , include full copy in applications using contentprovider . i'm not fan of duplicating code though. keeping duplicate of code in each target app, make things more annoying maintain. 3) abuse fact i'm developing on pdk, , ...

query blogger posts with PHP, using search API -

i'm using blogger api (google) try , search strings (i.e.'john doe friend' - , return blog id/url/etc) on public blogs. have found until returns data own account, not public accounts. here's have now, doesn't output have no blogs set myself. i've tried adding parameters , such narrow down search, feel $query need change bit. <?php $user = 'xxxxxx'; $pass = 'xxxxxx'; require_once 'zend/loader.php'; zend_loader::loadclass('zend_gdata'); zend_loader::loadclass('zend_gdata_query'); zend_loader::loadclass('zend_gdata_clientlogin'); zend_loader::loadclass('zend_gdata_feed'); $client = zend_gdata_clientlogin::gethttpclient($user, $pass, 'blogger', null, zend_gdata_clientlogin::default_source, null, null, zend_gdata_clientlogin::clientlogin_uri, 'google'); $gdclient = new zend_gdata($client); function printallblogs(){ $query = new zend_gdata_query('http://www.blogger.com...

c# - How to Implement IComparable interface? -

i populating array instances of class: bankaccount[] a; . . . = new bankaccount[] { new bankaccount("george smith", 500m), new bankaccount("sid zimmerman", 300m) }; once populate array, sort balance amounts. in order that, able check whether each element sortable using icomparable . need using interfaces. far have following code: public interface icomparable { decimal compareto(bankaccount obj); } but i'm not sure if right solution. advice? you should not define icomparable yourself. defined. rather, need implement icomparable on bankaccount class. where defined class bankaccount , make sure implements icomparable interface then write bankaccout.compareto compare balance amounts of 2 objects. edit public class bankaccount : icomparable<bankaccount> { [...] public int compareto(bankaccount that) { if (this.balance > that.balance) return -1; if (this.balance == that.balance)...

c# - Zebra TLP2844 Windows 7 USB escape issue -

i on windows 7 32bit running latest drivers zebra , printing via usb tlp2844. trying generate set of labels , print them label printer c# using rawprinterhelper class mentioned in numerous posts online. if power printer , use om command disable initial esc sequence feed works , prints 2 labels correctly. thereafter height appears incorrect because instead of printing 2 labels prints 1 label second piece of text towards bottom of label. appreciated. label dimensions: width: 75mm height: 34mm gap: 3mm example command sequence being sent printer: om n q599 q272,024 zt s2 a253,26,0,3,1,1,n,"test label text" p1 n q599 q272,024 zt s2 a253,26,0,3,1,1,n,"test label2 text" p1 as disabling detection of top of label culprit q272,024 not large enough. have not posted info not sure why using om command example not seem necessary. try omitting q , om device should smart enough able feed correctly on it's own. (make sure have don...

python - Connecting and Saving Data With Redis Inside Celery Task -

i have object saves data redis. needs block less possible, i've decided use celery offload task. when try .save() object outside of celery, connects redis , stores data fine. however, when try exact same thing celery task, looks runs, there no connection redis, no exception, no error output , nothing gets saves redis server. replicated problem small bit of code below. test.py: from celery.decorators import task import redis class a(object): def __init__(self): print "init" def save(self): self.r = self.connect() self.r.set('foo', 'bar') print "saved" def connect(self): return redis.redis(host="localhost", port=6379) = a() @task def something(a): a.save() here python console output: >>> test import * init >>> <test.a object @ 0x1010e3c10> >>> result = something.delay(a) >>> result.ready() true >>> result.successful() ...

reporting - DataDynamics Active Reports entering extra spaces in long email addresses -

i'm using data dynamics active reports generate reports on our website. action: user runs report on user accounts (this contains email field) , exports excel file. issue: if email relatively long, white space added in field. has else had problem? if so, did fix it? here, found solution hide blank sub report space: add group header , footer check condition make group header or footer visible false/true

Tail/forward recursion in Java -

i dont understand why forward recursion: int count(int x) { if(x<=0) return 0; return 1 + count(x - 1); } it's question on practice exam, , answer forward recursion. why case? how distinguish between two? you're doing addition after calling yourself. tail recursion means absolutely nothing can after if understand implementation, it's clear why. say call count first time main , @ program counter 0xaaa . of method. we'll recursive call count @ 0xbbb stack frame. if you're using tail recursion, when calling itself, can set return address 0xaaa (just go straight code called me). if it's doing anything after, must set return address 0xbbc (the address of addition). because doesn't need stack frames store return addresses, it's easier transform recursion iteration. when count calls itself, can jump beginning of method. the solution (to trivial example) build result in parameter: int count(int x, int res) { ...

UNIX email with multiple attachments and encryption -

is there way (preferably simple, concise way) send email command line in unix multiple encrypted attachments? this in workplace environment, hesitant install anything. the command-line tool openssl installed on unix-like servers. of cryptographic swiss-army knife; openssl smime utility allows create s/mime standard encrypted and/or signed mail.

swing - 2D Java Game. Moving sprite above tiled images -

-> short introduction, can skip part i'm glad able post on platform, because myself have gained knowledge through community; reading. wanted "hello everybody, , thank you! actual content(prologue): though i'm developing in objective-c in company, utterly interested in java development. quite comfortable syntax have major troubles awt/swing/graphics2d. the concept: java application 800*600 frame. on frame can see 16*12 tiles (i.e. gras.jpg or tree.jpg) size of 50px². above frame .png "player" moving. field generated 2 dimensional int array[16][12] 0 symbolizes "gras" , 1 means "tree". -> "working". first try: adding (frame.add(...)) 16*12 jlabels imageicon "gras" or "tree" jlayeredpane adding (frame.add(...)) class "entitylayer" wich updated @ 5ms paint(graphics g) { g.drawimage(imageicon.getimage()); } this version "works" if add either field tiles or entity layer....

MySQL: how to get an actual TimeStamp? literally the amount of seconds since 1970-01-01 UTC -

a mysql timestamp field written , read 'yyyy-mm-dd hh:mm:ss', how can actual amount of seconds since 1970-01-01 utc? use unix_timestamp . if called no argument, returns unix timestamp (seconds since '1970-01-01 00:00:00' utc) unsigned integer. if unix_timestamp() called date argument, returns value of argument seconds since '1970-01-01 00:00:00' utc. date may date string, datetime string, timestamp, or number in format yymmdd or yyyymmdd.

javascript - PHP - Sending gzip compressed JS/CSS -

i created style.css.php file code: <?php $gzip = (ob_get_length() === false && !ini_get("zlib.output_compression") && ini_get("output_handler") != "ob_gzhandler" && extension_loaded("zlib") && substr_count($_server['http_accept_encoding'], 'gzip') && !headers_sent()); if(!$gzip) header('location: style.css'); header('content-type: text/css'); header('cache-control: no-cache'); header('expires: mon, 1 jan 1901 04:20:00 gmt'); ob_start('ob_gzhandler'); include "style.css"; ?> what think? way compress js/css files? there better way this? i'm doing public app. can downloaded anyone. there people on shared hosts gzip disabled no, not ok. there's lot of things wrong there. include, no dying after redirecting, not considering deflate method, ... this simple php, zlib output handler automatically de...

sql server - SQL select dynamic number of records -

this weird problem describe, please bare me. using sql server 2005, trying select number of records (dynamic) 1 table, based on table number of records needs be. table 1 has category id , number of records want returned category. category id top_limit ---------------------- cat 1 1 cat 2 2 cat 3 10 table 2 has product id, category id, , quantity: product id category id quantity --------------------------------- part 1 cat 1 10 part 2 cat 1 20 part 3 cat 2 100 part 4 cat 2 100 part 5 cat 2 50 part 6 cat 3 5 how can write query me correct "top" product records table 2 (part 2, part 3 & 4, part 6)? try this: ;with cte ( select productid, categoryid, quantity, [row] = row_number() over(partition categoryid order quantity desc) table2 ) select t2.product, t2.categoryid, t2.quantity cte t2 join table1 t1 on t2.categoryid=t1.c...

java - Do you know good JMonkeyEngine tutorials and docs? -

i'm interested in jmonkey fun projects, when search google find tutorials , docs, can find either basic and/or incomplete stuff, these on http://jmonkeyengine.org/ , or specific ones. know "from beginner expert" tutorial jmonkey? http://jmonkeyengine.org/wiki/doku.php/jme3 has complete series of tutorials jme3. haven't been accessible via google until now.. http://jmonkeyengine.org/wiki/doku.php/jme2:jme2 has series of tutorials community-supported old jme2

java - codeswarm help: Anyone have experience setting up codeswarm for use with perforce activity log? -

i've been trying setup codeswarm kicks @ work using activity log generated our perforce depot. running troubles following guide/wiki on google-code site , wondering if maybe had experiences setting perforce server share? i running utf-8 encoding issues it's taking bloody long time believe. activity log generated python script 65k. have seen videos of other seemingly large projects cannot tell if cause. any appreciated. thanks i ran similar issues runtime. interest in visualizing recent development cycle company's large project, consisted of approximately 10000 perforce changelists. looking @ convert_logs.py , saw making direct call p4 -g changelists dump entire revision history @ considerable cost. p4 changes takes argument -m limit number of changelists returned. edited line 347 of convert_logs.py from changelists = run_marshal('p4 -g changelists "' + opts.perforce_path + '"') to changelists = run_marshal('p4 -g c...

Jquery disable click if hover too long -

i have jquery game can view here link text the game starts entering number in text field. click play button. after clicking play button set of square appear each rotating random numbers, click on square has number build score, miss 3 times , done. i added game site, can view here link text the problem i'm having site members keep cursor on 1 box , wait number appear in 1 box. ruins game. there way make can't click on same box more once in row. they'll have go click box before can come one. here's complete script var hitcount = 0, misscount = 0; function isnumeric(n) { return !isnan(n); } $("#getit").click(function() { var hitcount = 0, misscount = 0; $('#hitcount').text(0); $('#misscount').text(0); $('#message').hide(100); var li = [], intervals = 0, n = parseint($('#mynumber').val()); var intervalid = -1; if (isnumeric(n)) { intervalid = set...

c# - Is there an easy way to generate XML with method summary data? -

i have tool reflects dll , executes methods dynamically. however, don't have of classes can invoked documented user can invoke right method. is there way can generate xml file based on .cs file, similar way .net framework intellisense files? also, if there's way keep summary data inside dll , reflect data out, can too, i'm pretty sure summary data doesn't make release build. thanks! if using visual studio, have considered using ghostdoc ? either manually using generate xml document comments or in macro whole project/solution. there thread on social.msdn discusses doing this.

javascript - Embed V8 in OpenCL application? -

i using opencl write gpgpu kernels target nvidia cuda runtime. reading on v8 , found page describing v8 embedding techniques: http://code.google.com/apis/v8/embed.html is possible 'wrap' opencl functions in v8 'templates' can write kernel logic in javascript? for reference, links opencl 1.1 c++ bindings on khronos web site. my main concern opencl relies heavily on opengl. v8 opencl wrapper entail wrapping large portions of opengl (or prohibitively, closed-source cuda runtime) well? or impossible reconcile v8 virtual machine , cuda runtimes? it may "possible" infeasible , impractical. interpreters inherently serial processors. have spawn interpreter each thread ( or @ least each thread group using shared memory, have deal threads stomping on each other if used same interpreter instance ). video cards not have memory this. suppose map shared host memory around this. bottom line. possible yes, defeat purpose of opencl being fast , literal...

c++ - using the qsort() function -

i'm student & looked function in book. works should don't quite understand inner workings of sortfunction() passed qsort() function. if 1 explain in detail, please do. in advance. #include<iostream> #include<stdlib.h> using namespace std; //form of sort function required qsort() int sortfunction(const void *intone,const void *inttwo); const int tablesize = 10; int main() { int i, table[tablesize]; //fill table values for(i = 0; < tablesize; i++) { cout << "enter value " << (i + 1) << " : "; cin >> table[i]; } cout << "\n"; //sort values qsort((void*)table, tablesize, sizeof(table[0]), sortfunction); //print results for(i = 0; < tablesize; i++) { cout << "value " << (i + 1) << " : " << table[i] << endl; } cout << "\ndone\n"; return 0; } ...

html - How can I use ajax to submit a comment to a site? -

i know have dumb question, , im sorry beginner stupidity... but there easy way have open text box, when user hits submit comment saved database , comment box shrinks dissapear? there must dead simple tutorial out there, didn't find one! thanks! you can use jquery: $('.submitbutton').click(function() { var text = $('.textbox').slideup().text(); $('.loading').fadein(); $.post(url, { text: text}, function(response) { $('.loading').fadeout(); //do }); });

Wikipedia API for geolocations -

is possible, using existing wikipedia api's list of articles around geo-location? sort of how google maps it? i "here" , find out around me on wikipedia. i can see on articles this can see "coordinates" on right hand side, query on these coordinates... any thoughts? don't reinvent wheel, use dbpedia . sample page "lat" , "lon" data extracted . , can queried sparql .

javascript - How do I scroll to s specific location in an iframe? -

i have found 1 way uses js, rather use css, think had seen used before, cannot remember how. kind of css use position webpage inside , iframe? create anchor in iframe : <a id="abottom"/> . now, need anchor added in iframe , anchor 's offsettop : var position = window.frames["anchor_iframe"].document.getelementbyid("abottom").offsettop; now, set iframe scrolltop position window.frames["anchor_iframe"].document.body.scrolltop = position; iframe-scroll-to-anchor-position.htm <html> <head> <script type="text/javascript"> function getthere() { var position = window.frames[0].document.getelementbyid("abottom").offsettop; window.frames[0].document.body.scrolltop = position; } </script> </head> <body> <button onclick="getthere();">get me there!</button> <br/> <iframe src="loremipsum.htm" width="80%...

javascript - Get decoded / non html from Ajax HtmlEditor -

i struggling retrieve content plain text ajax htmleditor . i using editor.get_content() retrieve content , needing in plain text can compare initial value of content. needs done client side in javascript. for example plain text require along lines of - <a href='blah' .... what i'm getting out is: <a shape="rect" href="blah"..... i cannot use following answer unable specify static iframe . unless there way dynamicly retieve it? how value (non html) ajax html editor try one. http://htmleditor.codeplex.com/ its works fine me.

How do I log into a local server using the XMPP protocol? (iPhone SDK) -

how log local server using xmpp protocol? (iphone sdk) if want logning local sever sever ip address , port no. add ip address [xmppstream sethostname:@"10.0.1.98"]; in connect method. thanks anurag

.net - Intellisense in rehosted workflow designer -

is possible enable intellisense in rehosted workflow designer (as in visual studio)? if yes, how? edit: answer might here , afraid posts' language technical , don't understand what's being said basically have implement iexpressioneditorservice , add workflowdesigner. check out this series of posts solution build on top of vs2010 assemblies.

file - How to use C# Stream Reader to save a completion of a process? -

i have program uses cmd program execute various arguements. the arguements work in normal cmd c:\temp\bin\fls.exe -m c: -r c:\temp\image.dd > c:\temp\bin\ntfs.bodyfile . the c# program have written works till c:\temp\bin\fls.exe -m c: -r c:\temp\image.dd not execute > c:\temp\bin\ntfs.bodyfile means save process ntfs.bodyfile. i have read many other websites , point problem of program missing streamreader save completion of process file. can please advise on program allow process saved file? thanks! one such similar website has same problem be: streamreader file? using system; using system.collections.generic; using system.linq; using system.text; using microsoft.win32; using system.diagnostics; namespace consoleapplication1 { class program { static void main(string[] args) { process process = new process(); process.startinfo.filename = "c:\\temp\\bin\\fls.exe"; process.startinfo.arguments = "-m c: -r c:\\temp\\image.dd ...

ibm mq - Connect MQ Series from JBoss using MQ Java Classes -

i trying connect mq series jboss server. can tell me steps should follow? breaking head week !!! just check http://community.jboss.org/wiki/integrationwithwebspheremqseries http://www.ibm.com/developerworks/websphere/library/techarticles/0710_ritchie/0710_ritchie.html

asp.net - Content Web Form not permitting to add content -

this code of nested master page in project: <%@ master language="c#" masterpagefile="~/presentation_layer/pages/home.master" autoeventwireup="true" codebehind="cmsnestedmasterpage.master.cs" inherits="livetest.presentation_layer.pages.cmsnestedmasterpage" %> <asp:content id="content1" contentplaceholderid="head" runat="server"> </asp:content> <asp:content id="content2" contentplaceholderid="contentplaceholder1" runat="server"> <div id="divmenusidebarleft" class="mainsidebar1div" style="top: 2px" title="livetest cms menu"> </div> <div id="divcmscontent" class="maincontentdiv" title="divcmscontent" style="background-color: buttonface; width: 791px; left: 203px; position:relative; top: -602px;"> </div> </asp:con...

which is the best mysql connection method to use stored procedure in php? -

there 3 methods connect mysql php. mysql_connect,mysqli,pdo. best 1 use stored procedure in application? please guide me mysqli straightforwardly better mysql . pdo has lot of things going it. have codebase in @ moment use mysqli along stored procedures, , don't have complaints.

Hadoop MapReduce - Pig/Cassandra - Unable to create input splits -

i'm trying run mapreduce job pig , cassandra , error: error 2118: unable create input splits for: cassandra://constellation/logs [solved] there environment variables missed set: pig_rpc_port, pig_initial_address, pig_partitioner /opt/cassandra-0.7.0-beta3/contrib/pig$ bin/pig_cassandra example-script.pig 10/11/15 17:38:26 info pig.main: logging error messages to: /opt/cassandra-0.7.0-beta3/contrib/pig/pig_1289839106859.log 2010-11-15 17:38:27,809 [main] info org.apache.pig.backend.hadoop.executionengine.hexecutionengine - connecting hadoop file system at: hdfs://hadoop-master-1.dkd.lan:8020 2010-11-15 17:38:29,756 [main] info org.apache.pig.backend.hadoop.executionengine.hexecutionengine - connecting map-reduce job tracker at: hadoop-master-1.dkd.lan:8021 2010-11-15 17:38:32,753 [main] info org.apache.pig.backend.hadoop.executionengine.hexecutionengine - (name: store(hdfs://hadoop-master-1.dkd.lan/tmp/temp657556636/tmp-375431593:org.apache.pig.builtin.binstorage) - 1-82 ...

java - OpenMQ and JMX - Is it possible to query for messages? -

i able query queues invoking get_destinations operation using jmx. receive queue info (attributes). query messages stored in queue, possible? give me direction? i have tried using code connectionfactory connectionfactory = new com.sun.messaging.queueconnectionfactory(); connection connection = connectionfactory.createconnection(); session session = connection.createsession(false, session.auto_acknowledge); queue myqueue = session.createqueue(string); queuebrowser browser = session.createbrowser(myqueue); enumeration msgs = browser.getenumeration(); if (!msgs.hasmoreelements()) { system.out.println("no messages in queue"); } else { while (msgs.hasmoreelements()) { message tempmsg = (message) msgs.nextelement(); system.out.println("message: " + tempmsg); } } connection.close(); but reason o can't access same queue using jmx. didn't made research on because want use jmx access standard. i still trying find...

matlab imread() read jpg error under linux -

matlab7.10.0(r2010a) i=imread('input-small.jpg'); ???error using ==> jpeg_depth jpeg parameter struct mismatch: library thinks size 632, caller expects 616 error in ==> readjpg @ 13 [depth,msg]=jpeg_depth(filename); error in ==> imread @ 441 [x,map]=feval(fmt_s.read,filename,extraargs{:}); i got error r2010b. there's no relation picture itself. it using system's jre. when switched jre shipped matlab worked.

c - Need help figuring out infinite loop -

this simplified version of code: void calc(char *s) { int t = 0; while (*s) { if (isdigit(*s)) t += *s - '0'; else ++s; } printf("t = %d\n", t); } int main(int argc, char* argv[]) { calc("8+9-10+11"); return 0; } the problem while loop running forever, though i'm expecting stop after final digit 1 . , expected output t = 20 . s not incremented if *s digit, consider removing else clause, making code this: while (*s) { if (isdigit(*s)) t += *s - '0'; ++s; }

.net - Determine which update panel caused postback? -

suppose have 3 update panels. how detect update panel caused partial postback javascript. use hidden field assign value before calling _dopostback() in javascript , on server can specify updatepanel postback.

How to get group of key events in OfferKeyEventL function of Container class in Symbian S60 -

i using carbide.c++ 2.3 , s60 3rd fp2 sdk in container's offerkeyeventl function receiving key events how can identify key map/key group? i mean ask how identify alpha key event or numeric key event or special key event?? please guide me... you can use icode , iscancode members of tkeyevent that. /** character code generated eeventkey, or 0 down or event. key codes special keys defined in tkeycode. */ tuint icode; /** scan code of key caused event. standard scan codes defined in tstdscancode. */ tint iscancode;

iphone - CoreData - Save/Load Help! -

i need add functionality ipad app can save , load notes uitextview load them when user selects date in uidatepicker saved on, calendar, notes different dates. i have asked around on stackoverflow , people have been spoon feeding me code samples not quite latching on. complain like, want learn how this, important functionality added in. here asked: core data iphone - save/load depending on date save , load data - coredata hope can me out. answers: core data iphone - save/load depending on date save , load data - coredata

java - mysql error with GWT -

i trying create sample apps using gwt , code below public void onmoduleload() { verticalpanel panel = new verticalpanel(); multiwordsuggestoracle oracle = new multiwordsuggestoracle(); database data=new database(); statement s1; try { s1 = data.conn.createstatement(); s1.executequery ("select * details limit 10"); resultset rs = s1.getresultset (); while (rs.next ()) { string name = rs.getstring ("name"); oracle.add(name); } } catch (sqlexception e) { // todo auto-generated catch block e.printstacktrace(); } suggestbox suggestbox = new suggestbox(oracle); panel.add(new label("enter country")); panel.add(suggestbox); panel.addstylename("demo-panel-padded"); rootpanel.get("demo").add(panel); } , have added mysql-bin.jar connector in war/web_inf/lib/ , getting compilation error ...

jquery simplemodal unable to call another function -

in modal window have "continue" button. whilst can modal close assigning button simplemodal-close class, can't call function. i've put code simple demos on site. the button: <a href="#" class="simplemodal-close" onclick="closepopup()"><img src="bell/images/button_understand.gif" width="116" height="49"></a> the javascript: $(document).ready(function() { function showpopups(){ var e = document.getelementbyid('hirpopup'); $('#hirpopup').modal({ opacity:80, overlaycss: {backgroundcolor:"#fff"} }); e.style.display = 'block'; return false; } function closepopup(){ var e = document.getelementbyid('hirpopup'); e.style.display = 'none'; confirm(function () { samewindow(this.form); }); } function confirm(callback) { $(...