Posts

Showing posts from March, 2012

pyexiv2 with homebrew python 2.7.4 -

i have installed python (2.7.4) brew on macbook pro (10.7.5). installed exiv2 , pyexiv2 brew. when import pyexiv2 python interpreter, got following error : fatal python error: interpreter not initialized (version mismatch?) what should correct (considering not want remove brewed python suggested in thread: how install python library pyexiv2 , gexiv2 on osx 10.6.8? ) thanks lot advice ! after searching , looking @ few complicated solutions across web, found simple method solve problem, in homebrew wiki itself ! the root of problem boost dependency library, default links system python , not brewed python, wiki : note e.g. the boost bottle built against system python , should brewed source make work brewed python. can happen when both python executables same version (e.g. 2.7.2). explanation python packages c-extensions (those have .so files) compiled against python binary/library may have been built different arch (e.g. apple's python still not pure 64bit)

c# - What is meaning of multiply a table to self and get one field? -

this source code of webmatrix.webdata.simplemembershipprovider.gethashedpassword : private string gethashedpassword(idatabase db, int userid) { var pwdquery = db.query(@"select m.[password] " + @"from " + membershiptablename + " m, " + safeusertablename + " u " + @"where m.userid = " + userid + " , m.userid = u." + safeuseridcolumn).tolist(); // review: should 1 match, should throw if > 1? if (pwdquery.count != 1) { return null; } return pwdquery[0].password; } you can find on http://aspnetwebstack.codeplex.com/sourcecontrol/latest#src/webmatrix.webdata/simplemembershipprovider.cs and .net reflector check webmatrix.webdata.dll if check code, can see user table multiply self , password field running quer

java - Exception in reading a binary file -

i getting exception. because not catching them? java.io.eofexception @ java.io.objectinputstream$blockdatainputstream.peekbyte(objectinputstream.java:2577) @ java.io.objectinputstream.readobject0(objectinputstream.java:1315) @ java.io.objectinputstream.readobject(objectinputstream.java:369) @ readstudentrecord.readrecord(readstudentrecord.java:34) @ readstudentrecordtest.main(readstudentrecordtest.java:15) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:601) @ com.intellij.rt.execution.application.appmain.main(appmain.java:120) this class reads binary file: import java.io.*; public class readstudentrecord { private objectinputstream input; public void openfile() { try { input = new objectinputstream(new fileinputstream("student.

SQL Query with LEFT JOIN Issue -

i having problems left join sql query can't see why isn't working. have 3 tables: customers, purchases , payments, , i'm trying select customers who's total purchases cost less total payments (i.e. have balance greater 0). so far, have following: tables: customers id | name purchases id | customerid | cost payments id | customerid | paymentamount sql query: select a.*, coalesce(b.totalcost , 0) totalcost, coalesce(c.totalpayments , 0) totalpayments, coalesce(b.totalcost , 0) - coalesce(c.totalpayments , 0) balance customers left join (select customerid, sum(cost) totalcost purchases group customer) b on a.id = b.customerid left join (select customerid, sum(paymentamount) totalpayments payments group customerid) c on a.id = c.customerid balance > 0" when run query, error 'unknown column 'balance' in 'where clause'' though have defined balance. any appreciated. thanks! because balance alias given

django - Filtering objects less than 30 days and excluding object's user for a particular object -

i have 2 models called car , review . user can write many reviews car. able filter reviews car . issue i'm facing , want filter reviews belong particular car in less 30 days , excluding user own car. this question support question getting items less month old unable filter reviews belong particular car in less 30 days , excluding user own car. class car(models.model): user = models.foreignkey(user) name = models.charfield(max_length=11) class review(models.model): created = models.datetimefield(auto_now_add=true) user = models.foreignkey(user) review = models.textfield() car = models.foreignkey(car) filter review particular car car = car.objects.get(pk=1) review = review.objects.filter(car=car) filter review particular car retrieves reviews everycar in 30 days don't want . want retrieve reviews in less 30 days particular car , excluding user own car car = car.objects.get(pk=1) datetime import datetime, timedelta last_month = datetim

fadeIn() with jQuery -

i have page can comment on specific item (kind ofdetailpage). want fade comment in jquery. problem fading in. not update post. request.done(function (msg) { if (msg.status == "success") { var comment = msg.comment; var name = msg.name; var update = "<li class='description'>" + comment + "</li><li class='user'>" + name + "</li>"; $("#bug_list ul").prepend(update); $("#bug_list ul li").hide(); $("#bug_list ul li").fadein(update); $("#bug_message").val(""); } }); code on detailpage: <div id="bug_list"> <ul id="listupdates"> <?php if(isset($comment)) $comment->getallcomments($id); ?></ul> </div> my function: public function getallcomments($id) { $db = new db(); $select = "select * tblcomments bug_id =".

objective c - how can i convert NSNumber to CLLocationDistance? -

i have convert nsnumber cllocationdistance comparing them. there formatter that? searched @ internet not find. cllocationdistance double . need this: nsnumber *number = ... // number cllocationdistance distance = ... // distance if (distance == [number doublevalue]) { // equal } keep in mind comparing 2 double values equality can appear fail due inexactness of double values. if (abs(distance - [number doublevalue]) <= dbl_epsilon) { // equal }

rtf - Oracle BI Publisher auto width of excel columns -

when creating bi publisher rdf template in microsoft word, intended output microsoft excel; there way specify table should use auto width columns in excel output. by default, when use bi publisher desktop addin microsoft word; table wizard creates table in word not result in output excel columns in excel sized fit data. users of report have manually size excel columns every time run report. i did try "autofit contents" in microsoft word, didn't work. here go workaround: check part of rtf generates largest number of columns, let's header address , order info uses 4 columns, order items list uses 10. build whole document table 10 columns , many rows needed, including row every text line. fill in text, formulas, , fields cells never merge columns, let is, text exceed cell width excel recognizes there's no input in adjacent cells , displays text/sentences if single merged cell, although keeping interesting part tables in needed cells order. right clic

audio - How to keep playing a sound at a given frequency and volume in Python? -

i have gui program written python+panda3d. want add sound keeps playing during runtime. frequency of sound constant, , volume determined variable , modified time time. what's easiest way implement this? i've searched audio libraries of python, seem complex though desired feature simple. wonder whether there's easier way. thanks. update: program windows. well, there's no available answer yet, let me report own workaround. generate tone @ given frequency tone generator , .wav file. put .wav file @ accessible path. use panda3d's built-in sound function : base = showbase() mysound = base.loader.loadsfx("path/to/the_tone.wav") make keep playing: mysound.setloop(true) mysound.play() to adjust volume, call: mysound.setvolume(0.5) # 0.0~1.0 this solution works perfectly. panda3d.

java - Is serializable inheritable -

is serializable inheritable. particulary if have class implements serializable{} class b extends a{} is class b serializable? yes, subclass of serializable class serializable for more information http://docs.oracle.com/javase/1.5.0/docs/api/java/io/serializable.html http://java.sun.com/developer/technicalarticles/alt/serialization/

java - hadoop: expected org.apache.hadoop.io.LongWritable, received org.apache.hadoop.io.Text -

this question has answer here: hadoop error in execution : type mismatch in key map: expected org.apache.hadoop.io.text, recieved org.apache.hadoop.io.longwritable 1 answer i new hadoop , trying run sample program book. facing error java.io.ioexception: type mismatch in key map: expected org.apache.hadoop.io.longwritable, recieved org.apache.hadoop.io.text please me resolve error. below code import org.apache.hadoop.conf.configuration; import org.apache.hadoop.conf.configured; import org.apache.hadoop.fs.filesystem; import org.apache.hadoop.fs.path; import org.apache.hadoop.io.text; import org.apache.hadoop.mapred.fileinputformat; import org.apache.hadoop.mapred.fileoutputformat; import org.apache.hadoop.mapred.jobclient; import org.apache.hadoop.mapred.jobconf; import org.apache.hadoop.mapred.keyvaluetextinputformat; import org.apache.hadoop.mapred.mapreduceba

Python struct.unpack in delphi -

how use built in python function named: struct.unpack in delphi python do. here example: x = struct.unpack(">h",data[offset:offset+2])[0] >h big endian unsigned 2 byte value. in delphi this: var x: word; data: tbytes; .... x := ntohs(pword(@data[offset])^); let's @ in more detail: data array of bytes , data[offset] value trying unpack. ntohs converts network byte order (big endian) host byte order. since parameter of ntohs word , need treat data[offset] word , hence cast. in order call ntohs you'll need use winsock unit.

PHP - cookies and header location: Cannot modify header information - headers already sent by -

this question has answer here: how fix “headers sent” error in php 11 answers this user log in page. after user enter log in details, want store cookie files , direct user home page. however, keep getting error have tried every possible way solve , have read other questions posted on here nothing did solve problem... missing here? be? <?php //<--- line 4 error messages: warning: cannot modify header information - headers sent (output started @ /www/99k.org/p/h/o/phoneclassmate/htdocs/login.php:4) in /www/99k.org/p/h/o/phoneclassmate/htdocs/login.php on line 6 the issue you're trying send http headers (location:) after html code. you should refactor code avoid that; or hack can work around using output buffering, that'll allow modify http headers after started outputting html content. not great way handle problem imho know anyway; see

c# - Setting an alias on the .net Portable Subset library -

i'm using nuget package microsoft.net.http add httpclient pcl domain library. i want set custom network credential, can't because of error: code : httpclienthandler handler = new httpclienthandler(); icredentials credentials = new networkcredential("username", "password", "domain"); handler.credentials = credentials; _client = new httpclient(handler); error : error 5 cannot implicitly convert type 'system.net.icredentials [c:\program files (x86)\reference assemblies\microsoft\framework.netportable\v4.5\profile\profile78\system.net.primitives.dll]' 'system.net.icredentials' c:[truncated]\apiclient.cs 26 35 deltekapi the issue networkcredentials i'm providing implement nuget added implementation of icredentials , , interface httpclient wants pcl .net portable subset version. can't think of way of fixing this? this sounds bug had if install vs 2012 update 2 after wp8 sdk. run repair o

acra - Android app bug reporting -

i aware there many bug reporting tools, such acra , can generate content-rich crash reports. but question is: possible identify bugs don't cause crash? example, got user feedback app: images low quality, zoom in blurry pixelation because don't load full sized image. this bug doesn't cause crash; in case, how can catch them improve app? because if user doesn't complain, unaware of problem. you can't. need way in code detect , send event. google analytics, example, allows send custom events analytics , still have generated code: public void loadimagetoview(imageview iv) { if (/* criteria */) mytracker.sendevent("bug_report", "image_load", "failed", /* optional value */); // ... } you add feature in app allows user feedback send device information well, think that's best can do. there no way auto-detect bugs in app. further reading: google analytics android sdk tracking user behavior go

python - TypeError: 'module' object is not callable ( when importing selenium ) -

i have problem when running code : >>> selenium import webdriver >>> driver = webdriver.firefox() traceback (most recent call last): file "<pyshell#19>", line 1, in <module> driver = webdriver.firefox() typeerror: 'module' object not callable i have searched problem , got results. unfortunately , didn't work. , how can solve this? thanks. you have made typo. webdriver.firefox() note capital f.

javascript - Loading .js files on client side with page served by Node JS -

i have following simple js file, familiar who's used socket.io nodejs , express framework: var express = require('express'), app = express(), server = require('http').createserver(app), io = require('socket.io').listen(server); server.listen(8374); // routing app.get('/', function (req, res) { res.sendfile(__dirname + '/index.html'); }); in index.html , have following line of code: <script src="/socket.io/socket.io.js"></script> i have done experimenting pathnames , serving/mounting , still don't understand how client-side line manages work. answer this question says listening server , io handles incoming socket.io requests. ... my question is: can done other client-side js files? for example, there easy way bundle jquery can handled in same way? @ moment can put file in folder public , use express' app.use() method in index.html can include line: <script src="

ruby - How can I extract part of a string that is in quotes -

say have string: foo = "this string 'with string inside it!'" how extract 'with string inside it!' foo ? foo = "this string 'with string inside it!'" foo[foo.index("'")..foo.rindex("'")] #=> "'with string inside it!'"

networking - Issue receiving and storing data in C++ -

i have written server application in c++ receives packet of data client application (which have not written myself) , prints data console. issue is, when try receive , store entire packet body @ once, data stored incorrectly, when packet body received , stored using multiple callings of recv(), store correctly. regarding endianness, client , server both running on little endian machine, client sends data out little endian, , server reads without need conversion. this packet client application sends server application: 00 03 23 00 57 6f 57 00 01 0c 01 f3 16 36 38 78 00 6e 69 57 00 42 47 6e 65 00 00 00 00 7f 00 00 01 05 41 44 4d 49 4e here structured view of packet: cmd 00 error 03 pkt_size 23 00 gamename 57 6f 57 00 version1 01 version2 0c version3 01 build f3 16 platform 36 38 78 00 os 6e 69 57 00 country 42 47 6e 65 timezone_bias 00 00 00 00 ip 7f 00 00 01 srp_

python - Django caching - Pickle is slow -

working on optimization of 1 web-site, found, pickling of querysets becomes bottleneck in caching, , no matter how clever code be, unpickling of relatively large qs in time of 1-2secs kill effort. encountered this? if using pickle, might recommend cpickle purported 1000 times faster.

python - How can one optimize this MySQL count algorithm? -

i have 2 tables; 1 users , other records user actions. want count number of actions per user , record in users table. there ~100k user , following code takes 6 hours! there must better way! def calculate_invites(): sql_db.execute("select id, uid users") row in sql_db: id = row['id'] uid = row['uid'] sql1 = "select count(1) actions uid = %s" sql_db.execute(sql1, uid) count_actions = sql_db.fetchone()["count(1)"] sql = "update users set count_actions=%s uid=%s" sql_db.execute(sql, (count_actions, uid)) you can 1 statement: update users set count_actons = (select count(*) actions a.uid = users.uid) no loop. no multiple queries. in sql can in sql. looping on rows want in database rather in application.

c++ - Why do I always get default values when passing positional arguments? -

i'm trying familiarize myself boost::program_options , , i'm running problem positional arguments. here's main function, set options passed through command line. please note po namespace alias boost::program_options . int main(int argc, char** argv) { int retval = success; try { // define , parse program options po::options_description desc("options"); desc.add_options() ("help", "print messages") ("mode,m", po::value<std::string>()->default_value("ecb"), "cipher mode of operation") ("keyfile,f", po::value<bool>(), "use keyfile") ("key,k", po::value<std::string>(), "ascii key") ("infile", po::value<std::string>()->default_value("plaintext.txt"), "input file") ("outfile", po::value<std::string>()-

c# - Find all lines that contains given string -

system.io.streamreader file = new system.io.streamreader(@"data.txt"); list<string> spec= new list<string>(); while (file.endofstream != true) { string s = file.readline(); match m = regex.match(s, "spec\\s"); if (m.success) { int = convert.toint16(s.length); = - 5; string part = s.substring(5, a); spec.add(part); } } i'm trying lines contains word "spec" , space character error when run program. the details of exception follows: an unhandled exception of type 'system.argumentoutofrangeexception' occurred in mscorlib.dll could assist me on figuring out why? text file: id 560 spec ... bla bla blah... blah... bla bla bla category other price $259.95 id 561 spec more blah blah... blah... blah... bla bla bla category other price $229.95 system.io.streamreader file = new system.io.streamreader("data.txt"); list<string>

android - AsyncTask creation causes crash -

having issues custom class extends asynctask. app targeting android 4.0.3 , below code works fine 30+ people testing it. there 2 users seeing app crash when call new asyncrequest below. i've got working logger recording text file on users storage , doesn't record entry in asyncrequest constructor. have assume crash happening before constructor called. one of 2 devices experiencing crash running android 4.0.4 apparently. not sure other device running. unfortunately dont' have access 2 devices can't see logcat output. any input why object creation causing crash appreciated. string url = "www.google.com"; new asyncrequest(callback, context).executeonexecutor(asynctask.thread_pool_executor, url); and here full asyncrequest class public class asyncrequest extends asynctask<string, string, string>{ httpurlconnection connection; inputstream instream; iapicallback callback; context context_; public asyncrequest(iapicallback callback, context c

linux - should socket be set NON-BLOCKING before it is polled by select()? -

i have memory when want use select() on socket descriptor, socket should set nonblocking in advance. but today, read source file there seems no lines set socket non-blocking memory correct or not? thanks! duskwuff has right idea when says in general, not need set socket non-blocking use in select(). this true if kernel posix compliant regard select(). unfortunately, people use linux, not, linux select() man page says: under linux, select() may report socket file descriptor "ready reading", while nevertheless subsequent read blocks. example happen when data has arrived upon examination has wrong checksum , discarded. there may other circumstances in file descriptor spuriously reported ready. may safer use o_nonblock on sockets should not block. there discussion of on lkml on or sat, 18 jun 2011. 1 kernel hacker tried justify non posix compliance. honor posix when it's convenient , desecrate when it's not. he argued "

ollydbg - Code\Data segment overlaping -

when @ registers window in olly see both code segment , data segment registers span the whole memory space. mean overlap each other ? when @ memory map seems populated both code areas , data areas. thank you on win32 segment registers go 0 0xffffffff. so, yes, overlap. example freely exchange segment registers in code (but opcode instruction gets bigger because of prefix). one exception fs register. set differently each thread in process , can used locate thread information block . windows uses memory protection try keep data , code savely apart. if @ memory map, see memory blocks have "e" (execute protection) in "access" column. code , has no "w" (write protection).

c# - SELECT query using SqlParameter isn't working -

i'm working on select query sql in c#. trying use sqlparameter , when debug, throw exception: must declare scalar variable "@p1". i'm passing values in via textbox properties in class customer . in event handler: var newcustomer = new customer(); newcustomer.firstname = textboxfirstname.text; newcustomer.lastname = textboxlastname.text; newcustomer.address = textboxaddress.text; newcustomer.city = textboxcity.text; newcustomer.state = textboxstate.text; newcustomer.zip = int32.parse(textboxzip.text); newcustomer.phone = int64.parse(textboxphone1.text); newcustomer.notes = textboxnotes.text; var crochetdatahandler = new crochetdatahandler(); crochetdatahandler.insertnewcustomer(newcustomer); and method i'm calling: public void insertnewcustomer(customer customer) { var insertcustomerstring = "insert customer1 (firstname, lastname, address, city, state, zip, phone, notes) values (@p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8)"; sq

language agnostic - Fully correct Unicode visual string reversal -

[inspired largely trying explain problems character encoding independent character swap , these other questions neither of contain complete answer: how reverse unicode string , how reversed string (unicode safe)] doing visual string reversal in unicode harder looks. in storage format other utf-32 have pay attention codepoint boundaries rather going byte-by-byte. that's not enough, because of combining glyphs; spec has concept of "grapheme cluster" that's closer basic unit want reversing. that's still not enough; there sorts of special case characters, bidi overrides , final forms, have fixed up. this pseudo-algorithm handles easy cases know about: segment string alternating list of words , word-separators (some word-separators may empty string) reverse order of list. for each string in list: segment string grapheme clusters. reverse order of grapheme clusters. check initial , final cluster in reversed sequence; base characters m

java - How to remove a string from an arraylist randomly -

so program supposed user inputs name text box , presses button add array displayed onto text area. thing can't figure out how take away name arraylist randomly. noob programmer. here have far. random r = new random(); arraylist <string> names = new arraylist<string>(); private void btnaddactionperformed(java.awt.event.actionevent evt) { names.add(txtadd.gettext()); txtdisplay.settext("" + names); } names.remove(r.nextint(names.size()));

concurrency - Are map() and reduce() appropriate for concurrent processing in Go? -

coming python background, , starting go, found myself looking equivalent of map() , reduce() functions in go. didn't find them, fell on loops. example, used instead of map(), mapfunction defined elsewhere: data := make([]byte, 1024) count, err := input.read(data) // error handling removed snippet i:=0; i<count; i++ { data[i] = mapfunction(data[i]) } and used instead of reduce(), there 2 state variables i'm using keep track of quoting of fields in csv code moves through each item in slice: data := make([]byte, 1024) count, err := input.read(data) // error handling removed snippet i:=0; i<count; i++ { data[i], statevariable1, statevariable2 = reducefunction(data[i], statevariable1, statevariable2) } here questions: are there builtin capabilties missed? is appropriate use mutable slices each of these? would idea use goroutines map()? allow decoupling of io operation read file , process run mapping function on each item, , therefore allow para

ios - how to do the same button for three screens? -

i have trouble. have avplayer , uibutton play/stop. also: have 3 uiviewcontrollers. need when click on first button on first uiviewcontroller on second controller, third controller button pressed also, respectively, on contrary, too. how make? proposition? it's simple code - push on button - play url stream , when push again stop music. -(ibaction)playradiobutton:(id)sender { if(clicked == 0) { clicked = 1; nslog(@"play"); nsstring *urladdress = @"http://urlradiostream"; nsurl *urlstream = [nsurl urlwithstring:urladdress]; myplayer = [[avplayer alloc] initwithurl:urlstream]; [myplayer play]; [playradiobutton settitle:@"pause" forstate:uicontrolstatenormal]; } else { nslog(@"stop"); [myplayer release]; clicked = 0; [playradiobutton settitle:@"play" forstate:uicontrolstatenormal]; } } if have several contro

java - Line not appearing on JDesktopPane -

Image
i want draw line between 2 jpanels line not appearing on layeredpane. this have done please go through it, compilable.do try , correct code. have tried on drawing lines on internal frames way not working jpanels. package build; import java.awt.basicstroke; import java.awt.borderlayout; import java.awt.color; import java.awt.dimension; import java.awt.eventqueue; import java.awt.graphics; import java.awt.graphics2d; import java.awt.point; import java.awt.event.mouseevent; import java.awt.event.mousemotionadapter; import javax.swing.jframe; import javax.swing.jlayeredpane; import javax.swing.jpanel; import javax.swing.uimanager; import javax.swing.unsupportedlookandfeelexception; import javax.swing.border.lineborder; public class linklayerpane1 { public static void main(string[] args) { new linklayerpane1(); } public linklayerpane1() { eventqueue.invokelater(new runnable() { @override public void run() { tr

html - CSS vertical-align: middle not working -

i'm trying vertically center span or div element within div element. when put vertical-align: middle , nothing happens. i've tried changing display properties of both elements, , nothing seems work. this i'm doing in webpage: .main { height: 72px; vertical-align: middle; border: 1px solid black; padding: 2px; } .inner { vertical-align: middle; border: 1px solid red; } .second { border: 1px solid blue; } <div class="main"> <div class="inner"> box should centered in larger box <div class="second">another box in here</div> </div> </div> here jsfiddle of implementation showing doesn't work: http://jsfiddle.net/gzxwc/ this seems best way - time has passed since original post , should done now: http://jsfiddle.net/m3ykdyds/200 /* css file */ .main { display: table; } .inner { border: 1px solid #000000;

c++ - Vector Public in Class - Can't Use in Implementation? -

here's situation. have class in have defined vector publicly, below: class trackobjects { public: vector<movingobj> movingobjects; ... etc. it has constructor , everything. have separate .cpp file implementations i'm trying use vector , methods on vector. 1 example, it's part of condition in function so: if (movingobjects.locx >= x1) ... etc. it tells me movingobjects undeclared, , first use function. it's not function, , knowledge, haven't called one/tried use one. can suggest why might getting error? edit: locx public variable in class movingobj. trackobj class creates vector objects movingobj creates. sorry, should've specified that. so: class movingobj { public: movingobj(int inid, int inlocx, int inlocy, int inwidth, int inheight); int id, locx, locy,width,height; based on telling us, proper way access locx along lines of: trackobjects objs; objs.movingobjects[15].locx = 123.45; or, maybe: if(obj

Delete drop down when it is blank using Javascript or Jquery -

is possible write javascript function delete drop down when blank? <form name="myform" method="post" enctype="multipart/form-data" action="" id="myform"> <div> <label id="question1">1) draw recognizable shapes</label> <br /> <input type="radio" value="yes" id="question1_0" name="question1_0" /> yes <input type="radio" value="no" id="question1_1" name="question1_1" /> no </div> <div> <label id="question2">2) competently cut paper </label> <br /> <input type="radio" value="yes" id="question2_0" name="question2_0" /> yes <input type="radio" value="no" id="question2_1" name="question2_1" /> no </div> <div> <label

mocking - Is it possible to mock classes that only expose Factory constructors? -

recently had need mock timer class in test. turned out issue because timer doesnt have public default constructors because uses factory constructors. possible mock classes dont have public default constructor? every dart class has implicit interface. can implement timer , mock class way.

vb.net - Error occurred while connecting/creating automation server for ClassLibrary1.classname -

i built dll visual basic 2010 express. it's built on vb 4.0 framework. after building, ran on admin command prompt: c:\windows\...v4.0.30319\regasm c:\...\bin\release\classlibrary1.dll the com-visible check box checked. other program can't connect it, error message mentioned in title. the class library contains 1 class. it's in smscomms.vb: imports system imports system.threading imports system.componentmodel imports system.io.ports public class smscomms private withevents smsport serialport private smsthread thread private readthread thread shared _readport boolean = false public event sending(byval done boolean) public event datareceived(byval message string) public sub new() end sub public sub initport(byval commport string) smsport = new serialport smsport .portname = commport .baudrate = 19200 .parity = parity.none .databits = 8 .stopbits = stopbits.one .handshake = handshake.requesttosend

cgi - Python deadlock error - Trying to retrieve key value from shelve -

here code updating record in shelve def updaterecord(db, form): if not 'key' in form: fields = dict.fromkeys(fieldnames, '?') fields['key'] = 'missing key input' else: key = form['key'].value if key in db: record = db[key] else: person import person record = person(name='?',age='?') field in fieldnames: setattr(record, field, eval(form[field].value)) db[key] = record fields = record.__dict__ fields['key'] = key return fields when trying retrieve value shelve getting error >>> import shelve >>> db = shelve.open('class-shelve') >>> db['sue'].name traceback (most recent call last): file "<stdin>", line 1, in <module> file "/usr/lib/python2.7/shelve.py", line 121, in __getitem__ f = stringio(self.dict[key]

jsf - Unable to resolve org.eclipse.persistence.exceptions.EntityManagerSetupException -

i trying run maven project, able deploy project after deploying project when click function perform operation shows following exception: root cause: exception [eclipselink-28013] (eclipse persistence services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.entitymanagersetupexception exception description: attempted deploy persistenceunit [dbunit] while being in wrong state [deployfailed]. close factories persistenceunit. i have tried redeploying , restarting glassfish not resolve issue. more information posting persistence.xml file , server log persistence.xml <?xml version="1.0" encoding="utf-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0"> <