Posts

Showing posts from September, 2015

ruby - re-try logic in a simple loop -

i'm trying set bounds array later printed in console , summed. lower bound ($a) should less 50 , wrote code evaluate that, want re-prompt number if higher number typed. far, google , experimentation have failed me. def num_a print "pick number 1 50: " $a = integer(gets.chomp) until $a < 50 puts "um, try again please." # need here prompt response # until $a less 50 end end you restructure loop prompt , call gets both inside it: def num_a # start number doesn't meet condition = 50 # check if number meets condition yet until < 50 # ask user enter number print "pick number 1 50: " = integer(gets.chomp) # ask try again if number isn't under 50 puts "um, try again please." unless < 50 end # return entered value caller end also, i've shown in example, recommend avoiding use of global variables ( $a in case).

ruby - Accessing variable name -

i trying parameter validation outside of rails. def create_statement(action, ...) valid_one_of(action, ['add', 'move', 'delete']) ... end validation method: def valid_one_of(input, valid_values) return true if valid_values.include?(input) raise "#{input} not valid value #{input.var_name}" end sample call: create_statement('bob') so output be: bob not valid value action the problem how input.var_name ? i workaround pass valid_one_of(action, ['add', 'move', 'delete'], 'action') (and use 3rd parm output) doesn't seem feels bit redundant. if not possible access variable name there more dry coding style workaround? i don't know of way name of local variable, , if could, name want? name of parameter define on method definition? name of variable in caller? i don't think "work-around" horrible, suggest couple of slight variations might read littl

cytoscape.js - Setting control points for Cytoscape edges? -

Image
i'm trying build descending graph in cytoscape. i've got majority done quite well, i'm stuck on edge types. i'd use 'segments' curve-style, edges have points. however, instead of being zig-zags, edges constrained horizontal/vertical lines. my graph pretty constrained , user cannot manipulate positions. edges start @ 'parent' element, go straight down set amount, hit point, turn, head horizontally same x child, straight down child element. right now, lines go straight, , can add segments easily, aren't constrained , based on percentages won't have access without doing bunch of math, guess isn't terrible. current: desired: if want specific absolute positions on segments edges, you'll need convert absolute co-ordinates relative co-ordinates specify segments edges. if want different type of edges usecase, feel free propose in issue tracker.

c# - Error in creating twitterizer app in asp.net -

i using twitterizer dll post twit on twitter via oauth method give me error. "whoa there! there no request token page. that's special key need applications asking use twitter account. please go site or application sent here , try again; mistake." and code is: using system; using twitterizer; public partial class home : system.web.ui.page { protected void page_load(object sender, eventargs e) { var oauth_consumer_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; var oauth_consumer_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; if (request["oauth_token"] == null) { oauthtokenresponse reqtoken = oauthutility.getrequesttoken(oauth_consumer_key, oauth_consumer_secret, request.url.absoluteuri); response.redirect(string.format("http://twitter.com/oauth/authorize?oauth_token+{0}", reqtoken.token)); } else { string requesttoken = request["oauth_token"].

Parse Text in Python (Django) -

i have text looks like: link(base_url=u'http://www.bing.com/search?q=site%3asomesite.com', url='http://www.somesite.com/prof.php?pid=478', text='somesite - professor rating of louis scerbo', tag='a', attrs=[('href', 'http://www.somesite.com/prof.php?pid=478'), ('h', 'id=serp,5105.1')])link(base_url=u'http://www.bing.com/search?q=site%3asomesite.com', url='http://www.somesite.com/prof.php?pid=527', text='somesite - professor rating of jahan \xe2\x80\xa6', tag='a', attrs=[('href', 'http://www.somesite.com/prof.php?pid=527'), ('h', 'id=serp,5118.1')])link(base_url=u'http://www.bing.com/search?q=site%3asomesite.com', url='http://www.somesite.com/prof.php?pid=645', text='somesite - professor rating of david kutzik', tag='a', attrs=[('href', 'http://www.somesite.com/prof.php?pid=645'), ('h', 'id=se

php - Intergrating Paypal into my shopping cart -

i have developed own shopping cart , want integrate paypal once user click checkout button. i need pass item details on paypal based on customer has added cart. believe code below checkout button nothing when clicked on. tried reason form doesn't see checkout button! <?php $checkout = "<form action='https://www.paypal.com/cgi-bin/webscr' method='post'>"; $checkout .= "<input type='hidden' name='cmd' value='_cart'><input type='hidden' name='upload' value='1'>"; $checkout .= "<input type='hidden' name='business' value='craig@biosboss.com'>"; $count = 1; $checkout .= "<input type='hidden' name='item_name_" + $count + "' value='" + $item['name']+ "'>"; $checkout .= "<input type='hidden' name='item_number_" + $count + "' value='&qu

excel - Copy & Paste range as values into next empty column on another sheet -

using command button, trying copy range (which varies based on inputs) values sheet. have code mentioned below, seems copying on top of last entry rather pasting next empty column. i'm new vba step step appreciated. thank you sub commandbutton3_click() dim source worksheet dim destination worksheet dim emptycolumn long set source = sheets("month template") set destination = sheets("sheet1") 'find empty column (actually cell in row 1)' emptycolumn = destination.cells(1, destination.columns.count).end(xltoleft).column if emptycolumn > 1 emptycolumn = emptycolumn + 1 end if source.range("m26:m35").copy destination.cells(1, emptycolumn) end sub try below sub commandbutton3_click() dim source worksheet dim destination worksheet dim emptycolumn long set source = sheets("month template") set destination = sheets("sheet1") 'find emp

ios - Why set scrollview's delegate to nil in dealloc method? -

i found when slide tableview pressed button, project crashed , message :message sent deallocated instance. add - (void)dealloc { [self.tableview setdelegate:nil]; } project , crash doesn't happen again. still can't understand why project crash if didn't add code mentioned above. delegate deallocated , still sent message it? teach me this. following code in scrollview did scroll method. - (void)scrollviewdidscroll:(uiscrollview *)scrollview{ cgfloat y = scrollview.contentoffset.y; [self.navigationcontroller.navigationbar lt_setbackgroundcolor:gwprgbcolor(255, 255, 255, ((y-100)/100.0f))]; }

sql - Using Column Values from One Table within a Where Clause -

i have oracle table called: col_mapping column in table has column values of columns table. example data of table: col_mapping id descr col_vals ------------------------------ 1 label col_1 2 name_addr col_2:col_3 3 salary col4 based on above table, go through each record in col_mapping , use col_vals part of condition in table called other_tab , i.e.: select 'y' other_tab col_1 = 'whatever1'; select 'y' other_tab (col_2 = 'whatever2' or col_3 = 'whatever2'); , finally: select 'y' other_tab col_4 = 'whatever4'; i split out col_vals condition , there more 1 value colon separated, turn or condition above examples. any on how achieve above in oracle great. thanks. this not tested. how believe can accomplished. need 2 loops. 1 loop through table col_mapping , other loop through column col_vals each row , construct condition. something this: declare a_wh

javascript - Saving the lastest state of an entire application in JS -

i have interactive web based visualization. want allow users able undo while interacting visualization. noticed people suggest writing own undo function in case might difficult (so many different things keep track of). how can save last state of entire application after each interaction? idea? thanks, you use more state-driven approach , use react + redux, sounds have existing app don't want recreate. in case, depends on data looks like. single json object? in case, clone object on , on "save" previous states. you implement database , save copy of needed data timestamps and/or version numbers allow roll back. lead lot of duplication of data. another approach keep track of events modify data, , opposite of event. basic example, add number 15 "total". if wanted undo that, subtract 15. however, works if performing operations on of data. if want apply different types of data, store event along previous value. example: change name "bob&qu

javascript - Responsiveslides just not working -

i'm using responsive slides , have gone according instructions on site http://responsiveslides.com/ shows first image , not slide...i have checked can see somehow doesn't work...i have uploaded on jsfiddle https://jsfiddle.net/q421n8xo/ , hope give me valuable advice :) thanks! oh , think dropdown menu blocked images, there way put in front? again! okay major(?) breakthrough: found out responsiveslides file downloaded incorrect...i got working on jsfiddle...kinda weird on computer. try further. <!doctype html> <html> <head> <title>hire bach</title> <link rel="stylesheet" type="text/css" href="css/main.css"> <script src="js/responsiveslides.min.js"></script> <script src="js/jquery-1.12.4.min.js"></script> <script> $(function() { $(".rslides").responsiveslides({ auto: false,

objective c - Purge x objects from Realm -

i want purge event log removing oldest event objects there doesn't seem straight forward way this. can fetch object sorted according how want them deleted, there no way limit - ie want first 100 in rlmresults. rlmresults <event *> *events = [[event allobjects] sortedresultsusingproperty:@"id" ascending:yes]; if loop through , delete them index events updated go won't work. rlmrealm *realm = [rlmrealm defaultrealm]; [realm beginwritetransaction]; (nsinteger = 0; < numbertopurge; i++) { [realm deleteobject:events[i]]; } [realm commitwritetransaction]; i can put add them seperate array , use delete, way works seems bit clunky, there better way? nsmutablearray *purgeevents = [[nsmutablearray alloc] initwithcapacity:numbertopurge]; (nsinteger = 0; < numbertopurge; i++) { [purgeevents addobject:events[i]]; } rlmrealm *realm = [rlmrealm defaultrealm]; [realm beginwritetransaction]; [realm deleteobjects:events]; [realm commitwritetransact

apache - Error using PHP PEAR XAMPP 7.0.2.1 Net_Nmap -

i'm trying pear net_nmap package here: https://pear.php.net/package/net_nmap/ i have nmap installed on windows 10 machine. found following code should job. there should configure before use pear? i'm getting 2 errors: warning: require_once(xml/parser.php): failed open stream: no such file or directory in c:\xampp\htdocs\net_nmap-master\net\nmap\parser.php on line 31 fatal error: require_once(): failed opening required 'xml/parser.php' (include_path='c:\xampp\php\pear') in c:\xampp\htdocs\net_nmap-master\net\nmap\parser.php on line 31 <?php // scan network retrieve hosts , services information. require_once 'net/nmap.php'; //define target , options $target = array('193.95.13.16','www.google.com'); $options = array('nmap_binary' => 'c:\program files (x86)\nmap'); try { $nmap = new net_nmap($options); $nmap_options = array( 'os_detection' => true, 'service

unity3d - Unity android "freezes" with splash image -

i have added custom theme background image serve "splash" image make app nicer while unity player loading. that's theme definition have <?xml version="1.0" encoding="utf-8"?> <resources> <style name="theme.test" parent="@android:style/theme.light.notitlebar.fullscreen"> <item name="android:windowbackground">@drawable/launchimage</item> <item name="android:windowcontentoverlay">@null</item> <item name="android:windownotitle">true</item> <item name="android:backgrounddimenabled">false</item> </style> </resources> now, when refer theme in androidmanifest.xml like: <activity android:name="com.unity3d.player.unityplayeractivity" android:theme="@style/theme.test" ... ></activity> the game "freezes" – it's hard tell in fact, because displays splash

How do I make my live templates in Android Studio to generate code like getters and setters according to variables that have already existed? -

now have made 1 this: public $type$ get$property$() { return $property$; } public void set$property$($type$ $property$) { this.$property$ = $property$; } where: type:complete() property:suggestvariablename() property:capitalize(property) it can generate code this: public get() { return ; } public void set( ) { this. = ; } but not want. i want generate getters , setters according variables,and don't have input types , names of variable again. if want setter , getter fot variable can use default way of insertion. press alt + insert . choose getter , setter. shown dialogue box variable names. can select variable there. can select multiple variable. notice might have press fn press insert . not answer want work want.

postgresql - Asking Postgres to add a non-existent sequence value -

i have existing postgres table, example: create table profiles( profile_id serial primary key, num_feed integer, num_email integer, name text ); alter table profiles alter column profile_id set default nextval('profiles_profile_id_seq'::regclass); alter table profiles add constraint profiles_pkey primary key (profile_id); create index "pi.profile_id" on profiles using btree (profile_id); and existing data, can't change, can add new ones. insert profiles values (3, 2, 5, 'adam smith'), (26, 2, 1, 'fran morrow'), (30, 2, 2, 'john doe'), (32, 4, 1, 'jerry maguire'), (36, 1, 1, 'donald logue'); the problem when tried insert new data, postgres add minimum value (which good) on column "profile_id" failed/error when hits existent value, because value exists. error: duplicate key value violates unique constraint "profile_id" detail: key (profile_id)=(3) exists. is

c# - Keep differences between two hashtables -

i making function compares 2 hashtables , want keep difference of these tables. if both contain 100 keys , 2 have been altered want new hashtable equal 2 differences. here have. lost on how (keep differences) private hashtable comparehashtables(hashtable ht1, hashtable ht2) { hashtable resultsofcompare = new hashtable(); foreach (dictionaryentry entry in ht1) { if (ht2.containskey(entry.key) && ht2.containsvalue(entry.value) == false) { //keep differences } } return resultsofcompare; } it seems want check both key , value equality. if both don't match it's considered difference. creates bit of problem because type of difference can't represented in hash table. consider following ht1: key = "bob" value = 42 ht2: key = "bob" value = 13 here key same value difference. store every difference resulting structure need able contain 2 different values same key. that&#

python - "Horse" Math game -

for computer science class final, have been instructed make our own game in python. requirements: 1. needs use both “while loop” , “for x in y loop.” 2. needs use list either keep track of information or score 3. needs use function gameplay, tracking score, both. 4. display art either @ beginning, after, or in between turns. 5. can multi player or single player. 6. must carry complexity commensurate final project. anyways, decided make game similar horse in basketball. object of game find answer of math problem before time runs out. if don't, letter in horse. once letters of horse, game over. here have far: import random import time timeit import default_timer print("welcome jared's math horse game!") time.sleep(1) print("you have basic geometry , algebra problem,and brain teasers...") time.sleep(1) print("for each wrong, letter, , spell 'horse'. once letters, lose. round nearest integer!!!!!!!!&quo

ruby on rails - Running a cron job at different times for each job -

i building application in rails allows users post products sale set duration of time. each product has different 'end_time' in want run method sets updates product status 'dead'. i've been reading on wheneverize gem, far can tell use doing recurring task every minute, hour, day, etc... ideas on how go running cron job run @ each product's specific 'end_time'? for example along lines of: live_products = product.where('status = ?', 'live') live_products.each |product| at: product.end_time product.status = 'dead' product.save end end cronjob, every minute, checking need transaction dead. product.turn_dead.update_all status: :dead #product.rb scope :live, -> {where status: :live} scope :out_of_time, -> {where "end_time <= ?", time.now} scope :turn_dead, ->{ live.out_of_time }

mvvm - Set the Visibility of Data Grid in WPF -

in application have 3 data grids in single xaml file. based on user selection want show 1 grid , hide other grids. in view model class have boolean property each grid , based on selection setting true or false.but grids visible . <datagrid visibility="{binding path=isgridvisible}" > in view model setting isgridvisible value public bool iscapexgridvisible { { return iscapexgridvisible; } set { iscapexgridvisible = value; raisepropertychangedevent("iscapexgridvisible"); } } please provide ideas. thanks visibility property on uielement not boolean. enum 3 values: collapsed not display element, , not reserve space in layout. hidden not display element, reserve space element in layout. visible display element. so in order set viewmodel should: - make property type of visibility (not best solution in world) - use converter binding trick of translating boolean visibility public class booleantocolla

ios - No matching provisioning profiles found only in command line tool -

Image
my project able build , run on iphone using xcode, means both certificates , provisioning profiles rightly set up. if try use command line tool run app on device, tells me no matching provisioning profiles found. problem? as can see in picture shows no issue certificate , provisioning profiles. when use command line tool, failed. this type in command line: xcodebuild \ -workspace myapp.xcworkspace \ -scheme snail \ -configuration debug \ -destination "platform=ios,id=<my device udid>" \ code_sign_identity="iphone distribution: cert name" \ clean test error in command line tool: if don't explicitly specify profile xcodebuild should use, use 1 set in target's "build settings". in order specify profile, need know it's uuid (which can found opening .mobileprovision in text editor). if profile uuid "1234567890", updated command run is: xcodebuild \ -workspace myapp.xcworkspace \ -scheme snail \ -configura

python pyramid set throttle policy in download request -

when client request download example.com/media/files/test.mp4 if large file 1gb 3gb, user request drop in middle. server got hanged , other user can not download file.i want set throttle bandwidth limit single user session in every request. you should use front end web server nginx throttling: http://nginx.org/en/docs/http/ngx_http_limit_req_module.html python wsgi application not suitable this, specialized front end web servers can better.

python - Sqlalchemy db.create_all() not creating tables -

i following this pattern avoid circular imports. pattern seems pretty niche it's been difficult trying find solution googling. models.py from sqlalchemy.orm import relationship db = sqlalchemy() class choice(db.model): id = db.column(db.integer, primary_key=true) text = db.column(db.string(32)) votes = relationship("vote") def __init__(self, text): self.text = text application.py app = flask(__name__) app.debug = true basedir = os.path.abspath(os.path.dirname(__file__)) app.config['sqlalchemy_database_uri'] = 'sqlite:///' + os.path.join(basedir, 'db.sqlite3') app.config['sqlalchemy_track_modifications'] = false db.init_app(app) # reinitialiez db.model avoid cyclical imports in models.py db_create.py #!flask/bin/python application import app, db models import choice db.init_app(app) db.create_all() db.session.add(choice("red")) db.session.add(choice("blue")) db.session.add(choice(&q

ios - How do I retrieve additional properties for entity matching "max:" expression -

i have fetchrequest returns max value correctly particular key path. set looks this: nsexpression *keyexpression = [nsexpression expressionforkeypath:@"distance"]; nsexpression *functionexpression = [nsexpression expressionforfunction:@"max:" arguments:@[keyexpression]]; nsexpressiondescription *expressiondescription = [[nsexpressiondescription alloc] init]; [expressiondescription setname:keypath]; [expressiondescription setexpression:functionexpression]; [expressiondescription setexpressionresulttype:nsinteger32attributetype]; the problem need return value property on object matching above nsexpressiondescription. in other words, want value of timestamp property returned managedobject max: value being returned. if set fetch request this: nsfetchrequest* request = [nsfetchrequest fetchrequestwithentityname:@"record"]; request.resulttype = nsdictionaryresulttype; request.propertiestofetch = @[expressiondescription, @"timestamp&quo

java - How to make filterable to jtable record using netbeans ide -

Image
there many rows on above showing jtable. want filter record short code. if type short code 1234 should display short code 1234 associated row on jtable. thanks you're going have write code...start checking out how use tables , in particular sorting , filtering the basic requirement attach actionlistener both field , button (you can form editor if wish). within actionperformed event handler method, need create rowfilter , apply tables rowsorter . a table can configured automatically create row sorter setting autocreaterowsorter property true . it's explained nicely in linked tutorials... and example

java - how to get string from jtable with null cell -

i have jtable , data mysql. in mysql have column allowed null (it's called 'fil'). when retrive data jtable, it's ok. then, want fill jtextarea , enable button if 'fil' not null click jtable row. here code: private void jtable1mouseclicked(java.awt.event.mouseevent evt) { // todo add handling code here: int row = jtable1.getselectedrow(); string num = jtable1.getvalueat(row, 0).tostring(); string sub = jtable1.getvalueat(row, 1).tostring(); string desc = jtable1.getvalueat(row, 2).tostring(); string start = jtable1.getvalueat(row, 3).tostring(); string end = jtable1.getvalueat(row, 4).tostring(); string sta = jtable1.getvalueat(row, 5).tostring(); string fil = jtable1.getvalueat(row, 6).tostring(); if (fil != "") { jbutton1.setenabled(true); jbutton1.settooltiptext(fil); } else { jbutton1.setenabled(false); jbutton1.settooltiptext(""); } jtextarea1.settext("subject: " + sub + "\n" + "description: "

windows - UI Response Monitoring Tools -

do have suggestions on how monitoring response time of application? i'm looking existing monitoring tool log time when click button open window, , mark time when window completes loading. what kind of monitoring tool looking ?is there thing specific looking ? if looking browser based tool can use fire fox :- firebug chrome :- chrome developer tool ie :- internal ie developer tool

c# - TableView RowSelected with SearchResultsTableView: Keeping Track of Cell Index for CheckMark -

i have tableview i've created json file keeps track of checked/unchecked status of cell. problem when implemented searchresults view, results skewed because check cell @ index path, , update corresponding json entry ( subscribestatus ). var cell = tableview.cellat(indexpath); wondering if there way modify, or figure out approach takes account correct index search results displayed. here sample code below: public override void rowselected(uitableview tableview,nsindexpath indexpath) { var cell = tableview.cellat(indexpath); var value = this.tableviewcontroller.tableview==search.searchresultstableview ? filtereddatalist[indexpath.row] : datalist[indexpath.row]; if (value.selected) { value.selected = false; var uncheckedimage = new uiimageview (uiimage.frombundle("unchecked")); cell.accessoryview = uncheckedimage; string documentspath = environment.getfolderpath (environment

php - I am unable to handle SSH Connection Error Anyway -

Image
i'm trying handle runtimeexception connect vps through ssh. here's code connect vps through ssh. $server_ip = input::get('server_ip'); $password = input::get('password'); $validator = validator::make( ['server_ip' => $server_ip], ['server_ip' => 'ip|required|unique:servers'], ['password' => $password], ['password' => 'required|confirmed'] ); if(!$validator->fails()) { config::set('remote.connections.production.host',$server_ip); config::set('remote.connections.production.username','root'); config::set('remote.connections.production.password',$password); config::set('remote.connections.production.root','/'); $command = 'mysql --version'; $connection_status = ssh::run($command, function($line) { $this->output = $line.php_eol; }); if(!$connection_status) return $thi

java - Cannot draw a circle with loading of the fragment -

i trying draw circles in canvas. can on button click, need same when fragment loaded. below fragment code. public class steptwentyonefragment extends fragment { private canvasview customcanvas; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view v = inflater.inflate(r.layout.step21_fragment, container, false); customcanvas=(canvasview)v.findviewbyid(r.id.signature_canvas); final button button1=(button)v.findviewbyid(r.id.step18button1); float radius=(customcanvas.getcanvaswidth()/2) - ((customcanvas.getcanvaswidth()/2)/100)*60; customcanvas.drawcircle(radius); button1.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { if(v.getid()==r.id.step18button1){ float radius=(customcanvas.getcanvaswidth()/2) - ((customcanvas.getcanvaswidth()/2)/100)*60;

How to make label text to grow on left while making the right side fixed in vb.net? -

Image
label text grow on left side while making right side fixed in vb.net.image attached better understanding label text grow on left side:- what need set text label right-justified . showing part of code related creating , populating label (the 1 displaying total amount) help.

php - Yii2 add/remove rows in GridView -

i using gridview list data in application today realized need dynamicalli add/remove rows to/from list. found javascript not elegant. googled extension or module karje's gridview extension ther aren't much. use kind of task or think simpliest way make this? i tried unclead/yii2-multiple-input package. great instead of activeform need use html::dopdownlist elements. way somehow use it? <tbody> <?= $form->field($megrendelt_r, 'termek_id')->widget(\unclead\widgets\multipleinput::classname(), [ 'limit' => 6, ]) ?> </tbody> thank answers! using jquery $(document).ready(function(e) { var $table = $('#gridviewid table tbody'); //gridviewid = grid view 'id' var $rows = $table.find('tr'); var rownum = $rows.size(); var columnsnum = $($rows[0]).find('td').size(); for(var = 0; < rownum; i++) { var $row = $($

javascript - Issue with data table in Angular js when using $apply for invoke watcher -

Image
i working on angular data table , getting issue related $scope variable data not updating on ui after assign second api, used $apply invoke watcher , ui updated proper angular data table started behave wired, when click column sorting table blank , showing old assigned data of first api on ui. below screen shot include method calling on api success response , changing $scope.records value. can 1 how can resolve or should move on ng-table.

powershell - How to delete excess rows in Excel -

Image
i'm trying clean data. have seen number of treads topic. i've followed , applied examples seems wrong script. what wanted delete entire row when no. column null. when run script half of rows null no. column deleted. have run script multiple times before null rows deleted. there limit in deleting rows in powershell or missing something? here's script: #cleanup $max = $sheet.usedrange.rows.count ($i = 6; $i -le $max; $i++) { if ($sheet.cells.item($i, 1).text -eq "") { $range = $sheet.cells.item($i, 1).entirerow $range.delete() } } updates: address deleting problem added $i = $i - 1.. have find way stop loop ($i = 6; $i -le $row; $i++) { if ($sheet.cells.item($i, 1).text -eq "") { $range = $sheet.cells.item($i, 1).entirerow [void]$range.delete() $i = $i - 1 } } if you're deleting rows in "forward" for loop you'll skipping row every time delete row. if row

sql - Extract values from XML string using oracle xml commands -

i want extract values of attributes active_ind , call_status following string: <insurance_history active_ind="y" call_status="a"/> i have sorted issue substring , instr , need use xml commands extract these values. xpath, xquery, recommend read these technology. @ used access attribute in xml elment select extract(xmltype('<insurance_history active_ind="y" call_status="a"/>'),'/insurance_history/@active_ind') active_ind , extract(xmltype('<insurance_history active_ind="y" call_status="a"/>'),'/insurance_history/@call_status') call_status dual;

java - jsoup posting and cookie -

i'm trying use jsoup login site , scrape information, running in problem, can login , create document index.php cannot other pages on site. know need set cookie after post , load when i'm trying open page on site. how do this? following code lets me login , index.php document doc = jsoup.connect("http://www.example.com/login.php") .data("username", "myusername", "password", "mypassword") .post(); i know can use apache httpclient don't want to. when login site, setting authorised session cookie needs sent on subsequent requests maintain session. you can cookie this: connection.response res = jsoup.connect("http://www.example.com/login.php") .data("username", "myusername", "password", "mypassword") .method(method.post) .execute(); document doc = res.parse(); string sessionid = res.cookie("

transforming String and getting the Specified Value Java (Android) -

i new in android development , want write function have written ios in swift, if can me great : i want convert string string1 = "guardians of galaxy(g.t.g)" into string2 = "gtg" all want value inside brackets , remove . , if there's space within them here's how in swift maybe it'll understand if spacelessfullform = "catch me if can" let spacelessfullform = fullform.condensedwhitespace let delimiters: nscharacterset = nscharacterset(charactersinstring: "()") var splitstring: [anyobject] = spacelessfullform.componentsseparatedbycharactersinset(delimiters) let substring: string = splitstring[1] as! string print(substring) let dotlessstring = substring.stringbyreplacingoccurrencesofstring(".", withstring: "") let uppercasefirstcharcters = dotlessstring.stringbyreplacingoccurrencesofstring(" ", withstring: "") then uppercasefirstcharcters = "cmiuc" try

c# - Adding a reference assembly to script task and deploying -

i'm working on ssis project contains single script task. job of script task upload text file sharepoint site library. i'm using microsft.sharepoint.client , microsoft.sharepoint.runtime achieve this. code simple. string sharepointsite = @"https://server.com"; using (clientcontext ctx = new clientcontext(sharepointsite)) { web currentweb = ctx.web; ctx.load(currentweb); ctx.executequery(); using (filestream fs = new filestream(@"z:\samplefile.txt", filemode.open)) { microsoft.sharepoint.client.file.savebinarydirect(ctx, "/sites/subsite/library/testfile client.txt", fs, true); } console.writeline("uploaded file successfully"); } this works expected visual studio. if package different server,i'm not sure if dll's packaged along deployment file. have set &

google maps - how to specify my Longitude and latitude for use in a timemap -

i'm having trouble figuring out how specify longitude , latitude use in timemap. json: [{"lon":"106.78185","title":"zaki","start":"2016-05-25","description":"operation","id":1,"lat":-6.2206087,"timestart":"18:00:00"}] and below html file i'm working with. <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>tester</title> <script type="text/javascript" src="http://maps.google.com/maps/api/js?key=mykey&sensor=false"></script> <script type="text/javascript" src="lib/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="lib/mxn/mxn.js?(googlev3)"></script> <script type="text/javascript" s

javascript - Cannot get ng-click working for either div or span -

i trying use ng-click both div , span , can't working either. <body ng-controller="mainctrl"> <div ng-click="infoclicked('work_please')"> tony magoo </div> <div> general inquiries, please see our <span class = "highlight" ng-click = "infoclicked('work_span_please')">frequently asked questions</span> </div> </body> and... var app = angular.module( 'plunker', [] ); app.controller('mainctrl', function( $scope ) { $scope.name = 'world'; $scope.infoclicked = function( message ) { alert( message ); } }); here plunk you missing ng-app tag. <body ng-app="plunker" ng-controller="mainctrl">

Error "object required" in VBA , referred to duplicate questions -

my purpose split task constituent tasks , find important one.the macro written in "may" sheet of workallotment.xlsm , tasks in tasks.xlsx for example: constituents constituents important imp praveen t1 t2 t3 t4 t5 t6 t1+t2+t3 =t5 t3+t5+t6 =t9 t1 t6 4 3 1 2 8 9 karthik p1 p2 p3 p4 " among t1,t2,t3- t1 takes more time".its imp 6 3 2 2 walter c1 c2 c3 c4 1 2 3 4 arvind g1 g2 g3 2 1 3 sreelatha h1 h2 h3 2 1 1 code: sub workallotment() dim workallotmentwb, taskswb workbook dim washeet worksheet dim str(9) string dim splitarray() string, s(10) string dim col_new integer dim wa_namerng range