Posts

Showing posts from May, 2011

php - How to protect www folder on windows -

i made intranet shop , going give computer intranet on it. want make sure can not copy files , install on computer. i want protect "www" folder in apache server. using appserv. on local computer. checked tools on net truecrypt, folderencrypt etc. these encrypt folder contents. if www folder encrypted, php won't work. there way lock folder in windows without encrypting contents.[ little harder crack no lock @ all] i using zend guard protect php file , checks hard disk name , model , computer model not give %100 protection. heard zend encode gets decoded online. i need suggestions. $output = shell_exec('wmic diskdrive model'); echo $output; echo "<br>"; $output1 = shell_exec('wmic csproduct name,vendor,identifyingnumber'); echo $output1; you obfuscate php code or compile using example http://developers.facebook.com/blog/post/358/ produce binary, difficult , modify (although of course possible). obfuscating good, not c...

html - Fade background with transparent curtain -

it quite popular question, think. i looking crossbrowser css solution black opaque layer. hide stuff under it. my example: http://jsfiddle.net/pb9jv/ . not crossbrowser. (ie 6+ pain in ass). try adding the css style apply fadeover (in example : #black) filter: alpha(opacity = 50); edit : want opaque or transparent given example? have @ this, work on ie 6

tsql - Filter an ID Column against a range of values -

i have following sql: select ',' + ltrim(rtrim(cast(vessel_is_id char(2)))) + ',' 'id' vessels ',' + ltrim(rtrim(cast(vessel_is_id varchar(2)))) + ',' in (',1,2,3,4,5,6,') basically, want filter vessel_is_id against variable list of integer values (which passed in varchar stored proc). now, above sql not work. have rows in table `vessel__is_id' of 1, not returned. can suggest better approach me? or, if above ok edit: sample data | vessel_is_id | | ------------ | | 1 | | 2 | | 5 | | 3 | | 1 | | 1 | so want returned of above vessel_is_id in variable filter i.e. '1,3' - should return 4 records. cheers. jas. if object_id(n'dbo.fn_arraytotable',n'fn') not null drop function [dbo].[fn_arraytotable] go create function [dbo].fn_arraytotable (@array varchar(max)) -- ============================================= -- autho...

visual studio - VS show intellisense for constructors without having to delete a bracket or comma -

i have moved jobs , use tfs. if want @ intellisense constructor, (for code has been written, or dot.net code) have delete bracket or comma , type again constructor intellisense appear. this gets more annoying tfs wants check code out, (and don't). there shortcut key intellisense without typing in class? i have tried obvious, (ctrl + space.. ctrl + alt + space... ctrl + j). thanks i've run few times well. in case, fix go tools->import , export settings... , choose "reset settings" , restart visual studio. point, ctrl-space show intellisense completions. in case, however, work , stop working, there may different problem on machine. this clobber customizations you've made (so sure export them if care) has fixed problem me.

weblogic, deployments are not reading properties from WEB-INF/classes, configured using Spring -

i have similar problem to: using external properties files in weblogic , note accepted answer there working me. however, have follow-up (sorry, cannot work out how add comments re-open original question) does know actual cause of , "correct" (if there such thing) solution, or people take copying files domain common practise in weblogic (10.3.3) what using is: spring config has this: <bean id="messages" class="java.util.resourcebundle" factory-method="getbundle"> <constructor-arg index="0" value="config/messages"/> </bean> the messages bean referenced in other beans error is <code> <11-apr-2011 11:47:23 o'clock bst> <error> <deployer> <bea-149265> <failure occurred in execution of deployment request id '1302518829904' task '4'. error is: 'weblogic.application.moduleexception: ' weblogic.application.moduleexception: @ web...

hover - jQuery setInterval / hovering : it works once, but then stops the setInterval -

have problem 'setinterval' function, i'd start function when i'm hovering div, setinterval work @ first time when hover div => if i'm staying on div, doesn't keep on changing picture, stop 'setinterval'. is problem mouseenter? tried 'hover', etc. nothing seems make trick. does have solution? thanks lot help, here's code : img.bind('mouseenter', function(){ setinterval(next($(this)),1000); }); function next(elem){ var img_li = elem.find('li'); count++; if (count>2) count=0; img_li.eq(count).fadein('fast', function(){ img_li.eq(current).css({'display':'none'}); current = count; }); } it because assigning return value of next($(this)) setinterval , not function itself. try this: img.bind('mouseenter', function(){ var = $(this); //use that-this model avoid scope issues reference setinterval(function...

c# - All items in list query with nHibernate -

i know there restriction "in" allows detect if 1 or more elements in property in target list need tell me if items property in target list. here's example: i want person these competencies competenciescriterion : ilist<competency> { walking, running, rolling } between persona , personb: persona : person competencies : ilist<competency> { walking } personb : person competencies : ilist<competency> { walking, rolling, running } is there restriction or expression allow me execute search or know clean way instead of stacking "in" within "conjunction"? thanks in advance, Étienne brouillard i found way result wanted. stacking "in" not working figured out using subquery , counting "in" produce criteria on can verify condition counts equal. here's sample: var competencysubquery = detachedcriteria.for<employee>("employee2"); competencysubquery.createalias(...

proxy - node.js - communicate with TCP server (data == JSON) -

i'm new node.js, dived during last weekend , had fun various examples , small tutorials. i'd start little project local area network , have few questions myself right direction. setup: i've got server service running on lan. it's possible communicate service via tcp and/or http (it's possible enable or disable tcp or http or both of them) on specific port , sends , receives data via json on request. want create webinterface based on node.js service, receive , send json data webbrowser , service. problem: know how setup http server based on node.js. right i'm stuck in finding idea how create client based on node.js stands between service , webbrowser client pass through data client server , vise versa. router or proxy. here basic scheme based on client's (webbrowser) point of view: send: webbrowser requests -> node.js routes -> service receives receive: webbrowser receives <- node.js routes <- service responds questions: - go tc...

How do I convert a Ruby class name to a underscore-delimited symbol? -

how can programmatically turn class name, foobar , symbol, :foo_bar ? e.g. this, handles camel case properly? foobar.to_s.downcase.to_sym rails comes method called underscore allow transform camelcased strings underscore_separated strings. might able this: foobar.name.underscore.to_sym but have install activesupport that, ipsum says. if don't want install activesupport that, can monkey-patch underscore string (the underscore function defined in activesupport::inflector ): class string def underscore word = self.dup word.gsub!(/::/, '/') word.gsub!(/([a-z]+)([a-z][a-z])/,'\1_\2') word.gsub!(/([a-z\d])([a-z])/,'\1_\2') word.tr!("-", "_") word.downcase! word end end

c++ - Nifty/Schwarz counter, standard compliant? -

i had discussion morning colleague static variable initialization order. mentioned nifty/schwarz counter , i'm (sort of) puzzled. understand how works, i'm not sure if is, technically speaking, standard compliant. suppose 3 following files (the first 2 copy-pasta'd more c++ idioms ): //stream.hpp class streaminitializer; class stream { friend class streaminitializer; public: stream () { // constructor must called before use. } }; static class streaminitializer { public: streaminitializer (); ~streaminitializer (); } initializer; //note object here in header. //stream.cpp static int nifty_counter = 0; // counter initialized @ load-time i.e., // before of static objects initialized. streaminitializer::streaminitializer () { if (0 == nifty_counter++) { // initialize stream object's static members. } } streaminitializer::~streaminitializer () { if (0 == --nifty_counter) { // clean-up. } } // program.cpp #incl...

java - method to convert from a string to an int -

possible duplicate: converting string int in java i trying write method returns int string variable. method is: public int returnint(string s) { } you can use integer.valueof(string) this

How to do maths in if and else in jquery? -

hello guys! i have been trying create if/else statement code in jquery guess if/else statement resting in peace ! don't know getting wrong have did , still not working correctly! ok, here problem list ~ my if/else getting inverse! and think getting messed up! jslint (in jsfiddle.net ) showing no error in jquery code! please here problem demo link ~~~~~~~~~~ problem demo here smaple jquery code ~~~~~~~~~ $(function () { var correct = '10'; var incorrect = '9'; $('div.correct_incorrect').css("background",function () { if( correct > incorrect ) { return "#796"; } else if( correct == incorrect ) { return "#345"; } else { return "#732"; } }); }); please me out! thanks in advance ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sorry bother guys previous question solve...

c# - Dropdown to Enum -

i want cast string output of selected value dropdown enum. best way it? you can wrap extension method make call easier: public static t toenum<t>(this string value) { if (string.isnullorwhitespace(value)) { throw new argumentnullexception("cannot convert null or empty string enum"); } // enum built-in parse method return (t)enum.parse(typeof(t), value, true); } then call myvalue.toenum<enumnamehere>(); to enum

android - ListView with Custom ArrayAdapter not updating -

i trying return custom view of textview, chrono, , checkbox. have overriden getview method not sure if did correctly. appreciate comments on arrayadapter. not update in application. thanks! main java public class tasktracker extends activity { /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); button addbutton; addbutton=(button)findviewbyid(r.id.button1); listview mylistview= (listview)findviewbyid(r.id.listview1); final edittext myedittext= (edittext)findviewbyid(r.id.edittext1) ; //final arraylist<string> taskitems = new arraylist<string>(); final ttadapterview aa = new ttadapterview(this); // aa = new arrayadapter<string>(this, 0); mylistview.setadapter(aa); addbutton.setonclicklistener(new onclicklistener(){ public void onclick(view v){ aa.add(myedittext.gettext().tos...

Selecting values from a 3-column dataframe in R -

i have 3-dimensional array, variables being x, y , z. x list of places, y list of time, , z list of names. list of names not start @ same initial time across places: x y z x1 1 na x1 2 z2 x1 3 z3 x1 4 z1 x2 1 na x2 2 na x2 3 z5 x2 4 z3 x3 1 z3 x3 2 z1 x3 3 z2 x3 4 z2 how find first z every x? want output matrix or dataframe be: x z x1 z2 x2 z5 x3 z3 edited, after example data supplied you can use function ddply() in package plyr dat <- "x y z x1 1 na x1 2 z2 x1 3 z3 x1 4 z1 x2 1 na x2 2 na x2 3 z5 x2 4 z3 x3 1 z3 x3 2 z1 x3 3 z2 x3 4 z2" df <- read.table(textconnection(dat), header=true, stringsasfactors=false) library(plyr) ddply(df, .(x), function(x)x[!is.na(x$z), ][1, "z"]) x v1 1 x1 z2 2 x2 z5 3 x3 z3

R: load R table or csv file with the textconnection command -

in previous message convert table matrix column names i want use same approach csv table or table in r. mind teach me how modify first command line? x <- read.table(textconnection(' models cores time 4 1 0.000365 4 2 0.000259 4 3 0.000239 4 4 0.000220 8 1 0.000259 8 2 0.000249 8 3 0.000251 8 4 0.000258' ), header=true) library(reshape) cast(x, models ~ cores) should use following data.csv file x <- read.csv(textconnection("data.csv"), header=true) should use following r table named xyz x <- xyz(textconnection(xyz), header=true) is must have textconnection using cast command? thank you. several years later... read.table , derivatives read.csv have text argument, don't need mess around textconnection s directly anymore. read.table(text = " x y z 1 1.9 'a' 2 0.6 'b' ", header = true) the main use textconnection when people ask questions on dump data onscreen, rather writing code let ans...

Post to a Facebook user's stream at a later date? -

what common workflow able post user's feed/stream couple of hours/days after they've accepted access permissions on "canvas" app? for instance, if register interest notified when has been released, how post on wall release notification when occurs few days later? specifically , how authentication work? 1 need log keys gathered during original authentication process? when request permissions during authentication must request offline_access permission post users wall when they're not signed in. permission, access token use perform api requests becomes permanent, , can use @ time. further reading: facebook offline access step-by-step

actionscript 3 - How to pass arguments to constructor if object is loaded dynamically with Loader in flash? -

is possible ? if yes how ? otherwise what's alternatives ? by dynamically mean using loader = new loader(); loader.contentloaderinfo.addeventlistener(event.complete, finishloading); loader.load(new urlrequest("myswf.swf")); a swf not class itself, more collection of classes , other things (like images or audio bytes) archived , ready use. can't have constructor swf. however, can do, loading swf , then, after loading complete, can instantiate class swf , pass whatever arguments want it's constructor. also, it's possible send parameters swf , process them flashvars inside swf, that's no constructor of course :) loader.load(new urlrequest("myswf.swf?day=tue&week=3")); and can them this: var paramobj:object = loaderinfo(this.root.loaderinfo).parameters; trace(paramobj.day); trace(paramobj.week);

c# - date on DataGridView not formatting as expected -

Image
i have column uses datetime format set in column styles. when user enters date, it's not formatting style set to. matter of fact, isn't doing field. put gibberish in there , takes it. am missing here? shouldn't @ least format date or give error wrong date format? try handling event on datagridview, getting text input , validating whether it's date or not. used event cellendedit , choose yours like. private void checkcellvalue(object sender, datagridviewcelleventargs e) { //my column index on date 0; modify yours needed! if (e.columnindex == 0 && e.rowindex > -1 && e.rowindex != datagridview1.newrowindex) { //check whether can parsed date. string enteredval = datagridview1.currentcell.value.tostring(); datetime dt; if (datetime.tryparse(enteredval, out dt)) { datagridview1.currentcell.value = dt.tostring("dd-mmm-yyyy"); } else { ...

c# 4.0 - Return filename without extension from full path in C# -

this question has answer here: c# getting file names without extensions 10 answers i'm looking way return filename full path without extension. private static string returnfilenamewithoutextension(string varfullpathtofile) { string filename = new fileinfo(varfullpathtofile).name; string extension = new fileinfo(varfullpathtofile).extension; return filename.replace(extension, ""); } is there more bullet proof solution replacing extension empty string? return path.getfilenamewithoutextension (fullpath);

Small library for generating HTML files in C++ -

is there library allow easier generation of simple website using c++ code. 'website' compiled chm file (which final goal here). ideally, allow generation of pages , allow links generated between pages easily. can hand, going tedious , error prone. i know bigger libraries such wt, more interested in smaller ones little or no dependencies , need installation. you can try ctpp template engine. written in c++ small , quite fast. do need project written in c++? because if need prepare documentation in chm go sphinx . sphinx set of tools written in python generate manuals in few formats (chm, html, latex, pdf) text files (formated using restructuredtext markup language). text files created hand or using application , combined 1 manual using sphinx. in work right using solution write documentation, because easy maintain text files (merging, tracking changes etc.) example html or doc. sphinx used generate python language documentation ( chm ), capable handle large p...

programming languages - Generating strings and executing them as programs during runtime -

this tough question word , i'm not sure proper term (if any). i'm curious languages allow "build up" string during program execution, , execute part of program. language know of allows snobol. reading wikipedia entry tcl however, sounds may able also? i thought nifty feature if may not used much. thanks. ps: tag snobol, spitbol, don't have reputation create new tags. i'm curious languages allow "build up" string during program execution, , execute part of program. look languages support eval , or, more generally, runtime meta-programming . pretty every language supports eval (even strongly, statically typed languages haskell). many runtimes built languages implemented via bytecode interpretation (such lisp-like languages, erlang or java) support ability insert new (byte)code @ runtime. once can insert new code dynamically, can write eval , or "monkey patching". even in language implementations without specific ...

jquery - How to merge cells in jqGrid 4.0 -

Image
i've been trying "merge" cells in jqgrid, is, want make cells specific rows have colspan=2 (or more). far i've been able borders work using cellattr option in column model this: colmodel = { name: "a", width=50, cellattr: function(rowid, tv, rawobject, cm, rdata) { if (rowid < 5) { return 'sytle="border-right:0px"'; } }, name: "b", width=50, cellattr: function(rowid, tv, rawobject, cm, rdata) { if (rowid < 5) { return 'sytle="border-left:0px"'; } } }; this removes border cells want merge (a & b line 5). if add text of these boxes text-align not work , text gets cut off if larger 50 pixels. i crazy thing center-align cutting text in half , add each half column "a" , "b" under right-align , left-align respectively. however, there seems there should better way. i find ques...

syntax error - Javascript not running -

i have code here: var questions=[] questions[0]=["what answer?",["a","b","c","d"],3] questions[1]=["what answer?",["a","b","c","d"],3] questions[2]=["what answer?",["a","b","c","d"],3] questions[3]=["what answer?",["a","b","c","d"],3] function createquestions(id) { var treturn="<form>" treturn=treturn+"<b>questions "+id+":</b>" treturn=treturn+"</form>" return treturn; } (i=0;i<4;i++) { var elem=document.getelementbyid('quiz_section') var func=createquestion(i) elem.innerhtml=elem.innerhtml+func+"<br />" } i started using javascript recently. know there must syntax error in here somewhere can't find it. there is, in fact div in main document id of "qu...

c# - Black layer on top of title bar (minimize/maximize/close) in Win7 -

Image
we have .net 2.0 application using winforms , infragistics 7.2. title bar our application has appears black bar layered on covering minimize, maximize , close buttons. buttons still there (as evidenced hover colouring , tooltips in screen shot) , still work when click in correct location, buttons not visible. this happening on few win7 machines, , may theme related? have other applications using same framework/technology running on same machine, don't have problem. @ 1 point pc had problem in debug build running through vs2010, installed release (same source code) didn't. we've tried exporting themes 1 pc other problem doesn't appear exported it. any suggestions appreciated! had similar problem , solved changing formborderstyle: formborderstyle = system.windows.forms.formborderstyle.fixeddialog; hope helps.

c# - .net "Canvas" control -

i'm trying (for educational purposes) create image format, in order display i'd able setpixel on control draw pixel in display area. how can this? the appropriate class bitmap can draw stright on form via graphics class. here example: private void form1_paint(object sender, painteventargs e) { bitmap bmp = new bitmap(640, 480); bmp.setpixel(10, 12, color.green); e.graphics.drawimage(bmp, new point(0, 0)); }

amazon simpledb - Computing an HMAC-SHA signature -

i'm writing module amazon's simpledb. require rest requests signed using hmac-sha algorithm. ( details here. ) i'm told there function computer signature, can't find in documentation . function called, , arguments like? edited: following should work: pre { message = "four score , 7 years ago"; key = "abe lincoln"; signature = math:hmac_sha256_base64(message, key); } notify("signature is", signature); the function math:hmac_sha256_base64(<datastring>,<keystring>)

android async tasks -

i have application getting data particular day response web-server , plotting o/p graph depending on data(number/time) has come. right invoking web-server async task. i can fling across multiple screens(previous day/next day) invoke web-server multiple times(multiple async tasks) data server. the issue when number of flings(async tasks) increasing application shows anr. is there better way handle these kind of scenarios rather creating async task each , every web-server call(fling). adding portion of code: if(e1.getx() - e2.getx() > swipe_min_distance && math.abs(velocityx) > swipe_threshold_velocity) { valuesdaywithtime=onstart(dateprevious); } public graphview onstart(string date){ urlfinal=createurl(); new downloaddatatask(this).execute(urlfinal); } private class downloaddatatask extends asynctask<string, integer, long> { yieldactivity yactivity; progressbar pbar ; downloaddatatask(yieldactivity act){ ...

recursion - Cannot make sense of my lecturers recursive algorithm for the Towers of Hanoi -

the algorithm follows : algorithm move(k, from, to, spare) if k >0 move(k−1, from, spare, to) printf (”move top disc %d %d\n”, from, to) move(k−1, spare, to, from) k number of disks (http://en.wikipedia.org/wiki/tower_of_hanoi). understand recursion, don't understand how meant work, can make sense of this? sorry being vague in description here, it's understanding of what's happening pretty vague - have no clue printf line doing seems pivotal whole function. the recursive algorithm broken down 3 steps: move discs 1 "spare" peg move last disc destination peg move discs 1 (those step 1) spare peg destination peg thus discs have been moved destination peg. steps 1 , 3 2 recursive move(k-1, ...) calls in pseudocode. step 2 modelled printf . the point here steps 1 , 3 recurse more calls move , , each call move k > 0 prints 1 instruction line prinft . happen algorithm print steps need take move discs in ultimate detail, 1 one. i...

java - Map and Reduce with large datasets = how does it work in practice? -

i thankfull advice: http://en.wikipedia.org/wiki/mapreduce states: "...a large server farm can use mapreduce sort petabyte of data in few hours..." , "...the master node takes input, partitions smaller sub-problems, , distributes worker nodes..." i not understand how work in practice. given have san(storage) 1 petabyte of data. how can distrubute amout of data efficiently through "master" slaves? thats can not understand. given have 10gibt connection san master, , masters slave 1 gbit, can @ maximum "spread" 10gbit @ time. how can process petabytes withing several hours,as first have transfer data "reducer/worker nodes"? thanks much! jens actually, on full-blown map/reduce framework, such hadoop , data storage distributed. hadoop, example, has hdfs distributed file storage system allows both redudancy , high performance. filesystem nodes can used computing nodes, or can dedicated storage nodes, depending on how frame...

php - Easy way of getting unique id -

when insert table, how can unique id of table row without doing query selecting last inserted element. lets this: $query = mysql_query("insert `user_table` set user_email='efwwe', user_pw='fwefwef'; "); now want user_id last insertion. possible php $query variable? or need query select last row user_table? user_id unique id incremented automaticly in case regards, alexander you're looking mysql_insert_id() function. ex: mysql_query("insert mytable (product) values ('kossu')"); printf("last inserted record has id %d\n", mysql_insert_id());

javascript - How "best" to allow a web-page visitor to construct mathematical or statistical tools? -

i have free web site streams real-time stock-options data. want let users make , save own javascript-callable tools interpret options data. users can invoke these custom tools them make own sell/buy decisions options. but totally stopped, stymied, dead-ended, , buffaloed how accomplish this. if there few choices, guess stumble around blindfolded (as now) , hit on 1 kind-of worked. but choices seem endless: let user write javascript tools i'd interpret; mathematica , toolsets; many statistics packages; google spreadsheet api. and overwhelmingly many more. if has struggled through process of giving user facility making statistics , probability tools, how did end up? , way again? plus, feature-creeposis , perfectionitis want me integrate charts, graphs, heat maps, , knows else more; or @ least allow later integration of graphics. graphics nice , sexy: i'd drop , graphics. have resist , something onto page real now . 1 q: can/should allow , encourage eas...

Link to a facebook application from a facebook page does not work? -

i have ready facebook application should linked facebook page. trying link canvas url of application button in page of javascript calling: function onbtnclick() { window.location = "http://apps.facebook.com/canvas_url/"; } when click button supposed take me app empty page blue box , "facebook" string inside (pretty looking facebook logo) this box link application , if clicked takes me http://apps.facebook.com/canvas_url/ the same problem occurs in application, try link facebook page. link there regular <a> tag. do have ideas how redirect app without additional "facebook" page? thanks in advance, martin use instead: top.location.href = "http://apps.facebook.com/canvas_url/"; you need upper frame (facebook) redirect.

Transforming Lisp to C++ -

i working on toy language compiles c++ based on lisp (very small subset of scheme), trying figure out how represent let expression, (let ((var 10) (test 12)) (+ 1 1) var) at first thought execute exprs return last 1 returning kill ability nest let expressions, way go representing let? also, resources on source source transformation appriciated, have googled fing 90 min scheme compiler. one way expand let treat lambda : ((lambda (var test) (+ 1 1) var) 10 12) then, transform function , corresponding call in c++: int lambda_1(int var, int test) { 1 + 1; return var; } lambda_1(10, 12); so in larger context: (display (let ((var 10) (test 12)) (+ 1 1) var)) becomes display(lambda_1(10, 12)); there lot more details, such needing access lexical variables outside let within let . since c++ doesn't have lexically nested functions (unlike pascal, example), require additional implementation.

php - Do I need to use mysql_real_escape_string on all form inputs? -

i know need use them on user input fields such username entry field, radio buttons such gender option? stop! you seem confusing escaping data validation , data sanitization . you need validate data comes in. yes, means making sure radio buttons contain legal values. you need sanitize data comes in. should text field contain html? no? strip_tags . should field number? cast integer. you need escape data place in database . if you're still using prehistoric "mysql" extension, means using mysql_real_escape_string on as build query -- not before. you need escape data echo user . htmlspecialchars friend. i've explained in more detail , though not duplicate question.

iphone - warning: local declaration of 'mapView' hides instance variable -

please, can explain , me how fix warning?? thx in advance. -(void)mapview:(mkmapview *)mapview regionwillchangeanimated:(bool)animated { mapregion=mapview.region; //first warning } -(void)mapview:(mkmapview *)mapview regiondidchangeanimated:(bool)animated { newregion=mapview.region; //second warning if(mapregion.span.latitudedelta>newregion.span.latitudedelta||mapregion.span.longitudedelta>newregion.span.longitudedelta) shouldadjustzoom=no; } you have instance variable name mapview already. you can change local name else. example this: -(void)mapview:(mkmapview *)amapview regionwillchangeanimated:(bool)animated { mapregion=amapview.region; //first warning } -(void)mapview:(mkmapview *)amapview regiondidchangeanimated:(bool)animated { newregion=amapview.region; //second warning if(mapregion.span.latitudedelta>newregion.span.latitudedelta||mapregion.span.longitudedelta>newregion.span.longit...

javascript - How to drop a select list by 'onmouseover'? -

how can drop down select list onmouseover instead of clicking it. select list cannot clicked in javascript emulate that. eg: onmouseover="(this.click())" also setting 'size of select list' = 'its length' in javascript not accurately emulate click event because adjacent layout changes. tried using z-index , position attribute doesn't help. here's clever hack oldish devshed post select box expand onmouseover - dev shed here's example in action: http://jsfiddle.net/87nyg/1 personally i'd prefer 3rd party or custom solution opposed hacking <select> element

Multiple partial views on one main homepage, asp.net mvc -

hi still kinda new asp.net , can do. looking use few typed partial views on 1 main homepage. not sure how repository , irepository. i have done , keep getting error when try load page. <%html.renderpartial("~/views/shared/partial.ascx", model);%> would have use viewdata pass information view?? grateful, along examples. can please regards would have use viewdata pass information view? yes. if don't want pass data through same controller method partial views, consider using renderaction instead of renderpartial . need more controller methods, won't have repeat data binding code in existing controller methods every time use partial view.

java - Specify JAXB Packages in SLSB and JAX-WS -

i creating simple soap web service using slsb , jax-ws annotations. objects pass jaxb generated ogc schemas, ogc project @ java.net. 1 particular method having trouble (which causes deployment fail) situation field (eventtime) of request object (getresult) in different package request object. objectfactory type different , there problem when marshalling/unmarshalling. a subset of errors i'm getting: there's no objectfactory @xmlelementdecl element {http://www.opengis.net/ogc}temporalops. problem related following location: @ protected javax.xml.bind.jaxbelement net.opengis.sos.v_1_0_0.getresult$eventtime.temporalops @ net.opengis.sos.v_1_0_0.getresult$eventtime @ protected java.util.list net.opengis.sos.v_1_0_0.getresult.eventtime @ net.opengis.sos.v_1_0_0.getresult @ public net.opengis.sos.v_1_0_0.getresult net.opengis.sos.v_1_0_0.objectfactory.creategetresult() @ net....

c++ - Sub pixel drawing with opengl -

i drawing lots of small black rectangles white screen , move , zoom doesn't graceful. how can draw them if edge lies between pixels, pixels grey rather black? what asking anti-aliasing ,and there numerous ways of doing it. 1 way summarized in gamedev topic: http://www.gamedev.net/topic/107637-glenablegl_polygon_smooth/ . glenable(gl_blend); glblendfunc(gl_src_alpha, gl_one_minus_src_alpha); glhint(gl_point_smooth, gl_nicest); glhint(gl_line_smooth, gl_nicest); glhint(gl_polygon_smooth, gl_nicest); glenable(gl_point_smooth); glenable(gl_line_smooth); glenable(gl_polygon_smooth);

nosetests, python -

i trying learn python, guide following asking me write simple 'game', utilizing tuples, lists, , classes. when running 'nosetests' command, following error: e. ====================================================================== error: tests.lexicon_tests.test_directions ---------------------------------------------------------------------- traceback (most recent call last): file "/library/python/2.6/site-packages/nose/case.py", line 187, in runtest self.test(*self.arg) file "/users/vb/documents/svn/programming/python/projects/lexicon/tests/lexicon_tests.py", line 6, in test_directions assert_equal(lexicon.scan("north"), [('directions', 'north')]) typeerror: unbound method scan() must called lexicon instance first argument (got str instance instead) ---------------------------------------------------------------------- ran 2 tests in 0.011s failed (errors=1) vb mp > ./lexicon.py > north [()...

php - Regexp all but omit attributes containing data -

for example have text: bla bla 1 2 3 <b> test romans 12:5 </b> okay next line , next text romans 12:5 , text important romans 12:5 <іmg src="/іmg.png" title="romans 12:5" alt="romans 12:5" someattr="romans 12:5" /> <a title="romans 12:5" href="/link.html">romans 12:5</a> i need catch: romans 12:5 but regexp must omit text placed on attributes (alt,title,anyone) , omit text placed in <a> tags too. i have similar regexp catches including atributes containing text: romans(\?| |\.|\. |\.\r\n|\r\n)([0-9]{1,3}):([0-9]{1,3}) btw use php preg_replace regexp , text modifies this: <a href=\"http://site.com/romans/\\7\\3#\\4\" target=\"romans 12:5\">\\1</a> who know modernized way this? thanks in advance! [^">]{1}(romans \d{1,3}:\d{1,3})[^"<]{1} matches 3 instances of romans 12:5 outside attributes , <a> tag. ...

Eclipse - how to start remote debugging without automatically rebuilding -

[using eclipse 3.6 , preferances -> workspace -> build automatically disabled] i have project setup includes number of scripted steps generating autogen code (jaxb, etc). automatically produces , deploys (does not start) jars remote server. unfortunatly whole process can take upwards of 2 minutes. recently i've been remotely debugging 1 project starting on remote server manual script enables remote debugging attaching remote debugging session eclipse. problem if have not made source changes, eclipse performs rebuild when start remote debugging session. annoying. know how start eclipse's remote debugging without automatically performing rebuild? you have figured out, sake of future reference, accomplish this: window > preferences > run/debug > launching. uncheck build(if required) before launching.

revert - SVN: log of the update operations in the working copy -

i have updated live working copy of our repo, , want revert change. problem don't know working revision before update, , there many changes repo, i'm having hard time figure out should revert. is there log of operations done working copy of repo?

php - Why PHPMailer needs an SMTP to send emails and postfix doesn't -

i installed postfix: it's sending email without configuration me. (i choosed no-config setup) can know why phpmailer needs valid smpt or relay send emails while postfix doens't? thanks postfix mail server. phpmailer library interface mail server.

iphone - NSString caused EXC_BAD_ACCESS, string too long? -

when app gets this, receive exc_bad_access nsstring *namedata = nametextfield.text; nsstring *emaildata= emailtextfield.text; nsstring *phonedata = phonetextfield.text; nsstring *servicedata = servicetextview.text; nsstring *post = [nsstring stringwithformat:@"email_address=&contents=&form_identifier=538b7271-df83-41f5-84b0-db0fed518ade&form_type=1&empty_form_msg=please%20fill%20in%20something%20before%20submitting.&1_1_10_40_first%2bname=%@&2_1_20_30_last%2bname=&3_1_25_25_company=&4_1_30_999_email=%@&5_1_40_10_phone=%@&6_1_50_0_address%2b1=&7_1_60_-10_address%2b2=&8_1_70_-20_city=&9_3_80_-30_county=&10_3_90_-40_postcode=&11_2_100_-50_comments=%@&submit=send",namedata,emaildata,phonedata,servicedata]; is because data in string long? i suspect stringwithformat interprets (some of?) % characters format elements, more 4 arguments interpreted. (e.g. %20f take float argument) try replace lit...

Starting a second R script from within a parent script -

i have 5 scripts part of project run 1 after other. open first script, run , prompted @ end, "do want run xrefgenetic.r?" if yes, xrefgenetic.r should open , run. 100% r can this, in fact think used know how have forgotten , cannot find anywhere. how open r script within r script? are thinking of source() ? my usual recommendation create package, alleviates these issues: functions , symbols known (or hidden if chose not export them) , have much better control.

C++ or Java for android? -

i thinking picking android development in free time. see development possible in java , c++ latter limited. i more comfortable c++. so question limitations exist c++ on android? able develop full apps it, or have learn java? pick right tool job. right tool android java, , c++ if it's needed. android runs on several different cpus, , you'd required deal fun stuff compiling platforms can't test on - @ least if want make apps yourself.

file io - FileNotFoundException in android sdcard -

i'm exporting file in sdcard, however, i'm facing filenotfound exception ( 04-12 01:26:18.494: debug/carburant(4568): /mnt/sdcard/carburant/alaa.peugeot.settings.dat/alaa.peugeot.settings.dat (is directory) )here code: try { file sdcard = environment.getexternalstoragedirectory(); boolean mexternalstorageavailable = false; boolean mexternalstoragewriteable = false; string state = environment.getexternalstoragestate(); if (environment.media_mounted.equals(state)) { // can read , write media log.d("carburant", "sdcard can read/write !!"); mexternalstorageavailable = mexternalstoragewriteable = true; try { final sharedpreferences preferences = preferencemanager .getdefaultsharedpreferences(context); string filename = context.getresources().getstring( r.string.filename); string filedir = "" + preferences.getstring("log...

c# - How licenses.licx file is used -

i've got licenses.licx file included 1 of projects properties. not sure how used dlls. used msbuild? have idea how used when solution building? since indicate stellareleven's reply doesn't help, guess you're looking simpler. not 100% correct, understanding of how works: the licx file list of "licensed" components used application. each line in file of following format: [component name], [assembly name] for example 1 of projects uses licensed ip works netdial component .licx file contains following line: nsoftware.ipworks.netdial, nsoftware.ipworks in context of project (.csproj) file, .licx file referenced embeddedresource. during build process, lc.exe verifies machine performing build has appropriate license(s) component in question, , generates binary .licenses file gets embedded resource ([assemblyname].exe.licenses) in final executable. does help?

bash - cat not working a pipe -

revised version of question: cat - | tr "a-z" "a-z" | tr "a-z" "a-z" does not give output when run on bash shell prompt. have press ctrl-d o/p. o/p $ cat - | tr "a-z" "a-z" | tr "a-z" "a-z" test however works fine , output without using ctrl-d..why ? cat - | tr "a-z" "a-z" o/p $ cat - | tr "a-z" "a-z" test test original version of question: cat "$@" | tr "a-z" "a-z" | tr "a-z" "a-z" hangs when run on bash shell prompt. why that? my $@ empty. however works this cat "$@" | tr "a-z" "a-z" what you're seeing due buffering. in cat - | tr a-z a-z | tr a-z a-z (no quotes needed) may not output after hit enter, because middle or third tr may have buffered data internally. @ point, flush buffers , you'll full, correct output. hitting ctr...

php - Query Google storage to get only files in specified path -

first of all: yes, realize there no such thing folders in google storage system. however, google storage has dummy folders suffixed _$folder$ . know can define prefix filter-out results, though, how define depth? in other words, want files/_$folder$s under /foo/bar not children of deeper _$folder$ s. possible query? php version of rather messy.

php - Logged out sidebar weirdness -

when i'm logged in site, viewing individual post, right sidebar displays perfectly, when log out on same page (via sidebar widget), right sidebar ends below comments. happens i'm viewing individual posts. ideas causing this? i've double checked css, , far can tell being logged out doesn't add or change class attributes. - theme i'm working doesn't have posts.php file... post: http://www.wespeakfashion.com/cool-sunglasses page.php... <?php include (templatepath . '/header.php'); ?> <div id="content"> <?php include(templatepath."/l_sidebar.php");?> <div id="contentleft"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php the_content(__('read more'));?><div style="clear:both;"></div> <!-- <?php trackback_rdf(); ?> --> <?php endwhile; else: ?> <p><?php _e('sorry, no ...

javascript - CSS:hover for touchscreen reverse engineering -

i've found this site has sub-menu works fine on iphone/pad , i’m curious how made li:hover ul{ work touch screen? i've looked through entire html, css, js , nothing stands out if cluey can have peak i’d interested in find. i had same problem school website (www.harveygs.kent.sch.uk) servicepoint site gave me answer - add "<a href='#'>(your menu header)</a>" after first <ul> in menus.

c# - How to map class to database table? -

i'm have classes , need make data tables follow class 1 public class eventtype { public string id { get; private set; } public int severity { get; set; } public eventtypetemplate template { get; set; } public idictionary<string, string> params { get; set; } public eventtype(string id) { id = id; params = new dictionary<string, string>(); } } and second class public class eventtypetemplate { public string id { get; private set; } public int severity { get; set; } public string title { get; set; } public string description { get; set; } public ilist<string> categories { get; private set; } public ilist<string> queries { get; private set; } public eventtypetemplate(string id) { id = id;categories = new list<string>(); queries = new list<string>(); } } for class 1(eventtype) create...

html - one of the pages doesnt inherit the css form the base -

hey, using django template. below snippet base html file, invoked css link <link rel="stylesheet" type="text/css" href="static/css/layout.css"/> but weirdest thing happened. {% extends "layout.html" %} all html pages inherit base html file, there 1 page doesnt inherit css style while others work perfectly. think of possible answer? thank in advance. don't hard code css paths, if using django 1.3 staticfiles app, set following in settings.py : static_url = '/static/' in template: <link rel="stylesheet" type="text/css" href="{{ static_url }}css/layout.css"/> i'm assuming css/layout.css present in static folder of 1 of app.

user interface - UI Layout problem/algorithm -

i trying solve problem need fit set of rectangles(views) in bigger rectangle(window frame). each view has minimum size , maximum size. there general algorithm solve kind of problems. current code not elegant although works of situations, times situations have empty rects(unoccupied regions) or overlapped rects (views overlapped). sure has solved problem, cannot find yet. thanks, -abhinay. often used recursive subdivision, alternating horizontal , vertical directions. eg how eclipse ide works. assumed views or windows can grow arbitrarily large, padded if there not enough content.

How to read source code using git? -

i downloaded source code github. want read program though out initial commits last 1 step step. possible read ver.1 first read ver.2 , on.. using git ? you can use git log list of commits. if want read complete code @ each revision can pass hash git checkout checkout revision , poke around; if want see changes can use git show . recommend using client latter case though, tig , let step through each commit , see changes: screenshot of tig http://mrozekma.com/tig.png

image processing - A php file as img src -

i want print image using img tag src php file, script process action @ server scirpt. have example code? here test code no effect img.html <img src="visitimg.php" /> visitimg.php <? header('content-type: image/jpeg'); echo "<img src=\"btn_search_eng.jpg\" />"; ?> use readfile : <?php header('content-type: image/jpeg'); readfile('btn_search_eng.jpg'); ?>

html - Why does the <a> tag sit BELOW an <img> on screen (Firefox 4 + Chrome only!) -

Image
i'm not sure if glitch/quirk in latest firefox , chrome, i've got <img> tag that's been encapsulated <a> tag turn image link. the problem arises in click box link sits below image. image clickable, dead space under image clickable well. the <img> has left , bottom margin rule applied it, think what's causing issue, don't understand why... i've tried using explicit </img> closing tags didn't solve issue either. internet explore 8 works expected! not display issue below. shows box below image, dead space not clickable in ie 8. how think should work. here's image clarify mean: i've added rule border <a> tags. and here's code... <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content...

c - how to find a path to go home - algorithm -

Image
valid xhtml http://img2.blogcu.com/images/e/t/k/etkinlik4/clip_image001.jpg assume there rabbit , @ position (1,1). moreover, home @ position (7,7). how can reach position ? home positon not fix place. real question, trying solve problem on book exersizing c. what algorithm should apply find solution? should use linked list store data? data (1,1), (1,2),..., (3,3) ..., (7,7) place marked black shows wall. use a* . classic go-to algorithm path-finding (that article lists many other algorithms can consider too). by using a* learn algorithm might need in normal programming career later ;) an example evaluation of maze similar in question using a*:

java - Exception while starting Weblogic Managed Server -

i tried start weblogic managed server , i'm getting exception below: apr 11, 2011 10:08:16 pm pdt> <error> <oracle.bam.adc.dse.common.datasourcefactory> <bea-000000> <[12] exception occurred in method datasourcefactory.getdatasource(jdbc/oracle/bam/adc) exception: javax.naming.namenotfoundexception: while trying lookup 'jdbc.oracle.bam/adc' didn't find subcontext 'oracle'. resolved 'jdbc'; remaining name 'oracle/bam/adc' @ weblogic.jndi.internal.basicnamingnode.newnamenotfoundexception(basicnamingnode.java:1139) @ weblogic.jndi.internal.basicnamingnode.lookuphere(basicnamingnode.java:247) @ weblogic.jndi.internal.servernamingnode.lookuphere(servernamingnode.java:182) @ weblogic.jndi.internal.basicnamingnode.lookup(basicnamingnode.java:206) @ weblogic.jndi.internal.basicnamingnode.lookup(basicnamingnode.java:214) @ weblogic.jndi.internal.wleventcontextimpl.lookup(wleventcontextimpl.java:254) @ weblogic.j...