generate

Generate a random letter in Python

Is there a way to generate random letters in Python (like random.randint but for letters)? The range functionality of random.randint would be nice but having a generator that just outputs a random letter would be better than nothing. ...

How to generate a <ul><li> tree without recursive using python or other language ??

class tree: def __init__(self, name='a', childs=[]): self.name = name self.childs = childs output: <ul> <li> Introduction <ul> <li>Sub Intro</li> </ul> </li> <li>Module 1</li> </ul> Sorry, my English is poor. ...

How to generate a random String in Java

Hi everyone, I have an object called Student, and it has studentName, studentId, studentAddress, etc. For the studentId, i have to generate random string consist of seven numeric charaters, eg. studentId = getRandomId(); studentId = "1234567" <-- from the random generator. and i have to make sure that there is no duplicate id. than...

Is it necessary to generate javadoc as part of build process?

Is it necessary to generate javadoc as part of build process? ...

How do I generate a view from the console/script-runner in merb?

I'd like to generate a lot of merb views (around 350.000) and save them to separate files programmatically (they will actually be XML files). One option would be to simply wget them, but that is too slow (already tried it, but takes around two days). For rails I've already found an answer but that doesn't work with merb. ...

how could I generate xsd dynamically...

Hello I want to generate a xsd file dynamically, I don't want to use jaxb because it creates alot of files when I use schemagen and I want the schema in one file only. any idea? thx al ...

Generate Windows .lnk file with PHP

Hello, I'm working on a project which involves an FTP server running ProFTPd and a PHP/MySQL backend that creates accounts for users. Upon the creation of accounts, users are sent e-mails with their account details and instructions for downloading FileZilla or CyberDuck, depending on their OS, detected via user-agent string. To make t...

Missing script/generate in Rails 3

I just installed Rails 3 and created my first app. The install of Rails3 + ruby 1.9 went very smoothly but I am missing the generate script in script/generate. I have created a new app from scratch with no options to verify. Any idea why this is happening and how to fix it? ...

Ideas for decorating a property on a generated class?

Hello. I am generating a class that contains MANY properties on it (around 150) using the CodeDOM API. This class is basically an object that represents a row found in an Excel worksheet. The code for generation investigates the target worksheet, extracts the header row based on user-input, and generates the row class. Additionally...

Generating serial or unique ordernumber

Hello, How do generate unique serial or order number in php without checking against db? ...

How to generate id for easily sorting purpose in SQL Server?

Hi everyone, I'm making an website and I have problem generate the parent/child tree like: Page 1 ---Sub page 1 ------Sub page 1 - 1 Page 2 Page 3 ---Sub page 3 ------Sub page 3 - 1 ------Sub page 3 - 2 If I use UID, it's impossible to write the "ORDER BY" t-sql to make the tree. I'm thinking of a function that can generate the ID (v...

Entity Framework timestamp Generate Database problem

Hi. I got a problem with EF 4.0 I creating entity with "timestamp" column. After that, I try to generate database. In SQL script column looks like 'binary(8)' instead of timestamp. How to solve it ? ...

How to write programmatically some unicode text in RTF format?

In order to generate RTF programmatically I have decided to use rtflib v1.0 from codeproject.com. But I can't understand how to generate text in russian unicode. So I need to generate a unicode text. Could someone help me? P.S. Honeslty, I could write in .rtf file some text in, only by opening it with MS Word. But after writeing some te...

How to generate an Excel document with multiple worksheets from PHP?

I want to generate an MS Excel file from PHP. I know one can do something like this: header ( "Content-type: application/vnd.ms-excel" ); header ( "Content-Disposition: attachment; filename=foo_bar.xls" ); But it will generate a file with just one Sheet. What I want is generating a file with multiple sheets. How can I do that? Maybe t...

How to generate id based on two foreign keys in JPA / Hibernate?

I have a simple question regarding Entity declaration in JPA. I have an entity with 2 foreign keys, which are not null and form an uniqueConstraint. First I was thinking about a composite key, composed of the two foreign keys, but I heard that this is a legacy design, and not the recommended way of designing new tables. So I am interest...

Generating JavaDoc from String/Stream etc.

Is it possible to generate JavaDoc not from a .java file on disk but from a String or InputStream that contains Java source? As I can see, com.sun.tools.javadoc.Main.execute(...) deals with disk files only. Is there another option rather than "hacking" rt.jar? ...

generate image (e.g. jpg) of a web page?

I want to create an image what a web page looks like, e.g. create a small thumbnail of the html + images. it does not have to be perfect (e.g. flash /javascript rendering). I will call use the code on linux, ideally would be some java library, but a command line tool would be cool as well. any ideas? ...

Why is the same Public Key generated even with different key container names?

private readonly string KeyContainerName = "MyKeyContainer"; public void GenerateKeyPair() { Debug.WriteLine("Generating Key Pair"); CspParameters cp = new CspParameters(); cp.KeyContainerName = KeyContainerName; cp.Flags = CspProviderFlags.UseDefaultKeyContainer; ...

How to generate a XML from XML in jQuery (Javascript)?

I'm trying to generate a XML from client side XML according to this link. But it isn't work. Here is my js code: // XML Builder $.createElement = function(name) { return $('<'+name+' />'); }; $.fn.appendNewElement = function(name) { this.each(function(i) { $(this).append('<'+name+' />'); }); return this; } ...

How to turn off generators for RSpec 2 in Rails 3?

I installed the current RSpec 2 Beta under Rails 3 RC as mentioned on the GitHub page (and several blogs). Everything works fine, but I am not able to turn off specific generators like advised on some blogs. Here is what I do in ./config/application.rb: config.generators do |g| g.test_framework :rspec, :fixtures => false, :views => f...