Posts

Showing posts from August, 2012

Calling python script from another directory -

i have python script base.py , having path username/packagename/base.py another python script application.py, having path username/packagename/bin/application.py how can call method of application.py base.py, since both being in different folder. in bin directory, make empty file called __init__.py (two underscores on each side, total of 4 underscores). after doing that, python treat bin python module, , can do: from bin import application # e.g. application.yourapplicationfunction(params) in base.py file.

ios - Two prototype cells in one section -

i have 2 prototype cells. 1 appears if messagesarray[indexpath.row] value "", other if value contains characters. 1 of cells' row height greater second , contains additional variables. they're both hooked own cell classes , have own cell identifiers. want them both coexist in same tableview, under 1 section, i'm struggling achieve that. keep getting fatal error: array index out of range . array value being populated async db request, explanation. what doing wrong/how can successfully? var messagesarray = [string]() override func viewdidload() { super.viewdidload() var query = pfquery(classname: "class") query.findobjectsinbackgroundwithblock { (objects, error) -> void in if error == nil { if let objects = objects { object in objects { if let message = object["message"] as? string { self.messagesarray.append(message) ...

Which Google APIs to use? -

i want following things in ios app: let user create new google spreadsheet, or choose list of existing google spreadsheets let app read data google spreadsheet let user edit google spreadsheet, either embedding spreadsheet, or switching on safari or google app. there lot of google apis out there…which should @ accomplish above 3 tasks? thanks! you need drive api create sheets: https://developers.google.com/drive/ you need sheets api work them (editing file): https://developers.google.com/google-apps/spreadsheets/?hl=en you can find information on how authenticate google requests (oauth2) in linked pages. drive api built google play services library you'll need sheets api separately.

c++ - OpenSSL non-blocking mode BIO -

i trying create non-blocking bio openssl server, looking @ this stackoverflow question didn't help, trying bio_set_nbio(), no avail (see code snippet below). can please me , explain why one-line call bio_set_nbio doesn't appear says on tin.... bio *ssl_bio; ssl_ctx *ctx; bio *in = null; ssl *ssl = ssl_new(ctx); ssl_bio = bio_new_ssl(ctx, 0); ssl_set_mode(ssl, ssl_mode_auto_retry); if ((in = bio_new_accept(port)) == null) goto err; bio_set_nbio( ssl_bio, 1 ); bio_set_nbio( in, 1 ); bio_set_accept_bios(in, ssl_bio);

What approach is there for handling and returning errors (non-exceptional and exceptional) in Domain Driven Design entities and aggregate roots? -

i'm trying find article/examples of how ddd entities treat errors (and considered exceptional errors , wouldn't) , how pass them calling application layer (which wraps operations in transaction need rolled back). currently i'm thinking consider errors break transaction of aggregate (such validation) exceptions. way can rollback transaction in "catch" block. example: someapplicationservice: // start transaction here // ... try { $user = $userrepository->userofid($id); $user->dosomething(); $user->dosomethingelse(); // <-- imagine error thrown here $userrepository->save($user); } catch (customfriendlyforuiexception $e) { // custom friendly ui error // rollback transaction , add error/message ui payload dto // ... } catch (anothercustomexception $e) { // not friendly ui, use general error message ui // rollback transaction , add error/message ui payload dto // ... } catch (exception $e) { // cat...

php - ACF - Repeater shows only last entered row, not all rows from post -

i have code inside functions.php file: while ( have_rows('origin-repiter') ): the_row(); $origin = get_sub_field('origin-rep'); endwhile; while ( have_rows('destination-repiter') ): the_row(); $destination = get_sub_field('destination-rep'); endwhile; here origin-repiter/destination repiter repeater field name , origin-rep/destination-rep repeater fields, rows if want. my problem on frontend of wp site acf shows last input backend repeater fields. example: for origin entered: london, paris, moscow (three rows) same destination inverse (moscow, paris, london). but on frontend acf showing last entry origin: moscow & destination: london this code functions.php renders php/html on frontend 2 fields/snippets: $output .= '<div class="post_offer"><div class="offer-header"><div class="offer-pr"><div class="offer-pr-t"> from</div> <div class="offer-pr-...

javascript - nodejs - Convert a connect request/response object to a Express request/response object -

preface : this going bit of weird question, , know going hacky solution main concern solve interest of saving time. first off, know connect , express create own response , request object types, , differ lot cannot used interchangeably (e.g. express middleware plugin used on connect -based framework, vv). if necessity arises? my question: how convert connect response or request object within connect middleware call express or express -compatible res / req object can use pass express -based middleware plugin? edit: as @jfriend00 pointed out, yes there middleware fix out of scope of above question. i'll add following rationale quoted comment below: i thinking somewhere down line, connect have saved original properties of original node request/response object leading question surely if original object saved, there potentially conversion possible express request/response object..

cypher - Creating Relationship on the fly for Neo4j -

i'm quite new in neo4j , excited learn. using movie database , trying solve issue need create relationship between actor based on movie acts on together. for example, harrison ford , alec guiness acts on same 4 movies. harisson ford total movie 34 movies , alec guiness total movie 16 movies. i create relationship on fly say: "harrison ford"-[:same_movie{weight: 0.12 }]->"alec guiness" "alec guiness"-[:same_movie{weight: 0.25 }]->"harrison ford" i stuck @ getting calculation , alias, appreciate if can help. match (a:actor{name:"alec guinness"})-[x:acts_in]->(:movie)<-[y:acts_in]-(b:actor{name:"harrison ford"}) return {start: a.name, rel: count(x), end : b.name} ps: creating relationship physically not option in real case take lot of space. thanks. since need counts of movies in common total movies both actors have acted in, can try this match (a:actor{name:"alec guinness...

javascript - Prevent User from changing query string -

in multi page application can prevent user skipping page changing query string? if how. note: there 13 pages first 2-4 page (3 pages) skipped system if customer count ==1. if customer count greater 1 none of pages can(should) skipped. i don't think question complete; in general terms, query string reflects parameters. there no way user manipulate post parameters without getting console. if user can use console, no clientside data safe; foolproof, need track user in serverside session.

javascript - Changing height on div in css when resizing page using Twitter Bootstrap -

i'm looking way set height of div searchresults 100% when resize down col-xs-12 . when searchfilter div shrinks down col-xs-12 hide , height set 20%. div below searchresults has height of 80%, , when resize down col-xs-12 want change it's height 100%. i tried in css didn't work. .searchresults .col-xs-12 { height: 100%; } i tried .searchresults > .col-xs-12 { height: 100%; } here html , css .searchfilter { height: 20%; } .searchresults { height: 80%; } .searchresults .col-xs-12 { height: 100%; } <div class="container-fluid"> <div class="row"> <div class="col-lg-5 col-md-5 col-sm-5 hidden-xs"> @*sidebar*@ <div id="googleresultmap"></div> </div> <div class="col-lg-7 col-md-7 col-sm-7 col-xs-12"> @*body content*@ <div class="searchfilter col-lg-12 col-md-12 col-sm-12 hidden-xs"...

java - start and stop tomcat via command prompt -

im using tomcat 6.0.18 . have installed tomcat server , set catalina_home variable in environment variables. inside tomcat installation location under bin folder, there no startup.bat or shutdown.bat file available. there 2 exe files: tomcat6.exe & tomcat6w.exe . know how start tomcat server via command prompt. i tried executing below command c:\apache software foundation\tomcat6.0\bin>tomcat6.exe start the start command works fine. i'm unable stop server using command c:\apache software foundation\tomcat6.0\bin>tomcat6.exe stop but stop command not stop server. starts tomcat server. both commands 'tomcat6.exe start' & 'tomcat6.exe stop' starts tomcat server. know options should use stop tomcat server via command prompt. any on appreciated. in advance. if tomcat server 64 bit , system 32 bit server wont start...check system type when configuring

Drupal WSOD error caused by 'drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);' in index.php -

so i'm required fix issue drupal website while having no experience @ drupal. issue website not loading up, white screen, no errors coming after adding error_reporting(e_all); by putting in die()s able find out line that's causing issue drupal_bootstrap(drupal_bootstrap_full); here's full sourcecode index.php: <?php error_reporting(e_all); ini_set('error_reporting', e_all); ini_set('display_errors', true); ini_set('display_startup_errors', true); // $id: index.php,v 1.94 2007/12/26 08:46:48 dries exp $ /** * @file * php page serves page requests on drupal installation. * * routines here dispatch control appropriate handler, * prints appropriate page. * * drupal code released under gnu general public license. * see copyright.txt , license.txt. */ define('drupal_root', getcwd()); require_once drupal_root . '/includes/bootstrap.inc'; // reaching here drupal_bootstrap(drupal_bootstrap_full); // not reach here $retu...

visual studio - Using Team Foundation Server Merge tool on any files -

Image
is possible use merge tool 2 files, in example c:/1.txt , c:/2.txt on local machine? thanks! vsdiffmerge.exe in path "microsoft visual studio xxx\common7\ide" thing visual studio uses compare , merge files. you can use starting vsdiffmerge.exe right command line. here blog post explaining how that. note merge tool isn't independent, still open in visual studio only. the syntax this: "%vs110comntools%/../ide/vsdiffmerge.exe" "file1" "file2" "filethatservesasbase" "filethatservesastarget" /m for example "%vs110comntools%/../ide/vsdiffmerge.exe" "person source.cs" "person target.cs" "person source.cs" "person source.cs" /m syntax , example pulled above mentioned blog post.

jquery - JavaScript function parameter issue -

this question has answer here: passing variable single quote in javascript 6 answers i'm using javascript function in html click , pass 3 parameters in <div class="save_button" onclick="savetext('text','text_2000','plan share experiences week.')">submit</div> this working fine function function savetext(type,text_id,text_body){ // mycode } note: 3rd parameter can text when 3rd parameter came <div class="save_button" onclick="savetext('text','text_2001','it's hot today, i'll do? (better not go outside!).let's have ice cream')">submit</div> showing error in console uncaught syntaxerror: missing ) after argument list i know due additional ( , ) , ' coming on parameter. couldn't able remove 3rd parameter be...

php - WooCommerce - change QTY triggers AJAX call in cart -

i update , reload cart via ajax when quantity of item in cart changed. i can load in cart via ajax. to load in cart php function looks this. (in functions.php) function enqueue_cart_show_ajax() { wp_register_script( 'cart-show-ajax-js', get_template_directory_uri() . '/js/cart-show-ajax.js', array( 'jquery' ), '', true ); wp_localize_script( 'cart-show-ajax-js', 'cart_show_ajax', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) ); wp_enqueue_script( 'cart-show-ajax-js' ); } add_action('wp_enqueue_scripts', 'enqueue_cart_show_ajax'); function ajax_show_cart() { echo do_shortcode( '[woocommerce_cart]' ); die(); } add_action('wp_ajax_show_cart', 'ajax_show_cart'); add_action('wp_ajax_nopriv_show_cart', 'ajax_show_cart'); my jquery code looks (in cart-show-ajax.js) jquery(function($) { //if view-cart clicked, fi...

java - How to add headers to OkHttp request interceptor? -

i have interceptor add okhttp client: public class requesttokeninterceptor implements interceptor { @override public response intercept(chain chain) throws ioexception { request request = chain.request(); // here we'll try refresh token. // retrofit call // after succeed we'll proceed our request response response = chain.proceed(request); return response; } } how can add headers request in interceptor? i tried making mistake , lose request when creating new request: public class requesttokeninterceptor implements interceptor { @override public response intercept(interceptor.chain chain) throws ioexception { request request = chain.request(); request newrequest; try { log.d("addheader", "before"); string token = tokenprovider.getinstance(mcontext).gettoken(); newrequest = request.newbuilder() .addheader(headerscontract.header_authonrization, o...

ios - SpriteKit - Mouse Snaps to Center On Sprite Drag -

i'm trying create ios game , have when item touched , moved dragged. when dragged mouse snapped center of sprite. how make wouldn't happen? here example of happening. here functions dealing touch input override func touchesbegan(touches: set<nsobject>, withevent event: uievent) { var papers = 0 touch in (touches as! set<uitouch>) { let location = touch.locationinnode(self) let touchednode = nodeatpoint(location) if ((touchednode.name?.contains("paper")) != nil) { touchednode.position = location touchednode.position.x = cgrectgetmidx(self.frame) } } } override func touchesmoved(touches: set<nsobject>, withevent event: uievent) { touch: anyobject in touches { let location = touch.locationinnode(self) let touchednode = nodeatpoint(location) if ((touchednode.name?.contains("paper")) != nil) { touchedno...

ios - Add a circular cropping component for UIImagePicker? -

Image
i have circular framed uiimageview , need add circular framed cropping tool uiimagepickercontroller , after image selected photo library. similar instagram's uiimagepicker's crop component. how add type of component? update i've found repo circular cropping tool https://github.com/ruslanskorb/rskimagecropper but can guide me on how implement cropping tool uiimagepickercontroller after user selects photo photo library? update i getting following message in debugger : and buttons in crop view disabled, meaning cannot select them.. message debugger relaying on me? here code: @ibaction func chooseprofilepicture(sender: anyobject) { var mypickercontroller = uiimagepickercontroller() mypickercontroller = uiimagepickercontroller() mypickercontroller.delegate = self; mypickercontroller.sourcetype = uiimagepickercontrollersourcetype.photolibrary self.presentviewcontroller(mypickercontroller, animated: true, completi...

sql - how to get records who is reaching todays date -

i want records reach todays date in 2 days projectenddt. want show projects going end in 2 days. want show 2 days before. query select projectenddt , projectrenewaldt , projectupgradedt tbl_project convert(varchar(10), dateadd(day, 2, projectenddt)) >= convert(varchar(10), getdate());

c# - one of my methods has completely different execution time for same input -

i have web service should return answer in less 10 milliseconds. have many validation process including mobile number validation. every thing works fine mobile number validation execution time different!! returns in less millisecond , 2 seconds!! please take @ part of log file:(same entry in different times) [info ];[2015-08-25 9:51:09,073];[11];[intermediate_mobile.mobilecontentvalidator];[1800.2534 ms] [info ];[2015-08-25 10:47:53,636];[5];[intermediate_mobile.mobilecontentvalidator];[5.4598 ms] [info ];[2015-08-25 10:51:09,073];[38];[intermediate_mobile.mobilecontentvalidator];[0.1379 ms] [info ];[2015-08-25 11:12:09,073];[45];[intermediate_mobile.mobilecontentvalidator];[1780.4578 ms] and here method: public bool mobilecontentvalidator() { regex len = new regex(@"^.{2,20}$"); //length @ least 6 characters , maximum of 20 regex number = new regex(@"^[0-9]*$"); //a string consisting of numbers phonenumber mobile; stopwatch sw = new stopw...

ttml - What happens if different region attribute values are specified on parent and child? -

suppose have following ttml document: <tt xml:lang="en" xmlns="http://www.w3.org/ns/ttml" xmlns:tts="http://www.w3.org/ns/ttml#styling"> <head> <layout> <region xml:id="a"/> <region xml:id="b"/> </layout> </head> <body> <div region="a"> <p region="b">abc</p> </div> </body> </tt> according 9.3.2 intermediate synchronic document construction , visual marks produced regions a , b ? at first expecting a produce nothing , b produce abc , specification seems contradict implying anonymous span abc pruned (directly or indirectly) both when evaluating region a , b , seems bit counter-intuitive. the algorithm prunes content , nothing displayed. captured on w3c ttwg issue tracker in issue-341 . why author document behaviour though - mean, intend happen? under conditions not achi...

C# print html document from html string -

string s="<html><body>..some html code..</body></html>"; how print document without printdialog ? output: ...some html code... as understood correctly, need webbrowser class: webbrowser webbrowser = new webbrowser(); void print(string str) { webbrowser.documenttext = str; webbrowser.documentcompleted += webbrowser_documentcompleted; } void webbrowser_documentcompleted(object sender, webbrowserdocumentcompletedeventargs e) { webbrowser.print(); }

optimization - Scala: Why does my tail call optimized code run slower? -

recently needed write functionality flatten data structure list(). wrote 2 functions: mutable , recursive, and immutable , tail optimized. the immutable , tail optimized runs slower. why? here code: this recursive data structure flatten list[string]: case class node[a](rootnode: a, subtree: list[node[a]]) this mutable solution: def nodewalk(node: node[file]): list[string] = { val ls = listbuffer[string]() def recursenodes(node: node[file]): unit = { node match { case node(r, nil) => ls += r.getabsolutepath case node(r, l) => ls += r.getabsolutepath l.map { x => recursenodes(x) } } } recursenodes(node) ls.tolist } this immutable , tail optimized solution import scala.util.control.tailcalls._ def nodewalk2(node: node[file]): list[string] = { @annotation.tailrec def nodewalker(node: node[file], acc: list[string]): list[string] = { node match { case node(r, list()) => r.getabsolutepa...

javascript - Jquery Focusing another element on blur is not working in FireFox -

i trying focus input element on 1 input`s blur event. not working. <input type="text"/> <input type="text"/> $("input:last").on("blur",function(e){ $("input:first").focus(); }) the cursor not present in element. not able type anything. http://jsfiddle.net/7foref2g/ unfortunately can't make work ff. see jquery bug ticket firefox focus , blur events not firing when calling focus() , blur() , firefox 1 bug 53579 - calling this.blur() in onfocus handler or this.focus() in onblur handler not work

osx - Why Macports does not show the apple xcode compiler through "port select gcc"? -

recently updated mac's xcode , command line tools version 6.4 (i'm running on osx yosemite 10.10.5). after did change, install new package macports, forced run "port selfupdate". however, after did that, broke in system. particularly, usual port select gcc not display apple compilers installed xcode. displays: available versions gcc: mp-gcc48 none (active) i have that, trying solve compilation problem (that's how found out issue), uninstalled 1 or 2 mp-gcc versions. however, remember apple versions should have been listed there. to make sure apple compilers installed: running command xcode-select --install displays following: xcode-select: error: command line tools installed, use "software update" install updates and xcode-select -p displays following: /applications/xcode.app/contents/developer so, compilers there. ~/.profile file contains following line: macports installer addition on 2013-05-13_at_00:53:37: adding appropriate pa...

html - How to change directions of the buttons in bootstrap navigation menu? -

Image
i using bootstrap-nav-wizard.css project. here demo: <link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"/> <link href="http://acornejo.github.io/bootstrap-nav-wizard/bootstrap-nav-wizard.css" rel="stylesheet"/> <link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"/> <body> <div class="container"> <ul class="nav nav-wizard"> <li class="active"><a href="#">step1</a></li> <li><a href="#">step2</a></li> <li><a href="#">step3</a></li> </ul> <hr> </div> </body> the step buttons direction left right. i need change directions of buttons right left. i have direction: i want direction: my question how can cha...

Instance creation in Openstack Nova - Logfile -

i need keep track of instance creation in openstack nova. that need perform special operations on creation of new instance in openstack. so need know details getting stored (in log file). please 1 guide me regarding log file tracking instance creation or other way track same. as aware have in following services' log files nova-scheduler (oftenly installed on controller node). show 'server' host newly created virtual machine. the logs of nova-compute service running on host virtual machine instantiated. you can additionally check logs of qemu , libvirt (again on host virtual machine instantiated) have in mind info find there, depends on 'logging level' have set in each service configuration files. more information how can configure openstack components logging refer official documentation " logging , monitoring ".

python - Find all possible overlap and non-overlaps from list of various ranges of numbers -

with following code can determine overlap range, give list of ranges (tuple). list size can vary. example list has 3 tuples. ranges = [(10,20), (15,25), (18,30)] starts, ends = zip(*ranges) result = range(max(starts), min(ends) + 1) print(*result) # 18 19 20 now want find non-overlap . same input ranges. yields: (10,11,12,13,14) (26,27,28,29,30) how can achieve that? here's solution using heapq : range(*heapq.nsmallest(2, starts)) # -> 10, 11, 12, 13, 14 end, start = heapq.nlargest(2, ends) range(start+1, end) # 26, 27, 28, 29, 30 note work if overlap non-empty. when have empty overlap can obtain "non-overlap" doing: range(min(starts), max(ends)) i.e. it's whole range. so, if wanted function you'd get: def find_overlap_and_non_overlap(ranges): starts, ends = zip(*ranges) overlap = range(max(starts), min(ends)+1) if not overlap: return ([], range(min(starts), max(ends)+1), []) less_non_overlap = r...

c# - How to use MS Sync framework with visual studio 2013 -

i developing oca windows form application c# .net 4.5 on visual studio 2013. i looking "how sync" local database central database; , got microsoft sync framework. tutorials , blogs pinpoint visual studio 20110 , ms sql server 2008. quite old now. i followed article . in visual studio 2013 local database cache not supported. don't know how can use ms sync framework visual studio 2013 please provide solution works sync in visual studio 2013 ms sql server 2012 express. the local database cache project item removed vs 2013 there's no stopping downloading sdk , coding sync stuff yourself. sdk documentation has walkthroughs on how sync.

mongodb - How can we write mongo db query in Spring -

i have feed collection has 2 fields: username , sentiment . have write aggregation in spring group username , sentiment . have display total number of times username comes in collection. how that? my code is: db.feed.aggregate([ {$group: {_id : {username : '$username',sentiment:'$sentiment'}, total:{$sum :1}}}, {$project : {username : '$_id.username', sentiment : '$_id.sentiment', total : '$total', _id : 0}} ]) the first thing comes mind: http://docs.spring.io/spring-data/mongodb/docs/current/reference/html/#mongo.aggregation so in case like: import static org.springframework.data.mongodb.core.aggregation.aggregation.*; class stat { string username; string sentiment; int total; } aggregation agg = newaggregation( group("username", "sentiment").count().as("total"), project(). and("_id.username").as("username")....

html - Two floating divs, one text is vertical -

Image
have been fiddling hour, starting lose it. want i tried using css webkit-transform-rotate, vertical text out of place (also tried set width & height seems weird) any more appreciated! i think trick you. check code snippet. can use css transform this. rotate text -90 degrees , problem solved. add writing-mode tb-rl . .test { width: 300px; height: 300px; margin-top:50px; } .vertical { writing-mode:tb-rl; -webkit-transform:rotate(-90deg); -moz-transform:rotate(-90deg); -o-transform: rotate(-90deg); -ms-transform:rotate(-90deg); transform: rotate(-90deg); transform-origin:100 100; white-space:nowrap; display:block; float: left; background: #ccc; width: 94px; padding:5px; font-size:13px; font-weight:bold; margin-top:38px } .normal { width: 190px; float: left; background:#555; height:100px; margin-left:-40px...

opengl - integer currupt in glsl -

i have strange behavior in rendering process. i'm passing 32-bit unisgned integer attribute shader. vertex-shader forwards attribute flat uint fragmentshader. in fragment shader comparison. in case send in 1u , compare 1u. doesn't generate true. instead value compared to 0x3f800000 generates true. so, somehow initial 32-bit value: 0000 0000 0000 0000 0000 0000 0000 0001 has become: 0011 1111 1000 0000 0000 0000 0000 0000 all i'm doing this: vertex: layout(location = 3) in uint in_index flat out uint v_index; v_index = in_index; fragment: if (v_index == 0x3f800000u){discard;} and fragments discarded. i'm using core 330. and way, i've used floats , shorts , work fine. @andon m. coleman solved me! use glvertexattribipointer (...) instead of glvertexattribpointer (...).

smalltalk - How do I call a Yes / No / Cancel dialog in Pharo 4.0? -

this question related how ask user file name? the issue of 'standard dialogs'. how call yes / no / cancel dialog , how call alert in pharo 4.0? you can use uimanager default question: 'foo' title: 'bar'. which answers true yes, false no, , nil cancel. similarly, alert can shown this: uimanager default alert: 'hello world'.

How can I get textBaseline="alphabetic" behavior in Kineticjs? -

i'm trying align text in way canvas context textbaseline property set "alphabetic" does. can't same effect kineticjs. var letters = [ { symbol: "a", x: 3.0, size: 20 }, { symbol: "b", x: 36.3, size: 30 }, { symbol: "c", x: 86.3, size: 40 }, { symbol: "d", x: 158.6, size: 50 }, { symbol: "e", x: 248.9, size: 40 }, { symbol: "f", x: 315.5, size: 30 }, { symbol: "g", x: 361.3, size: 20 } ]; // how kineticjs renders text (function actual() { var stage = new kinetic.stage({ container: "mycontainer", width: 400, height: 100 }), layer = new kinetic.layer(), baseline = 60; letters.foreach(function(letter) { layer.add(new kinetic.text({ x: letter.x, y: baseline - letter.size, text: letter.symbol, fontsize: letter.size, fill: 'black', })); }); ...

javascript - angular (jquery timepicker) unable to get value of input -

i want make custom directive jquery plugin timepicker. i'm not getting input value in console, says undefined. here's plunkr <table class="table table-bordered"> <thead> <tr> <th>time from</th> <th>time to</th> </tr> </thead> <tbody> <tr> <td> <input type="text" ng-model="row1" size=6/ disabled> </td> <td> <input type="text" ng-model="dup_row1 " size=6 timepicki/> {{dup_row1}} </td> </tr> </tbody> </table> var app = angular.module('myapp', []); app.directive('timepicki', [ function() { var link; link = function(scope, element, attr, ngmodel) { element.timepicki(); }; return { restrict: 'a', link: link, require: 'ngmodel' }; } ])...

Mercurial .hgignore for umbraco 7 web project in visual studio -

i used answer of question visual studio 2012 .hgignore file before. now developing umbraco 7 project in visual studio. after changing small thing, found lot of changed file showing in mercurial working directory. understand cms, changes lot of files internally. confusing maintain. what files should place in .hgignore file when using umbraco 7 in vs2012 . basically of items in /app_data/ folder, , possibly /media/ folder if don't want keep track of that. google umbraco .gitignore files , use reference if want more comprehensive list.

access a project link on ubuntu machine without port number -

i have project running on ubuntu (installed on vm machine(ipaddress-172.22.240.54) on server ), jboss server port 8180 i need access link via http://172.22.240.54/employeeconnect/rest (without mentioning port number) what changes required in httpd file , server.xml file? you need add following httpd.conf proxypass /employeeconnect/rest http://localhost:8180/employeeconnect/rest proxypassreverse /employeeconnect/rest http://localhost:8180/employeeconnect/rest

machine learning - Recommender approach and algorithms for cold-start -

we looking @ building recommender system our brand-new learning management system. there bunch of users , items (learning modules) onboarded, no ratings yet - typical cold start problem. to begin with, thinking of using simple item-based similarity using item attributes (tags, category, etc.) idea switch more robust collaborative filtering ratings start coming in. questions: is approach? there recommended ml pattern handle such cold-start conditions? to realise item-based similarity, right algorithm? say, cosine similarity. however, please note there no "matrix". should try use standard ml algorithm or maybe roll our own? your approach good. start unsupervised learning algorithm such 'k-nearest neighbors classifier'. if team doesn't know first thing ml, recommend read tutorial http://www.astroml.org/sklearn_tutorial/general_concepts.html . uses python , great library called scikit-learn. there andrew's ng course ( https://www.coursera.o...

angularjs - My directive uses isolate scope, but still fetches data from the controller's scope -

i have created 2 directives, 1 controller passed in, , other require passed it. what trying check how directives use isolated scopes , utilize data of own scope. but out put strange. please follow code below, <!doctype html> <html lang="en" ng-app="myapp"> <head> <title>recipe 02 example 01</title> <script type="text/javascript" src="d:\rahul shivsharan\javascript-framework\angularjs\angular.js"></script> <script type="text/javascript" src="d:\rahul shivsharan\javascript-framework\jquery\jquery-1.11.1.js"></script> <script type="text/javascript" src="d:\rahul shivsharan\javascript-framework\bootstrapcss\bootstrap-3.2.0-dist\js\bootstrap.js"></script> <link rel="stylesheet" href="d:\rahul shivsharan\javascript-framework\bootstrapcss\bootstrap-3.2.0-dist\css\bootstrap.css"></link> ...

c# - Bitmap.Save() method is not working in Unity source -

i wanna implement 'bitmap texture2d' function in unity. i learned make texture2d instance, use syntax below. // **loadimage(byte[] arr)** can load byte array data , make texture2d var data = bitmaptobytemethod(bitmap); var texturecanvas = new texture2d(bitmap.width, bitmap.height, textureformat.argb32, false); texturecanvas.loadimage(data); texturecanvas.apply(); to make function did this. using (memorystream memorystream = new memorystream()) { imagecodecinfo jpgencoder = getencoder(imageformat.jpeg); system.drawing.imaging.encoder myencoder = system.drawing.imaging.encoder.quality; encoderparameters myencoderparameters = new encoderparameters(1); encoderparameter myencoderparameter = new encoderparameter(myencoder, 100l); myencoderparameters.param[0] = myencoderparameter; // point error occurred. bitmap.save(memorystream, jpgencoder, myencoderparameters); //bitmap.save(memorystream, imageformat.jpeg); return memorystream.toarray...

node.js - Socket.IO - how do I close socket with socketID in socket.io 1.3.6? -

i developing application of two-way communication in socketio. i using following method send specific user. io.to(socket.id).json.emit('message', message); how close socket socketid in socket.io 1.3.6? to borrow wisdom. you can use: io.sockets.connected[socketid].disconnect();

HTTP request with volley Java/Android -

i'm trying make http request page, application aways crash. first java application i'm beginner. been researching while not find solution: package com.lookingunique.splashstockcontrol; import android.app.activity; import android.os.bundle; import android.text.editable; import android.text.textwatcher; import android.view.view; import android.widget.button; import android.widget.edittext; import android.widget.toast; import com.android.volley.request; import com.android.volley.requestqueue; import com.android.volley.response; import com.android.volley.volleyerror; import com.android.volley.toolbox.stringrequest; import com.android.volley.toolbox.volley; public class mainactivity extends activity { edittext barcode; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); barcode = (edittext) findviewbyid(r.id.etbarcode); final button addbtn = (button) findviewbyid(r...