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
OddObserver
Apr 3, 2009

Plorkyeran posted:

Setting up a local svn server is a hell of a lot more work than "git init".

"svnadmin create" isn't. Again, there are lots of criticism to be made out of svn, but for
single-user use, it's perfectly capable of working off file system, w/o a server.

Adbot
ADBOT LOVES YOU

Tulenian
Sep 15, 2007

Getting my 'burg on.
I think the thing that really kills entry into git for newbies is the lack of GUI support and a version that actually runs natively on Windows.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
You mean, like, if there were some sort of tortoisegit?

Zombywuf
Mar 29, 2008

Internet Janitor posted:

You mean, like, if there were some sort of tortoisegit?

I assume from this comment that you've never actually used TortoiseGit. If you're on windows you really want to be using TortoiseHG.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
Thankfully I'm not on Windows and I don't have an aversion to commandline apps. My point was simply that GUI-based clients for Git exist and come in form factors already familiar to SVN users.

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

Zombywuf posted:

I assume from this comment that you've never actually used TortoiseGit. If you're on windows you really want to be using TortoiseHG.

Does git still have huge performance issues on Windows? That's the reason we went with hg at work a few years ago.

Plorkyeran
Mar 22, 2007

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

TRex EaterofCars posted:

Does git still have huge performance issues on Windows? That's the reason we went with hg at work a few years ago.
It's fairly slow compared to git on Linux, but it's still (by far) the fastest VCS I've used on Windows. I haven't used hg on Windows, though.

Lurchington
Jan 2, 2003

Forums Dragoon
last time I tried any of the git-windows versions/ports, it was a hell constructed of finicky path manipulation and an inability to actually get anything working.

I don't usually code on my windows box, but still, it's stupid to pull out:

Internet Janitor posted:

You mean, like, if there were some sort of tortoisegit?

and when confronted with the idea that while it exists, it may not be usable, going with the old standby: "well, it doesn't matter if what I suggested doesn't work, you shouldn't be using <the thing you just asked about>"

Internet Janitor posted:

Thankfully I'm not on Windows and I don't have an aversion to commandline apps. My point was simply that GUI-based clients for Git exist and come in form factors already familiar to SVN users.

My work uses mercurial and that's the main reason I use it at home for my own stuff, but the fact it worked on windows with no effort was nice

Zombywuf
Mar 29, 2008

Basically TortoiseGit is all the bad of TortoiseSVN, TortoiseHg is all the good with none of the bad. And a funky commit dialog.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
Lurchington: Ok, I was being unnecessarily glib and my second comment was a smug copout. Honestly, though, I used TortoiseGit at work for about a week before I discovered GitBash. Much like TortoiseSVN, I noticed that status icons didn't always update properly, but otherwise I thought it was pretty serviceable. Clearly not everyone shares this opinion.

ultimatemike
May 10, 2005

Little Joe? Yeah, well, you know, that's just, like, your opinion, man.
code:
  
create PROCEDURE usp_UpdateDruationDaysOpen   
AS  
DECLARE @BugID int, @OpenTime_ID int, @FixedTime_ID int, @DurationDaysOpen int  
DECLARE @RequestDate datetime, @FixedDate datetime  
  
DECLARE C_CURS CURSOR FOR  
 SELECT Bug_ID, OpenTime_ID, FixedTime_ID FROM DW_factBugFact  
   
  
OPEN C_CURS  
FETCH NEXT FROM C_CURS INTO @BugID, @OpenTime_ID, @FixedTime_ID  
WHILE @@FETCH_STATUS = 0  
BEGIN  
  
  SELECT @RequestDate = (SELECT Full_Date FROM DW_dimTime WHERE Time_ID = @OpenTime_ID)  
  SELECT @FixedDate = (SELECT Full_Date FROM DW_dimTime WHERE Time_ID = @FixedTime_ID)  
  
  IF (@FixedTime_ID <> -1)  
  BEGIN  
    SELECT @DurationDaysOpen = DATEDIFF(day, @RequestDate, @FixedDate)  
  END  
  ELSE  
  BEGIN  
    SELECT @DurationDaysOpen = DATEDIFF(day, @RequestDate, GetDate())  
  END  
  
  UPDATE DW_factBugFact SET  
  DurationDaysOpen = @DurationDaysOpen  
  WHERE Bug_ID = @BugID  
    
  FETCH NEXT FROM C_CURS INTO @BugID, @OpenTime_ID, @FixedTime_ID  
END  
CLOSE C_CURS  
DEALLOCATE C_CURS  
why why why

NotShadowStar
Sep 20, 2000

Lurchington posted:

last time I tried any of the git-windows versions/ports, it was a hell constructed of finicky path manipulation and an inability to actually get anything working.

The abysmal state of git on Windows is one of the big reasons why Google Code went with Mercurial instead.

Vino
Aug 11, 2010

Zombywuf posted:

Basically TortoiseGit is all the bad of TortoiseSVN, TortoiseHg is all the good with none of the bad. And a funky commit dialog.

Can you be more specific? I'm thinking of switching soon and "good" and "bad" are so subjective!

vanjalolz
Oct 31, 2006

Ha Ha Ha HaHa Ha
I have used tortoiseHg and its quite decent to use, but over time I taught my self to use the cli hg because it was quicker for certain tasks.

TagUrIt
Jan 24, 2007
Freaking Awesome
Ran into some java code earlier where everything was done via javax.swing.Actions.

Example:
code:
public void saveChanges() {
  actions.save.actionPerformed(null);
}
Well, I guess retarded code growth from a button to callable from elsewhere would explain that, so maybe it isn't that ba...

code:
class DoubleActionEvent extends ActionEvent {
  private double dbl;
  public DoubleActionEvent(double dbl) {
    super(null, 0, null);
    this.dbl = dbl;
  }
}

public void updateSpeed(double newSpeed) {
  actions.speed.actionPerformed(new DoubleActionEvent(newSpeed));
}
:bang:

Zombywuf
Mar 29, 2008

Vino posted:

Can you be more specific? I'm thinking of switching soon and "good" and "bad" are so subjective!

TortoiseGit: buggy, slow, confusing and poorly documented. Half the docs start with "install cygwin".

TortoiseHg: fast, haven't hit a bug yet, well designed, one-click webserver for repo sharing, commit dialog that lets you browse your commits and warns you if you put a lovely commit message, still lets you do it if you really want.

Vino
Aug 11, 2010
Well that's upsetting. I was really hoping to switch to git. Any suggestions on better windows frontends for it?

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

Vino posted:

Well that's upsetting. I was really hoping to switch to git. Any suggestions on better windows frontends for it?

Just use hg, the paradigm is essentially the same.

izagoof
Feb 14, 2004

Grimey Drawer
GROUP_CONCAT(DISTINCT CONCAT('<div class="li-main-singlefile"><a href="javascript:doDownLoad(\'',md5(f.id),'\')">', f.filename," - ",f.upload_date,'</a><div class="li-main-singlefile-actions"><a class="colorbox" href="javascript:rmvFile(\'',md5(f.id),'\',\'',o.id,'\')">',IF(f.id=o.file_id,'PO','Delete'),'</a></div></div>') ORDER BY f.upload_date DESC SEPARATOR "\n") files

:pwn:
This is just a small part of a 25 line select statement but I figured this was a big enough coding horror on its own.

w00tz0r
Aug 10, 2006

I'm just so god damn happy.
Not a specific piece of code, but this gem came out of my coworker:

quote:

All Windows API calls are automatically asynchronous, unless something happens to cause them to block.

He's talking about ReadFile here, and he's not using overlapped I/O. Why can't I have a senior dev that I can learn things from? :(

N.Z.'s Champion
Jun 8, 2003

Yam Slacker
EMF is an old vector format used in Microsoft Office and I was trying to convert it to SVG/PNG on Linux but there are no decent libraries (uniconverter, pywmfvu, and freehep don't work that well).

So I ended up making OpenDocuments that only have an EMF picture, on the fly, and streaming them to an OpenOffice instance before saving as PDF.

I guess I found a 100MB conversion library :bang:

edit here's the source code

N.Z.'s Champion fucked around with this message at 04:20 on Nov 8, 2010

TOO SCSI FOR MY CAT
Oct 12, 2008

this is what happens when you take UI design away from engineers and give it to a bunch of hipster art student "designers"
code:
void SetParamFoo(SiteInfo info)
{
  std::set<SiteInfo> sites = GetEnabledSites();
  std::set<SiteInfo>::iterator itr;
  for (itr = sites.begin(); itr != sites.end(); itr++)
  {
    SiteInfo info2 = *itr;
    if (info.GetKey() != 0 &&
        info.GetKey() != info2.GetKey())
    {
      continue;
    }

    int key = info2.GetKey();
    // do stuff with key
  }

  if (this->SomeFeatureEnabled())
  {
    for (itr = sites.begin(); itr != sites.end(); itr++)
    {
      SiteInfo info2 = *itr;
      if (info.GetKey() != 0 &&
          info.GetKey() != info2.GetKey())
      {
        continue;
      }

      int key = info2.GetKey();
      // do other stuff with key and SomeFeature
    }
  }
}
I...just...:psyboom:

Vino
Aug 11, 2010
Not to get more off topic but back on the topic of git in Windows, has anybody worked with GitExtensions? It seems to have a pretty good rep.

ColdPie
Jun 9, 2006

Vino posted:

Not to get more off topic but back on the topic of git in Windows, has anybody worked with GitExtensions? It seems to have a pretty good rep.

http://forums.somethingawful.com/showthread.php?threadid=3113983

Argue
Sep 29, 2005

I represent the Philippines
Okay, here comes another wonderful piece of architecture from our client, incidentally a very large company that's well-known in my country.

There's an HTTP server running, and it listens for requests such as "reset PIN#". When the server receives such a request, it dumps the connection into a pool, and queues up the request for processing by another thread, the service thread.

Now, the service thread does its processing (which is partly what my previous posts were about), and generates a response. How do you suppose this response gets sent back to the original requester?

That's right! It doesn't! Instead, it just plucks any connection out of the pool, and returns the response there. The results are exactly as you might expect. One guy might receive a "successful" confirmation message when his transaction failed, and vice versa. :toot:

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

Argue posted:

Okay, here comes another wonderful piece of architecture from our client, incidentally a very large company that's well-known in my country.

There's an HTTP server running, and it listens for requests such as "reset PIN#". When the server receives such a request, it dumps the connection into a pool, and queues up the request for processing by another thread, the service thread.

Now, the service thread does its processing (which is partly what my previous posts were about), and generates a response. How do you suppose this response gets sent back to the original requester?

That's right! It doesn't! Instead, it just plucks any connection out of the pool, and returns the response there. The results are exactly as you might expect. One guy might receive a "successful" confirmation message when his transaction failed, and vice versa. :toot:

Hahaha

"Your PIN has been reset. Have a nice day!"

"What nooooo"

Vino
Aug 11, 2010

Yeah sorry this was only brought to my attention recently, but thanks!

tripwire
Nov 19, 2004

        ghost flow

Hammerite posted:

Hahaha

"Your PIN has been reset. Have a nice day!"

"What nooooo"

Ahahahahaha

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

Hammerite posted:

Hahaha

"Your PIN has been reset. Have a nice day!"

"What nooooo"

This is the funniest coding horror I've seen in a while, and this post just makes it even better. :lol:

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Ryouga Inverse posted:

This is the funniest coding horror I've seen in a while, and this post just makes it even better. :lol:

I immediately thought of this: http://video.adultswim.com/tim-and-eric-awesome-show-great-job/erics-banking-problems.html

Sovi3t
Jan 11, 2005
purple monkey dishwasher
Please tell me I'm not the only one that finds this completely loving annoying.

code:
$old = ini_set('display_errors',  0);
$old = ini_set('mssql.textlimit', '2147483647');
$old = ini_set('mssql.textsize',  '2147483647');
unset($old);

Lonely Wolf
Jan 20, 2003

Will hawk false idols for heaps and heaps of dough.
Is that nonsense or something that you have to do with PHP? I can never tell.

NotShadowStar
Sep 20, 2000

Lonely Wolf posted:

Is that nonsense or something that you have to do with PHP? I can never tell.

It's one and the same, really.

Sovi3t
Jan 11, 2005
purple monkey dishwasher
here is the example with the php taken out
code:
a = 1
a = 2
a = 3
unset a

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

Sovi3t posted:

here is the example with the php taken out
code:
a = 1
a = 2
a = 3
unset a

I'm no php expert, but I think you're wrong; ini_set has the side effect its name implies. Whoever wrote that is still an idiot for what he's doing with its return value though, obv.

Lonely Wolf
Jan 20, 2003

Will hawk false idols for heaps and heaps of dough.
That's what I thought but for all I knew if you invoked it without binding the returned value the runtime would delete ini file off the server. PHP is the dragon on the corner of the map of programming languages.

Sovi3t
Jan 11, 2005
purple monkey dishwasher

Otto Skorzeny posted:

I'm no php expert, but I think you're wrong; ini_set has the side effect its name implies. Whoever wrote that is still an idiot for what he's doing with its return value though, obv.

That fact is completely irrelevant to the example. Thanks though. Needed a quick sanity check. Staring at poo poo like this for 40 hours a week the last 6 months started to warp my perception of reality. (I'm not kidding)

Factor Mystic
Mar 20, 2006

Baby's First Post-Apocalyptic Fiction

Argue posted:

Okay, here comes another wonderful piece of architecture from our client, incidentally a very large company that's well-known in my country.

There's an HTTP server running, and it listens for requests such as "reset PIN#". When the server receives such a request, it dumps the connection into a pool, and queues up the request for processing by another thread, the service thread.

Now, the service thread does its processing (which is partly what my previous posts were about), and generates a response. How do you suppose this response gets sent back to the original requester?

That's right! It doesn't! Instead, it just plucks any connection out of the pool, and returns the response there. The results are exactly as you might expect. One guy might receive a "successful" confirmation message when his transaction failed, and vice versa. :toot:

This is wonderful

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Argue posted:

randomized http responses

I think this ties for best in thread with Duff's Enigma.

Adbot
ADBOT LOVES YOU

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
$get = sqlInjectionProtect($_GET);

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