Posts

Showing posts from April, 2013

r - Create a straight faint dotted/dashed line through y=0 -

i want able draw faint dotted or dashed line through y=0 make more obvious when plotted line goes below 0. if possible id whole area of graph below y=0 line lightly shaded show better when plotted line drops below zero. here example of type of graph want shade/draw line: http://s27.postimg.org/v94uey56r/rplot02.png there lots of different graph types doesnt have specific, aslong works have general idea of enough :) thankyou how abline(h = 0, lty = 2) ?

django - python oauthlib: in escape ValueError "Only unicode objects are escapable" -

i'm using python-social-auth login social networks django application. on local machine works fine, when deploy server following error: oauthlib.oauth1.rfc5849.utils in escape valueerror: unicode objects escapable. got none of type <type 'nonetype'>. stacktrace: file "django/core/handlers/base.py", line 112, in get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) file "social/apps/django_app/utils.py", line 45, in wrapper return func(request, backend, *args, **kwargs) file "social/apps/django_app/views.py", line 12, in auth return do_auth(request.social_strategy, redirect_name=redirect_field_name) file "social/actions.py", line 25, in do_auth return strategy.start() file "social/strategies/base.py", line 66, in start return self.redirect(self.backend.auth_url()) file "social/backends/oauth.py", line 99, in auth_url token = self.set_unauthorize...

tomcat - 404 error for PNG image in IIS -

Image
i have site hosted on server abc running on 5000 port. have site hosted on xyz server running on port 6000 . when hit http://abc:5000/mysite url, redirects http://xyz:6000 . working fine. on abc server's virtual directory have img folder, under have 2 png images. when hit http://xyz:6000 , works fine. when request originates abc server (which gets redirected xyz server), system giving 404 error these images. please see below image. type of these 2 images coming 'text/html' iis returns 404 unknown file types, i.e. don't have mime-types. add png iis mime types.

arrays - removing python reference, copying instead -

so have strange error in function think must have python references rather value assignment. if can see causing value of mainlist disappear grateful. - http://pastebin.com/6szcwak8 inputs: ships -> [0] hitlistlength = 1 output of first print statement [[0]] output of second print statement [[]] my theory because have popped countinglist has removed value mainlist not sure how round this? def addplacement(ships,hitlistlength,start = none, mainlist = none,countinglist = none): if start == none: start=0 if mainlist == none: mainlist = [] if countinglist == none: countinglist = [] #pop ship array use on recusion level ship = ships.pop() #loop through each hit x in range(start,hitlistlength): #add rotation counting list countinglist.append(x) #if don't need go deeper add counting array element of main list if len(ships) == 0: mainlist.append(countinglist) print ...

javascript - Prematurely exiting a Loop and Merge block in Qualtrics -

i'm working on qualtrics survey in respondents have solve long list of anagrams, , answer demographic questions. to make anagram part easier, i've used loop , merge block: first field anagram solved, second field solution of anagram, , survey can therefore check answer of respondent against solution each anagram. as is, survey working perfectly: however, i'd allow respondents prematurely exit loop typing "exit" in response field, , redirect them next question block (the demographic questions). this typically achieved using "skip" logic: however, skipping end of block not trick (the loop restarts). managed redirect them end of survey, not demographic question block. is there way use javascript jump demographic block or exit loop , merge block prematurely? missing qualtrics option trick? if still relevant you: needed same functionality , how solved it: first, define helper variable, call endloop , initialize 0. set function change valu...

Laravel 4 admin route same as admin folder -

i have /admin folder , cant delete becaus there old files linked externaly , need use /admin route. when use /admin route have loop, if rename admin folder, works, cant permanently. if use route /admin/anything, works. how can have folder , route work together. here routes: route::post('admin/login/valida', ['before' => 'csrf', 'uses' => 'logincontroller@getvalidar']); route::get('admin/login', 'admincontroller@login'); route::get('admin/asociarmenuarchivo', 'admincontroller@asociarmenuarchivo'); route::get('admin/disenosnuevos', 'admincontroller@disenosnuevos'); route::get('admin/disenosnuevooantiguo', 'admincontroller@switchdisenos'); route::get('/admin', 'admincontroller@getindex'); the last 1 route doesnt work. here .htaccess: <ifmodule mod_rewrite.c> <ifmodule mod_negotiation.c> options -multiviews </ifmodule...

mysql - How can I append a new result column showing the result of the WHERE clause for that row? -

instead of retrieving rows satisfying clause, intend have new result table column shows result of clause. instance; cola colb colc newcol xxxx xxxx xxxx 1 # clause true row xxxx xxxx xxxx 0 # false row xxxx xxx xxx 0 .... how can design such query in mysql? you can use case statement achieve after: select case when myfield = whatever 1 else 0 end newcol from..... leave out clause together.

java - string array contain duplicate value and remove and print the array -

this question has answer here: how compare strings in java? 23 answers sorry ask question again had found alot in forum.but of new java excepting explanation code tried in way not working .i tried without default method code have work program code: package javatest; public class test03sep { public static void main(string args[]) { //0 1 2 3 string []val={"amma","senthil","kumar","amma"}; removeduplicate(val); } static void removeduplicate(final string []arr) { string temp=""; (int = 0; < arr.length; i++) { (int j = i+1; j < arr.length; j++) { system.out.print("condition are:"); system.out.println(arr[i]==arr[j]); ...

javascript - High CPU when I use progressbar in angular -

i have such high cpu when i'm lauchnig page 2 progressbar ... i checked , deleted them , site faster. this snippet of progressbar : <progressbar class="progress-danger progress-striped active" value="procentvalueemail" name = "domains_emails_search"> <span class="badge badge-info-rev" n> {{procentvalueemail | number:1}}% </span> </progressbar> i'm using angularjs, procentvalueemail cosnstance value. any idea how can use progressbar in angualar without lags ? lib <script src="static/bower_components/angular-bootstrap/ui-bootstrap.min.js"></script> <script src="static/bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script> in html markup have class set 'active'. class cause redraws switches on animations aren't visible...

url rewriting - IIS Rewrite Rule in web.config to redirect HTTPS requests to HTTP -

i need redirect https requests http, example, if visits https://www.example.com/another-page/ http://www.example.com/another-page/ i have following rewrite rule in web.config right now, it's not working correctly. it's redirecting https://www.example.com/another-page/ https://www.example.com/ , root of site, instead want redirect stay in same url , rewrite https http. <rule name="redirect http" stopprocessing="true"> <match url="(.*)" /> <conditions> <add input="{r:1}" pattern="^onepage/(.*)$" negate="true" /> <add input="{https}" pattern="^on$" /> </conditions> <action type="redirect" url="http://{http_host}/{r:0}" redirecttype="permanent" /> </rule> any on changing above rule changes https http, keeps full url visited appreciated! i set rule, cleaned little, , worked...

testing - python mockito argument captor -

i have been using python mockito https://code.google.com/p/mockito-python/ testing code. so far python mockito seems provide 2 matchers: contains() , any() https://code.google.com/p/mockito-python/wiki/matchers i wondering how can write code can capture entire argument. so example if code deletesqlstatement = "delete %s lower(z_id)=lower('%s') , y_id=%s" \ % (self.some_table, zid, yid) cursor.execute(deletesqlstatement) currently, can in verification verify(self.cursor_mock, times=1).execute(contains("delete")) it great if can capture entire argument passed execute string. suggestions? i guess implement own [matcher] capture argument. class captor(matcher): def matches(self, arg): self.value = arg return true def getvalue(self): return self.value and use in test: captor = captor() verify(self.cursor_mock, times=1).execute(captor) self.assertequal("expected query", capto...

ios - Type 'ProfilesTableViewController' does not conform to protocol 'UITableViewDataSource' in Xcode 6 GM seed -

today migrated xcode 6 gm seed , following error: type 'profilestableviewcontroller' not conform protocol 'uitableviewdatasource'. i've overrided numberofrowsinsection , cellforrowatindexpath , numberofsectionsintableview . in fact worked fine till today. noticed when remove uitableviewdatasource working fine, , no errors occured. .. necessary use ' uitableviewdatasource ' anymore, or override functions it? this code compiles fine: class profiletableviewcontroller: uitableviewcontroller, uitableviewdelegate, uitableviewdatasource { override func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int { return 1 } override func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell: uitableviewcell = tableview.dequeuereusablecellwithidentifier("foo", forindexpath: indexpath) uitableviewcell return cell } } so, can subclass...

Javascript merge to array with some identical value at certain index -

i have 2 arrays want combine (merge), if value @ index 0 first array identical value @ index 0 on second array must in same array. more details: array 1: var arr1 = [ ["sp.22110000295", 1, 162.9], ["sp29372", 1, 1061.6], ["sp3204200014", 5, 1147.5], ["sp324035", 1, 94110.0231] ]; array 2: var arr2 [ ["999974", 1], ["sp.sambacr803805", 1], ["sp29193", 1], ["sp29372", 4], ["sp324035", 3] ] as can see (in example), first array have 4 array 3 items, , second 5 array 2 items. arr1[3][0] ([ "sp324035" , 1, 94110.0231]) equal arr2[4][0] ([ "sp324035" , 1]) so don't know hot achieve result this: var arrfinal = [ ["sp.22110000295", 1, 162.9, null], // arr1 index 0 **is not** in arr2 index 0 ["sp29372", 1, 1061.6, ...

c# - How to memory profile unit tests running in Visual Studio -

i'd create unit tests test whether instances of specific types (not written me) being created; whether live or on gc heap, etc - kind of thing .net profiler api allows profilers via c++. these tests need run visual studio via nunit test adapter visual studio. however, have not found built-in or third party c# api allow me this. the scitech memory profiler api comes close, does not seem allow profiling running tests in visual studio. instead, requires unit test runner process run under profiler.

symfony - Having problems filtering by xPath -

i'm trying build hacker news scraper using symfony 2's dom crawler [1] when try out xpath chrome plugin [2], works. when try in scraper keep getting the current node list empty. here's scraper code: $crawler1 = $client1->request('get','https://news.ycombinator.com/item?id=8296437'); $hnpost->selftext = $crawler1->filterxpath('/html/body/center/table/tbody/tr[3]/td/table[1]/tbody/tr[4]/td[2]')->text(); [1] http://api.symfony.com/2.0/symfony/component/domcrawler/crawler.html#method_filter [2] https://chrome.google.com/webstore/detail/xpath-helper/hgimnogjllphhhkhlmebbmlgjoejdpjl?hl=en-us if problem think is, i've been battered 1 couple of times. chrome implicitly adds missing <tbody> tags dom, if copy xpath or css path, may have copied tags don't exist in source document. try viewing page's source , see if dom reported browser's console corresponds original source html. if <tbody> tags ...

f# - How do I edit an XML file using type providers? -

i understand how retrieve data xml source using type providers. however, need modify particular part of xml , save disk. have tried assigning value node using <- property read-only. for example: let doc = myxml.load filename doc.itemid.id <- "newid" // doesn't work doc |> savexml there similar question json suggestion create new object, xml. while researching question found can use .xelement accessor reference mutable xelement object. solution is: let doc = myxml.load filename doc.itemid.xelement.element(xname.get "id").value <- "newid" // tada doc.xdocument.save(...) note have use .xelement accessor on parent if you're modifying leaf node. because leaf node's type primitive , doesn't have .xelement accessor of own. slight shame, suppose makes life easier on other side when want read-only access value.

linux - How to install/update/upgrade SSL certificate in Tomcat -

i install/update/upgrade ssl certificate in 1 of servers has following configuration sever information: sever version: apache tomcat/6.0.35 os version: linux 2.6.18-371.6.1.el5 architecture: amd64 jvm version: 1.6.0_30-b30 jvm vendor: sun microsystems inc. tomcat location: /user/local/apache-tomcate-6.0.35 generate new ssl certificate request: i created folder name keystore (/user/local/apache-tomcate-6.0.35/keystore) to create key : sudo keytool -storepass keypassword -keyalg rsa -keysize 2048 -keystore mydomain.keystore -genkey -alias mydomain to create ssl certificate request: sudo keytool -storepass keypassword -keystore mydomain.keystore -certreq -keyalg rsa -file mydomain.csr -alias mydomain.com after successful executing both commands got 2 files keystore folder - mydomain.keystore - mydomain.csr the following files attached email received yesterday cabundle.cert (what this? no mention of in wiki) zip file mydomain.crt root_certificate.crt tren...

c# - Unit test failing on EF Entry.State -

is possible unit test this? public class myrepository<t> t : identityuser, new() { public async task updateasync(t user) { _context.entry(user).state = entitystate.modified; _context.entry(user).property("username").ismodified = false; await _context.savechangesasync(); } } the [testinitialize] adds 1 user repository _user = new identityuser { id = "70a038cdde40" }; idbset<identityuser> users = new fakedbset<identityuser> { _user }; var dbcontext = new mock<mydbcontext<identityuser>>(); dbcontext.setup(x => x.users).returns(() => users); _repository = new myrepository<identityuser>(dbcontext.object); and i'm trying test this private myrepository<identityuser> _repository; [testmethod] public async task updateuser_success2() { var user = await _repository.findbyidasync("70a038cdde40"); assert.isfalse(user.emailconfirmed, "user.emailconfirmed...

match - Solr returning matches on fields where Indexed="false" -

i have field defined such within schema.xml: <field name="imagethumbnail" type="string" indexed="false" stored="true" required="false" /> i storing base64 string representation of image thumbnail inside document, our search results screen can render these thumbnails. works great; show images of people , objects in our browser client. the problem text of base64 string searchable, though indexed="false" set in schema.xml. i found typing automotive vehicle make short hand (vw volkswagon), , got 2 hits. not returning hit highlighting information, returns few matching records. i went further search '4aaqskzjrgabaqeayabgaad' , got on 150 hits, again, matching string within imagethumbnail column. what missing? if indexed="false", how can solr search , find matches on field? else shuts off searching on field if not indexed="false"? i doing /select querying, , reference, here /select ...

Order when concat streams with event-stream in Gulp -

in gulp task, vendorfiles code placed after appfiles code in dest style.css file. is because appfiles stream runs faster? how have vendorfiles code come before expected? gulp.task('styles', function () { var vendorfiles = gulp.src(mainbowerfiles()) // don't read .pipe(gulpfilter('*.css')); var appfiles = gulp.src('app/sass/*.scss') .pipe(sass()) .pipe(prefix('> 5%')); return es.concat(vendorfiles, appfiles) .pipe(minifycss()) .pipe(concat('style.css')) .pipe(gulp.dest('./dist/css')); }); solved gulp-order gulp.task('scripts', function () { var jsfilter = gulpfilter('*.js'); var vendorfiles = gulp.src(mainbowerfiles()) .pipe(jsfilter) .pipe(concat('vendor.js')); var appfiles = gulp.src('app/js/*.js') .pipe(jshint()) .pipe(jshint.reporter('default')) .pipe(conc...

android - Need help to spot null pointer exception java -

when compile android device gives me null pointer exception. have been trying find null pointer exception is, without luck. have activity button , edittext. when click button text in edittext should end item in listview. please help. log: http://i61.tinypic.com/14lq33n.jpg source: package com.example.foodplannerbeta; import java.util.arraylist; import android.app.activity; import android.content.pm.activityinfo; import android.os.bundle; import android.view.menu; import android.view.menuitem; import android.view.view; import android.view.window; import android.widget.arrayadapter; import android.widget.button; import android.widget.edittext; import android.widget.listview; public class indkob2activity extends activity { private button bt; private listview lv; private arraylist<string> al; private arrayadapter<string> adapter; private edittext et; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setreque...

jquery script with list.pagination.js not processing after changing page -

<div id='listid'> <ul class='list'> <li class='add_to_email' email='a@gmail.com'>a@gmail.com</li> <li class='add_to_email' email='b@gmail.com'>b@gmail.com</li> <li class='add_to_email' email='c@gmail.com'>c@gmail.com</li> <li class='add_to_email' email='d@gmail.com'>d@gmail.com</li> <li class='add_to_email' email='e@gmail.com'>e@gmail.com</li> </ul> <ul class='pagination'></ul> </div> <input type='text' id='show_what_was_clicked'> <script> $( document ).ready(function() { var options = { valuenames: [ 'email' ], page: 3, plugins: [ listpagination({}) ] }; var listobj = new list('listid', options); $(".add_to_email").click(function(){ $("#show_what_was_clicked...

c# - .NET XML Serialization error: Invalid or missing value of the choice identifier -

following instructions from: .net xml serialization error (there error reflecting type) create object based on xmlchoiceidentifier http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlchoiceidentifierattribute(v=vs.110).aspx i tried serialize array of objects xmlchoiceidentifier attribute. apparently serializer requires array , observablecollection cause serializer throw , error (first link). need have observablecollection in order keep ui updated. attempted have serialization engine access array whilst ui access observable collection, albiet in resource wasting fashion. this "solution" [xmltype(includeinschema = false)] public enum itemchoicetype { [xmlenumattribute("item")] item, [xmlenumattribute("macro")] macro } [serializable()] public class groupanditemscollection { [xmlelementattribute(isnullable = false)] [xmlignore] public itemchoicetype[] itemtypearray; [xmlattribute(attributename ...

canvas - How to draw a full coordinate system with Easeljs? -

Image
i create complete coordinate system drawing on canvas. it should similar this: my question is, code create image easeljs? please ignore headline "koordinatensystem" , red cross in center. i did once in flash used line tool, arrow tool, label tool, etc. now porting html5 , trying create using code :) well, not know if can called optimized code, enough produce this: html: <canvas id="canvas2d" width="750" height="600"></canvas> javascript: var stage = new createjs.stage('canvas2d'); var coord_xaxis = new createjs.shape(); stage.addchild(coord_xaxis); var coord_yaxis = new createjs.shape(); stage.addchild(coord_yaxis); var coord_arrow_x = new createjs.shape(); stage.addchild(coord_arrow_x); var coord_arrow_y = new createjs.shape(); stage.addchild(coord_arrow_y); var coord_xaxis_lines = new createjs.shape(); stage.addchild(coord_xaxis_lines); var coord_yaxis_lines = new createjs.shape(); stage.addc...

javascript - Bootstrap social buttons -

i'm using social buttons twitter bootstrap 2 . reason, facebook "f" logo in button not showing up. here front end code: {% include "meddy1/header.html" %} {% load staticfiles %} <link href="../../static/meddy1/css/social-buttons-3.css" rel="stylesheet"> <link href="../../../bootstrap-social-gh-pages/bootstrap-social.css" rel="stylesheet"> <link href="../../../font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet"> <!-- css links --> <link href="{% static "meddy1/css/login-signup.css" %}" rel="stylesheet" media="screen"> <link href="{% static "meddy1/css/login-signup-responsive.css" %}" rel="stylesheet" media="screen"> <!-- end css links --> <div class="wrapper"> <div class="container"> <!-- log in -->...

junit - Mockito: Getting ClassCastException from a constructor call with a mock as argument -

i want unit test method signature as public oracle.sql.array methoda(java.sql.connection connection) the connection object mocked using mockito.mock(connection.class) and passed methoda while testing it. oracle.sql.array has constructor new array(oracle.sql.arraydescriptor, connection, object) the methoda has logic obtaining arraydescriptor. has logic providing third argument constructor provides array of objects i mocking these 2 set of logics , passing mocked arraydescriptor object , mocked object array. these mocking work correctly. so constructor invocation like new array(arraydescriptormock, connectionmock, objectmock) this constructor call throws exception when executed part of test java.lang.classcastexception:$java.sql.connection$$enhancerbymockitowithcglib$$2427854e cannot cast oracle.jdbc.oracleconnection i have made many attempts mock constructor call avoiding error. however, each proved futile. documenting mocking code constructor atte...

dart - What is the difference between @observable and @published -

until polymer 0.10.1 @published annotation created attribute on polymer element declared. changed polymer 0.11.0. since @publishedproperty(reflect: true) needed make fields value available attribute. it seems since update @published has same effect @observable . missing something? the @published attribute still allows use value attribute in html declaratively. can still do: <my-element myprop="{{hello}}"></my-element> the change accessing values procedurally via attributes property, must include @publishedproperty(reflect: true) . (this not seem case if you're interactive customtag class directly. needs @publishedproperty(reflect: true) : var x = queryselector('x-foo'); x.bar = "hi"; // ... print(x.attributes["bar"]); this needs @publishedproperty(reflect: true) : /* css */ x-foo[bar="hi"] { background-color: blue; } this not: xfoo x = queryselector('x-foo'); x.bar = "hi...

javascript - Angular-ui bootstrap don't work correctly with templates -

i use angular-ui-bootstrap popover. manually changed template of popover support html in it. changed ng-bind ng-bind-html: <div class=\"popover-content\" ng-bind-html=\"content\"></div> i'm passing such template popover attribute: <span ng-click="scopefunction()">{{somethingfromscope}}</span> so {{somethingfromscope}} resolves , works, ng-click function doesn't work. ng-show , ng-if (looks ng- directive) don't work well. what's reason of it? how can make work? thanks just changing template not enough update module dependencies this: angular.module('ui.bootstrap.popover', ['ui.bootstrap.tooltip', 'ui.bootstrap.bindhtml']) and change template <div class="popover-content" bind-html-unsafe="content"></div> works angular.ui.bootstrap v0.11.0 2014-05-01

Google compute engine .NET API examples/samples/tutorials -

i haven't been able find explain how use google compute engine through .net api (specifically c#). there can point me anything? p.s. know api reference ( https://developers.google.com/resources/api-libraries/documentation/compute/v1/csharp/latest/annotated.html ) i not find detailed tutorial code samples, official documentation available @ [1] includes code sample. there tutorial c# sample specific google drive @ [2]. for reference apis documentation available @ [3] , annotated library reference available @ [4]. link: [1] - https://developers.google.com/api-client-library/dotnet/get_started#examples [2] - http://conficient.wordpress.com/2014/06/18/using-google-drive-api-with-c-part-1/ [3] - https://developers.google.com/compute/docs/reference/latest/ [4] - https://developers.google.com/resources/api-libraries/documentation/compute/v1/csharp/latest/annotated.html

oracle - Connect to External WebDAV with PL/SQL -

does have resources/advice on how connect third party webdav pl/sql? placing file onto server , retrieving log file. simple using utl_http & 'put'? examples appreciated. thanks. so after further research, decided use pl/sql generate file , curl transfer file external server.

Which web framework is being used in doit.im? -

i'm curious know web framework being used in these list websites: http://www.doit.im , http://www.nirvanahq.com (i'm referring to list functionality available after login site - not webpages see when browsing site...) the user interface elements similar suggesting same web framework. i know little web frameworks, experience in domain, answer may simple. :) thanks. doit.im (which use) appears use angular. open console , type angular see global variable; main app registered , can retrieved running angular.module ('[insert name]'). nirvana, see bunch of jquery , variables stored in nirv.

haskell - Mapping a function on chained pairs of elements from a list -

i want map function on chained pairs of elements list. consider list: a = [1,2,3,4,5] by using e.g. function f a1 a2 = a1 < a2 , want get: [true,true,true,true] the following seems work in general: zipwith f (tail a) however, find kind of hackish. there more appropriate way, maybe using fold? i think can speak on behalf of haskell community if tell that the idiomatic way of doing in haskell. hack using fold not readable first variant: f p xs = snd $ foldl (\acc x -> (x, snd acc ++ [p (fst acc) x])) (head xs, []) (tail xs) thank @willness supplying more readable version of above's function, although still not beat zipwith in brevity , clarity. f p = foldr g [] . tails g (x:y:_) r = p x y:r; g _ _ = [] this hackish. problem using fold in situation elements dealt separately , not "know" neighbours. values know accumulator , own. in example, doing f (<) [1,2,3,4,5] check if left element of pair smaller 1 before, way less rea...

python - None in pandas dataframe index -

i'm reading sql query dataframe , utilizing 1 of columns index of dataframe. problem query did not filter nulls , resulting dataframe has rows in index none. can think of several ways fix this, wondering if pandas code existed took care of like: import pandas pd pd.index().dropna() i know doesn't work :-) tried already. there else? i hold off on setting index until after you've dropped na values: cnn = get_db_connection() sqlqry = "select * table" nacols = ['col_with_nas'] indexcols = ['col_with_nas', 'othercol1', 'othercol2'] df = pandas.read_sql(sqlqry, cnn).dropna(subset=nacols).set_index(indexcols)

css - Jquery Animation behavior -

say have 4 divs want animate. 1st div shows fish, 2nd div shows box, 3rd fish shows locker , 4th div shows top of box. have achieved far animate div follows: the fish goes right left until comes same vertical level box, fish animated towards box, box top closes , locker appears. animations proceeds scroll mouse. this code: var fish_animation = $(".fish-animation"); var boxtop_animation = $(".boxtop-animation"); var locker_animation = $(".locker-animation"); if(height == 100){ fish_animation.css({ right:'120px'}, { duration: 100, easing: 'easeinsine'}); } else if (height == 200) { fish_animation.css({right:'230px'}, { duration: 100, easing: 'easeinsine'}); } else if (height == 300) { fish_animation.css({right:'340px'}, { duration: 100, easing: 'easeinsine'}); } else if (height == 400) { fish_animation.css({right:'450px'}, { duration: 100, easing: ...

java - @Column insertable, updateble don't go well with Spring JPA? -

scenario : have 3 tables, offer, channel , offer_channels. channel lookup table, i.e, values in table can neither inserted nor updated application. offer can contain 1 or many channels. use channel table values populate dynamic checkboxes. anyways, here have : @entity @table(name = "offer") @cache(usage = cacheconcurrencystrategy.nonstrict_read_write) public class offer implements serializable { // offer id @id @generatedvalue(strategy = generationtype.auto, generator = "offer_seq_gen") @column(name = "offer_id") private long offerid; @manytomany(cascade = cascadetype.all) @jointable(name = "offer_channels", joincolumns = { @joincolumn(name = "offer_id") }, inversejoincolumns = { @joincolumn(name = "channel_id") }) private set<channel> channels = new hashset<channel>(); //other fields , corresponding getters , setters } here channel entity : @entity @table(...

xml - The return type of <xsl:variable name="pubDate" select="publicationDate" />, a node-set or a string? -

i new xsl , using version 1.0 here xml source <?xml version="1.0"?> <catalog> <cd> <title>empire burlesque</title> <artist>bob dylan</artist> <company>columbia</company> <publicationdate>03/31/1985</publicationdate> </cd> </catalog> from above xml content, set varialbe in xsl code by <xsl:variable name="pubdate" select="//publicationdate" /> i thought variable 'pubdate' should contain node-set because of '//publicationdate' realized possible apply string function such substring($pubdate, 1, 4) hints 'pubdate' string. is automatic type cast or else? in xslt 1.0 $pubdate node-set. if reference in function expects string value parameter, use string value of first node in node set. say, text value of node , descendant nodes. if first node looked this: <publicationdate><mm>03...

WPF Accessing subitems in a ListView/GridView -

i'm attempting access listview subitem. have insert columns listview/gridview dynamically program accesses multiple databases different value types. if need be can portion out database searching multiple tabs, ease of use, i'd rather not take route. i've been searching 3-4 days solution. class organizes subitems data oledb query. here snippet of code i'm using: public class repair { public string rp { get; set; } public string sn { get; set; } public datetime rec { get; set; } public datetime start { get; set; } public string cust { get; set; } public string sp { get; set; } public string tech { get; set; } public string status { get; set; } public string model { get; set; } public string notes { get; set; } public datetime accused { get; set; } public string accnotes { get; set; } public int id { get; set; } } public ilist<repair> openr...

dependencies - ruby on rails - are there any packages or modules that are not written in pure ruby? -

i new ruby on rails. heard ruby on rails needs java virtual machine run. i ask basic stuff ruby on rails. it seems ruby on rails can have native code in source code. from have researched ruby on rails, code runnable on same platform code written. so when need run code on different platform, using bundler ( rubygems ), can automatically download right version of package. is correct?? also, packages, there packages or modules not written in pure ruby?? i not sure if there any. if there is, think package manager cannot automatically download right version , developers need pull out , make changes deploy on other machines. i wasn't sure how @ package dependencies in package. there way find package dependency?? it not clear question asking perhaps can resolve of confusion. rails framework, distributed ruby gem package runs part of ruby app on 1 of several available ruby interpreters. neither ruby nor rails depend on jvm. jruby interpreter allows run rub...

c++ - Sending list of connected users to newly connected user in multithreaded iocp server -

i need advice how send doubly linked list of connected users. basic information code , approach far: i keep information connected users in doubly linked list, shared among threads. store head of list in global variable : *pper_user g_userslist , , struct users like: typedef struct _user { char id; char status; struct _user *pctxtback; struct _user *pctxtforward; } user, *pper_user; when new user connects server, data connected users gathered linked list , send him: wsabuf wsabuf; pper_player ptemp1, ptemp2; unsigned int c=0; ..... entercriticalsection(&g_csuserslist); ptemp1 = g_userslist; while( ptemp1 ) { ptemp2 = ptemp1->pctxtback; wsabuf.buf[c++]=ptemp1->id; // fill buffer data users wsabuf.buf[c++]=ptemp1->status; // ptemp1 = ptemp2; }; wsasend(...,wsabuf,...); leavecriticalsection(&g_csuserslist); but few things code above makes me confused: the linked list rather under heavily usage other threads...

Lucene.net limitations on the index files with large data -

we planning use lucene.net search in order have google search. have huge amount of data loaded d/b needs indexed. there limitations on size of indexing documents , maximum size of single index document be? how distribute size on average size of each document? there no limitations data sizes you're hinting at, i'm running lucene.net app works 100s of gb of indexed data without spliting index (outside of how lucene naturally splits without asking). just add data index , forget limitations, you're way bellow potential issues. (but read performance guidelines, lucene ones lucene.net direct port, tips apply).

Need a information with respect to framework in Selenium -

i new selenium , using selenium webdriver automate current project, , have query possible write or combine keyword driven framework , testng framework using selenium webdriver ( java) if yes can please me how can approach. if no ,how can validate if test have been executed i.e passed or failed. please can me query. well, sounds want use jbehave keyword framework. then, use testng test runner , report generator. alternative , use testng fitnesse, produces nice reports.

How do I validate that either one field or another is filled out in Ruby on Rails? -

i have contact information. user needs fill out @ least 1 of 3 fields, fields being email address, mailing address, or phone number. how in ruby on rails? while justin shows may fine, rails provide formal scheme doing type of thing. allows create custom validator of predefined validators. see " validates_with " more details, here example rails guide: class goodnessvalidator < activemodel::validator def validate(record) if record.first_name == "evil" record.errors[:base] << "this person evil" end end end class person < activerecord::base validates_with goodnessvalidator end

starting jboss server through eclipse -

i new eclipse , jboss application development. trying start jboss server eclipse. steps carried out : i installed boss 4 plugins on eclipse kepler i configured new->server jboss jre7 but when click start server gives me exception list : exception if start server running standalone.bat, runs successfully. why not run in eclipse? any suggestion? thanks in advance. you eclipse should opened in admnistrator mode . more information

c# - error when converting linq lambda query to list -

i trying query data using linq, joining 2 tables id == id of second table. getting exception error saying cannot implicitly convert type ' system.collections.generic.list<anonymoustype#1> ' ' system.collections.generic.list<--db table here--> '. var qry = context.projects .join(context.members, p => p.id, m => m.id, (p, m) => new { p, m }) .where(u => u.m.id == memid) .select(b => new { b.p.projname, b.p.projdesc, b.p.projecttype, b.p.tags }); return qry.tolist(); you trying return list of anonymous type method return type list<sometype> . so instead of creating anonymous objects need create objects of type. .select(b => new sometype { // set properties here });

regex - iOS Regular Expression Understanding -

recently use nsregularexpression me parse website's source. i found example expression @"(.*?)(<[^>]+>|\\z)" . kind people me out meaning of pattern? (.*?)(<[^>]+>|\z) - first part (.*?) non-greedy way of consuming characters, or in other words, consume minimum possible number of characters until reach next part: (<[^>]+>|\z) . (<[^>]+>|\z) - here have 2 parts, first part <[^>]+> - match expression starts < , has @ least 1 character before closing > . [^>] means character except > , + means number of characters >= 1. the | "or" - means matching group should match either first part <[^>]+> or second part \z means end of string.

python - Cannot send and receive udp message in same program -

i able send , receive udp messages in separate programs, i'm not able same task in 1 program. import socket udp_ip = "192.168.1.178" udp_port = 8888 msg = 'test' print "udp target ip: ", udp_ip print "udp target port: ", udp_port print "message: ", msg sock = socket.socket(socket.af_inet, socket.sock_dgram) sock.sendto(msg, (udp_ip, udp_port)) udp_ip2 = "192.168.1.198" sock.bind((udp_ip2, udp_port)) while true: data, addr = sock.recvfrom(1024) # buffer size 1024 bytes print "received message:", data with program, able send udp messages, however, not able receive messages other machine. what doing wrong? in advance, mikkel in example try bind socket addr after sending, what's wrong. address can bound socket before data transfer. if there no explicit bind os sets free (unused) port number in range [1024, 65535] on first .send()/.recv() call. next, socket can bound singl...

python - Function which executes when the date changes -

i need function execute every time date changes. i'm checking in loop see if date changed, i'm looking more effective method....in python any appreciated what want schedule function run @ time. need scheduling mechanism. could, of course, write 1 yourself, best way go use library you. apscheduler mature library sort of thing. docs: http://apscheduler.readthedocs.org/en/latest/ pypi: https://pypi.python.org/pypi/apscheduler/3.0.0 example here quick little example from apscheduler.schedulers.background import blockingscheduler scheduler = blockingscheduler() @scheduler.scheduled_job('interval', seconds=5, timezone='utc') def hello(): print('hello!') scheduler.start() this run function hello every 5 seconds. can change seconds=5 days=1 have run once day. there much more configuration can do, you'll want read documentation. able express date time format want, including cron . it supports different types of sch...