Programming :: MySQL Year Field Range Too Limited

Jul 1, 2011

In the MySQL database for one of my programming projects, I used a "YEAR(4)", because I wanted the column to contain four-digit year values. I discovered, though, that this type only allows values from 1901 to 2155, which is not workable as some year values are previous to the twentieth century. But I do not want a "DATE" type because the month and day are of no interest to me. What type should I convert to that would be the least radical change in data type, while giving more range?

View 1 Replies


Programming :: How To Do Fuzzy Matching On A MySQL Field

Feb 18, 2011

If I have a MySQL field called, say, "Occupation", which contains "Java Programmer" in it, I would like it to come up when I search for "Java", so that I can get to the other fields in the table.
How do I do this?

View 2 Replies View Related

Programming :: Awk - Print A Field When Field Position Is Unknown ?

Mar 28, 2010

I'm trying to display fields from flat files where the first 8 fields are always the same. Fields 9 - n are varied but will contain specific patterns I'm after. I'm using this so far because "mySearch" is on each line I want to examine.


How would you pattern match and include 2 additional fields above field $9 but change field position from line to line?

View 12 Replies View Related

Debian Hardware :: Intel Atom N450 - Limited CPU Frequency Range

Jul 29, 2010

Got a new HP Mini 210 the other day and things run pretty good using squeeze considering how new it is. The only serious problem is that the available scaling frequencies are mis-reported by the system. Instead of 800, 1.0, 1.3 and 1.6, only 1.0 and up are shown.

acpi-cpufreq is installed and run properly on boot, indeed the system scales nicely from 1.0 through max as needed / dicatated by the ondemand governor. Powertop tells me it spends 99.8% of its time at the "lowest" frequency of 1.0.

In the hopes that a newer kernel would solve things I downloaded 2.6.34-1 and built it, and though it runs very nicely it doesn't solve the problem of the missing 800Mhz frequency. At this point I'm at a bit of loss as to how to proceed. I've asked the same question on the Debian mailing list, because I want to give this the good old college try before submitting a bug report to the kernel mailing list.

View 2 Replies View Related

Programming :: Awk Printing From Nth Field To Last Field

Jan 8, 2010

How can print the, let's say 5nd field to the last field of every record (let's say we have 10 fields)?

I mean: I cant avoid to have to do:

print '{$5 $6 $7 $8 $9 $10}'

View 2 Replies View Related

Programming :: Php - Get A Return From A Field Within A Field?

Apr 27, 2009

I am creating a game with random variables. In the game I have created a dialogue exchange to players. I have set up a table with various returns and I inserted {$fields} to represent various random variables. When I call on the requested fields, I only see the field text and my field names. Am I supposed to parse something and call it back another way?

ie: myfield is: "You have won {$random1} silver! <br />{$wi['gender'] majesty rewards you well." the code I am using to call that field is:

View 11 Replies View Related

Networking :: Error Str2addr:Address 35 Outside Range Of Address Field Length 1?

May 12, 2011

I am working on implementing a protocol on NS2.34 .I really need help to solve this problem . Actually , I don't now whether the problem is generated by the tcl code or the c++ code when I run the simulation, I get this result :

num_nodes is set 64
45 - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0

View 1 Replies View Related

Programming :: Bash Script To Ping A Range Or Own IP-range?

Apr 11, 2011

I want to build a bash script, which can ping a range IP adresses which will be filled in by the admin. If there is no IP-adress filled in, then the script must ping the subnet where the system is logged on. So if my ip is, then the script must ping from till Or else, if there is given a beginning and ending ip it must ping that!

The first part of the bash script is to ping a given range (see below). But there is one problem, how can I tell the script to ping from $begin till $end, [..] is of course wrong! But what must be filled in there???

echo "Enter beginning IP-adres:"
read begin
echo "Enter ending IP-adres:"
read end
ping -c 1 $begin [..] $end

The second part is to find my own ip and ping the whole range.. How to do that? I only can find my own IP, but I cant ping the whole range,, how to do that?

ifconfig | grep 'inet addr:' | grep -v '' |
cut -d: -f2 | awk '{ print $1 }'

View 11 Replies View Related

Programming :: Get A Field Value Corresponding To Another Field Value?

Dec 14, 2010

i have a file : file.dat with following data



/storage_01 64% 0
/storage_02 17% 1
/storage_03 10% 0
/storage_04 50% 1

I need to get the value of PERCENTAGE in a variable for a value of storage passed as variable i have tried the following without success like :


percentage='awk -vx="$defaultStorage" '{FS=OFS=" "}$1==x{print $2}1' file.dat

View 2 Replies View Related

Ubuntu Networking :: MySQL Gammu - Unknown Column Signal In Field List

Feb 12, 2011

I seemed to configure my gammu and changed the version indicated version on my gammu table from 10 to 11 to match the version of my sql, upon starting my gammu-smsd the error:
gammu-smsd[3429]: Error code: 1054, Error: Unknown column 'Signal' in 'field list'
gammu-smsd[3429]: Error code: 1054, Error: Unknown column 'Signal' in 'field list'
gammu-smsd[3429]: Error code: 1054, Error: Unknown column 'Signal' in 'field list'
Kept on repeating on an infinite loop

View 3 Replies View Related

Programming :: Subtracting Years From Current Year?

Feb 24, 2011

I have a script: Code: #!/bin/bash
echo $LASTYEAR I get:


THEYEAR is correct but then I get a line space and then a -1 for LASTYEAR. I can't figure out why.

View 2 Replies View Related

General :: Field-terminating Char Appears Within Field Values?

May 18, 2010

I've had a very colorful morning learning the innerparts of Linux's sort command, and have come across yet another issue that I can't seem to find an answer for in the documentation. I'm currently using -t, to indicate that my fields are split by the comma character, but I'm finding that in some of my files, the comma is used (between double-quotes) within values:

Jonathan Sampson,,,0987654321
"Foobar CEO,","CEO,",,,

How can I use a comma to terminate my fields, but ignore the occurences of it within values? Is this fairly simple, or do I need to re-export all of my data using a more-foreign field-terminator? (Unfortunately, I do not have any control over declaring a different terminator with this particular project).

View 2 Replies View Related

Programming :: Simple Bash To Write Files By Year To A Log File

Jan 31, 2011

I have a folder of 2 many files that the old ls just hangs.

I am trying to write some log files such as;

I don't mind doing one at a time, but I am just playing and even getting the listing I am not getting the date stamp, I have the following;

That does create the file, but all the files look like this;

So basically it's just sticking that ls inside the log file and not actually running the ls, so how can I use the above type to get files just created per year?

View 2 Replies View Related

Programming :: Form Field Validation Using PHP

Sep 10, 2009

I want to validate a web form using PHP. I spent ages confusing myself with client side scripting and realised until I worked out it is not what I want. My problem is that now I am looking at PHP and everything is mixed up in my brain. I need to point out that PHP is very new to me! This is what I already have:
1 An html page with my form on it.
2 PHP page which emails the contents of the form to me.

The above works well. For the sake of clarity, here are my pages (cut down to the essentials where appropriate): My html form:
first name surname
Home phone
Work phone

I have read and understood your terms and conditions. My php script (regform.php)
$receiver = 'me@email'; $subject = 'New registration'; #$message = 'This is a new registration.'; $surname = $_POST['surname']; $firstname = $_POST['firstname']; $address = $_POST['address']; $email = $_POST['email']; $homeph = $_POST['homeph']; $mobileph = $_POST['mobileph']; $workph = $_POST['workph']; $time = $_POST['time']; #from here $oldaddress = $_POST['oldaddress']; $DOB = $_POST['DOB']; $elect = $_POST['elect']; $job = $_POST['job']; $salary = $_POST['salary']; $employer = $_POST['employer']; $benefit = $_POST['benefit']; $smoke = $_POST['smoke']; $claim = $_POST['claim']; $children = $_POST['children']; $children2 = $_POST['children2']; $pets = $_POST['pets']; $pets2 = $_POST['pets2']; $require = $_POST['require']; $terms = $_POST['terms']; $rooms = $_POST['rooms']; $body = "first name:$firstname
home phone:$homeph
mobile phone:$mobileph
work phone:$workph
time at this address:$time
previous address:$oldaddress
electoral register:$elect
benefit claim:$benefit
future benefit:$claim
pet type:$pets2
other requirements:$require
terms:$terms"; $headers = 'From: email' . "
" . 'Reply-To: email "
" . 'X-Mailer: PHP/' . phpversion(); mail($receiver, $subject, $body, $headers, "From: $firstname $surname
" . "Reply-To: $firstname $surname class="inlineimg" />;

You can see there are many more form fields than I have shown in my example html form above. What I want is that the following fields have to be filled:
1 mobileph
2 email
3 terms (checkbox)
I would like the user to be asked to fill the form in properly if any/all of the 3 fields have not been filled in. I imagine I need some php in the html page and some more in the php page. I am certainly not asking any one to do this for me but I am really confused. I have googled and copied and pasted and edited for 6 hours and I am lost. What I want is a very simple and clear example of the code needed. Sorry if I sound as if I can't search properly on Google: in this case I clearly can't!

View 2 Replies View Related

Programming :: SQL -any Value For Numeric Or String Field?

Feb 12, 2010

how do i ask in a query for any numeric or string field? It may not have any meaning, but i need it to fill a toplink DataReadQuery in java....Something like " select * from table where table.fieldA='?'

View 2 Replies View Related

Programming :: Getting A Particular Field Replaced In A Host List?

Sep 30, 2010

I'm having a bit of a trouble getting a particular field replaced in a host list. I have a MasterHostList which has a comma delimiter for fields and a new line to separate servers.


I then have a file.list file with a grouping of server names. What I need is to search the MasterHostList and for each server that is in the file.list I need to change the fourth field from group1 to group2 without changing the order or position of anything in the MasterHostList. Obviously the above names are arbitrary.

Failed attempts have been: for SERVER in `cat file.list`; do sed /$SERVER/s/,group1,/,group2,/ MasterHostList MasterHostList.tmp && mv -f MasterHostList.tmp MasterHostList; done for SERVER in `cat file.list`;do awk 'BEGIN { FS=OFS="," } /^${SERVER}/ { $4 = "group2" } 1' ./MasterHostList MasterHostList.tmp && mv -f MasterHostList.tmp MasterHostList; done

Both of these would in various output tests find the correct lines, but it wouldn't change them all correctly.

View 3 Replies View Related

Programming :: Find A Field And Print Its Companion?

Apr 5, 2010

I have a file with variable length lines containing fields separated by colons:


The first field identifies the file name, the second is the search key, and the third is the line number of the file that the search key points to. Any subsequent fields are other key/line number pairs.

As an example, I can search for 4151 (key) from my bash script to identify the file I will have to access, but I also need to capture the line (142) as well, and I can't figure out how to do that using grep, awk or sed (or anything else).

View 2 Replies View Related

Programming :: Add Commands To A Limited Shell Program?

Apr 3, 2011

In below program I want to add (as part of the valid_cmds string) the pwd (print working directory), lo (logout), and cd (change directory) commands. However when I add those into original program ;
char *valid_cmds = " ls ps df pwd lo cd";
they are not working I have the cout message huh?
Original source code is below code...

View 3 Replies View Related

Programming :: Place Another Command Like Grep Or Cut In Address Field?

Jan 28, 2010

The thing is that the command for sed resembles the following


Now if I want to place another command like grep or cut in the address field how do I do it. Actually I don't know the line number. The user has to give it as an input. How shall I do that?

View 8 Replies View Related

Programming :: Converting Date Format In A Comma Separated Field?

Apr 9, 2010

I am in the process of learning some scripting, however I am running into a roadblock in specifying a certain time format in the array. Ideally I would like to use Here are the lines of text that I am interrogating:

1123,3/25/2010,00:14 Thu,33229
1124,3/26/2010,13:30 Fri,33230
1125,3/27/2010,04:49 Sat,33231


View 2 Replies View Related

Programming :: Parsing VoIP Call Detail Records (Field Format)

Jan 4, 2010

I am going to parse the Cisco voip CDR(Call Detail Records), please tell me the field format of the CDR files.

View 1 Replies View Related

Programming :: Equivalence Classes Based On Field Values And Multi-key Hashtable?

May 12, 2010

I've got a set of objects (all of the same type). I'm trying to think of a good way to divide it into equivalence classes, with equivalence of two objects defined as meaning a specified set of attributes are equal for both objects. More concretely, I've got:

- a Java class with around 50 fields
- a bunch of instances of the class

I want:

- to divide the instances into a few sets
- in each set, each instance has field 1 - field 5 equal to fields 1-5 of the other instances in the set.

The method I've come up with is to generate a hashcode for each instance based on the hashcodes of fields 1-5*, and map the hashcode to one of my sets. Ignoring problems with potential hashcode collisions (which I'm expecting to be too rare to worry about for now), does that sound reasonable? It seems simple enough, but I'm wondering if there's a simpler method I haven't thought of.

* I'll generate the hashcode using a method based on Eclipse's generic hashcode method, which looks like this:


public int hashCode() {
final int prime = 31;
int result = 1;


View 5 Replies View Related

Programming :: Helios : Using Tab On Text Field Having Content Proposals, Crashes Application?

Sep 8, 2010

Using content proposal in helios, giving problem if u press tab. Below is the error. For recreation snippet is provided(taken from 2 sites) after error log.Only u need to press tab while proposal pop up is visible & then point mouse at client.

#################################ERROR LOG#############################
# A fatal error has been detected by the Java Runtime Environment:


View 9 Replies View Related

Programming :: Move Line Of Pipe Delimited Flat File If Field 27 = Sold?

Sep 26, 2010

I have a pipe delimited flat file, field 27 is price. I would like to move items marked sold to a new file every couple months.

awk -F"|" '$27 == "SOLD" {print $0}' >>

Allows me to write line to new file but I need to delete the original line, I also want to make sold case insensitive tried [Ss][Oo] with no luck

View 4 Replies View Related

Programming :: Script To Delete Aligned Single-character Columns With No Field Separator?

Apr 20, 2010

The lines beginning with greater-than symbols are the sequence descriptors and the lines immediately after each descriptor with A-Z characters, dashes, and question marks are the aligned DNA sequences. The sequences are always the same length within a file and never span/wrap across more than one line.I am trying to write a script to remove positions in the sequences that are only represented by a -, X, ?, or N (these represent gaps or missing data). Also, if there is exactly one non-gap/missing character in a position it is also useless (there is nothing to compare it to) so I would like to remove those positions as well.

Position 5 (from the left) was removed because it was all gap/missing characters. Position 9 was removed because only one character was a non-gap/missing character. Position 10 was retained because there were 2 non-gap/missing characters.I'm really not sure where to start here. My first concern is I can't figure out how to tell awk to treat each character in lines not containing a greater-than symbol as a separate field. After that, I'm thinking I should use set up a counter to count the number of lines with gap/missing characters comparing that to the total number of lines not containing greater-than signs?

View 14 Replies View Related

Programming :: How To Print Out "n" Days Ago's Year / Month And Day

Feb 10, 2011

Interesting uh? For example, 2 days ago's date is 2011 Feb 8th. This is not a homework...

View 3 Replies View Related

Programming :: Out Of Range Vector Iterator?

Mar 20, 2011

I'm not really a C++ noob at all, but I am a little rusty at the moment. Still, I CANNOT figure out what is wrong with the following code. I'm using Visual Studio 2010.

Code: #include <iostream>
#include <fstream>
#include <vector>
#include <string>


I THINK I got all of the pertinent code. Anyway, it fails at the *** line. I CANNOT figure out why. If I modify it to be linein.size()-30, it STILL gives me an error. That makes zero sense.

View 3 Replies View Related

Programming :: How To Tell Java To Print 20 When Value Is In That Range

Jul 28, 2011

I've just started programming at my university and I'm finding it a bit hard to get started. I've been given this for homework.Given 2 integers, a and b, print their sum. However, sums in the range 10..19 inclusive, are forbidden, so in that case just print 20The problem I'm having is that i don't know how to tell java to print 20 when the value is in that range.

View 14 Replies View Related

Networking :: What Are Short Range Link And Long Range Links In Routing

Jun 23, 2009

get me understand the short range and the long range links from routing (and routing protocols') point of view.

View 6 Replies View Related

Software :: Gnuplot - Combining A Linear Range And Log-scale Range In The Same X-axis?

Apr 24, 2011

I want to plot a set of data in only one plot.The problem is that some points of the data should be better plotted in a linear scale (lets say 0 to 100,000) but there are other data points that, exceding the value 100,000, would be better plotted in a logarithmic scale, as they goes in the range 100,000 to 500,000,000. Let's say the data is:


0 100
10000 80
20000 75


Is there a way to plot all these points in the same plot in only one X-axis showing two different ranges in that axis: linear: 0-100,000 logarithmic: 100,000 - 1,000,000,000?The axis would be read, for example, as:

0 20k 40k 60k 80k 100k 1M 10M 100M 1G

(The abbreviations k-M-G are not the important point. Just shown for clarity)

View 2 Replies View Related

Copyrights 2005-15, All rights reserved