generator

Symfony 1.4 change admin generator actions or templates

Hi, how can I modify admin generated modules (acions and templates)? They are stored in cache but I need to modify them (templates!). Is it possible at all? Greetings ...

Synchronizing thread communication?

Just for the heck of it I'm trying to emulate how JRuby generators work using threads in C#. Also, I'm fully aware that C# has built in support for yield return, I'm just toying around a bit. I guess it's some sort of poor mans coroutines by keeping multiple callstacks alive using threads. (even though none of the callstacks should exe...

'javadoc' look-a-like, using parser generator?

Hello all, I'm going to create a javadoc look-a-like for the language I'm mainly using, but I was wondering - is it worth to use a parser generator for this? The main idea to use a parser generator was because I could use templates for the HTML code which could be exported then. Also I could also use PDF templates if I need it. Thanks,...

Open Source/ Free alternatives to Redgate Test Data Generator

I was wondering if there are any free / open source alternatives to RedGate's Data Generator. I do not care if the tool is script based, GUI based, written in anly language/platform. I should be able to target a SQL Server or MySQL schema and have test data generated for me which gets inserted into db directly or generate scripts for ins...

Fast iterating over first n items of an iterable (not a list) in python

Hello! I'm looking for a pythonic way of iterating over first n items of an iterable (upd: not a list in a common case, as for lists things are trivial), and it's quite important to do this as fast as possible. This is how I do it now: count = 0 for item in iterable: do_something(item) count += 1 if count >= n: break Doesn't seem ...

Grammar/own-written parser?

Hello all, I'm doing some small projects which involve having different syntaxes for something, however sometimes these syntaxes are so easy that using a parser generator might be overkill. Now, when should I use a hand-made parser, and when should I use a parser generator? Thanks, William van Doorn ...

Is there a tool for generating a DSL parser that does not require a runtime for the resultant parser?

I'm doing a lot of work with a DSLs at the moment and was wondering if anyone knew of a tool that could generate a parser for my bnf specification that does not require a run-time library (pure java source parser)? I'm committed to using XTEXT for a future Eclipse plug-in but I need a nice small version for my library itself and don't w...

Multiple range product in Python

Is there a better way to do this: perms = product(range(1,7),range(1,7),range(1,7)) so that I can choose how many ranges I use? I want it to be equivalent to this, but scalable. def dice(num) if num == 1: perms = ((i,) for i in range(1,7)) elif num == 2: perms = product(range(1,7),range(1,7)) elif num == 3...

GUI for generating XML

Hello. Does anybody know of GUIs for generating XMLs? This means the user will not be presented with an IDE with support for XML for him to type XML codes. This would be helpful for non-technical people using the system. I know this sounds easy, given many libraries that can help in generating XMLs. The issue here is that the schema is...

Personal name generator

Hi all, I would like to populate my database with randomly generated personal names. Would you know any software tool (no web pages!) that can help me achieving this? I will need to generate at leat 5,000 personal names. Thank you. ...

No Secure Random Number Generators Available in JDK

Hi, I am currently running JDK 6 on Windows 7 and have installed the Unlimited Strength Policy Files. I wrote a Java app some time ago which used to work but now fails, giving an error message indicating that the SHA1PRNG SecureRandom is not available. I have tried printing a list of cryptographic providers available on the platform and ...

Generate an ID via COM interop

At the moment, we've got an unmaintanable ball of code which offers an interface to a third party application. The third party application has a COM assembly which MUST be used to create new entries. This process involves two steps: generate a new object (basically an ID), and update that object with new field values. Because COM interop...

Stepping over a yield statement

When in the Python debugger (pdb) I want to step over a yield statement, but hitting (n) for next brings me to the destination of the yield i.e. the consumer of the generator. I want to go to the next line that is executed within the generator. Is there any way to do this? I'm using Python 2.6 ...

Formatting numbers in loop

I want to list all numbers from 0000-9999 however I am having trouble holding the zero places. I tried: for(int i = 0; i <= 9999; ++i) { cout << i << "\n"; } but I get: 1,2,3,4..ect How can I make it 0001,0002,0003....0010, etc ...

Creating a smart text generator

I'm doing this for fun (or as 4chan says "for teh lolz") and if I learn something on the way all the better. I took an AI course almost 2 years ago now and I really enjoyed it but I managed to forget everything so this is a way to refresh that. Anyway I want to be able to generate text given a set of inputs. Basically this will read for...

Color generation based on random number

I would like to create a color generator based on random numbers, which might differ just slightly, but I need colors to be easily recognizable from each other. I was thinking about generation then in a rgb format which would be probably easiest. I'm afraid simply multiplying given arguments wouldn't do very well. What algorithm do you s...

C++ code parser/processor library

is there any library that parse a source code of C++ to produce lets say, call graph, class inheritance tree, flow control, class member list or anything as a ready to use graph or structure in code (not in diagram image). to make it more clear, suppose to generate call graph image, there will be a process like this: ` C++ source -> ...

[ASP.NET] Generating images: Alternate font by User Agent (OS)

Hello, I need to generate small images for certain parts of text. Those will have to fit into the text seamlessly. I know I can not make up for every browser font settings available, but how do I have to check for Linux, Mac and Windows users depending on the user agent? I want to use the right font (of the three "Verdana, Arial, Helvet...

rng random number

Hi, I have a question. How can I calculate/estimate upper bound of random number, that a random number can generate ? Thanks in advance! ...

Interpolation not working on Rails generator

For some reason the code I have included below does not interpolate the variables into the template. It simply copies the file over verbatim. I cannot figure out why. https://gist.github.com/60484f7b57b06b6eb3e3 The Rails version is 2.3.4. Thanks in advance! ...