Posts

Value Errors When Retrieving Images With Scrapy -

i'm having trouble using scrapy's image pipeline retrieve images. error reports, think feeding scrapy right image_urls. however, instead of downloading images them, scrapy returns error: valueerror: missing scheme in request url: h. this first time using image pipeline feature, suspect i'm making simple mistake. same, i'd appreciate solving it. below you'll find spider, settings, items, , error output. they're not quite mwes, think they're pretty simple , easy understand same. spider: import scrapy scrapy.spiders import crawlspider, rule scrapy.linkextractors import linkextractor ngamedallions.items import ngamedallionsitem scrapy.loader.processors import takefirst scrapy.loader import itemloader scrapy.loader.processors import join scrapy.http import request import re class ngaspider(crawlspider): name = 'ngamedallions' allowed_domains = ['nga.gov'] start_urls = [ 'http:...

java - Array Index Out of Bounds Error While Populating From a Text File -

i having trouble error trying populate array text file. think might have if loop, i'm not sure. it's giving me out of bounds error on mydata[9] . want check see if first letter d (meaning following stuff update), , make update object. update.txt file has 10 things in populate mydata with, why confused why mydata[9] giving me out of bounds error (specifically try set equal lastthirty ). scan = new scanner(file); while (scan.hasnext()) { string str = scan.nextline(); string[] mydata = str.split("#"); if (mydata[0].equalsignorecase("d")) { recordtype = mydata[0]; actioncode = mydata[1]; boxid = integer.parseint(mydata[2]); movieid = integer.parseint(mydata[3]); movietitle = mydata[4]; moviegenre = mydata[5]; releaseyear = mydata[6]; instock = mydata[7]; totalrentals = integer.parseint(mydata[8]); lastthirty = integer.parseint(mydata[9]); updates[co...

c# - How can you make progress bar colors more vibrant? -

Image
doing in c# wpf. me seems progressbar colors washed out; not vibrant: is because they're animated? color being called 'leadership' progress bar straight system color "red". there value can set make these colors 'pop' , brighter , more intense?

ajax - Rails Conditional Facebook OG Tags -

i have rails personality test app uses ajax render questions , show results. i have been attempting share personality test results via facebook sending variable 1 of dashboard rails controller dynamically create tags. however, variable nil when page first loaded (which causes error), fixed adding conditional (in application.html.erb): <% if @cat %> <meta property="og:title" content="you got <%= @cat.name %>!"/> <meta property="og:image" content="<%= @cat.picture %>" /> <meta property="og:description" content="<%= @cat.description%>" /> <meta property="og:url" content="https://mysite" /> <meta property="fb:app_id" content= "<%=env['facebook_app_id']%>" /> <meta property="og:type" content="website"> <% end %> facebook ...

c - Using Kernel Modules Functions in a Custom System Call - Undefined Reference Error -

Image
i'm beginner c , linux developer i'm sorry if sounds confusing. i managed create simple system call updating syscall_64.tbl, adding asmlinkage method definition syscalls.h, adding folder main makefile , creating makefile has 1 line: obj-y := syscall.o no problems until this, compiled linux source code , worked. want build more advanced system call. added function vmx.c(which in arch/x86/kvm): void myfunction(void){ //some code } export_symbol(myfunction); and defined in vmx.h(it in arch/x86/include/asm): void myfunction(void); now problem begins. included vmx.h syscall.c file , called function. i'm getting "undefined reference myfunction" when try compile linux source code. doing wrong? syscall.c: #include <linux/kernel.h> #include <linux/syscalls.h> #include <asm/vmx.h> asmlinkage long sys_customsyscall(const char *test) { printk(kern_alert "test: %s,\n", test); myfunction(); return 0; } after thi...

java - how to set request hostname in httpclient -

i use apache httpclient send request site, site check servlet request hostname. checks hostname this: string hostname = request.getremotehost(); and when send request, hostname ip address, not hostname. send request code this: httpclientbuilder httpclientbuilder = httpclientbuilder.create(); list<header> headerlist = new arraylist<>(); headerlist.add(new basicheader("host","mycustomhostname")); httpclientbuilder client = httpclientbuilder.build(); httpget request = new httpget("http://siteaddress:8080/gethostname"); request.setheader(new basicheader("host","mycustomhostnameagain.just.for.try")); client.execute(request); but not works. how set request hostname in httpclient? thx. request.getremotehost() not use headers http request. instead doing reverse dns lookup . takes ip got request , tries dns information. possible that information doesn't exist in case call returns ip address string. ...

mysql - i have tow table which contain on same column like UserID. How to get all row by subquery -

i have tow table contain on same column userid 1. employee -------------------------------------------------------- id userid name description 1 username1 fullname1 employee description1 2 username2 fullname2 employee description2 -------------------------------------------------------- 2. user_info -------------------------------------------------------- id userid password 1 username1 password1 2 username2 password2 -------------------------------------------------------- i have user_info data. want employee table row according user_info data "subquery" want use subquery syntax i don't know why want subquery, try this, maybe works;) select e.* employee e exists ( select 1 user_info u e.userid = u.userid ) -- maybe conditions else need, can add or can try this, select e.* employee e e.userid in ( select u.useid user_info u ) anyway, perhaps other solution exists... ...