Search Results

Search found 365 results on 15 pages for 'fred hamilton'.

Page 8/15 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Finding C++ static initialization order problems

    - by Fred Larson
    We've run into some problems with the static initialization order fiasco, and I'm looking for ways to comb through a whole lot of code to find possible occurrences. Any suggestions on how to do this efficiently? Edit: I'm getting some good answers on how to SOLVE the static initialization order problem, but that's not really my question. I'd like to know how to FIND objects that are subject to this problem. Evan's answer seems to be the best so far in this regard; I don't think we can use valgrind, but we may have memory analysis tools that could perform a similar function. That would catch problems only where the initialization order is wrong for a given build, and the order can change with each build. Perhaps there's a static analysis tool that would catch this. Our platform is IBM XLC/C++ compiler running on AIX.

    Read the article

  • Returning several COUNT results from one ASP SQL statement

    - by user89691
    Say I have a table like this: Field1 Field2 Field3 Field4 fred tom fred harry tom tom dick harry harry and I want to determine what proportion of it has been completed for each field. I can execute: SELECT COUNT (Field1) WHERE (Field1 <> '') AS Field1Count SELECT COUNT (Field2) WHERE (Field2 <> '') AS Field2Count SELECT COUNT (Field3) WHERE (Field3 <> '') AS Field3Count SELECT COUNT (Field4) WHERE (Field4 <> '') AS Field4Count Is it possible to roll up these separate SQL statements into one that will return the 4 results in one hit? Is there any performance advantage to doing so (given that the number of columns and rows may be quite large in practice)?

    Read the article

  • Recommendations for a Hex Viewer Control for Windows.Forms?

    - by Fred F.
    I need ability to display content in Hex View, like this from WinHex Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F 00000000 EF BB BF 0D 0A 4D 69 63 72 6F 73 6F 66 74 20 56 ..Microsoft V 00000010 69 73 75 61 6C 20 53 74 75 64 69 6F 20 53 6F 6C isual Studio Sol 00000020 75 74 69 6F 6E 20 46 69 6C 65 2C 20 46 6F 72 6D ution File, Form 00000030 61 74 20 56 65 72 73 69 6F 6E 20 31 30 2E 30 30 at Version 10.00 00000040 0D 0A 23 20 56 69 73 75 61 6C 20 53 74 75 64 69 ..# Visual Studi 00000050 6F 20 32 30 30 38 0D 0A 50 72 6F 6A 65 63 74 28 o 2008..Project( 00000060 22 7B 46 31 38 34 42 30 38 46 2D 43 38 31 43 2D "{F184B08F-C81C- 00000070 34 35 46 36 2D 41 35 37 46 2D 35 41 42 44 39 39 45F6-A57F-5ABD99 Please recommend a control. Thank you.

    Read the article

  • When is a scala partial function not a partial function?

    - by Fred Haslam
    While creating a map of String to partial functions I ran into unexpected behavior. When I create a partial function as a map element it works fine. When I allocate to a val it invokes instead. Trying to invoke the check generates an error. Is this expected? Am I doing something dumb? Comment out the check() to see the invocation. I am using scala 2.7.7 def PartialFunctionProblem() = { def dream()() = { println("~Dream~"); new Exception().printStackTrace() } val map = scala.collection.mutable.HashMap[String,()=>Unit]() map("dream") = dream() // partial function map("dream")() // invokes as expected val check = dream() // unexpected invocation check() // error: check of type Unit does not take parameters }

    Read the article

  • Are Maybes a good pattern for scala?

    - by Fred Haslam
    For a while I have been struggling to integrate scala with java methods that might return null. I came up with the following utility which helps a lot: // produce an Option, nulls become None object Maybe { def apply[T](t:T) = if (t==null) None else Some(t) } Maybe(javaClass.getResultCouldBeNull()).map( result => doSomeWork(result) ) I have a few questions about this solution: Is there a better or more standard pattern to use? Am I duplicating something that already exists? Does this functionality have hidden gotchas?

    Read the article

  • Extract parts of html using regex

    - by Fred Yang
    I have a simple requirement to extract text in html. Suppose the html is <h1>hello</h1> ... <img moduleType="calendar" /> ...<h2>bye</h2> I want to convert it into three parts <h1>hello</h1> <img moduleType="calendar" /> <h2>bye</h2> The aim is to extract text in two categories, simple html and special tags with <img moduleType="Calender".

    Read the article

  • Owner Vs PArent and Taction shortcuts on Frames

    - by Fred
    I have a form with a panel. I create frames at runtime and display them on the panel by setting frame's parent property to the panel. When creating panels I do not set the owner property because i manage myself the lifetime of the frame. Until now i got no problem. Next I put an TActionList on the frame with some shortcuts on the actions. I found that my actions did not execute until I set the owner property of the frame to the panel. Can someone can explain me that ? I thought that owner property was just about wich component is responsible to free the children components, and not responsible to forward key events.

    Read the article

  • Determine which process (b)locks a file, programmatically (under Windows >= XP)

    - by fred-hh
    How to programmatically determine from a process P, which other process P' has a lock on a file, that prevents P from recreating that file ? I know there are tools to do that, but how do they achieve that ? (Context: a batch program that runs overnight fails because of a locked file. Running an admin tool the next day may be too late to get useful information. So it would be nice if the batch program itself was able to determine the culprit.) EDIT: Added complexity: the file resides on a DFS and P' might not run on the same machine as P (but maybe does). But a solution that works locally would be a good beginning.

    Read the article

  • Javascript callback with AJAX + jQuery

    - by Fred
    Hey! I have this jQuery code (function () { function load_page (pagename) { $.ajax({ url: "/backend/index.php/frontend/pull_page/", type: "POST", data: {page: pagename}, success: function (json) { var parsed = $.parseJSON(json); console.log(parsed); return parsed; }, error: function (error) { $('#content').html('Sorry, there was an error: <br>' + error); return false; } }); } ... var json = load_page(page); console.log(json); if (json == false) { $('body').fadeIn(); } else { document.title = json.pagename + ' | The Other Half | freddum.com'; $("#content").html(json.content); $('#header-navigation-ul a:Contains('+page+')').addClass('nav-selected'); $('body').fadeIn(); } })(); and, guessed it, it doesn't work. The AJAX fires fine, the server returns valid JSON but the console.log(json); returns undefined and the js crashes when it gets to json.pagename. The first console.log(parsed) also returns good data so it's just a problem with the return (I think). I knew I was clutching at straws and would be extremely if this worked, but it doesn't. To be honest, I don't know how to program callback functions for this situation. Any help is greatly appreciated!

    Read the article

  • Open Source 2D Game Engine that supports Hexagon Maps for .NET

    - by Fred F.
    Hello, I cannot find a 2D game engine to create hexagon maps for .net. The best I can find is Xconq (http://sourceforge.net/projects/xconq/) and pygame. Does anybody where I can find any? preferrably one like xconq. Thank you for your time and effort. I really apprecate it. Edit: I would like to have feature of a strategic nature. Like adding custom AIs, path finding, etc. Xcong is an engine for turn-based strategy games.

    Read the article

  • Is it faster to do the pages first and CSS second, or should I do them at the same time?

    - by Fred Haslam
    I have been tasked with building a new web project from scratch, with the exception of reusing CSS files (the look and feel) from an existing project. In the past I have always completed development of the functionality and the web-ui before considering the appearance. This is mostly due to CSS development overlapping with the tail end of the project. I now have the opportunity to integrate a static set of CSS as I build the application. I have no experience with this circumstance. Would it be faster to develop the project and web-pages first, then integrate the CSS; or would it be faster to integrate the CSS as part of page development?

    Read the article

  • entity framework vNext wish list

    - by Fred Yang
    I have been intensively studying and use ef4 in my project. I do feel the improvement that it has over version 1. But I found that I have something I cannot get around easily. Here is a list I want it to be better in ef vNext. the model designer should allow multiple view of the same model, so that I don't need cram all my entity into a single view. respect user's manual edit of edmx. Currently, the some database view object simply can not be imported to the model because the designer "smartly" think that the view does not have a primary key, so that I have to manually edit the edmx to correct designer's behavior. But in the next "update from database" task, designer will revert my customization. For now, I simply fallback to manually edit the edmx file at all, or I have to use compare tool to keep the new update, and rollback and put the new update into my old edmx file manually. Designer should be improved to allow default behavior and user's manual control. I want control not to let the designer refresh the change of imported object. support user defined table function. linq is about Composability, stored proc dos not support composability. I wish I could use user defined table function which support this. What are you wishes for EF vNext?

    Read the article

  • Why do I get a nullpointerexception at line ds.getPort in class L1?

    - by Fred
    import java.awt.; import java.awt.event.; import javax.swing.; import java.io.; import java.net.; import java.util.; public class Draw extends JFrame { /* * Socket stuff */ static String host; static int port; static int localport; DatagramSocket ds; Socket socket; Draw d; Paper p = new Paper(ds); public Draw(int localport, String host, int port) { d = this; this.localport = localport; this.host = host; this.port = port; try { ds = new DatagramSocket(localport); InetAddress ia = InetAddress.getByName(host); System.out.println("Attempting to connect DatagramSocket. Local port " + localport + " , foreign host " + host + ", foreign port " + port + "..."); ds.connect(ia, port); System.out.println("Success, ds.localport: " + ds.getLocalPort() + ", ds.port: " + ds.getPort() + ", address: " + ds.getInetAddress()); Reciever r = new Reciever(ds); r.start(); } catch (Exception e) { e.printStackTrace(); } setDefaultCloseOperation(EXIT_ON_CLOSE); getContentPane().add(p, BorderLayout.CENTER); setSize(640, 480); setVisible(true); } public static void main(String[] args) { int x = 0; for (String s : args){ if (x==0){ localport = Integer.parseInt(s); x++; } else if (x==1){ host = s; x++; } else if (x==2){ port = Integer.parseInt(s); } } Draw d = new Draw(localport, host, port); } } class Paper extends JPanel { DatagramSocket ds; private HashSet hs = new HashSet(); public Paper(DatagramSocket ds) { this.ds=ds; setBackground(Color.white); addMouseListener(new L1(ds)); addMouseMotionListener(new L2()); } public void paintComponent(Graphics g) { super.paintComponent(g); g.setColor(Color.black); Iterator i = hs.iterator(); while(i.hasNext()) { Point p = (Point)i.next(); g.fillOval(p.x, p.y, 2, 2); } } private void addPoint(Point p) { hs.add(p); repaint(); } class L1 extends MouseAdapter { DatagramSocket ds; public L1(DatagramSocket ds){ this.ds=ds; } public void mousePressed(MouseEvent me) { addPoint(me.getPoint()); Point p = me.getPoint(); String message = Integer.toString(p.x) + " " + Integer.toString(p.y); System.out.println(message); try{ byte[] data = message.getBytes("UTF-8"); //InetAddress ia = InetAddress.getByName(ds.host); String convertedMessage = new String(data, "UTF-8"); System.out.println("The converted string is " + convertedMessage); DatagramPacket dp = new DatagramPacket(data, data.length); System.out.println(ds.getPort()); //System.out.println(message); //System.out.println(ds.toString()); //ds.send(dp); /*System.out.println("2Sending a packet containing data: " +data +" to " + ia + ":" + d.port + "...");*/ } catch (Exception e){ e.printStackTrace(); } } } class L2 extends MouseMotionAdapter { public void mouseDragged(MouseEvent me) { addPoint(me.getPoint()); Point p = me.getPoint(); String message = Integer.toString(p.x) + " " + Integer.toString(p.y); //System.out.println(message); } } } class Reciever extends Thread{ DatagramSocket ds; byte[] buffer; Reciever(DatagramSocket ds){ this.ds = ds; buffer = new byte[65507]; } public void run(){ try { DatagramPacket packet = new DatagramPacket(buffer, buffer.length); while(true){ try { ds.receive(packet); String s = new String(packet.getData()); System.out.println(s); } catch (Exception e) { e.printStackTrace(); } } } catch (Exception e) { e.printStackTrace(); } } }

    Read the article

  • how come we need not close the handle returned by ShellExecute ?

    - by fred-hh
    On success, ShellExecute returns a handle. Do we need to close this handle, and if so, how ? According to examples published my Microsoft, we need not close this handle. But the doc of ShellExecute itself is mute on the subject. Can you confirm we indeed do not need to close this handle ? But then, how can a handle be valid and in no need of being closed ??? Which of the following statements is/are true: the handle is invalid and we can't do anything with it; the handle is never freed and there is a (Microsoft-sponsored) memory leak (until the caller program ends); the handle is automatically freed by the system at some time and never reused afterwards (- another kind of resource leak). Only on trying to use it can we know whether it still points to something. what else ?

    Read the article

  • Animating UIImageView iPhone

    - by Fred Dpn
    Hi, i'm having trouble about animating an Image in a UIImageView. I've created an image view in interface builder and linked it to its iboutlet. Here is my code. @interface Game : UIViewController <UIAccelerometerDelegate>{ IBOutlet UIImageView *diying; } @property (nonatomic, retain) UIImageView *diying; In the viewDidLoad method i've written this code NSArray * imageArray = [[NSArray alloc] initWithObjects: [UIImage imageNamed:@"Die1.gif"], [UIImage imageNamed:@"Die2.gif"], [UIImage imageNamed:@"Die3.gif"], [UIImage imageNamed:@"Die4.gif"], nil]; diying.animationImages = imageArray; diying.animationDuration = 1.1; diying.contentMode = UIViewContentModeBottomLeft; [diying startAnimating]; [super viewDidLoad]; which is a adaptation of what i've found here : http://icodeblog.com/2009/07/24/iphone-programming-tutorial-animating-a-game-sprite/ NB : those .gif files are simple images and are not animated. I did the tutorial and it worked fine but i can't figure out why it my adaptation doesn't work !

    Read the article

  • Calling app_code folder from web application project

    - by Fred
    I am developing a module for DotNetNuke and have used a DotNetNuke Compiled Module template to create the module in the DesktopModule folder. I then get a Web Application Project under the DNN website in my Visual Studio 2008. Now I want to use DAL and BLL which are created in DNN app_code folder. But when I add them in code behind it can't find them. How do I tell my Web Application Project to access the app_code folder in the website "projcet"? Thanks in advance!

    Read the article

  • Group partial class shortcut

    - by Fred Yang
    I have to cs file for one partial class. I know that I can modify project file to group them together like way that vs.net group *.aspx and *.aspx.cs, but is there a way to do that in vs.net IDE directly?

    Read the article

  • PLEASE HELP JAVA/SQL question

    - by fred-ghosn
    Hello everyone, well I'm new here and I really need some help.. I want to create a table and this table's name will be inserted from a textfield. However when I run the query it's giving me an error, any help on this one? Ill paste the code here: public boolean CreateTable() { TableNumber=jTextField4.getText(); try { String password = null; String s = "CREATE TABLE '"+TableNumber+'" (Item char(50),Price char(50))"; ConnectionForOrders(); stmt = conn.createStatement(); stmt.executeUpdate(s); boolean f=false; ConnectionForOrdersclose();

    Read the article

  • Problem with SQLite executemany

    - by Strider1066
    I can't find my error in the following code. When it is run a type error is given for line: cur.executemany(sql % itr.next()) = 'function takes exactly 2 arguments (1 given), import sqlite3 con = sqlite3.connect('test.sqlite') cur = con.cursor() cur.execute("create table IF NOT EXISTS fred (dat)") def newSave(className, fields, objData): sets = [] itr = iter(objData) if len(fields) == 1: sets.append( ':' + fields[0]) else: for name in fields: sets.append( ':' + name) if len(sets)== 1: colNames = sets[0] else: colNames = ', '.join(sets) sql = " '''insert into %s (%s) values(%%s)'''," % (className, colNames) print itr.next() cur.executemany(sql % itr.next()) con.commit() if __name__=='__main__': newSave('fred', ['dat'], [{'dat':1}, {'dat':2}, { 'dat':3}, {'dat':4}]) I would appreciate your thoughts.

    Read the article

  • Can a user be a member of multiple Organization Units (OU) in Active Directory ?

    - by Stormshadow
    Can a user be a member of multiple Organization Units (OU) in Active Directory ? Also, is there a standard format mentioned by Microsoft on how an OU should be created and what its attributes are ? I found this in Wikipedia "However, Organizational Units are just an abstraction for the administrator, and do not function as true containers; the underlying domain operates as if objects were all created in a simple flat-file structure, without any OUs. It is not possible for example to create two user accounts with an identical username in two separate OUs, such as "fred.staff-ou.domain" and "fred.student-ou.domain"."

    Read the article

  • What problem did MS solve by creating PowerShell? [closed]

    - by Fred
    I'm asking because PowerShell confuses me. I've been trying to write some deployment scripts using PowerShell and I've been less than enthused by the result. I have a co-worker who loves PowerShell and defends it at every turn. Said co-worker claims PowerShell was never written to be a strong shell, but instead was written to: a) Allow you to peek and poke at .NET assemblies on the command-line (why is this a reason for PowerShell to exist?) b) To be hosted in .NET applications for automation, similar to DCOP in KDE and how Gnome is using CORBA. c) to be treated as ".NET script" rather than as an actual shell (related to b). I've always felt like Windows was missing a decent way to bang out automation scripts. cmd is too simplistic in many cases, and WSH is too obtuse (although the combination can be used successfully, I'm not a fan). When I first heard about PowerShell I felt like Windows was finally getting a decent shell that would be able to help with automation of many tasks, but recent experiences, and my co-worker, tell me otherwise. To be clear, I don't take issue with the fact that it's built on .NET, or that it passes objects around rather than text (despite my Unix background :]), and I'm not arguing that PowerShell is useless, but from what I can see, it doesn't solve the problem I was hoping it would solve very well. As soon as you step outside of the .NET/Powershell world, things quit being nice and cozy for you. So with all that out of the way, what problem did MS solve by creating PowerShell, or is it some political bastard child as I suspect? I've googled and haven't hit upon anything that sufficiently answered that for me, but the more citations the better.

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >