Posts

Showing posts from May, 2010

c# - TempData value implicitly cast from List<string> to string[] after RedirectToAction() -

i using tempdata allow error message displayed after redirect. compatibility, using list<string> add messages list of errors in notificationhelper class: if (tempdata["errornotification"] == null) { tempdata["errornotification"] = new list<string> { message }; } else { var data = (list<string>) tempdata["errornotification"]; data.add(message); tempdata["errornotification"] = data; } inside controller, fill tempdata error message , before return redirecttoaction() call, tempdata contains dictionary record list<string> (to exact: system.collections.generic.list`1[system.string] ) value right after call, inside terms() function, value becomes array ( system.string[] ). [httpget] public iactionresult terms() { return view(); } [httpget] public iactionresult index() { notificationhelper.adderrornotification("error!", tempdata); return redirecttoaction("terms...

html - Add a class to a group of elements in Pandoc markdown? -

i use pandoc create content website. for example, have following content on page: # me text. ## hobbies ### hiking text hiking. ### dancing text dancing. ### other text other. ## why love pandoc more text. pandoc parses me , outputs nice html. but want post-process html further, example want hobbies part become accordion. for i'd in own container, e.g. <div class="accordion"> . possible somehow? update by attaching class specific heading, can achieve close need: ## hobbies {.accordion} ... now can target using css (code not tested): h2.accordion ~ *:not(h1, h2) { color: red; } this assumes next heading on same (or higher) level belongs carousel. this can of help. don't know though whether fits requirements, it's start. sure, markdown supports raw html , e.g.: # me text. ## hobbies <div class="hobbies"> ### hiking text hiking. ### dancing </div>

vba - Every time a cell's value changes, copy and paste range to next open column on sheet2 -

Image
i have tried variety of functions try , work bit complicated skill level vba, appreciated. i have workbook 2 worksheets, 1st having large range of data , formulas , 2nd containing 2 empty tables populated specific date sheet1. sheet1 has column of dates range("dk7:dk39") range 5/1/1986 5/1/2018. time first date changed in column ("dk7"), of other dates in following years auto-update same day in given year. these changes, 2 separate columns repopulated new data determined based on date-specific data. i have code cycles target/first date cell ("dk7") through dates need data for: dim date = dateserial(1986, 5, 1) dateserial(1986, 8, 28) range("dk7").value = next i need add code while dates being cycled through , thus, creating new data needs recorded, ranges ("ds7:ds38") & ("dt7:dt38") copied , pasted next open column in 2 respective ranges on sheet2 formatted years 1986-2017 y-axis column , 5/1 through 8/28 x-...

python - how to find if edit box got the focus -

i need verify focus moves edit box after typing "enter" in other edit box. i'am using pywinauto library. tried using 'has_keyboard_focus()' returns 'false' no matter focus is. o = dlg.child_window(title="uut1", auto_id="gbuut", control_type="group"). \ child_window(title="serial # 2 :", control_type="edit").has_keyboard_focus() print(o)

wordpress - Bootstrap Post Carousel blocking other PHP in page-template -

i have created post carousel within wordpress page-template, other php (such advanced custom fields content , such) blocked. wp_debug shows no errors , can't find error within code. below code have used create carousel recent posts custom post type: when entirely remove slider php below work/load, can't seem find mistake in code. <div class="carousel-inner" role="listbox"> <?php $i = 2; global $post; $args = array( 'numberposts' => -1, 'post_type' => 'work', 'orderby' => 'date', 'order' => 'asc', ); $myposts = get_posts($args); if($myposts): $chunks = array_chunk($myposts, $i); $html = ""; foreach($chunks $chunk) { ($chunk === reset($chunks)) ? $active = "active" : $active = ""; $h...

-Xmx2048m is ignored by eclipse.ini -

my eclipse based product eclipse.ini has below entry accommodate 2gb of heap memory : -startup plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar -application xx.yy.zz.mm.application.application -showsplash splash.bmp --launcher.appendvmargs -vmargs -dosgi.requiredjavaversion=1.8 -xms512m -xmx2048m when launched exe not working ini entry xmx being ignored. workaround : using batch file below entry: java -dosgi.requiredjavaversion=1.8 -xms256m -xmx2048m -xss4m -jar plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar -application xx.yy.zz.mm.application.application -showsplash splash.bmp which working fine solution looks ugly users has launch application not exe batch file. info helpful. using windows7 + 64bit jre + eclipse neon strange part while xmx agrument working fine batch file why not working .exe+ini! don't know if can debug launcher or why ini file ignoring 2048m memory. the ini file fragile, sensitive whitespace , silently i...

excel - Looped call on rows in VBA -

i'm trying run call on top row, delete row , move cells below , run on new top row again. repeat excercise till there no more rows left. , yes know slow way of doing it, call takes 10 secs each row, it's nice way of keeping track of progression (i.e how many rows left). this i've got far, not understanding request delete range a2:c2 , move cells below if there value in range a3. any appreciated! sub loop_through_rows() dim rngquantitycells range set rngquantitycells = range("a2", range("a2").end(xldown)) = 1 rngquantitycells call runsplit if range("a3").value > 0 range("a2:c2”).delete shift:=xlup end if next end sub try this: sub loop_through_rows() dim rngquantitycells range set rngquantitycells = range("a2", range("a2").end(xldown)) = 1 rngquantitycells call runsplit if range("a3").value > 0 range("a2:c2").delete shift:=xlup end if next end sub ...

react native - Calling redux actions without bindActionCreator -

i want store gps position of user in redux-store. coords use this: navigator.geolocation.watchposition( (data) => { // }, null, { timeout: 60000, distancefilter: 10 }); i have reducer position: import createreducer '../lib/createreducer' import * types '../actions/types' export const position = createreducer({}, { [types.set_position](state, action) { return { latitude: action.latitude, longitude: action.longitude };; } }) and action: import * types './types' export function watchposition() { return (dispatch, getstate) => { ??? } } export function setposition({ latitude, longitude }) { console.log('ja'); return { type: types.set_position, latitude, longitude } } i want init watchposition in home-screen. don't bind actions there (no connect() ). how call action , init reducer when new position available? you czn import store object in commponent o...

php - SoapServer behind Symfony 3 controller not calling wrapped method -

overview i'm trying put soap server inside symfony controller described here: http://symfony.com/doc/current/controller/soap_web_service.html . i'm using php2wsdl generate wsdl (after having failed create valid 1 hand!). have service class bunch of methods exposed via soap. , symfony controller shovel post data soapserver instance , barf out yukky xml response client. but i'm pretty sure soapserver not calling methods on service class. can see soapserver::getfunctions php2wsdl @soap annotated methods have been registered soapserver instance, nothing methods supposed seems happening; no logging, not throw new \exception('@#!?!'); on first line. the actual symptom have that, after soapclient tries __soapcall method (in other application), expects have received soapheader s (which method might setting; don't know) response headers empty. code commented lines things i've been using try , debug. symfony controller class defaultcontrol...

r - Update Shiny graph when new Data is received -

my shiny app uploaded on shinyapp.io server. have python script receive data serial port , written inside csv file inside pc. uploading whole csv file on shiny app , generates graph. since passage of time data getting bigger therefore take large amount of time upload , generate graph , when ever close tab of browser , open link again shiny app again ask upload file. unable retain previous state. therefore have following question regarding shiny app : is possible restore previous state in shiny app after close , open instance again? if possible can create new csv file in desktop every time after instance being opened. need send message messaging client running in pc. does shinyapp , r support messaging client, example mqtt or socket.io? currently have upload file, possible there should static path, don't have browser file using file browser , have click update button , update new file? at extreme possible shiny app retain previous state , there should counter send...

jquery - Android keyboard appearing and dissapering -

i'm developing e-shop using magento , there small bug in search box on android devices. when user clicks on search box, keyboard appears , disappears after 1 second. page uses jquery "capture" id of search box portion of code follows: $('#search').keyup(function () { #code )}; i've tried various saw online didn't work. suggestions though lead fact keyboard looses focus. appreciated. it's becouse input lose focus. can try force on input field in jquery $("#search").focus()

java - How to set value in text view from other Android app -

i need set value in app instaled in devise other app or service or broadcast is homework... example first app package com.example.example1 second app package com.example.example2 my textview id in first app r.id.textview in activity of application want should make textview this: textview = (textview) findviewbyid(r.id.textview); then after in same application call: textview.settext("text want"); if that's not you're looking please expand more on want do.

amazon web services - AWS S3 Bucket Policy not working when manually testing Lambda Function -

i have aws lambda function accesses s3 resource it’s url (i.e https://s3-eu-west-1.amazonaws.com/bucketname/key ). i have added bucket policy on s3 bucket allows lambda function access s3 bucket (via lambda functions iam role). bucket policy looks follows: 
 { "version": "2012-10-17", "id": "access control s3 bucket", "statement": [ { "sid": "allow , list requests iam role", "effect": "allow", "principal": { "aws": "arn:aws:iam::123412341234:role/role-name“ }, "action": [ "s3:get*", "s3:list*" ], "resource": [ "arn:aws:s3:::bucket-name”, "arn:aws:s3:::bucket-name/*" ] } ] } this works fine when lambda fun...

sql - Get a value based on another column's value -

it's pretty basic sql statement imagine, can't life of me figure out how do. so have table have 3 columns : amount of car sold (aocs), day of week (dotw), previous day of week (pdotw). i'd have amount of car sold previous day in fourth column. example, let's have sold 4 cars on monday, 5 cars on tuesday, 3 cars on wednesday. on tuesday line, i'd have '4' written, amount of cars sold on monday. i'm not sure if make sense, let me know. thank help! you have join table on itself select a.dotw, a.aocs, a.pdotw, b.aocs my_table left join my_table b on a.pdotw=b.dotw

csv - Powershell Error -

i getting below error when run powershell code. cannot figure out @ all. not sure if has name of file location or not. import-csv : cannot bind parameter 'delimiter'. cannot convert value "csv" type "system.char". error: "string must 1 character long." @ line:4 char:60 + ... grouplist = import-csv c:\users\eh3599\desktop\powershell csv test\te ... + ~~~ + categoryinfo : invalidargument: (:) [import-csv], parameterbindingexception + fullyqualifiederrorid : cannotconvertargumentnomessage,microsoft.powershell.commands.importcsvcommand script source: set-executionpolicy unrestricted import-module activedirectory $grouplist = import-csv c:\users\eh3599\desktop\powershell csv test\test2-testoutput1.csv -header groupname,domain | select groupname,domain $table = @() $record = @{} foreach ($group in $grouplist) { if ($group.domain -eq "a") {$domainpath...

PHP 7: Query output to Text File Questions (FIeld Headers and Skipping a Comma after last column) -

i've new php , trying re-create code had in language. current version of php i'm working 7.17. right now, i'm trying re-create simple function of opening mysql query comma deliminated text file there no comma after last column (just line break). i'm trying figure out 2 things right finish piece of code. how insert query column headers @ top of data output (right data output, not column headers). at line "fwrite($output, $value.',');", i'm trying figure out how not add comma after last field (how skip adding comma after last column of data). php: if (isset($_post['download'])) { header('content-type: text/plain'); header('content-disposition: attachment;filename=cars.txt'); header('cache-control: no-cache, no-store, must-revalidate'); header('pragma: no-cache'); header('expires: 0'); $output = fopen('php://output', 'w'); while ($row = get...

Cassandra Spark Dataframe, CSV : "query in the SELECT clause of the INSERT INTO/OVERWRITE statement generates the same number of columns as its schema -

i have csv file around 100 cols. wanted put in table 101 cols (it 102 cols) the problem is have following message: org.apache.spark.sql.cassandra.cassandrasourcerelation requires query in select clause of insert into/overwrite statement generates same number of columns schema. how can overcome problem? here code: df = sqlcontext.read() .format("csv") .option("delimiter", ";") .option("header", "true") .load("file:///" + namefile); and then: df.repartition(8).select("col1","col2",..."col100").write().mode(savemode.append).saveastable("mytable");

swift3 - Disable Text Editor Menu UITextField (Swift 3.0/Xcode 8) -

Image
i'd disable popup menu 4 of uitextfields i'm not sure how. every time click "speak" function [not pictured] or bold/italicize/underline button app crashes. i've seen solutions in previous versions of swift/xcode, haven't seen 1 swift 3 or xcode 8. in advance!

javascript - Ajax Request not submit PHP executed form -

i have following code below needs submitted using ajax request. form <form action="genformexec.php" id="genform" method="post" enctype="multipart/form-data"> <label class="type" for="ccode">*your confirmation code series of numbers sent mail after payment verification</label> <input class="half" type="text" name="ccode" id="ccode" placeholder="confirmation code"> <input class="half" type="email" name="uemail" id="uemail" placeholder="email address"> <input class="half" type="text" name="fname" id="fname" placeholder="first name"> <input class="half" type="text" name="lname" id="lname" placeholder="last name"> <input class="full" type=...

javascript - Update django template after object creation -

i have model package, , table in template displays package instances, want table updated whenever new package instance created without refreshing page ( new instances should added ), after researches found ajax solution, have have read django signal post_save, how can send post_save signal ajax in order update template ? thank

angularjs - how can update my form in modal in angular js? -

hello creating mean application in want update record.the record in table format , when user click on edit button modal appears database values on input text box . have not problem in updating field stuck in updating video part. how can it?? html form (i use single form creating , updating) <div class="panel panel-default"> <div class="panel-heading">add videos</div> <div class="panel-body"> <div style="margin:10px;"> <form name="addvideos" class="" method="post"> <div class="alert alert-success" ng-show="success" style="background-color:black;"> <strong>successfully updated!!</strong> redirecting videos page. </div> <div class="form-group"> <label>title</label> <input type="text" class="form-control" ng-m...

netlogo - Efficiency clarification: Asking subsets of a general turtle type or asking breeds? -

i'm working large model many agents executing many procedures each day. is better such: ask turtles [ if type = "a" [do-a-thing] if type = "b" [do-b-thing] ] or alternatively ask a-turtles [do-a-thing] ask b-turtles [do-b-thing] i'm looking lower computational load. here's example tries both of approaches. creates 100,000 turtles , executes test 1,000 times each case. approach 2 seems faster. on machine, approach 1 took 46.3 seconds, , approach 2 took 30.6 seconds. doesn't use ifelse in approach 1. seems logical approach 2 faster, since avoid comparisons. breed[a-turtles a-turtle] breed[b-turtles b-turtle] turtles-own [ typ ] ; setup button callback function setup clear-all ; create turtles approach 1 create-turtles 100000 ask turtles [ ifelse (who < 50000) [ set typ "a" ] [ set typ "b" ] ] ; time approach 1 let 0 let iter 1000 reset-timer while [ < iter ]...

function - Python How to use sep=" " only between second and third item -

i have question print function. print("welcome to", a, "this new world") how can use sep=" " full stop between whatever , "this new world", not between "welcome to" , whatever is? i using python 3. basically want print this: assuming a "cake". welcome cake. new world # ^ full stop talking about. it won't accept question here more detail: have tried google didn't more basic , talking using separation function when there 2 items of text. there bunch of ways achieve describing better others. 1st way we can first keep syntax have make slight changes: print("welcome " + + ". new world") as may notice, added space after "to" , period , space before "this". replaced commas + 2nd way we can use %s. converts variable string , allows write whole output without needing use + more pythonic. print("welcome %s. new world" % a)...

Filter array of arrays with an array in Ruby -

looking more efficient way of filtering array of arrays using array in ruby. let me demonstrate. starting this: core = [[1, "apple", "james bond"], [5, "orange", "thor"], [10, "banana", "wolverine"], [15, "orange", "batman"], [20, "apple", "mickey mouse"], [25, "orange", "lee adama"], [30, "banana", "luke skywalker"]] filter = ["apple", "banana"] result = core.magical_function(filter) # result == [[5, "orange", "thor"], # [15, "orange", "batman"], # [25, "orange", "lee adama"]] the thing can think of looping through filter elements, slows down code lot when toy example gets more complicated. use array#reject , array#include? : core.reject { |_,fruit,_| filter.include?(fruit) } ...

excel vba - Trim Cell Contents to Certain Lenght with Scientific Numbers -

i have column of numbers need keep numbers limit length 20 characters. sub casecheck() dim mystring string dim newstring string dim char variant 'replace special characters nothing const specialcharacters string = "!,.,#,$,%,^,&,-,(,),{,[,],},/,\, " = 2 trans mystring = worksheets("data input").cells(i, 10).value newstring = mystring each char in split(specialcharacters, ",") newstring = replace(newstring, char, "") worksheets("expertpay feed").cells(i, 3).value = newstring worksheets("expertpay feed").cells(i, 3).numberformat = "0" next next 'trim length down 20 characters = 2 trans worksheets("expertpay feed").cells(i, 3).value = left(worksheets("expertpay feed").cells(i, 3).value, 20) next end sub my code works well, except when have numbers long. example: this original number: 1.31137e+17 turns 13113690920150400000000000000000 , can't seem trim off zeroes! ...

Hangman in Python - Replace multiple characters in single string based on index python -

trying create game called hangman in python. i've come long way, 'core' functionality failing me. i've edited out parts irrelevant question. here comes: picked = ['yaaayyy'] length = len(picked) dashed = "-" * length guessed = picked.replace(picked, dashed) while tries != -1: input = raw_input("try letter: ") if input in picked: print "correct letter!" found = [i i, x in enumerate(picked) if x == input] item in found: guessed = guessed[:item] + input + guessed[i+1:] print guessed upon calling script, python creates variable named guessed containing 7 dashes ------- asks user letter , if letter correct, replace - correct letter. not keeping previous letters. the word guessed yaaayyy output of code: word 7 characters: ------- try letter: correct letter! -aaa try letter: y correct letter! yyyy goal: word 7 cha...

javascript - How to get an HTML source page using an HTTP GET request -

i need html source website: http://nextbyteindustries.com it's redirect domain: http://5linx.com is there anyway send request website , html source of redirected website? if no, anyway - if sent request page example: " http://5linx.com " - how html source while not redirecting ? through ajax cant it. in other way can it there linux command named curl . can curl http://5linx.com or wget

migration - Upgrading Oracle forms and reports from 6i to 12c -

we planning migration of oracle forms , report 6i application 12c, , @ same time upgrade latest version of oracle (from 10g 12c). i know steps can follow, or start? there must consider before doing this? problems might encounter? any information whatsoever helpful ! i did exact thing. you'll want use forms migration assistant heavy lifting. copy fmb files somewhere , run assistant against them. open fmb's in 12c , convert 2 tier commands 3 tier (like host client_host (using webutil), etc) , may want other enhancements can made using 12c specific code on 6i (file operation handling, reports, external link handling, etc)

How do I perform operations on different numeric types while computing the average in an idiomatic Rust manner? -

i tried implement small module calculate mean of vector: pub mod vector_calculations { pub fn mean(vec: &vec<i32>) -> f32 { let mut sum: f32 = 0.0; el in vec.iter() { sum = el + sum; } sum / vec.len() } } as far can tell compiler error, there 2 problems code: error[e0277]: trait bound `&i32: std::ops::add<f32>` not satisfied --> src/main.rs:6:22 | 6 | sum = el + sum; | ^ no implementation `&i32 + f32` | = help: trait `std::ops::add<f32>` not implemented `&i32` error[e0277]: trait bound `f32: std::ops::div<usize>` not satisfied --> src/main.rs:9:13 | 9 | sum / vec.len() | ^ no implementation `f32 / usize` | = help: trait `std::ops::div<usize>` not implemented `f32` i'm trying add &i32 f32 , i'm trying divide f32 usize . i solve second error changing last line to: sum / (vec.len(...

python 2.7 - Efficiently create rolling subsets of dataframe based on month -

i have big dataframe df , trying create list df_list of dataframes contains subset of df based on 2 parameters, viz., size_month , roll_month dates = pd.date_range('1700-01-01', '2017-07-02') df = pd.dataframe({'date':dates, 'values':np.random.normal(size = len(dates))}) df date value 0 1700-01-01 -1.239422 1 1700-01-02 -0.209840 2 1700-01-03 0.146293 3 1700-01-04 1.422454 4 1700-01-05 0.453222 ... now if lets size_month=12 , roll_month=2 , df_list[0] should following: date value 0 1700-01-01 -1.239422 1 1700-01-02 -0.209840 2 1700-01-03 0.146293 ... 363 1700-12-29 1.562454 364 1700-12-30 0.677222 365 1700-12-31 0.937274 and df_list[1] should following: date value 0 1700-03-01 0.423422 1 1700-03-02 -0.544840 2 1700-03-03 -0.344293 ... 363 1701-02-26 -1.135334 364 1701-02-27 1.003222 365 1701-02-28 0.443274 and o...

dataframe - Selecting Rows in a Column Contingent on Two Variables in R -

i working data set contains multiple observations each prescription patient taking, many different patients. patients typically take 1 of several drugs, indicated own binary variables, drug1 , drug2 , on. i attempting pull out individuals have switched 1 drug other, i.e, have 1 in drug1 column , drug2 , these occur in different rows. i have attempted use newdata <- mydata[which(drug1 == 1 & drug2 == 1),] however, assumes 1 's in same row, not. is there way select patients have received both drugs, indicator variables in different rows? thank i believe solution asking using dplyr. data <- data.frame(id = rep(c(1, 2, 3, 4), each = 2), drug1 = c(1, 0, 0, 0, 0, 1, 1, 1), drug2 = c(0, 1, 1, 1, 1, 0, 0, 0) ) library(dplyr) data %>% group_by(id) %>% mutate(both_drugs = ifelse(any(drug1 == 1) & any(drug2 == 1), 1, 0)) %>% filter(both_drugs == 1)

html - CSS and images from a different folder are not read when rendering template using Golang -

i trying render template using html/template module of golang. css files , images same folder page rendering executed, located in different folder ignored. here code: func render(w http.responsewriter, filename string, data interface{}) { tmpl, err := template.parsefiles(filename) if err != nil { http.error(w, err.error(), http.statusinternalservererror) } if err := tmpl.execute(w, data); err != nil { http.error(w, err.error(), http.statusinternalservererror) } } for page example: <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>start connect</title> <link href="../css/bootstrap.min.css" rel="styles...

fortran - Characters in quotes in a print statement -

the documentation datetime subroutine in fortran-95, gives example on usage of data , time. here's code: program test_time_and_date character(8) :: date character(10) :: time character(5) :: zone integer,dimension(8) :: values ! using keyword arguments call date_and_time(date,time,zone,values) call date_and_time(date=date,zone=zone) call date_and_time(time=time) call date_and_time(values=values) print '(a,2x,a,2x,a)', date, time, zone print '(8i5)', values end program test_time_and_date in above snippet characters inside single quotes, example '(a,2x,a,2x,a, 8i5)' , in print statements? output statements take format specifier controls of displayed items. input statements use format control interpretation of input. in print version of output (compare write ) format specifier part before (unquoted) comma. in forms of i/o format may specified 1 of 3 ways: using * (so-called list-directed ...

c++ - Enable muti-select on Flow Layout in Qt -

i'm using example flow layout qt docs , add multiple instances of custom widget (named card ). i want enable user select 1 or more elements (cards) in layout , trigger right-click menu. menu contain several actions can either performed on 1 or more of cards. means, there should way selected items layout when action triggered. what best way achieve this? your highly appreciated. :)

Contiki nullrdc duplicate packets? -

i testing code in cooja environment, , checking if packets sent clients arriving in respective order (given enough time). checked each packet came duplicate sometimes. checked rdc , mac, , configured nullrdc , nullmac in contiki-conf.h. copied example "udp-ipv6" example , change code, same configuration. the duplicate packets coming in 10ms apart of first packet. knows why packets coming duplicate? forgetting configure something? by way, i'm using wismote cc2520. thanks in advance, best regards!

Is it safe to build a game with javascript + electron + three.js? -

nothing massive scale of mmorpg, small game faster light. anyone can open dev tools, wondering if possible add protection against cheat engine or if can implement prevent users running own javascript game. i understand writing games in javascript not best solution because inefficient, want try. according this thread in developer forum , there way force dev tools close whenever open using following code: win.webcontents.on("devtools-opened", () => { win.webcontents.closedevtools(); });

php - WordPress Redirection not working after Moving to Subdirectory -

today moved wordpress website root directory subdirectory in same domain. moved files new subdirectory. have setup 301 wildcard redirection hosting cpanel 301 wildcard redirection setting - old address - https://www.example.com new address - https://www.example.com/blog/ when visiting post directly https://www.example.com/blog/this-is-a-post showing correct post without error problem when opening same post without "blog" word i.e. https://www.example.com/this-is-a-post showing correct post instead of redirecting https://www.example.com/blog/this-is-a-post . and when visit through google visiting old address i.e. without word "blog". one more thing occuring redirecting https://www.example.com https://www.example.com/blog don't want because have different html index file homepage url settings in wordpress dashboard - wordpress address (url) - https://www.example.com/blog site address (url) - https://www.example.com/blog contents o...

Xampp Wordpress admin -

i've justed moved website localhost using xampp. changed settings increase speed , can access every part of site offline localhost:8080 , instead wp-admin . can see login page , can enter info login, when hit enter takes load , don't know if loaded or not, when connect internet, works well. currently, can see pages , posts offline , wordpress doesn't respond. wrong? update i use localhost:8080 access site, edited wp-config.php , changed /** mysql hostname */ define('db_host', 'localhost'); to /** mysql hostname */ define('db_host', 'localhost:8080'); but following error: fatal error: uncaught error: call undefined function nocache_headers() in c:\xampp\htdocs\mysite\wp-admin\admin.php:33 stack trace: #0 c:\xampp\htdocs\mysite\wp-admin\index.php(10): require_once() #1 {main} thrown in c:\xampp\htdocs\mysite\wp-admin\admin.php on line 33 some of changes i've made changing listen 127.0.0.1:80 listen 127.0...

jquery - Unable to Open a link from Outlook Ribbon is javascript API without being a popup window -

i creating outlook add-in javascript api, , ribbon has button defined below... <item id="msgcheckhelp"> <label resid="checkhelplabel"/> <supertip> <title resid="checkhelptitle"/> <description resid="checkhelpdesc"/> </supertip> <action xsi:type="executefunction"> <functionname>checkhelp</functionname> </action> </item> and then, check function defined here below... function checkhelp (event) { window.open("help", "_blank"); event.completed(); } the problem is, not recognized user event. tried looking @ displaydialogasync alternative window.open, loads popup well. if display page within application need specify in manifest different action type follow ... <action xsi:type="showtaskpane"> <sourcelocation resid="apphelp" /> </action> and inside resources sec...

How to curl -k -H with python requests -

i have curl command: curl -k -h "x-apitokenid: 11111111-2222-...." https://staging.mycompany.com/v1/users.json and works ok. when translate requests: r=requests.get("https://staging.mycompany.com/v1/user.json",headers={'authourization':'tok:11111111-2222-....'}) it says "unauthorized access resource." how correct this? add x-apitokenid headers (same curl -h) , verify=false ignore verifying ssl cert (same curl -k): r=requests.get("https://staging.mycompany.com/v1/user.json",headers={'x-apitokenid':'11111111-2222-....'}, verify=false)

javascript - Delete JSON data in array -

i trying remove piece of data json array. example, have array; var users = []; io.on('connection',function(socket){ socket.on('nickname', function(nick){ socket.nick = nick; users.push({ user:socket.nick, userid:socket.id, socket:socket }); }); i trying delete in users way; socket.on('disconnect', function(){ delete users[{ user, userid, socket }]; }); }); how can that? you may try using lodash methods achieve trying to: - var _ = require('lodash'); socket.on('disconnect', function(){ _.pullallwith(users, [{ user:socket.nick, userid:socket.id, socket:socket }], _.isequal) }); }); see if works..

php 7.1 - php-fpm connectivity with ibm_db2 driver -

i have created simple php script connects ibm_db2 driver. works if directly runs php. php test.php. script file looks like. <?php $dbname = "sample"; $dbuser = "db2inst1"; $dbpwd = "xyz"; $conn = db2_pconnect( $dbname, $dbuser, $dbpwd ); ?> i tried run php-fpm(php7.1) script not working. not able load ibm_db2 driver. have followed https://scaleyourcode.com/blog/article/2 setup php-fpm. instead of php5-fpm using php7.1-fpm. i have updated php.ini file in /etc/php/7.1/fpm extension=ibm_db2.so. kindly let me know if missing configuration.

asp.net - Azure .Net WebApp Deployment Failed but it works locally on VS -

i new .net , unable understand weird behaviour azure. i trying publish .net project azure web app. , throwing silly errors. assume thats becoz of new c# version. here log file . use case 1: when trying build visual studio team services , deploy using continuous delivery works. use case 2: when trying publish directly using visual studio using app service profile , works. use case 3: when trying deploy through repository hosted @ visual studio team services. , fails , thats error . any lead helpful. do let me know, if information provided not enough. to compile c# 7.0 code, need msbuild 15 installed. currently, msbuild15 not enabled on azure web app. for use case 1 , 2, c#(7.0) code build on development side on visual studio 2017(msbuild 15) installed. for use case 3, code complied on azure web app, throw errors. microsoft engineers in process of building these tools azure, should out soon. stay updated on github

java - method is not invoked -

method not invoked //view flipper code ...................................... public class homeactivity extends appcompatactivity implements navigationview.onnavigationitemselectedlistener { private viewflipper mviewflipper; private float initialx; private context mcontext; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_home); mcontext = this; mviewflipper = (viewflipper) this.findviewbyid(r.id.view_flipper); //play , stop button image slideshow(working fine) findviewbyid(r.id.play).setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { mviewflipper.setautostart(true); mviewflipper.setflipinterval(1000); mviewflipper.startflipping(); } }); findviewbyid(r.id.stop).setonclicklistener(new view.onclicklistener() { @override public void onclick(view vi...

xamarin - SkiaSharp does not fill triangle with StrokeAndFill -

Image
i trying draw , fill triangle. referred android - question how draw filled triangle on android canvas , did following. draws triangle doesn’t fill it. how filled? also, possible filled different color line color? xamarin forms private void onpainting(object sender, skpaintsurfaceeventargs e) { var surface = e.surface; var canvas = surface.canvas; canvas.clear(skcolors.white); var pathstroke2 = new skpaint { isantialias = true, style = skpaintstyle.strokeandfill, color = new skcolor(244, 0, 110, 200), strokewidth = 5 }; var path2 = new skpath { filltype = skpathfilltype.evenodd }; path2.moveto(0, 0); path2.lineto(0, 140); path2.moveto(0, 140); path2.lineto(140, 140); path2.moveto(140, 140); path2.lineto(0, 0); path2.close(); canvas.drawpath(path2, pathstroke2); } you don't need use both lin...

javascript - Target all <a> elements with a certain textContent while no identifier is available -

i have webpage includes a tags want remove. assuming these a tags have no identifier , suffice them identifiers end (not site): how target these a elements through textcontent property? i tried these codes: the first brought undefined. the second brought unexpected identifier. what have missed js freshman? code 1: let texttoremove = [ "עריכה", "עריכת קוד מקור", "שיחה", "גרסאות קודמות", "מזנון", "כיכר העיר" ]; document.queryselectorall("a").foreach( e => { if ( e.textcontent == texttoremove ) { e.style.display = "none" } }); code 2: let strings = [ "עריכה", "עריכת קוד מקור", "שיחה", "גרסאות קודמות", "מזנון", "כיכר העיר" ]; let links = document.queryselectorall("a"); ( string strings) { if ( links.textcontent == strings) { link.style.display = "none"; } } ...

php - using JSON ValueObject vs MySQL rows -

hey guys i'm having dilemma devising logic laravel application i'm developing , use advice. i have eloquent models , b needs arbitrary meta data. meta data not updated may change in properties/ characteristics , might want "searchable"( decided). better store meta data eloquent model table key/value row e.g. pseudo table ----------------------- |key|value|relation id| ----------------------- or store serialized valueobject/ json e.g. pseudo table ------------------ |relation id|json| ------------------ please note using pre 5.7 using json column types in mysql no go!

javascript - Swap LexOrder Union Find -

so i'm doing interview practice questions , came across one: given string str , array of pairs indicates indices in string can swapped, return lexicographically largest string results doing allowed swaps. can swap indices number of times. example for str = "abdc" , pairs = [[1, 4], [3, 4]], output should swaplexorder(str, pairs) = "dbca". by swapping given indices, strings: "cbda", "cbad", "dbac", "dbca". lexicographically largest string in list "dbca". i've got working answer involving finding unions answer slow: [time limit] 4000ms (js) 0 ≤ pairs.length ≤ 5000, pairs[i].length = 2. 1 ≤ str.length ≤ 10^4 could me tweak code increase speed? heres code have: function swaplexorder(str, pairs) { if (!pairs.length){ return str } answerhash = {} unmoved = findunmoved(pairs, str.length) unionsarr = findunions(pairs) (i in unmoved){ answerhash[unmoved[i]...