Posts

Showing posts from May, 2011

android - Starting new activity from asynctask in tabhostView -

i have problem code: i working on app requires log in. app consists of loading screen , tabview 4 tabs. last tab activity wil let login. have set edittext views here , login button. the login activity done far here's code: package com.appsoweb.kvodeventer; import org.json.jsonobject; import android.app.activity; import android.app.progressdialog; import android.content.intent; import android.os.asynctask; import android.os.bundle; import android.util.log; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.edittext; public class kvomeldingen extends activity { public static final jsonobject jsonresult = null; button blogin, bcreateaccount, bresetpassword; edittext etusername, etpassword; static string username; static string password; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview...

objective c - Trouble casting UIView in iOS -

i have class called fooview subclass of uiview , i'm trying cast uiview object fooview . i follows fooview *myview = (fooview*) myviewcontroller.view nslog(@"leg class of %@",nsstringfromclass([myview class])); // uiview here. the ivar of myviewcontroller uiview type. i uiview result, idea why happens? casting compile-time operation. doesn't magically change type of object. it's compile time checking , little runtime magic. myview still uiview , not fooview . these 2 lines in question should give answer: the ivar of myviewcontroller uiview type. uiview result all objective-c objects have pointer called isa points object of type class . casting not change pointer, nor change size of object. if want use fooview , need change property type in controller , if you're using interface builder, change type of uiview in inspector on right.

scroll - Problems with scrollTo() in android -

i´m developing application incorporates chat , when type new message stores file in internal memory. also, when type new message, automatically scrolls bottom of edittext (where messages are), , works fine on first try,but when open application again , loads history file, automatic scrolling no longer works because, although scrolling bottom well, hides last line of text. here .java file: public class chatactivity extends activity { private static edittext messagehistory; // private edittext messageinput; // private button sendbutton; // private scrollview scroller; @override public void oncreate (bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.chat); //prevents keyboard appearing when not rquested getwindow().setsoftinputmode(windowmanager.layoutparams.soft_input_state_always_hidden); projectdata.chatlogfile = new filehandler(getapplicationcontext(), projectdata.chat_log_file); projectdata.chatlogfile.create(...

android - findViewById usage in View -

i'm struggling problem few days , couldn't find solution problem far. have 2 classes: - startactivity extends activity - timegraphview extends surfaceview what want achieve add dynamically buttons within timegraphview view (linearlayout). wanted linearlayout inside timegraphview findviewbyid() returns null, , should because call in timegraphview not in root element used setcontentview(); so question how can add button dynamically custom view level view. and code: public class startactivity extends activity { public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.time_graph); linearlayout layout = (linearlayout) this.findviewbyid(r.id.timegraphlayout); //here can add button it's not want } } and ... public class timegraphview extends surfaceview implements surfaceholder.callback, runnable { public timegraphview(context context) { super(context); }...

Firefox, SVG, text-decoration -

consider following snippet of code: <text style="text-decoration:underline;"> underline </text> it renders me in both latest version of chrome & safari; however, fails in latest version of firefox. question: if text-decoration not part of svg standard? or does firefox not support entirety of svg? and lastly: how underline / strike through / on line in firefox svg text given above? thanks! edit hmm, https://bugzilla.mozilla.org/show_bug.cgi?id=317196 confirm firefox, in 2012, not support svg underline? :-) the bug linked it. and no 1 supports "the entirety of svg" (at least of svg 1.1). chances are, no 1 ever will.

machine learning - How to improve accuracy of decision tree in matlab -

i have set of data classify them in matlab using decision tree. divide set 2 parts; 1 training data(85%) , other test data(15%). problem accuracy around %90 , not know how can improve it. appreciate if have idea it. i guess more important question here what's accuracy given domain: if you're classifying spam 90% might bit low, if you're predicting stock prices 90% high! if you're doing on known domain set , there previous examples of classification accuracy higher yours, can try several things: k-fold cross validation ensamble learning generalized iterative scaling (gis) logistic regression

jquery - Switch text of span element based on whether the div is expanded or collapsed -

i trying have 3 divs , closed.when div closed span right side shown arrow pointing towards right , when click div want corresponding span arrow points down , again when div collapsed should point right.here fiddle .i think missing , can me out this. if 1 let know better ways of doing task (entire collapse , expansion) , appreciated. thanks i've made few amends code, including using classes group elements. code set selected arrow, needed change divs default state before completing actions on clicked one. try this: $('.main').click(function() { var $el = $(this); if (!$el.next(".sub").is(":visible")) { // reset $('.sub').slideup("slow"); $('.arrow').html("&#9654;"); // set current $el.next('.sub').slidedown("slow"); $('.arrow', $el).html("&#9660;"); } }); <div class="main"> ...

html - Set div to 100% of content -

i using 1140px fluid grid (cssgrid.net) layout. i having problem.. my layout looks this: side menu - content - content - content - content - etc. etc. my problem is, layout this: side menu - content content content content content etc. etc. i want, "side menu" full height, push content "the right". my layout (exist of 12 cols): <div class="container"> <div class="row"> <div class="twocol"> -- side menu content here -- </div><!-- end 2col --> <div class="tencol last"> content content content </div> <div class="tencol last"> content content content </div> <div class="tencol last"> content content content </div> <div class="tencol last"> content content content </div> </div><!-- end .ro...

Regex to match comma + newline -

i'm looking regular expression check occurrences of , , newline character together. prefer egrep. example: strstr("hello world","hello"); should not match, and strstr("hello world", "hello"); should return match. i tried both egrep ',\n' , , egrep ',$' , unsuccessful. have tried ,\r\n depending on platform different \r mac os 9 \n unix/linux, starting mac os 10 (os x) \r\n dos the regex ,$ should work, , more universal, remember set option $ matches @ line breaks , not end of entire string.

python - local variable referenced before assignment for decorator -

i'm using decorator functional syntax it's described here . i loop on list of dict. in loop wrap generic function decorator taking parameter. call wrapped function current dict parameters. my problem local variable 'generic_evaluator' referenced before assignment error. here code: the concerned decorator: def log(logfile_name): def inner_log(func): def wrapped(*args, **kwargs): import os ret = func() # business code... return wraps(func)(wrapped) return inner_log and here place wrap generic_evaluator function log decorator. for evaluation in generic_evaluations: generic_evaluator = log(evaluation['suffix'])(generic_evaluator) generic_evaluator(evaluation['suffix'], evaluation['id']) edit it'll more clear piece of code in addition: @tictoc def generic_evaluator(suffix_url, id): xml = etree.parse(get_resource(base_url + "/" + suffix_url ...

Merge two javascript objects without overwriting -

i have 2 javascript object data this: { "data": [ { "foo": "2388163605_10150954953808606", "bar": { "xyz": "123", }, "name": { "name": [ { "content": 1, "data": "some text", "id": "2388163605" } ] }, }, { "not_the_same": "other values", "foo": "different", "bar": { "xyz": "123", }, "name": { "name": [ { "content": 1, "data": "some text", "id": "2388163605" } ] ...

authentication - How do you implementing authorization on a local website (intranet) using active directory in the .net framework? -

a simple website has been created. going implemented in companies network users can access , edit data. group of users (security group) has been created have access system. now selection mechanism " manage access " used admin pull allowed users database , admin can decide users have access content or page. ie. authorized users can access pages authorized them example user "jake" production manager , should able access product production page, data entry sql occur. so each user able access 1 or more pages. how solution implemented using asp.net , active directory. authentication windows not forms. the users have access particular page stored in respective tables of database . have looked iis , seems iis manager can limit access based on active directory , have mentioned can controlled via iis , there no need "manage access" page, right? except list of allowed users stored can used iis if not how go allowing , disallowing (displaying , not...

jsp - Servlet Mapping. Web.xml -

in java web application possible map servlets in files not "web.xml"? mean. need map on hundred servelts , web.xml dificult deal with. dividing mappings in several file cathegory great. if there way please tell me how?. thank much. not sure dividing web.xml file. can achieve task defining servlets through java annotations instead of defining them in web.xml. servlet 3.0 specification provides new annotation @webservlet can used declare servlets.

java - Can you see why this if statement is not working correctly? -

when run if statement returns false , doesn't run 2 lines have there. can see in above line checked if words same , identical. there here oblivious or screwed? if matters using eclipse. boolean wordhaselement = false; (int firstdimension = 0; firstdimension <= wordnumber-1; firstdimension++){ system.out.println("-"+ words[firstdimension][0] + "-" + linewords[linewordnumber] + "-"); if (words[firstdimension][0] == linewords[linewordnumber] ){ system.out.println("worked"); wordhaselement = true; } } if (words[firstdimension][0] == linewords[linewordnumber] ){ should replaced with if (words[firstdimension][0].equals(linewords[linewordnumber] ){ == checks see if 1 object same another, aren't interested in. equals(...) checks if 2 strings hold same string -- same letters in same order -- , that's matters. or use equalsignorecase(...) if case doesn't matter.

python - Is that pythonic? -

if question waste of board, i'll remove it:) i'm new python wanna evaluation code because i'm c language. it's function extracting words string between 2 words. def extract(s,start,end): return s[s.index('start')+1:s.index('end')] it pythonic? or there standard function doing same thing? thanks:) i think pythonic you'll get: def extract(s, start, end): return s[s.index(start) + len(start):s.index(end)] i added + len(start) account length of start variable. or .partition() : >>> 'get stuff here'.partition('get')[-1].partition('here')[0] ' stuff '

Android intents and services -

i'm having requirement of designing update service application, update service pull data clued , should update gui if there new updates. first part straight forward second part best approach? i'm thinking of having custom intent receiver registered in application , tell activities load content again. if application closed need show custom dialog activity telling updates. i need feedbacks , if body having similar sample project please share @ implementation details. thanks. this update service pull/download data clued download service the big question here is: how update activity service?. in next example going use 2 classes may not aware of: resultreceiver , intentservice. resultreceiver 1 allow update our thread service; intentservice subclass of service spawns thread background work there (you should know service runs in same thread of app; when extends service, must manually spawn new threads run cpu blocking operations). download service can thi...

Incomplete beta function in raw C -

a friend of mine needs analogue of matlab's betainc function statistical calculations in programmable logic devices (pld's) (i'm not man of hardware , don't know details on project yet). therefore using precompiled libraries not option. needs implementation in raw c considering each of 3 parameters variable. is there 1 somewhere on web? thank in advance! i know i'm late answering, accepted answer (using code "numerical recipes") has terrible license. also, doesn't others don't own book. here raw c99 code incomplete beta function released under zlib license: #include <math.h> #define stop 1.0e-8 #define tiny 1.0e-30 double incbeta(double a, double b, double x) { if (x < 0.0 || x > 1.0) return 1.0/0.0; /*the continued fraction converges nicely x < (a+1)/(a+b+2)*/ if (x > (a+1.0)/(a+b+2.0)) { return (1.0-incbeta(b,a,1.0-x)); /*use fact beta symmetrical.*/ } /*find first part be...

ios - Malloc/Free based Memory Leak Undetected by Instruments? -

i found memory leak in code, caused c-style array of pointers not being freed. the curious thing is, tested app in instruments->leaks quite thoroughly, leak never detected (i released version 1.0 last week, without trouble far). now i'm working on version 1.1 , found logical error. fixed and, far there seems no 'over-release' crash , i'm confident fix due. has seen this? assumed objective-c's retain/release malloc/free under wraps, leaks based on c memory functions should equally visible instruments...?

Ruby on Rails: two has_many same_models :through => different_model -

i'd create 2 has_many on same model goes through different model (which join table) here's code: class content belongs_to :dis belongs_to :fac has_many :dis_representations, :through => :dis has_many :fac_representations, :through => :fac end class fac has_many :fac_representations has_many :contents end class dis has_many :dis_representations has_many :contents end class disrepresentation belongs_to :user, :foreign_key => "e_user_id" belongs_to :dis end class facrepresentation belongs_to :user, :foreign_key => "e_user_id" belongs_to :fac end class user has_many :dis_representations, :foreign_key => "e_user_id" has_many :fac_representations, :foreign_key => "e_user_id" has_many :dises, :through => :dis_representations has_many :facs, :through => :fac_representations has_many :contents, :through => :dises, :source => :contents has_many :contents, :through =>...

python - Elegant way to add functionality to previously defined functions -

how combine 2 functions together i have class controlling hardware: class heater() def set_power(self,dutycycle, period) ... def turn_on(self) ... def turn_off(self) and class connects database , handles data logging functionality experiment: class datalogger() def __init__(self) # record measurements , controls in database def start(self,t) # starts new thread acquire , record measuements every t seconds now, in program recipe.py want like: log = datalogger() @datalogger_decorator h1 = heater() log.start(60) h1.set_power(10,100) h1.turn_on() sleep(10) h1.turn_off() etc where actions on h1 recorded datalogger. can change of classes involved, looking elegant way this. ideally hardware functions remain separated database , datalogger functions. , ideally datalogger reusable other controls , measurements. for scenario, prefer using datalog...

ruby on rails - Only calling a method if a hash is populated -

i have instance variable called @filtered_ratings = params[:ratings].keys however, if params[:ratings] nil , #keys called on there error raised. if @filtered_ratings nil, want @filtered_ratings set empty array (or hash). there easy way of doing without code? thanks! @filtered_ratings = params[:ratings].keys if params[:ratings].respond_to? :keys edit: # if params[:ratings] nil return [] @filtered_ratings = params[:ratings].try(:keys) || []

Can't install "Web Developer Tools" on Visual Studio 2012 RC -

Image
in visual studio 2012 rc, can't install web developer tools properly. none of asp .net mvc project load in vs2012, , can't create new ones. option asp .net mvc projects not there, shown below. furthermore, can't pick other framework .net framework 4 , earlier. can't seem pick .net 4.5, may because it's addition .net 4.0. don't know. i'm running windows 8 release preview, should have .net 4.5 rc installed already, shouldn't problem. furthermore, if click "i want download more .net redistributables", i'm taken site says visual studio 2012 rc has included already. i can't seem download mvc 4.5 , install separately. because claim it's included in vs2012 well. when try click "modify installation" in visual studio 2012 rc installer, see following. what's interesting here "web developer tools" never checked. if check , click "update" , reboot, it's unchecked again, , seems if whole fe...

php - Directory list into associative array -

possible duplicate: php split string integer element , string i have directory these files filea10.txt fileb20.txt filec5.txt i need read list array: filea => 10 fileb => 20 filec => 5 what fastest way or function this? $arr = array(); foreach (glob('*.txt') $file) { list($name,$num) = preg_split('/\.|(?<=\d)(?=\d+)/', $file); $arr[$name] = $num; }

uml - Is there MDT UML2 Toold for Eclipse Indigo (3.7)? -

is there mdt uml2 toold eclipse indigo (3.7)? i'm little confused, on page model development tools (mdt) says release should on june 22 (2010??), there no release listed later on page. have sub-projects. mdt stuff released standard release train. there release indigo , there 1 juno.

windows installer - Visual Studio 2010 - Setup Project: How to compress "setup.exe" and "application.msi" in one file -

i have visual studio 2010 setup project , want compress both output files( setup.exe & application.msi) in 1 single file, , after launch gets extracted , run "temp" folder. thank you. setup.exe used special processing before running installation, checking bitness or language of os. if not special processing being done, enough distribute msi file. windows has executable msiexec.exe used run msi files. however, if wish combine files, can use iexpress program - http://www.itscodingtime.com/post/combine-setup-msi-and-exe-into-a-single-package-with-iexpress.aspx

java - Using svn versioning between eclipse and ibm rad 8? -

Image
i use eclipse , ibm rad 8 , since rad 8 built on eclipse should able version project using both ide:s. checked in project eclipse xp-dev.com in svn , checked out ibm rad 8 can't build project. views follows. when build ibm rad error occurs. exception in thread "main" java.lang.noclassdeffounderror: adventure.adventure caused by: java.lang.classnotfoundexception: adventure.adventure @ java.net.urlclassloader.findclass(urlclassloader.java:434) @ java.lang.classloader.loadclass(classloader.java:660) @ sun.misc.launcher$appclassloader.loadclass(launcher.java:358) @ java.lang.classloader.loadclass(classloader.java:626) what doing wrong? update there seems issue build path defined java 7. first java 7 project , ide can't find version 7 though it's installed @ computer. you should not version .settings folder. different depending on location , type of ide. should added svn:ignore .classpath , .project files. you have...

symfony - Rounded decimal in edit form Symfony2 + Doctrine2 -

how set decimal precision , scale within symfony2 entity? i've defined latitude in longitude fields using decimal data type in entity this: /** * @orm\column(type="decimal", precision="10", scale="6", nullable=true) */ protected $latitude; when persisting new object saves decimal correctly (i can see 52.406374 in phpmyadmin). when displaying edit form number rounded 52,406 , after updating stored in mysql 52.406000. wrong doctrine configuration, don't know what. why latitude , longitude getting rounded? found solution: symfony's form component renders decimal form field type="text". when using: ->add('latitude', 'number', array( 'precision' => 6, )) it rendered properly. thread comment doesn't describe problem. guess have fixed bug 'convert float' precision. when displaying latitude in twig template showing proper (not rounded) value. maybe problem not due d...

c# - Using statement vs. IDisposable.Dispose() -

it has been understanding using statement in .net calls idisposable object's dispose() method once code exits block. does using statement else? if not, seem following 2 code samples achieve exact same thing: using con new connection() con.open() 'do whatever ' end using dim con new connection() con.open() 'do whatever ' con.dispose() i give best answer whoever confirms correct or points out wrong , explains why. keep in mind aware classes can different things in dispose() methods. question whether or not using statement achieves exact same result calling object's dispose() method. using equivalent of: try { // code } { obj.dispose(); } so has benefit of calling dispose() if unhandled exception thrown in code within block.

fancybox in ie9 displaying left bottom -

works fine in firefox displaying bottom left in ie9 i assume it's either css in ie9 or doctype? any appreciated. site happening on below. http://bydezign.co.nz/products/chairs/manolichair.aspx where begin okay lets start validation http://validator.w3.org/check?verbose=1&uri=http%3a%2f%2fbydezign.co.nz%2fproducts%2fchairs%2fmanolichair.aspx now lot of errors think result of not adhering transistional doctype. go xhtml1 may have reasons transistional (though can't believe worth salt nowadays not use xhtml pretty standard. sorting doctype may (and will) solve rendering issues if doesn't @ use of tables layout. big 'no-no'. should using divs , css layout. give better design capabilities. tables not semantically correct use layout - displaying tabular data. fix these first , see if solves issue (99% confident doctype , getting through validation resolve issue

html5 - Sample web socket connection -

i know simple sample example sends , receives json message using web socket. know how write client side program using web socket. how write client side program ( running web socket client side programming ) using c or java web service , host on tomcat (localhost) web server? here in client side want give own localhost address instead of "echo... " what system requirement , installations/plug-in available these?? appreciated. thanks i don't understand why want that, maybe should have @ "websocketpp" if you're looking c++ implementation of both - client , server side.

android - Fit to screen all widgets -

Image
this screen shots. want buttons display in fit screen devices. i want remove space after button6 , fit buttons in screen. <linearlayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:orientation="vertical" > <button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="button" /> <button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="button" /> <button android:id="@+id/button3" android:layout_width="wrap_content" android:layout...

Python: Importing Module -

lets have python model fibo.py defined below: #fibonacci numbers module print "this statement" def fib(n): a,b = 0,1 while b < n: print b a, b = b, a+b def fib2(n): a,b = 0,1 result= [] while(b < n): result.append(b) a, b = b, a+b return result in interpreter session, following: >> import fibo statement >>> fibo.fib(10) 1 1 2 3 5 8 >>> fibo.fib2(10) [1, 1, 2, 3, 5, 8] >>> fibo.__name__ 'fibo' >>> so far good..restart interpreter: >>> fibo import fib,fib2 statement >>> fibo.__name__ traceback (most recent call last): file "<stdin>", line 1, in <module> nameerror: name 'fibo' not defined >>> i expected error have imported fib , fib2. don't understand why statement printed when imported fib , fib2. secondly if change module as: #fibonacci numbers module print "this statement" ...

ruby on rails - Custom Controller variable in application.html -

user story: action facebook has open graph object. for need modify tag defined in application.html problem: the logic need defined in helpers or application_controller from understanding not clean. question: i want pass variables directly application.html view. preferably pass variables custom controller application.html. way can still utilize rails routing system pass variables when on facebook action. the common mechanism passing variables in view create instance variables in controller these ported on automatically. this standard approach if used. things may not used, create helper method take care of providing them. this difference between doing this: def show @facebook_graph = ... end and in helper: def facebook_graph ... end

javascript - Can I manage C# variable into .js? -

i have script.js folder script. i'd manage, script, c# variable, web form (e.g. <%= mystring = 3 %> ). i think not possible, maybe can in way? thank you javascript client side executed code, , c# server side executed code. can't strictly make "variable" visible, they're 2 different code platforms/runtimes, running on 2 different computers. can still marshal data between them in few different ways. write web service , call via ajax populate control or url page data, , query via javascript dom api (or via wrapper library jquery) an example of 2nd (since asked): <!-- somewhere in page --> <span style="visibility:hidden" id="mydata"><%= mystring %></span> // in javascript, using jquery: var mydata = $('#mydata').text();

database - "missing authorization clause" while creating schema -

i trying create database schema in oracle using enterprise manager console as: create schema scm authorization scm but giving error as: "missing authorization clause". can please help. create schema used create whole set of objects in single statement. not create "schema" way other dbms (e.g. postgresql) use term. from the manual : use create schema statement create multiple tables , views , perform multiple grants in own schema in single transaction and big note @ beginning: this statement not create schema. oracle database automatically creates schema when create user (emphasis mine) a schema , user (more or less) same thing in oracle. looking for: create user scm identified scm;

c++ - Writing to hard disk more efficiently -

i'm writing streams of images hard disk using std::fstream. since hard disk drives have 32mb cache, more efficient create buffer accumulate image data 32mb , write disk, or efficient write every image onto disk? the cache used read/write cache alleviate problems due queuing.... here experiences disks: if disk not ssd, it's better if write serially, seek files.. seek killer i/o performance. the disks typically writes in sector sizes. sector sizes 512b or 4k (newer disks). try write data 1 sector @ time. bunching i/o faster multiple small i/os. simple reason processor on disk has smaller queue flush. whatever can serve memory, serve. use disk if necessary. can modify/invalidate cache entry on write, depending on reliability policy. make sure don't swap, memory cache size must reasonable, begin with. if you're doing i/o management, make sure don't double-buffer os page cache. o_direct this. use non-blocking, if reliability isn't issue. o_nonblo...

Consuming SOAP and REST Service in Android Application -

i have tried create sample application consuming soap , rest based services. when tried app consuming saop services using ksoap 2 api getting "the operation timed out" response. when tried app consuming rest services, works fine local services, if tried connect internet services getting "the operation timed out" response too. i thought proxy problem, configured proxy settings in emulator , can access services through browsers in emulator now. any suggestion or please. if able access web service in browser in emulator can access in android app. i saw code replace line string result= androidhttptransport.responsedump; by soapobject soapresult = (soapobject) envelope.bodyin; , add line string result = soapresult.getproperty(0).tostring(); if still have problem write me.

MySQL - Adjacency List Model - Get Depth -

i have organization table has id , parent_id , , name column. there 50k rows in table. there 1 top level parent , rest under that. in oracle, able retrieve current depth of particular organization level pseudocolumn: select id, parent_id, level, name organizations start parent_id = 1 connect prior id = parent_id i @ loss of proper way above in mysql is. need fetch entire tree along node's depth in 1 query. there plethora of questions on stackoverflow have this, none of them seem have answer it, links blogs dubious solutions. surely doable in sort of straight-forward manner? unfortunately modifying table in way not option, nested sets not possibility. this totally hilarious. picked +50 bounty on similar question literally yesterday : using mysql query traverse rows make recursive tree i referenced how stored procedures in dba stackexchange (october 24, 2011) i post same stored procedures along examples dba stackexchange answer: code parent given node ...

php - How to pull Instagram photos to my blog and integrate with Fancybox? -

i saw docs on instagram developers page. http://instagram.com/developer/endpoints/ but want display own photos need access token. after want make photos work in lightbox or fancybox. able make work endpoints require client id. access token stumps me. edit: i want use php , or jquery create gallery of images account. can out there point me in right direction? there tutorials can use demonstrate start finish? i've written tutorial people manipulate api , generate fancybox gallery. includes source files of final product. here link http://www.blueprintinteractive.com/blog/how-instagram-api-fancybox-simplified

uitableview - UIView mail-like staple animation -

Image
i want implement special animation , i'm wondering if did that. knows cool staple effect form ipad mail, when selecting multiple mails. i want bring animation ipad app. have uitableview available in-app purchases , want user able buy multiple purchases @ once. the user can select multiple products in tableview , want images custom uitableviewcell "staple together" cool ipad effect. i want cells move stack. code (most experience performance issues photo cell): - (ibaction)seteditingtableview:(id)sender { if ([itemstableview isediting]) { (nsindexpath *cellpath in [itemstableview indexpathsforselectedrows]) { uitableviewcell *cell = [itemstableview cellforrowatindexpath:cellpath]; if ([cell isselected]) { [uiview animatewithduration:1.0 animations:^{ [[cell image] setframe:[stackview frame]]; [[cell image] setcenter:[stackview center]]; }]; } ...

java - how to get rid of html in jsoup and only extract html table content? -

so i'm trying access table in website http://www.engin.umich.edu/htbin/wwwhostinfo?detail=0&display=all&sort=open , trying make elements object. need first , fourth columns . i'm using jsoup , doing : document doc = jsoup.connect("http://www.engin.umich.edu/htbin/wwwhostinfo?detail=0&display=all&sort=open").get(); elements buildings = doc.select("td:eq(0),td:eq(3)"); this should select first , fourth columns. doing html data need skip initial stuff in webpage "the following report ... ". , need 2 columns - building , open can initialize variables , assign number of open computers in building , use toast or similar display number of open computers in building on screen. currently i'm using textview show data , showing me html data don't want well. textview tv = new textview(this); tv.settext(""+buildings); setcontentview(tv); can individual values extracted elements ? in sho...

jasper reports - How to make grouping in JasperReports? -

Image
i generating pdf jasperreports xml data source. i have table and xml below: <multiplerecord type="paf_details"> <record pafno="paf121" mincomm="5" invoiceno="bill000000121" type="exclusive" category="category i" slabno="slab 1"/> <record pafno="paf122" mincomm="5" invoiceno="bill000000122" type="exclusive" category="category i" slabno="slab 1"/> <record pafno="paf123" mincomm="5" invoiceno="bill000000123" type="exclusive" category="category i" slabno="slab 1"/> <record pafno="paf124" mincomm="5" invoiceno="bill000000124" type="exclusive" category="category i" slabno="slab 1"/> <record pafno="paf125" mincomm="5" invoiceno="bill000000125" type=...

PHP Array to json, how to get rid of some double quotes? -

i have small weird problem while encoding php arrays json. i need prevent array() adding double quotes around specific values. here php array: $coordinates="[".$row["lat"].",".$row["lng"]."]"; $eguser=array( "geometry"=>array( "type"=>"$type", "coordinates"=>$coordinates ), "type2"=>"$type2", "id"=>$id ); $arrayjson[]=$eguser; wich return following json json_encode : var member = { "type": "featurecollection", "features": [{ "geometry": { "type": "point", "coordinates": "[46.004028,5.040131]" }, "type2": "feature", "id": "39740" }] }; as can see coordinates wrapped i...

javascript - How to break highchart bars for extreme values -

Image
in highcharts if there 2 series, first series value 20,0000 , second series value 20, second series becomes small invisible. is possible break first bar second series become visible? below desired output... at time there not way this. see highcharts user voice here .

asp.net mvc 3 - MVC 3 Authorize attribute not working in action method -

in web application want add authorization in action method in controller not on whole controller. added following [authorize] public actionresult manageresturant(long id = 0) { } and in web.config added <authentication mode="forms" > <forms loginurl="~/auth/login"/> </authentication> but when go action method page loads wrong want page redirect login page any suggestions? thanks john comment found solution after hint problem in code i use session store logged in user use of formsauthentication make sure users login make login link appears them the problem when session expires formsauthentication still validating user logged in user appears user logged out in fact logged in using form authentication so did onactionexecuting method make check on session if null logout user in case make sure user logged out

pivot - SQL Server query to generate dynamic columns -

i have 2 tables - 1 state , other 1 job titles. i want write query output me this:- job titles state name1 state name2 job title1 200 300 job title2 500 600 how can write query in sql server. i have no idea schema looks like, sounds want change have 3 tables: jobtitle, state, , jobtitle_state_salary. way you're not repeating either job titles or states in order tie salary. however, addressing problem written (and making assumption salary travels state), should trick: with [cte] ( select [title], [state], [salary] [jobtitle] inner join [statesalary] on [jobtitle].[id] = [statesalary].[jobtitleid] ) select [title], [state name1], [state name2] [cte] pivot ( max([salary]) [state] in ([state name1], [state name2]) ) [p] sqlfiddle example here .

actionscript 3 - How to click through a Rectangle (like mouseChildren = true) -

i have problem, use image pan class: http://www.lextalkington.com/blog/2009/08/auto-pan-class-for-panning-an-image-on-mouse-movement/ but problem objects/sprites/movieclips in have clickable, problem mousechildren adn mouseenabled properties can't applied rectangle object. anyone has idea on how able click through can acces objects in panned item? (if makes sense...) this class using rectangle scrollrect image. scrollrect specifies visible area of image. not thing want detect mouse clicks on. instead, can listen mouse click on image itself. from code linked to, image displayobject variable named _clip . in constructor image panning class, can add mouse listener: _clip.addeventlistener(mouseevent.click, onimageclick); then define event handler: private function onimageclick(event:event):void { // } by way, since _clip displayobject , doesn't have mousechildren or mouseenabled properties (those defined in subclasses of displayobject). ...

javascript - Show/hide markers based on form's selections doesn't do anything -

i'm trying show/hide( or put - filter ) markers( of houses , condos ) on google map , based on types of features user selected #features select box. e.g. if user selectes ' swimming pool ' feature , clicks submit button - show markers( houses/condos ) have feature, , hide ones don't have swimming pool. unfortunately, nothing happens/changes on map when run code. json of houses , condos( stored inside markers variable ): ({ condos: [ {address:'123 fake st.', lat:'56.645654', lng:'23.534546', features:['swimming pool','bbq','..etc..']}, {... condo features ...}, {... condo features ...}, ... ], houses: [ {address:'1 main ave.', lat:'34.765766', lng:'27.8786674', features:['...','...']}, {... house features ...}, {... house features ...}, ... ] }) js/jquery code: $('#filterform'...

html - How to close a popup window in javascript that was sent to the background -

so trying use window.close method, doesn't seem working. here's code: <script> var popup; function openpandora() { popup = window.open('http://www.pandora.com', '', 'width=100, height=100, resizable=no'); popup.blur(); document.getelementbyid('container').focus(); } function closewindow() { popup.close(); } </script> the html calls <a> onclick="closewindow();" any ideas on how popup close? thanks! are sure if closewindow() getting called. try this function closewindow() { alert("going close popup"); alert(popup); popup.close(); } what see?

Intellisense not working for XAML in VS2012 and only partially in Blend -

Image
i'm trying rc of visual studio 2012 working xaml files. can't seem xaml intellisense , option within tools greyed out. i've tried run solution using blend, intellisense custom controls such telerik then. when ever drag controls onto design surface "object reference not set instance of object" exception control still added surface. i've read bug within vs11 , fixed in visual studio 2012 rc. i've created new silverlight application , intellisense working i'm wondering if issue how projects set up. i have of styles within separate themes project, referenced other other projects. within designer these references show errors when application runs resolved fine. would unresolved resources @ design time affect intellisense? click "build -> clean solution", "build -> build solution". ("rebuild solution" alone doesn't work.) [source]

error while running makefile for opencl program -

i have started learning opencl. received following error when typed in make compile hellocl program: mkdir -p depends/x86_64 perl ../../../../../make/fastdep.pl -i. -i../../../../../include -i../../../../../samples/opencl/sdkutil/include --obj-suffix='.o' --obj-prefix='build/debug/x86_64//' hellocl.cpp > depends/x86_64/hellocl.depend mkdir -p build/debug/x86_64/ building build/debug/x86_64//hellocl.o g++ -wpointer-arith -wfloat-equal -g3 -ffor-scope -i ../../../../../samples/opencl/sdkutil/include -i "/opt/amdapp/include" -i ../../../../../include -o build/debug/x86_64//hellocl.o -c hellocl.cpp in file included hellocl.cpp:106:0: /opt/amdapp/include/cl/cl.hpp: in function ‘cl_int cl::unloadcompiler()’: /opt/amdapp/include/cl/cl.hpp:1826:12: error: ‘::clunloadcompiler’ has not been declared /opt/amdapp/include/cl/cl.hpp: in member function ‘cl_int cl::commandqueue::enqueuemarker(cl::event*) const’: /opt/amdapp/include/cl/cl.hpp:4842:13: e...

opengl es - EGL_MAX_PBUFFER_WIDTH vs GL_MAX_TEXTURE_SIZE -

in openggl, pbuffers maximum size match textures maxium size? egl_max_pbuffer_width maximum width of pixel buffer, means surface on graphics drawn. gl_max_texture_size maximum size of texture can use on 3d face.

c# - My search button not displaying data -

am building window form application clinic using vs2010. on form in have searchbutton display data baseon registrationno. when test application, provide registration number , click search button nothing display, , no error message display too. here code string connectionstring = "data source=localhost;initial catalog=hms;persist security info=true;user id=developer;password=abc@123"; sqlconnection connection = new sqlconnection(connectionstring); string selectstatement = "select * mytable registrationno = '@registraionno'"; sqlcommand insertcommand = new sqlcommand(selectstatement, connection); insertcommand.parameters.addwithvalue("@registrationno", txtsearch.text); sqldatareader reader; try { connection.open(); reader = insertcommand.executereader(); while (reader.read()) { textbox3.text = reader["regist...

recursion - Perl opening files from recursive directory -

so program supposed recursively go through directory , each file in directory, open file , search words "error" "fail" , "failed." should write instances these words occur, rest of characters on line after words, out file designated in command prompt. have been having trouble making sure program performs search on files found in directory. right recurse through directory , creates file write out to, however, not seem searching through files found in recursing. here code: #!/usr/local/bin/perl use warnings; use strict; use file::find; $argument2 = $argv[0]; $dir = "c:/program/scripts/directory1"; #directory search through open file, ">>$argument2" or die $!; #file write out $unsuccessful = 0; @errors = (); @failures= (); @failures2 = (); @name = (); @file; $file; $filename; opendir(dir, $dir) or die $!; while($file = readdir(dir)){ next if($file =~ m/^\./); foreach(0..$#file){ print $_; open(filelist,...