Categories
askquestion

Add last n lines of files to tar/zip

Add last n lines of files to tar/zip

Ask Question

Asked
11 years ago

Active
1 year, 9 months ago

Viewed
628 times

.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
margin-bottom:0;
}

0

I need to regularly send a collection of log files that can grow quite large, so I would like to only send the last n lines of the each of the files.

for example:

/usr/local/data_store1/file.txt (500 lines)
/usr/local/data_store2/file.txt (800 lines)

Given a file with a list of needed files named files.txt, I would like to create an archive (tar or zip) with the last 100 lines of each of those files.

I can do this by creating a separate directory structure with the tail-ed files, but that seems like a waste of resources when there’s probably some piping magic that can happen to accomplish it. Full directory structure also must be preserved since files can have the same names in different directories.

I would like the solution to be a shell script if possible, but perl (without added modules) is also acceptable (this is for Solaris machines that don’t have ruby/python/etc.. installed on them.)

unix shell zip tar

share|improve this question

edited May 4 ’18 at 14:13

Paul Floyd

3,04333 gold badges2222 silver badges3535 bronze badges

asked Feb 5 ’09 at 15:52

Dan McNevinDan McNevin

21.4k44 gold badges3232 silver badges2828 bronze badges

add a comment
 | 

5 Answers
5

active

oldest

votes

1

You could try

tail -n 10 your_file.txt | while read line; do zip /tmp/a.zip $line; done

where a.zip is the zip file and 10 is n or

tail -n 10 your_file.txt | xargs tar -czvf test.tar.gz —

for tar.gz

share|improve this answer

edited Feb 5 ’09 at 16:03

answered Feb 5 ’09 at 15:58

Johannes WeissJohannes Weiss

43.7k1414 gold badges9191 silver badges124124 bronze badges

add a comment
 | 

1

You are focusing in an specific implementation instead of looking at the bigger picture.

If the final goal is to have an exact copy of the files on the target machine while minimizing the amount of data transfered, what you should use is rsync, which automatically sends only the parts of the files that have changed and also can automatically compress while sending and decompress while receiving.

Running rsync doesn’t need any more daemons on the target machine that the standard sshd one, and to setup automatic transfers without passwords you just need to use public key authentication.

share|improve this answer

answered May 18 ’09 at 20:24

windenwinden

2,11711 gold badge1212 silver badges66 bronze badges

add a comment
 | 

0

There is no piping magic for that, you will have to create the folder structure you want and zip that.

mkdir tmp
for i in /usr/local/*/file.txt; do
mkdir -p “`dirname tmp/${i:1}`”
tail -n 100 “$i” > “tmp/${i:1}”
done
zip -r zipfile tmp/*

share|improve this answer

edited Feb 5 ’09 at 16:56

answered Feb 5 ’09 at 16:06

soulmergesoulmerge

65.2k1717 gold badges108108 silver badges144144 bronze badges

add a comment
 | 

0

Use logrotate.

Have a look inside /etc/logrotate.d for examples.

share|improve this answer

answered Feb 5 ’09 at 20:03

hendryhendry

7,2771111 gold badges5656 silver badges9090 bronze badges

add a comment
 | 

-1

Why not put your log files in SCM?

Your receiver creates a repository on his machine from where he retrieves the files by checking them out.

You send the files just by commiting them. Only the diff will be transmitted.

share|improve this answer

answered Feb 5 ’09 at 16:01

mouvicielmouviciel

59.6k1010 gold badges9999 silver badges133133 bronze badges

Yes. And this is extremely easy to implement and to use, given that cvs or svn is already installed of course.

– mouviciel
Feb 5 ’09 at 21:02

It’s definitely an interesting solution, but not really applicable for this case. I need to tar up logs to send to an external support origination on an infrequent basis. I also don’t want to send gigantic logs, just the last few lines when an error occurs.

– Dan McNevin
Feb 5 ’09 at 22:30

add a comment
 | 

Your Answer

Thanks for contributing an answer to Stack Overflow!Please be sure to answer the question. Provide details and share your research!But avoid …Asking for help, clarification, or responding to other answers.Making statements based on opinion; back them up with references or personal experience.To learn more, see our tips on writing great answers.

Draft saved
Draft discarded

Sign up or log in

Sign up using Google

Sign up using Facebook

Sign up using Email and Password

Submit

Post as a guest

Name

Email
Required, but never shown

Post Your Answer

Discard

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you’re looking for? Browse other questions tagged unix shell zip tar or ask your own question.

Blog

Podcast: Coaching a Developer Interview

Trying to find your first dev job? Here’s what employers are actually looking…

Featured on Meta

TLS 1.0 and TLS 1.1 removal for Stack Exchange services

How do the moderator resignations affect me and the community?

Linked

0

how to tar last few lines

Related

828Shell command to sum integers, one per line?1414Why should text files end with a newline?615How can I reverse the order of lines in a file?778Shell command to tar directory excluding certain files/folders1572How to count all the lines of code in a directory recursively?1310Looping through the content of a file in Bash1722Delete lines in a text file that contain a specific string1768How can I recursively find all files in current and subfolders based on wildcard matching?249Tar a directory, but don’t store full absolute paths in the archive932How are zlib, gzip and zip related? What do they have in common and how are they different?

Hot Network Questions

Jumping off of a cliff into water – survival tips

How to make Minimize with Sqrt calculate faster?

Conceptual reason that monadic functors create limits?

Why is carbon dioxide a non-polar molecule?

ASCII Pizza (no pineapple)

How to indicate that “I need more time to consider your draw offer” in a formal game?

Can a university legally enforce a policy preventing students from creating their own wireless networks?

Where to store passport during day trip in foreign country

What’s the difference between “люблю” and “обожаю”?

Difference between hfil and hfill

I need to examine an 82.7 GB (!) text file. What can open it?

What is the word for an animal species which only eats one type of food?

Can a Loxodon PC wield a 2-handed sword and a shield with one hand and their trunk?

Supermarket Product Inventory Management with Polymorphic Product Types

What is the moustache mode in Plants vs Zombies?

Why is learning mathematics compulsory?

Managing New Player “Murder Hobos”

Why does the same proportion of a radioactive substance decay per time period? (half life)

Are There Energy Monitoring Smart Plugs That Don’t Compromise my Privacy/Security?

Can a professor tell you that you can’t use your phone before or after their class?

Egg, sausage, bacon and spam (lovely spam!)

Any tips for photographing a political rally?

Where in Sphere-Space is Telene?

Is this violation of academic integrity if I ask a question on Github public repository and post it as an issue?

more hot questions

Question feed

Subscribe to RSS

Question feed
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

lang-sh

Categories
askquestion

Create a semi-transparent cursor from an image

Create a semi-transparent cursor from an image

Ask Question

Asked
11 years ago

Active
3 years, 6 months ago

Viewed
9k times

.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
margin-bottom:0;
}

9

3

Is it possible to create a cursor from an image and have it be semi-transparent?

I’m currently taking a custom image and overylaying the mouse cursor image. It would be great if I could make this semi-transparent, but not necessary. The sales guys love shiny.

Currently doing something like this:

Image cursorImage = customImage.GetThumbnailImage(300, 100, null, IntPtr.Zero);
cursorImage.SetResolution(96.0F, 96.0F);
int midPointX = cursorImage.Width / 2;
int midPointY = cursorImage.Height / 2;
Bitmap cursorMouse = GetCursorImage(cursorOverlay);
Graphics cursorGfx = Graphics.FromImage(cursorImageCopy);
cursorGfx.DrawImageUnscaled(cursorMouse, midPointX, midPointY);

Cursor tmp = new Cursor(cursorImage.GetHicon());

alt text http://members.cox.net/dustinbrooks/drag.jpg

c# winforms cursor transparency

share|improve this question

edited May 1 ’14 at 7:27

tshepang

9,8051919 gold badges7575 silver badges118118 bronze badges

asked Feb 5 ’09 at 15:54

Dustin BrooksDustin Brooks

2,36722 gold badges2121 silver badges3232 bronze badges

add a comment
 | 

4 Answers
4

active

oldest

votes

6

I’ve tried following example, and it was working fine…

public struct IconInfo
{
public bool fIcon;
public int xHotspot;
public int yHotspot;
public IntPtr hbmMask;
public IntPtr hbmColor;
}

[DllImport(“user32.dll”)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetIconInfo(IntPtr hIcon, ref IconInfo pIconInfo);

[DllImport(“user32.dll”)]
public static extern IntPtr CreateIconIndirect(ref IconInfo icon);

public static Cursor CreateCursor(Bitmap bmp, int xHotSpot, int yHotSpot)
{
IntPtr ptr = bmp.GetHicon();
IconInfo tmp = new IconInfo();
GetIconInfo(ptr, ref tmp);
tmp.xHotspot = xHotSpot;
tmp.yHotspot = yHotSpot;
tmp.fIcon = false;
ptr = CreateIconIndirect(ref tmp);
return new Cursor(ptr);
}

And i’ve put this on button click event (you can call from where you like):

Bitmap b = new Bitmap(“D:/Up.png”);
this.Cursor = CreateCursor(b, 5, 5);

And the Up.png image is saved with 75% opacity in AdobePhotoshop.

share|improve this answer

edited May 17 ’12 at 2:58

azian.otaku

9722 silver badges1515 bronze badges

answered Sep 11 ’09 at 6:52

ZokiManasZokiManas

68255 silver badges88 bronze badges

add a comment
 | 

0

On the top of my head (I would try that first):

create new bitmap with same size as original, but with ARGB structure
drawimage: existing bitmap to the new bitmap
access raw bitmap data, and replace A bytes with 128

You should have nice semitransparent bitmap there.

If performance allows, you can scan for fully transparent pixels and set A to zero for them!

share|improve this answer

answered Sep 4 ’09 at 21:39

Daniel MošmondorDaniel Mošmondor

18.2k1111 gold badges5151 silver badges9494 bronze badges

add a comment
 | 

0

If you want to set transparency of a custom mouse cursor bitmap ‘on the fly’ you may find this function helpful. It uses a color matrix to set the amount of transparency to any given bitmap and will return the modified one. To have just a touch of transparency the TranspFactor should be between 225 and 245, just try it out. (You need to import System.Drawing and System.Drawing.Imaging)

public static Bitmap GetBMPTransparent(Bitmap bmp, int TranspFactor)

{

Bitmap transpBmp = new Bitmap(bmp.Width, bmp.Height);
using (ImageAttributes attr = new ImageAttributes()) {
ColorMatrix matrix = new ColorMatrix { Matrix33 = Convert.ToSingle(TranspFactor / 255) };
attr.SetColorMatrix(matrix);
using (Graphics g = Graphics.FromImage(transpBmp)) {
g.DrawImage(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height), 0, 0, bmp.Width, bmp.Height, GraphicsUnit.Pixel, attr);
}
}
return transpBmp;

}

share|improve this answer

edited Aug 9 ’16 at 13:56

answered Aug 9 ’16 at 13:42

pewehhpewehh

122 bronze badges

add a comment
 | 

-2

that is very easy, I don’t use API.

the code is

Bitmap img = new Bitmap(new Bitmap(@”image.png”), 30, 30); //this is the size of cursor

Icon icono = Icon.FromHandle(img.GetHicon()); //create the Icon object

Cursor = new Cursor(icono.Handle); //the icon Object has the stream to create a Cursor.

I hope that is your solution

share|improve this answer

edited Sep 21 ’12 at 18:10

Gonzalo.-

10.4k44 gold badges4343 silver badges7171 bronze badges

answered Sep 21 ’12 at 17:23

MC.Martin Sarabia AquinoMC.Martin Sarabia Aquino

11

add a comment
 | 

Your Answer

Thanks for contributing an answer to Stack Overflow!Please be sure to answer the question. Provide details and share your research!But avoid …Asking for help, clarification, or responding to other answers.Making statements based on opinion; back them up with references or personal experience.To learn more, see our tips on writing great answers.

Draft saved
Draft discarded

Sign up or log in

Sign up using Google

Sign up using Facebook

Sign up using Email and Password

Submit

Post as a guest

Name

Email
Required, but never shown

Post Your Answer

Discard

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you’re looking for? Browse other questions tagged c# winforms cursor transparency or ask your own question.

Blog

Podcast: Coaching a Developer Interview

Trying to find your first dev job? Here’s what employers are actually looking…

Featured on Meta

TLS 1.0 and TLS 1.1 removal for Stack Exchange services

How do the moderator resignations affect me and the community?

Linked

3

WPF Adorners in WinForms

Related

1841How do I create an Excel (.XLS and .XLSX) file in C# without installing Microsoft Office?881Creating a byte array from a stream1361How do I update the GUI from another thread?1755Get int value from enum in C#248How can I make the cursor turn to the wait cursor?1Am I responsible for Disposing a BackgroundImage?405SVG fill color transparency / alpha?602How to make a background 20% transparent on Android19How do I draw a rectangle onto an image with transparency and text

Hot Network Questions

Does the Z80 allow interrupts after processing and ignoring a 0xdd prefix?

I need to examine an 82.7 GB (!) text file. What can open it?

Why do airliners park with the nose facing the terminal?

What is the moustache mode in Plants vs Zombies?

What happens to Victor Creed after “X-Men Origins: Wolverine”?

ASCII Pizza (no pineapple)

How to use rounding with 6809 multiplication

Integrating acceleration – wrong choice of bounds in textbooks?

First treatment of autism in speculative fiction

Why is offering draw not recorded but giving a check recorded?

Is Planning Poker Bad for Software Development Teams?

How to deal with parents that enforce a curfew on an adult

In a mathematics publication, is it preferable to state all definitions immediately, or as they arise?

Why did equal temperament become the standard tuning system for keyboard instruments?

Can a Loxodon PC wield a 2-handed sword and a shield

Why do goblins never form societies bigger than about 500 members?

What is the word for an animal species which only eats one type of food?

Why did the Z80 with 4-bit ALU out-perform the fully 8-bit Intel 8080?

Incorporating fruits in creme brulee

Why do most countries have so many members of parliament?

What verb forms εἴσηκται as 3 s pf m/p?

Is this picture of Trump, Bloomberg, and Clinton playing golf real?

I hate Valentine’s Day

When a spell asks for targets, can I choose the same target multiple times?

more hot questions

Question feed

Subscribe to RSS

Question feed
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

lang-cs

Categories
askquestion

Is there a “canonical” name for a function combining min() and max()?

Is there a “canonical” name for a function combining min() and max()?

Ask Question

Asked
11 years ago

Active
5 years, 9 months ago

Viewed
2k times

.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
margin-bottom:0;
}

23

2

I find that I frequently end up writing a function that I always call “clamp()”, that is kind of a combination of min() and max(). Is there a standard, “canonical” name for this function?

It always looks something like this:

function clamp($val, $lower, $upper)
{
if ($val < $lower)
return $lower;
else if ($val > $upper)
return $upper;
else
return $val;
}

Or simply using built-in min() and max() functions:

function clamp($val, $lower, $upper)
{
return max($lower, min($upper, $val));
}

Variations exist: You can also check for invalid input, where lower > upper, and either throw an exception or reverse the inputs. Or you can ignore order of the inputs and call it a median-of-three function, but that can be confusing.

language-agnostic standards nomenclature

share|improve this question

edited Oct 18 ’12 at 18:38

Kip

asked Feb 5 ’09 at 15:55

KipKip

92.5k7979 gold badges215215 silver badges254254 bronze badges

I’d avoid giving your parameters the same names as the functions used, particularly as they’re not used in matching pairs (i.e. $min is used with max() and vice-versa). Perhaps $lower and $upper, instead.

– Ben Blank
Feb 5 ’09 at 16:39

@BenBlank: good idea. edited the question

– Kip
Oct 18 ’12 at 18:39

I use the name InRange() but my comment is not about the name, it is about the ordering of the parameters. I find it easier to read: InRange(min,value,max) than (value,min,max)

– Manuel Gonzalez
Oct 24 ’12 at 18:39

add a comment
 | 

8 Answers
8

active

oldest

votes

37

clamp is a good name.

Let us make it the standard.

share|improve this answer

answered Feb 5 ’09 at 16:00

NiyazNiyaz

45.6k5454 gold badges139139 silver badges179179 bronze badges

2

Seems to be standard (at least in graphics) already: en.wikipedia.org/wiki/Clamping_%28graphics%29

– Zach Scrivena
Feb 5 ’09 at 16:05

Kind of a great name after I understood what it was. Plus one to the standard.

– Rodrigo
Feb 5 ’09 at 16:10

1

I think “clip” is more commonly used.

– John D. Cook
Feb 5 ’09 at 16:29

Numbers may be clamped, while images may be clipped.

– yfeldblum
Jul 9 ’09 at 16:44

1

C++17 has std::clamp.

– Knu
Jun 28 ’16 at 2:46

add a comment
 | 

5

In some languages you have the function limit

num = limit(val, min, max)

share|improve this answer

answered Feb 5 ’09 at 16:06

Jim CJim C

5,0011818 silver badges2525 bronze badges

add a comment
 | 

3

clip(val, lo, hi)

share|improve this answer

answered Feb 5 ’09 at 16:26

jfsjfs

304k115115 gold badges746746 silver badges13531353 bronze badges

add a comment
 | 

1

We use pin here. Actually, we use pin for simple ranges and clamp for other stuff.

share|improve this answer

answered Feb 5 ’09 at 16:43

MSNMSN

46.9k77 gold badges6565 silver badges9494 bronze badges

add a comment
 | 

0

I’d just go for a function name “rangeCheck”

share|improve this answer

answered Feb 5 ’09 at 15:59

tehvantehvan

8,62344 gold badges2424 silver badges3131 bronze badges

1

not good, rangeCheck sounds like it CHECKS. But what it does is CHANGING values to be in a range.

– Thorsten79
Feb 5 ’09 at 16:03

add a comment
 | 

0

median

Because it generalizes to more values.

share|improve this answer

answered Feb 5 ’09 at 16:41

Craig GidneyCraig Gidney

15.3k44 gold badges5757 silver badges119119 bronze badges

1

This isn’t about finding statistical information about a sample set. It’s about forcing a number to be in a particular range.

– MSN
Feb 5 ’09 at 16:44

2

@MSN: technically median(val, min, max) will do the same thing as clamp(val, min, max). plus, the order of the parameters to median() wouldn’t matter. but that’s not immediately obvious (at least, it wasn’t to me).

– Kip
Feb 5 ’09 at 17:46

Median has the advantage of being self descriptive. You get the median element back. For example, will “clamp” throw an exception if my min is less than my max? In that case, which argument is the min? First or second? These details might change from place to place.

– Craig Gidney
Feb 6 ’09 at 1:25

I must disagree with median being self descriptive, since we don’t want the median of a given set of values, but clamp a given value to some boundaries. While that may be the same operation internally (well not exactly, but close enough), the purpose of that median call wouldn’t be as clear as for example clamp, so it gets harder for other people to read the code.

– Grizzly
Dec 31 ’09 at 13:12

add a comment
 | 

0

What about bound?

bound(min, val, max)

Or constrain?

constrain(val, min, max)

share|improve this answer

edited Oct 24 ’12 at 2:43

answered Oct 17 ’12 at 19:14

KnuKnu

13.4k55 gold badges5252 silver badges8282 bronze badges

add a comment
 | 

0

What do you think of things like InRangeClosestTo(Number, RangeLowerBound, RangeUpperBound), or ClosestInRange(Number, LowerBoundOfRange, UpperBoundOfRange)? They mean ‘Get me the element of the range closest to the number’, as I hope is obvious.

The concept is more precise than a Clamp that yeah has two sides but not much more, or a Limit or Bound that might not want to return anything if the number is not within the range,

To me they are clearer then the rest I saw; although it can take a couple of seconds to understand them, you only need to reason about the name, and at most have a brief look at the comment for confirmation; and it’s nice when you see how precise it is (it is precise, right?).

You might only have doubts on whether the range is inclusive or not, but I think most people would correctly assume it’s inclusive. Alternatively you might use InInclRangeClosestTo and InExclRangeClosestTo, althought I don’t see a lot of uses for exclusive ranges.

Of course you should have an auto-completing IDE if you wanted to use them.

share|improve this answer

edited Apr 30 ’14 at 14:57

answered Apr 17 ’14 at 20:18

gbrgbr

99444 silver badges2323 bronze badges

add a comment
 | 

Your Answer

Thanks for contributing an answer to Stack Overflow!Please be sure to answer the question. Provide details and share your research!But avoid …Asking for help, clarification, or responding to other answers.Making statements based on opinion; back them up with references or personal experience.To learn more, see our tips on writing great answers.

Draft saved
Draft discarded

Sign up or log in

Sign up using Google

Sign up using Facebook

Sign up using Email and Password

Submit

Post as a guest

Name

Email
Required, but never shown

Post Your Answer

Discard

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you’re looking for? Browse other questions tagged language-agnostic standards nomenclature or ask your own question.

Blog

Community working group updates: February 2020

Podcast: Coaching a Developer Interview

Featured on Meta

TLS 1.0 and TLS 1.1 removal for Stack Exchange services

How do the moderator resignations affect me and the community?

Linked

31

How to force a number to be in a range in C#?

Related

732What is a lambda (function)?780Should a function have only one return statement?1702What’s the difference between a method and a function?669What is a callback function?211File name? Path name? Base name? Naming standard for pieces of a path286Coding Conventions – Naming Enums45International phone number max and min?337How to explain callbacks in plain english? How are they different from calling one function from another function?

Hot Network Questions

Are There Energy Monitoring Smart Plugs That Don’t Compromise my Privacy/Security?

Contractor day rate – calculating based off pro rata annual ‘salary’

What happens to Victor Creed after “X-Men Origins: Wolverine”?

What verb forms εἴσηκται as 3 s pf m/p?

Can a university legally enforce a policy preventing students from creating their own wireless networks?

What is the moustache mode in Plants vs Zombies?

set duo tone color of fontawesome5 duotone icons

Three way switch with two common wires?

Any tips for photographing a political rally?

Where to sell metals with numismatic value

What is right way to set up King & Queen In the beginning of game?

Has any accident been prevented by bending or breaking the rules?

Were Vietnam veterans spat on?

My name is akin to my size

Is there a good way to communicate choose at least one?

Where in Sphere-Space is Telene?

How to use rounding with 6809 multiplication

Octahedra+tetrahedra space-filling tessellations in 3D

Is Planning Poker Bad for Software Development Teams?

Is this violation of academic integrity if I ask a question on Github public repository and post it as an issue?

Detect manual changes to an autogenerated C header

Daily magnitude of Betelgeuse

Apocryphal (?) tale of hard drive platter propelled through a wall?

Conceptual reason that monadic functors create limits?

more hot questions

Question feed

Subscribe to RSS

Question feed
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Categories
askquestion

Is there a Vim equivalent to the Linux/Unix “fold” command?

Is there a Vim equivalent to the Linux/Unix “fold” command?

Ask Question

Asked
11 years ago

Active
4 years, 5 months ago

Viewed
779 times

.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
margin-bottom:0;
}

6

3

I realize there’s a way in Vim to hide/fold lines, but what I’m looking for is a way to select a block of text and have Vim wrap lines at or near column 80.

Mostly I want to use this on comments in situations where I’m adding some text to an existing comment that pushes it over 80 characters. It would also be nice if it could insert the comment marker at the beginning of the line when it wraps too. Also I’d prefer the solution to not autowrap the entire file since I have a particular convention that I use when it comes to keeping my structured code under the 80 character line-length.

This is mostly for Python code, but I’m also interested in learning the general solution to the problem in case I have to apply it to other types of text.

python vim formatting comments word-wrap

share|improve this question

edited Aug 8 ’12 at 18:02

Keith Pinson

6,37155 gold badges4747 silver badges9191 bronze badges

asked Feb 5 ’09 at 15:56

Joe HollowayJoe Holloway

23k1212 gold badges7474 silver badges8989 bronze badges

add a comment
 | 

2 Answers
2

active

oldest

votes

11

gq

It’s controlled by the textwidth option, see “:help gq” for more info.

gq will work on the current line by default, but you can highlight a visual block with Ctrl+V and format multiple lines / paragraphs like that.

gqap does the current “paragraph” of text.

share|improve this answer

edited Sep 17 ’15 at 22:25

Sagar Jain

5,61177 gold badges3737 silver badges6969 bronze badges

answered Feb 5 ’09 at 16:02

Philip ReynoldsPhilip Reynolds

8,76433 gold badges2525 silver badges3535 bronze badges

add a comment
 | 

0

Take a look at “:help =” and “:help ‘equalprg”

:set equalprg=fold

and in normal mode == filters the current line through the external fold program. Or visual-select something and hit =

share|improve this answer

answered Feb 6 ’09 at 12:12

user55400user55400

3,44511 gold badge1818 silver badges1313 bronze badges

add a comment
 | 

Your Answer

Thanks for contributing an answer to Stack Overflow!Please be sure to answer the question. Provide details and share your research!But avoid …Asking for help, clarification, or responding to other answers.Making statements based on opinion; back them up with references or personal experience.To learn more, see our tips on writing great answers.

Draft saved
Draft discarded

Sign up or log in

Sign up using Google

Sign up using Facebook

Sign up using Email and Password

Submit

Post as a guest

Name

Email
Required, but never shown

Post Your Answer

Discard

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you’re looking for? Browse other questions tagged python vim formatting comments word-wrap or ask your own question.

Blog

Community working group updates: February 2020

Podcast: Coaching a Developer Interview

Featured on Meta

TLS 1.0 and TLS 1.1 removal for Stack Exchange services

How do the moderator resignations affect me and the community?

Related

1902How to replace a character by a newline in Vim1597Duplicate a whole line in Vim4711Calling an external command from Python107What is the recommended way to use Vim folding for Python code1854Vim clear last search highlighting1112What’s a quick way to comment/uncomment lines in Vim?1614How to do case insensitive search in Vim1372How does the vim “write with sudo” trick work?1061What is the difference between the remap, noremap, nnoremap and vnoremap mapping commands in Vim?3626How do I exit the Vim editor?

Hot Network Questions

Linux backup utility for incremental backups

Is this picture of Trump, Bloomberg, and Clinton playing golf real?

What is the word for an animal species which only eats one type of food?

Single NPN or NPN+PNP (push pull) to drive a P-MOSFET

Drawing from the Deck of Many Things with a Simulacrum

Siunitx comma as separator in unit exponent

My name is akin to my size

Why doesn’t the ‘bm’ package work with the ‘unicode-math’ package?

Is there any material which cannot be cut by a lightsaber?

How does the Control Weather spell interact with the Dispel Magic spell?

Why did the Germans use the Enigma machine rather than the far superior “Lorenz” cipher machine?

If a device is rated at 12 V/80 mA what does that mean as far as the length of time that it will draw 80 mA?

Looking for an Animated Children’s TV Show about Time Travel

Dystopia of a world where old people get killed

Why is carbon dioxide a non-polar molecule?

Why do airliners park with the nose facing the terminal?

Why does adverse yaw exist?

When is it appropriate to introduce a new layer of abstraction into a class hierarchy?

Why do goblins never form societies bigger than about 500 members?

Can a pilot initiate an enroute descent to an IAF without ATC ‘s approval?

Why is late Russian Empire associated with Byzantium while having little in common with it?

Any tips for photographing a political rally?

Can I use 12-2 wire on a 20amp breaker to power an entire bathroom?

Managing New Player “Murder Hobos”

more hot questions

Question feed

Subscribe to RSS

Question feed
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

lang-py

Categories
askquestion

How do I add more than one project/solution on the same path to TFS

How do I add more than one project/solution on the same path to TFS

Ask Question

Asked
11 years ago

Active
4 years ago

Viewed
629 times

.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
margin-bottom:0;
}

2

2

I am working on a C# project which must be built for more than one platform (.Net and CF.Net) and from past experiences I have found that the best approach that works for me is to have multiple parallel solutions present side by side in the same folder corresponding to each platform. All the code files, resources etc are shared by these projects/solutions and are common for all parallel projects.

Eg.

/SolutionFolder
MySolution.sln
MySolution_CE.sln
/MyProject
MyProject.csproj
MyProject_CE.csproj

Now the problem is once I add MySolution.sln to source control I cannot add MySolution_CE.sln. It says something on the lines of “Cannot add two solutions on the same path”.

<edit>
To answer ctake’s question, I am trying to add the solution from VS2008 by right clicking on the solution and saying “Add to source control”.

Also I forgot to mention that I added the solutions manually anyway but VS2008 does not bind to this solution i.e. the files cannot be checked in/out from these “forced” solutions from within VS2008.
</edit>

visual-studio-2008 tfs

share|improve this question

edited Feb 18 ’16 at 15:52

Daniel Mann

44.9k1010 gold badges7676 silver badges9696 bronze badges

asked Feb 5 ’09 at 15:57

AutodidactAutodidact

23.8k1515 gold badges5959 silver badges7979 bronze badges

1

We have a large number of solutions in the same TFS folder. Can you give more details on how you’re adding to TFS and what the actual error is?

– ctacke
Feb 5 ’09 at 16:01

add a comment
 | 

3 Answers
3

active

oldest

votes

1

Try using the command line tools – tf.exe, and then setting up the bindings by using the File/Source Controls/Change Source Control… dialog once you’ve opened the unbound solution.

share|improve this answer

answered Feb 15 ’09 at 19:15

Dominic HoptonDominic Hopton

7,12411 gold badge1919 silver badges2929 bronze badges

add a comment
 | 

1

Ok, here is a possible work around to this problem. Needless to say it’s inelegant but it works nevertheless without going through the pains of writing a custom source control addin for VS2008…

Steps:
1. Open MySolution.sln in visual studio and then say add to source control then check in the first version.
2. Goto File->Source Control->Change Source control and unbind the solution from the source control.
3. Close the MySolution.sln
4. Open MySolution_CE.sln
5. Goto File->Source Control->Change Source control and bind the solution from the source control by clicking on Bind VS2008 should pick up the correct bindings automatically if the dir structure mentioned in the question was adhered to.
6. Add CE specific files to the solutions/projects and do an initial checkin.
7. Repeat this bind/unbind operation each time you wish to do a checkin from the other solution (I know this is a pain).

Hope this helps.

share|improve this answer

answered Mar 23 ’09 at 16:37

AutodidactAutodidact

23.8k1515 gold badges5959 silver badges7979 bronze badges

add a comment
 | 

1

The “Add Solution To Source Control” wizard isn’t really necessary if you are using TFS + you already have workspace mappings set up. (If you are using another source control system, or the solution folder is not mapped, this is not true.)

All you need to do is write bindings into the sln/proj files using the Change Source Control dialog. Unlike the full-blown wizard, the CSC dialog should not have any checks that stop you from binding >1 solution that live side by side.

share|improve this answer

answered Jun 6 ’09 at 22:33

Richard BergRichard Berg

19.7k22 gold badges5959 silver badges8585 bronze badges

add a comment
 | 

Your Answer

Thanks for contributing an answer to Stack Overflow!Please be sure to answer the question. Provide details and share your research!But avoid …Asking for help, clarification, or responding to other answers.Making statements based on opinion; back them up with references or personal experience.To learn more, see our tips on writing great answers.

Draft saved
Draft discarded

Sign up or log in

Sign up using Google

Sign up using Facebook

Sign up using Email and Password

Submit

Post as a guest

Name

Email
Required, but never shown

Post Your Answer

Discard

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you’re looking for? Browse other questions tagged visual-studio-2008 tfs or ask your own question.

Blog

Community working group updates: February 2020

Podcast: Coaching a Developer Interview

Featured on Meta

TLS 1.0 and TLS 1.1 removal for Stack Exchange services

How do the moderator resignations affect me and the community?

Related

52Howto resolve… Visual Studio Source Control notification “Projects have recently been added to this solution”146The project file has been moved renamed or is not on your computer0TFS: Choose which Team Project to add a solution too69Why does Visual Studio check out the .vspscc file when I add a file to a project?4VS 2008 – Star Team and multi project solution?98Visual Studio retrieving an incorrect path to a project from somewhere1How do I save the start-up project I selected in VS20084Add solution to different TFS team project0VS 2010 – Adding additional projects to Solution26How to add existing project to Visual studio 2012 after renaming the project path

Hot Network Questions

How to deal with parents that enforce a curfew on an adult

Can random forest detect squared terms?

Is Planning Poker Bad for Software Development Teams?

Can I use 12-2 wire on a 20amp breaker to power an entire bathroom?

Coupling Theory vs reality

Why is late Russian Empire associated with Byzantium while having little in common with it?

Is this violation of academic integrity if I ask a question on Github public repository and post it as an issue?

Why is learning mathematics compulsory?

Does the Z80 allow interrupts after processing and ignoring a 0xdd prefix?

ASCII Pizza (no pineapple)

set duo tone color of fontawesome5 duotone icons

Three way switch with two common wires?

Detect manual changes to an autogenerated C header

Drawing from the Deck of Many Things with a Simulacrum

How to use rounding with 6809 multiplication

Is it ever neccesary to burn a starter out?

Egg, sausage, bacon and spam (lovely spam!)

“Guardians of the Galaxy” soundtrack and Quill’s “Awesome Music Mix”

Where to store passport during day trip in foreign country

Is there any way to remove a rear cassette WITHOUT a cassette wrench?

Two network cards, which provides internet?

How does apt upgrade running programs?

Why doesn’t the ‘bm’ package work with the ‘unicode-math’ package?

How do I know whether an airline seat upgrade at gate was free?

more hot questions

Question feed

Subscribe to RSS

Question feed
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Categories
askquestion

Has anyone been able to edit text in an OpenWYSIWYG control dynamically?

Has anyone been able to edit text in an OpenWYSIWYG control dynamically?

Ask Question

Asked
11 years ago

Active
10 years, 1 month ago

Viewed
689 times

.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
margin-bottom:0;
}

2

1

Like the question says has anyone been able to take a OpenWYSIWYG control and change its contents dynamically with JavaScript? It’s hard because it takes your textarea and transforms it into a WYSIWYG editor by making the textarea invisible and inserting some kind of iframe and uses that as the editor.

I’ve tried code like this but failed:

document.getElementById(“textarea-wysiwyg”).value = “BLARG”;

javascript openwysiwyg

share|improve this question

edited Feb 5 ’09 at 17:03

Andrew G. Johnson

asked Feb 5 ’09 at 15:59

Andrew G. JohnsonAndrew G. Johnson

24.3k2929 gold badges8585 silver badges132132 bronze badges

add a comment
 | 

1 Answer
1

active

oldest

votes

1

If you know that is it the only frame on the page then you can do something like this:

window.frames[0].document.body.innerHTML = ‘blarg’

The above works when I tried it on http://www.openwebware.com/wysiwyg/demo.shtml in firebug.

Hope this helps…

share|improve this answer

answered Feb 9 ’09 at 18:12

JackJack

17k1111 gold badges4141 silver badges4545 bronze badges

add a comment
 | 

Your Answer

Thanks for contributing an answer to Stack Overflow!Please be sure to answer the question. Provide details and share your research!But avoid …Asking for help, clarification, or responding to other answers.Making statements based on opinion; back them up with references or personal experience.To learn more, see our tips on writing great answers.

Draft saved
Draft discarded

Sign up or log in

Sign up using Google

Sign up using Facebook

Sign up using Email and Password

Submit

Post as a guest

Name

Email
Required, but never shown

Post Your Answer

Discard

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you’re looking for? Browse other questions tagged javascript openwysiwyg or ask your own question.

Blog

This week, #StackOverflowKnows fast planes, math with dates, and code comments

Community working group updates: February 2020

Featured on Meta

TLS 1.0 and TLS 1.1 removal for Stack Exchange services

How do the moderator resignations affect me and the community?

Related

495Resizing an iframe based on content181jQuery .ready in a dynamically inserted iframe0how to add text to openwysiwig editor by javascript code outside openwysiwig474Detect when browser receives file download2197How to decide when to use Node.js?145YouTube iframe API: how do I control a iframe player that’s already in the HTML?1Proxying a site to be able to WYSIWYG edit in iframe – How does it work?

Hot Network Questions

ASCII Pizza (no pineapple)

Are There Energy Monitoring Smart Plugs That Don’t Compromise my Privacy/Security?

Why doesn’t the ‘bm’ package work with the ‘unicode-math’ package?

Dystopia of a world where old people get killed

How do I know whether an airline seat upgrade at gate was free?

When a spell asks for targets, can I choose the same target multiple times?

Were Data and Lore created as a ‘pair’?

Is there any advantage of using a travel agent in this day and age?

Hessian Matrix and Physical directions: Potential Energy Surface

Is there any way to remove a rear cassette WITHOUT a cassette wrench?

“electricity was suddenly turned off” or ” electricity suddenly turned off ”

What would be the best way to capture a Giant?

Three way switch with two common wires?

How to access Tridion Config Component in Event System

First non-elected person in line of succession for British Government or Parliament?

I need to examine an 82.7G (!) text file. What can open it?

Any tips for photographing a political rally?

Unexplained muscle mass loss

Integrating acceleration – wrong choice of bounds in textbooks?

Creating a Continuous Decision Variable between 0 and 1 in Python-MIP Interface

Drawing from the Deck of Many Things with a Simulacrum

Can a world where everyone has a time machine be consistent?

Overloading a function using templates

What early middle ages weapons would suit an extremely strong child?

more hot questions

Question feed

Subscribe to RSS

Question feed
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

lang-js

Categories
askquestion

Sql Server (Entity Framework): created_at , updated_at Columns

Sql Server (Entity Framework): created_at , updated_at Columns

Ask Question

Asked
11 years ago

Active
11 years ago

Viewed
3k times

.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
margin-bottom:0;
}

4

4

I think I should mention I’m trying to get Entity FrameworkSQL server to do something that I was used to coming from Rails. I really just want to know the ‘best’ way to have automatic created_at & updated_at column values for records that I insert/update in the database.

Right now I’ve hooked into the ObjectContext.SavingChanges event and things are working well. After I wrote and tested my code however I realize that there may be a better or faster way to do this.

sql-server ruby-on-rails entity-framework

share|improve this question

edited Feb 5 ’09 at 17:25

Bill

asked Feb 5 ’09 at 15:59

BillBill

1,52311 gold badge1515 silver badges2828 bronze badges

add a comment
 | 

1 Answer
1

active

oldest

votes

9

One method is to use insert/update triggers to set the created_at and updated_at columns to the current time.

The Insert trigger would look something like this:

CREATE TRIGGER [dbo].[inserted_myTable] ON [dbo].[myTable] AFTER INSERT
AS
BEGIN
SET NOCOUNT ON;
UPDATE [dbo].[myTable] Set AdmitDateTime = GetDate() where pkid in (SELECT pkid FROM Inserted)
END

The Update trigger would look something like this:

CREATE TRIGGER [dbo].[updated_myTable] ON [dbo].[myTable] AFTER UPDATE
AS
BEGIN
SET NOCOUNT ON;
UPDATE [dbo].[myTable] Set AdmitDateTime = GetDate() where pkid in (SELECT pkid FROM Inserted)
END

One advantage of the trigger approach is that the time/date will always be in the same time zone. Another advantage is that if someone modifies the database record outside of your application, the fields are still updated.

share|improve this answer

edited Feb 5 ’09 at 17:08

answered Feb 5 ’09 at 16:23

Friend Of GeorgeFriend Of George

46811 gold badge44 silver badges1414 bronze badges

See here for an explaination of NOCOUNT: msdn.microsoft.com/en-us/library/ms189837.aspx

– Friend Of George
Feb 25 ’10 at 17:36

add a comment
 | 

Your Answer

Thanks for contributing an answer to Stack Overflow!Please be sure to answer the question. Provide details and share your research!But avoid …Asking for help, clarification, or responding to other answers.Making statements based on opinion; back them up with references or personal experience.To learn more, see our tips on writing great answers.

Draft saved
Draft discarded

Sign up or log in

Sign up using Google

Sign up using Facebook

Sign up using Email and Password

Submit

Post as a guest

Name

Email
Required, but never shown

Post Your Answer

Discard

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you’re looking for? Browse other questions tagged sql-server ruby-on-rails entity-framework or ask your own question.

Blog

This week, #StackOverflowKnows fast planes, math with dates, and code comments

Community working group updates: February 2020

Featured on Meta

TLS 1.0 and TLS 1.1 removal for Stack Exchange services

How do the moderator resignations affect me and the community?

Linked

1

Automatically update Last Modified Date in ASP.Net MVC app

Related

818Entity Framework vs LINQ to SQL2700Add a column with a default value to an existing table in SQL Server1737How to return only the Date from a SQL Server DateTime datatype1817How to check if a column exists in a SQL Server table?1099Check if table exists in SQL Server1867How to concatenate text from multiple rows into a single text string in SQL server?1545LEFT JOIN vs. LEFT OUTER JOIN in SQL Server3608How do I UPDATE from a SELECT in SQL Server?1147Find all tables containing column with specified name – MS SQL Server1219How to Delete using INNER JOIN with SQL Server?

Hot Network Questions

What’s the difference between “люблю” and “обожаю”?

Any tips for photographing a political rally?

Who were the seven dwarves Sauron gave the Rings of Power to?

Three way switch with two common wires?

Do the US NTSB and other investigative agencies charge airlines for investigations?

How to modify a method which dynamically calls upon a set of various child classes to work for any new child class

Is it ever neccesary to burn a starter out?

Is there a unix-like system that doesn’t come with Perl?

Is there any material which cannot be cut by a lightsaber?

Hessian Matrix and Physical directions: Potential Energy Surface

First non-elected person in line of succession for British Government or Parliament?

My name is akin to my size

How do you name nodes/vertices with this type of code?

Is there any way to remove a rear cassette WITHOUT a cassette wrench?

Why did equal temperament become the standard tuning system for keyboard instruments?

How does apt upgrade running programs?

Incorporating fruits in creme brulee

Paint 21 Squares of a 7×7 Board Without Forming a Rectangle

What would be the best way to capture a Giant?

I need to examine an 82.7G (!) text file. What can open it?

Is it possible to run a monochrome LCD without driver circuit with an Arduino Uno?

ASCII Pizza (no pineapple)

Do UK visa documents not in English or Welsh have to be translated officially?

Why do airliners park with the nose facing the terminal?

more hot questions

Question feed

Subscribe to RSS

Question feed
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

lang-sql

Categories
askquestion

Altering the user-agent string with the HTMLControl

Altering the user-agent string with the HTMLControl

Ask Question

Asked
11 years ago

Active
6 years, 6 months ago

Viewed
72 times

.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
margin-bottom:0;
}

0

I’m writing an app (VS2005, C++, targeting WM5) which is hosting the HTML Control. Can I modify the user-agent this control uses when making a request to a server?

windows-mobile

share|improve this question

edited Jul 29 ’13 at 22:11

meshy

6,21366 gold badges4040 silver badges6565 bronze badges

asked Feb 5 ’09 at 15:59

brismithbrismith

66633 silver badges1313 bronze badges

add a comment
 | 

1 Answer
1

active

oldest

votes

-1

http://msdn.microsoft.com/en-us/library/system.web.httpresponse.addheader.aspx

Use AddHeader to modify the useragent.

Since you are in a control, use this to get to your current HttpResponse object.
this.Page.Response.AddHeader

share|improve this answer

edited Feb 5 ’09 at 16:28

answered Feb 5 ’09 at 16:06

Chris BallanceChris Ballance

30.4k2525 gold badges9898 silver badges147147 bronze badges

He doesn’t have an HttpResponse object. The question wants to know how to change the agent string being sent from an HTMLControl.

– ctacke
Feb 5 ’09 at 16:08

Sure he does. Just reference the current page’s HttpResponse object.

– Chris Ballance
Feb 5 ’09 at 16:29

I’m not using .Net CF. Is the HttpResponse object available by accessing a particular COM Interface?

– brismith
Feb 10 ’09 at 14:47

add a comment
 | 

Your Answer

Thanks for contributing an answer to Stack Overflow!Please be sure to answer the question. Provide details and share your research!But avoid …Asking for help, clarification, or responding to other answers.Making statements based on opinion; back them up with references or personal experience.To learn more, see our tips on writing great answers.

Draft saved
Draft discarded

Sign up or log in

Sign up using Google

Sign up using Facebook

Sign up using Email and Password

Submit

Post as a guest

Name

Email
Required, but never shown

Post Your Answer

Discard

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you’re looking for? Browse other questions tagged windows-mobile or ask your own question.

Blog

This week, #StackOverflowKnows fast planes, math with dates, and code comments

Community working group updates: February 2020

Featured on Meta

TLS 1.0 and TLS 1.1 removal for Stack Exchange services

How do the moderator resignations affect me and the community?

Related

2Possible to detect the *type of mobile device* via javascript or HTTP Headers?2Windows Mobile Emulator networking to host machine1Auto-size controls in .NET CF to avoid horizontal scrolling?0Wrapping the HTML Control on Windows Mobile1HTML Control in Windows Mobile 6.1 Professional8Passing a C# string to an unmanaged C DLL in Windows Mobile1How to disable WM6.5.3 gestures?0Mobile Compact Framework 2.0 Install unsuccessful from Win7 generated from VS20081How to: WCF Service check if Windows Forms user is still active?

Hot Network Questions

Unexplained muscle mass loss

What’s the difference between “люблю” and “обожаю”?

What is the word for an animal species which only eats one type of food?

ASCII Pizza (no pineapple)

Dystopia of a world where old people get killed

Why are the clouds white and Australia black in weather satellite infrared images?

Any tips for photographing a political rally?

Incorporating fruits in creme brulee

Managing New Player “Murder Hobos”

Single NPN or NPN+PNP (push pull) to drive a P-MOSFET

Contractor day rate – calculating based off pro rata annual ‘salary’

How to deal with parents that enforce a curfew on an adult

How do I execute/test a large set of test cases with limited time and resources?

Regexp for matching quoted strings that may have control characters in them

How do I know whether an airline seat upgrade was free?

Linux backup utility for incremental backups

Fastest yes in the west

Flexibility over solidity? Defending against 1. e4

Is it ever neccesary to burn a starter out?

Why is learning mathematics compulsory?

How can I say “to be tired of verbING” in Japanese?

Who first solved the classical harmonic oscillator?

Detect manual changes to an autogenerated C header

What is this narrow band of clouds?

more hot questions

Question feed

Subscribe to RSS

Question feed
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Categories
askquestion

Why doesn’t WebBBS work now that I’ve migrated to a new server?

Why doesn’t WebBBS work now that I’ve migrated to a new server?

Ask Question

Asked
11 years ago

Active
9 years, 8 months ago

Viewed
86 times

.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
margin-bottom:0;
}

0

I’ve moved a WebBBS board from one server to another. Ever since the board doesn’t work.
I’m getting an Apache error whenever I try to access the board. Don’t even know where to start the debugging, I’m not a Perl person. The file paths remained the same and there isn’t any DB involved.

http://gammonline.com/members/board/

Any ideas?

After a bit of testing I believe that the problem has something to do with the index.cgi which is located in that folder (not getting the error when renaming it).

Thanks,

Roy.

perl apache webbbs

share|improve this question

edited May 31 ’10 at 2:31

Sampson

239k6565 gold badges494494 silver badges540540 bronze badges

asked Feb 5 ’09 at 15:59

Roy PelegRoy Peleg

92022 gold badges88 silver badges2525 bronze badges

add a comment
 | 

2 Answers
2

active

oldest

votes

3

More information about this error may be available in the server error log.

Says it all. You will have to find the error log and look at it.

If you are using CGI, the first step is to check you have given it the right permissions so it is an executable script at all.

chmod 755 index.cgi

share|improve this answer

answered Feb 5 ’09 at 16:14

bobincebobince

470k9595 gold badges600600 silver badges786786 bronze badges

add a comment
 | 

1

This is caused by Apache config errors. Set LogLevel debug and tail -f the error log. It will probably be something to do with .htaccess permission for override, or, it’s requiring a module which isn’t loaded. The error log will tell you instantly.

share|improve this answer

answered Feb 5 ’09 at 16:07

Andrew TaylorAndrew Taylor

1,8641818 silver badges1919 bronze badges

add a comment
 | 

Your Answer

Thanks for contributing an answer to Stack Overflow!Please be sure to answer the question. Provide details and share your research!But avoid …Asking for help, clarification, or responding to other answers.Making statements based on opinion; back them up with references or personal experience.To learn more, see our tips on writing great answers.

Draft saved
Draft discarded

Sign up or log in

Sign up using Google

Sign up using Facebook

Sign up using Email and Password

Submit

Post as a guest

Name

Email
Required, but never shown

Post Your Answer

Discard

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you’re looking for? Browse other questions tagged perl apache webbbs or ask your own question.

Blog

This week, #StackOverflowKnows fast planes, math with dates, and code comments

Community working group updates: February 2020

Featured on Meta

TLS 1.0 and TLS 1.1 removal for Stack Exchange services

How do the moderator resignations affect me and the community?

Related

177How can I install Apache Ant on Mac OS X?35How to solve import errors while trying to deploy Flask using WSGI on Apache20URL rewriting question2Perl module Image::Imlib2 trouble saving gifs0Why is this .htaccess file mod_rewrite not working?2Perl library not working on WampServer0Issue moving file1Cygwin Perl CGI with Xampp

Hot Network Questions

How do Trump’s public statements make DOJ’s job impossible?

How can I say “to be tired of verbING” in Japanese?

“electricity was suddenly turned off” or ” electricity suddenly turned off ”

What is this narrow band of clouds?

Who were the seven dwarves Sauron gave the Rings of Power to?

Definition of a general rule

Coupling Theory vs reality

What happens if an aircraft tries to land at MTOW (if greater than MLW)?

Can random forest detect squared terms?

What is right way to set up King & Queen In the beginning of game?

How do Aarakocra fly with a backpack?

My name is akin to my size

How do I sail rafts in Breath of the Wild?

Since the caster of the Zone of Truth spell knows whether a creature failed the save, can they use it to detect hidden/invisible creatures?

Why do airliners park with the nose facing the terminal?

Why is learning mathematics compulsory?

Artificier Resistant Armor Infusion

When a spell asks for targets, can I choose the same target multiple times?

Can you Rappel with an Old Climbing Rope?

SQL Query timing out – Optimization Help?

DAD and link local address

Three way switch with two common wires?

How to access Tridion Config Component in Event System

Are There Energy Monitoring Smart Plugs That Don’t Compromise my Privacy/Security?

more hot questions

Question feed

Subscribe to RSS

Question feed
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

lang-perl

Categories
askquestion

Why is EDI still used, and how to deal with it?

Why is EDI still used, and how to deal with it?

Ask Question

Asked
11 years ago

Active
3 months ago

Viewed
15k times

.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
margin-bottom:0;
}

17

9

Why is this archaic format still used in the face of easier-to-use technologies? Does it provide some benefit that I’m not seeing? It seems that a large amount of vendors still provide data only in this format, instead of something more manageable and easier to use such as XML; at the least it would make sense to me to offer both formats.

Also, what are some good ways to deal with and utilize EDI when you have no other choice but to use it? Something like BizTalk is out of the question as it’s far too expensive. Are there any free/open source applications that make EDI easier to work with?

edi

share|improve this question

edited Feb 5 ’09 at 16:31

Wayne Molina

asked Feb 5 ’09 at 16:00

Wayne MolinaWayne Molina

16.7k2323 gold badges9090 silver badges154154 bronze badges

Subjective and Argumentative: See ‘cryptic’, ‘zero sense to me’, other systems are ‘more effecient’, ‘headache to parse’, ‘archaic’ ‘easier to use’ ‘read chinese’.

– George Stocker
Feb 5 ’09 at 16:09

@Gortok: Yes, he is being subjective, but there is a question hidden inside the rant: What are the pros and cons of the EDI format?

– Sebastian Dietz
Feb 5 ’09 at 16:16

EDI stands for Electronic Data Interchange, not Human Data Interchange. Its not meant to be human readable. Its compact and well defined. I’ve converted 7MB EDI file to XML, and they ended up being 45MB+. The conversion size is not linear. Larger EDI files could get huge.

– L_7337
Nov 1 ’13 at 20:11

@L_7337 Same could be achieved for XML with some standard compression algorithm that no one needs to see.

– Martin Clemens Bloch
Nov 19 ’13 at 7:14

same reason why we use QWERTY keyboards

– Max Hodges
Dec 18 ’15 at 2:34

add a comment
 | 

18 Answers
18

active

oldest

votes

19

EDI is not that hard to understand once you familiarize yourself with the delimiters it uses. You might ask yourself as well why anyone would still be using CSV or tab-delimited data.

The answer is probably that those formats are “domain specific languages” defined by committee and standardized in a certain industry, and that a lot of money has already been invested in supporting those formats. Where’s the business case to throw that all out again?

share|improve this answer

answered Feb 5 ’09 at 16:05

Dave Van den EyndeDave Van den Eynde

15.6k66 gold badges5555 silver badges7979 bronze badges

1

I’ve found that EDI is easy enough to read in. The difficult part is writing EDI documents that other systems don’t complain about. It seems that even if you are following the specs, they still complain.

– Kibbee
Feb 5 ’09 at 16:18

In fact, I’ve created a DSL to map EDI transaction sets (both ways). It was almost trivial.

– dkretz
Feb 5 ’09 at 16:46

3

@Kibbee: Sounds like developing web sites for Internet Explorer!

– Peter Di Cecco
Oct 9 ’09 at 17:08

add a comment
 | 

16

One word, Inertia. Developing the EDI formats by committee between various companys and organisations with different agendas was a nightmare (sad to say I have been there).

Asking them to abandon these with yet another round of committees agreeing web service API standards is going to take even longer, how do you sell the idea of replacing one electronic format with another to a non-technical board? What possible busness advantage does it give them. Originally the benefits of electronic exchange were clear but replace one with another is not. We’re talking really big companies here.

share|improve this answer

answered Feb 5 ’09 at 16:05

AnthonyWJonesAnthonyWJones

171k3030 gold badges225225 silver badges295295 bronze badges

1

Exactly. Suppliers aren’t software development companies. They don’t see the value in switching to new systems. They don’t have the inhouse expertise to do anything, and hiring somebody would be extremely expensive.

– Kibbee
Feb 5 ’09 at 16:24

not really “inertia”; it’s due to the “network effect” en.wikipedia.org/wiki/Network_effect

– Max Hodges
Dec 18 ’15 at 3:40

add a comment
 | 

9

You may be interested in the following project:

http://bots.sourceforge.net/en/index.shtml
Google code archive

share|improve this answer

edited Sep 16 ’16 at 22:38

MrMesees

7631212 silver badges1818 bronze badges

answered Feb 5 ’09 at 16:45

nullnull

6,46844 gold badges2222 silver badges2828 bronze badges

add a comment
 | 

6

A little information for all interested. EDI is basically a design by committee data exchange format that not only set out rules for data formatting (like XML), but also set out to define each document that could possibly ever be sent between 2 companies. So for any piece of data that could be exchanged between companies they came up with an exact definition of what was supposed to be in each of these documents. Of course, nobody could foresee every piece of data that 2 companies would want to exchange. So you end up with companies using fields that were defined for 1 thing, being used for some other piece of information.

What you ended up with, is an extremely convoluted data format, in which many people using it don’t follow the standards, because they need to send custom information, which the standard doesn’t account for. So in the end, you still need to talk to each company you want to deal with, and find out all the little idiosyncrasies of their implementation, just as you would have to do if you went to someone with a custom XML interface. Except that in the case of EDI, the format is hard to parse and even harder to write well, so you end up doing a whole bunch of work just to send a document, when doing the same kind of think with having a custom XML solution would have resulted in many times less problems.

share|improve this answer

answered Feb 5 ’09 at 16:37

KibbeeKibbee

60.8k2626 gold badges134134 silver badges175175 bronze badges

1

But then you get trading partners who extend the XML formats for the same data and same purposes in wildly different ways, so the same consequences result. We all like our own hammer better than the others, but they all drive in the nails semi-crooked sometimes.

– dkretz
Feb 5 ’09 at 16:44

1

My whole point is that you can’t try to standardize the documents sent across the entire industry. Instead, everybody would just be better off if they just used XML, and defined their own DTD for others to adhere to, instead of trying to get everybody to agree on a single DTD, or data format.

– Kibbee
Feb 5 ’09 at 16:51

Just because 100% of the message exchange requirements can’t be standardized isn’t a reason vote for a free for all approach.

– Puneet Lamba
Feb 17 ’13 at 3:50

add a comment
 | 

6

And switching to XML would give you what – a slightly easier to debug line format?

Generally you set it up and leave it, there isn’t a lot of need to play with the raw EDI feed, certainly not enough to abandon the standard and start again.
There are lots of standards, like FAX that could be made more readable but no real pressing need to change them.

share|improve this answer

edited Feb 6 ’09 at 1:51

answered Feb 5 ’09 at 16:05

Martin BeckettMartin Beckett

86.2k2121 gold badges170170 silver badges247247 bronze badges

Have you ever review an EDI format, even something simple like an EDIFACT order? What tools are there to easily consume it and extend it? There might be some but we’re talking several digits of currency to get what XML gives for free.

– AnthonyWJones
Feb 5 ’09 at 16:10

1

+1 AnthonyWJones. Exactly my problem with EDI – it’s ridiculously hard to parse whereas XML is easy to consume and extend.

– Wayne Molina
Feb 5 ’09 at 16:17

1

It’s not a matter of slightly easier. EDI is orders of magnitude harder to do correctly than XML.

– Kibbee
Feb 5 ’09 at 16:19

@AWJ I review them frequently (or used to, now it’s filtered through for the most part). I have a much harder time finding the data embedded in XML cruft. With EDI I can insert a newline at the segment breaks and things more or less line up vertically within a screen-width. It’s what you’re used to.

– dkretz
Feb 5 ’09 at 16:40

add a comment
 | 

6

Because it’s a formally established Standard (in fact a very large and comprehensive set of standards). And that’s one of the claimed benefits of a standard – you won’t need to change anything for a long time.

And to change it, it takes agreement between two or more (often thousands and thousands more) trading partners (including maybe all of your competitors) to agree.

EDI formats have much higher signal-to-noise ratios (because they were designed back when that was considered important.) Someone who knows and understands EDI will look at your XML and say “Where’s the beef (data)?”

Very few developers write their own parsers. There are many good mappers available (and many legacy and enterprise apps come with them built in). So there’s lots of relief available for your pain (including at least one Open Source app on SourceForge).

share|improve this answer

edited Jul 24 ’13 at 2:34

answered Feb 5 ’09 at 16:35

dkretzdkretz

35.8k1313 gold badges7575 silver badges131131 bronze badges

add a comment
 | 

5

“If it ain’t broke, don’t fix it.”

Most of these organisations are processing vast amounts of data using EDI, and aren’t about to change to something more modern without a compelling reason. And making things easy for third-party developers doesn’t usually qualify, sad to say.

share|improve this answer

answered Feb 5 ’09 at 16:06

Mike EdwardsMike Edwards

42222 silver badges22 bronze badges

add a comment
 | 

5

IMHO there are several problems with EDIFACT.

It is not easy to parse or generate an Object model from it. This is probably not a big problem anymore as there are now good system around that do it for you e.g. smooks.org
It is not easy to read. You get used to but XML is a lot easier to read
Validation isn’t that easy (compare that to validating XML)
There are far too many different versions and flavours, D95B, D96B, D00A, D00B etc.
But I think the biggest problem is that everyone is using the standards differently. They use the same ‘format’ but the fields are defined differently. We use EDIFACT to send and receive messages from Container Terminals and they all have slight differences. They would e.g. all use a D95B CODECO but for some terminals a certain segment is mandatory while for another it is optional or even not allowed to be there. Then you have segments that are used the same but the content in it is different.

So to summarise it: It is a pain in the neck.

share|improve this answer

answered Nov 4 ’11 at 14:47

BenBen

1,49233 gold badges1717 silver badges3131 bronze badges

add a comment
 | 

4

EDI is a very compact format and is often used to keep bandwidth usage in data exchanges as small as possible. The German customs offices for example use it in their ATLAS system to exchange a very high volume of data every day.

It is hard to parse and hard to read, but if the size of the resulting data matters, it can be a good choice and is supported by most of the bigger business applications.

share|improve this answer

answered Feb 5 ’09 at 16:09

Sebastian DietzSebastian Dietz

5,25411 gold badge2525 silver badges3737 bronze badges

Towards this point alot of valued added networks (VANs) still charge kilocharacter rates. The more characters the more it costs.

– direct
Oct 18 ’16 at 15:32

add a comment
 | 

3

Legacy Support

share|improve this answer

answered Feb 5 ’09 at 16:02

GWLlosaGWLlosa

21.3k1717 gold badges6868 silver badges103103 bronze badges

add a comment
 | 

3

EDI is prolific in many industries. It would be prohibitively expensive to replace an already-working technology with a newer one.

Consider this, Walmart uses EDI to communicate with its vendors, stores, distribution chain, etc. I’m guessing they deal with tenss of thousands of vendors. Every one of them has sunk thousands of dollars into EDI technology. If Walmart decided to switch over to XML, its a decision that affects thousands of companies, not just Walmart.

This is true for any EDI user. After all, it’s a standard used between trading partners.

I agree, EDI is a pain to work with. But ‘back in the day’, that’s all we had.

share|improve this answer

answered Feb 5 ’09 at 16:25

Marc BernierMarc Bernier

2,8122121 silver badges4040 bronze badges

1

Care to recommend anything to ease the pain of dealing with it, then? My frustration is because my company switched vendors and this new one only offers data in EDI format (the old one offered it in text as well), so I’m scrambling to figure out a way to integrate it with our systems

– Wayne Molina
Feb 5 ’09 at 16:28

@WayneM I may be missing something, but can’t you use XSLT to transform your XML into EDI? XML->XSLT->EDI seems much easier than EDI->CustomeParser->XML… again I may be over simplifying.

– null
Feb 5 ’09 at 16:40

I’m not using XML; I just need to extract the data – I was hoping the supplier was using XML and not EDI since XML is easier to parse the data I need.

– Wayne Molina
Feb 5 ’09 at 16:50

@WayneM, there are a few companies that offer EDI mapping software that will translate EDI docs into user-defined formats. We used to use Sterling Commerce’s product, but honestly, it was a love/hate relationship.

– Marc Bernier
Feb 5 ’09 at 17:17

add a comment
 | 

3

Edifact is one of the best standards when it comes down to document interchange.
Most problems come from tradingpartners sending non standardized documents.

Yes it’s a bit odd format and is tedious to work with if you don’t know the ins and outs but that goes for XML as well.

You really want XML over Edifact? Look at the bloated, hard to read XML standards peppol (pan-european public procurement online) is working on.

Yes it’s working nice and dandy if you don’t have any errors in the systems, troubleshooting edifacts is so much easier once you get used to the format than troubleshooting UBL documents.

You say you have $0.00 to use on the project?
You really should look into the amount of manual work done in your company and the costsavings EDI can offer some cost benefit analysis can be mighty handy.

share|improve this answer

edited Nov 5 ’12 at 7:09

Toon Krijthe

49.3k2222 gold badges133133 silver badges197197 bronze badges

answered Dec 4 ’11 at 10:57

plykkegaardplykkegaard

5711 silver badge66 bronze badges

1

Have a look at edidev, stylusstudio or liaison Liaison has a free program EDI Notepad which is quite handy if you’re unfamiliar with edifact There’s also quite a few java parsers out there if it’s gotta be opensource Agreed that BizTalk is a bit prizy but so is must large ERP systems, look at the prize in that context 🙂

– plykkegaard
Dec 9 ’11 at 16:41

add a comment
 | 

3

What types of information can be exchanged via EDI?

A variety of types of business information exchange is available via EDI including:

-•Booking information

-•Bill of Lading information

-•Invoicing

-•Electronic Funds Transfer

-•Arrival Notice Information

-•Shipment Status Information

How would choosing EDI benefit my company?
-•It streamlines the communications process between you and APL

-•It eliminates the need to rekey data, thus eliminating errors and the need to recheck information

-•It eliminates paper handling and the need for document storage

-•It improves the turntime and the accuracy of your data

-•It eliminates the need for faxing

share|improve this answer

answered Sep 27 ’13 at 14:16

kaushik0033kaushik0033

58033 silver badges1111 bronze badges

add a comment
 | 

2

One solution, although it will cost you, is to go to a company like ADX, which has tools you can use to convert EDI formats to more pleasing formats like CSV. Depending on the volume and type of transactions you are doing, this can be both affordable and a lot less stressful. I’ve used their products in the past, and while they are a bit of work to set up, they do work quite well, and are very stable. Because of the history of EDI, you could probably find hundreds of other companies that offer similar services.

share|improve this answer

edited Nov 4 ’19 at 11:32

xyz

20.3k3333 gold badges102102 silver badges145145 bronze badges

answered Feb 5 ’09 at 16:41

KibbeeKibbee

60.8k2626 gold badges134134 silver badges175175 bronze badges

Unfortunately, my budget is $0.00. I’ll keep it in mind, though, in case I need to use it.

– Wayne Molina
Feb 5 ’09 at 16:43

Are they paying you $0.00 to do the work? Because if they aren’t, you really should argue that it could be completed with far less overall cost to just pay someone else for a solution.

– Kibbee
Feb 5 ’09 at 16:53

add a comment
 | 

1

EDI has been around since before XML. Apart from the fact that two parties can pre-negotiate the EDI format that works for them both you must also consider the part of the VAN (value added network.)

In some cases the VAN performs validation of the message, or even reads the message and performs actions on it, such as copying it to additional parties based on its content.

The only reason really to use EDI is because “that’s the way it’s always been done”, and therefore there is a lot of existing infrastructure around to support it. Why switch to XML when there is no need? And how is to say XML wont be replaced by JSON which will then be replaced by something else?

share|improve this answer

answered Feb 5 ’09 at 16:13

Peter MorrisPeter Morris

8,62555 gold badges5353 silver badges9797 bronze badges

JSON is for data, XML is for documents. That is an important distinction.

– Bernard Igiri
Feb 5 ’09 at 16:22

Please explain what you mean.

– Peter Morris
Feb 5 ’09 at 16:40

add a comment
 | 

1

Another reason is that being business messages such as order. invoices, credit notes etc there is a lot of financial worth in the transactions and they need to be secure but perhaps more importantly they need have end to end validation and verification as well as non repudiation.

For example i send you an order for 1/2 million Euros worth of goods, you send me the goods, then i “lose” the order information and tell you i am not paying. The combination of the standards and the VANS make this almost impossible or at least with so much of an audit trail that it the problems could be tracked. This is why the “Oh let use xml and the internet instead of EDIFACT and the VANS” tend to fail. As someone els answered, Inertia, but it is an inertia founded in a stable effective, secure, reliable and well understood system.

Doing it on the cheap is not always an option.

If it is any consolation when i first implemented EDI in ’87 there was virtually no software around and so i got the Interbridge tables and wrote my own parser for the UK TRADACOMS standard using Cognos software on and HP Mini, and it worked fine. Assuming you are trading with other EDI partners the cost probably comes at the point of needing to use a VAN.

share|improve this answer

answered Nov 7 ’09 at 9:10

PurplePilotPurplePilot

6,22433 gold badges3232 silver badges4141 bronze badges

add a comment
 | 

1

I’ve used EDI (ANSI X12 and EDIFACT) in 2 projects about Maritime Transport Logistics and found them to be very useful since most Ocean Carriers and Trading Partners accept them as the standard way of communication between their different systems.

So EDI format is still used and will continue to be used since it’s a stablished standard and thousand companies have developed systems around them, and replacing them is a really big deal.

share|improve this answer

answered Jul 9 ’14 at 16:53

NathanNathan

2,2871919 silver badges2727 bronze badges

add a comment
 | 

0

I’ve had to use EDI as well and I agree. We used BizTalk to map it which worked well. Many system are built on EDI(well before XML).

share|improve this answer

edited Feb 5 ’09 at 16:12

answered Feb 5 ’09 at 16:03

Matt DavisonMatt Davison

1,4881010 silver badges1111 bronze badges

Maybe I wouldn’t have the problem if I was using BizTalk… but unfortunately the price for it is waaaay too much to even bother considering as a solution.

– Wayne Molina
Feb 5 ’09 at 16:05

add a comment
 | 

Highly active question. Earn 10 reputation in order to answer this question. The reputation requirement helps protect this question from spam and non-answer activity.

Not the answer you’re looking for? Browse other questions tagged edi or ask your own question.

Blog

This week, #StackOverflowKnows fast planes, math with dates, and code comments

Community working group updates: February 2020

Featured on Meta

TLS 1.0 and TLS 1.1 removal for Stack Exchange services

How do the moderator resignations affect me and the community?

Related

16EDI Format31How to understand an EDI file?9EDI ISA and GS ID Generation1EDI 999 implementation acknowledgment2Efficient EDI parsing into database in C#5How to set up an EDI Server3New to EDI – what is an ASI and whats so great about EDI?1Schema error with Azure BizTalk Services EDI Bridge0EDI and shipping tracking information

Hot Network Questions

What’s the difference between “люблю” and “обожаю”?

Are There Energy Monitoring Smart Plugs That Don’t Compromise my Privacy/Security?

Any tips for photographing a political rally?

Why is late Russian Empire associated with Byzantium while having little in common with it?

Drawing Lines on Differential Equation Slope Field

Were Data and Lore created as a ‘pair’?

How does apt upgrade running programs?

Is there a name for a chess variant where you are allowed to capture your own pieces?

New published work denied brewski robbery

Are the sum of two numbers desired?

What is the word for an animal species which only eats one type of food?

How do Trump’s public statements make DOJ’s job impossible?

How do Aarakocra fly with a backpack?

A childish challenge to generative grammar

I need to examine an 82.7G (!) text file. What can open it?

Why does the same proportion of a radioactive substance decay per time period? (half life)

Why did equal temperament become the standard tuning system for keyboard instruments?

Drawing one-liner

Coupling Theory vs reality

Flexibility over solidity? Defending against 1. e4

Can I use 12-2 wire on a 20amp breaker to power ENTIRE bathroom?

How to access Tridion Config Component in Event System

Detect manual changes to an autogenerated C header

Circle of Points with TikZ

more hot questions

Question feed

Subscribe to RSS

Question feed
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.