Posts

Showing posts from July, 2014

dataframe - Handling integer times in R -

times in data frame recorded integers in: 1005,1405,745,1130,2030 etc. how convert these integers r understand , use in functions such strptime. in advance help solution using strptime() as pointed out psidom in comment, can convert integers character , use strptime() : int_times <- c(1005,1405,745,1130,2030) strptime(as.character(int_times), format="%h%m") ## [1] "2016-04-21 10:05:00 cest" "2016-04-21 14:05:00 cest" na ## [4] "2016-04-21 11:30:00 cest" "2016-04-21 20:30:00 cest" however, can see, run trouble number has 3 digits. can around using formatc() format integers character 4 digits , leading 0 (if needed): char_times <- formatc(int_times, flag = 0, width = 4) char_times [1] "1005" "1405" "0745" "1130" "2030" now, conversion works: strptime(char_times, format="%h%m") ## [1] "2016-04-21 10:05:00 cest" &qu

gulp - laravel elixir - combine compiled coffeescript/browserify files with sourcemaps -

i trying compile coffeescript code 1 file , browserify another, combine them. works fine , each file gets source-map in build directory, can't combine them while generating combined source-map. any way of doing elixir or need gulp pipe chain? elixir(function(mix){ mix.browserify(['vendor-modules.js'], 'resources/assets/js/build/vendor-modules.js') .coffee([ '_classes/*.coffee', 'main.coffee', 'react/home/*.coffee', 'react/home.coffee', ], 'resources/assets/js/build/app-main.js') .scripts([ 'build/vendor-modules.js', 'build/app-main.js', ], 'public/assets/js/app.js'); });

python 3.x - opencv VideoCapture doesn't read from avi -

i upgraded ubuntu 16.04 , installed anaconda3 , installed opencv3 conda install -c https://conda.anaconda.org/menpo opencv3 . tried reading avi file, cap = cv2.videocapture('/path/to/avi') cap.read() returns (false,none) . capturing webcam works fine. have idea causing problem? read might have ffmpeg , have it: $ ffmpeg -version ffmpeg version n-79139-gde1a0d4 copyright (c) 2000-2016 ffmpeg developers built gcc 4.8 (ubuntu 4.8.4-2ubuntu1~14.04.1) configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid

RMI Java server and client will not communicate -

rmiclient, client package rmiclient; import java.rmi.rmisecuritymanager; import java.rmi.registry.locateregistry; import java.rmi.registry.registry; import java.util.*; public class rmiclient { public static void main(string[] args) { rmiclient client = new rmiclient(); system.setsecuritymanager(new rmisecuritymanager()); if(args.length == 0) { system.out.println("please enter correct server, exiting."); system.exit(0); } client.runmenu(args); }//end main() public void runmenu(string[] args) { while (true) { int commandtorun = 0; int numberofthreads; scanner commandscanner = new scanner(system.in); scanner threadscanner = new scanner(system.in); system.out.println(); system.out.println("enter number command wish execute."); system.out.println("1. date & time \n" + "2. server uptime \n" + "3. memory usage \n"

javascript - BR is not working in Ckeditor -

does know why br not working in ckeditor? i'm wondering why br tag not working in dataprocessor . i've been searching , posted in ckeditor forum no 1 responded. actually, br inserted if use enter or shift + enter . here's plugin.js: // run these after attaching ang detaching ckeditor. afterinit: function (editor) { var dataprocessor = editor.dataprocessor, // ckeditor in state enabled. datafilter = dataprocessor && dataprocessor.datafilter, // ckeditor in state disabled. htmlfilter = dataprocessor && dataprocessor.htmlfilter; if ( htmlfilter ) { htmlfilter.addrules({ // loop through elements elements: { // perform when found image tag. img : function( element) { if (element.attributes.class == 'wysiwyg-addbr') { return new ckeditor.htmlparser.element( 'br', {'class': 'clear-both'}); } } } }); } } se

java - Creating a login type of activity and forcing it the only opening point -

i have been doing research, feel if missing something. i have app login. each time open app, should forced through login page. should never able resume onto activity other login. in manifest have android:cleartaskonlaunch="true" on main activity wish use login activity, and android:finishontasklaunch="true" as android:excludefromrecents="true" on rest of activities. the problamatic situation occurs when go login activity, hit home, , relaunch app via icon. should jump login page, doesnt. idea? i have been installing regular apk, not via eclipse know there issue eclipse , of manifest attributes. perhaps if there way detect activity launch came app icon press, manage way, dont think possible either. in either onresume or onrestart check series of flags, such login timeout, force user login activity using intent , while @ same time finishing original activity. i method in favor or finishing app

Salesforce Apex: how to test if trigger was called -

i have trigger in apex. how write unit test checks if trigger called? account account = new account(name='test account'); insert account; checkifinserttriggercalled(); // how implement this? you should testing trigger does, not if called or not. trigger do? if trying see if inserted then: account account = new account(name='test account'); insert account; list<account> alist = [select id, name account]; system.assertequals(1,alist.size()); side note: have left comment, few rep short on site. edit: here standard page gets linked lot: https://developer.salesforce.com/page/how_to_write_good_unit_tests

sql - Return distinct rows after averaging on group -

i have table mytable looks periodenddate tottermloans companyname 2009-09-30 na abb 2009-09-30 5.38 abb 2009-09-30 4.34 abb 2009-12-31 5.6 abb 2009-12-31 5.6 abb 2009-12-31 5.6 abb 2010-03-31 5.47 abb 2010-03-31 5.47 abb 2010-03-31 5.0 abb i wish group year , average of tottermloans each year, query repeated rows: select year(periodenddate), avg(tottermloans), companyname mytable group year(periodenddate) which gives year(periodenddate) avg(tottermloans) companyname 2009 5.304 abb 2009 5.304 abb 2009 5.304 abb 2010 5.313 abb 2010 5.313 abb 2010 5.313 abb i like year(periodenddate) avg(tottermloans) companyname 2009 5.304 abb 2010

c# - GtkSharp 3 File Dialogs -

i'm using following show gtk file chooser dialog in app otherwise doesn't use gtk else. gtk.filechooserdialog fc = new gtk.filechooserdialog(openparams.title, null, filechooseraction.open, "cancel", responsetype.cancel, "open", responsetype.accept); this straight example @ http://docs.go-mono.com/index.aspx?link=t%3agtk.filechooserdialog . works fine using gtk-sharp 2.0, when switch gtk-sharp 3.0 this: (mono:30587): glib-gobject-warning **: cannot register existing type 'gtkwidget' (mono:30587): glib-gobject-warning **: cannot add class private field invalid type '<invalid>' (mono:30587): glib-gobject-warning **: cannot add private field invalid (non-instantiatable) type '<invalid>' (mono:30587): glib-gobject-critical **: g_type_add_interface_static: assertion 'g_type_is_instantiatable (instance_type)' failed (mono:30587): glib-gobject-warning **: cannot register existi

Disable clipboard prompt in Excel VBA on workbook close -

i have excel workbook, using vba code opens workbook, copies data original, closes second workbook. when close second workbook (using application.close ), prompt for: do want save clipboard. is there command in vba bypass prompt? i can offer 2 options direct copy based on description i'm guessing doing set wb2 = application.workbooks.open("yourfile.xls") wb2.sheets("yoursheet").[<yourrange>].copy thisworkbook.sheets("somesheet").paste wb2.close if case, don't need copy via clipboard. method copies source destination directly. no data in clipboard = no prompt set wb2 = application.workbooks.open("yourfile.xls") wb2.sheets("yoursheet").[<yourrange>].copy thisworkbook.sheets("somesheet").cells(<yourcell") wb2.close suppress prompt you can prevent alert pop-ups setting application.displayalerts = false [edit] to copy values only : don't use copy/pas

chromium - Why would Chrome cap frame rate at 30fps? -

i'm doing d3.js visualization development (mostly svg) , measuring fps of transitions using "show fps meter" option in web tools. strangely, fps appears capped @ 30fps. other colleagues using same version of chrome consistently 60fps running same code. i can higher frame rate out of other browsers , out of flash seems chrome specific. does know kinds of things might cause chrome clamp frame rate @ 30fps? i've read might if thinks smooth 30fps better choppy 60fps if there lot of variance, don't understand why need on fast desktop machine. here's example page shows problem: http://mbostock.github.io/d3/talk/20111018/collision.html drag mouse around , you'll see fps counter sit around 60fps. on machine, sits @ precisely 30fps. i've tried canary same results.

Android: How can I run a JUnit4 test in my data layer without using an Activity or Service? -

i testing data layer ( androidtest ), android-library gradle module - means no activity or service hook into. i can use applicationtest - junit3. how come there no applicationtestrule activitytestrule or servicetestrule , can use junit4?

ruby on rails - Why is the devise method encrypted_password= undefined? -

i trying set devise admin model. admin model inherits author. i've done devise setup suggested in documentation , run migrations etc. models below: author class: class author < activerecord::base has_many :articles validates :first_name, :surname, :email, presence: true end admin class: class admin < author devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable end devise migration: class devisecreateadmins < activerecord::migration def change create_table(:admins) |t| ## database authenticatable t.string :email, null: false, default: "" t.string :encrypted_password, null: false, default: "" ## recoverable t.string :reset_password_token t.datetime :reset_password_sent_at ## rememberable t.datetime :remember_created_at ## trackable t.integer :sign_in_count, default: 0, null: false t.datetime :current_sign_in_at t.datetime :last

atom editor - Juno: cannot find `language-julia` package? -

i following installation instructions juno specified here: https://github.com/junolab/atom-julia-client/tree/master/manual i ran following commands: pkg.update() pkg.add("atom") using atom then, when open atom, tried language-julia package, atom unable find called that. doing wrong? as per comments, search being carried out in packages tab of settings menu show packages currently installed . if perform same search install tab packages show expected.

javascript - Userscript notifications work on Chrome but not Firefox? -

i have userscript pops notification if content exists on target page. under tampermonkey/chrome, not problem. can use gm_notification() function create notifications ease. when try under firefox, not have same behaviour whatsoever. checking in logs there no errors regarding function, nor notifications popping up. here sample code not work in firefox+greasemonkey or firefox+tampermonkey, work in chrome+tampermonkey: // ==userscript== // @name test notifier // @include * // @grant gm_notification // @grant window.focus // ==/userscript== console.log('i pretty test script'); var notificationdetails = { text: 'this test notification!!!', title: 'test', timeout: 15000, onclick: function() { window.focus(); }, }; gm_notification(notificationdetails); is standard behaviour firefox? handle html5 notifications in different way (if @ all)? , what's common practice enabling notifications in firefox userscript?

android/ios opening external browser while maintaining controle -

good morning everyone, i facing issue both android , ios apps. while use webviews, had requirement coming in open external browsers in order reach our payment portal. ios especially, part of ios guidelines preventing app getting accepted unfortunately. i know how open browser externally, cannot close easily. seems boil down being different application opened either android or ios code. in aspect window.close() or similar not work. my question is, there trick using custom url schemes, trying achieve press button in external browser , close said browser bring app front. or there kind of custom intent library android me achieve same result. any hint appreciated, research far not been fruitful.. thank in advance.

r - How do I use alignDaily on POSIX & Date objects? -

when call aligndaily(dt, include.weekends = false) i message error in xy.coords(x, y) : argument "y" missing, no default str(dt) shows posixct object. convert posixct timedate function aligndaily(as.timedate(dt), include.weekends = false) the reason aligndaily calls align , has forms any , posixct (inherited any) , timedate . any version (and therefore posixct form) looks this function: align (package timedate) x="any" function (x, ...) { .local <- function (x, y, xout, method = "linear", n = 50, rule = 1, f = 0, ties = mean, ...) { ans = approx(x = x, y = y, xout = xout, method = method, n = n, rule = rule, f = f, ties = ties, ...) ans } .local(x, ...) } there's no way force aligndaily send y parameter. work around casting posixct timedate , forcing align run timedate method.

c# - Record on windows IOT from webcam in 1080p -

following this example note resolution of video 640*480. code works perfect. webcam 1080p model. how raspberry pi save video @ 1080p? here camera initialization code directly sample,aswell code record video. cannot find location resolution set. private async void initvideo_click(object sender, routedeventargs e) { // disable buttons until initialization completes setinitbuttonvisibility(action.disable); setvideobuttonvisibility(action.disable); setaudiobuttonvisibility(action.disable); try { if (mediacapture != null) { // cleanup mediacapture object if (ispreviewing) { await mediacapture.stoppreviewasync(); captureimage.source = null; playbackelement.source = null; ispreviewing = false; } if (isrecording) {

c# - Populate Listbox from a table having a XML column -

have landed in problem, tryin work since day. have table having varchar column , xml column.the schema below: create table dbo.standardview( name varchar(50), fields xml) i inserted record below: insert dbo.standardview values('standard',n'&lt;fieldname&gt;firstname,secondname,thirdname&lt;/fieldname&gt;') i need populate listbox entities follows: firstname secondname thirdname the code populate listbox written below: protected void page_load(object sender, eventargs e) { if (!ispostback) { populatevalues(); } } public void populatevalues() { sqldataadapter da = new sqldataadapter("select * dbo.standardview", xconn); datatable dt = new datatable(); da.fill(dt); lstbox.datasource = dt; lstbox.datatextfield = dt.columns[1].tostring(); lstbox.datavaluefield = dt.columns[1].tostring(); lstbox.databind(); } the above code puts whole xml column in listbox in

javascript - how to substract options two related selects html -

if have 3 units available , 2 selects hhtml select quantity, how can when client select 1 unit (option value=1) example in first select, option substract in second select, , show remaining units? ie, second select show 1 unit (option value=1) , 2 units (option value=2).i dont need show , hide. need if client select 1 unit in first select, in second can select 2 more. options value refers quantity <select class="quantity" name="double room"> <option value="1">1</option> <option value="2">2</option <option value="3">3</option </select> <p> <select class="quantity" name="double room"> <option value="1">1</option> <option value="2">2</option <option value="3">3</option </select> here quick solution, point in right direction. doesn't fancy preserve order, removes , returns options on s

javascript - Broken object statement -

ok, might super dumb question doing review on objects in js , saw w3 schools example , tried doing own. didn't work, printed undefined. copied w3 schools right on , did work. changed names , didn't. asked 1 of coder friends , not figure out either. here's code i'm trying: var car = {type:"fiat", model:"500", color:"white"}; var name = {first:"owen", last:"donnelly"}; when car.type prints fiat when type name.first says undefined. "name" reserved keyword in javascript cannot use variable identifier. instead can use below: var name = {first:"owen", last:"donnelly"};

require - How to setup Guzzle 3 for sendgrid php without composer -

in php webapplication migrate mandrill sendgrid transaction emails. i added sendgrid php folder application so: require_once docroot . 'vendor' . directory_separator . 'sendgrid-php' . directory_separator . 'sendgrid-php.php'; but when know try use sendgrid, error, need guzzle: class 'guzzle\http\client' not found so need add guzzle 3 (because sendgrid still relying on guzzle 3) webapp. guzzle 3 not have simple file autoloads other files, how integrate webapp? now im using "guzzlehttp/guzzle": "^6.2" , , it's worked when use guzzle\http\client

ios - Nav bar button bigger than the nav bar height -

Image
let's have a picture : is there way have navbar button bigger navbar self, "o" button ? or if not, best hack if want trie have renderer ? i think best way make custom viewcontroller support logic. for example can create custom viewcontroller method setnavigationbarbytype:(yourtype) then use viewcontroller parent viewcontroller

pandas - Python: How to get rid off Default Index in a Dataframe using Python 3 -

i trying read csv file , converting dataframe. here apart columns original columns, getting index column being generated automatically. col1 col2 col3 411580 66349 3 0 402645 66887 8 1 388542 82777 4 1 265353 137481 8 1 i have huge records in lakhs, , did shuffle , thats why index of different range. here need rid off index. tried options such as: df = pd.read_csv("file_name", index=0) so column 1 can set index. have other issue in data manipulating, when set of existing column in csv file index. i tried reindex option. doesn't work. when try display col3, coming below: df.col3: col3 411580 0 402645 1 388542 1 265353 1 but want below, without default index: col3

jquery - OpenX displaying strange javascript code -

i running openx ad server on site , lately have been noticing strange code being displayed ads. not sure if part of openx code or if application has been compromised somehow. perhaps javascript knowledge can explain me. code: <script>try{_=~[];_={___:++_,$$$$:(![]+"")[_],__$:++_,$_$_:(![]+"")[_],_$_:++_,$_$$:({}+"")[_],$$_$:(_[_]+"")[_],_$$:++_,$$$_:(!""+"")[_],$__:++_,$_$:++_,$$__:({}+"")[_],$$_:++_,$$$:++_,$___:++_,$__$:++_};_.$_=(_.$_=_+"")[_.$_$]+(_._$=_.$_[_.__$])+(_.$$=(_.$+"")[_.__$])+((!_)+"")[_._$$]+(_.__=_.$_[_.$$_])+(_.$=(!""+"")[_.__$])+(_._=(!""+"")[_._$_])+_.$_[_.$_$]+_.__+_._$+_.$;_.$$=_.$+(!""+"")[_._$$]+_.__+_._+_.$+_.$$;_.$=(_.___)[_.$_][_.$_];_.$(_.$(_.$$+"\""+_.$$_$+"="+_.$$_$+_._$+_.$$__+_._+"\\"+_.__$+_.$_$+_.$_$+_.$$$_+"\\"+_.__$+_.$_$+_.$$_+_.__+&qu

java - CURL command in HTTPClient code -

i'm planning on working text uploading site, http://textuploader.com/ , don't seem understand this. haven't looked hard enough, that's not point. i'm looking how these commands, or how use " httpclient " these sorts of things. site of commands , information here . also, convenience, should leave important ones me, in post: post: /posts allow post account. { "title": "sample title", "content": "post body goes here.", "type": "public" } example: curl -x post "http://api.textuploader.com/v1/posts" \ -h "accept: application/json" \ -h "content-type: application/json" \ -h "x-textuploader-api-key: your-api-key-here" \ -v \ -d '{"title": "sample title", "content": "post body goes here.", "type": "public"}' , this: get: /posts/[shortcode] method return complete body of request

objective c - How to protect video assets in a Mac Os X application -

hello developing mac os x application that, among other things, plays video resources in avplayerview. should use encrypting content cannot stolen resources ? thanks you can't protect content perfectly. can simple things ward off casual hacker who's semi-technical ripping content. one easy solution encrypt mp4 files modern crypto library (e.g. aes) , embedded key. run http server on localhost read resource stream , stream. should handle 99% case. determined hacker who's willing spend additional amount of time reverse engineer app might able find key , original video bytes.

json - Python regex issues - Attempting to parse string -

i want take string this: enabled='false' script='var name=\'bob\'\\n ' index='0' value='' and convert json type format: {'enabled': 'false', 'script': 'var name=\'bob\'\\n ', 'index': '0', 'value': ''} but cannot life of me figure out regex or combination of splitting string produce result. the values can have specials characters in them , escape single quotes , backslashes. is there way regex in python stop after finding first match? for example, this: import re re.findall('[a-za-z0-9]+=\'.*\'', line) will match entire string instead , won't stop @ ['stripprefix=\'false\'', ....] like to. first of all, assume have mistake in input string: quote before "bob" should escaped. if assumption correct use regex code this: >>> line = r"""enabled='false' script='va

python 2.7 - Updating entire column with data from tuple in PostgreSQL(psycopg2) -

first of all, there script: import psycopg2 import sys data = ((160000,), (40000,), (75000,), ) def main(): try: connection = psycopg2.connect("""host='localhost' dbname='postgres' user='postgres'""") cursor = connection.cursor() query = "update planes set price=%s" cursor.executemany(query, data) connection.commit() except psycopg2.error, e: if connection: connection.rollback() print 'error:{0}'.format(e) finally: if connection: connection.close() if __name__ == '__main__': main() this code works of course, not in way want. updates entire column 'price' good, updates use of last value of 'data'(75000). (1, 'airbus', 75000, 'public') (2, 'helicopter', 75000, 'private') (3, 'f

android - Build NativeActivity using ndk-build -

i trying launch native activity after launching java(i need load library that's why launching nativeactivity java). how build sample using android.mk? original sample uses gradle. tried build , @ launch library fails load. fatal exception: main process: sample.simple.com.myapplication, pid: 14917 java.lang.runtimeexception: unable start activity componentinfo{sample.simple.com.myapplication/android.app.nativeactivity}: java.lang.illegalargumentexception: unable load native library: /data/app/sample.simple.com.myapplication/lib/arm64/libnactivity.so here snippets of code. android.mk made following http://brian.io/android-ndk-r10c-docs/programmers_guide/html/md_2__samples_sample--nativeactivity.html local_path := $(call my-dir) include $(clear_vars) local_module := nactivity local_src_files := main.c local_ldlibs := -llog -landroid -legl -lglesv1_cm local_static_libraries := android_native_app_glue include $(build_shared_library) $(call import-module,android/native

c# - How to add empty row to the DataGrid? -

Image
i need allow user add information directly in datagrid put "canuseraddrows" property not work, appears follows: this datagrid: <datagrid x:name="dtgpersons" grid.row="3" canuseraddrows="true"> <datagrid.columns> <datagridtextcolumn header="n°" width="*" /> <datagridtextcolumn header="name" width="*" /> <datagridtextcolumn header="carrer" width="*" /> <datagridtextcolumn header="group" width="*" /> <datagridtextcolumn header="age" width="*" /> </datagrid.columns> </datagrid> edit this new grid code: <datagrid x:name="dtgperson" grid.row="3" itemssource="{binding lstperson}" autogeneratecolumns="false" canuseraddrows="true"> <datagrid.columns> <data

python - Error in query while inserting data using RDFlib to GraphDB -

i parse database rdflib graph. want insert triples graph graphdb triple store. code works fine when execute on older version of graphdb-lite hosted on sesame. however, error while executing same query on standalone graphdb 7.0.0. graph partially parsed before error raised , inserted triples show in triple store. this part of code: graphdb_url = 'http://my.ip.address.here:7200/repositories/test3/statements' ##insert sesame s,p,o in graph1: pprint.pprint ((s,p,o)) querystringupload = 'insert data {%s %s %s}' %(s,p,o) # querystringupload = 'delete {?s ?p ?o .}' # print querystringupload sparql = sparqlwrapper(graphdb_url) sparql.method = 'post' sparql.setquery(querystringupload) sparql.query() following error: arqlwrapper.sparqlexceptions.querybadformed: querybadformed: bad request has been sent endpoint, sparql query bad formed. response:

Puppet doesn't install NPM package or throw errors on package ensure -

i'm attempting write puppet script jupyterhub server deployment. seem have run problem pretty in set steps. i have class jupyterhub { # used jupyterhub web proxy notebooks. class { 'nodejs': manage_package_repo => false, nodejs_dev_package_ensure => 'present', npm_package_ensure => 'latest', } # proxy used package { 'configurable-http-proxy': ensure => present, provider => 'npm', require => class['nodejs'], } and on our test server i've run puppet module install puppet-nodejs to have nodejs , npm modules the box i'm running on debian stable box debian 3.16.7-ckt11-1+deb8u6 (2015-11-09) x86_64 gnu/linux when go run things on server, however, find npm has been installed package wasn't installed. puppet agent --test info: retrieving pluginfacts info: retrieving plugin info: loading facts info: c

excel - Delete all data but one column in VBA -

sorry basic question. i trying delete data worksheet, want keep data in column a. have worked out how clear rows whilst keeping header can't find way save data in column a. does know how this? worksheets("data") .rows("2:" & .usedrange.count).delete end the .usedrange.count return count of cells in used range, not rows. if understand correctly, want delete b2 end of used range. can this: with worksheets("data") .range("b2", cells(.usedrange.rows.count, .usedrange.columns.count)).clearcontents end

javascript - How to change duration of a jQuery animation before it's completed? -

Image
explanation i'm trying change duration of jquery animation before it's completed, wrote animation's code inside function, duration variable. animation has queue: false start when duration's variable changed , function called again button. the problem : when click on mentioned button animation durantion changes, when finish starts again previous duration. here fiddle code. var dur; function foo(){ $('.content').animate({width: '100%'}, { duration: dur, easing: 'linear', queue: false, done: function(){ $(this).css({width: '0%'}); console.log('prueba'); } }) }; $('.start').click(function(){ dur = 5 * 1000; foo(); }); $('.dur').click(function(){ dur = 0.5 * 1000; foo(); }); .content { width: 0%; height: 20px; float: left; margin-top: 20px; background: #fdcfa2; border: 1px solid #b18963;

Is it possible to use the Paypal In-Context Checkout feature in place without success or cancel redirection? -

i reading today paypal express checkout w/ in-context checkout docs , feature looks promising in scenario need perform purchase in place without page reload or redirection page, truth still have declare returnurl , cancelurl in order make work. unless missing something, takes user same problem tries solve, leave current page. undesired outcome real-time web-apps. there way sort of call without redirecting page? or not possible yet?

angular - Angular2, RouteParams not working -

Image
i'm getting error causing lots of frustration. here's running with: asp.net core 1.0 rc1 angular2, 2.0.0-beta.15 typescript, 1.7.6.0 the error(s): angular 2 running in development mode. call enableprodmode() enable production mode. attempting redirect to: /design/0deac46a-7f58-49f9-b67e-2c187dfa49a7/ navigated http://localhost:5000/ exception: cannot resolve parameters 'routeparams'(?). make sure parameters decorated inject or have valid type annotations , 'routeparams' decorated injectable. exception: cannot resolve parameters 'routeparams'(?). make sure parameters decorated inject or have valid type annotations , 'routeparams' decorated injectable. exception: error: uncaught (in promise): cannot resolve parameters 'routeparams'(?). make sure parameters decorated inject or have valid type annotations , 'routeparams' decorated injectable. exception: error: uncaught (in promise): cannot resolve parameters 'route

append - joining lists of different length in R -

i not sure if r has capabilities this, i'd join 2 different lists of different lengths it's nested list within list (if makes sense). edit: i'd add values in x additional value in z. z <- c("a", "b", "c") x <- c("c", "g") c(z, x) [1] "a" "b" "c" "c" "g" # i'd see [1] "a" "b" "c" "c, g" i think similar doing following in python pandas self.z.append(x) we can paste 'x' , concatenate 'z' c(z, tostring(x)) #[1] "a" "b" "c" "c, g"

jvm - Why can I not pickle my case classes? What should I do to solve this manually next time? -

edit 2: observations , questions i pretty sure along commenter below justin problem due errant build.sbt configuration. however, first time have seen errant build.sbt configuration literally works everything else except pickers. maybe becaus use macros , rule avoid them. why matter whether flow.merge used vs flow.map if problem sbt ? suspicious build.sbt extract lazy val server = project .dependson(sharedjvm, client) suspicious stack trace so top of stack: goes method cannot find linking environment string encoding utils. ok. server java.lang.runtimeexception: stub huh? stub ? server @ scala.sys.package$.error(package.scala:27) server @ scala.scalajs.runtime.package$.linkinginfo(package.scala:143) server @ scala.scalajs.runtime.package$.environmentinfo(package.scala:137) huh? server @ scala.scalajs.js.dynamic$.global(dynamic.scala:78) ??? server @ boopickle.stringcodec$.encodeutf8(stringcodec.scala:56) edit 1: big , beautiful build.sbt mig

c++ - Running In-Line Assembly in Linux Environment (Using GCC/G++) -

so have basic program written in c (.c file) in-line assembly coding part. want convert .c file assembly output know don't know how compile code linux environment. when using gcc or g++ .cpp files, errors not recognizing asm instructions. now code works intended in visual studio besides me changing brackets asm code parenthesis. still errors. bunch of undefined references variables. the changes made working code changing brackets parentheses, putting assembly instruction in quotation marks (found online, wrong). in short, want code below able compiled in linux environment using command gcc. don't know syntax code works, not linux/. #include <stdio.h> int main() { float num1, num2, sum, product; float sum, product; float f1, f2, f3, fsum, fmul; printf("enter 2 floating point numbers: \n"); scanf("%f %f", &num1, &num2); __asm__ ( "fld num1;" "fadd num2;" "fst fsum;" ); printf("th

MySQL: How to optimize this QUERY? Calculating SUM by year(date) -

i have query calculating sums of values per every year based on date. it works, heavy, takes minute 2 minutes running on 10k records is there way optimize this, or write in more efficient way? "select departments sum(case when year(employment_date) = '1990' 1 else 0 end) '1990'," + "sum(case when year(employment_date) = '2010' 1 else 0 end) '2010'," + "sum(case when year(employment_date) = '2011' 1 else 0 end) '2011'," + "sum(case when year(employment_date) = '2012' 1 else 0 end) '2012'," + "sum(case when year(employment_date) = '2013' 1 else 0 end) '2013'," + "sum(case when year(employment_date) = '2014' 1 else 0 end) '2014'," + "sum(case when year(employment_date) = '2015' 1 else 0 end) '2015'," + "sum(case when year(employment_date) = '2016' 1 el

php - Count my totals up - Laravel 5.2 -

Image
i have "orders" table holds totals in each row every order in shop. need count totals every single row grand total. how set query in laravel? my orders table: my function: public function index() { // orders in db $orders = order::all(); // doesnt work, counts rows $count_total = db::table('orders')->select('count(total)')->count(); dd($count_total); // carts in db $carts = cart::all(); return view('admin.pages.index', compact('orders', 'carts', 'count_products')); } you can use eloquent way, doing can total sum of column. $total = orders::sum('total'); echo "<pre>"; print_r($total); echo "<pre>";

java - How to sort an array of random numbers -

i need create array of size 500, , data randomly distributed , i'm confused how sort array. can me, please? the code random: import java.util.random; public class sorttest { public static void main(string[] args) { // create instance of random class random number generation random random = new random (1l); // begin new scope { // create int array of 500 elements int[] dataarray = new int[500]; // populate array randomly generated values (int index = 0; index < 500; index++) dataarray[index] = random.nextint(); // end scope } } } do need use arrays.sort(dataarray)? or arrays.sort(dataarray, collections.reverseorder())? heard said not primary class. please help!!! thank you!! here should steps: create 500-element integer array using random class’s nextint() method make copy of array , use parameter sort methods (array passed reference). measure execution time sort 500-element array

arm - Information about Section Index field (st_shndx) in Section SHT_DYNSYM & SHT_SYMTAB -

toolchain: product: arm compiler 5.04 component: arm compiler 5.04 update 1 (build 49) from elf portable formats specification, version 1.1, section index field (st_shndx) contains: every symbol table entry ‘‘defined’’ in relation section; member holds relevant section header table index. i compiling simple object (exports 1 global data & routine) understand various fields of elf source code (test.c): __declspec(dllexport) int x21 = 0x100; __declspec(dllexport) void bar21(void) { x21++; } build script used (build.bat) armcc -c test.c armlink --bpabi --dll -o test.dll test.o fromelf -cdrsy -o test.txt test.dll my query usage of st_shndx field of dynsym section & symtab section. output file (removed few sections keep short) ** section #1 'er_ro' (sht_progbits) [shf_alloc + shf_execinstr] size : 24 bytes (alignment 4) address: 0x00008000 $a .text bar21 0x00008000: e59f000c .... ldr r0,[pc,#12] ; [0