Posts

Showing posts from September, 2011

Retrieve device information in Linux from device file descriptor using c++ -

how can device info including device name device file descriptor? for example, in skype can see device "/dev/snd/pcmc2d0c" has name: "usb 2.0 camera. usb audio default audio device (default:card=camera)" how can such device name using c++? int file = open("/dev/snd/pcmc2d0c", o_rdwr | o_nonblock, 0); if (-1 == file) // check error occurred during opening? { perror("open"); return -1; } if (-1 == ioctl(file, /* appropriate ioctl value device info? */, /* appropriate structure fill device info? */)) { perror("ioctl"); return -1; } there no ioctl values getting device information. in special case it's usb device, has other sources device type information. you can sysfs file system, mounted @ /sys . there directory /sys/bus/usb/devices/ , has symbolic link entries pointing real devices. on system, there example /sys/bus/usb/devices/3-4 . symbolic link leads directory /sys/devices/pci0000:00/0000:...

AngularJS - input that can contain any JS type as ngModel -

how implement field (input validation purposes only) able contain value not have string or number (like object or resource). i want input field behave similar select directive, value can valid js type (object,array,string etc). i want use field validation purposes (it hidden). <input type="hidden" ng-model="fruit" name="fruit citrus-required> <span ng-show="form.fruit.$invalid">pick valid citrus</span> <a ng-click="fruit={name:'banana'}">banana</a> <a ng-click="fruit={name:'orange'}">orange</a> it turns out angular has covered, http://beta.plnkr.co/edit/udq8br6yzhybckyr8kdp don't know if safe ?

mysql - SELECT SUM(CRC32(column)) LIMIT doesn't work -

i need checksum of specific column , specific number of rows using limit . select sum(crc32(column)) table limit 0, 100; but, value returned checksum of entire table. why happen? how can use limit checksum of specific number of rows? the following works: select sum(crc32(column)) table id > 0 , id < 101; but don't want use method because of potential jumps in auto_increment value. why happen? limit gets applied after aggregate functions. when used without group by , sum aggregates on whole table, leaving 1 record, falls under limit . use this: select sum(crc32(column)) ( select column mytable order id limit 100 ) q

c# - Sum of primes for large numbers -

i've been working on problem time , can't figure out why keep getting overflow error. the code works fine point doesn't work larger values. have tested , found the breaking point input 225287 (with last non-breaking value being 225286, gives output of 2147431335). how can work 2,000,000? class sumofprimes{ static void main(string[] args) { primes primes = new primes(2000000); console.writeline(primes.list_of_primes.sum()); console.readline(); } } class primes { public hashset<int> all_numbers = new hashset<int>(); public hashset<int> list_of_primes = new hashset<int>(); public hashset<int> list_of_nonprimes = new hashset<int>(); public primes(int n) { all_numbers = new hashset<int>(enumerable.range(1, n)); (int = 2; < math.sqrt(n) + 1; i++) { (int j = 3; j <= n / i; j++) list_of_nonprimes.add(i * j...

android - Can I use lockCanvas() in onPreviewFrame callback? -

i'm fighting illegalargumentexception when using lockcanvas() in onpreviewframe. basically want achieve grab frame, process it, , draw directly surface of surfacepreview. here code of onpreviewframe @override public void onpreviewframe(byte[] data, camera camera) { canvas canvas = null; if (mholder == null) { return; } int mimgformat = mcamera.getparameters().getpreviewformat(); try { canvas = mholder.lockcanvas(); canvas.drawcolor(0, android.graphics.porterduff.mode.clear); mholder.unlockcanvasandpost(canvas); } catch (exception e) { e.printstacktrace(); } { if (canvas != null) { mholder.unlockcanvasandpost(canvas); } } } i have read lot of documentation , topics camera in android, , suppose locking surface frames drawn onto isn't possible, because it's beyond scope of application control. true? one of possible solutions draw on top of surface view v...

c# - WebBrowser control do not download images -

i automating process of downloading bank statement. way using win forms webbrowser control. navigate https://www.bankofamerica.com/ find username , password textboxes in dom fill them in c# send click event submit button etc etc. statement want download when ready parse page source. the process works slow. in summary improve performance of process these things considering: use fiddler see requests , responses hoping automate same process. (the problem approach connection encrypted have set cookies , belive complicated way). prevent webbrowser control downloading images , css. way page.ready event fire earlier , process faster. i rader go option number 2 because know little fiddler , know basics of http. how can speed process? it's trivial capture encrypted traffic fiddler; enable decrypt https connections option. it's easy disable download of images web browser control using "ambient dlcontrol" flags. see http://www.tech-archive.net/archive/...

java ee - env-entry in ejb-jar.xml not being injected with @Resource when deployed inside WAR file -

i have maven web application has dependency on ejb project. <dependency> <groupid>${project.groupid}</groupid> <artifactid>soar-ejb</artifactid> <version>1.0</version> <type>jar</type> </dependency> in ejb project there i've added env-entry in ejb-jar.xml such: <?xml version="1.0" encoding="utf-8"?> <ejb-jar xmlns = "http://java.sun.com/xml/ns/javaee" version = "3.1" xmlns:xsi = "http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"> <enterprise-beans> <session> <env-entry> <description>config file</description> <env-entry-name>configfilelocation</env-entry-name> <...

security - Occassional Oauth exceptions - user hasn't authorized the app -

i sure application handling things works 88-92% of time, way getting following error: (oauthexception - #200) (#200) user hasn't authorized application perform action i don't understand how possible. when user requested authorize app, not see way them accept subset of permissions required (it's or nothing). if proceed, , auth token, doesn't mean app has needed access? if not, how users doing that, , how can prevent or @ least detect it? in terms of background, application kiosk application takes user's photo , allows them post (or, more precisely, link it) on facebook timeline. kiosk gets user's authorization, passes token , other data central web service communicates facebook. has been working 88-92% of time past week. despite no code changes or application configuration changes, prior past week had been working 93-96% of time couple weeks prior that, , 98% earlier that. is there way can provide details (usernames , auth tokens) facebook more an...

regex - Best way to replace \x00 in python lists? -

i have list of values parsed pe file include /x00 null bytes @ end of each section. want able remove /x00 bytes string without removing "x"s file. have tried doing .replace , re.sub, not success. using python 2.6.6 example. import re list = [['.text\x00\x00\x00'], ['.data\x00\x00\x00'], ['.rsrc\x00\x00\x00']] while count < len(list): test = re.sub('\\\\x00', '', str(list[count]) print test count += 1 >>>tet (removes x, want keep it) >>>data >>>rsrc i want following output text data rsrc any ideas on best way of going this? >>> l = [['.text\x00\x00\x00'], ['.data\x00\x00\x00'], ['.rsrc\x00\x00\x00']] >>> [[x[0]] x in l] [['.text\x00\x00\x00'], ['.data\x00\x00\x00'], ['.rsrc\x00\x00\x00']] >>> [[x[0].replace('\x00', '')] x in l] [['.text'], ['.data'], ['.r...

.net - any way to fix mysql database tables missing mdy and mdi files -

we have mysql databases on 2 separate servers: 1 in dev , 1 in production. today @ around same time ran errors when querying: fatal error encountered during command execution. the db admin looked @ files, , says there no mdy or mdi files tables in databases, , thinks because of that, database doesnt have indices , having trouble. app running against databases has been working fine month. our nightly backups , files never existed ( or maybe not marked backup?) these databases used on mysql 4.1.14-nt, , moved on server mysql 5.2 using mysqldump --add-drop=table command does problem sound familiar anyone? suggestions? turns out when migrated databases, mysqldump generated sql set inno data engine when creating tables in schema. inno evidently doesnt use these mdy , mdi files.

Importing table from SQL server to XML -

i trying import information sql server xml trying create .xml file in e drive. code shown below not working: create proc x declare @xmloutput xml, @myfile varchar(8000) set @xmloutput= ( select top 1000 [tmc_code] ,[measurement_tstamp] ,[speed] ,[average_speed] ,[reference_speed] ,[travel_time_minutes] ,[confidence_score] ,[cvalue] [inrix_data].[dbo].[sample] xml auto) set @myfile='e:\britain.xml' exec x you can use xp_cmdshell , , bcp utility achive this exec xp_cmdshell 'bcp "select * mytable xml auto, elements" queryout "e:\mytablefile.xml" -c -t'

Jquery Not loading on Second Page -

solved matt! so odd bug ive come across redoing new site. have added testimonial second on 1 page , seems have "broken" smooth scroll jquery had working. the beta site here... www.anim-house.co.uk can see scroll working fine. on www.anim-house.co.uk/portfolio.html scroll not work - addition of $(document).ready(function(){ $('#fade').list_ticker({ speed:14000, effect:'fade' }); }); seems have broken it? im amateur when comes jquery if through , figure out error id appreciate it. $('a[href*=#]').each(function() { console.log(this.hash)}) #contact #cgi #web-design #graphic-design #motion-graphics #photography #home #cgi #web-design #graphic-design #motion-graphics #photography #home null null null it last 3 causing error. related links href="#". instead of checking if(target) { check if ($target && target) { edit : op got working this: http://paulund.co.uk/smooth-scroll-to-in...

Convert C++ to C Using C++ in C -

i seem having problem. i'm trying c++ function used in c code. i tried these methods http://www.olivierlanglois.net/idioms_for_using_cpp_in_c_programs.html calling "c++" class member function "c" code if need rid of class altogether ,but don't want lose download feed console. here code works in c++ not in c. #include <tchar.h> #include <urlmon.h> #pragma comment(lib,"urlmon.lib") #include <stdio.h> class mycallback : public ibindstatuscallback { public: mycallback() {} ~mycallback() { } // 1 called urldownloadtofile stdmethod(onprogress)(/* [in] */ ulong ulprogress, /* [in] */ ulong ulprogressmax, /* [in] */ ulong ulstatuscode, /* [in] */ lpcwstr wszstatustext) { printf("downloaded %i of %i byte(s) status code = %i\n",ulprogress, ulprogressmax, ulstatuscode); return s_ok; } // rest don't anything... stdmethod(onstartbinding)(/* [in] */ dword dwrese...

virtual machine - making a virtualbox vm (debian/linux) act as a router? -

i know steps make vm (i using debian/linux machine) act router/forward traffic between 2 networks in virtualbox. trying create virtual network bunch of systems. 1 of machines route traffic between 2 subnets. i have started of configuring multiple interfaces , adding internal networks on these interfaces. not sure if should add rules vm make work router , forward packets. you can install virtual router if metal router. host have network cards each network external network isolated through iptables (firestarter easy way configure this). guest connected networks bridged adapters. host must have valid connection each network (valid address or similar) have adapter working. note iptables filtering host occurs after redirection vbox connection, iptables affect host only, , guest have use own security. can use internal networks generate virtualized networks connect several hosts.

php - can't insert SQL updates -

i'm using jeasy-ui populate data grid. had working earlier today, decided move files around didn't work , rolled changes. unfortunately populates tables , allows me delete rows saving , inserting seems nothing. worst part know it's simple i've been @ 4 hours , it's time ask i'm not seeing. edit was missing comma after 'date' => $date on save_user.php. knew simple. help. html: <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="keywords" content="jquery,ui,easy,easyui,web"> <meta name="description" content=""> <title>scheduler</title> <link rel="stylesheet" type="text/css" href="css/black/easyui.css"> <link...

Python: Big set of 2D numpy arrays... how to visualize in 3D? -

i have big set (100+) of 256x256 scalar 2d numpy arrays. each array slice through 3d image , each arrays uniformly separated. i'm bit of python noob... tips on how create nice 3d visualization of data? do need compile 100+ 2d scalar arrays larger 3d one? cheers! you're going need give little more information, because how visualize depends on want out of it! note question going have multiple possible answers, you're trying display information inherently 3d on 2d screen. one way create movie of 2d "surface" plots, , play them back. plotting slices 1 after another. if want view 3d data @ once, can't, don't know of volumetric plotting tools python. closest thing mayavi if give more information on want accomplish, detail possible, can point more specific examples/code resources.

freebsd - using kqueue for EVFILT_USER -

i have trouble understand, how use kqueue user space events. 2 use cases. use case 1: manual reset event use case 2: auto reset event i think understand, how use kqueue() , kevent(), yet unclear on how events passed kevent() related operations: let there struct kevent variable named "event". let assume, have no problem finding new event id not colliding other event ids kqueue instance, named "eventid". create user event: ev_set(&event, eventid, evfilt_user, ev_add, note_ffnop, 0, null) destroy user event: ev_set(&event, eventid, evfilt_user, ev_destroy, note_ffnop, 0, null) set user event: ev_set(&event, eventid, evfilt_user, ?????, note_ffnop, 0, null) reset user event: ev_set(&event, eventid, evfilt_user, ??ev_clear???, note_ffnop, 0, null ) pulse user event: ev_set(&event, eventid, evfilt_user, 0, note_trigger, 0, null ) in wait loop, think snipped along: if( event.filter == evfilt_user && event.ident == eventid ) {...

Am i correctly using indexes for this mongoDB? -

so need advice i'm doing incorrectly. my database setup file system consisting of folders , files . begins folder, can have relatively infinite number of subfolders , or files. { "name":"folder1", "uniqueid":"zzz0", "subcontents": [ {"name":"subfolder1", "uniqueid":"zzz1"}, {"name":"subfile1", "uniqueid":"zzz2"}, {"name":"subfile2", "uniqueid":"zzz3"}, {"name":"subfolder2", "subcontents": [...etc...], "uniqueid":"zzz4"}, ] } each folder/file document have uniqueid can reference (seen above zzz#). question is, can make mongodb query pull out single document? like example db.filesystemcollection.find({"uniqueid":"zzz4"}) , give me following re...

postgresql 8.4 - How to change a status in sql correlating with time -

hi doing project stuck in following question asks me make booking entry travel agency using previous records such bookingid, customerid, flightid number, passenger details etc , booking can have status of reserved or held . if seat confirmed right away reserved , if not passenger has 24 hrs reserve , change held reserve status. also, if seat isn't booked after 24 hrs changes expired status. so far able come insert (values) different tables , when booked right bookingid.status = r or bookingid.status = bookingtime > 24 = e without clue here appreciate !!! there many ways of doing this, easiest initialize booking status reserved if booked right away , if it's not put held . now, have rely on view (or similar approach) dynamically calculated status. if user reserves booking @ later time, have update booking status reserve. note dont necessary suggest represent statuses strings, example. select case when status = 'held' , datediff(hh...

Android Application Crashing When Switching Activities -

upon clicking item of listview want new activity start up. when run through emulator application crashes every time. positive androidmanifest correct well. appreciated. public static class sectionfragment extends listfragment { /** * fragment argument representing section number * fragment. */ public static final string arg_section_number = "section_number"; private string dataarrayone[]; private string dataarraytwo[]; public sectionfragment() { dataarrayone = new string[] { "steven's portfolio", "sean's portfolio", "logan's portfolio", }; dataarraytwo = new string[] { "goog", "yhoo", "aapl", "msft" }; } @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinst...

java - Showing contents of a LinkedStack without removing them -

i beginner in java , working nodes. wondering if there way show content of list without having use .getnext method, because once use it, removes element on node literally removes node on top. trying in code using input store 2 string elements in new 2 nodes using method provetitle prove elements on list. once make sure elements still intact , use tostring method check list. note in class of book strange reason t isnt showing besides class , implemented class if put <> around it. heres code: mynode class: public class mynode<t> { private t data; private mynode next; public mynode(t _data) { data = _data; } public mynode(t _data, mynode _next) { data = _data; next = _next; } public t getdata() { return data; } public void setdata(t _data) { data = _data; } public mynode getnext() { return next; } public void setnext(mynode _next) { next = _next; } } interface class: public interface myinterface<t> { public void pushtitle(t d...

javascript - Add checkbox value to another hidden input field if first hidden field has content -

i have group of 4 checkboxes. when 2 have been checked have values copied 2 hidden input fields. the first checked checkbox value goes first input id="checkedbox1" how second checked checkbox value go second hidden input field id="checkedbox2" i have used javascript function below place values each input individual checkboxes can't figure out how iterate through list of 4 checkboxes , place 2 checked ones each separate input field. checkboxes: <input type="checkbox" value="test1" id="a" name="one"><label>test11</label> <input type="checkbox" value="test2" id="b" name="one"><label>test12</label> <input type="checkbox" value="test3" id="c" name="one"><label>test13</label> <input type="checkbox" value="test4" id="d" name="one"><la...

rspec2 - Rspec request specs and session values -

i writing request specs (rspec 2.13.1) , directly access session hash. think syntax possible in controller specs not sure if can can done in request specs. describe 'api' let(:user) { factorygirl.create(:user) } session[:auth_token]=user.auth_token i following error: failure/error: session[:auth_token]=user.auth_token │lock (2 levels) in top_level' nomethoderror: │/users/jt/.rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/application.rb:101:in `e undefined method `session' nil:nilclass │ach' # ./spec/requests/api_spec.rb:7:in `block (2 levels) in <top (required)>' i have seen following question access session hash in request spec not sure if accurate. thx in adva...

database - In Java, Why ResultSet does not allow you to run next() more than 1 time? -

look @ code: resultset results=preparedstmt.executequery(); while (results.next()){ string subject=results.getstring(1); system.out.println(subject +" 1st time"); } while (results.next()){ string subject=results.getstring(1); system.out.println(subject+ " 2nd time"); } why system prints out result @ 1st time, & not print out result in second time? if want run results.next() more 1 time, proper way code? while( rs.next() ) advance 'current row' cursor end of set. by default, resultset read-only , forward only, once end, you'll need call first() start over. note: first() optional method , may not supported driver.

ruby - How to access nested parameters in Rails -

in controller, i'm trying access parameter nested. here parameter trace. parameters: {"utf8"=>"✓", "authenticity_token"=>"2j+nh5c7jpknosqnwoa0wtg/vwxlmpykt6aic2umxgy=", "inventory"=>{"ingredients_attributes"=>{"0"=>{"ingredient_name"=>"bread"}}, "purchase_date"=>"11", "purchase_price"=>"11", "quantity_bought"=>"11"}, "commit"=>"create inventory"} i'm trying retrieve "bread" this. tried params[:inventory][:ingredient][:ingredient_name] , other variations. correct styntax? if matters, inventory has_many :ingredients inventory accepts_nested_attributes_for :inventories thanks! direct access value "bread" literally be: params[:inventory][:ingredients_attributes]["0"][:ingredient_name] i bet don't want that. with a...

ios - Telling the difference between UserLocation Pin and user added pins -

i trying solve problem i'm not sure how solve. in app, when mapkit launches, drop pin @ user's current location. mapkit delegates viewforannotation sets pin's color works fine. the issue i'm running cannot tell annotations apart can apply different color "user added locations" vs. "current location" pin. add button can delete pins add not able delete "current location" pin. can't seem figure out how extract identifiable pieces of information title or subtitle of pin. thanks in advance help. here's code... - (mkannotationview *)mapview:(mkmapview *)mapview viewforannotation:(id <mkannotation>)annotation { nslog(@"oaassignmentgpsviewcontroller.m : mapview viewforannotation"); if([annotation iskindofclass: [mkuserlocation class]]) return nil; nslog(@" mapview.userlocation.title = %@", self.mapview.userlocation.title); static nsstring* annotationidentifier = @"current...

android - How to get contact name when receiving SMS -

i have following code receive sms , trying contact name. package com.example.smstest; import android.content.broadcastreceiver; import android.content.context; import android.content.intent; import android.database.cursor; import android.net.uri; import android.os.bundle; import android.provider.contactscontract; import android.provider.contactscontract.phonelookup; import android.telephony.smsmessage; import android.widget.toast; public class smsreceiver extends broadcastreceiver { private sqliteadapter mysqliteadapter; @override public void onreceive(context context, intent intent) { mysqliteadapter = new sqliteadapter(context); mysqliteadapter.opentoread(); message message = null; bundle extras = intent.getextras(); if (extras == null) return; object[] pdus = (object[]) extras.get("pdus"); (int = 0; < pdus.length; i++) { smsmessage smessage = smsmessage.createfrompdu(...

java - Get paragraph style in JTextPane -

i'm doing text editor using jtextpane , need add colors words want if user clicks on area colored, painted color (paragraph style), not logical style. looking getparagraphattributes wasn't able paragraph style property. how paragraph style in jtextpane ? private style getcolor(string token) { if (token.equals("while")) return editor.getstyle("blue"); return editor.getlogicalstyle(); //at point want current not logical if it's possible. } try use ((styleddocument)textpane.getdocument()).getparagraphelement(position).getattributes();

css - Resize image keeping both sizes on ratio -

i have photo blog on final stages , last problem i'm struggling with. layout has fixed menu bar on right , content flows on right. when photo opened gallery page it's own, supposed resized either side not on (for example) 70% of free space. not that. should stay in horizontal , vertical center of right content div. @ point works except when image portrait goes on screen. is possible achieve css please few percent has js not activated? if not, thats not deal breaker. the html: <div id="wrapper"> <div id="left_column"> </div> <div id="right_column_post"> <div id="post_container"> <img src="img.jpg" width="1000" height="750"/> </div> </div> </div> the css: #left_column { position: fixed; top: 0; bottom: 0; left: 0; z-index:100; width: 240px; height: 100%; overflow: hidden; } #ri...

sql - Can i write this group by query without group by? -

i've written query find how many orders placed each customer? can write same querying without using group clause? using somekind of subquery , join. select c.customerid, count(si.customerid) customer c left outer join salesinvoice si on si.customerid = c.customerid group c.customerid select c.customerid, count(si.customerid) over(partition c.customerid) customer c left outer join salesinvoice si on si.customerid = c.customerid

segmentation fault - C: "Invalid free(): Address 0x7feffee08 is on thread 1's stack" -

this not exact code, in essence. i'm trying create stack variable in main() int **x; that want pass function foo(int **x, arg1, arg2, ...). on condition, i'm supposed dynamically allocate space x in foo() x = (int **) malloc(sizeof(int *) * num_elems); i not allocating new space each int * element, assigning &y, int y created in foo(). i got error when tried freeing x in main(). don't understand means, suspect might because used &y? edit: relevant: got garbage values when tried accessing double-dereferenced elements of x. you not correctly declared in main function , not correctly defined in foo() function. have declare as in main function int *x ; foo(&x); in foo(int **x,....) *x = malloc(sizeof(int) * num_elems);

Capacity and Tenancy of Reserved Instances on Azure -

i'm looking @ azure reserved web sites option asp.net application hosting. couldn't find information following 2 aspects: is reserved instance size/resources (e.g. medium vm, 2 x 1.6ghz cpu, 3.5gb ram) shared instance os , os services, vm? or dedicated computing capacity excluding os? in blog post ( http://weblogs.asp.net/scottgu/archive/2012/09/17/announcing-great-improvements-to-windows-azure-web-sites.aspx ) scott guthrie mentioned running multiple sites in single reserved instance (much vm without fully-managed), it's not clear me how multiple sites (with different domains names) setup/configured in reserved instances management tool: you run single site within reserved instance vm or 100 web-sites within same cost any clarification appreciated. just vm, shared instance os , os services. for hosting multiple web sites in reserved instance...read here... is possible have multiple azure web sites running off single reserved instance also. , ho...

Data analysis/manipulation in excel -

i'm new excel , might beginner question please bear me, i'm trying following: if have data in excel sheet goes - -- running case : 03_mileage.cry ...... result : ok -- running case : 07_option mode.cry ...... result : ok -- running case : 10_80 columns.cry ...... result : ok -- running case : 11_split tag.cry ...... result : ok -- running case : 12_tqc.cry ...... result : error what want move sheet case in 1 column , result in corresponding column. prefer using excel formulaes on vb. thanks, abhinaya if first sheet (sheet1) looks this: a1: -- running case : 03_mileage.cry ...... a2: result : ok a3: -- running case : 07_option mode.cry ...... a4: result : ok a5: -- running case : 10_80 columns.cry ...... a6: result : ok a7: -- running case : 11_split tag.cry ...... a8: result : ok a9: -- running case : 12_tqc.cry ...... a10: result : error then, on new spreadsheet ( within same workbook ) can refer range of worksheet this: a1: =sheet1!a...

php - jQuery val() returning previously selected element value -

i have javascript function handle dynamic ids table. table: <table border = "0" width = "95%" class = "table table-striped table-bordered" id = "tblinfochecks"> <thead> <tr> <th><center>#</center></th> <th><center>category</center></th> <th><center>name</center></th> <th><center>date</center></th> <th><center>due date</center></th> <th><center>allocation</center></th> <th><center>status</center></th> <th><center>tat</center></th> <th><center>action</center></th> </tr> </thead> <tbody> <?php $q = "select * check...

Codeigniter - cookies do not work in internet explorer 8 -

this code works in browsers except internet explorer 8 $this->input->set_cookie(array( 'name' => 'test_cookie', 'value' => 'hello cookie', 'expire' => 360000000, 'secure' => false )); echo get_cookie('test_cookie'); how solve problem? why not set_cookie? try: echo $this->input->cookie('test_cookie');

php - Why is it that the VALUES of my INSERT statement were turned to SPACES after the execution? -

//here function block public function create_accnt() { $post = $this->input->post(); //gets possible posts in array form echo "post array: ";print_r($post); // make sure array has values $data = array( 'userid' => $post['user_id'], 'lastname' => $post['lname'], 'firstname' => $post['fname'], 'username' => $post['username'], 'password' => $post['password'], 'usertype' => $post['user_type'], 'status' => 'a' ); // assigning values specific fields inserted $query = $this->db->insert('accounts', $data); //insertion via active record echo "<br/>result of db last query: "; echo $this->db->last_query();//to see how query looks in code form if($query) { return true; } else ret...

iphone - NSDate is not transformed correctly -

i trying transform datestring format. doing this. nslog(@"datestring %@",_dayobject.p_date); nsdateformatter *dateformat = [[nsdateformatter alloc] init]; [dateformat setdateformat:@"yyyy-mm-dd"]; nsdate *date = [dateformat datefromstring:_dayobject.p_date]; nslog(@"date transformed %@",date); [dateformat setdateformat:@"eeee, dd/mm/yyyy"]; [dateformat settimezone:[nstimezone timezonewithabbreviation:@"gmt"]]; nsstring *datestr = [dateformat stringfromdate:date]; nslog(@"datestring after %@",datestr); but nslogs 2013-04-18 08:43:36.181 mosaqua2[9629:907] datestring 2013-05-04 2013-04-18 08:43:36.184 mosaqua2[9629:907] date transformed 2013-01-03 23:00:00 +0000 2013-04-18 08:43:36.184 mosaqua2[9629:907] datestring after donderdag, 03/01/2013 what want saterday, 04/05/2013 can me ? use bellow custom method convert date format ... -(nsstring *)changedateformat:(nsstring*)stringdate dateformat:(nsstring*...

flash - How to create an exe file for adobe air project? -

i created adobe air project in flash builder 4.5. created native executable file, when double click it, first installed , able run it. question is: can create executable don't need install before using it. or can other way? as in mfc when build project create executable not need installed. thanks what have done in past achieve same result use c#. first create blank document load library's "adobes" project, there can pack , create exe same other windows exe installer, can use c# installer pack.

documentation - How to use Doxygen from command line with relative paths in configuration file? -

i have problem creating documentation doxygen configuration file. call config file command: doxygen "%~dp0doc\pdf_user\dsctest2certificate_user.doxyfile" . path returned %~dp0 correct , configuration file called correct , started. using realtive paths like: input = ../../src in doxygen config file, working nice, if call doxygen file eclox in eclipse , output build correctly. if call in cmd following error, folder/file not found: warning: source ../../src not readable file or directory... skipping. can keep relative paths instead of absolut , why there no output directory created called latex ? (if call in eclox plugin, there folder called latex near doxygen configuration file) thank in advance. edit: found solution myself: the default output directory directory in doxygen started. found on documentation site. saw in wrong directory , had cd fitting dir. not anymore doxygen "%~dp0doc\pdf_user\dsctest2certificate_user.doxyfile" , --> cd "%~dp0...

java - conversion to GMT giving problems during DST -

i facing problem in our existing application time entered employee (from org/store using time clock application) first converted gmt , stored in db. , displaying back, time in gmt converted store local time zone , displayed. in of cases works fine not when time zone moves dst , vice versa. let me more specific. suppose standard time zone of store gmt-8 , employee punches @ 08:00 in morning, time converted gmt gives 16:00 , stored in db. conversion process first converts 08:00 store local time somehow gives 17:00 cet , 17:00 cet converted gmt gives 16:00 cet. but if take example of 31 march when dst happens 02:00 becomes 03:00 am. suppose emplyoee punches @ 18:00 (on 30 march) returns me 04:00 cest during first conversion local , when convert gmt gives 03:00 cest. while converting gives 19:00 not correct. design says local times converted utc , stored in db if still utc should store 02:00 , not 03:00 because gmt/utc not have dst. the code used conversion is: step 1 fina...

winapi - Shell32.lib not found when compiling for Windows Mobile 6 -

i tried compile simple windows mobile 6 project uses shbrowseforfolder api call. have included shell32.lib in project linker dependencies. somehow, shell32.lib seems missing in armv4 sdk. there workaround this? thanks. shell32.lib desktop library. windows ce uses ceshell.lib , as stated in docs . don't know if it's available in winmo. since os customizable, , winmo team rewrote entire shell, it's possible omitted.

ruby - Rails: replacing try with the Null Object Pattern -

in of applications, have current_user method. avoid exceptions in cases current_user.name current_user nil , rails provides try method. problem need remember use try wherever current_user might nil . i want use null object pattern remove additional overhead. class nulluser def method_missing(method_name, *args) nil end end def current_user return nulluser.new unless usersession.find @current_user ||= usersession.find.user end this can replace try in cases: current_user.try(:first_name) #=> nil current_user.first_name #=> nil but fails further chaining: current_user.profiles.first.name #=> undefined method... i tried return null object: class nulluser def method_missing(method_name, *args) self.class.new end end current_user.try { |u| u.profiles.first.name } #=> nil current_user.profiles.first.name #=> nil but fail in other cases: current_user.is_admin? #=> #<nulluser...

javascript - How to load local files if CDN is not working -

i using cdn js , css files. i searched in google how load local data if cdn not working. i found link written this <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript"> if (typeof jquery == 'undefined') { document.write(unescape("%3cscript src='js/plugins/jquery-1.8.2.min.js' type='text/javascript'%3e%3c/script%3e")); } </script> yes working tried cdn network ,then not downloading local. if cdn not working showing error in page , page not working due missing js file. means : <script type="text/javascript" src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script> <script type="text/javascript"> if (typeof jquery == 'undefined') { document.write(unescape("%3cscript src='include/j...

Javascript HTML5 audio - Dont play sound if already playing? -

i have set html audio on site , have set autoplay function after couple of seconds, sound seems loading twice? 1 starts playing straight after other although, 1 ghost , cannot see player it. how go telling javascript not start playing sounds if there sounds playing? <audio controls="controls" onloadeddata="var audioplayer = this; settimeout(function() { audioplayer.play(); }, 2000)" }> <source src="http://www.alanis50.com/music/music.mp3" type="audio/mp3"/> <source src="http://www.alanis50.com/music/music.ogg" type="audio/ogg"/> </audio> the above issue has been solved wanted add flash fallback audio internet explorer , added: <div id ="audio"> <script>var readingmusic = false; </script> <audio controls="controls" loop="loop" onloadeddata="var audioplayer = this; if (!readingmusic){readingmusic = true;settimeout(function() { au...

Microsoft Word Macro to modify and paste clipboard text -

my goal to: copy text in pdf clipboard in single move (using macro, suppose), paste text ms word while replacing line breaks space matching destination's formatting i have accomplished create macro replaces line breaks spaces in whole documented, or in selected part, not in clipboard. currently, macro looks this: selection.find.execute replace:=wdreplaceall selection.wholestory selection.pasteandformat (wdformatoriginalformatting) selection.find.clearformatting selection.find.replacement.clearformatting selection.find .text = "^p" .replacement.text = " " .forward = true .wrap = wdfindcontinue .format = false .matchcase = false .matchwholeword = false .matchwildcards = false .matchsoundslike = false .matchallwordforms = false end which replaces whole text @ moment... on how apply replacement clipboard , paste replaced snippet appreciated! in advance. i propose way: remember current selection p...

android - How to bluring and debluring bitmap on seekbar change -

i developing image processing , want apply blur effect using seekbar. using code below blur bitmap , works want deblur bitmap can not achieve...plz me out problem private bitmap blurfast(bitmap bmp, int radius) { int w = bmp.getwidth(); int h = bmp.getheight(); int[] pix = new int[w * h]; bmp.getpixels(pix, 0, w, 0, 0, w, h); for(int r = radius; r >= 1; r /= 2) { for(int = r; < h - r; i++) { for(int j = r; j < w - r; j++) { int tl = pix[(i - r) * w + j - r]; int tr = pix[(i - r) * w + j + r]; int tc = pix[(i - r) * w + j]; int bl = pix[(i + r) * w + j - r]; int br = pix[(i + r) * w + j + r]; int bc = pix[(i + r) * w + j]; int cl = pix[i * w + j - r]; int cr = pix[i * w + j + r]; pix[(i * w) + j] = 0xff000000 | (((tl ...