Posts

Showing posts from August, 2013

magento skip payment method from checkout -

i have magento ee 1.14.2 setup client don't want payment method now. how can skip payment method checkout process. want place order without selection payment method. any suggestion welcome in advanced. you can follow below link hide payment method. http://excellencemagentoblog.com/blog/2011/10/17/magento-onestep-checkout-remove-payment-method-step/ please let me know if need side.

java - Main method empty? -

i have class implements runnable, eclipse needs public static void main method in it. ok if main completly empty? public class launcher implements runnable{ private string message; public launcher(string message) { this.message= message; } public static void main(string[] args) { } @override public void run() { //my implementations } if intend launcher main class of application, 1 use start it, main method needed , must whatever should done start work. if not, delete main method. eclipse not require main method unless start application telling run class. optionally generate 1 when creating class, can edited out if not needed.

ember.js - How to get the latest active item? -

the following returns active items. activeitems: ember.computed('items.@each.status', { get() { return this.get('items').filter((item) => { return item.get('status') === 'active'; }); } }) // template {{#each activeitems |activeitems|}} {{activeitem.status}} {{/each}} all of above works. lets want create computed property picks out last activeitem . tried: activeitem: ember.computed('activeitems', { get() { return this.get('activeitems').lastobject; } }), // template {{activeitem.status}} <-- returns nothing why , how can work? i see 2 problems: your computed property has incorrect dependent key. relying on activeitems , problem update when activeitems property returns new object, not when contents updated. should watching activeitems.lastobject . lastobject computed property, means might not able access without using ember's get() function. try this:...

r - Adding points from other dataset to ggplot2 -

there many questions theme, not find 1 answered specific problem. i have barplot (see testplot1 , testplot3 below) plotting dataset ( bardata below) , want add points dataset ( pointdata ). see simplified example: bardata <- data.frame( xname = c(1, 1, 1, 2, 2, 2, 3, 3, 3), yvalue = c(1, 2, 3, 2, 3, 1, 4, 2, 1), colorname = c("a", "b", "c", "a", "b", "c", "a", "b", "c") ) pointdata <- data.frame( xname = c(1, 1, 3), ypos = c(2, 4, 3), ptyname = c("p", "q", "r") ) testplot1 <- qplot(xname, yvalue, data= bardata, stat = "identity", fill= factor(colorname), geom = "bar") testplot2 <- testplot1 + geom_point(data = pointdata, mapping = aes(x = xname, ...

android - How to launch an Ionic application and NOT open it in a web view? -

i'm stuck @ same issue 2 days :( i have 2 ionic-phonegap applications need able open each other, not in webview , externally (if app running, can restarted or continue - handle both). after many hours of research, found that, using inappbrowser (window.open(url, _system)) , able open externally every commercial application tried (facebook, twitter, maps, etc). same call, when trying open 1 of applications, opens in web view. window.open("fb://", _system) -> opens facebook separately. window.open("myapp://", _system) -> opens application in web view. i've tried modify androidmanifest.xml , config.xml , changed erased building. for example, if change "android:launchmode="singletop" "android:launchmode="singletask" , run "ionic build", change lost.. any solution? solution found!!! need add lines in app/config.xml : <preference name="androidlaunchmode" value="singlet...

ios - CloudKit fetchUserRecordIDWithCompletionHandler completion code not calling? -

i trying fetch current user id cloudkit using fetchuserrecordidwithcompletionhandler when run code, completion handler skipped over. let container = ckcontainer.defaultcontainer() let publicdatabase = container.publicclouddatabase var userid: ckrecordid! container.fetchuserrecordidwithcompletionhandler( { recordid, error in if error == nil { userid = recordid } else { nslog("\(error.localizeddescription)") } }) let predicate = nspredicate(format: "personid = \(userid)") let query = ckquery(recordtype: "person", predicate: predicate) because of this, value of userid stays nil , , query throws exception because of it. the completion handler run once fetch request complete, happen asynchronously. cannot use result of fetch request after call. move query completion handler of other part of code can called or otherwise triggered handler.

php - calculate average interval on array of dates -

i have array dates array ( [0] => 2014-09-05 [1] => 2014-09-09 [2] => 2014-09-09 [3] => 2014-09-11 [4] => 2014-09-16 [5] => 2014-09-18 [6] => 2014-09-25 ) look interval between dates approximately 3 days. how can calculate interval automatically? this should work you: just loop through of dates , check if there still next date. if yes subtract both timestamps , add $intervals array. at end take average of intervals, in seconds, can divide 3600 * 24 average day interval. <?php $dates = [ "2014-09-05", "2014-09-09", "2014-09-09", "2014-09-11", "2014-09-16", "2014-09-18", "2014-09-25", ]; foreach($dates $key => $date) { if(isset($dates[($key+1)])) $intervals[] = abs(strtotime($date) - strtotime($dates[($key+1)])); } $average = array_sum($...

html - CSS buttons in middle "Center" -

i have tried place buttons in middle, have no idea do, i'm not best @ css. i don't know, if i'm doing right in code, have tried place in center. what should place buttons in middle of screen? <style> body { background-image: url(http://1-background.com/images/silk/grey-silk-website-background.jpg); } .button { display:block; text-align:center; } h1{ text-align: center; } .remove{ color: red; align-items: center; } .create{ color: green; align-items: center; } .test{ color: blue; align-items: center; } </style> <body> <form> <h1> <select id="myselect" style="width:400px" size="10" multiple> <option id=" hello">hello</option> </select> <br /> <input type=...

C++ Eclipse generates invalid exe -

i using c++ eclipse , mingw/msys ecosystem compiling c++ programs. set correct paths mingw/msys in system variables. on building exe created name libtest says x86/le in format. when run exe below error : createprocess error=193, %1 not valid win32 application i used dependency walker on created exe , got below error error: @ least 1 module has unresolved import due missing export function in implicitly dependent module. error: modules different cpu types found. i attaching build log below : **** build of configuration debug project test **** make -k building file: ../src/test.cpp invoking: gcc c++ compiler g++ -i"c:\mingw\include" -o0 -g3 -wall -c -fmessage-length=0 -v -mmd -mp -mf"src/test.d" -mt"src/test.d" -o"src/test.o" "../src/test.cpp" using built-in specs. collect_gcc=c:\mingw\bin\g++.exe target: mingw32 configured with: ../gcc-4.8.1/configure --prefix=/mingw --host=mingw32 --build=mingw32 --without-pic --enable-s...

java - Deleting a single linked list by just making head = null? -

why can't make head=null delete complete linked list? 3 = head > 1 > 2 > 4 > null by making head = null , jvm take care of it.as head node not referenced variable , should garbage collected. what wrong solution? note: i'm aware of correct solution delete complete link list i'm curious why can't make head=null delete complete linked list? here's code of java.util.linkedlist.clear(), verbatim: public void clear() { // clearing of links between nodes "unnecessary", but: // - helps generational gc if discarded nodes inhabit // more 1 generation // - sure free memory if there reachable iterator (node<e> x = first; x != null; ) { node<e> next = x.next; x.item = null; x.next = null; x.prev = null; x = next; } first = last = null; size = 0; modcount++; } the comment answers question. it's unnecessary. can gc, , can make more objects ...

(python) using threads to get last value of stock market -

i'm trying last value of symbol list yahoo finance using thread in python. read thread documentary don't understand concept #!/usr/bin/python threading import thread import urllib import re def th(ur): base = 'https://finance.yahoo.com/q?s='+ur htmlfile = urllib.urlopen(base).read() regex = '<span id="yfs_l84_[^.]*">(.+?)</span>' result = re.findall(regex,htmlfile) print result[0] symbollist = open("symbollist.txt").read().splitlines() threadlist = [] u in symbollist: t = thread(target=th,args=(u,)) t.start() threadlist.append(t) b in threadlist: b.join() have symbol list contain 3000 symbol don't know how many thread should use or should lock threads all code in function called "th" need thread safe. if of isn't, you'll need lock around parts stop "threading" issues, example race conditions.

c++ - CMake: Using the headers installed by an External Project -

i have read documentation on using external projects kitware here , attempting follow process use image-processing library leptonica external dependency. cross-compiling using different toolchains, not want install leptonica globally, rather have libraries , headers installed within build directory can deleted , reinstalled compilation toolchains change. in other words, make cmakeprojecta dependent on installed headers , libraries of externalprojectb . here have cmakelists.txt file. cmake_minimum_required(version 3.2) project(cmakeprojecta) set(source_files main.cpp) set(cmake_cxx_flags "${cmake_cxx_flags} -std=c++11") include(externalproject) externalproject_add( leptonica-1.72 prefix leptonica url http://www.leptonica.com/source/leptonica-1.72.tar.gz url_md5 7581db29f8442197ce68e766c6047c4b configure_command <source_dir>/configure --prefix=<install_dir> ) externalproject_get_property( leptonica-1.72 install_dir ) set(l...

c# - What is a NullReferenceException, and how do I fix it? -

i have code , when executes, throws nullreferenceexception , saying: object reference not set instance of object. what mean, , can fix error? what cause? bottom line you trying use null (or nothing in vb.net). means either set null , or never set @ all. like else, null gets passed around. if null in method "a", method "b" passed null to method "a". the rest of article goes more detail , shows mistakes many programmers make can lead nullreferenceexception . more specifically the runtime throwing nullreferenceexception always means same thing: trying use reference, , reference not initialized (or once initialized, no longer initialized). this means reference null , , cannot access members (such methods) through null reference. simplest case: string foo = null; foo.toupper(); this throw nullreferenceexception @ second line because can't call instance method toupper() on string reference pointing null ....

traversal - find path between vertices using edge properties in OrientDB -

is there way find path between 2 vertices including edges having property specific value in orient db ? i able find path between 2 vertices not able filter out based on edge properties. if want paths between 2 vertices, can do: select $path path ( traverse oute(), inv() #13:1 ) @rid == '14:2' this goes through out edges #13:1 , building path. keep end rid #14:2 . 1 thing note that, return several paths, if 2 two paths share common track 1 of retrieved (thats thing traverse command preventing loops , efficiency that) if have further conditions want apply traversal, can put them in while . want take consideration value of test attribute edges: select $path path ( traverse oute(), inv() #13:1 while (@class == 'v') or (@class == 'e' , test == 3) ) @rid == '14:2' here need 2 conditions because traversing both vertices , edges, if edge want check on test attribute, if vertex, no condition, keep traversing. note: ther...

android - Access Activity in Fragment when clicking on side menu item -

i trying build side menu. how can show activity in fragment when user clicks on side menu item? it's showing fragment when user clicks on side menu item. it's not showing activity. you can instantiate activities inside fragment using localactivitymanager, deprecated in api 13 ( http://developer.android.com/reference/android/app/localactivitymanager.html ). see example if want instead of using fragments intended: http://iamvijayakumar.blogspot.co.uk/2013/01/many-activity-inside-fragment-in-android.html

excel vba mac - Run time error "1004" in vba code -

i have run time error code: textbox8 = worksheets("listofbuyer").range("b" & combobox1.listindex + 1) the real issue combo box either has:- 1. no selection made yet 2. set value not match 1 of entries in list (properties achieve style = fmstyledropdowncombo , matchentry = fmmatchentrynone either way, find combobox1.listindex equal -1, resulting in range specified b0 .

ruby - Getting date value from an array hash -

i have hash looks like tagarray = { :"2014date"=>["11/22/2014"], :"2015date"=>["03/21/2015"] } since know given key, there 1 element in array of 'values', how can value not array? value = tagarray[:"2015date"] => value = ["04/12/2015"] you can index array , date like value = value.fetch(0).to_s => value = "04/12/2015" however looking more elegant way of doing it. note: using ruby 2.2, need 'strp' date first change mm/dd/yyyy format end goal. this bit simpler: value = tagarray[:"2015date"].last => value = "03/21/2015"

java - disabling a node without disable its children in javafx -

is there solution disable node in javafx without disabling children ? want disable nodes in pane except 1 of them dynamically. tried solution , other solutions doesn't work , think has bad performance! node.getparent().requestfocus(); for(int i=0 ; i<pane.getchildren().size() ; i++){ if( !pane.getchildren().get(i).isfocused()){ pane.getchildren().get(i).setdisable(true); } } edited: also tried solution: added transparent pane main pain , add special node . doesb't work complex components because should keep sizes , locations of it's children ! i want user interact 1 node of whole scene , other nodes should disable . the current javadoc of booleanproperty disableproperty() of node says: "...... setting disable true cause node , subnodes become disabled ....... https://docs.oracle.com/javase/8/javafx/api/javafx/scene/node.html#setdisable-boolean- https://docs.oracle.com/javase/8/javafx/api/javafx/scene/node.h...

lua - How to recover nodemcu infinite loop -

i made mistake loading init.lua infinite loop on nodemcu/esp8266 board. then board keep rebooting without other instruction executed. i = 10 timerid = 0 timerdelay = 30000 -- milisec pin = 5 gpio.mode(pin,gpio.input) repeat( print(gpio.read(pin)) = + 1 end) until < 5 i tried flashing board python esptool.py -p /dev/tty.wchusbserial1450 run python esptool.py -p /dev/tty.wchusbserial1450 write_flash 0x0000 ../nodemcu_latest.bin and after fix code , load again , works fine

javascript - Execute slideup and slidedown automatically when any div is showing or hidding -

i need apply jquery slideup/slidedown method automatically if div hide/show inside body tag in time. $(window).load(function(){ $("*").show(function(){ $(this).slidedown(2000); }); $("*").hide(function(){}); $(this).slideup(2000); });

sql - Need to calculate the current date till end year? -

i automating report has 3 dates set parameters, user enters. note our dates in yyyymmdd format. we want first set current date: totext(currentdate, 'yyyymmdd') till end of year. can hard code 20151231 prefer not to. how script last day of year? assuming using sql server of recent-ish vintage: current date: select today = convert(date, current_timestamp ) 1st day of current month: select first_of_month = convert(date, dateadd(day, 1-day(current_timestamp) , current_timestamp ) ) last day of current month: select last_of_month = convert(date, dateadd(day, 1-day(dateadd(month,1,current_timestamp)) , dateadd(month,1,current_timestamp) ) ) 1st day of current year: select first_of_year = convert(date, dateadd(day, 1-datepart(dayofyear,current_timestamp) , current_timestamp ) ) , last day of current year: select last_of_year = convert(date, dateadd(year,1, dateadd(day, -datepart(dayofyear,current_timestamp) , current_timestamp ) ...

Dataflow job status returns UNKNOWN always -

i trying current state of job. following code. job creation final dataflowpipelinejob job =dataflowpipelinerunner.fromoptions(configuration.getoptions()) .run(pipe); my code job state dataflowpipelinejob job=new dataflowpipelinejob(utils.getprojectid(), jobid, getdataflowclient()); job.getstate(); but throws following warning com.google.cloud.dataflow.sdk.runners.dataflowpipelinejob getstate: there problems getting current job status: com.google.api.client.googleapis.json.googlejsonresponseexception: 404 ok not found @ com.google.api.client.googleapis.json.googlejsonresponseexception.from(googlejsonresponseexception.java:145) @ com.google.api.client.googleapis.services.json.abstractgooglejsonclientrequest.newexceptiononerror(abstractgooglejsonclientrequest.java:113) @ com.google.api.client.googleapis.services.json.abstractgooglejsonclientrequest.newexceptiononerror(abstractgooglejsonclientrequest.java:40) @ com.google.api...

c++ - Trying to Minimize Repetitive code in Zip-to-Barcode program -

first time posting here if i'm doing wrong let me know...new whole programming thing. so in class doing zip bar code converter program. have program running fine , trying cut down on redundant or repetitive coding. instance function runs actual compiling of zip code bar code have 5 switch statements run same exact cases. difference condition switch (digita, b, c, d, e; digits of zip code): // short zip code converter function int zip_to_bar(int digita, int digitb, int digitc, int digitd, int digite) { int sum; string bar_code = "!", check_code; switch(digita) { case 0: bar_code += "!!..."; break; case 1: bar_code += "...!!"; break; case 2: bar_code += "..!.!"; break; case 3: bar_code += "..!!."; break; case 4: bar_code += ".!..!"; break; case 5: bar_code += ".!.!."; break; case 6: bar_code += ".!!.."; break; case ...

asp.net - Upload file using jQuery and post it to Controller -

i'm wondering if possible @ upload file posting controller action in asp.net mvc. dialog upload form dynamically generated , inside jquery dialog in case. i'm aware of file input element i'm not sure how send file controller action, not sure how set action parameter your action should this: [httppost] public actionresult upload(httppostedfilebase file) { if (file.contentlength > 0) { var filename = path.getfilename(file.filename); var path = path.combine(server.mappath("~/app_data/uploads"), filename); file.saveas(path); } return redirecttoaction("index"); } taken : http://haacked.com/archive/2010/07/16/uploading-files-with-aspnetmvc.aspx/ then using jquery dialog file upload: $dialog.dialog("option", "buttons", { "save": function () { var dlg = $(this); var formdata = new formdata($("#" + formname)[0]); $.ajax({ url: /controller...

c# - Dapper & MS Access - Read works, Write doesn't -

let's start getting out of way: i'm stuck using ms access db , can't change it. this works fine: using (oledbconnection conn = connectionhelper.getconnection()) { conn.open(); var results = conn.query<string>( "select firstname students lastname = @lastname", new { lastname= "smith" } ); conn.close(); } this works fine: using (oledbconnection conn = connectionhelper.getconnection()) { oledbcommand cmd = new oledbcommand( "update students set firstname = @firstname, city = @city lastname = @lastname", conn ); cmd.parameters.addwithvalue("firstname", "john"); cmd.parameters.addwithvalue("city", "somecity"); cmd.parameters.addwithvalue("lastname", "smith"); conn.open(); var result = cmd.executenonquery(); conn.close(); } this doesn't... executes without error sets firstname "somecity" in db , city "john...

java - CMIS Versioning not working as expected -

i'm creating file on document service cmis api using following code: zipmapfile.put(propertyids.object_type_id, "sap:versioned"); zipmapfile.put(propertyids.name, "g" + g.getid() + ".zip"); document versioneddocument = opencmissession.getrootfolder().createdocument(zipmapfile, contentstream, versioningstate.major); newzipfileid = versioneddocument.checkout(); ... the code above working , file being correctly generated. when run following code: cmissession.getobject(newzipfileid.getid()); i file created before, no errors. however, i'm having problem when try upload new version file. to this, i'm using following piece of code: oldzipfileid = newzipfileid; document pwc = (document) cmissession.getobject(oldzipfileid); pwc.setcontentstream(contentstream, true); newzipfileid = pwc.checkin(false, null, null, null); whenever this, can access newer version no problems running following code: cmissession.getobject(newzipfileid.geti...

bash - Virtualenv: deactivate not working -

i had venv called "myappenv" using , tried write script run call source bin/activate (save me keystrokes). accidentally ran while in myappenv. since doing this, when try deactivate myappenv, bash: type: deactivate: not found . happens in brand-new environment created, totally separate myappenv. how back? cannot exit out of environment except killing screen session.

pad - How padding 2 variable on c#? -

this question has answer here: add zero-padding string 4 answers function zeropad(num, places){ var 0 = places - num.tostring().length + 1; return array(+(zero > 0 && zero)).join("0") + num; } please tell me means of code above, , how use on c# the code javascript , pads number num zeros length places , example zeropad(12, 4) gives 0012 . in c# can padleft() method, example 12.tostring().padleft(4, '0') gives same above 0012 .

validation - Validating HTML form/web page element using VBScript -

i have started learn vbscript , want validate html form / web page elements using vbscript . can tell me if possible refer external html form/web page vbscript code , validate it's elements inside script? like, want add form reference or location (designed in html) in vbscript , validate textbox, checkbox , submit it. fyi, can validate html form adding vbscript part on html code. example: <html> <head> ... </head> <body> <script type="text/vbscript"> ... </script> <form name="form1"> ... </form> </body> </html> i want validate html form / web page elements using vbscript this bad decision. solution work under internet explorer. on client side recomend use javascript on server sode of couse vbscript.

ibm mq - Why does this exception occur: "java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key MQJE001b"? -

i have installed ibm mq 7.5.0.5 client , adding jars under c:\program files (x86)\ibm\websphere mq\java\lib classpath of java application. when writing queue using java program following exception: java.util.missingresourceexception: can't find resource bundle java.util.propertyresourcebundle, key mqje001b @ java.util.resourcebundle.getobject(unknown source) @ java.util.resourcebundle.getstring(unknown source) @ com.ibm.mq.mqexception.getmessage(mqexception.java:1638) @ com.ibm.mq.reasoncodeinfo.getresourceexception(reasoncodeinfo.java:191) @ com.ibm.mq.mqclientmanagedconnectionfactoryj11._createmanagedconnection(mqclientmanagedconnectionfactoryj11.java:600) @ com.ibm.mq.mqclientmanagedconnectionfactoryj11.createmanagedconnection(mqclientmanagedconnectionfactoryj11.java:630) @ com.ibm.mq.storedmanagedconnection.<init>(storedmanagedconnection.java:107) @ com.ibm.mq.mqsimpleconnectionmanager.allocateconnection(mqsimpleconnectionman...

How to show files/folders sync status in GIT repository (using icon overlays) as shown in Dropbox? -

while using dropbox, sync status shown mark on file/folder (e.g. not synced shown red , sync complete shown green). have seen git gui provides such feature showing different marks different status of files/folders. e.g. committed, untracked, synced, etc. shown different symbols shown on files/folders (as icon overlays). can tell how enable feature git repositories? edit: using windows 7. on windows os there software called tortoisegit have feature. https://tortoisegit.org

apache spark - Are cached RDDs resilient to graceful worker shutdown? -

i have (very) small spark cluster used 'sandpit' environment several people. occasionally, need restart worker nodes in course of maintaining cluster. if running job working off rdd has been .cache() 'd, , worker stopped gracefully (by running ./stop-slave.sh on node), happens portion of cached rdd? the 2 scenarios can think of (assuming storage level rdd memory_only , no replication) that: the worker distributes portion of rdd across other workers; the portion of rdd held worker lost, , must recomputed. the documentation suggests partition recomputed, it's unclear whether covers 'graceful' worker shutdown.

php - Hosting Laravel 4.2 project on share hosting -

i have uploaded laravel 4.2 project on share hosting contents of other folders uploaded directly in root directory, content of public folder uploaded in public_html . but when access url error. parse error: syntax error, unexpected '[' in /home/vendor/laravel/framework/src/illuminate/support/helpers.php on line 426 has experience before? any appreciated. thanks it looks got unsupported version of php. laravel 4.2 uses short array syntax introduced in php 5.4.

javascript - session not being passed to process.php -

i have looked @ similar questions none seems answer looking for. validation script doesnt recognise input fields - session not being passed. code follows: var data = {}; $(document).ready(function() { $('input[type="submit"]').on('click', function() { reseterrors(); var url = 'process.php'; $.each($('form input, form select'), function(i, v) { if (v.type !== 'submit') { data[v.name] = v.value; } }); //end each $.ajax({ datatype: 'json', type: 'post', url: url, data: data, success: function(resp) { if (resp === true) { //successful validation $('form').submit(); return false; } else { $.each(resp, function(i, v) { console.log(i + " => " + v); // view in console error messages ...

c# - Mobile Website Add Reminder To User Calendar -

developing booking website in mvc5 c# , once user has booked want added booked date user's calendar if access website via mobile device. i've been looking around web find if there solution i've seen device specific solutions android or ios mobile app developmemt. want solution tailored access calendar on mobile devices or android , ios. i want know if possible , starting point c# library? for security reasons, can't access user's calendar directly web app. what can do, though, providing him icalendar file contain details booked. when opening such file, user prompted add calendar. nice thing solution: works platforms, mobile and desktop. to generate icalendar file in c#, can use dday.ical.

Java regex using pattern matcher not returning correctly? -

i have index value following string: home.number[12].parent. i want value of 12. here tried: //escape . / [ ] private static final string pattern = "home\\.number\\[([0-9]*)\\]*"; private static final pattern addresspattern = pattern.compile(pattern); private static int getindex(string input, pattern pattern){ matcher m = pattern.matcher(input); if (m.matches()){ return integer.valueof(m.group(2)); } return -1; } public static void main(string[] args){ system.out.println(getindex("home.number[123].parent", addresspattern); system.out.println(getindex("home.number[456].child", addresspattern); } i -1 both, meaning no match found. using debugger, found m.matches() returning false . unable figure out why. p.s: tried using pattern.quote("home.number[([0-9]*])*") , stringutils.escapejava("home.number[([0-9]*)]*") . both not returning matching results. ...

javascript - Retrieving angular controller via $scope in unit test -

i'm trying retrieve controller via $scope in jasmine test, fail miserably. know why? when using controlleras syntax, controller object put on $scope object using name specified in controlleras. running code below in browser using ng-app='myapp' bootstrap angular, can use chrome-dev tools locate , select directive element, , type $0.scope().mydirctrl in console. yield controller object, why can't retrieve controller object in unit test? running snippet below kick off standalone jasmine browser testing environment. spec test listed @ bottom of snippet. code i'm having issues this: expect($scope.mydirctrl).tobedefined(); /* -------------------------------------- source code --------------------------------------*/ (function(angular) { 'use strict'; // setup template ----------------- angular.module('myapp.tpls', []) .run(['$templatecache', function($templatecache) { $templatecache.put('partials/m...

How to import excel to sql server with some column values transforming into row using asp.net? -

i want import excel file sql server using asp.net c#. the user upload file web page using file upload control. here code. here used outer apply transform columns row. when run code below error coming. ierrorinfo.getdescription failed e_fail(0x80004005). protected void btnupload_click(object sender, eventargs e) { string excelpath = server.mappath("~/files/") + path.getfilename(fileupload1.postedfile.filename); fileupload1.saveas(excelpath); string constring = string.empty; string extension = path.getextension(fileupload1.postedfile.filename); switch (extension) { case ".xls": //excel 97-03 constring = configurationmanager.connectionstrings["excel03constring"].connectionstring; break; case ".xlsx": //excel 07 or higher constring = configurationmanager.connectionstrings["excel07+constring"...

c - Why do I need to use & to pass a pointer to a struct in this stack implementation -

this question has answer here: what reason using double pointer when adding node in linked list? 9 answers in following program need pass argument function using & -operator although expect pointer , function expecting pointer. why need this? the program implements simple stack using linked lists , incomplete types in c . here 3 necessary files: stack.h #ifndef stack_h #define stack_h #include <stdbool.h> struct stack { int number; struct stack *next; }; /* * declare pointer stack structure thereby making use of incomplete * types. clients pull in stack.h able declare variables of type * pstack pointers stack structures. */ typedef struct stack *pstack; bool is_empty(pstack *s); void make_empty(pstack *s); void push(pstack *s, int new_num); int pop(pstack *s); #endif /* stack_h */ stack.c #include <stdio.h> #include ...

Invalid signature with Bittrex API calls in C# -

i trying access wallet balances in bittrex via bittrex's api calls, reason i'm getting response message saying invalid_signature . i use these functions create signature: getnonce private string getnonce() { long ms = (long)((datetime.utcnow - new datetime(1970, 1, 1)).totalseconds); return ms.tostring(); } getapisignature private string getapisignature(string key, string message) { using (var hmacsha512 = new hmacsha512(encoding.utf8.getbytes(key))) { hmacsha512.computehash(encoding.utf8.getbytes(message)); return string.concat(hmacsha512.hash.select(b => b.tostring("x2")).toarray()); } } here's how "compile" calls: public string apiquery(string requesturl) { url = new uri(requesturl); webreq = webrequest.create(url); signature = getapisignature(apisecret, requesturl); webreq.headers.add("apisign", signature ); webresp = webreq.getresponse(); stream = w...

javascript - Can Emstripten compile the iostream library? -

i'm on ubuntu. $ lsb_release -a no lsb modules available. distributor id: ubuntu description: ubuntu 14.04.2 lts release: 14.04 codename: trusty i installed emscripten . $ sudo apt-get install emscripten i wrote following c++ program: #include <iostream> int main(){ printf("hello world\n"); } it compiles expected. $ emcc -o1 -s asm_js=1 main.cpp $ however, when write similar program using iostream facilities: #include <iostream> int main(){ std::cout << "hello world" << std::endl; } it fails build. $ emcc -o1 -s asm_js=1 main.cpp aborting js compiler due exception: unknown vector type <4 x i8> | undefined aborting js compiler due exception: unknown vector type <4 x i8> | undefined aborting js compiler due exception: unknown vector type <4 x i8> | undefined traceback (most recent call last): file "/usr/share/emscripten/emscripten.py", line 1352, in <...