Posts

sql - Remove duplicate rows in MySQL -

i have table following fields: id (unique) url (unique) title company site_id now, need remove rows having same title, company , site_id. 1 way using following sql along script (php): select title, site_id, location, id, count( * ) jobs group site_id, company, title, location having count( * ) >1 after running query, can remove duplicates using server side script. but, want know if can done using sql query. a easy way add unique index on 3 columns. when write alter statement, include ignore keyword. so: alter ignore table jobs add unique index idx_name (site_id, title, company); this drop duplicate rows. added benefit, future inserts duplicates error out. always, may want take backup before running this... wiki

django channel set up routing -

i'm learning how setup websocket connection django-channel, i've got setup in routing.py from channels import route gallery import socket sock channel_routing = [ # wire websocket channels our consumers: route("websocket.connect", sock.ws_connect, path=r"^/render-status/$"), route("websocket.receive", sock.ws_receive, , path=r"^/render-status/$"), ] and following javascript // when we're using https, use wss too. var ws_scheme = window.location.protocol == "https:" ? "wss" : "ws"; var ws_path = ws_scheme + '://' + window.location.host + '/render-status/'; console.log("connecting " + ws_path) var socket = new reconnectingwebsocket(ws_path); socket.onmessage = function(message) { console.log("got message: " + message.data); var data = json.parse(message.data); // if action started, add new item table if (data.action == "started")...

android - How to create Floating activity that can be dragged for YouTubePlayerView? -

developers, i want create 1 activity( extends youtubebaseactivity ) has youtubeplayerview activity has small sized , can draggable in whole screen. independent activity should destroy on app killing only ! any suggestion, help, tutorial, code-snippet appreciated... in advance ! wiki

r - Errors trying to run glmer with paired data and repeated measures (lme4) -

i want analyze effect of 2 treatments on variation of abundance of plant species along time gradient. the experimental design consist of exclosures (treatment = no moose), paired control plots (treatment = moose). site consist of 1 exclosure + 1 control plot. there 15 sites (so 15 exclosures + 15 paired plots = 30 experimental units). each experimental units has unique "id". abundance (proportion : continuous value between 0 , 1) of fir has been monitored 5 years (once every year = repeated measures). repeated measures nested inside "id". i want analyze effect of treatments on fir abundance while controlling paired structure of data , repeated measures. since response data proportion (abundance between 0 , 1), have been directed toward glmm family=binomial. however, not entirely sure on how code model. tried : fit = glmer(fir ~ treatment*time + (time|id) + (1|site), data=dat1, family=binomial) if right, "(1|site)" control paired structure, ...

radio button - ListView with each row having a RadioGroup with two RadioButtons -

Image
im creating form have anywhere 10-16 rows @ given week/month. in each row, have radio group 2 radio buttons (this wont change) however, life of me, can't figure out how code properly. list view custom layout. here image. im having hard time trying tell app 1 group starts , finishes... thanks help. i know how handle radio group in single view, doing within list view has been nightmare. tips? wiki

c# - How to scrape a javascript loaded number from a webpage and save it to clipboard -

im building macro in mine "jitbit macro recorder". i can make cool stuff there , there option use c# language. have made lot of macro i'm stuck. i need simple c# script read number dynamically loaded javascript on webpage , save clipboard - that's it. i can see in source it's coded (there dynamically loaded number in place of "-"): <span id="counting">-</span> i hope it's not ask. know i'm not providing mine own c# code - it's because don't know language , it's not needed in macro recorder time gave me headache. greetings! i not think can this. javascript happens in browser , c# happens in different process. @ least number contained in source code of page not able access it. you can try browser "inspect element" feature since can access own memory , can tell how javascript being loaded , variables there. script need hack browser memory address kind of debugger. tricky. ...

javascript - Inline background-image in React -

i trying set background image via inline styles in react. after looking through few posts this one 's solution worked me: <div classname="phase1" style ={ { backgroundimage: "url('https://lh3.googleusercontent.com/mof9kxxkj7gvyzltzonuzuyv0jaweehlxjx6gslqvbvlhlk5_bstk6duxy2xfbbsj43h=w300')" } }> i pasted directly component without changing link test it, , worked. trying reference image /src folder isn't working. <div classname='background-image' style ={ { backgroundimage: "url('../../../../images/products/cards/main.jpg')" } }>asdfasdfasdfasdf</div> nothing shows , not getting error or warning. any appreciated! i figured out, can't put link straight url. need require first. var bg=require('../../../../images/products/cards/main.jpg') return ( <div classname="productitem"> {/* background image */} <div classname='background-...