Posts

Showing posts from January, 2014

VB.NET MySQL Fatal Error But database accepts input -

i fatal error when execute code, info still shows in database. can see error here? sql.runquery("insert test(test1,test2,test3) values(?fname,?lname,?dob)") sql.sqlcmd.parameters.addwithvalue("?fname", gender.selecteditem) sql.sqlcmd.parameters.addwithvalue("?lname", age) sql.sqlcmd.parameters.addwithvalue("?dob", rdiage) sql.sqlcmd.executenonquery() your code should looks like: dim connstring string = "database=yourdb;data source=localhost;"; connstring +="user id=youruserdb;password=dbpass" dim conn new mysqlconnection(connstring) dim cmd new mysqlcommand() try conn.open() cmd.connection = conn cmd.commandtext = "insert test(test1,test2,test3) values(@fname,@lname,@dob)" cmd.prepare() cmd.parameters.addwithvalue("@fname", gender.selecteditem) cmd.parameters.addwithvalue("@lname", age) cmd...

Adding a value to a cell in javascript -

i have created function increase cell value 1. goal make value of am39 increase 1, not go past 2. have fixed syntax errors, i've tried running script script hasn't done anything. what wrong function? function incrementcellvaluesbyone() { var ss = spreadsheetapp.getactivespreadsheet(); var sheet = ss.getsheets()[0]; var cell = sheet.getrange("am39"); var cell, cellvalue; if (cellvalue == cell.getvalue()) { cell.setvalue(cellvalue + 1); if (cellvalue >= 2) { cellvalue = 2; } } } edit: range.setvalue(value + 1); if (cellvalue >= 2) { cellvalue = 2; } you have wrong in define , ordering of statements! try this: function incrementcellvaluesbyone() { var ss = spreadsheetapp.getactivespreadsheet(); var sheet = ss.getsheets()[0]; var cell, cellvalue; cellvalue = "something should make here!"; cell = sheet.getrange("am39"); if (cellvalue == cell.getvalue()) { cell.setv...

sql - update statement with limit -

update accounts left join users b on a.user_id = b.user_id set `sold` = '1' b.country = 'ua' , a.site = 'od' how limit query? tried update accounts left join users b on a.user_id = b.user_id set `sold` = '1' b.country = 'ua' , a.site = 'od' limit 500 but error error : incorrect usage of update , limit try this update accounts left join users b on a.user_id = b.user_id set 'sold' = '1' b.country in (select country (select country users country = 'ua' order user_id asc limit 500) tmp) , a.site in (select site (select site accounts site = 'od' order user_id asc limit 500) tmp2); see further details on select limit statement. http://www.techonthenet.com/sql/select_limit.php

javascript - IE upload same file with angular file uploader -

i using angular , have simple file upload input on page. in ie, cannot upload same file twice in row because onchange not triggered since file name same. have tried several different ways set value null or blank not seem help. html: <input id="frontfileselect" type="file" class="ng-hide" onchange="angular.element(this).scope().getfrontimage(files); this.value = null; return false;" ng-accept="'*.pdf,*.jpg,*.png,*.tif,*.tiff'" ng-multiple="false" /> i have tried adding: onclick="this.value = null;" , onclick="this.value = '';" like: <input id="frontfileselect" type="file" class="ng-hide" onclick="this.value = null;" onchange="angular.element(this).scope().getfrontimage(files); this.value = null; return false;" ng-accept="'*.pdf,*.jpg,*.png,*.tif,*.tiff'" ng-multiple="false" /> i have tr...

Submit Hive query in Visual Studio, how? -

Image
okay, yesterday had toolbar button labeled "submit". now, nothing. either sdk 2.7 update clobbered it, or inadvertently dismissed toolbar. i'm using visual studio 2013 azure tools 2.7. how submit hive query? in latest version vs express not supported, might want use visual studio community instead (which free vs sku). https://www.visualstudio.com/downloads/download-visual-studio-vs sorry inconvenience!

How to create sending application in HL7 message end with double caret(^) via nHapi? -

how can create sending facility(abcsite^^) in msh segment below? msh|^~\&|abcsite^^|xyzfacility|||201506211402||omi^o23|20150621140223834684|d^t|2.4 there no need that. trailing component separators @ end of field serve no purpose , should removed save space. don't want add ones.

php - Draw a line of fixed length from a fixed starting point towards ending point -

Image
i stuck @ problem. trying solve 2 days. clueless. can simple clueless @ moment & appreciated. i want make line a(x1, y1) b(x2, y2) of fixed length. a.............b a....b........ a............. b i have made mobile cricket scorer. in reports builds wagon wheel. used mobile human touch not accurate , people not touch boundary line (dark orange circle in image below). but when generating report in php, must draw line fixed starting point boundary line in direction touched. right wagon wheel looks this. i have tried many ways accomplish failed. next idea draw line of fixed length fixed starting point (batting side) touch co-ordinates of fixed length line end @ boundary line no matter if users' touch not accurate. i can calculate distance between starting point , touch point using in php $linelength = round( sqrt (pow(($wicketx-$x),2) + pow(($wickety-$y),2)), 2); but dont know how further adjust touch co-ordinates required length please please pleas...

Parsing Json Output with PHP? -

Image
json output: { trainno: "12934", trainname: "karnavati express", mon: 1, tue: 1, wed: 1, thu: 1, fri: 1, sat: 1, sun: 1, fromname: "ahmedabad jn", toname: "mumbai central" } need show output below table: problem how separate dynamic value of run on mon, tue... thanks after chat final answer. $str = file_get_contents('put url here'); $json = json_decode($str, true); $day = ""; if($json['mon'] == 1){$day = $day."mon,";} if($json['tue'] == 1){$day = $day."tue,";} if($json['wed'] == 1){$day = $day."wed,";} if($json['thu'] == 1){$day = $day."thu,";} if($json['fri'] == 1){$day = $day."fri,";} if($json['sat'] == 1){$day = $day."sat,";} if($json['sun'] == 1){$day = $day."sun";} print_r($day) .'<br />'; edit 2 ...

c# - Marquee tag not work in windows form webBrowser control -

i have url. want show in windows form webbrowser control. in html page (url) multiple marquee tags. marquee tage not work in webbrowser control. work in normal browser private void form1_load(object sender, eventargs e) { // webbrowser1.scripterrorssuppressed = true; webbrowser1.url =new uri( @"http://67.205.96.105:8080/cis/"); } this url http://67.205.96.105:8080/cis using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; namespace windowsformsapplication1 { public partial class form1 : form { public form1() { initializecomponent(); } private void form1_load(object sender, eventargs e) { webbrowser1.url = new uri(@"file:///c:/users/myuser/desktop/test.html"); } ...

amazon rds - Cloud Formation RDS "Specified OptionGroupName: devrdsoptiongroup not found" -

i'm working on cloud formation template restore existing db snapshot looks this: "devdatabaseservice" : { "type" : "aws::rds::dbinstance", "properties" : { "allocatedstorage" : "200" , "dbinstanceclass" : "db.m3.medium", "dbsnapshotidentifier" : "snapshot-to-restor", "iops" : 1000, "dbsubnetgroupname" : { "ref" : "devdbsubnetgroup" }, "engine" : "sqlserver-se", "engineversion" : "11.00.2100.60.v1", "licensemodel" : "license-included", "masterusername" : "admin", "masteruserpassword" : { "ref" : "dbpassword" }, "storageencrypted" : "true", "tags" : [ { "key" ...

ios - UIImagePicker reappears after being image is selected -

i have uiimagepicker keeps reappearing after have selected image. code checking camera , displaying uiimagepicker based on fact there no camera in simulator. - (void)viewwillappear:(bool)animated { [super viewwillappear:animated]; self.imagepicker = [[uiimagepickercontroller alloc] init]; self.imagepicker.delegate = self; self.imagepicker.allowsediting = yes; if ([uiimagepickercontroller issourcetypeavailable:uiimagepickercontrollersourcetypecamera]) { self.imagepicker.sourcetype = uiimagepickercontrollersourcetypecamera; } else { self.imagepicker.sourcetype = uiimagepickercontrollersourcetypephotolibrary; } self.imagepicker.mediatypes = [nsarray arraywithobjects:(nsstring *)kuttypeimage, nil]; [self presentviewcontroller:self.imagepicker animated:no completion:nil]; } - (void)viewwilldisappear:(bool)animated { [super viewwilldisappear:animated]; [self clear]; } - (void)imagepickercontroller:(uiimagepickercontr...

python - How to add to google app engine flask website the user registration ability if it wasn't scheduled in application architecture -

i created website-app myself , become useful , many peoples wont use it. user management not scheduled in application architecture. there way easy add user registration each user have own google database tables same name? example of 1 "table": class settings(db.model): email = db.stringproperty() link = db.linkproperty() rating = db.stringproperty() how can separate data "table" between different users? search kind of wrapper don't need change current architecture. you have remember there no concept of tables datastore can't have separate set of tables each user such. you have few choices, 2 investigate are create separate app existing code base , each user runs own site. may not need code changes @ all if want complete separation of data each user in single app @ namespaces (thats how multi-tenancy implemented.) however haven't provided clear definition of how want separate users etc.. there other approaches can ta...

R, Standard error (IRT) Plotting an inverse function -

i following tutorial on creating information functions, completed tutorial looking take 1 more step , have been stalemated. tutorial following below. http://www.gonulates.com/psychometrics/fishers-information-function-for-the-four-parameter-model-4pm/ irt.4pm.info <- function(theta,item.par,d=1.7) { # function calculates fisher information # 4 parameter model, given item parameters , ability. # # item.par should matrix 4 columns: # each row represents item, # first column represents parameters (item discrimination) # second column represents b parameters (item difficulty) # third column represents c parameters(pseudo-guessing parameter) # fourth column represents d parameters (upper asymptote) # theta can single number or vector. return(t(sapply(theta, fun = function (x) ( (d * item.par[,1])^2 * (item.par[,4] - item.par[,3])^2)/ ((item.par[,3] + item.par[,4] * exp(d*item.par[,1] * (x - item.par[,2]))) * (1 - item.par[,3] + (1-item.par[,4]) * ...

ruby on rails - Cannot migrate on Heroku -

i'd migrate database production environment on heroku. i typed following code, got error. have no idea do. i'm looking forward advice. thank kindness. $ heroku run rake db:migrate running `rake db:migrate --trace` attached terminal... up, run.2338 rake aborted! loaderror: libruby.so.2.2: cannot open shared object file: no such file or directory - /app/vendor/bundle/ruby/2.2.0/gems/pg-0.18.2/lib/pg_ext.so /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require' /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in require' /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency' /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require' /app/vendor/bundle/ruby/2.2.0/gems/pg-0.18.2/lib/pg.rb:4:in `<top (required)>' /app/vendor/bundle/ruby/2...

php - Form validatation and result on same html page -

i have form use on page client able send me messages. everythings ok , working. 1 thing missing every form errors , result (email typ error, first name missing) showing on new page. have on same page have notifications , result e.g "your message has been send". saw in pages forms input can highlitet on red if putted wrong etc. read can done either ajax or jquery honest not familaiar it. in solution using bootstrap , php. can me achieve that? below current code. html (using bootstrap): <form action="send_form_email.php" method="post" class="form-horizontal"> <div class="form-group"> <label for="first_name" class="col-lg-2 control-label">first name</label> <div class="col-lg-10"> <input type="text" class="form-control" id="first_name" name="first_name" placeholder=...

javascript - How to create a source map for my compiled JS files with mincer? -

i want compile coffeescript files 1 js file using mincer , gulp . have app.coffee file requires other files. gulp task uses gulp-mincer , looks that: var gulp = require('gulp'); var mincer = require('mincer'); var mince = require('gulp-mincer'); gulp.task('mincer', function(){ var env = new mincer.environment(); env.enable('source_maps'); env.appendpath('src/coffee'); return gulp.src('src/coffee/**/app.*') .pipe(mince(env)) .pipe(gulp.dest('public/js')); }); if run task 1 js file required code in no source map. have source map file?

javascript - How can I store key in jQuery -

here code : function addtocart(id,price) { var qty = $("#txt_qty" + id).val(); var qty1 = new array(); if (qty == '' || qty == 0) { alert('please enter quantity'); $("#txt_qty" + id).focus(); return false; } if (qty != '' && type != '') { proid.push(id); var text = 'qty'+id+'='+qty; var keyvaluepair = text.replace(/ /g,'').split('='); qty1.push([keyvaluepair[0]] = [keyvaluepair[1]]); } i need store key in qty1 array,i have value called qty how can dynamically store key in qty1 array i trying above attempt not succeeded can me if got data value keyvaluepair[0] , keyvaluepair[1] , try use : var myobj = {}; // declare obj container myobj[keyvaluepair[0]] = keyvaluepair[1]; // set key , value based on variable qty1.push(obj); // push obj qty1(array) variable this alternative, can try use solution provided @disha v.

mapreduce - Spark : How to design streaming with spark? -

current architecture mysql database rest api abstraction. the problem mysql not scaling various reasons including data model design hard fix. proposed architecture using cassandra nosql backend , using spark in memory computation engine along spark streaming. questions how cassandra's consistency ? decision directly use kafka streams carries real time information cassandra , use spark sql query data. if consistency above good, how rdd's designed around since immutable.do create new rdd's ? an alternative design migrate data mysql cassandra , use kafka directly send messages spark handles in real time , use downstream systems hand on data cassandra on time. in points 1&2 consistency dependant upon cassandra , in point 3 tied spark. which design better ? can throw light on this.

How to convert Julian day and year to a date format and calculate elapsed time in R -

i have matrix separate columns year (yyyy), julian day, , time (hhmm). attach column vector full gregorian date ("mm/dd/yyyy") , column vector give me elapsed time in days. how go this? clear, referring these julian days: http://landweb.nascom.nasa.gov/browse/calendar.html help. c7 <- read.table(text="year day time 2015 193 915 2015 193 930 2015 195 1400 2015 195 1415", header=t) i add these 2 columns: year day time date elapsed time (days) 2015 193 915 07/12/2015 0.00 2015 193 930 07/12/2015 0.01 2015 195 1400 07/14/2015 2.20 2015 195 1415 07/14/2015 2.21 first, i'd convert values proper posixt date/time values. here paste in string, separating out hours , minutes using math pdates <- with(c7, strptime(paste(year,day,time %/% 100, time %% 100), "%y %j %h %m")) now can desired columns downcasting date , using...

c++ - background extraction using OpenCv -

i want extract background video don't want use cv::bgsegm::backgroundsubtractormog, cv::backgroundsubtractormog2 these methods. because using frame means. planed use frame comparison method. i'm using first frame background model , plane compere pixel values of next frames first frame pixel values , if there no change or change less threshold background pixel. how can implement these using opencv , c++ your question vague, think. can give hints. first, approach simplistic. that's not bad. experience, won't give great results, if have lot of control on scene. nevertheless, not want hold if want make own experiences. you want take at operations on arrays in opencv basic threshold operations in opencv everything need should there. in particular, absdiff operation , threshold function (with binary threshold type) should of interest.

ios - extracting properties from NSArray of NSArray of NSDictionary -

this question similar extracting properties nsarray of objects , deeper extraction. for sake of simplicity, objects referring in below examples nsstrings. i have 2 cases want solve. nsarray of nsarray of nsdictionary objects preferably key-value-coding, following structure, i'd extract "title" single enumerable list: nsarray *list1 = @[ @[ @{@"title":@"a", @"description":...}, @{@"title":@"b", @"description":...}, ], @[ @{@"title":@"c", @"description":...}, @{@"title":@"d", @"description":...}, ], ]; desired result example: @[@"a", @"b", @"c", @"d"] nsarray of nsdictionary nsarray of objects preferably key-value-coding, following structure, i'd extract lists of "titles" single enumerable list: nsarray *list2 = @[ @{ @...

python - Parsing text data and inserting in MySQL -

i confused approach need write python/any script needs dealt below situation. i generate text file server column name, time-stamp, server name , column value cpunumber 1437501780 l09fr01 40.0 cpunice 1437501780 l09fr01 0.0 cpusystem 1437501780 l09fr01 0.0 cpuwait 1437501780 l09fr01 0.0 cpuuser 1437501780 l09fr01 1.0 cpudile 1437501780 l09fr01 0.0 the table need insert these values given below. load id populate uniquely within program. best way parse above information , load in table? create table `test`.`cpu_util_all` ( `loadid` int not null, `servername` varchar(45) not null, `date_time` datetime not null, `cpu_number` decimal(10,2) null, `cpu_user` decimal(10,2) null, `cpu_nice` decimal(10,2) null, `cpu_system` decimal(10,2) null, `cpu_wait` decimal(10,2) null, `cpu_idle` decimal(10,2) null, primary key (`loadid`, `servername`, `date_time`,`cpu_user`)); you can use pandas read data this, , write sql well. import pandas pd import...

php - PHPUnit Test result type or also the result variables -

during unit testing i'm confused test. need test api , api or method result values. class someeventhandler { public function ondispatch (event $event) { if ($event->hasfoo) { $model = $this->createresponsemodel('foo'); } else { $model = $this->createresponsemodel('bar'); } // end. return $model; } private function createresponsemodel ($foo) { $vars = array( 'somevare' => true, 'foo' => $foo ); // end. return new responsemodel($vars); } } so should test if method ondispatch returns instance of responsemodel or should test if variable foo set properly? or test below fine? class someeventhandlertest { // assume instance of someeventhandler cr...

python - Avoiding shell=True in Popen -

i trying open .txt file in windows. code follows: subprocess.popen("c:\folder\file.txt", shell=true) this works fine. default editor automatically opened , file loaded, however, have read somewhere before invoking calls through shell (cmd.exe in windows) less safe. how can same without it. setting shell=false giving me error: oserror: [winerror 193] %1 not valid win32 application now, can try workaround: subprocess.popen("notepad c:\folder\file.txt") but works if notepad available, hence loses generality. if using windows there (non portable) os.startfile command take file path , open in default application filetype. in case do: import os os.startfile("c:\folder\file.txt") note method won't work on linux , mac osx, you'll have have use own utilities this. ( open osx , xdg-open on linux) , start them subprocess.

c# - MSMQ Event Logging doesn't show dropped messages? -

so i'm trying msmq messages forwarded 1 machine (which dead easy - surprised), 1 of requirements ops side of house need able see log entry somewhere when remote server decides not accept message. example, if try send nonexistent queue, so: messagequeue remotequeue = new messagequeue(@"formatname:direct=os:machinename\private$\notarealqueue"); remotequeue.send("test", messagequeuetransactiontype.single); the message goes local delivery queue, , appears sent across network, because queue doesn't exist, remote msmq manager discards message. however, there's no entry in event log can find message being dropped on floor, , makes people nervous. microsoft/windows/msmq/endtoend log seems involve successful messages, doesn't seem particularly useful. there log i'm not seeing somewhere? you can use msmq dead letter queues that. message.usedeadletterqueue = true; with enabled, if message can't delivered sent 1 of 2 system dead...

wpf - Bind to property in a relative source sends me up to the mainwindow + Catel -

have following xaml code <catel:usercontrol x:class="sicuap.views.catproducto_categoriasview" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:catel="http://catel.codeplex.com" xmlns:controls="clr-namespace:mahapps.metro.controls;assembly=mahapps.metro" xmlns:views="clr-namespace:sicuap.views"> <!-- resources --> <usercontrol.resources> </usercontrol.resources> <!-- content --> <catel:stackgrid> <catel:stackgrid.rowdefinitions> <rowdefinition height="auto"></rowdefinition> <rowdefinition height="auto" /> <rowdefinition height="auto" /> <rowdefinition height="auto" /...

javascript - Navigation bar is not responsive after scrolling -

i new web development.i met problem when designing scrolling navigation bar. i used bootstrap grid , jquery this. if don't scroll down , resize window, fine. navigation bar resized , in center of window. after scroll down, size of navigation bar fixed. size won't change when make window larger(it smaller if make window smaller, not centered). may caused setting width: nav.width() in js file, don't know how fix it. this new account don't have enough reputation upload images. try describe using words. example, @ beginning, parent of navigation bar 1140px, width of navigation bar 100%, size 1140px. if resize window, let width of parent 720px, navigation bar width 720px. if scroll down, callback function in js run, set width 720px, fixed value, won't responsible more. now, if resize window make parent 1140px, width of navigation bar 720px rather 1140. how fix this? <div class="container"> <div class="row"> ...

sql server 2008 - Calcualting fileds through trigger in MSSQL? -

i have 2 tables product , shop have trigger works when product added shop, updates product quantity shop when inserted , total price fields of product quantity , unit price. quantity updated correctly. the problem is: total price not updated correctly. problem? alter trigger [dbo].[trg_updtproqty] on [dbo].[shop] insert begin -- update product quantity , total price shop table update pd set pd.qty = pd.qty-i.qty, pd.tprice=pd.uprice*pd.qty dbo.product pd inner join inserted on pd.pid = i.pid end updates not happen in order write them in, i.e. in original update statement have: set pd.qty = pd.qty-i.qty, pd.tprice=pd.uprice*pd.qty when setting tprice value of pd.qty still original value, should set pd.qty = pd.qty-i.qty, pd.tprice=pd.uprice*(pd.qty-i.qty) if tprice such simple calculation , may want not bother storing @ all, , use computed column : alter table dbo.product drop column tprice; go alter table dbo.p...

ios - Where is Apple documentation for PickerView changing height -

this question has answer here: how change uipickerview height 26 answers is apple provided documentation picker view height restriction? per different stack conversation can set picker view height 162.0, 180.0 , 216.0. anywhere mentioned on apple developer portal. if yes, please let me know link. to change height of picker view, check question . couldn't find exact/proper apple's documentation you, link might helpful describing picker view's rowheightforcomponent

matlab - Alter tick labels to a '10^ - style' appearance -

Image
though there quite lot of answered questions kind of issue, wasn’t able find proper solution exact problem. anyway. i try format tick lables shown in following example: i found out ‘sprintf’ command offering possibility alter tick format. closest came want 'e-notation' triggered following command: set(ax,'yticklabel',sprintf('%2.0e|',yticks)) however, i’d labels appear shown in example picture. there simple way that? thank in advance, joe am missing something? why not use semilogy ? x = -3:0; y = 10.^x; semilogy(x, y); set(gca, 'yminorgrid', 'on')

java - Hibernate generate old query after column renaming -

i've renamed column in database (from configuration_system_id system_id), , added attributeoverride annotation abstractsubconfiguration class. hibernate ignore annotation , continue generate queries old column names (configuration_system_id instead of system_id). my classes looks this: abstractsubconfiguration.java @mappedsuperclass @idclass(configuration.class) public class abstractsubconfiguration implements dto, serializable { private static final long serialversionuid = -6271877313478924753l; @id @onetoone(fetch = fetchtype.lazy) @attributeoverride(name = "systemid", column = @column(name = "system_id")) private configuration configuration; public abstractsubconfiguration() { super(); } public abstractsubconfiguration(final configuration configuration) { super(); this.configuration = confi...

javascript - Major problems with Google maps after jQuery UI autocomplete is added to project -

i have run major problems on google maps project when integrated auto complete box , changed code google maps script have been working on. map supposed communicate database , mark cities have listings in them. when click on city zooms in , marks listings on map. ever since got auto complete box work messed around map script , markers no longer showing up. on top of cannot log in console through map script map styles , map still appear. can help? //buyersmap.js function initialize() { var cities = []; var counties = []; var states = []; var zipcodes = []; console.log("initialize"); var lat = 38.907097; var lng = -77.094389; var markers = []; var infowindow = new google.maps.infowindow(); geocoder = new google.maps.geocoder(); var styles = [ { "elementtype": "geometry", "stylers": [ { "lightness": 44 }, { "visibility": "simplified" } ] },{ "elementtype": "labels...

What happens when I give an offset to a "temporary register" in MIPS -

for example: $t0 = $t1 = b $t2 = c if following command lw $t1, 4($t0) would load $t2 $t1 ? as long temporary registers next each other in memory. i.e. reference: $t1 $t2 mem blocks: [byte][byte][byte][byte][byte][byte][byte][byte]... programs logisim should have registers packed tightly. helpful page here uc berkeley.

c# - Extract data from cell -

Image
the following code works fine , extracts data cells in sheet using (oledbconnection con1 = new oledbconnection(connectionstring)) { var dt = new datatable(); string query = string.format("select * [{0}]", sheetname); con1.open(); oledbdataadapter adapter = new oledbdataadapter(query, con1); adapter.fill(dt); try { using (sqlconnection con = new sqlconnection(consstring)) { con.open(); (int = 1; < dt.rows.count; i++) { (int j = 1; j < dt.columns.count; j ++) { messagebox.show(dt.rows[i][j].tostring()); } } } the code above extract data in green rectangle need extract data in red rectangle in following picture . how extract data in rectangle not in green rectangle ? you can change displayed digits changing region , setting in control panel, way full values displayed can fetched ol...

ios - How to set button to scroll to next tableview row? -

so each row has same button , want button scroll next row. in tableview, can set each button has different tags( button.tag ). when selected it, use tag decide row scroll to.

How to share global Map values among RDDs in Spark? -

i trying access map rdds on different compute nodes, without success. map like: val map1 = map("aa"->1,"bb->2,"cc->3,...) all rdds have check against see if key in map or not, seems have make map global, problem if map stored rdds , spread across different nodes, each node see piece of map , info not complete check against map( replace key corresponding value) e,g: val matchs= vecs.map(term=>term.map{case (a,b)=>(map1(a),b)}) any idea this? thanks! it sounds want use broadcast variable: val broadcastmap = sc.broadcast(map) vec.map(term=>term.map{case (a,b)=>(broadcastmap.value(a),b)})

spnego - How to get the principal name after authentication -

using mit gss-api libraries, i've written c program gets input full negotiate token , performs kerberos authentication (using keytab on server side). program calls gss_acquire_cred , gss_accept_sec_context , i'm able create context , client token. now, how can client principal name / user name? thought maybe calling krb5_build_principal right way don't see how input parameters function as you have context handle on acceptor side, can call gss_inquire_context inquire src_name initiated (your client) context or request gss_accept_sec_context directly return value. sample code available on request.

html - How to make a new line when content is too long? -

img { width:20%; } .shopinfol2 { display:inline-block; vertical-align:top; } h4 { color:red; } <h4>div 1</h4> <div> <img src="https://s.yimg.com/xd/api/res/1.2/2a8.gbmwtalpfoqzfy.leg--/yxbwawq9exr3yxvjdglvbnnlcnzpy2u7ad00mda7ct04nttyb3rhdgu9yxv0bzt3ptqwma--/http://nevec-img.zenfs.com/prod/tw_ec05-7/71eb3ae4-2784-4a9c-a3fa-6985fd12a43f.jpg" alt="" class="imgqrl2"> <div class="shopinfol2"> <h5>title here</h5> <p>address address </p> </div> </div> <h4>div 2</h4> <div> <img src="https://s.yimg.com/xd/api/res/1.2/2a8.gbmwtalpfoqzfy.leg--/yxbwawq9exr3yxvjdglvbnnlcnzpy2u7ad00mda7ct04nttyb3rhdgu9yxv0bzt3ptqwma--/http://nevec-img.zenfs.com/prod/tw_ec05-7/71eb3ae4-2784-4a9c-a3fa-6985fd12a43f.jpg" alt="" class=...

What is the difference in lifecycle between lock screen and opening other application android -

i'm developing application right now, problem when pressed home or open whatsapp notification , reopen application , restarted beginning of application , instead of resuming state left. while locking , unlocking screen resumes state left. so, tried tracing life-cycle between 2 process (locking screen & opening other app/home). makes me confuse both process show same lifecycle , onpause() , onstop() triggered when locked screen or open other app/home. then, when returned app, onrestart() , onresume() triggered. if both shows same result, why locking screen , unlocking continued application , while pressing home or application , reopen application did not? any solution or explanation appreciated. thanks. code : @override protected void onrestart(){ system.out.println("restart"); super.onrestart(); } @override protected void onresume(){system.out.println("resume"); gamepanel.resumeactivity(); super.onresume(); } ...

html - Span is smaller than the parent div, why? -

why span smaller it's parent div? .class1 { background-color: red; border: solid thin; padding: 0px; margin: 0px; } .class1 span { background-color: yellow; font-size: 60px; } <div class="class1"> <span>drawback</span> </div> the reason nature of default display style both div , span elements. the display css property specifies type of rendering box used element. in html, default display property values taken behaviors described in html specifications or browser/user default stylesheet. default value in xml inline. div elements block level elements (respect dimension, take full width default) span elements inline elements (content determines dimension, purposes handled in similar way text). as such, want match 2 display types setting display:block child span . alternatively, span no longer behaving span should, change div .class1 { background-color: red; border...

powershell - In Get-WinEvent, which kind of interval of EndTime? -

i used get-winevent in powershell eventlog in time interval. avoid data loss or repeat, need know interval type of starttime , endtime . in following example in msdn: ps c:\> # use where-object cmdlet ps c:\>$yesterday = (get-date) - (new-timespan -day 1) ps c:\>get-winevent -logname "windows powershell" | where-object {$_.timecreated -ge $yesterday} # uses filterhashtable ps c:\>$yesterday = (get-date) - (new-timespan -day 1) ps c:\>get-winevent -filterhashtable @{logname='windows powershell'; level=3; starttime=$yesterday} it seems starttime means ">=". but did not find info endtime . what's represent? "<" or "<="? endtime means <= . ran test on pc. when set endtime=(get-date -date "03.08.2015 14:07:27") events on precise time. timestamps in event log don't contain milliseconds, therefore filtering done 1 second precision.

javascript - what is triggered in click-and-drag date histogram event in kibana -

i have kibana dashboard embeded in webpage , dynamically find start date/time , end date/time of kibana dashboards when time range narrowed user clicking , dragging time range. i plan on accomplishing extracting json request sent after event triggered conveniently stores start , end data, don't know event triggered , when appropriate extract it. comfortable extracting data whenever request changed though admittedly less direct route. how can recognize when date histogram range has been narrowed click-and-drag? if have embedded dashboard in webpage, if user changes time range every other parameter dynamically changed in dashboard. i don't think there need recognize date histogram range.

matlab - Octave error when trying to integrate: "integrand F must return a single, real-valued vector of the same size as the input" -

i've confirmed issue in attempting compute glonball_2, don't see why it's producing error. function funct_2 should returning real numbers. "same size input" part, don't think i'm interpreting error message correctly. funct_2 takes 2 arguments , returns 1 value, funct_1, caused no error, that's not it. explain this? code: function glonball = glonball(alpha) epsilon = 1; rmin = 0; rmax = 1; thmin = 0; thmax = 2*pi; funct_1 = @(r,th) (2).*(abs(alpha).^2-1).^(2)./abs(1-conj(alpha).*r.*exp(i.*th)).^4; glonball_1 = dblquad(funct_1, rmin, rmax, thmin, thmax); funct_2 = @(r,th) (abs(alpha.-r.*exp(i.*th))/abs(1-conj(alpha).*r.*exp(i.*th))).^2; glonball_2 = dblquad(funct_2, rmin, rmax, thmin, thmax); glonball = .5*glonball_1 + (1/((4).*epsilon^2))*glonball_2; end here's error receive when attempting run input argument between 0 , 1 (the area of interest): error: quadcc: integrand f must return single, real-valued vector of same size input error: ca...

javascript - how to make string in java script? -

expected output model = gt-n8000, cordova_version = 3.6.4, os = android hello trying make 1 string shown below display values not name of values .i not able attribute , = in striing here code var deviceinfo = '' var deviceinfo = ''; deviceinfo += model = getmodel() + ','; deviceinfo += cordova_version = cordovaversion() + ','; deviceinfo += os = getos(); alert(deviceinfo); function getmodel() { return "gt-n8000" } function cordovaversion() { return "3.6.4" } function getos() { return "android" } https://jsfiddle.net/nl7ouohv/ try below code. var deviceinfo = '' var deviceinfo = ''; deviceinfo += 'model = ' + getmodel() + ','; deviceinfo += 'cordova_version = ' + cordovaversion() + ','; deviceinfo += 'os = ' + getos() + ','; alert(deviceinfo) function getmodel() { return "gt-n8000" } function cordovave...