@Donavon We encourage you to take a look around the site. You may find it especially useful to look around the Questions/Answers for your language of choice, there's almost certain to be some useful advice for you in there :)
SQL again..... anyone tell me what's wrong with this part of my WHERE statement?
(Code IN (SELECT CASE @Type WHEN 0 THEN ('CRI', 'MAG', 'POA') WHEN 1 THEN ('FPO', 'STA', 'DOM') WHEN 2 THEN ('CRI', 'MAG', 'POA', 'FPO', 'STA', 'DOM') END))
This is the implementation of segment tree with lazy propagation. Could you please review this code so that I can improve my go language skill.
package main
import (
//"fmt"
)
var array []int; // Array to store initial input like: [1,2,3,4,5,6,7,8,9,10]
/*
This is Node structure
val ...
I am just wondering whether this code could be done in simpler way:
if (conditon1)
flightChangeInfoList.Add(new ChangeInfo() { IsChangeable = false, ReasonCode = ReasonCode.Departure });
if (conditon2)
flightChangeInfoList.Add(new ChangeInfo() { IsChangeable = false, ReasonCode = Reason...
Feel free to ask on Code Review. However I would strongly recommend you include the whole context - boiled-down "what's the best practice about X?" questions are off-topic on CR, you need to include your actual working code, in its full contextual glory. — Mat's Mug30 secs ago
@Donavon I'll try to spare some time to write up an answer later on. I think a strategy pattern would be nice there, but your post could use a bit more context - can you edit to add the declarations for the locals being used? ideally you'd have the actual method, with its signature. actually ideally you'd have the entire program in there (I'm sure it can fit the 60K character limit!)
AND (
(@SearchType = 'criminal' AND Code IN ('CRI', 'MAG', 'POA'))
OR (@SearchType = 'protection' AND Code IN ('FPO', 'STA', 'DOM'))
OR (@SearchType = 'both' AND Code IN ('CRI', 'MAG', 'POA', 'FPO', 'STA', 'DOM'))
)
I am just wondering whether this code could be done in simpler way:
if (conditon1)
flightChangeInfoList.Add(new ChangeInfo() { IsChangeable = false, ReasonCode = ReasonCode.Departure });
if (conditon2)
flightChangeInfoList.Add(new ChangeInfo() { IsChangeable = false, ReasonCode = Reason...
@EthanBierlein I didn't know that about system("PAUSE"), good to know. However, IIRC there isn't really a decided bracket style for C++, and it's still in controversy (however, I agree on your stance :P)
Feel free to ask on Code Review. However I would strongly recommend you include the whole context - boiled-down "what's the best practice about X?" questions are off-topic on CR, you need to include your actual working code, in its full contextual glory. — Mat's Mug25 mins ago
Welcome to CR! Please include more context, and the actual conditions - what is the purpose of the code? Why do you need these conditions for? What's a ChangeInfo and why does it need to be added into a flightChangeInfoList? What type is flightChangeInfoList? is it a private readonly field? a public mutable one? a function's return value? Feel free to edit your post to include the whole method, or the whole class. We can't review stub code / boiled-down logic. — Mat's Mug ♦4 mins ago
C# here. I should learn C though, so I can better program my Arduino and teach my kids (and myself) about robotics, get them hooked on programming as well
I have an Arduino Uno. I think I might try to create a car that follows a line on the floor. that would be cool, I just need to figure out what all I need, and then call it a school expense
@Zak Please. There's no better control than self-control. Asking moderators to ban you because you can't focus on things doesn't solve anything, really. We can't hold your hand and make sure that you don't waste time on other sites. In the end, it's all up to you.
Yeah, it's an interesting effect these sites can have on you.
On the one hand there is the boost to self-esteem and personal pride with high reputation and upvotes...but you don't always get the upvotes you feel you deserve.
On the other hand, there is the fear of looking stupid in front of you...
"How can I keep from getting addicted to SO?" asked Jul 9 at 17:39 by Jonathan Sampson ♦
Ahem:
By the time you asked this question, it was already too late.
> Not all addictions are bad. I mean you could be hooked on leprechaun porn or something and that wouldn't do anybody (except maybe the leprechauns) any good.
From personal experience... Have a child!
That will force you away from SO for at least a short period of time, which may be just enough momentum to help you break free from its gravity. ;)
I'm writing and app in AngularJS and am learning about writing RESTful services. I also want to make sure that I'm understanding the MVC pattern correctly. In my code, this is my take on how I'm implementing MVC.
I have two services that get JSON data from the server. The JSONController then ...
So, I'm writing a sub. It's going to determine which type of business is being detailed on a particular line of data. It's going to use column positions to check if the data exists, and then output the corresponding string if it does.
I've decided that the best way to organise a group of my argu...
I am developing mvc project and I am writing jQuery functions very much per page and it's getting complex while function counts incresing. Finally page header looks very dirty.
I decided using java-script's oop, I wrote this code:
var thisPage = function () {
var page = this;
page.showL...
I just started javascript about a week ago. For my first project, my goal was to use my knowledge of basic javascript to create somewhat of a "thinking computer brain," so to speak. I wasn't focused on the looks of it, as seen by my only using the basic prompts and alerts. I just wanted to get us...
http://www.commitstrip.com/en/2015/08/31/fixing-a-bug-when-the-whole-world-seems-to-be-against-you/ CommitStrip - Blog relating the daily life of web agencies developers Fixing a bug when the whole world seems to be against you CommitStrip 1441044006
Related but not a duplicate: How far off-topic can we get in 'the 2nd monitor'?
Today was a complicated day in the history of The 2nd Monitor.
On one side there appears to be consensus something went wrong which should be handled. On the other side there appears to be disagreement about how muc...
@Donavon I'm general "IT guy" for a small Finance Company. People have things they want done/automated/created (inevitably in Excel), I figure out how to make it happen.
I'm writing a sub which is going to determine which type of business is being detailed on a particular line of data. It's going to use column positions to check if the data exists, and then output the corresponding string if it does.
I've decided that the best way to organise a group of my argum...
I have an SSL configured on my site, but when I call file_get_content() on my own site, I can echo the whole site. I'm concerned as I believed this was impossible if an SSL is installed. I've tried various preventative measures to no avail eg:
$foo = $_SERVER[SERVER_NAME];
if($foo === 'www.e...
@Malachi Be careful with your wording, please. Calling for a downvote brigade (for any site) is not appropriate. There's a line between "this answer wasn't that helpful" and "hey everyone, help downvote this post!"
@IsmaelMiguel Yeah, honestly I've learned more about good in my 2-3 years interning then in my formal training (granted it's been only one year, but I don't foresee much better anytime soon)
@Zak I've reviewed your latest VBA post. For the record, I didn't upvote the question, because I don't like A vs B questions, and I find it would be a much better question with more meat/context.
Let's say I have a bunch of Widget, where a Widget is
class Widget (sku: Int, label: String, name: String, description: String)
And I have 2 sources of Widgets:
List[Widget] wInventory = getWidgetsInInventory()
List[Widget] wCatalog = getWidgetsFromCatalog()
I want to use the name & label...