separate

Static Variables, Separate Compilation

Hi, I wrote a program out, which was all in one file, and the methods were forward declared in a header. The program initially worked perfectly when it was in one file. But when I separated the program, I kept getting random occurrences for the destructor of one of the classes which was declared in the header file. I have a static v...

Putting separate python packages into same namespace?

Hey everyone, I'm developing a python framework that would have "addons" written as separate packages. I.e.: import myframework from myframework.addons import foo, bar Now, what I'm trying to arrange is so that these addons can be distributed separately from core framework and injected into myframework.addons namespace. Currently my...

WPF DataGrid ContextMenu(s)

Hi, how can I define different ContextMenus for each column in the DataGrid (Microsoft's grid)? I found out that the grid provides a ContextMenu attribute, but i want different context menu items for the columns, not the same ContextMenu for the whole grid.. Thanks for any help on this! Edit: Thanks for your answer! I tried to listen...

Need help/answers on PDF color seperation

Using the following process: A PDF is been created by PDFCreator, when a user prints something to the virtual printer The PDF gets further processed with integrated VBScript handler and passed over to JAVA which does some processing with the PDF content In the middle of the process an external application is called with the PDF that ad...

SQL Separate String

Duplicate Separate String with separator #@# The string below I have to call three times using sql. String: JAN#@#PIET#@#HENK The first call shoudl return: JAN The second call: PIET The third: HENK So we could use the #@# as separator but it could be that the string is: JAN#@#PIET only. Still all three calls will be done wher...

Communication between Intranet Applications

I have two separate web applications, both in the same intranet. One of the two is a legacy application, strictly a static site, being served via Apache. The other application is new, one that I am currently building, and will be a dynamic site, with a database. In the first application I want to have a few form pages, that collect in...

How to store datetime in database if time portion is optional?

Should I store it in a single timestamp/datetime field or separate date and time fields? I prefer to store it as a single timestamp field but I need to know when a user didn't enter a time portion. How to best store this in the database? I'm using postgresql. Thanks. ...

Git for game server configuring?

I was wondering if git is suitable for this. So here is the scenario: We are thinking about hosting a game server. However it is not the case of just downloading files and running the server. It needs to be carefully configured and maintained. It also has scripting capabilities. Also, there will be quite a few "developers" who are going...

Render partial from another model

Hi everyone, I have a rails application that models a house. There is a house model that has many parameters and it has_many rooms. A room has a house_id and a name. I've also used http://github.com/ryanb/complex-form-examples to allow many lights and small_appliances to be added to room. complex-form-example uses RJS and partials to...

How to create iText PDF with CMY colors only

Hi, I need to create pdfs with iText (for the moment, other lib suggestions are appreciated) in the CMY colorspace. It's not CMYK: All colors and black should be converted to CMY only so that the black plate is empty when saving my created PDF. I know, black would look some sort of brown, but I have to requirement to not use any black ...

Separate strings and include separating character in one of the returned components

Hi, Say I have the following string "Center-World" and I want to separate this string in two different strings but I want the dash to be part of "Center". With the code below I got a string with ["Center","World"] and I want something that returns ["Center-","World"]. Here is my code: NSCharacterSet *stringDelimiters = [NSCharacterSet ...

Combine Separate Git Repository Branches

I have two separate git repositories. One is mine, and has "Branch A", the other was developed by someone else and has "Branch B". They both have the same master branch. How do I import his branch inside my git repository? So I want the result to be: $ git branch Branch A Branch B master ...

Java Swing: separating UI component from logic behaviour - how do you approach this?

What I do, in NetBeans for example: create a UI component class, suffixed with Swing component type, e.g. JPanel, e.g. MyUIWidgetJPanel create a logic/behaviour class to handle the behaviour/logic, i.e. what happens when the UI component is used, e.g. buttons within it pressed etc., MyUIWidgetLogic I may also link components/logic to...

FLOT: How to make different colored points in same data series, connected by a line?

Hi all, I think I may have stumbled onto a limitation of Flot, but I'm not sure. I'm trying to represent a single data series over time. The items' "State" is represented on the Y-Axis (there are 5 of them), and time is on the X-Axis (items can change states over time). I want the graph to have points and lines connecting those points f...

Put a GUI control on a different thread?

I'm assuming it's possibly to do so as programs like google chrome have gone one better and put each tab on a separate process. So how can i put a GUI control such as a datagridview on a separate thread? ...

How can I set distance between elements ordered vertically?

I have code like that: JPanel myPanel = new JPanel(); myPanel.setLayout(new BoxLayout(myPanel, BoxLayout.Y_AXIS)); JButton button = new JButton("My Button"); JLabel label = new JLabel("My label!!!!!!!!!!!"); myPanel.add(button); myPanel.add(label); In this way I get elements with no distance between them. I m...

How divide a GWT module into some separate javascript files ?

Hi, I've a big GWT module which comprised of many java classes (& of course it's impossible to break it down into several modules). My GWT application consists of some forms, but the users usually work only with a few of them, anyway they should be abale to open any form as they need. Now my problem its that gwt generates a big js file t...

Phone number transformation. Separate prefix in brackets.

There is an element: <phone>(987) 123-45-67</phone>. It is necessary to transform it in: <span><small>(987)</small>&#160;123-45-67</span>. How it can be made? ...

get resource from ASP.NET App_GlobalResources in separate DLL Library

I have a solution with one web project and one class library. In web project I have App_GlobalResources folder with resource file. In code used in web project I can access resourcel like this: string r = Resources.res.ResourceString123; How to get this resource string from class library? ...

Should I separate data from Facade Class?

I'm making a "back-end" engine of HomeCAD. I have a facade class that do many things. But should I separate data (like array of object) from that class? Many thanks ...