General :: Implementing A Variable-length List Of Keywords In Mysql?
Sep 20, 2010
I'm having a hard time googling for answers because I keep using the word "keyword."
I've never really used any kind of database before, but I want to learn the basics, so I'm playing with it a little bit at work. What I want to do is make a database to hold information on various articles. For example, with columns for the title, author, and date. Those are all easy. The tricky part is that I'd also like to be able to label articles with keywords so I can search for certain topics.
Since there's no way to know ahead of time how many keywords, if any, each article might warrant, I'm not sure how to put this in database form. There's no variable-sized array data type. It seems sloppy to just list them all in a single VARCHAR column. Making several columns that may or may not be left null and putting one keyword in each seems wasteful.
I have a question about the prompt. it is very easy to tune it for it to be colored and display path where you are etc. But my problem is that when the path is too long I would prefer the code line to be on the folowing line...
Ex 11:00 me@host a/short/path > ls -ltr ./stuff 11:00 me@host a/very/very/very/long/path > ls -ltr ./stuff
and to be honnest as I am very new in LINUX I don't know how to do this...
I want a line or lines to check for variable length in my script. I just want to check if a variable the user inputted is 4 characters long, and if it isn't to return a false or exit status of 0.
I am trying to write a Perl script that can open a file, find text that appears between two identifying strings (for now, "start" and "end"), then modify that text by enclosing it between "term_" and "_term" . Since the identified strings vary, the replacement string becomes "term_$1_term". From looking at other threads in this forum I've been able to get as far as spitting out the modified terms using the following code:
open FILE, "start2.txt" || die ("Could not open file <br> $!"); $text = <FILE>; while ($text=~ s/start (.*?) end//) {
[code]....
The problem is how to get "term_$1_term" into the file in the same while loop, which I'm guessing would be some of variant of "$text=~ s/$1/$term/;" (which doesn't work as it stands).
Myself and a friend have our own small IT business; we mainly design and build web sites for other small businesses. One of the things we would like to offer to clients is the ability to relay email addressed to their company's domain to their own personal email address (either web-based, or hosted by their ISP).
Now, clearly there is a risk of our mail relay being marked as "open", and therefore becoming black listed as a source of spam. Not something that we want to happen!setting up such a system? I understand how I would go about configuring an MTA like Postfix or Sendmail to perform such a task, but I'm unsure how I would ensure that relayed mail is delivered and we're not labeled as spammers.
I did wonder if perhaps the "mail forwarding" options in a mail server like Zimbra would get around the issue by forwarding on messages inline or as attachments within new emails (so the messages would appear to be from the account hosted on our server).
I would like to extract Room number, Lastname,Firstname,invoice (205880080),arrival date, departure date, and total(229.46). Can you at least give me a hint on how to proceed? I have tried a lot but I am stumped from the beginning.
***History*** Room: 124 B Payment: Bell/TRAVELSCAPE.COM Lastname*FIT*,Firstname 4A, 0K, 0B Guest Bell *205880080 FT Bell *205880080 July 31, 2010
Some say because the record is not in a fixed length so rec_len is the real record length. Why is the length of the array `name' not fixed? I thought C arrays like this should be fixed length. C99 has variable-length arrays, does this structure count on C99?
I know it's possible to change the $ user@hostname colors, but is it possible to color different things? Could I make all numbers/integers a certain color. Or set certain keywords to be bold?
I am not parsing on a webserver so is it possible to have both
#! /usr/bin/php & #!/bin/bash
in the same script? Alternatively, I have a current bash script that I need to get some variables from mysql and not sure how to get mysql results in bash:
Quote:
mysql -h server.net -u username1 -paaa -e "USE squid; SELECT email, usern FROM TABLE WHERE blah blah;" emailadd="resultfrom above" usern="resultfromabove"
I have successfully installed XAMPP on CentOS. I can access PHPMyadmin from my browser. So my mySQL installation is OK. I need to set Environment Variable. I am confused about the path directory.
For an example in windows the path was:
%MYSQL_HOME% -------> C:xamppmysql
What will be the path for CentOS $MYSQL_HOME? Under LAMPP folder I did not see the "mysql" folder
As far as I know, mysql has several configuration files e.g. /etc/my.cnf, ~/.my.cnf etc. But I mainly focus on /etc/my.cnf to set up global variables.
My questions are:
1/ Global variables and session variables, which one of them take precedence? 2/ How to modify session variables using option file so that when clients connect to mysql server, the session variable settings would be applied... According to mysql document, I can do this using SET statements but I prefer to do this using configuration file. Global variables settings can be done using /etc/my.cnf but session variables settings configuration files are nowhere to be found.
i am using liferay5.2(mysql included in the download pack) on fedora. while liferay is working fine but i cannot connect to mysql.i am getting the error
[ [root@localhost ~]# ln -s /var/lib/mysql/mysql.sock /tmp [root@localhost ~]# /etc/init.d/mysqld start Timeout error occurred trying to start MySQL Daemon.
[code]....
i didnt find the mysql.sock file in the location /var/lib/mysql/mysql.sock. i cannot find the portal-ext.properties file also to make intial settings.
I have been giving the task of shell scripting in C++ for implementation of Secure command in my shell. The Secure command will prompt for the filename and the password (like *****) and can only be displayed when ls -secure and password is provided. For example
I am supposed to create an environment variable with the PRINTER variable, which should resolve to the word sales. Would the command be like this?: env PRINTER - NAME=SALES (is this the command to create that variable with resolving the word sales to it?)
How can I implement logical operators in grep? I checked the man info and couldn't figure it out. For example, I'd like to display lines in file1.txt that contains word1 OR word2. cat file1.txt | grep word1 OR word2
i m trying to implement wireless sensor network in omnet++ 4.1 simulation tool but that tool is not supported.so i m installing framework mixim 1.2 in omnet++ that support wireless and mobility feature.now i have problem that how to create sensor network in omnet++4.1 using mixim 1.2?if any body
can i use the value of one variable to generate a name for another variable? for example i want to use the counter from a "do while" loop to name and define a variable each time the loop executes. for example
objectnames1=`ls -a` objectnames2=`ls -a` etc.
i don't have a script yet but each time through the loop i intend to cd to a particular directory and then define a variable containing a list of each object in that directory as values. for the rest of the script to work, each variable generated has to be unique, and i can't think of a good way to accomplish this.
if using a value from one variable to name another isn't possible, can anyone think of a more elegant solution? i know limited syntax but i'm willing to read up...
I am trying to alter the character position of residue numbers above 999 in a pdb file.The following script is an attempt to:1) Get all unique pdb residue numbers (in column 5) using awk and assign it to a variable i.2) Loop through all the values in $i and if it is greater than 999, shift that number one character to the right using sed.However, the script only manages to alter the final residue numberCould anyone please advise how I can loop through all values in $i and shift it one character to the right?
#!/bin/bash # Script to alter position of residue number in pdb file for resid above 999 i=$(awk '{print $5}' wt-test.pdb | uniq)
How can I list the following with grep. I want to extract 2 lines fron a text file The fixed known part if it exists will static text and the text line after it will change.
A sample file . . textline1
[code]....
If the fixed part does Not exist how can I return error code 1
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
At last i finish my script to find the status of the URL , in this code i used all the status codes, because of this it take too much of length. with the help of wiki only i find all the status codes.code...
Multiple dirs full of mp3s All strictly encoded with exactly the same parameters (CBR 128kbps, Joint-Stereo, etc) Is it possible to determine the total playing time (to within ~98% accuracy) by some formula based on the total file size? I say ~98% accurate since ID3 tags do consume a small amount of space.
I have a text file with 2 columns. Column A has 69,000 rows. Column B has 49,000 rows. Column A has our complete product list Column B has product list from Manufacturer 1 There are only certain/some rows which are common between 2 columns. and also, column B is not a subset of column A. Column A has extra entries and so does column B. I need to know, which rows from Column B, are common with Column A which rows from Column B are not common with Column A. Essentially I want to know from this list, how many of our products are from my manufacturer 1, how many does my manufacturer has which we dont carry.
How would I acheive this? My natural approach to solving this kind of obstacle is to reach for MS excel and use its lookup function, but its not working... Its taking forever and hanging up. since the file is so huge and probably my excel skills are really bad.
How can I do this from command line? I am looking for awk command if possible instead of sed since I am trying to pick up its syntax and usage etc. My thought process is, sort column A,B, for every row in A, lookup and output based on condition. Dont know if I am on the right track.
i've got a file with sorted words - one on each line.How could it be possible to delete thouse lines that have words of length 1 or 2 (1-2 letters). I guess a good way it will be with AWK, n its fuction length(), but getting it, i dont know how to delete those very lines.
At last i finish my script to find the status of the URL , in this code i used all the status codes, because of this it take too much of length. with the help of wiki only i find all the status codes.Quote:and my question is do we need all the status codes necessary in this script..and is there any other way to reduce the code using any conditonal statements..code...