Posts

python - cx_oracle unable to find Oracle Client -

i have installd python 2.7.3 on linux 64 bit machine. have oracle 11g client(64bit) installed. , set oracle_home, path, ld_library_path, , installed cx_oracle 5.1.2 version python 2.7 & oracle 11g. ldd command on cx_oracle unable find libclntsh.so.11.1. i tried creating symlinks libclntsh.so.11.1 under /usr/lib64, updated oracle.conf file under /etc/ld.so.conf.d/. tried possible solutions have been discussed on issue on forums, no luck. please let me know missing. the issue me installed python, cx_oracle root oracle client installation done "oracle" user. got own oracle installation , fixed issue. later ran pyunicodeucs4_decodeutf16 issues python , had install python —enable-unicode=ucs4 option

security - When is it acceptable to run app with no password on mysql? -

it's not crucial question, i'm still wondering, when it's possible have mysql connection settings some-user@localhost no-password. it's potential risk in case of shared web-provider: other user can access database (if know some-user name). is risky in case of vps(vds)? if run own server ip, assume approach safe? wrong? mimic localhost ip outside?

java - Configure JDBC Authentication in Spring Boot -

goal: add jdbc authentication spring boot default security configurations. source can found here per spring boot docs configure global authenticationmanager autowiring authenticationmanagerbuilder method in 1 of @configuration classes and spring security docs example: @autowired private datasource datasource; @autowired public void configureglobal(authenticationmanagerbuilder auth) throws exception { auth .jdbcauthentication() .datasource(datasource) .withdefaultschema() .withuser("user").password("password").roles("user").and() .withuser("admin").password("password").roles("user", "admin"); } given above, added following ( found here ): @configuration @enableauthorizationserver @enableresourceserver public class authenticationmanagerconfig { @autowired private datasource datasource; @autowired public void configure...

stringtemplate - StringTemplate4 if conditional with length -

i need generate following kinds of code stringtemplate4: methodfoo0(connection conn); methodfoo1(connection conn, int arg1); methodfoo2(connection conn, int arg1, int arg2); etc. the "connection conn" part present passing method name , rest of arguments st template. template looks follows: <methodname>(connection conn, <args; separator=", ">); this works produces comma when there no arguments @ (except conn): methodfoo0(connection conn,); to eliminate comma tried using if conditional , length st4 function couldn't work although tried various combos following: <methodname>(connection conn <if (length(fieldsinfind) \> 0)>,<else><endif><fieldsinfind; separator=", ">) ... , others failed parsing-related error ( mismatched input ). in end, gave , resorted passing comma parameter template either "," or empty string "" based on pre-rendering logic. you check p...

c# - Exchange 2010/2013 TransportAgent Content Conversion for Internal Recipients -

i trying create transportagent reroutes internal email remote server further processing, email comes on in microsoft's internal tnef format (no content conversion being applied). in same format used if email going external recipient. i using routingagent reroute internal emails remote server. if can explain why happens in terms of categorizer's pipeline, helpful too, if can't avoid it. agent implemented both exchange 2010 , 2013, in case answer differs based on version of exchange.

regex - Ruby on Rails exclude group elements in route constraints -

i wondering, how define constraints regex route, match if excludes every single element of group. for instance, so: get "list/:action", :constraints => {:action => [none of following: (new, edit, delete, update)} i know if want match of elements of list, have defined so: get "list/:action", :constraints => {:action => /(new|edit|delete|update)/}, don't know, how make work described above. i have tried using ^ , ! signs before group, no luck far - there has notation one, think. how exclude these elements ? try following. it'll exclude actions route. class excludeactions def matches? ["new", "edit", "delete", "update"].exclude? params[:action] end end "list/:id", :constraints => excludeactions.new this exclude new , edit , delete , update actions routes list

shader - OpenGL Shadow Map -

i trying basic shadow map reason doesn't render properly. video of problem i render house using flat shader: int shadowmapwidth = window_size_x * (int)shadow_map_ratio; int shadowmapheight = window_size_y * (int)shadow_map_ratio; // rendering shadow texture. glactivetexture(gl_texture0); call_gl(glbindtexture(gl_texture_2d, shadowtexture)); // bind framebuffer. call_gl(glbindframebuffer(gl_framebuffer, shadowfbo)); //clear call_gl(glclear(gl_depth_buffer_bit)); call_gl(glviewport(0, 0, shadowmapwidth, shadowmapheight)); call_gl(glcolormask(gl_false, gl_false, gl_false, gl_false)); //render stuff flatshader.use(); flatshader["basecolor"] = glm::vec4(1.0f,1.0f,1.0f,1.0f); flatshader["pvm"] = projectionmatrix*pointlight.viewmatrix*cursor.modelmatrix; cursor.draw(); //binds vao , draws // revert scene. call_gl(glbindframebuffer(gl_framebuffer, 0)); call_gl(glcolormask(gl_true, gl_true, gl_true, gl_true)); call_gl(glviewport(0, 0, window_size_x, window_s...

c# - Reducing number of trips from Silverlight App to Database -

i working on silverlight application. have view allows user add new object. viewmodel bound view has collection of object type property. constructor of viewmodel has function, getdata() calls wcf service , fetches data database, adds fetched list collection. after adding new object database through wcf service, method getdata needs called again refresh collection having latest data in collection necessary. this process little slow every time 1 adds anything, entire data tables need fetched again. can more slower data grows more , more large , when joining of multiple tables may required data. i thinking of adding object pass service add database, directly collection in viewmodel. obviously, add object collection when service called has not returned error make sure has been added db. way can have latest data in collection without need fetch database. can 1 point out drawback approach or scenario may fail? also, please suggest if there other better ways of achieving goal. ...

c++ - How to avoid scientific notation and show full number instead? -

i have below code in 1 of library causing numbers shown in form of scientific notation. t value = 0; template<typename u> void process(u& buf, dataoption holder) const { if (holder == dataoption::types) { switch (type_) { case teck::proc_int: buf << "{\"int\":" << value << "}"; break; case teck::proc_long: buf << "{\"long\":" << value << "}"; break; case teck::proc_float: buf << "{\"float\":" << value << "}"; break; case teck::proc_double: buf << "{\"double\":" << value << "}"; break; default: buf << "{\"" << type_ << "\":" << value << "}"; } ...

java - use variable or textfield to pass as parameter to other textfield in jasper report -

i'm doing report showing balance sheet report completed, 1 thing remains showing final amount in words used java function int parameter convert amount words. now problem have calculated , stored final amount in textfield (say x ) , want pass amount java function tried out many ways, failed question how pass variable or 1 textfield other textfield parameter? suggest ways or ideas? googled same, tried search on jaspersoft forum also.

tail recursion - Return a sequence with the elements not in common to two original sequences by using clojure -

i have 2 sequences, can vector or list. want return sequence elements not in common 2 sequences. here example: (removedupl [1 2 3 4] [2 4 5 6]) = [1 3 5 6] (removeddpl [] [1 2 3 4]) = [1 2 3 4] i pretty puzzled now. code: (defn remove-dupl [seq1 seq2] (loop [a seq1 b seq2] (if (not= (first a) (first b)) (recur (rest b))))) but don't know next. i encourage think problem in terms of set operations (defn extrasection [& ss] (clojure.set/difference (apply clojure.set/union ss) (apply clojure.set/intersection ss))) such formulation assumes inputs sets. (extrasection #{1 2 3 4} #{2 4 5 6}) => #{1 6 3 5} which achieved calling (set ...) function on lists, sequences, or vectors. even if prefer stick sequence oriented solution, keep in mind searching both sequences o(n*n) task if scan both sequences [unless sorted]. sets can constructed in 1 pass, , lookup fast. checking duplicates o(nlogn) task using set.

How to throw exception when comparing with None on Python 2.7? -

in python 2.7: expression 1 (fine): >>> 2 * none traceback (most recent call last): file "<stdin>", line 1, in <module> typeerror: unsupported operand type(s) *: 'int' , 'nonetype' expression 2 (fine): >>> none none true expression 3 ( bad ): >>> 2 < none false expression 4 ( bad ): >>> none<none false expression 5 ( bad ): >>> none==none true i want somehow force expressions 3, 4 , 5 throw typeerror (same in expression 1). python 3.4 there - expression 5 returns true. i need in 2.7. my use case (if interested): i'v made application evaluates expressions (example): d = a+b e = int(a>b) f = if a<b else b if b<c else c expressions based on values (a, b , c) comes deserialized json. most of time values (a, b , c) integers, (when value missing) none. when value missing , used in expressions expression should return none (i thinking catching typeer...

android - alpha calculation in complementary filter -

i using complementary filter sensor fusion. equation complementary filter using is angle=(1-alpha)*(angle+gyro*dt)+(alpha)*(accel_mag_angle) i have confusion calculation of alpha. read somewhere alpha calculated using formula alpha= da/(da+dt) where da rate @ want values change (which refers cutoff frequency of filter) , dt sampling time. using sensor_delay_ui. sampling rate of ui around 15hz. used alpha=0.2(by trial , error method) , app worked fine. later realised according equation cannot use alpha=0.2(theoretically) since give me cut off frequency of 60hz , sampling frequency 15hz. cut off frequency calculation wrong ? or understanding of equation wrong ? i wouldn't sweat it. if find alpha=0.2 satisfactory trial , error, use it. filters have tuned in practice anyway. theory helps start (usually) cannot avoid tuning. i don't see wrong 60 hz cut off frequency. means motions above frequency cut off. , thing, since noise anyway.

asp.net - editURL not being called - JQGrid -

i have editable jqgrid, inline editing events, editurl not being called. edit data web method in vb.net. when click on row row becomes editable , able make changes when hit enter editurl not being called. please suggest changes necessary. <scriptmethod(responseformat:=responseformat.json)> _ <webmethod()> _ public shared function loaddata() jqgridresult 'if mulist.selectedvalue <> "0" andalso mulist.selectedvalue <> string.empty ' hirnodemu = hirnodemu.parse(mulist.selectedvalue) 'else ' hirnodemu = 0 'end if 'dim hirnode integer = hirnodemu 'if hirnode = 0 ' hirnode = hirnodecurrent 'end if dim sidx string = "" dim sord string = "asc" dim page integer = 1 dim rows integer = 1000 dim entryfieldsonly integer = 1 dim hirnode integer = 5 dim fiscalyear integer = 2012 dim fiscalperiod integer = 3 dim dtwordata...

c++ - forward compatibility of occi application -

we have occi application linked dynamically occi lib on solaris . during build linked occi of oracle 10.2.0.4 client want same build able run under oracle 10g client oracle 11g client. seems occi not backward compatible name of dynamic occi lib has version in it. e.g md1sisun26:/tools/oracle/10.2.0.4/lib->dump -lv libocci.so libocci.so: **** dynamic section information **** .dynamic: [index] tag value [1] init 0xc6110 [2] fini 0xc62b8 [3] soname libocci.so.10.1 [4] runpath tld_global [5] rpath tld_global [6] hash 0xe8 [7] strtab 0x10488 [8] strsz 0x1fb42 [9] symtab 0x41e8 [10] syment 0x18 [11] checksum 0x25a3 [12] pltsz 0x4c80 [13] pltrel 0x7 [14] jmprel 0x3c450 [15] rela 0x2ffd0 [16] relasz 0x11100 [17] relaent 0x18 [18] register 0x72 [19] register 0x86 [20] feature_1 parinit [21] flags 0 [22] flags_1 [ dispreldne ] [23] pltgot 0x1eb500 md1sisun26:/tools/oracle/10.2.0.4/lib->ls -lrt libocci.so lrwxrwxrwx 1 oracle 15 aug 10 2010 libocci.so -> libocci.so.10.1* ...

Linux how to start "sftp-server"? -

i'm not familiar there installed openssh/sftp-server (by vendor before) on rhel , running before reboot server. when check after rebooted: # ps aux | grep ftp no sftp running sshd is. so how do have sftp running please? you need add following line /etc/ssh/sshd_config file: subsystem sftp /usr/libexec/openssh/sftp-server or subsystem sftp /usr/lib/openssh/sftp-server

excel data formatting numbers -

my data coming database , populating in excel when data looks 65.90 excel shows 65.9 , if use formatting on facing issue : value 65 , shows 65.00 to maintain leading or trailing zeros, format cells text.

python - Matrix, index out of range -

i've declared matrix following code: matrix = [[' ' x in range(x1)] x in range(y1)] but when try find random element , change it's value following code: randomx = random.randint(0, x) randomy = random.randint(0, y) if matrix[randomx][randomy] == ' ': try: matrix[randomx][randomy] = 'g' scr.addstr(randomx, randomy, matrix[randomx][randomy]) scr.refresh() except indexerror: return i indexerror. tried write garbage code exit function if runs in indexerror. works once, still throws error. note, x1 same x in function. same goes y1 , y. any clue i'm doing wrong? your indices in wrong order. should access them by matrix[randomy][randomx] or change order in comprehension. matrix = [[' ' y in range(y1)] x in range(x1)] also, garrett pointed out in comments, randint() inclusive on both ends might want use randint(0,x-1) , randint(0,y-1) .

android - differentiate between update and inset in SQLite -

in sqlite how can if row exists update else createentry? want have table single row , update whenever single button pressed or so. entry.open(); if(the row exist) entry.updatecontact(1, double.tostring(db1), double.tostring(db2), double.tostring(db3)); else entry.createentry(double.tostring(db1), double.tostring(db2), double.tostring(db3)); entry.close(); sounds want insert or replace . there's blog post on topic @ http://www.buzzingandroid.com/2013/01/sqlite-insert-or-replace-through-contentprovider/

recursion - Recursive transposition cipher C -

i trying intake string of chars , split them recursively in half until char length 2. take char string of 2 , swap char string next it. code below: #include <stdio.h> #include <string.h> void encrypt(char *str, int size); int main(){ char input[8192]; int length; printf("input phrase: "); fgets(input, 8192, stdin); length = strlen(input) -1; printf("length: %d\n", length); encrypt(input, length); printf("encryption: %s\n", input); return 0; } void encrypt(char str[], int size){ int i; int k = size / 2; //encryption code here } some example outputs: sample input: 12345678 sample output: 34127856 sample input: test , often! sample output: aeyrlet sttf!enn aod i'm not asking assignments me. looking nudge in right direction having tough time wrapping head around how continuously split string swap. op: "i'm not asking assignments me. looking nudge in rig...