Posts

Showing posts from March, 2010

unit testing - How to get all packages' code coverage together in Go? -

i have library consisting of several packages. when running tests, using '-cover' flag , showing coverage information each package individually.like follows: --- pass: testsampletestsuite (0.00s) pass coverage: 28.7% of statements ok github.com/path/to/package1 13.021s ? github.com/path/to/package2 [no test files] === run testabc --- pass: testabc (0.43s) pass coverage: 27.7% of statements is there way full coverage overview idea coverage on whole project? update: here go test command using go test ./... -v -short -p 1 -cover here bash script extracted https://github.com/h12w/gosweep : #!/bin/bash set -e dir in $(find . -maxdepth 10 -not -path './.git*' -not -path '*/_*' -type d); if ls $dir/*.go &> /dev/null; go test -short -covermode=count -coverprofile=$dir/profile.tmp $dir if [ -f $dir/profile.tmp ] cat $dir/profile.tmp | tail -n +2 >> profile.cov rm $dir/profile.tmp fi fi don...

javascript - Using async package inside blue bird promises -

i know if i'm using async inside promise, this: new promise(function(resolve, reject) { async.maplimit(files, 3000, function(file, callback) { // // }, function(result) { // }); }); i'm doing because need process maximum of 3000 files, if pass 9000, need process before call other function in stack. for example i'm using new promise, i'm using promisifyall in real code. "same" i have mainobject: var myobject = {} inside with, have 4 steps, , i'm using promisifyall because need wait 1 step finish before call other, this: var myobject = { stepone: function(files, callback) { }, steptwo: function(files, callback) { }, stepthree: function(files, callback) { }, stepfour: function(files, callback) { } }; promise.promisifyall(myobject); the problem is, in step (i'm dealing files here) can allow program run 3.000 asynchronous, achieve this, i'm using following: async.maplimit(files, 3000, function() { ...

python - Odoo. How to translate menu items? -

Image
i working odoo , need translate menu items. can provide example step step how can this? in advance! translate menus need follow these steps. 1. settings => translation => load translation. 2. select proper language , click load button. 3. open user preferences. 4. change language user preferences , menus language changed.

How can I configure the data present in HBase caputure to Apache Kafka -

now presently working based on hbase , kafka. my requirement is: suppose if have data present in hbase database. need capture database kafka. here hbase database acts producer , when ever have created in database/producer automatically captures kafka consumer. i have followed many links have not got exact solution. please give me suggestions , provide links based on requirement. if want information ping me. if want use database producer, might want kafka connect. it allows ingest data external sources reliably kafka. https://kafka.apache.org/documentation.html#connect http://docs.confluent.io/3.0.0/connect/index.html

Distributed tensorflow parameter server and workers -

i closely following imagenet distributed tf train example. i not able understand how distribution of data takes place when example being run on 2 different workers? in theory, different workers should see different part of data. also, part of code tells parameters pass on parameter server? in multi-gpu example, there explicit section 'cpu:0'. the different workers see different parts of data virtue of dequeuing mini batch images single queue of preprocessed images. elaborate, in distributed setup training imagenet model, input images preprocessed multiple threads , preprocessed images stored in single randomshufflequeue . can tf.randomshufflequeue in this file see how done. multiple workers organized 'inception towers' , each tower dequeues mini batch of images same queue, , different parts of input. picture here answers second part of question. slim.variables.variabledevicechooser in this file. logic there makes sure variable objects assigned evenl...

Delta encoding - strings (Programming logic - no specific language) -

can put code delta encoding strings. for example, if initial string "cat , dogs" and later string "cats , dogs" i should able difference between string versions efficiently. if can put code here big paragraphs can sent delta encoding less data. i found answer, wanted share all. var oldstring = "this sample of string test delta encoding. infact, own login.dsfdsfdsfdsfsdfsdfdsfdsfsdfsdfds dsfds fds fddsf"; var newstring = "dsfdsthissdf sample of string test x dedsfdsflta encoding sdfds decoding. infact, own sadsadsadsad" var result = ""; var changes = getchanges(oldstring, newstring); var string = getoriginal(oldstring, changes); function getchanges(os, ns) { var addedindex = false; var changes = []; var obj = []; var oi = 0, ni = 0; while (oi < oldstring.length && ni < newstring.length) { if (newstring.charat(ni) != oldstring.charat(oi)) { if (!adde...

java - JPanel with JComponents inside a JScrollPane and custom LayoutManager -

i have written subclass of jcomponent draws in paintcomponent method. in constructor set bounds setbounds. works fine. added subclass jpanel. jpanel inside jscrollpane. jpanel class subclassing jpanel , implementing mouseinputlistener , keylistener. whenever user clicks in jpanel bounds of each jcomponent check against mouse point. if matched focus set jcomponent. if focus @ jcomponent , user drags mouse jcomponent moved inside jpanel. want achive whenever position of jcomponent inside jpanel changes , gets out of viewport of jscrollpane scrollbars gets visible , jpanel gets resized user can scroll outside of viewable area. achive have written custom layoutmanager not layout jcomponents in way absolute position. whenever move jcomponent inside jpanel , outside of viewable area scrollbars not updated. how can achive this? here class subclassig jcomponent: public abstract class gate extends jcomponent { /** * */ private static final long serialversionuid = 1l; public gate() ...

c# - Find the name of the class that eventually does work in a string of method calls -

i have problem need solve , revolves around idea of code following. public class x { private y yinstance; public bool dosomething(){ return y.dosomething(); } } public class y { private z zinstance; public bool dosomething(){ return z.dosomething(); } } public class z { public bool dosomething(){ return true; } } i to, having instance of x, beable find out class work, in case "z". however, in case there can number of layers , more 1 path lead final class. please let me know if need clarify anything. note: need without calling method is possible? edit: poor pseudo-code demonstrate use-case little better suggested. note in repository using nhibernate criteria. public ienumberable<t> getbycriteria(detachedcriteria criterion){ if(criterion.type.getfilterbase() == a) criterion.appendfilter_a(); if(criterion.type.getfilterbase() == b) criterion.appendfilter_b(); if(criterion....

javascript - How to give exported file name in safari browser -

exported html table xls file name of file unknown file.how customize name of exported file. you set filename header in response performs download of said file: filename="downloaded.xls" see, how set name of file downloaded browser?

sql server - Dynamic SQL and carriage breaks -

i trying insert table dynamic sql following code: set @sqlinsert = 'insert ' + @tablename + ' (op__docid, op__parentid, op__folderid, clientkey, admissionkey, pgmkey, ' + 'pgmadmissionkey, staffkey, groupsize, mealtime, appmgrkey, sessionnum, facilitykey, ttmnotetext,' + @datefield + ', ' + @timefield + ') ' set @sqlvalues = 'values (' + cast(@newdocid varchar) + ', ' + cast(@clientkey varchar) + ', ' + cast(@clientkey varchar) + ', ' + cast(@clientkey varchar) + ', ' + cast(@admissionkey varchar) + ', ' + isnull(cast(@pgmkey varchar),'') + ', ' + isnull(cast(@pgmadmissionkey varchar),'') + ', ' + cast(@staffkey varchar) + ', ' + cast(@groupsize varchar) + ', ' + cast(@mealtime varchar) + ', ' + cast(@apprvmgr varchar) + ', ' + cast(@sessionnum varchar) + ', ' + cast(@facilitykey varchar) + ', ' --added 1...

clojure - Does (into) do any higher-level inference to stay idiomatic on output type? -

say have key-value pair i've agnostically defined key-value map: (def foo {:bar "baz" :bat "squanch"}) it occurs me @ later time set operations on it, i'll need convert relation, clojure cheatsheet says type of set, go ahead , grab (into) , go it: (set/project (into #{} foo) [:bar]) #{{}} huh? (into #{} foo) #{[:bar "baz"] [:bat "squanch"]} that's not (project) expects @ all. according the docs : ;; `project` strips out unwanted key/value pairs set of maps. ;; suppose have these descriptions of cows: user=> (def cows #{ {:name "betsy" :id 33} {:name "panda" :id 34} }) #'user/cows ;; care names. can them this: user=> (project cows [:name]) #{{:name "panda"} {:name "betsy"}} so close. should expecting (into) know mean when convert 1 of these types, or there way? if it's going this, might roll own thing few map/flatten calls, that's i'm trying avo...

linux - Does O_DIRECT bypass filesystem journaling? -

the man page open(2) suggests o_direct bypasses page cache, many descriptions around net describe causing user buffer dma'd straight drive. if case imagine bypass journaling done filesystem (e.g. xfs, ext4, etc.). case? i can't find claiming 1 way or other. seems me consistent o_direct being used databases -- common example use o_direct when application database doing own caching in userspace, , can imagine databases doing own transaction logs.

git - Disable automatic merging files when pulling from another branch -

how stop tortoisegit and/or sourcetree performing automatic merge when pull branch? i want manually merge (with kdiff3 or whatever external diff/merge program) files have been changed in both checked out branch , branch i'm pulling from. apparently, merging done automatically (and badly) default, , messed project files. setup kdiff3 external program diff/merge fetch compare revisions diff each file , merge manually external program setting: https://tortoisegit.org/docs/tortoisegit/tgit-dug-settings.html diff kdiff3: c:\path-to\kdiff3.exe %base %mine --l1 %bname --l2 %yname merge kdiff3: c:\path-to\kdiff3.exe %base %mine %theirs -o %merged --l1 %bname --l2 %yname --l3 %tname

sql - select recursive and order by -

i use below query select recursive top bottom e.g if tagid 1 rows 1 > 3,4, > 5 works fine, want know how result order "name" @ each level(same parent id) rows 1 > 4,3 > 5 ? i treid add order "name" after select * "tag" "tagid" = $1 not work . , if add after select * tag_tree mess level become 1,4,5,3 not want . create table if not exists "tag"( "tagid" serial not null, "parenttagid" integer, "name" varchar, primary key ("tagid") ); tagid | parenttagid | name | 1 | | | 2 | | b | 3 | 1 | b | 4 | 1 | | 5 | 3 | | var query = 'with recursive tag_tree ( ( select * "tag" "tagid" = $1 ) union select child.* "tag" child join tag_tree parent on parent."tagid" = child."parenttagid" ) select * tag_tree'; add ord...

php - How to include Wordpress header/footer in CGI script -

i have cgi script creates, searches, , edits mysql database. database searchable listing of burials cemetery, similar this: http://www.cowlitzcemetery2.org/burials/ based off program called "flattext mysql" no longer available online. anyway, trying set script new cemetery, use wordpress main site. use script, import wordpress header , footer around script output, search results match rest of web site. possible? thank you! yes. here : https://metacpan.org/pod/template or use easier way .. templatize yourself grab entire wordpress page cgi script after data section , instead of printing: my $output = ''; ... $output.="string1\n"; ... $output.="string2\n"; $/ = undef; $page = <data> $page =~ s/<content>/$output/; print $page; __data__ <html> wordpress page begin <content> wordpres page footer </html>

glass mapper - How to set up Sitecore 8.1 MVC project with multiple website -

i planning set sitecore 8.1 mvc project 2 website in 1 visual studio solution approach should follow: approach 1: should create 2 mvc project in 1 solution sample.sc.model ( c# class library ) sample.sc.utility ( c# class library ) sample.sc.web.website1 ( mvc project ) ( project contains layout,sublayout , specific website1 ) sample.sc.web.website2 ( mvc project ) ( project contains layout,sublayout , specific website2 ) aproach 2: should create 1 mvc project , put website1 layout , website1 sublayout in website1 folder , website2 layout , website2 sublayout in website2 folder sample.sc.model ( c# class library ) sample.sc.utility ( c# class library ) sample.sc.web.website ( mvc project ) ****folder structure under sample.sc.web.website node**** layout website1 ( contains layout specific website1 ) website2 ( contains layout specific website2 ) sublayout website1 ( contains sublayout specific website1 ) website2 ( contains sublayout specific web...

jax rs - Uploading a file via Jaxax REST Client interface, with third party server -

i need invoke remote rest interface handler , submit file in request body. please note i don't control server . cannot change request multipart, client has work in accordance external specification. so far managed make work (omitting headers etc. brevity): byte[] data = readfilecompletely (); client.target (url).request ().post (entity.entity (data, "file/mimetype")); this works, fail huge files don't fit memory. , since have no restriction on filesize, concern. question: somehow possible use streams or similar avoid reading whole file memory? if possible, i'd prefer avoid implementation-specific extensions. if not, solution works resteasy (on wildfly) acceptable. reasteasy jersey support inputstream out of box use entity.entity(inputstream, "application/octet-stream"); or whatever content-type header want set.

Get values from selected box in bs dual list angularJS -

i trying selected values in dual box. refference of link http://www.virtuosoft.eu/code/bootstrap-duallistbox/ i have done below code snippet: .html <select name="duallistbox_demo1[]" ng-model="recschedule" ng-options="recschedule recschedule.recschedulingname recschedule in recordingschedules" size="10" multiple bs-duallistbox selected-list-label="{{ settings.selectedlistlabel }}" non-selected-list-label="{{ settings.nonselectedlistlabel }}"> </select> json file: [ { "id": "1", "recschedulingname": "record schedule 1" }, { "id": "2", "recschedulingname": "record schedule 2" }, { ...

extjs - Excel-like behaviour of Grids in Ext JS -

i'm trying figure out way have excel-like behavior grids on ext js. here sample grid working with. far can naviguate through cells arrows in edit mode. however trying reach naviguation arrows, tab , enter keys outside of edit mode, excel. i tried integrate piece of code overrides editor class, hoping change behavior of cells doesn't change thing. i believe important part overrides editor class , tries include keys input : ext.override(ext.editor, { startedit: function (el, value) { var me = this, field = me.field; me.completeedit(); me.boundel = ext.get(el); value = ext.isdefined(value) ? value : me.boundel.dom.innerhtml; if (!me.rendered) { me.render(me.parentel || document.body); } if (me.fireevent('beforestartedit', me, me.boundel, value) !== false) { me.startvalue = value; me.show(); field.reset(); if (deletegridcellvalue) { field.setvalue(''); ...

stdin - Program does not accept argument Python -

i creating postfix calculator accepts arithmetic expressions , first pushes operators stacl. ./pythonfilename 3 4 1 + - used input. however, since no output displayed, tried debug program see why program not taking in argument. not result in printing output. hit ctrl+c display traceback call , points out x = sys.stdin.readlines. #!/usr/bin/python import sys import fileinput class stack: def __init__(self): self.items = [] def isempty(self): return self.items == [] def push(self,item): self.items.append(item) def pop(self): return self.items(pop) def peek(self): return self.items[len(self.items)-1] def size(self): return len(self.items) def is_number(line): try: float(line) except valueerror: return false def infixtopostfix(): initstack=stack() x = sys.stdin.readlines() #read user input lines in x:#for lines in fileinput.input(): ...

c - How to make #if #endif part of a macro -

#define m(n)\ #if n == 5\ /*several lines of code can't replaced tertnary operator*/ #else\ n;\ #endif when use macro so m(5); i expect output // within #if #else block but doesn't compile. i'm not surprised doesn't compile: know #if cannot used on continuation line ie "\". i've tried #define pound_if #if and use pound_if doesn't work. is possible do? is there nifty boost pre-processor stuff can used? succinctly, can't. can rely on optimizer instead, though: #define m(n)\ { if (n == 5) { \ /*several lines of code can't replaced ternary operator*/ \ } else { n; } } while (0) if compiler can determine value of n 5 when code run (e.g. write m(5) ), code in body of if included in generated code. if compiler can determine value of n not 5 when code run, generate code in body of else clause. , if can't determine value be, preprocessor not have been ab...

JQuery can't change font-size -

i need change font size on hover, think doesn't work me because i'm using bootstrap. have: <!doctype html> <html> <head> <title>marichihueu</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dtfge/zgomypp7qbhy4gwmegsbsdzecxz7iritjcc3spuftf0kufbdz/ixg7artxmdjlxdmezhubenikykgvyq==" crossorigin="anonymous"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"> </script> <script> $(document).ready(mymain); function mymain(){ $("a").hover(more); function more(){ $(this).animate({font-size:'50px'},"fast"); } } </script> </hea...

cassandra - What is the proper way to seed a 3 node cluster? -

a little background if helps, i'm preparing 3 node cluster (all in same rackspace). want 3 nodes optimal consistency , resilience in smallest footprint , not concerned replicating cluster region. one question have regarding seed nodes. know not idea make every node in cluster seed, in case of 3 nodes, should go ahead , that? or should make subset of 3 nodes seed nodes? confused how pick how many or ones (all machines identical ones isn't issue). seed nodes nothing special initial contact point address. best practice have 1 seed node per 3 nodes in cluster varies depending on deployment. can put 3 ips in seed node list without problems.

event handling - Javascript addEventListener not reading resize -

hi i'm trying add eventlistener adds h1 tag width , height of browser when resize it. don't understand why it's not working. <!doctype html> <html> <head> <title>window size</title> </head> <body> <div id="wh"></div> <script type="text/javascript"> "use strict"; document.addeventlistener("onresize", function(){ var width = document.documentelement.clientwidth; var height = document.documentelement.clientheight; document.getelementbyid('wh').innerhtml = "<h1>width: " + width + " height: " + height + "</h1>"; }); </script> </body> </html> you have wrong event, needs 'resize'. see here further examples - http://www.w3schools.com/jsref/event_onresize.asp <!doctype html> <html> <head> <title>window...

angularjs - Angular Js SPA is not working after publishing in IIS 8.5 -

i'm using spa technique using angularjs in asp.net mvc framework,angularjs routing between pages working fine when it's run vs2013,but after hosting application in iis8.5 routing not working. when run app using iis express url http://localhost:12345/#/home after publishing http://localhost/myapp/#/home here app.js, $routeprovider.when("/home", { controller: "homecontroller", templateurl: "/app/views/home.html" }); in index.html <li> <a href="#/home">home</a></li> when publish app in windows azure, app working fine. because url myapp.azurewebsite.net . myapp.azurewebsite.net/#/home how can host in local iis. you find find answer -- absolute file path. quick fix: change templateurl: "/app/views/home.html" templateurl: "app/views/home.html" (remove heading slash) answer: if specify templateurl /app/views/home.html , starts / , tell browser...

php - Unable to auto-refresh page element using AJAX -

i playing around trying make chatbox, find myself unable make auto-reload messages. using database messages there insufficient permission php write files on server. here code chatbox: <input name="usermsg" id="usermsg" type="text"/> <button id="submitmsg" type="button" onclick="onsubmit()">send</button> </div> <script type="text/javascript" src="src/assets/js/jquery.js"></script> <script> function onsubmit(){ //console.log('ghffgj'); if($("#usermsg").val()) { //alert($("#usermsg").val()); var clientmsg = $("#usermsg").val(); $.ajax({ type: "post", url: "src/add_reply.php", data: {text: clientmsg}, }); $("#usermsg").attr("value", ""); ...

How to generate random float number in C -

possible duplicate: c++ random float how generate random number in c? i can't find solution find random float number [0,a] , a float defined user. i have tried following, doesn't seem work correctly. float x=(float)rand()/((float)rand_max/a) try: float x = (float)rand()/(float)(rand_max/a); to understand how works consider following. n = random value in [0..rand_max] inclusively. the above equation (removing casts clarity) becomes: n/(rand_max/a) but division fraction equivalent multiplying said fraction's reciprocal, equivalent to: n * (a/rand_max) which can rewritten as: a * (n/rand_max) considering n/rand_max floating point value between 0.0 , 1.0, generate value between 0.0 , a . alternatively, can use following, breakdown showed above. prefer because clearer going on (to me, anyway): float x = ((float)rand()/(float)(rand_max)) * a; note: floating point representation of a must exact or never hit absolute ed...

javascript - How to get sum of the calculated column on input -

i have tree number columns, , create calculated column sum of tree inputs , have click save see change . i'm looking result on calculated column ,when type or change number in 1 of 3 column before pressing save. tried javascript code : function myfunction() { var x = document.getelementbyid("myinput").value; document.getelementbyid("demo").innerhtml = "you wrote: " + x; } but in case have 3 number columns idea? see solution below. you'll have add validation numbers allowed var inputs = document.getelementsbyclassname("myinput"); function myfunction() { var total = 0; array.prototype.foreach.call(inputs, function (input) { total += +input.value; }); document.getelementsbyclassname("myoutput")[0].innerhtml = "the total is: " + total; } (var = 0; < inputs.length; i++) { inputs[i].addeventlistener("input", function () { myfunc...

c++ - std::unique_ptr<Mesh>::unique_ptr(__gnu_cxx::__alloc_traits<std::allocator<Mesh> >::value_type&)’ -

i'm using c++ std11 , i've following code #include "renderengine.h" #include "cam.h" #include "vec3d.h" #include "mesh.h" #include "model.h" #include <vector> #include <memory> struct option { int imagewidth, imageheight; }; int main() { cam* cam = new cam(vec3d(0.0, 0.0, 250.0), vec3d(0.0, 0.0, -1.0), 90, 1); //cam* cam = new cam(); option option; option.imagewidth = 1920; option.imageheight = 1080; //option.imagewidth = 1280; //option.imageheight = 900; model mymodel; mymodel.loadmodel("/models/arm.obj"); std::vector<std::unique_ptr<mesh>> objects; std::unique_ptr<mesh> mymesh( mymodel.meshes[0] ); objects.push_back(std::move(mymesh)); renderengine* render = new renderengine(*cam, option.imagewidth, option.imageheight); render->getimage(objects); delete cam; delete render; return 0; } with class model contain std::vector<mesh> meshes ; when compile code i...

html - Styling on mobile device not correct -

i have new website complete. done database connected , working perfect, thing failing on site styling on mobile devices. no matter try background moves , shows background color on first page don't want. i need specific in trying make sure background does not move, , background color not directly visible on first page. thank you! :) in <head> : <meta name="viewport" content="width=device-width" /> my css code : img { max-width:100%; } @viewport { width: extend-to-zoom 980px; min-zoom: 0.25; max-zoom: 5; } body { margin:0; background:url(../images/bg-body.png) repeat-x left top #a6a6a6; font-family:arial, helvetica, sans-serif; } { outline:none; } img { border:0; display:block; } .background { background:url(../images/bg-background.jpg); background-color: #696969; background-position: 0 100%; background-repeat: repeat; background-attachment: fixed; background-size: cover; ...

cocoa touch - Touches Began not working with Swift 3.0 on Xcode 8.0 beta -

i making game swift 3.0 on xcode 8.0 beta. in gamescene have touchbegan function: override func touchesbegan(_ touches: set<uitouch>, event: uievent?) { t in touches { let location = t.location(in: self) let nodeattouch = self.atpoint(location) let touchedsprite = nodeattouch as! skspritenode print("touch detected") if touchedsprite skbutton { print("button touched") touchedsprite.run(skaction.resize(bywidth: 25, height: 25, duration: 0.25)) } } } for strange reason print on line 6 doesn't print out when touch screen, therefore meaning touch not being detected. ideas or fixes, else having problem? in advance.

c# - IEnumerable.Except() not excluding -

i have 2 arrays. first holds members, second holds claimed members. i'm trying unclaimed members using except, resulting array includes members (an exact copy of first array). var junior_handler_all = db2.junior_handler.include(j => j.person).include(j => j.status).toarray(); var junior_handler_claimed = db.junior_handler.include(j => j.person).include(j => j.status).toarray(); var junior_handler_unclaimed = junior_handler_all.except(junior_handler_claimed).toarray(); i have tried getting unclaimed members using query same results. var junior_handler_unclaimed = junior_handler_all.where(i => !junior_handler_claimed.contains(i.junior_handler_id.tostring())); any ideas why either of these aren't working? the way except , contains compare elements calling gethashcode() , - if hash equal - calling equals check if 2 elements equal. so if apply reference types not have own implementation of gethashcode() , equals() , comparison results in ...

mobile - How do I get a call back for notification received in android? -

is possible/is there reliable way call when notification received on android platform? i.e. want record when notification received (not when later opened). no, it's app receives message if need things logged, log it. handle once receive it. note if use fcm notification message message type, not directly notified message arrival when app in background (notification automatically posted firebase - app message payload once use taps notification). in such case consider switching data messages no matter app in foreground or not. see docs: https://firebase.google.com/docs/cloud-messaging/downstream

angularjs - $routeProvider - modal of a single page with different URL -

Image
i have list of items showed in page. idea click on item, , open modal showing information of selected item, , in background list remains. when modal opens, url should change. idea have specific url every item, when access url, should see modal, item info , in background main page. i'm using $routeprovider routing. example: i have similar this http://www.eltrecetv.com.ar/articulo/le-salio-del-alma-el-emotivo-recuerdo-de-la-china-suarez-para-su-papa-en-una-fecha_087466 .config(function ($routeprovider) { $routeprovider .when('/', { templateurl: 'views/main.html', controller: 'mainctrl' }) .when('/meals', { templateurl: 'views/meals/meals.html', controller: 'mealsctrl' }) .when('/meal/:mealid', { templateurl: 'views/meals/meal-profile.html', controller: 'mealctrl' }) the /meal/:mealid should shown in modal, ...

Why SpellChecker (C#) incorrectly defines words? -

i need determine correct spelling specific word list. if word wrong write in in file. used class spellchecker, code: public class spellchecker : idisposable { system.type tword = null; object com_app = null; private static spellchecker checker = new spellchecker(); private spellchecker() { try { tword = type.gettypefromprogid("word.application"); com_app = activator.createinstance(tword); } catch { com_app = null; } } public static spellchecker getchecker() { return checker; } public void dispose() { if (com_app != null) { object[] arg = { null, null, null }; tword.invokemember("quit", bindingflags.invokemethod, null, com_app, arg); com_app = null; } } public bool checkword(string word) { object[] arg = { word }; return (bool)tword.invokemember("checkspelling"...

ios - My CollectionViewCell is getting into a mess -

Image
you can download project files here look @ cells. @ first normal. mess after scroll down , below. i don't know why.. , have wasted time few days. implemented method: collectionview(collectionview: uicollectionview, layout collectionviewlayout: uicollectionviewlayout, sizeforitematindexpath indexpath: nsindexpath) -> cgsize source code: settingsviewcontroller.swift import uikit class supplementaryview: uicollectionreusableview { var imageview = uiimageview() override init(frame: cgrect) { super.init(frame: frame) self.addsubview(imageview) imageview.translatesautoresizingmaskintoconstraints = false } required init?(coder adecoder: nscoder) { fatalerror("init(coder:) has not been implemented") } } class settingscell: uicollectionviewcell { var imageview = uiimageview() var celllabel = uilabel() var textfield = uitextfield() override init(frame: cgrect) { super.init(frame: fr...

android - How to pass the default time to time picker dialog fragment -

i have created time picker fragment.it shows current timing in dialog box.i want set default time.what setting default timing in dialog box. you can this: declare default time.. 20:00 mcurrenttime = calendar.getinstance(); int hour = 20; int minute = 0; then dialog timepickerdialog mtimepicker; mtimepicker = new timepickerdialog(addmedicine.this, new timepickerdialog.ontimesetlistener() { @override public void ontimeset(timepicker timepicker, int selectedhour, int selectedminute) { timepicker.setis24hourview(true); if(db.getalarm3().contains(selectedhour + ":" + selectedminute+" : 0")){ alarm3.settext( selectedhour + ":" +( selectedminute+1)); } else{ alarm3.settext( selectedhour + ":" + selectedminute); } mcurren...

java - Two CLI for one process -

is possible create 1 process 2 different cli (commandlineinterface)? have 1 cli real program, , cli chat, can send command program , send messages in chat @ same time, , have different views program , chat. (edit) program game , chat make communication between player, when start program in eclipse, program strat console , here have 2 console in 1 there game action , state , in other 1 have messages in chat. know can build process 0 , integrate process builder, have in 1 process. if assume cli mean main terminal execute program, answer no, regardless os. there couple of options implement additional cli interfaces in same process: listening on socket , waiting client(s) connect e.g. telnet opening window implements cli under unix can spawn e.g. xterm , process io in process

objective c - Mail: Application isn't running -

i'm trying execute simple applescript in objective-c. code is: nsstring *emailstring = @"tell application \"mail\" activate"; nsapplescript *emailscript = [[nsapplescript alloc] initwithsource: emailstring]; nsdictionary *errordict = null; [emailscript executeandreturnerror: &errordict]; and got annoying error: nsapplescripterrormessage: mail got error: application isn’t running. nsapplescripterrorrange: nsrange: {27, 8} nsapplescripterrorbriefmessage: application isn’t running. nsapplescripterrornumber: -600 nsapplescripterrorappname: mail it's no problem if execute script script editor. need — thanks! solved. app using sandbox. , if want run applescript it, need edit entitlements file. in me case this help.

express - How to download created excel file in node.js using exceljs -

i using exceljs module creating excel file. problem is neither getting created nor getting saved in path. var excel = require('exceljs'); var options = { filename: './streamed-workbook.xlsx', usestyles: true, usesharedstrings: true }; var workbook = new excel.stream.xlsx.workbookwriter(options); var sheet = workbook.addworksheet('my sheet'); worksheet.columns = [ { header: 'id', key: 'id', width: 10 }, { header: 'name', key: 'name', width: 32 }, { header: 'd.o.b.', key: 'dob', width: 10 } ]; worksheet.addrow({id: 1, name: 'john doe', dob: new date(1970,1,1)}); worksheet.addrow({id: 2, name: 'jane doe', dob: new date(1965,1,7)}); worksheet.commit(); workbook.commit().then(function(){ console.log('xls file written.'); }); but when run code nothing happens. excel not created. missing here? *********************** edit ************************** made foll...