11-01-2010
DG, not lack of iteration, but lack of capturing groups, alternation and back references is what is speeding things up dramatically is what I am finding.
The "t n b :n" bit in your suggestion is on par with my last part with the ta bit, i.e. 10% slower than without the loop.
Quote:
Originally Posted by
DGPickett
PS: How big did you expand the data set for the timings?
I used 128K lines
Last edited by Scrutinizer; 11-01-2010 at 06:02 PM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello Awk Gurus,
Can anyone of you help me with the below problem. I have got a file having data in below format
pmFaultyTransportBlocks
-----------------------
9842993
pmFrmNoOfDiscRachFrames
-----------------------
NULL
pmNoRecRandomAccSuccess
-----------------------... (4 Replies)
Discussion started by: Mohammed
4 Replies
2. Shell Programming and Scripting
Hi guys
task removing the last commas of 5th and 6th columns. The bug in the script is causing effect because of whitespaces around commas. I tried to delete white spaces first and running the above script. but still some where getting the results wrong.
I already have a script to do this... (12 Replies)
Discussion started by: repinementer
12 Replies
3. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
Problem Statement for project:
When an account is created on the CS Unix network, a
public html directory is created in the account's home directory. A default web page is put into that directory.
Some users replace or... (13 Replies)
Discussion started by: peage1475
13 Replies
4. Shell Programming and Scripting
Hi all,
I have a conf file, i want to update some entries in that conf file. Below is the code for that using a temporary file.
sed '/workgroup=/ c\workgroup=Workgroup' /usr/local/netx.conf > /usr/local/netx.conf.tmp
mv -f /usr/local/netx.conf.tmp /usr/local/netx.conf
Sample contents of... (9 Replies)
Discussion started by: ranj14r
9 Replies
5. Shell Programming and Scripting
I have two files which I would like to compare and then manipulate in a way.
File1:
pictures.txt 1.1 1.3
dance.txt 1.2 1.4
treehouse.txt 1.3 1.5
File2:
pictures.txt 1.5 ref2313 1.4 ref2345 1.3 ref5432 1.2 ref4244
dance.txt 1.6 ref2342 1.5 ref2352 1.4 ref0695 1.3 ref5738 1.2... (1 Reply)
Discussion started by: linuxkid
1 Replies
6. Shell Programming and Scripting
Hello,
i have a file, i open the file and read the line, i want to get the first item in the csv file and also teh third+6 item and wirte it to a new csv file. only problem is that using echo it takes TOO LONG:
please help a newbie. below is my code:
WorkingDir=$1
FileName=`cut -d ',' -f... (2 Replies)
Discussion started by: limamichelle
2 Replies
7. UNIX for Dummies Questions & Answers
Hello all, I need some help with sed. seems like i cant get through it. So here is what i am trying. when i do ps -ef|grep bla blah ...like below...i get /u01/app/oracle/11g/bin/tnslsnr .... but i want to replace that string with something using sed. So basically i want to get rid of... (3 Replies)
Discussion started by: abdul.irfan2
3 Replies
8. UNIX for Dummies Questions & Answers
With sed
1. I need to find a line that contains "DVM" and "73069".
2. I need to insert a double quote at the beginning of the first line of the file.
These two have been driving me crazy for the last 45 minutes. Any help would be greatly appreciated.
Thanks (3 Replies)
Discussion started by: nlassiter
3 Replies
9. Shell Programming and Scripting
HI All,
I am new to unix. I have a file would like to do some editing by using awk, cut and sed. Could anyone help?
This file contain 100 lines. There are one line for example:
2,"102343454",5060,"579668","579668","579668","SIP",,,"825922","035885221283026",1,268,"00:59:00.782 APR 17... (2 Replies)
Discussion started by: mimilaw
2 Replies
10. Shell Programming and Scripting
{
"AFafa": "FAFA","AFafa": "FAFA"
"baseball":"soccer","wrestling":"dancing"
"rhinos":"crocodiles","roles":"foodchain"
}
I need to insert a new line before the closing brackets "}" so that the final output looks like this:
{
"AFafa": "FAFA","AFafa": "FAFA"... (6 Replies)
Discussion started by: SkySmart
6 Replies
LEARN ABOUT CENTOS
set_color_conversion
set_color_conversion(3alleg4) Allegro manual set_color_conversion(3alleg4)
NAME
set_color_conversion - Tells Allegro how to convert images during loading time.
SYNOPSIS
#include <allegro.h>
void set_color_conversion(int mode);
DESCRIPTION
Specifies how to convert images between the various color depths when reading graphics from external bitmap files or datafiles. The mode is
a bitmask specifying which types of conversion are allowed. If the appropriate bit is set, data will be converted into the current pixel
format (selected by calling the set_color_depth() function), otherwise it will be left in the same format as the disk file, leaving you to
convert it manually before the graphic can be displayed. The default mode is total conversion, so that all images will be loaded in the
appropriate format for the current video mode. Valid bit flags are:
COLORCONV_NONE // disable all format
// conversions
COLORCONV_8_TO_15 // expand 8-bit to 15-bit
COLORCONV_8_TO_16 // expand 8-bit to 16-bit
COLORCONV_8_TO_24 // expand 8-bit to 24-bit
COLORCONV_8_TO_32 // expand 8-bit to 32-bit
COLORCONV_15_TO_8 // reduce 15-bit to 8-bit
COLORCONV_15_TO_16 // expand 15-bit to 16-bit
COLORCONV_15_TO_24 // expand 15-bit to 24-bit
COLORCONV_15_TO_32 // expand 15-bit to 32-bit
COLORCONV_16_TO_8 // reduce 16-bit to 8-bit
COLORCONV_16_TO_15 // reduce 16-bit to 15-bit
COLORCONV_16_TO_24 // expand 16-bit to 24-bit
COLORCONV_16_TO_32 // expand 16-bit to 32-bit
COLORCONV_24_TO_8 // reduce 24-bit to 8-bit
COLORCONV_24_TO_15 // reduce 24-bit to 15-bit
COLORCONV_24_TO_16 // reduce 24-bit to 16-bit
COLORCONV_24_TO_32 // expand 24-bit to 32-bit
COLORCONV_32_TO_8 // reduce 32-bit RGB to 8-bit
COLORCONV_32_TO_15 // reduce 32-bit RGB to 15-bit
COLORCONV_32_TO_16 // reduce 32-bit RGB to 16-bit
COLORCONV_32_TO_24 // reduce 32-bit RGB to 24-bit
COLORCONV_32A_TO_8 // reduce 32-bit RGBA to 8-bit
COLORCONV_32A_TO_15 // reduce 32-bit RGBA to 15-bit
COLORCONV_32A_TO_16 // reduce 32-bit RGBA to 16-bit
COLORCONV_32A_TO_24 // reduce 32-bit RGBA to 24-bit
COLORCONV_DITHER_PAL // dither when reducing to 8-bit
COLORCONV_DITHER_HI // dither when reducing to
// hicolor
COLORCONV_KEEP_TRANS // keep original transparency
For convenience, the following macros can be used to select common combinations of these flags:
COLORCONV_EXPAND_256 // expand 256-color to hi/truecolor
COLORCONV_REDUCE_TO_256 // reduce hi/truecolor to 256-color
COLORCONV_EXPAND_15_TO_16 // expand 15-bit hicolor to 16-bit
COLORCONV_REDUCE_16_TO_15 // reduce 16-bit hicolor to 15-bit
COLORCONV_EXPAND_HI_TO_TRUE // expand 15/16-bit to 24/32-bit
COLORCONV_REDUCE_TRUE_TO_HI // reduce 24/32-bit to 15/16-bit
COLORCONV_24_EQUALS_32 // convert between 24- and 32-bit
COLORCONV_TOTAL // everything to current format
COLORCONV_PARTIAL // convert 15 <-> 16-bit and
// 24 <-> 32-bit
COLORCONV_MOST // all but hi/truecolor <-> 256
COLORCONV_DITHER // dither during all color reductions
COLORCONV_KEEP_ALPHA // convert everything to current format
// unless it would lose alpha information
If you enable the COLORCONV_DITHER flag, dithering will be performed whenever truecolor graphics are converted into a hicolor or paletted
format, including by the blit() function, and any automatic conversions that take place while reading graphics from disk. This can produce
much better looking results, but is obviously slower than a direct conversion.
If you intend using converted bitmaps with functions like masked_blit() or draw_sprite(), you should specify the COLORCONV_KEEP_TRANS flag.
It will ensure that the masked areas in the bitmap before and after the conversion stay exactly the same, by mapping transparent colors to
each other and adjusting colors which would be converted to the transparent color otherwise. It affects every blit() operation between dis-
tinct pixel formats and every automatic conversion.
SEE ALSO
set_color_depth(3alleg4), load_bitmap(3alleg4), load_datafile(3alleg4), fixup_datafile(3alleg4), makecol15_dither(3alleg4), get_color_con-
version(3alleg4), exalpha(3alleg4), exblend(3alleg4), exdata(3alleg4), exexedat(3alleg4), exlights(3alleg4), exrotscl(3alleg4),
exxfade(3alleg4)
Allegro version 4.4.2 set_color_conversion(3alleg4)