Programming :: Script To Generate Random Dates?

Aug 3, 2010

A script to generate random dates. It uses the year range 2006-2009, and truncates every month of the year to an ordinary February's 28 days, but otherwise it's pretty solid and safe.

Code:
spate=1
while [ $spate -le 120 ]

[code]....

View 1 Replies


ADVERTISEMENT

Programming :: Using /dev/random To Generate Double?

Mar 6, 2010

I need to generate random numbers using /dev/random in C. The numbers should be of type double (64-bit floating point).The functionality should be equal to linux command "od -An -N8 -t fD /dev/random", but written in C.The prototype should be "double drand(void);".

View 7 Replies View Related

General :: Generate Random Number Either 1 Or 0?

Jan 21, 2010

Not only that but I need tons and tons of them generated, and I need it to be totally random each time.

Code:
matthew@mvm:/h/misc> cat a
#!/bin/bash
for i in {1..5}; do
echo $RANDOM

[Code]....

There you can see that it is the same number. It does that every time!! Grrr. The strange thing is each time I manually type [or copy & paste] it into the terminal, it gives random [not static, like I am getting from my script] results.

The reason I want this is because I am making a script where this line will randomly go up or down [depending on if the random number is 1 or 0].

View 4 Replies View Related

Software :: Generate Random Letters Only?

Aug 24, 2010

I have this: Code: dd if=/dev/urandom count=128 bs=1 2>&1 | md5 | cut -b-10 But I only want it to have letters and no numbers. What can I do for this?

View 13 Replies View Related

General :: CLI Commands To Generate Random Result From Specified List?

Jul 20, 2011

List of 77 lines with the names of movies. For ease, let's say it's in a text file. What I want is a command line argument I can pass that'll read each line and pick one of those 77 lines at random, except I can't figure out how to do this. Is there a program I can just pipe the output of 'cat listofmovies.txt' to?

View 13 Replies View Related

General :: Generate Random List And Determine Size Of Arbitrary Block Of Files In Dir?

Mar 4, 2010

I want to generate a temporary random list from a directory of files and then determine the size of an arbitrary block of files from this list (say 1-25 or 26-50) and add their names to a file along with some other info for each name. I can generate a random list with file sizes like this: ls -l | sort -R | cut -d " " -f 6 but i'm not sure how to add up the sizes of just a certain block of these files and at the same time save the file names.

View 2 Replies View Related

Programming :: AWK: Compare Apache Dates Without Using Regular Expression

May 15, 2010

I'm writing a loganalysis application and wanted to grab apache log records between two certain dates. Assume that a date is formated as such: 22/Dec/2009:00:19 (day/month/year:hour:minute) Currently, I'm using a regular expression to replace the month name with its numeric value, remove the separators, so the above date is converted to: 221220090019 making a date comparison trivial.. but.. Running a regex on each record for large files, say, one containing a quarter million records, is extremely costly.. is there any other method not involving regex substitution? here's the function doing the convertion/comparison

[Code]...

View 13 Replies View Related

Programming :: Calculate The Minutes Difference Between Two Dates Using The Function Mktime() On C++?

Jul 28, 2010

I'm trying to calculate the minutes difference between two dates using the function mktime() on c++. The dates will be passed to me as struct tm, and I will use this function many many times. The example below shows what I wanna do:

Code:

int main(int argc, char** argv) {
while (1) {
tm date2;
tm date1;

[code]...

I read the mktime() description on c++ reference, searched google... but there is no light

View 4 Replies View Related

Programming :: How To Generate MD5 / Sha-1 With Perl

Mar 31, 2010

How can I generate a md5 or sha-1 code with perl?

View 2 Replies View Related

Debian Programming :: Generate SQL Result Into XML

Dec 2, 2014

How do I generate sql result into xml ? Tried this way (shown below), but it generates all data into single column.

Code: Select allgenerate_xml()
{
        f1=_tmp1
        f2=_tmp2
        cat $SQL_QUERY_OUT |sed -e 's/^"//g;s/"$//g;s/","/|/g'|tr '|' ' ' > $f1
        [ -e $SQL_QUERY_OUT ] && rm $SQL_QUERY_OUT

[code]....

View 2 Replies View Related

Programming :: Generate Excel Charts From C?

Feb 24, 2011

Does anybody know how to generate excel charts from C, or if it's possible at all?

For example, if I had 2 arrays that I wanted to export to excel and graph against each other. I know how to export it to a csv file, that's no problem, but I have no idea where to start with generating a graph of the data. I can't seem to find any examples anywhere.

I'd appreciate if someone could point me in the right direction.

Just a simple example to show you what I mean code...

View 10 Replies View Related

Programming :: Script To Generate Vouchers?

Jun 24, 2010

I have a file, two columns, first column has a list of 15000 (yes 15k) unique codes, second column has the afilliate codes of 60 locations repeated to fill out the 15000 rows of unique codes. I need to produce a nice neat paper voucher which will fit onto A6 (1/4 A4) and is ready to print. Each voucher has the unique code and corresponding location. So far I am thinking PHP will do the job. This does it somewhat, but doesn't let be split the fields between the ",". I did this so far in PHP

[Code]...

View 3 Replies View Related

Programming :: Generate Pdf In Thai Language?

May 19, 2009

I am trying to generate pdf in thai language. i have installed thai package (extension in babel package). It is finally generating pdf in thai. but thai string are cming very long as compared to original string given in .tex file.

View 3 Replies View Related

Programming :: Running Some Script To Generate Below Values?

Mar 24, 2011

We are running some script to generate below values however we don't need the first level output as it always shows cpu % as 0.0.

(We dont need following part:
NAME STATE CPU(sec) CPU(%)
XXX -----r 55567 0.0

[code]....

View 10 Replies View Related

Programming :: Script To Generate SSH Banner MOTD?

Apr 18, 2010

I want to automate my System-installation. So i try to make a Script that will generate the /etc/motd. Now i have the Problem that the script has some variables and after the "Hostname, OS, HW, IP" the "stars" are anyware, but not there they should. The most problem is the $OS this string can verry long or verry short be. Fedora release 12 (Constantine) or RedHat 5.4 i can do that after the variables place the "stars" on the write position?

Script
Code:
#!/bin/bash

[code]....

View 6 Replies View Related

Programming :: Tool To Generate Class Diagrams?

Sep 7, 2010

I have some c++ code and want to generate class diagrams using some tool which would scan the c++ code and generate diagrams. Is there any such open source tool to be used on linux machine?

View 1 Replies View Related

Debian Programming :: GCC Can't Generate 64 Bit Program On Wheezy Mips64?

Dec 21, 2014

I have both 32 bit and 64 bit libs installed with gcc multilib.

I tried following options, but the result is still a 32bit elf:

# cc -mips64 -mabi=o64 -mlong64 -mgp64 -c gendian.c
# file gendian.o
gendian.o: ELF 32-bit LSB relocatable, MIPS, MIPS64 version 1 (SYSV), with unknown capability 0xf41 = 0x756e6700, with unknown capability 0x70100 = 0x1040000, not stripped

The machine is running 64 bit os:

# uname -a
Linux debian 3.2.0-4-5kc-malta #1 Debian 3.2.63-2+deb7u2 mips64 GNU/Linux

Both 4.6 and 4.7 gcc have been tried, and both have the same issue.

Fixed: need -mabi=64

View 0 Replies View Related

Programming :: Write A Program In C Which Will Generate A Maze Randomly ?

Oct 8, 2010

I want to write a program in C which will generate a maze randomly and find the solution for it ..

The idea behind is in [url]

How the 16 bit integer is stored in a variable..Earlier I wrote a program on trees and displayed it using dotty.. Is there any such tool to display a maze..I am using ubuntu 10.04.

View 1 Replies View Related

Programming :: Generate Alphanumeric Characterlist - No Repeating More Then 3 Times?

Apr 5, 2011

i have spotted that script (something similar that i am looking for)

[URL]

and i just dont know how to use it.I am not a programmer myself and probably no need for learning that just to create one script! modify "wje_lq" script and run it. thing like : "Just redirect standard output to a file in the normal manner" ? and all this

I.Comment out the first definition of *character-set*, by adding a semicon at the beginning of the line.

II.Uncomment the second definition, which just uses "ABC", by removing the semicolon from the beginning of the line.

III.Comment out the first definition of *word-length*.

IV.Uncomment the second definition, which uses a word length of four.

i would like to generate :

10-character combinations of the following characters (lowercase) 23456789abcdef with no more then 3 same letters repeates no metter side by side or within one line (sequence) so lets say

abcdef1234 accept
fabcde1234 accept
ffabcd1234 accept

which is probably permutation with repetable string ( where abc is not equeal to cba etc .so ti speak position does metter)

fffabc1234 not acceptable -----(3 same characters)
ffabcf1234 not acceptable -----( 3 same characters event thought not side by side)

we dont want 3 same characters apper in same line.

View 2 Replies View Related

Programming :: Reading Lines To An Array And Generate Dynamic Zenity List?

May 18, 2011

explanation what I want to do exactly:I have a textfile which looks for instance like this:

file.txt:
...
something=else to do

[code]....

View 14 Replies View Related

Programming :: Get Random Number From -1 To 1 In C?

Mar 4, 2011

i want to generate random number in c programming from -1 to 1

View 1 Replies View Related

Programming :: Random Float Numbers In BASH

Mar 27, 2011

I'm learning shell scripting using bash and I want to generate 4 floating point number with 5 decimal places and write them to a file and a variable. I've done all this except the $RAMDOM enviroment variable does not generate a float number but a integrer.

[code]...

View 4 Replies View Related

Programming :: Random Libraries Are Not Directly Executable?

Jun 30, 2011

Since I read that executing a library could return its version number, I ran "/lib/libc.so.0" on uClinux, but it triggers an error.I'm told that random libraries are not directly executable. Does someone know what a random library is?PS: In case that matters, here's the short version of the error:

Code:
Undefined instruction
<5> - May be used to emulate instructions that are not defined for

[code]....

View 2 Replies View Related

Programming :: MySQL - Get A Random Selection Of An Ordered Data Set

Jan 11, 2011

Given the following data structure: Quote:

[Code]...

What is the minimum possible MySQL query to get a random data selection that includes each Index number only once and ordered ascending. The maximum index number is known. For example running the query should get the following data: 01, 06, 07, 02. Running the query again, you may get the same data or another possible combination like: 01, 05, 07, 04. Of course you could run a loop for 1 to max_index and process a random ordered data selection until the next index number is found. But I think this will result in too many database access. Also you could run max_index queries to get all IDs that correspond to the given index and randomly select one ID for each index.

View 3 Replies View Related

Programming :: Bash: Generating A Random LETTERS Sequence?

May 12, 2011

I tried googling around but i cant find anything related to this: everyone seems just interested in random numbers, so when it comes to random letters there is a lack of informations. However, i am trying to figure out a wait to get a random letters string that matches a simple rule: it must be a sequence of consonant+vowel. So for example, these are some 6 letters strings i would like to obtain: wolupa, tafoke, zewevu, cupimo.

View 3 Replies View Related

Programming :: Srand (static_cast<unsigned Int>(clock( ))); Seems Not Random Enough

Jul 21, 2011

I copied and test a simple random number generate program

#include <algorithm>
#include <vector>
#include <iterator>
#include <iostream>

[code]....

View 2 Replies View Related

Programming :: Perl Match Character - Random Sentence Generator ?

Aug 11, 2010

I am trying to make a random sentence generator in perl. So far I can loop it x times to make a fixed quantity of words, but I don't want to do that. Or I can let it go on until I hit ctrl-C :/

I want to have it so that when it reaches a word with a sentence terminating punctuation mark it stops.

My attempt to do that was with:

This is doing the woooosh text until ctrl-C thing...

Now however I am not sure how I can cut off everything after the punctuation mark (when it exists).

View 1 Replies View Related

Ubuntu Multimedia :: Copy Random Jpg From Random Folder

Jan 19, 2010

I'm looking for a script that copies a random .jpg from a random folder in my ~/Pictures folder to my ~/temp folder with a standard filename. This file will then be displayed in Conky. I can fix the last part, but I cannot find a way to do the first part.

View 3 Replies View Related

Programming :: Create File Listing In C++ That Will Generate Line Number On Every Line Of Code

Apr 11, 2010

I have a project due for my Intro to C++ class and we are suppose to generate a file listing that will take an input of a C++ source code with .cpp extension and make a copy of it with a .lst extention that will have a line number preceding each and every line.

View 12 Replies View Related

Programming :: Parsing Xml File Using Shell Script And Generate Report In A PDF File?

Jul 9, 2009

parsing xml file using shell script and generate report in a PDF file

Xml file input:

<report>
<student name="x" father name="x1" class="first" Address="xyz">
<property name="sports" value="yes"/>
<property name="drawing" value="no"/>

[code]....

View 12 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved