Posts

Showing posts from March, 2010

objective c - SplitViewController's master side sometimes is not rendered correctly when changing orientation in IOS 6.1 -

objective c - SplitViewController's master side sometimes is not rendered correctly when changing orientation in IOS 6.1 - i have tab bar controller has tabitems. of tabitems splitviewcontrollers. sometimes, when alter orientation, left side of splitview controller not render correctly, have black square in bottom. changing orienation again, problem solved. there nil special in code. in viewdidload have: [self.navigationcontroller setnavigationbarhidden:yes]; self.splitviewcontroller.delegate = self; and 1 splitviewcontroller delegate method handled trivially: - (bool)splitviewcontroller:(uisplitviewcontroller *)svc shouldhideviewcontroller: (uiviewcontroller *)vc inorientation:(uiinterfaceorientation)orientation { homecoming no; } i have nil more, tableview on cells on detail side. i've seen such issue , workaround came reset size of left side view controller's view , it's navigation controller's view: - (void)didrotatefrominter...

css precedence ambiguity -

css precedence ambiguity - i have next css rules: input[type="submit"],input[type="reset"]{ background-image:url(skins/images/bg_mega_hdr_on.png); background-repeat:no-repeat; padding:5px; margin:5px; color:#000; cursor:pointer; } #submit-search{ background-image:url(skins/images/bg_blue.png) !important; } now according css rule, id selector has higher precedence on generic selector why that, when apply rule, sec 1 overridden first one? note have applied !important, first 1 applied. something id="submit-search " notice space can cause odd selector behaviors ! ps . cant comment yet , little points ... css precedence

tcp - tcpreplay and timestamps -

tcp - tcpreplay and timestamps - i want utilize tcpreplay replay packet trace made of tcp , upd packets. is there way attach timestamp each outgoing packet, able compute round trip time 1 time replies have been received (and dumped)? otherwise, other tool should use? if sniff traffic @ same time tcpdump or wireshark, timestamp each packet on way out , replies. just warning though, tcpreplay doesn't back upwards replaying tcp streams servers since doesn't track state of tcp stream. you'll reset packets in reply. udp should ok. icmp works. if want more information, sure check out tcpreplay faq: http://tcpreplay.synfin.net/wiki/faq#doestcpreplaysupportsendingtraffictoaserver tcp udp timestamp ip packets

geolocation - distance between mobiles system -

geolocation - distance between mobiles system - i'm developing mobile , wanted implement feature show other mobile devices near you(changeable radius if it's possible) have same app using wifi or gps, whatever better. how do that(reference great guide/site great)? there sort of ready plugin or ^^? thanks. 1) app reads gps position of user id , send server , store recent one 2) app connect server , reads position of users, or users within aproximate distance current device position gps. fpr aproximate distance calculate distance between 2 lat/lon coordinates. ios , android have built in functions. otherwise easy self implement. mobile geolocation gps

oop - Object Oriented Design Suggestion required -

oop - Object Oriented Design Suggestion required - i need suggestion on ood. below situation. class a{ private b service_; private stopwatch timer_; private const int mintimetowait; public someoperation(){ timer_.start(); //call method on service_ async , subsribe event callback } private someoperationcallback() { timer_.stop(); int elapsedtime = timer_.elapsedtime(); if(elapsedtime < mintimetowait) thread.sleep(mintimetowait - elapsedtime) //continue after thread resumes } } i have class fires async operation, , after async operation returns need check if asycn operation returned in less mintimetowait, if yes wait mintimetowait completes , proceed other operations. now, doing right thing including logic check times , wait in someoperationcallback, or should create new class encapsulates logic , stopwatch , utilize class check , wait? thanks in advance replies. ...

java - Handling repeated values in template -

java - Handling repeated values in template - the documentation says can utilize @repeat lists defined in forms. http://www.playframework.com/documentation/2.1.0/javaformhelpers bottom of page. this might totally stupid question... can utilize similar map? right have helper class consist, string key , string value. works, have logic in template. in sentiment not good... edit: more info suppose have class article { ... map<string, string> resources; ...getters, setters... } i phone call view deal form return ok(form.render(form.form(article.class))); in form.scala.html @for((key, value) <-formart("resources")) { @key, @value } gives me error: value map not fellow member of play.data.form.field which makes finish sence, because not map anymore, formfield. there helper in scala deal list, have no thought how create helper deal map. (if seek similar, illustration utilize @repeat helper, gives me same error) ...

WPF Taskbar Restore/Minimize doesn't always work -

WPF Taskbar Restore/Minimize doesn't always work - so have big wpf application, , there icon on taskbar when application running. expect if click taskbar icon, application restore itself, or minimize if showing, standard windows functionality. however, have click several times work. i've done quite bit of research/programming, 1 simple item can not figure out. help appreciated, please allow me know if need provide more info. have tested using jumplist, users not want right click icon , click "restore". want left-click taskbar icon. .net 4.0, wpf 4. in advance everyone. check if there background processes running. wpf restore taskbar

Why does git not recognize "origin/master" as a valid object name? -

Why does git not recognize "origin/master" as a valid object name? - ~/www> git branch --track live origin/master fatal: not valid object name: 'origin/master'. ~/www> git remote origin ~/www> git branch * master test_branch working_branch i tried creating tracking branch with: git branch live git branch --set-upstream live origin/master but got same error $ git branch -r origin/1.x origin/1.x@60 origin/1.x@63 origin/head -> origin/master origin/master $ git branch --track live origin/blah fatal: not valid object name: 'origin/blah'. as has been suggested can track remote if has been added. perhaps add together remote this $ git remote add together upstream git://github.com/svnpenn/rtmpdump.git $ git fetch upstream example git

caching - Is it ok to simply cache every search using a CachingWrapperFilter? -

caching - Is it ok to simply cache every search using a CachingWrapperFilter? - using lucene.net 3.0.3 easy wrap every query created in response user's search in cachingwrapperfilter . bad thought because lucene consume more , more memory, or lucene manage memory , release cached items in intelligent way? should selective in queries wrap in cachingwrapperfilter? query query = .... querywrapperfilter queryfilter = new querywrapperfilter(query); cachingwrapperfilter cachingfilter = new cachingwrapperfilter(queryfilter); searcher.search(query, cachingfilter, 1); update the lucene.net implementation of cachingwrapperfilter uses mechanism tied garbage collection. implements weakdictionary class keyed using instances of weakreference class. built in .net class wraps object , provides way check if object has been garbage collected or not. suggests me reply question yes. memory management of lucene cache kept under command because tied runtime garbage collector , cache...

php - How to catch errors/warnings with FirePHP -

php - How to catch errors/warnings with FirePHP - i'm not sure how firephp grab errors , warnings , study them in firebug console. i've installed firephp , i'm pretty sure working—i see responses these in console: fb('log message', firephp::log); fb('info message', firephp::info); fb('warn message', firephp::warn); fb('error message', firephp::error); i see "log message," "info message", "warn message" , "error message." changed code intentionally break it--it gave me logs: [21-jan-2013 22:19:49] php warning: missing argument 3 echo_first_image(), called in /app/web/xxx/wp-content/themes/xxx/home.php on line 85 , defined in /app/web/xxx/wp-content/themes/xxx/functions.php on line 12 i'm trying grab , print in firephp not beingness detected, , i'm not sure why. total code block initializing firephp: <?php /* debug */ require_once("debug/firephp.class.php")...

php - Detecting field changes - cakePHP -

php - Detecting field changes - cakePHP - what want i want see fields on table changed , save name database under edit column. what have currently, not much. standard cakephp baked edit view , controller. have done previously, not cakephp. did retrieve record, , if it's different user entered, save name of column edited in edit column corresponding row. my question could tell me how compare user input on database? behaviors "logable" behavior , store info separately. advice same. "changes" not need set same table. if sense do, though, create own "modified" logable behavior creates "diff" , stores field of selection on same record. ps: might want take @ revisionbehavior. contains diff algorithm. there whodidit behavior stores user lastly modified record. in same table, though. combined above should trick. either way: use callbacks (beforesave/aftersave) on model or (cleaner) behavior calculate diff store dif...

javascript - Create a shape from the other -

javascript - Create a shape from the other - three days of trying create dynamic figure in other figures, not work. using three.extrudegeometry, turned: but "tail" should radius: none of parameters extrudegeometry not allow him do. draw in 3d editor , figure place not work because, size has dynamically changes how implement it? or how glue 2 planes, set of arcs , create whole figure? bevelsize : -4 result: code... javascript html5 canvas three.js

android - whether the permanent value returned by these methods? -

android - whether the permanent value returned by these methods? - activity.getpreferences(mode) , sharedpreferences.edit() can this? (at activity class): //... private sharedpreferences pref; private editor editor; oncreate() { pref = getpreferences(activity.mode_private); editor = pref.edit(); } ondestroy() { int somesavedint = pref.getint("someint", 0); editor.putint("someint", somesavedint * 2); } //... or before utilize should value of pref , editor ? you can create static variable of shared preference too. or can each time, both fine. just maintain in mind have editor.commit(); save/commit these values always. android

indentation - Python expected indent error -

indentation - Python expected indent error - here image of problem in idle says have expected indent error , can't figure out do. all docstrings should aligned 1 more step: should line code within methods, not method definitions. python indentation

bayeux - CometD Issues with Publishing Data -

bayeux - CometD Issues with Publishing Data - i'm new cometd , having problems publishing info on channel. i'm getting next error not invoking handshake() on channel: sender : null sender : l:/abc/1? exception in thread "thread-9" java.lang.illegalstateexception: method handshake() not invoked local session l:/abc/1? @ org.cometd.server.localsessionimpl.getid(localsessionimpl.java:161) @ org.cometd.server.serverchannelimpl.publish(serverchannelimpl.java:309) @ packagename.cometdsender.senddata(cometdsender.java:64) @ packagename.processorimp.processdata(processorimp.java:18) @ packagename.testsource.processnewdata(testsource.java:50) @ packagename.testsource.run(testsource.java:36) @ java.lang.thread.run(unknown source) but when include sender.handshake() next exception sender : null sender : l:/abc/1? exception in thread "thread-9" java.lang.nullpointerexception @ org.cometd.server.bayeuxserverimpl.freez...

java - multicast receive wrong message -

java - multicast receive wrong message - i'm working on multicastsocket. testing websphere 8.0.0.5 on aix 7. problem getting wrong message sender. testing scenario is: 1. run sendmulticast (new thread) 2. run receivemulticast (new thread) 3. run receivemulticast (new thread) the first receiver thread receives right message. secondary receiver thread receives wrong message. but interesting thing tried on same machine (aix 7) java 6 console application , every thing ok. here code: static final int port = 9999; static final string multicastaddress = "224.2.2.3"; public static void sendmulticast() { multicastsocket socket = null; datagrampacket outpacket = null; byte[] outbuf; long t= system.currenttimemillis(); //run 60 seconds long end = t+60000; seek { socket = new multicastsocket(); string msg; while(system.currenttimemillis() < end) { ...

c++ - How to delete same pointer in different std::vector's? -

c++ - How to delete same pointer in different std::vector's? - my game's main loop looks this: std::vector<std::unique_ptr<state>> states; for(size_t = 0; < states.size(); i++) { states[i]->update(); states[i]->draw(); } their flaw though. can't modify vector (delete state) during iteration because if deleted current state iteration on breaks because there no state phone call update , draw on. thought thought create vector of states should added states vector , create vector of states should deleted states vector. after loop on modify states vector , no problems occur mid iteration. std::vector<std::unique_ptr<state>> states; std::vector<std::unique_ptr<state>> statestobeadded; std::vector<std::unique_ptr<state>> statestoberemoved; for(size_t = 0; < states.size(); i++) { states[i]->update(); states[i]->draw(); } for(size_t = 0; < statestobeadded.size(); i++) { ...

java - Memory raise on dialog button click in javafx application -

java - Memory raise on dialog button click in javafx application - i attached next sample application of javafx, in there dialog class used dialog box. while click on button exist on dialog box - memory raised much. when dialog box shows - back upwards in taskmanager takes 57kb , click on button , on dispose dialog - taskmanager shows memory start increasing - , got crash, getting dump memory exception. there next classes in sample dialog.java : shows dialog box ok - cancel button messagedialog.fxml : fxml create the dialog messagedialogcontroller associate file messagedialog.fxml javafxsample.java main class runing sample. dialog.java package javafxsample; import java.io.ioexception; import java.io.inputstream; import javafx.fxml.fxmlloader; import javafx.fxml.initializable; import javafx.fxml.javafxbuilderfactory; import javafx.scene.scene; import javafx.scene.image.image; import javafx.scene.layout.anchorpane; import javafx.stage.modality; import javafx.stage.stag...

algorithm - c++ harmonic value from time increment -

algorithm - c++ harmonic value from time increment - i have counter in milliseconds increases during normal programme execution. wish mathematically convert counter harmonic value: float getharmonictime(int currenttime, int periodinmilliseconds) { // cool algorithm here } this function homecoming floating point value between -1 , 1 on course of study of given period so: -1...-0.5...0...0.5...1...0.5...0...-0.5...-1 how algorithmically efficiently in c/c++? thanks! the formula you're looking sin( 2 * m_pi * currenttime / period ) . c++ algorithm math

wysiwyg - django-tinymce removes bootstrap HTML code -

wysiwyg - django-tinymce removes bootstrap HTML code - i'm using/testing django-cms (2.3.5) + bootstrap based templates. using django-tinymce add together code: <a class="carousel-control right" href="#this-carousel-id" data-slide="next">›</a> but django-tinymce removes "data-slide="next"" <a class="carousel-control right" href="#this-carousel-id">›</a> and of course of study nil works. using wyeditor found no way modify options in settings.py. using tinymce can : tinymce_default_config={ # general options 'mode': "textareas", 'theme': "advanced", 'remove_linebreaks': "false", 'convert_urls': "false", 'relative_urls': "false", 'theme_advanced_resizing': "true", 'paste_auto_cleanup_on_paste': "t...

osx - Zoom (magnifying glass) effect in OS X -

osx - Zoom (magnifying glass) effect in OS X - i'm trying create magnifying glass app similar build in in os x (mountain lion). i'm wondering how can acheive effect, using frameworks? what think, custom cursor? image displayed in rectange zoomed portion of backgound-spapped screen? think kind of implementation can run sluggish, , hard alter cursor whole scheme not in "zooming" application. or maby utilize quartz functionality not known me :) i found 1 thing tha interesting apples implementation (build in os x), when come in in zoom-mode , screenshot using ctrl+cmd+4 , next space image captured that: with out content of screen border of zooming area. tells me kind of transparent window abowe screen not taking on focus. have got thought how ? osx cocoa quartz-graphics

html - JQUERY setInterval Function -

html - JQUERY setInterval Function - i have a membership counter needs update 1 digit @ time. below function function sitecounterupdate(newmembership) { var oldmembership = $('span#indexsitelastmembershipcount').text(); var digit; newmembership = padstring(newmembership, 9); $('ul#indexsitecounterbottom').empty(); for(i=0;i<9;i++) { if(newmembership.tostring()[i] == '_') {digit = '&nbsp;';}else{digit = newmembership.tostring()[i];} $('ul#indexsitecounterbottom').append('<li>'+digit+'</li>'); $('ul#indexsitecounterbottom li:nth-child(3n)').addclass('extra-margin'); } $('span#indexsitelastmembershipcount').text(newmembership); } it accepts new membership - 1010 members it gets old membership kept in span - 1000 members it pads string nbsp if less 9 digits (this relates counter images size) - not of import quetion , working fin...

ios - How to add "Copy" option to text? -

ios - How to add "Copy" option to text? - i have text in "bubble" fitting text within image shown below. works fine except text not copyable. need have "copy" alternative when user tab on text (or bubble image") "cop" options displayed, in when user tab built in sms message bubble. #import "speechbubbleview.h" static uifont* font = nil; static uiimage* lefthandimage = nil; static uiimage* righthandimage = nil; const cgfloat vertpadding = 4; // additional padding around edges const cgfloat horzpadding = 4; const cgfloat textleftmargin = 17; // insets text const cgfloat textrightmargin = 15; const cgfloat texttopmargin = 10; const cgfloat textbottommargin = 11; const cgfloat minbubblewidth = 50; // minimum width of bubble const cgfloat minbubbleheight = 40; // minimum height of bubble const cgfloat wrapwidth = 200; // maximum width of text in bubble @implementation speechbubbleview + (void)initialize...

ruby - Parse HTML modified by Javascript -

ruby - Parse HTML modified by Javascript - i want submit form in webpage, when submit form web add together using javascript new fields. parse new fields. using mechanize not interpret javascript, have tested capybara want in background are there alternative? you can much easier without evaluating javascript using capybara's autowaiting enabled in capybara's methods. methods like: find(locator) will wait automatically 2 seconds. can alter limit specifiing value default_wait_time, e.g.: capybara.default_wait_time = 5 ruby parsing html-parsing capybara mechanize

user interface - Choosing a cross-platform graphics library for perfect text rendering -

user interface - Choosing a cross-platform graphics library for perfect text rendering - i want write simple text editing application in c/c++ ( devoted source code editing ) these specifications: cross-platform ( windows, os x, linux ) with much possible same appearence on each os insanely fast a superior font printing quality * of import of * it's not of import widget support, don't need complex back upwards of widget precedence software code architecture , speed instead of speed coming back upwards of hardware acceleration before writing made study , search on net, need advice take better: gtk+ , wxwidgets: finish set of libraries finish task sdl: offers virtualization layer on platform, can write platform independend graphics using sdl primitives cairo ( or pango ): skia views ( utilize within chromium http://www.chromium.org/developers/design-documents/chromeviews) agg ( anti grain geometry: seems best text rendering library subpixel feature, speed ...

Remove and destroy object in a list -

Remove and destroy object in a list - extending little on this question. removing object python list easy enough, i'm going have "busy" list -- frequent removals , frequent additions -- want guard against memory leaks. will removing object list destroy object? (i'm assuming no.) if assumption correct, how can remove list and destroy @ same time? if matters, objects in question instances of class wrote. plan on creating objects "live" each time need insert new one, e.g. mylist.insert(index,myclass(constructorparm1,constructorparm2)) so when later need delete of instances created way, want sure they're not gone list, gone period. in cpython, objects automatically destroyed when reference count drops 0. if delete entry list, reference count object in question decremented. not need special have destroyed, nor should seek to. if other reference object still exists, destroying object break other reference. if want hold referenc...

java - Remote XA JMS Connection -

java - Remote XA JMS Connection - is possible provide , lookup connection factories transactional on jboss 7? standard "remoteconnectionfactory" doesn't seem transactional (xa) , don't know how create xa or how define sort of xaremoteconnectionfactory can utilize remote client. i tried adding <xa>true</xa> element (which works in hornetq configuration illegal in jboss config file) , tried create <pooled-connection-factory> "java:/jmsxa" (but wasn't able in context right name exporting). java jboss jms xa

widget - Attaching a "Free Download" button to the SoundCloud player within the SoundCloud website -

widget - Attaching a "Free Download" button to the SoundCloud player within the SoundCloud website - this problem has eluded me on month now. i've noticed soundcloud(sc) members able attach button says "free download" (or variation of that) onto sc player within sc site. i've seen can customize sc widget embedding elsewhere, i'm stumped on how edit on sc. ideas or help in figuring out appreciated. when have soundcloud premium business relationship http://soundcloud.com/premium able rename 'buy link' title. can done on 'edit' page of track or set. widget soundcloud

javascript - Jquery Tools Scrollable onBeforeSeek function and then slide to next -

javascript - Jquery Tools Scrollable onBeforeSeek function and then slide to next - i'm trying implement , customize little behavior of jquery tools scrollable plugin. want calling function just before sliding next item, waiting function complete , slide next item. i tried out onbeforeseek function api, unfortunately calls desired function (like f.ex. settimeout) , doesn't wait finish, slides next item. has thought how can prevent sliding next item until function completed? doesn't have occur absolutely trough onbeforeseek, seemed me ok, because summarizes result of several events trigger prev/next. markup: <section> <div> <dl> <dt>titre 1</dt> <dd><img src="http://placehold.it/350x150"></dd> </dl> <dl> <dt>titre 2</dt> <dd><img src="http://placehold.it/350x150"></dd> ...

c++ - Printing unicode character in C -

c++ - Printing unicode character in C - i got local language font installed in scheme (windows 8 os). through character map tool in windows, got know unicode characters particular font. wanted print character in command line through c program. for example: assume greek letter alpha represented unicode u+0074. taking "u+0074" input, c programme output alpha character can help me? there several issues. if you're running in console window, i'd convert code utf-8, , set code page window 65001. alternatively, can utilize wchar_t (which utf-16 on windows), output via std::wostream , set code page 1200. (according the documentation i've found, @ least. i've no experience this, because code has had portable, , on other platforms i've worked on, wchar_t has been either private 32 bit encoding, or utf-32.) c++ c winapi unicode

Multitouch in Android on image -

Multitouch in Android on image - i've image button in android , there 6 image buttons , want have mulitouch on 6 buttons any suggestion how in android? can u give me link bcoz i'm new android. use view.ontouchlistener hear touch events , actions according button touched. android image button

c++ - Accessing a data member of a pointer -

c++ - Accessing a data member of a pointer - class cat { public: int name; cat(); int getname(); } if have a: cat* pointer = new cat(); pointer->getname(); pointer->name; //this doesn't work so how can access info member: name? it works fine: http://ideone.com/3e5uec #include <iostream> using std::cout; using std::endl; class cat { public: int name; cat() : name(0) { } int getname() { homecoming name; } }; int main() { cat* pointer = new cat(); pointer->name = 42; cout << "getname: " << pointer->getname() << endl; cout << "name: " << pointer->name << endl; delete pointer; } note had create additions code provided, did not compile gave it: i added missing #include directives i added definitions cat::cat() , cat::getname() i added missing ; after class definition i wrapped code in main(), , output result of pointer->name...

jpa - stateless annotation cannot be found -

jpa - stateless annotation cannot be found - i'm having little problem using jpa (hibernate) import javax.persistence.column; import javax.persistence.entity; import javax.persistence.generatedvalue; import javax.persistence.generationtype; import javax.persistence.id; import javax.validation.constraints.notnull; /** * bean decribing user. * */ @entity public class user implements serializable { ... i'm able utilize of annotation (like @entity), shown in illustration above. but @stateless cannot found eclipse. why ? i'm using latest version hibernate (4.1.9) created user library containing required library hibernate directory. upgraded dynamic web project jpa project facet. i solved problem using tomee web server, contains ejb implementation jpa java-ee-6

c# - How to show only certain columns in a DataGridView with custom objects -

c# - How to show only certain columns in a DataGridView with custom objects - i have datagridview , need add together custom objects it. consider next code: datagridview grid = new datagridview(); grid.datasource = objects; with code datagridview object properties columns. in case, don't want show of information; want show 2 or 3 columns. know can set autogeneratecolumns = false . but not know how proceed afterwards. 1 alternative hide columns not involvement me, think improve in opposite way. how can this? whenever create grid.datasource result of linq projection on objects. so this: grid.datasource = objects.select(o => new { column1 = o.somevalue, column2 = o.someothervalue }).tolist(); the nice thing can set autogeneratecolumns true, generate columns based on properties of projected objects. edit: the 1 downside approach projecting anonymous object, can have problems in situations need access specific object in click event, exam...

osx - How do I get the full path for a process on OS X? -

osx - How do I get the full path for a process on OS X? - i know can pid process using ps , how find total path of process? os x has libproc library, can used gather different process informations. in order find absolute path given pid, next code can used: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <libproc.h> int main (int argc, char* argv[]) { pid_t pid; int ret; char pathbuf[proc_pidpathinfo_maxsize]; if ( argc > 1 ) { pid = (pid_t) atoi(argv[1]); ret = proc_pidpath (pid, pathbuf, sizeof(pathbuf)); if ( ret <= 0 ) { fprintf(stderr, "pid %d: proc_pidpath ();\n", pid); fprintf(stderr, " %s\n", strerror(errno)); } else { printf("proc %d: %s\n", pid, pathbuf); } } homecoming 0; } example compile , run (above code stored in pathfind.c, 32291 pid of p...

magento cleaning my category to 2000 products -

magento cleaning my category to 2000 products - after updating category or subcategory products disappearing it. unusual because 2000 products left. cache, indexing not helping. if create more sense category disappearing product. open logs, php error max_input_vars. magento category products

java - wrong junit test names -

java - wrong junit test names - i seek write own junit runner , stuck @ returning proper test description. public class parameterizedwrapper extends suite { private list<runner> frunners; /** * @throws throwable * */ public parameterizedwrapper(final class<?> clazz) throws throwable { super(clazz, collections.<runner>emptylist()); frunners = constructrunners(getparametersmethod()); } protected list<runner> constructrunners(final frameworkmethod method) throws exception, throwable { @suppresswarnings("unchecked") iterable<object[]> parameters = (iterable<object[]>) getparametersmethod().invokeexplosively(null); arraylist<runner> runners = new arraylist<runner>(); int index = 0; (object[] parameter : parameters) { class<?> testclass = gettestclass().getjavaclass(); wrappedrunner wrappedrunner = test...

set qt c++ mainwindow always on bottom mac osx -

set qt c++ mainwindow always on bottom mac osx - so trying set window/ mainwindow / application in qt on bottom (like bottom window) (so rainmeter somehow widgets), can't mac osx such things. i've tried whole this->setwindowflags(qt::windowstaysonbottomhint); but without luck. hints? illustration code amazing. got bad news , news. bad news it's not implemented. the news is: qt open source, can crack open , take know that. , if there's bug can submit fix. here's deal, in generic code qwidget::setwindowflags in qwidget.cpp:9144 have this: void qwidget::setwindowflags(qt::windowflags flags) { if (data->window_flags == flags) return; q_d(qwidget); if ((data->window_flags | flags) & qt::window) { // old type window and/or new type window qpoint oldpos = pos(); bool visible = isvisible(); setparent(parentwidget(), flags); // if both types windows or neither of them are, r...

javascript - JQuery Tablesorter Add Column with Filters -

javascript - JQuery Tablesorter Add Column with Filters - i using jquery tablesorter 2.7.* javascript table have. using tablesorter filter widget, in order have several of columns have drop-down filtering options. have new challenge: required add together columns table dynamically. have seen question: adding columns dynamically table managed jquery's tablesorter - recommends remove , recreate table each addition/removal of column. fair enough, causes conflict filter widget. in order apply filter functions, javascript references column index only, so: widgetoptions: { filter_reset: '.reset', filter_functions: { 2: true, 3: true, } } this code cause columns index 2 , 3 have default select filter. problem occurs when new columns added dynamically - index values of these columns change. this brings question; there way apply widget options columns named name? if not, there soluti...

Powershell: moving items not working when filenames that have chars [ ] -

Powershell: moving items not working when filenames that have chars [ ] - quick question moving items powershell: know why next script not work when filename has [ or ] chars on it? (ex.: file1[vt].txt) ls j:\ | foreach { $itemname = $_.name.replace('.', ' ') $destination = ls | { $itemname -match $_.name } | select -first 1 if ($destination -ne $null) { mi $_.pspath $destination.pspath -verbose -whatif } } for instance, move file if it's called file1.txt ignore files named file1[vt].txt. i'm under assumption it's not finding path file when has chars [ or ] on name. ideas? just using -literalpath parameter move-item ls j:\ | foreach { $itemname = $_.name.replace('.', ' ') $destination = ls | { $itemname -match $_.name } | select -first 1 if( $destination -ne $null){ mi -literalpath $_.pspath $destination.pspath -verbose -whatif } } powershell filenames

cron - PHP auto execution -

cron - PHP auto execution - i trying execute php script @ predefined time. instance, how can write php script forcefulness script run on march 24th, 2013 @ 11:14am(even if browser closed). heard cron not clear me. thank reading indeed cron reply question. special programme in linux systems , runs defined programs/commands on given time or periodically. here: http://unixhelp.ed.ac.uk/cgi/man-cgi?crontab+5 php cron

ruby on rails - Hash to_json: how can I skip the key and list only the values in the JSON response? -

ruby on rails - Hash to_json: how can I skip the key and list only the values in the JSON response? - the result of activerecord query array of hashes. if convert json output, keys of hash (the db column names) repeated in json result every row. e.g. dailystats.all.to_json gives back: [ {\"statisticsdate\":1360454400000,\"storagetoptempavg\":48.6}, {\"statisticsdate\":1360540800000,\"storagetoptempavg\":49.0}, {\"statisticsdate\":1360627200000,\"storagetoptempavg\":48.4} ] however omit column names repeated , this: [ {1360454400000:48.6}, {1360540800000:49.0}, {1360627200000:48.4} ] is there simple way or should build info converter? you should able map info before convert json: dailystats.all.map {|item| {item[:statisticsdate] => item[:storagetoptempavg]}}.to_json ruby-on-rails ruby json rails-activerecord

java - Using regex to remove JSON quotes -

java - Using regex to remove JSON quotes - i beingness given json external process can't change, , need modify json string downstream java process work. json string looks like: {"widgets":"blah","is_dog":"1"} but needs like: {"widgets":blah,"is_dog":"1"} i have remove quotes around blah . in reality, blah huge json object, , i've simplified sake of question. figured i'd attack problem doing 2 string#replace calls, 1 before blah , , 1 after it: datastring = datastring.replaceall("{\"widgets\":\"", "{\"widgets\":"); datastring = datastring.replaceall("\",\"is_dog\":\"1\"}", ",\"is_dog\":\"1\"}"); when run vague runtime error: illegal repetition can regex maestros spot i'm going awrye? in advance. i believe need escape braces. braces used repetition ( (foo...

How to reuse sockets in .net using beginaccept -

How to reuse sockets in .net using beginaccept - i experimenting socket re-use on asynchronous http server writing, although code recycles .net part of socket fine, netstat shows new socket handles opened when recycled .net socket passed through beginaccept , hence server crashes under load. of import think doesn't happen under low load guess has latency of begindisconnect ?? running on mono 2.10 on ubuntu 10.04 insight grateful received. have researched quite thoroughly on google no avail. using system; using system.io; using system.net; using system.net.sockets; using system.text; using system.collections.generic; using system.threading.tasks; using system.threading; public class server{ public static queue<socket> sockets=new queue<socket>(); public static manualresetevent alldone = new manualresetevent(false); public static void main (string [] args) { int port=81; var listensocket = new socket (addressfamily.internetwork, sockettype.strea...

c++ - negation of std::integral_constant -

c++ - negation of std::integral_constant<bool> - sorry asking simple question, cannot find reply easily. google says nil interesting "c++ negation integral_constant" , similar queries. is there in c++11 trait create std::true_type std::false_type , vice versa? in other words, i'd more readeble version of std::is_same<my_static_bool, std::false_type> i know of course of study can write myself, i'd utilize existing 1 if there such. there not, because it's one-liner , <type_traits> should little possible. template <typename t> using static_not = std::integral_constant<bool, !t::value>; usage: static_not<my_static_bool> this right way because standard says " false_type or derived such", can't depend on beingness equal std::false_type . relax "having constexpr boolean ::value property" because don't utilize tag dispatching. c++ c++11 template-meta-program...

asp.net - MSDeploy to multiple servers -

asp.net - MSDeploy to multiple servers - i looking way deploy multiple different environments. ie, dev, uat, prod1, , prod2 servers i under impression msdeploy work this. have deploys using command "c:\program files\iis\microsoft web deploy\msdeploy.exe" -verb:sync -source:contentpath="d:\sourcepath" -dest:contentpath="d:\destpath", computername=prodserver1 "c:\program files\iis\microsoft web deploy\msdeploy.exe" -verb:sync -source:contentpath="d:\sourcepath" -dest:contentpath="d:\destpath", computername=prodserver2 this work, in application i'm developing needs deploying has database connection involved, needs changed per environment. <connectionstrings> <add name="devserver" connectionstring="data source=devserver\sqlinstance;initial catalog=dbname;user id=sqluser;password=sqlpassword" providername="system.data.sqlclient" /> </connectionstrings> ...

asp.net - Need help understanding ASP .Net MVC user authentication/authorization -

asp.net - Need help understanding ASP .Net MVC user authentication/authorization - i have been going around in circles trying understand this. i have asp .net mvc project working on , need implement user logins authorize , authenticate against en external scheme (via webservice). i can't seem head around membershipprovider , authorizeattribute in context require. which need utilize (i believe both) , need customize provide authentication against external system. there 1 additional thing require on top of default asp .net user principals in external webservice homecoming session id upon successful login used subsequent requests external services. would able point me in direction of useful illustration of sort of set up? membershipprovider used provide users may login system. roleprovider used tell roles user has. used during authentication process. i.e. identifying user. can read membership vs roles the [authorize] attribute on other hand used during a...

.htpasswd - .htaccess: Different AuthUserFile paths for different hosts -

.htpasswd - .htaccess: Different AuthUserFile paths for different hosts - i developing application has run both locally on remote server. 1 directory protected using htpasswd file. how have define path htpasswd file in htaccess file: authuserfile ../app/some-folder/.htpasswd unfortunately app folder required on server, don't have locally. instead, path has this: authuserfile /volumes/some/very/long/path/some-folder/.htpasswd is possible en if/else statement switch authuserfile path according current host (edit: or improve yet, don't require authentication locally)? or there workaround create file work on both local , remote host? never mind, figured out. set in .htaccess : authname "protected" authtype basic authuserfile path/to/.htpasswd require valid-user order deny,allow deny allow 127.0.0.1 satisfy this allows connections made local ip go through without entering password. not perfect, works in situation. .htaccess .htpas...

ubuntu - Capture currently running programs as start-up programs -

ubuntu - Capture currently running programs as start-up programs - i remember in previous versions of ubuntu there used feature capture running programs, , automatically set them start-up programs. in 12.04 can't find feature anymore. still available? there way manually add together start-up programs, utilize automatic feature used available in other versions. if you're using verion 11.04 or previous can going scheme menu -> preferences -> startup applications -> options tab, , here can check "remember running applications". but if you're using newer version (11.10 or newer) alternative not exist anymore, , no plans implement in near future due numerous side effects. so because you're using 12.04 think that's not possible. i'm not sure kde. also if still want manually add together application startup check here - ubuntu 12.10 ubuntu ubuntu-12.04

javascript - Accessing object properties from object itself -

javascript - Accessing object properties from object itself - i'm having little problem learning object-oriented javascript. have 2 classes called cosmos , background , cosmos looks this: // js/cosmos.js function cosmos() { this.background = new background(); // fire game loop this.ticker = setinterval(this.tick, 1000 / 60); } // main game loop cosmos.prototype.tick = function() { console.log(this.background); } when main game loop ticks, undefined in console. don't quite understand because this.background property of cosmos class, should accessible methods defined in cosmos class, no? if go index.html page's script tag , alter this: // lift off var cosmos = new cosmos(); console.log(cosmos.background); it works , background object gets logged console. can offer explanation , tell me how can access properties of cosmos within cosmos.tick ? edit: turns out problem setinterval() , because if proper object logged console: fu...

javascript - How to get entries between a price x and y? -

javascript - How to get entries between a price x and y? - im using current jquery ui slider range: http://jqueryui.com/slider/#range and underscore.js http://underscorejs.org/ so ive minimum , max send, after user stopped slide function: currentslide:function(){ $('#slider').slider({ range: true, min: min, max: max, values: [ vmin, vmax ], stop:$.proxy(this.afterslide,this) }); }, afterslide:function(event, ui) { console.log(ui.values[0]); }, in afterslide function min/max correctly, dont know how utilize underscore.js entries have cost starting min , end max. examplearray: var sample = { "response": { "things": [{ "index": 0, "price": "10" },{ "index": 1, "price": "15" },{ "index": 2, "price": "60...

carousel - Sencha touch couresel items float one above the other -

carousel - Sencha touch couresel items float one above the other - my carousel rendering weird, doesnt load items horizontally loads them 1 above other. looks this: http://postimage.org/image/3tisqjl9n/ is because create carousel within of formpanel ? here can see code: config: { title: 'more info', layout: 'fit', items: [ { xtype: 'formpanel', id:"moreinfo", items: [ { id: 'morecontent', tpl: [ '<div style="border-bottom 1px solid black">', '<h2 style="margin-bottom:5px;text-transform:capitalize;font-weight:bold">project: {project}</h2>', '</div>' ].join(''), }, { xtype: 'carousel', ...

tomcat - Java method stops being called -

tomcat - Java method stops being called - i have tomcat server running big application. has 2 classes similar example: public abstract class classa { private static final logger logger = logger.getlogger(classa.class); // ... public file methoda(icancellable cancel) { url request = new url("an url"); logger.debug("calling classb.methodb(type)"); file f = classb.methodb(request, "type", cancel); logger.debug("the phone call classb.methodb(type)" + " returned file==" + f); // ... } } public class classb { private static final logger logger = logger.getlogger(classb.class); // ... public static synchronized file methodb(url url, string type, icancellable cancel) { final string thismethodsname = "classb.methodb(url: " + url + ", type:" + type + ", cancel: " + cancel + ...