Daily Archives

Articles indexed Monday March 15 2010

Page 2/125 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Weird bug in 'tar' not including files named .__init__.py

    - by Sridhar Ratnakumar
    Does anyone know why tar is not including files named .__init__.py (note the dot)? $ mkdir /tmp/work && cd /tmp/work $ mkdir foo $ touch foo/.__init__.py $ touch foo/.namespace__init__.py $ tar czf foo.tar.gz foo $ mkdir e && mv foo.tar.gz e/ && cd e/ $ tar zxf foo.tar.gz $ ls -al foo/ total 0 drwxr-xr-x 2 sridharr wheel 102 14 Mar 17:16 . drwxr-xr-x 3 sridharr wheel 136 14 Mar 17:17 .. -rw-r--r-- 1 sridharr wheel 0 14 Mar 17:16 .namespace__init__.py $ $ echo ".__init__.py file is missing. WTF? This is OSX 10.6"

    Read the article

  • Excanvas does not work in IE8 at all

    - by Matt Null
    I simply cannot get excanvas to work at all. I have tried everything I can think of. I am even uploading the examples that come with excanvas to my website and testing them and they do not even work. I don't know if it has something to do with my server or what, but I haven't seen a working excanvas image yet. for instance... I this example comes with the excanvas package and it does not work for me... does anyone know what this could possibly be? thanks http://www.javascriptkids.com/tools/excanvas/examples/example1.html

    Read the article

  • How do I get AutoMapper to map this?

    - by Randy Minder
    Say I have this class: public class Account { public int AccountID { get; set; } public Enterprise Enterprise { get; set; } public List<User> UserList { get; set; } } When I use AutoMapper to map the Account class, I would also like it to map the Enterprise class, and the list of users (UserList) in the returned object. How can I get AutoMapper to do this? Thanks!

    Read the article

  • Python sock.listen(...)

    - by Ian
    All the examples I've seen of sock.listen(5) in the python documentation suggest I should set the max backlog number to be 5. This is causing a problem for my app since I'm expecting some very high volume (many concurrent connections). I set it to 200 and haven't seen any problems on my system, but was wondering how high I can set it before it causes problems.. Anyone know?

    Read the article

  • validates_uniqueness_of with HABTM relationship

    - by jeffshantz
    I've got a HABTM relationship between two models: Publication and Author. I want to ensure that one cannot create a publication with the same title, year, and author list. However, if I try something like this: class Publication < ActiveRecord::Base validates_uniqueness_of :title, :scope => [:year, :authors] end This obviously won't work since there is no authors column. Can this be done with validates_uniqueness_of, or do I need a custom validator? Thank you.

    Read the article

  • php json jquery and select box

    - by user253530
    I have this php code $jsonArray = array(); $sql = "SELECT ID,CLIENT FROM PLD_SERVERS"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { $jsonArray[] = array('id'=>$row['ID'],'client'=>$row['CLIENT']); } echo json_encode($jsonArray); And this js function autosearchLoadServers() { $.post("php/autosearch-load-servers.php",function(data){ var toAppend = ""; for(var i = 0; i < data.length; i++){ toAppend += '<option value = \"' + data[i].id + '\">' + data[i].client + '</option>'; } $("#serverSelect").empty(); $("#serverSelect").html(toAppend); }); } The problem is that i get only undefined values. How can this be? The values are in the JSON, i checked using firebug in mozilla so there has to be something with the data variable but i can't understand what. I tried different ways and no results.

    Read the article

  • PyQt4 Custom Widgets

    - by Frank E.
    Are there any good PyQt4 custom widgets like at Qt-Apps.org? I would like to start making PyQt custom widgets but online resources that I find don't seem to be clear For example, Trolltech's and Zetcode's don't seem to be related in any way at all. Thanks for any input :)

    Read the article

  • Python Socket Getting Connection Reset

    - by Ian
    I created a threaded socket listener that stores newly accepted connections in a queue. The socket threads then read from the queue and respond. For some reason, when doing benchmarking with 'ab' (apache benchmark) using a concurrency of 2 or more, I always get a connection reset before it's able to complete the benchmark (this is taking place locally, so there's no external connection issue). class server: _ip = '' _port = 8888 def __init__(self, ip=None, port=None): if ip is not None: self._ip = ip if port is not None: self._port = port self.server_listener(self._ip, self._port) def now(self): return time.ctime(time.time()) def http_responder(self, conn, addr): httpobj = http_builder() httpobj.header('HTTP/1.1 200 OK') httpobj.header('Content-Type: text/html; charset=UTF-8') httpobj.header('Connection: close') httpobj.body("Everything looks good") data = httpobj.generate() sent = conn.sendall(data) def http_thread(self, id): self.log("THREAD %d: Starting Up..." % id) while True: conn, addr = self.q.get() ip, port = addr self.log("THREAD %d: responding to request: %s:%s - %s" % (id, ip, port, self.now())) self.http_responder(conn, addr) self.q.task_done() conn.close() def server_listener(self, host, port): self.q = Queue.Queue(0) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.bind( (host, port) ) sock.listen(5) for i in xrange(4): #thread count thread.start_new(self.http_thread, (i+1, )) while True: self.q.put(sock.accept()) sock.close() server('', 9999) When running the benchmark, I get totally random numbers of good requests before it errors out, usually between 4 and 500. Edit: Took me a while to figure it out, but the problem was in sock.listen(5). Because I was using apache benchmark with a higher concurrency (5 and up) it was causing the backlog of connections to pile up, at which point the connections started getting dropped by the socket.

    Read the article

  • Resolving html entities with NSXMLParse on iPhone

    - by Roberto
    Hi all, i think i read every single web page relating to this problem but i still cannot find a solution to it, so here i am. I have an HTML web page wich is not under my control and i need to parse it from my iPhone application. Here it is a sample of the web page i'm talking about: <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> </HEAD> <BODY> <LI class="bye bye" rel="hello 1"> <H5 class="onlytext"> <A name="morning_part">morning</A> </H5> <DIV class="mydiv"> <SPAN class="myclass">something about you</SPAN> <SPAN class="anotherclass"> <A href="http://www.google.it">Bye Bye &egrave; un saluto</A> </SPAN> </DIV> </LI> </BODY> </HTML> I'm using NSXMLParser and it is going well till it find the è html entity. It calls foundCharacters: for "Bye Bye" and then it calls resolveExternalEntityName:systemID:: with an entityName of "egrave". In this method i'm just returning the character "è" trasformed in an NSData, the foundCharacters is called again adding the string "è" to the previous one "Bye Bye " and then the parser raise the NSXMLParserUndeclaredEntityError error. I have no DTD and i cannot change the html file i'm parsing. Do you have any ideas on this problem? Thanks in advance to all of you, Rob. Update (12/03/2010). After the suggestion of Griffo i ended up with something like this: data = [self replaceHtmlEntities:data]; NSXMLParser *parser = [[NSXMLParser alloc] initWithData:data]; [parser setDelegate:self]; [parser parse]; where replaceHtmlEntities:(NSData *) is something like this: - (NSData *)replaceHtmlEntities:(NSData *)data { NSString *htmlCode = [[NSString alloc] initWithData:data encoding:NSISOLatin1StringEncoding]; NSMutableString *temp = [NSMutableString stringWithString:htmlCode]; [temp replaceOccurrencesOfString:@"&amp;" withString:@"&" options:NSLiteralSearch range:NSMakeRange(0, [temp length])]; [temp replaceOccurrencesOfString:@"&nbsp;" withString:@" " options:NSLiteralSearch range:NSMakeRange(0, [temp length])]; ... [temp replaceOccurrencesOfString:@"&Agrave;" withString:@"À" options:NSLiteralSearch range:NSMakeRange(0, [temp length])]; NSData *finalData = [temp dataUsingEncoding:NSISOLatin1StringEncoding]; return finalData; } But i am still looking the best way to solve this problem. I will try TouchXml in the next days but i still think that there should be a way to do this using NSXMLParser API, so if you know how, feel free to write it here :)

    Read the article

  • Is there some way to access Sql server from z/OS mainframe and have the result in IBM 3270 terminal

    - by systempuntoout
    I tagged this question "impossible" because after a lot of googling, i have not find any trace\reference to a possible answer. I'm asking if there is some way\dirtytrick (possibly cheap) to access Microsoft Sql Server from z/OS mainframe (COBOL programs) and have the result in 3270 terminal emulation; i know that 3270 is a pretty old system, but in bank CED, is still very popular.

    Read the article

  • Stand-alone Bytecode Verifier

    - by HH
    In my bytecode instrumentation project, I stumble frequently on VerifyErrors. However, the default java Verifier gives little information on which instruction resulted in the error (it only gives the method and a small message). Is there any stand-alone bytecode verifier which provides with a little more advanced help in locating the error, at least the precise instruction location? Thank you.

    Read the article

  • Is it possible to cache JSP bytecode to avoid recompiles w/ Tomcat?

    - by Computer Guru
    Hi, Is there any way of caching the bytecode for JSP webapps/ In particular, using Tomcat as the Java servlet? I'm getting really fed up of Tomcat taking up all the CPU for 10 minutes while it compiles 4 different webapps every time I restart it.... I'm already using Jikes to "speed up" the compiles, but it's really killing me. The code does not change unless the webapp is upgraded (very rarely), and I cannot believe that there is no way to cache the compiled java bytecode instead of recompiling it each and every time. I'd appreciate any advice on the matter!

    Read the article

  • getResponseHeader is not a function

    - by zurna
    I need to get a value from another page. But I get this error with the following code. How can I fix it? $(document).ready(function() { $("[name='submit']").click(function() { $.ajax({ type: "POST", data: $(".form-signup").serialize(), url: "external.asp", success: function(output) { alert(output.getResponseHeader("Content-Length"));, error: function(output) { $('.sysMsg').html(output); } }); }); });

    Read the article

  • form validation with jquery

    - by kalpaitch
    I am having some issues with a jQuery form validation pluggin. Below is the code which executes on document.ready() $("#register").validate({ rules: { usernameREG: { required: true, remote: "PHP/checkUsr.php", minlength: 4} fnameREG: { required: true} lnameREG: { required: true} password1REG: { required: true, minlength: 4} password2REG: { equalTo: "#password1REG", required: true} emailREG: { required: true, email: true} telREG: { required: true, rangelength: [9, 13]} } }); Even without the 'rules' parameters this function does not trigger. It also stops all the proceeding jquery functions which are triggered on document.ready()

    Read the article

  • So do programming languages get updated regularly like everyday applications or are they just x.0 re

    - by Randy
    I was wondering if programming languages and frameworks get updated in small increments or are they just x.0 releases? And if they do how do you keep up on all the changes in every update? I am specifically interested in Objective-C and Cocoa and CocoaTouch. I'm learning from books and online PDF's etc, but often they are at best a few years old. I just would like to know if there have been any changes etc. that should concern me and even if not, inevitably there will be, so where can I look out for them?

    Read the article

  • WPF C# how to create THIS binding in code?

    - by 0xDEAD BEEF
    I wonder, how to create this binding, since Line.X2 IS NOT dependency property! :( <Line Y1="0" X1="0" Y2="0" Stroke="Blue" StrokeThickness="3" Margin="0 -2 0 -2" X2="{Binding Path=RenderSize.Width, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type StackPanel}}}"/>

    Read the article

  • Please Critique Code (Java, Java2D, javax.swing.Timer)

    - by Trizicus
    Learn by practice right? Please critique and suggest anything! Thanks :) import java.awt.EventQueue; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import javax.swing.JFrame; public class MainWindow { public static void main(String[] args) { new MainWindow(); } JFrame frame; GraphicsPanel gp = new GraphicsPanel(); MainWindow() { EventQueue.invokeLater(new Runnable() { public void run() { frame = new JFrame("Graphics Practice"); frame.setSize(680, 420); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); gp.addMouseListener(new MouseListener() { public void mouseClicked(MouseEvent e) {} public void mousePressed(MouseEvent e) {} public void mouseReleased(MouseEvent e) {} public void mouseEntered(MouseEvent e) {} public void mouseExited(MouseEvent e) {} }); gp.addMouseMotionListener(new MouseMotionListener() { public void mouseDragged(MouseEvent e) {} public void mouseMoved(MouseEvent e) {} }); frame.add(gp); } }); } } GraphicsPanel: import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JPanel; import javax.swing.Timer; public class GraphicsPanel extends JPanel { Test t; Timer test; GraphicsPanel() { t = new Test(); setLayout(new BorderLayout()); add(t, BorderLayout.CENTER); test = new Timer(17, new Gameloop(this)); test.start(); } class Gameloop implements ActionListener { GraphicsPanel gp; Gameloop(GraphicsPanel gp) { this.gp = gp; } public void actionPerformed(ActionEvent e) { try { t.incX(); gp.repaint(); } catch (Exception ez) { } } } } Test: import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Toolkit; import javax.swing.JComponent; public class Test extends JComponent { Toolkit tk; Image img; int x, y; Test() { tk = Toolkit.getDefaultToolkit(); img = tk.getImage(getClass().getResource("images.jpg")); this.setPreferredSize(new Dimension(15, 15)); } @Override public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D) g.create(); g2d.setColor(Color.red); g2d.drawString("x: " + x, 350, 50); g2d.drawImage(img, x, 80, null); g2d.dispose(); } public void incX() { x++; } }

    Read the article

  • jquery typeWatch with Dynamic input fields added on the fly.

    - by mtyagi
    How can i get the Id of the input field added on the fly? My script adds the input fields on click on the button , using var ix = 1; $(template2(ix++)).appendTo("#dataTable tbody"); var template2 = jQuery.format($("#template2").val()); I also add this , line after the insertion of the new fields, so it adds the typeWatch to all the .email class fields. $(".email").typeWatch( { highlight:true, callback:function(){alert("changed search text"); }, wait:750 } ); now, in the callback function , I want to get the Id of the input field typeWatch Callback is triggered. Please advice. Thanks

    Read the article

  • Benefits of 'Optimize code' option in Visual Studio build

    - by gt
    Much of our C# release code is built with the 'Optimize code' option turned off. I believe this is to allow code built in Release mode to be debugged more easily. Given that we are creating fairly simple desktop software which connects to backend Web Services, (ie. not a particularly processor-intensive application) then what if any sort of performance hit might be expected? And is any particular platform likely to be worse affected? Eg. multi-processor / 64 bit.

    Read the article

  • Display new image on web page

    - by RuiT
    Hello, I'm uploading images to a folder and I want to display each new image on a web page every time it is saved in the folder. I can display the initial image, which is already in the folder, and I can also detect when a new image is saved into the folder but I don't know how to display the new images. I'm new to web development. Can somebody help me? Here's the code: public partial class _Default : System.Web.UI.Page { string DirectoryPath = "C:\\Users\\Desktop\\PhotoUpload\\Uploads\\"; protected void Page_Load(object sender, EventArgs e) { FileSystemWatcher watcher = new FileSystemWatcher(); try { watcher.Path = DirectoryPath; watcher.Created += new FileSystemEventHandler(watcher_Created); watcher.EnableRaisingEvents = true; Image image = Image.FromFile(DirectoryPath + "inicial.jpg"); MemoryStream ms = new MemoryStream(); image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); byte[] im = ms.ToArray(); Context.Response.ContentType = "Image/JPG"; Context.Response.BinaryWrite(im); } catch (Exception ex) { } } void watcher_Created(object sender, FileSystemEventArgs e) { Console.WriteLine("File Created: Name: " + e.Name); try { //How to display new image? } catch (Exception ex) { } } }

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >