Posts

Showing posts from April, 2010

casting - MATLAB: convert array of int8 to int16 with half its size -

i have array <610x1 int8> read database in matlab , want convert <305x1 int16> since data saved int16. using function "int16" array <610x1 int16>. if data in file, use "fread(fid, filesize,'int16')" not want save und read afterwards. a solution typecast(input,'int16')

java - Hibernate : object references an unsaved transient instance - save the transient instance before flushing -

i receive following error when try list using hibernate + postgresql myobject: @entity @table(name = "my_objects", schema = "public") public class myobject implements java.io.serializable { private static final long serialversionuid = 1l; @id @column(name = "my_object_id", unique = true, nullable = false) @generatedvalue private long myobjectid; @manytoone(cascade = cascadetype.all, fetch = fetchtype.lazy) @joincolumn(name = "owner_id") private user user; @column(name = "scheme_zone_name", length = 150) private string schemezonename; @temporal(temporaltype.date) @column(name = "create_dt", length = 13) private date createdt; @column(name = "comment", length = 250) private string comment; public myobject() { } public myobject(long myobjectid) { this.myobjectid = myobjectid; } public myobject(long myobjectid, user user, string myobjectname, date createdt, string) { this.schemezoneid = schemezo...

c# - Unable to create a new mail with multiple recipients with mailto uri -

i using creating windows 8.1 store app in winrt . i unable create new mail multiple recipients mailto uri separating each email either comma or semi colon, both gives me same error. invalid uri: hostname not parsed. the mailto strings looks this "mailto:username@mail.com,username2@mail.com" "mailto:username@mail.com,username2@mail.com," "mailto:username@mail.com, username2@mail.com" "mailto:username@mail.com;username2@mail.com" "mailto:username@mail.com;username2@mail.com;" "mailto:username@mail.com; username2@mail.com" i have tried these variants give me same error when newing uri, this. var uri = new uri(string.format("mailto:{0}", mails)); i have no idea doing wrong, or in case not implemented why wouldn't be? i created few unit tests see if variations work, no.. [testclass] public class urimailtotest { private uri createmailtouri(string mail) { if (string.isnullorempty(m...

c# - How to restrict user in opening multiple Tabs in a browser while performing tasks? -

i have restrict users in opening multiple tabs of browser security purposes bank. want user perform tasks in single tabs of browser only. if try open multiple tabs user ids must forcefully log out. i don't know how this. please me out or provide me logic s this. thanks in advance. first, have agree other users -- if having more 1 tab open security issue, have problems. big problems. however, if still want this: when user logs in: // must string var datetimestamp = "" +new date().gettime(); // 1 can seen windows/tabs localstorage.setitem("timekey", datetimestamp); // 1 can seen current window/tab sessionstorage.setitem("timekey", datetimestamp); now, when page loads, check see if 2 values match: var localkey = localstorage.getitem("timekey"); var sessionkey = sessionstorage.getitem("timekey"); // if there key: if (localkey) { if (localkey !== sessionkey) { // handle multiple login here? redir...

csv - Vba dowload file from internet WinHttpReq with login not working -

i have been looking solution automatize dowload of csv table site, haven't found working solution. if on ie or chrome, after previous log in enter url , file automatically start dowloading. @ purpose have way of achieving need through ie , html object navigating , saving, uses sendkeys , not suitable solution. tried achieve winhttpreq download me seems efficient , elegant way it. problem : it downloads file unfortunately outputs csv file html code of login page -> must fail logging in. site http. following code found posted in several forums. sub downloadfile() dim myurl string valore = range("f6").value myurl = "www.myurlpointingtodownload.com" dim winhttpreq object set winhttpreq = createobject("microsoft.xmlhttp") winhttpreq.open "get", myurl, false, "eimail@g.com", "passs" winhttpreq.send myurl = winhttpreq.responsebody if winhttpreq.status = 200 set ostream = createobject("adodb.stream...

asp.net mvc - Bootstrap button icon on type input submit not visible -

my hyperlink @ end looks fine. first "button", input of type submit, looks bad bootstrap. not see image on button. actually, guess have use submit button razor how can nice button style bootstrap? there no icon visible! <input type="submit" class="btn btn-default fa fa-save" id="saveteststeps" /> looks good, icon visible: <a class="btn btn-default" href="#"><i class="fa fa-plus"></i></a> the icon classes not intended applied alongside other classes, such buttons. specifically, icon classes things hide text, , have own padding, height, line-height, etc. definitions. if need use icon in button, use button element i element inside. in general, should avoid input s buttons, though. html should have never allowed in first place, confuses purpose of element: rendering user input control, button technically not.

python - Is the Unicode code point value equal to the UTF-16BE representation for every character? -

i saved strings in microsoft agenda in unicode big endian format (utf-16be). when open shell command xxd see binary value, write down, , value of unicode code point ord() ordinal value character character (this python built-in function takes one-character unicode string , returns code point value), , compare them, find equal. but think unicode code point value different utf-16be — 1 code point; other encoding format. of them equal, maybe different characters. is unicode code point value equal utf-16be encoding representation every character? no, codepoints outside of basic multilingual plane use two utf-16 words (so 4 bytes). for codepoints in u+0000 u+d7ff , u+e000 u+ffff ranges, codepoint , utf-16 encoding map one-to-one. for codepoints in range u+10000 u+10ffff, 2 words in range u+d800 u+dfff used; lead surrogate 0xd800 0xdbff , trail surrogate 0xdc00 0xdfff. see utf-16 wikipedia article on nitty gritty details. so, utf-16 big-endian bytes, when printed...

javascript Google scripts create a document within a folder -

i have tried countless techniques, not able docslist.createfile('example file', 'example file contents'); to create google document file. creates plain text file. have tried adding mime type. not work- think may bug in google. whatever file seems open in "viewer" however there workaround, seems simple, sure there way using? doc = documentapp.create('document name'); i cant folder. thanks help. yes possible. either try using driveapp (not docslist) create directly in folder. if wont work, create doc, add folder , remove root.

unix - how to create a file with 9983137 columns containing 0/0? -

i'm not in programming, i'm asking basic question : how create file 9983137 columns, each 1 containing 0/0 ? i tried using vim didn't succeed.. appreciated, in advance, vschill perl -e 'print "0\0 " (1..9983137) ;' > largefile.txt to verify use wc command on generated file

.net - Hide TextBox of MS Report -

Image
i use same ms report different code of parameters inside of report , pointed textbox (i.e. [@customergroup]) , empty. so hide textbox completely. know can pass string.empty need hide entire title or in other words textbox . is possible do? what found tha working little bit ugly approach. in code have parametervalues.add(" "); and in ms report designer

java - when wouldn't i want to nullify every list item when using adapter? -

i'm using image adapter fill android listview. i know adapter recycles items in listview . but if need nullify every view in each item in list, what's benefit anyway in recycling items?a i mean, when wouldn't want nullify every list item? i have tried nullify every view in item have thought - what's point in recycling anyway , how can avoid tedious nullifying. adding: my problem when change image view in first item's layout i scroll down , see image has changed in 4th , 8th items. it gives changed image instead of default one. i can overcome putting defualt image everytime (appears in layout xml anyway) but think: have on evry single view in item's layout? why not defaults xml? the listview recycles views contained in list. views merely visual representations of data provided adapter gives it. listview absolutely nothing actual data showing. don't have nullify anything. the reason happens in listviews, list items same...

java - How to call a non static abstract method from another class -

this header of abstract class public abstract class recursivego extends jframe implements actionlistener i want take method class, non static, , call in main method of driver of class. have not yet made driver, know if extend class driver , make driver subclass come error because not overriding actionlistener. how can call non static method abstract class in non abstract driver? if there useful non-static method depends on subset of class (i.e. doesn't depend on actionlistener), entire class has stay abstract, sounds there's clean line of separation there. refactor class extract subset, , make available driver. public abstract class recursivego extends jframe implements actionlistener { private final usefulsubset usefulsubset; public recursivego() { usefulsubset = new usefulsubset(); } // static, can address recursivego.usefulsubset. // maybe extends jframe, too, , if made top-level class // recursivego further subclass subset. public st...

java - Image Loader "SkImageDecoder::Factory returned null" -

i pass view imageview imageloader class have created, reason getting error "skimagedecoder::factory returned null" seems happen images, url's should fine with. load 3 out of list of ten. wondering if task wasn't thread safe or else may have missed. take below imageloader: public class imageloader { memorycache memorycache = new memorycache(); filecache filecache; private map<imageview, string> imageviews = collections .synchronizedmap(new weakhashmap<imageview, string>()); executorservice executorservice; public imageloader(context context) { filecache = new filecache(context); executorservice = executors.newfixedthreadpool(5); } final int stub_id = r.drawable.failed_load; public void displayimage(string url, imageview imageview) { system.out.println(url); imageviews.put(imageview, url); bitmap bitmap = memorycache.get(url); if (bitmap != null) { ...

Use Photoswipe with AngularJS -

i having problem photoswipe , angular. i'm doing images server using $http.post , pushing objects array of images, i'm initializing photoswipe. in success have this: $scope.gallery.push(images server); myphotoswipe.initialize() but error: code.photoswipe.createinstance: no images passed , initialize getting fired before items in view. i can see images in view of course not attach photoswipe, idea of how can initialize after images in view? ps: have tried this: how can directive fire after view loaded? didn't work me thanks!

java - android how can i get first row of CSV file in my application? -

i developing quiz application in fet question csv file.i fetch data file.but when set data.it set last row of csv file.can me? here code: public class essentialquiz extends activity { private arraylist<string> questionlist = new arraylist<string>(); private arraylist<string> option1list = new arraylist<string>(); private arraylist<string> option2list = new arraylist<string>(); private arraylist<string> option3list = new arraylist<string>(); private arraylist<string> option4list = new arraylist<string>(); button btnanswer1, btnanswer2, btnanswer3, btnanswer4; button btnback, btnnext; textview txtquestion; questiondemo currentq; list<questiondemo> queslist; int score = 0; private int pos = 0; private int count = 0; private int rand[] = new int[10]; boolean flag = false; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.question); ...

java - javafxpackager installs applications one on top of the other on Windows -

i've used netbeans tool wrap swing applications native installer. however, applications seem install same destination folder on windows , isn't clear me configure this. i'm assuming installer accepts universal unique identifier potential upgrades application might change name , identifier identical between both installers. can't seem find such identifier defined though? the javafx packager determines install target directory based on vendor name specified creating package. application name used name shortcut application. i assume using javafx ant task create installer. in case, have build target setting fx task this: <fx:deploy ... > <fx:application name="${application.title}" mainclass="..." /> <fx:info title="${application.title}" vendor="${application.vendor}" /> [...] </fx:deploy> in case, need set ${application.vendor} property whatever want target directory.

jquery - How to successively change a class on click -

Image
suppose have list of div: <div id='d-1' class='hidden'>this one<br /> <button onclick='next();'>next</button> </div> <div id='d-2' class='show'>second 1 <br /> <button onclick='next();'>next</button> </div> <div id='d-2' class='hidden'>third one<br /> <button onclick='next();'>next</button> </div> <div id='d-2' class='hidden'>fouth 1 <br /> <button onclick='next();'>next</button> </div> and css: .show { color: red; } .hidden { color: green; } how can change classes successively? i try by: $(function(){ function next(){ $(this).removeclass('show').addclass('hidden'); } }); any help? here code in jsfiddle : edit updated here your question has several aspects try adress each 1 one. if use chrome dev too...

Php Codeigniter data share to facebook -

is possible share custom data in facebook wall without using fb connect? i'm developing application using codeigniter php. wan't share data user's facebook wall using his/her email address user provided personal information in application. is possible send data without using fb connect? if so, can teach me how? you should use facebook libraries in application. can't share on wall without user agreement.

AngularJS : Service data binding -

i trying call service in angular.js through controller on load , return promise. expect promise fulfilled , dom updated. not happens. clear, not getting error. code follows. app.controller('tutorialcontroller', function ($scope, tutorialservice) { init(); function init() { $scope.tutorials = tutorialservice.gettutorials(); } }); <div data-ng-repeat="tutorial in tutorials | orderby:'title'"> <div>{{tutorial.tutorialid}}+' - '+{{tutorial.title + ' - ' + tutorial.description}}</div> </div> var url = "http://localhost:8080/tutorial-service/tutorials"; app.service('tutorialservice', function ($http, $q) { this.gettutorials = function () { var list; var deffered = $q.defer(); $http({ url:url, method:'get' }) .then(function(data){ list = data.data; deffered.r...

python - Split value into bins based on time -

i'm working in python modifying new york city subway turnstile data turn visualization of entrance/exits each station. so far have list of entrance/exit counts based on start ( 03-24-15 ) , end ( 03-27-15 )dates: { 'endtime': '03-25-14t21:40:30', 'entriesduringperiod': 158, 'exitsduringperiod': 597, 'starttime': '03-25-14t17:03:23' }, { 'endtime': '03-26-14t01:00:00', 'entriesduringperiod': 29, 'exitsduringperiod': 235, 'starttime': '03-25-14t21:00:00' }, the problem have different time periods not standardize , overlap. i'd able go through , create list normalizes these numbers 1 hour increments. i'm not familiar python time processing, , wondering if provide information how started taking strings, converting them date objects, , dividing values based on time. the final visualization visualized using d3.js if matters. getting strings datetime objects isn...

Using Android Window Animations in a Fragment -

i have fragment i'm working has scrollable tabs in it. have button on 1 of fragments opens sub activity. want use translate animation android offers it's giving me errors. button onclicklistener code: button.setonclicklistener(new view.onclicklistener() { @override public void onclick(view arg0) { intent intent = new intent(getactivity(), subactivity.class); bundle translatebundle = activityoptions.makecustomanimation(getactivity(), r.anim.slide_in_left, r.anim.slide_out_left).tobundle(); startactivity(intent, translatebundle); } }); android studio giving me error: startactivity (intent) in fragment cannot applied (intent, android.os.bundle) i tried searching s.o. didn't find anything. help appreciated! edited answer try this!! intent intent = new intent(getactivity(), subactivity.class); startactivity(intent) getactivity().overridependingtransition(r.anim.slide_in_left, r.anim.slide_out_le...

node.js - Grunt insert string after pattern in file -

i'm building custom task grunt finds particular font, , outputs definition uses php variable configuring particular font. it uses underscore , postcss. it groups css selectors use font, , outputs string similar one: selector1, selector2, selector3 { font-family: <?php echo $font_1 ?>, font 2, font 3, font 4; } here code custom task: // extract configurable font data // ====================================================================== grunt.registertask('extractfontdata', 'extract configurable properties', function () { console.log('extracting configurable font data'); var match = /myriad pro/gim; var contents = grunt.file.read('assets/css/leadscon.css'); var css = postcss(function (css) { var findings = {}; css.eachdecl(function (decl) { if (decl.value.match( match ) && decl.parent.selector !== undefined) { var fonts = decl.value.replace(/(\r\n|\...

java - How to get results onPostExcute in AsyncTask? -

Image
i've been using asynctask few days. old code works on api 8 runonuithred dosn't work on >api 18. want send data db json in doinbackground() , data in onpostexecute(). how separate code 2 parts? class getproductdetails extends asynctask<string, string, integer> { @override protected void onpreexecute() { //bla-bla-bla } protected integer doinbackground(string... args) { int success = 0; try { list<namevaluepair> params = new arraylist<namevaluepair>(); params.add(new basicnamevaluepair("pid", pid)); jsonobject json = jsonparser.makehttprequest( url_product_detials, "get", params); success = json.getint(tag_success); } catch (exception e) { e.printstacktrace(); } return success; } protected void onpost...

javascript - Request for the username and password again if either is wrong -

how make when password and/or username wrong ask password and/or username again? var user = prompt("please enter username continue.").touppercase(); if (user === "ryebread4") { var pass = prompt("please enter password continue").touppercase(); if (pass === "7277") { console.log("welcome ryebread4"); } else { console.log("username or password incorrect! please try again"); } } use while loop var signedin = false; while(!signedin) { ... if (password === "7477") { console.log("welcome back!"); signedin = true; } ... } or for (not recommend) var username = ""; var password = ""; for(;username !== "ryebread4" && password !== "7477";) { //prompt user username/password ... } that same methodology can applied while loop, , eliminate variable.

c - Socket connect() always returns zero -

i'm writing basic c program on linux utilizes sockets. sake of simplicity, shortened code this: #include <sys/types.h> #include <sys/socket.h> #include <arpa/inet.h> #include <stdio.h> int main(int argc, char const *argv[]) { int sock, ret; struct sockaddr_in sin; sock = socket(pf_inet, sock_stream, 0); printf("%d\n", sock); ret = connect (sock, (struct sockaddr*)&sin, sizeof(sin)); printf("%d\n", ret); return 0; } and output get: 3 0 as can see, connect() returns 0 invalid sockaddr_in . returns 0 regardless of address passed it. it working fine earlier, sudden not. logically, tells me problem local, can't figure out is. it strange because problem connect() failing -1 though 1 thinks 'did right', rather connect 'working' (returning zero) when it's not supposed to. please advise. i running ubuntu 12.04 x64. there's no guarantee uninitialized struct ...

html - Increase DIV width by float elements -

i want make div auto increase width . have tried it's not working: problem? http://jsfiddle.net/silverlight/b6k8x/1/ html: <div class="metro"> <div class="rail"> <div class="track">a</div> <div class="track">b</div> <div class="track">c</div> </div> </div> css: .metro{ position :relative; background :rgba(255, 255, 255, .03); width :150px; height :128px; padding-bottom :28px; overflow :hidden; overflow-x :scroll; } .metro .rail{ white-space:nowrap; position :relative; width :auto; background :rgba(255, 255, 205, .03); height :128px; min-height :128px; overflow-y :hidden; } .metro .rail .track{ text-align:center; display :inline-block; float :left; margin-right :10px; width :64px; height :128px; background :rgba(255, 105, 255...

android - Rectangle shape as background causes black background -

Image
i create border around rablerow. using following shape background. bg_stroke_dotted_right <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:top="-4dp" android:left="-2dp" android:bottom="-4dp" android:drawable="@drawable/stroke_dotted"> </item> </layer-list> stroked_dotted drawable <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" > <solid android:color="#000000" /> <stroke android:dashgap="4dp" android:dashwidth="2dp" android:width="2dp" android:color="@color/greydark" /> </shape> i n...

Java Serialization to transfer data between any language -

question: instead of writing own serialization algorithm; possible use built in java serialization, have done below, while still having work across multiple languages? explanation: how imagine working, follows: start process, be language-specific program - written in language. i'd have cppexecutor.exe file, example. write data stream program. program needs do, return result. to this, need serialize data in way. first thing came mind basic java serialization use of objectinputstream , objectoutputstream . of have read has stated java serialization java-to-java applications. none of data ever need stored in file. method of transferring these packets through java.lang.process , have set already. the data composed of following: string - containing information displayed user. integer - 32-bit. won't need deal times. float - handle floating-point values. character - ensure proper types used. array - composed of of elements in list. the best way have ...

C# TCP Application deadlocks on one computer and never deadlocks on another -

i'm not sure how approach this. hesitant showing code because it's university assignment. need place start. i'm making tcp card game 4 players , server. every 100ms, player asks update server using background worker. server accepts client connection , reads in enumeration value (sent int32) tells action wants server send (update, card, player, etc) , value read in based on enumeration value (recieving update enumeration means needs read in int32 next). server sends response based on enumeration read in. here's problem occurs. have custom built computer (2500k processor, win8 x64) , when execute program on it, loop forever, accepting client requests , sending appropriate response back. expected! however, on laptop (levono yogapad, win8 x64) , forth exchange lasts around 30-50 requests , deadlocks. it's @ same spot. server has read in enumeration , awaiting second value. client past part of sending enum , value , waiting results. stable on desktop , deadlocks...

java - how to change all bookmarks property to inherit zoom in existing pdf using itext -

this code change property of root bookmark inheritzoom. want access kids array of bookmarks , bookmarks inherit zoom. how access kids array of bookmarks? want change property of bookmarks not destinations. how achieve? can me out this. list<hashmap<string,object>> list = simplebookmark.getbookmark(reader); for(hashmap<string, object> lis:list) { system.out.println(lis.size()); lis.put("page",string.format("%d %s",page++,"xyz")); } you want access kids of bookmark. done this: list.get("kids");

asp.net mvc - Google Play Store API Search for c# or .Net Application -

i looking api / service searching app / games of google playstore api can having code or tips complete task google api can checked in google api explorer page . use api, can check out code snippet article - alternate ways invoke rest api .

php - SQL inner join of multiple tables and search through database -

i'm making search function in php , have 3 tables wish join single one; 3 tables looks follow: band id | bands ---+---------- 1 | muse 2 | coldplay 3 | etc. release id | releases ---+---------- 1 | showbiz 2 | origin of symmentry 3 | etc. track id | tracks ---+----------- 1 | sunburn 2 | muscle museum 3 | etc. i want these tables put this: discografic id | band_id | release_id | track_id ---+----------+-------------+--------- 1 | 1 | 1 | 1 2 | 1 | 1 | 2 3 | etc. so table sql code looks this: discografic id | bands | releases | tracks ---+----------+-------------+--------- 1 | muse | showbiz | sunburn 2 | muse | showbiz | muscle museum 3 | etc. i want inner join these tables. joined 1 can't figure out how last joined well. select * band inner join discografic on band.id = discografic.band_id this should have own question; want able search database, have result show once, , referenc...

Bash while sed is not null -

i need while loop when sed not null. example: file 1 line1 line2 line3 file 2 i=1 while sed "${int}p" # here need expression checks if line not null # here echo line , i++ i tried write while sed -n "${int}p" not work expected. you can use = command in sed number of lines: sed -n '/./!q;=;p' input | sed 'n;s/\n/ /' for input: a b c d this gives: 1 2 b 3 c if want line number of line before first non-empty line: sed -n '/./!q;=' input | tail -1 a while loop prints lines: while read line; echo "$line" done < input

scala - Difference between Option(value) and Some(value) -

i new scala ! my question is, if there case class contains member myitem:option[string] when construct class, need wrap string content in: option("some string") or some("some string") is there difference ? thanks! if scala's sources you'll notice option(x) evaluates x , returns some(x) on not-null input, , none on null input. i'd use option(x) when i'm not sure whether x can null or not, , some(x) when 100% sure x not null . one more thing consider when want create optional value, some(x) produces more code because have explicitly point value's type: val x: option[string] = some("asdasd") //val x = option("asdasd") // same , shorter

javascript - Why can't I get this 3D model (.obj) to display on screen? -

i'm trying display 3d model bodyparts3d using three.js. example, this 3d model of human stomach (check box , click download). try might, have been unable it. i first tried 'naive' approach of substituting '.obj' file 1 in three.js obj-loader example . there no error messages. object doesn't display anywhere. played around configuration of camera, lighting , object. no luck. none of tips this question have helped me either. i quite inexperienced 3d, i'm missing simple. appreciate pointers. i should point out able load models artofillusion , 'work'. i not sure if downloaded same object did objects in stomach zip not centered around (0,0,0). in fact center of object @ (38.2862, -137.925, 1098.39). before rendering object need transform close 0 or move camera there.

extbase - Repository/controller: How can I force TYPO3 to load the field "sorting"? -

in controller/template i'd have access field sorting of entity. i've tried access like: $category->getsorting(); but fails, method not exist. when dump entity, meta fields, hidden , starttime etc. aren't listed @ all. how can tell typo3 load fields along other fields of entitiy? since in extbase context, have add property model or (if use model of extension) extend , add property. in both cases getter , setter method needed if want access , edit properties value: /** * @var integer */ protected $sorting; public function setsorting($sorting) { $this->sorting = $sorting; } public function getsorting() { return $this->sorting; } make sure have field configured in tca well: ... 'columns' => array( 'sorting' => array( 'label' => 'sorting', 'config' => array( 'type' => 'passthrough' ) ), ... after should able ac...

ios - Adding NSString to NSMutableString -

i want add multiple nsstrings yo nsmutablestring construct list of strings. this code in method takes nsdictionary , grabs value out of - stores in nsstring , there append string nsmutablestring . when running method first time works. however, when call method again, replaces last string in nsmutablestring . here code: nsstring *userid = [nsstring stringwithformat:@"%@,", parameters[@"userid"]]; self.alluserids = [nsmutablestring string]; [self.alluserids appendstring:userid]; can tell me doing wrong? self.alluserids declared strong . this: self.alluserids = [nsmutablestring string]; is creating new mutable string. should done once, before want use mutable string, , not done again until want restart (because recreating mutable string destroys old instance had).

Excel VBA Save sheet so it opens on last row -

this should dead simple i'm throwing total blank far, i've googled around , not found answer either. i'm creating new workbook using vba , i'd save workbook opens on last row containing data when user opens it. have far:- activeworkbook 'added last row selection sheet open @ bottom of page - ash 07/04/14 lastrow = range("a65536").end(xlup).select rows(activecell.row).activate .saveas str_destfolder & str_file, fileformat:=xlopenxmlworkbook, accessmode:=xlshared .close end somehow failing me, appreciated! you add following line, after activating last row: activewindow.scrollrow = activecell.row so full code be activeworkbook lastrow = range("a65536").end(xlup).select rows(activecell.row).activate activewindow.scrollrow = activecell.row .saveas str_destfolder & str_file, fileformat:=xlopenxmlworkbook, accessmode:=xlshared .clo...

linux - Where can I find .curlrc file on UBUNTU? -

where can find .curlrc file? have tried $home/ , echo $curl_home gives me blank line. have tried find . -name ".curlrc" in $home. no results. please help updatedb && locate curlrc make sure run command root or could... nano ~/.curlrc this should be. i believe default though, there no curlrc file. might have create own

manifest - Chrome Extensions - Script works only once, when I download a page the first time -

the problem after downloads page first time, works, if click on "home" link, script doesn't work anymore. manifest: { "manifest_version": 2, "name": "facebook no advs", "description": "this extension try avoid advertisement facebook home.", "version": "1.0", "permissions": ["https://www.facebook.com/*"], "content_scripts": [ { "matches": ["https://www.facebook.com/*"], "js": ["jquery-1.11.0.min.js", "noadvsscript.js"], "css": ["noadvsstyle.css"] } ] }

excel vba - How to determine time at which PC was woken -

is there function in excel vba returns time elapsed since pc last woken sleep or hibernate? or when booted? whichever recent? here's way figure out last time pc booted up. it's in visual basic: http://www.c-sharpcorner.com/uploadfile/scottlysle/determine-the-time-since-the-last-boot-up-in-visual-basic3/ i haven't seen may return time of when woken up, though.

javascript - jQuery animation doesn't run fluently -

i learning how schedule animations via javascript, of jquery. tried blink h1 tags, animation doesn't seem run fluently. stops while , go on. core animation code: function animslideheading() { $('.slide h1').animate({ opacity: .6 }, 500, 'swing', function() { $('.slide h1').animate({ opacity: 1 }, 500, 'swing', animslideheading); }); } see this jsbin . there several elements matching selector $('.slide h1') , callback called multiple times, once each element animated, , animslideheading runs more , more times longer goes, messing up. to solve it, can use promises resolve when animations have completed elements in collection collectively function animslideheading() { $('.slide h1').animate({ opacity: 0.6 }, 500, 'swing').promise().done(function () { $(this).animate({ opacity: 1 }, 500, 'swing').promise().done(animslideheading); ...

Allegro 5, C++, and Math -

i'm writing game, , i've decided use allegro 5 , c/c++. i've worked out of bugs in code far, i've come graphics , mathematical computations included, , i'm stuck. here's short version: al_draw_rotated_bitmap(...) doesn't much. image onscreen, other times isn't. i've verified loaded drawing al_draw_bitmap(...) , , well, plus, no segfaults on drawing, else works. just reference, documentation says arguments of al_draw_rotated_bitmap(...) : al_draw_rotated_bitmap(allegro_bitmap *bitmap, float cx, float cy, float dx, float dy, float angle, int flags) where cx x-center, cy y-center, dx x-destination, dy y-destination, angle angle rotate in radians, , flags combination of things telling allegro if should perform +/- 90 degree turn on bitmap. i've tried many things, , none of them produce desired results. i've tried making c&d(x,y) same, different, setting dx&dy center of rotation, cx&cy various points in bitm...

pushSharp in vb.net for android -

i follow wiki of pushsharp project , write code send notification device. https://github.com/redth/pushsharp/wiki/how-to-configure-&-send-gcm-google-cloud-messaging-push-notifications-using-pushsharp imports pushsharp imports pushsharp.android imports pushsharp.core module module1 sub main() console.writeline("start notification : ") dim push new pushbroker() addhandler push.ondevicesubscriptionexpired, addressof devicesubscriptionchanged addhandler push.onchannelexception, addressof channelexception addhandler push.onserviceexception, addressof serviceexception addhandler push.onnotificationfailed, addressof notificationfailed addhandler push.ondevicesubscriptionexpired, addressof devicesubscriptionexpired addhandler push.ondevicesubscriptionchanged, addressof devicesubscriptionchanged addhandler push.onchannelcreated, addressof channelcreated addhandler push.onchanneldestroyed, addressof channeldestroyed push.reg...

ios - Unwind segues not working with modal view controllers -

i'm working on storyboard-based iphone app. using unwind segues navigate stack of view controllers. however, when present modal view controller cannot seem able trigger unwind segue have specified in storyboard file. is normal or bug? problem solved. apparently i've hit glitch storyboard editor. did delete destination (modal) view controller , re-create it. works fine, now. bug report filed.

javascript - Running test cases selectively with Mocha -

there total of 20 test case files. want test particular set of 10 test cases. there script file or other method run test cases selectively mocha? there 2 principal ways specify subset of tests run: you can give mocha name of file contains tests want run: $ mocha path/to/file it possible give paths multiple files if needed. instance, if have 10 test files , want run tests 2 of them, give paths of 2 files. this method relies on splitting tests separate files according logic suits situation. you can use --grep option: $ mocha --grep pattern the pattern regular expression mocha use test each test title. each test pattern matches run. the 2 methods combined run tests match pattern , 1 specific file: $ mocha --grep pattern path/to/file

php - Check Log in, email is in a different table to password. How? -

i have user table has passwords, teacher stable has e-mail. to log on need enter e-mail , password, have following, not working :/ $sqlquery="select s.password, t.email, s.id, t.id user s, teacher t t.email='$myemail' , s.password='$newpassword' , s.id = t.id"; $result=mysql_query($sqlquery); //then checks row number etc, part works. enter code here help appreciated! try $sqlquery="select s.password, t.email, s.id, t.id user s, teacher t t.email='".$myemail."' , s.password='".$newpassword."' , s.id = t.id"; $result=mysql_query($sqlquery);

mysql - Which one of these is better for ASP.NET Access database for forum -

is better have 1 table 10 000 entries, or better have 100 tables 100 entries. idea create table each thread created, table store posts thread. sugested me have 1 master table entries of threads, , when open specific thread call entries table (e.g. id of thread) performance wise there should little (if @ all) difference. logically , rationally, however, creating table each , every thread makes no sense. makes more sense have table threads (i.e.: thread name , thread id relationship, created date, etc.) , using thread id foreign key in table posts (i.e.: post id , thread id belongs). of course in end won't matter much, unless forum begins grow considerable size (5,000+ regular users).

c++ - Why does the following program works fine? I am returning a reference to local variable from a function -

this question has answer here: can local variable's memory accessed outside scope? 20 answers i baffled how come following program works fine. returning reference local variable function , reference assigned value more once. expect compiler throw error reference assignment. #include <iostream> using namespace std; int& getnum() { int mynum = 89; return mynum; } int& getanothernum() { int mynum = 1000; return mynum; } int main() { int& value1 = getanothernum(); cout << "value1 value is: " << value1 << endl; value1 = getnum(); cout << "value1 value is: " << value1 << endl; return 0; } that undefined behavior. per §1.3.24, undefined behavior described as: behavior international standard imposes no requirements contrary popular be...

How to test a PayPal capture API call with Sandbox -

i have setup paypal sandbox test accounts, personal (buyer) , business (merchant). i'd test paypal ' docapture ' api operation. problem i'm encountering need authorizationid , don't know how obtain it. if run 'doexpresscheckoutpayment' api call, not authorizationid returned, using merchant api credentials, though 'ack' of success. need using buyer credentials 'doexpresscheckoutpayment' call? don't see api credentials in paypal sandbox profile personal account. express checkout example authorization , capturing can find here . short answer - according docapture documentation authorizationid ... transaction id returned doexpresscheckoutpayment... according doexpresscheckout documentation need field response, attention, paymentinfo#transactionid ... value authorizationid use authorization & capture apis.

artificial intelligence - Is an optimal algorithm a complete algorithm? -

i understand complete algorithm 1 if there solution, algorithm able find , optimal algorithm 1 manages find least cost solution. but optimal algorithm, complete algorithm? can please briefly explain? thanks. yes, definition. finding optimal solution entails proving optimality. can done finding solutions or proving no solution can have better cost 1 found already. in either case, @ least 1 solution has found. if there no solution, neither optimal nor complete algorithm find 1 of course.

visual studio 2012 - Resharper view resolve stopped working after general NuGet update -

after updating packages in nuget manager, i've noticed view resolvement feature of resharper have stopped working. can't navigate view, , no longer have option of creating new view. a lot of packages updated, among them mvc , razor. if you're using resharper 8, need update latest resharper 8.2, , make sure update resharper's extension 'external annotations'. pull updated files required mvc , razor support. if you're using previous version of resharper, here's workaround @derigel use: about workaround previous versions of resharper: you can download package annotations https://resharper-plugins.jetbrains.com/api/v2/package/resharper.externalannotations/8.1.1000.431 , unpack content of resharper\vany\annotations\ folder c:\program files (x86)\jetbrains\resharper\vx.y\bin\externalannotations , x.y version of resharper. better first clean target folder avoid annotations duplicates.

linux kernel - Accessing Platform Device from Userpace -

from general standpoint, trying figure out how access platform device userspace. more specific, have emif controller on , soc of have added device tree , believe correctly bound pre-written emif platform device driver. trying figure out how can access emif device userspace application. have come accross couple different topics seem have connection issue cannot quite find out how relate. 1) read seems i/o done through use of device nodes created mknod() , need create device node in order access device? 2) have read couple threads talk writting kernel module (character?, block?) can interface both userspace , platform device driver, , use intermediary. 3) have read possibility of using mmap() map memory of platform device virtual memory space. possible? 4) seems when emif driver instantiated, calls probe() fucntion. functions userpace application call in driver? it's not clear you're needing (and should caveat have no experience emif or "platform devic...