Posts

Showing posts from August, 2010

three.js - How to select a root Object3D using Raycaster -

three.js - How to select a root Object3D using Raycaster - i have parent object3d has kid meshes. how can utilize raycaster select root parent object? my example if have parent object3d has multiple kid meshes, , want select parent raycasting, can following: add parent object array of objects: var objects = []; ... objects.push( root_parent_object ); add each kid object pointer root parent object: child.userdata.parent = root_parent_object; pass in recursive flag intersectobjects() . var intersects = raycaster.intersectobjects( objects, true ); now when raycaster intersects kid object, can obtain root object. three.js r.68 three.js

javascript - High order functions explanation when passing a function to another function -

javascript - High order functions explanation when passing a function to another function - i need help breaking downwards line line happens in illustration (an excerpt eloquent javascript): we have foreach function logs every item in array. understand how works. function foreach(array, action) { (var = 0; < array.length; i++) action(array[i]); } so have array called 'numbers' , variable called 'sum' set 0. lost when 'function(number)' gets passed the action parameter. , how work? don't see it's value is. can break down? var numbers = [1, 2, 3, 4, 5], sum = 0; foreach(numbers, function(number) { sum += number; }); console.log(sum); // → 15 i think you're not grasping syntactic construction of call. 1 as write var numbers = [1, 2, 3, 4, 5]; var sum = 0; function addtosum(number) { sum += number; } foreach(numbers, addtosum); i hope clear happening in here. have function addtosum , , pass function foreach ...

google app engine - GAE Guestbook Java tutorial. force authentication of /sign servlet causes 405 on redirect -

google app engine - GAE Guestbook Java tutorial. force authentication of /sign servlet causes 405 on redirect - i've gone throught guestbook tutorial , i've been trying forcefulness authentication /sign servlet. here's i've set in web.xml <servlet> <servlet-name>sign</servlet-name> <servlet-class>com.google.appengine.demos.guestbook.signguestbookservlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>sign</servlet-name> <url-pattern>/sign</url-pattern> </servlet-mapping> <security-constraint> <web-resource-collection> <web-resource-name>sign</web-resource-name> <url-pattern>/sign/*</url-pattern> <http-method>post</http-method> </web-resource-collection> <auth-constraint> <role-name>*</role-name> </auth-constraint> </security-constraint...

node.js through FastCGI/PHP: Error: Cannot find module 'less' -

node.js through FastCGI/PHP: Error: Cannot find module 'less' - i installed node.js sources ( ./configure && create && create install ) under /usr/local/bin/node . afterwards installed less compiler globally npm -g install less under /usr/local/lib/node_modules/less/ . node , less located under default paths. i using kriswallsmith/assetic compile less files through php, hence adjusted path /usr/local/bin/node . everytime run script error error: cannot find module 'less' , had same behavior through command line. found solution ( ln -s /usr/local/lib/node_modules/ ~/.node_libraries ) prepare problem , after worked out on command line. through php problem still persists - php running through fastcgi same user used on command line. how can prepare problem through fastcgi/php too? constructor of assetic's lessfilter accepts array of nodepaths. adding /usr/local/lib/node_modules/ nodepath solves problem. php node.js assetic

python - How can I get my returned class of specific strings of a txt file added to a list? -

python - How can I get my returned class of specific strings of a txt file added to a list? - def gettopnames(state, gender, startyear, endyear): """ top names. :param state (str): state, e.g. 'ny' :param gender (str): gender, e.g. 'f' :param startyear (int): starting year, e.g. 1969 :param endyear (int): ending year, e.g. 2010 :return: list of top name objects :rtype: list """ filename = 'data/' + state + '.txt' = startyear file = open(filename) lst = list() open(filename) f: line in f: fields = line.strip().split(",") print(fields) if fields[1] == gender , fields[2] == i: lst.append(createname( fields[3], fields[1], int(fields[2]), fields[0], int(fields[4]))) = +1 if == endyear: break if line == "": br...

type families - OCaml functors (parametrized modules) emulation in Haskell -

type families - OCaml functors (parametrized modules) emulation in Haskell - is there recommended way utilize typeclasses emulate ocaml-like parametrized modules? for instance, need module implements complex generic computation, may parmetrized different misc. types, functions, etc. more specific, allow kmeans implementation parametrized different types of values, vector types (list, unboxed vector, vector, tuple, etc), , distance calculation strategy. for convenience, avoid crazy amount of intermediate types, want have computation polymorphic dataset class, contains required interfaces. tried utilize typefamilies avoid lot of typeclass parameters (that cause problems well): {-# language multiparamtypeclasses , typefamilies , flexiblecontexts , flexibleinstances , emptydatadecls , functionaldependencies #-} module main import qualified data.list l import qualified data.vector v import qualified data.ve...

mysql - Learning PyMySQL, Python - Tuple Error -

mysql - Learning PyMySQL, Python - Tuple Error - i'm learning sql , trying build script update db basic company information. below query i've got , i'm getting query: query = "update companies set url = '{}', industry = '{}', address = '{}', city = '{}', state = '{}', country = '{}', type = '{}', year_founded = {} name = '{}') values (\'{}\',{},\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',{},\'{}\')".format(url,industry,address,city,state,country,type,year_founded,company_name) error: indexerror: tuple index out of range indices: insert1(company,url,data[1],data[3],data[4],data[5],data[7],data[0],data[9]) questions: is there more elegant way build query? is possible set query onto multiple lines? what's best way that? i know that index goes 11 values should in range, because of values ''? ie ['google',...

How to handle events for options menu in Python (Android)? -

How to handle events for options menu in Python (Android)? - i'm getting started in python development android. have created simple options menu , want function called when menu item selected. import android droid = android.android() droid.addoptionsmenuitem("show list","showlist","showlist","ic_media_record") droid.addoptionsmenuitem("exit","exit","exit","ic_media_stop") def showlist(): print("show list event handler") while true: response=droid.eventwait().result if response["name"]=="showlist": showlist if response["name"]=="exit": exit menu visible funtion not called. easiest , standard method handle events? android python

sockets - Java SSLSockets and repetition attack -

sockets - Java SSLSockets and repetition attack - i'm working on java server platform school project. i'm using ssl tcp sockets communication , i'm in stage of developing json protocol between client , server. my question whether messages in protocol should contain unique id or if using if ssl tcp sockets plenty avoid repetition attacks. no. ssl immune replay attacks java sockets ssl tcp

Jssor slider does not display slides in Chrome -

Jssor slider does not display slides in Chrome - i have jssor slider working in firefox , ie. in chrome image vanishes transition completes. image reappears next transition begins. how "tell" chrome display missing slide? just set $hwa false can see here jssor

javascript - Why is my table being injected into the html multiple times with jQuery -

javascript - Why is my table being injected into the html multiple times with jQuery - i'm using jquery dynamically homecoming list of products, render html , show on page, using $(selector).html(html) .. i've noticed if add together products cart (which calls method render cart again, injecting html twice sometimes. for example, below code renders menu: html = " <table cellspacing=\"0\" width=\"270px\">\n"; html += " <tr>\n"; html += " <th>\n"; html += " <h1>\n"; html += " current order id: " + $("input[name=cart_id]").val() + "\n"; html += " </h1>\n"; html += " </th>\n"; html += " </tr>\n"; html += " <tr id=\"cart_products\">\n"; html += " ...

ios - Data being displayed in other uitableviewcells along with the selected cell -

ios - Data being displayed in other uitableviewcells along with the selected cell - i new iphone development. have uitableview custom uitableviewcell. each cell contains labels, buttons created dynamically. functionality have display view on click of button , hide using same button. able display view on click of button. problem appears in other cells also. , on scrolling table appears @ random cells too. have maintained array mark position of selected cell, , display view based on array. info in array correct. still appears in other cells. kindly help me me issue. give thanks in advance. following code cellforrowatindexpath , , function called on button click - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath{ appdelegate *delegate = (appdelegate *) [[uiapplication sharedapplication] delegate]; int y=0; childcell *cell= [tableview dequeuereusablecellwithidentifier:nil]; [cell setselectionstyle:uitableviewcellselectio...

algorithm - sorting bins two at a time -

algorithm - sorting bins two at a time - i'm stumped next problem in case there 4 bins. can 6 or 8 not 4. also, can help me come generalized algorithm this? you have n bins (arranged in alternate order of b b ...) can move 2 @ time , given 2n slots. sort them in end "a" bins left of "b" bins. should adjacent, i.e. no gaps @ end. example: _ _ _ _ b b a thanks edit: yes have move 2 adjacent bins @ time 2 adjacent spots. edit 2: no can't transpose bins. here's illustration 6 bins: _ _ _ _ _ _ b b b a _ _ _ _ b b _ _ b a _ _ _ _ b b b a _ _ _ _ a b b b _ _ _ _ a straightforward breadth-first search of reachable positions 4 bins case showed cannot solved. here rough pseudo-code can seek writing yourself: todo_queue = ["____baba", []] path_to_position = {} while things in todo_queue: (position, path) = todo_queue.next() if position in path_to_position: go on # we've been here before. ...

html - Wordpress contact form 7 template file -

html - Wordpress contact form 7 template file - i'm using contact form 7 plugin wordpress , i'm wondering template links when type mysite.com/contact/ . want edit template file don't know find it. advice much appreciated :) contact form 7 not have template file. rather, adds fields (defined in admin) page via shortcode. you can override default cf7 styles editing theme's style.css file. your contact page using default or specialized wordpress page template. html wordpress contact-form-7

jquery - Stop Font Awesome icon from stretching in Bootstrap form with validation -

jquery - Stop Font Awesome icon from stretching in Bootstrap form with validation - i'm building form bootstrap 3 , want have nice icon in field using font awesome. when i'm applying validation using bootstrapvalidator, icon stretches accommodate error message. any thought how can maintain icon within form field? html: class="lang-html prettyprint-override"> <div class="container"> <div class="row"> <div class="col-md-8 col-md-offset-2"> <div class="page-header"> <h2>sign up</h2> </div> <form id="registrationform" method="post" class="form-horizontal"> <div class="form-group"> <label class="col-sm-3 control-label">username</label> <div class="input-group col-sm-5"> <span c...

datagridview - Highlight a row instead of highlighting a single cell - VB.NET -

datagridview - Highlight a row instead of highlighting a single cell - VB.NET - in datagrid, there way highlight whole row (whenever clicked), instead of highlighting single cell? use below selectionmode : fullrowselect vb.net datagridview highlight

variables - R- how to dynamically name data frames? -

variables - R- how to dynamically name data frames? - this question has reply here: how assign values dynamic names variables in r 3 answers i have 2 types of files in directory. each type has either text "drug_rep" in or if not there means command file. drug info has replicates can vary in number , control. reading files in loop follows. want name dataframes x_drug_rep1 , next x_drug_rep2 , on...and save dataframe farther processing. same controls...x_control_rep1...x_control_rep2...and on. syntax save info dataframes because need merges , calculations later on drug replicate dataframes , controls separately. paste on left side of assignment not seem work. suggestions? for (f in 1:length(filelist)){ filename <- filelist[f] x <-read.xls(filename) if(regexpr("drug_rep", filename)[1]>0){ print("drug") ...

rest - Groovy:unable to resolve class groovyx.net.http.RESTClient -

rest - Groovy:unable to resolve class groovyx.net.http.RESTClient - i learning groovy scripting bundle called geoscript-groovy. followed groovy rest tutorial here , tested next code: import groovyx.net.http.restclient def client = new restclient( 'http://www.acme.com/' ) def resp = client.get( path : 'products/3322' ) // acme boomerang however, got error @ import statement saying: groovy:unable resolve class groovyx.net.http.restclient i searched around, , there many questions , answers error message, e.g., import groovyx.net.http.restclient in groovy class , , restclient grails import fails. however, grails, don't utilize , not familiar with. my question is how should prepare error if have groovy only? (my version of groovy installed under ubuntu 12.04 next commands). sudo apt-add-repository ppa:groovy-dev/groovy sudo apt-get update sudo apt-get install groovy thanks. -- edit --- i added @grab statements suggested, , set two-l...

iphone - iOS : How to correctly send put request to server -

iphone - iOS : How to correctly send put request to server - i have set request trying achieve. problem having isn't sending right raw body on server form/post parameter. expecting raw body {"questions":[{"type":"control_head"}]} , instead getting questions[][type]=control_head tips or suggestions appreciated. nsstring *jsonstring = @"{\"questions\":[{\"type\":\"control_head\"}]}"; [self createforms:jsonstring]; - (void) createforms : (nsstring *) form { [self executeputrequest:@"user/forms" params:form]; } - (void) executeputrequest : (nsstring *) url params : (nsstring *) params { nsstring *urlstr = [nsstring stringwithformat:@"http://requestb.in/13oujhot"]; afhttprequestoperationmanager *manager = [afhttprequestoperationmanager manager]; nsdata *data = [params datausingencoding:nsutf8stringencoding]; nsdictionary *json = [nsjsonserialization jsonobjectwithdata:data o...

python - Odoo: External ID not found in the system: stock.view_picking_out_form -

python - Odoo: External ID not found in the system: stock.view_picking_out_form - i'am using odoo 8.0 , want install "picking_invoice_rel" module. when click on "install" button, next error: openerp server error traceback (most recent phone call last): file "c:\program files (x86)\odoo 8.0\server\.\openerp\http.py", line 500, in _handle_exception file "c:\program files (x86)\odoo 8.0\server\.\openerp\http.py", line 517, in dispatch file "c:\program files (x86)\odoo 8.0\server\.\openerp\http.py", line 283, in _call_function file "c:\program files (x86)\odoo 8.0\server\.\openerp\service\model.py", line 113, in wrapper file "c:\program files (x86)\odoo 8.0\server\.\openerp\http.py", line 280, in checked_call file "c:\program files (x86)\odoo 8.0\server\.\openerp\http.py", line 733, in __call__ file "c:\program files (x86)\odoo 8.0\server\.\openerp\http.py", line 376, in re...

r - Can I make a time series work with date objects rather than integers? -

r - Can I make a time series work with date objects rather than integers? - i have time series info i'm trying analyse in r. provided csv excel, subsequently read data.frame all . let's has 2 columns: all$date , all$people , representing count of people on particular date. frequency hence daily. being excel, dates integers representing number of days since 1900-01-01. read info people = ts(all$people, start=c(all$date[1], 1), frequency=365); gives silly start value of 40000 because info starts in 2006. start parameter doesn't take date object, according ?ts , can't utilize as.date() : ts - ... start: time of first observation. either single number or vector of 2 integers, specify natural time unit , (1-based) number of samples time unit. see examples utilize of sec form. i of course of study set start=1 , it's bit painful figure out season we're in when plot tells me interesting things happening around day 2100. (to clear, setting fre...

java - Ant build.xml cannot find symbol in included .jar -

java - Ant build.xml cannot find symbol in included .jar - i migrating multiple projects purely desktop eclipse dev & build buildserver (jenkins-ci) environment. project, can run build.xml -> run -> ant build under eclipse, fails when running on buildserver. sense i'm missing elementary, i've spent far many hours looking @ this. ideas missing? <path id="lib-classpath"> <!-- create path lib files used in javac compilation --> <fileset dir="${lib.dir}"> <include name="*.jar"/> </fileset> </path> <target name="init"> <mkdir dir="${bin.dir}"/> <mkdir dir="${lib.dir}"/> </target> <target name="check-databaseutil"> <property name="databaseutil.dir" value="../../databaseutil/workspace" /> <property name="databaseutil.jar...

php - simpleXMLElement attributes and foreach -

php - simpleXMLElement attributes and foreach - if run in debugger, programme performs 2 iterations correctly, , infinite loop. if exchange line foreach, works correctly. why? test.xml: <?xml version="1.0" encoding="utf-8"?> <response result="0"> <reports> <get count="2"> <row a="first" b="second" comment="test" c=""/> <row a="first1" b="second2" comment="test2" c=""/> </get> </reports> </response> php: $xml = simplexml_load_file('test.xml'); $rows = $xml->xpath('reports/get/row'); foreach($rows $row){ $item = []; $attr = $row->attributes(); print_r($attr); $i = 0; foreach($attr $key => $value){ //foreach($row->attributes() $key => $value){ $...

javascript - Wordpress Search & Filter Autosubmit -

javascript - Wordpress Search & Filter Autosubmit - i'm working wordpress search & filter plugin , it's needed filtering though gallery , shop content! create selections submit every time dropdown changed, opposed having click submit button. (see link below). in researching other posts, i've found solution implement theme's java script file: $(".searchandfilter select").change(function() { $(".searchandfilter").submit(); }); i have set line woothemes canvas's 'general.js' file seems create no difference. still need click on submit button create changes. i've tried placing in various other js files i've had no luck. page in questions one: http://richardrosenman.com/wordpress/portfolio/ does have insight i'm doing wrong? appreciate help i'm stuck (and of novice javascript!). thanks! jquery loaded jquery.noconflict(); hence cannot utilize $ selector (other libraries may using it), ins...

javascript - ACE EDITOR Find Text, select row and replace text -

javascript - ACE EDITOR Find Text, select row and replace text - in ace editor want find text, select row , replace text. can find text (using own tags find them). , works, row (line) number, doing that: editor.find('needle',{ backwards: true, wrap: true, casesensitive: true, range: null, wholeword: true, regexp: false }) editor.$search.set({ needle: /(start_#d1_savepos)/ }); var found = editor.$search.find(editor.getsession()); var range = require('ace/range').range, mine = new range(found.start.row+1, found.start.column-1, found.end.row+1, found.end.column); //find in textfile own tagname "start_#d1_savepos" var d1savepos = (editor.session.gettextrange(mine)) ; // read linenumber var rowofd1savepos = (mine+1) ; // next line number, after "start_#d1_savepos" - need , in textfile r13=0 // rewrite r13 value imputtext var newd1savepos = document.getelementbyid("highestbttxt").value; //get value inputfie...

AngularJS Third Order Nested Table Structure -

AngularJS Third Order Nested Table Structure - say have next info structure { 'key 1': { 'value 1': ['a', 'b', 'c'], 'value 2': ['d', 'e'] }, 'key 2': { 'value 3': ['f'], 'value 4': ['g', 'h'] } } how, angularjs, can render in table similar following: |-------|---------|---| | key 1 | value 1 | | | | |---| | | | b | | | |---| | | | c | | |---------|---| | | value 2 | d | | | |---| | | | e | |-------|---------|---| | key 2 | value 3 | f | | |---------|---| | | value 4 | g | | | |---| | | | h | |-------|---------|---| the keys done via rowspan . if really, need rowspan s way it, it's beyond tricky , impossible read/follow unless author (sorry that), works. need back...

gwt celltable - Selecting text in TextinputCell in GWT -

gwt celltable - Selecting text in TextinputCell in GWT - i utilize textinputcell in celltable. when click on cell, text selected. don't want edittextcell. have idea? you can seek next approach: mytable.addcellpreviewhandler(new handler<myobject>() { @override public void oncellpreview(cellpreviewevent<myobject> event) { if ("click".equals(event.getnativeevent().gettype())) { if (event.getcolumn() == table.getcolumnindex(mycolumn)) { inputelement input = (inputelement) getrowelement(event.getindex()).getcells().getitem(event.getcolumn()).getfirstchildelement().getfirstchildelement(); input.select(); } } } }); gwt gwt-celltable

hyperlink - Verify href with Javascript? -

hyperlink - Verify href with Javascript? - in online shop have links in product pages go template user can download. unfortunately, have many of these links, broken, because file missing. is there function, preferably in javascript, allows me check if link correct? if it's ok, "continue linking" allow download, , if it's broken, show alert says "uh, file missing, please study clicking here" since javascript won't have access server's file system, believe need server-side code. easy way of accomplishing write web service accepts filename(string). have homecoming boolean. this: [webmethod] public bool checkfile(string filename) { homecoming file.exists(filename); } then, when clicks link, can phone call webservice , write callbackfunction evaluates returned value. if it's true, execute logic (presumably) have. if it's false, can pop modal informing them file no longer ex...

output image via php problems -

output image via php problems - i aware trivial problem can't seem right although have spent lastly few hours crawling web.. i have file image_get.php supposed display image file "keepcalm.png" located in same directory php file. i using class handle image related actions. image_get.php <?php include "classes/image.class.php"; include "classes/database.class.php"; $database_sso = new database('sso'); //will needed later , dummy $testimage = new image($database_sso, "1"); //parameters dummy $testimage->show_image(); ?> image.class.php <?php class image{ private $database_image; //image database containing images private $imageid; //id of image in database private $filepath; //path image file //public functions public function __construct($database, $imageid){ $this->database_image = $database; //right placeholder $this->imagei...

python - Q: Django - how to return data from other function on views.py -

python - Q: Django - how to return data from other function on views.py - i'm kind of working on string operation, here want do - created functions gettext(request) getting text *.txt files, code def gettext(request): if request.method == 'post': form = uploadfileform(request.post, request.files) if form.is_valid(): f = request.files['file'] chunk in f.chunks(): text = chunk homecoming render(request, 'ecs/index.html', {'text': text, 'form': form}) else: form = uploadfileform() homecoming render_to_response('ecs/index.html', {'form': form}) and want info stored on text variable functions, called preprocessing def preprocessing(text): pp = preprocess() wordtokenize = pp.tokenizing(text) homecoming wordtokenize how can utilize preprocessing(text) method handle info text variable on gettext method. tried tricks, still no progre...

See when I logged time on Jira? -

See when I logged time on Jira? - is possible see when logged time in jira? need log 8 hours day. ive updated number of tasks , can see time spent not when time spent. jira

html - How to align a background image to bottom of table cells in css? -

html - How to align a background image to bottom of table cells in css? - i'm trying thought simple.. i want display background image @ bottom of each table rows (or cells, whichever works best) i'm getting alignment issue. the image seems align bottom of cell content, ignores padding. border-origin:border-box doesn't seem have influence on result either. setting background on row (ie. tr tag) produces problem. the background uses syntax: background:url('...') bottom left repeat-x; see next screenshot of results - i've added semi transparent outline of cell show boundaries. reddish dotted line background. here's fiddle it: http://jsfiddle.net/bendog/gvtqwhw0/ (note: fiddle cdns bootstrap, i'm using project) one think should easy... the problem occurs on latest chrome , firefox on mac (but haven't tried other browsers yet) use background-position adjust pixels wherever necessary tr { background: url(data:i...

css - Javascript and Media Queries show hide hidden divs -

css - Javascript and Media Queries show hide hidden divs - does 1 know how utilize javascript media query? i wanting left column menu hidden in mobile view using bootstap 3 hidden-xs want able click menu button overlays left column on main content area - x close menu. using function showfunction() { document.getelementbyid("left-col").style.visibility="visible"; } function hidefunction() { document.getelementbyid("left-col").style.visibility="hidden"; } when testing in broswer works ok 1 time have clicked cross close menu if resize screen desktop or above break point of media query left-col remains hidden. is there anyway around this? or waste of time trying , benefit of work on mobile rather users on desktops resizing browsers. update -- in desktop view have 3 columns left main right header , footer. in mobile stacking right colum under main hiding left column on default by clicking menu icon ...

java - open Instagram hashtag intent -

java - open Instagram hashtag intent - for opening specific image in instagram utilize intent: uri uri = uri.parse("http://instagram.com/p/image_id"); intent insta = new intent(intent.action_view, uri); if want see specific hashtag images have do? want open instagram , see images of hashtag uri uri = uri.parse("https://instagram.com/explore/tags/your_tag/"); intent intent = new intent(intent.action_view, uri); startactivity(intent); java android android-intent

scala - How reuse properties in tyesafe config files? -

scala - How reuse properties in tyesafe config files? - consider next files: application.conf app { port = 5000 } reference.conf akka { cluster { seed-nodes = ["akka.tcp://sysname@localhost:"${app.port}] } } so when run configfactory.load() fails, because ${app.port} not nowadays in reference.conf. but load algorithm clear - reference.conf loaded , merged application.conf . there way load application.conf , "include" reference.conf it? important i tried add together include "reference.conf" @ first line in application.conf not help. you can utilize file("") syntax include file. include file("reference.conf") see https://github.com/typesafehub/config/blob/master/hocon.md#include-syntax scala properties akka config

java - Spring @response body with defferent alphabet return bad results -

java - Spring @response body with defferent alphabet return bad results - i have spring method using @responsebody annotation, when ever resonse body has hebrew alphabet response shown in client distorted. changed stringhttpmessageconverter charset utf-8 still result same. what can do? @requestmapping(method = requestmethod.post, value = {"/{accountid}/{containerid}/{objectid:.+}"}) public @responsebody string createobject( @pathvariable string accountid, @pathvariable string containerid, @pathvariable string objectid, httpservletrequest request, httpservletresponse response) <mvc:annotation-driven> <!-- register custom converter returns utf-8 encoded response-body defualt --> <mvc:message-converters register-defaults="true...

html - Javascript Slideshow Makes Page Width Large -

html - Javascript Slideshow Makes Page Width Large - here javascript gallery html , css. slideshow making page width long. http://codepen. io/anon/pen/dpbdav is there can prepare this? disable overflow slideshow element. add next css code style sheet: #slidy-container{ overflow: hidden; } javascript html css

ruby - Prompt option is not working in Edit view in Active Admin in Rails -

ruby - Prompt option is not working in Edit view in Active Admin in Rails - i have 2 select boxes. in 1 select box in edit mode, prompt showing 'select certification provider'. in select box in edit mode, prompt not showing 'select certification'. f.input :certificate_provider ,as: :select ,:collection => certificateprovider.select('id,name').map{|c| [c.name,c.id]} , :prompt => "select certification provider" f.input :certification ,as: :select ,:collection => certification.select('id,name').map{|c| [c.name,c.id]} , :prompt => "select certification" i don't know why showing prompt in 1 select box , not in sec 1 in edit mode. is there left do? thank you. use :include_blank instead of :prompt :include_blank => "select certification" modify code as: f.input :certification ,as: :select ,:collection => certification.select('id,name').map{|c| [c.name,c.id]} , :include...

c# - binding with Model field? -

c# - binding <input type="radio"> with Model field? - in view have 2 <input type="radio"> , combine create radio group. i want bind them field of model, in way if value true should bind first radio button if false should bind other. please guide how can achived. tried below code checked sec radio no matter value model has. <div class="radiobuttons"> <input type="radio" name="lendertype" checked="@model.filter_value" id="rbtnalllenders" class="cb"> <input type="radio" id="rbtnmajorlendersonly" checked="!@model.filter_value" name="lendertype" class="cb"> </div> the input typed radio needs have value set. if radio checked, value sent name in model. view model public class someviewmodel { public int myradiovalue { get; set; } } input element <input type="radio" value=1 name=...

create date range array from a list of dates using ruby -

create date range array from a list of dates using ruby - what best way create array of hashes date ranges list of dates. example: if have list of dates in array below: ['12/11/2014','13/11/2014','14/11/2014','24/11/2014','25/11/2014','26/11/2014','27/11/2014','28/11/2014','29/11/2014','04/12/2014','05/12/2014','06/12/2014','07/12/2014','24/12/2014','25/12/2014','26/12/2014', '28/12/2014', '30/12/2014'] i trying array of date ranges hashes below: [{:from => '12/11/2014', :to => '14/11/2014'}, {:from => '24/11/2014', :to => '29/11/2014'}, {:from => '04/12/2014', :to => '07/12/2014'}, {:from => '24/12/2014', :to => '26/12/1014'}, {:from => '28/12/2014', :to => '28/12/2014'}, {:from => '30/12/2014', :to => '3...

javascript - Bootstrap carousel stop cycling when some event occur -

javascript - Bootstrap carousel stop cycling when some event occur - using bootstrap carousel had problem stopping auto cycle. it said in documentation, if set interval:false, carousel won't auto cycle, there nil said do, when need stop auto cycle when event occurs. lets have code @ project $('#carousel-images').carousel({ interval: 5000, pause : 'hover' }); then have click event handler, should 2 things first: n-th slide should set second: auto-slide should stop $('.smallslide').click(function(e) { $('#carousel-images').carousel(4); $('#carousel-images').carousel('pause'); } this code won't trick, because 'pause' tried set @ moment of slide beingness slided. this work you: $('.smallslide').click(function(e) { $('#carousel-images').carousel(4); $('#carousel-images').on('slid.bs.carousel', function () { $('#carousel-...

c# - How to get current domain name in ASP.NET -

c# - How to get current domain name in ASP.NET - i want current domain name in asp.net c#. i using code. string domainname = httpcontext.current.request.url.host; my url localhost:5858 but it's returning localhost . now, using project in localhost. want localhost:5858. for example, when using domain www.somedomainname.com i want somedomainname.com please give me thought how current domain name. using request.url.host appropriate - it's how retrieve value of http host: header, specifies hostname (domain name) ua (browser) wants, resource-path part of http request not include hostname. note localhost:5858 not domain name, endpoint specifier, known "authority", includes hostname , tcp port number. retrieved accessing request.uri.authority . furthermore, not valid somedomain.com www.somedomain.com because webserver configured serve different site www.somedomain.com compared somedomain.com , if sure valid in case you'll need m...

c# - EntityFramework - contains query of composite key -

c# - EntityFramework - contains query of composite key - given list of ids, can query relevant rows by: context.table.where(q => listofids.contains(q.id)); but how accomplish same functionality when table has composite key? this nasty problem don't know elegant solution. suppose have these key combinations, , want select marked ones (*). id1 id2 --- --- 1 2 * 1 3 1 6 2 2 * 2 3 * ... (many more) how way entity framework happy? let's @ possible solutions , see if they're good. solution 1: join (or contains ) pairs the best solution create list of pairs want, instance tuples, ( list<tuple<int,int>> ) , bring together database info list: from entity in db.table // db dbcontext bring together pair in tuples on new { entity.id1, entity.id2 } equals new { id1 = pair.item1, id2 = pair.item2 } select entity in linq objects perfect, but, bad, ef throw exception like unable create constant va...

javascript - No return data by JQuery in Laravel 4 .. why? -

javascript - No return data by JQuery in Laravel 4 .. why? - my project e-commerce .... in layout product.blade.php file {{ html::script('js/jquery.js') }} <script type="text/javascript"> $("#frm").submit(function(e){ $('#returncart').html("loading ..."); e.preventdefault(); var token = $("input[name=_token]").val(); $.ajax({ type: "post", url : "{{ route('add-to-cart') }}", info : datastring, success : function(data){ $('#returncart').html(data); } },"json"); }); </script> and in cartcontroller.php file public function addtocart(){ $maxquantity = product::where('id','=',input::get('id')); $maxquantity = $maxquantity->first(); $validator = validator::make(input::all(),array( 'quant...

python - all() got an unexpected keyword argument 'pk' in Django -

python - all() got an unexpected keyword argument 'pk' in Django - i've got problem django , django rest framework. when go http://mynameislee.co.uk/albums/ works fine , returns django framework fine when seek http://mynameislee.co.uk/albums/1 all() got unexpected keyword argument 'pk'. this code. urls.py # api url(r'^albums/$', 'canary.views.album_list', name='album_list'), url(r'^albums/(?p<pk>[0-9])$', 'canary.views.album_detail', name='album_detail'), views.py @login_required @api_view(['get', 'post']) def album_list(request): # list tasks, or create new task. if request.method == 'get': album = album.objects.all() serializer = albumserializer(album, many=true) homecoming response(serializer.data) elif request.method == 'post': serializer = albumserializer(data=request.data) if serializer.is_valid(): serializer.save() homecoming r...

html - Javascript Date Selection -

html - Javascript Date Selection - i'm trying create day selection website , i'm having slight issue it. current issue stands @ this. the if statement @ bottom doesn't seem searching , selecting info contains that? i'm not great javascript i'm not sure if that's how it? overall want selects classes name show , searches contents of see if it's equal todays date, if colour green. i've tried thinking of different ways can can't seem head around , i've looked on here see if anyone's trying create simular date selections, not day selections. javascript: <script> function showdate() { var = new date(); var daynames = new array("sunday","monday","tuesday","wednesday","thursday","friday","saturday"); var shows = document.getelementsbyclassname('show'); var today = shows.innerhtml; ...

sql - Stack space error 28 vba teradata query -

sql - Stack space error 28 vba teradata query - i using macro-enabled excel workbook (via vba) access teradata database in end, pull info using query wrote in vba, populate workbook, , output/save file locally. have process working flawlessly in 1 sheet of workbook, code sec sheet gives me "runtime error: 28 - out of stack space" every time. used same steps did first sheet , renamed of functions, buttons, forms, modules etc.. query more complicated previous one. contains creation of volatile table, performs delete, select *. know of work-around type of error? can post code if needed, there quite lot , didn't want bombard stackoverflow redundancies. debug process highlights function creates query. sql excel vba teradata

angularjs - Creating another session with a separate Firefox profile in Protractor? -

angularjs - Creating another session with a separate Firefox profile in Protractor? - i trying figure out how have 2 firefox profiles running @ 1 time in protractor on 2 different windows. first train of thought create webdriver.webdriver.createsession don't quite understand set in 'executor' parameter. i've followed illustration here first profile https://github.com/juliemr/protractor-demo/tree/master/howtos/setfirefoxprofile, , i've tried multicapabilities doesn't help, runs spec on both browsers. angularjs selenium selenium-webdriver protractor