Posts

Showing posts from March, 2013

sql server - MS-SQL 2012 Principle "Freeze" -

yesterday had "freeze" of 1 of our customers mirrored database. the symptom applications freezed. there no high cpu (~1% sql server , ~10% total) / memory (4gb free ) / disk (50gb free) utilisation. i tried accessing principle-database microsoft sql server management studio. when tried open tables section application freezed well. i stopped whole server , applications switched automatically mirror-database , continued if nothing happened. after (re)starting stopped sql-server resume mirroring without problem. i tried find information in windows events, except messages stopped server , resulting messages mirror became principle, there no failure event. also our applications access database did not report issues. as additional information (i don't know if it's of importance): have got job running backups database full backup every hour , differential backup every 15 minutes (the diff backups go bak file created full backup). backup files overwritten af

javascript - NodeJs Use async with for loop download -

i have loop download files , it's work fine. but files downloaded "2,3,4,1,5" order , not "1,2,3,4,5". i know how .each async , waterfall async don't know how loop. config.totalfiles = 5; for(i = 1; <= config.totalfiles; i++) { $this.createjsonfile(i, function() { cls(); }); } and when downloads done want call callback, have tried if(id == config.totalfiles) it's doesn't work because id isn't good. how can done "async" process loop? thanks you can use async.whilst this: config.totalfiles = 5; var count = 1; //pass maincallback want call after downloading of files complete. var callme = function(maincallback){ async.whilst( function() { return count <= config.totalfiles; }, function(callback){ $this.createjsonfile(count, function() { cls(); count++; callback(); }); }, function(){ /

aggregation framework - MongoDB query on count of elements in one of the subdocument array -

this question has answer here: how sort array inside collection record in mongodb 13 answers mongodb: combine data multiple collections one..how? 8 answers mongo order length of array 2 answers given: documents looks this: supplier document { "_id" : "63", "companyname" : "niranjan company", "createdby" : "niranjank4523@gmail.com", "createdon" : isodate("2017-07-06t03:12:13.171z"), "active" : true, "locations" : [ "594fbfc9ae0638325796a17c", "594fbfc9ae0638325796a17d", "594fbfc9ae0638325796a17e&quo

datetime - How to filter an sqlite3 query (in python) by a string date? -

i need database / table entries happened during current hour. so, if it's 3 pm, need select rows value. table has 22 columns , date column text in following format: please visit image do first have convert string dates datetime objects or can directly run query? i'm using sqlite3 python .

java - How to compare user selected date with from and to date in Android? -

this question has answer here: how compare dates in java? 11 answers i want compare user selected date date , date. e.g., from date : 2017-25-07 date : 2017-31-07 selected date : 2017-27-07 so want check selected date in range between date , date. you can compare 3 dates below code if(!fromdate.after(selecteddate) && !todate.before(selecteddate)) { //fromdate <= selecteddate <= todate }

regex - Find and replace between html comment tags in dreamweaver -

i'm trying dreamweaver remove content between 2 html comment tags. have lot of html pages in project have bunch of js scripts in bottom , different page page. for example, let's have following html: <!-- scripts --> <script src="http://code.jquery.com/jquery-latest.js"></script> <script src="assets/js/custom.js"></script> <!-- end scripts --> and i'd find , replace strips between comment tags , replaces new stuff: <!-- scripts --> <script src="new-path-for-js-files.js"></script> <!-- end scripts --> i believe possible achieve using regex couldn't find fit i'm looking for. i'd appreciate suggestions on accomplishing this. many thanks! you can match comment tags including content surround using following regex : <!-- scripts -->[\s\s]*?<!-- end scripts --> explanation: regex looks exact text <!-- scripts --> ,

javascript - HTML image link not showing up in Safari or Chrome -

i have image supposed appear on website page. works in firefox, not appear in either safari or chrome reason. line have used image in js file: $("#picture").append("<img src='/images/sub1/green_graph.png' alt='low_graph' style='width:300px;height:250px;padding: 0px 0px 20px 40px;position:relative'>") i can't seem figure out why appears in 1 browser not others , have not yet found answer problem. edit: code html file: <div class="row"> <div class="col-md-1"> </div> <div class="col-md-6"> <div class="row"> <div class="col-12"> <div id="info"> <h3 id="rank"><span style = "color:orange"> random:</span></h3> <div class="col-6"> <img id="picture&q

javascript - Make a table based on the value of a drop down menu -

i stuck in part trying fetch data php file script in json format . new php trying learn w3schools , got stuck in http method post send data php file , display in html getting error uncaught syntaxerror: unexpected token < in json @ position 0 @ json.parse () @ xmlhttprequest.xmlhttp.onreadystatechange and here code had done till in front part used html , javascript : <script> function change_myselect(sel) { var obj, dbparam, xmlhttp, myobj, x, txt = ""; obj = { "table":sel, "limit":20 }; dbparam = json.stringify(obj); xmlhttp = new xmlhttprequest(); xmlhttp.onreadystatechange = function() { if (this.readystate == 4 && this.status == 200) { myobj = json.parse(this.responsetext); txt += "<table border='1'>" (x in myobj) { txt += "<tr><td>" + myobj[x].name + "</td></tr>"; } txt +=

android - Horizontal recyclerView with volley NetworkImageView image is not displaying -

i use recycleradapter load lot of images in horizontal view using networkimageview(volley). changing position of recycler view periodically. time while scrolling image not displaying , showing white space instead of original image. adapter onbindviewholder code: mimageloader.get(newsdto.getimage(), imageloader.getimagelistener(holder.networkimageview, r.drawable.loading, android.r.drawable .ic_dialog_alert)); holder.networkimageview.setimageurl(newsdto.getimage(), mimageloader); how periodically changing position: new timer().scheduleatfixedrate(new timertask() { @override public void run() { if (getactivity() != null && recyclerview != null) { getactivity().runonuithread(new runnable() { @override public void run() { int lastvisibleitemposition = l

selenium - Why multiply the text when I am trying web-scraping a table with Python? -

Image
i trying web-scraping table website, , fine, run without error, when open in csv, see there multiple web-scraping: text+table, when need table 1 web-scraping. the table start 53. row , don't understand that. why code web-scraping text , not table? my code: from bs4 import beautifulsoup selenium import webdriver import time import unicodecsv csv filename = r'output.csv' resultcsv = open(filename, "wb") output = csv.writer(resultcsv, delimiter=';', quotechar='"', quoting=csv.quote_nonnumeric, encoding='latin-1') profile = webdriver.firefoxprofile() profile.set_preference("intl.accept_languages", "en-us") driver = webdriver.firefox(firefox_profile=profile) driver.get("https://www.flightradar24.com/data/airports/bud/arrivals") time.sleep(10) html_source = driver.page_source soup = beautifulsoup(html_source, "html.parser") print(soup) table = soup.find('table&#

linux - Who try to access root@ -

i couldn't find how can have list of ip try access root@ (it command in linux couldn't find it). , how can block ip access. there try access root@ on server. need resolve problem. i tried don't work : cat access.log| awk '{print $1}' | sort | uniq -c |sort -n just type: last root this give details of ip addresses of machines users logged in root.

google maps - how to pass query string with 2 values in mvc -

i want send 2 values (longitude , latitude)while click row. when click row in table should redirect web page , show marker in google map.how can pass dynamic values in query string code @model list<smartpond.models.assetdetailsviewmodel> @{ viewbag.title = "details"; layout = "~/views/shared/_layout.cshtml"; } <div> <table> <tbody> @foreach (var device in model.select(x => x.deviceid).distinct().tolist()) { foreach (var item in model.where(x => x.deviceid == device).select((value, i) => new { i, value })) { <tr class="tr_@item.value.deviceid"> <td>@(item.i + 1)</td> <td>@item.value.deviceid</td>

c++ - Initializing main function from Matlab Coder -

i created c++ program through matlab coder called implicit_enumeration.cpp takes matrix , vector b input , returns vector zstar , probability value vstar. struggling initialize main function: // include files #include "stdafx.h" #include "implicit_enumeration.h" #include "main.h" // function declarations static void arginit_4x1_real_t(double result[4]); static void arginit_4x9_real_t(double result[36]); static void main_implicit_enumeration(); // function definitions static void arginit_4x1_real_t(double result[4]) { int idx0; // loop on array initialize each element. (idx0 = 0; idx0 < 4; idx0++) { // set value of array element. // change value value application requires. result[idx0] = 1; } } static void arginit_4x9_real_t(double result[36]) { int idx0; int idx1; // loop on array initialize each element. (idx0 = 0; idx0 < 4; idx0++) { (idx1 = 0; idx1 < 9; idx1++) {

r - ggplot2: How to shade an area above a function curve and below a line? -

Image
so have dataframe this: a_data <- data.frame( f = f, alpha = alpha, asymptote = alpha_1_est) and function this: a_formula <- function(x) { 0.7208959 - 0.8049132 * exp(-21.0274 * x)} i use them ggplot2: ggplot(a_data, aes(x = f, y = alpha)) + geom_point() + #function curve stat_function(fun = a_formula, color = "red") + #asymptote of alpha geom_hline( yintercept = asymptote, linetype = "longdash", color = "blue") which yields plot this: what want , can't find way shade area between y axis, function curve (red) , asymptote line (dashed), this: i have tried squeeze ribbon or polygon in there, doesn't work correctly - maybe it's because want shade above curve, not below (below works fine). this how dataframe looks like: > head(a_data) f alpha asymptote 1 0.01 0.007246302 0.7208959 2 0.03 0.374720198 0.7208959 3 0.05 0.484362949 0.7208959 4 0.07 0.540090209 0.7208959

android - Can't connect to Google Games API with 11.0.2 Play Services -

i know stackoverflow has lot of questions regarding issue 1 related recent changes in games development . first of there no strict guide integrating games api. @ least didnt find fresh. 1 guide simple sign in , basegameutils not suitable new changes anymore. tried - doesn't work. perhaps faced issue. i able connect client mapiclient.hasconnectedapi(games.api) stull returns false on onconnected method. i've added sha-1 keys both release , debug versions , in google console see auto-generated ids web , android clients. last 1 added string server_client_id . i've downloaded google-services.json file. yeah, , manifest has meta-data: <meta-data android:name="com.google.android.gms.games.app_id" android:value="@string/app_id" /> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> my current code: oncreate() : googl

c# - Get the page number and page size -

i need page size , page number of jsgrid . based on page number, need records db. because when use above 100k records, jsgrid got stuck , loading long period. how page number of jsgrid? , want search text , pass cs method. don't want filter inside jsgrid using loaddata: function (filter) { return $.grep(clients, function (client) { return (!filter["fieldname"] || client["fieldname"].tolowercase().indexof(filter["fieldname"].tolowercase()) > -1) )} it filtering data loaded in jsgrid. want pass search text cs. to data bind in jsgrid,(serializing data) datatable dtitem = // data db foreach (datarow row in dtitem .rows) { gridlist += "{'id':" + row["id"] + ",'name': '" + row["name"] + "'}, "; } to search,need data filter area , pass along pagenumber sql procedure. you decide on page size want in jsgrid options, example:

python - create a plot with all dates in pandas -

i need create plot of dataframe several columns. have dates on x-axis. how possible make on plot there dates? data shown period of once every 5 months. in columns, data small, important me visible on plot. dataframe looks this. date col1 col2 col3 col4 col5 col6 20.05.2016 1091,06 12932,31 0 9343,334 23913,74 0 27.05.2016 1086,66 11845,64 0 9786,654 23913,74 0 03.06.2016 1083,04 10762,59 0 9786,654 23913,74 0 10.06.2016 1083,96 9678,630 4000 9786,654 23913,74 0 17.06.2016 1087,31 22718,40 0 9786,654 23913,74 1412 24.06.2016 1089,78 21628,62 0 9786,654 23828,96 0 01.07.2016 1083,70 20544,92 0 9749,567 23828,96 0 08.07.2016 1081,92 19463 0 9749,567 23828,96 0 ... my code looks this: df.plot(figsize=(20,10), x='date', y=['col1', 'col2', 'col3&

activiti - No activity events when using the Java API -

i'm using actviti implementation of activitieventlistener , handles events such activti_completed / task_created etc. when communicating process instances, can see aforementioned events fired (in act_evt_log table), when via java api, no events fired (e.g. when sending message boundary event catches). below code snippet: public static void main(string[] args) { readproperties(); processengine = buildprocessengine(); processengine.getruntimeservice() .addeventlistener(new activitieventhandler("localhost", "61616")); new messagesender(processengine).sendmessage(args); } what missing here? in case come across same problem - this misunderstanding: presumed events show in act_evt_log table, not knowing there's registered event listener popoulates it. after not seeing expected events in table thought activiti doesn't dispatch them, when in reality dispatched had no indication. so added following line, mad

javascript - After clicking Export to Excel. in Excel Duration time is not Displaying correct -

Image
here trying correct duration time not able add punch in , punch out time in duration column. i tried not getting correct result per requirement me. when excel file download should display correct duration time. @(html.kendo().grid(model) .name("timetrackinglogsgrid") .columns(columns => { columns.bound(c => c.id).hidden(true).htmlattributes(new { style = "text-align:center;" }); columns.bound(c => c.isdeleted).hidden(true); columns.bound(c => c.approvalrequired).visible((bool)viewbag.isadmin).clienttemplate("# if (approvalrequired == true && approved == false && '" + (viewbag.isadmin).tostring() + "'=== 'true') {# yes: <a data-ajax='true' data-ajax-complete='refreshgrid' data-ajax-method='post' href='/punch/approve/#:id#' class='grid-link' >approve</a>#} else{# no #}#"); columns.bound(c => c.employeename

jquery - Populating Columns headings from JSON in bootstrap-table? -

i can how populate data json file on server (url: file.json), still need declare columns manually initiate bootstrap table. i populate entire table according json information. possible? current code: function create_table_from_json() { $('#table').bootstraptable({ url: 'data.json', columns: [{ field: 'firstname', title: 'first name', sortable: 'true' }, { field: 'lastname', title: 'last name', sortable: 'true' }, { field: 'desc', title: 'description' }, { field: 'donotcall', title: 'do not call' }], sortname: 'lastname', striped: 'true', search: 'true', showcolumns: 'true' }); } sidenote: if has experience other table e

mysql - How I can do this query? -

i have 2 tables: table1: name added_by edited_by 1 3 b 2 2 c 3 1 table2: id login 1 admin 2 user1 3 user2 i need result: name added_by edited_by admin user2 b user1 user1 c user2 admin you can try query select t1.name, t2.login added_by, t3.login edited_by table1 t1 inner join table2 t2 on(t1.added_by=t2.id) inner join table2 t3 on(t1.edited_by=t3.id)

excel - Is there a way to put a breakpoint when my active window changes? -

is there way put breakpoint on activewindow.change ? have macro run in new, unsaved excel file, supposed open csv file, save as, process it, , keep in focus. instead of that, when macro done selects empty new file unsaved, , puts csv in background. happens though use code below, before end sub : wkb1.activate wkb1.sheets(1).activate wkb1.sheets(1).range("a1").select the thing 3 rows of code above set focus correctly, @ end sub switches unsaved file. i thinking if can set breakpoint whenever active window name changes, can catch when happens, because macro i'm working huge, , can't find bug manually. kind regards, daniel the fix quite stupid, fixed issue creating new ribbon tab , run macro ribbon instead of running vba. removed , activate o select commands. macro behaving same, after removed activate , select commands, thing fixed running new menu.

dns - Every subdomain redirect to main one -

i have bought vps server , domain points ip of vps. thought working fine noticed when ping: ping domain.com ping asd.domain.com ping asd.asd.asd.asd.domain.com gives same result (pings vps) , guess shouldn't (only domain.com). i'm using ubuntu 16 on vps without special configuration. need set dns server or on server? natural behaviour? how "fix" , how manage subdomains?

html - multipart/form-data not sending binary data in header -

i wondering why code not sending file's data in http request header. <!doctype html> <html> <head> <title>test</title> </head> <body> <form enctype="multipart/form-data" action="test.html" method="post"> <input type="file" name="photo"> <button type="submit">submit</button> </form> </body> </html> it not pointing @ server side code knowledge shouldn't affect browser generating http request. looking @ actual http request shows getting filename not actual data. link below shows request payload in chrome. request payload it sending file data. chrome dev tools doesn't show it.

JavaScript condition for operations not working as required -

i want check operator condition , based on assign values. below condition. if (checkifuserrequesterapprover == "vsat approver" && isdraftorsave == "save" || isdraftorsave == "draft") { vsatsaving.is_submit = 0; vsatsaving.status_id = 1; } and in checkifuserrequesterapprover vsat requester still both conditions satisfying , going inside. how possible ? looks if expression should (checkifuserrequesterapprover == "vsat approver" && (isdraftorsave == "save" || isdraftorsave == "draft"))

php - Unable to connect to my web API from Java Bukkit Plugin -

i have made web api want bukkit plugin connect to. plugin sends post httpurlconnection file 'registerplugin.php' in website. code file is: <?php require("api.php"); registerplugin($_post["name"], $_post["ip"], $_post["port"], $_post["online"], $_post["uuid"]); ?> the code registerplugins method in file 'api.php' is: function registerplugin($name, $ip, $port, $playersonline, $uuid) { $sql = "insert api_activeplugins (plugin_name, plugin_ip, plugin_port, players_online, plugin_uuid) values ('$name', '$ip', '$port', '$playersonline', '$uuid')"; get_mysql()->query($sql); } and code in bukkit plugin is: private void connect(string api, string args) { try { byte[] data = args.getbytes(charset.forname("utf-8")); int datalength = args.length(); plugin.getlogger().info(args);

javascript - Embed videos from Youtube & Vimeo in the same player -

i'm trying embed both youtube & vimeo videos in same player, found https://github.com/jakiestfu/youtube-tv , looks how want it, except purely youtube videos. i want able provide youtube & vimeo links embedded youtube-tv plugin. i googled , searched stackoverflow no use. any tips start?

angularjs - How to cal function name to other service id in jasmine karma -

below ctrl file code , i'm calling jasmine spec file.when run spec file i'm getting below error typeerror:undefined not object id = myservice.functionname(otherservice)[0].id;

css3 - Compiling Sass (scss) to css -

i have template - web template - editorial when added existing meteor app not load scss files , css file in client directory. though put scss files in public folder. best way can add this? because not work decided compile scss css. sass_folder scss_subfolder ----base_scss_subfoler _partial1.scss _partial2.scss ----components_scss_subfoler _buttons.scss _textbox.scss ----layouts_scss_subfoler _pages.scss _footer.scss ----libs_scss_subfoler _functions _vars _skels _mixins main.scss ie8.scss ie9.scss css_output_folder i have tried compile files doing on cmd: sass --update scss:css compiled main.scss, ie8.scss, ie9.scss css folder, other not compiled. how compile @ once , maintain same sub-directory folder in css folder. why , how do this? if appreciate contribution in advance. the files names starti

javascript - How to print the message using setTimeout function with the help of callback and promise concept? -

below code snippet have written.my aim print message . delayedalert(message:string, time: number, cb){ settimeout(()=>{ cb() }, time) }; //calling function. delayedalert('aditya', 3000, ()=>{ console.log('done) }); i want print aditya after 3secs, getting console value, don't want instead want aditya printed after 3 secs. , same above i have write code promise also. please ignore typos. please help. the promise won't need call back, act placeholder result of asynchronous task.... in example can execute function when promise resolved .. (in .then() funcion) function delayedalert(message, time){ return new promise((resolve,reject)=>{ settimeout(()=>resolve(message), time); }); }; //calling function. //promise let promise = delayedalert('aditya', 3000); promise.then(message=>{ console.log(message); }); //callback function delayedalertcallback(message, time,cb){ settime

javascript - unable to add custom js script in child theme -

i need add custom script in child theme in wordpress. this content of child theme : themes |meteorite |style.css |meteorite-child |function.php |style.css |js |mngclk.js my function.php add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css'); } wp_register_script( 'new-script', get_stylesheet_directory_uri() . '/js/mngclk.js', 'jquery', "1", true); wp_enqueue_script( 'new-script' ); i tried multiple change did not manage inclute custom js script this proper example function my_theme_enqueue_styles() { $parent_style = 'parent-style'; // 'twentyfifteen-style' twenty fifteen theme. wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style',

python - How to show dynamic custom actions by selected custom filter in Django -

class evidencefilter(simplelistfilter): title = _('evidence') parameter_name = 'evidence' def lookups(self, request, model_admin): return evidence_status_choices def queryset(self, request, queryset): if self.value(): if self.value() == 'pending': return queryset.filter(q(profile__identity_verified='pending') & (q(person_id_status='pending') | q(person_selfie_status='pending') | q(org_certificate_status='pending') | q(org_taxid_status='pending'))) elif self.value() == 'accepted': return queryset.filter(q(profile__identity_verified='pending') & ((q(person_id_status='accepted') & q(person_selfie_status='accepted')) | (q(org_certificate_status='accepted') & q(org_taxid_status='accepted')))) elif self.value() == 'rejected

Null handling in rx-java2 flatMap -

as explained in docs rxjava 2.x no longer accepts null values. not surprising both of following 2 lines terminate onerror called: observable.fromcallable(() -> null); observable.just(1).flatmap(i -> observable.error(new runtimeexception())); what unclear why observable.just(1).flatmap(i -> observable.fromcallable(() -> null)) terminates success , no items emitted. seams reasonable expect behave in same fashion observable.error i can see in source code of rx-java 2.1.2 public final <r> observable<r> flatmap(...) { if (this instanceof scalarcallable) { @suppresswarnings("unchecked") t v = ((scalarcallable<t>)this).call(); if (v == null) { return empty(); } ... } which explains why happening in terms of code, still have 2 questions: 1) intended behavior or bug? 2) if intended, there reason this? this bug observable.fromcallable , fixed pr 5517 . if, reason

javascript - JQuery selector change every 3 item -

i'm working php loops , creating multiple li in 1 ul . problem is, need show every fourth li when click on 1 of 3 previous li . at moment works first previous li this: $('.last_news li').on('click', function(){ $('+ .actu_details',this).toggleclass('expend'); }); anyone got clues $('.last_news li').on('click', function() { $('+ .actu_details', this).toggleclass('expend'); }); last_news { padding: 35px } ul { padding-left: 0px; margin: 0; overflow: hidden; } ul li { list-style-type: none; cursor: pointer; float: left; width: 33%; height: 250px; background-color: red; margin-right: 0.5%; margin-bottom: 5px; color: #fff; position: relative; } li:nth-of-type(3) { margin-right: 0; } li:nth-of-type(4n+7) { margin-right: 0; } li.actu_details { width: 100%; height: 0px; background-color: green; display: blo

ios - How to get shape or detect bezier path of shape in image? -

Image
need achieve detecting shape path within image. creating images bezier path 1 solution can path or draw border around shape other way? image in odd rule layer. how detect path in it?

Machine Learning Algorithms which provide information that describes why a classification is made -

Image
i working on machine learning project in need train model classify various input objects; simplicity, lets assume trying create model can classify image either containing cat or dog. however, not interested in classifying these objects, in understanding why algorithm classified image dog or cat. decision trees allow nice visualizations describe why example classified 1 way or based on example's features, so: i new machine learning, unfamiliar how lot of learning algorithms work; there other algorithms allow visualization (or information) give insight why input example classified 1 way or other, based on examples features? there 1 such visualization tool (for neural networks) helps visualize how particular parameter affects output classification. might give intuition on how network classifying particular label. can check out here: http://playground.tensorflow.org/ since linear , complex non linear classifiers can represented/transformed neural network, can ge

amazon web services - Sails On AWS AdapterError: Connection is already registered -

i've managed deploy sails app aws , seems fine, except sails refuses lift error: error: adaptererror: connection registered @ object.registerconnection(...) this has not been lifted before shouldn't have connection registered. running: ec2 t2.micro ubuntu image thanks in advance!

ibm bluemix - IBM weather company data, max temp and min temp for day and night part of the forecast -

in case of ibm weather company data forecast, key gives maximum , minimum temp day , night part of forecast? using: nighthigh = result.forecasts[0].night.hi; nightlow = result.forecasts[0].night.wc; here json received api call. { "metadata": { "language": "en-us", "transaction_id": "1500467819366:918701294", "version": "1", "latitude": 36.11, "longitude": -115.17, "units": "e", "expire_time_gmt": 1500469259, "status_code": 200 }, "forecasts": [ { "class": "fod_long_range_daily", "expire_time_gmt": 1500469259, "fcst_valid": 1500472800, "fcst_valid_local": "2017-07-19t07:00:00-0700", "num": 1, "max_temp": 98, "min_temp": 81, "torcon": nu

sql - update all duplicate rows with different values in pgsql -

i need update duplicate rows different values in same table. table is table(id, phoneid(int), deviceid(int), userid(int)) there records same deviceid or phoneid . example id phoneid deviceid userid 1 23 3434 1235 2 23 5453 235 <---- same phoneid 1 record 3 43 5453 2343 <---- same deviceid 2 record 4 23 3434 6347 <---- same deviceid , phoneid 1 record what need change - if phoneid not unique, set phoneid userid (from row). same @ deviceid. (if deviceid not unique, set deviceid userid ) final result should this id phoneid deviceid userid 1 23 3434 1235 2 235 5453 235 <---- phoneid changed userid 3 43 2343 2343 <---- phoneid changed userid 4 6347 6347 6347 <---- phoneid , deviceid changed userid just update duplicated phoneids , duplicated deviceids (assuming table name "t") upd

Javascript, How to change a value of an internal css class -

this question has answer here: how read css rule values javascript? 14 answers how dynamically adjust css stylesheet based on browser width? 4 answers i have html file , internal css style tag, includes css classes, i'm trying change value of color in class called "header1", when window width becomes less 700: <script type="text/javascript"> var width = document.body.clientwidth; if (width <=700){ var hcolor = document.getelementsbytagname("style").item("header1").style.color; alert(hcolor); } </script> i tried assign value "red" variable hcolor, i'm getting nothing, no errors too, it's ignoring it, tried test using alert, i'm ge

linux - How to solve too many TCP connections on FIN_WAIT_2? -

server , client connected using port 8000. clients aborted unexpectively connections still there. besides restarting server, suggestion release legacy connections? $ net stat -an | grep 8000 tcp4 0 0 127.0.0.1.8000 127.0.0.1.58761 close_wait tcp4 0 0 127.0.0.1.58761 127.0.0.1.8000 fin_wait_2 tcp4 0 0 127.0.0.1.8000 127.0.0.1.58755 close_wait tcp4 0 0 127.0.0.1.58755 127.0.0.1.8000 fin_wait_2 tcp46 0 0 *.8000 *.* listen

java - How complete list of object into another object uqing Rxjava -

on service, client has on or many relationships. using rxjava when client want retrieve client object list of relationships. something like: datamanager.getclient(clientid) .zipwith(???) .observeon(androidschedulers.mainthread()) .subscribeon(schedulers.io()) .subscribe(); use map function change scope of data within observable: datamanager.getclient(clientid) .map(client -> client.relationships) .observeon(androidschedulers.mainthread) .subscribeon(schedulers.io()) .subscribe(list -> { *do something* });

angularjs wait for response from $http -

i have problem function doesn't wait response of http request , go further. know can use promise wait don't understand concept. i have data service have http request : function getgroupidfrombakery(bakeryid, successcallback, errorcallback) { $http.get(service.baseurl + "bakeriesgroup/bakeries/" + bakeryid) .then(function (result) { successcallback(result.data); }, errorcallback); } from service, call data service : var haspermission = function (permission, params) { permissionroute = permission; setidentity(params); (var = 0; < permissions.length; i++) { if (permissionroute.name === permissions[i].name) { if (permissions[i].scope == "system") return true; else if (permissions[i].scope == permissionroute.scope && permissions[i].identity == permissionroute.identity) return tr

java - javax.xml.bind.UnmarshalException iccurs when unmarshalling an XML -

i use below code unmarshal xml using jaxb. responsexml contains xml string returned web service call. stringreader reader = new stringreader(responsexml); jaxbcontext = jaxbcontext.newinstance(testresponse.class); unmarshaller unmarshaller = jaxbcontext.createunmarshaller(); object idresponse = unmarshaller.unmarshal(reader); below exception occurs when unmarshalling. javax.xml.bind.unmarshalexception - linked exception: [exception [eclipselink-25004] (eclipse persistence services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.xmlmarshalexception exception description: error occurred unmarshalling document internal exception: java.lang.illegalargumentexception: ] someone work on this. below testresponse class auto generated xsd @xmlaccessortype(xmlaccesstype.field) @xmltype(name = "", proporder = { "responsecode", "responsedescription", "responsemessage" }) @xmlrootelement(name = &q

mysql - myrocks (mariadb + rocksdb) php charset -

there plenty of posts choosing right charset mysql, it's again different (and frustrating) story rocksdb engine. firstly, decided use utf8-binary charset (latin1, utf8-bin , binary supported myrocks) because data may contain special chars , want on save side. furthermore, using php , pdo loading data mysql , connection looks this: $pdo = new pdo('mysql:host=localhost;dbname=dbname;charset=utf8', 'user', 'password'); so set charset utf8 (i tried use utf8_bin , not supported pdo). although, able insert rows, errors following one: incorrect string value: '\xf0\x9f\x87\xa8\xf0\x9f...' column 'column_name' but what's error now? hex sequence encodes unicode-smily (a regional indicator symbol letter c + regional indicator symbol letter n). seems me valid utf8 , mysql php configured use it. you gotta have utf8mb4 , not mysql's subset utf8 . 🇨 needs 4-byte utf-8 encoding, hex f09f87a8 . if rocksdb not support