Posts

Showing posts from February, 2011

How to get Spring rest API response in java code? -

i done spring rest api .that returning json data want call api in system(remote ip) .how response in java code or rest template. {[ { "deviceid": 1, "userid": "100", "username": "jee", "date": "2016-09-19 00:00:00.000" }, . . . n ]} how read in java using rest template . what want consuming rest api in java. this should started.

python leading and trailing underscores in user defined functions -

how can used rt function, understand leading & trailing underscores __and__() available native python objects or wan't customize behavior in specific situations. how can user take advantages of . ex: in below code can use function @ all, class a(object): def __rt__(self,r): return "yes special functions" a=a() print dir(a) print a.rt('1') # attributeerror: 'a' object has no attribute 'rt' but class room(object): def __init__(self): self.people = [] def add(self, person): self.people.append(person) def __len__(self): return len(self.people) room = room() room.add("igor") print len(room) #prints 1 python doesn't translate 1 name another. specific operations under covers call __special_method__ if has been defined. example, __and__ method called python hook & operator, because python interpreter explicitly looks method , documented how should used. in other words,

How to upload video to vimeo from my android app? Is there any new library to implement that right now? -

now, i'm developing android app uploads video vimeo android app. i'm new @ vimeo integration. me implement that. is there new library(sample code or github) satisfy right now? if there's help, helpful. thanks. the short answer there no official upload library (but we're working on one), , in mean time you'll have implement own following api documentation here . there's networking library offer may provide models models upload api using (like video , user object). there several posts on stack overflow may help. here one .

sql - Joining WIP_DISCRETE_JOBS to a Bill Of Materials table -

i have sql query in trying fetch items along components have bill of materials (bom) enabled , creation date withing last 3 years. problem every item along component list gets repeated. suppose item has 5 components, , query particular item number. 35 rows (7 repetitions of sets of 5 components). however, if query particular wip_entity_name or if use distinct, perfect 5 rows of data. need data (5 rows, no repetitions) when query particular item number. here query: select * bom_bill_of_materials bom, bom_inventory_components bic, bom_components_b bcb, bom_operational_routings_v borv, bom_operation_sequences_v bosv, bom_structures_b bsb, bom_structure_types_b bst, mtl_system_items_b msi, mtl_system_items_tl msit, org_organization_definitions ood, wip_discrete_jobs_v wdjv bom.bill_sequence_id = bic.bill_sequence_id , bic.component_sequence_id = bcb.component_sequence_id , bcb.bill_sequence_id = bsb.bill_sequence_id , bom.structure_type_id = bst.struct

rename - Update sys.servers after renaming SQL Server Host -

i'm upgrade sql server 2012 instance sql server 2014. i've cloned host windows vm , renamed foo-2012 foo-2014 . on restart, sql server instance noticed updated own name, can log foo-2014 . good. unfortunately (single) entry in sys.servers still foo-2012 means running select * [foo-2012].[bardb].[dbo].tfoobartable fails with: could not find server 'rw-db-2014' in sys.servers. verify correct server name specified. if necessary, execute stored procedure sp_addlinkedserver add server sys.servers. fine. i run exec sp_addlinkedserver 'foo-2014', 'sql server' , entry. but new entry has islinked=1 (whereas existing entry has islinked=0 ). documentation indicates setting important (especially app has strong opinions on distr.trans. :( ) i can't edit/add to/modify sys.servers directly. attempt gives: ad hoc updates system catalogs not allowed. i remove new entry ( exec sp_dropserver 'foo-2014' ) succeeds, , t

java - How do I run an imported Spring project in IntelliJ -

i've imported spring project eclipse runs perfectly. when go run/debug configurations , asks me choose main class don't know choose there lot. with eclipse right clicked project , selected run on server, selected wildfly 10 , ran on localhost:8080 seems little more complicated here. how run project? try selecting jboss. jboss renamed wildfly. not sure why it's still jboss in intellij. can add server using run > edit configurations > + . choose jboss in list. https://www.jetbrains.com/help/idea/2016.2/working-with-server-run-debug-configurations.html

Nativescript Angular - Could not find support-v4.jar -

Image
i running sample groceries example of nativescript angular , typescript. followed steps http://docs.nativescript.org/angular/tutorial/ng-chapter-1#11-install-nativescript-and-configure-your-environment i getting error. failure: build failed exception. * went wrong: a problem occurred configuring root project 'groceries'. could not find support-v4.jar (com.android.support:support-v4:24.1.1). searched in following locations: https://jcenter.bintray.com/com/android/support/support-v4/24.1.1/support-v4-24.1.1.jar here output of $tns run android --justlaunch --log trace execfile: /home/charan/android/sdk/platform-tools/adb "help" execfile: /home/charan/android/sdk/platform-tools/adb "help" spawn: /home/charan/android/sdk/platform-tools/adb "--help" socket { _connecting: false, _haderror: false, _handle: pipe { _externalstream: {}, fd: 13, writequeuesize: 0, owner: [circular],

ios - Cordova: White bar at bottom when I return from file chooser/Picker -

Image
file picker opens , closes after closed, brings white bar @ bottom of screen , each time file picker opened , closed, grows above shrinks height of screen. [ i found answer after 2days of research. replace 'viewbounds' '[self.view bounds]' instead of '[self.webview bounds]' in viewwillappear in mainviewcontroller.m if phonegap/cordova app displays other native views (like file picker, camera capture dialog, picture album) , returns view. fix initialize 'view bounds' instead of 'webview bounds'.

Scan uploaded files C# ASP.net -

i'm trying virus scan on uploaded files. have no control on installed virus scanner, product hosted multiple parties different scanners. i tried following library returns virusnotfound on eicar file. https://antivirusscanner.codeplex.com/ do know other solutions? i used library .net (it uses virustotal public api): https://github.com/genbox/virustotal.net a little example github : static void main(string[] args) { virustotal virustotal = new virustotal("insert api key here"); //use https instead of http virustotal.usetls = true; fileinfo fileinfo = new fileinfo("testfile.txt"); //create new file file.writealltext(fileinfo.fullname, "this test file!"); //check if file has been scanned before. report filereport = virustotal.getfilereport(fileinfo).first(); bool hasfilebeenscannedbefore = filereport.responsecode == 1; if (hasfilebeenscannedbefore) { console.writeline(filerepo

What is best approach to validate a Java bean against custom validation rules? -

public class user { private string name; private integer age; public string getname() { return this.name; } public void setname(string name) { this.name = name; } public integer getage() { return this.age; } public void setage(integer age) { this.age = age; } } here want validate these fields using custom rule set defined in database each field. e.g. validate length of name field - length validation can different different companies. scenario : company x, max length of name field can 20. company y, max length of name field can 30. how apply validation criteria runtime? see link, bean validation you can find below link full example. http://howtodoinjava.com/spring/spring-mvc/spring-bean-validation-example-with-jsr-303-annotations/

c# - Mapster Adpat not working -

i`m trying make select in form-control. <div class="form-row form-row-wide"> <div class="col-sm-3"> <select asp-for="estadoid" class="form-control input-text" required="required" placeholder="estado"></select> <span asp-validation-for="estadoid" class="text-danger"></span> </div> <div class="col-sm-9"> <select asp-for="cidadeid" class="form-control input-text" required></select> <span asp-validation-for="cidadeid" class="text-danger"></span> </div> </div> but adapt not getting element`s. controller. public async task<jsonresult> get(select2request param) { try { var pagedresults = await _service.getallbypageasync(w => w.nome.like(param.q),

sql server - How do I get employee details if they are earning more than their paylevel? -

i have database employees , employees has paylevel according experience (calculated hire date) earn higher because of previous experience. have 2 tables employee table (details employee including paylevel number) , paylevel table (details of pay level) years of experience calculated. question employees earning more paylevel says earn. connected view. select accountant_name, hire_date, pay_level_name, 'pay_level_no' convert (int,experience_in_years) 'xp in years' accountant_view; so how see whether pay level of each employee matches salary of specific pay level number (salary in paylevel table) not sure whether asking in right way appreciated. create table paylevel (paylevel_no smallint identity (1,1), paylevel_name varchar (25) not null, annual_pay money not null, min_experience char (3) not null, constraint paylevel_pk primary key (paylevel_no) ); go create table accountant (accountant_id int not null identity (01, 1), branch_id smallint not null, payleve

linux - Java code to run a shell script which in turn runs another script -

i have gone through various similar questions asked in forum or in web in general none matched situation explained below. need run shell script java. below code: in $home_folder run #!/bin/sh ----- various commands ----- java com.test.web.restapplication --server.port=9090 start.sh #!/bin/sh cd $home_folder nohup ./run & stop.sh #!/bin/sh pkill -f restapiapplication cd $home_folder rm -fr nohup.out in other folder runshellscript.java public class runshellscript { public static void main(string[] args) { string envar = system.getenv("home_folder"); string command = ""; string option = args[0]; switch(option){ case "start": command += envar+"/start.sh"; break; case "stop": command += envar+"/stop.sh"; } try{ processbuilder pb =

c++ - Meaning of asterisk following a member function -

this question has answer here: what function of asterisk before function name? 4 answers i new c++ , trying decode piece of code shown below. in particular basesetassoc::blktype* line, not sure asterisk means in case. appreciate insight. basesetassoc::blktype* nmru::accessblock(addr addr, bool is_secure, cycles &lat, int master_id) { // accesses based on parent class, no need special blktype *blk = basesetassoc::accessblock(addr, is_secure, lat, master_id); if (blk != null) { // move block head of mru list sets[blk->set].movetohead(blk); dprintf(cacherepl, "set %x: moving blk %x (%s) mru\n", blk->set, regenerateblkaddr(blk->tag, blk->set), is_secure ? "s" : "ns"); } return blk; } blktype isn't member function, it's type, pos

android - Robolectric 2 with JNI -

in app stared using external library uses jni. system.loadlibrary("somelib") also have unitests robolectric 2 . when i'm running these tests i'm getting following exception: java.lang.unsatisfiedlinkerror: no dafprovider in java.library.path how configure robolectric load native library? note: i'm using maven unfortunately, robolectric doesn't work jni. suggestion wrap jni library loading class , mock under test, or override jni method loading in test: public class myapp extends application { public void oncreate() { loadjni(); } protected void loadjni() { system.loadlibrary("somelib"); } } in tests: public class testmyapp extends myapp { @override protected void loadjni() { //don't } }

php - How can I get Gedmo\Timestampable to keep updated_at null on first create? -

i've got symfony 2.8 app uses gedmo\timestampable annotations automatic created_at , updated_at operations, seems putting same timestamp updated_at column when entity/row first created. update cause updated_at column show newer timestamp, want blank begin with. my understanding on insert , created_at column should populated timestamp , updated_at should stay blank, because hasn't been updated such. after first update of column should value of updating time. am correct in expecting this? there wrong code/config? or annotation set values both columns design? my config.yml : ... stof_doctrine_extensions: default_locale: "%locale%" translation_fallback: true orm: default: translatable: true timestampable: true ... my entity: ... /** * automatic timestamp of creation. * * @var \datetime $createdat * @gedmo\timestampable(on="create") * @orm\column(name="created_at", type="datet

Windows timers - how do they work? -

i know until windows 7 standard kernel ticks each 15.6 ms, , can modified using timebeginperiod , timeendperiod. win 8 kernel apparently made tickless. but information can not infer on how timers work. can imagine, there routine checking every 15.6 ms (or whatever current resolution is, , win8+, idk) within sorted list containing active timers' desired notification times, expressed in ms elapsed since system start. need check first few timers (until finds timer not ready yet) notify correct client, und re-insert list @ proper position next timing event. this conceptionally, folks @ ms surely pondered longer time me, can not find information it. (maybe there little man sitting in kernel doing task?) so, if knows how gets done, appreciate explanation. links welcome. thanks time!

c# - Unable to bind JSON object with WCF REST service -

am trying create w rest service using wcf cater particular use case way structured makes unable bind. structure follows: { "1387213536":{ "ext_id":"1", "unit_id":"0", "currency":"eur", "login_hash": "" }, "1387213537":{ "ext_id":"1", "unit_id":"0", "currency":"eur", "login_hash": "" } } does have idea type of object translate to? tried create dictionary<string, dictionary<string, string>> but still fails bind. thanks in advance

javascript - Angular ui-sortable not working on mobile devices -

i'm working on angularjs app contains tests. in of them have list user has order correctly dragging , dropping. i'm using angular-ui-sortable accomplish that. on pc , laptop works perfectly. problems arrives when user on mobile devicesit's, stops working. i imagine conflicts vertical scroll on phones, or totally wrong? , has encountered issue , has come solution? or might point me in right direction appreciate it. html (my html if needed) <ul ui-sortable ng-model="sequence" class="list-group list-group-lg list-group-sp"> <li ng-repeat="choice in choices" class="list-group-item" draggable="true"> <h5>{{choice.name}}</h5> </li> </ul>

how javascript excutes callback with parameters -

i in trouble javascript‘s callback,my code seems simple: var =0; (; < listsize+1; i++) { var content = "content"+i; $("#" + content).focus(function () { $("#" + content).keydown(check(new number(i))); $("#" + content).keyup(check(new number(i))); }); } where lisetsize=3 in test case , content html element's id and callback function check(my_num) is: function check(my_num) { var content = "content"+my_num; } then try trigger function through keyboard input. however,i got result content=content4 time via broswer's debugger,even though listening element content0 i have try anyway such $.extend({},i) $.extend(true,{},i) it make no difference now have no idea problem,how can pass value no reference callback function's parameter? you're not declaring handlers correct

php - How to add the html tag into codeigniter variable? -

i using following code display table row $tablerow="<tr> <td style='text-align:center'>".$services[$i]['servicename']."</td> <td style='text-align:center'>".$services[$i]['servicedesc']."</td> <td style='text-align:right'>".$services[$i]['taxamt']."</td> </tr>"; but value display.i got following out test tset 43500 i want these <tr> <td style='text-align:center'>test</td> <td style='text-align:center'>tset</td> <td style='text-align:right'>43500</td> </tr> you can use php function display value $tablerow="<tr> <td style='text-align:center'>".$services[$i]['servicename']."</td> <td style='text-align:center'>".$servic

asp.net mvc - Modify the key/value pair of a ModelState MVC attribute -

is there way modify key of modelstate attribute? receive following json response: {"message":"the request invalid.", "modelstate": { "supplier.supplierwarehouses[2].location":["location name long, maximum 50 characters"] } } i want modify supplier.supplierwarehouses[2].location more simple supplierlocation . is there way directly in model? current model is: public class supplierwarehousemetadata { [stringlength(50,errormessage="location name long, maximum 50 characters")] public string location { get; set; } } no, because isn't modelstate . post value has name because that's modelbinder needs in order bind correctly appropriate property on model on post. if modify name, value no longer bind. that said, goal here anyways? if you're concerned what's coming in json, return custom instead of dumping modelstate .

amazon web services - Can't attach 2nd interface to ec2 instance -

i've got 2 instances running nicely web - t2.medium - us-east-1d - private ip - 10.1.1.6 vpn - t2.micro - us-east-1d - eip assigned i'm trying add 2nd interface onto vpn server within 10.1.1.0/24 network. after create interface can't attach vpn. web instance shows attach that's on internal network. how can 2nd interface within 10.1.1.0/24 network onto vpn server? vpc setup: internal: cidr - 10.1.1.0/24 - us-east-1d (web server) vpn: cidr - 192.168.247.0/24 - us-east-1d (vpn server) i've tried manage priv ip addresses on vpn server see if assign internal comes with: "ip address not in subnet" i need vpn server have 2 network interfaces: 1 public , 1 private/internal. it looks you're trying assign ip isn't in subnet range. if instance in subnet-foo , subnet-foo us-east-1a 10.1.1.0/24 should work. fail instance if tried attach nic ip 10.0.1.6 in example. error message pretty specific ip address not i

ssl - NSIS powershell freezes installer -

i nedd add ssl certificate https binding in iis inside nsis installer. inside powershell command works perfectly: get-childitem -path cert:\localmachine\my | where-object {$_.subject -eq 'cn=win2012'} | new-item 0.0.0.0!44334 but nsis installer freezes when reach script. i've tryed diffrent execution methods: 1) discribed in article ${powershellexec} "get-childitem -path cert:\localmachine\my | where-object {$_.subject -eq 'cn=win2012'} | new-item 0.0.0.0!44334" 2) nsexec::exectostack 'powershell -command "get-childitem -path cert:\localmachine\my | where-object {$_.subject -eq \"cn=win2012\"} | new-item 0.0.0.0!44334"' where problem? other powershell scripts works great.

ruby on rails - No route matches [GET] -

i'm trying add 'add cart' method items. items_controller: def to_cart @item = item.friendly.find(params[:id]) @item.add_to_cart redirect_to root_path end routes: resources :items put :to_cart, on: :member end model: def add_to_cart current_user.cart.items << self current_user.cart.save end show: <%= @item.name %> <%= link_to 'add cart', to_cart_item_path(@item) %> i got routingerror: no route matches [get] "/items/first/to_cart" 'first' because of friendly id. did wrong? add method: :put in link default it's get , rails trying find route get method <%= link_to 'add cart', to_cart_item_path(@item), method: :put %>

sql - Exclusive IF Statement in WHERE clause -

i have following initial query. select * table datum1 < @datum2 , employee_name = employee_name but want filter datum1 < datum2 if employee member of group students. non student employees not want filter datum1 < @datum2 . my first idea select * table case when datum1 < @datum2 end , employee_name = employee_name but not working. have checked other solutions refering where clause in sql if statement of them take care of problems have eiter or decision if student datum1 < @datum2 else datum2 < @datum2 . want statement not considered @ if condition true. can me here? you can or statement, accounting both of scenarios. i'm assuming there's field called employee_group wasn't mentioned in question, should point in right direction: select * table employee_group <> 'students' or ( employee_group = 'students' , datum1 < @datum2 ) , employee_name = @employee_name

c# - Filtering database search with multiple textboxes with LINQ lambda in MVC .NET -

i have created modified mvc template handling crud operations reports. trying accomplish filtering reports based on multiple inputs. have managed create basic search function can search every column in database (except date still havent figured out), want 3 textboxes, each representing own column, filtering rows. 1 column identifying report, 1 date (maybe 2 can search between dates), , 1 customer. this code in controller: public actionresult avvik(string searchawb, string searchmottaker) { var rapports = db.rapports.include(r => r.Ã…rsak); if (!string.isnullorempty(searchawb)) { rapports = rapports.where(r => r.awb.contains(searchawb)); } else if (!string.isnullorempty(searchmottaker)) { rapports = rapports.where(r => r.mottaker.contains(searchmottaker)); } return view("rapporter/avvik", rapports.tolist()); } and of code in view: @html.actionlink("back ad

php - Count how many projects are in the projects table -

i trying count how many projects have in projects table. code gets count of project specific id. i want count on all projects exist in table. controller code: public function countprojects() { $count = projects::where('id','0')->count(); return view('projects.test')->with('count', $count); } you should able remove where. $count = projects::count(); the where() builder method returns $this after attaching criteria, in order allow method chaining. if eliminate it, still calling count() on model.

How to debug Service Fabric stateful service / actor state -

i implemented basic service fabric statefulservice stores questionnaire data using ireliablestatemanager . in order debug method, need view statemanager data using sort of browser or administration console. doesn't seem possible using service fabric explorer. how can done? you have expose apis allow reading of data , create viewer part of application. there no generic way today.

javascript - How to return the response from an asynchronous call? -

i have function foo makes ajax request. how can return response foo ? i tried return value success callback assigning response local variable inside function , return one, none of ways return response. function foo() { var result; $.ajax({ url: '...', success: function(response) { result = response; // return response; // <- tried 1 } }); return result; } var result = foo(); // ends being `undefined`. -> more general explanation of async behavior different examples, please see why variable unaltered after modify inside of function? - asynchronous code reference -> if understand problem, skip possible solutions below. the problem the a in ajax stands asynchronous . means sending request (or rather receiving response) taken out of normal execution flow. in example, $.ajax returns , next statement, return result; , executed before function passed success callback

javascript - Ajax Post request example -

i wondering if me simple ajax request example can wrap head around whole idea. tried testing ajax request search word "rails" on github. code looks this: $.ajax({ url: 'www.github.com', type: 'post', contenttype: 'application/x-www-form-urlencoded', data: { q: 'rails' }, success: function(data) { console.log(data); } }); this request responding 404 response. so, i'm curious how supposed know key names "data" element should be? when inspected search bar on github, told me name of element q. hence why used key "q" , wanted search "rails". if me example or perhaps provide better 1 appreciated. thanks! try add http in url, but, security reason can't ajax crossdomain request without autorisation of github.com domain in case. http://api.jquery.com/jquery.ajax/

Programmable arguments in perl pipes -

i'm gradually working way perl learning curve (with contributors helpful site), struggling how approach particular issue. i'm building perl utility utilises 3 (c++) third party programmes. these run: $file_list | b -args | c $file_out where process reads multiple files, process b modifies each individual file , process c collects input files in pipe , produces single output file, null input file signifying end of input stream. the input files large(ish) @ around 100mb , around 10 in number. processes cpu intensive , whole process need applied thousands of groups of files each day, simple solution of reading , writing intermediate files disk inefficient. in addition, process above part of processing sequence, input files in memory , output file needs in memory further processing. there number of solutions documented , have prototype version utilising ipc::open3(). far, good. :) however - when piping each file process through process b i need modify arguments in pr

access callback response data from Ajax using Javascript Revealing Prototype Pattern -

i trying structurise js code using revealing prototype pattern. my basic usecase is: create different types of entities person, technology. each entity has own tags. in order these tags make ajax call returns object of tags. want access object in implementation. not sure how in right way. my attempt follows: var entity= function (url) { this.url = url; /*variable can shared instances*/ var entitytags; }; entity.prototype = function () { var create = function (type, values) { //code creating } var update = function (type, values) {} var tags = function () { ajaxcall(' ', this.url, {data:data}, 'callbackaftergettags', ''); callbackaftergettags=function(responsefromajax) { entitytags=responsefromajax.tagsreturned; //how access entitytags in implementation } }; return { createentity: create, gettagsentity: tags }; my implementation var myentity = new entity(url); myentity.gettagsentity(); ajax cal

python - Robotframework: Clicking web-elemnt in loop often fails to find an element -

i have created keyword rf , selenium2library. supposed wait element clicking periodically on other element renew area element supposed appear. use example waiting mails in postbox. the problem pretty "renew element" cannot found , clicked on loop iteration exists on screenshot. ideas why can happen? def check_if_element_appeared(self, element_locator, renew_locator, renew_interval=10, wait_interval=300): if not self.is_visible(renew_locator): raise assertionerror("error message") start_time=int(time()) scan_time = start_time if not self.is_visible(element_locator): while int(time())<=start_time+wait_interval: if int(time()) >= scan_time + renew_interval: scan_time = int(time()) self.click_element(renew_locator) if self.is_visible(element_locator): break if not self.is_visible(element_locator): raise assertionerror(

Best way to use variables that contain lists in Oracle SQL -

i have around 5 long sql queries , replace of values variables, can enter them directly in script @ top (no pop ups). what best way achieve (and comes part makes question not duplicate), can have variables lists. example here how queries should differ between configuration 1 , 2: where trd_src_sys ='blabla1' trd_src_sys ='blabla223' select 'blabla1- new' rec_system, select 'blabla223- new' rec_system, trd_src_sys in ('mag','llelle') trd_src_sys ='ma' independent of set date in 1 place, don't have change everywhere occurs in query. (but believe explained in other posts) any suggestions appreciated. you can use substitution variables like: define sys_list = "'mag','llelle'" then write query like: ... trd_src_sys in (&sys_list.) it resolve to: ... trd_src_sys in ('mag','llelle') when need 1 value: define sys_list = "'ma'"

javascript - Bind events in iframe content even when change url -

i'm trying bind envent when form submitted inside iframe, i'm having problems: first attempt: i tried bind envent when page loads, worked, event binded when page loads entirely. $('#mainframe').on("load", function() { $('#mainframe').contents().find('form').submit(function(){ $('#overlay').addclass("overlay"); }); }); then tried use ready event $('#mainframe').ready(function() { $('#mainframe').contents().find('form').submit(function(){ $('#overlay').addclass("overlay"); }); }); but isn't called when url changed. second attempt: i tried bind event on every input inside iframe, think can't access iframe elements without .contents() $('#mainframe').on("click", 'input',function(){ $('#overlay').addclass("overlay"); }); ps: iframe page same domain someone can me, p

thread safety - Python: Deadlock of a single lock in multiprocessing -

i'm using pyserial acquire data multiprocessing. way share data simple. so: i have member objects in class: self.mpmanager = mp.manager() self.shared_return_list = self.mpmanager.list() self.shared_result_lock = mp.lock() i call multiprocessing process way: process = mp.process(target=do_my_stuff, args=(self.shared_stopped, self.shared_return_list, self.shared_result_lock) ) where do_my_stuff global function. now part fills list in process function: if len(acqbuffer) > acquisitionspecs["lengthtopass"]: shared_lock.acquire() shared_return_list.extend(acqbuffer) del acqbuffer[:] shared_lock.release() and part takes local thread use is: while len(self.acqbuffer) <= 0 , (not self.stopped): #copy list shared buffer , empty self.shared_result_lock.acquire() self.acqbuffer.extend(self.shared_return_list) del self.shared_return_list[:] self.shared_result_lock.release() the problem : although there's 1 lock,

Riak MapReduce in single node using javascript and python -

i want perform mapreduce job on data in riak db using javascript. stuck in begining, couldnot understand how returning value. client = riak.riakclient() query = client.add('user') query.map(""" function(v){ var i=0; i++; return [i]; } """) result in query.run(): print "%s" % (result); for simplicity have checked above example. here query bucket , user contain 5 sets of data in riakdb. think map() returns single value returns array 5 value, think equivalent 5 set of data in riakdb. 1 1 1 1 1 and here, why can return array? treats each dataset independently, , returns each. think have 5 1's. due reason when process fetched data inside map(), returns gives unexpected result me. so please give me suggestion. think basic thing couldnot it. highly appreciate help. when run mapreduce job, map phase code sent out vnodes data stored , ex

Google Analytics get absolute numbers instead of charts -

Image
i'm using google analytics embed api create craft dashboard widgets show analytics data have show number instead of chart there easy , fast way 1 number? i'm doing this var datachart = new gapi.analytics.googlecharts.datachart({ query: { metrics: 'ga:sessions', dimensions: 'ga:date', 'start-date': '30daysago', 'end-date': 'yesterday' }, chart: { container: 'chart-container', type: 'line', options: { width: '100%' } } }); but want show like: i'm new welcome i think doing things incorrectly, invoking function create chart out data retrieved. if try query on google analytics query explorer , it'll return list of sessions per date specified in metrics fetch sessions per ga:sessions value , separated date ga:date in dimensions key. you can use google analytics api query , number immediately. , magic number p

Not able to get url parameter value in a Sharepoint "calulated column" -

i want url parameter value in calculated column...here url http://xyz/forms/formsvjfs/123.xml?openin=browser&defaultview=myview&source=http://xyz/sharepoint/distribution/ i want "myview" in calculated column...is there formula it? got working.. here formula... =left(right([urlcolumn],len([urlcolumn])-int(find("defaultview=",[urlcolumn])+11)),int(find("&",right([title],len([title])-int(find("defaultview=",[title])+11))))-1)

c# - ASP.NET MVC3 Forms Authentication Expiring Prematurely -

Image
we have online assessment platform built mvc3. runs in iis on single dedicated server running windows server 2012 r2 on have full control. users have been reporting "getting logged out" during assessments.this problem many of our assessments have time constraints , logging in costs users valuable seconds. i have been unable replicate issue during testing, have confirmed consulting our logs last 2 months ~15-20% of users have log in @ point during assessment. 10 months prior <2% had log in. i have compared our current code base how 3 months ago, , nothing remotely related logging in , authentication has been changed. knowledge no settings on server have been changed. there many hundreds of files, , thousands of lines of code in application, try , share relevant bits in hope can me resolve this. if there information have missed, leave comment , add possible. from web.config: <authentication mode="forms"> <forms loginurl="~/login/"