Posts

Showing posts from August, 2010

Wordpress ignoring page template from drop down -

i struggling appears easy, page templates. have read plently posts on this, people seem forget put comment @ top of page , can't show in drop down menu on pages. can this, problem next stage. i have written basic template (custom-page.php): <?php /* template name: test template */ ?> <?php get_header(); ?> <h1>teams!</h1> <?php get_footer(); ?> it shows , can select on new page sidebar. when visit new page seems have defaulted archive page using content template include. thanks in advance. if put following in footer, should able grok further information how template being selected (and know might happening). <?php global $template; echo(basename($template)); ?> then template name in footer. it's possible (like @adomnom said) have slug conflict. there handful of other strange scenarios caused plugins, custom functions, or other factors well.

jquery - Ajax Live Search multiple response at a time -

according question, use deboucing make live search facebook facebook style ajax search but here case, when set timeout 300ms, first type query , wait 300ms ajax request triggered, when waiting server response query a, query b, , after 300ms, response query shows up, , response query b shows too, see 2 results flashing, how prevent this? (cancel first request or something?) depending on how many results return see 2 possible actions: don't make new request wait old 1 complete , filter new search value cancel first request , start one. the first method work when first request returns more items displayed.

hadoop - Interoperability of pig 0.9.0 with cdh3u1? -

softer version of cdh3 client interoperable apache hadoop server 0.20.xx? we have java app runs series of pig scripts (it injects variables in them, it's driver/client running them). need macro features of pig 0.9.0 cdh comes pig 0.8.1. following idea? we try working with: <dependency> <groupid>org.apache.hadoop</groupid> <artifactid>hadoop-core</artifactid> <version>0.20.2-cdh3u1</version> </dependency> with <dependency> <groupid>org.apache.pig</groupid> <artifactid>pig</artifactid> <version>0.9.0</version> </dependency> instead of <dependency> <groupid>org.apache.pig</groupid> <artifactid>pig</artifactid> <version>0.8.1-cdh3u1</version> </dependency>

exception - NotImplemented Attribute C# -

a simple question: why there isn't notimplementedattribute in c#? you can throw exception, think nice work obsoleteattribute -> warning using method. ok, have method attribute, , when implement have remove attribute hand, think safer using methods throw new notimplementedexception() inside...and wait them called. i remember reading obsolete hard coded compiler, maybe there spare room 1 :) this opinion, maybe wrong. it's see. thanks

Ruby: Mildly 'exotic' inheritance doesn't work? -

i factor bunch of common code subclasses superclass method. superclass method must refer nonexistent (in superclass) method defined in subclasses. can't work. this 1 try out of many multiple variations have tried: class superclass def chunk_of_code # <code...> nonexistant_superclass_method_defined_in_subclass params # <more code...> end end class subclass < superclass def nonexistant_superclass_method_defined_in_subclass params # whatever... end end subclass.new.chunk_of_code params this doesn't work. other variations don't work either. kind of coding possible in ruby (i thought was)? did kind of thing time working in smalltalk. any way achieve want? please avoid advising me use "mix-ins" or "modules," i'd just learn , use ruby's inheritance right now. *running latest version of ruby. thanks. edit: in rails app. superclass applicationcontroller. edit: he...

c# - MonoTouch connect to Azure ACS, Azure SQL / Azure WCF -

Image
i'm going make ios application , wondering on differences between development new language objective c cocoa or old language c# mono-touch the requirement of application should work azure , store/retrieve information store on local device frequently, content browsing , token login portal, deadline 2 month today , never develop iphone / ipad application previously. may know easier start , there resources mono ? while find it's great if use old programming language seem there're no such thing support monotouch azure development... thank reply. first of have asked lots of things in 1 post. first question answer subjective. objective c/cocoa native language ios development using monotouch, require depend on whatever provided monotouch. if not part of monotouch wouldn't able it. here can find lots of opinions other fellow users: monotouch & c# vs objective c iphone app i can give guidance on windows azure development mobile device. connecting differen...

javascript - Knockout.js: adding elements to observable-array -

i have problem loading element items observable-array - event. viewmodel = (function () { var items = ko.observablearray([]), removeitems = function (element) { items.remove(element); }, saveall = function () { return ko.tojs(items); }, additem = function (element) { items.push(element); return false; // no page-reload after button-klick }; return { items: items, // call additem dummy object (for testing) clicksave: additem(new customer(1, "tfsd", "tfsd")) }; })(); ( fiddle ) why additem function called, without clicking button? because of () @ end of function? additem = function (element) { items.push(element); return false; // no page-reload after button-click }; what can make event only? or problem somewhere else? use return { items: items, clicksave: additem }; ...

for loop - VB.Net - Looking for Design Pattern - For Each Instead of For with index -

using vb.net, i'm looking best practices in dealing following idiom: for integer = 0 o1.count - 1 o1(i).x = o2(i).x next what want vb.net doesn't offer -- additional , simultaneous iterators on each statements. for each m1 c1 in o1, m2 c2 in o2 m1.x = m2.x next i'm interested in both linq , non-linq recommendations, comments copy method design, comparisions c# or other languages. i'm sure actual real world situation more complicated example have shown, thought worth mentioning that, if doing trying copy entire list of items 1 list another, can this: dim list2 = new list(of object)(list1)

iphone - Invoking a singleton class to keep a sockets connection open -

i have created singleton class job create tcp socket connection , keep open infinitely while application running. believe singleton class looks it's supposed (with other stackoverflow questions me there) problem not know when or how invoke class object. i'm still pretty new ios development, pretty foreign me. my app has multiple views i want use singleton class create tcp socket connection , keep connection open @ times i not know call/invoke singleton class object i not know how call/invoke singleton class object i using smallsockets library here class files: socketconnection.h #import <foundation/foundation.h> @interface socketconnection : nsobject { } + (socketconnection *)getinstance; @end socketconnection.m #import "socketconnection.h" #import "imports.h" static socketconnection *sharedinstance = nil; @implementation socketconnection - (id)init { self = [super init]; if (self) { while(1) ...

php - Parse HTML links with a regular expression -

i have following code: $regex='|<a.*?href="(.*?)"|'; //parse links preg_match_all($regex,$result,$parts); $links=$parts[1]; foreach($links $link){ echo $link."<br>"; } its output following: /watch/b4se39an /watch/b4se39an /bscsystem /watch/ifuyzwfw /watch/ifuyzwfw /?sort=v /?sort=c /?sort=l /watch/xk4mvavj /watch/2h7b53vx /watch/d7bt47xb /watch/yh953b17 /watch/tj3z6ki2 /watch/sd4vraxi /watch/f2rnthuh /watch/ey6z8hxa /watch/ybgxgay1 /watch/3iaqyrm1 /help/feedback how can use regular expression extract /watch/..... strings? modify regex include restriction on /watch/ : $regex = '|<a.*?href="(/watch/.*?)"|'; a simple test script can show it's working: $tests = array( "/watch/something", "/bscsystem"); $regex = '|<a.*?href="(/watch/.*?)"|'; foreach( $tests $test) { $link = '<a href="' . $test . '"></a>'; ...

android - Error in accessing sqlite database -

public class dbopener { private static string db_path = "/data/data/com.edu.tp.iit.mns/databases/"; // path // of // our // database private static string db_name = "finals"; // database name private final context mycontext; private sqlitedatabase db; public dbopener(context context) { mycontext = context; } public void open() { boolean dbexists = checkdatabase(); if (!dbexists) { try { copydatabase(); } catch (ioexception e) { throw new runtimeexception("something bad!!!"); } } string path = db_path + db_name; db = sqlitedatabase.opendatabase(path, null, sqlitedatabase.open_readwrite); } private boolean checkdatabase() { sqlitedatabase c...

Jsoup: 500 error loading URL -

i trying write code logs google play website , extracts data present in home page of developer. now when try parse url: https://play.google.com/apps/publish/home?dev_acc=12345678 , parses irrelevant parts of page. part of page contains application data not present. saw source of same page in browser , found application data not present in too. so while using live http headers (with firefox) found there other urls might have data want. when try open them (using post) gives error: 500 error loading url https://play.google.com/apps/publish/feedback?dev_acc=12345678 now tried opening same page in browser , got, http method not supported url error 405 can point out how carry on this? cannot post code due company policy can tell have used same technique in of sites , worked. cannot understand what's happening here. thanks, arun well... don't know google api, nor policy. know them not liking guys data without using own methods. should way within google want....

javascript - what's the purpose of eval function? -

i know function gets string of valid javascript expression or statements , evaluate expression or execute statements, why need pass code function execution instead of writing code in script? let's have functions: makecheckbox() , makeradio() , makeselect() (theoretically). want call function user's activity (for example menu click). can make if , else if , on, can make switch , can eval , make like: eval('make'+userchoose.charat(0).touppercase()+string.slice(1)+'()'); where userchoose 1 of options: radio , checkbox or select , first-char-uppercased first , concatenated make (before) , () (after), @ end calls 1 of functions. this not practice because in large projects can't find callings function, because they're "hidden behind" eval , it's way.

mysql - bootstrap error trying to enable drupal module with drush -

trying install first drupal module. following book did not work because of "ftp" error installed drush. download seemed work enable command gives me error. i'm noob ubuntu , every part of drupal. help. thanks. nnh@comp:/var/www/drupal$ sudo drush en module_filter command pm-enable needs higher bootstrap level run - [error] need invoke drush more functional drupal environment run command. drush command 'en module_filter' not executed. [error] drush not able start (bootstrap) drupal database. [error] hint: error occurs when drush trying bootstrap site has not been installed or not have configured database.and tried it. drush attempting connect : drupal version : 7.14 site uri : http: //default database driver : mysql database hostname : localhost database username : drupal7 database name : drupal7 default theme : garland administrat...

android - Optimizing yuv420p to rgb565 conversion with Tegra? -

when android application native code runs on neon processor i'm taking advantage of fast neon assembler instructions convert yuv420p rgrb565. is there similar tegra processors though? the arm simd instruction set called neon standard feature on cortex-a8 , cortex-a9 processors. nvidia tegra2 not include neon, tegra 3 does. there no other standard instruction set extensions arm related multimedia matter. marvel had mmx variant added strongarm , pxa series while intel owned them, no longer relevant.

Looking for mod_rewrite regular expression feature in grep -

because picture (or example) worth more thousand words, i'll use example: rewriterule ^/products/([0-9]+)$ /content.php?id=$1 in rewriterule example we've got simple regular expression. $1 reference captured ([0-9]+), reference number if matching exists. possible in grep? let's say, xml document contains following : <sometag>somevalue</sometag> i extract somevalue , input second_bash_script following: first_bash_script | grep "<sometag>\([[:digit::]]\)\+</sometag>" | second_bash_script is somevalue . possible extract somevalue using grep? thanks clue! those 2 separate questions, right? the answer first 1 be: use sed , grep doesn't substitutions. sed 's_^/products/\([0-9]\+\)_/content.php?id=\1_g' the second thing can done grep using perl regexp: $ echo '<sometag>42</sometag>' | grep -op '(?<=<sometag>)\d+(?=</sometag>)' 42

svn - Subversion reintegrate branch conflicts -

i'm using svn version control , have following question: let's develop in feature branch , upstream changes trunk (by merging them , resolving conflicts). now, @ moment made last upstream merge trunk , resolved conflicts. and, example, right after merge somehow manage "freeze" trunk - commits trunk being rejected , remains in same state. does guarantee absence of conflicts when perform merge --reintegrate feature branch ? or missing other conditions , actions, might possibly lead them? how plan freeze trunk? if freeze trunk first, , merge trunk branch, guaranteed no 1 has touched trunk since last merge. you shouldn't have merge conflicts if: you don't cherry pick merges since merge conflicts should have been handled when merged branch trunk -- that's if didn't cherry picking of merges. you did merging same root directory. however, possible strange edge case might not true. i've tried 2 feature branches see i...

ios - AFHttpClient post with both parameters and JSON in body -

sorry, im kinda newb regarding http post terminology! i have post webservice cannot changed: format follows: http://somewebaddress/json/getallfeedsrestfullywrapped?usertoken=foo so parameters are: key:usertoken , value=foo in body need put json formatted array this: {"feedids":[1,2,3,4,5,6]} im trying accomplish afnetworking cannot seem make work situation. i have tried both afhttpclient , afjsonreqestioperation im not able combine request , body correct. so hope knows how this. appreciated. try that [[yourhttpclient sharedhttpclient] postpath:@"getallfeedsrestfullywrapped?usertoken=foo" parameters:[nsdictionnary {"feedids":[1,2,3,4,5,6]}] success:^(afhttprequestoperation *request, id json) { } failure:^(afhttprequestoperation *request, nserror *error) { }];

Android: Dynamically adding textviews to a scrollview -

i working on application functions text messaging app. working on layout of app now. in xml file have edit text on top of screen , 1 on bottom of screen. want dynamically create scrollview between 2 edit texts. scroll view enable scroll through multiple messages of app. when try create scrollview , textview dynamically replaces edittexts , disappear. so question how go preventing edittexts disappearing , adding scrollview in between 2 edit texts ? my code this: scrollview sv = new scrollview(this); linearlayout ll = new linearlayout(this); ll.setorientation(linearlayout.vertical); sv.addview(ll); textview tv = new textview(this); tv.settext("dynamic layouts ftw!"); ll.addview(tv); this.setcontentview(sv); what asking build listview . listview'ss have every function require , more. further, adapters, pretty quick. here decent turorial on using listviews.

html5 - jQuery onclick don't work with a href and img -

i want display divs when clicking on link id. jquery: $('#tab-bar a').on('click', function(e){ e.preventdefault(); var nextpage = $(e.target.hash); page(nextpage); $("#pages .current").removeclass("current"); nextpage.addclass("current"); }); html: <div id="pages"> <div id="mainpage" class="current"> <ul id="tab-bar"> <li> <a href="#mimik"><img src="img/mimik.jpg" alt="mimik"></img></a><br> </li> </ul> </div> <div id="mimik"> <h2 style="color:red">mimik</h2> </div> when use text instead of image in works wish. h2 displayed. image in "link" displays blank page. how can solve problem? best regards simon that because when have image inside anchor event ...

java - Hiding a <div> tag using wicket & eclipse -

i've tried hide tag in wicket, i've managed accomplish in case follows: html ... <div wicket:id="div_id">this hides</div> java final webmarkupcontainer wmc = new webmarkupcontainer("div_id"); method public onsubmit(){ wmc.setvisible(false); } this manages div hidden, div tag has wicket components inside, , can't seem working, error pops saying inner components not defined in component "div_id". any idea how working? thanks guys!! this wild guess, since don't know how add inner components , fails, if add or modify them in onbeforerender() , you're using wicket 1.4.x, you'll need override webmarkupcontainer.callonbeforerenderifnotvisible() return true... for wicket 1.5 code should moved onconfigure()

objective c - loading UIViewController faster -

i have 6 viewcontrollers , 6 buttons in project. every button brings appropriate viewcontroller. thing when user taps example 4th button application freze 1 or 2 seconds , requested viewcontrol loaded. want make things faster. mean checked applications there done first requested viewcontroller brought starts load controls. how can such thing in application ? using "time profiler" tool in instruments can see functions in code slow. should figure out code slowing down. for instance, if swapped view controllers out blank ones shouldn't see freezing. chances in view controller initialization code slowing down.

android - Show date in current locale -

i have input date-time string: 2012-06-04 15:41:28 i display various countries. example, in europe have dd.mm.yyyy whereas uses mm/dd/yyyy. my current code this: textview timedate = (textview) v.findviewbyid(r.id.report_date); simpledateformat curformater = new simpledateformat("yyyy-mm-dd kk:mm:ss"); curformater.settimezone(timezone.getdefault()); date dateobj = curformater.parse(my_input_string); timedate.settext(dateobj.tolocalestring()); but doesn't work want (i "uniform" result "jun 4, 2012 3:41:28 pm", on phone). doing wrong? try this: textview timedate = (textview) v.findviewbyid(r.id.report_date); simpledateformat curformater = new simpledateformat("yyyy-mm-dd kk:mm:ss"); curformater.settimezone(timezone.getdefault()); date dateobj = curformater.parse(my_input_string); int datestyle = dateformat.short; // try medium, , full int timestyle = dateformat.medium; dateformat df = dateformat.getdatetimeinstan...

file - acct folder android -

what /acct folder in android file system hierarchy mean? need understand file system hierarchy. manipulation of file inflict harm? i think acct means accounting "cpu accounting controller". cpu accounting controller cgroups

datetime - MS Timestamp parsing Python -

is there built-in function in python can use parse ms timestamps ? example, "\x3a\xcf\x84\x72\x66\x42\xcd\x01" correspond date & time: 06/04/2012, 15:26:43.901625 the timestamp (as @mandel mentioned ) looks filetime -- 64-bit value representing number of 100-nanosecond intervals since january 1, 1601 (utc) : import struct datetime import datetime, timedelta def filetime_bytes_to_datetime(timestamp_bytes): quadword, = struct.unpack('<q', timestamp_bytes) = quadword // 10 - 11644473600000000 return datetime(1970, 1, 1) + timedelta(microseconds=us) example: >>> filetime_bytes_to_datetime(b"\x3a\xcf\x84\x72\x66\x42\xcd\x01") datetime.datetime(2012, 6, 4, 15, 26, 43, 901625) '<q' (little-endian unsigned 64-bit integer) might not work on platforms (due alignment of filetime structure fields, endianness). to parse value on windows, use ctypes.wintypes.filetime structure: import ctypes import os dat...

Android Java Compiler directive to disable warnings for a single line of code -

i want suppress compiler warning number. saw done following line of code special comment. you know murphy's law? think 1 case. when don't need it, bump time on code has kind of directive. loks somehting static int num; //!nlns201 now need cannot find anywhere. edit: cannot believe nobody knows talking about! rephrased question, maybe unclear. well, found it. not thought is. the $non-nls-x tags, used eclipse suppress literal strings warning aimed @ language internationalization. i using instead @supresswarnings("all") before variable declaration. see post reference on @suppresswarnings arguments

Is it possible to pass the NEW and the OLD tables from a trigger into a procedure in MySQL? -

is possible pass new , old tables trigger procedure in mysql? suspect no, since there no such datatype table procedure accepts. workarounds possible? ideally this: create trigger product_log after update on product each row begin call logchanges(old, new); end; you can explicitly pass each field: call logchanges(old.cola, old.colb, new.cola, new.colb); or if logchanges must sufficiently generic can handle such calls different tables, 1 concatenate field values single string using suitable delimiter (e.g. unit separator ): call logchanges(concat_ws(char(31), old.cola, old.colb), concat_ws(char(31), new.cola, new.colb)); or if data types must preserved, 1 insert records temporary logchanges reads.

iphone - iOS unable to autoresize subviews when device rotation -

i tried several solutions found on other posts still having problems autoresize subviews when device rotation. layout (ib) has 3 views , apply resize current view. if then, after rotating device, view shown, not resized , remains @ previous dimensions. set autoresize subviews , mask... doing wrong or missing? appreciated, thank you! - (void)viewdidload { [super viewdidload]; [self.view setautoresizessubviews:yes]; [self.view setautoresizingmask:uiviewautoresizingflexiblewidth | uiviewautoresizingflexibleheight]; [vistasocial setautoresizessubviews:yes]; [vistasocial setautoresizingmask:uiviewautoresizingflexiblewidth | uiviewautoresizingflexibleheight]; [vistab setautoresizessubviews:yes]; [vistab setautoresizingmask:uiviewautoresizingflexiblewidth | uiviewautoresizingflexibleheight]; for given view adjust size upon device rotation, superview needs have autoresizessubviews property set yes . (it not clear code fragment view hierarchy is.) ...

c++ - Using `std::sort` with a member function in a templated class -

the problem i'm having want use stl's sort custom compare function inside templated class. the idea using typedef came stackoverflow post anyway, here code: template <typename r,typename s> class mesh{ /* stuff */ void sortdata(){ typedef bool (*comparer_t)(const s,const s); comparer_t cmp = &mesh::compareedgesfromindex; sort(indx,indx+sides*esize,cmp); } /* more stuff */ // edata , cindx member variables bool compareedgesfromindex(const s a,const s b){ return compareedges(edata[cindx[2*a]],edata[cindx[2*a+1]],edata[cindx[2*b]],edata[cindx[2*b+1]]); } }; the error i'm getting mesh.h:130:29: error: cannot convert ‘bool (mesh<float, unsigned int>::*)(unsigned int, unsigned int)’ ‘comparer_t {aka\ bool (*)(unsigned int, unsigned int)}’ in initialization thank in advance! you trying mix member-function-pointer function-pointer required. can either refactor predicate static function, or use bindings a...

c# - Honeypot Attribute creates syntax error in MVC 3 project -

i went following link , started performing instructions step-by-step. https://github.com/webadvanced/honeypot-mvc/wiki/simple-getting-started-guide i added using simplehoneypot.core; @ top of controller. i have listed dll's, when try add honeypot attribute httppost method, syntax error. it says type simplehoneypot.core.honeypot exists in both '...mvc2.dll' , '...mvc3.dll'. previously, tried delete mvc2.dll package, then honeypot didn't appear recognized @ all. how use honeypot attribute in controller? in references folder in solution, delete reference simplehoneypot.net4.mvc2 . make sure reference simplehoneypot.net4.mvc3 still there. application should build.

python - Multiply each pixel in an image by a factor -

Image
i have image created using bayer filter , colors off. need multiply rg , b of each pixel factor ( different factor r, g , b each) correct color. using python imaging library , of course writing in python. there way efficiently? thanks! here how it: first split image rgb channels. use point multiply channel factor ( 1.5 in example, on r channel). merge channels back. heres code: import image im = image.open('1_tree.jpg') im = im.convert('rgb') r, g, b = im.split() r = r.point(lambda i: * 1.5) out = image.merge('rgb', (r, g, b)) out.show() original: with red channel multiplied 1.5 (its bit redder..):

assembly - Should you backup registers before calling a C Standrd Library function? -

in assembly, should backup registers before calling c standard library function? does standard library guarantee of functions backup caller's registers , recover them in end? where can find official information matter? it platform specific, don't need save , restore registers @ call site, callee it. need follow linkage convention particular platform. c-library not state-less, not idea call functions without initializing library done in typical c program object contains main().

optimization - remove redundant css rules from dynamic website -

i'm trying reduce size of css file. template css & js heavy. cssmin css file size 250kb. whilst use alot of css - know dont use all. i'm trying work out styles can removed. i'm aware of dust-me selector - takes static @ website. html5 , css3 - websites dynamic, , of css occurs dynamic events, or 'responsive' events i.e. bootstrap. question: there tool 'records' css use on website perioid of time, can go , click/hover/move on each element , interact site. @ end let me know styles & not used? 250kb such big figure css files. templates have css required pages in single file. suggest: do not cut css code, might needed point of time. instead suggest, break css file number of small files different page stylings, such different css login page, different css file home page, etc. read own css , html code vigorously find out which significant part of css code used in html section . update: may try removed unused css - css ...

CPU Frequency in AVR, CodeBlocks and Proteus -

well, i'm using code::blocks ide, , win avr compiler. f_cpu selected 8000000ul. i'm writing code atmega32. when run written code (*.hex file) in proteus design suite (isis) _delay_ms(1000) doesn't give delay 1sec. don't know if write or wrong, i've selected cksel fuses (0100) int.rc 8mhz in edit component. what's wrong? please.... have tried setting compiler optimization other -o0? avr-libc docs regarding delay * functions. in order these functions work intended, compiler optimizations must enabled, , delay time must expression known constant @ compile-time.

magento layout - content block structure and position -

here magento's newbie question. is there way see content blocks of each magento theme, example in joomla! when typing "?tp=1" @ end of url can see layout? thanks! there feature in magento allow view structure of layout including template file names (i.e. .phtml) , associated block types. this feature easy enable in admin area: log in admin area , go system > configuration > developer. change "current configuration scope" setting in top left of screen. after page reloads should see tab titled 'debug'. under have option display hints both templates , blocks. change both yes , visit frontend.

ruby on rails 3.2 - How can I specify prefix parameters when saving a nested ActiveResource? -

i have nested activeresource model (i.e. it's within model's namespace). trying call save raises: activeresource::missingprefixparam: client_id prefix_option missing how supply needed prefix? here's class: class foo::bar < activeresource::base self.site = "http://www.example.com" self.prefix = "/clients/:client_id" self.element_name = "policy" self.collection_name = "policies" end here's save attempt: bar = foo::bar.new :client_id => 123 bar.valid? # => true bar.client_id # => 123 bar.save # => activeresource::missingprefixparam... time , again i've looked elucidation on this, find same instruction: when requested nested resource , don’t provide prefix_param activeresource::missingprefixparam raised. i'm trying access our server's api endpoint @ http://www.example.com/clients/[client_id]/policies , i'm apparently failing supply client_id , app makes request http://www.e...

Check Twitter Streaming Access Level -

i have twitter account elevated access levels (15% of firehose , keywords) have been having issues tokens. trying resolve them now, can't figure out if elevated rate limit being used. is there way test receiving amount? or place login , check? logging dev.twitter.com site doesn't seem give information access level. just create filter stream more 400 keywords. if can, account fine. by way, mind if ask how did have elevated access levels account. application needs kind of account track more 400 keywords have no idea how it. many thanks.

How do I restrict route extensions in @RequestMapping paths for Spring MVC controllers? -

i have simple task want accomplish, can't seem find information spring mvc routing it. have simple controller routes path view: @controller @requestmapping(value = "/help") public class helpcontroller { private static final string = "help"; @requestmapping(method = requestmethod.get) public string help(model model, locale locale) { model.addattribute("locale", locale); return help; } } i throw 404 if http://mysite.com/help.some.extension.is.entered , spring seems resolve example /help. javadoc says @requestmapping annotation servlet uri mapping, thought /help means needs exact match. clarification appreciated. for spring 4 it's pretty easy solve: <mvc:annotation-driven> <mvc:path-matching suffix-pattern="false" /> </mvc:annotation-driven> so still can use mvc:annotation-driven config.

jquery - How do I get cell data from a javascript variable containing a <tr> element -

i using datatables , table tools plugin. can have selected row returned javascript variable. variable want value of specific cell in each row. not sure @ how though. have var rowdata = tabletools.fngetinstance( 'tableid' ).fngetselected(); and want rowdata.children('td'), doesn't work, effect. var cellvalue = $("#tableid").datatable().fngetdata(rowdata, colindex); where colindex whatever column want value of (this includes hidden cells). if don't care hidden cells, do: var cellvalue = $(rowdata).children("td")...

javascript - Redirect after POST using the Location header with jQuery -

i want redirect target using location header jquery 1.7. my code looks $('#creationlink').click(function(){ $.ajax({ type: 'post', url: '/', success: function(data, textstatus, xhr) { window.location = xhr.getresponseheader("location"); } }) }); ... not work. xhr.getresponseheader("location") null. http headers: post / http/1.1 host: localhost:9000 x-requested-with: xmlhttprequest content-length: 0 http/1.1 302 found content-type: text/plain; charset=utf-8 location: http://localhost:9000/virdd0pdwp4/bearbeiten content-length: 0 how can redirect using location header? afaik, browsers supposed to, during xhr, transparently follow redirect in response header. is, xhr @ response, see location header, , proceed magically run second request uri. when has result of that give @ all, , gives result of second request. see this stackoverflow answer ! so, if need redirect feature, you'll ha...

sql - null value in foreign key -

i copied following paragraph http://msdn.microsoft.com/en-us/library/ms175464(v=sql.105).aspx a foreign key constraint can contain null values; however, if column of composite foreign key constraint contains null values, verification of values make foreign key constraint skipped. make sure values of composite foreign key constraint verified, specify not null on participating columns. could provide me simple example me understand above? verification foreign key constraint do? think has referential integrity. thanks lot. you shouldn't need example if think of in way. if any of fields in composite foreign key null none of other fields checked integrity until all fields of key provided.

case insensitive glob listing in zsh -

i have following code: $ print -l backgrounds/**/*.((#i)jpg|jpeg|gif|webp|png|svg|xcf|cur|ppm|pcd) the intention list image file indifernet of case of file termination. but code seems not functional because won't list files whit uppercase endings. can explain error in above code example? thanks in advance. you need #i apply everything, not jpg . can use: $ print -l backgrounds/**/*.(#i)(jpg|jpeg|gif|webp|png|svg|xcf|cur|ppm|pcd) make sure have done: set -o extended_glob

html5 - Overlap/hit test in javascript -

im trying hit test/overlap test work in below code creates 200 circles in random position on canvas. trying store positions of circles in array , checking array each time circle created in loop, if randomly created x , y close created circle should keep getting new random x , y until isnt close created circle. i cant work in while loop. any please... thanks <script type="text/javascript"> document.addeventlistener("domcontentloaded", canvasdraw); function canvasdraw () { var c = document.getelementbyid("canvas"); var w = window.innerwidth; var h = window.innerheight; c.width = w; c.height = h; var ctx = c.getcontext("2d"); ctx.clearrect(0,0,c.width, c.height); var abc = 0; var colours = new array ("rgb(0,100,0)", "rgb(51,102,255)"); var positions = new array(); function hittest(x, y) { for(var p in positions) { pp = p.split("...

eclipse plugin - GEF: How to add figures to different BorderLayout sections of RootEditPart/-Figure -

i have gef editor following rooteditpart . public class myprojecteditpart extends abstractgraphicaleditpart { @override protected ifigure createfigure() { scalablefreeformlayeredpane layer = new scalablefreeformlayeredpane(); layer.setlayoutmanager(new freeformlayout()); return layer; } i'm using editor create bottom-up tree: _7_ / \ 5 6 / \ / \ 1 2 3 4 1-7 rectangle s, 1-4 represent different model elements 5-7 . @ moment, figures laid out foot ( new rectangle(x, y, w, h) + parent.setconstraint(this, figure, rectangle) ). position of figures 5-7 calculated simple algorithm, based on position on figures 1-4 . for sake of practicality i'd able add 1-4 flowlayout ed figure @ borderlayout.bottom of rootfigure, , add rest of figures rootfigure's borderlayout.center . however, i'm pretty new gef , can't head around how it. fail find right method adding figures 1-4 in respective editpart 's createfigur...

solr - textual content without metadata from Tika via SolrCell -

Image
using solr 3.6 , extractionrequesthandler (aka tika), possible map just textual content (of pdf) field minus metadata? "content" field produced tika unfortunately contains metadata munged in text content of document. i provide snippet highlighting of content , subject metadata within content field skewing highlight results. update: screenshot of tika output indexed solr. highlighted portion block of metadata gets prepended block of text pdf content. the extractingrequesthandler in solrconfig.xml: <requesthandler name="/update/extract" startup="lazy" class="solr.extraction.extractingrequesthandler"> <lst name="defaults"> <str name="lowernames">true</str> <str name="uprefix">ignored_</str> </lst> </requesthandler> schema.xml fields. note "content" receives tika's content output directly. "page" , "collection...

objective c - UIPickerView Spin Confusion -

i have app making has pickerview , uibutton. want user tap button , make picker view show random selection. have been looking around , can't seem come anything. guess similar urbanspoon app. know piece of code can't think of be. you looking – selectrow:incomponent:animated: so this: [thepickerview selectrow:(arc4random() % numrows) incomponent:0 animated:yes]; where numrows number of rows. if rows associated array names rowarray instance be: [thepickerview selectrow:(arc4random() % [rowarray count]) incomponent:0 animated:yes];

rsa - Best practices for personal private keys -

i'm starting use rsa keys in daily work, , have few questions regarding best ways use them. the biggest question revolves around idea of multiple clients , multiple servers. here's scenario: i have 2 client computers: desktop laptop and there 2 servers authenticating: my own local server remote service (e.g. github) so, generally, how many key-pairs recommend in situation? one key-pair: key "me" , use everywhere. one per client: key "this client" , put on each server mean connect client. one key-pair per server: key "for service", , bring private key each client want connect from. one every combination: every unique client-server pairing has own key-pair. if none of these significantly superior or worse other, can outline pros , cons of each person choose themselves? of 4 options, 2 are: one per client: key "this client" , put on each server mean connect client. this gives easy ability revoke ...

Magento XML $this->getChildHtml() necessary? -

i have edited following file, move newsletter footer instead of sidebar app/design/frontend/base/default/layout/newsletter.xml i changed following code: <reference name="left"> <block type="newsletter/subscribe" name="left.newsletter" template="newsletter/subscribe.phtml"/> </reference> to: <reference name="footer"> why did not need add $this->getchildhtml('newsletter') or similar footer.phtml? unsure when use getchildhtml() , when not to. steps necessary in exercise#2 of this article ? thanks. if take @ page/html/footer.phtml , footer block's template <div class="footer-container"> <div class="footer"> <?php echo $this->getchildhtml() ?> <p class="bugs"><?php echo $this->__('help keep magento healthy') ?> - <a href="http://www.magentocommerce.com/bug-tr...

javascript - clearTimeout not working in nested function -

i think it's got nested functions, need way. why isn't working? doing stupid? isolated example , must using $(this) , seems have nest functions? html: <div class="box"></div> <ul> <li>hover box, turns blue. leave box, turns red after 2 secs.</li> <li>if hover onto box before 2 secs up, it's supposed clear timer , keep box blue.</li> <li>it doesn't clear timer , after 2 secs box still turns red. why?</li> </ul> javascript: var t; $('.box').on('mouseenter', function() { $thisbox = $(this); cleartimeout(t); $thisbox.addclass('blue'); $thisbox.on('mouseleave', function() { t = settimeout(function() { $thisbox.removeclass('blue'); }, 2000); }) }); ​jsfiddle: http://jsfiddle.net/ddbtz/7/ thanks looking :) http://jsfiddle.net/ddbtz/3/ your .on() shouldn't nested. effectively, that's attac...

How to create with Python API a new Perforce user? -

i'm writing test python script returns list of submitters. the following: new_user = self.p4.fetch_user('existing-user') new_user['user'] = 'new-user' self.p4.save_user(new_user) emits: p4exception: [p4#run] errors during command execution( "p4 user -i" ) [error]: "error in user specification.\nuser name can't changed 'existing-user'." what's python api call create new user? new users created automatically with: self.p4 = p4python.p4.p4(user='new-user')

asp.net session logout -

i have made asp.net application. application has session variables shows user logged in or logged out. if there way capture expiration of session without going single pages , once logged out user can redirected login( re-login) page? can asp.net classes inherit base class can have abstract method check if session existing or not. please suggest me architecture this. thanks in advance. you can use global.asax's session end event: void session_end(object sender, eventargs e) { // code.... } when session expire event called.

php - Inserting this timestamp into MySQL timestamp column -

i have series of data need insert mysql table using php (codeigniter). problem: 1 of data timestamp looks 06/01/12 01:43 pm . when insert mysql timestamp column, becomes 0000-00-00 00:00:00 . how can format original format can insert correctly timestamp col? if wanted perform transformation via php, it's quite straightforward: $oldformat = "06/01/12 01:43 pm"; $newformat = date("y-m-d h:i:s", strtotime($oldformat)); strtotime docs date docs

spring - Integration framework for JSF -

in our product have separate layers ui , backend , means different wars ui , server (ui.war , server.war). planning use primefaces/richfaces jsf framework along xhtml. so, way platform architect-ed ui send request server business logic. e.g. when form submitted data sent server side invoking rest interface. thinking of using integration framework seam jsf ui.war, seems overkill given ui.war have jsf , framework jersey invoke rest interface. if using jsf ejbs etc in 1 single war using seam framework have been useful. since have jsf in ui.war, u think should use 'any' integration (seam/spring) framework in ui.war , if yes one? also, might want integrate security framwork too, shiro maybe. please guide. using jboss.

php - Error in installing JomSocial in Joomla -

i got error when installing jomsocial in joomla project in extension manager . it says installing component successful. got error strict standards: variables should assigned reference in c:\xampp\htdocs\project\administrator\components\com_community\install.community.php on line 39 actually new joomla things , don't have idea error. can can me case? thanks in advance ... make sure joomla version , joomsocial version compatible each other....

ruby - Converting images with MacRuby -

does know how convert images macruby (or normal ruby)? imagine 'scriptingbridge' framework able handle it. in addition, prefer not use imagemagick or (something lighter fine, however). thanks! you can macruby: framework 'appkit' input_file_path = "/users/username/desktop/input_file.png" img_data = nsdata.datawithcontentsoffile(input_file_path) bitmap = nsbitmapimagerep.imagerepwithdata(img_data) new_data = bitmap.representationusingtype(nsjpegfiletype, properties: nil) # nsbmpfiletype, nsgiffiletype, nsjpegfiletype, nspngfiletype, or nstifffiletype. output_file_path = "/users/username/desktop/output_file.jpeg" new_data.writetofile(output_file_path, atomically: true) and you're done, nsbitmapimagerep#representationusingtype:properties: can takes nsbmpfiletype, nsgiffiletype, nsjpegfiletype, nspngfiletype or nstifffiletype bmp, gif, jpeg, png or tiff

condition while making relation in YIi -

agent: agent_id (primary key) user: f_id (foreign key) type i have created relation in way public function relations() { return array( 'user' => array(self::has_one, 'users', 'f_id'), ); } but want add more conditions join if type=3 in user table. thanks. add condition on relation public function relations() { return array( 'user' => array(self::has_one, 'users', 'f_id', array( 'condition' => 'user.type = :type', 'params' => array(':type'=>3) )), ); } http://www.yiiframework.com/doc/guide/1.1/en/database.arr#relational-query-options

visual studio 2010 - how create a sql database fom a stongly typed dataset -

i'm looking easy way transfer database schema have developed inside visual studio typed dataset (xsd file) corresponding sql server database. silly me assumed process forthright, can't find out how it. assume duplicate tables column column, seems error prone. know of way perform schema transfer this? maybe tool translate xsd file corresponding sql server ddl file? final thought once have schema transferred moving data around between 2 data stores straight forward, getting schemas synced has me stumped... thanks, keith why didn't implement data model directly in sql server ?! more common , engineered , think why microsoft has not provided wizard or tool case. can make data model scripts or .sql files , can managed via svn , whenever need model implementation can sue them.

java ee - JavaScript force an OnChange in Maximo -

i'm working on bookmarklet maximo, java ee application, , need populate few input boxes. generally when use inputs data box click button gives them popup , search value added script. or can type name , hit tab/enter , turns capital letters , few things in background (not sure exactly). i use javascript: $('mx1354').value = "khbrarr"; $('mx1354').ov= "khbrarr"; but not work need to. set's input box value needed, doesn't run background functions when hit save button doesn't recognize changes , discards put box. how simulate tab/enter button has been pressed? so far i've tried call onchange, focus/blur, , click functions (not 100% sure if called them correctly). the dojo library part of application, i'm not sure if can use 1 if it's feature or if jquery cause conflict. p.s. needs run in ie. the onchange function: function tb_(event) { event = (event) ? event : ((window.event) ? window.event : ...

python - Resizing uploaded files in django using PIL -

i using pil resize uploaded file using method: def resize_uploaded_image(buf): imagefile = stringio.stringio(buf.read()) imageimage = image.open(imagefile) (width, height) = imageimage.size (width, height) = scale_dimensions(width, height, longest_side=240) resizedimage = imageimage.resize((width, height)) return resizedimage i use method resizedimage in main view method: image = request.files['avatar'] resizedimage = resize_uploaded_image(image) content = django.core.files.file(resizedimage) acc = account.objects.get(account=request.user) acc.avatar.save(image.name, content) however, gives me 'read' error. trace: exception type: attributeerror @ /myapp/editavatar exception value: read any idea how fix this? have been @ hours! thanks! nikunj here's how can take file-like object, manipulate image in pil, turn file-like object: def resize_uploaded_image(buf): image = image.open(buf) (width, height) = image.size...

c# - Apply datatemplate to custom object? -

assuming have class derived shape. i'm looking way how implement support binding datatemplate. datatemplate looking this: <datatemplate> <grid x:name="grid"> <path x:name="path" data="f1 m 0.0692474,6.76634c -2.5902,6.76634 -4.91351,8.20551 -6.16436,10.3475l 0.0665311,-10.3179l 6.29167,10.3284c 5.03818,8.19696 2.72079,6.76634 0.0692474,6.76634 z " /> </grid> </datatemplate> it's clear me how apply datatemplate controls, such buttons, textboxs, listviews , on. the templatepartattribute like. see tutorial info on how write custom control supports templating , see how can mix shape in there.

iphone - SenTesting stop test after first STAssert fails -

is there way stop execution of ios unit test once first stassert fails? for example if have multiple stasserts: stasserttrue([myobject succeeded], @"failed"); stassertnotnil(foo,@"bar"); i love if xcode stopped executing test after first 1 fails. way this? if have exception breakpoint set exceptions, xcode throw debugger on first failed test. if you're running tests manually within xcode might acceptable. to setup exception breakpoint within xcode 4+ view > navigators > show breakpoint navigator click + button @ bottom left of breakpoint navigator window, choose "add exception breakpoint" click "done" in popover appears. xcode break debugger on exceptions encountered @ application runtime.

vb.net - Why i cannot find context menu strip in my form? -

i'am trying find context menu strip in form code doesnt seem displayed desired output...here code: dim omnustrip() object = ocollection.controls.find("mnustrip", true) dim mnustrip_ contextmenustrip = directcast(omnustrip,contextmenustrip) mnustrip_.tag = "my control" it return empty array of objects...am doing wrong here? please help..thanks! contextmenustrips added components, not controls, that's why empty array. dim strip contextmenustrip = nothing each component object in components.components strip = trycast(component, contextmenustrip) if strip isnot nothing exit next

internet explorer - IE 9 jQuery error: "Object doesn't support ... 'on'"? -

i need help. i'm getting following error in ie9. code working in firefox: script438: object doesn't support property or method 'on' this raised on following code: $(function() { $(document).on('change', '#dropdownval select', function(event) { //logic function }); }); works in firefox, not ie? i make sure both browsers loading same source. honest, it's bit impossible firefox use .on while using jquery 1.6, since method didn't exist. within console (f12 developer tools in ie , firebug in firefox) type following: jquery.fn.jquery this should resturn current version of jquery loaded on particular page. instance, of today, running command here on stackoverflow results in "1.7.1" . secondly, test presence of .on method, can access without parenthesis, using double-negation cast true boolean: !!jquery.fn.on // true if .on present, false otherwise with jquery 1.6, use .delegate rather .on sin...

How to show AlertDialog When Application in Foreground Android? -

i have program responsible show alertdialog when in foreground after several seconds: activitymanager = (activitymanager) getsystemserv(); if (am != null) { list< activitymanager.runningtaskinfo > taskinfo = am.getrunningtasks(1); if (taskinfo != null && !taskinfo.isempty()) { if (taskinfo.get(0) != null && taskinfo.get(0).topactivity != null) { if (!my_class_name.equalsignorecase(taskinfo.get(0).topactivity.getclassname())) { new alertdialog.builder(this).setmessage("aaaaaaaaaaaaaaaaaaaaaaaaaaaa?") .settitle("message").setpositivebutton("yes", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int which) { } }) .setnegativebutton("no", new dialoginterface.onclicklistener(...