Posts

What encoding is this, and better yet, how do i decode it in ruby -

@string = "\x16\x03\x01\x00\x91\x01\x00\x00\x8d\x03\x01li.\e\x8f|\x06\f\xa2tu\xc8ww\xcf\x87g2o,98\xec\xadmm h\xb4\x0e-g\x00\x00h\xc0\n\xc0\x14\x00\x88\x00\x87\x009\x008\xc0\x0f\xc0\x05\x00\x84\x005\xc0\a\xc0\t\xc0\x11\xc0\x13\x00e\x00d\x00f\x003\x002\xc0\f\xc0\x0e\xc0\x02\xc0\x04\x00\x96\x00a\x00\x04\x00\x05\x00/\xc0\b\xc0\x12\x00\x16\x00\x13\xc0\r\xc0\x03\xfe\xff\x00\n\x02\x01\x00\x00\e\xff\x01\x00\x01\x00\x00\n\x00\b\x00\x06\x00\x17\x00\x18\x00\x19\x00\v\x00\x02\x01\x00\x00#\x00\x00" it turned out attempting connect server wss:// instead of ws:// trying read encrypted packet. packet in whatever format secure web sockets in. thanks every one.

OOP class design, Is this design inherently 'anti' OOP? -

i remember when ms released forum sample application, design of application this: /classes/user.cs /classes/post.cs ... /users.cs /posts.cs so classes folder had class i.e. properties , getters/setters. users.cs, post.cs, etc. have actual methods access data access layer, posts.cs might like: public class posts { public static post getpostbyid(int postid) { sqldataprovider dp = new sqldataprovider(); return dp.getpostbyid(postid); } } another more traditional route put of methods in posts.cs class definition (post.cs). splitting things 2 files makes more procedural doesn't it? isn't breaking oop rules since taking behavior out of class , putting class definition? if every method static call straight data source, "posts" class factory. put static methods in "posts" "post" class (this how csla works), still factory methods. i more modern , accurate name "posts" class "postfactor...

postgresql - Getting "Access is denied" error when executing pg_dump on Windows -

i'm trying execute pg_dump 1 of postgresql databases, having permission problems. c:\windows\system32>pg_dump -u postgres -p 1863 -o social_sense > c:\\program files\\postgresql\\8.4\\data\\social_sense.sql getting following error: access denied can enlighten? i apologise taking time. due there no write permission directory writing to.

java - How to force use of specific XML parser -

i have xerces , oracle xml parsers both in application's classpath (don't ask why). when create new javax.xml.parsers.documentbuilderfactory , classloader automatically picks oracle xml parser. however, it's not full/proper implementation, it's giving me headaches. is there way can force/tell classloader use xerces parces when constructing document builder factory? documentbuilderfactory has newinstance() method can specify class name of implementation want use.

gis - How to calculate coordinates of center of image from an aerial camera whose FOV, attitude and position are given -

i have problem involves uav flying camera mounted below it. following information provided: gps location of uav in lat/long gps height of uav in meters attitude of uav i.e. roll, pitch, , yaw in degrees field of view (fov) of camera in degrees elevation of camera w.r.t uav in degrees azimuth of camera w.r.t uav in degrees i have some images taken camera during flight , task compute locations (in lat/long) of 4 corners points , center points of image image can placed on map @ proper location. i found document while searching internet can downloaded @ following link: http://www.siaa.asn.au/get/2411853249.pdf my maths background weak not able translate document working solution. can provide me solution problem in form of simple algorithm or preferable in form of code of programming language? thanks. as see, not related image-processing, because need determine coordinates of center of image (you not need fov). have find intersection of camera principa...

Javascript: How to have value in string represented by %s and then replaced with a value -

i know stupid question. i've had few years experience javascript 1 thing seems have skipped mind, head has gone blank , can't remember it's called , how go doing it. basically i'm looking when have string variable such as: var error_message = "an account exists email: %s" and pass string somehow , replaces %s. i sound idiotic, i'd appreciate / reminding! thanks guys. you use replace method: error_message = error_message.replace('%s', email); this replace first occurance, if want replace multiple occurances, use regular expression can specify global (g) flag: error_message = error_message.replace(/%s/g, email);

hashtable - Efficient bidirectional hash table in Python? -

python dict useful datastructure: d = {'a': 1, 'b': 2} d['a'] # 1 sometimes you'd index values. d[1] # 'a' which efficient way implement datastructure? official recommend way it? thanks! here class bidirectional dict , inspired finding key value in python dictionary , modified allow following 2) , 3). note : 1) inverse directory bd.inverse auto-updates when standard dict bd modified 2) inverse directory bd.inverse[value] list of key such bd[key] == value 3) unlike bidict module https://pypi.python.org/pypi/bidict , here can have 2 keys having same value, very important . code: class bidict(dict): def __init__(self, *args, **kwargs): super(bidict, self).__init__(*args, **kwargs) self.inverse = {} key, value in self.iteritems(): self.inverse.setdefault(value,[]).append(key) def __setitem__(self, key, value): if key in self: self.inverse[self[k...