Posts

Showing posts from April, 2010

html - bootstrap3 nav-tabs not switching tabs -

this code i'm working with. i want able switch tabs not. i've tried taking off active class still doesn't work. i followed tutorial way didn't require javascript. can me find out why not working? <div class="nav"> <ul class="nav nav-tabs"> <li class="active"><a data-toggle="tab" href="#home">home</a></li> <li><a data-toggle="tab" href="#tournaments">tournaments</a></li> <li><a data-toggle="tab" href="#about">about</a></li> <li><a data-toggle="tab" href="#contact">contact</a></li> </ul> </div> <div class="tab-content"> <div id="home" class="tab-pane fade"> <h3> example </h3> </div> <div id="tournaments" class="tab-pane fade"> <h3>

c++ - xCode MongoDB Boost import <angled> -

i created c++ project in xcode 6.3.2 (mac yosemite 10.10.3). installed boost (brew install boost) , mongodb (following this guide ). i have setted librarysearchpath , userheadersearchpath following this guide . now when try launch application have lot of error this: 'boost/smart_ptr/detail/shared_count.hpp' file not found <angled> include; use "quotes" instead in file of boost , mongo, include path angled include. xcode seems see boost library relative project , not system. there's way tell xcode boost system library , not relative project library? after few hours resolved stupid problem. it's not userheadersearchpath headersearchpath. :)

ios - Add Scroll View Controller between multiple view controllers scenes -

working on ios8 swift app, i'm looking way include scroll view controller between multiple view controller scenes, app consists in: 1 tab bar controller scene 3 buttons(icons) linked 3 view controller scenes. can navigate between 3 views using tab bar buttons i'd navigate between these 3 views implementing scroll view controller. can suggest me please?

Elasticsearch: find documents with distinct values and then aggregate over them -

my index has log-like structure: insert version of document whenever event occurs. example, here documents in index: { "key": "a", subkey: 0 } { "key": "a", subkey: 0 } { "key": "a", subkey: 1 } { "key": "a", subkey: 1 } { "key": "b", subkey: 0 } { "key": "b", subkey: 0 } { "key": "b", subkey: 1 } { "key": "b", subkey: 1 } i'm trying construct query in elasticsearch equivalent following sql query: select count(*), key, subkey (select distinct key, subkey t) the answer query be (1, a, 0) (1, a, 1) (1, b, 0) (1, b, 1) how replicate query in elasticsearch? came following: get test_index/test_type/_search?search_type=count { "aggregations": { "count_aggr": { "terms": { "field": "concatenated_key" }, "aggs": { &qu

osx - Yosemite, double interface (eth/wifi) access a site through a specific interface -

i have macbook, connected ethernet, , wifi. site (lets call facebook) blocked on 1 of interface (ethernet) open on other (wifi), on other hand eth better (fastest , more reliable wifi) use eth priority interface (on top of network preferences), in way there no access blocked site. i know if there way operating system or browser or other software components must use connection of wifi if , if connection on :80 on eth fail. perfect...or other means solve problem.. it's matter of configuring proper proxy? thanks in advance. you modify routing table pass traffic given host or network through chosen gateway. list routing table: $ netstat -rn routing tables internet: destination gateway flags refs use netif expire default 10.0.0.1 ugsc 15 0 en0 default 192.168.0.1 ugsci 1 0 en1 [...] in case en1 wifi. use wifi connection host x.x.x.x, route traf

html - Why does my list stop showing horizontally when I add a div? -

i creating horizontal list. here html : <ul class="deals"> <li>test</li> <li>fads</li> <li>asdf</li> </ul> and here css : ul.deals { list-style-type: none; } ul.deals li { display: inline; padding: 10px 20px; } if add div inside of list, not show horizontally anymore. here new html : <ul class="deals"> <li> <div>test</div> </li> <li> <div>fads</div> </li> <li> <div>asdf</div> </li> </ul> what div changes output? also, how fix this? as mentioned, divs block level elements. what trying achieve nesting div? if don't need dimensional container use <span> rather using <div> styled display: inline . reason: spans inline nature , won't need additional css make them so. if want dimensional container while still retaining ho

What is the 'Address of an Ada subprogram passed as an access parameter? -

compiling following program without optimization, , running it, see program_error , raised program_error : addreq.adb:16 explicit raise or, updating in view of simon wright's answer, raised program_error : using address this happens when using gnat gpl 2014 on either mac os x or on gnu/linux x84_64, on linux, strangely, program. other versions of gnat produce code doesn't raise, older compilers not accept (access-to-function parameters being more recent, i'm not surprised). since program needs identify addresses of subprograms, hoping definitive statement in rm; 13.3 (11) has ramifications grow waivers, iinm . so, referring program below, would yes_no.all'address = no'adress be true statement if interpreted lrm? legit? yes_no.all proper way refer function no (if taking 'address )? there indirection through different pointer types, 1 having deeper accessibility, change picture? thinking yes_no.all should yield same 'address no , apparen

excel - Printing in one column only if the next row is empty -

Image
i have information printed files in folder columns 1,2,3, , 4 of excel sheet. columns 1 , 2 ever contain 1 cell of information 2 , 3 vary in length equal each other. my goal if column a, if cell next in column b occupied, go row below , loop, else if cell empty print info column 1 in row. here full code! option explicit sub loopthroughdirectory() dim objfso object dim objfolder object dim objfile object dim myfolder string dim startsht worksheet, ws worksheet dim wb workbook dim integer dim lastrow integer, erow integer dim height integer dim rowlast long 'turn screen updating off - makes program faster 'application.screenupdating = false 'location of folder in desired tds files myfolder = "c:\users\trembos\documents\tds\progress\" 'set startsht = activesheet set startsht = workbooks("masterfile.xlsm").sheets("sheet1") 'create instance of filesystemobjec

compass - Different gutters with susy sass -

Image
i have susy settings: $susy: ( columns: 8, gutters: 1/4, global-box-sizing: border-box, ); sometimes need different gutters instead 1/4. see image example: and code: .wrap { @include clearfix; @include container (500px); .box-1 { @include span(4 of 8); } .box-2 { @include span(4 of 8 last); } .box-3 { @include span(4 of 8 wide no-gutter); } .box-4 { @include span(4 of 8 last); } .box-5 { @include span(3.95 of 8 wide no-gutter); } .box-6 { @include span(4 of 8 last); } } i tried without success: @include span(4 of 8 wide (gutter-override: 2px)); i found way fix not if correct @include span(3.95 of 8 wide no-gutter); thanks you can change layout this @include with-layout(12 1/8 fluid float after) { .box-5 { @include span(2 of 12); } .box-6 { @include span(10 of 12 last); } } where 1/8 gutter width.

Cassandra with uneven hardware, how to configure? -

we building cassandra (2.1.5) cluster storing large amount of timeseries data, , planning utilize existing hardware, problem hardware available different. 2 machines with: 4 core, 8 gb, ssd 2 machines with: 8 core, 16 gb, ssd 2 machines with: 32 core, 64 gb, hdd obviously, 32 core machine can handle larger load 4 core machines, how should configure cassandra handle this. using rf 3 , latest datastax java driver. any suggestions? when configure cassandra node tell number of vnodes use node. load on node proprtional number of vnodes. hence choosing different numbers of vnodes computers can distribute load unevenly among them.

javascript - Handlebars -- script in precompiled template doesn't run -

i have precompiled handlebars template. having html sending values (like normal), decided wanted include script executed when inserted dom. however, haven't been able script run. a lot of people seem have run across issue when handlebars template not precompiled, haven't seen many issues precompiled. here's basic structure of .hbs file: <div> <h1>{{title}}</h1> </div> <script> // please alert('executing script'); </script> i'm injecting handlebars dom , part working (the html injected , variables getting set). script never executes, however. any ideas? as mentioned in comment wrote while ago, can't add script directly handlebars template. you can create new html tag, dynamically treat code job want do. example: <div data-handlebars-script="example-stack-overflow"></div> or <example-stack-overflow /> (i prefer go more standard way - first one). and a

Difference of 2 calculated fields in Pivot in Spotfire -

i have raw data on account level current balance, total balance , sales amount formula reads: total dso : total balance * 92 / 3monthbilling amount best dso : current balance * 92 / 3monthbilling amount i wanted grouping on month level overall dso, best dso used formula: total dso : total balance * 92 / sales amount on (month) best dso : current balance * 92 / sales amount on (month) the above 2 works want 3rd field called remaining dso = total dso-best dso so in spotfire, when insert calculated column pivot saying remaining = total dso - best dso don't correct value. then tried remaining = total dso - best dso on (month) , remaining = (total balance-current balance)*92 / sales on (month) both produced incorrect value. simply, want difference of 2 fields (but done on pivot level excel , not raw data level)

datatable - How to upload/import a file in the new R shiny version 0.12 using DT package -

i have updated shiny version 0.12 , started use dt package (finding bit difficult use have anyway). trying upload or import file. server code: shinyserver(function(input, output, session) { datasetinput <- reactive({ infile <- input$fileinput if(is.null(infile)) return(null) read.table(infile$datapath,header=input$header,sep=input$sep,check.names=f) }) output$table = dt::renderdatatable(datasetinput(), server = true) }) # tried following code same error & warning: # output$table <- dt::renderdatatable({ # dt::datatable(datasetinput()) # },server=true) this error getting: error in datatable(instance, ...) : 'data' must either matrix or data frame and following warning, despite using server = true : warning in run(timeoutms) : seems data big client-side datatables. may consider server-side processing: http://rstudio.github.io/dt/server.html i know basic, couldn't find example u

url - AJAX : Passing null parameter in GET request -

i couldn't find anything, i'm asking here little help! i'm sure it's super easy i'm stucked anyway. i've created mvc application in order gather data (in ajax) camunda via rest api. 1 property of stuff (tasks, more precise) need "assignee". value filled username, can empty (in case, it's filled "null"). but here's problem: can't manage gather tasks value (in fact, i'd display each task of given user, including tasks not assigned anyone, can claim them if want to). url use in ajax this: http://localhost:8080/engine-rest/task?assignee=peter i've tried these parameters no success (no task displayed @ ; peter's, obvisouly): task?assignee=peter%2cundefined task?assignee=peter%00 task?assignee=peter%2cnull any ideas? i don't think doable via camunda rest api. if not mistaken, there no way specifying condition assignee = peter or assignee null . i can think of 2 options: 1. make 2 queries on

c++ - Understanding Move Capture in Lambdas for C++11 -

i have question regarding workaround proposed in order address move capture in c++11 lambdas. in particular, taking example meyer's book : std::vector<double> data; ... auto func = std::bind( [](const std::vector<double>& data) { /*uses of data*/ }, std::move(data) ); my question is: consequences/meaning of declaring parameter "data" rvalue reference?: auto func = std::bind( [](std::vector<double>&& data) ... to guide answer, i'll make 3 claims. please tell me if i'm right or wrong: in both cases, move capture semantics included in c++14 emulated. in both cases, not safe use data after definition of "func". the difference in second case (rvalue reference), stating callable object (the lambda) move contents of "data". thanks in advance. what consequences/meaning of declaring parameter " data " rvalue refe

java - Spring Bean Injection Failing Due To Proxy -

spring version : 3.2.4.release , 3.2.9.release mockito version : 1.8.5 i've been trying introduce h2 tests old project integration testing, , i've been running few issues. due way transactions propagating, needed mock out autowired class. i've done before, i'm running severe problems. following error message being thrown when initialising test: org.springframework.beans.factory.beancreationexception: error creating bean name 'com.stuff.xmlitcase': injection of resource dependencies failed; nested exception org.springframework.beans.factory.beannotofrequiredtypeexception: bean named 'theprocessor' must of type [com.stuff.xmlbatchfileprocessor], of type [$proxy118] @ org.springframework.context.annotation.commonannotationbeanpostprocessor.postprocesspropertyvalues(commonannotationbeanpostprocessor.java:307) diving bit deeper, turns out the bean in-fact proxy. if check abstractbeanfactory (round line 239), can see proxy: sharedin

regex - How to separate thousands with space -

this question has answer here: comma separator numbers in r? 3 answers i format number every thousand should separated space. what i've tried : library(magrittr) addspacesep <- function(x) { x %>% as.character %>% strsplit(split = null) %>% unlist %>% rev %>% split(ceiling(seq_along(.) / 3)) %>% lapply(paste, collapse = "") %>% paste(collapse = " ") %>% strsplit(split = null) %>% unlist %>% rev %>% paste(collapse = "") } > sapply(c(1, 12, 123, 1234, 12345, 123456, 123456, 1234567), addspacesep) [1] "1" "12" "123" "1 234" "12 345" "123 456" "123 456" [8] "1 234 567" > sapply(c(1, 10, 100, 1000, 10000, 100000, 1000000), add

delphi - How cand I include a bitmap in my custom component (if is possible)? -

i writing component (a button) needs bitmap displayed on it. don't want make imagelist property , user assigns image. want button have image chosen me. i tried include bitmap in resource file when try access "resource not found" error message. i've done: myres.rc fixed bmp "fixed.bmp" i compiled resource file with: brcc32 myres.rc then included in component unit... implementation {$r .\resources\myres.res} and access with... mycomponent.glyph.loadfromresourcename(hinstance,'fixed'); // mycomponent = class(tspeedbutton) edit1: deleted {$r .\resources\myres.res} directive , loaded resource menu project -> resources , it's working, both hinstance or findclasshinstance(mycomponent). using resource editor found when load resource menu resource appears name "fixed" should, when load resource compiled brcc32 appears name "0". seems brcc32 doesn't set name correctly. but don't want load menu, want

c++ - Autoregister Objects to list stores shared pointers -

i implement base object, can autoregister singleton object list. store shared pointers pointing these objects in list. registration happen either in constructor or separate initialisation function set(). problem object not know it's shared pointer. how can solve problem? the object: class object { public: object() {} virtual ~object() {} void set() { // register object, how? } void unset() { // unregister object, how? } }; the object list: #include <memory> #include <list> class objectpool { public: void unregisterobject(std::shared_ptr<object> objptr) { objptrlist.remove(objptr); } void registerobject(std::shared_ptr<object> objptr) { objptrlist.push_back(objptr); } private: std::list<std::shared_ptr<object> > objptrlist; }; usage: int main() { auto objptr = std::make_shared<object>(); objptr->set(); objptr->unset(); } i

javascript - Open window in tab of new window -

i want open tab inside opened window. this (it should open new window "google.co.uk" new tab "google.de" newwindow = window.open('http://www.google.co.uk', '', 'width=10'); newwindowtab = newwindow.open('http://www.google.de', '_blank'); but opens "newwindowtab" in window, code is. i have tried this, give window time load, until (should) open new tab: newwindow = window.open('http://www.google.co.uk', '', 'width=10'); settimeout(function() { newwindowtab = newwindow.open('http://www.google.de', '_blank'); }, 500); but get: error: permission denied access property "open" i have used firefox. heard might possible in chrome, want use script in firefox. this not possible, unless window being opened same origin (ie same domain). mdn says this : the reference can used access properties , methods of new window provided complies sa

swing - Trouble with Colours values in Java -

i'm creating class called rectangle, gets 2 ponits (the origin 1 , final one), , used fillrect() , drawrect() functions, activated method called visible. rectangle data coming main java class, both point , b's x's , y's positions, plus outline color (color) , fill color (color2). inside of class, i've created method (type int) called distance, allows me calculate distance between 2 points, giving height , width values (both int), can use value draw rectangle correctly. problem fact need multiply, in cases, height , width values -1. though both int types, wrongly switching color , color2 values (ex color = blue, color2 = red. after *-1, color = red, color2 = blue). of course, error doesn't happen when i'm not multiplying -1. what doing wrong? why switching this? check out code: public class rectangle extends figure { protected point p1, p2, p3, p4; protected int height, width; public rectangle (int x1, int y1, int x2, int y2, color cor, color cor

c# - FFT Fundamental frequency calculation from LomontFFT -

i using lomontfft http://www.lomont.org/software/misc/fft/lomontfft.html fundamental frequency sampled values of signal. testing if fundamental frequency correctly determined, have used samples past (with known fundamental frequency). below code have written call lomontfft algo , determine fft: private void buttonfft_click(object sender, eventargs e) { //double fftavg = 0; double fftmax = 0; var fftdata = new byte[512]; double[] fftvalues = enumerable.repeat(0.0, 512).toarray(); array.copy(sapmleddoublevaluesadc1, fftvalues, sapmleddoublevaluesadc1.length); var fftmethod = new lomont.lomontfft(); fftmethod.realfft(fftvalues, true); (int = 0; < 512; += 2) { double fftmag = math.sqrt((fftvalues[i] * fftvalues[i]) + (fftvalues[i + 1] * fftvalues[i + 1])); if (fftmag > fftmax) fftmax = fftmag; //fftavg += fftmag; //fftdata[i

c# - Is there a way to generate a Guid from a list of Guids? -

i have list of objects have guids ids. want use ids in list of objects create guid can use ensure list has not changed. if object removed/added guid different. thing comes mind using hash. maybe should use hash, wondering if possible faster generating hash? edit: getting list stored procedure. storing list of objects memory cache. each user going validate local value in cookie against generated value ensure list still same. when need know if object same before can't rely on hashing alone - hash of object allows tell objects different, not guarantee objects same. generally there several approaches solve that: frequently small rate of potential collisions on hash values acceptable , can use hash long enough satisfy requirement. crypto-hash functions sha256 provide low enough collision rate live it. such value fit in http cookie if needed. if objects small enough (i.e. several k) sending whole object client may option (will give chance perform exact comparison on

javascript - Return multiple videos to poster photo -

i have got website on 20 videos , use video.js plugin play them. have come problem - want each video returned it's poster photo after it's finished. i've got code: <script> var video = videojs('#myvideo'); video.on('ended', function() { video.trigger('loadstart'); video.posterimage.show(); }); </script> everything ok until put there more 1 video, because code refers 1 of them id="myvideo". there way overwrite code more general or have use loop , make function each video on website? thanks replies this simpler in css .video-js.vjs-ended .vjs-poster { display: block; }

php - mt_rand() returns unexpected output -

i working ad system of site , having trouble this. <?php function bdads($size, $company) { if($company == 'nufa') { if ($size == '300'){ echo 'n300'; } if ($size == '160'){ echo 'n160'; } if ($size == '728'){ echo 'n728'; } if ($size == '700'){ echo 'n700'; } } if($company == 'gnr') { if ($size == '300'){ echo 'g300'; } if ($size == '160'){ echo 'g160'; } if ($size == '728'){ echo 'g728'; } if ($size == '700'){ echo 'g700'; } } } function bdad($size, $company){ $zsize = $size; if($company == 'nufa'){ echo bdads($zsize, 'nufa'); } if($company == 'gnr'){ echo bdads($zsize, 'gnr'); } if($company == 'both'){ $randomlist = [ bdads($zsize, 'gnr'),

Is it possible to find out last modified date in android studio project? -

i had exam in android app development in university. home exam , had 5 days our projects. deadline last friday , delivered wrong project same name. have send complaint exams office , explain had made project until deadline. so wondering possible find out last modified date use clue or evidence have made project @ right time , other project have sent mistake. right click on project in project structure on left, local history -> show history if want show history src folder , click on local history -> show history ... same layout folder or vcs -> local history -> show history

ms access - SQL use MAX() function select field not in Group By -

i want find recent entry unique combination of 2 fields in table. employee_number | cap_id | score | date_added i want find recent 'date_added' group of employee_number , cap_id show 'score' entered group. can group employee_number , cap_id row want in result, can't show score group determine distinct value. if table looks like: employee_number cap_id score date_added 96149 2 4 04/06/2015 96149 2 3 03/06/2015 i want result be: employee_number cap_id score date_added 96149 2 4 04/06/2015 i can use: select employee_number, cap_id, max(date_added) scores group employee_number, cap_id to correct result, need score too skip group by , return row if no other row same employee_number , cap_id later date exists! select employee_number, cap_id, score, date_added scores s1 not exists (select 1 scores s2 s1.employee_number = s2.employee_number

java - deleted object would be re-saved by cascade (remove deleted object from associations) - issue with service method invoking -

i have faced strange problem regarding deleting child object association. here first object order : @lazycollection(lazycollectionoption.false) @onetomany(mappedby = "order", orphanremoval=true) @cascade({org.hibernate.annotations.cascadetype.all}) private list<exchangetransaction> exchangetransactions = new arraylist<exchangetransaction>(); here second object exchangetransaction : @manytoone @joincolumn(name = "orderid", insertable = true, updatable = false) private order order; i want delete order related exchangetransactions. if perform delete operation through controller, works fine. here code inside controller: order order = orderservice.getorder(orderid); user user = order.getuser(); user.removeorder(order); orderservice.removeorder(order); if delete operation performed @scheduled service, i've got error message: error [org.springframework.scheduling.support.taskutils$loggingerrorhandler] [] pool-3-thread-1

ruby on rails - How do I get several attributes value and method value from an ActiveRecord model? -

to solve problem, set fictitious car model below: car model has 3 attributes(id, car_name, owner_name) and 2 methods return integers(riders, passengers). i want one hash has values of 2 attributes , 2 methods of cars. solve problem, temporary solution below: json_format = car.all.to_json(only: [:car_name, :owner_name], methods: [:riders, :passengers]) final_hash = activesupport::json.decode(json_format) this works, bad because use 'to_json' method optional function. other choice getting 1 hash directly car model via own optional function? use as_json . it's to_json uses under hood, , accepts same options returns hash .

google app engine - Objectify list consistency in one entity -

i try make chat solution on app engine android app. decided instead of save messages send topic in separated entity chatmessage or this, can save them in list of strings inside topic entity, this: @entity public class topic { @id public string id; public list<long> users = new arraylist<long>(2); public long lastchangetime; public linkedlist<string> messages = new linkedlist<string>(); } i came because storing topic id every message more data message string itself. :s don't know is, can list strong consistent? how add new message topic: // 2. topic if exists or create new if not topic topic = ofy().load().key(key.create(topic.class, topicid)).now(); if (topic == null) { topic = new topic(senderid, recipientid); } // 3. add message // method adds new string topic , update // last change time topic.addmessage(senderid, recipientid, send.message); // 4. save topic & new message

osx - Mac installation Apache with SSL, WSGI -

i tried install apache, apparently installation done , can see page localhost, set while ssl when set module wsgi have problems because page forbidden appears, uninstalled , installed xampp problems, nose follow steps configuration , have results. i'm installing on mac yosemite

python - How do I run a google appengine docker image on a compute engine instance? -

i have following docker file: from gcr.io/google_appengine/python-compat maintainer me@me.com run apt-get update run apt-get -y upgrade add ./app/ /app add app.yaml /app/ run mkdir -p /var/log/app_engine i create log directory because otherwise following error sudo docker run gcr.io/my-project/ae-image traceback (most recent call last): file "/home/vmagent/python_vm_runtime/vmboot.py", line 133, in <module> run_file(__file__, globals()) file "/home/vmagent/python_vm_runtime/vmboot.py", line 129, in run_file execfile(_paths.script_file(script_name), globals_) file "/home/vmagent/python_vm_runtime/google/appengine/tools/vmboot.py", line 32, in <module> initialize.initializefilelogging() file "/home/vmagent/python_vm_runtime/google/appengine/ext/vmruntime/initialize.py", line 92, in initializefilelogging app_log_file, maxbytes=max_log_bytes, backupcount=log_backup_count) file "/usr/lib/python2.

javascript - Image to Fade In during input -

i new javascript , jquery wanted ask how can make image fade-in next input tag when start typing in input field? how should write onchange function in javascript. this code far thank in advance <!doctype html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> </head> <body> <img id="logo" src="visa.png" style="display:none"/> <input id="test" type="text"> <script type="text/javascript"> $('#logo').hide().fadein(3000); </script> </body> </html> <img id="logo" src="visa.png" style="display:none" /> <input id="test" type="text" /> <script type="text/javascript"> $('#test').keypress(function() { $('#logo').fadein(3000);

Bootstrap 3 datepicker internalization -

i'm using code create booking system: http://jsfiddle.net/9zjwdypc/ this example working fine, can't add internalization , others option. i tried sample code: $('#dpd1').datepicker({ language: 'it' }); $('#dpd1').datepicker({ format: "dd-mm-yyyy", weekstart: 1, language: "fr", autoclose: true, todayhighlight: true }); $('#dpd2').datepicker({ format: "dd-mm-yyyy", weekstart: 1, language: "fr", autoclose: true, todayhighlight: true }); $(window).load(function(){ var nowtemp = new date(); var = new date(nowtemp.getfullyear(), nowtemp.getmonth(), nowtemp.getdate(), 0, 0, 0, 0); var checkin = $('#dpd1').datepicker({ onrender: function(date) { return date.valueof() < now.valueof() ? 'disabled' : ''; } }).on('changedate', function(ev) { if (ev.date.valueof() > checkout.date.valueof()) {

Move ImageView inside RelativeLayout Android -

i have imageview android:scaletype="matrix" <imageview android:id="@+id/imageview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@+id/textview1" android:layout_margintop="20dp" android:scaletype="matrix" android:src="@drawable/ic_launcher" /> i want drag imageview left @ parts of image off screen. in other words want move image point mark point on imageview . please help. put imageview inside framelayout , use following code move : java code: _framelayout.setx(position); _framelayout.sety(position); example xml : <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/bac

InitErgmTerm.graphletCount in R -

i loaded interaction data, converted adjacency matrix , converted undirected graph. i installed packages; ergm , ergm.graphlets , statnet , etc. when write: initergmterm.graphletcount(gy2) i following error message: error: is.directed(nw) : is.directed requires argument of class network . i couldn't find solution in tutorial, , appreciate if clarifies this. if you're trying graphletcount way within 'ergm()' command, follows: ergm(gy2~graphletcount(n)) n can number 0 29 corresponding 30 possible graphlets exist 5 nodes. it's possible define vector 'c(1,3,5)' run graphletcount. aware n optional argument , can left blank, run 30 possible counts. see paper on ergm.graphlets examples

html - Vertically align image in dynamic div -

i trying vertically align images on page have had no luck. i need them centered text block. when page wide enough images shown next text. link demo page: http://ruigendyk.com/static/stackoverflow/questions/1/ there's few things need do... add following css .img-frame height:100%; then following .featurette-image position: relative; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); -ms-transform: translate(-50%, -50%); transform: translate(-50%, -50%); for vertical align css work need image column match height of text column, can using following script: equalheight = function(container){ var currenttallest = 0, currentrowstart = 0, rowdivs = new array(), $el, topposition = 0; $(container).each(function() { $el = $(this); $($el).height('auto') toppostion = $el.position().top; if (currentrowstart != toppostion) { (currentdiv = 0 ; currentdiv < rowdivs.length ; currentdiv++) { rowdivs[cu

html5 - An invalid form control with name='' is not focusable. WITHOUT ANY REQUIRED OR HIDDEN INPUTS -

i'm facing known chrome's "not-focusable-input" error situation different explained in other post find there. i have error message duplicated first on pointed input, input has no required attribute: code: <fieldset> <label>total (montaje incl.)</label> <input type="number" id="pricefinal" name="pricefinal"> € </fieldset> the error: an invalid form control name='pricefinal' not focusable. while user filling form field gets value js script jquery. user type size in input, script maths size value , put outcome in 'pricefinal' input jquery function: .val() in browser can see input correctly filled , no errors displayed @ time. , 'novalidate' solution goes fine, couldn't responsible nofocusable error, think. then got same error input no name didn't write , doesn't exist in dom: an invalid form control name='' not focusable. this weird because

"Additive" property values with LESS mixin -

i'm looking feature may or may not available in less. i have mixin adds "glow" box-shadow, use on various elements - buttons, inputs etc. .glow() { box-shadow: 0 0 5px skyblue; } what i'm looking way make mixin add box-shadow new comma-seperated value if element has box-shadow. so, want this: .button { box-shadow: inset 0 5px 10px black; .glow(); } to compile this: .button { box-shadow: inset 0 5px 10px black, 0 0 5px skyblue; } i think recall seeing similar feature in sass, can't find anywhere now. does feature exist in less, or there alternative way achieve similar result? the feature you're looking merge . you'd this: .glow() { box-shadow+: 0 0 5px skyblue; } .button { box-shadow+: inset 0 5px 10px black; .glow(); } note both rulesets need use + syntax work. or, declare glow rule variable: @glow: 0 0 5px skyblue; .button { box-shadow: inset 0 5px 10px black, @glow; }

python - Different forms depending on object status in Django -

i have model order field status . depending on status of order, user should see different when he/she tries update order. so if order pending, want show fields , when user submits form, order status should change status, etc. i guess can use updateview , override get_form_class , form_valid , , get_template_names . in get_form_class can return form class use depending on status , in form_valid can make sure status change new status. is best approach? or should make separate views each use case? when order accepted, want user confirm doesn't require fields. maybe it's better use separate views each use case or what? if forms different each other, write 2 separate forms , pass them depending on status. not need 2 different views that. split views based on functionality, again, if both forms satisfy 2 different purposes, maybe better serve them different views. another approach use single form , in template can render form fields manually show fields depend

angularjs - Angular UI-Router very basic example is not working ? Please see full code on plunker -

angular ui-router not working? please see code on plunker . i trying run basic routing example in angular js. welcomeview.html not appearing on page. (function() { "use strict" var app = angular.module("plunker", ["ui.router"]); app.config(["$stateprovider", "$urlrouterprovider", function($stateprovider, $urlrouterprovider) { $urlrouterprovider.otherwise("/"); $stateprovider .state("home", { url: "/", templateurl: "welcomeview.html" }) } ]); }()); there updated , working version firstly need add reference app.js our module <head> ... <script src="app.js"></script> // missing <script src="script.js"></script> </head> also, should not use ng-controller , not need ui-router //<body ng-controller="mainctrl"> <body> the app.j

silverlight - Failed to create an object instance for the specified ProgID (WIA.CommonDialog) -

we trying allow users scan documents using silverlight xap running in-browser elevated trust, remote server, , getting following error: unhandled error in silverlight application failed create object instance specified progid. the failure @ following line: dim commondialog = automationfactory.createobject("wia.commondialog") application.current.haselevatedpermissions , automationfactory.isavailable both return true. i can create instance of unsafe activex controls, e.g. scripting.filesystemobject : dim fso = automationfactory.createobject("scripting.filesystemobject") the code fails when running production environment on remote server. when running asp.net development server localhost, code succeeds, , wia scanning dialog shown when calling commondialog.showacquireimage() . how can resolve this? (is there perhaps specific wia prevents being used way?) steps can take try , debug this? update when try open generated silverlight test page

ruby - How to insert a string content into varbinary column in rails -

there varbinary column in database table,in sql statement,we can use convert(varbinary(10),n'hello') ' to convert string varbinary ,but in rails,how can or there way insert string content varbinary column.

javascript - Create complex json from datatable c# -

i have 3 datatables in dataset. table has 1 many relationship b , c. want create json below using linq in c#. can please me? in advance guide me or provide me input question. { "a": [ { "id": "0001", "type": "donut", "name": "cake", "ppu": 0.55, "b": [ { "id": "1001", "type": "regular" } ], "c": [ { "id": "5001", "type": "none" }, { "id": "5002", "type": "glazed" } ] } ], "a": [ { "id": &quo

java - Volatile keyword does not work as expected with multiple instances of a class -

this question has answer here: why volatile not working properly 6 answers i have read in posts volatile (even if it's not static) variable shared among the threads. when 1 thread updates variable second thread gets updated value. when run below code on local machine, running java 7 . not giving expected results code - public class statcivolatile3 { public static void main(string args[]) { new examplethread2("thread 1 ").start(); new examplethread2("thread 2 ").start(); } } class examplethread2 extends thread { private volatile int testvalue = 1; public examplethread2(string str) { super(str); } public void run() { (int = 0; < 3; i++) { try { system.out.println(getname() + " : " + i); if (getname().compareto("thread 1

javascript - Dropdown Menu troubles in IE9/Windows 7 -

i have page developed using asp.net , javascript have drop down , when clicking on drop down getting expanded , getting freezed , unable select item drop down mouse adding able select item dropdown means of key board , happenning few time , in few machines . unable find out if javascript issue / i.e version issue / css issue . please let me know if more info required thanks in advance

How to open Default Email Application in PHP -

hi guys curious, wonder if php can stuff: have anchor tag says "send email admin". what want open default email client such ms outlook or lotus , automatically create empty mail message. i want php it. possible? if may, how should it? use html - browser handle it. <a href="mailto:test@example.com">click me</a>