Posts

plsql - Can anyone tell me what is wrong with the following PL/SQL block? -

i trying execute following script in sqlplus each time says "missing keyword". main objective select random number column1 of table variable vnm_rand_number each value(1 8) of column2. please tell me wrong code , there other way me this? declare vvc_sql_stmt long; vvc_name varchar2(10) := 'asdf'; vnm_rand_number number; vvc_table_name varchar2(50); begin vvc_table_name := 'ak_'||vvc_name||''; in 1 .. 8 loop vvc_sql_stmt := 'select column1 vnm_rand_number from( select * '||vvc_table_name||' column2 = '||i||' order dbms_random.value) rownum = 1'; execute immediate (vvc_sql_stmt); commit; dbms_output.put_line(vnm_rand_number); end loop; end; / it's helpful post full error stack (the ora-xxxxx error number, line throwing error, etc.). guess want vvc_sql_stmt := 'select column1 ' || ' from( ' || ' select * ' || ' ' || vvc_table_name || '...

r - How to draw a power curve using ggplot2 -

Image
i want use ggplot2 visualize data follows power curve. has been asked before ( add exp/power trend line ggplot ) answer didn't help. one trick use stat_function() create curve. however, unable stat_function() , power curve work logarithmic scales. i illustrate problems. create sample data , base plot: library(ggplot2) x <- 1:100 pwr <- function(x)x^-2.5 dat <- data.frame(x, y = pwr(x)) p <- ggplot(dat, aes(x = x, y = y)) + geom_point() p + stat_function(fun = pwr) great, let's add logaritmic scales using coord_trans() . works perfectly, except straight lines no longer straight (exactly documentation tells me expect). p + stat_function(fun = pwr) + coord_trans(x = "log10", y = "log10") so, try again coord_x_log10() , coord_y_log10() , throws error : p + stat_function(fun = pwr) + scale_x_log10() + scale_y_log10() error in seq.default(min, max, = by) : 'from' cannot na, nan or infinite this has fact...

java - How to filter properties on a self reference using Jackson? -

let's have class want serialize jackson. public class product { int id; string name; list<product> similarproducts; } how end this? { "id": 1, "name": "product 1", "similarproducts": [ { "id": 2, "name": "product 2" }, { "id": 3, "name": "product 3" } ] } i've see how use @jsonproperty class or @jsonview select things seems it's class (am mistaken)? i'm not sure how work when have class that's referencing , parent has many properties, while child has few. imagine ecommerce site , want name , url of similar products single json payload, don't need other details of similar products (children). you can serialize using @jsonfilter annotation. new version of model: public class product { int id; string name; @jsonfil...

python - launch tornado app on port 80 on remote server -

i have flask app wrapped in tornado server , trying run app on remote server when got error: traceback (most recent call last): file "run.py", line 7, in <module> server.listen(80) file "/home/ec2-user/gatekeeper/local/lib/python2.7/site-packages/tornado/tcpserver.py", line 126, in listen sockets = bind_sockets(port, address=address) file "/home/ec2-user/gatekeeper/local/lib/python2.7/site-packages/tornado/netutil.py", line 187, in bind_sockets sock.bind(sockaddr) file "/usr/lib64/python2.7/socket.py", line 224, in meth return getattr(self._sock,name)(*args) socket.error: [errno 13] permission denied so tried use sudo , got this: traceback (most recent call last): file "run.py", line 1, in <module> tornado.wsgi import wsgicontainer importerror: no module named tornado.wsgi so wondering if must install tornado root in turn mean virtualenv practically useless. how launching...

delphi - How do I raise an exception in an asm block? -

i want raise exception in x64 asm block. lets assume have function so: function example(values: array of integer): integer; asm or rcx,rcx jz @error .... i know can read pointer , av, want raise more descriptive error. i make additional function , call one: asm or rcx,rcx jz @error .... @error: mov ecx, 1 mov rdx, errorstring jmp raiseerror .... function raiseerror(code: integer; const msg: string); begin case code of 1: raise eemptyarrayerror.create(msg); however error occur outside function in caused. how exception (seem to) originate inside example function. note x64, seh answers apply x86 no because x64 uses veh. the full syntax of raise is: raise exception @ address all need pass current ip parameter , error proc can pass on exception. you can rip using lea rax, [rip] . thus code becomes: asm or rcx,rcx jz @error .... @error: mov ecx, 1 mov rdx, errorstring lea r8,[rip] jmp raiseerror .... fun...

Odd syntax in C++: return { .name=value, ... } -

while reading article, came across following function: solidcolor::solidcolor(unsigned width, pixel color) : _width(width), _color(color) {} __attribute__((section(".ramcode"))) rasterizer::rasterinfo solidcolor::rasterize(unsigned, pixel *target) { *target = _color; return { .offset = 0, .length = 1, .stretch_cycles = (_width - 1) * 4, .repeat_lines = 1000, }; } what author doing return statement? haven't seen before, , not know how search it... valid plain c too? edit: link original article this isn't valid c++. it's (sort of) using couple features c known "compound literals" , "designated initializers", few c++ compilers support extension. "sort of" comes fact legitimate c compound literal, should have syntax looks cast, you'd have like: return (rasterinfo) { .offset = 0, .length = 1, .stretch_cycles = (_width - 1) * 4, .repeat_lines = 1000, }; regardless o...

css - Website resources still loading with https protocol -

i've strange issue website . several months ago site had ssl cert i've stopped using reasons. since seems works few days ago lot of users tell me issues website (broken layout said). of them solves issue hard refresh. since last update of chrome (yesterday) i'm facing same issue stylesheet doesn't load. so took in source code of page , see every resources (css, js, img, ...) loaded in https protocol instead of http. it's why can't load. i don't know happens, i'm facing issue chrome , i've of course clean cache, cookies, ssl certs, can clean , clean again. in htaccess nothing rewriting http in https protocol, nothing in wp-config (i'm running wordpress install), , subdomain tv.blizzheart.com on same domain , using same vhost works perfectly. today users tell me error occures in firefox too. on side i'm facing issue chrome (i've tried firefox , ie). of them said error occures on login page (blizzheart.com/login/) i'm...