Posts

Showing posts from March, 2015

Is it possible to create a temporal table in SQL Server 2016 using Entity Framework code-first technique? -

i have requirement create temporal table using entity framework code-first. searched many links didn't find information links. possible create temporal tables using entity framework code-first technique? native ef support still on to list . now, have ef create normal table, , in ef migration, add custom sql convert table temporal .

tensorflow - Invalid argument : You must feed a value for placeholder tensor with dtype float and shape [64,1] -

i got unexpected error when running below code : ith tf.session(graph=graph) session: tf.initialize_all_variables().run() print('initialized') mean_loss = 0 step in xrange(num_steps) : print ("train data ",len(train_data)) batch_inputs, batch_labels = generate_batches(train_dataset, batch_size=64, unrollings=5) feed_dict = dict() in range(unrollings): batch_labels[i] = np.reshape(batch_labels[i], (batch_size, 1)) batch_inputs[i] = np.array(batch_inputs[i]).astype('int32') batch_labels[i] = batch_labels[i].astype('float32') print (train_inputs[i], train_labels[i]) feed_dict = {train_inputs[i] : batch_inputs[i], train_labels[i] : batch_labels[i]} _, l, predictions, lr = session.run([optimizer, loss, train_prediction, learning_rate], feed_dict=feed_dict) mean_loss += l here generating batches, lstm cell , calculating loss code : def generate_batches(raw_data, batch_size, unrollings): global data_ind

node.js - download binary excel response from nodejs in angular 2 -

am new angular 2 , having difficulties downloading xlsx file api(node). have gone through discussion issues can't seem figure going wrong. this have done . node api res.setheader('content-type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); res.setheader("content-disposition", "attachment; filename=" + filename+".xlsx"); workbook.xlsx.write(res) .then(function() { res.end(); }); angular 2 post request let bodystring = json.stringify(body); let headers = new headers( { 'content-type': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' , 'x-access-token':localstorage.getitem('auth_token') , 'accept': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', }); let options = new re

wordpress - Select a post from select box and display its featured image -

i have post select box , want display featured image of post while selecting post select box.something select post select box , display featured image of post below. http://prntscr.com/d5e3ad custom js file code is var $ = jquery; $(document).ready(function(){ $("post-thumb").css("display", "none"); $("#vzxms-post-slct").on('change', function(e){ e.preventdefault(); $slct_val = $("#vzxms-post-slct").val(); console.log($slct_val); $.ajax({ url: ajaxurl, data: $slct_val, success: function(data){ $("#post-thumb").css("display", "block"); } }); }); }); and plugin index file form in div wrap <form method="post" action=""> <div class="form-group-field"> <div class="left_label"><label> select post </

BASH: Concatenated string variable unable to be used by select inside function -

in "hostmenu" function below want concatenated strings $site , $system used identify array used build next menu. functions "sitemenu" , "sysmenu" set 2 required variables needed set $sitesystem. arrays defined outside of functions. problem having "$sitesystem" ends empty when select goes use it. echo of "$sitesystem shows positional parameters "site""system" (example: "siteasysb") instead of strings defined in array "$siteasysb". how can have have select use "$sitesystem" variable? #!/bin/bash main () { sitemenu sysmenu hostmenu } ## functions omitted set $site , $system ## hostmenu () { ps3="please choose $site $system device connect to.." clear sitesystem=("$site""$system") echo $sitesystem select opt in "${sitesystem[@]}" case $opt in ## omitted selected host section ## ;; "return previous system men

c - Using realloc in this code - Size of my array not increasing -

this question has answer here: getting size of data of pointer 5 answers i have been programming in c++ while learning c. trying following code trying understand behaviour of realloc strcture struct foo{ int a; int b; }; and how using it.initially want create array of size 2. (which manage do). increase size of same array 3 preserving previous content use realloc . code //create array of size 2 struct foo* farry = malloc(2 * sizeof(struct foo)); farry[0].a =1; farry[1].a =2; for(i=0 ; i<=(sizeof(farry)/sizeof(farry[0])) ; i++) { printf("value %d \n",farry[i].a ); } printf("-----increasing size of array \n"); //increase size int oldsize = sizeof(farry)/sizeof(farry[0]); farry = realloc(farry, (oldsize+1) * sizeof(struct foo)); printf("new size %d \n",sizeof(farry)/sizeof(farry[0]) ); farry[2].a =3; for(i=0 ; i<=(

ios - Exception while showing data from dictionary on custom cell -

i have dictionary having following details { name = "american airlines"; picture = ( "" ); rate = 3; }, and want show name on label of cell...for doing following code: -(void)viewwillappear:(bool)animated { [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(getdetail:) name:@"newnotification" object:nil]; } -(void)getdetail:(nsnotification *)notification { if([notification.name isequaltostring:@"newnotification"]) { nsdictionary *dictionary=notification.userinfo; nslog(@"dictionary %@",dictionary); userinfo=dictionary; [self.listview reloaddata]; } } -(nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section{ //return [userinfo count]; return 115; } -(uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath{ static nsstring *c

javascript - Change logo on navigation bar onscroll in striking multiflex theme -

i want change logo on navigation bar when scroll page down.i using wordpress 'striking multiflex theme" installed you can use jquery $(window).scroll() event handler $(window).scroll(function(){ var height = $(window).height(); var url = 'url new image'; if(height > 100){ $('.site-logo').attr('src',url); } })

html - Safari Scroll bar is not working when select list is in Div -

https://stackoverflow.com/a/31975798/7139696 there solution provided in above link have applied in application. solution not working in safari... can please help? the scrollbar doesn't work in safari, when pointing @ div scrolls when pointer @ scroll bar area. .wrap { height: 100px; width: 300px; overflow: auto; } .crop { overflow: hidden; display: inline-block; } select { border: none; margin: 0px -20px 0px 0px; /* hide unused scroll bar */ } <div class="wrap"> <div class="crop"><!-- add croping container --> <select multiple size="21"><!--add size attribute equal length of list--> <option>1 vsdjflksdj fkajsdk fasjd;fkl sdaj;fk asdjf asdkljf klsdaj;f lsdajfk l;sdjkflsdjf kasd;fjl end</option> <option>2 vsdjflksdj fkajsdk fasjd;fkl sdaj;fk asdjf asdkljf klsdaj;f lsdajfk l;sdjkflsdjf kasd;fjl end</option> <option>3 vsdjflksdj fkajsdk fasjd;f

jquery - How to hide and show modal boxes in angular2 -

i used ng2 modal not getting opened or hide through ts, template, <modal id='saveeditsmodal'> <modal-header> <h4 class="modal-title">editing item(s) in viewed</h4> </modal-header> <!-- modal content--> <modal-content> <div class="modal-body"> <p>you have unsaved changes.</p> </div> <div class="modal-body"> <p>are sure want discard these changes?</p> </div> </modal-content> <modal-footer> <button type="button" class="btn btn-primary" data-dismiss="modal">stay on list</button> <button type="button" class="btn btn-default" data-dismiss="modal" (click)='closebox()'>discard</button> </modal-footer> </modal> my ts,

Android adapter dataset instantiation practices with Realm -

i wondering matter instantiate adapters dataset realm? fetch data adapter needs in adapters constructor , instantiate dataset there, examples i've seen fetch data beforehand in activity creating adapter , pass adapter parameter. with sqlite seems more arbitrary, since i'm using realm need open realm connection every time want access database , keep data available need keep connection open. keeping connection open in activity seems unnecessary since might need make queries in adapter having open connection realm within adapter anyways. is there higher reason fetch dataset beforehand or matter of preference? since i'm using realm need open realm connection every time want access database wrong, need 1 open instance given thread in order access database. keeping connection open in activity "seems unnecessary" since might need make queries in adapter in case can have activity-level realm instance "scoped dependency", can share

asp.net mvc 4 - I need to update the model view and reflect those changes in database -

here,i have typed view in i'm showing registered user his/her data in form allow updating edited data , make changes reflected database. i have written code action methods in both , post method accordingly can't figure out what's causing issue.the issue changes made on view page binded model class not reflected database table though have written method db.submit changes(). below code: , post action methods detailsupdate view page: [httppost] [validateantiforgerytoken] public actionresult patientdetailspage2(patients p) { if (modelstate.isvalid) { tblpatient updatedpatientdetail = new tblpatient() { patientname = p.patientname, patientage = (short) p.age, patientmail = p.patientemail, patientmobileno = p.patientmobileno, patientpassword = p.patientpassword

docker - How to allow my host IP address in the PostgreSQL pg_hba.conf file -

i'm having postgresql instance running on local machine, listening on interfaces ( listen_addresses = '*' ), , docker running rails application needs connect database. updating manually pg_hba.conf file adding line allowing ip address makes application working. now, given computer has ip address 192.168.1.10, how allow ip address in pg_hba.conf , dynamically in case ip address changes, file updated , postgresql continue accepting connections? (my point don't want allow 192.168.1.0 network, otherwise colleagues gonna able connect db, don't want :))

html - Long loading Javascript (modal window) -

on site http://nashedom.ru there js scripts. fast. the modalka fancybox pages (for login users, in user cabinet, page объявления -> добавление объявления) slow. in chrome loading 25-28 seconds. in firefox - 2,5 seconds. the data taken out of context. html: {% load hosts %} <div class="b-header"> <div class="b-header__menu"> <div class="container"> <div class="row"> <div class="col-xs-12"> <div class="b-menu"> <a>...</a> <a>...</a> <a>...</a> <a>...</a> <span class="b-menu__item btn_change-location"> <a href="#change-location" class="fancybox dashed"> {% if user.is_authen

sql - How to count consecutive days and group by year -

i want count consecutive days (rows) , easy (given answers similar questions). in data set have groups of consecutive rows dates such as: 1. 30/12/2010 2. 31/12/2010 3. 01/01/2011 4. 02/01/2011 looks 1 group (4 consecutive days), split group 2 groups. when having: 1. 30/12/2010 2. 31/12/2010 3. 01/01/2011 4. 02/01/2011 5. 05/01/2011 6. 06/02/2011 7. 07/02/2011 i see grouped 4 groups (not three): 1. 30/12/2010 2. 31/12/2010 3. 01/01/2011 4. 02/01/2011 5. 05/01/2011 6. 06/02/2011 7. 07/02/2011 i'm using sql server 2014 you can number rows this: declare @t table(id int, dt date); insert @t values (1, '2010-12-30'), (2, '2010-12-31'), (3, '2011-01-01'), (4, '2011-01-02'), (5, '2011-01-05'), (6, '2011-02-06'), (7, '2011-02-07'); cte1 ( select *, year(dt) temp_year, row_number() on (order dt) temp_rownum @t ), cte2 ( select cte1.*, datediff(day, temp_rownum, dt) temp_dategroup cte1 ) s

Android code for Fastest Way to retrieve data from web server to android! Native method or 3rd party library? -

i using asynctask download json string webserver. while debugging code realized time taken transfer control function call in background taking time. public class downlog extends asynctask<string, string, string>{ // ... } after entering in background data downloaded little faster. want know how download data fast definetely third party library (if don't want reinvent wheel :) )

How to Create Custom Plugin to Add Dynamic Navigation Menu in Wordpress -

i try integrate php dynamic code directly not working properly...please solve problem how create plugin........ want create plugin using core php.................. <?php /* plugin name: # plugin uri: # description: # version: 1.0 author: # author uri: # */ ?> <?php $dbcon = new mysqli("localhost","root","","wp2"); ?> <!doctype html> <html> <head> <title>dynamic dropdown menu using php , mysqli</title> <script type="text/javascript" src="jquery.js"></script> <link rel="stylesheet" type="text/css" href="style.css" media="all" /> </head> <body> <div id="head"> <div class="wrap"><br /> <label><a href="add_menu.php">add menu here</a></label> </div> </div> <div class="wrap"> &l

Getting error when drawing polylines using python and opencv -

i getting error: file "c:/python27/drawinginthevideo.py", line 22, in cv2.imshow('frame 2', frame2) cv2.error: ........\opencv\modules\highgui\src\window.cpp:261: error: (-215) size.width>0 && size.height>0 in function cv::imshow and using code: import numpy np import cv2 cap = cv2.videocapture('vid2.mp4') # open video file while (cap.isopened()): ret, frame = cap.read() # read frame try: cv2.imshow('frame', frame) frame2 = frame except: # if there no more frames show... print('eof') break line1 = np.array([[100, 100], [300, 100], [350, 200]], np.int32).reshape((-1, 1, 2)) line2 = np.array([[400, 50], [450, 300]], np.int32).reshape((-1, 1, 2)) frame2 = cv2.polylines(frame2, [line1], false, (255, 0, 0), thickness=2) frame2 = cv2.polylines(frame2, [line2], false, (0, 0, 255), thickness=1) cv2.imshow('frame 2', frame2) #

python - How to transmit Sockets between Celery tasks -

my celery tasks creating connections send data on them , if connection not ready writing (if it's blocking much) want send connection queue used when it's ready writing (so task sending data queued again) in other words , i'm trying transfer socket objects in celery , problem socket objects not serializable . the question is: there way transmit open connections between celery tasks? (by way, if think approach bad, welcome advise me better one)

How to pass the same value as Cash On Delivery to PayOnline in android -

i have 2 radio group button (cash on delivery , payonline) when click cash on delivery passes related data of cart , customer detalis, when click payonline passes activity ask fill amount...?? using atom payment gateway library here code activitypayment.java package com.www.prashant; import android.app.progressdialog; import android.content.intent; import android.os.asynctask; import android.os.bundle; import android.support.annotation.nullable; import android.support.v4.app.fragment; import android.util.log; import android.view.layoutinflater; import android.view.menuitem; import android.view.view; import android.view.viewgroup; import android.widget.*; import com.atom.mobilepaymentsdk.payactivity; import org.ksoap2.soapenvelope; import org.ksoap2.serialization.soapobject; import org.ksoap2.serialization.soapserializationenvelope; import org.ksoap2.transport.httptransportse; import org.xmlpull.v

c# - Sonar Build error after Sonar version upgrade -

we have upgrade our sonar dev server following details of same: sonar server : 4.5.2 5.6.3, c# plugin : 3.3 5.3.2 sonar runner (sonar scanner) : 2.4 2.8 post-upgrade, our xaml build getting partially succeeded error. warning is 15:05:30.046 warn: * use msbuild 14 best analysis results * 15:05:30.046 warn: * use of msbuild 12 or sonar-scanner analyze c# projects deprecated * 15:05:30.046 warn: we using msbuild version 14.0 still showing warning regards dushyant padhya

Start Server in windows powershell in cuba-plattform -

is possible change cuba configuration start tomcat server in windows power shell window , not in dos window? regards karl you can create shell script invoked instead of cmd.exe /c ... when studio starts application server. path script should specified in cuba_tomcat_start_script environment variable. see cuba gradle plugin code details.

How to format a JavaScript date -

how can format javascript date object print "10-aug-2010"? function formatdate(date) { var monthnames = [ "january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december" ]; var day = date.getdate(); var monthindex = date.getmonth(); var year = date.getfullyear(); return day + ' ' + monthnames[monthindex] + ' ' + year; } console.log(formatdate(new date())); // show current date-time in console you can edit array monthnames use jan, feb, mar, etc..

javascript - Issue with let keyword -

i playing code , ran situation couldn't identify why 'let' behaving way does. for below block of code: var x = 20; // global scope function f() { let x = x || 30; } f(); // vm3426:1 uncaught referenceerror: x not defined(…) i error 'x not defined' on executing f(). understand 'let' variables not hoisted since 'x' has global copy, why isn't line inside function 'f' defaulting global copy instead of throwing error? 'let' set variable undeclared (instead of 'undefined' var because of hoisting) @ beginning of function? there way global copy of 'x' within function? the exception right side x - when initializing block-scope x variable global 1 "forgotten" new 1 still not being declared , cannot used during initialization compare explicit calling global one function f() { let x = window.x || 30; } also take @ this mdn article let dead zones

ASP.NET MVC5 / bootstrap validator email Validation Attribute related to any RFC? -

i'm struggling documentation app i'm writing. have email validation on data models, using bootstrap validation on frontend. does know validator related rfc document? rfc822 ? need specify , did not find info far.

osx - fly execute on localhost fails -

i have simple task want execute on local concourse instance: build-frontend.yml --- platform: linux image_resource: type: docker-image source: repository: node tag: 'latest' inputs: - name: client-devops run: path: client-devops/scripts/test the task executed: client-devops daka$ fly -t frontend execute --config build-frontend.yml executing build 1 % total % received % xferd average speed time time time current dload upload total spent left speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) failed connect localhost port 8080: connection refused gzip: invalid magic tar: child returned status 1 tar: error not recoverable: exiting exit status 2 the target available: client-devops daka$ fly targets name url expiry frontend http://127.0.0.1:8080 fri, 11 nov 2016 09:13:55 utc why can&

winforms - How to call progress bar defined in wcf service - c# -

i have client(winforms application)/server (wcf service) doing complex logic writes packets remote host - process takes 20 minutes write specific point not complete. want show progress , attempt continue last stopped in client application in form of progress bar. //service: public class serviceimplementation: iserviceinterface{ progressbar pgbar = new progressbar(); public void complexfunction(byte[] data_to_send, uint32 start_addr){ pgbar.maximum = data_to_send.length; for(int = 0; < data_to_send.length; += 64){ //do logic } pgbar.value = i; } } //client private void btnprogcomplexfunction_click(object sender, eventargs e){ callcomplexfunction } void callcomplexfunction(){ serviceimplementation.serviceimplementationclient proxyinstance = new serviceimplementation.serviceimplementationclient(); //i attempted doing following doesn't work because progress bar returns integer (e.g pgbar.value = 100;). prob

Splash screen duration time automation Appium -

my spash screen gets displayed few seconds on android .can check duration of time of screen using appium code? please share code this. thanks akshat jain you can't accurate time between activities, can approx time. regrading splash screen time differ different apps, since lot more background thread running. once app gets specific data move other screen. we can try first time interval between while starting splash screen till next screen display.

html - How do i put a Row in bottom of Thumbnail Bootstrap -

i tried add row bottom of div thumbnail can't seem right, nor find working answer. <div class="item col-lg-4"> <div class="thumbnail"> <div class="caption"> <h4 class="list-group-item-heading"><?php echo $row["name"]; ?></h4> <p class="list-group-item-text"><img style="width: 100%; padding-bottom: 10px;" border="0" src="<?php echo $row["description"]; ?>"></p> <div class="row"> <div class="col-md-6 "> <p class="lead"><?php echo '€'.$row["price"].' euro'; ?></p> </div> <div class="col-md-6 "> <a class="btn btn-success" href=&

php - Updating a Mapbox dataset via cURL -

i'm new here, though wandered lot in forums, looking answers many questions :) i'n not coder @ learn myself, , time wanted create mapbox map work. created dataset, 5 polygons property named "status" 3 different values ("high", "medium" , "low"), linked different color. wanted create html/php form access dataset , change status. according mapbox doc, needs done via curl requests. i succeded use curl decode mapbox json dataset, designed way : array (size=4) 'type' => string 'feature' (length=7) 'properties' => array (size=1) 'status' => string 'low' (length=3) 'geometry' => array (size=2) 'coordinates' => array (size=1) 0 => array (size=9) ... 'type' => string 'polygon' (length=7) 'id' => string '21f9760f204c673ede61f96202c005bc' (length=32)

JAVA - swing - draw/fill with invert/negated colors of destination canvas -

i cannot find info on how draw shapes on graphic canvas, making sure draw not same color background there solutions out there use images drawing per pixel operations/loops or filters; tried different composite operations, none suit want so lets g.setcolor(color.white) // relevant in case ? not sure g.fillrect(...) i want rectangle in inverted colors of background visible sorry cant provide more code, dont know how achieve this thanks your paint method retrieve current color, , search complementary color: color originalcolor = g.getcolor(); g.setcolor(complementarycolor(originalcolor)); g.fillrect(0, 0, 50, 50); the complementarycolor method inspired topic : reverse opposing colors color complementarycolor(final color bgcolor) { color complement = new color(255 - bgcolor.getred(), 255 - bgcolor.getgreen(), 255 - bgcolor.getblue()); return complement; }

Unable to print usernames longer than 8 chars with "w" in linux -

i doing linux script extract users logged onto machine, where, , how long have been idle. far have been using "w" command in linux. noticed truncates usernames , source i have 3 users logged on testuser testuser-new lala-testuser they logged on either: testserver, or superdupertestserver the output of w is: testuser pts/2 testserver 10:12 29.00s 0.15s 0.15s -bash testuser pts/3 superdupertestse 10:12 21.00s 0.18s 0.18s -bash lala-tes pts/4 superdupertestse 10:12 21.00s 0.18s 0.18s -bash i using "long listing" of output. there way fix this, or information source w using? man w: environment procps_userlen override default width of username column. defaults 8. procps_fromlen override default width of column. defaults 16.

osx - Unabl to install PHP extension OpenSSL on OS X using phpize -

i have been trying install php version 5.5.34 extension openssl magento2 because won't pass magento process installation if don't have openssl extension. don't seen able install neither way phpize or compiling php source. phpize this ok: sudo phpize this fails: sudo ./configure` fail error `configure: error: cannot find < evp.h > compiling source this ok: sudo ./configure --prefix=/usr/local --mandir=/usr/share/man --infodir=/usr/shar e/info --sysconfdir=/private/etc --with-libdir=lib --enable-cli --with-config-fi le-path=/etc --with-config-file-scan-dir=/library/server/web/config/php --with-l ibxml-dir=/usr/local/opt/libxml2 --with-mssql --with-pdo-dblib --with-apxs2 --wi th-openssl=/usr/local/opt/openssl this fails: sudo make fail error **undefined symbols architecture x86_64: "_pkcs5_pbkdf2_hmac", referenced from: _zif_openssl_pbkdf2 in openssl.o ld: symbol(s) not found architecture x86_64 clang: error: linker command fail

java - Call void method and pass trought arguments RxJava -

i'm looking better : mrestservice.login(email, password) // login user in .flatmap(user -> observable.zip( mrestservice.start(user._token), // start session observable.just(user), (v, u) -> (user) u // pass user throught )) .subscribe(user -> { }, throwable -> { }); but coudn't come better. the start method on mrestservice perform side effect. can use doonnext method here sort of side effect. mrerstservice.login(email, password) .doonnext(u -> mrestservice.start(user._token)) .subscribe();

r - RStudio can't find installed packages -

i updated osx sierra , rstudio can't find packages. seems looking in right place (deseq2 nr. 30 on list): > library(deseq2) error in library(deseq2) : there no package called ‘deseq2’ > .libpaths() [1] "/library/frameworks/r.framework/versions/3.3/resources/library" > list.files("/library/frameworks/r.framework/versions/3.3/resources/library") [1] "acepack" "airway" "annotate" "annotationdbi" "assertthat" "base" [7] "base64enc" "bh" "biobase" "biocgenerics" "biocinstaller" "biocparallel" [13] "biocstyle" "biomart" "biostrings" "bitops" "boot" "catools"

javascript - Add additional bar lines in highcharts x axis -

Image
i have 1 chart in application.i have customize chart below image here working fine how draw bar lines in x axis,whether possible or not.i adding 1 fiddler can me draw bar line every bar code highcharts.chart('container', { chart: { type: 'column' }, title: { text: 'stacked column chart' }, xaxis: { categories: ['apples', 'oranges', 'pears', 'grapes', 'bananas'] }, yaxis: { min: 0, title: { text: 'total fruit consumption' }, stacklabels: { enabled: true, style: { fontweight: 'bold', color: (highcharts.theme && highcharts.theme.textcolor) || 'gray' } } }, legend: { align: 'right', x: -30, verticalalign: 'top', y: 25, floating: true, background

angularjs - Angular JSONP showing Uncaught SyntaxError: Unexpected token : -

i'm trying retrieve data object using jsonp getting message uncaught syntaxerror: unexpected token : my js codes: factory datafactory.getgroupdetails = function(id) { return $http({method: 'jsonp', url: get_base_url().concat("group-setting?id=").concat(id)}); }; call angular controller dataprovider.getgroupdetails(id).then(function( response ) { console.log(response.id); ); server site script: die(json_encode( ['id' => $group_id] )); how solve problems. suggestion appreciated.

java - How to add Custom Renderer for row in nebula GridTableViewer -

i working on nebula gridtableviewer. there 2 columns in table. want make each row of 1st column header. if use tablegrid.setrowheadervisible(true) , display numeric value. don't want this, have display 1st column header. when dug deeper, found class defaultrowheaderrenderer used add row header. how can customize this? please me this.

python - BeautifulSoup html -- load from memory? -

i'm using beautifulsoup in python 3.5 parse html. while can load file, need load memory because http request. i've google found nothing loading html beautifulsoup memory. possible? if using version 4 of beautifulsoup, try passing request data it from bs4 import beautifulsoup import requests # replace following url response = requests.get("https://www.python.org") soup = beautifulsoup(response.text,"html.parser")

r - Extract Characters/String before Space from a factor data type column -

this question has answer here: remove after space in string in r 3 answers i have r data frame in 1 column has factor data type text in column. want extract string column considering text before space. tried gsub( " .*$", "", data[, 3] ) ,where summary field.but not working. example: data "abcd efgh ijk" & want "abcd" tried convert factor field character field using data[, 3] <- sapply(data[, 3], as.character) but it's failed retrieve string before first space. can please help? sorry can't able put data here client data or x <- "abcd efgh ijk" strsplit(x, " ")[[1]][1]

go - Can't create copy of variable of type map[int]Struct in another variable by just assigning one variable to another -

i have map : cart := map[10033207:{10033207 3 425 126} 10012761:{10012761 4 40 0}] i want create copy of cart in variable tempcart can modify tempcart temporary usage in function. want cart value remains same. tempcart := cart //some operation modifies temp cart , make //map[10033207:{10033207 2 425 126} 10012761:{10012761 1 40 0}] the problem when modify tempcart , somehow cart getting modified , becomes equal tempcart . later when print value of cart get: map[10033207:{10033207 2 425 126} 10012761:{10012761 1 40 0}] , not original value map[10033207:{10033207 3 425 126} 10012761:{10012761 4 40 0}] . i can't understand reason behind , want know solution of how create copy of cart . edit: question has been marked duplicate copy 1 map another knew how copy 1 map anothor, prime question why couldn't assign 1 map variable. why have copy in loop. to copy map use for k,v := range originalmap { newmap[k] = v }

sorting - How can i sort addtoset grouped results mongoDB query -

currently have following: db.questionanswers.aggregate( [ { $group : { _id : {sessionid: "$sessionid", quizid: "$quizid" }, sessionid: {$first: "$sessionid"}, quizid: { $first: "$quizid"}, sessionstarted: {$first: "$created"}, questionsubmitted: {$last: "$created"}, answer: {$addtoset: "$answer"} } }, ] ) after trying many combinations of $sort, $each, $push, $unwind, $orderby, i'm unable, @ point, sort answer field, answers still being still in $group s defined. aggregating : { "_id" : objectid("xxx"), "quizid" : "xxx", "sessionid" : "xxx", "questionid" : "q1", "answer" : "answer a", "created" : isodate("2015-12-xxx"), "__v" : 0 }, { "_id" : objectid("xxx

javascript - How to set up SSH Agent Forwarding in node.js (simple-ssh module)? -

i new node.js , using module simple-ssh executing shell commands windows remote server. whenever run code, console curses me [error: authentication failure. available authentication methods: publickey,gssapi-keyex,gssapi-with-mic,password,keyboard-interactive] . have put rsa private-key file, , set windows env variable ssh_auth_sock . still keeps giving error. below code snippet wrote simple-ssh: var ssh = new ssh({ host: sshhost, user: 'root', timeout: 11000000, key: require('fs').readfilesync("d:/keys_pair_prvt_pub/rsa_key"), agent: process.env.ssh_auth_sock, agentforward: true }); when trying ssh remote windows cmd-prompt, giving me error: $> ssh -a <myremote.host.com> ssh : term 'ssh' not recognized name of cmdlet, function, script file, or operable program. check spelling of name, or if p

json - How to post bulk to elastic search using python? -

i have post information elastic search using python. info looks like { "index": {"_type": "testsuitereport","_index": "testsuite"}}{"driver name": "","run mode": "","testsuite_starttime": "2016-10-0t14:20:09","testsuite link": "2016-10-20t14:20:09","number of tests passed": 491} i using curl posting data search server using command curl -i -x put -k "http://serverip:5601/_bulk" --data-binary @filelocation. can me finding alternative way implement in python ? read json data file. use requests python library post json server import requests data = open('yourfile').read() url = "http://serverip:5601/_bulk" requests.post(url, data=data)

c# - Using multiple textboxes text to form a JSON string -

i have button store text value of 80 text boxes in winforms c#. the button looks @ moment private void btnsavechanges_click(object sender, eventargs e) { //create new connection mongodb database , select database , "table" var nol = networkopslayer.networkopslayer.createfordirectmongoconnection("mongodb://snipip", "snipdbname", "snip"); //inser document starting selected node name, id, timestamp , entire loan data nol.insertdoc("{ \"loanname\" : \"" + tvtodolist.selectednode.name + "\", \"agentname\" : \"" + txtagentname.text + "\" }"); } this approach work end string long. nol.insertdoc("{long json string of keys , textboxids}") 80 textbox values each json key contained inside string. i'm wondering if there better way go this? possible still form valid json string looping through each textbox on form , giv