Sponsored Content
Full Discussion: Optimize code in single line
Top Forums UNIX for Beginners Questions & Answers Optimize code in single line Post 303044679 by jim mcnamara on Sunday 1st of March 2020 09:11:33 AM
Old 03-01-2020
Optimization does not mean condensing several readable single commands into a less readable single line - which can be harder to maintain, say, in six months. When you have forgotten about it. And you have to come back for other changes - then you wonder what this 'optimized' code really does.

Crocodile indeed.
These 3 Users Gave Thanks to jim mcnamara For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Optimize shell code

#!/usr/bin/perl use strict; use warnings; use Date::Manip; my $date_converted = UnixDate(ParseDate("3 days ago"),"%e/%h/%Y"); open FILE,">$ARGV"; while(<DATA>){ my @tab_delimited_array = split(/\t/,$_); $tab_delimited_array =~ s/^\ =~ s/^\-//; my $converted_date =... (2 Replies)
Discussion started by: sandy1028
2 Replies

2. Shell Programming and Scripting

pl help me to Optimize the given code

Pl help to me to write the below code in a simple way ... i suupose to use this code 3 to 4 places in my makefile(gnu) .. **************************************** @for i in $(LIST_A); do \ for j in $(LIST_B); do\ if ;then\ echo "Need to sign"\ echo "List A = $$i , List B =$$j"\ ... (2 Replies)
Discussion started by: pk_arun
2 Replies

3. Shell Programming and Scripting

Multiple lines in a single column to be merged as a single line for a record

Hi, I have a requirement with, No~Dt~Notes 1~2011/08/1~"aaa bbb ccc ddd eee fff ggg hhh" Single column alone got splitted into multiple lines. I require the output as No~Dt~Notes 1~2011/08/1~"aaa<>bbb<>ccc<>ddd<>eee<>fff<>ggg<>hhh" mean to say those new lines to be... (1 Reply)
Discussion started by: Bhuvaneswari
1 Replies

4. Shell Programming and Scripting

Joining multi-line output to a single line in a group

Hi, My Oracle query is returing below o/p ---------------------------------------------------------- Ins trnas value a lkp1 x a lkp1 y b lkp1 a b lkp2 x b lkp2 y ... (7 Replies)
Discussion started by: gvk25
7 Replies

5. Shell Programming and Scripting

Can someone please help me optimize my code (script searches subdirectories)?

Here is my code. What it does is it reads an input file (input.txt which contains roughly 2,000 search phrases) and searches a directory for files that contains the search phrase. The directory contains roughly 1900 files and 84 subdirectories. The output is a file (output.txt) that shows only the... (23 Replies)
Discussion started by: jl487
23 Replies

6. Shell Programming and Scripting

Formatting File having big single line into 95 Char Per Line

Hi All, I have 4 big files which contains one big line containing formatted character records, I need to format each file in such way that each File will have 95 Characters per line. Last line of each file will have newline character at end. Before:- File Name:- File1.dat 102 121340560... (10 Replies)
Discussion started by: lancesunny
10 Replies

7. Shell Programming and Scripting

sed command to grep multiple pattern present in single line and delete that line

here is what i want to achieve.. i have a file with below contents cat fileName blah blah blah . .DROP this REJECT that . --sport 7800 -j REJECT --reject-with icmp-port-unreachable --dport 7800 -j REJECT --reject-with icmp-port-unreachable . . . more blah blah blah --dport 3306... (14 Replies)
Discussion started by: vivek d r
14 Replies

8. UNIX for Dummies Questions & Answers

To find and display the middle line in a file using single line command.

Hi all, How can i display the middle line of a file using a single line command? (6 Replies)
Discussion started by: Lakme Pemmaiah
6 Replies

9. Shell Programming and Scripting

Looking to optimize code

Hi guys, I feel a bit comfortable now doing bash scripting but I am worried that the way I do it is not optimized and I can do much better as to how I code. e.g. I have a whole line in a file from which I want to extract some values. Right now what I am doing is : STATE=`cat... (5 Replies)
Discussion started by: Junaid Subhani
5 Replies

10. Shell Programming and Scripting

Optimize awk code

sample data.file: 0,mfrh_green_screen,1454687485,383934,/PROD/G/cicsmrch/sys/unikixmain.log,37M,mfrh_green_screen,28961345,0,382962--383934 0,mfrh_green_screen,1454687785,386190,/PROD/G/cicsmrch/sys/unikixmain.log,37M,mfrh_green_screen,29139568,0,383934--386190... (7 Replies)
Discussion started by: SkySmart
7 Replies
Gtk2::CellRendererText(3pm)				User Contributed Perl Documentation			       Gtk2::CellRendererText(3pm)

NAME
Gtk2::CellRendererText - wrapper for GtkCellRendererText HIERARCHY
Glib::Object +----Glib::InitiallyUnowned +----Gtk2::Object +----Gtk2::CellRenderer +----Gtk2::CellRendererText METHODS
cellrenderer = Gtk2::CellRendererText->new $renderer->set_fixed_height_from_font ($number_of_rows) o $number_of_rows (integer) PROPERTIES
'align-set' (boolean : default false : readable / writable / private) Whether this tag affects the alignment mode 'alignment' (Pango::Alignment : default "left" : readable / writable / private) How to align the lines 'attributes' (Pango::AttrList : default undef : readable / writable / private) A list of style attributes to apply to the text of the renderer 'background' (string : default undef : writable / private) Background color as a string 'background-gdk' (Gtk2::Gdk::Color : default undef : readable / writable / private) Background color as a GdkColor 'background-set' (boolean : default false : readable / writable / private) Whether this tag affects the background color 'editable' (boolean : default false : readable / writable / private) Whether the text can be modified by the user 'editable-set' (boolean : default false : readable / writable / private) Whether this tag affects text editability 'ellipsize' (Pango::EllipsizeMode : default "none" : readable / writable / private) The preferred place to ellipsize the string, if the cell renderer does not have enough room to display the entire string 'ellipsize-set' (boolean : default false : readable / writable / private) Whether this tag affects the ellipsize mode 'family' (string : default undef : readable / writable / private) Name of the font family, e.g. Sans, Helvetica, Times, Monospace 'family-set' (boolean : default false : readable / writable / private) Whether this tag affects the font family 'font' (string : default undef : readable / writable / private) Font description as a string, e.g. "Sans Italic 12" 'font-desc' (Pango::FontDescription : default undef : readable / writable / private) Font description as a PangoFontDescription struct 'foreground' (string : default undef : writable / private) Foreground color as a string 'foreground-gdk' (Gtk2::Gdk::Color : default undef : readable / writable / private) Foreground color as a GdkColor 'foreground-set' (boolean : default false : readable / writable / private) Whether this tag affects the foreground color 'language' (string : default undef : readable / writable / private) The language this text is in, as an ISO code. Pango can use this as a hint when rendering the text. If you don't understand this parameter, you probably don't need it 'language-set' (boolean : default false : readable / writable / private) Whether this tag affects the language the text is rendered as 'markup' (string : default undef : writable / private) Marked up text to render 'rise' (integer : default 0 : readable / writable / private) Offset of text above the baseline (below the baseline if rise is negative) 'rise-set' (boolean : default false : readable / writable / private) Whether this tag affects the rise 'scale' (double : default 1 : readable / writable / private) Font scaling factor 'scale-set' (boolean : default false : readable / writable / private) Whether this tag scales the font size by a factor 'single-paragraph-mode' (boolean : default false : readable / writable / private) Whether or not to keep all text in a single paragraph 'size' (integer : default 0 : readable / writable / private) Font size 'size-points' (double : default 0 : readable / writable / private) Font size in points 'size-set' (boolean : default false : readable / writable / private) Whether this tag affects the font size 'stretch' (Pango::Stretch : default "normal" : readable / writable / private) Font stretch 'stretch-set' (boolean : default false : readable / writable / private) Whether this tag affects the font stretch 'strikethrough' (boolean : default false : readable / writable / private) Whether to strike through the text 'strikethrough-set' (boolean : default false : readable / writable / private) Whether this tag affects strikethrough 'style' (Pango::Style : default "normal" : readable / writable / private) Font style 'style-set' (boolean : default false : readable / writable / private) Whether this tag affects the font style 'text' (string : default undef : readable / writable / private) Text to render 'underline' (Pango::Underline : default "none" : readable / writable / private) Style of underline for this text 'underline-set' (boolean : default false : readable / writable / private) Whether this tag affects underlining 'variant' (Pango::Variant : default "normal" : readable / writable / private) Font variant 'variant-set' (boolean : default false : readable / writable / private) Whether this tag affects the font variant 'weight' (integer : default 400 : readable / writable / private) Font weight 'weight-set' (boolean : default false : readable / writable / private) Whether this tag affects the font weight 'width-chars' (integer : default -1 : readable / writable / private) The desired width of the label, in characters 'wrap-mode' (Pango::WrapMode : default "char" : readable / writable / private) How to break the string into multiple lines, if the cell renderer does not have enough room to display the entire string 'wrap-width' (integer : default -1 : readable / writable / private) The width at which the text is wrapped SIGNALS
edited (Gtk2::CellRendererText, string, string) ENUMS AND FLAGS
enum Pango::Alignment o 'left' / 'PANGO_ALIGN_LEFT' o 'center' / 'PANGO_ALIGN_CENTER' o 'right' / 'PANGO_ALIGN_RIGHT' enum Pango::EllipsizeMode o 'none' / 'PANGO_ELLIPSIZE_NONE' o 'start' / 'PANGO_ELLIPSIZE_START' o 'middle' / 'PANGO_ELLIPSIZE_MIDDLE' o 'end' / 'PANGO_ELLIPSIZE_END' enum Pango::Stretch o 'ultra-condensed' / 'PANGO_STRETCH_ULTRA_CONDENSED' o 'extra-condensed' / 'PANGO_STRETCH_EXTRA_CONDENSED' o 'condensed' / 'PANGO_STRETCH_CONDENSED' o 'semi-condensed' / 'PANGO_STRETCH_SEMI_CONDENSED' o 'normal' / 'PANGO_STRETCH_NORMAL' o 'semi-expanded' / 'PANGO_STRETCH_SEMI_EXPANDED' o 'expanded' / 'PANGO_STRETCH_EXPANDED' o 'extra-expanded' / 'PANGO_STRETCH_EXTRA_EXPANDED' o 'ultra-expanded' / 'PANGO_STRETCH_ULTRA_EXPANDED' enum Pango::Style o 'normal' / 'PANGO_STYLE_NORMAL' o 'oblique' / 'PANGO_STYLE_OBLIQUE' o 'italic' / 'PANGO_STYLE_ITALIC' enum Pango::Underline o 'none' / 'PANGO_UNDERLINE_NONE' o 'single' / 'PANGO_UNDERLINE_SINGLE' o 'double' / 'PANGO_UNDERLINE_DOUBLE' o 'low' / 'PANGO_UNDERLINE_LOW' o 'error' / 'PANGO_UNDERLINE_ERROR' enum Pango::Variant o 'normal' / 'PANGO_VARIANT_NORMAL' o 'small-caps' / 'PANGO_VARIANT_SMALL_CAPS' enum Pango::WrapMode o 'word' / 'PANGO_WRAP_WORD' o 'char' / 'PANGO_WRAP_CHAR' o 'word-char' / 'PANGO_WRAP_WORD_CHAR' SEE ALSO
Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::CellRenderer COPYRIGHT
Copyright (C) 2003-2011 by the gtk2-perl team. This software is licensed under the LGPL. See Gtk2 for a full notice. perl v5.14.2 2012-05-27 Gtk2::CellRendererText(3pm)
All times are GMT -4. The time now is 12:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy