Daily Archives

Articles indexed Saturday April 3 2010

Page 25/78 | < Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >

  • smallest filesize for transparent single pixel image

    - by zaf
    I'm looking for the smallest (in terms of filesize) transparent 1 pixel image. Currently I have a gif of 49 bytes which seems to be the most popular. But I remember many years ago having one which was less than 40 bytes. Could have been 32 bytes. Can anyone do better? Graphics format is no concern as long as modern web browsers can display it and respect the transparency.

    Read the article

  • to_date in SQL Server 2005

    - by Chin
    Does any one know how I would have to change the following to work with ms sql? WHERE registrationDate between to_date ('2003/01/01', 'yyyy/mm/dd') AND to_date ('2003/12/31', 'yyyy/mm/dd'); What I have read implies I would have to construct it using DATEPART() which could become very long winded. Especially when the goal would be to compare on dates which I receive in the following format "2003-12-30 10:07:42". It would be nice to pass them off to the database as is. Any pointers appreciated.

    Read the article

  • iPhone clip image with path

    - by huggie
    I would like to clip an image with path. In the book Programming with Quartz there is an example on how to draw a circle clipped by a rectangular path (p.37), and there is also a chapter on image masking with existing image as stencil (Ch.10). But I'm still not sure about how to clip an existing image using path. Is there any example or pointer?

    Read the article

  • Unable to execute stored Procedure using Java and JDBC

    - by jwmajors81
    I have been trying to execute a MS SQL Server stored procedure via JDBC today and have been unsuccessful thus far. The stored procedure has 1 input and 1 output parameter. With every combination I use when setting up the stored procedure call in code I get an error stating that the stored procedure couldn't be found. I have provided the stored procedure I'm executing below (NOTE: this is vendor code, so I cannot change it). set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO ALTER PROC [dbo].[spWCoTaskIdGen] @OutIdentifier int OUTPUT AS BEGIN DECLARE @HoldPolicyId int DECLARE @PolicyId char(14) IF NOT EXISTS ( SELECT * FROM UniqueIdentifierGen (UPDLOCK) ) INSERT INTO UniqueIdentifierGen VALUES (0) UPDATE UniqueIdentifierGen SET CurIdentifier = CurIdentifier + 1 SELECT @OutIdentifier = (SELECT CurIdentifier FROM UniqueIdentifierGen) END The code looks like: CallableStatement statement = connection .prepareCall("{call dbo.spWCoTaskIdGen(?)}"); statement.setInt(1, 0); ResultSet result = statement.executeQuery(); I get the following error: SEVERE: Could not find stored procedure 'dbo.spWCoTaskIdGen'. I have also tried CallableStatement statement = connection .prepareCall("{? = call dbo.spWCoTaskIdGen(?)}"); statement.registerOutParameter(1, java.sql.Types.INTEGER); statement.registerOutParameter(2, java.sql.Types.INTEGER); statement.executeQuery(); The above results in: SEVERE: Could not find stored procedure 'dbo.spWCoTaskIdGen'. I have also tried: CallableStatement statement = connection .prepareCall("{? = call spWCoTaskIdGen(?)}"); statement.registerOutParameter(1, java.sql.Types.INTEGER); statement.registerOutParameter(2, java.sql.Types.INTEGER); statement.executeQuery(); The code above resulted in the following error: Could not find stored procedure 'spWCoTaskIdGen'. Finally, I should also point out the following: I have used the MS SQL Server Management Studio tool and have been able to successfully run the stored procedure. The sql generated to execute the stored procedure is provided below: GO DECLARE @return_value int, @OutIdentifier int EXEC @return_value = [dbo].[spWCoTaskIdGen] @OutIdentifier = @OutIdentifier OUTPUT SELECT @OutIdentifier as N'@OutIdentifier ' SELECT 'Return Value' = @return_value GO The code being executed runs with the same user id that was used in point #1 above. In the code that creates the Connection object I log which database I'm connecting to and the code is connecting to the correct database. Any ideas? Thank you very much in advance.

    Read the article

  • Method that does conditional return of method calling it?

    - by Mattias Konradsson
    Ok this might be a bit of hack but bear with me :) The background is that i'm tired of methods that that some if-statement to that messes up indention for the whole method, like: public SomeClass DoStuff(string inputStr) { SomeClass result =null; if (IsOpenFilter(inputStr)) { .... } return result; } So I was thinking , wouldn't it be neat if I could do something like this instead: public SomeClass DoStuff(string inputStr) { Require(IsOpenFilter(inputStr),null); .... return result; } The idea is that if the statement does not evaluates to true it would return null. If there wasn't a return type for the method it would simply be: Require(IsOpenFilter(inputStr)); I realize that this is kinda overlapping with code contracts but these would be more like "conditional" or "soft" contracts evaluated at runtime rather than compile time. So I guess there's two questions, can this be done somehow? I'm stumped on how to do a conditional return from calling a method. The other question is, is this a good idea? It's a bit weird to monkeypatch the language like this but I'd rather like the way the code reads. I would be even cleaner if it could be put into an attribute above the method: [Require(IsOpenFilter(inputStr))]

    Read the article

  • (Python) algorithm to randomly select a key based on proportionality/weight

    - by LaundroMat
    Hi - I'm a bit at a loss as to how to find a clean algorithm for doing the following: Suppose I have a dict k: >>> k = {'A': 68, 'B': 62, 'C': 47, 'D': 16, 'E': 81} I now want to randomly select one of these keys, based on the 'weight' they have in the total (i.e. sum) amount of keys. >>> sum(k.values()) >>> 274 So that there's a >>> 68.0/274.0 >>> 0.24817518248175183 24.81% percent change that A is selected. How would you write an algorithm that takes care of this? In other words, that makes sure that on 10.000 random picks, A will be selected 2.481 times?

    Read the article

  • Adding items in the combobox dynamically.

    - by Harikrishna
    Can we add the items in the combobox located on the window form dynamically ? Like there are 7 combobox on the window form and when the application is run user should be able to add the item(s) in the combobox.And items added by user should be permanent in the combobox.

    Read the article

  • Is this a valid LGPL scenario?

    - by themapguyde
    Suppose I have Project X under closed source. It references/links to component Y which is LGPL, we make modifications to component Y 1) We release Project X binaries with the source to the modified component Y OR 2) We contribute component Y modifications back upstream (to the original author(s)) and release Project X binaries without component Y source. Does any of these scenarios comply with the LGPL?

    Read the article

  • How to store and access ajax data in javascript without using global variables ?

    - by mike_t2e
    I may be missing something obvious here, but how could I rewrite this code so that it doesn't need the theVariable to be a global variable ? <script language="javascript"> theVariable = ""; function setValue() /* called on page load */ { /* make ajax call to the server here */ theVariable = "a string of json data waiting to be eval()'d"; } function getValue() { alert(theVariable); } </script> <input type="button" onClick="javascript:getValue()" value="Get the value"> In my actual situation, the setValue function makes an ajax call to the server, receives a json string and the data from that is accessed when you mouseover various parts of the page. I end up using several global variables which works fine, but is messy and I'd like to know if there's a better and more elegant way of doing it ?

    Read the article

  • Best practice for defining CSS rules via JavaScript

    - by Tim Whitlock
    I'm loading a stylesheet that is only required when javascript is enabled. More to the point, it mustn't be present if JavaScript is disabled. I'm doing this as soon as possible (in the head) before any javascript libraries are loaded. (I'm loading all scripts as late as possible). The code for loading this stylesheet externally is simple, and looks like this: var el = document.createElement('link'); el.setAttribute('href','/css/noscript.css'); el.setAttribute('rel','stylesheet'); el.setAttribute('type','text/css'); document.documentElement.firstChild.appendChild(el); It's working fine, but all my CSS file contains at the moment is this: .noscript { display: none; } This doesn't really warrant loading a file, so I'm thinking of just defining the rule dynamically in JavaScript. What's best practice for this?. A quick scan of various techniques shows that it requires a fair bit of cross-browser hacking. P.S. pleeease don't post jQuery examples. This must be done with no libraries.

    Read the article

  • XDebug, how to disable remote debugging for single .php file?

    - by Kirzilla
    Hello, I'm using Eclipse IDE + remote Xdebug. EclipseIDE is listening 9000 port for some kind of Xdebug information. There are some php scripts running by cron on server. So, every cron execution xdebug is sending information to my workstation and EclipseIDE is trying to find this file in my project. But file couldn't be find because cron running scrits do not relate to the project I'm working with. So, every cron run Eclipse IDE is alerting this message http://img2.pict.com/22/fc/86/3299517/0/screenshot2b142.png I've tried to add to cron executed php scripts some strings... if (function_exists('xdebug_disable')) { xdebug_disable(); } ... but it didn't helped. Any ideas? Thank you

    Read the article

  • Serialization with Qt

    - by Narek
    I am programming a GUI with Qt. In my GUI I have a huge std::map. And "MyType" is a class that has different kinds of filds. So, in a word, I want to serialize the std::map. How can I do that? Does Qt provides us with neccesary features? P.S. I would like to use std::map, NOT QMap.

    Read the article

  • Syntax highlighting with Chili

    - by Nimbuz
    I want to use jquery Chili plugin for syntax highlighting a piece of code thats generated on the fly, but its not working for the same, because the code is inserted into the #output div on page load. When I tried chili with static examples, it worked but not on the dynamically generated code. Is there any workaround? Thanks in advance for your help!

    Read the article

  • How to treat a symbolic link as a directory in Mercurial?

    - by celil
    As of 0.9.4, when adding a symbolic link Mercurial keeps track of the link itself, and not the file or directories it points to. However, there are cases when it is desirable to keep track of the files pointed to by the symbolic link. How can I force Mercurial to treat the symbolic link to a directory as a regular directory?

    Read the article

  • Variable declared with variable keyword in sql plus(oracle 9i)?

    - by Vineet
    I am trying to declare g_num ,number data type with size it gives an error but in case of varchar2,char it does not. variable g_name varchar2(5);//correct accept size for varchar 2 variable g_num number(23);//Gives an error " VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) | VARCHAR2 (n [CHAR|BYTE]) | NCHAR | NCHAR (n) | NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR ] ]" Please suggest!

    Read the article

  • Deleted vmware ESXi snapshot file - any way to recover?

    - by Mark Allison
    Hi there, I wanted to make some changes to a file server VM today on ESXi 4. The machine is a Debian Lenny guest with two virtual disks - one is 8GB and the other is 500Gb (data). In order to protect the machine from unwanted changes, I made a snapshot of the machine. I went ahead and made my changes and it didn't work out well. So, I powered off the VM and went into snapshot manager and reverted to snapshot. However I reverted to an older snapshot and not the one I just made by mistake. I then (idiotically) deleted the snapshot I just made in snapshot manager. This has resulted in me losing about one year's worth of data. Is there any way to recover this deleted snapshot file? I'm using vmware esxi 4. When I browse the VMWare repository I can see various vmdk files - is it possible the data I need is still there? What should I look for? Thanks, Mark.

    Read the article

  • Screen Capture Under Win7 of JOGL Applet

    - by binarybug
    Hi I'm trying to take a screen shot of an applet running inside a browser. The applet is using JOGL (OpenGL for Java) to display 3D models. (1) The screen shots always come out either black or white.The current solution uses the usual GDI calls. Screen shots of applets not running OpenGL are fine. A few examples of JOGL apps can be found here https://jogl-demos.dev.java.net/ (2) Another thing I'm trying to achieve is to get the scrollable area inside the screen shot as well. I found this code on the internet which works fine except for the 2 issues mentioned above. import win32gui as wg import win32ui as wu import win32con def copyBitMap(hWnd, fname): wg.SetForegroundWindow(hWnd) cWnd = wu.CreateWindowFromHandle(hWnd) rect = cWnd.GetClientRect() (x,y) = (rect[2] - rect[0], rect[3] - rect[1]) hsrccDc = wg.GetDC(hWnd) hdestcDc = wg.CreateCompatibleDC(hsrccDc) hdestcBm = wg.CreateCompatibleBitmap(hsrccDc, x, y) wg.SelectObject(hdestcDc, hdestcBm.handle) wg.BitBlt(hdestcDc, 0, 0, x, y, hsrccDc, rect[0], rect[1], win32con.SRCCOPY) destcDc = wu.CreateDCFromHandle(hdestcDc) bmp = wu.CreateBitmapFromHandle(hdestcBm.handle) bmp.SaveBitmapFile(destcDc, fname)

    Read the article

  • How to get visitors for a community site

    - by Dofs
    I am in the process of creating a small community for car owners. I am still in the development process, but was wondering how to get users to visit the site when it is done. My main focus is the forum, and you probably all know that, nobody wants to visit a dead forum. I was thinking of two options on how to start the community: Advertising on the internet. Creating fake posts by myself The problem is to get the first few people using the forum, and I want to know if any of you guys have some experience doing it?

    Read the article

  • What does stdole.dll do?

    - by rc1
    We have a large C# (.net 2.0) app which uses our own C++ COM component and a 3rd party fingerprint scanner library also accessed via COM. We ran into an issue where in production some events from the fingerprint library do not get fired into the C# app, although events from our own C++ COM component fired and were received just fine. Using MSINFO32 to compare the loaded modules on a working system to those on a failing system we determined that this was caused by STDOLE.DLL not being in the GAC and hence not loaded into the faulty process. Dragging this file into the GAC caused events to come back fine from the fingerprint COM library. So what does stdole.dll do? It's 16k in size so it can't be much... is it some sort of link to another library like STDOLE32? How come its absence causes such odd behavior? How do we distribute stdole.dll? This is an XCOPY deploy app and we don't use the GAC. Should we package it as a resource and use the System.EnterpriseServices.Internal.Publish.GacInstall to ensure it's in the GAC?

    Read the article

  • Framework vs. Micro-Architecture, which is mine

    - by droboZ
    I'm in the process of choosing a framework for my flex development, and one of the questions that was asked about a framework was "is this a framework or a micro-architecture"? Can someone clarify what's the difference? What exactly is a framework, and when can we start calling what we have a framework? I work with FlexBuilder3 (now called FlashBuilder4) and have a lot of standard things that I do for almost all projects, and components that I created for easy re-use. Some are very very small, but the benefit of a 1-liner has been immense for me instead of repeating the code over and over. So in the framework/micro-architecture scheme, can I say that these are my internal in-house framework or are they part of a micro-architecture? Trying to understand this topic better.

    Read the article

< Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >