generate

Generate a URL with URL Routing in Webforms

I know in the MVC Framework, you have the Html Class to create URLs: Html.ActionLink("About us", "about", "home"); But what if you want to generate Urls in Webforms? I haven't found a really good resource on the details on generating URLs with Webforms. For example, if I'm generating routes like so: Route r = new Route("{country}/...

How to generate 2-characters long words effectively?

Hello, I've been playing with idea to make a script to generate 2-characters words from a given set of characters in my language. However, as I am not into re-inventing the wheel, do you know about such a script publicly available for C#? ...

Generate a hash sum for several integers

Hello, I am facing the problem of having several integers, and I have to generate one using them. For example. Int 1: 14 Int 2: 4 Int 3: 8 Int 4: 4 Hash Sum: 43 I have some restriction in the values, the maximum value that and attribute can have is 30, the addition of all of them is always 30. And the attributes are always positive....

How to make a pdf file using PHP

How can I make a PDF file in PHP. What I want to make is a student list. So I want to query the database, get the information and give it to the user as a PDF when he clicks generate student list. ...

Generating attendance list in PDF using PHP

Hi I want to create an attandence list from the student's database in PDF using PHP. I want the columns student.name, student_id, student_rollno and a column for sign for signing to be made as table in pdf. How can I do this? ...

Generate Images for formulas in Java

Hi I'd like to generate an image file showing some mathematical expression, taking a String like "(x+a)^n=∑_(k=0)^n" as input and getting a more (human) readable image file as output. AFAIK stuff like that is used in Wikipedia for example. Are there maybe any java libraries that do that? Or maybe I use the wrong approach. What would yo...

Generate a number of ranges for a random set of values

Given a set of random numeric values in a database, how do I generate a limited list of ranges where each range contains at least one value? The ranges should not overlap and ideally have a similar amount of values in them. Ideally their boundaries should also be multiples of 10, 100, 1000 etc... For example: Values: 100,150,180,300,40...

Can I databind (2-way) dynamically generated RadioButtonLists?

I am trying to create a dynamic survey page. The idea seems simple, but trying to implement it in ASP.NET is getting me very frustrated... Each user is linked to an individual list of (multiple-choice) questions. I have the following data tables: Surveys: User | Question | Rank -------+------------+----- user-x | question-x | 1...

NHibernate: Generate a business key

What is the best way to generate a unique number for a business key? In the example below, our customer wants a number (OrderNumber) they can use to refer to an Order. <class name="Order"> <id name="Id" ... /> <property name="OrderNumber" column="order_number" /> </class> ...

rails script/generate skip unnecessary files by default

script/generate became very annoying since i started using rspec etc. i dont need unit test files and fixtures anymore, but script/generate makes them anyway. is it possible to set --skip-fixtures and --skip-test to be default system-wide (or at least project-wide)? ...

fixPluralClassNames option not working when generating through visual studio

I have a table in my database called "Campus" and when sonic.exe generates the class it names it "Campu". So I tried setting "fixPluralClassNames" to false in my generate statement (through visual studio as an external command, it automatically picks up the connection strings in app.config) but it still generates it as "Campu". I tried r...

Fast Algorithm to Generate 500,000 html file.

What is the fastest way (Algorithm) to generate 500,000 static html files from DB? And is it a good practice to put all this files in single folder? or create hierarchically for this files? We want to handle about 6,000,000 concurrent hit, so the static files will be a good solution for that. the source DB will be simple flat table wi...

How do I generate dynamic items dynamically?

Hi All, I'm looking for a way to append elements with javascript using javascript. Basically I have two lists of items. One has a list of items with an "ADD" button (using "link_to_remote") and the other has a list of items with a "REMOVE" button (using "link_to_remote"). When I click the "ADD" it immediately places the item into the...

Best code to generate 1,000,000 files from Database

Using C#, I want to generate 1,000,000 files from DB, each record in separate file. What is the best way to generate this files in minimum time? Here is my code without threading : AppDomain.CurrentDomain.ProcessExit += new EventHandler(CurrentDomain_ProcessExit); // to calculate the execution time in case of using threading SqlCom...

Generating a class from an object (JavaScript)

I'm trying to generate a class from an object in JavaScript. For example: var Test = { constructor: function() { document.writeln('test 1'); }, method: function() { document.writeln('test 2'); } }; var TestImpl = function() { }; TestImpl.prototype.constructor = Test.constructor; TestImpl.prototype.method = Test.method; var x =...

How do I modify the set method signature that Eclipse auto generates?

My current project has the coding convention that instance variables are never referred to with the this. prefix and that parameters should never hide instance variables. This results in setters that look like: public void setFoo(final Foo aFoo) { foo = aFoo; } Unfortunately eclipse won't generate that for me by default. I've found...

Page object problem

Hi, I have a class which generate a dynamic page. Panel myPanel = new Panel(); TextBox myTextBox = new TextBox(); myPanel.Controls.Add(myTextBox); Page thePage = new Page(); thePage.Form.Controls.Add(myPanel); return thePage; my class basically do this. I call my class and I get thePage object from code-behind. Now, How can I r...

Generate Ant build file

I have the following project structure: root/ comp/ env/ version/ build.xml build.xml build.xml Where root/comp/env/version/build.xml is: <project name="comp-env-version" basedir="."> <import file="../build.xml" optional="true" /> <echo>Comp Env Version tasks</echo> ...

Nhibernate/Domain Objects generate test objects with random data from factory

We are doing some DDD at work and I am trying to find a good utility for generating Domain Objects with random data, or predefined data, and populating dependent objects. Example Usage: var user = DDDObjectFactory.CreateUser(); user.Name = "TestUser"; In our world, a user can not exist without a organization, so if there is no organi...

How can I generate images of circles, of varying sizes?

For the task I'm trying to accomplish, I need to generate many images, all consisting of a black circle border on a transparent background, but each a different size (going up in size from 3x3 to, say, 20x20). Preferably they would be GIFs or PNGs, as these support transparency. I started building a simple C# Console project for this, ...