Posts

Showing posts from June, 2010

url rewriting - IIS Rewrite - Creating SEO Friendly URL -

using iis v8 , trying create seo friendly url's current url follows: http://www.domain.com/equipment/flexible/technical.cfm?id=2&title=applications trying create: http://www.domain.com/equipment/flexible/2/applications i have following rule added within web.config - doesnt seem working. <rule name="product technical details"> <match url="^/equipment/flexible/technical.cfm?([0-9]+)/([_0-9a-z-]+)" /> <action type="rewrite" url="/equipment/flexible/technical.cfm?id={r:1}&amp;title={r:2}" /> </rule> any ideas? thanks! your incoming url in format: http://www.domain.com/equipment/flexible/{id}/{title} so, can modify rule this: <rule name="product technical details"> <match url="^equipment/flexible/technical/([0-9]+)/([_0-9a-z-]+)" /> <action type="rewrite" url="equipment/flexible/technical.cfm?id={r:1}&amp;title={r:2}&qu

python - Export matplotlib pdf with text not as path from tkinter -

i have simple gui plots figure this: def display_graph(self,f1): self.canvas = figurecanvastkagg(f1, self) self.canvas.show() self.canvas.get_tk_widget().place(anchor = n ,x = 200 ,y= 150) self.get_all_figures() self.canvas._tkcanvas.place(anchor = n ,x = 675 ,y= 325) self.toolbar_frame = frame(self) toolbar = navigationtoolbar2tkagg(self.canvas, self.toolbar_frame) self.toolbar_frame.place(anchor = n ,x = 540 ,y= 933) there text xlabel, ylabel , user should able export in pdf format. work figure great if displayed text text object in example illustrator, recognized path. (no font information). have changed pyl.rcparams['pdf.fonttype'] = 42 work when plot directly console. there trick make happen gui using canvas? to save image use toolbar , function (depending on user clicks) def save_all(figures,save_path_name,curr = 'all'): try: pp = pdfpages(save_path_name) if curr == 'last': pp

batch file - create process failed when building makefile using GNU tools in windows -

when trying build make file getting following error "createprocess(c:\users\admini~1\appdata\local\temp\make6752-1.bat, c:\users\admini~1\appdata\local\temp\make6752-1.bat, ...) failed. make (e=2): system cannot find file specified." using eclispe ide build make file , gnu make tool version 3.1

push notification - Android Build error -

i doing ionic push notification using fcm during build apk build error came.please me solve issue. error: cmd: command failed exit code 1 error output: failure: build failed exception. * went wrong: problem occurred configuring root project 'android'. > not resolve dependencies configuration ':_debugcompile'. > not find version matches com.google.android.gms:play-service s-gcm:9.8+. versions not match: 9.4.0 9.2.1 9.2.0 9.0.2 9.0.1 + 5 more searched in following locations: https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm /maven-metadata.xml https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm / https://jcenter.bintray.com/com/google/android/gms/play-services-gcm/ma ven-metadata.xml https://jcenter.bintray.com/com/google/android/gms/play-services-gcm/ file:/c:/users/veeravel.p/android-sdks/extras/andro

printing - Android: Communicate with printer using USB to LPT adapter -

my android software need talk zebra printer using usb-to-parallel(lpt) adapter. don't know if have consider adapter usb/serial interface or parallel connection. don't think android can handle lpt connections; on other hand, if consider serial connection, can see endpoints not able write because lack of information adapter(baud rate, data bits...). has experience lpt connections , android? thanks. seems there no drivers usb-to-parallel(lpt) adapter in android. can use: 1) printing android bluetooth zebra printer ; 2) usb zebra print station 3) zebra wifi 4) zebra serial port

Ansible - Write variable to config file -

we have redis configurations differs on port , maxmemory settings, i'm looking way write 'base' config file redis , replace port , maxmemory variables. can ansible? for such operations lineinfile module works best; example: - name: ensure maxmemory set 2 mb lineinfile: dest: /path/to/redis.conf regexp: maxmemory line: maxmemory 2mb or change multiple lines in 1 task with_items : - name: ensure redis parameters configured lineinfile: dest: /path/to/redis.conf regexp: "{{ item.line_to_match }}" line: "{{ item.line_to_configure }}" with_items: - { line_to_match: "line_to_match", line_to_configure: "maxmemory 2mb" } - { line_to_match: "port", line_to_configure: "port 4096" } or if want create base config, write in jinja2 , use template module: vars: redis_maxmemory: 2mb redis_port: 4096 tasks: - name: ensure redis configured template:

how to run sql query on all column data and export result to csv -in c# -

i made sql queries on access db. in datagridview2 see in first column istalled programs in second how many computers installed program. col1 col2 xxxx 1 yyyy 2 zzzz 3 oledbcommand command2 = new oledbcommand(); command2.connection = connection; string query = "select item_1, count(item_1) (select item_1 audit_data category_id = 500) group item_1 having (count(*)>0) "; command2.commandtext = query; oledbdataadapter da1 = new oledbdataadapter(command2); da1.fill(dt2); datagridview2.datasource = dt2; datagridview2.autoresizecolumns(); the datagridview3 contains computers name programs installed when selection changed on datagridview2: string selcell = convert.tostring(datagridview2.currentcell.value); oledbcommand command3 = new oledbcommand(); command3.connection = connection; string query = "select distinct

function - Python 3.X using multiple *args for different stuff -

i know *args used when dunno how many args being used inside function call. however, do when want 1 group of *args x , 1 group of *args y? you can not pass 2 *args within single function. need pass args1 , args2 plain list , may pass these lists args functions doing x , y . example: def do_x(*args): # def do_y(*args): # more thing def my_function(list1, list2): do_x(*list1) # pass list `*args` here do_y(*list2) and call my_function like: args_1 = ['x1', 'x2'] # group of arguments doing `x` args_2 = ['y1', 'y2'] # group of arguments doing `y` # call function my_function(args_1, args_2)

javascript - Angular 2 - Cannot find module in nested routes -

i try use lazyload routes nested. still error not find module in 2 level route. here construct: app.module.ts: import { browsermodule } '@angular/platform-browser'; import { ngmodule } '@angular/core'; import { formsmodule } '@angular/forms'; import { httpmodule } '@angular/http'; import { routing } './app.routes'; import { appcomponent } './app.component'; import { routermodule } '@angular/router'; @ngmodule({ declarations: [ appcomponent, authcomponent ], imports: [ browsermodule, formsmodule, httpmodule, routing ], exports: [routermodule], providers: [], bootstrap: [appcomponent] }) export class appmodule { } app.routes.ts import { router, routermodule} '@angular/router'; import { authguard } './auth/services/auth-guard.service'; import { authcomponent } './auth/auth.component'; export const routing = routermodule.forroot([ { path: '', red

javascript - Why is this counting down after reaching the target? -

i wanted have counter activates when on screen. i've managed mangle other examples i've found. html: <div>scroll down</div> <span class="count">200</span> css: div { height:800px; background:red; } h1 { display:none; } javascript: $(window).scroll(function() { var ht = $('#scroll-to').offset().top, hh = $('#scroll-to').outerheight(), wh = $(window).height(), ws = $(this).scrolltop(); console.log((ht - wh), ws); if (ws > (ht + hh - wh)) { $('.count').each(function() { $(this).prop('counter', 0).animate({ counter: $(this).text() }, { duration: 4000, easing: 'swing', step: function(now) { $(this).text(math.ceil(now)); } }); }); } }); demo: https://jsfiddle.net/76d57vjl/ the problem is,

azure - Creating multiple queries in Hadoop Hive using Ambari -

Image
i'm pretty new working in cloud, general disclaimer! i have set set of databases in hadoop/hive , query them through hive view in ambari. run through azure platform. creating tables based on data , saving these db works great, once attempt create multiple separate tables in same query, start getting strange errors - message saying "error". have made sure code runs fine when test separately, , running each query can way desired end result. the pseudocode looks follows - why won't run @ once? create database if not exists test_db; drop table if exists test_db.table_one; drop table if exists test_db.table_two; use test_db; create table test_db.table_one select var1, var2 [datasource_one]; create table test_db.table_two select var1, var2 [datasource_two]; hiveview had in-built notifications list details on what's wrong if click on it. sharing image below notications highlighted. in query exclude square braces ([]) , should work. fail if used

sitecore8.1 - Restrict image upload size in sitecore -

is there way control image upload size in sitecore? is possible have custom warning message on uploading large file? we on sitecore 8.1 update 3. you can use setting: <setting name="media.maxsizeindatabase" value="500mb"/>

How can I partially match two tables in a many-to-many situation in MySQL? -

currently i'm trying develop system send automated replies customers based on attributes select tickets send in. for instance if send in ticket product_id of 10 , reason_id of return 5 . want able send answer matches these criteria in partial way. in previous question requested in matching options of ticket criteria exactly. if there 5 criteria answer ticket had fulfill these 5 criteria exactly, no more, no less. what want accomplish partial match these tickets. if customer sends in ticket product_ids 10,20,30,40 , reason_id 5 want able match answer has @ least options e.g. answer product_ids 10,20 , reason_id 5 should match product_ids in ticket , reason_id . ticket needs have criteria of answer or more not less. below explanation of how tables after show attempts have been far. tickets_answers id name message 1 answer 1 message sent 2 answer 2 message number 2 3 answer 3 arbitrary text 4 answer 4 text tickets_answ

Read td values and display total with php or javascript -

i remake question hoping better understood. i'm working on table.php file structured below: <table> <tr> <td class="a" name="id">field1</td> <td class="b" name="title">field2</td> <td class="c" name="adder">field3</td> <td class="d" name="addend">field4</td> <td class="e" name="sum">field5</td> </tr> </table> what want read given values of field3 , field4, make addition calculation of both numbers, , display result in field5 php or javascript. have tried this: <script> var x = document.getelementbyclassname("a"); var y = document.getelementbyclassname("b"); var z = x+y; document.write('z').innerhtml = c; </script> or <script> var = document.getelementbyclassname("a").innerhtml; var b = document.getelementbyclassname(&quo

Why does Jenkins keep sending me to https://127.0.0.1:8080? -

i inexplicably having 50% of requests jenkins redirect me https://127.0.0.1:8080/ . jenkins url http://ci.example.com , neither on localhost or https. ok, figured out after much, frustration. issue happening when post'ing data jenkins. used chrome record network traffic , saw request http://ci.example.com/j_acegi_security_check , returning 302 location: https://127.0.0.1:8080/ . further down saw browser sending header x-forwarded-proto: https in request. ahhh, because had set website , forgot deactivate =( after deactivating header, things have returned normal. hopefully saves else headache suffered.

Rails join model not effectively working in my complex application -

i have order , product , in between join model booking . it has peculiarities: the booking join model doesn't need product model still present. (so bookings can stay on order though product has been deleted.) done by: belongs_to :product, optional: true all 3 models in 1 view: store. the bookings rendered a-synchronically. the crux of problem seems order has_many bookings relationship seems not working thought would. been having issues weeks need bottom of it. how did build it? migrations # timestamp_create_products.rb class createproducts < activerecord::migration[5.0] def change create_table :products |t| t.string :name t.text :description t.references :category, index: true, foreign_key: true t.timestamps end end end # timestamp_bookings_orders.rb class createbookings < activerecord::migration[5.0] def change create_table :bookings |t| t.belongs_to :order, index: true, foreign_key: true t.belongs_

r - How can I split large data.frame into smaller ones without using a loop? -

i have large dataframe (20k rows) dataframe contains date / timestamp text , delta between first timestamp , subsequent time stamps. date text time.diff 1 2016-03-09 15:50:07 text 1 0.000 2 2016-03-09 15:50:10 text 2 2.808 3 2016-03-09 15:50:17 text 3 10.128 4 2016-03-09 15:50:53 text 4 45.952 5 2016-03-09 21:26:15 text 5 65.053 i'd able split dataframe smaller chunks based on values contained in time.diff (say chunks of 60 seconds). example, splitting 2 using subset can done so, if have larger frame, end writing 1000's lines of code! i create loop iterate through larger dataframe , accomplish task, know using loops in r rather slow. so i'm wondering approach can take split larger frame many smaller frames in way doesn't use loop , can increment smaller dataframe names e.g. df.sub.1, df.sub.2 ... df.sub.3 # split 2 frames based on matched criteria df.split1 <- subset(df.tosplit, time.diff <= 60) df.split2 <- subs

mysql - Where inside JOIN ON clause? -

if have following tables: table_a id | name |tbl_b_key| status -----+---------+---------+-------- 0 | | 1 | 0 1 | b | 2 | 0 2 | c | 3 | 1 table_b id | type | status -----+---------+--------- 0 | | 0 1 | b | 0 2 | b | 1 3 | | 1 is there difference in terms of performance between these 2 queries? select table_a.name, table_b.type table_a join table_b on (table_a.status = table_b.status , table_b.type = a); select table_a.name, table_b.type table_a join table_b on (table_a.status = table_b.status) table_b.type = a; my understanding first query faster, first reduces amount of rows being joined whereas second query join performs where. or there no real difference between two? edit: pointed out made mistake in first query, fixed now. the 2 queries equivalent. there's no difference. when have 2 valid queries want compare, can run explain on eac

node.js - NodeJS - Q - How to pass a promise in another promise -

i want return or pass promise promise don't know how that. codes: function seedusers(){ var def = q.defer(); _seedusersindb(function(err, users){ if(err){ return def.reject(err); } def.resolve(users); }) return def.promise; } function seeddb(){ var def = q.defer(); _checkcountofusers(function(count){ if(count > 0){ // seeded return def.resolve(); } else{ // have use seedusers() // ???????????????????? // how pass seedusers() ???? // ???????????????????? } }) return def.promise; } what codes put in specified section? thanks mixing promisified , unpromisified functions messy, therefore promisify both low level functions : // promisify _seedusersindb() function _seedusersindbasync() { var def = q.defer(); _seedusersindb(function(err, users) { if(err) def.reject(err); else

Deep learning Memory Error -

i want use deep architecture 15 layers, after change parameters , run again, run following memory error. memory error not resurface when reduce layers 10 layers. but afterwards 10 layers not work anymore, , have reduce layers. i'm wondering if there's way clear 'junk' files can let run @ 15 layers again? memoryerror: error allocating 419430400 bytes of device memory (cnmem_status_out_of_memory). apply node caused error: gpuelemwise{sub,no_inplace}(gpucorrmm{half, (1, 1)}.0, gpuelemwise{composite{(((i0 / i1) / i2) / i3)},no_inplace}.0) toposort index: 163 inputs types: [cudandarraytype(float32, 4d), cudandarraytype(float32, (true, false, true, true))] inputs shapes: [(1024, 64, 40, 40), (1, 64, 1, 1)] inputs strides: [(102400, 1600, 40, 1), (0, 1, 0, 0)] inputs values: ['not shown', 'not shown'] outputs clients: [[gpucareduce{pre=sqr,red=add}{1,0,1,1}(gpuelemwise{sub,no_inplace}.0), gpuelemwise{composite{(((i0 + i1) + ((i2 * i3 * i4) / i5)) + i6

Element height and width change detection in Angular 2 -

i looking solution, nothing found (only articles (window:resize) , not looking for). how detect element size change in angular 2 ? <div #myelement (sizechanged)="callback()" /> i want use css animations , detect element's height , width changes. the problem not angular 2 problem. more generally, how detect size changes in element other window ? there onresize event, triggered window , there no other obvious solutions. the general way many approach this, set interval of, say, 100ms , check width , height of div detect change. horrible sounds, common approach. from this answer more general question, there library using events: http://marcj.github.io/css-element-queries/ . supposedly, it's quite good. use resizesensor you're looking for. unless of course, you're expecting div resize when window does. onresize you're looking for.

php - Apply different tax rate based on user role -

i use woocommerce , members plugin. have created special tax rate classes (customertaxexempttaxclass & customerpstexempttaxclass customers can tax exempt or pay tax (pay pst tax in canada). have created 2 new roles members plugin: customer tax exempt & customer pst exempt. i have added following code child theme functions.php file, not work. /* apply different tax rate based on customer user role */ /* special tax rate: 0 if role: customer tax exempt */ function customertaxexempttaxclass( $tax_class, $product ) { global $current_user; if (is_user_logged_in() && current_user_can('customer_tax_exempt')) { $tax_class = 'customertaxexemptclass'; } return $tax_class; } add_filter( 'woocommerce_product_tax_class', 'customertaxexempttaxclass', 1, 2 ); /* special tax rate: charge gst if role: customer_pst_exempt */ function customerpstexempttaxclass( $tax_class, $product ) { global $current_user;

php - Laravel - After login doesn't redirect -

Image
when logged in can't redirect page. in inspector network page shows 302 found code. the auth::attempt() , auth::check() returns both true when dd(). my code this: route::post('/login', function() { //echo "login..."; $username = input::get('username'); $password = input::get('password'); $remember = input::get('remember'); $userdata = array( 'username' => input::get('username'), 'password' => input::get('password') ); $rules = array( 'username' => 'required|exists:us,username', 'password' => 'required' ); $validator = validator::make($userdata, $rules); if ($validator->passes()) { //dd(auth::attempt(['username' => $username, 'password' => $password], $remember)); if(auth::attempt(['username' => $username, 'password' => $password], $remember))

functional programming - Passing arguments through several functions in Python -

this question related best practice. let's have following code: def clean_text(text, idx): title = sqlalchemy.query("select title page_titles id = %s" % idx) return {title: text} def scrape_webpage(idx): """ stuff here""" response = requests.get(link) return clean_text(response.text, idx) def main(): idx in range(10): scrape_webpage(idx) if __name__ == '__main__': main() the main problem have code there statefulness required (namely idx ) being passed through scrape_webpage . can imagine if have many functions before clean_text() invoked, idx has passed through of them without being used in of them. is there better way clean_text can know state of loop without having passed argument (and incidentally, through of functions use it)? perhaps generators or callbacks? appreciate example.

Does App Engine Flexible automatically gzip responses? -

app engine standard supports automatic gzip compression of responses if client has correct accept-encoding , user-agent headers set on request. info on can found here , here . i running project in app engine flexible beta , not auto compress responses. auto response compression present on flexible beta? if not, recommended approach compress responses? presently, app engine flexible beta not compress responses. web servers can configured compress responses. web server using?

swift - Calendar changed Mac -

i making program runs in background , needs know wether user added events calendar app (the standard app) in mac os. tried using ekeventstorechanged notification, doesn't seem fired when there changes. code notification this: func applicationdidfinishlaunching(_ anotification: notification) { notificationcenter.default.addobserver(self, selector: #selector(calendarchanged), name: nsnotification.name.ekeventstorechanged , object: nil) } func calendarchanged(notificatie : nsnotification) { print ("something changed") } is possible receive notifications changes calendar way? or should try other approach?

Neo4j 3.0.6 Uniqueness constraint being violated with MERGE -

i running neo4j 3.0.6, , importing large amounts of data fresh instance multiple sources. enforce uniqueness using following constraint: create constraint on (n:person) assert n.id unique i import data , relationships multiple sources , multiple threads: merge (mother:person{id: 22}) merge (father:person{id: 55}) merge (self:person{id: 128}) set self += {name: "alan"} merge (self)-[:mother]->(mother) merge (self)-[:father]->(father) meanwhile, on thread, still on same neo4j server , bolt endpoint, i'll importing rest of data: merge (husband:person{id: 55}) merge (self:person{id: 22}) set self += {name: "phyllis"} merge (self)-[:husband]->(husband) merge (wife:person{id: 22}) merge (self:person{id: 55}) set self += {name: "angel"} merge (self)-[:wife]->(wife) merge (brother:person{id: 128}) merge (self:person{id: 92}) set self += {name: "brian"} merge (self)-[:brother]->(brother) merge (self)<-[:brother]-(br

c# - Login control to redirect to different pages depending on the query executed -

i have 2 queries.. want if login control finds username , password in 1st query table redirect seller page.. if finds un , pw in 2nd query table redirect dealer page. how can that? coz checks first query. protected void login1_authenticate(object sender, authenticateeventargs e) { var constring = configurationmanager.connectionstrings["constring"].connectionstring; sqlconnection con = new sqlconnection(constring); string user = login1.username; string pass = login1.password; con.open(); sqlcommand cmd1 = new sqlcommand("select username, password, status login username = '" + user + "' , password = '" + pass + "' , status = 1", con); string currentname; currentname = (string)cmd1.executescalar(); if (currentname != null) { session.timeout = 1; session["un"] = login1.username; response.redirect(&q

angular - Making Components Available to Nested Modules -

so right have set looks this: app module a large module another large module a component a component not have access components loaded in a large module , though components defined both declarations and exports of a large module . is there way can give nested module another large module access component imports of a large module it's child components have access components? or these need declared inside another large module in order it's child components have access them? you need import things in module if components declared in use things. can create feature module imports/exports/declares set of components , use in other modules. - app module - featurea module - featureb module - large module (import featurea module) - component [can use components featurea; can't use components featureb] - large module (import featurea module, featureb module) - component [can use components feat

c++ - How can I maximize my main window and prevent resize in QT -

i trying maximize main qt window upon running , prevent user resizing it. have tried int main(int argc, char *argv[]) { qapplication a(argc, argv); mainwindow widget; widget.showmaximized(); widget.show(); return a.exec(); } which maximize window, along mainwindow::mainwindow(qwidget *parent) : qmainwindow(parent), ui(new ui::mainwindow) { this->setwindowflags(this->windowflags() | qt::mswindowsfixedsizedialoghint); ui->setupui(this); } which grey out "restore down", "maximize" button located in title bar in middle of minimize , close window. but still able drag title bar down unsnap maximized window , readjust size corner , edges. how can prevent ability unsnap window , no strictly no resizing. thanks! if want window frame disappear , maximize-lose-restoredown buttons invisible, can modify ui part of code as: mainwindow::mainwindow(qwidget *parent) : qmainwindow(parent), ui(new ui::mainwindow

mysql - How does the ORDER BY CASE Clause Work in the following Code? -

how part of code work? order case when subject in ('chemistry','physics') 1 else 0 end, subject, winner; first checks if subjet chemistry or physics. if sorting score 1. if subject not contain of "chemistry" or "physics" score 0. after sorts results score results contains chemistry or physics come first after dont contain.

Angular 2, webpack extract-text-webpack-plugin doesn't work -

Image
i have structure folder angular 2 application: an want .scss files inside /app compile inline js modules of angular 2 app, , .scss files in ( /public/assets/styles/ ) compile , extract in file /public/assets/styles/main.css plugin don't work web pack configuration i'm doing wrong? var webpack = require('webpack'); var webpackmerge = require('webpack-merge'); var extracttextplugin = require("extract-text-webpack-plugin"); var htmlwebpackplugin = require('html-webpack-plugin'); var path = require('path'); module.exports = { context: path.resolve(__dirname, '../src'), entry: { 'polyfills': './polyfills', 'vendor': './vendor', 'app': './main', }, resolve: { extensions: ['', '.ts', '.js', '.json', '.css', '.scss', '.html'] }, module: {

PHP curl exec failing on good url -

i have made other calls using curl different site, url: https://api.eveonline.com/account/apikeyinfo.xml.aspx?keyid=5710518&vcode=qiav0wxj9v8t7ajmkn58fwlw6x55un06pt8srfljnbfagvbuwbx2cswloo4gkjvs and code believe correct $service_url = 'https://api.eveonline.com/account/apikeyinfo.xml.aspx?keyid=5710518&vcode=qiav0wxj9v8t7ajmkn58fwlw6x55un06pt8srfljnbfagvbuwbx2cswloo4gkjvs'; $curl = curl_init( $service_url ); curl_setopt( $curl, curlopt_returntransfer, true ); $curl_response = curl_exec( $curl ); if ( $curl_response === false ) { $info = curl_getinfo( $curl ); curl_close( $curl ); die( 'error occured during curl exec. additioanl info: ' . var_export( $info ) ); } curl_close( $curl ); $xml = simplexml_load_string( $curl_response ); print_r($xml); all eror information says there error during curl exec.

javascript - jQuery filter with multiselect option -

how can filter multiple select in jquery? if have table : $('#mask').on('change', function(){ var isiwak = $('.wak').val(); var isi = $("#mask").val(); if(isiwak=="allwak" && isi == "all"){ $(".allshow").show(); } else { $("td:not(."+isi+")").parent().hide(); $("."+isi).parent().show(); } }); //onchange waktu $('.wak').on('change', function(){ var isiwak = $('.wak').val(); var isi = $("#mask").val(); if(isiwak=="allwak" && isi == "all"){ $(".allshow").show(); } else { $("td:not(."+isiwak+")").parent().hide(); $("."+isiwak).parent().show(); } }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <table border="1"> <t

php - Escaping a Windows server file path string with single and double backslashes in it? -

i have windows server file path i'm having lot of difficulty escaping because of php's magic quotes feature. assuming turning setting off isn't trivial, how go escaping path? example: \\server\folder1\folder2\folder3\file.dtsx to complicate things further, path need run part of command wrapped in set of quotes since runs via command prompt utility (called in sql). full command this: $package = 'dtexec.exe /f "\\server\folder1\folder2\folder3\file.dtsx" ' + '/set \package.variables[user::param1].properties[value];"' + cast(@param1 varchar) + '" ' + '/set \package.variables[user::param2].properties[value];"' + cast(@param2 varchar) + '" ' + '/set \package.variables[user::param3].properties[value];"' + cast(@param3 varchar) + '"'; i think main challenge server file path if can lend hand here, though! in advance! dan

javascript - What is the state of ElementRef when it's available in components constructor -

i can access elementref in components constructor: export class mycomponent { constructor(element: elementref) { element.nativeelement what state of dom element: 1) in terms of dom - put in dom already? rendered? it's child components dom elements created , appended? 2) in terms of child components lifecycle - stages have child components gone through - oninit, aftercontentinit etc.? 1) elementref.nativeelement avalable when ngafterviewinit() called. 2) if mean transcluded children, ngaftercontentinit() .

correlation - Autocorrelation in Matlab WITHOUT xcorr -

so i'm expected make autocorrelation of multiple signals (in order see difference of power spectrum it's irrelevant) note: don't want other way resolve exercise explanation problem :) the signals periodic , data length multiple of period. the problem don't same answer xcorr function of matlab. i'm using classic (i think) r_x(lag) = sum(k=-inf +inf) of x(k)*x(k-lag). when searching answer found other method 1 used using basically: ifft(fft().*conj(fft())) if understood correctly taking inverse fourier transform of periodigram equivalent power spectrum, fourier transform of autocorrelation. don't know why "classic" way doesn't work.. can please explain why/if code wrong? if don't want run code can go directly % ! autocorrelation! code: % making prbs y, of period 2^size(a,1) -1 , span [-lambda,lambda] = [ 1 0 0 0 0 1;... 1 0 0 0 0 0;... 0 1 0 0 0 0;... 0 0 1 0 0 0;... 0 0 0 1 0 0;... 0 0 0 0 1 0]; c = [

android - Return results to SearchableActivity in Fragment -

situation topic suggest, working on simple app, simple enough few fragments. app simple me querying items online server. however, in app implement search. problem although i'm little experienced in searching cannot seem working in fragment. when click "search" blank screen comes up, absent results. what have done far so far have wrote search , volley have reason believe fine. in public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { the oncreateview grey, signifying isnt being called or used anywhere. breakpoints placed arent activated. making believe never activity. thank you public class mysearchableactivity extends actionbaractivity { requestqueue requestqueue; list<numberresults> storieslist = new arraylist<>(); private recyclerview recycle; private toolbar toolbar; final context context = this; // @override //protected void oncreate(bundle savedinstances

html - Gradient background of a div doesn't show up if I have text? -

i'm trying make tags enjin website (two, actually). i'm trying make gradient gradiented text inside it, isn't working. code: #ownerheaven { width: 120px; height: 30px; background: linear-gradient(#00a6ff, #0033ff); border-radius: 60px; } #owner_heaven_text { font-size: 20px; padding: 0; margin: 0; } <div id="container"> <div id=" heaven"></div> <div id="owner_heaven"> <h1 id="owner_heaven_text">owner</h1> </div> <div id="dragon"> <div id="owner_dragon"></div> </div> </div> thanks in advance :) you forgot _ in css #owner_heaven . #owner_heaven { width: 120px; height: 30px; background: linear-gradient(#00a6ff, #0033ff); border-radius: 60px; } #owner_heaven_text { font-size: 20px; paddi

android gradle - This error shows in windows 10 32bit version -

Image
i installed studio 2.2 on 2 windows 10pro (32 bits), got (error=216. if change path jdk, got same 'daemon' problem. maybe experts take here. error message: "error:createprocess error=216, version of %1 not compatible version of windows you're running. check computer's system information , contact software publisher"

ios - zoomScaled UIScrollView positioning incorrectly when field tapped -

Image
i have strange issue uiscrollview when it's zoomed in. we display user-created forms on ipad within uiscrollview, fields can of varying size. positioning seems handle enough moving fields (by adding content offsets when keyboard appears) act of tapping field appears doing kind of positioning. my problem - if user zoomed in point field wider view, tapping field (even if keyboard visible) scrolls view way right , despite being left-to-right text entry no text in field yet. pushes left of field (where user expecting type) off left of screen. note - mentioned above, happens if keyboard visible , user editing field. tapping field again (to display delete / copy / paste etc) shoves scroll view on right, cutting off first part of field. the ideal solution have instead scroll make caret position visible on screen, can't find related issue or evidence else has seen on or google. example - you can locate problem adding symbolic breakpoint: [uiscrollview set

How can I add Part# Amounts when they are in multiple columns in Excel? -

i have 4 lists of part#s , each 1 has column amount. part#s may or may not repeated in each list, want 1 big list of every distinct part# total amount in each column. i'll show example. part# amt part# amt part# amt part# amt 0 1 1 2 b 0 b 2 c 4 b 5 c 1 c 0 d 0 c 0 d 4 d 3 e 0 d 0 e 7 e 6 f 4 e 3 f 4 f 0 g 3 f 5 g 2 g 0 h 5 g 6 h 6 h 2 0 h 0 2 j 6 k 3 and final column this: part# amount 4 b 7 c 5 d 7 e 16 f 13 g 11 h 13 2 j 7 k 3 what best way me go doing this? thank you if have latest version of excel (2013+) pro plus edition, might able make use of data models , powerpivot add-in (ms:create data model in excel) . however, following should work regardless of version, , tried/tested in libreoffice calc. assuming have existing data

sql - WPF VB 2015 C# Datagrid selected row contents in different textboxes -

ive got datagrid im using display data sql database using ado.net. ive been struggling while work out, want select row in datagrid, data db , display each column entry in relevant textbox. example id goes tbxid , name goes tbxname etc. internet searches seems concerned datagridview don't think have in vb 2015. i'm using wpf application , in xaml code ive set select full row , set isreadonly=true because id crashes when selecting stuff. manipulate data elsewhere, id how carry out original query. id appreciate help. guys

xpath - Selenium webdriver - Java - How to get code value from tr element? -

i td code value based on td text value. please refer attached image. kindly help!! copy tag name below code didn't work webelement test1 = driver.findelement(by.xpath("//table[@class='table table-striped-admin']//tr//td[contains(text(),'"+tag_name+"')]//td//code")); test1.gettext(); maybe this: webelement test1 =driver.findelement(by.xpath("//table[@class='table table-striped-admin']//tr[contains(td[1],'tag name 1')]/td/code")); test1.gettext(); ???

Prevent Oculus home from starting automatically once my android device is plugged in Gear VR -

i facing problem while running android app on gear vr oculus. start app , launch 360 video. once plug phone gear headset, automatically enters oculus home , app not active anymore. i have configured phone oculus signature file , enabled oculus developer mode, problem ? how can prevent oculus home launching , blocking app?

java.util.ConcurrentModificationException in Android Game Loop -

i using canvas, moving objects on screen, when object hit left side of canvas (x=0), object of same type gets instantiated, , start moving on screen. everything works fine, few objects gets created , start moving around screen. at point, receive concurrent modification exception in run method game loop is, gameobjs arraylist: @override public void run() { while(isrunning){ if(!myholder.getsurface().isvalid()) continue; canvas canvas = myholder.lockcanvas(); canvas.drawrect(0,0,canvas.getwidth(), canvas.getheight(), pwhite); for(mygameobject gameobj : gameobjs){ gameobj.move(canvas); } myholder.unlockcanvasandpost(canvas); } } i've tried use iterator, still getting same error. i appreciate help. thank in advance! collections.synchronizedlist(...) won't work if happening... (throws concurrentmodificationexception...) public class concurrenttest { public static void