Posts

Showing posts from January, 2015

javascript - Three.js Update Texture image -

i'm using three.js create minecraft texture editor, similar this . i'm trying basic click-and-paint functionality down, can't seem figure out. have textures each face of each cube , apply them making shader materials following functions. this.createbodyshadertexture = function(part, update) { sides = ['left', 'right', 'top', 'bottom', 'front', 'back']; images = []; (i = 0; < sides.length; i++) { images[i] = 'img/'+part+'/'+sides[i]+'.png'; } texcube = new three.imageutils.loadtexturecube(images); texcube.magfilter = three.nearestfilter; texcube.minfilter = three.linearmipmaplinearfilter; if (update) { texcube.needsupdate = true; console.log(texcube); } return texcube; } this.createbodyshadermaterial = function(part, update) { shader = three.shaderlib['cube']; shader.uniforms['tcube'].value = this.c...

eclipse - Cannot Commit , Cannot Pull , All Tortoise git tasks are ending in errors -

Image
previously had repo java class files pushed well. learnt general purposes best keep source files in git repo. deleted repo , created new one. when try push project folder onto github repo , errors , exists error code 1. previously had no such issues , push , pull , syncs went smoothly. i'm quite @ loss @ do. edit : reading burhan khalid's comment , tried , not working edit : tried kvass suggested , iv never used gitbash , , couldnt change directories there. re-installed tortoisegit , did think of , still gives error in everything! edit: same thing happening repositories ! :( cannot pull , push , sync , im virtually paralysed ! please me out here. are in right directory? looks in home directory - created repository?

javascript - Using font-awesome in a code -

i have following code in jsp file <div class="row-fluid"> <div style="text-align: left;" class="span3 row-fluid"> <label><spring:message code="alert.channels.outbound.lines"></spring:message>:&nbsp; </label> </div> <div class = "span3"> <div class="textbox"> <div class="textval">${alertstatusform.outboundlines}</div> <div class="pencil span3 "> <img src="/static/img/pencil.png" alt="edit"> </div> <div class="save span3"> <img src="/static/img/disk.png" alt="save"> </div> <div class="close span3">...

python - appending foreign key reference in django json response -

during appending result (appending foreign key ) causes key error models.py class table1 id = models.integerfield( primary key=true) ref = models.foreignkey('table2') class table2 name = models.charfield() id = models.integerfield(primarykey= true) address = models.charfield() views.py def relation(request) """ stuff """ query = "query set makes object of table 1" result['content'].append([query['ref__address']) the error keyerror @ /url ref__address def relation(request, pk): item = get_object_or_404(table1, pk=pk) context= {'content': item} return render(request, 'table1/relation.html', context) urlpatterns = patterns('', url(r'^table1/(?p<pk>\d+)/$', relation, name='relation'), ) your problem seems none of python valid.

python - How do I make files downloadable for a particular role in Plone? -

i wish make contents of folder in plone downloadable roles. can done easily? @ present clicks hyperlink file name in folder contents can download file easily. know site-wide option of overriding at_download code using zmi. the codeless way make use of plone's workflow system. out-of-the-box, plone's file , image content types not have own workflow. means files , images inherit publication state of parent folder. easy , sensible, doesn't meet need you're describing. to change situation, may use "types" configuration panel turn on independent workflow files , images. then, publication status may set separately containing folders. typically, you'd choose same workflow you're using documents. then, may publish folder , list contents while having files within private -- requiring login viewing. if need work differently in different places, may turn on "placeful" workflow (turn on adding in add-ons panel; it's pre-installed, ...

c# - Instantiate a random class on program start -

i'm having play around inheritance , few other concepts @ moment. i have created console app amongst other things, holds following classes: public abstract organism public abstract animal : organism public bird : animal public mammal : animal public reptile : animal public fish : animal public amphibian : animal public human : organism when console app starts, want create new object either human, fish, mammal, reptile, bird or amphibian class. 1 of these classes instantiate randomly chosen. once class has been randomly chosen, i've used console.writeline ask user key questions assign values given objects properties. how create random object 1 of these classes? // use dll of project running var runningassembly = assembly.getexecutingassemby(); // classes have "type" exposes information class var organismtype = typeof(organism); // keep track of organism classes we've found. var allorganismtypes = new list<type>(); // go through ty...

ios - Cant move UIScrollView that has buttons in it when pressing and dragging the buttons -

i have uiscrollview has buttons inside , when i'm trying press button , sliding side uiscrollview doesn't move when i'm sliding fast move. i'm using uicontroleventtouchupinside on button. code i'm using add buttons scroll view: -(void) setscrollview:(int) numberofviews { (int = 0; < numberofviews; i++) { cgfloat xorigin = * 40; uibutton *button = [uibutton buttonwithtype:uibuttontypecustom]; [button addtarget:self action:@selector(scrollviewbuttonclicked:) forcontrolevents:uicontroleventtouchupinside]; [button settitle:[nsstring stringwithformat:@"%d",i] forstate:uicontrolstatenormal]; button.frame = cgrectmake(xorigin, 0, 40, 40); button.tag = 1000+i; button.backgroundcolor = [self getcolorforsound:self.sounds[i]]; [button setexclusivetouch:yes]; [self.soundsscrollview addsubview:button]; } } how can make uiscrollview scroll if user pressed butto...

php - How to get Rid of the JSON Error in Firefox -

my response header is access-control-allow-meth... get, post access-control-allow-orig... * cache-control no-store, no-cache, must-revalidate, post-check=0, pre-check=0 connection keep-alive content-length 81 content-type text/html date mon, 26 aug 2013 06:35:53 gmt expires thu, 19 nov 1981 08:52:00 gmt keep-alive timeout=5, max=99 pragma no-cache server apache/2.4.3 (win32) openssl/1.0.1c php/5.4.7 x-powered-by php/5.4.7` and request header is accept application/json, text/javascript, */*; q=0.01 accept-encoding gzip, deflate accept-language en-us,en;q=0.5 cache-control no-cache connection keep-alive content-length 31 content-type application/x-www-form-urlencoded; charset=utf-8 cookie usernameemail=shan%40atlos.com; phpsessid=8asm46iltcqc9oahsbaaap1c16 host localhost pragma no-cache referer http://localhost/test/ user-agent mozilla/5.0 (windows nt 6.1; wow64; rv:23.0) gecko/20100101 firefox/23.0 x-requested-with xmlhttprequest` i get...

How to change color of one element by clicking on another - jquery -

i've got multiple choice test on english/thai language web site. each row has question , 4 answer choices, layout 50x5 matrix. <div id="question"> <p class="word_test">1<span class="1 color_up audio" id="b1e01">the </span></p> ... <p class="word_test">50<span class="50 color_up audio" id="b1e50">if </span></p> </div> <div id="answers"> <div id="col_a"> <p class="word_test">a:<span class="1 color_up audio" id="b1t01">คำนำหน้านาม</span></p> ... <p class="word_test">a:<span class="50 color_up incorrect">มัน </span></p> </div> <div id="col_b"> ... </div> <div id="c...

php - 1.0.0-rc1 zend framework how to use pagination -

can tell me how use pagination in zend framework 1.0.0-rc1. i used not working in version. $db = zend_db_table_abstract::getdefaultadapter(); $select = new zend_db_select($db); $statement = $select->from('product'); $statement = $statement . "order id desc"; $results = $db->query($statement); $rows = $results->fetchall(); $result = $db->fetchall($sql); $page=$this->_getparam('page',1); $paginator = zend_paginator::factory($rows); $paginator->setitemcountperpage(10); $paginator->setcurrentpagenumber($page); $this->view->paginator=$paginator; please me regarding

pymongo - Mongodb find all except from one or two criteria -

alright 1 field matching run: db.bios.find( { "country":"netherlands" } ) how can bring documents not ones "country":"netherlands" ? also possible bring documents without 2 countries? use $nin operator for example: db.bios.find( { country: { $nin: ["country1", "country2"] } } ) and $ne 1 country: db.bios.find( { country: { $ne: "country1" } } )

image - jQuery item fly in an U shape -

is there way make element fly in upside down u shape through screen , rotate continuously? i'm working on script , need create effect: image appears bottom left corner of screen, go 50% of screen's height , fall through right corner of screen. need every 1 minute, can setinterval. what i've done: var currwidth = $(window).width(); console.log(currwidth); var startpos = -100; var endpos = (currwidth + 100) + (startpos / 2); console.log(endpos); setinterval( function(){ $('.bouquet').animate({left: endpos}, 3000); var offset = $(e.target).offset(); $('.bouquet').animate({'top':offset.top},600); }, 10000 ); but goes left of screen right, not work ok. well, won't easy. you'll need 2 animations @ once, like //first half of motion settimeout(function(){ $('.bouquet').animate({left: endpos/2}, 3000,'<easing>'); },0); settimeout($('.bouquet').animate({top:offset.top}, 3000,'<easing...

android - onRegistered() is called but onMessage() not -

i have below 2 methods in class gcmintentservice, onregistered() method gets called upon registeration regid, however, when send message onmessage() not called. @override protected void onregistered(context context, string registrationid) { log.i(tag, "onregistered called"); gcmregistrar.setregisteredonserver(context, true); } @override protected void onmessage(context context, intent intent) { log.i(tag, "received message"); sendnotification("a", "b"); } below manifest <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.get_accounts" /> <uses-permission android:name="android.permission.wake_lock" /> <uses-permission android:name="com.myapp.permission.c2d_message" /> <uses-permission android:name="com.google.android.c2dm.permission.receive" /> <uses-permission android:name=...

hash - how do hashed sharding keys work in mongodb? -

i wondered internals hashed sharding keys in mongodb. constant mongodb chooses hash field if timestamp instance ? guess key timestamp % n ; n ? if design, guess n cannot change on time. how can sure if have lot of data there not many collisions in 1 shard if n small ? thanks a hashed key uses data in document, , standard hash function (md5) generate hash value document. example, suppose index on {name: 'hashed'} , have these documents: {name: 'john', height: 73} {name: 'zardosht', height: 68} mongodb run 'john' , 'zardosht' through md5 hash function , random-looking byte sequences. then, it'll use byte sequences actual b-tree key use in index. when want query {name: 'john'} , md5 hash again, gets same byte sequence have gotten before, , index lookup value. you can play mongo shell , see these values yourself: % mongodb-linux-x86_64-2.2.5/bin/mongo mongodb shell version: 2.2.5 connecting ...

ember.js - How to write Ember model for tree type json -

i new ember, can 1 tell me how write ember model json show below. searched lot couldn't come solution {id:1, name: "a", children: [ { id:1, name: "a1" }, { id:2, name: "a2" }, { id:3, name: "a3", children: [ { id:1, name: "a31", children: [ { id:1, name: "a311" }, { id:2, name: "a312" }, ] }, ] }, ] thanks have tried following? have not worked ember data yet, imagine work this: app.person = ds.model.extend({ id : ds.attr("number"), name : ds.attr("string"), children : ds.hasmany("app.person"), parent : ds.belongs...

javascript - How can I put element in the middle of vertical align? -

i made demo jsfiddle please check. this show comment slides right side left. it's shown little bit above middle of vertical align. how can show right in middle? please fix , update jsfiddle javascript function transition() { $('.newsticker p').animate({"marginleft":"400px","opacity":".0"}, 600).fadeout(100); $('.newsticker').append("<p style='margin-left:400px;opacity:0'>hello! test</p>"); $('.newsticker p').animate({"marginleft":"0px","opacity":"1"}, 600); } setinterval(transition, 2000); css div.newsticker{ border:1px solid #666666; width:100%; height:100px; } .newsticker p{ padding-left:10px; padding-right:10px; float:left; position:absolute; } html <div class="newsticker"> </div> first reset browsers default stylesheet margin or padd...

.htaccess - how to change site path and create subdomain using htaccess -

i have site index.php located @ server public root. the url is http://example.com i have created subfolder called 'travel' , moved whole site content it. using .htaccess , how can have site @ adress ( subdomain travel): http://travel.example.com why htaccess , why not virtualhost entry in apache config this: <virtualhost *:80> servername www.example.com serveralias example.com documentroot /www/domain </virtualhost> <virtualhost *:80> servername travel.example.com documentroot /www/domain/travel </virtualhost> edit .htaccess based solution: enable mod_rewrite , .htaccess through httpd.conf , put code in .htaccess under document_root directory: options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritebase / rewritecond %{http_host} ^travel\.example\.com$ [nc] rewriterule (?!travel/)^(.*)$ travel/$1 [l,nc]

css - How to align image to top left of div -

Image
below code : css #block { border-width: 2px; border-color: #4682b4; background-color: #e0ffff; width: 200px; text-align: center; } html <div id="block"> <h3>test header</h3> <p> <img height="100" style="max-width: 120px;background-position: top left;" src="http://socialmediababe.com/wp-content/uploads/2010/12/administrator.jpg" /> </p> <p> test text </p> </div> produces : how can align image top left corner of screen ? by top left corner mean align point indicated arrow : i have tried 'background-position: top left;' not make difference. after trying 'fags' answer receive same result : like this demo css *{ margin:0; padding:0; } #block { border-width: 2px; border-color: #4682b4; background-color: #e0ffff; width: 200px; text-align: center; line-height:30px; padding:3...

c# - Printing in WPF similar to Winforms -

below process worked in windows forms printing. used printdocument class. contains printpage event , used draw graphics of need print , obtained result expected. below code: public printdocument printing { m_printdocument = new printdocument(); m_printdocument.printpage += new printpageeventhandler(onprintpage); } the code onprintpage follows: protected virtual void onprintpage(object sender, printpageeventargs e) { //image img = have things printing in form of image. e.graphics.drawimage(img, new point(0,0)); } in wpf: i working fixed document , using below code can print printdialog print = new printdialog(); print.printdocument(fixeddocument.documentpaginator, "print") //where fixed document contains data printed. this results insufficient memory continue execution of program. got fixed document without problem. solutions ...? hope similar thing windows form there in wpf too... i used when pages contained lots of visual elem...

How to connect to remote MYSQL database via php -

i have build android app connects remote mysql webserver , retrieve information display purpose. did research coz had no idea start. read article mentions better approach use php script. , didn’t know how server, database , php works, studied php here “ http://www.homeandlearn.co.uk/php/php12p1.html ” understand , downloaded whampserver testing. on local machine worked fine. main thing don’t understand “how connect remote server/database”. it’s obvious i’m doing stupid, need find out doing wrong. when test php script on local machine in webrowse use "localhost/some.php." when want test same php script on remoter server local machine , how should do? need make changes in configuration file on server side? have done more research before asking question here understand remote server connection in php still don’t understand. have gone through pages within link below: https://www.google.co.uk/search?q=connect+to+remote+mysql+webserver+php&rlz=1c1avsx_engb447gb448&oq...

javascript - How to use inline easing with ScrollTo plug-in -

i try use scrollto plug-in easing effect. and don't want include easing plug-in file, because use once , 1 easing effect. this 'easeoutback' want use : easeoutback: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; } and scrollto's function code like.. $(window).scrollto(element,800,{offset:-80,onafter:function(){ alert('done'); }}); so try insert easing effect like... $(window).scrollto(element,800,{offset:-80, easing:function(x, t, b, c, d){ return -c/2 * (math.cos(math.pi*t/d) - 1) + b; }, onafter:function(){ alert('done'); }}); it dosn't work. typeerror: b.easing[this.easing] not function you can store easing function in $.easing : $.easing.easeoutback = function(x, t, b, c, d, s) { if(s == undefined) s = 1.70158; return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; }; after can use when easing p...

javascript - node.js process.hrtime in asynchronous server? -

i create http server using http.createserver(onrequest) , want measure time needed make response. currently, in onrequest handler do: var start = process.hrtime(); response.on('end', function (){ console.log('time respond', process.hrtime(start)); }); // call various asynchronous functions , send them 'response' object. 1 of them response.end() i'm worried if work fine when bunch of requests comes instantly, or asynchronism break it/mix-up times? the variable in closure scope of onrequest handler function it'll work way expect (assuming process.hrtime want).

angularjs - How to pass yeoman prompt options through to templated files? -

i'm writing version of generator-angular options support sources in livescript, , bootstrap less, font-awesome etc. work in progress @ https://github.com/gmp26/generator-angular-ls i'm hung on trivial wish. i'd initial 'halo 'halo installed list reflect options installed in response yeoman questions rather constant common denominator list. as first attempt - tried lodash templates in templates/*/spec/controller.(ls|js|coffee) adjust $scope.awesomethings list defined in files. fails because optional flags defined prompt (this.bootstrap, this.lessbootstrap, this.fontawesome) in similar manner generator-angular's this.bootstrap , this.compassbootstrap not available in 'this' context template called. both 'this' contexts generators believe prompting 'this' context generator angular:app whereas template called in angular:controller. so, ideas how communicate flag app/index.js prompting phase through templating phase? i feel there s...

javascript - Google Drive - Providing resource paths -

Image
i have created hangman game in html , javascript. when run on local machine, works perfectly. happens when user loses game image called lose.png displayed. if user wins image win.png displayed. moreoever, other images need displayed displayed fine. 2 images need displayed @ end of game not displayed. but when uploaded google drive , tried play there, other parts fine last image change win.png or lose.png not take place. the complete code available here - hangman . the part of code not work is: if(score === wordis.length) { document.getelementbyid("respimg").setattribute("src","img/win.png"); alert("you won game!!\na new game has been started."); return true; } if(attrem <= 0) { document.getelementbyid("respimg").setattribute("src","img/lose.png") alert("your attempts over.\nyou lost game.\nthe word trying guess was:\"" + wordis + "\""); retu...

executing a clearcase command through a c program -

i trying execute following clearcase command through c program. system("ct pwv"); but i'm getting error. :permission denied. would please suggest solution problem. thanks. try cleartool : system("cleartool pwv");

android - Get dialoginterface of an alertdialog click -

i need alertdialog custom view in title. since not able inflate view title used this link. able make custom title , able inflate list items. on list item click alertdialog not closing. how implement this? package com.qustom.dialog; import android.app.alertdialog; import android.content.context; import android.content.dialoginterface; import android.content.dialoginterface.onclicklistener; import android.graphics.color; import android.graphics.drawable.drawable; import android.view.view; import android.widget.adapterview; import android.widget.framelayout; import android.widget.imageview; import android.widget.listadapter; import android.widget.listview; import android.widget.textview; public class qustomdialogbuilder extends alertdialog.builder { private view mdialogview; private textview mtitle; private imageview micon; ...

how can i use search dropdown list in Titanium -

i want use drop down list text box searching ability. new titanium, if knows how please inform me. var picker = ti.ui.createpicker({ bottom : 60, width : 150 }); var data = []; data.push(titanium.ui.createpickerrow({ title : 'bananas' })); data.push(titanium.ui.createpickerrow({ title : 'strawberries' })); data.push(titanium.ui.createpickerrow({ title : 'mangos' })); data.push(titanium.ui.createpickerrow({ title : 'grapes' })); picker.add(data); win1.add(picker); var button = titanium.ui.createbutton({ title : 'login', right : 50, bottom : 30, width : 80, height : 60 }); win1.add(button);

osx - Mac OS X virtual audio driver -

i want create virtual audio device gets audio data default output (which output ioaudiostream) , converts input ioaudiostream. i went through of examples find, implement feature copy output ioaudiostream input 1 @ most. means converts audio input stream if audio device selected output. this should possible, since screenflow allows recording of computer audio installing kext creates virtual driver. how can access audio data default output , send virtual driver? take @ open-source wavtap , simplified fork of open-source soundflower virtual sound card driver. .kext believe substantially want. for reference, here how popular commercial closed-source options work: rogue amoeba's audio hijack pro -captures system audio via code based off of open-source soundflower .kext -captures application's audio substituting "patch" framework normal coreaudio.framework when launching application -captures already-running application's audio of haxie "a...

Why the sketch size and amount of RAM used by Arduino DUE is more than Arduino MEGA 2560 -

can please tell me why due sketches occupy more ram compared mega same code. need make analysis. please solve query. it's because have different microcontrollers: arduino mega 2560 has 8-bit avr atmega2560 microcontroller , arduino due has 32-bit arm cortex-m3 microcontroller. ram variables smaller in 8-bit architectures in 32-bit architectures. example: int 2 bytes long in mega 2560 4 bytes long in due. because of that, program in due use more ram program in mega 2560 (and other atmega-based arduino board uno , leonardo). sketch size the reason similar ram: instructions in 8-bit avr architectures 16 bits long while in arm architectures, majority of instructions 32 bits long.

Can we use InfoPath forms with Microsoft Dynamic CRM -

i want create ui forms microsoft dynamic crm, can fetch data crm , push data crm. is achievable using infopath (i using infopath 2013). can create dynamic crm data connection in infopath? if yes, how? is ideal way use infopath forms dynamic crm? if no, best approach? please give me steps if possible. http://social.microsoft.com/forums/en-us/5bfff309-7cab-4046-af32-969ff53250b8/how-integrate-infopath-in-crm-2011 http://www.3dcios.com/enright/lists/posts/post.aspx?id=5 here links at. second link explains how can fire infopath form button in ribbon. to accept data infopath, should try integrate sharepoint and

c++ - Return variable as a Class Object -

i have created string class using character array. i need place array instead of class object. here's easy example. i want print a integer , not b class object isn't possible. #include <iostream> class t { int ; public : t ( ) { = 10 ; } } ; void main ( ) { t b ; std :: cout << b ; } is possible? okay, how? you need output stream operator: std::ostream& operator <<(std::ostream& o, const t& t) { return o << t.a; } note that, since a private, have friend of t .

c# - Notify change in calculated property -

there have been similar questions on site have not found answer works, post again. public myclass { public person person1 {get; set;} public person person2 {get; set;} calculatedproperty { { return person1.salary + (person2.salary/2) ; } } } public class person { public double salary { get; set;} } i want able notify changes in calculatedproperty whenever person1.salary and/or person2.salary changes. i have tried adding onpropertychanged("calculatedproperty") on setters of person1 , person2 not work (and understand why), can't find way notify changes. please =) (is there way use objectdataprovider this?... been trying too...) you need person implement inotifypropertychanged too, register 2 properties have. once propertychanged invoked salary on either of them, invoke propertychanged on calculatedproperty void personpropertychanged(object sender, propertychangedeventargs e) { if(e.propertyname == ...

wpf - How to search a documentpanel from the itemssource of docklayoutmanager -

i have current code @ moment: shell: <dxd:docklayoutmanager x:name="docklayoutmanager" activedockitem="{binding activeselectedview, mode=twoway}" itemssource="{binding dockitemssource, mode=onewaytosource}" > this itemssource binded property dockitemssource: public ienumerable dockitemssource { get; set; } and have property activeselectedview should return documentpanel: private documentpanel _activeselectedview; public documentpanel activeselectedview { { return _activeselectedview; } set { _activeselectedview = value; raisepropertychangedevent(this, x => x.activeselectedview); } } my question u guys is, how search documentpanel using itemssource docklayoutmanager? im using mvvm pattern. greets to activate dock panel in mvvm manner should bind documentpanel.isactive property corresponding boolean property of viewmodel. , should not bind docklayou...

ruby - How to indent part of code in rubymine and keyboard shortcuts -

i trying indent part of code in rubymine editor . is there way how fast using keyboard shortcuts ? update example let have file 200 lines. keyboard shortcut , keyboard ( w/o mouse selection ) want select e.g. lines 10 20 , lines indent tab or outdent shift-tab . navigate first line hold down shift navigate last line press tab or shift tab appropriate

regex - How to extract text related to a regular expression (regexpr) index in R -

i'm working specialised text file, long list of names , random sequence of letters associated each name. i'm attempting extract particular consensus sequence i'm interesting in. sequence is, lets "stxdxik", x being letter. red text file r , named "text". then used regular expression isolate list of entries containing sequence, calling "ylist". ylist<- text[grep("st[a-z]d[a-z]ik", text, value=false, perl=false)] then used regexpr function locate position of sequence i'm interested in, calling "r". r<- regexpr("st[a-z]d[a-z]ik", ylist) now problem index of locations sequence lies in, starting position , number of matches. i'm interested in extracting full sequences, , not indexes "ylist" since important me full length sequence is. can help? i have tried substr , regmatches functions in r substr has applied each match, not practical me have many many matches sequence , regma...

javascript - Moment js Not returning the right day of the week -

i trying use momentjs return day of week (ex. "monday" or "mon", doesn't matter long it's name of day of week) string number stored in db (ex "3" ). reason keep getting monday returned. var values = ["3", "06:00", "18:00"]; moment().isoweekday(values[0]).format('ddd'); //returns "mon" i've tried using moment('3','d').format('ddd') i've tried using moment().days('3').format('ddd') returns same day. sat or mon. try moment().isoweekday(parseint(values[0])).format('ddd'); and in general, store week day integer , not string: var values = [3, "06:00", "18:00"];

javascript - Assigning .value to CSS style -

im working on little project. here's thing. want have textfields read , value's read out of need assigned css rule. i.e. document.getelementbyid("bd").value; i want value being read assigned border-radius. .style.border-radius:<value>px; but how make link. then if have 3 divs of them have seperate names how can fix assign div selected? edit: complete html <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>opdracht 1</title> <link rel="stylesheet" type="text/css" href="css.css" /> <script language="javascript"> function borderdikte(){ document.getelementbyid("bd").value; document.getel...

html - my vertical text align middle did not work -

there wrong code. need vertically center text in middle of each box. #navcontainer { padding: 0 5 20px 10px; } ul#navlist { font-family: sans-serif; } ul#navlist { font-weight: bold; text-decoration: none; display: inline-block; line-height:20px vertical-align: middle; } ul#navlist, ul#navlist ul, ul#navlist li { margin: 0 8px; padding: 0px; list-style-type: none; box-shadow: 8px 8px 12px #aaa; } ul#navlist li { float: left; } ul#navlist li { color: #ffffff; background-color: #ef634a; //padding:10px; padding: 10px 5px 10px 5px; border: 1px #ffffff outset; height: 40px; } ul#navlist li a:hover { color: #ffff00; background-color: #003366; } ul#navlist li a:active { color: #cccccc; background-color: #003366; border: 1px #ffffff inset; } ul#subnavlist { display: none; } ul#subnavlist li { float: none; } ul#subnavlist li { padding: 0px; margin: 0px; height: 20px; } ul#navlist li...

java - org.springframework.beans.factory.parsing.BeanDefinitionParsingException -

i use sts - web app works. import eclipse , see following stacktrace: org.springframework.beans.factory.parsing.beandefinitionparsingexception: configuration problem: failed import bean definitions relative location [security_config.xml] offending resource: servletcontext resource [/web-inf/spring/root-context.xml]; nested exception org.springframework.beans.factory.parsing.beandefinitionparsingexception: configuration problem: unable locate spring namespacehandler xml schema namespace [http://www.springframework.org/schema/security] offending resource: servletcontext resource [/web-inf/spring/security_config.xml] @ org.springframework.beans.factory.parsing.failfastproblemreporter.error(failfastproblemreporter.java:68) @ org.springframework.beans.factory.parsing.readercontext.error(readercontext.java:85) @ org.springframework.beans.factory.parsing.readercontext.error(readercontext.java:76) @ org.springframework.beans.factory.xml.defaultbeandefinitiondocumentreade...

notsupportedexception - Automapper 3.0 - This type is not supported on this platform IMapperRegistry -

i updated project use automapper 3.0.0 , tfs build not succeeding. error following: " ...system.platformnotsupportedexception: system.platformnotsupportedexception: type not supported on platform imapperregistry. " is there can me resolve issue. in mean time, going revert previous version since 1 seems work fine. we had same issue on our build server. mstest seemed remove dlls deemed unnecessary (note : claim educated guess). fix it, add explicit call in automapper.net4.dll. instance, class listsourcemapper : var useless = new listsourcemapper() adding project shared other projects fixed us. put line of code may vary.

sql server - Stored Procedure Where Parameter SqlDbType -

i have combobox , textbox. use combobox value @criteria , texbox value @value when execute there no data showed up. analyzing problem within : select * table @criteria '%'+@value+'%' from tested, data showed if value part of @criteria string. if @criteria 'name' data showed if @value 'n' or 'a' or 'm' or 'e' how can make works? openconn() cmd.commandtype = commandtype.storedprocedure cmd.commandtext = "find" cmd.parameters.clear() cmd.parameters.add("@criteria", sqldbtype.varchar).value = cmbcriteria.text cmd.parameters.add("@value", sqldbtype.varchar).value = txtvalue.text dr = cmd.executereader listview1.items.clear() while dr.read dim lv listviewitem lv = listview1.items.add(dr("no")) lv.subitems.add(dr("name")) lv.subitems.add(dr("address")) loop closeconn() i think maybe expe...

javascript - JS setDate() in loop -

i want call function each day within next 2 weeks , pass parameters such day , month. use method: startdate.setdate(startdate.getdate() + 1) found here gets messy after first 6 steps of loop var date = new date, searchdate = new date, period = 14; for(i = 1; <= period; i++){ searchdate.setdate(date.getdate() + i); // somefunction(searchdate.getdate(), searchdate.getmonth()); } what console.log(i + ": " + searchdate) returns: 1: tue aug 27 2013 17:38:04 gmt+0200 2: wed aug 28 2013 17:38:04 gmt+0200 3: thu aug 29 2013 17:38:04 gmt+0200 4: fri aug 30 2013 17:38:04 gmt+0200 5: sat aug 31 2013 17:38:04 gmt+0200 6: sun sep 01 2013 17:38:04 gmt+0200 // far 7: thu oct 03 2013 17:38:04 gmt+0200 // , after week it's october 8: sun nov 03 2013 17:38:04 gmt+0100 9: thu dec 05 2013 17:38:04 gmt+0100 10: sun jan 05 2014 17:38:04 gmt+0100 11: thu feb 06 2014 17:38:04 gmt+0100 12: mon mar 10 2014 17:38:04 gmt+0100 13: tue apr 08 2014 17:38:04 gmt+0200 14:...

javascript - What is the difference between the async.compose function and underscore.compose function? -

both seem doing same thing, i.e. calculating f(g(h(x))) , when called async.compose (f, g, h) or _.compose (f, g, h) . is there difference between 2 calls ? as name implies, async.compose composes asynchronous functions. it gets result via callback parameter, not return value.

regex - Shell script linux, validating integer -

this code check if character integer or not (i think). i'm trying understand means, mean... each part of line, checking grep man pages, it's difficult me. found on internet. if explain me part of grep... means each thing put there: echo $character | grep -eq '^(\+|-)?[0-9]+$' thanks people!!! analyse regex: '^(\+|-)?[0-9]+$' ^ - line start (\+|-)? - optional + or - sign @ start [0-9]+ - 1 or more digits $ - line end overall matches strings +123 or -98765 or 9 here -e extended regex support , -q quiet in grep command. ps: btw don't need grep check , can directly in pure bash: re='^(\+|-)?[0-9]+$' [[ "$character" =~ $re ]] && echo "its integer"

jquery - Add new option for ui-select2 in angular js -

i using ui-select2 in angularjs uses select2 plugin of jquery. have pre-defined list , when start searching , if not found in list want add new value. doing : var selectoptions = { formatnomatches: function(term) { return "<a ng-click=\"addcountry('abc');\">add new country</a>"; } }; $scope.addcountry = function(countryname) { console.log (' test'); }; but click doesnt work , console in addcountry never printed. idea how add new option ui-select2 in angular js ? i've done this, not via click allowing user enter in select2 , hit enter: <input type="text" ui-select2="selectopts" ng-model="selected"/> in coffeescript hope idea: $scope.selectopts = maximumselectionsize: 1 data: $scope.somelistofdata tags: true multiple: false createsearchchoice: (term) -> {id: term, text: term} i hope puts on right track, ...