Posts

Showing posts from March, 2013

python - Can I use a Dictionary to store keywords that I need to loop through a csv file to find? -

i writing python script go through csv file row row looking keyword. once keyword found need write entire row new .csv file. having trouble writing loop complete task , not understand how write new .csv file. post have done far below. #!/usr/bin/python # first import csv module work on .csv file import csv #lets open files used read , write infile = open('infile.csv','rb') outfile = open('outfile.csv','w') # lets pass file object through csv reader method csv_f_reader = csv.reader(infile) writer = csv.writer(outfile,delimiter=',',quotechar='',quoting=csv.quote_none) #lets create dictionary hold search words unique keys. # associated value used keep count of how many successful # hits forloop hits. search_word={'wifi':0,'wifi':0,'wi-fi':0,'wi-fi':0,'cisco':0,'cisco':0,'netgear':0,'netgear':0,'netge$ csv_line in csv_f_reader: match_found = false keyword ...

css - How do I align cell data in an HTML table with the image in the cell above it? -

i'm making web page me revise computer science class year, , on page i'm making when scroll down there 2 images, headings , descriptions of these other pages consist of. however, images don't appear on center of text, although have aligned center. what i'm asking how each cell of data in html table center cell of data above it. post picture need 10 reputation. here code: <div class="main"> <br /> <br /> <table> <tr> <td> <a href=""> <input type="image" id="topics" position:absolute style="height:px; width:px;" src="./csimages/topics.png"> </a> </td> <td> <a href=""> <input type="image" id="languages" position:absolute style="height:px; width:px;" src="./csimages/languages.png"> ...

java - Why puppet is not able to download latest from snapshot repo -

we using puppet , mcollective our server deployments. both of our dev , test environments, release artifacts (from 2 different branches) same nexus snapshot repo (we use maven classifier distinguish between dev , test artifacts). artifact details like: dev artifact <groupid>my.group</groupid> <artifactid>my-app</artifactid> <version>1.0-snapshot</version> <classifier>dev</classifier> test artifact <groupid>my.group</groupid> <artifactid>my-app</artifactid> <version>1.0-snapshot</version> <classifier>test</classifier> these artifacts released through 2 jenkins jobs. puppet/mcollective use latest version; however, reason ignores classifier while determining latest. meant was, lets assume in nexus snapshot repo dev artifact created @ 21-july-2015 1pm gmt , test artifact created @ 21-july-2015 2pm gmt . on server, if want dev deploy, mcollective agent downloads test artifact...

django - Chaining queries through related objects -

given scenario like: from django.db import models class player(models.model): playername = models.charfield() class team(models): teamname = models.charfield() class members(models): player = models.foreignkey(player) team = models.foreignkey(team) class division(models): divname = models.charfield() class divisionteam(models): division = models.foreignkey(division) team = models.foreignkey(team) how can list distinct players in division id = 5? i've through q , f expressions, i'm not looking complex set of or's. wondering if there way chain number of object1_set.object2_set.all() type structures, or set nested loops build object (to passed template via context) eventual {% p in players %} type loop in template. div id passed through request variable. you do: players = player.objects.filter(members__team__divisionteam__division_id=5).distinct() of course, suggested in other answer, models simplified (by using manytom...

javascript - NodeJS- get process ID from within shell script exec -

i have nodejs code runs shell script using child_process.exec() . within shell script run program someprogram . pid of someprogram , pass javascript code can later kill specific process child_process.exec() call. possible? var exec = require('child_process').exec; var pid = {}; exec('. ./script.sh', function(err, stdout, stderr) { console.log(stdout); settimeout(function() { exec('kill ' + pid, function(err, stdout, stderr) { console.log(stdout); }); }, 6000); }); exec('pgrep -f someprogram', function(err, stdout, stderr) { console.log('stdout' + stdout); pid = stdout; console.log('pid ' + pid); }); just note bottom exec run concurrently. use in gulpfile, etc.

Setting up an XSLT Ingestion Crosswalk for MODS DSpace 4.2 -

i new dspace , want set ingestion crosswalk mods. ultimately, trying harvest oai feeds metadata records in mods format. followed instructions https://wiki.duraspace.org/display/dspace/xsltcrosswalk , stuck. when run: "sudo ./dspace dsrun org.dspace.content.crosswalk.xsltingestioncrosswalk mods /home/dhenry/mods_example.xml" i following error: "error, cannot find ingestioncrosswalk plugin for: "mods"" here relevant lines dspace.cfg: # configure table-driven mods dissemination crosswalk # (add lower-case name oai-pmh) crosswalk.mods.properties.mods = crosswalks/mods.properties crosswalk.mods.properties.mods = crosswalks/mods.properties # configure xslt-driven submission crosswalk mods crosswalk.submission.mods.stylesheet= crosswalks/mods-submission.xsl ...... # crosswalk plugin configuration: # purpose of crosswalks translate external metadata format # dspace internal metadata format (dim) or dspace...

spring - How to load jar file in Java project as a dependency programatically -

in jar: class {getter setter} in war:(load above jar runtime) class b {a a=new a()} problem : now actual problem when deploy war without adding jar dependency (in pom), want pick jar local sys folder when deploy war. i tried urlclassloader , problem here able load classes jar, still class a unable resolve.

sql server - Data from textboxes not being saved in SQL database -

i not sure if it's me or there's wrong code. whenever try add new account, being "saved" , shown in datagridview, however, when check under data set or table data, it's not being saved (or updated). using visual studio 2013 , checked microsoft sql version - 2012. did found here , in other sites, uncheck "prevent saving changes require table re-creation"; , changed "copy output directory copy if newer", oh, , changed |datadirectory| path of 2 mdf files. sorry if i'm asking question asked before. and... here's code (this 1 change password form): if txtnewpass.text = txtretyped.text dim strsql string try dim objadap sqldataadapter dim objdt new datatable strconn = "data source=(localdb)\v11.0;attachdbfilename=|datadirectory|\fhges.mdf;integrated security=true" objconn = new sqlconnection(strconn) dim s string = ...

c# - Is there a surefire way to validate the existence of a URL? -

i have c# mvc4 website, call foo.org. in there "pages" such foo.org/news or foo.org/events. http website, not https. i have c# mvc4 website, http site, administers first 1 (on same webserver). in latter website need validate existence of pages such "foo.org/news" in first one. both intranet sites. foo.org/news , foo.org/events valid pages. if slap urls on address bar of browser, appear,... no problem. i tried several suggestion , other forums no avail. things tried: httpwebrequest request = webrequest.create(uri) httpwebrequest; request.method = "head"; httpwebresponse response = request.getresponse() httpwebresponse); var retval = (response.statuscode == httpstatuscode.ok); response.close(); return retval; and var pingsender = new ping(); var options = new pingoptions(); options.dontfragment = true; var data = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; var buffer = encoding.ascii.getbytes(data); var timeout = 120; var reply = pi...

virtual machine - Multi apache2 websites wont work -

i try make 2 websites on same ip. have understand on research possible if use domain , subdomains. right made in default config file apache2 on ubuntu: namevirtualhost prem2.trixia.dk:80 namevirtualhost srv6.trixia.dk:80 <virtualhost prem2.trixia.dk:80> servername prem2.trixia.dk serveradmin webmaster@localhost documentroot /var/www/html errorlog ${apache_log_dir}/error.log customlog ${apache_log_dir}/access.log combined </virtualhost> <virtualhost srv6.trixia.dk:80> servername srv6.trixia.dk serveradmin webmaster@localhost documentroot /var/www/host523.trixia.dk errorlog ${apache_log_dir}/error.log customlog ${apache_log_dir}/access.log combined </virtualhost> what wonna is, if go website srv6.trixia.dk, goes folder /var/www/host523.trixia.dk , if prem2.trixia.dk, default webpage. right if go srv6.trixia.dk goes /var/www/html . have done wrong? i assume use apache 2.2 or lower, in 2.4 namevirtualh...

php - Custom Helper is not loading correctly in Laravel -

i'm trying load helper file called application_helper.php using composer.json, , i'm getting entire dump of file on every page including composer update command. telling function not exist , throwing 500 error on ajax request. instead of loading it, it's printing out entire file. what's confusing works on everyone's localhost, on our aws server, it's giving issue. great. my files include of: composer.json "autoload": { "classmap": [ "database" ], "psr-4": { "app\\": "app/" }, "files": [ "app/helpers/application_helper.php" ] }, app/helpers/application_helper.php if (!function_exists('mavrick_rsp')) { /* @param $viewroute string @param $data associate/json @error boolean, optional @param associate/json, mergable userdata.... */ function mavrick_rsp($viewroute = false, $da...

windows - Obtain PSCredential instance representing Local System built-in account -

running powershell version 5.0 on windows 10 build 10240. need obtain pscredential instance contains localsystem context. how can achieve this? https://msdn.microsoft.com/en-us/library/windows/desktop/ms684190(v=vs.85).aspx from documentation linked to: this account does not have password . if specify localsystem account in call createservice or changeserviceconfig function, any password information provide ignored. so, supply "any password information" in pscredential constructor: $username = "nt authority\system" $password = "whatever feel like" | convertto-securestring -asplaintext -force $localsystemcreds = new-object -typename pscredential -argumentlist $username,$password

Add a custom country field option to country_select ruby on rails gem -

i'm using country_select gem ruby on rails: https://github.com/stefanpenner/country_select the following code prints list of countries: <%= f.country_select :countryto, html_options = {:class => "form-control"} %> i want add custom option field in select dropdown value "anywhere". know how can achieve this? pretty new ruby on rails apologies if there super easy fix, thank you. according tests of country_select supports include_blank -option of select_tag . should able use: <%= f.country_select(:country_to, include_blank: 'anywhere') %> please consider having @ ruby style guide .

c# - Error accessing Fonts in Azure Web App when using PDFSharp -

i using pdfsharp dynamically generate pdf's in web app. web app works fine locally however, when push app azure (as web app), following exception: {"message":"an error has occurred.","exceptionmessage":"internal error. font data not retrieved.","exceptiontype":"system.invalidoperationexception","stacktrace":" @ pdfsharp.fonts.opentype.fontdata.creategdifontimage(xfont font, xpdffontoptions options)\r\n @ pdfsharp.fonts.opentype.fontdata..ctor(xfont font, xpdffontoptions options)\r\n @ pdfsharp.fonts.opentype.opentypedescriptor..ctor(xfont font, xpdffontoptions options)\r\n @ pdfsharp.fonts.opentype.opentypedescriptor..ctor(xfont font)\r\n @ pdfsharp.fonts.fontdescriptorstock.createdescriptor(xfont font)\r\n @ pdfsharp.drawing.xfont.get_metrics()\r\n @ pdfsharp.drawing.xfont.initialize()\r\n @ pdfsharp.drawing.xfont..ctor(string familyname, double emsize)\r\n @ spiro.services.orderservice.getorderlabel(...

sql - Group by unlike values -

i'm trying create report shows line counts based on report type. i'm grouping on report type, report types have specific names want combined under 1 listing. for example: urgent care reports can have type of urgent care , sd494 , sd510 , sd546 , multiple others. sd### show under urgent care rather separate listing. same op notes , can op note , sd805 , polysomnography , etc. under op notes , in 1 report. have 20 different reports can run individually each report type. how can accomplish task? declare @officeid int = 93; declare @startdate datetime = '6/01/2015'; declare @enddate datetime = '07/01/2015'; select (r.reporttype), sum(cast(round(r.transcriptionlinecount,2) decimal(8,2))) "bill lines", (cast(round(sum(r.transcriptionlinecount) * .13,2) decimal(8,2))) "amount" rptlinecountinfo r join dictation d on d.dictationid = r.dictationid d.officeid = @officeid , r.finishedtime between @startdate , @enddate , (d.dictat...

C-Like Array in TCL -

i'm porting program c tcl, , i'm trying implement data structure similar array in c. 2 main things need are be ordered allow insertion index return array procedure i know size of array before run time, , size should not change throughout program (so static). there data structures fit bill? i'm using tcl 8.6 if matters edit: need able return data structure function. the corresponding data structure list . meets requirements. if want have fixed size, "pre-allocate" this: set data [lrepeat 8 {}] which creates 8 empty compartments. it ordered, can access every element index (0-based), , can pass value procedures/functions , return it. can traverse e.g. foreach , for , , there lot of list manipulating commands. while list tcl data container corresponds closely c array, 1 can use array or dict simulate fixed-size, direct-access, ordered container. # allocation set listdata [lrepeat 8 {}] array set arraydata {0 {} 1 {} 2 {} 3 {} 4 ...

android - Error when installing Amazon FireOS platform to Phonegap application -

i've created phonegap app , trying add amazon fireos platform list. sudo phonegap platform add amazon-fireos as per these instructions, copied avw_interface.jar ~/.cordova/lib/commonlibs . running above command returns: error: android_home not set , "android" command not in path. must fulfill @ least 1 of these conditions. however, both set. echo $android_home -> ~/android/sdk echo $path -> contains ~/android/sdk/tools android resides. has had similar problem? edit: android installs properly, not fireos . however, running phonegap build android gives me same error. as aside, when using phonegap sencha touch, build android , run on kindle, perhaps same work here. maybe don't need fireos platform. edit 2: app/www/res/screen directory contains following directories: android bada bada-wac blackberry ios tizen webos windows-phone i believe these created when created app. however, there's no amazon-fireos here. s...

Ambiguous EtherCAT Details -

the following few introductory lines on ethercat: the ethercat master sends telegram passes through each node. each ethercat slave device reads data addressed “on fly”, , inserts data in frame frame moving downstream. my questions above text: what reading data "on fly" mean? how can data inserted in frame while moving? doesn't need copied first in buffer , updated? this text taken http://www.ethercat.org/en/technology.html . an ethercat network can compared railway each station can off-load , re-load train cars while train moves through station. what reading data "on fly" mean? it means reading happens @ same time when frame transmitting. it's pretty cut-through technology used switches. don't store whole received frame first, process it, , forward it. instead, read transmitting through "on fly" train passing through station. how can data inserted in frame while moving? doesn't need copied first in bu...

javascript - Give array elements individual IDs when taken from PHP file with AJAX -

my index.php : <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> </head> <body> <form name="form1" method="post"> <select id="dropdown1" name="country" onchange="window.getstates()"> <option> select country</option> <option value="1">pakistan</option> <option value="2">india</option> <option value="3">usa</option> <option value="4">uk</option> </select> <input type="text" id="area" style="display: none;" size="16" placeholder=" enter value"></input> <input type="button" id="submit" style="display: none" name="submit" value="submit" onclick="su...

pointers - Difference in mutability between reference and box -

i'm trying understand rust pointer types , relation mutability. specifically, ways of declaring variable holds pointer , mutable -- i.e. can pointed other memory, , declaring data itself mutable -- i.e. can changed through value of pointer variable. this how understand plain references work: let mut = &5; // mutable pointer immutable data let b = &mut 5; // b immutable pointer mutable data so a can changed point else, while b can't. however, data b points can changed through b , while can't through a . do understand correctly? for second part of question -- why box::new seem behave differently? current understanding: let mut = box::new(5); // mutable pointer mutable data let c = box::new(7); // c immutable pointer immutable data new should return pointer heap-allocated data, data points seems inherit mutability variable holds pointer, unlike in example references these 2 states of mutability independent! is how box::new supposed work? if so,...

Unable to find login() function location in opencart -

private function validate() { if (!$this->user->login(@$this->request->post['username'], @$this->request->post['password'])) { $this->error['warning'] = $this->language->get('error_login'); } if (!$this->error) { return true; } else { return false; } } here after function called($this->user->login()) wanted know function located. for admin part: $this->user represents user of admin area, it's instance of class user located in file <oc_root>/system/library/user.php for catalog part: there no such member named $this->user , there member named $this->customer represents user of system catalog (a customer) , it's instance of class customer located in file <oc_root>/system/library/customer.php

java - Open .jar file when double-clicking on .csv file on Mac -

i've created .jar file displays information .csv file in specific, user-friendly format. however, in order open .csv file .jar, have first open .jar, within program select options open .csv file. based on question — set jar default program file — know possible set default on windows automatically opens .jar file , sends argument when double click on file type. is possible on mac? if so, there specific code need add .jar file support this?

spring - JPA and database interaction -

i quite new spring , jpa environment. wrote small code stores information of offices using repository.save(office object) operation. when rerun code shows there no such entry (that entered before). how can permanently store information in database using jpa? if use h2 without configuration (only dependency in gradle/maven), spring create inmemory db you. change setting can create own datasource bean. there simpler way if use spring boot - configure in application.properties . spring.datasource.url=jdbc:h2:file:<path to store url>;db_close_delay=-1;db_close_on_exit=false spring.datasource.driverclassname=org.h2.driver spring.datasource.username=sa spring.datasource.password= spring.jpa.database-platform=org.hibernate.dialect.h2dialect spring.jpa.hibernate.ddl-auto=update

Expand All Folders using fuel ux treeview -

i´m using fuelux treeview display list , want expand folders or nodes when page load. i´m using fuelux.tree.min.js. below code load treeview: $('#trvmembers').ace_tree({ datasource: treedatasource, loadinghtml: '<div class="tree-loading"><i class="ace-icon fa fa-refresh fa-spin blue"></i></div>', 'open-icon': 'ace-icon tree-minus', 'close-icon': 'ace-icon tree-plus', 'selectable': true, 'selected-icon': null, 'unselected-icon': null }); the questions is: there parameter or function expand folders when load page? you can call $().tree('discloseall'); on fuel ux tree , open visible nodes, don't know ace admin trees. see following documentation .

voip - Issues Getting Started with Restcomm -

i've been trying started programming restcomm few weeks now, , i'm having trouble figuring need in order myself set of services. so far, have gotten myself situated restcomm software via aws marketplace; able log software, have failed register phone number yet. whenever select number page clicking "register number," message comes saying registration "failed" without additional information. additionally, have downloaded , unzipped folders mobicents (which have not read use of on desktop yet) , telscale ussd gateway (which have read of background documentation for, yet in motion because of inability utilize restcomm). i have been trying make sense of of these pieces on own, i'm @ point of frustration. guidance walking me through need in order started using restcomm , having functions through telephones correspond simple database? thanks! if have been able log restcomm ami, should able use pre-packaged demo apps. here documentation ex...

c# - wav File not saving using mciSendString -

i using mcisend method record wav file problem file not saving.my code is: using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms; using system.speech.recognition; using system.speech.synthesis; using microsoft.visualbasic.devices; using system.runtime.interopservices; public class form1 { [dllimport("winmm.dll", entrypoint="mcisendstringa")] private static extern int mcisendstring(string lpstrcommand, string lpstrreturnstring, int ureturnlength, int hwndcallback); private void button1_click(object sender, system.eventargs e) { // record microphone mcisendstring("open new type waveaudio alias recsound", "", 0, 0); mcisendstring("record recsound", "", 0, 0); } private void button2_click(object sender, system.eventargs e) { // code not working mcisendstring(...

SQL Server DB_mail sending multiple counts -

i using db_mail in sql server 2008 r 2 send counts of mail daily. how can send 1 email daily has 3 counts ( count a, count b, count c) included? you can use query multiple columns want. [ @query = ] 'query' is query execute. the results of query can attached file , or included in body of e-mail message. query of type nvarchar(max) , , can contain valid transact-sql statements. note query executed in separate session, local variables in script calling sp_send_dbmail not available query. sample query: exec msdb.dbo.sp_send_dbmail @profile_name = 'adventure works administrator', @recipients = 'danw@adventure-works.com', @query = 'select count(*) counta, 1 countb, 2 countc adventureworks2012.production.workorder duedate > ''2004-04-30'' , datediff(dd, ''2004-04-30'', duedate) < 2' , @subject = 'work order cou...

ruby - How to create IPAddr-object with a netmask -

i tried use ruby's ipaddr class , i've been wondering if possible create new ipaddr netmask. clarify issue i've done: ipaddr.new "192.186.2.253/24" => #<ipaddr: ipv4:192.186.2.0/255.255.255.0> what expect this: #<ipaddr: ipv4:192.186.2.253/255.255.255.0> if use to_range method, ip addresses matching second example. did wrong class? how can achieve initialize such ip address without cutting off host id. thanks lot when netmask supplied, address treated network address, not host address, @ least that's how interpret findings in combination the docs : if prefixlen or mask specified, returns masked ip address . i assume, "masked ip address", author means network address, @ least that's makes sense given behavior observed , description of ipaddr#to_range method .

node.js - Node-Postgres SELECT WHERE IN dynamic query optimization -

we're working on node/express web app postgres database, using node-postgres package. followed instructions in this question , , have our query working written way: exports.getbyfilenameandcolname = function query(data, cb) { const values = data.columns.map(function map(item, index) { return '$' + (index + 2); }); const params = []; params.push(data.filename); data.columns.foreach(function iterate(element) { params.push(element); }); db.query('select * columns ' + 'inner join files on columns.files_id = files.fid ' + 'where files.file_name = $1 , columns.col_name in (' + values.join(', ') + ')', params, cb ); }; data object containing string filename , array of column names columns . want query extract information our 'columns' , 'files' tables dynamic number of columns. db.query takes parameters (query, args, cb) , query sql query, args array of parameters pass que...

powershell - Searching through a text file -

i have script searches lastest modified log file. suppose read text file , pick key phrase display line after it. so far have this $logfile = get-childitem 'c:\logs' | sort {$_.lastwritetime} | {$_ -notmatch "x|zr" }| select -last 1 $error = get-content $logfile | select-string -pattern "failed modify" an example line reads this 20150721 12:46:26 398fbb92 cv failed modify cn=role-x-users,ou=role groups,ou=groups,dc=gyp,dc=gypuy,dc=net mds_e_bad_membership 1 or more members not exist in directory they key bit of information im trying here can help? thanks try this: $error = get-content $logfile | where-object { $_ -like "*failed modify*" } | select-object -first 1 this provided looking first match in file. select-string cmdlet returns matchinfo object. depending on requirements there might no reason add level of complexity if you're looking pull first occurrence of error in file. failing this...

Simple Signal Handling in Scrapy/Python giving error -

i'm trying catch closed signal in scrapy following code. and error traceback (most recent call last): signal.signal(scrapy.signals.spider_closed,scrapy_clean_up) typeerror: integer required this code import scrapy import signal,os def scrapy_clean_up(): print "scrapy has closed!" signal.signal(scrapy.signals.spider_closed,scrapy_clean_up) am missing something? the usual approach have scrapy signal handler use dispatcher : from scrapy.xlib.pydispatch import dispatcher dispatcher.connect(scrapy_clean_up, signal=scrapy.signals.spider_closed)

Reading int and double numbers from xml file using MSXML in c++ -

i have simple xml file need read in c++. working on windows choose msxml. , wouldn't problem if not way of how data saved in xml file. cannot modify files have lot of them + can lot more in future. part interest me in xml file is: <data> <sample cost="2.000000000000000e+01">1</sample> </data> in beginning of xml have specified precision of number , how digits can ignored. so far doing: msxml::ixmldomnodelistptr temp = xmldoc->selectnodes("data/*"); temp->getitem(0)->getxml(); gives me whole line string also: temp->getitem(0)->gettext(); gives me number between sections (in case 1) string. dont know how access number in <> without manualy getting string returned getxml(). getting numbers manualy string , converting them double , int isnt problem want know if there way directly access numbers in double , int format.

node.js - How to install recess through npm on the terminal on windows 8.1 -

i have installed node.js on windows pc, when try install recess so: npm install -g recess from terminal, list of errors. how can install recess on machine? here error list: c:\users\king> npm install -g recess npm err! windows nt 6.3.9600 npm err! code enoent npm err! enoent not problem npm npm err! please include following file support request:

return array from function in VBA -

all, i write function return array of integers can index them, not aware of syntax vba. here pseudo code: function getstats() integer dim returnval(4) integer returnval(0)=c2percent14 returnval(1)=c3percent14 returnval(2)=c4percent14 returnval(3)=c5percent14 getstats=returnval end function msgbox getstats(3) where these values integers, or should be, , can index return array stat want. thanks. -rik function getstats() variant getstats array , not integer

web services - Java EE TDD starting point -

i want apply tdd java ee application. the requirement create company name , contact details. entry point system rest , web service, depends on client. i'm struggling find starting point write unit tests. do start stateless companyservice bean (rest , web service use service/bean) takes in parameters in create method or start @ rest service , web service level , work way down, i.e. entry points? there's books written answer can't covered in short answer, here's starting point: you start acceptance test simple bit of user functionality, e.g. create company name via web service. use tdd create code needed satisfy acceptance test. can either 'outside-in' or 'inside-out'.

excel - VBA to create hyperlinks from a list -

i have below vba: sub list_creator() ' ' list_creator macro ' creates list of names become tab names ' ' sheets("all scheme derivatives").select activesheet.range("$a$1:$q$64944").autofilter field:=9, criteria1:=array( _ "a - mini", "b - supermini", "c - lower medium", "d - upper medium", _ "e - executive", "g - specialist sports", "h - mpv", "i - 4 x 4", "y - lcv", "="), _ operator:=xlfiltervalues columns("b:b").select selection.specialcells(xlcelltypevisible).select selection.copy sheets("list").select sheets("list").name = "list" range("a1").select selection.pastespecial paste:=xlpastevalues, operation:=xlnone, skipblanks _ :=false, transpose:=false application.cutcopymode = false activesheet.range("$a$1:$a$1047980").removeduplicates columns:=1, header:= _ xln...

gridview - Long response time for loading a grid view from a table in oracle database -

i working on web application using .net 4.5 framework. populating grid view table in oracle database. table huge 73,000 records , each 5 columns. response time loading of table around 4 mins.i populating of connected architecture method of ado.net. want way reduce response time. the code retrieving public datatable retrievemanufacturerdetails() { try { opendbconnection(); objdatatable = new datatable(); objtrans = objcon.begintransaction(); objcommand = new oraclecommand("sp_get_manufacturer_details", objcon); objcommand.commandtype = commandtype.storedprocedure; objcommand.parameters.add("cmanufacturer", oracletype.cursor).direction = parameterdirection.output; objcommand.transaction = objtrans; objdataadapter.selectcommand = objcommand; objdataadapter.fill(objdatatable); objtrans.commit(); return objdatatable; } catch (exception ex) { objtrans.rollback(); throw ex; ...

sql - Is there a difference between NOT (ColumnName LIKE '%a%') and ColumnName NOT LIKE '%a%' -

i came across when amending else's view in sql server. are there differences between: not (columnname '%a%') and columnname not '%a%' are there performance differences or difference in results? or strange way (strange me anyway) sql server alters code when use query builder or view builder? no, there's no difference. the 2 syntaxes both make sense - not like clearer one, it's not can disable not (a simple unary boolean operator) in cases this. most of time, form of query doesn't matter performance - time does, you're looking @ subtle bug in execution planner. before query gets anywhere close executing, it's torn apart, analyzed , rebuilt actual steps needed results - whenever wonder what's really happening in query, execute include actual execution plan, , you'll see. if you're human, there's little reason not use not like - you'd use other way part of automatic generation of code (negating res...

c# - Error with explicit conversion when using CollectAs<> -

right have simple problem, cannot life of me think of simple answer go it. code supposed return single 'person', collection of languages , countries. return client.cypher .match("(person:person)") .where((person person) => person.email == username) .optionalmatch("(person)-[:speaks]-(language:language)") .optionalmatch("(person)-[:current_location]-(country:country)" .return((person, language, country) => new profileobject { person = person.as<person>(), language = language.collectas<language>(), country = country.collectas<country>() }).results.tolist(); it looks right me, isn't, on build error, understand cannot solve. cannot implicitly convert type 'system.collections.generic.ienumerable<neo4jclient.node<graph.country>>' 'graph.country'. explicit con...

How to understand javascript error debugging message -

i have used 1 function in application through error message. this have done identify error line number , file location. that fine work confused line numbers because has 2 value each. please have on 1 of same error message: error @ object.core.initalert (http://localhost/demo/core.js:205:22) @ http://localhost/demo/app.js:26:10 @ _setimmediate (http://localhost/demo/async.js:182:20) @ http://localhost/demo/async.js:234:13 @ http://localhost/demo/async.js:113:13 @ _arrayeach (http://localhost/demo/async.js:85:13) @ _foreachof (http://localhost/demo/async.js:112:9) @ _each (http://localhost/demo/async.js:77:13) @ object.async.foreachof.async.eachof (http://localhost/demo/async.js:233:9) @ object.async.foreach.async.each (http://localhost/demo/async.js:210:22) you can see @ last of line there 2 line numbers , confused here 1 line number function statement. first 1 or second. for ex. in first line: at object.core.initalert ( http:...

Which function I can use to send a simple text from the php server to android -

if have following string variable in php file: $text = "hello world"; can use print(json_encode($text)); send $text void function such following function in android? void getstring(string text) { // somethings on text variable }

javascript - anglularJs custom directive not loading -

i trying create custom directive in below manor: my main html file: <body ng-app="boom"> <!--<section ng-include="'data-table.html'"></section>--> <data-table></data-table> </body> my app.js file: (function () { var app = angular.module('boom', ['ajs-directives']); })(); my ajs-directive.js file: (function () { var app = angular.module('ajs-directives', []); app.directive('datatable', function () { return { restrict: 'e', templateurl: 'data-table.html', controller: function () { this.dataset = dataset; }, controlleras: 'tabledata' }; }); var dataset = [ { prop1: 'one', prop2: 'two', prop3: 'three' }, { prop1: 'four', prop2: 'five', prop3: 'six' } ]; })(); and data-ta...

Change colspan color in HTML with Javascript -

i have problem. color 1 word, , not row's words. e.g.: great, if passed became green, failed became red, , not testable became orange without coloring last result text. how can refer words, , coloring without last result text? here javascript code: javascript: (function() { var = window.frames['mainframe'].frames['workframe'].document.getelementsbytagname("b"); (var i=0, max=all.length; < max; i++) { if(all[i].innerhtml == "failed" ) { all[i].parentnode.parentnode.style.textcolor = "white"; all[i].parentnode.parentnode.style.color = "red"; } if(all[i].innerhtml == "passed") { all[i].parentnode.parentnode.style.backgroundcolor = "white"; all[i].parentnode.parentnode.style.color = "green"; } ...

c# - ASP .NET MVC 5 prevent "escape" Unicode string -

first i'd sorry if title not correct, don't know how call it. tried google many times don't found need result (maybe keywords not correct) my problem is, in asp .net mvc 5 project, unicode words ""escaped". ex:thư viện trường thpt chuy&#234;n lương thế vinh (the "chuyên" "escaped" "chuy&#234;n") anyone know solution please me. lot.

Normalization issue in Java - Android Studio -

i gathering 10 acceleration values on-board accelerometer on mobile device. attempting normalize these values between range of -1,1. unable figure out why isn't working correctly. here normalization code: class normutil { private double datahigh; private double datalow; private double normalizedhigh; private double normalizedlow; public normutil(double datahigh, double datalow) { this(datahigh, datalow, 1, -1); } public normutil(double datahigh, double datalow, double normalizedhigh, double normalizedlow) { this.datahigh = datahigh; this.datalow = datalow; this.normalizedhigh = normalizedhigh; this.normalizedlow = normalizedlow; } public double normalize(double e) { return ((e - datalow) / (datahigh - datalow)) * (normalizedhigh - normalizedlow) + normalizedlow; } on button press, highest/lowest acceleration values found in code: = enrolacc.get(0); b = enrolacc.get(0); ...

excel vba - Select rows which have a numeric value in the first cell (Column A) -

i using excel vba try , select range of rows on spread sheet located below last row numeric value in column a. row 40 need select from, location change. how perform selection based on non numeric value. selecting range of rows , deleting them using following rows("40:40").select range(selection, selection.end(xldown)).select application.cutcopymode = false selection.delete shift:=xlup dim lastrow integer lastrow = activesheet.usedrange.rows.count row = 2 lastrow if not isnumeric(cells(row, 1)) row = row+1 rows(row).select range(selection, selection.end(xldown)).select application.cutcopymode = false selection.delete shift:=xlup end if next row

c# - Add comboBox items from code behind. [WPF] -

Image
i grabbed code msdn . im trying similar, use list instead of 3 different strings. say list<string> strlist = new list<string>(); strlist.add("created c#"); strlist.add("item 2"); strlist.add("item 3"); //msdn code below cbox = new combobox(); cbox.background = brushes.lightblue; cboxitem = new comboboxitem(); cboxitem.content = "created c#"; cbox.items.add(cboxitem); cboxitem2 = new comboboxitem(); cboxitem2.content = "item 2"; cbox.items.add(cboxitem2); cboxitem3 = new comboboxitem(); cboxitem3.content = "item 3"; cbox.items.add(cboxitem3); cv2.children.add(cbox); tried cbox.items.add(strlist); tried forloop loop through each element, doesn't work either. ideas how can achieve this? xaml: <grid x:name="grid44" datacontext="{staticresource tblpermitsviewsource}" horizont...

As to the progress bar videojs player to make draggable slider? -

as progress bar videojs player make draggable slider? here http://take.ms/2m2cw var down = false; me.controlbar.progresscontrol.on('mousedown', function() { down = true; }); me.controlbar.progresscontrol.on('mouseup', function() { down = false; }); me.controlbar.progresscontrol.on('mousemove', function(e) { if(down) { console.log(this.seekbar.update()); } });

c# - Row Number for RDLC Matrix -

Image
i using rdlc matrix. total number of record got data set 46 matrix map 7 records.i using following expression count number of rows not working expected. =rownumber(nothing) try this: =rownumber(nothing)/count(fields!admitcardno.value)

python - literalinclude : how to include only a variable using pyobject? -

i'm using sphinx document parts of python code. i include variable class in documentation. for example, tried without success : .. literalinclude:: myclass.py :pyobject: myclass.avariable :language: python i see 1 solution if code change in next release line numbers of variable change : .. literalinclude:: myclass.py :language: python :lines: 2-3 is there solution filter variable ? as workaround, use start-after , end-before options have add 2 comments in code before , after variables. for example : the class : class myclass(): # start variables avariable = {"a":123 , "b":456} # end variables def __init__(self): pass the rst file : .. literalinclude:: myclass.py :start-after: # start variables :end-before: # end variables :language: python it's not perfect, works.

Spring - JMS , after couple of start/stop of JMS activemq server, listener server throws java.io.EOFException and then does not connect to running JMS -

i have following setting in spring context file. <bean id="amqpowerconnectionfactory" class="org.apache.activemq.activemqconnectionfactory"> <constructor-arg index="0" value="${power.messagebrokerurl}"/> </bean> <bean id="powerconnectionfactory" class="org.springframework.jms.connection.cachingconnectionfactory"> <constructor-arg ref="amqpowerconnectionfactory"/> </bean> <bean id="powereventqueue" class="org.apache.activemq.command.activemqqueue"> <constructor-arg value="powereventqueue"/> </bean> <bean id="timeserieschangescontainer" class="org.springframework.jms.listener.defaultmessagelistenercontainer"> <property name="connectionfactory" ref="powerconnectionfactory"/> <property name="destination" ref="powereventqueue"/> ...