Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



shrughes posted:

We just have

code:
// Copyright 2010-2012 <employer>, all rights reserved.

What about 2013?!?! :gonk:

Adbot
ADBOT LOVES YOU

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
But...why?

Not So Fast
Dec 27, 2007


We have that, *and* the keep comments for every commit on the file.

Makes going to files from the 1990s a hoot.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Not So Fast posted:

We have that, *and* the keep comments for every commit on the file.

Makes going to files from the 1990s a hoot.

Holy poo poo I hate that, leaning on the page down button for two minutes every time i open the file.

zergstain
Dec 15, 2005

Ours is like 11 lines, and we have a perl script that forces you to update it to the current year on commit. No the script doesn't do it for you.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

zergstain posted:

Ours is like 11 lines, and we have a perl script that forces you to update it to the current year on commit. No the script doesn't do it for you.

Take a vacation after the new year, let someone else do it for most of the files.

Slanderer
May 6, 2007

zergstain posted:

Ours is like 11 lines, and we have a perl script that forces you to update it to the current year on commit. No the script doesn't do it for you.

That is the dumbest loving script.

Pardot
Jul 25, 2001




Otto Skorzeny posted:

You should have copyright notices on code for internal use,


Why? None of our stuff has anything.

coaxmetal
Oct 21, 2010

I flamed me own dad
none of our stuff has anything either

zergstain
Dec 15, 2005

Slanderer posted:

That is the dumbest loving script.

To be honest, the script does a hell of a lot more. Main purpose is to enforce style and extract strings for the message catalogs. We always make it a range from when it was created to when it was last touched. Simple mistakes it fixes for you, but I think there's an issue so they don't enable the copyright fixing option.

This is a Co-op term so I'm gone after August anyway.

tef
May 30, 2004

-> some l-system crap ->

Pardot posted:

Why? None of our stuff has anything.

Similarly. I was under the impression that copyright was automatic under the berne convention, but I do tend to put organization/owner information in the root level of a package/module.

evensevenone
May 12, 2001
Glass is a solid.
Adding a notice means that if someone infringes, they can't claim it was "innocent infringement" and you can collect larger damages (i.e. statutory instead of actual damages).

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
I've been picked up for a bunch of freelance web development contracts, so I'm having a ball earning actual money instead of sitting on welfare. Already come up against one gem of a responsive site, built in the last 6 months.

code:

<html>
  <body>
    <div class="desktop">
      <!-- entire site -->
    </div>
    <div class="tablet">
      <!-- entire site -->
    </div>
    <div class="mobile">
      <!-- entire site -->
    </div>
 </body>
</html>

There's also a couple of other gems in there like forking the entire CSS/JS directory twice for one off pages, so they don't cascade very well. Payin' dem bills though.

zergstain
Dec 15, 2005

code:

#define ISNULL(p)                ((void *) (p) == NULL)
#define MEMCLR(p)                (void) memset((char*)(p), 0, sizeof (*(p)))
#define MEMFREE(p)               if (!ISNULL(p)) free((char*)(p)), MEMCLR(&(p))
I am so glad I don't work with the team responsible for this.

ExcessBLarg!
Sep 1, 2001

shrughes posted:

code:
// Copyright 2010-2012 <employer>, all rights reserved.
I use:
code:
/* Copyright © 2013  $company */
"All rights reserved" is now redundant, although it was quite necessary for works published in the US before 1989. Some folks still prefer to use it for emphasis, as there's an opinion that merely stating copyright alone is ambiguous with regard to the Copyright holder's intention with regard to licensing, although there is no ambiguity in law. Anything beyond that is just for scare.

Pardot posted:

Why? None of our stuff has anything.

tef posted:

I was under the impression that copyright was automatic under the berne convention,
This is true, but the real purpose of putting in a Copyright header is to avoid any ambiguity. This code might be internal today, but a few acquisitions later and there might be a push to opensource even internal tools. That's relatively easy to do when the copyright notice is already there, just insert the license below. However if the header is missing, there may be some question as to where the code originally came from.

Or alternatively, if you license your code to some other entity who (lawfully) integrates it into their internal code. Then they later decide to opensource it, the Copyright makes it clear who owns that piece of code.

Honestly, keeping track of Copyright and licenses is important stuff. Revision control does help to maintain a trail of authorship, but only if repositories are preserved and code doesn't get packaged outside of them. It's also not really that hard.

QuarkJets
Sep 8, 2008

The Gripper posted:

Well you can also wrap if statements across lines if you really want:
Python code:
def event_is_interesting(event):
  if(len(event.Leptons) != 2 or 
    event.Leptons[0].Pt() < 20.0 or
	event.Leptons[1].Pt() < 20.0 or
    event.MET() < 60.0):
      return False
  return True
Your advisor is a pretty terrible person and I'd hate to see how crappy his actual production code is, if he thinks nesting for things like that is a good idea I can just imagine the other "me learning VB6" style choices he makes.

Doesn't every part of the if statement get checked when you do this? I try to stay away from those kinds of if statements

And yeah, as other people have pointed out there's not really any such thing as "production" code in academia, with a few exceptions

Scaevolus
Apr 16, 2007

QuarkJets posted:

Doesn't every part of the if statement get checked when you do this? I try to stay away from those kinds of if statements

And yeah, as other people have pointed out there's not really any such thing as "production" code in academia, with a few exceptions
No. Like most modern languages, Python has short-circuiting boolean operators.

nielsm
Jun 1, 2009



QuarkJets posted:

Doesn't every part of the if statement get checked when you do this? I try to stay away from those kinds of if statements

No, most languages have "short-circuiting" logical operators. They evaluate left to right, innermost outwards, until the entire expression can be proven true or false. This means it evaluates as little as possible to find the answer.
In the sample you quoted, it's a chain of comparisons "or"-ed together. This entire expression becomes true if just one single of the sub-expressions are true. So they get evaluated from left to right, but as soon as one of them evaluates "true", it takes the "true" branch of the if statement, it doesn't need to evaluate the rest since their result is irrelevant to the truth value of the entire expression.
(Short-circuiting "or" with two operands: Evaluate first operand, if true the result is true, otherwise evaluate the second operand and use that as the result. Short-circuiting: Evaluate the first operand, if false the result is false, otherwise evaluate the second operand and use that as the result.)

Zhentar
Sep 28, 2003

Brilliant Master Genius
Some language implementations will even reorder statements to perform the cheapest checks first, when they can prove there aren't any side effects.

toiletbrush
May 17, 2010
How do they know what checks will be cheapest?

ymgve
Jan 2, 2004


:dukedog:
Offensive Clock
For example, comparing two integers is usually less costly than comparing two strings.

Zorn
Oct 24, 2000

QuarkJets posted:

Doesn't every part of the if statement get checked when you do this? I try to stay away from those kinds of if statements

And yeah, as other people have pointed out there's not really any such thing as "production" code in academia, with a few exceptions

Never program a computer.

KaneTW
Dec 2, 2011

He's in academia that basically says everything.

mobby_6kl
Aug 9, 2009

by Fluffdaddy

toiletbrush posted:

How do they know what checks will be cheapest?

SQL decides this based on statistics and presence/type of indexes on the relevant fields. As for "real" programming languages, I'm not sure. Even with functional ones where the absence of side effects is guaranteed, they wouldn't know much about the cost anyway.

Sang-
Nov 2, 2007

mobby_6kl posted:

SQL decides this based on statistics and presence/type of indexes on the relevant fields. As for "real" programming languages, I'm not sure. Even with functional ones where the absence of side effects is guaranteed, they wouldn't know much about the cost anyway.

I imagine this is a kind of analysis a JITer can do at runtime.

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug

quote:

From: Sathyanathan, Justin
Sent: Monday, June 17, 2013 6:51 PM
To: 'git@vger.kernel.org'
Subject: RE: GIt error


Hi,

1.Iam getting error attached when cloning of repository is done:



2.Also, when file is tried to be added,it gives error below:

$ git add *
fatal: unable to stat 'src/development_architecture/integration_application_proj
ect_template/provider_archetype/provider_archetype/src/main/resources/archetype-
resources/__rootArtifactId__-data/src/main/java/com/accenture/afpj/sample/skelet
on/visitor/data/VisitorRepositoryJpaImpl.java
': Filename too long

Request you to help to resolve same asap as it is affecting the project.
Regards,
Justin,
-----------------------------------------------------------------------------------------------------
Sun Certified Enterprise Architect for Java EE platform | Certified TA | Java Capability | Accenture- India Delivery Center
AIM: justinsprabhu| +91-9611804388 (m)


This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited.

Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

______________________________________________________________________________________

https://www.accenture.com

:stare: (emphasis mine)

zokie
Feb 13, 2006

Out of many, Sweden

Lysidas posted:

src/.../src/.../src/.../VisitorRepositoryJpaImpl.java
Is this some kind of record?

kitten smoothie
Dec 29, 2001

Lysidas posted:

:stare: (emphasis mine)

I am actually really surprised by how cordial the other list members are being when responding to this person; I expected them to just rip the guy to shreds but they're actually making some reasonable effort to help him and not look like absolute dicks. Good on them.

But they're still finding very clever ways to make fun of the dude. Case in point, from down-thread:

quote:

> > For Below issue , O/S is Windows7.
> > 1.Iam getting error attached when cloning of repository is done:
>
> What error?

Okay, the Microsoft Word document with two screenshots has been
scrubbed by the list software but passed through the git-users list
where you posted this as well; answering here.

Good lord, did I hate when my clients did this when I was in consulting.

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
Agreed. I'm amazed by how patient many of the list members are.

I also like the wording and tone of this response:

quote:

Please next time you ask consider doing two things:
  • If you post your message to several groups, take care to mention this fact in each of them.
  • Do not require anyone to do anything "ASAP" unless this claim is backed by your or your employer's wallet.

Strong Sauce
Jul 2, 2003

You know I am not really your father.





FYI for others wondering, this is on a mailing-list. An archive of it is here although I don't know if its complete.

http://marc.info/?l=git&m=137147574728306&w=2

kitten smoothie
Dec 29, 2001

Strong Sauce posted:

FYI for others wondering, this is on a mailing-list. An archive of it is here although I don't know if its complete.

http://marc.info/?l=git&m=137147574728306&w=2

Here's a link to the whole thread. Sorry for not including it when I started quoting other messages.

http://thread.gmane.org/gmane.comp.version-control.git/228065

EAT THE EGGS RICOLA
May 29, 2008

zokie posted:

Is this some kind of record?

You've never worked with lawyers, have you? This is nothing.

Strong Sauce
Jul 2, 2003

You know I am not really your father.





Sun Certified Enterprise Architect for Java EE platform

Dren
Jan 5, 2001

Pillbug
Lets not forget to recognize the other potential horror there, 'git add *'.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Assuming you have an up-to-date .gitignore, it sounds perfectly reasonable to me.

facepalmolive
Jan 29, 2009
code:
$ echo 'src/development_architecture/.../VisitorRepositoryJpaImpl.java' | tr '/' '\n' | sort | uniq -c | sort -nr
   3 src
   2 provider_archetype
   2 main
   1 visitor
   1 skeleton
   1 sample
   1 resources
   1 java
   1 integration_application_project_template
   1 development_architecture
   1 data
   1 com
   1 archetype-resources
   1 afpj
   1 accenture
   1 __rootArtifactId__-data
   1 VisitorRepositoryJpaImpl.java
provider_archetype/provider_archetype

e: gently caress broke tables

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Suspicious Dish posted:

Assuming you have an up-to-date .gitignore, it sounds perfectly reasonable to me.

I might go so far as to say that if you can't do git add *, you should fix that. Having a clean working directory makes it far harder to do things like forget to commit a new file.

Deus Rex
Mar 5, 2005

Plorkyeran posted:

I might go so far as to say that if you can't do git add *, you should fix that. Having a clean working directory makes it far harder to do things like forget to commit a new file.

git add * won't add anything in . directories though :q:

I use git add .

Dren
Jan 5, 2001

Pillbug
I usually do git add $(git ls-files -m) then follow it up with git adds for any new files. Now that I've seen everyone's posts I guess I'll clean up the gitignore file.

Adbot
ADBOT LOVES YOU

Marsol0
Jun 6, 2004
No avatar. I just saved you some load time. You're welcome.

Dren posted:

I usually do git add $(git ls-files -m) then follow it up with git adds for any new files. Now that I've seen everyone's posts I guess I'll clean up the gitignore file.

Generally, I do this with git add -u . which only adds already-tracked, modified files (well, I also use -p).

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply