|
Also, people had been using hacks for concatenation like #define GLUE(a, b) a/**/b. But then they standardized on comments being replaced with a single space, which meant they needed some formal way to do concatenation, which begat ##.
|
# ? Mar 27, 2015 17:38 |
|
|
# ? Jun 8, 2024 05:57 |
|
Visual Basic .NET code:
|
# ? Mar 27, 2015 17:43 |
|
OOP method for creating an HTML carousel/slider for your website.php:<? namespace _global\derp\_ui\slider\data; use _global\_data\data\ADefaultData as DefaultData; use _global\_data\dataSet\DefaultDataSet; require_once(OBJECTS_GLOBAL."/_data/data.php"); require_once(OBJECTS_GLOBAL."/_data/dataSet.php"); class SliderData extends DefaultData{ public $img; public $headline; public $content; public $cta; protected function __constr__(&$data){ $this->cta=new DefaultDataSet(); $this->cta->init(); } protected function __constr(&$data){ parent::__constr($data); self::__constr__($data); } protected function __constrDB(&$data){ parent::__constrDB($data); self::__constr__($data); } } class IMGData extends DefaultData{ public $src='img.jpg'; public $alt=''; public $title=''; function __constr__(&$data){ if(isset($data['src'])) $this->src=$data['src']; if(isset($data['alt'])) $this->src=$data['alt']; if(isset($data['title'])) $this->src=$data['title']; } protected function __constr(&$data){ parent::__constr($data); self::__constr__($data); } protected function __constrDB(&$data){ parent::__constrDB($data); self::__constr__($data); } } class CTAButtonData extends DefaultData{ public $label='CTA BUTTON'; public $href='#'; public $target='_self'; public $title=''; protected function __constr__(&$data){ if(isset($data['label'])) $this->src=$data['label']; if(isset($data['href'])) $this->src=$data['href']; if(isset($data['target'])) $this->src=$data['target']; $this->type='button'; } protected function __constr(&$data){ parent::__constr($data); self::__constr__($data); } protected function __constrDB(&$data){ parent::__constrDB($data); self::__constr__($data); } } class CTAGraphicData extends CTAButtonData{ public $img=''; protected function __constr__(&$data){ if(!isset($data['img'])) $this->img=new IMGData(); if(isset($data['label'])) $this->type.="-graphic"; else $this->type="graphic"; } protected function __constr(&$data){ parent::__constr($data); self::__constr__($data); } protected function __constrDB(&$data){ parent::__constrDB($data); self::__constr__($data); } } ?> php:<? namespace _global\derp\_ui\slider\display; class SliderDisplay{ function __construct(){} public static function & renderDisplay(& $data){ // Declare local variables. $html=''; $img; $cta; $length_i=sizeof($data); for($i=0; $i<$length_i; $i++){ $ds=$data[$i]; $img=$ds->img; $cta=$ds->cta; // BEGIN: Slide $html.='<li id="'.$ds->id.'" class="slide" data-slide>'; $html.='<div class="slide_liner">'; $html.='<div class="slide_content_container" data-slide-content><section>'; $html.='<a class="pg_anchor" id="'.$ds->id.'" name="'.$ds->id.'"></a>'; // IMG $html.='<div class="imagecontainer">'; $html.='<img id="'.$img->id.'" class="'.$img->css.'" src="'.$img->src.'" alt="'.$img->alt.'" title="'.$img->title.'" data-slide-img />'; $html.='</div>'; // BEGIN: content $html.='<div class="contentcontainer"><div class="content fixedwidth"><div class="liner">'; // Headeline & Copy $html.='<h1>'.$ds->headline.'</h1>'; $html.=$ds->content; // CTA $length_j=$cta->length(); for($j=0; $j<$length_j; $j++){ $btn=$cta->get($j); $html.='<a id="'.$btn->id.'" class="btn cta '.$btn->css.'" href="'.$btn->href.'" target="'.$btn->target.'" title="'.$btn->title.'">'; switch($btn->type){ case 'button-graphic': $img=$btn->img; $html.='<img id="'.$img->id.'" class="'.$img->css.'" src="'.$img->src.'" alt="'.$img->alt.'" title="'.$img->title.'"/>'; default: $html.='<span class="data">'.$btn->label.'</span>'; break; case 'graphic': $img=$btn->img; $html.='<img id="'.$img->id.'" class="'.$img->css.'" src="'.$img->src.'" alt="'.$img->alt.'" title="'.$img->title.'"/>'; break; } $html.='</a>'; } $html.='</div></div></div>'; // END: content $html.='</div>'; $html.='</section></div>'; $html.='</li>'; // END: Slide } return $html; } } ?>
|
# ? Mar 27, 2015 18:23 |
|
Munkeymon posted:Your poo poo tier CC sounds like they have their poo poo together (in that area) and you should probably write someone a nice letter to that effect. I probably should. We're really only poo poo tier in terms of perception and the amount of CS theory we're taught. As far as practical stuff that you actually use in industry we're pretty good. VCS/Unit Tests are mandatory for all projects, emphasis is placed on good code rather than just working code (our profs will happily sit down with you and do code reviews before submitting, which is nice), most projects are group projects and they have us do scrum, etc. Side effect of all our profs still working in industry rather than being career academics I guess. The only real downside is the lack of theory we get, but if you want something theory heavy with lots of math you're probably at university anyways.
|
# ? Mar 27, 2015 19:18 |
|
Is this an open-source horror?package author posted:This sounds like a great feature/horrible bug, but unfortunately we don't currently have the development bandwidth to support it/fix it. If you'd like to submit a pull request that implements this feature/fixes this bug, please follow the instructions in the development vignette. me posted:That's fair, but shouldn't this be left open in the meantime, since it is an open bug? I mean, it might be fairly rare for users to run into it but to the extent that the GitHub Issues page is a "known bugs" list it could prove helpful for other users to see it here. package author posted:Unfortunately we just don't have the brain space to manage a list of open bugs that we're never going to fix. i.e. this is declaring github issue bankruptcy. All the issues will still be available via google etc. Guy closes hundreds of open GitHub issues with this message, on a very highly used package. Now, a year later, there are a hundred new open issues, some probably duplicates of closed ones. Is it me or is this not how open-source is supposed to work?
|
# ? Mar 27, 2015 19:23 |
|
Open source has always been a cooperative anarchy, the only thing it's "supposed" to do is give anyone access to the code that wants it. Anything more than that is gravy. I mean yeah the decision to close unfixed issues is a bit dumb, but it's their project and they can do whatever the hell they want.
|
# ? Mar 27, 2015 19:29 |
|
That just seems like a situation where they are creating more work for themselves by policing the Issues. By letting them stay open, they might be able to free up some of that precious developer bandwidth. Unless they just like playing whack-a-mole with Issues.
|
# ? Mar 27, 2015 19:35 |
|
I've worked with a lot of people that just really hate the idea of having any open issues. I've never really understood it.
|
# ? Mar 27, 2015 20:05 |
|
Plorkyeran posted:I've worked with a lot of people that just really hate the idea of having any open issues. I've never really understood it. Yeah, colloquially known as managers. "This two week old report is making our metrics look bad, I need you to close it so I don't get dinged for it in the status report. "
|
# ? Mar 27, 2015 20:17 |
|
ExcessBLarg! posted:However, "function-like" macros can generate all sorts of expressions that wouldn't be valid [...] I had reason to curse function macros just yesterday. Defined a class something like this: code:
|
# ? Mar 27, 2015 20:29 |
|
xzzy posted:Yeah, colloquially known as managers. We need target dates on all our open issues at work, even if there's no way in hell we'll meet them or the issue will ever get fixed at all. These target dates also can't be further than two weeks in the future so I have open ones from 6+ months ago (that are probably never going to get fixed) that I've just been steadily pushing the date back on two weeks at a time every two weeks because metrics. If I ever forget and it goes past the target date the QA lead emails me a screenshot of his spreadsheet.
|
# ? Mar 27, 2015 20:54 |
|
Plorkyeran posted:I've worked with a lot of people that just really hate the idea of having any open issues. I've never really understood it. - People will think your project is unresponsive because of all the open bugs and you're a jerk. - People will think your project is buggy because of all the open bugs and you're a jerk. - People will think your project is dead because of all the open bugs and you're a jerk.
|
# ? Mar 27, 2015 21:42 |
|
Also, the fact that it indicates your software is imperfect somehow, for which there is never any excuse.
|
# ? Mar 27, 2015 23:38 |
|
SupSuper posted:In open-source there can be a myriad of reasons you don't wanna keep open issues you aren't gonna do anything about : The noise also makes it harder to search for issues you are going to do something about.
|
# ? Mar 27, 2015 23:55 |
|
SurgicalOntologist posted:Is it me or is this not how open-source is supposed to work? The normal way this works is the bug gets closed after six months or a year by an automated script without anybody bothering to check to see if it still applies to the current version.
|
# ? Mar 28, 2015 00:16 |
|
Deus Rex posted:The noise also makes it harder to search for issues you are going to do something about. It seems like the 'on hold' state solves this problem better than closing open bugs does
|
# ? Mar 28, 2015 01:24 |
|
SurgicalOntologist posted:Is it me or is this not how open-source is supposed to work? pseudorandom name posted:The normal way this works is the bug gets closed after six months or a year by an automated script without anybody bothering to check to see if it still applies to the current version. Slightly different context but Jamie Zawinski, of Mozilla and emacs fame posted:In February 2003, a bunch of the outstanding bugs I'd reported against various GNOME programs over the previous couple of years were all closed as follows:
|
# ? Mar 28, 2015 01:26 |
ExcessBLarg! posted:Beware that tossing a function in a header file can cause issues. Unless you declare them "static", including the header in multiple translation units will result in multiple copies of the function being generated in object code with external linkage, with a symbol conflict upon linking. C99/C++ support the "inline" keyword to get around this, but "static" vs. "static inline" is something of a zen riddle, and non-static inline has weird semantics I always forget. This is why you do unity builds
|
|
# ? Mar 28, 2015 01:28 |
|
Blotto Skorzany posted:It seems like the 'on hold' state solves this problem better than closing open bugs does It'd be so nice then if GitHub Issues supported such a thing!
|
# ? Mar 28, 2015 02:01 |
|
My friend sent me this today:code:
|
# ? Mar 28, 2015 02:16 |
|
Blotto Skorzany posted:Slightly different context but No, that's the exact same context.
|
# ? Mar 28, 2015 02:20 |
|
status posted:My friend sent me this today: Just fyi the company's name is in the imports on this if you/your friend are concerned about them being outed. Also Jesus Christ this looks like Android code written by someone who "mastered" PHP. kitten smoothie fucked around with this message at 15:17 on Mar 28, 2015 |
# ? Mar 28, 2015 03:22 |
|
re: ## operator replies, thanks folks.status posted:My friend sent me this today: code:
This is uh, missing some vital innards. Like setting a timeout. Also, using a string as a boolean... what? Never mind that mLogin (a member of the encapsulating class) is returned by the doInBackground() thus becoming the result parameter of onPostExecute(). The more I look at it, the worse it gets. kitten smoothie posted:Also Jesus Christ this looks like Android code written by someone who "mastered" PHP. Evil_Greven fucked around with this message at 07:29 on Mar 28, 2015 |
# ? Mar 28, 2015 07:24 |
|
status posted:My friend sent me this today: I hope he knows that some older devices have buggy deviceId values where instead of being random, they're the same for every phone. Which is a step above the ones that just plop in "Android" and call it a day. I hope he enjoys the literally millions of dupes.
|
# ? Mar 28, 2015 15:27 |
|
I had plenty of exposure to Linux in my CS days, but only one mention of SVN before Git/Hg were a requirement for one class in my last year.xzzy posted:Yeah, colloquially known as managers. Back when I was starting out with corporate development, I was in the process of switching from admin to dev and had a bunch of years old SRs dumped in my lap by the other devs (thanks!). Half of the requesters hadn't been with the company for years. No less than 24 hours later I start getting emails about how I have open SRs that are some of the oldest in the company and that we'll look poorly in a report sent to the CTO if I don't close them by the end of the week.
|
# ? Mar 28, 2015 16:28 |
|
Volmarias posted:There should be a mandatory "here are things you need to learn if you plan on programming for a living" class Oh hell yes.
|
# ? Mar 28, 2015 16:41 |
|
Volmarias posted:I hope he knows that some older devices have buggy deviceId values where instead of being random, they're the same for every phone. Which is a step above the ones that just plop in "Android" and call it a day. I hope he enjoys the literally millions of dupes. Older devices? Zawinski was blogging just a few months ago about lovely cheap Android "smart tv" boxes that all had the same MAC address burned into them. Seemed like a cheap way to run advertising on a TV screen except you can have only one http://www.jwz.org/blog/2014/10/flyer-screens-2/
|
# ? Mar 28, 2015 18:23 |
|
Wheany posted:Oh hell yes. They have that; it's called Software Engineering. Unfortunately the only life lesson usually learned is that one good programmer can do more work than three bad ones in a finite amount of time.
|
# ? Mar 28, 2015 20:47 |
|
KernelSlanders posted:They have that; it's called Software Engineering. Unfortunately the only life lesson usually learned is that one good programmer can do more work than three bad ones in a finite amount of time. One good programmer can often do more work than one good programmer and two bad ones, in fact.
|
# ? Mar 28, 2015 21:11 |
|
Even one bad one.
|
# ? Mar 28, 2015 21:16 |
|
Subjunctive posted:One good programmer can often do more work than one good programmer and two bad ones, in fact. And a good manager knows when this is happening and can stop it.
|
# ? Mar 28, 2015 21:22 |
|
KernelSlanders posted:They have that; it's called Software Engineering. Unfortunately the only life lesson usually learned is that one good programmer can do more work than three bad ones in a finite amount of time. I find that bad programmers are actually really productive.
|
# ? Mar 28, 2015 21:24 |
|
I, myself, am of course an excellent programmer who only produces the minimum amount of the best possible code.
|
# ? Mar 28, 2015 21:25 |
|
Wheany posted:I, myself, am of course an excellent programmer who only produces the minimum amount of the best possible code. I too never do any work.
|
# ? Mar 28, 2015 21:27 |
|
Wheany posted:I find that bad programmers are actually really productive.
|
# ? Mar 28, 2015 22:04 |
|
Subjunctive posted:One good programmer can often do more work than one good programmer and two bad ones, in fact. Sometimes one good programmer can even do more than two good programmers if they have sufficiently different views on what good is.
|
# ? Mar 29, 2015 00:51 |
|
KernelSlanders posted:They have that; it's called Software Engineering. When I took that class, all they did was show us a bunch of Java design patterns, then tell us to make a website in Django.
|
# ? Mar 29, 2015 01:26 |
|
Are management horrors still classed as coding horrors? At my current workplace everyone not involved in the actual coding/development part of the project constantly throws in their own two cents on what tooling we should use. That includes even the company CEO, who used his local mouthpiece to tell us that we shouldn't be migrating to GCC, and we should instead stick with the >$5000/seat compiler he likes, despite not giving any reasons to do so or having anything to do with the coding side himself. All this, despite money being so tight we can't afford to get another proprietary license to build test our code on a build server. All that time and work wasted based on an "intuitive feeling that the more expensive one is better" despite all technical arguments we make to the contrary. Now we're about to spool up another project, and I'm already getting directions on what RTOS and compiler we should use from the same people ("the proprietary ones!"), despite not even having the official SDK up and running yet. Whelp.
|
# ? Mar 29, 2015 01:51 |
|
EpicCodeMonkey posted:>$5000/seat compiler These are a thing?
|
# ? Mar 29, 2015 02:17 |
|
|
# ? Jun 8, 2024 05:57 |
|
status posted:These are a thing? Welcome to the world of embedded systems, where IAR pays vendors to ensure they get first support of all chips so there's little choice when they hit the market. Their wonderful IDE reminiscent of Windows 3.1 that crashes all the time, uses a crazy XML project format (ASCII encoded binary, comma separated in a single XML node for some settings) and can't compile files in parallel could fill up this thread. http://www.futureelectronics.com/en/Technologies/Product.aspx?ProductID=EWARMIARSYSTEMS5016703&IM=0e t That's USD$6000 a seat actually, but you can find it for USD$5000 if you shop around.
|
# ? Mar 29, 2015 02:21 |