Posts

Showing posts from 2013

vba - Excel Dynamically Add To If Row Contains Something -

Image
i have excel sheet used customer data entry, such cost of parts, how paid everything, , how paid (cash, credit, or check). here's first page better look: so on first sheet, enter data need, such name, car make, address (the date dynamic =today()). when type "y" in confirm box, data calculated on sheet2 analyze monetary values. here's sheet 2 data can see i'm talking about: pressing "new customer" button runs vba script creates new line on sheet1 customer entry, creates corresponding line on sheet2 new line on sheet1 produce calculated data, , "stores" both sheet1 , sheet2 of previous customer data on sheet3. this leads me question.. sheet2 calculations "cash total", "credit card total", , "check total", need filter through , add (cash + part cost) if paid in cash, (card + part cost) if paid card, , (check + part cost) if paid check. problem cannot figure out how go row row , check whether used cas

Laravel - How to a try/catch in blade view? -

i create way compile in view, try/catch. how can in laravel? example: @try <div class="laravel test"> {{ $user->name }} </div> @catch(exception $e) {{ $e->getmessage() }} @endtry you should not have try / catch blocks in view. view that: representation of data. means should not doing logic (such exception handling). belongs in controller, once you’ve fetched data model(s). if you’re wanting display default value in case variable undefined, can use or keyword: {{ $user->name or 'name not set' }}

jquery - Clicking children triggers parent -

this question has answer here: how stop events bubbling in jquery? [duplicate] 5 answers i have found many questions in regard, none of solutions me. keep experiencing feature (issue in case) when have multiple elements stacked on eachother. have dom situation this. <div class="body" data-type="body" onclick="foo(this)"> <div class="container" data-type="container" onclick="foo(this)"> </div> </div> so when click .body console.log shows correct element. when click .container both elements fire onclick event. there way overcome this? or there possibility add listeners otherwise? pure jquery approach looks this. of course when use pure jquery have no inline onclick. function initselectable(){ $('*[data-type]:not(.item-wrapper)').unbind('click').bind('clic

google chrome - Webstorm 10 won't run my HTML -

this code i'm using test webstorm, , when try run it, goes chrome , gives me 404 not found error. why this? <!doctype html> <html lang="en"> <head> <title>my webpage</title> </head> <body> <h1>heading</h1> <p>sample text</p> </body> </html>

refresh - R Shiny: Updating .csv input on a schedule -

i have .csv auto-updates every minute new data. i'd have r shiny reupdate every hour new dataset. from i've seen, involve invalidatelater or autoinvalidate ; however, i'm not sure how these working (or more importantly, put them). ui.r pretty straightforward won't include it. server.r below: library(ggplot2) library(reshape2) library(scales) # data <- reactive({ # data refresh once day # 86400000ms 1 day # invalidatelater(10000, session) # 10s test # }) shinyserver(function(input, output, session) { autoinvalidate <- reactivetimer(10000, session) observe({ x <- read.csv("wait_times.csv", header=t, stringsasfactors=false) x <- rename(x, c("fall.river" = "fall river", "martha.s.vineyard" = "martha's vineyard", "new.bedford" = "new bedford", "north.adams" = "north adams", "south.yarmouth" = "south yarmouth")) citie

html - How to animate border-top effect -

when hover on "login,sign up" acorns website ( https://www.acorns.com/ ) can see animation going along. have li .navbar li{ display: inline-block; border-width:5px; border-top-style:solid; border-top-color: white; } .navbar li:hover, .navbar li:active{ border-width:4px; border-top-style:solid; border-top-color: #e0b82b;} how possible make border-top animated ? shown above. thank you. http://jsfiddle.net/9mfccz6w/ i'm trying animate top bar (yellow) you can add css tranistions .navbar li style. try code: .navbar li{ display: inline-block; border-width:5px; border-top-style:solid; border-top-color: white; -webkit-transition: 0.5s ease; -moz-transition: 0.5s ease; -o-transition: 0.5s ease; -ms-transition: 0.5s ease; transition: 0.5s ease; } jsfiddle

r - Why are these numbers not equal? -

the following code wrong. what's problem? i <- 0.1 <- + 0.05 ## [1] 0.15 if(i==0.15) cat("i equals 0.15") else cat("i not equal 0.15") ## not equal 0.15 general (language agnostic) reason since not numbers can represented in ieee floating point arithmetic (the standard computers use represent decimal numbers , math them), not expected. true because values simple, finite decimals (such 0.1 , 0.05) not represented in computer , results of arithmetic on them may not give result identical direct representation of "known" answer. this known limitation of computer arithmetic , discussed in several places: the r faq has question devoted it: r faq 7.31 the r inferno patrick burns devotes first "circle" problem (starting on page 9) david goldberg, "what every computer scientist should know floating-point arithmetic," acm computing surveys 23 , 1 (1991-03), 5-48 doi>10.1145/103162.103163 ( revision availa

mysql - Select * from table where id = ? and order by priority -

i have database fields: id (int) name (text) priority (int) i want show values database id = (e.g) 13 , sort them priority. e.g: field id 13 , priority 1 first other field priority 2. how can it? select id,name,priority table_name id=13 order priority asc;

javascript - Issue with JsonForm in mvc -

i trying use jsonform libary github generate html markup json schema. trying in mvc view not have default form tag. added 1 html.beginform still markup not generated , following javascript error in console :typeerror: _ null . me out ? below code in view : @{ viewbag.title = "index"; layout = "~/views/shared/_layout.cshtml"; } @using (html.beginform()) { <script type="text/javascript" src="~/scripts/jquery-1.8.2.js"></script> <script type="text/javascript" src="~/scripts/json-form.js"></script> <script type="text/javascript" src="~/scripts/bootstrap.min.js"></script> <script type="text/javascript" src="~/scripts/underscore.js"></script> <link href="~/content/bootstrap.css" rel="stylesheet" /> <script type="text/javascript"> $('form').jsonform({ schem

ios - Can I change (unsigned) to (NSUInteger) or will it create problems? -

i jr software developer, can change (unsigned) (nsuinteger) or create problems later? - (unsigned)retaincount { return uint_max; //denotes object cannot released } warning said mkstoremanager.m:88:1: conflicting return type in implementation of 'retaincount': 'nsuinteger' (aka 'unsigned long') vs 'unsigned int' i found previous definition - (nsuinteger)retaincount objc_arc_unavailable; your method must return nsuinteger because how retaincount method defined in nsobject . the error being caused value trying return. instead of returning uint_max , should return nsuintegermax . the underlying type nsuinteger changes depending on whether building 32 or 64 bit. accordingly, value of nsuintegermax changes match type. - (nsuinteger)retaincount { return nsuintegermax; //denotes object cannot released }

asp.net - Dynamic property changing, C# -

so have function replacement looking this: powerpointeventarg.powerpointdatalist[index].property = powerpointeventarg.powerpointdatalist[index].property.replace("deeperskyblue", "0066cc"); powerpointeventarg.powerpointdatalist[index].property = powerpointeventarg.powerpointdatalist[index].property.replace("deepskyblue", "3366ff"); powerpointeventarg.powerpointdatalist[index].property = powerpointeventarg.powerpointdatalist[index].property.replace("skyblue", "99ccff"); powerpointeventarg.powerpointdatalist[index].property = powerpointeventarg.powerpointdatalist[index].property.replace("yellow", "ffff00"); powerpointeventarg.powerpointdatalist[index].property = powerpointeventarg.powerpointdatalist[index].property.replace("darkturquoise", "0066cc"); powerpointeventarg.powerpointdatalist[index].property = powerpointeventarg.powerpointdatalist[index].property.replace("salmom"

powershell - Choice of input values for a PS function. -

i have function accepts range of input values. of times, users pick 1 of 3 values (value1, value2, value3). occasionally, might input value not in set (value 5). though, want provide user choice, avoid typos etc, don’t want restrict them 3 values. use following code, doesn’t serve purpose. suggestions? function get-something(){ param([validateset('value1','value2','value3')] [string] $yourchoice) return $yourchoice } one option might have 4 parameter sets, value1, value2, , value3 being switch parameters used select 1 of 3 common values, , value being string parameter used specify arbitrary value, each within it's own parameter set they're mutually exclusive.

c# - DataAnnotation Presentation Working on IIS Express but Not Working on IIS -

i'm developing asp.net mvc application, , controlling presentation of element properties using data annotations. result fine on iis express directly visual studio, when deploy uat server annotations fail. code: edit.cshtml: @html.editorfor(m => m.globalizedelement) model: public class globalizedelement { [hiddeninput(displayvalue = false)] public int id { get; set; } [hiddeninput(displayvalue = false)] public int elementid { get; set; } [hiddeninput(displayvalue = false)] public string culturecode { get; set; } [datatype(datatype.multilinetext)] [allowhtml] [display(name = "internaldescription", resourcetype = typeof(entitydataannotations))] [required(errormessageresourcetype = typeof(entityvalidation), errormessageresourcename = "requiredinternaldescription")] public string internaldescription { get; set; } [datatype(datatype.multilinetext)] [allowhtml] [display(name = "interview

ruby on rails - how to refresh a page after receiving webhook from stripe -

i using stripe creating payments. after payment done user redirected payment status page. payment status page supposed show latest plan user has subscribed for. problem webhook stripe after sometime updates user plan table. user redirected user plan page after payment. how can show updated status after user redirected. there way halt redirect till webhook request complete there should no need on end wait webhook event arrive before updating customer here. stripe api calls synchronous means when create charge either error indicates payment failed or charge object indicates payment succeeded. depending on can update customer without having wait event reach you. the same logic applies new subscription here when create 1 subscription object indicating successful , can update database before redirecting customer. most events should seen way verify information have on end , make sure data date , not validate charge , update customer directly.

Get all nested arrays from ElasticSearch document and sort it -

i have mapping similar this: jsonexample this represents changelog structure. each document represents object properties. these properties can changed @ dates. limit space, keeps track of changes instead of updating whole object 1 updated field example. the goal query object based on given date. result should object properties on given date. later changes should discarded , changes matching or recent given date should returned. so nested query can retrieve whole object. want nested properties returned , sorted closest given date can find properties @ given date. is there way elasticsearch queries/filters , without parsing returned json , sort afterwards example java.

windows - Unknown error occurred in terasso library, unable to connect to teradata using vba -

i have simple code. last line return such error, use not english version, might bit different: " the data source not found , default driver not specified ". private objconn new adodb.connection 'connection... private objrs new adodb.recordset 'recordset... private objerr adodb.error 'errors... dim strsql string, intjobcoderequested integer 'prompt user job code... intjobcoderequested = inputbox("please enter job code desired: ", "teradata program", " ") 'connect database using dsl set in odbc setup... objconn.open "driver=teradatadsn; server=teradata server name; database=database name; uid=user id; pwd=password" so after that: i run 32 bit odbc data source administrator, pressed "add" selected "teradata" list pressed "finish" as result error message unknown error occurred in terasso library i`m using teradata v 14.1. oldp driver installed, according registry.

php - Infinite dynamic multi-level nested category with MySQL -

in database structure this: ---------------------- | id | name | par_id | ---------------------- | 1 | aaaa | 0 | ---------------------- | 2 | bbbb | 1 | ---------------------- | 3 | cccc | 1 | ---------------------- | 4 | dddd | 2 | ---------------------- | 5 | eeee | 2 | ---------------------- | 6 | ffff | 5 | ---------------------- this listed php want avoid php , sql directly made query return hierarchy looks this: --------------------- | id | name | level | --------------------- | 1 | aaaa | 0 | --------------------- | 2 | bbbb | 1 | --------------------- | 4 | dddd | 2 | --------------------- | 5 | eeee | 2 | --------------------- | 6 | ffff | 3 | --------------------- | 3 | cccc | 1 | --------------------- i need change order in table , add level of depth this: from: to: aaaa aaaa bbbb -bbbb cccc --dddd dddd --eeee ee

MS Access Link to an Excel Document on Sharepoint -

hi trying link excel document on sharepoint "http://..." every time try link file gives me list. don't want link list want able pull data actual excel document aand not list of file on sharepoint. possible? i don't know if right have found indicates access see things on sharepoint "blank blocks" , not pull data actual files may wrong article , forums found dated 2013 , 2012 couldn't find else newer date. : ). did find can use macro download files , locate them in shared drive , update them every month or access update , link file access via excel files.

python - pandas - select/mask the first n elements by value -

starting 1 single dataframe: i,a,b,c,d,e,f a,1,3,5,6,4,2 b,3,4,7,1,0,0 c,1,3,5,2,0,7 i keep/mask first 3 elements in rows value keeping order of columns, resulting dataframe appears as: i,a,b,c,d,e,f a,0,0,5,6,4,0 b,3,4,7,0,0,0 c,0,3,5,0,0,7 so far i've been able sort dataframe with: a = df.values and a.sort(axis=1) so that: [[1 1 2 3 4 5] [0 0 1 1 3 4] [0 1 1 3 5 7]] obtaining sorted numpy array, loosing information columns. you can rank values row-wise , filter them , call fillna : in [248]: df[df.rank(axis=1, method='min')>3].fillna(0) out[248]: b c d e f 0 0 0 0 5 6 4 0 1 0 3 4 7 0 0 0 2 0 0 3 5 0 0 7 you can concat 'i' column back: in [268]: pd.concat([df['i'], df[df.rank(axis=1, method='min')>3].fillna(0)[df.columns[1:]]], axis=1) out[268]: b c d e f 0 0 0 5 6 4 0 1 b 3 4 7 0 0 0 2 c 0 3 5 0 0 7 output intermediate dfs: in [269]: df

tfs2013 - TFS Release Management Visual Studio 2013 - Permission Issue -

i attempting deployment 'program files' directory on target server, running tfs deployment agent under account 'administrator' privilege. i unable perform directory operations on 'program files' surely deployment tool should able access program files? microsoft release management managewindowsio powershell script v12.0 copyright (c) 2013 microsoft. rights reserved. executing following parameters: action: create source file or folder name: c:\program files\xxx destination file or folder name: read only: archive: system: hidden: owner domain: owner name: working directory: (script path) new-item : access path 'xxx' denied. @ c:\users\xxxxxxxxxxxxxx\appdata\local\temp\rm\t\rm\create folder\201507 141521278761159-39\managewindowsio.ps1:165 char:17 + new-item <<<< -itemtype directory -path $filefoldername + categoryinfo : permissiondenied: (c:\program file... xxx:string) [new-item],

javascript - Hide element based on value of other elements -

i trying hide table based on value of 2 fields, if field2 equal field1 table hidden. jsfiddle html: <form> expected number of items: <input type="text" value="14" name="totalitems" id="totalitems"> <p> number of items entered: <input type="text" value="14" name="entereditems" id="entereditems"> </form> <p> <table border="1" style="width:100%" id="hidethis"> <tr> <td>this should hidden when "totalitems" equals "entereditems"</td> </tr> </table> js: function toggleclass(eid, myclass){ var theele = document.getelementbyid(eid); var eclass = theele.classname; if(eclass.indexof(myclass) >= 0){ theele.classname = eclass.replace(myclass, ""); }else{ theele.classname += "" +myclass; } } $(d

java - Notification not shown when setGroup() is called in Android KitKat -

i'm testing stackable notifications (stacking notifications article) . i detected in cases notifications not shown after notify() call in devices running android 4.x kitkat. to problem created code simulates notification (button1) , second notification summary (button2) private final static int notification_id_a=6; private final static int notification_id_b = 7; private final static int notification_id_summary = 8; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); findviewbyid(r.id.button).setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { shownotif(notification_id_a,false); } }); findviewbyid(r.id.button2).setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { shownotif(notification_id_b,false); shownotif(notification_

Internal IP not localhost? -

recently i've had problem tomcat server , saying couldn't resolve host address. turned out required internal ip assigned localhost, i.e. 192.168.a.b why not resolved localhost? , there's no adding ip hosts file because change network it'll become else.

javascript - For loop is stopping at the first letter in string? -

this rovarspraket function. loop not iterating on other letters in phrase. stops @ 't' first letter in string. function returning 'tot' instead of full string of 'tothohisos isos fofunon'. i've been staring @ long. suggestions help. i'm novice javascript way. function translate (phrase) { var splitphrase = phrase.split().join(); var letter = splitphrase[i]; var vowels = ['a', 'e', 'i', 'o', 'u']; var output = ''; (i = 0; < phrase.length; i++) { if(vowels.indexof(letter) === -1) { output = letter + 'o' + letter; } else { } return output } }; undefined translate('this fun') "tot" there handful of mistakes or things may have overlooked in order reach final desired result of "tothohisos isos fofunon": you aren't appending data output , you're overwriting it. you return within loop, stopping loop after fir

sql - How to format value as float with 2 deciaml only in mdx? -

here value : value -0,00398911382022891 and member count value member [date].[percentage] ([date].[averagesalenumberthisyear] - [date].[averagesalenumberpreviouseyear] )/ [date].[averagesalenumberthisyear]. if use format_string = "percent" getting value : -0,40%, want same without % sign. you can use custom format strings in mdx. sounds want format_string = "0.00" or format_string = "fixed" i'm assuming didn't really want multiple value 100, "percent" does) if do want multiplied 100, in expression: member [date].[percentage] 100 * ([date].[averagesalenumberthisyear] - [date].[averagesalenumberpreviouseyear] ) / [date].[averagesalenumberthisyear].

c++ - Disable exception working for boost::smart_ptr but not for boost::property_tree -

i'm using boost 1.57. need disable exception support in not widely-used proprietary compiler. when needed use boost::smart_ptr , following steps worked charm: disabled c++11 support using following user.hpp file (compiling -dboost_user_config="<user.hpp>" ): #define boost_has_nrvo #define boost_no_complete_value_initialization #define boost_no_cxx11_auto_declarations #define boost_no_cxx11_auto_multideclarations #define boost_no_cxx11_char16_t #define boost_no_cxx11_char32_t #define boost_no_cxx11_constexpr #define boost_no_cxx11_decltype #define boost_no_cxx11_decltype_n3276 #define boost_no_cxx11_defaulted_functions #define boost_no_cxx11_deleted_functions #define boost_no_cxx11_explicit_conversion_operators #define boost_no_cxx11_final #define boost_no_cxx11_function_template_default_args #define boost_no_cxx11_lambdas #define boost_no_cxx11_local_class_template_parameters #define boost_no_cxx11_noexcept #define boost_no_cxx11_nullptr #define boost_no_c

Import spinnerwheel module to android studio -

how can import library project in android studio spinnerwheel download zip github you should put library modules inside application project. in order specify module dependency, simply: right click on application->open module settings click on '+' icon select root directory library module you'd add. follow prompts then, module show in project. then, need add application library dependency. once again, in module settings: select application module select dependencies tab on right click '+' icon on bottom select module dependency select desired library module

windows - PHP exec cmd doesn't work in my case -

i've been looking around 2 days , can't find problem, i'm trying run simple cmd code works if run directly cmd console. when run php nothing happens, believe kind of permission problem, ideas? this code i'm trying run, execute html5point_converter.exe converts ppt file html exec("c:\\windows\\system32\\cmd.exe /c c:\\inetpub\\wwwroot\\html5pointsdk\\html5point_converter.exe \"c:\\inetpub\\wwwroot\\html5pointsdk\\arquivos\\upload1\\teste1.ppt\""); i've tried execute following code test if cmd inside php works, , working fine: exec("c:\\windows\\system32\\cmd.exe /c dir", $output); i'm running on windows server 2008 r2, iis 7 , php 5.5 installed web plataform installer 5. for test purpose i've set security permission full control in: folder: c:\program files (x86)\php folder: c:\inetpub\wwwroot\html5pointsdk file: c:\windows\system32\cmd.exe file: c:\inetpub\wwwroot\html5pointsdk\html5point_converter.exe thanks

c# windows service - not quite the intervals -

private const int intervaltime = 5; protected override void onstart(string[] args) { } public long dosomething() { intervalstopwatch.reset(); intervalstopwatch.start(); facade.execute(); intervalstopwatch.stop(); return intervalstopwatch.elapsedmilliseconds; } hi, i'd create service similar intervals, purpose count execution time of function "dosomething" , if time >= intervaltime recall function, if not ,wait until passes interval time , call function. best practise this? , don't know how that. look quartz.net , seems need

Can't update Google Sheets Add-on -

Image
i've published add-on google sheets google web store. then had fix small bug, i'm having troubles publishing updated version of script. when click "publish" in script editor menu, , "implement google sheets add-on" see following message: it asking me accept terms , conditions of store. after clicking review, i'm redirected https://chrome.google.com/webstore/developer/update?authuser=0 page, asking upload new zip file. is bug or doing wrong? edit: here's short video steps i'm following: video if facing issue updating published add-on, can submit issue in chrome web store support page , provide details.

android - NestedScrollView is not scrolling due to Editext -

i facing issue when have following structure in nestedscrollview . here xml file : <android.support.v4.widget.nestedscrollview android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/app_base_color" app:layout_behavior="@string/appbar_scrolling_view_behavior" android:id="@+id/nested_view_editprofile" android:focusable="true" > <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/app_base_color" android:weightsum="3"> &

javascript - Bootstrap Pagination not working with displayed content -

want make dynamic bootstrap pagination displaying different content on clicking paginations. try this, hope work you <html> <head> <script src="http://code.jquery.com/jquery-latest.min.js"></script> <script type="text/javascript" src="//raw.github.com/botmonster/jquery-bootpag/master/lib/jquery.bootpag.min.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> </head> <body> <div class="main" style="text-align:center;"> <h2 style="text-align:center;">pagination div structur</h2> <div class='blk content4'> <!--// show here ur div structure--> pagination content here. </div> <div class="pagi"></div&

wordpress - How to add order confirmation page after billing address page in Woocommerce? -

the default woocommerce checkout structure this: cart->billing address -> checkout but need order confirmation page after billing address fill correctly. so need this: cart->billind address->confirm order->checkout. i found woocommerce germanized plugin, it's isn't working wel..

windows - PrintWindow and Microsoft Edge -

we have problem printwindow function on windows 10 (build 10166). when call printwindow ( https://msdn.microsoft.com/ru-ru/library/windows/desktop/dd162869(v=vs.85).aspx ) capture image of microsoft edge (project spartan) browser window black image. does know reason of , how fixed/avoided? or maybe other way capture image of window, can in background , hided behind windows? update : we've tried sending wm_printclient , wm_print messages, , calling defwindowproc wm_print, results same - black image. tried use bitblt copy window's dc memory surface, it's not working too. best solution have bringing browser window foreground, capturing entire screen , cropping screenshot window's client size; can interrupt , annoy users because of switching application that's in use. if want take screenshot of page on browser. try javascript library: http://html2canvas.hertzen.com/ script traverses through dom of page loaded on. gathers information on elements there,

Convolutional Neural Networks with Caffe and NEGATIVE or FALSE IMAGES -

when training set of classes (let's #clases (number of classes) = n) on caffe deep learning (or cnn framework) , make query caffemodel, % of probability of image ok. so, let's take picture of similar class 1, , result: 1.- 96% 2.- 4% rest... 0% problem is: when take random picture (for example of environment), keep getting same result, 1 of class predominant (>90% probability) doesn't belong class. so i'd hear opinions/answers people has experienced , have solved how deal no-sense inputs neural network. my purposes are: train 1 more class negative images (like train_cascade). train 1 more class positive images in train set, , negative on val set. purposes don't have scientific base execute them, that's why ask question. what do? thank in advance. rafael. edit: after 2 months, colleague of mine throw me clue: the activation function. i've seen use relu in every layer means value x x when x > 0 , 0 otherwise. t

Excel formula: output values based on matched data -

Image
i have range of dates column a, , number of selected dates column c. logic "if cell of contains same value c, output same row field of b d, starting @ d1 , contining downward." what best syntax accomplish this? i have tried use if(vlookup()) this, don't understand how works. assuming have this a |b |c |d 01/01/2015|hello|01/01/2015| then formula in d should vlookup(c1,a:b,2,false) this means 'find value c1 in column (the first of 2 columns a:b) , give me value second column (b)'. note use of false means looking exact match. you can enter following formula in d1 , drag down far need ... =vlookup(c1,a:b,2,false)

r - How to change output of weekdays from Hebrew to English -

Image
i want extract weekday using weekdays function. but unfortunately results in hebrew. how can change this? i prefer change english. if not possible, prefer convert them numbers. you should change locale desired language/region. for example changing english can done with: sys.setlocale(category = "lc_all", locale = "english_united states.1252")

java - Guice + classpath scanning -

i looking @ guice @ moment , appear geared towards explicit programmatic building of context via modules. now used using annotations put context , using classpath scanning build context. now add "feature" guice, i'd rather not reinvent wheel, if knows if there extension - please say. however, question is, breaking desired use , design of guice doing this...have missed point of how/why guice meant used in enterprise application? guice has pretty smart jit binding makes unnecessary scan-per type (concrete types example) in situations if there not actual binding required (e.g. interface-to-implementation, etc.). i find package-scanning components in spring mess. fact have explicitly filter out don't want, , 'sub-packages' (which mean nothing in language) scanned default, no simple way package types in (without ugly filter code , reflection) extremely fragile , error-prone. guice's approach far more elegant (convention of module per packa

lua - Wrong constructor is called when two classes of the same name are in different files -

i'm new lua. co-worker asked me work code while he's on leave. i'm having problem couldn't find answer (or couldn't query right). i have 2 lua scripts classes imitating types in our c program. file , b both contain identical class typea: type1 = { new = function(self,num) local o = { _data_num = {}, _data = {}, _size = {}, } o._data_num = num i=1, num o._data[i] = type2:new() end o._size = o._data[1]:getsize() setmetatable(o,self) return o end, <some other functions> also both files contain class type2 bearing same name different code. both of them marked required in file c. script crashed when instantiating type1 in file c because constructor wrong type2 called in process (from b instead of a). can please offer me workaround? putting files in different folders doesn't work.

ssl - How to handle renegotiation in openssl (returned by SSL_read, SSL_write) -

i'm using openssl library on linux platform. according man page: renegotiation happen during ssl_read/write, user should repeat call same arguments . here scenario, right or wrong? 1: ssl_read returns ssl_want_write, call ssl_write write data (hoping ssl_write can finish handshake left ssl_read ) 2: ssl_read(ssl, buf, size) returns ssl_want_write, call ssl_read(ssl, buf2, size2) (the buf arguments have been changed) best regards

git - browse through branch refs making use '/' (forward slash) grouping -

i have 2 parts o following question. general : including / (forward slash) within name of branch puts head of branch within directory specified path interpreted using / . e.g. head of branch named category-1/ref-1 wil named ref-1 , stored in ./.git/refs/heads/category-1/ ref-1 . i refer sort of 'branch directory' branch pseudo folder (bpf) part 1 - i have dos dir command or linux ls command listing refs in particular bpf. part 2 - for such command, configure tab-completion work works when typing normal system paths. also, configure similar tab configuration other functions require ref names e.g. git checkout e.g - assume command named git branch-ls . also. assume following 4 branch heads exist. cooling/ac cooling/fridge heating/heater heating/microwave now, following behavior. git branch-ls hea[tab] should complete git branch-ls heating/ , further tab should complete complete ref name. note unlike working of branch name completion in

Integrating UITabBarController with slide menu in iOS Objective-c -

i want create slide menu (left side). using uitabbarcontroller rootviewcontroller . please suggest how implement this. i found neat solution nib , i'm using own project. may check out: https://maniacdev.com/2013/08/open-source-component-for-making-a-nice-ios-7-control-center-style-animated-side-bar-menu

c++ - const or ref or const ref or value as an argument of setter function -

constantness class myclass { // ... private: std::string m_parameter; // ... } pass-by-value: void myclass::setparameter(std::string parameter) { m_parameter = parameter; } pass-by-ref: void myclass::setparameter(std::string& parameter) { m_parameter = parameter; } pass-by-const-ref: void myclass::setparameter(const std::string& parameter) { m_parameter = parameter; } pass-by-const-value: void myclass::setparameter(const std::string parameter) { m_parameter = parameter; } pass-by-universal-ref: void myclass::setparameter(std::string&& parameter) { m_parameter = parameter; } pass-by-const-universal-ref: void myclass::setparameter(const std::string&& parameter) { m_parameter = parameter; } which variant best (possibly in terms of c++11 , move semantics)? ps. may bodies of functions in cases incorrect. pass value: not in general value copy might taken. (although move constructor might mitiga

c# - page load on validate user -

i want ask how load page using validate user using request string. have code below: protected void page_load(object sender, eventargs e) { string validateuser = request.querystring["inisial"]; if (validateuser != null) { response.redirect("home.aspx"); } string x = request.querystring["ind"]; if (validateuser != null) { response.redirect("home.aspx"); } } protected void validateuser(object sender, eventargs e) { int userid = 0; string constr = configurationmanager.connectionstrings["dbconn"].connectionstring; using (sqlconnection con = new sqlconnection(constr)) { using (sqlcommand cmd = new sqlcommand("validate_user")) { cmd.commandtype = commandtype.storedprocedure; cmd.parameters.addwithvalue("@username", request.querystring["inisial"]); cmd.parameters.addwithvalue("@password",

Can I initialise a value in a parameterised constructor in C++ -

i have program in giving error. not able undertsand reason. please elaborate #include<iostream> using namespace std; class room { int length; int width; public: room() { length=0; width=0; } room(int value=8) { length=width=8; } void display() { cout<<length<<' '<<width; } }; main() { room objroom1; objroom1.display(); } the error call of overloaded function room() ambiguous. the call of constructor in declaration room objroom1; is indeed ambiguous because your class has 2 default constructors . according c++ standard (12.1 constructors) 4 default constructor class x constructor of class x can called without argument. so constructor room() { length=0; width=0; } is default constructor. , constructor room(int value=8) { length=width=8; } also default constructor because can called without argument. moreover there lo

Prevent row click event in YUI Datatable -

i have yui data table. when click on row of data table, there alert box. vtgttbl.on('rowclickevent',function(oargs){ alert("a"); } i have checkbox. want when checkbox true row click work, , not when false. there method in yui attach , detach these events within rowclick event handler callback can add check checkbox in following way vtgttbl.on('rowclickevent',function(oargs){ var checkboxnode = y.one('#checkboxid'); if (checkboxnode.checked) { alert("a"); } } hope solves problem.

mysql (innodb) increment a value to create a hole -

say have simple tree type table id(key) | parent | order ============================ 1 | 0 | 0 2 | 0 | 1 4 | 2 | 0 5 | 2 | 1 6 | 2 | 2 i want insert new node has parent = 2 , order = 1 , table data looks like: id(key) | parent | order ============================ 1 | 0 | 0 2 | 0 | 1 4 | 2 | 0 5 | 2 | 2 6 | 2 | 3 7 | 2 | 1 e.g. existing rows increment order value. what's best way ensure existing rows increment order (non-key field) starting @ existing arbitrary value, make hole insert statement? if have new row parent $p , order position $o can: update table set order = order + 1 parent = $p , order >= $o and then: insert order (id,parent,order) values($id,$p,$o)