Posts

Showing posts from August, 2013

android - Adapter not working properly until scrolled -

in listview want have textviews image drawables colored accordingly text. tried using code below while text showing expected, drawable shows last color in list of textviews - until list scrolled, shows right color. @override public view getview(final int position, view convertview, viewgroup parent) { viewholder holder; layoutinflater inflater = (layoutinflater) context.getsystemservice(context.layout_inflater_service); view row = convertview; if (row == null) { row = inflater.inflate(r.layout.mylayout, parent, false); holder = new viewholder(); holder.textview = (textview) row.findviewbyid(r.id.mytextview); holder.img = getresources().getdrawable(r.drawable.my_icon); row.settag(holder); } else { holder = (viewholder) row.gettag(); } holder.textview.settext(colors[position]); int color = 0; switch (colors[position]) { case "blue": color = getresources().getcolo

reactjs - Is it More Performant to Pass Props From Parent Component Or Listen to State Change In Flux Store? -

let's have following parent -> child relationship(s) inside of react component: <parentcomponent> <childcomponent> <grandchildcomponent> <greatgrandchildcomponent></greatgrandchildcomponent> ... ... ... // , on </grandchildcomponent> </parentcomponent> assuming i'm getting data flux store, more performant have <parentcomponent> state / listen changes on flux store , pass relevant data down children props or more performant have each <..child> component listen store directly updates state? performance depend on specific program. there reason youre concerned performance between these 2 practices? must imagine extremely minimal difference. that being said, idiomatic react favors stateful components housing stateless components. unless theres reason child component manage (that manage own state , not let parent manage

angularjs - angular factory return data remained same after changing the json file -

i calling camera.json file "cameradata" service , injecting cameradata service in "cameracontroller". if change camera.json after clicked on refresh button getting old data. idea? .factory('cameradata', function ($http, $q,globalvariable) { var deferred = $q.defer(); var cameradata = {}; var contenttype = "application/json; charset=utf-8"; cameradata.getitemlist = function(){ $('.loader').show(); var senddata ={}; senddata.installedcameraid = "9547857793457943"; $http({ //url: globalvariable.serveraddress + "admin_getcamerapoints", url: globalvariable.camerafilepath, datatype: 'json', method: "post", data: json.stringify(senddata), headers: { "content-type": contenttype, "access_token": globalvariable.token } }).success(function(response){ //$scope.re

javascript - jQuery location picker API location name field is not working -

i'm using jquery location picker api map view. in api working fine except when give input location name doesn't work. , autocomplete option not working , map not show location. location: <input type="text" id="location" style="width: 200px"/> lat <input type="text" id="lat" style="width: 200px"/> long: <input type="text" id="lng" style="width: 200px"/> <div id="us2" style="width: 500px; height: 400px;"></div> <script>$('#us2').locationpicker({ location: {latitude: 46.15242437752303, longitude: 2.7470703125}, radius: 0, inputbinding: { latitudeinput: $('#lat'), longitudeinput: $('#lng'), locationnameinput: $('#location') }, enableautocomplete: true, onchanged: function(currentlocation, radius, ismarkerdropped) { alert(""); } }); </script> i had s

batch file - ask set /p variable on a different line -

i've seen in batch code can ask user input on separate line or continue while asking or something. example this; enter name name:_(input here) enter name above and code might like; echo enter name set /p /(continue) name=name:_ echo enter name above or maybe: echo enter name (line 2) echo enter name above set /p /line:2 name=name:_ @echo off setlocal cls echo enter name echo name: echo enter name above rem move cursor 1 line below screen size, rem must adjust value fit screen. /l %%i in (1,1,34) echo/ rem move cursor screen home , hide timeout "waiting..." message /f %%a in ('timeout /t 1 ^> con') rem set /p "name=name: " echo/ echo/ echo/ echo name read: "%name%" further details @ this post

python - How to obtain detailed device / partition info from file path on Linux (like UUID, hard drive serial etc.) -

starting absolute file path, want obtain following information: the mount point of filesystem on file stored (in order compute path relative mount point) the uuid , label of file system the type (or vendor name) , serial number of hard drive contains partition i aware 2 , 3 may undefined in many cases (e.g. loopback, ramfs, encyrpted devices), totally fine. i know how obtain information using shell , system tools df , /sys or /proc filesystem. see this question reference. however, searching least cumbersone method programmatically python 3.5. means: prefer system calls instead of parsing contents of /proc or /sys (which may subject change or depend on kernel configuration?) avoid calling subprocesses , parsing output (the definition of cumbersome) so far, using os.stat() on path block device's major , minor number stat_result.st_dev . what's proper way proceed? there example /proc/mounts /proc/partitions /sys/dev/block/<major>:<min

Orbeon DataBase conectivity -

could please connect orbeon form builder mysql. please find below useful details: os: window 8, server: liferay tomcat, database: mysql. please follow step in documentation , steps mysql. if unclear, post specific questions on stackoverflow or in forum .

database - DB2 linking schemas across multiple instances -

i have few instances of db2 10.5 server running on 1 physical linux machine, let name them inst1 , inst2. all of them contain multiple schemas, schema-naming unique accross whole machine, example inst1_schema_a, inst2_schema_a etc. what somehow create user can access of schemas on 1 instance, possible make queries like: select id inst1_schema_a union select id inst2_schema_a how can achieve that? should link databases , alias schemas? federation is keyword request. db2 luw db2 luw included in license , done across multiple databases - not matter if reside within same instance, instance on same server or different server. set federated = yes in dbm cfg, define server , set nicknames remote tables. details refer article or one or ibm knowledge center.

python - Theano: using dot "T" at the end of a dot product where number of dimensions is greater than one -

i going through lstm code jonathan raiman , encountered line of code in "layer" class if x.ndim > 1: return t.nnet.sigmoid(t.dot(self.linear_matrix,x.t) + self.bias_matrix[:,none]).t t "import theano.tensor t" x symbolic variable what x.t do? (return statement).t do?? please help. x.t transpose of matrix x . .t notation applies transpose numpy matrices, same numpy.transpose(x) . should not confused name t import theano.tensor t and (return statement).t returns transpose of output of sigmoid function applied on parameter: t.dot(self.linear_matrix,x.t) + self.bias_matrix[:,none]

laravel 5 - Getting base_url into a PHP file of symfony3 framework -

i beginner symfony framework , want base url of symfony3 framework view file. did r&d , how base url twig file using this. {{ app.request.getschemeandhttphost() }} but view not twig file it .php file so don't know how use base url in view .php file. i base url head.blade.php file of laravel framework using:- <?php echo url::to('/'); ?> i want symfony3 framework. as explained on the doc : in symfony have create routes. /** * @route("/", name="site_home") */ public function homeaction() { // ... } in twig, can call routes : {{ path('site_home') }} you can route in controller , pass view : $homeurl = $this->get('router')->generate('site_home');

django - Customize select widget in a foreignkey field -

i have following models: class regioncategory(models.model): """categories of regions""" symbol = models.charfield(max_length=15) description = models.charfield(max_length=50) class region(models.model): """region model""" region = models.charfield(max_length=30) category = models.foreignkey(regioncategory) class md_orderlog(models.model): """order log model""" order_region = models.foreignkey(region) nothing uncommon, model foreign key model. i have modelform also: class md_orderlogform(forms.modelform): """model form of md_orderlog model""" def __init__(self, *args, **kwargs): super(md_orderlogform, self).__init__(*args, **kwargs) self.fields['order_region'] = forms.modelchoicefield( label=("project region"), widget=forms.select, queryset=regio

android - CardView suddenly turned black -

i've got problem cardview in recyclerview . cardview became black , ratingbar became blue. i'm using infiniterecyclerview changing simple recyclerview has no effect. can change cardview 's background colour white ratingbar still blue. example of happening: black cardview i use normal recyclerview in activity within fragment same adapter , looks fine. here example: normal cardview this single_recipe_recycler_item.xml layout file: <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.cardview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginleft="5dp" android:layout_marginright="5dp" android:layout_margintop="5dp"> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:back

vb.net input past end of file when importing CSV -

i using vb.net import csv file , using eof while not eof(1) input(1, csv_month) end while the csv files import have line or 2 lines blank @ end of file , error when gets end file saying input past end of file , breaks application use textfieldparser instead. input() , eof() more little obsolete.

python - ModelForm has no attribute get -

i´m getting modelform has no attribute 'get' error on django 1.8 project. i´ve read similar questions on topic haven´t found solutions: django 'user' object has no attribute 'get' error object has no attribute 'get' when visiting url: patients/add i´m getting above error: here´s code: forms.py class addpatient(forms.modelform): class meta: model = patientuser fields = ['gender'] views.py def add_patient(request): if request.method == "get": form = addpatient(data=request.post) if form.is_valid(): new_user = patient.objects.create_user(**form.cleaned_data) # login(new_user) # redirect, or want main view return httpresponseredirect('base.html') else: form = addpatient() return render(request, 'addpatient.html', {'form':form}) models.py class patie

java - How to deploy to AEM instance via Repository? -

is possible/ how take packaged version of jar via repository (for example artifactory) , deploy instance of aem? done via maven , jenkins in automated way? currently done, using tagged version in vcs build , deploy via content-package-maven-plugin. with jenkins have multiple options: you let maven build artifacts you or use repository connector plugin (1) artifacts nexus / artifactory after that, use crx content package deployer plugin (2) upload packages aem instance. the jenkins build triggered manually, change in vcs,... (1): https://wiki.jenkins-ci.org/display/jenkins/repository+connector+plugin (2): https://wiki.jenkins-ci.org/display/jenkins/crx+content+package+deployer+plugin

c# - InventorySystem List of Items and their subclass Permanents Bug -

hey need inventory system. it's simplistic - guess - got problems , couldn't find solution online. //! edited minimal best of knowledge my task university system contains sub-classes. worked fine till added sub-classes.. apparently items created , added inventory @ start somehow child part , in-fact entire item seems overwritten @ point. guess list of items cause problems later on when sub-class of permanents added. anyway started out , can't find problem. any appreciated - or point me right direction read on given problem. cheers , in advance! itemdatabase public class itemdatabase : monobehaviour { public list<item> items = new list<item>(); void start () { items.add(new permanent(0, "iron armor", "the armor has seen battle.", 0, item.itemtype.permanent, 110, 20000, 6640, 600, 100, true, "torso", 5, -5, 10, 50)); items.add(new consumable(139, "healing potion", "brew res

pyspark - Matrix multiplication in py-spark using RDD -

i have 2 matrices # 3x3 matrix x = [[10,7,3],[3 ,2,6],[5 ,8,7]] # 3x4 matrix y = [[3,7,11,2],[2,7,4,10],[8,7,6,11]] i want multiply these 2 in spark using rdd. can 1 me on this. multiplication should not use inbuilt function. i able multiply 2 using loop in python follows in range(len(x)): # iterate through columns of y j in range(len(y[0])): # iterate through rows of y k in range(len(y)): output[i][j] += x[i][k] * y[k][j] #output 3*4 empty matrix i new spark , using pyspark. it not hard, have write matrix using different notation. x = [[10,7,3],[3 ,2,6],[5 ,8,7]] can written as x = (0,0,10),(0,1,7),(0,2,3)... rdd_x = sc.parallelize((0,0,10),(0,1,7),(0,2,3)...) rdd_y = sc.parallelize((0,0,3),(0,1,7),(0,2,11)...) now can make multiplication both using join or cartesian. e.g., rdd_x.cartesian(rdd_y)\ .filter(lambda x: x [0][0] == x[1][1] , x[0][1] == x[1][0])\ .map(lambda x: (x[0][0]

python - Adding secondary X-axis with user-defined list of coordinates -

Image
i have function plotting amount of graphics using pyplot . code here: def plot_results(results, expers): """ type results: list[list[float]] type expers: list[int] """ label_builder = lambda index: 'experiment ' + str(index + 1) colors = ('green', 'blue') x_indices = list(map(compute_filesize, list(range(np.shape(results)[1])))) x_percents = list(map(compute_percent, list(range(np.shape(results)[1])))) fig, ax1 = plt.subplots() in range(expers): ax1.plot(x_indices, results[i], color=colors[i], lw=2, label=label_builder(i)) ax1.legend() plt.show() for each value of expers list function plots chart. example, if len(results) == len (expers) == 2 , such graph: i need create secondary x-axis (similarly this , may x-axis , located on top of graph). difference i need set list of coordinates manually (e.g. ax2.set_coords(x_percents)). i created new axis using ax2 = ax1.

react jsx - getDefaultProps is not working using reactjs -

i trying use getdefaultprops method below example using react.js , found not working me: html: <script src="https://facebook.github.io/react/js/jsfiddle-integration-babel.js"> </script> <div id="container"> <!-- element's contents replaced component. --> </div> javascript: var recentchangestable = react.createclass({ render: function() { return ( < table classname = 'table' > { this.props.children } < /table>); } }); recentchangestable.heading = react.createclass({ render: function() { var headingstyle = { backgroundcolor: 'floralwhite', fontsize: '19px' }; return <th style = { headingstyle } > { this.props.heading } < /th>; } }); recentchangestable.headings = react.createclass({ render: function() { var headings = this.props.headings.map(function(name, index) { return <recentchanges

java - TableColumn set width equal header -

Image
after added menubutton can not can not correct size the tableview after load looks this how can set each column's width equal inner content width of column ? or right blank space should distributed in balanced way i can not them both tablecolumns[i].setminwidth(tablecolumns[i].minwidthproperty().get() + 50);//does not work tableview.columnresizepolicyproperty().set(...)//not work

java - Why doesn't my application open new Activity from fragment? -

can please tell me doing wrong. have looked everywhere , tried changing code many ways , still can't figure out. have "loginactivity.java" file has activity_login.xml file. inside activity, have 2 fragments, login_fragment , register_fragment. each have own java files. works fine on loginfragment.java file, when user verified successfully, supposed open mainactivity, instead of opening mainactivity, opening new instance of loginactivity, though telling telling open mainactivity. here code in loginfragment.java file. package com.example.myapplication; import android.content.intent; import android.os.bundle; import android.support.v4.app.fragment; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.button; import android.widget.edittext; import android.widget.toast; import com.android.volley.authfailureerror; import com.android.volley.request; import com.android.volley.requestqueue; import com.android.vo

Why is scripting not available in my version of Enterprise Architect? -

Image
i have tried follow (nice) webinar how scripting ea ( scripting introduction ), , don't have option try locally. my ea installation tells me have corporate edition installed, , ea help tells me scripting available corporate edition. have enable scripting in ea? turn on scripting in options and should ready go. you can use api outside ea.

Zero division java integer vs double -

this question has answer here: why 1/0 give error 1/0.0 returns “inf”? 4 answers double doubleresult = 1d/0d; system.out.println(doubleresult); int intresult = 1/0; system.out.println(intresult); the output is: infinity exception in thread "main" java.lang.arithmeticexception: / 0 why double 0 division returns infinity , int 0 division throws exception? this principally due fact double type (which in java ieee754 64 bit double precision type) has representation infinity, whereas int type not. note double doubleresult = 1 / 0; still cause exception thrown: type of variable result assigned not relevant.

java - tomcat stops responding when fourth service ajp connector added -

a tomcat 8 server has been serving reverse proxy behind apache httpd on centos 7. tomcat has had 3 services running, each ajp connection apache. when add fourth service own fourth ajp connection, apache stops responding altogether. how can assign fourth ajp connection? /opt/tomcat/conf/server.xml is: <?xml version='1.0' encoding='utf-8'?> <server port="8005" shutdown="shutdown"> <listener classname="org.apache.catalina.startup.versionloggerlistener" /> <listener classname="org.apache.coyote.ajp.ajpprotocol" sslengine="on" /> <listener classname="org.apache.catalina.core.jrememoryleakpreventionlistener" /> <listener classname="org.apache.catalina.mbeans.globalresourceslifecyclelistener" /> <listener classname="org.apache.catalina.core.threadlocalleakpreventionlistener" /> <globalnamingresources> <resource name=&q

python - numpy stride_tricks.as_strided vs list comprehension for rolling window -

when dealing rolling windows, wrote functions in way list comprehension [np.std(x[i:i+framesize]) in range(0, len(x)-framesize, hopsize)])] recently discovered numpy.lib.stride_tricks.as_strided , found used rolling windows (for example, this post ), though "hidden" function. in this issue concerning why stride_tricks.as_strided undocumented, it's mentioned intentionally! it's dangerous! low-level plumbing implement broadcast_arrays(). is there advantage stride_tricks.as_strided on list comprehension or loop? had @ the source code of stride_tricks gained little. from this post , can use strided_app sliding views array , allows specify hopsize/stepsize. then, use np.std along second axis final output, - np.std(strided_app(x, framesize, hopsize), axis=1) sample run verification - in [162]: x = np.random.randint(0,9,(11)) in [163]: framesize = 5 in [164]: hopsize = 3 in [165]: np.array([np.std(x[i:i+framesize]) \ in

types - Understanding Haskell's RankNTypes -

while working way through ghc extensions, came across rankntypes @ school of haskell , had following example: main = print $ rankn (+1) rankn :: (forall n. num n => n -> n) -> (int, double) rankn f = (f 1, f 1.0) the article offered alternative type rankn : rankn :: forall n. num n => (n -> n) -> (int, double) the explanation of difference "the latter signature requires function n n num n; former signature requires function n n every num n." i can understand former type requires signature what's in parentheses or more general. not understand explanation latter signature requires function n -> n "some num n ". can elaborate , clarify? how "read" former signature sounds means? latter signature same num n => (n -> n) -> (int, double) without need forall ? in normal case ( forall n. num n => (n -> n) -> (int, double) ), choose n first , provide function. pass in function of type int ->

windows 10 - After upgrading to Windows10, Vim does not fully function -

i had installed vim 7.4 under windows 7, , worked great. upgraded windows 10, , now, lost vim functionality, basic vi functionality still there. is there configuration need work windows 10? i have tried uninstall , reinstall, left same issue. when "echo $vimrumtime" "c:\program files (x86)\vim\vim74\gvim.exe" thought folder, not file. where set? i've figured out.... i had set "vim" equal "c:\program files (x86)\vim\vim74\gvim.exe" system environment variable, thus, missing everything, thereafter. which strange $vimruntime dependent upon $vim, there go. que sera sera

javascript - Unknown props - react and material-ui -

currently i'm using react , material-ui , i've following code in component. <dialog title="dialog actions" actions={actions} modal={false} open={this.state.open} onrequestclose={this.handleclose}> sure want proceed? </dialog> i've imported import react 'react'; import dialog 'material-ui/dialog'; import flatbutton 'material-ui/flatbutton'; but i'm getting following error message warning: unknown prop `onkeyboardfocus` on <button> tag. remove prop element. warning: unknown prop `keyboardfocused` on <button> tag. remove prop element. this issue material-ui they've fixed . wait 0.15.2 release or master branch now.

asp.net mvc - Why I get error when I try to display image? -

i work use asp.net mvc5 in project. i try display image stored in shared folder in project: <img src="@url.content(~/views/shared/logo.png)" alt="" /> but error on fly: compiler error message: cs1525: invalid expression term '/' any idea why error above? @url.content helper needs string parameter should write this: <img src="@url.content("~/views/shared/logo.png")" alt="" />

apache - How can I view website root when directory listing enabled? -

i can view websites subdirectory indexes. (domain.com/css) when try reach root index server shows me index.html file. is there way list root directory? directoryindex disabled should turn off indexes in apache. it's beyond me why 1 want in real life. ref: https://httpd.apache.org/docs/2.4/mod/mod_dir.html

javascript - Including waypoints in wordpress -

so i'm trying include waypoints.js in wordpress page can't figure out why not working. i got in functions.php inside theme (and put noframework.waypoints.min.js inside js folder): function waypoints_init() { wp_enqueue_script( 'waypointsjs', get_template_directory_uri() . '/js/noframework.waypoints.min.js', array('jquery'), true); } add_action('wp_enqueue_scripts', 'waypoints_init'); then wrote: function waypointtrigger() { echo '<script> jquery(document).ready(function() { var waypoint = new waypoint({ element: document.getelementbyid("triggerpointid"), handler: function() { alert("basic waypoint triggered"); } }); }) </script>'; } add_action('wp_footer', 'waypointtrigger'); and still when scroll down point element id mentioned above located nothing @ all. where did make mistake? i ended a

c# - WCF Parameter Value is null -

Image
i'm trying test wcf rest service multiple parameter. 1 value passed parameter, reset null. wrong on code or fiddler. hope can point me right direction. [operationcontract] [webinvoke( bodystyle = webmessagebodystyle.wrapped, method = "post", requestformat = webmessageformat.json, responseformat = webmessageformat.json, uritemplate = "valid/{id}")] string validateuser(logindetail logindetail,string id); public string validateuser(logindetail logindetail,string id) { //your validation logic return logindetail.username; //always null value } i got answered @ wcf forum. here answer link

c++ - How to store parameter pack as members -

so reading thread: c++ how store parameter pack variable the answer didn't me (i wasn't sure on how implement it) what i'm trying create thread class has arguments, current way arguments need able stored members, them passed onto member function. here current thread class: (i want funcargs able stored members, can passed member function in run) template<class _ty, typename...funcargs> class ythread { private: typedef yvoid(_ty::* ymethod)(); handle _mythread_handle; dword _mythread_id; _ty* _myobject; ymethod _mymethod; private: static yvoid run(ypointer thread_obj) { ythread<_ty>* thread = (ythread<_ty>*)thread_obj; thread->_myobject->*thread->_mymethod(); } ythread(const ythread<_ty>& other) = delete; ythread<_ty>& operator=(const ythread<_ty>& other) = delete; public: // starters ythread() {} ythread(_ty* object, yvoid(_ty::*

Receive Messages from Chrome Extension in a C++ program -

i have chrome extension starts executable c++ file using nativehostmessaging through json file points file. this .exe file tries read messages send extension. first, reads 4 bytes depicts length, reads number of bytes equal length. first thing file wait message extension. however, executable file did not receive extension , keeps on waiting. nothing exists on stdin(0) . is security issue or doing wrong? did have read/write sequence in wrong order? here how mine looks windows: #include "stdafx.h" #include "json\json.h" int _tmain(int argc, _tchar* argv[]) { //save in file know called file *fh_debug; int errorcode; errorcode =fopen_s(&fh_debug, "debug.txt","ab+"); std::string msg = "host called"; fwrite( msg.c_str(), sizeof(char),msg.size(),fh_debug); unsigned int uisize = 0; std::string inputstr; //read first 4 bytes (=> length) (int = 0; < 4; i++) { int

assembly - New AVX-instructions syntax -

i had c code written intel-intrinsincs. after compiled first avx , ssse3 flags, got 2 quite different assembly codes. e.g: avx: vpunpckhbw %xmm0, %xmm1, %xmm2 ssse3: movdqa %xmm0, %xmm2 punpckhbw %xmm1, %xmm2 it's clear vpunpckhbw punpckhbw using avx 3 operand syntax. latency , throughput of first instruction equivalent latency , throughput of last ones combined? or answer depend on architecture i'm using? it's intelcore i5-6500 way. i tried search answer in agner fog's instruction tables couldn't find answer. intel specifications didn't (however, it's missed 1 needed). is better use new avx syntax if possible? is better use new avx syntax if possible? i think first question ask if folder instructions better non-folder instruction pair. folding takes pair of read , modify instructions this vmovdqa %xmm0, %xmm2 vpunpckhbw %xmm2, %xmm1, %xmm1 and "folds" them 1 combined instruction vpunpckhbw %xmm0, %xmm1,

ios - UIWebView, simply select "actual" font in css, not just family? -

Image
in ios, using uiwebview, load short text file , display in uiwebview. ( loadhtmlstring ) <html><head><style type='text/css'> body { font-family:'source sans pro'; font-size:12pt; } html { -webkit-text-size-adjust:none; } </style></head> <body leftmargin=0 topmargin=0> example text... </body></html> here 12 "actual" font names installed ( print(uifont.fontnamesforfamilyname("source sans pro")) ) ["sourcesanspro-boldit", "sourcesanspro-semiboldit", "sourcesanspro-extralight", "sourcesanspro-semibold", "sourcesanspro-bold", "sourcesanspro-black", "sourcesanspro-regular", "sourcesanspro-light", "sourcesanspro-blackit", "sourcesanspro-it", "sourcesanspro-extralightit", "sourcesanspro-lightit"] now in uiwebview body { font-family:'source sans pro'; font-size:12pt; }

javascript - how to get inserted value from data base? -

i using mongo db using express + node js .i inserted 1 value in data base . mongodb shell version: 3.0.4 connecting to: localhost:27017/local > use hockey switched db hockey > db.playes.insert({ name:"naveen" }) writeresult({ "ninserted" : 1 }) i make hocket scehma name , players table name , add 1 entry name:"naveen" ..which inserted . now want retrieve value using connecting mongo db. var express=require('express'); var app =express(); var mongoclient = require('mongodb').mongoclient; var assert = require('assert'); app.get('/app',function(req,res){ mongoclient.connect(url, function(err, db) { assert.equal(null, err); console.log("connected correctly server."); db.close(); }); }) var url = 'mongodb://localhost:27017/test'; app.listen(3000,function(){ console.log('server runninngn') }) when user type http://localhost:3000/app gi

msbuild - TFS will not execute NuGet script -

so got hands on tfs, build small app tests (nunit) , wanted let tfs build me. however, build fails when tries use nuget: ****************************************************************************** starting: build ****************************************************************************** executing following commandline: c:\users\rab\desktop\buildagent\agent\worker\vsoworker.exe /name:worker-6726df74-da4c-466a-b1c6-1f2b78b88a8d /id:6726df74-da4c-466a-b1c6-1f2b78b88a8d /rootfolder:"c:\users\rab\desktop\buildagent" /logger:forwarding,1.0.0;verbosity=verbose,name=agent4-bbf8df0bd72035f895b9972ec79f2bcb;jobid=6726df74-da4c-466a-b1c6-1f2b78b88a8d ****************************************************************************** starting: sources ****************************************************************************** syncing repository: rabs git test (git) starting fetch... checking out 1f6c87dfd38578b9d0f365f83a92fc4ef9bc172e c:\users\rab\desktop\buildagent\_work\1\

c# - Slow page serving on ASP.NET MVC 4 web site -

Image
i'm experiencing slow random response of pages of web site. page takes 1 second load, in cases, unpredictably, can take 10 seconds or worse. find here screenshot of miniprofiler output: as can see output, there's in stack of asp.net stuck, while actual code fast enough. this slowness happens sometimes, during normal navigation of pages (not on page). on local machine pretty fast, while both on production , staging servers (which configured in same way) same problem happens. i think i'm doing wrong in configuration of server or of web app. or maybe i'm using internal asp.net object (like session) in wrong way. could me providing hint can drive me correct solution? thank you cghersi though might not answer big comment, writing here... @ moment can think of following checks: 1) verify once bundling , minification done , minified versions rendering browser. 2) if pages slow, can check logic in action methods. how expensive database/service q

javascript - How to use Highcharts.Tooltip type in typescript -

i following example related active tooltip using click event in highchart url highcharts - show tooltip on points click instead mouseover . thing using typescript , can' find correct way translate line typescript: this.mytooltip = new highcharts.tooltip(this, this.options.tooltip); the error getting is: "property tooltip doesn' exist on type highchartsstatic" i tried add new member controller this: public highcharttooltip : highchartstooltipoptions; and after : this.mytooltip = new self.highcharttooltip(this, this.options.tooltip); but getting error: "cannot use 'new' expression type lacks call or construct signature"... don't know how create object initialize tooltip according js example. also can see definition of tooltip in http://code.highcharts.com/highcharts.src.js var tooltip = highcharts.tooltip = function () { this.init.apply(this, arguments); }; tooltip.prototype = {... but can't figure ou

CefSharp isTrusted click event? -

i'm having trouble getting cefsharp browser invoke trusted clicks in browser. initiating click event follows in js (from cefsharp) halfway there: var e = document.createevent("mouseevents"); e.initmouseevent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null); element[0].dispatchevent(e); the above method still theoretically fails .istrusted event property (even though version of chromium cefsharp uses doesn't implement .istrusted) knowing chromium implement istrusted, how can cefsharp perform trusted click on elements in browser?

xcode - Scenekit how to have an X amount of rectangles at different positions? -

for example have variable named x value of 1, means there 1 rectangle. x might become more 1 example 10, , 10 rectangles appear near first one. x 10 might go down example 4 , 4 rectangles disappear? there way this? this example uses uiview: let view = uiview(frame: cgrectmake(0, 0, 1024, 768)) view.backgroundcolor = uicolor.graycolor() let x = 20 in 0 ..< x { let v = uiview(frame: cgrect(x: 0, y: 0, width: 1024, height: 768)) v.backgroundcolor = uicolor.redcolor() let xpos = cgfloat(random(20, max: 1000)) let ypos = cgfloat(random(20, max: 700)) v.frame = cgrect(x: xpos, y: ypos, width: 30, height: 30) view.addsubview(v) } but can convert others frameworks spritekit, scenekit. in scenekit add 1 more dimension (z). if want dinamically change x variable , want view reload can add property observer x variable (didset) , inside simple remove old views , run same code again.

uiview - UIStackView inside scrollView -

Image
i trying put uistackview inside scrollview. within want following: top view uistackview contains 2 labels. second view custom view remain same size. third view uiview want use add other customuiviews to. in code doing addsubview , view need change size depending on size of subview added it. fourth view 2 labels in stackview. i have tried setting following: (plus third view's hugging priority higher want grow , shrink depending on size of view added.) however getting following result: has had luck adding uistackview scroll view , within stackview having view resize depending on content? the other option maybe using tableview. though prefer use stack view.

android - spacing of items added to linear layout changes -

Image
i adding pictures linearlayout programmatically. linearlayout surrounded horizontalscrollview , part of item layout listview. when have pictures inline other view items, spaced next eachother correctly: however if move horizontalscrollview/linearlayout under other view items, weird spacing android seems automatically: so far have tried relativelayouts, embedded linearlayouts, changing padding, changing margins, changing width property of linearlayout between match_parent, fill_parent, , wrap_content, nothing changes spacing. same. here relevant code: linearlayout tmpll = (linearlayout) convertview.findviewbyid(r.id.llupgrades); //remove previous list contents first tmpll.removeallviews(); for(int = 0; i<= tmpupgradelist.size()-1; i++){ imageview tmpib = new imageview(getcontext()); upgrade tmpupgrade = tmpupgradelist.get(i); upgrade.setupgradepic(tmpib, tmpupgrade, tmpupgrade.title()==null); tm