Posts

Showing posts from March, 2014

winforms - How to open a form from a Dialog (modal form) and make it accesible even if didn't close the dialog -

i have form (form1) open modal. in form there button where, when user presses it, opens new form (form2). i have problem form1 modal , form2 in background, , cannot until close form1. how can stuff in form2 without closing form1? i need form1 modal, cannot change that. tried set parent of form2 when calling it: form2.parent = form1 form2.show() but gave me error: "form cannot added controls collection has valid mdi parent. parameter name: value" so tried this: form1.ismdicontainer = true but puts form2 inside form1. tried hiding form1 , showing again when form2 closed, fails. platform: windows forms using vb.net. the problem having was setting parent of form2 mainform, deleted part , form2 opens on top of form1. another solution works open form2 modal. of course act different, depends on want.

visual c++ - fatal error LNK1104: cannot open file 'libboost_thread-vc90-mt-gd-1_53.lib' -

i build project (c++ based) using cmake using microsoft visual studio 9 compiler (x64). in return generated solution file (.sln) project. project using boost library. i opened '.sln' file in microsoft visual studio 9 , when tried build project in debug mode (x64). received following error: fatal error lnk1104: cannot open file 'libboost_thread-vc90-mt-gd-1_53.lib' can please whats going on wrong here? lot.

oauth - GET VIMEO VIDEO DETAILS USING JAVA - OAUTH2.0/RESTFUL -

i registered " https://developer.vimeo.com/ " - (advanced api) & have consumer key , secret etc.. i tried list of videos using scribe, signpost libraries. hope vimeo implemented oauth1.0a version it's asking me visit authurl produce authcode. same need input authorization. coming implementation, need authcode (pin/verifier) without human interaction. also, let me know if restful service available vimeo developer api. my programming language: java. thanks in advance inputs. you may want have @ https://vimeo.com/forums/topic:34314 , access_token , access_token_secret. example in php, using vimeo.php library, i'm sure if phpvimeo function in library, may translated java. hope helps , regards

android - Format String into KB, MB and GB -

below class returns me data counter value in string. wanted format string kb, mb, , gb public class mainactivity extends activity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); textview infoview = (textview)findviewbyid(r.id.traffic_info); string info = ""; long getmobilerxbytes = trafficstats.getmobilerxbytes(); long getmobilerxpackets = trafficstats.getmobilerxpackets(); long getmobiletxbytes = trafficstats.getmobiletxbytes(); long getmobiletxpackets = trafficstats.getmobiletxpackets(); long totalrxbytes = trafficstats.gettotalrxbytes(); long totalrxpackets = trafficstats.gettotalrxpackets(); long totaltxbytes = trafficstats.gettotaltxbytes(); long totaltxpackets = trafficstats.gettotaltxpackets(); info += "mobile interface:\n"; info += ("\tr...

asp.net - Web application deploy on web server -

while trying deploy web application web server throws following error. it error use section registered allowdefinition='machinetoapplication' beyond application level. error can caused virtual directory not being configured application in iis. you can see site clicking here . i had developed web application in framework 4.0, vs2012. i check entire site in local machine iis 7. i afraid problem. delete obj folder in solution folder, , should able publish again.

visual studio - Preprocessor directives from C++ code (_VARIADIC_MAX) -

please how define preprocessor directive _variadic_max=10 c++ code? set in property page -> c/c++ -> preprocessor -> definitions need in each project. cool define 1 time in common.h file , use in every project including such header. you can this: #define _variadic_max 10

Why Timestamp type is not nullable in SQL Server? -

i have used following command.. select * sys.types is_user_defined = 0 here timestamp datatype not nullable. googled , not satisfied why is? is possible conditionally avoid timestamp column updatation..........

c - Tools to detect memory(array of structures) getting over-written -

could guide me suitable tool debug c program? not simple 1 , part of big project. problem have array of structures , initialised properly. check values using gdb. after program runs, somewhere array contents being over-written. not sure process over-writing contents of array of structures. tool or technique within gdb track problem? can't watchpoint gdb because can't watch "constant value". tried valgrind, doesn't show memory related issues. help, appreciated. thanks, badri. with gdb possible watch address. if can address of in gdb : p &somecomplexthing and answering 0x123456 can always watch *(void**)0x123456 (or use whatever pointer-to-pointer type appropriate you) beware of aslr ; may want disable (perhaps echo 0 > /proc/sys/kernel/randomize_va_space run root). also, recent gcc 4.8 gives address sanitizer -fsanitize=address ; , don't forget -wall -g flags gcc.

android - What's the core difference between fragment and activity? Which code can be written in fragment? -

i have 3 tabs 3 fragments each , 1 main activity, , want create socket send message on wifi network, should write code it? in particular fragment class or main activity? of course can write code inside fragment need take care of few things. while accessing requires context or specific activity need reference super activity of fragment, e.g. while creating intent inside activity : intent intent = new intent(this,someactivity.class); but inside fragment have this: intent intent = new intent(super.getactivity(),someactivity.class); similarly if accessing thing layout file of fragment. need perform following steps: 1)get global reference parent layout of fragment inside fragment. e.g private linearlayout result_view; 2) implement oncreateview method instead of oncreate method. @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { return result_view; } 3) infl...

backbone.js - Backbone Router does not trigger for direct URLs - using Meteor -

i using same basic router code todo's example, running issues. when router.navigatetoitem(itemid) works. however, if enter in direct url (/inventory/itemid), session variable never set , direct url doesnt work. can figure out how router trigger via direct url. thank appreciated. here's code i'm working with: var webrouter = backbone.router.extend({ routes: { "": "main", "inventory/:itemid": "itemdetail" }, main: function () { session.set("inventoryitem", null); }, itemdetail: function(itemid) { session.set("inventoryitem", items.find({_id:itemid}).fetch()[0]); }, navigatetoitem: function(itemid) { this.navigate("inventory/"+itemid, {trigger: true}); } }); router = new webrouter; meteor.startup(function () { backbone.history.start({pushstate: true}); }); edit 1: i notices if not pushstate: backbone.history.start(); th...

html - Changing DIV Background Image with JavaScript Not Working -

i'm trying change div background image on hover, want javescript works cross browser without issues. current code have is: <div class="staff" style="background-image: url(/wp-content/uploads/2013/08/img_1828- 300x237.png);" onmouseover="this.style.background=url(wp-content/uploads/2013/08/img_1836-v2-300x237.png);" onmouseout="this.style.background=url(wp-content/uploads/2013/08/img_1828-300x237.png);"> </div> css: .staff{ width: 300px; height: 237px; } can see causing problem? <style> .staff{ width: 300px; height: 237px; background-image: url(/wp-content/uploads/2013/08/img_1828- 300x237.png); } .staff:hover { background-image: url(wp-content/uploads/2013/08/img_1836-v2-300x237.png); } </style> <div class="staff"></div>

java - getView() not being called on notifyDataSetChanged() -

here's problem: have app has activity listview inside it. activity recursive, when click on item on list takes same activity different items in listview. lot of code within arrayadaptor listview. when moving forward through activities new ones call getview() when creating listview rows. when stepping (pressing closing current instance of activity , moving previous one) these existent activities don't call getview() rows don't updated. so need , onresume , call getview rows. i've tried adding notifydatasetchanged() , requestlayout() , invalidate() on onresume, doesn't work. getview doesn't called. i've searched answers problem, did not find any. i'm sure there million ways improve app if re-write ground up, that's not gonna happen time soon. have few days finish this, i'm quite desperate. please help.

PHP using map array? -

i new php , trying use map array. $arr2 hold values of different types of fruits. when execute following code, tells me "apple" undefined index. can please show me how can correct following code can accesses different values? <?php main_fun (); function main_fun () { $arr2 = array(); num2_data ($arr2); echo "<br>.".$arr2["apple"]["q1"]; // quadrant 1 value of apple echo "<br>.".$arr2["orange"]["q2"]; // quadrant 2 value of orange } function num2_data (&$arr2) { $arr2 = array("apple" => array("q1" => 1.1380711874577, "q2" => 1.7625118400083, "q3" => 1.8957417329238, "q4" => 2.4453545524829)); $arr2 = array("orange" => array("q1" => 1.1380711874577, "q2" => 2.5045795667914, "q3" => 1.8957417329238, "q4" => 2.7192...

vba - When using late-bound enumerated type is the only option to use the numeric representation of the type -

using late bound ado code within vba script i've got following: dim cn object dim cm object dim rs object 'get in touch server 'create ado objects. set cn = createobject("adodb.connection") cn.open strconn cn.commandtimeout = 0 set cm = createobject("adodb.command") cm.commandtext = "xxx.dbo.xxxstoredprocname" set cm.activeconnection = cn cm.commandtype = 4 'adcmdstoredproc set rs = createobject("adodb.recordset") set rs.activeconnection = cn i can see rs recordset object line set rs = createobject("adodb.recordset") without comment (' adcmdstoredproc ) i'd struggling remember cm.commandtype = 4 meant. is there way change code can stick late binding use descriptive form of enumerated type commandtypeenum rather numeric form? put in declarations section of standard module enum adcommandtypeenum adcmdunspecified = -1 adcmdtext = 1 adcmdtable = 2 adcmdstoredproc...

excel - Convert to text using VB-macro (including line breaks within cells) -

i convert excel sheet several text files. sheet contains 2 columns: column gives names generated text files column b provides content - contains line breaks within cells the conversion works using following code, line breaks not imported text file - text in 1 line: private sub commandbutton1_click() dim otxt object each cell in ark1.range("a1:a" & ark1.usedrange.rows.count) ' can change sheet1 own choice savetext = cell.text open "h:\webshop_zpider\s-solutions" & savetext & ".txt" output #1 print #1, cell.offset(0, 1).text close #1 next cell end sub can me that? hi, result of using siddharths suggestions: line breaks included! generated files not named , saved wanted. files name s-solutions plus content of colum (e.g. s-solutionss-4001-k-t.txt) , saved in folder h:\webshop_zpider. however, want is: filename: content of colum (e.g.s-4001-k-t.txt) , folder h:\webshop_...

uri - Android: Saving taken picture to Imagefolder -

i want save picture in imagefolder in phone. have got 2 examples tried. 1. example my app crashes when activate onclick method: public void onclick(view arg0) { intent cameraintent = new intent(android.provider.mediastore.action_image_capture); startactivityforresult(cameraintent, 1337); }}); protected void onactivityresult(int requestcode, int resultcode, intent data) { if( requestcode == 1337) { bitmap thumbnail = (bitmap) data.getextras().get("data"); mediastore.images.media.insertimage(getcontentresolver(),file.getabsolutepath(),file.getname(),file.getname()); } else { toast.maketext(androidcamera.this, "picture not taken", toast.length_long); } super.onactivityresult(requestcode, resultcode, data); } 2. example before saved taken picture uri. saved picture in folder, can access on pc or fileapp. don´t...

Is Eclipse enough to make an EXE using java? -

i'm going study java via book "head first: java".. im going use eclipse, when in 3rd year college, basic java programming, used notepad++ , command prompt compiling. i know if can make exe using eclipse , java alone. guis? done application in android, code using "button.settext"" things, java application desktop, how can make guis? exes? there other programs use? i start creating simple pc apps calculator. how can that? launch4j cross-platform tool wrapping java applications distributed jars in lightweight windows native executables. executable can configured search jre version or use bundled one, , it's possible set runtime options, initial/max heap size. wrapper provides better user experience through application icon, native pre-jre splash screen, custom process name, , java download page in case appropriate jre cannot found. i launch4j best tool converting java source code(.java) .exe file can bundle jre distribution , exe can...

java - How can I change log level of single logger in runtime? -

i wanna read spring property , based on property change log level packages (not root logger). how can implement using logback? see top related question: slf4j - logback: how configure loggers in runtime? more specific ((ch.qos.logback.classic.logger)loggerfactory.getlogger("abc.xyz")) .setlevel(level.xxx) should trick. i'm not sure use case is, prefer use jmx interface: http://logback.qos.ch/manual/jmxconfig.html .

asp.net - SSIS package config file windows authentication -

i have created ssis package , make deployment file , save credentional in dtconfig file. have deploy ssis package on development machine. need change username , password windows based authentication of sql server. have remove username , password , set empty , change server name still getting connection issue. i using sql server 2008 r2 what missing here? i suggest should rebuild package without storing sensitive data. for details refer http://www.mssqltips.com/sqlservertip/2091/securing-your-ssis-packages-using-package-protection-level/

How to enable USB debugging in Android? -

how enable usb debugging in nexus 7 (first generation)? edit: accepted answer applies other android devices developer option hidden . toggle on "usb debugging" in "developer options" area of settings. if not see "developer options", go "about device" in settings , tap on "build number" entry 7 times, unlock "developer options". as documented on android developers: https://developer.android.com/training/basics/firstapp/running-app.html

sql - Select from table based on result from other table -

Image
firstly, db setup (access 2010) didn't create , cannot change: violations: packages: i want select workpackagecodes when given role1 , role2 match record. example if role1 3 , role 2 8, want workpackagecodes id 3 , 8. if example role1 4 , role2 6, none should selected. i achieved doing multiple queries want have in 1 single query (with/without subquery). need can in see if workpackageid in resultset other table. tried this: //3 , 6 replaced parameters select role1 role tblsodviolations union select role2 tblsodviolations role1 = 3 , role2 = 6 this gives me desired result , tried make 1 query, this: select workpackagecode tblworkpackages workpackageid in (select role1 r tblsodviolations union select role2 tblsodviolations role1 = 3 , role2 = 6); but if run this, message: this operation not allowed in subqueries. so how can achieve this? or there way select workpackagecode in sort ...

.net - ASP.net MVC 3 Multi-Select List -

i wanted know how values multi-select list when has been selected? i have created multi-select list populating database. there use html helpers show deopdown list on view. @html.listbox("id", model.id) my question how can values user has chosen. multi-select list thanks also dont want have refresh page, unless have to. this jquery solve problem var values = $("#id option:selected").text(); hope helps.

asp.net - collapsiblepanel collapse in code not collapsing -

i have panel have extended collapsible extender. working until try collapse code. the collapsible panel shown inside modal popup user searches data, shown in grid , in every row of grid there select button fires row command event of grid on trying close panel. markup: <asp:modalpopupextender id="modalpopupextender1" runat="server" targetcontrolid="btnadd" popupcontrolid="pnlpopup" cancelcontrolid="cancel" backgroundcssclass="modalbackground"> </asp:modalpopupextender> <asp:panel id="pnlpopup" runat="server" backcolor="white" height="320px" width="530px" style="display: none"> <table width="100%" style="border: solid 3px #d55500; height: 100%" cellpadding="0" cellspacing="0"> <tr> <td> bridge i...

ios - UIView 1px height always scales wrong in UITableViewCell -

Image
i have custom tableview cell in interfacebuilder , how looks in ib : notice thin white line under label. how it's supposed during runtime. the hierarchy of uitableviewcell : my problem is, during runtime of app, line (which first view under view ) scales big, think 5px height, maybe bigger. i tried following after research, doesn't work. cell.line.frame =cgrectmake(161,36,282,1/[[uiscreen mainscreen] scale]); you should add height constrain line view.

jquery - Make hover work or capture mouse enter events on the scrollbar of an iframe? -

when try use hover or mouse enter events on div box contains iframe scrollbars find following issues in ie9-: when approach mouse box , hit extern "border" of scrollbar, "mouse enter" event fires. if keep going scrollbar, "mouse leave" event fires if scrollbar not part of box. if leave scrollbar , go box "mouse enter" event fires again. how can make scrollbar of iframe work rest of box? in firefox works well. the html <div class="hover_point"> <iframe height="250" width="250" src="www.20minutos.es"/> </div> the css <style> .hover_point{width: 250px; height:250px} </style> the js $(".hover_point").hover(function () { alert("hover"); }, function () { alert("no hover") }); here fiddle http://jsfiddle.net/kfuyp/ this seems z-index issue please follow below rule fix z-index issue. ...

response - elastic beanstalk cron run twice -

i have 1 application on elastic beanstalk , cron jobs it. the code of setting cron is container_commands: 01_some_cron_job: command: "echo '*/5 * * * * wget -o - -q -t 1 http://site.com/cronscript/' | crontab" leader_only: true this script calls mail sender. , i'm receive 2 message per time. code of http://site.com/cronscript/ looks (php code) require_once('ses.php'); $ses = new simpleemailservice(email_shortkey, email_longkey); $m = new simpleemailservicemessage(); $m->addto('user@domain.com'); $m->setfrom('response_service@domain.com'); $m->setsubject('test message'); $m->setmessagefromstring('', 'message content'); $send_emails=($ses->sendemail($m)); when call http://site.com/cronscript/ browser's address bar, receive 1 message want. i believe what's happening first time deploy app, autoscaling picks 1 instance leader , new cron job created on instance. n...

javascript - Tel link fallback -

i working on mobile version of site has "call" link @ top. i'm using tel: protocol link deal right now, problem happens if user on tablet or phone no sim card etc. if possible, i'd try tel: link , if fails pop div couple of phone numbers can choose from. ideas how might possible detect if tel: link worked/works, either @ page load or when clicked? you're better off changing way present phone number user. how putting information next call button or drop down shows it? detecting whether or not succeeded not cross platform. another suggestion change "call" phone number itself. tablet users less click on anyway if see number. "call" either piss them off thinking phone number being concealed them assuming they're on smart phone or make them think "ah, can click here , it'll show me number."

php - Facebook api. How I can get all nottagged photo my Profile? -

how photos page in facebook not tagged? $feedurl = "https://graph.facebook.com/" . $this->user . "/albums?access_token=" . $this->access_token; $albumdata = json_decode(file_get_contents($feedurl)); foreach ($albumdata->data $album) { $url = "https://graph.facebook.com/" . $album->id . "/photos?access_token=" . $this->access_token; $photo = json_decode(file_get_contents($url)); foreach ($photo->data $_) { // here not know how identify not tagged photos } }

What's the best way to create an engine for an engine in Rails? -

i working engine in rails , i'd extend functionality additional models , controllers in modular format. idea create "engine engine." best approach? if so, how achieve this? if not, better approach? what creating other engine mount in main application in addition first 1 ? coreengine extendedcoreengine are additional models , controllers specific engine , have nothing rails application engine mounted in ?

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -

my code below changes image people in team sector, can see theres alot of repeated code; there way shorten it? also currently, allows click on sections without turning off clicked one; assume toggle() function, couldn't work other way! still quite new jquery coding, grand!! cheers in advance! $("#team_client_services").click(function () { if ($(".team_client_services").hasclass("team_hide")) { $(".team_client_services").toggleclass("team_hide"); $(".team_client_services2").toggleclass("team_show"); } else { $(".team_client_services").toggleclass("team_hide"); $(".team_client_services2").toggleclass("team_show"); }; }); $("#team_management").click(function () { if ($(".team_management").hasclass("team_hide")) { $(".team_management").toggleclass("team_hide"); $(".team_management2...

ios - Setting an animation for a toolbar from the beginning -

i have textfield has uidatepicker instead of keyboard. made toolbar not connected datepicker appears when textfield tapped. problem animations. datepicker slides nicely, toolbar appears before animation of datepicker done. makes whole thing horrible. how set animation match datepickers ? have no experience animations , none of other posts did me. edit based on tareks answer able set animation slide doing following. first, setting toolbar bottom of screen pickerbar = [[uitoolbar alloc] initwithframe:cgrectmake(0, 480, 320, 44)]; seconds, changing location of toolbar in animation [uiview animatewithduration:.4 animations:^(void) { cgrect rect = cgrectmake(0, 224-46, 320, 44); [pickerbar setframe:rect]; you can use code below show toolbar: [uiview animatewithduration:2.0 animations:^(void) { toolbar.alpha = 1; }]; edit : toolbar.alpha should 0. for sliding: gonna like: [uiview animatewithduration:2 animations:^{ int newy = ...

android - How can i turn Stringbuilder variable to a long? -

// text file file file = new file(environment.getexternalstoragedirectory() + "/config/gpslistenermintime.cfg"); // read text file stringbuilder gpslistenermintime = new stringbuilder(); try { bufferedreader br = new bufferedreader(new filereader(file)); string line; while ((line = br.readline()) != null) { gpslistenermintime.append(line); gpslistenermintime.append('\n'); } } catch (ioexception e) { // todo you'll need add proper error handling here } i want read number file code , works well, how can use number long value in requestlocationupdates? tried use way not working: lm = (locationmanager) getsystemservice(context.location_service); lm.requestlocationupdates(locationmanager.gps_provider, long.valueof(string.valueof(gpslistenermintime)), 0, this); my file contains number:...

Rails - javascript not reloading divs via remote call -

i trying create timeline user can create events go on timeline. i've had working fine in past, have since updated version of rails 3.2.14, , no longer works. possibly syntactical error if has changed between versions, or have done wrong? the timeline show view renders partials including timeline, , create/edit/destroy form partials events. understand it, form getting submitted, , should calling create.js.erb. what happening when click 'create event', contents of page replaced standard "event created" notice (not 1 create.js.erb), , else disappears. event has been created though. can help? timeline show view: <div id="show-timeline"> <%= render :partial => "show_timeline" %> </div> <div class="content-box timeline-box"> <div id="my-timeline-box"> <%= render :partial => "my_timeline" %> </div> <br /> <button id="new-event-butt...

c# - Unable to install OOB SL5 programatically -

i'm trying install brand new silverlight 5 application using sllauncher.exe. when older sl4 application, works fine, however, new sl5 application different , causing sllauncher fail silently. generate folder in appdata folder, empty. ideas might causing this? way see errors sllauncher throwing? , ideas welcome! (for method of invoking sllauncher, following post: http://timheuer.com/blog/archive/2010/03/25/using-sllauncher-for-silent-install-silverlight-application.aspx ) in case had nothing silverlight 5, turns out issue due out of browser icons had set, being set resource , not content. them show , install using sllauncher.exe work, icon files must set content, otherwise out of browser fail silently when using sllauncher.exe , work fine using right-click context menu install it.

xcode - Retrieve files from iOS app Documents folder via command line -

for project work on, have set performance metrics. way simulator writes csv files known location. retrieve theses files , make graphs out of it. piece of cake. we have these tests running on device. in case, files created in documents directory. while can retrieve these files via organizer, i'd more interested in automating that. how can retrieve files iphone app via command line rather organizer? you can access content of app computer, using https://github.com/phonegap/ios-deploy (originally https://github.com/ghughes/fruitstrap ) . it's simple : ./ios-deploy --download=/documents --bundle_id com.mycompany.myapp -2 dest_dir you can more, listing content of app, debug using lldb etc.

JQuery UI Date Picker - Adding a class to all selected <td> -

i trying add class each <td> between 2 specific dates. here code; http://jsfiddle.net/7q4bt/171/ $(function() { $(".checkin-date__input").attr("placeholder", "mm-dd-yyyy").datepicker({ dateformat: "mm d yy", mindate: +1, showon: "focus", numberofmonths: 2 }).on("change", function(e) { var curdate = $(this).datepicker("getdate"); $(this).datepicker("setdate", curdate); if($('.checkin-date__input').datepicker("getdate")) { $( ".checkout-date__output" ).datepicker( "option", "mindate", $('.checkin-date__input').datepicker("getdate") ); }; }); $(".checkout-date__output").attr("placeholder", "mm-dd-yyyy").datepicker({ dateformat: "mm d yy", mindate: +1, showon: "focus",...

import - Using a C++-function that is exported -

this question has answer here: c++ exporting , using dll function 2 answers i have been googling days now, , cant seem wrap head around problem. i have header, exports functions library. file called test_extern.h, , function looks this: __declspec(dllexport) int afunction(int a, int b); i have 2 other files, 1 .h , .cpp calculates things of exported file. have stripped down versions show want do. a.h file: // include cbasedili_j1939 header file. class : public cbasedili_j1939 { public: int bfunction(int a, int b); } a.cpp file: #include "test_extern.h" #include "a.h" int a::bfunction(int a, int b) { return afunction(a, b); // return value of exported function! } now when run this, "error lnk2019: unresolved external symbol _ imp _afunction". i have read , read there exporting dll's, there knows might doing wro...

c++ - Cmake Regenerate on variable change -

y part: i've got cmake macro runs external program , creates project specific variables. i'd have cmake run script on every build, check if variables have changed, , iff have (to prevent full project rebuild when has not), regenerate configure_file header...i'm not sure how though. (add custom target rebuilds header file every time , can't call macros, same add custom command). x part: so i've written following script pulling hg version information use in c++ project: macro (readprojectrevisionstatus) exec_program(hg ${project_source_dir} args paths output_variable ${project_name}_hgpaths) message(status "${project_name}_hgpaths=${${project_name}_hgpaths}}") if (not(${project_name}_hgpaths strequal "")) string(replace "\n" ";" ${project_name}_hgpaths ${${project_name}_hgpaths}) foreach(hgpath ${${project_name}_hgpaths}) string(substring "${hgpath}" 0 10 hgpathstart) if (hgpathstart matches "default...

Understanding JavaScript Object -

this line @ top of javascript file in project @ school. can tell me does? var tele = { 'forms': {}, 'form': {} }; it followed 3 functions contain more functions exampled below. formsview.js tele.forms.view = new function (){ this.setrequesttitle = function (title) { if (el.length == 0) { settimeout(function () { tele.forms.view.setrequesttitle(title); }, 100); return; } $('#formtitlebarsubmenutext').html(title); document.title = title; }; .... .... }; then there second javascript file formview.js contains this tele.form.view = new function () { this.initialize = function (data) { tele.forms.view.setrequesttitle('approval request'); }; }; i new javascript , scripting in general trying figure out how things work. understand happening inside functions, not tying together. thanks! that line declares variable: var tele; // declare variable identifier tele and ...

asp.net - ASP button reloading page? -

i have code on aspx page: <div id="bloc1"> hey </div> <asp:button id="button2" runat="server" text="button" onclick="button2_click" onclientclick="change_page()" /> <input id="button1" type="button" value="button" onclick="change_page()" /> <div id="bloc2" style="display:none"> hey me </div> <script type="text/javascript"> function change_page() { document.getelementbyid("bloc2").style.display = "block"; document.getelementbyid("bloc1").style.display = "none"; } </script> when click on html button, script works well: bloc1 disappears , bloc2 appears. when click on asp button, bloc1 disappears , bloc2 appears , bloc2 disappears , bloc1 re-appears (so beginning) if page reloaded. behind code something: protected void butt...

command line arguments - R Paste multiple -

i taking in multiple command line parameters within r script such : args<-commandargs(true) arg1 <- as.numeric(args[1]) arg2 <- as.numeric(args[2]) i wanting use these args within paste string below. problem can figure out how use 1 of arguments , not both (arg1, arg2). instead of "xxx" show below in clause (i.e. "columnname1 in (xxx)") how use "arg1" command line parameter in place of "xxx"? i've tried number of different ways , reason can't figure out. should concatenate 2 different strings accomplish or there easier way? sql<-paste( "select * table columnname1 in (xxx) , columnname2 in ('",arg2,"')",sep = "") thanks help! try: sql<-paste( "select * table columnname1 in ('",arg1,"') , columnname2 in ('",arg2,"')",sep = "", collapse="")

perl - WWW::Mechanize::Firefox click button in <div> -

i got big problem. have 12 elements same class - "comment". in every button click. i need know how select (eg. 3 of 12) , click button there. is exist selector or something? please give me advice that. $mech->click can take css selector or xpath query argument. if know button want click always third one, use nth-of-type css selector pinpoint it. edit: example using xpath based on op's comments (i haven't tested this). use qq allow variable interpolation inside xpath statement. note have backslash escape occurrences of @ qq doesn't interpret them arrays: my $author = 'xxx'; $mech->click({ xpath => qq(//div[\@class="com" , \@author="$author"]/button) });

vba - Visual Basic: killing the process of an Application Object -

in visual basic create application object , start it: gapp = new canoe.application gmeasurement = gapp.measurement gapp.open(arrargs(0), false, false) gmeasurement.start() once application finishes processing data 2 possible scenarios may happen: (i) data file corrupt , (in normal circumstances) allert window raised , (ii) data file ok. in (ii) case can quite application gapp.quit() . in case (i) gapp.quit() not work, since program expects input user (although not see window @ all). question 1 : how can quite process corresponding gapp? quiting in way: each p process in process.getprocesses if p.processname = "canoe32" p.kill() end if next in general bad solution since more instances of canoe32 may run (although in particular case 1 process of binary may run on system). question 2 more elegant solution quit gapp in case has child windows? any comments helpful a possible solution problem use s...

.net - kendo ui grid filter case insensitive -

i'm trying enable case insensitive filtering (server side) kendo grid. know way inject tolower (toupper, etc) filter enable case insensitive filtering? background: i dropped kendo grid in consume data controller ( entitysetcontroller , .net 4.5) , seems work well. inline editing, server paging, adding new rows, etc. to enable case insensitive filtering knockout, build filter filter text , field wrapped in tolower (as recommended here ). haven't found way customize filter using kendo elements. controller: public class categoriescontroller : entitysetcontroller<category, int> { public override iqueryable<category> get() { return _repository.find().orderby(c => c.name); } } data source creation: var servicebaseurl = "api/categories", datasource = new kendo.data.datasource({ type: "odata", transport: { read: { url: servicebaseurl, datatype: ...

javascript - D3 Tree Layout - Custom Vertical Layout when children exceed more than a certain number -

Image
i'm trying use d3 tree layout create family tree of sorts , 1 of things noticed when have many children nodes, stretch out horizontally across screen. ideally more vertical layout these nodes people don't have scroll across screen , can keep looking down tree. here see: now might not bad, if had 20 children, span across whole screen , kind of want avoid. i have seen questions this doesn't me because want specific layout , not resize... have large nodes , begin collide 1 if try dynamically resize tree -- shrinking tree not me good. i need different layout situations there more number of children. here kind of envisioning/hoping for. notice root not make format because has 4 children. ideally want if parent has 5 or more children, result in layout below. if root had 5 children, result in layout , layout should stretch out vertically if users wanted see root's grandchildren (the a, b, c... nodes). if necessary can diagram of going: i found semi-similar que...

linux - ./startAgent.sh --udp-port 0 --tcp-port 3450 Permission Denied -

in jmeter plugins, when trying run ./startagent.sh --udp-port 0 --tcp-port 3450 to monitor server, getting permission denied error. per details on plugin page don't need rot/admin access. system still shows error.. i found solution, have run below command avoid permission denied. chmod 744 startagent.sh

javadoc - Where to get downloadable Javasdocs for older JDKs? -

i download of javadocs 1.6 api. oracle has them online, can't seem find way download them computer. ideas? thanks. jdk contains javadoc ( http://docs.oracle.com/javase/6/docs/ ). so, download , install java se 6 jdk, , you'll have needed documentation offline on computer.

linux kernel - How to read return value of mmap -

i'm new topic, have mmaped 3 pages. how can read content of each? know have use page_shift don't know how. unsigned int* address = mmap(...) somethings following... #define page_size 4096 unsigned int * address = mmap(...) unsigned int * page0 = &address[ 0 * page_size / sizeof(int) ]; unsigned int * page1 = &address[ 1 * page_size / sizeof(int) ]; unsigned int * page2 = &address[ 2 * page_size / sizeof(int) ];

view - Objective-c Nested VIewControllers -

Image
i create app whit structure similar native application "phone" of iphone. more precise, phone application have tabbar contains:"favorites" , "recents", "contact", "keypad" , "voice mail". when enter in tab contacts can see navigation bar , tableview. have similar structure i'm questioning myself best , correct way it? i thinking start single view application use view controller create automatically tabbedviewcontroller create subclass of viewcontroller , used navviewcontroller. i have [mytabbar.view addsubview:mynavcontroller]; but how can set instance? once have automatically created viewcontroller , create secondviewcontroller how can set them tabviewcontroller , navviewcontroller ? if you're using storyboards, add tab bar controller storyboard. select 1 of tab bar's child scenes , choose "embed in" - "navigation controller" xcode "editor" menu. if repeat ...

php - Custom wordpress contact form -

i trying make custom wordpress contact form. i've got far: my function contact form itself: <?php if( isset( $_post['submitted'] ) ) { //response generation function $response = ""; //function generate response function my_contact_form_generate_response($type, $message){ global $response; if($type == "success") $response = "<div class='success'>{$message}</div>"; else $response = "<div class='error'>{$message}</div>"; } //response messages $not_human = "human verification incorrect."; $missing_content = "please supply information."; $email_invalid = "email address invalid."; $message_unsent = "message not sent. try again."; $message_sent = "thanks! message has been sent."; //user posted variables $name = $_post['message_name']; $email = $_post['message_email']; ...

java - Why doesn't the index/list of an array begin with 1? -

this question has answer here: why indexing start 0 in 'c'? 12 answers is there special reason? know that's how language has been written, can't change it? , challenges we'd face if index start 1? for historical reasons, , reasons connected how array "made" in memory. in c, array piece of memory (with information @ compiler level on size). have pointer (a reference) first element. go second element can do int array[10]; // array int *p = array; // reference first element of array int *q = p + 1; // reference second element of array int *r = p + 2; // reference third element of array clearly, symmetry: array[0] // reference first element of array array[1] // reference second element of array array[2] // reference third element of array the [x] operator of c in fact compiled array + x . you see? array "base 0...

javascript - Compatibility issues with pidcrypt and openssl_encrypt -

i designing application allows end users take quizzes browsers. part of requirement when quiz start time around, question should displayed every participant @ once. makes serving questions end users server less reasonable because lead sudden burst of request intend serve questions them connect , less 2 hours quiz start time. problem since competition, questions should not seen before start time hence there need encrypt it. i have decided encrypt in 2 stages, first stage of encryption using asymmetric rsa encryption exchange of keys have done. key used encrypt other data that sent between server , client. the problem symmetric encryption part. trying use openssl_encrypt method encrypt on server side , trying decrypt pidcrypt (a javascript encryption/decryption library) on clientside. turns out pidcrypt requires iv (initialization vector) 8 bytes long openssl_encrypt using aes-256-cbc mode doesn't allow 8 bytes instead insisting on 16 bytes. have done lot of permutations , ex...