I just wrote this password validation code function that checks to see if a password will be accepted in AD or not. I'm not sure this is the best way to do it, but for now it works fine. I would love some suggestions on how to make it better. Thanks!!
public String validateNewPass(String pass1, ...
What would be the order of growth of the worst case running time of the following code fragment as a function of N?
int sum = 0;
for (int i = 1; i <= N; i++)
for (int j = 1; j <= N; j++)
for (int k = 1; k <= N; k = k*2)
for (int h = 1; h <= k; h++)
sum++;...
Here's a few things I noted:
Don't have using namespace std; in your code. It's almost universally considered a bad practice.
The C++ standard states that you should use int main() and not void main(). Bjarne Stroustrup (a creator of C++) stated that this isn't even C++ (or even C!). I'm sur...
I'm trying to implement a simple binary search in F# as a way of learning functional programming. I've already implemented it in an imperative way in C# which is my main language, but I thought it would be a nice challenge and a good way to learn functional concepts by implementing it in a recurs...
@200_success / @Jamal - that meta close-flag question just got interesting:
Oh, interesting, as a CR mod, that's why I am intetrested in this discussion.... we have that many? I know that I just click the helful-option on the flag simply because it is 1-less click than decline. Using that as an indicator of whether the flag is helpful or not is.... meaningless, @Gilles — rolfl49 secs ago
@mariosangiorgio it's a good idea to DV also when you VTC. I forget why. I think posts with a certain number of DV get deleted automagically after a certain time.
I took your code and added some returns to it. you were running through all the if statements even when an entire field was missing.
I also added a return "success" if I hit that (which is probably checking all the expressions twice now if one isn't true) it dumps out as a success and will sav...
when you use a given value instead of putting it in a variable (or in a constant), give to the variable a meaningful name and use it http://en.wikipedia.org/wiki/Magic_number_(programming)
Just got this marketing gem from the CEO of my employer:
> While we have capitalized on strong forward momentum, driven by the winning spirit of our people and solid performance in our core business, we need to better position ourselves for stronger performance, balancing growth, profit, and risk.
Guy probably makes 7-figures if not 8... and writes that.
Thanks @mariosangiorgio that makes sense
Wait... that guy is concatenating HTML into Java... is this standard??
I have this GLSL snippet of code that is used for a one-pass gaussian blur effect.
Vertex shader
attribute vec4 position;
attribute vec4 inputTextureCoordinate;
uniform float texelWidthOffset;
uniform float texelHeightOffset;
varying vec2 blurCoordinates[5];
void main()
{
gl_Position = p...
I created this solution awhile ago, and have been going back over my problems to try to make them all more efficient. I have been stuck on this one, and have tried a few different ideas. So far, my original code has still been the "quickest" at over 2 minutes.
Here is the problem and original so...
I am trying to make a 'diner food suggestion' program in Java, that relies on earlier user input. I have at the moment created a basic structure, but i am running into difficuties in terms of storing and inputting data. I would really appreciate some suggestions in terms of ways to input data and...
Hi thanks for the feedback. @SimonAndréForsberg, yes i know that i got a long way to go. The problem is that i need some pointers/suggestions to what road i should follow to accomplish this. E.g. is it possible to store and get the data with arrays etc.. — user40472484 mins ago