Posts

Showing posts from January, 2013

Can Lighttpd set "connection.kbytes-per-second" depends on the hour of the day? Such as peak and offpeak -

is possible set "connection.kbytes-per-second" depends on hour of day in lighttpd? such between 7pm-11pm limit 250kb/s, 1am-5am limit 500kb/s etc? thanks! sorry delay, answer - lua script: -- if don't find our "supersecretstring" in request uri, if string.find(lighty.env["request.uri"], "supersecretstring") == nil local hour = os.date("%h") -- account whether or not there query variables if string.find(lighty.env["request.uri"], "?") == nil lighty.env["request.uri"] = lighty.env["request.uri"] .. "?supersecretstring=" .. hour else lighty.env["request.uri"] = lighty.env["request.uri"] .. "&supersecretstring=" .. hour end -- restart request, script run again, return nil. return lighty.restart_request end -- continue request, above if have ran. return nil and configuration file: server

c# - What is the usage of XsltArgumentList.AddParam's namespaceUri argument? -

xsltargumentlist.addparam demonstrated this: xslarg = new xsltargumentlist(); xslarg.addparam("param-name", string.empty, "param-value"); does have example of xsl relevant specify other empty string namespaceuri (the second argument)? the namespaceuri argument described in documentation: "the namespace uri associate parameter. use default namespace, specify empty string." that parameter namespacing own parameters. example, might define xslt this: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns="urn:my-output-namespace" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:input="urn:my-input-variables" version="1.0" > <xsl:param name="input:myvariable" /> ... </xsl:stylesheet> in code, in order pass parameter myvariable , have add namespace uri xsltargumentlist.addpara

wordpress - Loop through array of objects (PHP) -

i have been trying loop through array cannot retrieve post title. little missing can't right. array ( [0] => wp_post object ( [id] => 5366 [post_author] => 1 [post_date] => 2013-07-09 12:06:00 [post_date_gmt] => 2013-07-09 12:06:00 [post_content] => [post_title] => mini face lift [post_excerpt] => [post_status] => publish [comment_status] => open [ping_status] => open [post_password] => [post_name] => mini-face-lift [to_ping] => [pinged] => [post_modified] => 2013-07-09 12:06:00 [post_modified_gmt] => 2013-07-09 12:06:00 [post_content_filtered] => [post_parent] => 17 ) ) if want post title -- how do it? i'd appreciate stuck. huge in advance! it's not multi-dimensional array, array of objects . . . try like: $varname[0]->post_title al

java - when converting an integer value to string the string comparison fails, and returns false boolean value -

public class run { public static void main(string args[]) { boolean b; int i=3; b=integer.tostring(i)=="3"; system.out.println(b); } } according code should return true,but outputting false. youre using == when should use: b=integer.tostring(i).equals("3"); i don't know why use x . i'm assuming typo. basically == compares reference used literal's being compiled in reference new string object created integer that, due implementation details, may or may not have been interned .

Rails specify controller action -

i have folder views/home contains initial screen rails app. for users, home.index.html.erb displays partial containing list of workorkorders. in other words i'm fetching list of workorder , list of worequests home/index.html.erb - therefore, i've added code read @workorders , @worequests home controller. this code fetches workorders: <% @workorders.notcompl.each |workorder| %> the home controller contains code fetch workorders: def index @workorders = workorder.all i'd have _agentopenrequests.html.erb fetch of worequests. so, added following fetch wore quests: def index2 @worequests = worequest.all but, in partial thats executed home/index.html.erb file, how following line use index2 instead of index ? <% @worequests.notcompl.each |worequest| %> should put both @worequests , @workorders index ? update1 i tried changing home controller this: def index @workorders = workorder.all respond_to |format| format.htm

Passing global Javascript variables through callback functions to other JS files -

so have interesting problem. declare global variable before referencing other javascript files, variable not seem carry through. maybe missing step somewhere? the variable string contents of uploaded file so: function gettext(s){ //creates global variable can hold file window.text = s; console.log(window.text); }; function handlefileselect(event) { var files = event.target.files; // file uploaded var reader = new filereader(); reader.onloadend = function(event){ gettext(event.target.result); //pulling out content of file loadscript('total.js',function(){ //starts app code window.text }); }; reader.readastext(files[0],"utf-8");//required read text }; try{ document.getelementbyid('files').addeventlistener('change', handlefileselect, false); //listens uploaded file } catch(e){

Linux signal masks - what do they mean though? -

how can store 32 signals inside 16 bit mask? sigpnd: 0000000000000000 shdpnd: 0000000000004000 sigblk: 0000010000017003 sigign: 0000000000381000 how interpret sigign example? read proc documentation don't how interpret actual bits mean. not sure got "32 signals inside 16 bit mask" information wrong far know. assuming each line hex each line 8 bytes or 64 bits. lower 4 bytes (32 bits) standard signals. upper 32 bits posix realtime signals. (it's little more convoluted - see man (7) signal , sigrtmax , sigrtmin low down.) so in sigign mask asked off couple of things in lower 3 bytes: 38 10 00. in lowest order byte, 00, no signals ignored. in next byte, hex 10 converts 00010000 in binary. 5th bit in byte on. likewise hex 38 converts binary 00111000. putting 3 bytes string of binary get: 001110000001000000000000 so counting right can see bits 13 20 21 22 on , therefore ignored. if go man (7) signal can see table signal values. values br

mysql - Return random row in Laravel 4 -

i have testimonial table display on main page on laravel 4 project. usual run query random row: select * `testimonials` `id`=".mt_rand(1,3); but error when trying run it: sqlstate[42000]: syntax error or access violation: 1064 have error in sql syntax; check manual corresponds mysql server version right syntax use near '".mt_rand(1,3)' @ line 1 (sql: select * `testimonials` `id`=".mt_rand(1,3);) (bindings: array ( 0 => 1, )) here controller: public function showhome() { db::select('select * `testimonials` `id`=".mt_rand(1,3);', array(1)); return view::make('home.index', array('pagetitle' => 'home')); } another side question how display information in home.blade.php template? i usual while loop , $row['assoc_array'] $testimonial = db::table('testimonials')->where('id', mt_rand(1, 3))->first(); return view::make('home.index', array(&#

How to convert between floats and decimal twos complement numbers in Python? -

i want convert decimal float numbers in python twos complement decimal binary numbers. example 1.5 in twos complement decimal 2.6 (8 bits) 0b011000. is there module can me? what you're describing has nothing @ decimal. want convert float fixed-point binary representation. this, multiply float scale factor, cast integer, , use python's built-in string formatting tools string representation: def float_to_binary(float_): # turns provided floating-point number fixed-point # binary representation 2 bits integer component , # 6 bits fractional component. temp = float_ * 2**6 # scale number up. temp = int(temp) # turn integer. # if want -1 display 0b11000000, include part: # if temp < 0: # temp += 2**8 # 0 means "pad number zeros". # 8 means pad width of 8 characters. # b means use binary. return '{:08b}'.format(temp)

git - How did I cross the streams, and how can I uncross them? -

Image
i've been using git happily better part of year, , our team using git-flow model (although not git-flow itself). last week created release branch , have been happily merging changes development/unstable branch - until strange happened today. somehow, release branch got hyper-merged , or something. can't think of better way describe "crossing streams". here's visual git extensions: i'm obfuscating of commit comments, sorry. starting bottom, can see development branch on left , release branch on right being periodically merged it. until halfway through, when must have done wrong merge, because @ point release branch literally merged development branch - appear share merge commit should have been on development branch. github presents clearer view: this doesn't unusual, except fact blue , black lines supposed same branch. tick off obvious: there commits other contributors, specific commits in question me. know can trust commit messages

Techniques for drawing objects in OpenGL -

techniques drawing large numbers of objects in opengl i wondering techniques or methods use draw many objects on opengl. for example, may have class represents brick, , maybe represents tree, or else random draw lamppost. say, have many bricks draw, or lampposts or that... calling draw method each 1 lead long code. at moment using glut callback function draw "stuff" in world, brick or tree. using globally accessible vector of base pointers one idea had have classes inherit base class, , put base pointers vector - have vector global. way like: for(int = 0; < vector_of_objects.size(); ++) vector_of_objects[i]->draw(); each object have draw function, draws opengl primitives. an example of such class this. (this have been experimenting with.) class box { public: void draw() { // drawing of box } // other members etc } alternatives? this doesn't seem idea, since creating new class house, require user remember add draw functio

GWT - EventBus calling event for object that no longer exists -

i ran problem in large program, wrote small sample test it. i'm hoping can explain me. here's code: eventbus bus = new simpleeventbus(); class testclass { testclass() { bus.addhandler(testevent.type, new testhandler() { @override public void onevent(testevent event) { system.out.println("test"); } }); } } class testevent extends gwtevent<testhandler> { public static final gwtevent.type<testhandler> type = new gwtevent.type<testhandler>(); @override public type<testhandler> getassociatedtype() { return type; } @override protected void dispatch(testhandler handler) { handler.onevent(this); } } interface testhandler extends eventhandler { void onevent(testevent event); } after following: testclass c1 = new testclass(); c1 = new testclass(); bus.fireevent(new testevent()); now logic, output should single &

javascript - Placing a div within body tag -

currently have page setup as: <body id="some-id"> <div class="some-class"> </div> <!-- some-class --> </body> i've tried using append , before, however, it's not quite doing want do. i'm trying add div id inserted-div this: <body id="some-id"> <div id="inserted-div"> <div class="some-class"> </div> <!-- some-class --> </div> <!-- inserted div --> </body> each time use something, example: $('body').appendto("<div id='inserted-div'>"); either won't insert or insert </div> after inserted < div> rather placing </div> before closing body. tried prepend , prependto no luck. you looking wrap method. $('.some-class').wrap('<div id="inserted-div"></div') $('body').prepend -- add div first child of body.

python - Python3: Conditional extraction of keys from a dictionary with comprehension -

i need extract keys of dictionary values pass condition. basically, want this, in shorter, more pythony way: keys=[] key in dict: if dict[key]==true: keys.append(key) this original idea, raises valueerror: [key (key,val) in map if val==true] i came moment, can't feeling it's not nice: [key key in map.keys() if map[key]==true] is there less messy way it? perhaps obvious i'm missing? thanks! here way keys true values lot shorter , cleaner comprehension (not comprehensions bad though): >>> dct = {0:false, 1:true, 2:false, 3:true} >>> list(filter(dct.get, dct)) [1, 3] >>>

code signing - Building Blackberry 10 App bar file -

i found no place on internet listed steps build blackberry app (webworks) working bar file , how install device. install blackberrygraphicalaid direct link 1st time sign application ask keys , remember pin here: https://www.blackberry.com/signedkeys/codesigning.html after receiving keys email blackberry, open blackberry graphical aid app go "configuration" tab set sdk path (skip android if don't need it) create certificate (it's author.p12) will ask keys, , pin (received via bb email) , new password set certificate with, set them , ready signed application before , need resign again (using diff pc) you have find following files used releasing last released version author.p12 barsigner.csk barsigner.db make sure these files there in c:\users\youusername\appdata\local\research in motion if released app world version using these keys have keep safe because if used other keys create new app not new version if released world version

mouseevent - Click event in an inactive window -

so lets have created 2 windows via ti.ui.createwindow() method,and have close window button on both windows. first window current window. i click second window's close button , instead of closing second window, takes focus. have click second window's close button again once active close window. is there way of being able click button if window not have focus or somehow pass click event through not takes focus inherits click event button? thanks.

c# - Saving each user's file along with corresponding database / table -

context : writing application in visual c# / .net, user can: create new document-file "untitled.abc" add data/content, e.g., images, text, etc. save document-file "mydoc7.abc", abc app-specific extension. question : following method implement above, or there simpler/cleaner approach? i start sql-server database called mydb. each time user creates new document-file, programatically add new db table mydb the newly created db table stores data/content particular corresponding document-file created user. when user re-opens saved document-file in future, programatically read data/content attached corresponding db table. update : solved. using alternative approach: i start sql-server database called mydb table called mytable, including column called fileid. each time user creates new document-file, assign file unique id, e.g., fileid = 5. when user adds piece of data/content file, store piece of data mytable, store fileid = 5 piece of data. in f

d3.js - nvd3 chart error when display:none -

i using nvd3 charting in application. have problem in if div hidden via display:none before charts rendered, charts throw error, , upon "un-hiding" div, have click on charts them render correctly. there way pre-render charts if div hidden? have tried setting width , height of parent svg before calling chart, no avail. nv.addgraph(function () { //chart setup code d3.select("#chart svg").attr("width", 300).attr("height", 500); d3.select("#chart svg").datum(data).transition().duration(500).call(chart); nv.utils.windowresize(chart.update); return chart; }); i figured out how make hidden chart render without needing statically define dimensions of chart area: nvd3 charts not rendering correctly in hidden tab this solution depends on using js display hidden content , @ same time trigger resize event forces nvd3 resize visible chart fill parent. in case didn't care seo used display:none; visibility

scala - Why is it possible to write HTML inside Scalatra? -

take following example : package com.example.app import org.scalatra._ import scalate.scalatesupport class myservlet extends scalatraservlet scalatesupport { get("/") { <html> <body> <h1>hello, world!</h1> <a href="hello-scalate">hello scalate</a>. </body> </html> } } is dsl? wondering mechanism of how work. scala natively supports xml syntax and, extension, xhtml. no dsl, language feature.

joomla2.5 - Joomla 2.5 pagination settings from administrator -

i beginner joomla, using version 2.5. have came across problem pagination. in site pagination on pages working well, suddenly, don't see pagination page. don't realized, setting admin panel have changed. have checked settings article manger->options->shared options, ok. there other settings in admin panel show pagination? any appreciated. thanks. you must seach in article manger->options->"first tab" but can placed in main menu item: menu->mainmenu->"first item" general settings...

Creating directories in remote PC using Java -

i need create directory in pc using java, used file class, code structure is string path = "\\\\192.148.64.99"+file.separator+"d:"+file.separator+"hello"; string fname= path+file.separator+"sample.pdf"; file file = new file(fname); system.out.println("exists"+file.exists()); file.getparentfile().mkdirs(); this throwing error. d: in path constructing not valid. use d$ instead if admin on remote machine. path should \\machinename\sharename\folder\subfolder...

sql - Updating tables in Sage -

i'm getting error doing simple update function. begin transaction update dbo.slcustomeraccount set syscreditbureauid = 'the id number' (customeraccountnumber 'a%') rollback transaction this works fine when stating 1 account add comes message stating string or binary data truncated procedure.

c# - Linq lambda entities , does not contain definition -

i have query code here : //get records based on activityid , taskid. public ilist<model.questionhint> getrecords1(int listtask, int listactivity) { ilist<model.questionhint> lstrecords = context.questionhints.tolist(); return lstrecords.groupby(x => new { x.questionno, x.activityid, x.taskid }).where(a => a.taskid == listtask && a.activityid == listactivity).tolist(); } the error lies in .where statement, says not contain definition activityid , taskid . full error : 'system.linq.igrouping' not contain definition 'activityid' , no extension method 'activityid' accepting first argument of type 'system.linq.igrouping' found (are missing using directive or assembly reference?) i weak in query statements, want retrieve records database activity id = , task id = , group them questionno, activityid , task id . the simplest fix here is: filter (where) before group; reduce work grouping has do: r

java - JSON data store in POSTGRES (EclipseLink) -

i deisgn database , model below eclipselink , postgres. what best approach same? how ro store json data in postgres , retrieve? my data model below. names surnames id name id json 1 test 100 {test:temp, test2:dfdf, test3:fsdf} mapping namesid surnamesid place country 1 100 san jose ca you can store json in character column (varchar, text). if want use json type may need use converter convert between , field type. if want convert json data objects, can use jaxb eclipselink moxy this. http://wiki.eclipse.org/eclipselink/examples/moxy#moxy.27s_json-binding you write own converter this, or in eclipselink 2.6 dev stream there new json convert option. see, http://wiki.eclipse.org/eclipselink/designdocs/406993

elasticsearch - Why script in custom_filters_score behaves as boost? -

{ "query": { "custom_filters_score": { "query": { "term": { "name": "user1234" } }, "filters": [ { "filter": { "term": { "subject": "math" } }, "script": "_score + doc['subject_score'].value" } ] } } } if script having above gives error: unresolvable property or identifier: _score if script "script": "doc['subject_score'].value" multiplies _score in similar way boost does. want replace elasticsearch _score custom score. if understood correctly use elasticsearch scoring if subject not math , use custom scoring subject math. if using elasticsearch v0.90.4 or higher, can achieved using new function_score query: { "query": { "function_sc

android - Gradle: Execution failed for task ':processDebugManifest' -

i'm getting gradle error @ building since yesterday - came randomly.... full stacktrace here: my project depends on multiple libraries , built without problems until yesterday (even librarys) compile 'com.google.android.gms:play-services:3.1.36' compile 'com.android.support:support-v4:13.0.0' compile project(":libs:databasecreationhelper") compile project(":libs:actionbarsherlock") anyone has idea how fix it? randomly came... full stacktrace here: * exception is: org.gradle.api.tasks.taskexecutionexception: execution failed task ':itchyfeet:processdebugmanifest'. @ org.gradle.api.internal.tasks.execution.executeactionstaskexecuter.executeactions(executeactionstaskexecuter.java:69) @ org.gradle.api.internal.tasks.execution.executeactionstaskexecuter.execute(executeactionstaskexecuter.java:46) @ org.gradle.api.internal.tasks.execution.postexecutionanalysistaskexecuter.execute(postexecutionanalysistaskexecuter.java:35) @ org.gr

Does a parameter variable create closure in JavaScript? -

i tasked trace cause of memory leak in 1 of our applications i'm trying study closures. wonder if code creates closure: function foo(p) { return function(){ return p + 1; } } based on understanding, closure created when inner function gains access local variable of parent function. parameter p local foo , if inner function gains access p , mean closure created? the parameters of function exists in local scope of function, yes creates closure

angularjs - render templates for a specific route directly from the server -

when using routes in angular.js application possible render template specific route directly server , attach controller it? for example, have application login screen , screen shows content when user logged in. when user isn't logged in , opens application cool if render template login route directly server , attach right controller it. user gets feedback directly , doesn't have wait until angular.js bootstrapped before page shows anything. when user logged in , opens application want render template content page directly server , attach controller when don't use routing angular.js (with ng-controller example). stuff on page cloacked because needs controller attached before shows useful. i'm quiet new angular, experimented bit angular.js , routing api. in test application when open it, first shows nothing , when angular bootstrapped renders view "/" route. want show view direcly because of information doesn't need controller attached it. other

php - How do write reg exp for string has structure like a-b-1 and a-b-1/d-e-2? -

sorry english not good. have problem, want compare 2 different string use reg exp. first string has structure a-b-1 , ex: mobile-phone-1. , second string has structure a-b-1/d-e-2 , ex: mobile-phone-1/nokia-asha-23. how can it? can use preg_match() method or method ... method 2 different string. much! code demo: if (preg_match("reg exp 1", string1)) { // } if (preg_match("reg exp 2", string2)) { // } p/s: shouldn't care code demo $pattern = '#[\w]+-[\w]+-[\d]+(/[\w]+-[\w]+-[\d]+)?#'; if (preg_match($pattern, $str, $matches)){ return $matches; } to match shorter string use: $pattern = '#[\w]+-[\w]+-[\d]+#'; to match longer: $pattern = '#[\w]+-[\w]+-[\d]+/[\w]+-[\w]+-[\d]+#'; to match longer more dashes: $pattern = '#[\w]+-[\w]+-[\d]+/[\w-]+[\d]+#';

parsing - Shift/reduce conflicts in bison -

i'm new bison , i'm having trouble shift/reduce conflicts... i'm trying load file array data[] : struct _data { char name[50]; char surname[50]; int year; } data[1000]; here part of bison code: %token id num nl eof %% file : list eof ; list : record | list record ; record : name surname year nl { count++; } | nl { count++; } | /*empty*/ ; name : id { strcpy(data[count].name, yytext); } ; surname: id { strcpy(data[count].surname, yytext); } ; year : num { data[count].year= atoi(yytext); } ; %% i error: conflicts: 5 shift/reduce any idea went wrong? you can use -v option bison produce .output file containing lot more information can diagnose shift/reduce conflicts. in particular, show every parser state, including list of items, , indicate states have conflicts. but in case, p

java - How to safely refactor (e.g rename fields) DTO classes returned in JAX-RS web service calls? -

i stumbled upon following problem after refactoring of issuedto (used type of elements in returned list below): generated json response has changed dictionary key (keys used strings in our selenium tests refactoring broke tests) jsf page accesses issuedto objects using field names (or names converted javabeans-named methods, i'm not sure) access textual, not "typed" @get @path("/issues/{" + locale_param + "}") @produces(mediatype.application_json) public list<issuedto> getslides(@pathparam(locale_param) final string locale) { final locale currentlocale = (locale == null) ? locale.getdefault() : new locale(locale); return issues.getissuesinlocale(currentlocale); } how can sure refactoring neither break tests nor break jsf pages? there annotation can apply issuedto fields "freeze" names i.e. de-couple java code names used non-statically-typed-javaee-specific contexts?

mysql - Multiple If conditions in a trigger -

i want write multiple if conditions check values of different columns of same table in trigger. checking 2 columns right , getting mysql error #1064(syntax error) @ line # 17. following conditions. plz me im doing wrong. if (old.ce_en_option_id != new.ce_en_option_id) insert audit_log( beneficiary_id , table_name , field_name , old_value , new_value , edit_by, date_time ) values ( old.beneficiary_id, 'be_ce_main', 'ce_en_option_id', old.ce_en_option_id, new.ce_en_option_id, new.edited_id,now() ); end if; if(old.ce_dm_option_id != new.ce_dm_option_id) insert audit_log( beneficiary_id , table_name , field_name , old_value , new_value , edit_by, date_time ) values ( old.beneficiary_id, 'be_ce_main', 'ce_dm_option_id', old.ce_dm_option_id, new.ce_dm_option_id, new.edited_id,now() ); end if; you missing begin - end block. , fear did not override delimiter instruct sql engine not execute statements ending default statement term

javascript - Run animation again when this animation is ready -

i have simple jquery animation made below: $('#message').animate({ height: "+=50px" }, 1000).delay(1000).animate({ height: "-=50px" }, 1000); when click on button , runs good. when click button again while animation still running adds sort of queue , after animation done runs time. when spam button 1 second long, goes , down, , down , on. i have tried using .stop and.query functions can't make work somehow. i want run animation when click button , animation 'ready'. if don't want mess queues, can add flag var animrunning = false; , set true when run animation until ends, set false. of course, don't run animation if flag true. something this: if (animrunning) return false; animrunning = true; $('#message').animate({ height: "+=50px" }, 1000, function(){ // using complete callback instead of delay here animate({ height: "-=50px" }, 1000, function(){

ruby - Rails has_and_belongs_to_many collection methods not showing up on object -

i have problem has_and_belongs_to_many in rails 4 app. setup follows: a user can have several roles a role can have several permissions since many users can share same roles, , many roles can share same permissions, , don't need special connection models between them, using has_and_belongs_to_many both these relationships. here models (stripped of validations): class user < activerecord::base has_and_belongs_to_many :roles end class role < activerecord::base has_and_belongs_to_many :permissions has_and_belongs_to_many :users end class permission < activerecord::base has_and_belongs_to_many :roles end the join tables named per convention: create_table "permissions_roles" |t| t.integer "role_id" t.integer "permission_id" end create_table "roles_users" |t| t.integer "role_id" t.integer "user_id" end roles <-> permissions works great, users <-> roles seems work 1 w

sql - Getting the name of the user who executed the Stored Procedure -

i know can done in code (c#) using windowsidentity , there way within sp itself? i tried using user function it's returning dbo instead of name. because user owner of database? if that's so, how can db owner's login name? edit: the application executes sp uses sa user account, if use system_user , returned value sa . select system_user will return name of user excecute code in sql. more in aricle if sql server service work sa there no way (windows) username sql server side. suppose security issue. information connection sql server may table sys.dm_exec_connections . there stored ip addreses , port s , other useful things existings connections.

Programmatically assign VBA code to MouseupEvent in access? -

Image
i have created form dynamically in vba. below query create form mouseupevent.but doesnt contain code inside event. want know how insert vba code particular event. need use modules or functions ?? set frm = createform() frm.allowadditions = false frm.allowdeletions = false frm.allowedits = false frm.onmouseup = "[event procedure]" waiting valuable response... the best way can think of consists of following steps: create public function in module note separate module, not 1 of form modules. has public , , has function . create new macro : runcode - functionname when adding function runcode arguments, through expression builder make sure can accessed. frm.onmouseup = "macroname" i have tested following code : i hope clearer.

enterprise architect - sparx EA confused on the version control status of a package -

Image
i have package showing package (deployables & connectivity - prd) under version control, has red symbol: if try , delete package, error saying package checked out: when try undo checkout, error: question: how can resolve issue? guess model in "offline" mode. thats when red symbol shown. check http://www.sparxsystems.com/enterprise_architect_user_guide/9.2/projects_and_teams/offline_version_control.html

version control - Is there a way to search ALL mercurial commits for a specific string? -

we have situation know keyword used in 1 particular mercurial commit in repository. don't know commit in. can go through each committed file , find keyword , how used, lot of tedious work. is there way in mercurial search string across committed code in repository? hg grep that. hg grep [option]... pattern [file]... search pattern in specified files , revisions search revisions of files regular expression. command behaves differently unix grep. accepts python/perl regexps. searches repository history, not working directory. prints revision number in match appears. default, grep prints output first revision of file in finds match. print every revision contains change in match status ("-" match becomes non-match, or "+" non-match becomes match), use --all flag. returns 0 if match found, 1 otherwise.

vb.net - GridViewMultiComboBoxColumn: Allow User to Enter Data -

i got straight forward grid connected dataset. i'm doing in visual basic. using telerik winforms q3 2013. every column text column, 2 of them multi column combo boxes , attached distinct dataset brings possible information. , intended reference. i want let user able key these columns text want regardless if it's on list or not. i looked @ post http://www.telerik.com/help/winforms/gridview-editors-howto-allow-end-users-to-add-items-to-dropdownlisteditor.html but example confusing , importantly, saves ref/underlining ref dataset, not desirable. how can set comboboxes allow users enter text want. thanks the multi column combo boxes working items, these items gotten data source of multi column combo box. in order allow freely typed text, latter should added data source.

android - How to display the user entered text on the same screen -

i'm begineer in android. learned developer.android.com, how display text calling activity. want display user entered text in same window. i.e., belolow text field(center). please me. i'm beginner in android , have started learn android. use edittext user input text edittext text = (edittext)findviewbyid(r.id.edittext); for use of textwatcher listen text field text .addtextchangedlistener(new textwatcher() { @override public void ontextchanged(charsequence s, int start, int before, int count) { // todo auto-generated method stub } @override public void beforetextchanged(charsequence s, int start, int count, int after) { // todo auto-generated method stub } @override public void aftertextchanged(editable s) { // todo auto-generated method stub } }); use ontextchanged method use listen edittext . inside ontextchanged start activity passing te

jquery - want to show interval days between two selected dates in two months calendar -

i new in jquery. facing problem. using jquery ui calendar. want show date difference , there 2 months calendar. start date , end date highlighted , in between dates highlighted in different color. in bottom of calendar display total interval days(start date end date)i.e. 5days. 10days. i have done highlighted parts. unable show calculation parts i.e 5days, 10 days . please follow link reference https://docs.google.com/a/webskitters.com/file/d/0b1t10tawdw7wqnpqa09hm0hwdee/edit or https://drive.google.com/file/d/0b1t10tawdw7wqnpqa09hm0hwdee/edit?usp=sharing one idea input values from , to text inputs , compute difference in js. ( (new date($('#to').val())).gettime() - (new date($('#from').val())).gettime() ) / (24*60*60*1000) should give 5.

node.js - NodeJS ExpressJS Restfull API -

i'm trying implement webservices nodejs , expressjs. this code : node.js , expressjs: var express = require('express'); var routes = require('./routes'); var skybiometry = require('./routes/skybiometry'); var http = require('http'); var path = require('path'); var app = express(); app.set('port', process.env.port || 3000); app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'jade'); app.use(express.favicon()); app.use(express.logger('dev')); app.use(express.json()); app.use(express.urlencoded()); app.use(express.methodoverride()); app.use(app.router); app.use(require('stylus').middleware(path.join(__dirname, 'public'))); app.use(express.static(path.join(__dirname, 'public'))); // development if ('development' == app.get('env')) { app.use(express.errorhandler()); } app.get('/', routes.index); app.get('/skybiomet

MultiChoice text box in html -

Image
can please guide me on how create multi-select text box in html (as shown below) ? there option available in jquery drop down same functionality. check attached screen shot look here code , live example : http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxcombobox/index.htm#demos/jqxcombobox/multiselect.htm

How to programmatically check, get and set touch settings in android phones? -

is possible programmatically various touch settings in android such as: -> dial pad touch tones -> touch sounds -> screen lock sound -> vibrate on touch i have tried accessing various constants in system.settings, see no mention of constants touch settings. can provide me info on apis or constants use this? use following check -> dial pad touch tones: boolean isdtmftoneenabled = settings.system.getint(contentresolver, settings.system.dtmf_tone_when_dialing, 1) != 0; -> touch sounds: boolean istouchsoundsenabled = settings.system.getint(contentresolver, settings.system.sound_effects_enabled, 1) != 0; -> screen lock sound: boolean islockscreensoundsenabled = settings.system.getint(contentresolver, "lockscreen_sounds_enabled", 1) != 0; -> vibrate on touch: boolean isvibrateontouchenabled = settings.system.getint(contentresolver, settings.system.haptic_feedback_enabled, 1) != 0; you c

algorithm - Special combinations with score in Java -

i have k time intervals calls epochs (e.g epoch1, epoch2,.., epochk). have set s of n elements (e.g a, b, c, d, e, f). i have assign each epoch elemnt of powerset(s) every elements in powerset(s) have score depends on epoch. for example in epoch1 have score = 5, in epoch2 have score = 4. i need assign epochs element of powerset(s), there problem. have global score sum of epochs score minus number of change between contiguos epochs multiplied parameter lambda. for example if have: epoch1 = ab score 5; epoch2 = score 6; epoch3= c score 4 i have 1 change betwenn epoch1 , epoch2 (remove b), 2 change between epoch3 , epoch2 (remove , add c), global score 6+5+4 - 3*lambda. for reason can't maximum of each epochs. 1 solutions make combination, if |s| = 30, |powerset(30)| = 2^30, suppose have c'(2^30, k) combinations repetitions. there method maximum without compute combination ? my idea algorithm finds local optima: treat epoch configurations 1 long s

symfony - 500 internal server error - IOException: Failed to create media/cache/my_thumb with LiipImagineBundle -

i trying apply filter on image based on liipimaginebundle. here steps: installation through composer file adding line: "liip/imagine-bundle": "1.0.*@dev" configuration of config.yml file adding these lines: liip_imagine: resolvers: default: web_path: web_root: %kernel.root_dir%/../web cache_prefix: media/cache filter_sets: cache: ~ my_thumb: quality: 75 filters: thumbnail: { size: [120, 90], mode: outbound } declaration of bundle in appkernel.php: new liip\imaginebundle\liipimaginebundle(), testing bundle adding there line twig file: <img src="{{ asset('img/test.jpg') | imagine_filter('my_thumb') }}" /> but, no image displayed. generated html file contains: <img src="http://localhost/tuto/web/app_dev.php/media/cache/my_thumb/img/test.jpg"> and in javascript console of browser, find error: get http://localhost/tuto/

finding eigenvalues of huge and very sparse matrix -

i have following problem. there matrix a of size nxn , n = 200 000 . sparse, there m elements in each row, m={6, 18, 40, 68, 102} (i have 5 different scenarios), rest zeros. now eigenvalues , eigenvectors of matrix a . problem is, cannot put matrix a memory around 160 gb of data. looking software allows nice storing of sparse matrix (without zeros, matrix few mb) , putting stored matrix without zeros algorithm calculates eigenvalues , vectors. can of recommend me software that? edit: found out can reconfigure matrix a becomes band matrix. use lapack eigenvalues , eigenvectors (concretely: http://software.intel.com/sites/products/documentation/doclib/iss/2013/mkl/mklman/guid-d3c929a9-8e33-4540-8854-aa8be61bb08f.htm ). problem is, need vectors, , since matrix nxn , cannot allow lapack store solution (all eigenvectors) in memory. best way function give me first k eigenvectors, rerun program next k eigenvectors , on, can save results in file. you may try use sle

protocols - Monitoring SOlution for Arduino -

i have arduino project solar tracker running. used serial monitor view data laptop. i'm moving project 1000 meters home. want remotely monitor data solar tracker parameter date, time, track angle, coordinates, etc. updated every 15 minutes. what best best protocol used long distance transmission? should zigbee, wireless, ethernet, modbus? if particular protocol suggested let me know why being suggested. want use least number of pins this. i googled , found ethernet shield sd card. never wanted recorded on sd card. data should go directly pc. if can use cable connection, reitable. rs485 best bucket (100 kbit/s @ 1200 m), optical fiber expansive optimal. classic ethernet has range of 100meter, wifi without special equipment 50/100m, zibee has maximal range of 1km, may solution, @ limit. modbus "high level" protocol can used on rs485 (or other connection)

c# - Parsing specific data from a webpage -

i getting data this webpage using following code block. think code block not reasonable because used bordercolor of table. not find different way data. there different way because newbie in c#. thanks help. foreach (htmlnode node in document.documentnode.selectnodes("//table[@bordercolor='#3366cc']/tr")) { sxpath = node.xpath + "/td[2]/font[1]"; htmlnode = document.documentnode.selectsinglenode(sxpath); if(htmlnode != null) { if (htmlnode.innertext.length >= 7) { string freq = htmlnode.innertext.substring(0, 5); if (int.tryparse(freq, out intfrequency) == true) { string pol = htmlnode.innertext.substring(6, 1); if (pol == "h") bpolarity = false; else if (pol == "v") bpolarity = true; } } } sxpath = node.xpath + "/td[3]/font[1]"; h

html - jQuery Mobile Reusing a Header and Navigation -

i'm new jquery mobile , have having issues understanding reusing header , general navigation. so i've created header has menu button on right. on clicking menu bar popup appears links other pages: <div data-role="header"> <h1>home</h1> <a href="#popupmenu" data-rel="popup" data-transition="slide" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-icon-bars ui-btn-icon-right ui-btn-a">menu</a> <div data-role="popup" id="popupmenu" data-theme="a" style="top: 22px; right: -12px"> <ul data-role="listview" data-inset="true" style="min-width:250px; min-height: 698px;"> <li><a href="test1.html">home</a></li> <li><a href="test2.html">second</a></li>

javascript - How to target a child of a sibling div using jquery -

i trying study jquery , quite shucked on figuring our how target child specific class name of sibling div. here fiddle have written: http://jsfiddle.net/7c9f4/2/ html: <div id="container"> <div class="item"> <div class="item-image"> <img width="100" src="https://www.google.com/images/srpr/logo11w.png" alt="google" /> </div> <div class="item-name"> item 1 </div> <div class="item-body"> <div class="body-inner hidden"> body 1 </div> </div> </div> <div class="item"> <div class="item-image"> <img width="100" src="https://www.google.com/images/srpr/logo11w.png" alt="google" /> </div> <div c

Remove array key from array in cakephp -

print array array( 'order' => array( 'id' => '1', 'base_price' => '65', 'min_price' => '95', ) ) is possible remove key('order') when retrieving data? if not how can use array_shift or end in 1 line , prevent below error? i getting error only variables should passed reference when remove key array. $orders = array_shift or end ($this->order->read(null, $id)); debug($orders); you want id following code you $arrorderid=set::extract("/order/id",$data); here $data array want delete "order" key. you following array when debug($arrorderid); [0]=>1 if want base_price write following code $arrorderid=set::extract("/order/base_price",$data);

OOP PHP function Connect, function Disconnect -

slowly getting world of oop php, working on database class , struggling close connection . error receive is; warning: mysqli_close() expects parameter 1 mysqli, boolean given in c:\users\pc\documents\xampp\htdocs\class.database.php on line 34. then receive own error message, failed close connection. believe problem variable have in mysqli_close. appreciated. have tried $this->myconn , $myconn no success <?php class database{ private $db_host = 'localhost'; private $db_user = 'c3337015'; private $db_pass = 'c3337015'; private $db_name = 'iitb'; public $myconn; public function connect(){ if(!isset($this->myconn)){ $this->myconn = mysqli_connect($this->db_host,$this->db_user,$this->db_pass,$this->db_name); if($this->myconn){ $this->myconn = true; echo "connected"; return true; }else{ echo "failed"; return false; }}else{ echo "already connected"; return false; }