Posts

android - ImageView overlaps with TextView in ConstraintLayout -

i using recyclerview , code activity_main: <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.constraintlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.romin.apodbrowser.mainactivity"> <android.support.v7.widget.recyclerview android:id="@+id/recyclerview" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginbottom="8dp" android:layout_marginleft="8dp" android:layout_marginright="8dp" android:layout_margintop="8dp" android:scrollbars="vertical" app:layout_constraintbottom_tobottomof="parent" app:la...

performance - MySQL updates getting very slow towards end of the table -

i have table "data" holds around 100,000,000 records. have added new column "batch_id" (integer). on application layer, i'm updating batch_id in batches of 10,000 records each of 100,000,000 records (the batch_id same 10k). i'm doing (application layer pseudo code): loop { $batch_id = $batch_id + 1; mysql.query("update data set batch_id='$batch_id' batch_id null limit 10000"); } i have index on batch_id column. in beginning, update statement took ~30 seconds. i'm halfway through table , it's getting slower , slower. @ moment same statement takes around 10 minutes(!). reached point no longer feasible take on month update whole table @ current speed. what speed up, , why mysql getting slower towards end of table? index on primary key help? is primary key automatically indexed in mysql? answer yes so instead 1 index batch_id help. the problem without index engine full table scan. @ first easy find 10...

ios - What happen to http request when applicationWillResignActive or applicationDidEnterBackground -

when app doing http request , user receive phone call , put app in background (so event applicationwillresignactive , applicationdidenterbackground fired), what's happen current active http request ? need worry (calling example beginbackgroundtaskwithexpirationhandler ) or system @ least let current http request finish ? assuming didn't opt-in multitasking, http call continue a while : according docs on applicationdidenterbackground , have 5 seconds complete ongoing tasks, hence unfinished http calls halt when actual suspension occurs. respective sockets timeout. if need more time, use background downloads or begin background task .

vert.x - Vertx merge contents of multiple files in single file -

what best way append contents of multiple files single file in vertx? have tried vertx filesystem , asyncfile both not have option append file or did not know of any. there alternative approach merge or append files in vertx asynchronously. the solution find make buffer list , write content on end of each previous buffer length using loop. indeed, of vert.x 3.4, there no helper method on filesystem append file file. you asyncfile , pump follows. first create utility method open files: future<asyncfile> openfile(filesystem filesystem, string path, openoptions openoptions) { future<asyncfile> future = future.future(); filesystem.open(path, openoptions, future); return future; } then 1 append file file pump : future<asyncfile> append(asyncfile source, asyncfile destination) { future<asyncfile> future = future.future(); pump pump = pump.pump(source, destination); source.exceptionhandler(future::fail); destination.exception...

python - Email verification and password reset - django rest framework and angularjs -

how implement built in views password-reset in django.rest.auth , how create email verification system registration using django rest framework , angularjs? i have been searching tutorial or documentation on how implement django's send_email function in website using django rest framework , angular js haven't been able find any. what need... when new user registers url must generated them confirm email address this url must automatically sent user's given email after user sent link , confirms email address status must changed new_user.is_active = false new_user.is_active = true what have... registration form sends post request register endpoint the new user data unpacked, validated, , saved in register view in settings.py have added this... email_use_tls = true email_host = 'smtp.gmail.com' email_host_user = 'myemail@gmail.com' email_host_password = 'mypassword' email_port = 587 in urls.py have added this... from djang...

Kill chromedriver process in Selenium / Java -

i running multiple java programs through jenkins using "build periodically" option , uses h 06 * * 1-5 (run every day between 6 , 7 monday friday). there programs in click on links opens new window. hence, use below code driver.findelement(by.xpath(".//*[@id='terms']/li[1]/a")).click(); system.out.println("home page loaded , terms of use link clicked"); arraylist<string> window1 = new arraylist<string>(driver.getwindowhandles()); driver.switchto().window(window1.get(1)); thread.sleep(3000); driver.close(); thread.sleep(3000); driver.switchto().window(window1.get(0)); now after program runs, other program following fails because of chromedriver.exe process running. i tried using driver.quit() instead of driver.close() in code above, close entire browser. note: have used driver.quit() @ end of program doesn't me getting rid of running chromedriver.exe instance opened when switched window. please suggest me a way ha...

Spark DataFrame Filter using Binary (Array[Bytes]) data -

i have dataframe jdbc table hitting mysql , need filter using uuid. data stored in mysql using binary(16) , when querying out in spark converted array[byte] expected. i'm new spark , have been trying various ways pass variable of type uuid dataframe's filter method. ive tried statements val id: uuid = // other logic looks df.filter(s"id = $id") df.filter("id = " converttobytearray(id)) df.filter("id = " converttohexstring(id)) all of these error different messages. need somehow pass in binary types can't seem put finger on how properly. any appreciated. after reviewing more sources online, found way accomplish without using filter method. when i'm reading sparksession, use adhoc table instead of table name, follows: sparksession.read.jdbc(connectionstring, s"(select id, {other col omitted) mytable id = 0x$id) mytable", props) this pre-filters results me , work data frame need. if knows of solution us...