Posts

Showing posts from July, 2014

python - Edit an account in Sugarcrm -

python - Edit an account in Sugarcrm - i having problem uploading file, form sugarcrm. i using this tutorial, states next code should update account: #2 - update existing entry sugarcrm_conn= none try: sugarcrm_conn = sugarcrm.sugarcrm(url = sugarcrm_url, username = sugarcrm_user, password = sugarcrm_pass) print "connected sugar via rest" except valueerror: print "cann't connect " + sugarcrm_url exit(1) accounts = sugarcrm_conn.module('accounts') #we show first 10 of them. business relationship in accounts[:10]: account.setvalue(['shipping_address_postalcode','email'],['4144','test@gmail.com']) the problem having error: sugarcrm instance has no attribute 'module' for line sugarcrm instance has no attribute 'module' have missed something? clarify, can connect sugarcrm , have added accounts, displayed them. query = sugarcrm_conn['accounts'].que

java - Simple Program Does Not Work Correctly -

java - Simple Program Does Not Work Correctly - import java.util.scanner; public class welcome { public static void main(string[] args) { scanner input = new scanner(system.in); double = input.nextdouble(); double b = input.nextdouble(); double c = input.nextdouble(); double rezultat = - b + math.sqrt(math.pow(b, 2) - 4 * * c) / 2 * a; system.out.println(rezultat); } } i wonder why code not work should. printed result always: nan math.sqrt(math.pow(b, 2) - 4 * * c) this portion homecoming nan. if plug in values of (1, 0, 1) x^2 + 1, nan never crosses x line. in other words, if math.pow(b, 2) - 4 * * c) < 0, should expect nan. if trying quadratic formula, proper equation be: double rezultat = (-b + math.sqrt(math.pow(b, 2) - 4 * * c)) / (2 * a); you need take business relationship order of operations, more in java. original operation have returned not have been x. additionally, there 2 e

design - Using nested loops to create a box with stars in java -

design - Using nested loops to create a box with stars in java - i new java , taking intro course. i have been able figure out bulk of question stuck on lastly step. the end result supposed using 4 or less system.out.print or system.out.println statements: ******* * ***** * **** * *** * ** * * ******* and have created this ******* * ***** * **** * *** * ** * * * this code. there guys can see help? public class starpatterns { public static void main(string[] args) { int col; int row; (row = 6; row >= 0 ; row--) { if (row >= 0) system.out.print("*"); (col = row; col < 6; col++) { system.out.print(" "); } (col = row; col > 0; col--) { system.out.print("*"); } system.out.println(); } } } public class stars { public static void

c# - How to fire event out of threading mode -

c# - How to fire event out of threading mode - i used component socket connection in c# i connect 10 tcp object server threading. , recived info in event (data_onrecived) here code: // connect function private void connect(object state) { tcp tcp = (tcp)state; tcpsession tcpsession = new tcpsession(); tcpsession.remoteendpoint = new dart.sockets.ipendpoint(ip, convert.toint32(port)); tcpsession.connecttimeout = 1; seek { tcp.connect(tcpsession); } catch(system.net.sockets.socketexception ex) { tcp.marshal(ex); } } // initial tcp component private void tcpinitialize() { (int = 0; < maxconnection; i++) { socketcontrol[i].tcpconnection = new tcp(); socketcontrol[i].tcpconnection.data += new system.eventhandler<dart.sockets.dataeventargs>(this.tcp_data); socketcontrol[i].tcpconnection.sta

date formatting - Why is this format "[$-F400]h:mm:ss\ AM/PM" a 24 hour format in Excel? -

date formatting - Why is this format "[$-F400]h:mm:ss\ AM/PM" a 24 hour format in Excel? - and yet 1 [$-409]h:mm:ss\ am/pm;@ not , shows am/pm correctly? i'm using npoi read excel file , extract useful info app. while parsing dates, stumbled across interesting case. this date 16:00:00 (4 o'clock in afternoon) format [$-f400]h:mm:ss\ am/pm showing 16:00:00 in excel. yet similar format, [$-409]h:mm:ss\ am/pm;@ , shows 04:00:00 pm , believe right because of am/pm notation @ end of format string. my excel version one: microsoft® office excel® 2007 (12.0.6665.5003) sp3 mso (12.0.6662.5000) and i'm using latest version of npoi (got source code), interprets [$-f400]h:mm:ss\ am/pm hh:mm:ss tt (which doesn't match way excel shows it) i know [$-xxxx] locale, don't know ;@ . why, depending on circunstances, excel ignoring am/pm part? edit: appears @ text-placeholder am/pm seems. absence of token forcing excel show 24-hour format?

html - menu bar shrink when i restore down browser -

html - menu bar shrink when i restore down browser - here seek create menu ... menu seems fine when browsers in maximize , seems image1 but when restore downwards browser menu image 2 code <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>gatr enterprise - home</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <script src="js/mymenu1.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="css/style.css" /> <script type="text/javascript"> <!-- function text_newsletter_onclick() { } // --> </script> <style type="text/css"> .style1 { width: 100%; }

javascript - How can I get only the specific H3 I am hovering over to show and not all of them? -

javascript - How can I get only the specific H3 I am hovering over to show and not all of them? - i trying have text appear on each image user hovers on specific image. don't want of text every image appear when user hovers on 1 image. have 1 photo becomes opaque right text shows every image when hovering on image. html: <div class="image"> <img class="projectimage" src="images/peralta.png" alt=""> <h3 class="hiddenh3">this test!</h3> </div> scss: .image { position: relative; width: 100%; .projectimage { width: 100%; transition: 0.5s ease-in; } .hiddenh3 { display: none; position: absolute; top: 45%; width: 100%; } } js: $('.projectimage').on("mouseover", function() { $(this).closest('.projectimage').addclass("cooleffect"); $('.hiddenh3').fadein(1000); }); $('.projectimage').on("

Mapping one block of HTML to another with jQuery -

Mapping one block of HTML to another with jQuery - i have div multiple images needs replaced <ul> block contains <li> each image. block 1, below, needs replaced block 2. block1 <div id="box"> <img src="images/pic1.jpg"> <img src="images/pic2.jpg"> <img src="images/pic3.jpg"> etc. </div> block2 <ul> <li> <img src="images/pic1.jpg"> </li> <li> <img src="images/pic2.jpg"> </li> <li> <img src="images/pic3.jpg"> </li> etc. </ul> i've started with: $('<ul id='wrapper'>); $('#box').find('img').each(function() { src =

c# - WPF layout created dynamically using MVVM -

c# - WPF layout created dynamically using MVVM - i'm trying postion views window in layout rectangle base of operations while using mvvm pattern. in winforms able utilize width, height, x , y of rectagle position controls setting same properties on control. now i'm rewriting code wpf using mvvm , i'm lost. this i'm trying do: this thought might work not. <grid showgridlines="true"> <grid.rowdefinitions> <rowdefinition /> <rowdefinition /> <rowdefinition /> <rowdefinition /> <rowdefinition /> <rowdefinition /> </grid.rowdefinitions> <grid.columndefinitions> <columndefinition /> <columndefinition /> <columndefinition /> <columndefinition /> <columndefinition /> </grid.columndefinitions> <itemscontrol itemssource="{binding virtualscre

excel - VBA filter result row count wrong -

excel - VBA filter result row count wrong - language: excel vba scenario: have source range (rngdtref_allrecord) need insert info destination range (rngrtdc_alldetail) for each of row(rngcurrrow) in source range (rngdtref_allrecord), filter destination range (rngrtdc_alldetail) if filter yield result, add together info result row (note: each of result unique) else add together new row destination range (rngrtdc_alldetail) below code: each rngcurrrow in rngdtref_allrecord.rows intrtdc_rowbegin = 7 intrtdc_colidxtotal = 20 intrtdc_rowlast = fntgetnewlastrow 'this function lastly row of rngrtdc_alldetail due might add together in new row set rngrtdc_alldetail = shtrtdc.range(shtrtdc.cells(intrtdc_rowbegin, 1), shtrtdc.cells(intrtdc_rowlast, intrtdc_colidxtotal)) rngrtdc_alldetail.autofilter rngrtdc_alldetail.autofilter field:=intrtdc_colidxacc, criteria1:=rngcurrrow.cells(1, intdtsource_colidxacccode), oper

make - cc -o kocka -I/usr/include kocka.o -L/usr/X11R6/lib -lX11 -lXi -lglut -lGL -lGLU -lm -lpthread /usr/bin/ld: cannot find -lXi -

make - cc -o kocka -I/usr/include kocka.o -L/usr/X11R6/lib -lX11 -lXi -lglut -lGL -lGLU -lm -lpthread /usr/bin/ld: cannot find -lXi - i error when want play create file, don't know why. apps = kocka obj = $(apps).o src = $(apps).c cflags = $(c_opts) -i/usr/include libs = -l/usr/x11r6/lib -lx11 -lxi -lglut -lgl -lglu -lm -lpthread application:$(apps) clean: rm -f $(apps) *.raw *.o core a.out realclean: clean rm -f *~ *.bak *.bak .suffixes: c o .c.o: $(cc) -c $(cflags) $< $(apps): $(obj) $(cc) -o $(apps) $(cflags) $(obj) $(libs) depend: makedepend -- $(cflags) $(src) where libxi on machine? add together -l flag directory. make

virtualbox - docker on windows not working -

virtualbox - docker on windows not working - i have tried installing docker on windows 7 (using boot2docker). console exists abruptly , unable see error, much less run commands. in installation have tried both installing , not installing virtualbox. have tried un-installing , re-installing both docker , virtualbox. nil seems work. here console errors see when run boot2docker -v up : boot2docker-cli version: v1.3.0 git commit: deafc19 2014/10/26 20:47:11 executing: c:\program files\oracle\virtualbox\vboxmanage.exe showvminfo boot2docker-vm --machinereadable 2014/10/26 20:47:12 executing: c:\program files\oracle\virtualbox\vboxmanage.exe guestproperty set boot2docker-vm /virtualbox/guestadd/sharedfolders/mountprefix / 2014/10/26 20:47:12 executing: c:\program files\oracle\virtualbox\vboxmanage.exe guestproperty set boot2docker-vm /virtualbox/guestadd/sharedfolders/mountdir / 2014/10/26 20:47:12 executing: c:\program files\oracle\virtualbox\vboxmanage.exe sharedfolder add to

Changing a string pointer in C -

Changing a string pointer in C - this question has reply here: c function alter string using pointer 3 answers apparently i'm fellow member of big club doesn't understand c-style pointers correctly. here's program: void changethestring (const char * thestring) { thestring = "string two"; } int _tmain(int argc, _tchar* argv[]) { const char * teststring = "string one"; changethestring(teststring); printf("the string is: %s.\n", teststring); homecoming 0; } my intent changethestring() should cause pointer point "string two". logic i'm giving function pointer. function should able alter pointer point different area in memory. , alter should persist outside function. yet that's not happens. in printf() statement, string still "string one". can explain why is, what's

java - Get PathVariable using spring integration -

java - Get PathVariable using spring integration - from url want extract pdf name localhost:port/server/inboundgateway/pdf/ <int-http:inbound-gateway id="inboundgateway" request-channel="request" reply-channel="response" supported-methods="get,post" request-payload-type="java.lang.string" path="/inboundgateway/{type}" <int-http:header name="type" expression="#pathvariables.type" /> </int-http:inbound-gateway> in above code (int-http:header name="type" ) type pdf how extract value in java code not able httpservletrequest i routing on bases of supported-method <int:router input-channel="request" expression="headers.http_requestmethod"> <int:mapping value="post" channel="contentdownload" /> </int:router> <int:service-activator input-channel="contentdownload" method=&qu

html - Make DIV bigger if scrolled -

html - Make DIV bigger if scrolled - is possible create div bigger when content of page scrolled? have chatbox position:fixed on right side of page. css chat box height:100% right:0 bottom:0 top:50px. top:50px because don't want hide navigation bar on top of page. problem is, when start scrolling page, navigation bar disappear sight , there 50px high blank space on top of chatbox. want when start scrolling page, chatbox should take whole 100% of screen, there no blank space on top of it. you may this: $(document).ready(function () { $(window).scroll(function () { if ($(this).scrolltop() > 100) { $('.chat_box').css({top:'0px'}); } else { $('.chat_box').css({top:'10px'}); } }); }); http://jsfiddle.net/5tnygmrz/1/ html css height

web services - JAVA-EE7/javax.ws.rs: Injection of EJB in REST-Resource -

web services - JAVA-EE7/javax.ws.rs: Injection of EJB in REST-Resource - i'm trying inject stateless ejb jax-rs webservice via annotation @ejb. unfortunately ejb beingness injected null , throws nullpointerexception when beingness called, see class "registrationrest": @path("/database") @stateless public class registrationrest { @ejb private dbdao dbdao; @path("getinfo/{name}") @get @produces(mediatype.text_plain) public string getinfobyname(@pathparam("name") string name { treeset <string> ts = new treeset<string>(); jsongenerator json = new jsongenerator().writestartarray(); // lesen info aus datenbank for(persons person : dbdao.findinfobyname(name) { ts.add(person.getname()); } // schreiben der gefundenen staedte in ein json for(string name : ts) { json.write(name); } // rueckgabe der daten als jso

web - AngularJS - How do I modify variables in $rootScope? -

web - AngularJS - How do I modify variables in $rootScope? - i've got potentially dumb question, how modify variables in $rootscope in angular? i've got slide-in sidebar want alter content on whenever clicks on thumbnail, , figured easiest way handle info in sidebar comes from/the sidebar visibility either in global values, or in $rootscope. i'm trying maintain simple possible, don't know how handle modifying global variables. my angular code surrounding is: app.run(function($rootscope) { $rootscope.currenturl = { value: 'visual/design/1/' }; $rootscope.detail_visible = { value: true }; }); app.controller('navcontroller', ['$scope', '$rootscope', function ($scope, $rootscope) { $scope.isdetail = $rootscope.detail_visible.value; $scope.url = $rootscope.currenturl.value; $scope.hide = function($rootscope) { $rootscope.detail_visible.value = false; }; }]); and connecting html is <

Tkinter - How would I create buttons in a new window, which has been created by a function being called? Python 3 -

Tkinter - How would I create buttons in a new window, which has been created by a function being called? Python 3 - from tkinter import * def begin(): root = tk() root.title("main window") root.geometry("1920x1080") homecoming #how button placed in window made function? root = tk() root.title("start page") root.geometry("1920x1080") beginbutton = button(app, text = "begin", command=begin, bg="green") beginbutton.grid(column = 2, row = 2, sticky = w) beginbutton.config(height = 10, width = 30 ) root.mainloop() how create new buttons in new window, if new window beingness made by, in case function known "begin". any response much appreciated! i believe want modify root window rather create new one. here minimal working example: from tkinter import * root = tk() class app: def __init__(self): root.title("start page") root.geometry("1920x

php - Foreach iteration position -

php - Foreach iteration position - is there way in php move iteration position in loop? for illustration have array: 1, 2, 3, 4, 5, 6, 7, 8, 9 we have array of 1 9 want 5 placed @ end of iteration outcome this: 1 2 3 4 6 7 8 9 5 it unclear asking. anyway can obtain required output using unset , [] operator $element = $array[4]; unset($array[4]); $array[] = $element; live: http://codepad.org/cwzhjjwy if need search 5 key array_search() : $key = array_search(5,$array); unset($array[$key]); $array[] = 5; php loops foreach iteration

What is the best way to change the text colour used in an android date picker view -

What is the best way to change the text colour used in an android date picker view - i have background colour views in activities set black. seek utilize standard date picker view. unfortuneatley text seems black. makes invisible. have been using code alter text. tried childpicker1 = (viewgroup) findviewbyid(resources.getsystem().getidentifier("month" /*rest is: day, year*/, "id", "android")); edittext textview1 = (edittext) childpicker1.getchildat(0); textview1.settextcolor(color.white); and seems work when seek scroll or select value text goes black thats not good. best way alter text colour of date picker in android ? android

java - choosing language to work on very large text files (up to some terabytes) -

java - choosing language to work on very large text files (up to some terabytes) - i working on project uses text files (.txt) input, reading them line line files can go big 1 terabytes. know languages/technologies used similar problems, java, bash, awk, , python. don't know 1 can work such big file, , kind on tricks , tweaks needed. as long process file line line , assemble statistics, doesn't matter tool choose. java has advantage in terms of speed, compared scripting languages, in end difference constant factor. matters algorithm utilize process file. java python bash awk

c# - Using DbContext as a Repository -

c# - Using DbContext as a Repository - currently working on project in read, process , store products. using entity framework 6 read , write mysql database. after building prototype , fetching statistics, found storing new products in database takes (relatively) much time. have been asked improve this, can't figure out best alternative is. currently, every read , write happens in using block. since first time using entity framework 6, did research , vast bulk of stackoverflow said should always utilize using block. did. code snippet of how looks now; public int getsomeid(string somestringtomatchwith) { using (var db = new mydbcontext()) { homecoming db.sometable.where(t => t.somestring == somestringtomatchwith).firstordefault().id; } } public void savesomedata(int someid) { using(var db = new mydbcontext()) { db.sometable.add(new sometable{ id = someid }); db.savechanges(); } } i have been told mysql work fa

ios - tapping on another uitextfield does not close the keyboard -

ios - tapping on another uitextfield does not close the keyboard - i have multiple uitextfields on view , in mehtod: - (void)textfielddidendediting:(uitextfield *)textfield i calling: [textfield resignfirstresponder]; but not hide keyboard when switching between uitextfields, want close because uitextfields open other views. i have checked events firing. i have seen reply here doesn't help: tapping between uitextfields in ios7 if want close keyboard hitting specific textfield, give tag textfield , implement delegate method this: - (bool)textfieldshouldbeginediting:(uitextfield *)textfield { if (textfield.tag == 1) { [self.view endediting:yes]; homecoming no; } else homecoming yes; } ios uitextfield uikeyboard

c# - Nested Data Contract Exception in WCF - Cannot Implicitly convert Entity's model to model defined in DataContract -

c# - Nested Data Contract Exception in WCF - Cannot Implicitly convert Entity's model to model defined in DataContract - problem statement: in mvc 4 application,i have index view(list view) i'm bringing info multiple tables. i'm able bind info grid , fetch values.now i'm converting method involved in fetching info mvc controller wcf method,where i'm facing problems in conversion able controller code.following code have been using: working code: controller: public actionresult index() { var result = getindexdata(); homecoming partialview(result); } public ienumerable<globalupgrademodel> getindexdata() { homecoming (from u in db.upgrade.asenumerable() bring together in db.asset.asenumerable() on u.id equals a.id a.assetid == u.assetid orderby u.assetid select new globalmodel() { assetmodel = a, upgrademodel = u }).distinct()

android - Convert Mat to Blob and then back to Mat -

android - Convert Mat to Blob and then back to Mat - basically tring face recognition using opencv android need convert mat image received during face detection via inputframe.gray(); in cvcameraviewframe blob byte[] save sqlite database , while recognition convert byte[] mat file can used in .cpp files in jni folder recognition code native. [edit] it turned out quite easy androids onboard methods: import org.opencv.core.mat; import android.content.context; import android.content.contentvalues; import android.database.cursor; import android.database.sqlite.sqlitedatabase; import android.database.sqlite.sqlitedatabase.cursorfactory; import android.database.sqlite.sqliteopenhelper; class sqtable extends sqliteopenhelper { string table = "mydb"; public sqltable(context context, string name, cursorfactory factory, int version) { super(context, name, factory, version); } @override public void oncreate(sqlitedatabase db) {

Sugar ORM in Android: update a saved object in SQLite -

Sugar ORM in Android: update a saved object in SQLite - i'm new app development using sqlite , sugar orm on android, , have tried read through sugar orm documentation, didn't find how update saved object in sqlite. can still save object after changing properties? like: customer mycustomer = (customer.find(customer.class, "id = ?", id)).get(0); mycustomer.setname("new name"); mycustomer.setaddress("new address"); mycustomer.save(); // okay updating object? the save() method won't create new object while leaving old entry untouched, right? it update entity. sugar orm overwriting existing e.g name , updated "new name" after save() method call. android sqlite orm crud

php - How Facebook/Gmail's 'logout from other devices' works? -

php - How Facebook/Gmail's 'logout from other devices' works? - anyone can please tell me how facebook/gmail's 'logout other devices' works?i'm developing website login scheme , want user able login multiple devices , remotely log out other devices. in login scheme i've developed cookie created when user logs in 'remember me' alternative checked , key stored in database.it possible log out user browser deleting keys respective browser/ip. if user doesn't checks 'remember me' option?i'm stuck here.. i think should go oauth provide secure delegated access website resources. generate authentication token log website different devices. if user selects remember me option, encrypt , store user credentials (including oauth token) in local machine. nullify these credentials if user logs out. php session browser login device

Angularjs rest call example -

Angularjs rest call example - !doctype html> <html ng-app="formmodule"> <body> <form method="get" ng-submit="submit()"> <div ng-controller="submitcontroller"> username :<input type="text" ng-model="uname"></br> password :<input type="password" ng-model="pwd"></br> <button ng-click="submit()">submit</button> </div> </form> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script> <script> var app=angular.module("formmodule",[]); app.controller("submitcontroller",function ($scope,$http) { $scope.submit = function () { var url = 'htttp://9.oo4.000.224:2020/restdemo/rest/user/'+$scope.uname+'/'+$scope.pwd; console.debug(url); $http.get(url).success(function (data) {

angularjs - How to resend request when not authorized -

angularjs - How to resend request when not authorized - i implemented authinterceptorservice when response not authorize send request new token , want resend previoes request. need store somewhere , resend, best way it? var _responseerror = function (rejection) { if (rejection.status === 401) { var authservice = $injector.get('authservice'); var authdata = localstorageservice.get('authorizationdata'); if (authdata) { authservice.refreshtoken().then(function (response) { //redirect original request }, function (err) { $location.path('/login'); }); } authservice.logout(); $location.path('/login'); } homecoming $q.reject(rejection); } why not create own request? // define original request var originalrequest = function( i

hadoop - Remove brackets and commas in output from Pig -

hadoop - Remove brackets and commas in output from Pig - currently output below: ((130,1)) ((131,1)) ((132,1)) ((133,1)) ((137,1)) ((138,2)) ((139,1)) ((140,1)) ((142,2)) ((143,1)) i want have like: 130 1 131 1 132 1 my code given below: a = load 'user-links-small.txt' (user_a: int, user_b: int); b = order user_a; grouped = cogroup b user_a; c = foreach grouped generate count(b); d = cogroup c $0; e = foreach d generate($0, count($1)); dump e; i looking through these forums, , suggested way coding user-defined function. can seek that, new pig , want larn functions bit more in details. found on flatten() can't output. there way remove brackets , commas shown? in advance help! if utilize dump command default output stored tuples (ie fields dumped within function bracket separated delimiter ',') you can remove first bracket using flatten operator , sec bracket , ',' using store command. try e = foreach d generate flatt

c++ - Qt Creator crashes when using multiple threads -

c++ - Qt Creator crashes when using multiple threads - i'm writing qt (5.3) programme has joystick test ui in it, need separate thread infinite while loop looking joystick axis/button value changes through sdl. part of code working fine can have thread qdebug() messages , seems work. main window, when seek open test joystick ui, programme crashes. i've had test joystick ui running separation without joystickthread thread , seems open fine. the error messages inconsistent though - times, get the programme has unexpectedly finished. /home/narendran/qtworkspace/build-linkcontrol-desktop-debug/linkcontrol crashed this has shown once: qxcbwindow: unhandled client message: "_gtk_load_iconthemes" and few other times: [xcb] unknown sequence number while processing queue [xcb] multi-threaded client , xinitthreads has not been called [xcb] aborting, sorry that. star: ../../src/xcb_io.c:274: poll_for_event: assertion `!xcb_xlib_threads_s

objective c - Removing 64-bit support for a separate file (compile flag?) xcode -

objective c - Removing 64-bit support for a separate file (compile flag?) xcode - i using c files in objective-c project stopped working. figured out problem disappears when remove arm64 valid architectures alternative in build settings. have limited experience in c , rather not rewrite of c files. my question if there way me remove arm64 back upwards few of files instead of turning off whole project. objective-c c xcode compiler-flags arm64

node.js - Node ssh2 library private key error -

node.js - Node ssh2 library private key error - getting next error node ssh2 module, error: unable parse private key while generating public key (expected integer version) i've logged key , looks okay, cause this? relevant code privatekey: require('fs').readfilesync(__dirname + '/config/id_rsa', 'utf8'), node.js ssh

asp.net web api2 - Web Api 2 Odata and versioning -

asp.net web api2 - Web Api 2 Odata and versioning - we trying implement odata feed using web api 2 consumed various clients. when seek powerfulness query excel seeing unusual behavior seems relate powerfulness query sets next headers in request: maxdataserviceversion: 3.0 odata-maxversion: 4.0 when using v3 version of odata web api 404 response (if same request replayed in fiddler without odata-maxversion things work) when using latest v4 version web api 403 response (if same request replayed in fiddler without maxdataserviceversion things work) is config issue or bug? odata asp.net-web-api2

netlogo - How to place turtles in a portion of a raster dataset? -

netlogo - How to place turtles in a portion of a raster dataset? - from gis extension , imported netlogo raster represented in orange in figure below. objective randomly place 1 turtle in each block of raster represented in bluish (namely in 9 blocks). bluish raster portion of orange raster. here code randomly place turtles in blocks let number 1 inquire n-of number patches [ (max-pxcor - ((x-increment + 1) * (max-pxcor / 3))) <= pxcor , pxcor <= (max-pxcor - (x-increment * (max-pxcor / 3))) , (max-pycor - ((y-increment + 1) * (max-pycor / 3))) <= pycor , pycor <= (max-pycor - (y-increment * (max-pycor / 3))) ] [ sprout 1 ] from orange raster in netlogo, how can apply code above in bluish raster ? here rasters: thanks much help. how this? ask patches [pcolor = blue] [ sprout 1 ] i suspect doesn't reply question. that's because don't understand question. if can tell me why above code isn't you're looking for, perhap

java - HashMap string key -

java - HashMap string key - i have bug in android app , can't find what's wrong, there think problematic , need help that. i have next hashmap hashmap<string, string> numbers = new hashmap<string, string>(); and i'm inserting info so, numbers.put("1", "one" ); numbers.put("2", "two" ); then search this, numbers.get("1"); is correct? please note above working fine except see weird behavior mentioned earlier update, forgot add together " in put. no, won't work. should putting , getting same type of keys. perhaps meant numbers.put("1", "one"); java android

Ajax JSON and jsp -

Ajax JSON and jsp - i have created form info page using jsp , apply ajax phone call , want store info in ms access found difficulty form info not store , console doesn't show error.. please guide me.. my login.jsp <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <!doctype html> <html> <head> <title>login</title> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script type="text/javascript"> function senddata() { alert("i m in senddata function"); var email=$('#email').val(); var name=$('#name').val(); var password=$('#password').val(); alert("i in senddata mode"); var jsondataobject=new object(); alert(&

java - Starting a WebAppContext in isolation -

java - Starting a WebAppContext in isolation - i trying start jetty server web context. web.xml passing contains custom class (for different reasons) on classpath of code executing code below. expect jetty not able find class specified in web.xml , does. how build new server webappcontext not load classes current context? the code below in scala, should give thought have tried. if reply java fine. // reference root class loader, 1 should not know // of custom classes val rootloader = { // recursive method find loader without parent def parent(loader:classloader):classloader = { val p = loader.getparent if (p == null) loader else parent(p) } parent(getclass.getclassloader) } // check if custom classfile available rootloader val classname = classof[my.custom.servlet.classfile].getname val classavailable = seek { rootloader.loadclass(classname) true } grab { case e:classnotfoundexception => false } // if i'm not insane no erro

mongodb - Mongo UUIDs vs ObjectId creation and performance -

mongodb - Mongo UUIDs vs ObjectId creation and performance - i considering using uuids v1 document indexes instead of objectid. concerned performance , unsure of best way proceed switching uuids. my performance concern stems comments objectid beingness more efficient b-tree/indexing. kind of performance issues looking at? my other concern unique factor. creating api store publicly accessible documents , have consider sharding. , there document mongo issues objectids uniqueness , sharding. i not clear on issues might arise ability check uniqueness across shards , if create problems situation. (basically people can create documents website or api , search them same way. lets think in low millions of documents sake of question. more concerned fetches lots of parallels inserts). it seems there pros , cons both types of ids. can clarify this? mongodb

apache - subdomain wildcard .htaccess for escape cloudflare -

apache - subdomain wildcard .htaccess for escape cloudflare - i have example.com domain , set on cloudflare. time don't need utilize cloudflare, create up.example.com subdomain , unused of cloudflare it. park on main domain. means example.com , up.example.com point root site. cover duplicate content in seo, need .htaccess file. these items of import me: all urls under main domain (example.com) must open , accessible. the main page don't open subdomain (up.example.com) , open main domain (example.com). all address upload controller must accessible subdomain. example: up.example.com/upload/ the word after controller (my action) contain a-z, 0-9 (because don't allow utilize dot point file) about urls path must don't accessible subdomain , must 404 error. for this, write code here: rewriteengine on rewritecond %{http_host} ^up\..+ [nc] rewritecond %{request_uri} !^(/upload/?[a-z,a-z,0-9]*)$ [nc] rewriterule . - [r=404,l,ns] # hide index.php , used y

arrays - PHP: Parsing a Post Response containing Multipart Form Data -

arrays - PHP: Parsing a Post Response containing Multipart Form Data - i have been working api , used run cron job , create api phone call every 5 minutes. introduced feature similar paypal ipn posts variables 1 time order gets response. i did print post variables , mailed have @ response be. code used. $post_var = "results: " . print_r($_post, true); mail('email@mail.com', "post variables", $post_var); and got in mail. results: array ( [--------------------------918fc8da7040954f content-disposition:_form-data;_name] => "id" 1 --------------------------918fc8da7040954f content-disposition: form-data; name="txn" 1234567890 --------------------------918fc8da7040954f content-disposition: form-data; name="comment" test comment --------------------------918fc8da7040954f content-disposition: form-data; name="connectid" 1 --------------------------918fc8da7040954f content-disposition: form-data;

c# - Append values to a column value in database -

c# - Append values to a column value in database - i want append big string values existing values of column value in db. column set nvarchar(max) . when trying, first few parts of new string appending old value. others not appending. please suggest . string initial_result ="xxxxxx";//reading values db column , assigning string string final_result="yyyyyyyyyy";//lengthier 1 sqlcommand cmd71 = new sqlcommand("update details set result='" + initial_result + "'+'"+finalresult+"' student_id ='11' ", con7); cmd71.executenonquery(); because using unnecessary single quotes when concatenate initial_result , finalresult values. result='" + initial_result + "'+'"+finalresult+"' ^ ^ but more important, should utilize parameterized queries. kind of string concatenations open sql injection attacks. also utilize usin

opencv - Why do we need to move the calibration object for pinhole camera calibration? -

opencv - Why do we need to move the calibration object for pinhole camera calibration? - is there particular reason why need multiple poses (e.g. varying z or rotation) obtain focal length , principal point photographic camera matrix? in other words, sufficient calibrate pinhole photographic camera single pose? i.e. keeping location of calibration object (let's standard checkerboard) constant? i assume asking in context of opencv-like photographic camera calibration using images of planar target. reference algorithm used opencv z. zhang's classic paper . give-and-take in top half of page 6 shows n >= 3 images necessary calibrating 5 parameters of pinhole photographic camera matrix. imposing constraints on parameters reduces number of needed images theoretical minimum of one. in practice need more various reasons, among them: the need have plenty measurements overcome "noise" , "random" corner detection errors, while using practical