Posts

Showing posts from July, 2013

linux - Makefile Anomaly: Invoke `make` and it appears to be running another makefile -

i have following makefile: objdirs = runtime/core/common runtime/core/graphic/symbolxlib runtime/core/map runtime/core/symboldictionary \ runtime/coreclient/runtimecorejava objs = $(wildcard $(objdirs:=/*.o)) targeta = libruntimecorejava.a targetd = libruntimecorejava.so targetd1 = $(targetd).1 targetd2 = $(targetd).1.0 targetd3 = $(targetd).1.0.0 ar = ar cqs link = g++ symlink = ln -f -s ldflags = -shared -wl,-soname,libruntimecorejava.so.1 : $(targetd) $(targeta) $(targetd) : $(objs) echo "building dynamic lib using "$(objs) #$(cxx) $(ldflags) $(objs) #$(symlink) $(targetd) $(targetd1) #$(symlink) $(targetd) $(targetd2) #$(symlink) $(targetd) $(targetd3) $(targeta) : $(objs) echo "building static lib using "$(objs) #$(ar) $(targeta) $(objs) when run make @ same level makefile appears call makefile unrelated one. i

php - Cannot find a full php5.ini example file -

i trying change php configuration settings on webserver , need set values in php5.ini file. have been told need "full" php5.ini file. take mean needs have settings in there , not ones want change. cannot find example of "full" 1 anywhere. have been looking through google no avail. can point me in correct direction? thanks can view recent php.ini @ location http://svn.php.net/viewvc/php/php-src/trunk/php.ini-production?view=co or you can view http://svn.php.net/viewvc/php/php-src/trunk/ scroll down until find php.ini file. there two, 1 meant development , other production choose 1 want. there can older versions of .ini file. or you may want download .ini specific version first going here http://svn.php.net/viewvc/php/php-src/branches/ because latest may not work version. view version echo phpinfo() on site. click version of php using find .ini edit: update links svn github seeing got downvoted broken links after on year. i

html - How can I trigger javascript function once I load the webpage (Not using form and submit button) -

for example, want html page can able call javascript function automatically once loaded or refreshed. don't want trigger function using form , submit button. how can so? , coding? many thanks. [edited] okay working right now. many guys , have 1 more question. using servlet print out html tag make html page. using servlet since want load data mysql database , pass parameter javascript carry out calucation. last question how can control time of calling javascript? want call read database first , triggering javascript function (at same time passing data read parameter) .how can that? answer! javascript call function after page load <body onload="myfunc() ;"> or <script> window.onload=myfunc ; </script> refer http://www.mkyong.com/javascript/javascript-call-funtion-after-page-load/

URL Regular Expression with Perl -

i need normalise url before store in database using perl regular expressions. here example urls: http://www.codeme.com:80/foo/../index.php http://www.codeme.com:123/../foo//bar.html however, whenever try below code, instead of removing // after foo in foo// , remove double slash in http:// . need keep // in http:// , don’t need forward // after foo// . need rid of /../ or /./ can appear in url. basically, this: "http://www.codeme.com:123/../foo//bar.html" should become this: "http://www.codeme.com/foo/" i new perl ignored , thought never need life has proven me wrong. therefore appreciate if can lead me right track. sub main { $line; open(fh, "test.txt"); until(($line = <fh>) =~ /9/) { $line =~ tr/a-z/a-z/; $line =~ s|//|/| ; $line =~ s|\:\d\d\d|| ; $line =~ s|:80||; print $line; } close fh; } use

c - SO_KEEPALIVE and poll -

hello try use following code, seems not working, on connected socket (sock) do: struct pollfd input_fd; int a=1; setsockopt(sock,sol_socket,so_keepalive,&a,sizeof(a)); a=1; setsockopt(sock,sol_tcp,tcp_keepidle,&a,sizeof(a)); a=1; setsockopt(sock,sol_tcp,tcp_keepintvl,&a,sizeof(a)); a=1; setsockopt(sock,sol_tcp,tcp_keepcnt,&a,sizeof(a)); input_fd.fd = sock; input_fd.events = pollin | pollout; input_fd.revents = 0; int p=poll(&input_fd, 1,-1); i pull lan plug remote computer, nothing happens. kernel seems sleeping in poll syscall. desired behaviour, or defect? set nfds: int p=poll(&input_fd, sock+1 ,-1); also, i'm not sure of allowed range of settings, it's worth check return value of setsockopt .

javascript - Simple AJAX: how to swap out a div that contains a form? -

please refer below jsfiddle code snippet: http://jsfiddle.net/jlxs5/3/ when user clicks "here", want swap out div contains signup form div contains login form (currently login form display:none) quick fade. how go doing this? i'm total novice @ ajax, , i'm having trouble making headway in replacing div here. thanks! ringo to people suggesting jquery just show/hide 2 elements... seriously? . however , since op wants elements fade in , out, , jquery has these functions built-in ( fadein() , fadeout() ), useful. can done pretty plain old javascript. mentioned, ajax not needed @ all. here jsfiddle includes fade.

C# Guitar Hero Clone, Note Animation Timing -

i creating guitar hero clone using c# , having trouble syncing animations , sound. a rundown of now: a read file , note highway, note time , not length (this done correctly) the notes put array before song starts, generate storyboard, read in entire array of notes, , create doubleanimations make rectangle objects (notes) scroll down screen. i set begintime on animation 1 second before expected play time (the duration spent approaching end) , , animation duration 1 second. however, expect happen (the notes playing in sync) inst happening. here code creating animation: private void startnote(midinoteevent evnt) { const double length = 0; int[] highwayarray = evnt.highway; (int = 1; <= highwayarray.length; i++ ) { var highway = highwayarray[i-1]; if (highway > 0) { string name = evnt.time.tostring() + "|" + highway.tostring(); var rect = new rectangle

ios - Xcode continues to pull outdated PhoneGap -

first, issue. have built ios mobile app client in xcode using phonegap. on machine, app compiles fine. when sent app , assets client him compile on machine, throw error , not load phonegap header file. dug around , turned out header file (pgplugin.h) literally not in installation of phonegap. zipped phonegaplib directory , replaced phonegaplib files mine. yet, when tried run, did not discover header file. part of debugging process (i'm rookie on macs , xcode, basic), rename phonegaplib directory phonegaplibold ensure when did that, xcode not find needed, verifying indeed pulling source files each time compiled. not case! when rename phonegaplib directory, compiles if nothing has changed. cleaning project, cleaning build folder, , clearing simulator data not change things. how can xcode refresh phonegap can discover files sent client? or ask question differently, why when rename phonegaplib directory, xcode compiles fine if nothing has changed? does have

Chrome extension wont inject javascript for Twitter -

my chrome extension wont inject javascript when viewing twitter. my json this "content_scripts": [ { "matches": ["https://www.twitter.com/*"], "run_at": "document_end", "js": ["jsfunc.js"] } ], and js simple alert("it works"); if change matches http://www.google.com/* works when open google.com, see alert. but when set matches https://www.twitter.com/* , open twitter, never see alert... why work google , not twitter? way fix it? twitter redirects https://www.twitter.com/ https://twitter.com/ .

javascript framework - value is undefined in emberjs nested view -

i have script handlebar.. <script id="owneritem" data-template-name='owneritem' type="text/x-handlebars"> {{value.username}} &nbsp;<button {{action "remove" on="click"}}>remove</button> </script> and view.. resadmin.ownerview = ember.view.extend({ templatename: 'owneritem', remove: function() { var selectedrest; selectedrest = resadmin.admincontroller.get('selectedrestaurant'); alert(value.restaurantownerid); return $.ajax({ url: '/api/restaurantowner/' + value.restaurantownerid, cache: false, type: 'delete', data: { restaurantid: selectedrest.restaurantid, methodoverride: 'delete' }, datatype: 'jsonp', success: function(data) { return resadmin.admincontroller.getrestaurantlist(); } }); } }); and in other view

sql - MySQL comparison with null value -

i have column called code in mysql table can null. have rows code='c' want ignore in select result set. can have either code=null or code!='c' in result set. the following query not return row code null: select * table code!='c' but query works expected , know right way it. select * table code null or code!='c' my question why having code!='c' not return rows code=null? 'c' not null. comparing no value character here. can throw light why doesn't work way? in mysql, null considered 'missing, unknown value', opposed no value. take at mysql reference on null . any arithmetic comparison null not return true or false, returns null instead., so, null != 'c' returns null , opposed returning true. any arithmetic comparison 'null' return false. check in sql: select if(null=123,'true','false') to check null values need use is null & is not null operator.

javascript - Where should I put the Collection instance in Backbone.js? -

is best place in global object or within view instance? (i'm thinking if place on global such as: window.todos = new todos() , pollute global object if there lot of collections; however, putting inside view may make things bit confusing) based on experience, best way place it? i think depends on application. have done establish namespace application, , put collections there, views: // namespace application var app = {}; // collection classes within namespace app.todos = backbone.collection.extend({ ... }); // , collection instances in namespace singletons app.todos = new app.todos(); for large application, might go further, establishing sub-namespaces model classes, view classes, router classes, , application instances. there few advantages this, though none of them crucial: having collections available in app namespace allows them referenced multiple views if necessary when debugging, have access collections in console establishing new namespace applic

Perl to Python regex help needed -

i new python regex, , did not find enough info how in python perl: my $a="some pattern"; $b="some other pattern"; $str =~ s/\s*$a\s+\-\-\>\s+$b/ $b/; $a , $b change, , specific strings need substituted. idea how in python? import re = "some pattern" b = "some other pattern" # create regular expression. '-' , '>' don't need escaping pattern = re.compile(r'\s*' + + '\s+-->\s+' + b) # 'str' poor variable name in python; hides built-in result = pattern.sub(' ' + b, result) although don't know how fail find enough information, assuming understand how regexes work. did read documentation? there no equivalent perl's /o flag; if want compile regular expression once , re-use it, then... that; play scope of pattern re.compile line run once.

java - Why is my ArrayList length 0 in my mouseClicked() function? -

in processing program, added object global arraylist called items in draw function. here class. class obj { string name; obj(string name) { self.name = name; } } here draw function. void draw () { items.add(new obj("bob")); } i tried printing size of items in mouseclicked() function console, keep getting 0. void mouseclicked () { print(items.size()); } why? the arraylist declared @ top of file after class: arraylist<obj> items = new arraylist<obj>(); there couple of things aren't quite there yet: self.name = name; should this.name = name; you're creating tons of objects (based on framerate), checking size of array in mousecliked() (also might want use println() instead). try this: arraylist<obj> items = new arraylist<obj>(); void setup(){ } void draw () { } void mouseclicked () { items.add(new obj("bob")); println("items size: " + items.size());

parsing - python email get values for multiple headers of the same name -

i'm using python's email.message_from_string parse raw email message. however, message has multiple "recieved" headers in it. when call message.keys() several recieved headers. when try message.get("recieved") "" null string. how values of instances of header? get_all(name[, failobj]) return list of values field named name. if there no such named headers in message, failobj returned (defaults none). source: http://docs.python.org/library/email.message.html#email.message.message.get_all

java - Declaring a global variable to use in all activities -

i creating custom class in main application class. lets mainaccount . now, creating many activities. want mainaccount variable in every activity, how can that? 1 way put in intent , pass each activity. there better way, making global etc? best regards have thought using preferences? great resource more info is. http://mobile.tutsplus.com/tutorials/android/android-application-preferences/ or can create class extends application demostrated http://www.helloandroid.com/category/topics-covered/global-variables

html - jQuery bind event does not work at all -

i did make happen, without success. the problem create element on runtime bind function element following code: $(document).ready(function() { $('.rem').click(function() { $("body").append('<a id="runtime" href="javascript:void(0);">runtime</a>'); }); $('#runtime').bind('click', func_name()); }); //end of doc function func_name() { alert('i got it!'); } in html code have label below: <div id="body"> <label class="rem">click me</label> </div> my second attempt $(document).ready(function() { $('.rem').click(function() { $("body").append('<a id="runtime" href="javascript:void(0);">runtime</a>'); }); $('#runtime').bind('click',function() { alert($(this).text()); }); }); //end of doc html code: <div id="body"> <labe

MySQL Insert Incorrect CRC32 hash -

i have mysql table products , has url , url_crc fields. have incorrect crc32 calculating @ time of insert. insert products (url, url_crc) values ('http://www.zappos.com/product/7859366/color/106', crc32('http://www.zappos.com/product/7859366/color/106')) result is: http://www.zappos.com/product/7859366/color/106 , 2147483647 but when this: select crc32('http://www.zappos.com/product/7859366/color/106') result is: 2838206275 why happen ? 2838206275 != 2147483647 . triggers didn't help. result same. the maximum value of 32 bit signed integer 2^31-1. 2838206275 greater that. (2147483647 conveniently 2^31-1). in other words, use larger data type (bigint).

c++ - Issue regarding practical approach on machine learning/computer vision fields -

i passionate machine learning,data mining , computer vision fields , thinking @ taking things little bit further. i thinking @ buying lego mindstorms nxt 2.0 robot trying experiment machine learning/computer vision , robotics algorithms in order try understand better several existing concepts. would encourage me doing so? recommend other alternative practical approach in understanding these fields acceptably expensive like(nearly 200 - 250 pounds) ? there mini robots can buy , experiment stuff with? if interests machine learning, data mining , computer vision i'd lego mindstorms not best option you. not unless interested in robotics/electronics. do interesting machine learning need computer , problem solve. think ai-contest or mlcomp or similar. do interesting data mining need computer, lot of data , question answer. if have internet connection amount of data can @ limited bandwidth. think netflix prize , try hand @ collecting , interpreting data wherever. if

magento - Overwrite CompareController -

i try override core comparecontroller. somehow don't done. have done research on magento website: http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/how_to_overload_a_controller but did not override controller. local/wp/compare/etc/config.xml <?xml version="1.0"?> <config> <modules> <wp_compare> <version>0.1.0</version> </wp_compare> </modules> <global> <rewrite> <wp_compare_catalog_product_compare> <from><![cdata[#^/catalog/product/compare/#]]></from> <to>/compare/catalog/product/compare/</to> </wp_compare_catalog_product_compare> </rewrite> </global> </config> local/wp/catalog/controllers/product/comparecontroller.php <?php require_once "mage/catalog/controllers/product

ruby on rails - Rhostudio path Eclipse Mac Lion 10.7.3 -

i have problem rhostudio, mac os x 10.7.3 lion , ecplise. rhostudio install app plugin not work. if create project blank. in preferences tells me can not find path of rhodes. on mac development in ruby on rails aptana studio 3. works , use ruby 1.9.3 , rvm. the gems installed correctly. what problem? can do? i had same issue on mac os x lion 10.7.3; project blank because rhostudio not installed, installation seems had gone through failed. i followed instructions here http://docs.rhomobile.com/rhostudio.tutorial#installing-rhostudio when ran install gems script, 'please install building tools' message coming out on terminal. script fails because looks developer folder , not find it, can still run rhostudio, doesn’t work properly. there several things do, installing version of xcode create developer folder, don’t need that. this did: 1. cleaned previous installations of rhostudio. i installed latest xcode, latest version of xcode not create developer fo

java - Store Previous SelectedValue from selectOneListbox -

i need quite simple solution implement this. i need store value selected in jsf selectonelistbox drop down , need preserve value in bean. everytime when user selects new value, 1 value should checking new value in drop down. how best this using session? java solutions preserve previous selected value? i tried valuechangeevent oldvalue not working because scope request , that's why looking alternate methods. my jsf version 1.1 well, can try this: <h:form> <h:inputhidden id="oldvalue" value="#{mrbean.oldvalue}" /> <h:selectonelistbox id="newvalue" value="#{mrbean.newvalue}"> ... <h:selectonelistbox> <h:commandbutton actionlistener="#{mrbean.dosomething}" value="submit" /> </h:form> then can access old value way: @requestscoped @managedbean public class mrbean { private string oldvalue; private string newvalue; public void dose

c# - How to recuperate the image of this rss feed ? -

i'm developing wp7 app, it's simple rss reader. i'm able recuperate date, title , description... but when try recuperate image rss feed , catch nullreferenceexception... here wrong line : itemrss.image = new uri(item.element("enclosure").attribute("url").value); so, what's instruction recuperate image please ? in advance there no "enclosure" element in feed. when image, 1 contained in text? if so, use "content" element retrieve html , use the regex have given in answer . var reg = new regex("src=(?:\"|\')?(?<imgsrc>[^>]*[^/].(?:jpg|bmp|gif|png))(?:\"|\')?"); var match=reg.match(source); if(match.success) { var encod = match.groups["imgsrc"].value; }

iOS record audio error -

i developing ios app recording video , audio. implemented recording audio. first record video camera, if recording audio, can't record audio. used follow code. audioqueuegetproperty(mqueue, kaudioqueueproperty_streamdescription, &mrecordformat, &size); here got error(couldn't input channel). after started app , record audio immediately, recording audio successed. recorded video camera, recording audio failed. couldn't reason. please let me know reason. in advance. maybe can provide more code in right format. or post solution if got any. did try solve problem av foundation framework ? can access video , audio stream , put them together.

java - Xstream no-args constructor error -

i'm getting following error when tries create instance of 'transacao' `error: cannot construct br.com.cbmp.ecommerce.resposta.transacao not have no-args constructor : cannot construct br.com.cbmp.ecommerce.resposta.transacao not have no-args constructor ` ---- debugging information ---- message : cannot construct br.com.cbmp.ecommerce.resposta.transacao not have no-args constructor cause-exception : com.thoughtworks.xstream.converters.reflection.objectaccessexception cause-message : cannot construct br.com.cbmp.ecommerce.resposta.transacao not have no-args constructor ` class : br.com.cbmp.ecommerce.resposta.transacao required-type : br.com.cbmp.ecommerce.resposta.transacao path : /transacao i aware there's bug xstream 1.3.1 , jdk7, i'm using xstream 1.3.1 , jdk6 . ideas why error still happening? thanks 3 solutions: provide no-args constructor (obvious) make object implement serializable. upgrade xstream 1.4.4* i use solution #

Git rebase (Merge Squash) my feature branch onto another branch -

i'm looking git command me feature branches when they're ready go master. git command squash changes on branch single commit on top of master. today with: git rebase origin/master git rebase -i head~4 where 4 number of commits squash. however, requires me know how many commits have. today running: git log head...origin/master and counting commits. i feel though there should better way this. or how else it, too? all have is: git checkout feature_branch git rebase master git checkout master git merge --squash feature_branch as docs git merge --squash say: produce working tree , index state if real merge happened (except merge information), not make commit or move head, nor record $git_dir/merge_head cause next git commit command create merge commit. allows create single commit on top of current branch effect same merging branch (or more in case of octopus). after that, can git commit changes staged.

asp.net mvc 3 - How to build a complex View Model -

i wondering if me building of view model... i have 3 parent models, users, profiles, , projects on view, pass model has user's information, profile information, , projects information... so far view model looks this... using system; using system.collections.generic; using system.linq; using system.web; namespace prodevportmvc3.viewmodels { public class portfolioviewmodel { public int profileid { get; set; } public int userid { get; set; } public string profilefirstname { get; set; } public string profilelastname { get; set; } public string profileemail { get; set; } public nullable<long> profilecontactno { get; set; } public string profilecity { get; set; } public string profilestate { get; set; } public string profilecountry { get; set; } public string profilephotopath { get; set; } public string profilephotoname { get; set; } public string profilebio { get; s

c# - How to pass a func<> in linq to sql with a join -

i have following issue. i want pass func parameter can vary in statement. private ienumerable<user> getuser(int cant, func<user, bool> userfilter, func<client, bool> clientfilter) { return (from dcu in _db.all<user>().where(userfilter) join c in _db.all<client>() on dcu.idclient equals c.idclient temp cli in temp.defaultifempty().where(clientfilter) select new {usuer = dcu, client = cli}). take(cant).select(uc => _usersmapper.map(uc.user, uc.client)).asenumerable(); } and func should this public void getusers () { getuser(50, u => u.email.contains("onemail@mail.com"), c=> true); } public void getusersfilterbyclient () { getuser(50, u => true, c=> c.password.contains("mypasssword")); } you need lambda where filter function: private ienumerable<user> getus

mongodb - Efficient way to store and query tree-like hierarchical data -

please see image here: https://picasaweb.google.com/108987384888529766314/cs3217project#5717590602842112850 so, can see image, trying store hierarchical data database. 1 publisher has may articles, 1 article has many comments , on. thus, if use relational database sql server, have publisher table, articles table , comments table. comments table grow , become large. thus, there alternative allows me store , query such tree data efficiently? how nosql (mongodb)? you can use adjacent lists hierarchical data. it's efficient , easy implement. works mysql. here link: http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/ .

Using Powershell to enter results in a specific cell of a CSV -

i have csv file , last column (column j) has usernames in it. have script run down column j , display state pulling info active directory. want add information column k beside current username. below script. works fine information can’t add column k. placed count function (the line says $add1 = $add1 +1) hope find solution let me pipe results csv file in column k row $add1. assume there way cant figure out. thanks enter code here import-module activedirectory $add1 = 1 import-csv c:\temp\newfile.csv | select -expand muid | foreach { $add1 = $add1 +1 get-aduser -identity $_ -properties st | select -expandproperty st } you can this: import-csv c:\temp\newfile.csv | %{ $k = get-aduser -identity $_.muid -properties st | select -expandproperty st $_ | add-member -membertype noteproperty -name k -value $k $_ } | export-csv -notypeinformation c:\temp\newfile2.csv if csv had column k, have assign result want $_.k

c# - Unable to cast object of type 'WhereListIterator`1[Web.Model.Appointment]' to type 'Web.Model.Appointment' -

this code fragment controller [httppost] public actionresult cancel(string id,formcollection collection) { //this how declare appt cannot seem correctly pass id method //var appt = application.session.getobjectfromoid<appointment>(new objectid(id)); //i trying way instead error var appt = (appointment)application.appointments.where(a=>a.id.equals(collection["id"])); ..... } this error get:unable cast object of type 'wherelistiterator`1[web.model.appointment]' type 'web.model.appointment'. this view: <input type="button" value="save" onclick="updatecancel(); return false;" /><button>save</button> and function function updatecancel() { $('#cancel').ajaxsubmit({ }); } so why getting error? or there way pass model.data.id function can use id instead? the where-clause returns iterator. select want use instead. i.e., if expect 1 result, can use f

jQuery UI Endless Loop when referencing a slider that doesn't exist -

if page hangs: var foo = $("#mysliderthatdoesntexist").slider("value"); so may wonder why reference slider doesn't exist? it's called function that's run on page load , when changes on page (server side generates slider on page load). i wouldn't have thought cause whole page freeze , consume ram on pc. a bug perhaps? latest stable jquery & jquery ui you shouldn't have guess workaround be: var $mysliderthatdoesntexist = $("#mysliderthatdoesntexist"); var foo = ($mysliderthatdoesntexist.length >= 1) ? $mysliderthatdoesntexist.slider("value") : 0;

vb.net - WebBrowser control and cookies -

i have problem webbrowser control , cookies. first of happens when 1 navigates in normal web browser (ie9 in case): 1.1. open web page http://www.gmail.com . i enter username / password, leave checkbox " stay signed in " unchecked , click " sign in ", ie9 opens gmail page mails listed. ok. 1.2. @ top of gmail page there lot of links "calendar", "documents", etc. when click "documents" link, documents page opened in separate tab in ie9. no additional login information name / psw asked. fine too. now, happens when repeat in webbrowser control (i have created simple vb.net application single webbrowser control in it). 2.1. in form load event following code executed: private sub myform_load(sender system.object, e system.eventargs)     me.mywebbrowser.navigate("http://www.gmail.com") end sub 2.2. enter gmail login information (name , psw) in webbrowser control, 2.3. when click "documents" li

c# - Mature compilers based on ANTLR v3 -

are there mature (and open-source, since want read code) language implementations based on antlr? don't want read code dsl, or language targets c/c++ output. i'm after project either targets assembler or bytecode featured general purpose programming language (of paradigm). btw: if used d target, perfect! it may not suit exact needs, nhibernate uses antlr hql parsing. open source, , mature.

how to push more data into the array after finishing the loop in php? -

im trying here php, want after loop finishes looping data array add more data array , again start looping. i.e. foreach($arraydata->data $item) { echo $item->id; } //add more data $arraydata //and foreach loop again i dont if impossible thought let me give try , ask, thank. ps. not code on page, tried make simple fro eyes :)) i guess can either of following use array_push($arraydata->data, "val1", "val2"); or use simple array assignment like $arraydata->data["another key"] = "another value"; i assuming $arraydata->data array by of thing $item object too. replace string values objects

c++ - GetWindowLongPtr sets Error to "Class already Exists" -

in windows api wrapper, can choose have message box come when there's error. have 1 can't pin down though. here's main function: int main() { window win; //create default window default class (name changes each new instance) return messageloop(); //the familiar getmessage() while loop, returns msg.wparam } this works fine, when close window (just tested via x button), following message (this when copy message box): --------------------------- error --------------------------- file: "g:\programming\v2\wwbasewindow.h" function: _fakewndproc line: 61 error code: 1410 error: class exists. --------------------------- ok --------------------------- now it's crystal clear error coming from, not why. here's _fakewndproc function. whole wrap (function, args) syntax checks getlasterror() after function called. why don't see error checking. lresult callback basewindow::_fakewndproc (msgfillparams) //trick procedure (taken someone&

session - PHP use $_ENV instead of $_SESSION -

is danger in using $_env hold global script variables rather using $_session? understand difference between 2 superglobals not sure of impact of using $_env on $_session? $_session provide more security? they 2 complete different thing. $_session : associative array containing session variables available current script. $_env : associative array of variables passed current script via environment method.

runtime - Ada generics at run-time -

how instantiate generic @ runtime instead of @ compile time. example without using new. you cannot without use of new . can in declarative section, generic extant duration of scope of declaritive section. for example (not compiled ada-like pseudocode): get(length) declare package stack new stack_generic (max_stack_size => length); begin stack.push(); ... end; -- stack package no longer in scope. does ?

java - Hashing password using salt -

i producing hashed value of password salt.my code: `string psw="hello"; string tobehashed=""; tobehashed=salt+psw; messagedigest md = messagedigest.getinstance("sha-256"); byte[] digest = md.digest(tobehashed.getbytes()); system.out.println("digest:"+digest);` i have produced salt providing seed current time in milliseconds,i have no issues salt(i m getting random values) irrespective of salt getting same hash value.. actually purpose of salt different hash values.. output; random nubr:-2098016229(this keeps changing) digest:[b@ca0b6(this remains same) waht solution?? you printing out result of digest.tostring() , in case of byte array not convert bytes meaningful output. prints [b (which code byte array), @ , , hex address. see output more experience java. you need use loop iterate through bytes in digest , print them individually.

iis 7 - Cannot connect to SystemDSN ODBC datasource IIS 7 -

i have configured odbc datasource system dsn. works fine , visual studio. when try start applicattion under iis 7 on connection error: error [08001] [microsoft][sql server native client 10.0]named pipes provider: not open connection sql server [5]. error [hyt00] [microsoft][sql server native client 10.0]login timeout expired error [08001] [microsoft][sql server native client 10.0]a network-related or instance-specific error has occurred while establishing connection sql server. server not found or not accessible. check if instance name correct , if sql server configured allow remote connections. more information see sql server books online. iis application runs different user - user has no access premonitions somewhere odbc uses. i changed applicationpool identity ran administrator - solved problem. fast solution. @ least dirrection dig. :)

jquery - datepicker and Internet Explorer -

i have problem use of datepicker in internet explorer. in other browsers there isn't problem, ie. the code use this: <script type="text/javascript"> ( function($) { $(document).ready( function() { $("#slider").easyslider({ auto: true, continuous: true }); $( ".tcal" ).datepicker({ changemonth: true, changeyear: true, showon: "both", mindate: '-122y', maxdate:'0', yearrange: "-122", buttonimage: "/images/kalender3.gif", buttonimageonly: true }); $( ".tver" ).datepicker({ changemonth: true, showon: "both", buttonimage: "/images/kalender3.gif", buttonimageonly:

asp.net - how to use Group By in RDLC Report ( Group data by Date )? -

i have report shows monthly attendace of employee.. each day has 2 or more 2 entries employee , 1 when signin , other when leaves have use group days this, note: inout 1 = timein inout 2 = timeout tid attendancedate empid inout 01 nov 2010 37219 2010-11-01 09:01:00.000 0000000001 1 37109 2010-11-01 18:02:00.000 0000000001 2 02 nov 2010 37219 2010-11-01 09:01:00.000 0000000001 1 37219 2010-11-01 09:16:00.000 0000000001 1 37109 2010-11-01 18:02:00.000 0000000001 2 i have use =fields!attendancedate.value in parent group , included group header the problem report showing 1 record in each group.. please tell me how can this? when group date, including ti

objective c - How to print an address in Xcode without a warning -

the code below works ok, address printed, gives 'wrong type' warning. i'm quite new xcode, , expected uncomplaining conversion of pointer unsigned. {nslog(@"released <%@> @ %x, retain count %lu", newentry, newentry, [newentry retaincount]);} correct format specifier pointer address %p: nslog(@"released <%@> @ %p, retain count %lu", newentry, newentry, [newentry retaincount]);

ios - CoreData detecting deleted entity after save -

this question has answer here: how can tell whether `nsmanagedobject` has been deleted? 6 answers if delete cd entity , save mod [self.moc deleteobject:(nsmanagedobject *)somecdentity]; [self savemoc]; the pointers cd entity become faults by trying accessing fault or ask isdeleted, 'coredata not fulfill fault the problem is, save mod, isdeleted doesn't work more so how can detect if entity removed? because asking isfault, doesn't indicate deleted... , cannot use isdeleted i found in osx oriented thread how can tell whether `nsmanagedobject` has been deleted? - (bool) entitywasdeleted:(someentity *)someentity { return ((someentity == nil) || ([self.moc existingobjectwithid:someentity.objectid error:null] == nil)); } beware : don't use code bellow, might not work if (managedobject.managedobjectcontext == nil) { //

Python: Custom package delivered with script and ways of importing it -

i trying grok way packages work in python. goal require python installed, users should able check out script repository , run it. the relevant files (output of ls testpackage.py mypackage/ ): testpackage.py mypackage/: __init__.py someclass.py contents of testpackage.py : from mypackage import someclass print "hello testpackage.py" the_instance = someclass() the_instance.hi() contents of mypackage/ _ init _.py : class insideinitpy(): def hi(self): print "hi insideinitpy! (when importing package)" insideinitpy().hi() contents of mypackage/ someclass.py : class someclass(): def hi(self): print "hi someclass in package! (using explicit call)" when running test script python testpackage.py : hi insideinitpy! (when importing package) hello testpackage.py traceback (most recent call last): file "testpackage.py", line 5, in <module> the_instance = someclass() typeerror: 'module' ob

Matlab fails to validate parallel environment -

when run parallel >> manage congifurations... , matlab fails pass distributed job , parallel job , matlabpool tests. system has double core: intel core i5 cpu m520 @ 2.40ghz 2.40ghz, 2gb ram, win7 64bit, matlab r2011b. after failed validation, following output: validation details configuration: "local" type: local -------------------------------------- stage: find resource status: passed description: validation passed command line output: (none) -------------------------------------- stage: distributed job status: failed description: given stage reached default or user-specified timeout. command line output: (none) error report: (none) debug log: log file output: -------------------------------------- stage: parallel job status: failed description: given stage reached default or user-specified timeout. command line output: (none) error report: (none) debug

maven - mvn depedency plugin and Hadoop -

i've got jar contains both map reduce code , few command line tools. to distribute dependencies i'm packaging dependences in lib directoy within jar using maven dependency plugin: <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-dependency-plugin</artifactid> <version>2.3</version> <executions> <execution> <id>copy-dependencies</id> <phase>prepare-package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputdirectory>${project.build.directory}/classes/lib</outputdirectory> <overwritereleases>false</overwritereleases> <overwrites

swing - Java JLabel changes Font Automagically -

i have number of various components in large javaee application. such, debugging pain, , sadly cannot provide sscce accurately depicts problem i'm having. in nutshell, somehow fonts change things jlabels , jtabbedpanes . without ever touching them, they're being repainted bold, italicized, dramatically changed in size, or combination thereof. simple question: why? if step through eclipse debugger, no changes made, ever. time somehow factor. i'm still java grasshopper (working myself), , haven't built program in such way edt sacred object. i'm worried because i'm potentially not making repaint() calls on edt jtabbedpane, jlabel , other font properties being reset , repainted. edit: forgot i'm constrained java 1.5. i think i've narrowed down issue using html in jlabels , jtabbedpane tab titles...but past i've got no idea. regards jtabbedpane, it's going drawing methods right font / fontmetrics objects, whatever reason (so

java - Serialized object has null values after sending via udp -

i have set udp client/server model can send string messages each other. i've created custom class loginrequest serialized , sent server containing username , password. when getters these variables called return null values though check variables before loginrequest sent. here code serializing , sending datagram client: private void login(string name, char[] pass) throws sqlexception { try { loginrequest login = new loginrequest(name, pass); bytearrayoutputstream baos = new bytearrayoutputstream(); objectoutputstream oos = new objectoutputstream(baos); oos.writeobject(login); byte[] buffer= baos.tobytearray(); oos.close(); baos.close(); datagrampacket packet = new datagrampacket(buffer, buffer.length, inetaddress.getbyname(server), 10110); datagramsocket ssocket = new datagramsocket(); ssocket.send(packet); login.getusername(); } catch (exception e) { e.

image - how to move an imageview to right get activity in android? -

i have implemented application image view in application implement when user move image right side next acitvity. how can write event or other code move image right side? i have used imageview code as: (imageview)findviewbyid(r.id.slide) //event move right here intent = new intent(slide.this,nextactivity.class); startactivity(it); please body me... so, if understood correctly, want move imageview across screen, drag it, , when hit spot want start activity? if so, try , use code below...which let's drag imageview across screen just add ontouchlistener imageview you're trying slide (move/drag) yourslideimageviewobject.setontouchlistener(new view.ontouchlistener() { @override public boolean ontouch(view v, motionevent event) { onslidetouch(v, event); return false; } }); then add code handle touch events public void onslidetouch( view view, motionevent event ) {

android - use one webview replace with the listview? -

all, developing app "forum client", use webview each item in listview showing post list, there pics, texts , attachments can downloaded user. work, webview heavy component, need lots of system resources. have find method show post list. found this question same problem, , last post author said, use "one webview bunch of divs rendering individual contents", cannot it, so, did mean? i think meant should html showing in different webviews in each listview item, wrap each in div tag, show in 1 single webview user can scroll. should better performance since have 1 webview on-screen (and in memory) @ 1 time, rather 1 each visible row take lot of memory.

css - Why do I need `position: absolute` in making side-by-side 2x2 square? -

i use method here in below example. <!-- vim: set nowrap:--> <html> <style type="text/css"> #titleimg{ <!--no use in code makes --> <!--things work odd reason?!--> position:absolute; <!--if remove this, failure --not 2x2.--> <!--it becomes one-after-another after rem.--> <!--why?--> } li{ width:190px; height:190px; display: block; float: left; margin: 5px; } </style> <body> <center> <ul style="width:400px; height:400px; text-align:center;"> <li> <img id="titleimg" src="../pictures/logos/logo.png"

iphone - Strange memory leak in Window:addSubView -

first of sorry english :-) not good. i have strange memory leak following code (code after explanation). have class, flwaitingview. simple view waiting indicator (plus view background), used user "wait data loaded". has 2 simple methods: show , dismiss. in show method, find main application window , add subviews (the waiting view , background view, different animations). in dismiss method, remove superview. in every show, verify view isn't visible using static bool var (is_visible). the strange thing this: in dismiss method, use: [self.view removefromsuperview]; [self.waitingview removefromsuperview]; to remove 2 views window, avoid them retained. correctly removed, can verify nslog (for cicle on each window subview). but, in instruments, using "mark heap" function, see in every single reload (new instance of flwaitingview, show, dismiss) old instance remains in memory , continues increase memory usage. not problem of calling code, because correctly

HTML5: How to pause when using Onclick for custom button? -

i'm using following code found on iphone app i'm working on, <a onclick="this.firstchild.play()"> <audio src=".."></audio> here's insert custom player button </a> but can't pause music, can tell me should insert pause() ? how started? test here on fiddle . <audio id="player" src=".."></audio> <a href="javascript:;" onclick="document.getelementbyid('player').play();">play</a> <a href="javascript:;" onclick="document.getelementbyid('player').pause();">pause</a>

active directory - Any way to bypass windows domain account? -

i installing dynamics ax 2012 (single pc installation) on laptop , gives me alert you logged on local computer account 'pc-name'. must logged on domain account run microsoft dynamics ax setup not familiar windows domain accounts , networking, wishing solution on how bypass this, 'single pc' solution domain account? mean there windows service can solve this? looks dynamics requires domain, so, no. might want consider creating virtual machine on laptop , running domain controller on , installing dynamics there.

python - SQLAlchemy: how to make primary_key not unique (PostgreSQL)? -

i need that. i've tried define in model: vs_id = column(integer, primary_key=true, unique=false) but didn't work - database schema has such row: alter table my_table__ add constraint my_table___pkey primary key (vs_id); how solve this? in advance! the primary key must unique, in order able refer specific record. if need this, add field isn't unique!

Unable to assign value to php array -

i creating array in php assigning values retrieved database. when print array displaying array output , not contents. retrieve values mysql. $resultset=mysql_query("select isbn tbl_book publisherid='$publisherid'"); /***retrieve books*****/ while($resultisbnarray = mysql_fetch_assoc($resultset)) { $isbn = $resultisbnarray["isbn"]; $myarr[]=$isbn; } echo $myarr echo ing array prints "array". need pick individual values in array ( echo $myarr[0] ) or use print_r() .

How to constrain jQuery draggable to both x and y axes -

it's pretty easy constrain jquery draggable axis this: $("#object").draggable({ axis: "x" }); but how can constrain both x , y? iow, want allow both vertical , horizontal movement nothing else (imagine rooks on chess board). just add works $("#object").draggable({ axis: "x,y" });

Image spot detection in Python -

i have millions of images containing every day photos. i'm trying find way pick out in colours present, say, red , orange, disregarding shape or object. size may matter - e.g., @ least 50x50 px. is there efficient , lightweight library achieving this? know there opencv , seems quite powerful, bloated task? it's relatively simple task, right? thanks certainly opencv can this, use python imaging library pil , create function iterate through image cropping small blocks of image set @ minimum size, , testing these blocks average colour , tolerance against matching criteria. along lines of (untested pseudo code): import image im = image.open("test_picture.png") y in xrange(image_height - block_height): x in xrange(image_width - block_width): block = im.crop(x, y, x + block_width, y + block_height) if colour_test(block): # test match return true its easy colour frequency info of image using block.getcolors() , can wri

git - Why am I getting ": No such file or directory" when trying to execute a bash script? -

i'm trying execute bash script (git-ftp) can't seem it. happens: [trusktr@rocketship ~]$ ~/scripts/git-ftp : no such file or directory the file has permissions 755. this contents of script: http://pastie.org/3567556 why getting error? can fix problem? i have seen error if script has windows line endings instead of unix line endings. try running dos2unix on script , see if same error.

c# - Default memory cache with LRU policy -

i trying implement caching in application , want use default memory cache in c# (this requirement can changed if wont work). problem don't want exceed maximum amount of physical memory have on machine, understand can't add such constraint default memory cache. in general policy is: if object has been in cache 10 min no requests removed if new object added cache , maximum amount of avaliable physical memory close used, elements removed based on lru my cache can contain many different objects , range 10mb 2-3gb, can't trim function work. are there suggestions on how implement lru cache monitoring ram usage? , hoppefully can done using caches in .net? edit i've added simple example memorycache limited 100mb , 20% of physical memory, not change anything. memory filled no removal of cache entries. note polling interval changed evert 5 second. class item { private list<guid> data; public item(int capacity) { this.data = new lis