Posts

Showing posts from March, 2014

java - Multiple parameters for a single method -

i don't know how simple or if possible can't seem find information on it. method there way set multiple parameters. for example in public void required call component , and string when call method in java file. public void testmethod(component c, string s) { //do } is there way public void testmethod(component c, string d) or public void testmethod(component c, int i) , when method called either specified? it's called method overloading. create them separate methods , compiler (usually) infer right 1 based on input values.

dotcmis - SessionFactory not found -

i'm starting using cmis. i'm trying first sample apache site work ( https://chemistry.apache.org/dotnet/getting-started-with-dotcmis.html ) compiler not accept sessionfactory. doing wrong? using system; using system.collections.generic; using system.linq; using dotcmis; using dotcmis.client; namespace cmis_testandexplore { class program { static void main(string[] args) { dictionary<string, string> parameters = new dictionary<string, string>(); parameters[sessionparameter.bindingtype] = bindingtype.atompub; parameters[sessionparameter.atompuburl] = "http://<http://localhost:8081/inmemory/atom"; parameters[sessionparameter.user] = "test"; parameters[sessionparameter.password] = ""; sessionfactory factory = sessionfactory.newinstance(); isession session = factory.getrepositories(parameters)[0].createsession(); } } } it turns out missing using state

c - The variable 'buff' is being used without being defined -

i need read data text file , store in 2d-array. code works good: #include <string.h> #include <stdio.h> int main() { file *f = fopen("read.txt", "r"); char buff[100][100]; char str[100]; int = 0; while(fgets(str, 100, f)) { strcpy(buff[i], str); i++; } return 0; } but why doesn't work when try change buff definition in line 5 to: char (*buff)[100]; i expected definition work too. error get: run-time check failure #3 - variable 'buff' being used without being defined char (*buff)[100]; here buff pointer array of 100 characters. first should make pointer point valid memory location before storing value in it. presuming want go dynamic memory allocation can have char *buff[100]; now in fgets() loop allocate memory each pointer individually like buff[i] = malloc(100); note here buff array of 100 char pointers.

css3 - CSS overflow-y:scroll; missing something -

i have 1 problem css overflow-y:scroll; i have created demo codepen.io in demo can see there left sidebar. , inside have 11 .layer div . if scrolling down left sidebar can see 9 layer other 2 layers staying inside. what problem in css. need fixed ? css .container { -webkit-animation: cardenter 0.75s ease-in-out 0.5s; animation: cardenter 0.75s ease-in-out 0.5s; -webkit-animation-fill-mode: both; animation-fill-mode: both; display: block; position: absolute; height: auto; bottom: 0; top: 0; left: 0; right: 0; max-width: 980px; min-width: 300px; margin-top: 75px; margin-bottom: 20px; margin-right: auto; margin-left: auto; background-color: #ffffff; box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .06), 0 2px 5px 0 rgba(0, 0, 0, .2); -webkit-box-shadow: rgba(0, 0, 0, 0.0588235) 0px 1px 1px 0px, rgba(0, 0, 0, 0.2) 0px 2px 5px 0px; border-radius: 3px; -webkit-border-radius: 3px; -o-border-radius: 3px; -moz-border-radius: 3px; min-heigh

spring - Proxy and Concrete Class in Java -

consider junit code xxximpl xxximpl=(xxximpl) new classpathxmlapplicationcontext(context).getbean("xxxx"); it throws exception: java.lang.classcastexception: $proxy42 incompatible com.zzz.yyy.xxximpl when classpathxmlapplicationcontext(context)getbean("xxx").getclass() gives $proxy 42. i have similar setup in application getclass returns concrete class "xxx" instead of $proxy 42. when searched error, mentioned classloaders. looked @ class path not find issue. can guide why 2 applications similar setup - 1 returns proxy , other returns concrete class.

if statement - Python Pandas Dataframe Conditional If, Elif, Else -

in python pandas dataframe , i'm trying apply specific label row if 'search terms' column contains possible strings joined, pipe-delimited list. how can conditional if, elif, else statements pandas? for example: df = pd.dataframe({'search term': pd.series(['awesomebrand inc', 'guy boots', 'ectoplasm'])}) brand_terms = ['awesomebrand', 'awesome brand'] footwear_terms = ['shoes', 'boots', 'sandals'] #note: not work if df['search term'].str.contains('|'.join(brand_terms)): df['label'] = 'brand' elif df['search term'].str.contains('|'.join(footwear_terms)): df['label'] = 'footwear' else: df['label'] = '--' example desired output: search term label awesomebrand inc brand guy boots footwear ectoplasm -- i've tried appending .any() ends of contains() statements applie

oauth 2.0 - Google Voice via OAuth2.0 -

my goal retrieve google voice voicemail audio messages , download them. on may 27, 2015 - google permanently disabled clientlogin api google voice , encouraged migration oauth2.0. i created project in google developers console, unable identify api should used. not alone ( google voice php oauth 2.0 ). it seems unlikely me google permanently disable google voice clientlogin api without having working solution available - since deprecated gv clientlogin api more 2 years ago , left available use long afterwards. after further research, discovered gmail api permits downloading of attachments. theoretically, if set google voice forward voicemails gmail, download audio file using gmail api (gmail.users.messages.attachments.get). note: not work! worry may not because when click on play message in gmail, forwards google voice page - can choose download message. seems approach may result in needing google voice api well. how supposed retrieve google voice voicemail au

Autofac + OWIN + Web Api ASP.NET MVC constructor injection not working -

i have webapicontroller no default constructor , after infoke receive error: <error><message>an error has occurred.</message><exceptionmessage>an error occurred when trying create controller of type 'lookupscontroller'. make sure controller has parameterless public constructor.</exceptionmessage><exceptiontype>system.invalidoperationexception</exceptiontype><stacktrace> en system.web.http.dispatcher.defaulthttpcontrolleractivator.create(httprequestmessage request, httpcontrollerdescriptor controllerdescriptor, type controllertype) en system.web.http.controllers.httpcontrollerdescriptor.createcontroller(httprequestmessage request) en system.web.http.dispatcher.httpcontrollerdispatcher.<sendasync>d__1.movenext()</stacktrace><innerexception><message>an error has occurred.</message><exceptionmessage>el tipo 'ta.webapp.mvcapp.controllers.lookupscontroller' no tiene un constr

database - GDBM vs a simple JSON, INI or YAML configuration file -

i studying file based key-value databases such gdbm , can not see real advantage versus using configuration file. both technologies let store in file keys , values. is advantage of gdbm performance, gdbm parse file faster? gdbm doesn't parse file, permanent storage key value pairs. storage on disc can larger memory (although indices have fit). if start yaml, jsoon or ini files, first have parse material , has fit in memory.

xslt - What does it means vpf in a XML to create a scenario for SAP B1if? -

i creating scenario in b1if, , have doubts referred vpf word. example, code below using command <xsl:copy-of select="vpf:msg/@*"/> copy data, word vpf makes reference? also, use <payload role="r" , use vpf:payload[@role='s']/ , why "r" , other times "s"? <xsl:template match="/bfa:unbranch"> <msg xmlns="urn:com.sap.b1i.vplatform:entity"> <xsl:copy-of select="vpf:msg/@*"/> <xsl:copy-of select="vpf:msg/vpf:header"/> <body> <xsl:copy-of select="vpf:msg/vpf:body/*"/> <payload role="r" id="{$atom}"> <xsl:call-template name="transform"/> </payload> </body> </msg> </xsl:template> <xsl:copy-of

vb.net - Make specific randomly generated codes with timer -

i make randomly generated codes when timer finished. but use code abcdefghijklomnopqrstuvwxyz0123456789 on format xxxx-xxxx-xxxx (replace x randomly generated number/letter) and insert code in this private sub timer1_tick(sender object, e eventargs) handles timer1.tick progressbar1.increment(3) if progressbar1.value = 100 textbox1.text = "replace textbox code" timer1.stop() end if end sub here's solution using linq. private sub timer1_tick(sender object, e eventargs) handles timer1.tick progressbar1.increment(3) if progressbar1.value = 100 dim chars = "abcdefghijklmnopqrstuvwxyz0123456789" dim random = new random() dim num1 = new string(enumerable.repeat(chars, 4).select(function(s) s(random.next(s.length))).toarray()) dim num2 = new string(enumerable.repeat(chars, 4).select(function(s) s(random.next(s.length))).toarray()) dim num3 = new string(enumerable.repeat(c

css - HTML - Sidebar not filling 100% of screen -

Image
i have sidebar taking enough space content contains rather taking 100% of wrapper contains elements, image below should across mean: here of code i'm working with: html <body> <div id="wrapper"> <div id="top"> ... </div> <div id="topnav"> <... </div> <div id="banner"> <img id="img" src="images/2for20.png" alt="banner1" /> </div> <div id="subbanner"> ... </div> <div id="content"> ... </div> <div id="rightside"> <p>this sidebar</p> </div> <div id="footer"> <p>© copyright 2015 celtic ore, rights reserved</p> </div> </div&g

javascript - Create variable from imported HTML's ID and children using jQuery ajax -

i able html webpage using jquery code: $(document).ready(function() { baseurl = "http://www.somewebsite.com/"; $.ajax({ url: baseurl, type: "get", datatype: "html", success: function(data) { // create variable here } }); }); i want create variable includes text second anchor in returned html ajax request: <div id="wrapper"> <ul> <li> <a></a> <a>i want data anchor</a> </li> </ul> </div> quite frankly, don't know start, unfamiliar jquery. can point me in right direction?

java - Abstract class and methods, Why? -

hope can help, learning java , comparable else in forum guess newbie programming well. i have come across chapter on abstract class , methods don't understand used , why, , thought explanation experienced programmer. below have example code have been working on, book, not sure why in class dims have have abstract double area() when each sub class uses area method anyway, or calling area method super class, why have have methods override? // using abstract methods , classes package training2; abstract class dims { double dim1; double dim2; dims(double a, double b) { dim1 = a; dim2 = b; } // area abstract method abstract double area(); } class rectangles extends dims { rectangles(double a, double b) { super(a, b); } // override area rectangles double area() { system.out.println("inside area rectangle."); return dim1 * dim2; } } class triangles extends dims { tri

android - Error import module Facebook 4.2.0 -

i have error when import facebook-sdk-4.2.0 d:\document\android\funnyphoto\facebook\build.gradle (16, 0) not find property 'android_build_sdk_version' on project '-facebook'- and have code in here apply plugin: 'com.android.library' repositories { mavencentral() } project.group = 'com.facebook.android' dependencies { compile 'com.android.support:support-v4:[22,23)' compile 'com.parse.bolts:bolts-android:1.2.0' compile 'com.facebook.android:facebook-android-sdk:4.2.0' } android { compilesdkversion integer.parseint(project.android_build_sdk_version) buildtoolsversion project.android_build_tools_version defaultconfig { minsdkversion integer.parseint(project.android_build_min_sdk_version) targetsdkversion integer.parseint(project.android_build_target_sdk_version) } lintoptions { abortonerror false } sourcesets { main {

command prompt - Invalidate match in batch file for loop -

i have following directory structure: >c >somefile >.ignoreme >vitalsysteminfo.eiafj >donttouchthis.ei3rw3j >picture.jpg >pandas.gif >code.cpp >anotherdirectory >morestuff.bacon and have loop go through it for /r %f in (c:\somefile) echo %f how can exclude .ignoreme ? you appear little confused syntax of for /r . should be for /r "folder" %f in (filemask) echo %f you should double-pump percent signs if you're putting in .bat script. anyway, if you're doing echo ing results, easiest way exclude ".ignoreme" pipe output find /v ".ignoreme" . for /r "c:\somefile" %%f in (*) echo %%f | find /v /i ".ignoreme" on other hand, if use of echo merely demonstration not production, can accomplish same effect for /f loop executing dir /s /b . for /f "delims=" %%f in ('dir /s /b &qu

javascript - How to call this function from the other function? -

i have search form idea when user wants search , press enter, pointing search page want. html <div class="search"> <form method="post" action="" onsubmit="return do_search();"> <input type="text" value="nhập từ khóa tìm kiếm" onfocus="if (this.value == 'nhập từ khóa tìm kiếm') this.value = ''" onblur="if (this.value == '')this.value = 'từ khóa'" id="searchinput" name="query" onkeydown="enterkey(event);"/> <input type="submit" value="" /> </form> </div><!-- end #search --> js function enterkey(a) { if(13 == (window.event ? window.event.keycode : a.which)){ var temp = document.getelementbyid("searchinput").value; alert(&

jquery - "[object Object]" showing in input field with bootstrap3-typeahead and tagsinput -

Image
when tag selected, tag added correctly text [object object] appended in input box. (see below image) i using bootstrap 3, jquery, bootstrap3-typeahead, , bootstrap-tagsinput (all recent versions) the form in modal window. here code: jquery('#banner_geo_locations').tagsinput({ itemvalue: 'value', itemtext: 'text', typeahead: { displaykey: 'text', source: function (query) { return jquery.get("http://dev.marijuanaweeklycoupons.com/?action=ajax|citystatessearchtags&pagespeed=off&q=" + query); } } }); ajax looks like: [{"value":"2908762","text":"dixon corner, al"}, {"value":"2956030","text":"dixon corner, me"}, {"value":"3008251","text":"dixon corner, pa"}, {"value":"2931983","text":"dixon crossroads, ga"}, {"v

C - deleting n-ary tree nodes -

i have implemented in c m,n,k-game ai. game works fine when have free decision tree throws "access violation reading location" exception. implementation of decision tree structure: typedef struct decision_tree_s { unsigned short **board; status_t status; struct decision_tree_s *brother; struct decision_tree_s *children; } decision_tree_t; , implementation of delete_tree function: void delete_tree(decision_tree_t **tree) { decision_tree_t *tmp; if (*tree != null) { delete_tree((*tree)->children); delete_tree((*tree)->brother); free(*tree); *tree = null; } } you destroying twice children member: first time in for loop, second time after loop. you might want write loop that: for (tmp = tree->brother; tmp != null; tmp = tmp->brother) { delete_tree(tmp); }

php - Have to reload page for if statement to be parsed -

first: code! loginform.html <form action="" method="post" id="loginform"> <h3>login</h3> <input type="text" name="username" placeholder="username"> <br> <br> <input type="password" name="password" placeholder="password"> <br> <input type="submit" name="logsubmit" value="login" class="registerbutton"> </form> login.php <?php require_once("../resources/config.php"); require_once("../resources/library/dbconnect.php"); function checkuser($con) { if (isset($_post['username']) && isset($_post['password'])){ $username = $_post['username']; $pw = md5($_post['password']); $sq

geolocation - Using geo-coordinates as vertex coordinates in the igraph r-package -

Image
in igraph package r, struggling plot social network using latitude/longitude coordinates layout of graph. imagine simple example: network 4 nodes of know geographical location , connections: df<-data.frame("from" = c("bob", "klaus", "edith", "liu"), "to"= c("edith", "edith", "bob", "klaus")) here have meta-data nodes, bob lives in ny, klaus in berlin, edith in paris , liu in bejing: meta <- data.frame("name"=c("bob", "klaus", "edith", "liu"), "lon"=c(-74.00714, 13.37699, 2.34120, 116.40708), "lat"=c(40.71455, 52.51607, 48.85693, 39.90469)) we make g igraph object... g <- graph.data.frame(df, directed=t, vertices=meta) ...and define our layout longitude/latitude coordinates lo <- layout.norm(as.matrix(meta[,2:3])) plot.igraph(g, layout=lo) if run example these (real) geo-coordinates, y

postgresql - Rails find_by_sql not returning results -

so query running returning array id , nothing else. when run same query in psql returns correct records. idea why be, or if there may better way of executing query? rails console numbers = robodial.find_by_sql "select p.id, p.nam_last, w.warn_closed_date, w.warn_date_issued, pn.phone_number, w.collection_amount people p left outer join warrants w on p.id = w.person_id left outer join pn on p.id = pn.person_id p.id = 81437" returns not correct [#<robodial id: 81437>, #<robodial id: 81437>] am doing wrong here? when run same query in psql session returns correct values. correct values include below p.id, p.nam_last, w.warn_closed_date, w.warn_date_issued, pn.phone_number, w.collection_amount

How do char and int work in C++ -

may i'm going ask stupid question, want confirm how char works? let me explain examples want ask. let suppose declare char variable , input 6 or integer character. #include <iostream> using namespace std; int main(){ char a; cin >> a; cout << a*a; // know here input's ascii value multiply return 0; } same integer input 6 #include <iostream> using namespace std; int main(){ int a; cin >> a; cout << a*a; // why compiler not take input's ascii value here? return 0; } i think question clear. char fundamental data type, of size 1 byte (not 8bits!!!), capable of representing @ least ascii code range of characters. so, example, char x = 'a'; stores ascii value of 'a' , in case 97. however, ostream operators overloaded "know" how deal char , , instead of blindly displaying 97 in line cout << x; display ascii representation of character, i.e. 'a' .

java - How to get Android Device Density Unit -

i want click on point(x,y) on android device. figured out need density unit of device equilibrate point according different devices. i wonder how can ths density unit use in code. use density device getresources().getdisplaymetrics().density;

javascript - Need to update UI when a checkbox is changed -

i have situation have bootstrap 3 based page has checkbox on it: <input type="checkbox" value="y" id=useractive checked> before display form want set correct state based on value of field in database so: if (ra.active=='y') { $("#useractive").prop("checked",true); } else { $("#useractive").prop("checked",false); } the problem ui display of form checked (as if true). value of initial state. if remove checked parameter html checkbox ui display represent uncheck regardless of value. the actual dom element checked or unchecked correctly (which can verify posting form). ui not being displayed correctly. there nothing wrong code, here working describe. perhaps have other code interfering or special css styling on checkboxes? //some setup mimic code var ra = { active: 'n' }; if (ra.active == &#

sql - Compress rows with common id's to one row -

this question has answer here: collapse / concatenate / aggregate column single comma separated string within each group 2 answers i have question have not found answer for. there similar questions solutions don't quite work in situation. have data set has 4 columns example: name session sequence page bob 001 001 home bob 001 002 news bob 001 003 contact_us bob 001 004 home sally 001 001 home sally 001 002 contact_us bob 002 001 home john 001 001 home john 001 002 about_us what this name session pages bob 001 home-news-contact_us-home sally 001 home-contact_us bob 002 home john 001 home-about-us now trick sequence can 1:44, or anywhere in between. coding in r , have sql

android - Errors on MvxBind and MvxItemTemplate with a custom control that inherits from MvxListView -

i bind error during loading of view, app keeps running no visuals in listview. i following error on mvxbind: (and same on mvxitemtemplate) mvxbind: 9.11 problem seen during binding execution binding itemssource isolationcertificate.isolationpoints - problem targetinvocationexception: exception has been thrown target of invocation. this happens on custom control manualy want add headerview , control later on. therefore needed following construction; public class mvxpaddedlistview : mvxlistview { public view padder; public mvxpaddedlistview(context context, iattributeset attrs) : base(context, attrs, null) { setflexibleheader(context); var itemtemplateid = mvxattributehelpers.readlistitemtemplateid(context, attrs); adapter = new mvxadapter(context) { itemtemplateid = itemtemplateid }; } protected mvxpaddedlistview(intptr javareference, jnihandleownership transfer) : base(javareference, transfer) {

sql server - a select statement that assigns a value to a variable must not be combined with data-retrieval -

for example had 1 variale @rev data retieval shown in query "select distinct @accno,illness_id,desc_id,'lab',labname,lr.result,'positive','false',@sex @rev =case when datediff(day,@admitdate,lr.labdatetime)<0 1 else datediff(day,@admitdate,lr.labdatetime) end i wanna use variable in same select query clause as l.labdatetime between @admitdate , dateadd(hh,24*@ rev ,@admitdate) can var value there ..? this error occurs when assigning column values select statement local variables not columns assigned corresponding local variable. may can try way select @rev=case when datediff(day,@admitdate,lr.labdatetime)<0 1 else datediff(day,@admitdate,lr.labdatetime) end select distinct @accno,illness_id,desc_id,'lab',labname,lr.result,'positive','false',@sex,@rev

regex - Regular expression for path validation? -

i have path , need write regular expression filter path common-io library. the path should not contain: req/com/res , res/com/req , req/al/res , res/al/req , _svn and path should end .xml . fileutils.listfiles(afile, new regexfilefilter("^(.*?)"), truefilefilter.instance) if this, returns xmls. i don't have idea regex; please give idea how this? you can use following regex: ^(?i)(?!.*(?:re[qs]/(?:com|al)/re[sq]|_svn)).*\\.xml$ see demo the (?i) pattern makes case-insensitive. remove if want make search case-sensitive. (?!.*(?:re[qs]/(?:com|al)/re[sq]|_svn)) pattern makes sure not allow of forbidden strings inside path. if want account whole words, add \b : ^(?i)(?!.*\\b(?:re[qs]/(?:com|al)/re[sq]|_svn)\\b).*\\.xml$ see another demo note in java-style regex not need escape / , have double-escape special characters.

javascript - Text box changes accordion display -

i'm new web development , i'm attempting change accordion active when text entered within textbox. i'm trying make content within accordion required when text entered. here have far: //when text box edited $("#hardware").on("keyup", function () { if ($(this).val().length > 0) { //also needing fields become required here? //displaying accordion $("#accordion").accordion({ active: true }); //displaying accordion } else { $("#accordion").accordion({ active: false }); } }); //functionality of accordian $(function () { $("#accordion").accordion({ active: false, collapsible: true, autoheight: false, navigation: true }); }); hardware needed: <br />&nbsp; <textarea name="hardware" cols="70" rows="5" maxlength=&q

.net - Windows server service bus 1.1 in server explorer Connection string error -

i installed service bus in windows server 2012, using service bus power shell. after while trying connect via vs2012, throwing error " underlying connection closed.cannot establish trust relationship ssl/tls secure channel". trying connect in same server on service bus installed.. please help!!!!

php - Display table data if -

im not sure if you'll i'm asking, i'll try specific , clear possible. have php code : $result = mysql_query("select * batai svarbumas=1 order id"); while ($row = mysql_fetch_array($result)) { extract($row); $link=$row["linkas"]; echo "<div class='col-md-4'>"; list($width, $height) = getimagesize($link); if($width > $height) { echo "<img src="$link" style='height:234px;margin-left:-33%'>"; } else if($width < $height) { echo "<img src="$link" style='width:234px;margin-top:-33%>"; } echo "</div>"; } what want do, center given image database div, example, if given images width bigger height, echos left margin. problem is, page displays 2 of elements. one, height bigger width , one, width bigger height. if don't type ifs , echo image, every image database gets display. hope understan

perl - Generic ways to invoke syscalls from the shell -

i call truncate(const char *path, off_t length) (see man 2 truncate ) directly command line or in shell script. i guess embed c program , compile, run, , remove it. another short alternative using perl -e "truncate($file,$length)" . questions: is perl -e "syscall(params...)" common pattern invoke syscalls? how cover other syscalls? is there common way invoke linux/bsd syscalls shell? instance, using command syscall "truncate($file,$length)" ? thank comments , suggestions. conclude following answers questions: some scripting languages, e.g., perl , may provide functions resemble or wrap of useful syscalls, i.e., make sense calling shell. however, there no 1:1 mapping of scripting apis , syscalls , no "common pattern" or tool invoke many different types of syscalls shell. moreover, generic solution specific problem should not focus on syscalls in first place, rather use generic language or library beginning. instance

javascript - List of checkboxes checked for specific classes -

i list of names of checkboxes checked in specific div (page-wrap). creating filter of sorts , have treeview of different types color, quality, grain, etc... each has own class assigned them. color has class of color_cb, quality product_cb, grain grain_cb. following code works great 1 of them i'd test 3. there way modify 3. var selected = []; $('#page-wrap input:checkbox.color_cb:checked').each(function() { selected.push($(this).attr('name')); }); alert(selected.join(",")); i've tried doesn't work. var selected = []; $('#page-wrap input:checkbox.color_cb:checked input:checkbox.product_cb:checked').each(function() { selected.push($(this).attr('name')); }); alert(selected.join(",")); use comma separator b/w selected element $('#page-wrap input:checkbox.color_cb:checked ,#page-wrap input:checkbox.product_cb:checked')

Get json data from a htttp based web service C# -

i can't recieve json data http web service, because of data size - guess - 7 mb, first tried : private async task<string> getresponse(string url) { httpresponsemessage response = null; httpclient client = new httpclient(); try { response = await client.getasync(url); } catch (exception ) { throw; } return await response.content.readasstringasync(); } but gives me "task canceled exception", after doing search , found might request timeout limit probleme, implemented second solution setting timeout limit 2 minutes : httpclient client = new httpclient(); client.timeout = new timespan(0, 2, 0); when executing, there no result, no exception , app blocks @ method client.getasync(url);

selenium - Developers tool(F12) is opening in Internet Explorer when it is launched by watir-webdriver -

i automating web application on internet explorer using watir-webdriver , ruby. when run script in laptop[win7(x64) , ie11] running without opening developers tool in internet explorer. when test same script in virtual machine[win8(x64) , ie10], intenet exploerer browser opening developer tool. has idea, why happening? i'm using below code launch browser: selenium::webdriver::remote::capabilities.ie(:ignoreprotectedmodesettings => true) browser = watir::browser.new :ie when opening internet explorer, developer toolbar state same when ie last closed. in other words, developer toolbar open if (the toolbar) open when ie last closed. try: log virtual machine manually open internet explorer, automatically have developer toolbar open close developer toolbar close browser the next time ie started, whether manually or via webdriver, toolbar should closed.

php - Inserting an array into a relational table -

i have 3 tables: user_login doc_list user_cat_link_table so creating new user , apart of form shows array of available categories pulled cat_list table. i struggling along other form data update user_cat_link_table. the script take id of new user , take id of category selected checkboxes array: here input form: <form action="actions/add_emp.php" method="post"> <input type="text" name="user" placeholder="username" required="required" /><br/> <input type="text" name="pass" type="password" placeholder="password"/></label><br/> <input type="text" name="firstname" id="name" required="required" placeholder="firstname"/><br /> <input type="text" name="lastname" id="email" required="required&quo

ant - OutOfMemoryError:Java Heap space in liquibase when running a large SQL file -

i using ant task updating database. ant task is <target name="updatedb"> <updatedatabase changelogfile="${prj.db.changelog.file}" driver="${prj.db.driver}" url="${prj.db.url}" username="${prj.db.username}" password="${prj.db.password}" classpathref="db.liquibase.classpath"> </updatedatabase> </target> i have changeset runs sql file as <changeset author="test" id="20150603"> <sqlfile path="data.sql" stripcomments="true" relativetochangelogfile="true"/> </changeset> when run ant task, receiving java.lang.outofmemoryerror: java heap space that's because sql file has large size. want give heap space through ant task. changes required made? please suggest. dont want use set jav

php - Zend 2 Authentication Service Session for multiple sub domains -

i have 2 sub-domains , trying authenticate user via either sub-domains. scenario: sub domains: abc.example.com, xyz.example.com user can login (login form) either of 2 domains. authentication done abc.example.com (ie. request sent abc.example.com only). when user submits form xyz, request sent abc , authentication done. upon successful login, page redirected xyz. now xyz creates session on xyz , ok abc can't seems find created session during authentication. any appreciated. you can using 2 authentication storage, 1 each subdomain create 2 authentication storage , 1 authentication service in module.config way public function getserviceconfig() { $subdomainabc = "abc.example.com"; $subdomainxyz = "xyz.example.com"; $address = ''; // correct address here $authenticationservice = function($sm){ // declare , return authentication service here }; if($address === $subdomainabc) { return array

ios - Displaying random questions by looping through a dictionary -

i started learn swift trying make quiz game. i'm stuck @ trying display random questions dictionary. reason why use dictionary because quiz i'm working on based on chemistry elements has different symbols. so based on selected difficulty created 4 different dictionaries: //defining dictionaries per difficulty var easy: [string: string] = [ "h": "waterstof", "he": "helium", "li": "lithium", "b": "boor", "c": "koolstof", "o": "zuurstof", "ne": "neon", "al": "aliminium", "si": "silicium", "k": "kalium", "fe": "ijzer", "ni": "nikkel", "zn": "zink", "cd": "cadmium", "i": "jood" ] var normal: [string: string] = [ "

Java Loops - Break? Continue? -

i've read through bunch of threads on using break , continue , suspect problem isn't use of those, layout of loops. in following code, trying iterate through chars in string input user find - symbols. if found, throw error user negative number found , exit. otherwise, if not find - symbol, should print out of chars in string. i used break @ end of first loop find - symbol, not continuing on next loop. tried continue didn't work. loops new me may have wrong, know first loop working ok , throw error when finds - in string. strnum1 = joptionpane.showinputdialog ("enter number string"); (int = 0; < strnum1.length(); i++) { char c = strnum1.charat(i); if (c == '-') { system.out.println("negative digit found - exiting"); break; } } (int = 0; < strnum1.length(); i++) { char c = strnum1.charat(i); if (c <= 9) { system.out.println(c); } } the break statement breaks first loop. in order skip runni

php - Limit select options -

the other day when out friends of sudden hit me use inspect element , change name of option in select tag whatever want, stored in database (still unsure on why thinking of this, glad did!) this select tag: <form name="submit" method="post" action="select.php" validate> <select class="form-control" name="genre" id="genre" required> <option value="" selected="selected">select genre</option> <option value="autos , vehicles">autos , vehicles</option> <option value="comedy">comedy</option> <option value="education">education</option> <option value="entertainment">entertainment</option> <option value="film & animation">film & animation</option> <option value="gaming">gaming&l

angularjs - How to listen to socket emit on sails.io.js? -

i'm using sails 0.11 in back-end, , angularjs in front-end. i have twittercontroller in sails following code, open stream twitter streaming api (this uses node module twit ): var twit = require('twit'); var t = new twit(sails.config.twit); var stream = t.stream('statuses/filter', { track: ['apple'] }); module.exports = { open: function(req, res) { if (!req.issocket) { return res.badrequest(); } var socketid = sails.sockets.id(req.socket); stream.start(); stream.on('tweet', function(tweet) { sails.log.debug('tweet received.'); sails.sockets.emit(socketid, 'tweet', tweet); }); } }; in front-end (with angular-sails module): $sails.get('/twitter/open').then(function(resp) { console.log(resp.status); }, function(resp) { alert('houston, got problem!'); }); this of course reaches back-end controller, , s

swift - Pass scope to a named function, rather than a closure -

i separate data processing of nsurlsession separate method. when making url request, rely on enclosing scope provide me user's callback . this works: static func makerequest(url: string, callback: apicallback) { let urlobject = nsurl(string: url) var request = createrequest(urlobject!, method: "get") // internal var session = nsurlsession.sharedsession() var task = session.datataskwithrequest(request){ (data, response, error) -> void in // basic parsing, error checking, then... callback(data, nil) } task.resume() } there's rather lot of basic parsing , error checking i'd @ application level, however, want define , pass function instead of closure datataskwithrequest method: static func makerequest(url: string, callback: apicallback) { let urlobject = nsurl(string: url) var request = createrequest(urlobject!, method: "get") // internal var session = nsurlsession.sharedsession() var task = session.datat

SAS Macro for multiple datasets -

i new sas. have 12(monthly data) data sets in folder. names of data sets are: 201401 201402 201403 ... 201411 201412 each data contain 10 variables. variable names same data. want 3 variables among 10 , rename data new_201401 , on. i trying manually using keep var1 var2 var3; there easy way or macro can make fast? in advance. i think trick: %macro keep(table,var1,var2,var3,set); data &table (keep=&var1 &var2 &var3); set &set; run; %mend keep;

py2exe Python 3.4, what dll -

i'm trying create exe python script. i've read instractions on py2exe site, , exe works on pc, tells me "msvcr100.dll missing". now i'm confused, on site tell me use msvcp90.dll exe wants msvcr100.dll. another thing, include 'dist' folder, or point setup.py location dll located? i'm using python 3.4 starting python 3.3, windows build of python built using visual studio 2010. need use msvcr100.dll python 3.3 or 3.4. see this tutorial step specifying correct library. replace *90.dll *100.dll . note starting python 3.5, visual studio 2015 being used, introduces new way of distributing crt, won’t need msvcr140.dll else instead. it’s py2exe take while become compatible.

Throwing an Error Message in Excel through comparative list Data Validation -

i have 2 sets of data 'list' data validated , referenced different 'named ranges' in other worksheets in same workbook. of entries in first list appear in second list. there way check if value entered in each list in same row same , throw error message state must different? i prefer if there non- vb/vba route tackling problem. if me appreciated. thanks vba not needed. if both columns a & b filled dv pull-downs, in c1 enter: =if(a1<>b1,"",if(and(a1="",b1=""),"","bad values")) and copy down.

angularjs - Implement RequireJs in AnuglarJs UI-Router -

i have application in angularjs , have different modules different js files.for js file optimization going implement requirejs. there is (broken) plunker my angularjs code in app.js: var app = angular.module("webapp", ['ngroute']); app.run(['$rootscope', '$state','$urlrouterprovider', function ($rootscope, $state,$urlrouterprovider) { $urlrouterprovider.otherwise('/index.html'); $stateprovider .state('root.home',{ url: '/index.html', views: { 'header': { templateurl: 'modules/header/html/header.html', controller: 'headercontroller' }, 'content-area': { templateurl: 'modules/home/html/home.html', controller: 'homecontroller' }, 'footer': { templateurl: 'modules/common/html/footer.htm