Posts

Amazon S3: how to set requests to use virtual host in ruby aws sdk -

currently, sending requests s3 using aws-sdk ruby follow: #!/usr/bin/ruby # require 'aws-sdk' s3 = aws::s3::resource.new(region: 'test', endpoint:'http://10.0.23.45:8081') my_bucket = s3.bucket('test.bucket-name') my_bucket.objects.limit(50).each |obj| puts " #{obj.key} => #{obj.etag}" end but request trying hit url endpoint(virtual hosting): http://test.bucket-name.10.0.23.45:8081 i use path style addressing instead. want request url endpoint like: http://10.0.23.45:8081/test.bucket-name/ any idea how set path style addressing instead of virtual hosting address? thanks. you need set option :virtual_host true according documentation . so in case should work: s3.bucket('10.0.23.45:8081').object('test.bucket-name').public_url(virtual_host: true) #=> "http://10.0.23.45:8081/test.bucket-name/"

c# - Dependant assemblies of different version in a same project -

Image
project structure: as above structure defines havea main application (dlltestapp) , has reference 2 projects app1 , app2. app1 has reference assembly (myassembly v1.0) , app2 has reference same assembly different version (myassembly v2.0) if run project automatically picks latest 'myassembly' v2.0, i.e. under bin/release folder see 1 myassembly file v2.0. hence breaks app1 functionality .. but configure dlltestapp should reference myassembly v1.0 , v2.0 both different folder while building could please help?

javascript - Create a table with required & optional checkbox columns & check-one only columns -

i need create table containing check-boxes few specific needs e-mail feature. (yes, know radio buttons have feature choosing either or, it's not i'm looking have done.) this table has 11 columns , x amount of rows: first column contains e-mail addresses. the second blank dividing rest of purpose, maybe button, etc. the next columns filled check-boxes in 4 have special requirements: columns 4 & 5 can have 1 or other check-box ticked in (i.e. if column 4 has check, column 5 unchecked , vice versa). code have found here works, option remains checked; not allowing user not choose between two. columns 8 & 9 optional/required check-boxes (i.e. if column 9 checked, column 8. however, column 8 can checked without column 9 checked. i've gotten other code section of page (with similar requirements, not in table) might worth making table's code bit more flexible include entire page other single instances of check-boxes. i've made jsbin of i...

android - Use a drawable in rate app dialog -

i have dialog pop rate app , on dialog android icon. what want able chose drawable instead of system icon have app icon in place! first time in using rate app dialog apologies if basic question me tough one, think should need 1 section of code icon if require full class can post that. builder.setmessage(message) .settitle("rate " + app_title) .seticon(context.getapplicationinfo().icon) .setcancelable(false) you can pass resource id of app icon drawable , example: builder.setmessage(message) .settitle("rate " + app_title) .seticon(r.drawable.app_logo) .setcancelable(false); in case app_logo can drawable having app icon.

shell - Does PHP support process substitution? -

i've trying following examples such as: $ php -r 'require_once($argv[1]);' <(echo "hello") or: $ php -r 'file_get_contents($argv[1]);' <(echo "hello") both fails like: php warning: require_once(/dev/fd/63): failed open stream: no such file or directory in command line code on line 1 php warning: file_get_contents(/dev/fd/63): failed open stream: no such file or directory in command line code on line 1 or: $ php -r 'file_get_contents($argv[0]);' < <(echo "hello") which fails with: php fatal error: require_once(): failed opening required '-' (include_path='.:/usr/share/pear:/usr/share/php') in command line code on line 1 the above attempts inspired drush command, example: $ drush --early=<(echo print 123';') "" [warning] require_once(/dev/fd/63): failed open stream: no such file or directory preflight.inc:58 where inject dynamic php code...

Escaping (, round brackets sybase SQL -

i working sybase sql , want exclude entries this: (not present) so tried using: select col table col not '(%)' do guys know happening? think need escap ( somehow, not know how. following returns error: select col table col not '\(%\)' escape '\' kind regards you might find helpful sybase event stream processor 5.0 ccl programmers guide - string functions like() scalar. determines whether given string matches specified pattern string. syntax like ( string, pattern ) parameters string string. pattern pattern of characters, string. can contain wildcards. usage determines whether string matches pattern string. function returns 1 if string matches pattern, , 0 otherwise. pattern argument can contain wildcards: '_' matches single arbitrary character, , '%' matches 0 or more arbitrary characters. function takes in 2 strings arguments, , returns integer. note: in sql...

java - Hibernate, how to build query joining multiple tables at runtime -

i have 1 parent table , many children tables (say 5). based on input parameter, choose number of children tables parent fetch result. joining number of children tables parent table decide on run time parameter. number of table joined in query may 1 5. implement using hibernate orm, please suggest me better approaches achieve it. thank in advance.