Posts

Showing posts from May, 2011

javascript - Updating Array comparison function for strings -

i'm working pre-written code quiz trivia game, , have update games question choices number values strings. don't know change in code user choice compared correct answer. currently, number answers, code compares array placement of correct choice in choices array, correctanswer variable. best guess change has occur in displayscore function shown @ bottom. a current question object: { question: "what 2*5?", choices: [2, 5, 10, 15, 20], correctanswer: 2 } and updated question object be: { question: "which list contains words not names of shoe types:" choices:[ "a. oxford, jelly, boat, clogs, stiletto, mary jane", "b. loafer, gladiator, wedge, mule, platform", "c. pump, moccasin, wingtip, sneaker, derby, monk", "d. chalupa, dogler, hamster, croonley, frankf...

web scraping - Loop through payload Python -

there site connect to, need login 4 times different user names , passwords. is there anyway can looping through usernames , passwords in payload. this first time im doing , not sure of how go it. code works fine if post 1 username , password. im using python 2.7 , beautifulsoup , requests. here code. import requests import zipfile, stringio bs4 import beautifulsoup # here add login details submitted login form. payload = [ {'username': 'xxxxxx','password': 'xxxxxx','option': 'login'}, {'username': 'xxxxxx','password': 'xxxxxxx','option': 'login'}, {'username': 'xxxxx','password': 'xxxxx','option': 'login'}, {'username': 'xxxxxx','password': 'xxxxxx','option': 'login'}, ] #possibly need headers later. headers = {'user-agent': 'mozilla/5.0 (macintosh; intel mac os x 10_12_...

python - Group over Series of lists in Panda Dataframe -

i have dataframe list in each cell. each row of dataframe want group on 1st element of lists , average second element. here dummy data , screenshot of df illustrate problem: import pandas pd df = pd.dataframe({"column a":[["winter 2012",5],["sommer 2012",10]], "column b":[["sommer 2012",20],["winter 2012",10]], "column c":[["winter 2012",15],["sommer 2012",30]]}) df column column b column c 0 [winter 2012, 5] [sommer 2012, 20] [winter 2012, 15] 1 [sommer 2012, 10] [winter 2012, 10] [sommer 2012, 30] the desired output first line should this: column d column e 0 [winter 2012, 10] [sommer 2012, 20] 1 [sommer 2012, 20] [winter 2012, 10] being new python, cannot wrap head around how approach this. here's 1 way in [410]: df.apply(lambda x: pd.series( x.ap...

database - does Android application come with sqlite databse created when an application is released? -

i working on android application. have 2 related questions sqlite database in android. 1) have got bunch of sql queries create database tables in sqliteopenhelper class. queries executed in oncreate(sqlitedatabase db) method. database , database tables re-created each time run application, using cellphone? or should else create database , tables @ once if don't exist? 2) when release application, playstore, remove sql queries , include created database file in application folder users can download database along application? or should leave sql queries create database , tables users download application , when run it, queries executed , create database? sorry guys asking 2 questions @ time, believe quite related. thanks! 1)once have changed database structure adding columns or modify existing table, you should increase database version number. changes applied. public void onupgrade(sqlitedatabase db, int oldversion, int newversion) for more info refer l...

spring - How do I enable CORS headers in the Swagger /v2/api-docs offered by Springfox Swagger? -

i have following file in project: @configuration @order(ordered.lowest_precedence) public class swaggerconfig { @bean public docket apiswagger2documentation() { .... } } and in application.java there is: @springbootapplication @componentscan(basepackages = { ... }) @enableswagger2 public class application { ... } the swagger json available under /v2/api-docs , works fine. what do, enable cors headers endpoint. for own controllers, have added @crossorigin controller classes, apis have cors headers, works fine. swagger json url haven't written controller myself, cannot use annotation. i have added following method swaggerconfig , described in "global cors configuration" in cors support in spring framework . @bean public webmvcconfigurer corsconfigurer() { system.out.println("*** corsconfigurer called"); return new webmvcconfigureradapter() { @override public void addcorsmappings(corsregistry reg...

php boolean value as argument throws encoding error -

when try put boolean value parameter in functionc call, missing property // try orders try { $order = new order($auth_login, $auth_password, $live_mode); $orders = $order->findordersbysubscriptionid($sessionid, $subscriptionid, (bool) false); } catch (exception $e) { var_dump($e); } this gives error: soapfault object ( [message:protected] => soap-error: encoding: object has no 'onlyongoing' property array ( [0] => array ( [session] => 12345 [subscriptionid] => 30520 [onlyongoing] => ) ) ) ) i have tried (instead of (bool) false ): false , false , false none work! edit: i looked through orders , found part: public function findordersbysubscriptionid($session, $subscriptionid, $onlyongoing) { try { $result = $this->client->findordersbysubscr...

java.util.scanner - Java scanner multiple/several delimiter conditions -

i have problem in finding right way city1, city 2 , distance without "km", using scanner , delimiter. need text in bold. string (example): city1 , country; city2 , country; 145 km my delimitar far because have no idea: scanner.usedelimiter(";"); i tried using string.split("") without success. should first devide in 3 parts on ";" , new delimitar each part? or there easier way? thanks in advance (edit explain difference post: tried regex, no luck. need split string on multiple places on different characters. wouldn't ask question if i'm able solve post.) you can use combination of scanner , string#split : string source = "city1, country; city2, country; 145 km"; scanner scanner = new scanner(source); scanner.usedelimiter(";"); while (scanner.hasnext()) { // trim() removes leading , trailing whitespace string line = scanner.next().trim(); // split line on either ',' o...

javascript - How to delay excuting the code inside Promise? -

my code: class mypromise extends promise { constructor(func) { super(func); } somepromiseextensionmethod() { // stuff... } } let test = async function() { let promise = new mypromise(function (resolve) { console.log('foo'); resolve(); }); console.log('start printing:'); await promise; }; test(); i'm leaning promise , want create class derived promise class. my question: there way delay printing foo until call await promise ? update: i want create class because want run methods while object promise . (just like: mypromise.somepromiseextensionmethod() ). update 2: real project: let task = (function () { let __data = {}; __data.run = function (...args) { if (args.length) { let func = args[0]; return new task(func); } }; class task extends promise { ...

java - JToggleButton Tooltip being hidden by AWTGLCanvas -

Image
first time developer here, hired on summer make application find layout of building. i'm having little problem jtogglebutton's in application , how interact awtglcanvas. problem being after clicking awtglcanvas labels hidden behind awtglcanvas. the labels show should when hover on them before clicking on awtglcanvas. in response tried adding toolbar.requestfocusinwindow(); unfortunately still didn't work. (the cursor hovering on jtogglebutton screen capture used gets rid of cursor) this code i'm using make button: protected jtogglebutton makebutton(string imagename, string actioncommand, string tooltiptext) { string imglocation = "res/" + imagename + ".png"; jtogglebutton button = new jtogglebutton(); button.setactioncommand(actioncommand); button.settooltiptext(tooltiptext); try { image image = imageio.read(new file(imglocation)); image = image.getscaledinstance(15,15, 0); button.seticon(ne...

Spring H2 Database, Not Creating table in Database -

the following code creating test.mv.db file. run , show has inserted data in database. schema: create table customer ( id identity, firstname varchar(20) not null, lastname varchar(20) not null ); main class: public class app { public static void main(string[] args) { annotationconfigapplicationcontext ctx = new annotationconfigapplicationcontext(config.class); customerrepository repo = ctx.getbean(customerrepository.class); customer c1 = new customer("john", "doe"); customer c2 = new customer("jane", "doe"); // insert c1 = repo.save(c1); c2 = repo.save(c2); for(customer t : repo.findall()) { system.out.println(t.getfirstname()+", "+t.getlastname()); } ctx.close(); } } config: @configuration @componentscan public class config { @bean public datasource datasource() { drivermanagerdatasour...

DataTables Invalid JSON response -

i'm having trouble datatables. i'm trying use server-side script make data loading faster in project, keep getting errors. when load page, first error is: datatables.min.js:86 uncaught error: datatables warning: table id=lista_pedidos - invalid json response. more information error, please see http://datatables.net/tn/1 @ k (datatables.min.js:86) @ object.error (datatables.min.js:48) @ (jquery.js:2) @ object.firewith [as rejectwith] (jquery.js:2) @ (jquery.js:4) @ xmlhttprequest.<anonymous> (jquery.js:4) when type on search field same error in logs , in tab "network" following error: <br /> <b>notice</b>: undefined offset: 0 in <b>c:\wamp64\www\prevmais\sistema\app\server\ssp.class.php</b> on line <b>116</b><br /> <br /> <b>notice</b>: undefined offset: 0 in <b>c:\wamp64\www\prevmais\sistema\app\server\ssp.class.php</b> on line <b>162</b><br /> <br ...

python - youtube api request on azure doesn't work -

Image
i have small python/flask application on microsoft azure, here: https://sdtflask.azurewebsites.net/#!/ this being developed on local machine , pushed github automatically gets deployed azure. works fine on both ends except tiny part of app, http request youtube api retrieve information youtube channel. this works fine on local machine, when tried on azure, doesn't. the code same on both ends: import requests flask_restful import resource class getchannellist(resource): def get(self): try: url = "https://content.googleapis.com/youtube/v3/search?key=aizasycxd3kgnnizy-omydh7u8lr3zgqd6zo448&channelid=ucvs6-k6ydmb4gh-kim3amja&part=snippet,id&order=date&maxresults=50" r = requests.get(url).json() # r.raise_for_status() return r except exception e: print(str(e)) return {'message': 'something went wrong'} then have following: from flask impo...

java - How to remove the namespace of SOAPHeaderElement -

i have java class generate following xml : <v:envelope xmlns:v="http://schemas.xmlsoap.org/soap/envelope/"> <v:header> <b>lge nexus 5</b> <c>android</c> <d>6.0.1</d> <e>4.1.5</e> <f>127.0.0.1</f> <g/>?<g> <h>0.0</h> <i>0.0</i> <j"/> <k>8320738e-8634-4f73-a4dd-874a5d79e336</k> <l>2017-08-14 13:24:01</l> <m>8797e74f0d6eb7b1ff3dc114d4aa12d3</m> </v:header> <v:body> <ns2:getstatus xmlns:ns2="http://soap.ws.placa.service.sinesp.serpro.gov.br/"> <a>abc1234</a> </ns2:getstatus> </v:body> </v:envelope> but current result is: <v:envelope xmlns:v="http://schemas.xmlsoap.org/soap/envelope/"> <v:header> ...

amcharts - Keeping scrollbar in same position live chart -

when creating live chart in amcharts (example: http://jsfiddle.net/amcharts/atqum/ ) seems when 1 triggers this.state.chart.validatedata() scope of scrollbar being reset full-scope unless user clicks , holds down scrollbar in same position. is there way keep scope data being updated, without holding button down? assuming want date selection persist between updates, can set zoomoutondataupdate false in chart object , scrollbar stay on selected date range; example, if you're zoomed on 2017-07-01 through 2017-08-01, date range still in view between updates. demo if you're sliding old points off chart in demo, zoomoutondataupdate doesn't quite work out, ui-wise, since date range fall off points removed, you'll notice in above demo (the right scrollbar handle moving left). in instance, you'll want maintain chart's current startindex , endindex , call zoomtoindexes after update, i.e. var startindex = chart.startindex; var endindex =...

c# - Function to approximate skewed distribution of range of values? -

i need write function return ienumerable> each tuple represents each member of generated range along corresponding probability approximate probability on skewed distribution. i envision function signature of: ienumerable<tuple<double, double>> skewedrange(double min, double max, double mean, double step = 1.0) for example, range between 1.0 , 10.0 mean 2.3 , default step 1.0, want list of values so: item1 item2 histogram (for demo only) 1.0 p1 ***** 2.0 p2 ********* 3.0 p3 ******* 4.0 p3 ***** 5.0 p3 *** 6.0 p3 ** 7.0 p3 ** 8.0 p3 * 9.0 p3 * 10.0 p10 * the resulting graph of these values resemble skewed distribution peak between 2-3. questions: is feasible. if so, on scale of 1 5 how difficult implement. are there open source libraries utilized or implement this. any resources knows of me understand problem domain. have done significant amount of research on already, heavy in stati...

mysql - Why shouldn't I use mysql_* functions in PHP? -

what technical reasons why 1 shouldn't use mysql_* functions? (e.g. mysql_query() , mysql_connect() or mysql_real_escape_string() )? why should use else if work on site? if don't work on site, why errors like warning: mysql_connect(): no such file or directory ? the mysql extension: is not under active development is officially deprecated of php 5.5 (released june 2013). has been removed entirely of php 7.0 (released december 2015) this means of 31 dec 2018 not exist in supported version of php. gets security updates. lacks oo interface doesn't support: non-blocking, asynchronous queries prepared statements or parameterized queries stored procedures multiple statements transactions the "new" password authentication method (on default in mysql 5.6; required in 5.7) all of functionality in mysql 5.1 since deprecated, using makes code less future proof. lack of support prepared statements particularly important provide...

Android MediatorLiveData observer -

i'm bit confused on why following code doesn't work: mutablelivedata<string> mutabletest = new mutablelivedata<>(); mediatorlivedata<string> mediatortest = new mediatorlivedata<>(); mediatortest.addsource(mutabletest, test -> { timber.d(test); }); mutabletest.setvalue("bla!"); this code seems straightforward, debugger doesn't enter callback , nothing logged console... edit: shouldn't work then? mutablelivedata<string> mutabletest = new mutablelivedata<>(); mediatorlivedata<string> mediatortest = new mediatorlivedata<>(); mediatortest.observe(loginactivity, str -> timber.d(str)); mediatortest.addsource(mutabletest, str -> timber.d(str)); mutabletest.setvalue("bla!"); this answer largely reproduction of @commonsware has shared in comment section above. in order callback on mediatorlivedata's addsource method triggered, mediatorlivedata object n...

linux - Is there a lower level interface than `std::process::Command` to execute a single string as a process? -

is there equivalent in rust like: os.run("/bin/bash ln -s /dir1 /dir2"); i want ability spawn process using string expression similar 1 use in ptty. the utility i've found doing std::process::command , it's not documented , seems complex , hard debug. there in rust, how invoke system command , capture output? gives std::process::command answer, hence why specified finding possible option. however, i'm looking lower level interface make std::process::command execute single string query rather forcing me feed arguments 1 one. no, there no such thing available in standard library. mentioned in comments, command is lower level interface. shells , other tools take single string have exceedingly clever parsing of string in order split pieces. parsing non-trivial , may differ between shells! you can write own simplified parser, of course: use std::process::command; fn main() { let args = "ls -l /etc /tmp"; let args: vec...

Sed regex between known word and unknown integer -

i can't quite regex need solve this, asking wizards help! given: locus node_96_length_17326_cov_8.76428_id_1>17327 bp dna linear locus node_97_length_17208_cov_6.56803_id_1>17208 bp dna linear locus node_98_length_17111_cov_6.60638_id_1>17111 bp dna linear locus node_99_length_17092_cov_6.7682_id_19717092 bp dna linear locus node_9_length_59921_cov_8.04963_id_1759921 bp dna linear i need replace string between node , sequence of numbers @ end of same string. character preceeding numbers (e.g. in line 1, 17327 ) can appear > or _ . need replace node , including last > or _ , or match until multi-digit integer of unknown length. best i'd managed far was: sed 's/\(node.*\)\(>|_\)/newstring/' but know doesn't work. just make painfully clear, desired output. locus newstring 17327 bp dna linear locus newstring 17208 bp dna linear locus newstring 17111 bp dna linear lo...

css - Bootstrap 4 styling issue with input select .form-control-lg on Firefox -

when using form-control-lg on select input in firefox, text getting cut off. the code: <select class="form-control form-control-lg"> <option>large select</option> </select> the result in firefox: https://i.stack.imgur.com/284d8.png it seems work fine in safari , chrome though. firefox fix this? thanks.

python - getObject returns value of RAM_0_UNIT_PLACEHOLDER for RAM item -

the machine trying details contains following ram: 2x4gb kingston 4gb ddr3 1rx8 the ram item returned machine getobject is: { 'item': { 'softwaredescriptionid': '', 'capacity': '8', 'description': '8 gb ram', 'upgradeitemid': '', 'itemtaxcategoryid': 166, 'itemcategory': { 'quantitylimit': 0, 'sortorder': 3, 'categorycode': 'ram', 'id': 3, 'name': 'ram' }, 'keyname': 'ram_0_unit_placeholder', 'units': 'gb', 'id': 6147 } } ram_0_unit_placeholder not seem valid result , causing problems when trying order machines configuration. can please confirm if expected behavior or not?

aem - Configuration binding is not there with the jar file AEM6.3 -

Image
i working on aem 6.3. have config nodes different environment. code jar file under apps/myproject/install . when go system console http://localhost:4502/system/console/configmgr , don't see configuration binding present configurations below- any idea why binding not there jar file? thanks!

java - Mifosx Installation failure -

i trying install mifos x server on windows 7 pc. installed java runtime 1.8 -> set jre_home variable. downloaded tomcat 1.9 -> set catalina_home variable i installed wamp server mysql server. came mysql 5.7. added mysql drizzle jdbc driver mentioned in installation notes. when start tomcat server starts successfully, can't access mifos app (/fineract-provider - name of app) gives 404 error. checked manager app of tomcat. shows app not started default. tried starting app manually, throws error fail - application @ context path [/fineract-provider] not started fail - encountered exception [org.apache.catalina.lifecycleexception: failed start component [standardengine[catalina].standardhost[localhost].standardcontext[/fineract-provider]]] so checked tomcat log app. shows this dependency. dependency annotations: {@org.springframework.beans.factory.annotation.qualifier(value=tenantdatasourcejndi)}; nested exception org.springframework.beans.factory.nosuchbeandefiniti...

python - Error: Too many values to unpack with CSV File -

Image
my program shown below has goal of outputting statements based off 2 criteria:( year , location ) once accomplished, next goal match year yearlink , location location . location , year both input statements. output should statement outputs values row. reason, receive error many values unpack. excel sheet posted if wants better idea of talking about. anyway tried nothing working me. traceback (most recent call last): file "c:/users/roszkowskim/desktop/win4.py", line 134, in <module> from,to,max,min in data: valueerror: many values unpack load_gen_datafile = 'c:\users\roszkowskim\desktop\data_2016.csv' # csv file read # read entire csv python. # csv has columns starting year,busnum,busname,scaled_power,tla,location data = list(csv.reader(open(load_gen_datafile))) mydict = {} row in data: year,busnum,busname,scaled_power,tla,location,yearlink,from,to,max,min = row[0:12] #if year not seen before, add dictionar...

node.js - npm install within Vagrant box but sudo npm run dev error -

i installed npm in vagrant box, , when tried start project, error occurred. error follows: vagrant@vagrant-ubuntu-trusty-64:~$ sudo npm run dev npm err! linux 3.13.0-121-generic npm err! argv "/opt/node-v6.11.2-linux-x64/bin/node" "/usr/local/bin/npm" "run" "dev" npm err! node v6.11.2 npm err! npm v3.10.10 npm err! path /home/vagrant/package.json npm err! code enoent npm err! errno -2 npm err! syscall open npm err! enoent enoent: no such file or directory, open '/home/vagrant/package.json' npm err! enoent enoent: no such file or directory, open '/home/vagrant/package.json' npm err! enoent not problem npm npm err! enoent , related npm not being able find file. npm err! enoent npm err! please include following file support request: npm err! /home/vagrant/npm-debug.log my vagrantfile: vagrant.configure(2) |config| config.vm.box = "~/dev/webstormprojects/ubuntu_former.box" config.vm.network "pri...

r - How can I make a method to acces a data.table in a structure? -

suppose have this: dt <- data.table(x = 1:10, y = 1:2) s <- structure(list(dt = dt), class = 'dt_test') i want define [ function objects of class dt_test pass on arguments dt. example want able things like s[, sum(x), = y] s[, z := x + y] where [ applied dt. how can make happen? it can done, i'm not sure should done though. defining method [ sends arguments down data.table pretty straight forward: `[.dt_test` <- function(x, ...){ x[[1]][...] } s[, sum(x), = y] you have similar generics want supported, example want define [[ . i rather recommend referring data.table inside list directly, majo suggested in comment question. way it's easier understand whats happening in code else might reading (e.g. future you).

Unable to copy file from Docker container to host -

$ docker cp maven-container_:xxxx.war /home/wissem/documents/docker-stage/wildfly-configured/target/ error response daemon: lstat /var/lib/docker/aufs/mnt/afbdc7f4ce3165fb2e6c34929841b9fa911de1978887dd5b9b0804e4f624af2d /xxxx.war: no such file or directory error: job failed: exit status 1 you need copy running instance , not image. assume maven-container_ name of container had launched , not image. use complete path after : , docker cp maven-container_:/path/inside/container/xxxx.war /home/wissem/documents/docker-stage/wildfly-configured/targe‌​t/

How can I make a html solution here instead of using a javascript hack? -

i trying create chat box (front end) website project. you may test here: https://jsfiddle.net/ovdzaj2v/5/ now, current fiddle use javascript hack pushchatup() function move messages. don't hack because: it's ugly. it's hard calculate how messages must go because can different sizes (overlap issues). i want html solution, not sure how it. example, html elements stack below 1 like: <div id=top> </div> <div id=bottom> </div> how can make happen .messages ? after javascript appends message, pushchatup() not needed. js: function openchat(){ document.getelementbyid("chatinput").style.display = "block"; document.getelementbyid("chatbutton").style.display = "block"; c = document.getelementbyid("chatbutton"); = document.getelementbyid("chatinput"); cm = document.getelementbyid("chatmessage"); c.innerhtml = ""; c.style.height = ...

Rearrange data in csv with Python -

i have .csv file following format: a b c d e f x1 x2 x3 x4 x5 x6 y1 y2 y3 y4 y5 y6 z1 z2 z3 z4 z5 z6 what want: a x1 b x2 c x3 d x4 e x5 f x6 y1 b y2 c y3 d y4 e y5 f y6 z1 b z2 c z3 d z4 e z5 f z6 i unable wrap mind around built-in transpose functions in order achieve final result. appreciated. you can melt dataframe using pandas: import pandas pd df = pd.read_csv(csv_filename) >>> pd.melt(df) variable value 0 x1 1 y1 2 z1 3 b x2 4 b y2 5 b z2 6 c x3 7 c y3 8 c z3 9 d x4 10 d y4 11 d z4 12 e x5 13 e y5 14 e z5 15 f x6 16 f y6 17 f z6 a pure python solution follows: file_out_delimiter = ',' # use '\t' tab delimited. open(filename, 'r') f, open(filename_out, 'w') f_o...

access vba - Display Recipient with error when it is in Outlook Distribution List -

i have been handed code generates e-mails attachments , sends them out. code works great except if there problem 1 of recipients in distribution list (dl). i trying display errant recipient dl user knows needs fixed instead of searching through hundreds of names across several dls. the following code display name of dl pulled in via .recipients.add not offending recipient name. there way this? if not objoutlookrecip.resolved each objoutlookrecip in .recipients if not objoutlookrecip.resolved msgbox "address error in dl: " & objoutlookrecip.name end if next end if

wpf - Instance of an UserControl doesn't show content but warning icon -

i have usercontrol button , expander. in main window instantiated one. neither button nor expander visible, there warning icon. visual studio shows warning (something like: "this document contains 1 or more controls have been changed. rebuild project show changes in design view."). rebuilding didn't fix issue. doing wrong? the usercontrol: <usercontrol x:class="audionodegui_xaml.audioinputnode" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:audionodegui_xaml" mc:ignorable="d" d:designwidth="300" height="212" width="190" background="transparent" f...

Can Java serialization be used with Gemfire/Geode, without deploying classes on the server? -

the goal avoid having deploy java classes gemfire/geode servers. the use-case requires storage/retrieval of serialized objects. keys strings. there no use of server-side functions or oql. i'm aware gemfire/geode pdx doesn't (in cases) require java classes deployed gemfire/geode server. i'm curious possible when using plain old java serialization. as long there no server side logic require deserializing values, think should work. besides not using functions , oql, , cachelisteners or cachewriters require deserializing values on server.

excel - Highlight Row-Column of selected cell -

be gentle guys, i'm not programmer. i got snippit of code off internet many many moons ago. give credit, don't remember came from. sub worksheet_selectionchange(byval target excel.range) static xrow static xcolumn if xcolumn <> "" columns(xcolumn) .interior.colorindex = xlnone end with rows(xrow) .interior.colorindex = xlnone end end if prow = selection.row pcolumn = selection.column xrow = prow xcolumn = pcolumn columns(pcolumn) .interior.colorindex = 19 .interior.pattern = xlsolid end with rows(prow) .interior.colorindex = 19 .interior.pattern = xlsolid end end sub the above code highlights rows , columns of selected sell. problem highlights columns 1 1048576, causes vertical scroll bar tiny. plus if there color coding in spreadsheet screws up. decided write own highlighter. put border around selected row,column , 500 rows. works, almost. problem in code cancels copy command, , not allow me paste, did not happen in code above. copy/paste must...

jquery - Hover effect over image as a link ideas -

i have image on page use link. trying effect when hover on image become little darker (transparent dark) , on image appear text saying "view". using bootstrap, needs responsive. i tried categorieimg:a hover in css doesn't seems respond. if can done jquery, suggestions welcomed. my html: @extends ('master') @section('content') <div class="row"> <div class="col-md-12"> <h1 class="text-center">myhero shop</h1> <br><br> </div> </div> <div class="row"> @if ($categories) @foreach($categories $category) <div class="col-md-4 col-sm-6 text-center"> <h3 >{{ $category['title'] }} </h3> <p class><a href="{{ url('shop/'. $category['url']) }}" class="categorieimg"><img width="250" src="{{ asset('images/...

PHP and MySQL WP -

i trying accomplish 2 things here code. writing php directly wp page using insert php plugin. 1) query mysql database , return results 1 column 4 columns. 2) make each result own hyperlink directs user new wp page runs new query on page. i able query show results , turn results dynamic hyperlink, cannot formatting down. right returns result 1 column. here have: [insert_php] $servername = "localhost"; $username = "login"; //edited privacy $password = "password"; //edited privacy $database = "database"; //edited privacy // create connection $conn = new mysqli($servername, $username, $password, $database); // check connection if ($conn->connect_error) { die("connection failed: " . $conn->connect_error); } echo "connected successfully"; //get results database $result = mysqli_query($conn,"select mine mines order mine"); $all_property = array(); //declare array saving property //showing proper...

html - Reorder row columns in repeating CSS grid/table -

when displaying multiple items in table/grid like-manner, possible css override elements order, without knowing number of "rows" in advance? e.g. here standard table, , more compact alternative same data. had move html elements 2nd 1 (1, 4, 2, 3), otherwise 4th column got offset row. .layout1 { margin: 1em 0; width: 400px; display: grid; grid-template-columns: auto auto auto max-content; grid-row-gap: 0.2em; } .layout2 { margin: 1em 0; width: 200px; display: grid; grid-template-columns: auto auto max-content; } .layout2 .col1 { margin-top: 0.2em; grid-column: span 2; } .layout2 .col4 { margin-top: 0.2em; grid-row: span 2; } .layout2-5 .col2 { grid-column: 1; } .layout2-5 .col3 { grid-column: 2; } .layout2-5 .col4 { grid-column: 3; } .col1, .col2, .col3, .col4 { padding: 0 1em; } .col1 { background: #f99; } .col2 { background: #9f9; } .col3 { background: #99f; } .col4 { background: #9ff; } <div...