|
Not programming so much as CS, but I just realized that on a test I wrote if not (a ⊕ b) for boolean values !(a xor b) is just a==b
|
# ? May 19, 2015 01:48 |
|
|
# ? Jun 5, 2024 05:48 |
|
Oh yeah that's a classic, !(a ^ b) is something I've argued about in a code review.
|
# ? May 19, 2015 02:28 |
|
code:
|
# ? May 19, 2015 04:37 |
|
My mental image is something like a dude on a skateboard, going "Oh my god, I think I finally got this, you gu-" and then faceplanting right into some stairs.
|
# ? May 19, 2015 04:40 |
|
Dessert Rose posted:My mental image is something like a dude on a skateboard, going "Oh my god, I think I finally got this, you gu-" and then faceplanting right into some stairs. that gave me the image of this ::: https://youtu.be/olit-B5Yldc?t=35s
|
# ? May 19, 2015 06:33 |
|
If you ever wanted to see a God Object, here's a great example. I've omitted the rest to anonymize it a bit (and also for sanity).php:<?php include_once "dashhelpers.php"; class Dashboard extends \main{ public $buffer = false; public $metricClass = array(); function __construct(&$post) { global $main, $userid; // more omitted for sanity if($post['event'] ==="promptQuestion"){ $this->run("createPrompt"); echo json_encode(array( prompt => $this->promptMessage )); exit(1); } if($post['event']==="savePrefs") { $this->savePrefs($post); exit(1); } // more omitted for sanity } public $tabs =array(); public $sidebarDefault = array(); public $auxInfo = array(); public $metricDefault = array(); public $sidebar = array(); public $client = array( dataSets => array(), unique => array(), data => array(), totals => array(), gauge => array(), ); public $design = array( calc =>array(), comp =>array(), range=>array(), total =>array() ); public $ignoreColumns = array(); public function jsonReturn ($data){ unset($data['clause']); $data = json_encode($data); echo $data; exit(1); } public function run (){ $list =func_get_args(); $func = $list[0]; if(!method_exists($this,$func)) return; $vars = array_slice($list,1); return call_user_func_array(array($this,$func),$vars); } public function getPref (){ global $userid, $commondb; // more omitted for sanity } public function savePrefs ($response){} public function getRecord($post){ global $database, $main; // more omitted for sanity } public function isBuilt($post){ global $database,$userid; // more omitted for sanity exit(1); } public function allFieldExists($list, $structure){} public function buildNewTable($post){ global $database,$main; // more omitted for sanity } public function getReportCode($r = false){} public function checkIfexists($post){ global $database,$main; // more omitted for sanity } public function formulateTabs ($response){} public function reportPicker (){ global $main, $userid, $database; // more omitted for sanity } public function buildModel ($post){ // more omitted for sanity exit(1); } public function genCustCodes (){ global $userid; // more omitted for sanity } public function add_unique_item($lib, $key){} public function buildMyStructure ($post){ global $main; $query = new \QueryBuilder($this); // more omitted for sanity } function snapshot ($post){ global $userid, $database; $clause = $this->makeClause($post); $post['command'] = str_replace("'","''",$post['command']); list($now) = getsqlfields($database,"select now()"); $now = str_replace(" EST","",$now); $sql = "insert into dashboard_snapshots values ('{$post['naming']}','{$this->getReportCode($post)}','$userid','$clause', '{$post['command']}','$now')"; pg_query($database,$sql); $response = array( sql => $sql, dcr =>$now, ); echo json_encode($response); } function saveSnaps ($post){} function createFavorite ($post) {} function detail ($post){} public function primary($post) { // ... more stuff ... exit(1); } public function getMyDateRange ($sidebar){} public function generateUnique ($response){} public function generateUnique3 ($columns){} public function generateUnique4($response){ global $database; $query = $this->bufferTable(); $response['query']=$query; ini_set("memory_limit","1000M"); ini_set("max_execution_time","1200"); ini_set("max_input_time","200"); pg_query($database,'SET datestyle TO "ISO, YMD"'); $data = $this->runSQL($query); if(!$this->structureKey) return; // ... more stuff ... } public function buildSideBar (){} public function startDashboard($post){ // more omitted for sanity echo json_encode($response); exit(1); } public function makeClause ($post){} public function getSnapShots ($post){ global $database,$main; // ... more stuff ... } public function getFavorites ($post){ global $commondb,$main; // ... more stuff ... } public function userAccess(){} public function add_unique_listItems($listItem,$key){} public function dataCalc ($dataItem,$group){} public function newDataItem (){} public function rangeList ($dataItem){} public function pullDataSet(&$post){} public function createDynamicReport ($post){ // ... more stuff ... exit(1); } public function removeFile($post){ // ... more stuff ... echo json_encode($response); exit(1); } public function saveFile($post){ // ... more stuff ... echo json_encode($post); exit(1); } public function createList ($post){ // ... more stuff ... echo json_encode($this->pullDataSet($post)); exit(1); } public function kendoFormat($columnName){} public function createBaseData ($post){ // ... more stuff ... $this->jsonReturn($record); exit(1); } public function setAsDefault($post){} public function accessDenied ($post){} public function getSourceFiles($post){} protected function bufferTable(){} } Me: Whoa Him: Yeah, it's a bit long. I'm not really sure how long classes are supposed to be. Me:
|
# ? May 19, 2015 16:09 |
|
Should have told him the maximum is 100 lines. Probably wouldn't hurt since apparently they have no intention of learning any of the theory.
|
# ? May 19, 2015 16:22 |
|
All the grades are in on this class. Go hog wild: http://pages.cs.wisc.edu/~cs537-2/ http://en.wikipedia.org/wiki/Perry_Kivolowitz This last project in particular suffers from being a quickly banged-out wall of text with too much emphasis on being "funny". There are at least 5 instructions in here that turned out to be factually incorrect: http://pages.cs.wisc.edu/~cs537-2/projects/p5.html
|
# ? May 19, 2015 17:19 |
|
LeftistMuslimObama posted:All the grades are in on this class. Go hog wild: Doesn't Wikipedia have a policy about people not making pages about themselves unless they're actually a notable public figure? I figure you might be able to get him deleted in revenge.
|
# ? May 19, 2015 17:23 |
537 as an introductory class in a US university?
|
|
# ? May 19, 2015 17:26 |
|
^^ Yeah, this school is weird and all of the CS courses after Data Structures are 400-level at a minimum. None of my undergrad credits transferred because the school I went to used the usual 1xx,2xx,3xx convention.Volmarias posted:Doesn't Wikipedia have a policy about people not making pages about themselves unless they're actually a notable public figure? I figure you might be able to get him deleted in revenge. Eh, I think it's better to leave it there as a monument to how self-absorbed he is. edit: One last fuckup I forgot to mention. By school policy, final grades are due 6 days after the final exam. The final project wasn't graded until 10 days after the exam. They just graded the exam today, 12 days after it was given. I ended up filing a complaint with the registrar, because I can't get reimbursed by my work until I have a final grade and in the mean time the tuition is racking up interest on a credit card. The MUMPSorceress fucked around with this message at 17:30 on May 19, 2015 |
# ? May 19, 2015 17:28 |
|
Scaevolus posted:
|
# ? May 19, 2015 17:51 |
|
In slightly better news about this class, my perfect sweep on the projects boosted my low-B exam performances such that I ended up setting the curve and have the "highest" A in the class according to the instructor. I am finding that I'm way better at the hands-to-keyboard stuff than the theory stuff. Clearly I will not be pursuing a master's degree ever.
|
# ? May 19, 2015 18:44 |
|
Friend of mine works at a certain large firm and had this to say on the Enlightenment Foundation Libraries. http://what.thedailywtf.com/t/enlightened/8795 Look in the comments for one of the developers of the libraries having a meltdown and some good points and counterpoints. notably this is an error you could get at the time he posted that: let's not forget the library printing "You bitch! to the console on a certain error (The developer removed this during his aforementioned meltdown.) tyler274 fucked around with this message at 19:01 on May 19, 2015 |
# ? May 19, 2015 18:58 |
|
tyler274 posted:Friend of mine works at a certain large firm and had this to say on the Enlightenment Foundation Libraries. You forgot quote:And did I mention EFL is the basis of all applications on Tizen? I hope this thing dies in its crib before it can spread to the rest of the world
|
# ? May 19, 2015 19:44 |
|
Munkeymon posted:You forgot Isn't TIzen just Samsung's card they keep in their back pocket in case they ever need to extort Google on an Android design decision by threatening to take their ball and go home? I doubt it'll ever see the light of day. Android's too entrenched now and I don't think they'll be able to compete because people see smartphones as a binary choice between an "Android" and an iPhone.
|
# ? May 19, 2015 19:51 |
|
LeftistMuslimObama posted:Isn't TIzen just Samsung's card they keep in their back pocket in case they ever need to extort Google on an Android design decision by threatening to take their ball and go home? I doubt it'll ever see the light of day. Android's too entrenched now and I don't think they'll be able to compete because people see smartphones as a binary choice between an "Android" and an iPhone. People see smartphones as a choice between a Samsung and an iPhone. Most people barely know what the word Android means in this context. But regardless, this Tizen thing doesn't work as a threat because it doesn't have much in the way of apps.
|
# ? May 19, 2015 20:03 |
|
LeftistMuslimObama posted:Isn't TIzen just Samsung's card they keep in their back pocket in case they ever need to extort Google on an Android design decision by threatening to take their ball and go home? I doubt it'll ever see the light of day. Android's too entrenched now and I don't think they'll be able to compete because people see smartphones as a binary choice between an "Android" and an iPhone. People in the US do, but in other markets even Windows and loving BBY still have a share greater than statistical uncertainty. Hell, sometimes I get mad enough at my phone that I feel like defecting to Windows. Oh, they've subjected Indians to this thing http://arstechnica.com/gadgets/2015/02/samsung-z1-review-the-first-tizen-smartphone-still-feels-like-plan-b/4/ great. It's like they had a meeting that went like "Hey, you know all those Android S-Apps that we bundle that nobody uses except by accident?" <heads nod, approving murmurs can he heard> "We're going to make a whole OS like that!" <chorus of cheerful cheers>
|
# ? May 19, 2015 20:13 |
|
LeftistMuslimObama posted:Isn't TIzen just Samsung's card they keep in their back pocket in case they ever need to extort Google on an Android design decision by threatening to take their ball and go home? I doubt it'll ever see the light of day. Android's too entrenched now and I don't think they'll be able to compete because people see smartphones as a binary choice between an "Android" and an iPhone. Tizen is on Samsung TVs in the wild.
|
# ? May 19, 2015 20:21 |
|
Subjunctive posted:Tizen is on Samsung TVs in the wild. Also their Smartwatches. Although I would be surprised if anyone actually uses them right now though, considering they only work with Samsung phones.
|
# ? May 19, 2015 20:23 |
|
Subjunctive posted:Tizen is on Samsung TVs in the wild. On purpose? Or did it escape from containment?
|
# ? May 19, 2015 20:29 |
|
EFL don't seem fun to use but the shitposters in the comments come off looking worse than the dev trying to defend their design decisions.
|
# ? May 19, 2015 20:59 |
|
Vanadium posted:EFL don't seem fun to use but the shitposters in the comments come off looking worse than the dev trying to defend their design decisions. It's worse than GBS over there.
|
# ? May 19, 2015 21:06 |
|
One of our internal tools is basically a wrapper around a keypass database to launch sessions in all our internal unix environments. I just discovered that it can't handle passwords containing spaces unless you surround your password with quotes. So, if my password is Pass Word, I have to enter "Pass Word" in the application to be able to connect to my environment. The developer has chosen not to put the code into any of the SVN repositories (a horror in itself), so I can't find the offending code, but I can only assume that he's not escaping the password before passing it to PuTTY as an argument, because the bug doesn't happen with another terminal emulator that is launched via RPC rather than invoked via the system.
|
# ? May 19, 2015 22:18 |
|
Vanadium posted:EFL don't seem fun to use but the shitposters in the comments come off looking worse than the dev trying to defend their design decisions.
|
# ? May 20, 2015 00:32 |
|
tyler274 posted:Friend of mine works at a certain large firm and had this to say on the Enlightenment Foundation Libraries. So I don't get how a person who has the technical knowhow to implement the following: quote:Dont use pointers as pointers. Split the bits in them into 3 (or 4) groups, which would be cast to a numerical indexes into 3- (or 4-) dimensional hash map, which in turn results in a real pointer to function + object, and call it, if such exist. yet lacks the experience or common sense to realize why this (or anything else in the OP link) is a terrible idea.
|
# ? May 20, 2015 02:51 |
|
tyler274 posted:Friend of mine works at a certain large firm and had this to say on the Enlightenment Foundation Libraries. Oh geez it's that enlightenment that was the window manager from back in the day. quote:
|
# ? May 20, 2015 03:00 |
|
X window managers are a coding horror in a category of their own, there's been more from scratch "minimalist" implementations that slowly turn into bloated monsters than any other software type.
|
# ? May 20, 2015 03:09 |
|
xzzy posted:X window managers are a coding horror in a category of their own, there's been more from scratch "minimalist" implementations that slowly turn into bloated monsters than any other software type. Two or three lives ago I put a bunch of effort into getting my ctwm config just the way I wanted it for maximum productivity, then I spent years in a corporate environment and came out figuring that as long as a WM wasn't horrible it was good enough.
|
# ? May 20, 2015 03:39 |
|
shodanjr_gr posted:So I don't get how a person who has the technical knowhow to implement the following: I finally clicked the link and read that whole article. Holy hell...
|
# ? May 20, 2015 03:41 |
|
Subjunctive posted:Tizen is on Samsung TVs in the wild. Funny story, the youtube app on Tizen TV has full root access. Lots of security holes like this across the entire thing due to stupid decisions by management from what I understand.
|
# ? May 20, 2015 04:14 |
|
quote:http://what.thedailywtf.com is now being blocked on the corporate firewall at Samsung.
|
# ? May 20, 2015 04:42 |
|
Lol. My company encourages us to read the blogs that poo poo talk us because you can farm their criticism for ideas for improvement when people aren't outright trolling. edit: That is to say, we're actually expected to be reading blogs on the clock, not just in our free time.
|
# ? May 20, 2015 05:29 |
|
Well, that's certainly one way to make sure your people don't find out about how bad things are, I guess they assume everyone will honor their firewall even at home, too. I ran across this when looking up the named arguments pattern in C++, this is the C++11 way: C++ code:
code:
code:
In the end I decided against any of them, it either scans like someone forgot a trailing semicolon and throws you off, or leads to overly long lines that do too many different things. Harik fucked around with this message at 05:45 on May 20, 2015 |
# ? May 20, 2015 05:38 |
|
That is just a thing one person wrote that has never been used for a real project, not "the c++11 way".
|
# ? May 20, 2015 05:43 |
|
Plorkyeran posted:That is just a thing one person wrote that has never been used for a real project, not "the c++11 way". I'm well aware. It's only c++11 in that they're abusing the new features 11 brought. Are there good examples of operator "", or is it just there to be a lurking horror?
|
# ? May 20, 2015 05:46 |
|
code:
|
# ? May 20, 2015 06:10 |
|
"Division is a very costly operation so I optimised it"
|
# ? May 20, 2015 06:33 |
|
QuantumNinja posted:
Suggest to them it's not general enough and they should do it like this instead code:
|
# ? May 20, 2015 09:17 |
|
|
# ? Jun 5, 2024 05:48 |
|
QuantumNinja posted:Saw this in a production codebase last month. Just check if the last 3 bits are 101 or 000
|
# ? May 20, 2015 09:22 |