Posts

Showing posts from September, 2014

actionscript 3 - Download youtube videos with flash -

i'm new flash, understand concepts of , had great progress far. wondering how hard download youtube video , components/functions have use. know possible since i've seen adobe air app it. take @ youtube chromeless player !

c++ - How to find out if a folder exists and how to create a folder? -

i'm trying create folder if doesn't exist. i'm using windows , not interested on code working in other platforms. never mind, found solution. having inclusion problem. answer is: #include <io.h> // access(). #include <sys/types.h> // stat(). #include <sys/stat.h> // stat(). #include <iostream> #include <string> using namespace std; string strpath; cout << "enter directory check: "; cin >> strpath; if ( access( strpath.c_str(), 0 ) == 0 ) { struct stat status; stat( strpath.c_str(), &status ); if ( status.st_mode & s_ifdir ) { cout << "the directory exists." << endl; } else { cout << "the path entered file." << endl; } } else { cout << "path doesn't exist." << endl; } the posix-compatible call mkdir . it silently fails when di...

php - Do other programming languages/platforms problem with Garbage Collector like JVM? -

i want know whether other programming languages/platforms php, ruby, c# etc. (where dont have manually deal memory-managment) have same prolem gc java on jvm results in long pause, high response time, low throughput etc. on large heap size (> 5gb)? or that's general problem languages/platforms gc-ability, in java-world hot discussion thema because there many large scale systems written in java out there , 1 oftener have deal problem elsewhere? thx much! yes, gc-based languages have similar issues large heaps. has little language, , vm implementation (as gc tuning options , of course application code). since applications large heaps still quite rare becoming more common, becoming major selling point vendors of alternative vm implementations, such ibm or azul systems .

database connection - SQL Server 2000 charset issues -

once again charset issues when talking db's :) i have 2 enviroments running zend server. bot of these communicate sql server 2000 using mssql extension. none of them has value given charset in settings of extension. 1 works , other 1 returns data in wrong encoding. the problem became noticed when data beeing inserted mysql database , screamed sqlstate[hy000]: general error: 1366 incorrect string value: '\xf6m' column 'cust_lastname' @ row 1 . i tried using set names utf8 sql server connection return correct data, complains , says names not recognized set statement . looking around people recommend using doesn't seem part of sql server 2000 :) so, should do? how i, without fiddling sql server database/tables, tell send me data in utf-8 encoded format? edit: some more info... sql server uses finnish_swedish_ci_as collation mysql has every table in utf-8 format , uses utf8_unicode_ci i didn't find solution , ended converting , utf...

bash - Why do I end up with two processes? -

i wrote script has been running daemon quite time now. if ever needed debug it, stop daemon version , rerun manually in current shell. have never logged out of script, getting ready deploy on remote server figured want log errors script into. purpose followed hints several postings , doing following: if ! tty > /dev/null; exec > >(/bin/logger -p syslog.warning -t mytag -i) 2>&1 fi this seems log fine, surprised see 2 instances of script listed ps when feature enabled. there way avoid it? i know process logger , assume has >(...) , still hope avoid it bash spawns subshell execute command(s) in >( ... ) . in case, thing subshell run /bin/logger , it's rather pointless. think can "fix" exec command: if ! tty > /dev/null; exec > >(exec /bin/logger -p syslog.warning -t mytag -i) 2>&1 fi this doesn't prevent subshell starting, instead of running /bin/logger subprocess (of subshell), subshell gets repla...

ios - How to "render" a Box2D scene on iPhone -

i'm using box2d cocos2d on iphone. have quite complex scene set up, , want end user able record video part of app. have implemented recorder using avassetwriter etc. , have managed recording frames grabbed opengl pixel data. however, video recording seems a) slow down app bit, more importantly b) record few frames per second @ best. this led me idea of rendering box2d scene, manually firing ticks , grabbing image every tick. however, dt issue here. just wondering if has done this, or if has better ideas? a solution guess use screen recorder solution screenflow or similar...

localization - How to localize MMC snap-in (default actions, file menu, etc) -

i developing mmc 3.0 snap-in , have framework in place localize string literals @ run-time. however, mmc inserts lots of 'default' menu items, actions , descriptions, none of can access programmatically. example, "refresh" & "help" buttons. can suggest way of accessing these items in code, in order translate properties? i suspect ui elements managed mmc localized according whatever rules govern ui language used in other parts of windows. if install french language pack , make default, assume basic mmc ui elements appear in french.

php - array for loop syntax -

if have: $data = array( 'id01' => array( 'firstname' => 'eric', 'lastname' => 'smith', ), 'id02' => array( 'firstname' => 'john', 'lastname' => 'turner', ), ); foreach ( $data $key){ print "$key[firstname]<br>"; echo $key[0]; } the $key[0] part not working...basically i'm trying output id01, id02, id part of array forloop processing... any ideas on correct syntax? what need foreach ($data $key => $val){ print "$val[firstname]<br>"; //changed $val echo $key; //prints id01, id02 }

objective c - Help with a memory leak -

i made class uses nsurlconnection , kvc make objects plists on server. instruments says have bunch of memory leaks coming function handles data returned server: - (void)connectiondidfinishloading:(nsurlconnection *)connection{ hasoutstandingcall = no; nserror* serror; nsdictionary* tmpdict = [nspropertylistserialization propertylistwithdata:receiveddata options:nspropertylistimmutable format:null error:&serror]; self.lastresponse = [serverresponse new]; //nslog(@"server responded: %@",tmpdict); [lastresponse setvaluesforkeyswithdictionary:tmpdict]; if(tmpdict.count == 0){ lastresponse.success = no; lastresponse.errorid = -1; lastresponse.errormessage = @"couldn't understand server response"; [[nsnotificationcenter defaultcenter] postnotificationname:@"serverdidrespond" object:self]; [[nsnotificationcenter defaultcenter] postnotificationname:@"requestdid...

codeigniter - MySQL Active record query ignoring case -

i have following active record query: $this->db->select('id, firstname, surname'); $this->db->from('users'); $this->db->where('site_id',$siteid); $this->db->like('firstname', $name); $this->db->or_like('surname', $name); $query = $this->db->get(); this works fine exception names within db can contain upper , lowercase names. if case not match, query fails. is there way can ignore case query? one of way manipulate case sensitivity in mysql have firstname field in either upper or lower case in db , convert given string in format , match it. edit: operator , depends on database use case sensitive or not . in postgres , case insenstive in mysql case sensitive. depends on database using. edit: working not useful way use ucase() or lcase() function on given field , match lowercase or uppercase of match. though have performance issues.

php - CodeIgniter - Code repetition and passing variables to functions -

i have following code in controller: <?php class student extends ci_controller { function index() { $data = $this->init->set(); $this->parser->parse('include/header', $data); $this->parser->parse('student/student_index', $data); $this->parser->parse('include/footer', $data); } function planner() { $data = $this->init->set(); $this->parser->parse('include/header', $data); $this->parser->parse('student/student_cal', $data); $this->parser->parse('include/footer', $data); } } ?> as can see, there's lot of repetition here. of it. put variables in model have call model function each time instead of putting whole $data array @ start of each function. anyway, tried reduce repetition here doing following: <?php class student extends ci_controller { function index() { $data = $this->init->set(); $this->parser->pa...

java - How to limit a task from using all threads in a thread pool? -

i'm using thread pool execute tasks in background of application. however, of tasks heavier others. i'd limit heavy tasks subset of thread pool, thereby leaving @ least few threads open lightweight tasks execute. is there simple way this? the simple way use separate thread pools different "tasks weight". even can create separate class exposes separate methods differents tasks.

creating a class in C#, use of unassigned variable -

i recieve "use of unassigned varable in infopeople". not sure why, class set example in textbook. shed little light on this. thanks. class personinfo { public string fname; public string lname; public int personid; } class program { static void main(string[] args) { personinfo infopeople; infopeople.fname = "jeff"; console.writeline("the fname is: " + " " + infopeople.fname); } } you haven't initialised instance: personinfo infopeople = new personinfo(); i try , conform c# style type/casing conventions: personinfo infopeople = new personinfo();

Anonymous user form submission drupal 7 -

i have situation after doing basic registration user redirected page needs fill small form. i aim @ implementing hook_user_insert , hook_menu this function registration_user_insert(&$edit, $account, $category){ drupal_goto('splan/'.$edit['uid']); } function registration_menu() { $items['splan/%'] = array( 'title' => 'select plan', 'page callback' => 'drupal_get_form', 'page arguments' => array('selectplan_form'), 'access callback' => true, 'type' => menu_callback ); return $items; } in selectplan_form define new form , using uid save data user table. now happening after basic user registration form being submitted redirection splan/uid happening following error. you not authorized access page. now have changed permissions allow anony. users create , edit webform still problem exists. please help!!!!!!!! try removing 'access callback' => tru...

c# - Querying in advance with linq2sql for data with gaps -

hi have table: values valueid, timestamp , value , belongto. each 15 minutes there insreted new row table new value, current timestamp , specific belongto field. , want find gaps mean values 1 after has timestamp more 15 minutes. i trying this: var gaps = p1 in db.t_values join p2 in db.t_values on p1.timestamp.addminutes(15) equals p2.timestamp grups !grups.any() select new {p1}; and works don't know if optimall, think? , don't know how can add p1.belongto == 1. cos query looks data. jon told var gaps = p1 in db.t_values p1.belongto == 1 !db.t_values.any(p2 => p1.timestamp.addminutes(15) == p2.timestamp) select p1; jon last query translated to: exec sp_executesql n'select [t0].[valueid], [t0].[timestamp], [t0].[value], [t0].[belongto], [t0].[type] [dbo].[t_values] [t0] (not (exists( select null [empty] [dbo].[t_values] [t1] dateadd(ms, (convert(bigint,@p0...

c# - What is going wrong when Visual Studio tells me "xcopy exited with code 4" -

i'm not familiar post-build events, i'm little confused what's going wrong program. when compiling in visual studio 2010, following: the command "xcopy c:\users\me\path\foo.bar\library\dsoframer.ocx c:\users\me\path\foo.bar\bin\debug\ /y /e /d xcopy c:\users\me\path\foo.bar\applicationfiles c:\users\me\path\foo.bar\bin\debug\ /y /e /d xcopy c:\users\me\path\url\ c:\users\me\path\foo.bar\bin\debug\ /y /e /d rmdir /s /q c:\users\me\path\foo.bar\bin\debug\.gwt-tmp" exited code 4. the program appears run fine, despite error, don't want ignore issue , hope nothing bad happens. strangely, line started out single command (the first xcopy) continued compile project (fixing other problems, references) error message expanded larger , larger. idea going on? edit: here postbuild events seem failing -- xcopy $(projectdir)library\dsoframer.ocx $(targetdir) /y /e /d xcopy $(projectdir)applicationfiles $(targetdir) /y /e /d xcopy $(solutiondir)com.myurl.gwt\w...

javascript - get values from query string for input box and drop down menu -

hi have following page query string: http://userpages.umbc.edu/~andrade1/querystring/querystring/example1%20-%20copy.html when click show , go receiving page here: http://userpages.umbc.edu/~andrade1/querystring/querystring/example123.html?name=duck%2c%20donald&spouse=daisy how can retrieve query string drop down menu display name donald duck or mickey depending button clicked , input box display either minnie or daisy depending button clicked? for example when show button mickey mouse clicked want mickey mouse display in drop down menu still able select other options after page loaded , minnie display in input box able type in value. currently javascript using is: <script type="text/javascript"> <!-- document.write("name: " + request.querystring("spouse")); // --> </script> which not work drop down menu or input box use location.search javascript query string

.net 2.0 - in c# I would like to compare datatables -

i compare 2 datatables. need know contents different yes or no. can 1 recommend quick way compare them? i know if contents (data) diffrent assuming tables have same structure (column names , data types) static bool aretablesequal(datatable t1, datatable t2) { // if number of rows different, no need compare data if (t1.rows.count != t2.rows.count) return false; (int = 0; < t1.rows.count; i++) { foreach(datacolumn col in t1.columns) { if (!equals(t1.rows[i][col.columnname], t2.rows[i][col.columnname])) return false; } } return true; }

delphi - Can TIdHTTP component handle javascript code? -

i using tidhttp component fetch web pages. works fine main page. not retrieve content generated embedded javascript code. example pages allow users add comments via disqus . here example in scenario tidhttp.get method not comments down on bottom of page. is there anyway done indy component or other native component? i have experimented using twebbrowser ole control. prefer use native delphi code. idhttp not execute javascripts, idhttp not browser. need introduce javascript executor application execute scripts retrieved html source browser would. your example displaying google analytics stats... you're trying in application? if so, you're being foolish (without meaning offensive) trying hack using pre-rendered result. google analytics provides api can harvest information using http calls. once information retrieved, can display using native delphi components , code in imaginative or original way desire. because ga provides api, there's no ex...

oracle - Parameters used by the optimizer query -

i vaguely remember need join 2 weird tables output of parameters this: optimizer_mode/goal = choose _optimizer_percent_parallel = 101 hash_area_size = 131072 hash_join_enabled = true hash_multiblock_io_count = 0 sort_area_size = 65536 ... this output 10053, don't have os access full trace (and parameters sideffect). need sql query. select * v$parameter2 order name; this show regular parameter values session hidden parameter values different default.

Left Join Linq to Entity's Vb.net -

i can't figure out linq entity query syntax. problem if value of calls table null noting comes up, want make left join 'all' rows calls table. i tried group can't figure out correct way write it. dim ticketquery objectquery = c in endata.customer _ join t in endata.calls on t.customerid equals c.customerid _ join status in endata.lists on t.status equals status.listvalue _ join project in endata.lists on t.project equals project.listvalue _ join priorty in endata.lists on t.priority equals priorty.listvalue _ c.status > -1 , t.status > -1 , status.listtype = 1 , project.listtype = 3 , priorty.listtype = 2 _ select new {c.custname, t.callid, t.calldate, t.calltime, t.description, key .status = status.listtext, key .project = project.listtext, t.da...

passenger - Multiple Ruby apps on one port, RackBaseURI help -

i'm trying 2 ruby apps work same port. don't know server technology @ all, forgive ignorance. i've tried follow doc: http://www.modrails.com/documentation/users%20guide%20apache.html sections 4.1 - 4.3, keep messing up. i've tried simplify little, here situation. have 2 simple rackup apps here: /users/dan/webapps/test1 /users/dan/webapps/test2 they each have "config.ru" file, public/ folder, , tmp/ folder "restart.txt", directed. both work on own. i have following in httpd.conf file: <virtualhost *:80> servername localhost documentroot /users/dan/webapps <directory /users/dan/webapps> allow </directory> rackbaseuri /test1 <directory /users/dan/webapps/test1> options -multiviews </directory> rackbaseuri /test2 <directory /users/dan/webapps/test2> options -multiviews </directory> </virtualhost> i start apache, , put in browser: http://localhost/test...

integer - What exactly is a float? -

yeah, noob question of century... in seriousness, have no idea float value is... , more importantly, difference between float , integer. thanks in advance! see http://steve.hollasch.net/cgindex/coding/ieeefloat.html http://en.wikipedia.org/wiki/ieee_754-2008 basically, floating point data type way of storing numeric value in scientific notation. might write 2.3789 x 10^12, since computers work in binary, it's binary scientific notation. floating point values, in software, trade magnitude absolute precision (you've got many bits spread around). integers are...well..integers. rightmost (low-order bit) represents 2^0 (e.g., 1), next bit represents 2^1 (2s), next 2^2 (4) , forth. leftmost (high-order) bit represents sign (0 positive, 1 negative). brings negative values: represented in what's called two's-complement notation. two's complement of positive number: flip bits: zeros become ones , ones become zeros. add 1 result, doing usual ca...

powershell - Configuration Manager -

i'me new powershell don't bit me :) question this: have setup 2 types of machine x86 , x64. during setup have check version of .net framework install on machine. i'm doing invoking test-path: test-key "hklm:\software\wow6432node\microsoft\net framework setup\ndp\v1.1.4322" "install" i'd this: # check if system x64 architecture # in case of positive answere change registry # wow6432node if($os_architecture -eq "x64") { $dot_net_registry_root_path = "hklm:\software\wow6432node" } # add common framework path $dot_net_registry_path = $dot_net_registry_root_path + "\net framework setup\ndp\" # check 1.0 version of .net framework $dot_net_1_0_registry_path = $dot_net_registry_root_path + "\microsoft\.netframework\v1.0\sbsdisabled" if(!(test-key $dot_net_1_0_registry_path "install")) { write-output ".net framework v1.0.3705 not installed" } else { w...

jquery selectors - smart way to rewrite this function -

i have this, , showing div if user clicked 1 button , not showing if user clicked other. working dumb way repeatition $j(document).ready(function() { $j('#button1').click( function () { var data = $j("form").serialize(); $j.post('file.php', data, function(response){ $j("#response").show(); }); }); $j('#button21').click( function () { var data = $j("form").serialize(); $j.post('file.php', data, function(response){ //do else }); }); }); i'd adding class selected buttons , pull event.target id click function: $j('.buttons').click(function(e) { var buttonid = e.target.id, data = $j("form").serialize(); $j.post('file.php', data, function(response) { switch (buttonid) { case "button1": ...

C#, Is there a better way to verify URL formatting than IsWellFormedUriString? -

is there better/more accurate/stricter method/way find out if url formatted? using: bool isgoodurl = uri.iswellformeduristring(url, urikind.absolute); doesn't catch everything. if type htttp://www.google.com , run filter, passes. notsupportedexception later when calling webrequest.create . this bad url make past following code (which other filter find): uri nurl = null; if (uri.trycreate(url, urikind.absolute, out nurl)) { url = nurl.tostring(); } the reason uri.iswellformeduristring("htttp://www.google.com", urikind.absolute) returns true because in form valid uri. uri , url not same. see: what's difference between uri , url? in case, check new uri("htttp://www.google.com").scheme equal http or https .

html5 - Testing cache.manifest on an iPad with Apache Web Server 2 -

i trying build offline web app ipad, , trying verify cache.manifest being served correctly apache web server 2, , working. have added 'addtype' .manifest extension mime-types configuration file apache web server. if @ access logs, first request cache-manifest returned 200 http response code, further requests served 304, 'not modified'. take mean working. assets (html, images) returned combination of both (200, 304 above) indicates working. when load on ipad, page, when go offline, , reload unable load not have connection internet. i serving off apache web server of mac, having trouble reliably testing mac. ideas on going wrong, or how verify working? testing cache manifest of pain in general, there few useful techniques. first, start testing using safari on mac directly. turn off apache when want check in offline mode. in safari, open activity monitor , resources listed "cancelled" -- typically ones missing manifest. also use web insp...

iphone - CADisplayLink swallows exceptions -

i've noticed when using cadisplaylink, exceptions swallowed: cadisplaylink *adisplaylink = [[uiscreen mainscreen] displaylinkwithtarget:self selector:@selector(doit)]; [adisplaylink setframeinterval:100]; [adisplaylink addtorunloop:[nsrunloop currentrunloop] formode:nsdefaultrunloopmode]; ... - (void) doit { nslog(@"before"); // force exception nslog(@"%@", [[nsarray array] objectatindex:1]); nslog(@"after"); } running code produces following output: 2011-04-11 18:30:36.001 testframelink[10534:207] before 2011-04-11 18:30:37.666 testframelink[10534:207] before 2011-04-11 18:30:39.333 testframelink[10534:207] before is correct behavior cadisplaylink? there way make abort program when exception bubbles rather unwind stack , pretend nothing happened? i suspect coreanimation's c++ innards (as evidenced in backtraces) responsible exception-swallowing you've noticed (or rather, don't think nstimer swallows...

asp.net mvc 3 - NerdDinner Example and issues -

i using vs2010 , sql server 2008 in windows 7 64 bit os. have downloaded nerd dinner example , tried run example. fine until try login using open id. have tried loging using yahoo , google accounts. after successful sign in in pop window, control not transferred application or didnt throw error. hanging there itself. hangs entire internet explorer. cannot select other ie window have opened. vs2010 got hang , ended in killing process , reopen project again. please me fix issue. have whitelisted localhost dotnetopenauth library? can in web.config adding this: <dotnetopenauth> <messaging> <untrustedwebrequest> <whitelisthosts> <add name="localhost"/> </whitelisthosts> </untrustedwebrequest> </messaging> </dotnetopenauth>

java - Use value outside for loop -

public class randomdemo { public static void main(string[] args) { random rand = new random(); int [] vararray = new int[rand.nextint(10)]; system.out.println(vararray.length); int d = rand.nextint(1999)-1000; (int i=0;i<vararray.length;i++) { vararray[i]= rand.nextint(1999)-1000; system.out.println(vararray[i]); if(d==vararray[i]) { system.out.println(d); system.out.println(i+1); } else { system.out.println(d); system.out.println(0); } } } } problems in code: it executes if-else statement multiple times , displays if-else output multiple times since in loop. code should execute if-else statement once rest of loop should executed multiple times. since if statement using value of vararray[i] cannot exclude code loop. when break statement use...

php - TimeStampDiff not working in MySql 5.0.3 -

hey there -- doing simple timestampdiff query , keep getting error query. tried exact same query on mysql 5.5 engine , worked fine.. select timestampdiff(second, current_timestamp(), current_timestamp()) time; this simple query test function out, return 0 on mysql 5.5, on 5.0 database fails run.. i've looked if function wasn't yet implemented, , seems in 5.0 introduced.. not sure why isn't working? i've checked documentation on function in 5.0 manual , seems same 5.5.. anyone know work around? in advance it seems there bugs function, on old versions of mysql 5.0.x -- here's example : erratic behaviour of timestampdiff() note mysql 5.0.3 old -- should update more recent version : you'll more support lots of bug fixes new features , enhancements and, probably, better performances

google chrome - How can i create a new tab via browserAction and then execute a script -

i want create tab clicking on browser action button , insert content script or execute script. far, not working well. background.html chrome.browseraction.onclicked.addlistener(function(tab) { chrome.tabs.create({url: "dreamer.html"}, function(tab) //dreamer.html file in extension { //add script chrome.tabs.executescript(tab.id, {file:'dreamer.js'}); }); }); manifest.json { "name" : " dreamer", "version" : "0.1", "description" : "my extensionr", "browser_action" : {"default_icon" : "app/appdata/images/icon.png", "default_title":"start dreamer" }, "background_page" : "app/appdata/background.html", "content_scripts" :[{"matches":["http://*/*"],"js":["app/view/uimanager.js"]}], "permissions": [ "cookies", "t...

garbage collection - executing java command remotely via ssh fails with GC error -

i've been attempting execute java application using ssh remote machine quite doesn't work :( to execute application on local machine, wrote shell script including java command, , works okay on local. so, tried execute shell script remotely via ssh below ssh username@hostname execute.sh it seemed worked out @ first, result in following error, , shutdown. gc warning: repeated allocation of large block (appr. size 929792): may lead memory leak , poor performance. gc warning: out of memory! returning nil! i understood message means reading page ( http://www.hpl.hp.com/personal/hans_boehm/gc/debugging.html ), yet, have no idea how come error occur when execute java command remotely. does know this? or, there better way execute java command remotely other ssh? any idea or information appreciated! regards, may java version: java(tm) se runtime environment (build 1.6.0_18-b07) the difference between exec'ing command locally vs remotely ...

javascript - Jquery model popup maximize mode issue -

i want open jquery dialog in maximized mode. when set width & height properties of model window goes out of inner window & shows horizontal scollbar. what's wrong in code $("#popupwin").dialog({ width: $(document).width(), height: $(document).height(), resizable: false }); i guess may want use $(window)? from jquery documentation: $(window).height(); // returns height of browser viewport $(document).height(); // returns height of html document basically, html document can go way longer actual window viewport doesn't make sense use $(document) @ case.

Need help with openURL:[NSURL URLWithString:@"tel:+91 (number)"]] from an iPhone app -

i need call number +91 (number),but if use tel:// url not make call iphone app. how call number coming in format. the iphone dial number using either of formats listed below. [[uiapplication sharedapplication] openurl:[nsurl urlwithstring:@"tel://15415551234"]]; [[uiapplication sharedapplication] openurl:[nsurl urlwithstring:@"tel:15415551234"]]; [[uiapplication sharedapplication] openurl:[nsurl urlwithstring:@"tel:1-541-555-1234"]]; link apple documentation on tel: url scheme

java - to draw graph with mysql data -

i need draw line graph mysql data has 2 columns. 1 me sample code. there number of options available draw line chart in java: easy charts jfree charts jcharts chart 2d google chart api

asp.net ajax - Why do some ScriptResource.axd calls succeed and others fail? -

we have website runs on asp.net 4. i notice website renders 2 scriptresource.axd requests. on our qa environment 1 request succeeds , other request fails (with 404 error). on other environments both calls succeed. the request urls are... this 1 works: http://qa.www.fin24.com/scriptresource.axd?d=exdgayd7e-g0ti3ln2uv0ito6mfpfvkoqgrthwywgdvjjouwj8gsper-44iuksfoazbnfszxolvf2p_wqjs6qmssyi9ghzdzoun3o0z5p9jse-pk_3bd4oqnx_kud_dhkag4ecunm9c042hschtngriqu9rgs-zizbslmuwbm6afrr20ths8cz6ecss-lusv0&t=2610f696 this 1 returns 404: http://qa.www.fin24.com/scriptresource.axd?d=pxon2obk88-8ae9bfqlj3v1atnvv55yrzddzgp3qs3clont7iligg1ealrod7pi8hllo--dmwm5l9a_gg8llygzzn50tzrkvfudreungwabszxd6qdss_qet81nled9xnvl7xi6rlzhhk2ktlrnlqcbnnznbvug2iyldg5ug-71rj6ch9hylfidce6mjex2m0&t=2610f696 why second 1 fail? i've read these calls relate different dlls, i'm guessing 1 dll not on server? don't know dlls. am on right track? thoughts? this must have been problem asp.net....

java - "class, interface, or enum expected" error when trying to create package -

i'm trying declare package in file follows: import java.util.*; package rtg; public class generate { // ... } but i'm getting error when try compile this: generate.java:3: class, interface, or enum expected package rtg; why getting error? it should package rtg; import java.util.*; public class generate{ } in java first define package imports , class. see wiki here: java_package , oracle's tutorial here: java packages edit now call genereate class class in same folder rtg folder: package rtg; public class gui{ generate gen = new generate(); } make sure words spelled correctly.

jQuery load function ignores Cache-Control max-age -

i using jquery's load function image (graph) server. graph received rest api protected basic authentication. image in current setup returned header cache-control max-age=0. respected if call image url directly browser. when using jquery's load function, cached. i don't want new image every time, because requires heavy calculations on server, , because graphs shows real-time data, long time caching unwanted. use max-age=30 or 60 later. i know jquery's ajax function has cache option. option can set true or false, , that's not i'm looking for. the standard way override getting cached result append random query string url you're getting, in: $(this).attr('src', url + '?randomval=' + (new date).gettime() ); you can set server headers allow client cache (e.g. cache-control: private - or whatever appropriate application), , decide in javascript code how want change "random" value appended url force resource reload. ...

ASP.NET Page_Load values are lagging one postback behind -

i have foreach loop in page_load method of 1 page determine whether enable button or not. code: foreach (var class in classes) { (var = studentslist.count - 1; >= 0; i--) { if (studentslist[i].id == class.student_id) studenstlist.remove(studentslist[i]); } } if (studentslist.count == 0) { button1.enabled = false; button1.text = "a"; } else { button1.enabled = true; button1.text = "b"; } if (page.ispostback) { return; } the issue: the value of studentslist.count lagging behind postback. if after loop should 1, has value of 1 @ next postback. i've debugged confirm case. you can move foreach loop page_preload method , give try. here anof life cycle of asp.net page: http://msdn.microsoft.com/en-us/library/ms178472.aspx#lifecycle_events

javascript - transforming jquery to java script -

i have script made jquery using show / hide divs on page. need made purely in javascript , have no idea how this. me ??? think need converter or . . . $("#optiuni").children().click(function(){ $("#" + $(this).attr('name')).show().siblings().hide(); /*gives link-activ class link clicked link-inactive others*/ $(this).attr('class','link-activ').siblings().attr('class','link-neactiv'); }); /*this makes shure first option list active incarcarea paginii*/ $("#optiuni li.prima").children().click(); sample markup: <div id="lista"> <ul id="optiuni"> <li id="titlu-lista-p"> <p class="listname-t">past events </p></li> <li name="opt-1" class="prima"><a href="#"><p class="listdata">28.02.2011</p><p class="listname">tabu oscar party</p...

jquery - Private method returned as string -

i'm developing simple jquery plugin , im having difficulties setting method structure. please enlighten me. using plugin structure described in official jquery authoring documentation. the problem having when calling private function _generateid, function returns function text ( function() { return this.. ) instead of 'hi'. (function( $ ){ var methods = { init : function( options ) { return this.each(function() { }); }, _generateid : function() { return this.each(function() { return 'hi'; }); }, create : function( options ) { return this.each(function() { var settings = { 'id' : methods._generateid, }; if ( options ) { $.extend( settings, options ); } $('<div>', { id : settings.id, }).appendto(thi...

sml - open knight's tour (backtracking) algorithm in smlnj -

i have write sml code solve knight's tour problem in backtracking. chess knight must run on chessboard (size: nxn ) , must visit each square once (no need come in first square @ end). i write functions create empty board, set or squares in board, list of possible knight next moves. have no idea on how write recursive function in sml (i know how write algorithm in c not in sml). algorithm in c 8x8 chessboard dl , dr array : (delta calculate next moves) dl = [-2,-2, -1, 1, 2, 2, 1, -1] dr = [-1, 1, 2, 2, 1, -1,-2, -2] bool backtracking(int** board, int k/*current step*/, int line, int row, int* dl, int* dr) { bool success = false; int way = 0; do{ way++; int new_line = line + dl[way]; int new_row = row + dr[way]; if(legal_move(board, new_line, new_row)) { setboard(board,new_line, new_row,k); //write current step number k in board if(k<64) { success = backt...

c++ - openGL lighting rotates with camera -

i'm trying build simple uni coursework , i've tried light it, lights seem rotate camera, totally annoying... i've pasted code below using pastebin (so doesn't stretch page), here's little explanation too: i added lights in display::init (using poollight class). camera set in display::resize. it's placed above 'pool table' @ (0, 0, 80), looking down (0, 0, -1), x axis being forward/up (1, 0, 0). this simple movement , rotation of camera adjusts lights too, not geometry (or perhaps adjusts geometry, , not lights, i'm not sure). i have read of other answers here concerning same issue, don't understand well. i'm hoping can explain me in simpler terms, or maybe spot obvious i've accidentally excluded. anyway, here code: main display class poollight class: #include "poollight.h" #include "glut/glut.h" #include "gl/gl.h" #include "gl/glu.h" poollight::poollight(glenum lightnumber, glen...

.net - Convert Android SMS table date to meaningful DateTime format using other than Java -

i'm wondering how convert sms table date value e.g. 1293457709636 (miliseconds) meaningful date time value using microsoft platforms, not java. i've made backup of sms messages htc phone. exported xml file , date have this: 1301061775000. i've got solution post: android - date time sms timestamp in miliseconds unfortunately require have installed , knowledge of java i'm not. it possible convert format mm/dd/yyyy hh:ii:ss using microsoft (don't shoot me!) tools/ide/languages (.net, c#, vb) or php because have automate somehow process since there more 600 messages. the android datetime milli-secs since jan 1, 1970. use following exention method convert .net datetimeoffset. public static datetimeoffset epoch = new datetimeoffset(new datetime(1970, 1, 1), timespan.zero); ... public static datetimeoffset frommillisecssinceepoch(this long millsecs) { return epoch + timespan.frommilliseconds(millsecs); }

php - Popup dialog with event details keeps the same even if another id is used -

i have integrated fullcalendar json , php events small calendar widget works well. i have coded css/div popbox passed event id via eventclick function when event clicked opens , uses ajax request passed id full event details focussed popbox. i can close popbox without issue when click next/previous/today tabs calendar refreshes , fires off last viewed popbox. i assume because calendar , ajax popbox using javascript event , being tied together. can few lines stop this? my code: $('#calendar').fullcalendar({ editable: false, cache: false, header: {left: 'title',center: '',right: 'today,prev,next'}, events: function(start, end, callback) { $.getjson("/mod/calendar/events.php?ts=1302604339", { action: "get_events", start: start.gettime(), end: end.gettime(), id: 'a', etype: "club" ...

fortran - Zero sized arrays and array bounds checking -

when compiled either gnu fortran (v4.4.3) or sun studio f95 (v8.3) , no array bounds checking following program runs without error. however, when array bounds checking switched on ( gfortran -fbounds-check , f95 -c , respectively) gnu compiled executable runs again without error, whereas sun studio compiled executable gives run-time error, ****** fortran run-time system ****** subscript out of range. location: line 44 column 20 of 'nosize.f90' subscript number 2 has value 1 in array 't$27' that's error in call sub2() , uses automatic array dummy argument x . sub1() calls run fine either compiler , flags. to knowledge program "legal", in 0 sized array may referenced non-zero sized array, , there no explicit indexing of 0 length dimension of x . there 0 sized array slicing or automatic array subtlety i'm missing here? , should expect array bounds checking behave same across different compilers, or should consider vendor-specific exten...

inline xaml in html document -

how view xaml code inside html document, xaml code: <canvas name="myxaml" width="618.125" height="37.325001" cliptobounds="true" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <canvas name="g10" rendertransform="1.25,0,0,-1.25,0,37.325001"> <canvas name="g12"> <path fill="#ff000000" name="path16"> <path.data> <pathgeometry fillrule="nonzero" figures="m41.977,17.434l41.977,18.165 48.719,18.165 48.719,17.434 41.977,17.434z m41.977,15.165l41.977,15.891 48.719,15.891 48.719,15.165 41.977,15.165z" /> </path.data> </path> </canvas> </canvas> </canvas> and goal doing this: <html> ...

javascript - Elegant way to get ExternalInterface working with all browsers -

i want call function inside flash movie javascript, using externalinterface class. problem work firefox need use embed element , rest have object element. solve it, gave different ids 2 elements , depending on user agent select 1 or other: function getmovie(moviename) { alert(navigator.useragent); if (navigator.useragent.indexof("firefox") != -1) { return document["flash_embed"]; } else { return document["flash_object"]; } } this works, not elegant , may not work other browsers... know better way this? use swfobject embed flash movie, , use retrieve correct id.

iphone - SOAP message error with addiotional XML tags -

nsstring *urlstring = @"http://172.29.165.219:8090/abc/services/abc"; nsstring *soapmessage = [nsstring stringwithformat: @"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" "<soap:envelope xmlns:xsi=\"http://www.w3.org/2001/xmlschema-instance\" xmlns:xsd=\"http://www.w3.org/2001/xmlschema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" "<soap:body>\n" "<getuserinfo>\n" "<email>%@</email>\n" "<pwd>%@</pwd>\n" "</getuserinfo>\n" "</soap:body>\n" "</soap:envelope>\n", @"babla.sharan@tcs.com",@"ugfzc0axmjm="//,@"5000...

java - Is this class Threadsafe? -

hi class below threadsafe? class immutablepossiblythreadsafeclass<k, v> { private final map<k, v> map; public immutablepossiblythreadsafeclass(final map<k, v> map) { this.map = new hashmap<k, v>(); (entry<k, v> entry : map.entryset()) { this.map.put(entry.getkey(), entry.getvalue()); } } public v get(k key) { return this.map.get(key); } } if whole class definition, i.e. there no other setter/modifier methods, usage of map thread safe: its initialization , visibility safeguarded declaring final , the containing class has getter, no modifier methods, the contents of map copied constructor parameter map, there can no outside references through can modified. (note though refers structure of map - individual elements inside map may still unsafe.) update regarding claim class not guarded constructor parameter being concurrently modified during construction, tend agree...

solr EdgeNGramFilterFactory -

i have edgengramfilterfactory field. indexing fine. can see words generating through admin interface. have copied other fields text field fast searching since text field default field query. copied field type of edgengramfilterfactory text field. other field values available when searching except field. need help. <field name="city_sub" type="ngram" indexed="true" stored="true"/> <copyfield source="city_sub" dest="text"/>

prototypejs - JavaScript memory loss with Prototype's Ajax.Updater? -

i'm not sure prototype specific issue, since don't have problem when not using prototype guess is. i'm using ajax.updater append external html dom tree. in external file there script elements. since have set evalscripts options true, evaluated. when later try access objects have been set in script elements, no longer exists. example: <script type="text/javascript"> var test = true; console.log(test); // works fine, obviously. </script> <input type="text" onkeydown="console.log(test)"> <!-- throws referenceerror exception (test not defined) when event fired. --> if request ajax.updater script element run expected, after evaluation test variable seems deleted. knows what's going on? you can solve issue with <script type="text/javascript"> window.test = true; // global on window console.log(test); // works fine, obviously. </script> ajax.updater call on scrip...

javascript - Why are .innerHTML problems not an issue when using JQuery().html()? -

i worked out single instance of document.getelementbyid("myid").innerhtml = "a value" in this javascript world clock guide causes wordpress admin not load , breaks various areas of wordpress admin interface. i solved replacing each instance jquery("#myid").html("a value")) appears work fine. causing .innerhtml fail miserably not jquery().html() ? this pertinent part of jquery source: try { ( var = 0, l = this.length; < l; i++ ) { // remove element nodes , prevent memory leaks if ( this[i].nodetype === 1 ) { jquery.cleandata( this[i].getelementsbytagname("*") ); this[i].innerhtml = value; } } // if using innerhtml throws exception, use fallback method } catch(e) { this.empty().append( value ); } note handles exceptions thrown. see in 1.5.2 .

html - vertical centering of list items -

i have read many articles vertical centering i’m afraid not many of them intuitive, hence unable apply problem. basically, have main div , in there, i’ve got unordered list has image , paragraph tag within , displayed using inline-block. aspect of work fine. the problem or trying achieve have list centered in middle of screen. instance, if have got 1 item in list, should in middle , move upwards more items entered in list. <div id = "main"> <ul> <li> <img src="test.jpg" alt="#" /> <p>lorem ipsum</p> </li> </ul> </div> #main { margin: 60px auto; height: 400px; } #main ul li { display: inline-block; vertical-align: top; margin: 0 13px 72px 22px; height: 100px; } #main ul { text-align: center; } not sure you're trying here possible solution. trick line-height. edit: should it... http://jsfid...

ruby - clean "prefixes" in a set of arrays? -

i wondering, i've got set of arrays containing of own datatype. looking like: traces = {[<label1>, <label2>], [<label1>], [<label1>,<label2>,<label3>]} now, have method cleans 'prefix'-existing arrays in set, new set in example: traces = {[<label1>,<label2>,<label3>]} anybody idea how make clean implementation out of this? hope there neater solution stepping through traces , set new_traces , comparing every array-item several times. note: define array prefix of array b iff first items of array b array a not quite fastest solution, rather simple: s = set.new([[1,2],[1],[1,2,3]]) s.reject{|prefix| s.any?{|array| array.length > prefix.length && array[0,prefix.length] == prefix } } #=>[[1, 2, 3]]

php - Possible to remove included classes? -

i using 3rd party file manager plugin on cms , want include authentication check php framework i'm using. authentication part works fine, simple include auth check, there seems conflict between included classes , of file manager. example, i'm getting "class kohana not found" error class belonging file manager trying instantiate class belonging framework. at top of file manager main entry file, have following: //load kohana framework authorisation include('../../../../../admin/index.php'); // if not valid authenticated user, kill page if ( ! auth::instance()->logged_in()) { die('unauthorized'); } having done authentication, no longer want included files , classes, these seemingly conflicting file manager. there way can this, or misunderstanding what's going on here? the error being thrown in file manager class - public_html/media/js/tiny_mce/plugins/ajaxfilemanager/inc/class.file.php [ 67 ] function file($path=null) { $this...

Looking for a PHP to Excel library -

possible duplicate: alternative php_excel i'm looking lightweight , fast php excel writer. need export excel files 50000 rows. i've tried phpexcel, far slow , memory-intensive. it's data, formatting not necessary. another requirement fields bigger 255 characters. lot of solutions found don't support this. any suggestions? you try these projects: http://code.google.com/p/php-excel/ http://phpexcel.codeplex.com/ (excel 2007)

Java sending files through sockets -

i want send files other information through sockets. using following code public void receivefile(socket socket,int filesize,string filename) throws ioexception { //after receiving file send ack system.out.println("waiting "); // int filesize=70; // filesize temporary hardcoded long start = system.currenttimemillis(); int bytesread; int current = 0; // localhost testing system.out.println("connecting..."); // receive file byte [] mybytearray = new byte [filesize]; inputstream = socket.getinputstream(); fileoutputstream fos = new fileoutputstream(filename); bufferedoutputstream bos = new bufferedoutputstream(fos); bytesread = is.read(mybytearray,0,mybytearray.length); current = bytesread; system.out.println("recv..."+mybytearray.length); { bytesread = is.read(mybytearray, current, (mybytearray.length-current)); system.out.println(bytesread); if(bytesread > 0) current += bytesread; } while(bytesread > 0); bos.write(m...

c# - ListBox showing one property in different rows -

i using following code binding listbox list i.e. list , set binding path=name. list box shows 1 name letter divided in rows. if name john, list box row 1 shows "j", row 2 shows "o", row 3 shows "h", row 4 shows "n". here's code. xaml <listbox height="auto" itemssource="{binding path=name}" horizontalalignment="stretch" margin="0,80,0,0" name="ledgerlistview" verticalalignment="stretch" width="200" keydown="ledgerlistview_keydown" mousedoubleclick="ledgerlistview_mousedoubleclick" issynchronizedwithcurrentitem="true" /> code-behind list<ledgers> ledgers = new list<ledgers>(); ledgers = dal_ledgers.loadledgers(); this.datacontext = ledgers; the itemssource property needs bound source collection want generate list box's items from. in case datacontext. show name each item can either apply ...

python - Django: optimizing many to many query -

i have post , tag models: class tag(models.model): """ tag blog entry """ title = models.charfield(max_length=255, unique=true) class post(models.model): """ blog entry """ tags = models.manytomanyfield(tag) title = models.charfield(max_length=255) text = models.textfield() i need output list of blog entries , set of tags each post. able 2 queries, using workflow: get list of posts get list of tags used in posts link tags posts in python i having trouble last step, here code came with, in gives me 'tag' object has no attribute 'post__id' #getting posts posts = post.objects.filter(published=true).order_by('-added')[:20] #making disc, {5:<post>} post_list = dict([(obj.id, obj) obj in posts]) #gathering ids list id_list = [obj.id obj in posts] #tags used in given posts objects = tag.objects.select_related('post...

Android aes encryption pad block corrupted -

i using methods below , if enter right key works fine. if enter wrong key receiving badpaddingexception:pad block corrupted... doing wrong? public void initkey(string passwd, byte[] salt) throws nosuchalgorithmexception, invalidkeyspecexception, nosuchproviderexception{ byte[] localsalt = salt; pbekeyspec password = new pbekeyspec(passwd.tochararray(),localsalt, 1024,128);//, localsalt, 1000, 128); //128bit enc aes secretkeyfactory factory = secretkeyfactory.getinstance("pbewithmd5and128bitaes-cbc-openssl","bc"); pbekey key = (pbekey) factory.generatesecret(password); enckey = new secretkeyspec(key.getencoded(), "aes"); } public string txt2enc(string etxt) throws nosuchalgorithmexception, nosuchpaddingexception, invalidkeyexception, illegalblocksizeexception, badpaddingexception, unsupportedencodingexception { final cipher cipher = cipher.getinstance("aes");//aes cipher.init(cipher.encrypt_...