Posts

Showing posts from August, 2015

html - Javascript for hover over one image to bring up another with description in a fixed place -

hey i'm trying create javascript, functions , html coding website working on.i have 8 small images on left hand side. default large image on right. want make when hover on each small image different large image replaces default large image on right hand side description between two. leftside small image1 small image2 small image3 small image4 small image5 small image6 small image7 small image8 middle *small image1 title* *small image1 description* rightside *large image* changes default large image through 8 different large images (and descriptions, default image has no description) when hover on small images. horizontal each other. any appreciated. thanks you can put middle , rightside in div, has id rightdiv, can load content of div ajax. onhover can perform new ajax call populate rightdiv new content retrieved ajaxcall. take @ ...

javascript - create a callback function instead of using a flag var to control when a specific function is done -

i have code snipet this: var nbrprevart = $("#accordion > div .accordionpanel").size(); var processing = false; if (nbrprevart == 0) { processing = true; getarticlespreview();//fetches articles first } //loop makes browser wait until finishes "getarticlespreview()" while(!processing) { } //getarticlespreview() finished can safely execute step $.ajax({ type: "get", url: "http://mydomain.com/somepage.htl", success: function(data) { alert(data);} }); //----------------------------------- function getarticlespreview() { //lenghty operation processing = false; } don't practical because using loop make wait until function competely executed perform next step. is there way define callback message called when first operation done , have second step ( $.ajax call) inside run properly? thank in advance! teixeira you create callback yourself, using apply function. juste have add callback par...

java - Difference between Eclipse and NetBeans -

possible duplicate: what difference between eclipse , netbeans if want use java in it? what difference between eclipse , netbeans ides? specific features of both ides? note: mac user eclipse has massive plugin library , enormous community behind it. i've found "pinwheel" when doing large refactors, other it's stable me. jsp editor, has, in past been weak me regards differentiating between html , embedded java. appreciate extreme configurability of layout of different perspectives. i've never been particularly thrilled it's editor theming regards color schemes. it's debugger top-notch. netbeans sort-of reference platform, know? said, it's plugin library not large, though have rather nice vi emulation plugin. it's felt slower me eclipse, no matter it. has been known out-right dump on me well. netbeans has nice integration different application-deployment platforms, such glassfish , tomcat.

Naming conventions in UNIX C functions (_t and _st) -

i notice there function return types named *****_t or ******_st . "_st" , "_t" mean? posix reserves names ending _t types. although quite common see code invents own type names ending _t , doing dangerous - can run posix systems define (different) type same name. in libmemcached source, looks _st suffix used indicate structure type: types.h:typedef struct memcached_st memcached_st; types.h:typedef struct memcached_stat_st memcached_stat_st; types.h:typedef struct memcached_analysis_st memcached_analysis_st; types.h:typedef struct memcached_result_st memcached_result_st; types.h:// of flavors of memcache_server_st types.h:typedef struct memcached_server_st memcached_server_st; types.h:typedef const struct memcached_server_st *memcached_server_instance_st; types.h:typedef struct memcached_server_st *memcached_server_list_st; i didn't find single instance of function ending _st (but may not have looked hard enough).

how to get email address of friends using facebook api in asp.net using c#? -

please example give me...dont give me reference site name or facebook sdk site..because used sdk asp.net , in friendlist class show me email hashes instead of email address,so there other way friend email full email address the facebook api has never , never expose friends email addresses. if want own account, facebook gives option sync friends & email addresses yahoo mail account , again feature not available through kind of api.

iphone - CALayer transformation - anchorPoint problem -

i work on card flip animation coreanimation. layer want animation uiview uiimageviews subviews. animation approach: cabasicanimation *animation = [cabasicanimation animationwithkeypath:@"transform"]; animation.duration=2.0f; animation.repeatcount=1; animation.fromvalue = [nsvalue valuewithcatransform3d:catransform3dmakerotation(0.0, 0, 1, 0)]; animation.tovalue = [nsvalue valuewithcatransform3d:catransform3dmakerotation(m_pi, 0, 1, 0)]; animation.removedoncompletion = no; animation.fillmode = kcafillmodeforwards; [layer addanimation:animation forkey:@"flip"]; the problem anchor point of layer seems wrong because animates view @ point x = 0. anchor point of layer has value (0.5, 0.5) any suggestions?

sharepoint - Add SPFolder in List Instance xml -

i've create custom list , included basic pieces (schema.xml, list template,..) package .wsp. have list instance defined, add folders xml. know can add splistitems using ..., i'm not sure how add spfolder. want add spfolders list instance default, can't seem find examples of doing this. wondering if has suggestions , sample code related how this. my answer guess how happen, have no sharepoint setup on home computer test it. i wonder, happen if included field fsobjtype in list instance xml. like: <data> <rows> <row> <field name="title">outgoing e-mail settings</field> <field name="fsobjtype">1</field> </row> </rows> </data> edit: seems not 1 think of such solution, seems trick won't work on custom lists, in custom document libraries: http://www.notesfor.net/post/2009/02/16/deploy-a-custom-splist-with-folders-from-onetxml.a...

tsql - How do I convert the following code to a SQL Server/T-SQL CTE? -

i consider myself rather proficient t-sql , i'm able optimize query pretty without loosing readability. in short: sql short, descriptive, declarative , elegant. while following code works, have 2 problems it: i using cursors , can't shake feeling have in of head have been done more efficiently using ctes. cursors don't work in views, can't manipulate results/ranges on client-side or in dependent sql. the code implemented in stored procedure, leads same problem above. linq sql , auto-paging. so given following sp, see obvious way convert plain select using recursive ctes? i've tried, failed , thought i'd see stack overflow community might able come with. set ansi_nulls on go set quoted_identifier on go create proc [dbo].[usp_getlastreferers] ( @limit int = null ) begin set nocount on create table #referer ( id int, url nvarchar(500), referer nvarchar(500) ) declare @id int declare @url nvarchar(500) declare @referer nvarch...

javascript - How to create an N:N relation editor in web page? -

i have create small "who what" web application incoming letter routing: there relatively long list (about 600 items) of employees; there short list (about 5 items) of tasks; when assigning task employee, due date must specified; as result, need list (sequence of items matters in case, since first employee in list considered "main responsible person"): john smith - write response letter - 20.01.2010 frederica minoso - review incoming letter - 18.01.2010 robert geer - review incoming letter - 18.01.2010 if had, say, 10 employees, design quite easy - drop-down list of employees, drop-down list of tasks, date picker due date, "add list button" alt text http://naivist.net/tmp/layout.jpg , of course, add result list "move up"/"move down" buttons besides it. however, drop-down list of 600 items much; means user searching name, surname, department must take place. i skilled enough technically create application (javascr...

yui - Every flash uploader giving bad progress values -

the file upload script wrote last year internal website has been misbehaving oddly on number of machines. on machines consistently works fine, on others consistently misbehaves. having same problem yui uploader, swfupload (2.2 , 2.5a), , uploadify. on misbehaving machines, progress event (or callback case may be) reporting upload going far quickly. progressing around 9 or 10mb/s, instead of 50 or 60kb/s going on. progress bar fills quickly, , no more progress events triggered. few minutes later completion event trigger when upload done. i must emphasize file upload proceed normally, though progress being reported wrong. the progress events reporting correct file size, reported amount uploaded way high, , appears multiple of 2^16 (65536). i'm having problem firefox 3.5 on windows xp, of have various subversions of flash 10. has heard of happening, or have idea going on? (i'm off go file number of bug reports, here has previous experience this.) turns out...

Why does my Sharepoint IRM module fail to re-initialize intermittently? -

i have sharepoint irm module works of time. however, mornings when come in , try exercise it fails work. iisreset going again. the windows event log shows following error mornings @ around 01:45 (guid blanked post). information rights management (irm): protector {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} experienced problem while being initialized. protector: {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} additional data error value: 80070005 more information, see , support center @ http://go.microsoft.com/fwlink/events.asp. this error occurs along 3 other events 3 other irm modules re-initializing (i believe these built-in ones). the sharepoint log contains similar: 09/22/2010 01:45:20.39 w3wp.exe (0x11ec) 0x1338 windows sharepoint services irm 95lu information information rights management (irm): initialization of protector {4f9976dd-47c3-4518-b2a2-a258b379f970} completed. protector: {4f9976dd-47c3-4518-b2a2-a258b379f...

OpenID Directed Identity/Identifier Selection in PHP -

i'm trying implement openid server in php supports identifier selection (some call directed identity, more specific case of identifier selection). is, user can enter generic uri openid identifier, log in, , choose identifier return openid consumer. for example, if user enters mysite.com indentifier, after log in prompted return 1 of 2 identifiers openid consumer (perhaps mysite.com/myusername or mysite.com/anon-ad83f38c98b98 ). the advantage of system have option either use single identifier among many sites, or use unique identifiers individual sites. anyway—i haven't been able find tutorial on how implement portion of openid spec in php. in fact, searches led me unanswered questions on forums or on stack overflow. know of php library can handle identifier selection or directed identity? if so, there tutorials out there explaining how set up? i've been playing few libraries don't mention 1 way or other, haven't been able working yet. any apprecia...

constructor - Javascript object literal: value initialization? -

i using object literal create object methods. here simple example. var sizemanager = { width : 800, height : 600, ratio : this.width / this.height, resize : function (newwidth) { width = newwidth; height = newwidth / ratio; } } my issue sizemanager.ratio returns " nan ". i'm quite sure it's initialization issue. there way obtain correct ratio value? there way assign costructor or initializer object literal? defining constructor objcet way? edit: off course sizemanager ideally singleton (only 1 object), that's way using object literal. yes, it's initialization issue. this not refer sizemanager object @ point you're using it. (object initializers don't change value of this .) this set how call function , has same value throughout function call. you're not calling function there, this has whatever value had prior beginning of code. (i've pointed out ratio specific example @ end of...

iphone - Customizing Cocos2D menus -

i've decided stick cocos2d game dev... menus there way make more customizable, maybe instead of text maybe image there way arrange them differently versus in center of screen check tutorial have done cocos2d menus . it quite simple present images instead of text, , should select when creating menu item. have @ menuitemimage class. as can see in suggested tutorial piece of code create menu // creating menu items menuitem *start = [menuitemfont itemfromstring:@"start" target:self selector:@selector(start:)]; menuitem *settings = [menuitemfont itemfromstring:@"settings" target:self selector:@selector(settings:)]; menuitem *credits = [menuitemfont itemfromstring:@"credits" target:self selector:@selector(credits:)]; menuitem *help = [menuitemfont itemfromstring:@"help" target:self selector:@selector(help:)]; // creating menu , adding items menu *menu = [menu menuwithitems:st...

asp.net - ASP .NET: Thread.CurrentPrincipal is lost when customErrors contains redirectMode="ResponseRewrite" -

i setup custom principal in 1 of modules handles authentication_request. set httpcontext.user. sets httpcontext.user , thread.currentprincipal. when error occurs , customerrors section contains "responserewrite", thread.currentprincipal reset generic principal on aspx error page., httpcontext.user still contains custom principal. not happen if customerrors section contains "responseredirect". expected behavior? i suspect server spinning separate thread execute error page. might able reset (thread.currentprincipal) putting following global.asax. protected void application_authenticaterequest(object sender, eventargs e) { thread.currentprincipal = httpcontext.current.user; } this line insure both in sync on each request application.

asp.net - Should I set IsReusable to True in my HttpHandlers? -

i've never understood this property of ihttphandler . property have set when implement interface. i've assumed setting true better performance, not sure negative side effects might be. should return true or false? it used indicate if single instance of ihttphandler used process multiple concurrent requests. if set true improve performance must make sure code thread safe because processrequest method might invoked multiple threads @ same time.

Flip View for 2.2.1 iPhone SDk -

i have app works great in 3.1.2, yet when revert 2.2.1 method flip view doesn't work, using following code: -(ibaction)infobuttonpressed:(id)sender { secondviewcontroller *second = [[secondviewcontroller alloc] initwithnibname: nil bundle:nil]; second.modaltransitionstyle = uimodaltransitionstylefliphorizontal; [self presentmodalviewcontroller:second animated:yes]; } i following error ( http://screencast.com/t/ytjlytgz ). thoughts on how can fix easily? modaltransitionstyle available 3.0+. if want have similar transition have create animation transition yourself. take @ following uiview function + (void)setanimationtransition:(uiviewanimationtransition)transition forview:(uiview *)view cache:(bool)cache

:last-child pseudo class selector in CSS and Internet Explorer -

i have following code: ul.mylist li{ border-right: 1px dotted #000; } however, on last element, need remove border design working dictates last item not require border separator. so, need target last child of list , within css have added ul.mylist li:last-child{ border-right: none; } which know, works fine in firefox, safari , chrome. the problem lies when view page in internet explore 6 through 8. so, after digging around, found answer: if browser ie<8, specify stylesheet this: <!--[if lt ie 8]> <link rel="stylesheet" href="css/ie_all.css" type="text/css" /> <![endif]--> and within ie stylesheet specify following rules: ul.mylist li{ border-right: expression(this.nextsibling==null?'none':'inherit'); } the nextsibling expression looks see if there element after , if there inherits rule specified in default stylesheet, if not applys new rule. more information can found...

.net - XPath to get the element with the highest ID -

xml source: <documents> <document> <id>3</id> </document> <document> <id>7</id> </document> <document> <id>1</id> </document> </documents> i need document-element highest value in id-element (so <document><id>7</id></document> in example). can't change c# code, xmldocument.selectsinglenode(...) , can modify xpath used. is there documents/document[id=max(id)] or order id descending it? documents/document[not(../document/id > id)]

.net - How to use/configure Unity Container IOC in my situation -

i have trouble implementing unity ioc project reading config file. here have 1) classlibrarya 2) classlibraryb references classlibrarya 3) winforms app references classlibraryb note: someother app reference classlibrarya, eg. web service. classlibrarya have configured ioc depending on used. eg. idatasource different if called in web service , when called local app. classlibraryb have own set of dependencies injected main application, in case, winforms app. classlibraryb instantiate many classlibrarya objects in loop. winforms app contain concrete implementation of classlibraryb's dependancies implementation , container.configure should called here? my questions are, when , call container.configure in application? need child container sub library tiers/layers? should classlibraryb or winforms implement concrete class classlibrarya injected classlibrarya? should group each layer/tier's ioc config different "container" name in config file? ...

optimization - Cookies: More but smaller or less but bigger? -

regarding web optimization, load-time, speed performance , assuming data size equal: is faster have more cookies smaller, or less cookies bigger? for technically inclined: more efficient concat values separated known delimiter resulting in larger cookie size, or have smaller cookies containing single values? and sake of argument, let's assume we're not in danger of exceeding 4k/20 cookie limit =) thanks! edit: thread didn't come in searches, apparently asks same question apologize repost: in website, setting 1 cookie better setting many single cookies? imho, answers seem vague , contradict, maybe there no clearcut answer here. nice have empirical benchmark data or technical basis answer, might ask =) each cookie has additional attributes, expiration date. if don't have change cookie each time, i'ld go 1 cookie containing data.

c# - Generating a list of categories and subcategories with asp.net mvc2 -

i have feeling i'm doing horribly, horribly wrong. nested loops? best practice method of listing subcategories? have feeling involves preparing list in controller action , sending client via actionresult, don't know start? able point me in right direction? here's hacky code: <h2>categories</h2> <a href="javascript:;" onclick="newcategory()">create new category</a> <br /> <ul class="parent"> <%foreach (var category in model.categories){%> <%-- list of top-level parent categories --%> <%if (category.isparent && category.parentid == 0)%> <li> <span class="buttons"><a href="javascript:;" onclick="editcategory(<%:category.categoryid%>)" class="edit"></a> <a href="javascript:;" onclick="deletecategory(<%:category.categoryid%...

How do I get all the variables defined in a Django template? -

i'm new django , wonder if there way dump variables available template debugging purposes. in python might use locals() , there equivalent default template engine? note: suppose don't have access view purposes of question. both ned's , blaine's answers good, if want achieve ask there's template tag it: {% debug %} builtins:debug more information in context_processor.debug including: if processor enabled, every requestcontext contain debug , and sql_queries variables – if debug setting set true , request’s ip address ( request.meta['remote_addr'] ) in internal_ips setting similar peter g suggestion, use <div id="django-debug"><pre>{% debug|escape %}</pre></div> block @ end of page has display:none can inspect debug.

layout - Magento _prepareLayout() called 5 times to many -

** new edit ** so i'm trying this. i want add new form elements generated module on product view of following url http://magento.example.com/catalog/product/view/id/46 ultimately these elements determined show related table in module i expected if extended mage_catalog_block_product_view in module shown below able create block in product form contain such form fields, if in related table in module so created test.phtml file in app/design/frontend/default/default/templates/<module>/test.phtml then can see in view.php file described bellow built block , displayed in product view. it did appear 5 times many. answers below normal answers question why shows 5 times leaves question proper way proceecd since plan not going work ** end new edit ** in module call _preparelayout() , 5 times when pull page here's code in /app/code/local/namespace/module/product/veiw.php class <namespace>_<module>_block_product_view extends mage_catalog_bl...

what kind of html element is used for users to input an order? -

basically have sql , want user able select ordering in "order by" section html element. there out-of-the-box solutions? edit: it's more order country,status,... or order status,country,... if u display sql results in list view u can change display order clicking on header of displayed fields. edit: have @ this . (hold down shift key , click on headers)

android - Should I remove e.printStackTrace() from my code before publishing -

i reading the android publishing docs , said remove log calls code. have calls e.printstacktrace() in code can printed part of normal running of program (ie. if file not exist yet). should remove these calls? you shouldn't using e.printstacktrace() directly anyway — doing send info android log without displaying application (log tag) came from. as others have mentioned, continue catch exception in question, use 1 of android.util.log methods logging. log message, not stack trace, or use verbose logging stack trace: try { object foo = null; foo.tostring(); } catch (nullpointerexception ex) { log.w(log_tag, "foo didn't work: "+ ex.getmessage()); log.d(log_tag, util.stacktracewriter(ex)); } you should strip debug or verbose log messages production builds. easiest way use proguard remove log.[dv] calls code.

c - Can we change the value of an object defined with const through pointers? -

#include <stdio.h> int main() { const int = 12; int *p; p = &a; *p = 70; } will work? it's "undefined behavior," meaning based on standard can't predict happen when try this. may different things depending on particular machine, compiler, , state of program. in case, happen answer "yes." variable, const or not, location in memory, , can break rules of constness , overwrite it. (of course cause severe bug if other part of program depending on const data being constant!) however in cases -- typically const static data -- compiler may put such variables in read-only region of memory. msvc, example, puts const static ints in .text segment of executable, means operating system throw protection fault if try write it, , program crash. in other combination of compiler , machine, entirely different may happen. 1 thing can predict sure pattern annoy whoever has read code.

python - Django: Chicken or Egg question -

i building application send api call , save resulting information after processing information in apirecord(models.model) class. 1) should build separate class in such way class api call, processes information (including checking against business rules) , creates instance of apirecord() class? or 2) should build separate class appropriate methods processing, , calling api, , in model, override apirecord.save() method call separate class's api methods , save results? or 3) should build model class appropriate methods calling api , processing response (including checking values , other business rules)? i tried # 2 , ran problems flexibility (but still open suggestion). i'm leaning towards # 1, i'm not sure of negatives yet? it design decision. depends design , programming interests. used combination of 3 methods said. if need informations can build other fields create internal function in model class. if need other records of database create fun...

javascript - Dynamically adding listeners in Google Maps where iframe src is set differently for each marker -

hi i've read articles , excellent piece on scope , closures robert nyman. cannot work. i'm trying assign mouseover event various markers , set iframe src depending on marker moused over. infamous last entry every mouseover event. i've played better part of few days , not 'thinking fluid' helping :). guidance appreciated for(var i=0; i var latlngr = new google.maps.latlng(mylatd,mylongd); markerno = "marker_"+i; markerarray[i] = new google.maps.marker({ position: latlngr, map: map, title:myname }); google.maps.event.addlistener(markerarray[i], 'mouseover', function(markerno) ...

Is python's "set" stable? -

the question arose when answering question ( there ). when iterate several times on python set (without changing between calls), can assume return elements in same order? , if not, rationale of changing order ? deterministic, or random? or implementation defined? and when call same python program repeatedly (not random, not input dependent), same ordering sets? the underlying question if python set iteration order depends on algorithm used implement sets, or on execution context? there's no formal guarantee stability of sets (or dicts, matter.) however, in cpython implementation, long nothing changes set, items produced in same order. sets implemented open-addressing hashtables (with prime probe), inserting or removing items can change order (in particular, when triggers resize, reorganizes how items laid out in memory.) can have 2 identical sets nonetheless produce items in different order, example: >>> s1 = {-1, -2} >>> s2 = {-2, -1} >...

xamarin.ios - What does an iphone user need to use a Monotouch app? -

if user wants use monotouch app, need download onto iphone prior using app? how heavy stuff needs download? thanks. monotouch transparent end user - user buys monotouch app app store, , works, in same way normal iphone application works. the size of app depending on how many of frameworks used app.

Scale limits on pinch zoom of android -

how set max , min zoom levels pinch-zoom? here code: // public class touchimageview extends imageview { private static final string tag = "touch"; // these matrices used move , zoom image matrix matrix = new matrix(); matrix savedmatrix = new matrix(); static pinchzoomexample spinchzoomexample = null; // can in 1 of these 3 states static final int none = 0; static final int drag = 1; static final int zoom = 2; int mode = none; static bitmap scurrentimage; // remember things zooming pointf start = new pointf(); pointf mid = new pointf(); float olddist = 1f; context context; public touchimageview(context context) { super(context); super.setclickable(true); this.context = context; matrix.settranslate(1f, 1f); setimagematrix(matrix); setscaletype(scaletype.matri...

How to compare JARs in Araxis Merge? -

i'm using araxis merge try , compare 2 java archive files. i've done in beyond compare have switched mac. right araxis treats jars files , see lot of binary/hex stuff. i'd see classes have differences , treat jar folder. ideas? decompress contents of archive folders, , diff folders

patch - How do patches work in Git? -

i'm new git, familiar svn. test made repository in local directory git init . cloned empty repository (over ssh using 127.0.0.1, thing wanted test) local directory. added files in repository 2, did git add * , git commit -a -m "first source code" . i want create patch using git format-patch , apply on repository 1. how do this? know there's manual, these things terribly complicated , make me wanna things monitor. create patch via: $ git format-patch master --stdout > patch.diff then patch.diff contain diff, can send else apply using: $ git < patch.diff sometimes, when manuals little dense, makes sense tutorial: http://luhman.org/blog/2009/09/22/git-patch-tutorial

c# - Simple MVC Framework for ASP.net? -

i need simple mvc framework, without jquery extensions, hibernate, loggers, etc.. only model-view-controller functions. have idea can find one? i second on vici mvc framework ! open source, easy setup, easy learn, lightweight, powerfull , support channel through stackexchange-based webpage. the vici project comes lot more libraries (e.g. vici coolstorage = orm) work beautifully together.

.net - How do I order by and group by in a Linq to objects query? -

how order , group in linq query? i tried.. dim iperson = lqpersons in objpersons len(lqpersons.person) > 0 group lqpersons key = lqpersons.name group order group descending select group, key each in iperson tmp = tmp & vbnewline & i.key & ", " & i.group.count next the above works if remove order group descending claus, it, error on next statement.. at least 1 object must implement icomparable. my query obtain list of people in class/object how many times name used item of class/object. i.e. joe, 4 | james, 5 | mike, 4 does have ideas i'm doing wrong? excuse c#, couldn't like... objpersons.where(p=> p.person > 0).groupby(p => p.name).select(p => new { name= p.key, number = p.count()}).orderbydescending(p=> p.number); main idea: groupby did select new object using key (name) , counting how many in group order descending

ruby twitter api :uninitialized constant Twitter::HTTPAuth (NameError) -

require 'rubygems' require 'twitter' httpauth = twitter::httpauth.new('myusername', 'mypassword') client = twitter::base.new(httpauth) it throwing : uninitialized constant twitter::httpauth (nameerror) have "twitter" in gem list, dotn understand problem the httpauth delete on twitter, there no more twitter::httpauth class in twitter gem. you need use oauth authentication on twitter.

iPhone SDK windows? -

is there official iphone sdk windows? thought there none, colleague @ work said downloaded 1 apple. 1 of wrong? thought apple doesn't release it's developer tools windows. or windows on non-apple computers ? there no official sdks iphone runs on windows. official sdk here , mac.

What is Common Gateway Interface (CGI)? -

cgi common gateway interface. name says, "common" gateway interface everything. trivial , naive name. feel understood , felt every time encountered word. frankly, didn't. i'm still confused. i php programmer web development experience. user (client) request page ---> webserver(->embedded php interpreter) ----> server side(php) script ---> mysql server. now php script can fetch results mysql server & matlab server & other server. so, php script cgi? because interface between webserver & other servers? don't know. call cgi, technology & other times call cgi program or other server. what cgi? whats big deal /cgi-bin/*.cgi ? what's this? don't know cgi-bin directory on server for. don't know why have *.cgi extensions. why perl comes in way. cgi & perl (language). don't know what's these two. time keep hearing these 2 in combination "cgi & perl". book great example cgi programming...

iphone - How can you share ivars between classes.? -

in 1 classes .h have nsmutablearray *rountines; and in classes .m want this [routines addoject:@"hello]; the other class modalviewcontroller type set up. so, in essence i'd .m file of mvc able read, , edit , other things ivars declare in header. cheers, sam edit another example, similar im trying achieve edit screen. you can't share ivars between classes really. ivar stands instance variable, , variable belongs particular instance of object. way solve problem allow other objects access object's state. commonly done through setter , getter methods. objective-c 2.0 makes easier providing @property , @synthesize keywords. if had access object had routines array, access through property (getter method) this: [[someobject routines] addobject:@"hello"];

Foreign Characters in android & Java -

i trying download , parse webpage foreign (chinese) characters. i'm not sure whether should use "utf-8" or else. none of these seems work me. used sample wikitionary code geturlcontent() . public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); mtext = (textview) findviewbyid(r.id.textview1); huaren.prepareuseragent(this); string test = new string("fail"); try { test = geturlcontent("http://huaren.us/"); } catch (apiexception e) { // todo auto-generated catch block e.printstacktrace(); } byte[] b = new byte[100000]; try { b = test.getbytes("utf-8"); } catch (unsupportedencodingexception e) { // todo auto-generated catch block e.printstacktrace(); } char[] chararr = (new string(b)).tochararray(); charsequence seq = java.nio.charbuffer.wrap(chararr); mtext.settext(...

Iterate Form Fields in WatiN -

is there way iterate form field in watin? code snippet highly appreciated. thanks. string url = "http://localhost//test.htm"; string formid = "myformid"; ie ie = new ie(url); form form = ie.form(formid); checkboxcollection checkboxcollection = form.checkboxes; (int index = 0, total = checkboxcollection.count; index < total; index++) { checkbox checkbox = checkboxcollection[index]; this.addinputcontrol(checkbox.id, checkbox); } radiobuttoncollection radiobuttoncollection = form.radiobuttons; (int index = 0, total = radiobuttoncollection.count; index < total; index++) { radiobutton radiobutton = radiobuttoncollection[index]; this.addinputcontrol(radiobutton.id, radiobutton); } selectlistcollection selectlistcollection = form.selectlists; (int index = 0, total = selectlistcollection.count; index < total; index++) { selectlist selectlist = selectlistcollection[index]; this.addinputcontrol(selectlist.id, sele...

Does smarty work fine when APC is installed? -

i'm developing website using php , smarty. , i'd caching bytecode of php script using apc, i'm worry apc cache complied smarty's templates, loosing possible dynamic content. possible? tanks i have been using apc on year , without problems on 4 different servers , more 30 different sites. these sites smarty ones, using dynamic content literally everywhere. @ moment using in pretty heavily used customer site no problems. not once. apc caches compiled templates , re-caches them when/if altered (compiled smarty compiler). dynamic content work previously, bit quicker, of course. so go ahead , use it.

datetime - How do you change the timezone in PHP for an existing timestamp? -

the code date , time function: function date_and_time($format,$timestamp) { $date_and_time = date($format,$timestamp); return $date_and_time; } and code display it: <?php echo date_and_time("ds f y", strtotime($profile[last_activity_date_and_time])); ?> the value of $profile[last_activity_date_and_time] 2010-01-18 14:34:04 when displayed shows 18th january 2010 - 02:34pm but, there way change timezone displayed in? not sure if you're looking for, try datetime date_default_timezone_set('europe/london'); $datetime = new datetime(); $datetime->settimestamp($yourtimestamp); echo $datetime->gettimezone()->getname(); echo $datetime->format(date_atom); $la_time = new datetimezone('america/los_angeles'); $datetime->settimezone($la_time); echo $datetime->gettimezone()->getname(); echo $datetime->format(date_atom);

linq - Update existing list values with values from another query -

i have linq statement calls stored proc , returns list of items , descriptions. like so; var q = in doh.usp_report_plc() i.qtygood == 0 orderby i.partnumber select new parts() { partnumber = i.partnumber, description = i.descritpion.trimend() }; i have sql statement returns quantities on order , delivery date each of items. parts class has 2 other properties store these. how update existing parts list other 2 values there 1 parts list 4 values? update the following code brings out results. var = a1 in db.usp_optos_daysonhand_report_plc() a1.qtygood == 0 orderby a1.partnumber select new parts() { partnumber = a1.partnumber, description = a1.descritpion.trimend() }; var b = b1 in db.pop10110s join b2 in db.iv00101s on b1.itemnmbr equals b2.itemnmbr //from b3 in j1.defaultife...

c++ - Can Win32 "move" heap-allocated memory? -

i have .net/native c++ application. currently, c++ code allocates memory on default heap persists life of application. basically, functions/commands executed in c++ results in allocation/modification of current persistent memory. investigating approach cancelling 1 of these functions/commands mid-execution. have hundreds of these commands, , many complicated (legacy) code. the brute-force approach trying avoid modifying each , every command/function check cancellation , appropriate clean-up (freeing heap memory). investigating multi-threaded approach in additional thread receives cancellation request , terminates command-execution thread. want dynamic memory allocated on "private heap" using heapcreate() (win32). way, private heap destroyed thread handling cancellation request. however, if command runs completion, need dynamic memory persist. in case, logical equivalent of "moving" private heap memory default/process heap without incurring cost of ac...

Instant messenger streaming with libVLC python wrapper -

i'm trying develop instant messenger client supports video streaming. working libvlc wrapper python. basic functions of im client there, problem comes video streaming. i've been able basic tests streaming video , playing in tkinter form own code. when comes streaming many users, , recieving many streams other users i'm lost. i'd appreciate can give me, maybe not right way , can point me out direction should take, helps not experienced programmer. in advance. i don't think easy. http://wiki.videolan.org/videolan_videoconference#see_also might give clues directions try...

Tomcat serving URLs wrong with mod_proxy and apache -

i've set host apache serve static pages , use tomcat serve web application (see this question ). static pages server from " http://myhost.com " and dynamic (tomcat) pages server from " http://myhost.com/myapp " the mod_proxy makes sure " http://myhost.com/myapp " forwarded tomcat server running on " http://myhost.com:8080 ". the problem standard tomcat introduction page on " http://myhost.com/myapp " if click on local link (e.g. 'status') on left, generates url " http://myhost.com/manager/status " while should generate: " http://myhost.com/ myapp /manager/status" (the same true webapps installed under tomcat) what should changed in configuration (apache, tomcat?) redirect tomcat links right place? have set proxypassreverse setting in httpd.conf. overwrite http header you'll correct request on side of tomcat.

arguments - jQuery for a beginner Web Designer -

what arguments can use encourage beginner web designer jquery library worth learning , using? proficient in html , css, php expertise little javascript, jquery appears huge risk , maintenance nightmare. presentation articles these ones published “smashing magazine” : jquery , javascript coding: examples , best practices 45+ new jquery techniques user experience 50 useful new jquery techniques , tutorials are met raised eyebrow – appear either gimmicky (e.g. sliding animations), 1 trick pony (image slideshows) or complex , difficult master. so, biggest benefits in using jquery (both graphical , functional) – there simple examples prove concept? jquery isn't "some tool" more. it's utilised throughout many high-tech websites , more not lot of designers asked if know jquery in interview. hell, when on google , microsoft's radar know effective standard in web design. to me, web design encompasses client-side aspects of website development pr...

c# 4.0 - Return newly created TFS work item ID using TFS API? -

using tfs api, able create tfs item, no problem. what best way me know item id newly created item? thank you, george try { // authenticate user account networkcredential account = new networkcredential(username, password, domain); // user stories team project user story created. uri collectionuri = new uri(tfsuri); //tfsteamprojectcollection tpc = new tfsteamprojectcollection(collectionuri); tfsteamprojectcollection tpc = new tfsteamprojectcollection(collectionuri, account); workitemstore workitemstore = tpc.getservice<workitemstore>(); project teamproject = workitemstore.projects[info.tfsprojectname]; workitemtype workitemtype = teamproject.workitemtypes[info.itemtype]; // create work item. workitem userstory = new workitem(workitemtype); userstory.title = info.title; userstory.description = info....

.net - Sending mhtml emails - C# -

i have requirement send emails containing both text , images. so, have .mhtml file contains content needs emailed over. i using chilkat this, in outlook 2007 showing mhtml file different attachments(html+images). can suggest me other component sending mhtml emails. fyi, using .net 3.5 also, not want save images on server before sending them. thank you! i use plain old native mailmessage class. previous answer can point in right direction edit: built similiar code time ago, captures external html page, parse it's content, grab external content (css, images, etc) , send through email, without saving on disk.

plot - How can I display empirical pdf of my 100x1 vector data in Matlab? -

i have data 100x1 vector. how can display empirical pdf in matlab? also, if want compare pdf of 3 vectors on same graph, how that? right using pdfplot.m file plot empirical pdf, when want compare 3 distributions using 'hold on', firstly not working , secondly distributions in same color. thanks! edit: don't want plot cdf. hist : hist(data) or, if want more control on how presented, use: [n,x] = hist(data); plot(x,n,'rx-'); %# example, plot pdf red x's , line, %# instead of bars figure; plot(x, cumsum(n)/sum(n)); %# plot cdf