Posts

Showing posts from August, 2015

Unable to set up Jinja2 with Django -

i've installed django 1.9.7, , have pythons 3.4.3 , 2.7.10 on ubuntu. these steps i've followed: made new project django-admin startproject testproject cd testproject/testproject made app within project django-admin startapp testapp made directory templates in app mkdir testapp/templates , added basic index.html template in there edited settings.py change template backend django.template.backends.jinja2.jinja2 , editing line 57 of default settings file, , add testproject.testapp installed_apps ; templates section therefore this: templates = [ { 'backend': 'django.template.backends.jinja2.jinja2', 'dirs': [], 'app_dirs': true, 'options': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth

java - Error Expected int but given string -

i'm getting error. it's saying it's expecting int, i'm giving string. i'm not sure how fix this. int dnastrandlength, stranddna; scanner dnainfo = new scanner (system.in); system.out.println ("please enter dna strand!"); stranddna = dnainfo.next(); dnastrandlength = stranddna.length(); you have declare stranddna string . int dnastrandlength; string stranddna; scanner dnainfo = new scanner (system.in); system.out.println ("please enter dna strand!"); stranddna = dnainfo.next(); dnastrandlength = stranddna.length(); if reading int have nextint() scanner.

azure service fabric - Targeting a stateless replica on the same node when communicating over the ServiceProxy client -

Image
i have deployed 2 stateless , singlepartion microservices service fabric cluster, hosted on azure. want hook communication between these services this: my masterdata web api service should prefer communicate masterdata serviceproxy service replica/instance on same node when calling method via serviceproxy client. if there's no replica/instance available on same node, connect node. code looks this: var serviceclient = serviceproxy.create<imasterdataserviceproxy>(new uri("fabric:/sfapp/masterdataserviceproxy")); var result = await serviceclient.getmasterdata(); but communication this: the serviceproxy connects randomly chosen replica/instance (due targetreplicaselector.default ). i'm missing communication options " targetreplicaselector.prefersamenode ". there way handle manually? here's explanation: how can reach specific replica of stateless service if still want it, either use http listeners on localhost or use sta

php - Class 'DOMPDF' not found after downloading via Composer -

i used composer download latest (v0.7). copied entire downloaded 'vendor' directory web server, error: class dompdf not found if change use namespaces error 'fatal error call undefined function dompdf()' several hours trying desperately find missing. never had problems using composer before, (it takes care of dependencies), not in case! ideas appreciated. sample code: <?php require "../vendor/autoload.php"; $dompdf =\dompdf(); // used new dompdf(); $dompdf->loadhtml($html); $dompdf->render(); $dompdf->stream("sample.pdf", array("attachment"=>0)); ?> solved myself.. in case interested example given on github page missing critical line i added: use dompdf\dompdf; , fixed it. require "../vendor/autoload.php"; use dompdf\dompdf; $dompdf =\dompdf(); // used new dompdf(); $dompdf->loadhtml($html); $dompdf->render(); $dompdf->stream("sample.pdf", array("attachment&

linux - How to turn command output to a live status update? -

i curious if there's tool or easy way continually execute command in given intervals, , reprint output same place on screen. the example prompted me think 'dropbox-cli status'. manually executed: $> dropbox-cli status syncing (6,762 files remaining) indexing 3,481 files... $> dropbox-cli status syncing (5,162 files remaining) indexing 2,681 files... i looking for: $> tracker --interval=1s "dropbox-cli status" syncing (6,743 files remaining) indexing 3,483 files the imaginary command 'tracker' block , 2 output lines continually reprinted on every second, rather creating appending log output. you can use watch watch -n1 dropbox-cli status specify time in seconds param -n .

Improve performance of a JavaScript function (with an array lookup) -

i'm trying complete code challenge have decode keystrokes of cell phone t9 input characters create text message. main function (reverse_t9) takes string of keys such "44 444" or "999337777" , need translate them corresponding texts ("hi", or "yes" respectively). i have logic down , can generate correct outputs, challenge telling me i'm exceeding time limit 4000ms. i've found couple spots improve performance, still can't under mark. think biggest time-waster "getletterfromdigits" function has iterate through array find corresponding mapping set of keystrokes. am missing other obvious performance problems? please let me know if need more info. function reverse_t9(keys) { var retval = ""; var maxkeystrokes = 3; var splitkeystrokes = splitkeystrokesbyspacesandkeys(keys); (i = 0, numsplits = splitkeystrokes.length; < numsplits; i++){ //console.log("this split:");

html - flexbox vertical centering plus a sticky footer -

im using flexbox lot on page. im using on 6 images spaced apart works fine. this wrapped in container (pink background). want aligned vertically , horizontally of window. got working fine. untill added in flexbox sticky footer. cant them both working @ once. my main issue safari, getting sticky footer working in that. use flex: 1 0 auto; on .container class. if change value flex: 1; centers thte footer not work in safari can shed light on this. i've never used flexbox before https://codepen.io/gorelegacy/full/dxzbmk/ can bit more precisely? me it's working fine in codepen. or pink background (which shows black on large screen) problem? one advice, not solution: flexbox used define layout. see give body flex-direction: row, , give elements fixed height. instead of using .bottom { height: 40px; } i recommend using: flex: 0 0 40px; the results same, prevent little bugs or weird behaviour in future. same goes div class=top. regarding problem,

tortoisesvn - SVN Change the HEAD to a particular revision and the set HEAD back to top -

i came across many posts showed ways revert changes of commit in working copy , commit again. there way following. supposed have following versions. 103 -> head 102 i want make to 103 102 -> head do tasks , change back. 103 -> head 102 is there way without making version 104 ? no, regular user can't perform such operation. revisions in subversion immutable. the process of undoing changes made in commits described in svnbook | undoing changes , tortoisesvn manual | undoind changes . ps looks trying solve problem in awkward way. describe problem in details , ask advise in separate question. don't forget read documentation before asking questions.

r - Predicting data via regression model and storing in a vector -

apologies basic question. i have created linear model massive meteorological dataset using multiple regression. goal use model "predict" data during period using predictors 1, 2 , 3. compare predicted data observed data period. my approach far has been create new vector predicted values , loop through vector, creating predicted values based on extracted coefficients of linear model. then, subtract predicted values observed values. reason, approach results in new predicted vector being null. idea how approach this? a sample below. "data" refers dataset containing predictors. coef <- coefficients(multipleregressionmodel) predictedvalues=c() for(i in 1:length(data$timeperiod)){ predictedvalues[i] = append(predictedvalues, data$coef[1]+data$predictor1[i]*data$coef[2]+data$predictor2[i]*data$coef[3]+ data$predictor3[i]*data$coef[4]) } diff=c() diff=observedvalues - predictedvalues it looks making more difficult need

multithreading - c# Background thread gets an error when run in UserControl -

right in usercontrol, have button click event starts thread. i've since moved on using abort(), , trying convert thread background process shut down when close parent form. code is: public thread t; private void btninitiate_click(object sender, eventargs e) { udplistener mylistiner = new udplistener(this); t.isbackground = true; t = new thread(() => mylistiner.spreadvalue(mycurrentport, firstticker, secondticker, mybeta)); t.start(); } but when run application, error t.isbackground=true says "object reference not set instance of object". i'm wondering going wrong in case. you need change row order in code: ... t = new thread(() => mylistiner.spreadvalue(mycurrentport, firstticker, secondticker, mybeta)); t.isbackground = true; ... because need instantiate thread , use it.

javascript - eventListener to be added to parent, but child element interfering -

i trying create calculator, , want on clicking whole key/button, number appears on screen. if click in h1 region of key/button, output undefined. understand problem, try click key/button on white area , on blue area. how can fix ? var evt = document.queryselectorall(".evt"); var screentext = document.getelementbyid("screentext"); var show = function(e) { screentext.innerhtml += e.srcelement.firstchild.innerhtml; } for(var = 0 ; < 14 ; i++) { evt[i].addeventlistener("click", show); } #calcbody { width: 400px; height: 500px; border: 2px solid black; } #screen { width: 90%; height: 15%; border: 1px groove black; margin: 5%; text-align: right; } .flt { float: left; width: 20%; height: 17%; border: 1px solid black; box-sizing: border-box; margin-left: 4%; margin-bottom: 2%; position: relative; } .flt2 { float: left; border: 1px solid black; box-sizing: border-box; width: 44%; height: 17

codeigniter - saving highchart canvas as png image on server -

i'm wondering has been able save canvas image of highchart onto server. can render highchart on canvas fine, when save server image blank has file size of 6kb. testing purposes i'm hard coding in dataurl of canvas image still can't image show(i'm ruling out fact not case of me not transferring data correctly when generating image). ive tried taking regular dataurl of cloud , image appears fine. $img = 'ivborw0kggoaaaansuheugaaa+gaaaescayaaabqrzlvaaaxukleqvr4xu3xmreaaagdmfbvghn8ebt0upbuoaiecbagqiaaaqiecbagqobdyn8tcecaaaecbagqiecaaaecbaimge4jcbagqiaaaqiecbagqibaqmbad5qgagecbagqiecaaaecbagqmnd9aaecbagqiecaaaecbagqcagy6iesrcbagaabagqiecbagaabaga6hybagaabagqiecbagaabagebaz1qgggecbagqiaaaqiecbagqmba9wmecbagqiaaaqiecbagqcagykahshcbaaecbagqiecaaaecbagy6h6aaaecbagqiecaaaecbagebaz0qakiecbagaabagqiecbagaaba90pecbagaabagqiecbagacbgicbhihbbaiecbagqiaaaqiecbagykd7aqiecbagqiaaaqiecbagebaw0amliecaaaecbagqiecaaaecbax0p0caaaecbagqiecaaaecbaicbnqgbbeiecbagaabagqiecbagicb7gciecb

google cloud storage - How to set a GCS object lifecycle for all objects below a path, not bucket-wide? -

the docs mention setting object lifecycle entire bucket. want set lifecycles several paths within bucket, not entire bucket. is possible on google cloud storage? if so, how can it? it's not possible configure lifecycle management less entire bucket.

Send file contents over ftp python -

i have python script import os import random import ftplib tkinter import tk # now, grab windows clipboard data, , put var clipboard = tk().clipboard_get() # print(clipboard) # feature work if string in clipboard. not files. # if "hello, world" copied clipboard, work. however, if target has copied file or # come error, , rest of script come false (therefore shutdown) random_num = random.randrange(100, 1000, 2) random_num_2 = random.randrange(1, 9999, 5) filename = "capture_clip" + str(random_num) + str(random_num_2) + ".txt" file = open(filename, 'w') # clears file, or create if not exist file.write(clipboard) # write contents of var "foo" file file.close() # close file after printing # let's send file on ftp session = ftplib.ftp('ftp.example.com','ftp_user','ftp_password') session.cwd('//logs//') # move correct directory f = open(filename, 'r') s

Java annotation to transform a json field -

i trying come interface has pretty non-standard way of representing fields fed legacy system, interface seems require custom validations + transformations such truncating string value beyond specified length (example : in cases truncate string beyond 25th character, in other cases truncate beyond 15th character) validate string date field of format yyymmdd , transforming date field of yyyy-mm-dd format in setter how come custom annotations can using @interface ? able find @constraint(validatedby=someclass.class) there doesn't seem transform data (or sorry if haven't looked enough).. pointers on helpful. in java, use "transformed" datatype in jackson annotated objects, example: private transformeddata data; then configure jackson deserializer accepts string , returns "transformeddata" object. when jackson trying fill in data field, notice needs conversion , call deserializer.

java - Speed up the process of loading a .exe file -

i created java application using eclipse . created executable .jar file, choosing " package required libraries generated jar ". eventually, created .exe file using lauch4j . the problem .exe file takes forever opening application , executing "on startup" statements (which take few seconds when run application eclipse). believe problem required libraries packed .jar file, , need unpack them. unfortunately, pack required library generated jar chance, since application seems not read required libraries (e.g. gluegen-rt.jar ) if extracted generated file. anyone has idea how speed unpack process? maybe passing commands jvm? thanks in advance

contactscontract - Android - contacts address field updating to other fields -

i trying update native contact data through app. problem when updating address, address updating first name , notes , phone fields. below code used in app, please correct me if mistake. public arraylist<contentprovideroperation> updatecontact(context context, contactdata contactdata){ string selectphone = contactscontract.data.contact_id + "=?"; string[] phoneargs = new string[]{contactdata.getcontactlocalid()}; arraylist <contentprovideroperation> ops = new arraylist <> (); ops.add(contentprovideroperation.newupdate( contactscontract.rawcontacts.content_uri) .withselection(selectphone, phoneargs) .withvalue(contactscontract.rawcontacts.account_type, null) .withvalue(contactscontract.rawcontacts.account_name, null) .build()); //------------------------------------------------------ names ops.add(contentprovideroperation.newupdate( contactscontract.data.con

Rails Api security: is oauth protocol only for third party application? -

i building restful api , want protect api's. thinking implement oauth per knowledge oauth suitable when exposing our api third party application. not exposing api third party application. i want know implementing oauth suitable or not?? thanks, sanjay salunkhe

python - How do I set the Content-Type of an existing S3 key with boto3? -

i want update content-type of existing object in s3 bucket, using boto3, how do that, without having re-upload file? file_object = s3.object(bucket_name, key) print file_object.content_type # binary/octet-stream file_object.content_type = 'application/pdf' # attributeerror: can't set attribute is there method have missed in boto3? related questions: how set content-type on upload how set content type of s3 object via sdk? there doesn't seem exist method in boto3, can copy file overwrite itself. to using aws low level api through boto3, this: s3 = resource('s3') api_client = s3.meta.client response = api_client.copy_object(bucket=bucket_name, key=key, contenttype="application/pdf", metadatadirective="replace", copysource=bucket_name + "/" + key) the m

javascript - Create new array from exisiting properties -

i have object such: export var project: = { id: "1", name: "hunkemoller", teammembers: [ { id: 1, name: "sarah johnson", firstname: "sarah", role: "manager" }, { id: 2, name: "christian johnson", firstname: "christian", role: "employee" } etc. i'm making app , want add search element in it, can search different teammembers. want initialize properties 'name' out of every teammember. that's thing needs filtered. i've thought of 2 ways: create new array names of project > teammembers in it. just initialize names. haven't succeeded this. can me make right choice , explain me how can succeed? don't how make new array out of existing one. thinking this: var teammembers = project.teammembers.name(); but apart option, best i

android - TextViews recycle their positions and title when scrolling, Glide Gallery -

i trying use glide image library load images in gridview using reccycler view. however, wanted have title textview beneath each image. i have set custom layout , tried load textview in onbindviewholder. works on scrolling, positions recycled, , textviews titles changed, making mess of it. @override public void onbindviewholder(myviewholder holder, int position) { image image = images.get(position); // // setup glide request without into() method // drawablerequestbuilder<string> thumbnailrequest = glide // .with(mcontext) // .load(image.getmedium()); // pass request a parameter thumbnail request glide.with(mcontext).load(image.getmedium()) .thumbnail(0.3f) .crossfade() .diskcachestrategy(diskcachestrategy.all) .into(holder.thumbnail); titletext.settext(image.getname()); } how fix dear developers? i think problem titletext not stored in viewholder. s

build automation - meaning of Warnung: Symbol 'AllocateHWnd' wird abgelehnt -

when building bcb6 project on command line via make version 5.2 running borland c++ 5.6.4 (seemingly including run of borland delphi version 14.0 ), i'm getting these warnings: syncmeth.pas(57) warnung: symbol 'allocatehwnd' wird abgelehnt syncmeth.pas(62) warnung: symbol 'deallocatehwnd' wird abgelehnt several web searches german phrase didn't provide useful results. tried translate it, starting things like warning: symbol 'allocatehwnd' [is/was] denied with little success. tried without verb warning symbol 'allocatehwnd' and found promising: lot of search results matching pattern symbol '<whatever>' deprecated. but german abgelehnt means denied , not deprecated (which means veraltet translated in software development domain). can confirm translation error , can ignore warnings (of course aware deprecated means)? a google search of exact german phrasing reveals following discussion

ios - How to Upload video files in background? -

i doing app in need upload videos taken iphone camera , upload server. when app in foreground video gets uploaded don't know how in background when app inactive. used afnetworking multipart data upload. here code tried var task:nsurlsessionuploadtask! let filepicker_base_url = "my server url" var isuploading : bool = false var videopath : string! func upload(dictmain: nsmutabledictionary) { isuploading = true let uuid = nsuuid().uuidstring + "-" + (getuserid().description) let request = afhttprequestserializer().multipartformrequestwithmethod("post", urlstring: filepicker_base_url, parameters: nil, constructingbodywithblock: { (fromdata) in { try fromdata.appendpartwithfileurl(nsurl(fileurlwithpath: videopath) , name: "fileupload", filename: uuid, mimetype: "video/quicktime") }catch{ print(error) } }, error: nil) let manager:afurlsessionmanager = afurl

angularjs - Rails: How do I load my local Angular 2 app inside a view? -

i have angular 2 app built using angular cli generator: https://github.com/edmundmai/angular-2-playing this generator: https://github.com/angular/angular-cli i ran ng serve , have page can see when visit http://localhost:4002 my dist/index.html file in angular 2 app looks this: <!doctype html> <html> <head> <meta charset="utf-8"> <title>angulartwo</title> <base href="/"> <script src="/ember-cli-live-reload.js" type="text/javascript"></script> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="image/x-icon" href="favicon.ico"> <script src="http://carbon.ec2.crowdtap.com/component_importer.js"></script> </head> <body> <angular-two-app>loading...</angular-two-app> <script src="vendor/es6-shim/es6-shim.js&q

Avoid Salesforce Apex components being wrapped with <span> elements -

i'm new salesforce apex , struggling bit on nuances. problem salesforce components knowledge:categorylist or knowledge:articlelist wrapped span elements when rendered, far needed. things like: <ul> <span> <li>one</li> <li>two</li> <li>three</li> </span> </ul> are semantically wrong @ least, further more breaking markup when using libraries bootstrap . there solution this? or maybe wrong @ point? upd small example: this... <ul class="nav nav-tabs" role="tablist"> <knowledge:categorylist categoryvar="category" categorygroup="help" rootcategory="using_{!selectedcategory}" level="1"> <li role="presentation"> <a href="#{!category.name}" aria-controls="basics" role="tab" data-toggle="tab">{!category.label}</a>

html - Numbers not showing with list items in ordered list with display: inline-block; and text-overflow: ellipsis; -

Image
i trying make ordered list of links facing problems, not showing numbers list items when using display: inline-block; , text-overflow: ellipsis; i have html <ol> <li><a href="one">link 1 one 1 one 1 one 1 one</a></li> <li><a href="two">link 2 two 2 two 2 two 2 two</a></li> <li><a href="three">link 3 three 3 three 3 three</a></li> <li><a href="four">link 4 four 4 four 4 four four</a></li> <li><a href="five">link 5 five 5 five 5 five 5 five</a></li> <li><a href="six">link 6 six 6 six 6 six 6 six 6 six</a></li> <li><a href="seven">link 7 seven 7 seven 7 seven seven</a></li> <li><a href="eight">link 8 eight 8 eight 8 eight 8 eight</a></li> <li><a href="nine&qu

android - Rename file in gradle with passed parameter -

i'm packaging build artefacts gradle build. it's android studio project. i have tasks create zip file containing 2 jars. let's zip file called ' my.zip '. i have following gradle task: task renameartifacts (type: copy) { ('build/') include 'my.zip' destinationdir file('build/') dolast { println "my-${versionstring}.zip" rename('build/my.zip', "build/my-${versionstring}.zip") } } and i'm calling gradle -pversionstring="123" :sdk:renameartifacts i have println in dolast closure , can see string interpolation working correctly outputs my-123.zip . however, 'my.zip' not renamed 'my-123.zip' . remains 'my.zip' , in fact results in file size of 0 bytes , no longer openable zip file. i'm going wrong somewhere, where? full gradle file: apply plugin: 'com.android.library' android { compilesdkversion 22 bu

sass - SCSS mixin add percentage fails -

i have scss mixin below definition linear-gradient . @mixin custom-background( $color: $color, $progress: 0 ) { background: linear-gradient(to right, $color #{$progress}%, #9ec9db 0); border: #10516c solid #9ec9db; } but on compiling gulp-sass breaks below error: error: invalid css after "... #{$progress} %": expected expression (e.g. 1px, bold), ", $progress-" on line 15 of file.scss nt(to right, $color #{$progress} %, #9ec9db 0); ------------------------------------------^ messageoriginal: invalid css after "... #{$progress} %": expected expression (e.g. 1px, bold), ", $color" interpolation different purposes, creating selector string variable. not convert values. convert number percentages, multiply 100% . @mixin custom-background( $color: $color, $progress: 0 ) { background: linear-gradient(to right, $color $progress * 100%, #9ec9db 0); border: #10516c solid #9ec9d

ocr - Including unicharambigs in the [lang].traineddata file (Tesseract) -

i'm facing problem in training tesseract ocr kannada font (lohit kannada , kedage), when comes numerals. for example, 0 getting recognized 8 (and ನ ವ). needed in including unicharambigs file (the documentation on github describes format solely).my output.txt file has not changed,despite including unicharambigs file. suppose [lang] corresponds kan, following command include unicharambigs file in kan.traineddata file? combine_tessdata kan. incase doesn't, i'd appreciate regarding how proceed same. difficult answer not knowing version of tesseract , kan.traineddata you're using. you can unpack kan.traineddata see version of kan.unicharabigs included in , recombine after editing file. see https://github.com/tesseract-ocr/tesseract/blob/master/doc/combine_tessdata.1.asc command syntax use -u option unpack: -u .traineddata pathprefix unpacks .traineddata using provided prefix. use -o option overwrite ucharambigs : -o .traineddata

botframework - How to integrate multiple Luis model to bot framework -

i developing bot respond users query private use cases. enable bot answer of common questions weather or directions etc. built own app in luis , trying use pre-built cortana intents. sample below [luismodel("c413b2ef-382c-45bd-8ff0-f76dad0e2a821", "697asfc173ce6f40aca4c99e7d38assad6cad")] public class myclass: luisdialog<t> { } this accept either cortana intents or own intents depends on subscription id , key. how can use both luis models in class? please help around 20 days ago, updated luisdialog support multiple luismodel , iluisservice instances (check commit ). change released in nuget 1.2.4.

python - Django: Use htaccess to protect django app -

i have staging server identical source code production server. want keep public outside of staging server thought of using htaccess limit users staging server (and keep robots , strangers outside). somehow not working me. i created passwordfile sudo htpasswd -cs /var/.passwd staging i placed .htaccess file in /var/www/djangoapp/ .htaccess: authuserfile /var/.passwd authtype basic authname "just testing" require valid-user i ensured: <directory /var/www/> options indexes followsymlinks allowoverride require granted </directory> apache restart: sudo service apache2 restart the django application still available everybody. doing wrong? i found alternative solution above goal without htaccess. share: in 000-default-conf in respective virtualhost section: <directory /var/www/djangoapp/djangoapp> authuserfile /var/.htpasswd authname "just testing" authtype basic require

r - Efficient assignment of a function with multiple outputs in dplyr mutate or summarise -

i've noticed lot of examples here uses dplyr::mutate in combination function returning multiple outputs create multiple columns. example: tmp <- mtcars %>% group_by(cyl) %>% summarise(min = summary(mpg)[1], median = summary(mpg)[3], mean = summary(mpg)[4], max = summary(mpg)[6]) such syntax means summary function called 4 times, in example, not seem particularly efficient. ways there efficiently assign list output list of column names in summarise or mutate ? for example, previous question: split data frame column containing list multiple columns using dplyr (or otherwise) , know can assign output of summary list , split using do(data.frame(...)) , means have add column names later , syntax not pretty. this addresses example, perhaps not principal question. in case showed, rewrite as: tmp <- mtcars %>% group_by(cyl) %>% summarise_each(funs(min, median, mean, max), mpg) this more e

Generic class with multiple return types -

i know question not asked rather hard show example: have class abstracthandler. create method class: class abstractmanager { binaryserializator binaryserializator; //just example textserializator textserializator; public abstractmanager(binaryserializator binaryserializator) { this.binaryserializator = binaryserializator; this.textserializator = null; } public abstractmanager(textserializator textserializator) { this.textserializator = textserializator; this.binaryserializator = null; } public abstracthandler createhandler() { if (this.binaryserializator != null) { return new abstracthandler<byte[]>(this.binaryserializator); } else { return new abstracthandler<string>(this.textserializator); } } } so how create abstracthandler again has 2 constructors (one takes binaryserializator , textserializator). here fun part: both serializators have method ge

javascript - JQuery doesn't get the changes that angularjs does -

Image
i've got set angularjs <span data-end-time="{{ productauctionend | date:'yyyy,mm,dd,hh,mm,ss' }},000" class="detail-rest-time js-time-left"></span> and when use jquery $(".js-time-left").each(function() { console.log($(this)); console.log($(this).data("end-time")); } the first log prints screen: <span data-end-time="2016,06,12,15,03,59,000" class="detail-rest-time js-time-left"></span> the second log prints this: ,000 can please me out just call jquery logic after angular , work.sometimes 2 don't play nice together: <script src="~/scripts/angular.js"></script> <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js' type="text/javascript"></script> <script type="text/javascript"> var myapp = angular.module("app", []); myapp.controller('con

mariadb - Custom table creation options in django models -

i have girl model (i mean django =) class girl(models.model): id = models.autofield(primary_key=true) first_name = models.textfield() last_name = models.textfield() nickname = models.textfield(blank=true, null=true) maiden_name = models.textfield(blank=true, null= = models.textfield(blank=true, null=true) quotes = models.textfield(blank=true, null=true) activities = models.textfield(blank=true, null=true) books = models.textfield(blank=true, null=true) games = models.textfield(blank=true, null=true) tv = models.textfield(blank=true, null=true) interests = models.textfield(blank=true, null=true) movies = models.textfield(blank=true, null=true) music = models.textfield(blank=true, null=true) ... class meta: managed = true db_table = 'girls' story: database mariadb+innodb , text fields may contain insanely large unicode poems. i've run problem http://instantbadger.blogspot.ru/2013/01/mysql-row-size-too-large-when-saving.html

Javascript - How to get the url for Youtube videos programmatically? (self-answer) -

an extremely common question "how url youtube video?". answers involve scraping , regexing html of video page or resort 'use 3rd party tool or website'. its extremely easy dev tools console in browser on youtube video page. see answer below. example here: https://gist.github.com/geuis/8b1b2ea57d7f9a9ae22f80d4fbf5b97f // run dev tools console of youtube video // accurate of june 12, 2016 var videourls = {}; ytplayer.config.args.url_encoded_fmt_stream_map.split(',').foreach(function (item) { var obj = {}; item.split('&').foreach(function (param) { param = param.split('='); obj[param[0]] = decodeuricomponent(param[1]); }); videourls[obj.quality] = obj; }); console.log(videourls); sample output https://www.youtube.com/watch?v=9bzkp7q19f0 { "hd720": { "url": "https://r3---sn-n4v7sn76.googlevideo.com/videoplayback?ms=au&mv=m&mt=146577…za3kgkxmjcumc4wlje&ip=108.

reactjs - Where I handle API calls in react-native and redux -

i'm building android app using react-native + redux + immutable i structured app this /src -/components -/actions (where have action types , actions) -/reducers -/api (i'm not sure if i'm doing right) ok, have action need make api call fetch this: import * types './casestypes' export function getcases() { return { type: types.get_cases } } this cases reducer: const initialstate = fromjs({ isloading: false, cases: null }) export default function cases(state = initialstate, action = {}) { switch(action.type) { case types.request_cases: return state.set('isloading', true) case types.recive return state.set('cases', //set here array recive api call) default: return state } } so, thing dont understand, should make api call in reducer can merge initial state recive api call? your app structure sound. i recommand usage of redux-thunk handl

xcode - Cannot add a view not part of the controller in Xamarin storyboard -

i have problem ios storyboard editor under xamarin. i want add view not part of controller layout in xcode dragging uiview control storyboard controller header (added before 'exit' icon) seems not possible in xamain. if add using xcode, storyboard cannot edited anymore in xamarin. any clue on this? limitation in current version of xamarin or missed something? thanks! if i've experienced in past, should try flipping orientation in storyboard designer , flipping back.