Posts

Showing posts from January, 2015

c# - Want to Save visual studio project ON CD? -

i have made phonebook project on visual studio , used sql server management studio database , want save project on cd please tell me how can move cd? since you're using visual studio, assume you're using windows. these official microsoft instructions basically: put blank disc in burner when dialog window comes up, click "burn files disc" copy files window appears click 'burn disc'

c# - Embed an library into my application and make it use that library -

i want executable thing needed program work, dependant of library, more mysql.data.dll. how can incorporate library executeable? i've dragged dll project explorer. furthermore have selected afterwards , set build action embedded resource however still face filenotfound exception when in application try open new window: an unhandled exception of type 'system.io.filenotfoundexception' occurred in presentationframework.dll additional information: not load file or assembly 'mysql.data, version=6.9.8.0, culture=neutral, publickeytoken=c5687fc88969c44d' or 1 of dependencies. system cannot find file specified. edit: is different when using winforms? have been doing earlier, winforms application used ioniczip , json library, included embedded ressource. way didnt need include 2 dll files application. see question: merging .net managed dlls generally speaking, might want careful terms , conditions of library might forbid doing that. by settin...

Error asp.net sending email -

i followed first answer of how can send email using gmail smtp in asp.net mvc application? , tried tutorials same result(i used gmail account , password). receive error when doing smtp.send(message); receive error 502 ( bad gateway) there 2 forms of smtp on ssl; explicit ssl , implicit ssl. need determine form of ssl destination server using, , make sure smtp library using supports protocol , configured properly. i suggest instead of sending email directly within asp.net code, queue messages database, , have service routinely checks queue , sends messages, , removes messages upon successful send.

Change name of zip when creating archive with distribution plugin in gradle -

is there way configure distribution file name when creating archive using distribution plugin in gradle? here build.gradle (i'm using gradle 2.10 ) file: apply plugin: 'distribution' version '1.2' distributions { custom { basename = 'somename' contents {...} } } and calling task customdistzip creates file: $builddir/distributions/somename-1.2.zip have file name configurd to: somename.zip (without version number). my workaround create new task rename zip file after creation , use gradle finalizedby feature: task renamedist { dolast { new file("$builddir/distributions/somename-${project.version}.zip") .renameto("$builddir/distributions/somename.zip") } } customdistzip.finalizedby renamedist but don't elegant , nice solution. you can either do: customdistzip.setversion('') to set version string used basename empty or customdistzip.setarchivename('somename.z...

android - Text View is not visible -

i have textview should visible if particular condition satisfied. other views functioning on satisfaction of condition text view not getting visible. <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#fff"> <relativelayout android:id="@+id/nav_header_container" android:layout_width="match_parent" android:layout_height="50dp" android:layout_alignparenttop="true" android:background="#000"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="hi " android:textstyle="bold" android:layout_centervertical="true" android:textcolor="#fff"...

android - Only images in a spinner -

i have 4 images ( drawables ) want use in spinner. have found many ways include text , images using hash maps , overriding arrayadapter . they seem complex handle 1 imageview in each row. there easier way this? if not how handle hash map 1 drawable ? you must define layout row of spinner, create custom arrayadapter. @ link http://www.coderzheaven.com/2011/07/18/customizing-a-spinner-in-android/ i hope helps you. bestregards

mysql - phpmyadmin print statement syntax error -

create trigger agecheck after insert on student each row begin if (current_date-dateofbirth) > 16 dbms_output.put_line('age must greater 16'); end if; end; i trying write trigger in phpmyadmin gives error on dbms_output.put_line. says "you have error in sql syntax". can please me out this? dbms_output.put_line oracle pl/sql call , not available in mysql. there no direct equivalent in mysql's procedural language. closest thing call perhaps signal command class 01 (warning) or can create table trigger can insert messages.

JavaScript "example" of a switch to compare HTML button id's -

i posted question week ago how use javascript switch statement compare this.id. found hard function/object methods out of switch variables. using strict mode , trying seems impossible. did find 1 way results wanted. "use strict" function fragmentloader() { getid(this.id); } function getid(x) { var theid = x; switch (theid) { case "myfirstid": mydate(); break; case "mysecondid": changestyle(); break; case "mythirdid": mytext(); break; default: otpt = "error!"; } } function mydate() { document.getelementbyid('content').innerhtml = date(); } function changestyle() { var whatcolor = document.getelementbyid("content").style.color; if ( whatcolor === "black") { ...

oracleforms - Multi column list box in forms 11g -

please have @ attached file , advise if similar features available in oracle form 11g. tried in oracle form 11g fail work out. possible use similar windows features achieve same result , how? many in advance. enter image description here multi column list box not possible, can concatenate data show 1 column. in forms there exists lov type of data. so suggest use this. if not ok option got use java pluggable components ( java bean ) make yourself.

vb.net - Using EWS to retrieve attachments from signed emails -

i using exchange web services (ews) read emails , attachments. successful until started receiving emails digitally signed. found link ews: retrieving attachments signed emails solution starts off saying "... assuming security context has access key. " seems have problem. how can make sure security context has access key? how achieve that? code in above link gives me error: asn1 bad tag value met are messages signed or encrypted (or both) ? decrypt encrypted message need have private key (eg smime these should have been exchanged) envelopedcms search current user (security context) , computer certificate store certificate information. in exchange in addition being stored locally certificate used decrypt message stored attachment on personal contact or in active directory http://blogs.technet.com/b/exchange/archive/2008/04/23/3405402.aspx .

osx - adding PSQL to the .bash_profile mac -

i installed postgresql client manage online database command, psql command not known in command line. tried add .bash_profile file there went wrong , none of commands can found. know how fix ? this content of file[enter image description here][1] export m2_home=/usr/local/apache-maven-3.3.9 export path=$path:$m2_home/bin export path=/library/postsql/9.5/bin:psql you're overwriting $path instead of appending it. change line include old $path too: export path=$path:/library/postsql/9.5/bin

swing - Java Event-Dispatching Thread explanation -

i've started learning , exploring basics of gui programming in java. having been programming while have done backend work or work , result closest i've gotten user interfaces command console (embarrassing know). i'm using swing , far can gather means extension using awt. my question based on piece of code: java.awt.eventqueue.invokelater(new runnable() { public void run() { new frame.setvisible(true); } } ); i have been researching while wanted understand strange piece of code , have come across term 'event-dispatching thread' multiple times. correct me if i'm wrong understand it; has using multiple threads , how java swing interprets threads. gather above code used make sure threads 'safe' before creates window, hence invokelater? i have read that: "you can call methods operate on frame event-dispatching thread" and under circumstances can call methods operate on frame main method. can please clarify m...

Numbering of Dropdown Options XSLT -

xslt1.0 preferably i have following xslt code recreated amount of productguarantee selected. pick 5 below dropdown 5 times. @ moment when on 1 selected number each of them sequentially. what want number items same e.g. if b selected 3 times b 1, b 2, b 3. and tricky part there 'other' box user can type freetext if matches other box numbered i'm not worried part moment. at moment select 5 products get: optionone 1, optionone 2, optiontwo 3, optionfour 4, optionfive 5 what numbering multiples e.g. optionone 1, option 1 2, optiontwo, optionfour, optionfive any appreciated code: <xsl:if test="productguarantee!=0"> <xsl:for-each select="productguarantees/productguaranteedata"> <xsl:if test="producttypes/option[@id='a']='selected'">optionone</xsl:if> <xsl:if test="producttypes/option[@id='b']='selected'">optiontwo</xsl:if> <xsl:if test...

php - How to correctly use Laravel with SQL Server instead on MySQL? -

i trying use sql server databases laravel project. able connect sql server laravel 5.2. however, when try seed data table error [illuminate\database\queryexception] sqlstate[23000]: [microsoft][sql server native client 11.0][sql server]cann ot insert explicit value identity column in table 'surveys' when identity_insert set off. (sql: insert [surveys] ([id], [name]) values (10, 'some text')) note: trying supply identity value causing problem. while researching sql error, learned need execute following queries. before seeding need execute set identity_insert surveys on; after seeding need execute set identity_insert surveys off; but not sure how can execute these command using laravel how can seed while supplying value identity column without issue? updated here seeder <?php use illuminate\database\seeder; class finalsurveyts extends seeder { /** * run database seeds. * * @return void */ public function run()...

rdf - How to validate JSON-LD against an schema? -

as understand there ways validate serialized rdf (e.g rdf/xml) against rdf schema ( how validate rdf rdf schema ). also, there various converters rdf/xml json-ld serialization format (and vice versa). searching internet not find straightforward way validate json-ld against sort of json schema relates json-ld rdf schema relates rdf(/xml). of course, there various json-ld document forms assume 1 schema cannot describe forms. so question is, proper or recommended way of validating json-ld document rdf perspective? btw run on project tries solve validation of json linked data https://github.com/common-workflow-language/schema_salad . rdf schema mia-named, can used make sense of (actually, infer information from) rdf graph. owl provides more mechanisms asserting shapes of rdf graphs new work on rdf shapes. key these work on data model, not syntax. both rdf/xml , json-ld rdf serializations, can used reduce documents expressed in appropriate syntax rdf graph, these tools ope...

oracle - SQL query with ON DUPLICATE KEY UPDATE clarification needed -

this question has answer here: oracle db equivalent of on duplicate key update 3 answers i'm trying use following query: insert table1(col1, col2, col3) select ss.col1, ss.col2, ss.col3 table2 ss on duplicate key update col1=ss.col1, col2=ss.col2, col3=ss.col3; unfortunately "sql query not ended" message. in example syntax wrong? the error message pops right when insert on duplicate key update col1=ss.col1, col2=ss.col2, col3=ss.col3; oracle doesn't support on duplicate key update syntax. appears mysql-specific syntax. most likely, appear want merge statement merge table1 t1 using (select col1, col2, col3 table2) ss on (t1.col1 = ss.col1) -- whatever key when matched update set t1.col1 = ss.col1, t1.col2 = ss.col2, t1.col3 = ...

javascript - Dynamically changing url in sharrre Jquery -

my question following: i have multiple filters on page, filter events schedule dynamically, when click on of filters, url changes without reloading page. for example: http://.../schedule/#screening,free http://.../schedule/#talk,expo then, have share buttons sharrre: .social.social--share-filters a.icon.icon-twitter.js-twitter-filters(href="#", target="_blank") a.icon.icon-linkedin2.js-linkedin-filters(href="#", target="_blank") a.icon.icon-facebook.js-facebook-filters(href="#", target="_blank") $('.js-facebook-filters').sharrre({ share: { facebook: true, }, url: window.location.href, enabletracking: false, enablehover: false, click: function(api, options) { api.simulateclick(); api.openpopup('facebook'); } }); inspite of fact inside sharrre have url variable equals current link, shares link derived when page loaded first time. i tried put in...

diff - Why Managed and Unmanaged solution files are so much different in MS CRM? -

i created solution in ms dynamics crm, exported managed , unmanaged one. decompressed both , ran diff tool on customizations.xml files. , there many difference between them, it's hard changed , why. are these changes crucial? may create managed solution changing value in <managed> tag 1 instead of 0 ? safe? if shipping solution customer packaging proper managed solution "with proper publisher , version" critical part. if you'll go deep customization you'll understand changing managed tag doesn't make solution managed in proper sense. by updating managed tag can install/uninstall solution crm if you'll deep proper usage of managed solution control @ field level "which field customizable , field won't customizable" can control crm in such way other solutions being imported afterwards don't break customizations, you'll start seeing differences.

sql server - how to make sure that SSIS uses SSL to transfer data to Azure Database -

this question has answer here: does ssis provides kind of encryption on wire [duplicate] 1 answer in local computer, running ssis package transfer data azure db in every hour. how can make sure ssis uses ssl transfer data. went through various online tutorials , posts didn't find how confirm ssl being used. ms azure tutorials recommends use encrypt=true , trustservercertificate=false in connection string. my connection string ole db destitaion (azure) is data source=tcp:aaaaaa.database.windows.net,1433; user id=dbadmin@aaaaaa; initial catalog=testdb; persist security info=true; encrypt=true; trustservercertificate=false; application name=ssis-package-bbbbb; how understand ssl being used? have install certificate in local computer? ssl being used when encrypt=true . from: https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlc...

object recognition - best approach for template matching of binary (edge) images -

Image
to skimage , opencv gurus, given: scene image template image what best approach find cross in scene image ? these output smoothing, , canny filters. now, tried kinds of examples in skimage, , opencv template matching results not satisfactory. my ideal solution rotation, translation invariant (scale invariant bonus) . there way convert contour points , them registration point cloud ? more accurate ? thought ransac how give inputs ransac? thanks my approach solving similar problem create large set of rotated , scaled variations of template image , use opencv's matchtemplate function. i recommend preprocessing step of filling detected , closed contours (for both template , scene image) white since largely black template image might create false positives in black regions of scene image.

ADO.NET Connected Approach -

in connected approach while working databases, how add date string in table windows form date time picker? always use property type, don't use string datetime . should use parameters prevent sql-injection: using (var con = new sqlconnection(connectionstring)) { using (var cmd = new sqlcommand("insert dbo.table(datecol)values(@date)", con)) { cmd.parameters.add("@date", sqldbtype.datetime).value = datetimepicker1.value; con.open(); cmd.executenonquery(); } }

java - Hibernate post load event listener - not all data present -

hibernate version 4.3.10-final i have entity called account declares child transaction table follows @onetomany(cascade = cascadetype.all, mappedby = "account", orphanremoval = true) @orderby("transactiondate desc") private set<transaction> transactionlist; transaction list lazily loaded hibernate loads when needed. perform actions in post load event works fine when load account object, when hibernate loads transaction list (when code accesses transaction list, not happen every time), post load event account. in case post load data not correctly set account. example in following code, logs show key, deep inside hibernate loads account again when gettransactionlist called, same account object can not access key. getuser not return null, not loaded either - happenning on loaded object. final string key = account.getuser().getkey(); if (log.isinfoenabled()) { log.info("got key {}", key); } (final transaction transact...

html - javascript - get img src -

if have img in index.html : <script src="script/script.js" type="text/javascript"></script> <img id="imgb" src="picture/banner1.jpg" border="0"> then in separate file, such gallery.html , need src element of img in index.html . i tried writing function: function imgbbs(){ var x = document.getelementbyid('imgb').src; document.getelementbyid('imgbb').src = x; } then try using in gallery.html : <script src="script/script.js" type="text/javascript"></script> <body onload="imgbbs()"> <img id="imgbb" src="" border="0"> but doesn't seem working. how can src attribute of img in different file? a way load partial part of index page using jquery this: $( "#your_image_container_in_gallery.html" ).load( "index.html #imgb" );

javascript - event for when dialog is fully loaded -

i trying add jscrollpane dialog once dialog loaded. tried using dialogopen , dialogfocus events seems these trigger early. there event can subscribe tells me dialog loaded , displayed , safe call jscrollpane? right i'm adding half second timeout seems hacky , shows user broken dialog half second. any other solutions welcome. $("#diagbox").load($(this).attr('href'), function() { $dialog.imagesloaded(function() { $dialog.dialog('open'); $dialog.dialog("option", "position", "center"); settimeout(function(){ $('input, textarea').placeholder(); $('.scroller').jscrollpane(); positionelements(); },500); }); });

how to check if an object exists in javascript -

i want check if window.sessionstorage object exists. way it: if (window.sessionstorage) in javascript? if(sessionstorage.length == 0) { //do } that validate whether sessionstorage empty or not. alternatively, can use this: if(typeof(sessionstorage) == 'undefined') { //do }

xml - Known JSON file looks different in each browser -

Image
it's not programming question, interesting developers. today came across question user asking parsing json data in c#. nothing new, gave link json file: http://sapi.confirmtkt.com/api/platform/hotel/gethotels?city=bangalore&checkindate=08-01-2016&checkoutdate=09-01-2016&adults=2&rooms=1&children=0&childrenages= the page not available anymore! . if browse above link in google chrome can notice file shown xml. checked url in edge , showed me json file. google chrome edge i'm bit confused. why google chrome shows json file xml? that's because chrome sending different data in accept http header: chrome's request: get http://sapi.confirmtkt.com/api/platform/hotel/gethotels?city=bangalore&checkindate=08-01-2016&checkoutdate=09-01-2016&adults=2&rooms=1&children=0&childrenages= http/1.1 host: sapi.confirmtkt.com connection: keep-alive cache-control: max-age=0 accept: text/html,application/xhtml+...

php - Push an array into Laravel collection with matching keys -

Image
i have collection called user , have array containing 2 models post relating user model. the user collection contains primary key id , each model in post collection have foreign key user_id . i executing following: foreach ($users $user) { foreach ($posts $post) { if ($post->user_id == $user->id) { $user->posts->push($post); } } } this works, not entirely because pulls in related posts instead of recent 2 posts user has made. the array looks following: my user schema looks like; hasmany relationship post : you cannot use query constraints / eager loading this. doing work if retrieving posts 1 user. however, if try retrieve posts multiple users, fail because eager loading / query constraints limit related results whole. understand, have @ queries eloquent generates. lets take @ example need 1 user's posts. $user = user::with(['posts' => function($query) { $query->limit(2); }])-...

javascript - Click function on list filtered by Angular -

i have list i'm using angular filter, based on search: <div ng-init="psykers = [{name: 'kairos fateweaver'}, {name: 'pink horrors(10)'}, {name: 'pink horrors(11-14)'}, {name: 'pink horrors(15 or more)'}, {name: 'sorcerer (lvl 1)'}, {name: 'sorcerer (lvl 2)'}, {name: 'sorcerer (lvl 3)'}]"> </div> this information gets displayed in following paragraph class on it: <label>begin entering psyker's name here: <input id="psykersearch" ng-model="searchtext"> </label> <p class="psykerresult" ng-repeat="psyker in psykers | filter:searchtext"> {{psyker.name}} </p> i trying assign click event of text shows up. works first time, , if change search, works 1 more time, if change search again (which of course generates new results), fails recognize text @ clic...

php - Unknown method ApiTester::sendGet with Codeception -

i'm trying setup codeception tests test api i'm building seem doing wrong. following tutorial* have run php codecept.phar generate:suite api creates ./tests/api.suite.yml file looks this: class_name: apitester modules: enabled: - \helper\api i modified file same 1 in tutorial (adding url) this: class_name: apitester modules: enabled: - rest: url: http://serviceapp/api/v1/ depends: phpbrowser and generate test script generate:cept api readuser , add tests such <?php $i = new apitester($scenario); $i->wantto('perform actions , see result'); $i->sendget('/user/1'); however when run test error call undefined method apitester::sendget what need add have methods sendget, sendpost , others available? the codeception version 2.1.5 * http://codeception.com/docs/10-webservices fixed: removed tests directory , started again , working now. not sure different. yii...

encoding - Reading unknown-encoded text files in Adobe AIR -

i've got adobe air app users can process text files filesystems. i've been assuming utf-8, in case text file in other encoding (eg iso-8859-1 or iso-2022-kr), how should determine (best guess) encoding type of text file can read contents string? filestream.readmultibyte supports an intimidating range of types . you can try guess looking if file has header, bom. never 100% sure. look @ answers: how detect encoding of file? how can detect encoding/codepage of text file edit: maybe guessing approach, not in as3 help: simple class automatically detect text file encoding, english-biased "best guess" heuristic based on byte patterns in absence of bom. also, if option in app, can use utf-8 , let users preview text in encoding of choice.

python - Dict/Set Parsing Order Consistency -

containers take hashable objects (such dict keys or set items). such, dictionary can have 1 key value 1 , 1.0 or true etc. (note: simplified - hash collisions permitted, these values considered equal) my question is: parsing order well-defined , resulting object predictable across implementations? example, osx python 2.7.11 , 3.5.1 interprets dict so: >>> { true: 'a', 1: 'b', 1.0: 'c', (1+0j): 'd' } {true: 'd'} in case, appears first key , last value preserved. similar, in case of set : >>> { true, 1, 1.0, (1+0j) } set([(1+0j)]) here appears last item preserved. but (as mentioned in comments): >>> set([true, 1, 1.0]) set([true]) now first in iterable preserved. the documentation notes order of items (for example in dict.items ) undefined, question refers result of constructing dict or set objects. the bug fixed in recent versions of python explained in @jsf's answer d...

java - How to navigate a Barbie in a grid system? -

i'm trying solve interesting problem navigating barbie doll inside grid system. initially, barbie in [0,0] position, means in intersection of x , y axis. barbie has 3 operations on movement 'f' forward, 'r' right turn (90 degree) , 'l' left turn (90 degree). say, if pass direction string of "ff", position should [0,2]. solve problem , current state of code following, public static void barbieposition(string str ){ if( str == null || str.length() == 0) return; int [] initial = {0,0}; boolean xpos = false, xneg = false, ypos = true, yneg = false; char[] ch = str.tochararray(); for( char c: ch){ // initial postion of robot towards positive y axis if(c == 'l'){ if(xpos){ xpos = false; ypos = true; } else if ( xneg){ xneg = false; yneg = true; } else if(ypos){...

google chrome extension - Looking for some mutex-like mechanism for exclusive USB access -

i'm working on various usb hardware devices, each of implementing serial port. i'd access such serial ports multiple (chrome , non-chrome) applications running on system in pseudo-parallel fashion. basically i'd use mutex-like atomic primitive make sure 1 application has access serial port @ same time , others temporarily blocked, waiting mutex released. i'm afraid chrome api doesn't offer such low-level primitives please disprove me. also, i'm open suggestions. i've finished reading full chrome packaged apps api , mutexes not supported mutexes work inside process anyways it's not i'm looking begin with. i create native app bind multiple ports on local loopback interface , proxy connections towards /dev/ttyacm* serial interface. the other solution implementing multiple serial ports usb device in firmware multiple clients connect device without interference. i think i'll go latter solution because don't want have daemo...

android - Make view clickable underneath recyclerview -

Image
i trying achieve similar google play store app for got <framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <imageview android:id="@+id/image" android:layout_width="match_parent" android:layout_height="200dp" /> <android.support.v7.widget.recyclerview android:id="@+id/recyclerview" android:layout_width="match_parent" android:layout_height="match_parent" android:cliptopadding="false" android:paddingtop="200dp" /> </framelayout> looks great since recyclerview overlapping imageview, it's not clickable anymore. looking solution. you can make use of scrolling activity template in android studio has similar behaviour want do. , put imageview in appbarlay...

vb.net - How to get the loading time of a web page in Windows Service Application using HttpWebRequest -

i'm looking code me loading time of web page without using webbrowser() in windows service application. i run through different methods, don't quite it. please me solve problem. this function should trick: public function webpageresponsetime(byval url string) timespan dim sw new system.diagnostics.stopwatch sw.start() dim wrequest webrequest = httpwebrequest.create(url) using httpresponse httpwebresponse = directcast(wrequest.getresponse(), httpwebresponse) if httpresponse.statuscode = httpstatuscode.ok sw.stop() return sw.elapsed end if end using end function this take downloading of source code account. if want calculate how long time takes download source code , render page you'd have use webbrowser class. how works: the function declares , starts stopwatch used calculating how long operation took, creates web request specified url. downloads entire page's source code (via httpweb...

ios - Why changing xib's constraint is invalid in url request's success block? -

Image
i have written viewcontroller using interface building: top part tableview, bottom part uiview(called bottomview).the tableview's bottom bottomview's top, , add height constraint in bottomview control height of tableview.then link bottomview's height constraint viewcontroller's property. let's see xib picture viewcontroller.   the constraints in viewcontroller in picture followed(the first picture tableview's, second bottombackview's):   in viewcontroller, use iboutlet corresponding link this: @property (strong, nonatomic) iboutlet nslayoutconstraint *bottomviewheightconstraint; change bottomviewheightconstraint's constant in url request's success block this: [getcontacts startwithparams:@{@"bizid":self.bizid, @"bizcode":@(self.bizcode)} success:^(id responseobject) { self.bottomviewheightconstraint.constant = self.bottomcontentview.height; [self.view setneedslayout]; } first time, value of self.bottomviewheightco...

excel - Copying and Pasting -

i got vba coding, however, though code compiles without hiccups, still fails it's intended purpose. essentially, merely test program created copy , paste information 1 workbook in specific cell. sub copyopenitems() ' copyopenitems macro ' copy open items sheet. ' keyboard shortcut: ctrl+shift+o ' dim wbtarget workbook 'workbook data pasted dim wbthis workbook 'workbook data copied dim wstarget worksheet dim wsthis worksheet dim strname string 'name of source sheet/ target workbook 'set current active workbook (the source book) set wbthis = activeworkbook 'get active sheetname of book strname = activesheet.name 'open target workbook set wbtarget = workbooks.open("c:\users\administrator\desktop\excel testing\excel info testing 2.xlsx") 'set variable current worksheet set wsthis = activesheet 'set variable target worksheet s...

python - Airflow HiveOperator not working -

i trying use hive operator in airflow. have dependencies installed (pyhs2, pyhive, , ran pip install airflow[hive]). however when use code below t1 = hiveoperator( task_id='simple_query', hql='select * cities', dag=dag) i error. not sure means [2016-01-06 03:26:39,500] {models.py:1017} error - [errno 2] no such file or directory traceback (most recent call last): file "/usr/local/lib/python2.7/dist-packages/airflow/models.py", line 977, in run result = task_copy.execute(context=context) file "/usr/local/lib/python2.7/dist-packages/airflow/operators/hive_operator.py", line 65, in execute self.hook.run_cli(hql=self.hql, schema=self.schema) file "/usr/local/lib/python2.7/dist-packages/airflow/hooks/hive_hooks.py", line 110, in run_cli cwd=tmp_dir) file "/usr/lib/python2.7/subprocess.py", line 710, in __init__ errread, errwrite) file "/usr/lib/python2.7/subprocess.py", line 1...

SSL chain of trust with browser-sync? -

i'm trying set gulp https server. server's certificate signed company's ca. in order validated browser, ca's certificate needs specified, client browser can validate chain of trust. node's https object has option "ca" listing trusted certificates establish chain of trust. there way specify ca certs in browser-sync? optimally, i'd looking snippet below, i'd take workaround, if there any. browsersync.instance = browsersync.init({ server: { basedir: "app", index: "index.htm" }, https: { cert: './certs/servercert.pem, key: './certs/serverkey.pem', ca: ['./certs/mycompany-ca.cer', './certs/mycompany-root-ca.cer'] } });

html - Setting 'select' as default value in dropdown using angularjs -

i trying make simple dropdown using angularjs , want invoke function when dropdown value changed. when dropdown selection 'a', want display other elements(say 'hello') in page. here jsfiddle http://jsfiddle.net/gkjve/932/ . html <div ng-controller="ctrl"> <select id="sel" class="input-block-level" ng-model="list_category" ng-options="obj.name obj in list_categories" ng-change="dropdownchange()"> <option value="">select</option> </select> <div ng-show="showdiv"> hello </div> <div> angular var app = angular.module('app', []); $scope.showdiv=false; function ctrl($scope) { $scope.list_categories = [{ id: 'id1', name: 'a' }, { id: 'id2', name: 'b' }]; $scope.dropdownchange =...

c - For Loop condition -

#include <stdio.h> #define all_mem (sizeof(x) /sizeof(x[0])) int x[] ={1,2,3,4,5,6,7,8,9,10}; int main(void) { // printf("the condition %d",(all_mem-2)); int i; for(i=-1;i<=(all_mem-2);i++) { printf("the number %d",i); } return 0; } in above code loop not executing single time, tried printing condition , satisfies loop condition. insights how macro expression in loop condition evaluated value less -1? the all_mem macro returning size_t value; integer promotion rules mean comparison of i <= (all_mem - 2) promoting i size_t , means value huge, rather -1 . try casting ensure signed comparison: for(i = -1; <=(ssize_t)(all_mem- 2); ++i)

Your PHP installation does not support XML in Centos6.7 -

i have installed centos6.7 within php5.6.16 , i've configured virtual hosting (vhosts) create website.however used ci2.2.0 but got errors below info an error encountered your php installation not support xml so php extension solve problem? i have install bellow packages install 1 package(s) upgrade 8 package(s) total download size: 9.3 m ok [y/n]: y downloading packages: (1/9): php-5.6.16-1.el6.remi.x86_64.rpm | 2.7 mb 00:00 (2/9): php-cli-5.6.16-1.el6.remi.x86_64.rpm | 3.9 mb 00:00 (3/9): php-common-5.6.16-1.el6.remi.x86_64.rpm | 1.1 mb 00:00 (4/9): php-gd-5.6...

javascript - How to avoid multiple helper implementations like __indexOf() with grunt-contrib-coffee -

i have gruntfile.coffee has grunt-contrib-coffee configuration this: coffee: compile: files: 'public/assets/application.js': [ 'multiple/files' #, ... ] options: bare: true the problem is, generates multiple implementations of helper methods like var __indexof = [].indexof || function(item) { (var = 0, l = this.length; < l; i++) { if (i in && this[i] === item) return i; } return -1; }; how make recognize these implementations compiled? update 1 the reason compiled javascript gets concatenated after got compiled. avoided if coffeescript concatenated before compiling it. if not configuration option of grunt-contrib-coffee i'm missing, i'll submit issue on github. so question remains is: how concatenate coffeescript before compiling it, avoid multiple helper implementations? update 2 there workaround, involves manual concatenation of source files concat task. requires temporary file, c...

jQuery and javascript ('#ID') #update1#helpme -

understand me <!doctype html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css"> <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script> <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script> <script> $('.deleteme').live('click', function(){ $(this).parent().remove(); $('#contributionlist').listview('refresh'); }); $( document ).ready(function() { $('#addcontribution').click(function () { var newamount = $('#contributionamount').val(); if (newamount) { $('#contributionlist').append('<li><a>' + newamount + '...

Lookup Java non-String keyed Java HashMap with string -

i'm trying have hashmap keyed circuitid class . circuitid class contains string clci member , class overrides hashcode()/equals() using clci member's hashcode()/equals() . i wanted can lookup map using simple string , away converting string circuitid object lookup map. doesn't work , think because hashmap uses evaluation form (key==null ? k==null : key.equals(k)) key input key , k key entry in map, key.equals(k) part. i'm wondering why hashmap didn't k.equals(key) instead? (at least way, think i'm trying have worked.) being that's not case, there trick this? if have overridden equals() check handle if key being passed string or actual circuitid object, don't understand why wouldn't have worked. whether container compares circuit string, or string circuit implementation-specific, , not guaranteed same in future releases of jre. generally, given 2 objects a , b , expected a.equals(b) when b.equals(a) , vice-versa. cal...

multithreading - .net UI Thread taking wrong culture -

there weird problem application code facing. have wpf application (desktop) in .net 4.0. uses third party control devexpress. this application being supported wcf windows service, in .net 4.0 through our logs, noticed in wpf application, main gui thread has taken culture such datetime.now in thread gives time of 1 hour behind i.e. if system time 1.20 pm, gui thread (through datetime.now) gives 12.20 pm. however, other threads in application e.g. timer threads or background worker thread giving correct time. in wcf windows service also, noticed main thread running services or timers within service fine. however, have created new thread (using thread t = new thread()) , thread taking wrong culture i.e. datetime.now in thread return 12.20 pm instead of 1.20 pm. it mysterious us. can please help?

sql - Condition in a stored procedure -

i have stored procedure 2 updates, want first update if parameter @active equals 'y' . alter procedure sp_updatethis @something varchar(5), @active char(1) begin -- check see if active , update update mytable set this=@something -- run 1 regardless update yourtable set that=@something try changing last line this: if (@active = 'y') begin update yourtable set that=@something end

php - Check Input contain Text and Number using JavaScript -

i have input text field in webpage. need validate field field contain both text , numbers. ie input box if cost need validate if cost in format of '100 r' i have validated number, how can validate text , number var number = document.forms["myform"]["cost"].value; if (isnan(number)) { alert("cost must in number"); document.myform.cost.focus() return false; }

Can't get the right result when using re.findall function on python -

i want match right string regular expressions, can't. import re str = "<meta apple <meta" \ "we go<meta" \ "goto mac <meta td yiyang ziyou" \ "net<meta aaask zoie go?" \ "<meta " \ "buy mac" r = re.findall("<meta(?!.*<meta).*mac", str, re.s) i think there matched 2 strings, 1 <meta goto mac , <meta buy mac , got last. why? use pycharm 5.0.3, version of python 3.5.1. thank you. the problem have negative look-ahead operator (?!.*<meta) means match, there must not <meta later in string. for reason, last <meta string matched, because can satisfy criteria.

read json into R -

after couple of days struggle, decided ask experts of stackoverflow. i wanted export (for example) " http://www.appannie.com/app/ios/instagram/ranking/history/chart_data/?s=2010-10-06&e=2012-06-04&c=143441&f=ranks&d=iphone " r. so here's tried. library(rjsonio) library(rjson) library(rcurl) appannie <- geturl("http://www.appannie.com/app/ios/instagram/ranking/history/chart_data/.json?s=2010-10-06&e=2012-06-04&c=143441&f=ranks&d=iphone") fromjson(appannie) but gives me error of "no data parse". but can see there data (i can see data browser). [{"data": [[1286323200000, 70, "initial release\n"], [1286409600000, 65, null], [1286496000000, 89, null], [1286582400000, 106, null], [1286668800000, 143, null], [1286755200000, 172, null], [1286841600000, 106, null], [1286928000000, 116, null], [1287014400000, 78, null], [1287100800000, 102, null], ...... [1338768000000, 2, null]], "labe...

c# - How do I show the contents of this array using DataGridView? -

Image
i created 2 dimensional array of strings , populated it. try bind datagrid control so: string[][] array = new string[100][]; datagridview.datasource = array; instead of seeing contents of array see following columns: length, longlenth, rank, syncroot, isreadonly, isfixedsize, issyncrhonized. so instead of displaying contents of array, displays properties of array. did wrong? when allow grid control auto-generate columns, enumerate through properties of object , create column each one. has no way know want display grid of array values. you'll need create new object (such enumerable list of class) out of array properties want bind columns. quick way use anonymous type, built using linq query. like: string[][] array = new string[100][]; for(int = 0; < 100; i++) // set values test array[i] = new string[2] { "value 1", "value 2" }; datagridview.datasource = (from arr in array select new { col1 = arr[0], col2 = arr[1] }); page.databi...