Posts

Showing posts from September, 2013

GXT 3.x EditorGrid: choose cell editor type on a cell by cell basis -

is there anyway define editor type on cell cell basis in gxt 3.0 ? i need create transposed table; column become row , row column. being case, column (from normal table point of view) have various editor type, whereby row have identical editor type. i trying use following approach - seems working fine, , allow open editors based on data type when click out; doesn't close/hide editor. i appreciate if can please point me in right direction. final gridinlineediting<mymodel> editing = new gridinlineediting<mymodel>(mygrid){ @suppresswarnings("unchecked") @override public <o> field<o> geteditor(columnconfig<mymodel, ?> columnconfig) { if(valuecolumnname.equals(columnconfig.getheader().asstring())) { mymodel mymodel = tree.getselectionmodel().getselecteditem(); if(mymodeltype.string.equals(mymodel.getmymodeltype())) { textfield textfield = new textfield();

apache - How to point two domains to the same root directory in order to run multiple drupal sites -

i trying point 2 domains same root directory. both shared same nameserver , ip address. created file: vhost.conf i put file in http://firstdomain.com conf folder file has 1 line of code: documentroot /var/www/vhosts/seconddomain.com the firstdoman.com still not picking new root folder. , have 2 directories inside /sites directory name after 2 domains both have files , settings.php file. , default directory has not been modified. i made youtube video answers question: http://www.youtube.com/watch?list=pl_aby6eqruxryspxkkthzwvmkcbc0x2f9&feature=player_detailpage&v=lwxrc5vivam

Average across many files on matlab -

i wondering if can this. have many .mat files array in each , want average each cell individually (average (1,1)s, (1,2)s, ... (2,1)s etc.) , store them. thanks help! i'm not quite sure how data organised, can this: % assume know size of arrays , variables r , c % hold numbers of rows , columns respectively. xtotals = zeros(r, c); xcount = 0; % each file: assume data loaded variable called x, % r rows c columns ... xtotals = xtotals + x; xcount = xcount + 1; end xavg = xtotals / xcount; and xavg contain average each array cell. note know xcount without having count each time go round loop, depends on getting data. idea!

date - MySQL: Returning records from the current month and previous 3 months -

i'm using php/mysql booking system , i'm using google line chart try , display gross sales current month, , previous 3 months. each booking has date in standard phpmyadmin "date" format, yyyy:mm:dd. so, im looking 4 results 4 queries, each query filtering out month , grabbing sum of each booking month. my question is, how can distinguish between months in query? how structure query? based on title: select * bookings month(curdate())=month(booking_date); select * bookings month(booking_date) > month(curdate()-interval 3 month) , < month(curdate() + interval 1 month); for simple per-month searches can use following: select * bookings monthname(booking_date)='july' , year(booking_date)=2013; or: select * bookings month(booking_date)=7 , year(booking_date)=2013; also since you've got months, (this method requires maintain table of ending dates each month compensate leap year though): select * bookings booking_date>'

linux - Can .emacs location be specified with an environment variable? -

i work in environment log in ourselves, sudo common user. (bleah). i'm starting use emacs , specify own .emacs file @ launch. think want specify location of .emacs environment variable, don't see way in emacs documentation. there one? as alternative, perhaps need learn elisp , conditionally load own file out of common .emacs file located in /home/common_user/.emacs? in case, have environment variable sudo_user set name 'lcuff', , environment variable my_conf set /foo/bar/blah/lcuff, wherein i'd store own .emacs file. how this? thoughts , advice appreciated. see: c-h i g (emacs) find init ret failing else, can specify $home command env : env home=/foo/bar/blah/lcuff emacs

php - Check If User Subscription Is In Date - Not Working -

i have code in login script check if users subscription in date: // current date $now = date("y-m-d"); if ($user_id['enddate'] < $now) { ?> <p>your licence out of date</p> <?php } else { ?> <p>your licence in date</p> <?php } the value storing expiry date 'enddate'. it goes straight out of date message, whether user has subscription in date or not. can't head around it. the mysql field enddate type 'date', , generated registration script: $enddate = date("y-m-d", strtotime("+ 365 day")); any ideas? know i'm working in depreciated mysql, need project. cheers you need convert time, date string... $now = strtotime(date("y-m-d")); if (strtotime($user_id['enddate']) < $now) { ?> <p>your licence out of date</p> <?php } else { ?> <p>your licence i

PHP validation function. Check for numeric and positive -

little confused how code this. user inputs numbers, validation checks make sure numeric , positive. user can leave field blank. this have far, checks see inserted. $error_blue = check_blue($phone); if($error_blue !=''){ print "<p>blue: $error_blue"; } is item validated @ top of page. function check_blue($blue){ if(! is_numeric($blue)){ return'please enter valid number blue.'; }} is function is. on here appriciated. something this? function check_blue($blue) { if (is_numeric($blue) && $blue > -1) { return 1; } else { return 0; } } if(!check_blue($phone)) { return'please enter valid number blue.'; } see demo

batch file - How do I re-write this DOS command without using the PIPE symbol? -

i use command verify if particular schedule task exists: schtasks.exe | findstr /i /c:taskname i need write not use pipe "|" tried this: schtasks.exe /query /tn taskname but works windows 2008, not windows 2003 machines since /tn option not available in 2003. any ideas? thank you! heh, yeah. schtasks /query >tmpfile && findstr /i /c:"taskname" tmpfile doesn't use pipe. :>

vb.net - Sending PictureBox Contents to MsPaint -

how go sending contents of picturebox edited in paint? i've thought of saving temporarily sending temp address loaded, i'd think cause minor saving issues. unfortunately i'm providing answer in c# @ time. luckily, syntax , not content have change. assuming picturebox control, take contents (as bitmap) , put on clipboard. can paste mspaint you'd sendmessage or sendkeys if make foreground, etc. bitmap bmp = new bitmap(picturebox1.image); clipboard.setdata(system.windows.forms.dataformats.bitmap, bmp); a poor example, optional opening of mspaint , waiting appear, using sendkeys paste. [dllimport("user32.dll", setlasterror = true)] public static extern intptr findwindowex(intptr parenthandle, intptr childafter, string classname, string windowtitle); [dllimport("user32.dll")] private static extern intptr getforegroundwindow(); [dllimport("user32.dll")] [return: marshalas(unmanagedtype.bool)] st

How to invoke a java static method from jruby -

how do this? include java thread.currentthread.sleep 3 i saw posting several years ago did not directly answer question. thx either: java::javalang::thread::sleep 3 or java::javalang::thread.sleep 3 (note static call sleep() on thread causes current thread sleep, no need call currentthread() , , sleep time in millisecond). here example (if use jruby prior 1.7, need add require 'java' ): t = java::javalang::thread.new puts "hi." java::javalang::thread::sleep 3000 puts "done." end t.start

javascript - How to avoid to display JSON string with custom typeahead -

i have overridden typeahead methods enable ajax calls (getting json object results since need field name display, , field url hide). but it's not enough, works when user tape research, if pick result, or press tab , there json string appears in input, like: { "name":"test", "url":"http://mysite.com/test" } i want display field name in input, in dropbox overriding highlighter method, don't know if it's possible. highlighter: function (obj) { var item = json.parse(obj); var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&') return item.name.replace(new regexp('(' + query + ')', 'ig'), function ($1, match) { return '<strong>' + match + '</strong>' }); } is there way simple thing? i couldn't understand provide methods can override if can't... typeahead 2.x not allow storage or loading o

Obtaining the most reoccurring attribute in SQL -

using sql, have table list of usernames , trying output repeated 1 out using max. new sql appreciated! thanks you can use aggregate function count() total number of times username repeated: select username, count(username) total yourtable group username order total desc then depending on database can return username appears most. in mysql, can use limit : select username, count(username) total yourtable group username order total desc limit 1; see sql fiddle demo in sql server, can use top : select top 1 ties username, count(username) total yourtable group username order total desc see sql fiddle demo

java - How do I create custom classes as subroutines -

i may have terms mixed up, i'm creating android app , want encapsulate of routine functions. instance actionbar. @ first had code on activities , if change 1 thing have change else where. want create navigationactionbarmanager.java file handle inital setup, onnavigationlistener, setlistnavigationcallbacks, etc. here's class far: import android.app.actionbar; import android.app.actionbar.onnavigationlistener; import android.app.activity; import android.content.intent; import android.view.menu; import android.widget.arrayadapter; import android.widget.spinneradapter; public class navigationactionbarmanager extends activity { public actionbar actionbar = getactionbar(); // actionbar object // method: display public void display() { actionbar.setdisplayshowtitleenabled(false); actionbar.setdisplayhomeasupenabled(true); actionbar.setnavigationmode(actionbar.navigation_mode_list); } // method: inflate public void inflate(

c++ - How to make an array print zeros when there is no input in that slot -

the user inputs double , string gets stored 2 arrays. : { double doc; string nm; cout << " please enter amount charged credit card " << endl; cin >> doc; cout << " please enter charge made " << endl; cin >> nm; getline(cin, nm); cca.docharge(nm,doc); break; } then double , string passed : { if (amount > 0) { (int = 9; != 0; i--) { last10withdraws[i] = last10withdraws[i-1]; last10charges[i] = last10charges[i-1]; } last10withdraws[0] = amount; last10charges[0] = name; setbalancew(amount); } else { cout << " error. number must greater zero. " << endl; } return 0; } this seems work storing data arrays. use function displ

c++ - Why not set class members to public in the first place? -

this question has answer here: why use getters , setters? 38 answers i can't understand why people keep saying when make class should make get() method variable in class, , set() method set variable in class. if have get()/set() method... why not make variable public in first place? it's not if accidentally change anyway since still need type myclassname.variable am missing something? using get/set functions gives flexibility change class implementation later without having change code accesses class. for example, might change type of 1 of internal variables, or want add restrictions on values variable can set to. perhaps might want calculate value on demand. also, can make get/set function non-inline, , put breakpoint on it.

Android screen freezes, while saving to DB -

following coding downloading data web , on post execute save db , update listadapter gui. problem when saving db, screen freezes time getting saved in db , 600 records 20 secs. please let me know, how can change this, ui not freeze. private class downloadwebpagetask extends asynctask<string, void, string> { public downloadwebpagetask() { } @override protected void onpreexecute() { super.onpreexecute(); progressdialog = progressdialog.show(getactivity(), "please wait...", "retrieving data ...", true); progressdialog.setcancelable(true); } } } @override protected string doinbackground(string... urls) { string response = ""; (string url : urls) { defaulthttpclient client = new defaulthttpclient(); httpget httpget = new httpget(url); try { inputstream content = clie

vba - DoEvents, Waiting, and Editing -

i have set of code contains: application.wait (now + timevalue("4:00:00")) this pausing macro 4 hour window 3 (when finishs running code) till 7 (when should resume). code on endless loop essentially. i want user able have control during time edit cells. have tried doevents but have not found way keep macro running, yet provide control user during time when macro doing nothing waiting. any insight appreciated. thanks! edit: one more followup question. created macro reference actual macro "production_board". want macro run time , refresh possible. using goto startagain, tries start launch macro again before macro has started due "ontime" delay interval. how make sub runmacro start again second macro "production_board" finishes? sub runmacro startagain: dim hour integer dim ot string hour = 0 ot = "empty" hour = sheets("calculations").range("dr1").value ot = sheets("black").range(&q

python - Calling numpy function from C-code -

i'm trying move matlab code mex extensions python numpy , scipy libraries. using wonderful tutorial http://www.scipy.org/cookbook/c_extensions/numpy_arrays , quite adopt c-functions calling python. c-functions call matlab functions, have substitute code calling numpy , scipy functions c-code. i've tried extending , embedding python interpreter . however, faced problem: how pass array function argument. long way find function in module , build tuple arguments doesn't seems elegant. so, how call sum function in numpy module c-code, example? i'll appreciate ideas or links. ruben p.s. here example: pyobject *feedback(pyobject *self, pyobject *args){ pyarrayobject *vecin; double mp=0,ret; if( !pyarg_parsetuple(args,"o!d",&pyarray_type,&vecin,&mp) || vecin == null ) return null; /* make python string module name */ pyobject *pname = pystring_fromstring("numpy"); if( pname == null){ fprin

javascript - Accessing the file written using Cordova -

i have created file using cordova file api in worklight. wnat read file once write event done. tried writing function call readastext() in writer.onwriteend event. file not being read. "exclusive" option have this? works fine till read(), , there no error, no message.. think not reading file. once error occurred on reader.onloadend event : read error {"type":"error","bubbles":false,"cancelbubble":false,"cancelable":false,"lengthcomputable":false,"loaded":0,"total":0,"target":{"filename":"file://c:\users\ibm_admin\cordova\filesystem\persistent\rqm\executionresult.xml","readystate":2,"result":null,"error":{"code":1},"onloadstart":null,"onprogress":null,"onload":null,"onabort":null}} here code: window.requestfilesystem(localfilesystem.persistent, 0, onfilesystemsucce

c# - How to create SampleDataSource for GridApp template using images that stored at PicturesLibrary? -

i trying create datasource gridapp. images pictureslibrary using getfilesasync(). modified sampledatasource.cs: in data structure use storagefile imagepath instead of string imagepath. , of course wrote code creates bitmapimage storagefile using irandomaccessstream instead of creation bitmapimage uri. so code can compiled doesn't work. here reasons of it: async method getfilesasync() not blocks main thread. , groupeditemspage.xaml.cs asks sampledatasource before getfilesasync() provides necessary information. cause exception typeinitializationexception. the obvious solution use sync analog of getfilesasync(). there new problems: it seems it's impossible files knownfolders.pictureslibrary synchronously. it's whole bad idea, because if have big amount of pictures generation of groupeditemspage cause freezing. so, how can solve problem? asking conception of solution. how should organize architecture of app?

rename - Renaming files with inode number [UNIX] -

i'm trying rename file attaching underscore , inode number of said file before move directory. the description is: to avoid name conflicts in recycle bin, change file name original name followed underscore, followed inode file. example, if file named "f1" inode 1234 removed, file named f1_1234 in recycle bin. any ideas? it easy if parallel available : ls f* | parallel 'mv {} newdir/{}_`stat -c%i {}`'

Chrome Developer tools numbers after each files name? -

Image
i debugging website using developer tools, if refer image, there 2 styles.css overwrite 1 another. it weird though, because remember have 1 style.css file attached showing 2 style.css instead. have checked location pointing same path same css file(but content of css different.) the difference can spot number after css file name shown devtools style.css:839 style.css:190 what means actually? it line number of selector present in file(style.css). in line number 190, have added style selector(providedsupport). in same file, have added style same selector @ line number 839 have @ chrome dev tools, has more feature : refer link

android - Media Player socket exception in Samsung Grand -

we playing media through local proxy server. fine till new samsung grand device. in specific device getting socket exception following: 4-04 17:55:35.646: w/system.err(15187): java.net.socketexception: sendto failed: econnreset (connection reset peer) 04-04 17:55:35.646: w/system.err(15187): @ libcore.io.iobridge.maybethrowaftersendto(iobridge.java:506) 04-04 17:55:35.646: w/system.err(15187): @ libcore.io.iobridge.sendto(iobridge.java:475) 04-04 17:55:35.646: w/system.err(15187): @ java.net.plainsocketimpl.write(plainsocketimpl.java:507) 04-04 17:55:35.656: w/system.err(15187): @ java.net.plainsocketimpl.access$100(plainsocketimpl.java:46) 04-04 17:55:35.656: w/system.err(15187): @ java.net.plainsocketimpl$plainsocketoutputstream.write(plainsocketimpl.java:269) 04-04 17:55:35.656: w/system.err(15187): @ java.io.bufferedoutputstream.flushinternal(bufferedoutputstream.java:185) 04-04 17:55:35.656: w/system.err(15187): @ java.io.bufferedoutputstream.write(buffe

networking - random connection error cant connect to mysql database server 10060 -

our application using mysql database remote linux server @ port 3306 application connecting database server using tcp/ip protocol windows xp service pack 3 machine.application works time times giving following error randomly "[mysql][odbc 5.1 driver]can't connect mysql server on 'ip adderss' (10060)". 1 desktop user facing issue around 240 users. application developed in vb6. database server: mysql 5.1.51 can 1 suggest possible cause of error ? as error occurs randomly in 1 client machine , have change network card on particular machine , user has not face same issue last week.it due interrupted network connectivity of client machine database server

html - Not all CSS properties will be able to cascade down or some tags will ignore properties from parents? -

my html <div class="teaser"> <img src="smiley.gif"> </div> in css, trying apply border-radius: 100% image looks circle. when .teaser{ border-radius: 100%; } won't work .teaser img{ border-radius: 100%; } will. reasons? because border-radius property can't cascade down or because img tag ignore properties parents. properties inherit default border-collapse border-spacing caption-side color cursor direction empty-cells font-family font-size font-weight font-style font-variant font letter-spacing list-style-type list-style-position list-style-image list-style line-height orphans page-break-inside quotes text-align text-indent text-transform visibility white-space widows word-spacing source : impressivewebs.com/

ios - Create an iPhone app to have multiple users in iPhone -

i want create application using can create multiple users in ios device. multiple users in computer. every user should able have separate applications, separate settings etc. tried find starting point app no luck. can tell me start , how can implement system/feature in iphone . if have make app jailbreak iphones, no problem. it implementing correct primary-foreign key relationship in db-schema(sqlite). storing , retrieving data respect pk-fk relationship for instance have user table table name : user columns : userref,userid,usertype (userref should primary key) then subtables should store , retrieve data using userref in primary , foreign key relationships. table name : account_balance columns : userref,account_balid,balanceamount i hope helps

php - $_REQUEST works on one page but not another -

okay folks question pretty basic. here basics. my site on godaddy shared hosting. i have pagination script works perfect on 1 page. http://subdomain.mysite.com/category.php in different part of site; http://www.mysite.com/admin/page.php i error line: $page= $_request['page']; i don't put rest of script, because identical on both pages exception of query variables. on second page notice: undefined index: page .... error. what missing? is there work around? you're trying param not passing server. i guess pass pagination params in query, failing on "page 1" still don't pass anything. try with: $page = 1; if (isset($_request['page']) { $page = (int)$_request['page']; }

sqlite - Join tables in android -

this question has answer here: how join 2 sqlite tables in android application? 4 answers i have 3 tables in sqllite database 2 config tables , 1 main table data stored. how retrive data main table joining 2 tables in android, how , perform join operations. can guide me. you can execute rawquery. example this: db.rawquery("select a.* table_1 inner join table_2 b on a.id=b.anyid inner join table_3 c on b.id= c.anyid c.key = ?", new string[]{"test"}); the first parameter query want execute. keys want add query add ? in query. second parameter string array. in array put keys, example given above value test . edit: it's possible use rawquery update , insert or delete . example 1 simple update query: db.rawquery("update table_1 set fielda = ?, fieldb = ? id = ?", new string[]{"test", "test2&q

What is the preferred way of updating properties that are not part of mapping in RestKit -

all mapping of objects within response object objects in data model clear how , works well. need update properties on data model every time values change through mapping, not part of response objects. example last_synced date or section sorting property (which value based on 1 of mapped objects), etc. is there way set part of mapping operation or need handle such things manually within success block iterating through mappingresult? look @ using kvo , facilities offered nsmanagedobject rather trying use restkit. can trigger dependent kvc changes mapping applies changes model objects perform internal data updates.

java - Android Bluetooth Received Serial Data Garbled -

i've gone through following thread doubt. but, it's still unclear. why serial bt data received chopped out? chris, that's nice workaround suggested. in solutions you've provided, 1 appending '\n' suitable me i'm purely transmitting float values pc (matlab) - after converting string - android phone. i'm using following code group data searching '\n' still received data garbled up. please tell me i've change. areader = new inputstreamreader( mminstream ); mbufferedreader = new bufferedreader( areader ); astring = mbufferedreader.readline(); mhandler.obtainmessage(bluetoothactivity.message_read, astring).sendtotarget(); this have in handler display data: string readmessage = (string) msg.obj; try{ float readm = float.parsefloat(readmessage); text.append("\n" + readm); }catch (numberformatexception e) { text.append("\n number format exception!!"); e.

ruby - timeout ie.close not working and time out error occurs -

ie.link(:id, "ctl00_contentplaceholder1_btnsearch").click rescue timeout::error #sleep(5) puts "timeout" ie.close #sleep(9) retry #open new browser , go begin end` when .click link gets time out , output = timeout, ie.close not work. , time out error comes * i want close browser when time out error comes * i not believe ie.link(:id, "ctl00_contentplaceholder1_btnsearch").click ever throw timeout::error . why rescue block never executed. the exceptions thrown are: when ie.link(:id, "ctl00_contentplaceholder1_btnsearch").click , element not found, watir::exception::unknownobjectexception occur. when ie.link(:id, "ctl00_contentplaceholder1_btnsearch").when_present.click , element not found within required time frame, watir::wait::timeouterror occur. your rescue needs catching 1 of these exceptions instead. begin ie = watir::browser.new ie.g

android - Texture/pattern recognition/matching int Unity? -

i going develop game in user draws shape on screen his/her finger. have predefined shapes in form of textures me. need detect shape user made his/her finger on screen. example user draws arrow on screen, on comparison predefined shapes want know if he/she drawn arrow. need advises/suggestions way should go with 1) draw shape on screen? (possibly line renderer, trail renderer or?) 2) detect shape he/she drawn? (any solution being in unity or plugin) any suggestions appreciated. if willing pay it, fingergestures package asset store seems have need, plus additional features may come in handy. haven't used personally, seems have reviews.

mysql - why superkey is required when we can identify a tuple uniquely through primary key? -

defination of superkey , primary key in wikipedia a superkey set of attributes within table values can used uniquely identify tuple. and the primary key has consist of characteristics cannot duplicated other row. primary key may consist of single attribute or multiple attributes in combination. i've gone through many books , surfed on internet found in them what primarykey , superkey but want know why superkey required when can identify tuple uniquely through primarykey ? thanks in advance. let's define these terms mean in first place: a "superkey" set of attributes that, when taken together, uniquely identify rows in table. a minimal 1 superkey called "candidate key" , or "key" . all keys in same table logically equivalent, historical , practical reasons choose 1 of them , call "primary" , while remaining "alternate" keys. so, every primary key key, not every key primary. every key superke

java web server sending continuous response to browser but not closing the socket when client is closed -

i making server side program using socket programming in java , handle multiple request client. here client browser not client program. server accept request browser , process request using thread . in response web server sending continuous data browser streaming getting problem when user close browser or change tab or minimize browser .then server not able detect browser states on socket . why data continuously sending server program socket when browser minimize. how can detect browser states on java socket means tab,close or minimize. i want know how apache tomcat detect whether browser open or close or tab change in browser.

wpfdatagrid - Get filter value from Syncfusion ExtendedGrid for WPF -

we need persist filters (those funnel filtering on header row) in syncfusion's wpf grid. how possible read current filter settings can persist it? , way restore filters programmatically? is possible? thanks, tom you can filters particular column using following code snippet. code snippet[c#]: var filters = this.syncgrid.visiblecolumns["customerid"].filters; , can add filters particular column using following code snippet. code snippet[c#]: this.syncgrid.visiblecolumns["customerid"].filters.add(new syncfusion.windows.data.filterpredicate() { filtervalue = 2, predicatetype = syncfusion.windows.data.predicatetype.or, filterbehavior = syncfusion.linq.filterbehavior.stringtyped, filtertype = syncfusion.linq.filtertype.equals }); note: here customerid mappingname of griddatavisiblecolumn

c# - DDD and how to map EF entities to domain objects? -

i'm new ddd try use ddd ideas in new project. i'm using entity framework(edmx). on thing i've learnt ddd avoid having public setters in domain objects. if correct, how map ef entities(ef generated classes) domain objects? have put initial values in constructor? any appreciated! you don't need have public setters in entities when using edmx file. can change setter accessibility . after can use ef entities domain entities , ef complex types value objects. still has limitations have live less ideal design fit ef needs.

How to specify -v option in openssh in perl -

i'm using net::openssh module connect node. while connecting node, need specify -v ssh ssh -v admin@hostname. tried using master_opts , default_ssh_opts. didn't work. my $ssh = net::openssh->new("$user_name\:$password\@$server",strict_mode => 0, default_ssh_opts => [-o => "-v"]); how can achieved? my $ssh = net::openssh->new($server, user => $user_name, password => $password, strict_mode => 0, master_opts => ['-v']);

(ERROR) Trying to get property of non-object (Facebook PHP SDK) -

i trying echo name got error: trying property of non-object. please help. have problem getting user access token though have no problem getting app access token. <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title></title> </head> <body> <?php require_once('facebook.php'); $config = array(); $config['appid'] = "my_app_id"; $config['secret'] ="my_app_secret"; $facebook = new facebook($config); $app_id = "my_app_id"; $app_secret = "my_app_secret"; $my_url = "http://localhost:8080/samplewebsite/index.php/"; $code = $_request['code']; if(empty($code)) { $_session['state'] = md5(uniqid(rand(),true)); $dialog_url = "https://www.facebook.com/dialog/oauth?client_id=" . $app_id . "&redirect_uri=" . urlencode($my_url)

oracle11g - Need Pointers | Using JDBCTemplate | CQ 5.5 -

i need pointers/suggestions on following scenario. scenario: we trying use jdbctemplate in cq 5.5 querying database ( oracle 11g ). first step have integrated cq spring framework . jdbctemplate work requires jdbc driver needs loaded separately cq not available spring jars. jar required available here http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html , jar in case “ ojdbc6.jar ” contains oracledriver class ( javadoc : * http://docs.oracle.com/cd/e11882_01/appdev.112/e13995/oracle/jdbc/oracledriver.html *) required register driver create connection database. problems/suggestions required on following points: as oracle 11g commercial product there no repository available online (for pom dependencies), need create separate local repository it. ( need pointers; there other way it? ) jar mentioned above not osgi. so how approach in case? (i have created osgi bundle following directions mentioned here http://cq-ops.tumblr.com/post/21893

Subset a large number into smaller series of numbers using python -

i have big number lets of around hundred digits. want subset big number consecutive number of 5 digits , find product of 5 digits. example first 5 digit number 73167. need check product of individual numbers in 73167 , on. the sample number follows: 73167176531330624919225119674426574742355349194934969835203127745063262395783180169848018694788518438586156078911294949545950173795833195285320880551112540698747158523863050715693290963295227443043557 i have problem subsetting small numbers out of big number. my basic starting code : b = 73167176531330624919225119674426574742355349194934969835203127745063262395783180169848018694788518438586156078911294949545950173795833195285320880551112540698747158523863050715693290963295227443043557 jd = str(b) ch in jd: number = ch print (number) any highly appreciated. edit: believe grouper overkill in solution, @ solution @haidro https://stackoverflow.com/a/16078696/1219006 using grouper recipe itertools i'

Inconformity between RFC and implementation about ethernet IPv6 multicast address -

in rfc2464 , prefix of ethernet ipv6 multicast address defined 33:33 , captured packets in wireshark, found prefix implemented 33:33:ff . for example, when sending icmpv6 neighbour solicitation packet, destination mac address captured 33:33:ff:f8:67:0d , , last bits of destination ip address ...:d3f5:31f8:670d . rfc2464, mac address should 33:33:31:f8:67:0d . so rfc deprecated? how should implement in program? you looking @ solicited node multicast address. trying convert directly ipv6 unicast address of node ethernet mac address, missing step in between. multicast mac address first convert node's unicast ipv6 address solicited node multicast ipv6 address described in section 2.7.1 of rfc2373 . multicast mac address corresponds ipv6 multicast address described in section 7 of rfc2464 . an example: let's start ipv6 address 2001:db8::d3f5:31f8:670d . corresponding solicited node ipv6 multicast address ff02:0:0:0:0:1:fff8:670d . apply algorithm multicast mac add

iphone - Terminating app due to uncaught exception 'NSUnknownKeyException', reason:<MyMapViewController 0xa9446a0> setValue:forUndefinedKey:] -

terminating app due uncaught exception 'nsunknownkeyexception', reason: '[<mymapviewcontroller 0xa9446a0> setvalue:forundefinedkey:]: class not key value coding-compliant key destinationaddress.' first throw call stack: (0xa8d012 0x1b57e7e 0xb15fb1 0xd76711 0xcf7ec8 0xcf79b7 0xd22428 0x12c30cc 0x1b6b663 0xa8845a 0x12c1bcf 0x1186e37 0x1187418 0x1187648 0x1187882 0x1193235 0x13923d2 0x11904f3 0x1190777 0xaf2833f 0x11907b7 0x2d8d 0x1b6b705 0x10a9920 0x10a98b8 0x116a671 0x116abcf 0x1169d38 0x10d933f 0x10d9552 0x10b73aa 0x10a8cf8 0x29f5df9 0x29f5ad0 0xa02bf5 0xa02962 0xa33bb6 0xa32f44 0xa32e1b 0x29f47e3 0x29f4668 0x10a665c 0x233d 0x2265) libc++abi.dylib: terminate called throwing exception check .xib outlet destinationaddress , make sure linked correctly

java - Take an xml feed from the internet and put it in my assets -

currently developping android application , i'm using xml feed take internet.the problem when phone doesn't have internet connection, application crashs. obtain xml file , put in assets. my question : possible ? , if yes, what's best solution ? check network connection: public static boolean isconnectedtointernet(context context) { connectivitymanager connectivity = (connectivitymanager) context.getsystemservice(context.connectivity_service); if (connectivity != null) { networkinfo[] info = connectivity.getallnetworkinfo(); if (info != null) (int = 0; < info.length; i++) if (info[i].getstate() == networkinfo.state.connected) { return true; } } return false; } download xml string public string getxmlstring(string url) { try { url url1 = new url(url); urlconnection tc = url1.openconnection(); tc.setc

json-schema validation using validictory -

i getting following schema validation error using json schema , valdictory parser/validator. schema has been autogenerated using jsonschema.net (using same json data) validictory.validator.fieldvalidationerror: value '{"bp": [{"category": "bp", "created": "2013-03-08t09:14:48.148000", "value": 147.0, "day": "2013-03-11t00:00:00", "value2": 43.0, "id": "dc049c0e-d19a-4e3e-93ea-66438a239712", "unit": "mmhg"}]}' field '_data' not of type object code: import json import validictory data = json.dumps({'bp': [{'category': 'bp', 'created': '2013-03-08t09:14:48.148000', 'day': '2013-03-11t00:00:00', 'id': 'dc049c0e-d19a-4e3e-93ea-66438a239712', 'unit': 'mmhg', 'value': 147.0, 'value2

jquery - Wordpress unrecognized expression: #the-comment-list [class^=delete:the-comment-list] -

i have error uncaught error: syntax error, unrecognized expression: #the-comment-list [class^=delete:the-comment-list] on wordpress website http://www.michelepierri.it this error not allow jquery work in administrative panel. can me? in advance. as noted in selectors documentation : character special character in jquery selectors, , result needs escaped it's treated regular : character when appears in id, class name, etc. there 2 ways that. generic use 2 backslashes ( \ ): $('#the-comment-list [class^=delete\\:the-comment-list]') however, since attribute value, can same result wrapping in quotes: $('#the-comment-list [class^="delete:the-comment-list"]')

jquery - Update FlexSlider2 width when container width is set to 100% on button click -

i using flexslider2 on fixed width site, trying make button "full screen" view. basically, button change main site's container div 100% width , hide other site elements. here code button's function: $('.fullscreen-toggle').click(function() { $('#container').toggleclass('full-width', 0); $('#header').toggleclass('hide', 0); $('#menu').toggleclass('hide', 0); $('#lower-content').toggleclass('hide', 0); $('.fullscreen-toggle span').toggle(); }); the problem i'm having flexslider adjusts image/slide width when window resized or when it's brought in , out of focus (by changing browser tabs). i've been unable find way "reload" flexslider when button clicked images full width. right when button clicked multiple slides shown @ time, this: http://img202.imageshack.us/img202/5308/flexsliderresizeissue.jpg things i'