@Hosch250 If you're going to learn SQL, may as well get SQL Server Express (free) from Microsoft. It comes with AdventureWorks example database that is good for learning modern RDBMS
Just write a SELECT and try to join tables correctly, and apply aggregates & filters. SELECTs are the most difficult, other operations are pretty easy for the most part
@mjolka because the Declaration.Selection doesn't seem to be reliable - I'm using it to navigate and select identifiers in the code pane, and sometimes the selection in the code pane doesn't match the actual position and/or length of the identifier I'm supposed to be selecting
indeed - and it will happen. but when I end up refactoring the RenamePresenter the whole logic will probably end up in some IRefactoring implementation, and I might just use the TokenStreamRewriter for everything
Don't think an employer would expect you to do much DDL, or write sprocs, triggers and other stuff unless you were getting hired specifically as a DBA.
After a discussion of which users were from Australia, I wrote my first SQL query to find out:
SELECT u.DisplayName'Display Name', u.Reputation'Rep', u.Location'Location'
FROM Users u
WHERE u.Location LIKE '%Australia%'
ORDER BY 'Rep' DESC
As always, please tell me the good, the bad, and the u...
@Hosch250 OK. Write a query that returns the basic post and user data, where a user's first question post received an answer post within 24 hours from when question was asked.
After a discussion of which users were from Australia, I wrote my first SQL query to find out:
SELECT u.DisplayName'Display Name', u.Reputation'Rep', u.Location'Location'
FROM Users u
WHERE u.Location LIKE '%Australia%'
ORDER BY 'Rep' DESC
As always, please tell me the good, the bad, and the u...
I'm working on a project where I have two websites (client and a server).
I've opened web service and I'm trying to "send" a picture from my server to the client
[WebMethod]
public string PictureUrl(string id)
{
return "http://localhost:49400/Website13/images/" + "PICTURE NAME";
}
It work...
I just wrote a small class that generates perfectly unique colors(or that is the plan anyway). I found the original index shifting snippet online, and was just wondering if it could be improved in anyway, or if any problems could arise from using it.
Here is the class which is used to create the...
I am looking to enhance my VBA skills and efficiency with the code below. It currently executes at about 20 minutes. I just recently learned how to use public functions but this project is very robust and I haven't been able to make it more efficient. I've cut off two Case requirements {Auto -...
I am working my way into learning a bit of Scheme (actually, Racket) with the help of a few practical problems to solve. In this case, I want to split a flat list of symbols at a certain delimiter symbol, discarding it and returning the list of splitted chunks.
So, here is my solution:
#! /usr/...
I recently have encountered a memory leak in this code:
from PIL import Image
from PIL.ImageColor import getcolor, getrgb
from PIL.ImageOps import grayscale
import time
import gc
##def memory_usage_psutil():
## # return the memory usage in MB
## import psutil
## import os
## process...
I have written two Perl subroutines to flatten and unflatten a complex hash or array key. This can be useful in situation when you are traversing/parsing a complex data structure like JSON and want to store a given complex key to be later used as an index into a modified data structure. The reaso...
I have three checkboxes and i need to know what combination of checkboxes are checked, i was thinking of doing something like this and adding else if for every other possible combination.
$("#cbOne, #cbTwo, #cbThree").click(function () {
if ($("#cbOne").is(":checked") == true && $("...
Not sure if they actually track if you scroll down to the answer (probably not), so then it's likely a modifier based on the position of your post on the page?
So if that's correct then it's "page views for questions you asked plus page views for questions you answered where your answer is accepted, is in the top 3, has ≥5 votes, or has ≥20% of the votes for answers on that question (excluding self-answers)"
the code have alot of variable on file a, like below
var a_class1 = true;
var a_class2 = true;
var a_class3 = true;
var b_class1 = true;
var b_class2 = true;
var b_class3 = true;
and below code is file b
if (a_class1) {
$('.a').addclass('class1');
}
if (a_class2) {
$('.a').addclass('clas...
I've created two simple methods. One to instantiate a new XMLHttpRequest Object and open the request and another to handle the request.
Can you please point out improvement that can be made or any short comings in my code.
ajax: function(opts) {
var xhr, method, body, constructor;
xhr =...
I decided to learn a Lisp-ish language and I am discovering a very weird and new sintax. The obligatory first programme, that also uses all the fundamentals is the number guessing game.
Did I define too many constants, too few?
Is my code properly spaced and intented?
Is there a cleaner way to...
I have installed openfire in 3 node and added hazelcast plugin in all three nodes, and it works fine. But some time am getting this below timeout exception and its spamming my log.
Will this error cause any major damage to my application and how can i avoid this exception?
2015.04.15 12:16:38 co...
My windows machine goes to developer.apple.com. My iPhone on LTE goes there too. The Mac and our test iOS devices on same network as Windows machine can't get there.
I wrote this program to determine the Greatest Common Factor of any 2 given numbers, and would like to know of any improvements that can be made. I have tested it using a loop and 2 randomly generated numbers and it seems to work perfectly:
import java.util.ArrayList;
import java.util.Scanner;
...
@Joe The question on SO was example code. When it was posted here in that format, it was closed (check question edit history). Also, you're welcome to join us in The 2nd Monitor — nhgrif39 secs ago
I invited him here... But I'm also at work, so in and out of chat.
It's no big deal, we just ask that you familiarize yourself with what's on topic here before sending people this way.
> Is code included directly in my question? (See Make sure you include your code in your question below.) Am I an owner or maintainer of the code? Is it actual code from a project rather than pseudo-code or example code? Do I want the code to be good code? (i.e. not code-golfing, obfuscation, or similar) To the best of my knowledge, does the code work as intended? Do I want feedback about any or all facets of the code?
I wrote this code, called "arrayHistogram", that would generate a random number within a set range, and print it in an array "randomIntArray". It would then make another array "arrayHist" that would count how many times each number in randomIntArray" occurred. The program works, but, I feel I hav...
Ok, I'm thinking I'm missing something. The SO question was some example Factory code he wrote in Swift and wanted to make sure there was no "code smell". He was looking for improvements.
Today I thought about Factory Design Pattern in Swift, and I do an implementation with Extension.
My post is about if anyone have any observation or issue about this implementation violate any convention about Factories? Can I do this way?
I did it because I thought the statics function in my o...
I got ya, it was example code. In the future should I request for them to provide actual code and then post here. I probably should mention that and point them to the FAQ first.
I made a class to manager save file in drive with swift, and I tried do the best work about code.
Someone can get me a feedback about this class? What I can improve? That is the good way to save file?
import UIKit
class TCFileData:NSObject, NSCoding
{
override init() {
}
required ...
Just had a really nice talk with a recruiter. He's working with a company on putting together a brand new team. I think it would be cool to get in on the ground floor like that.
@RubberDuck In my building, you can't get in on the ground floor without an access pass. Because we're on a hill, the main entrance is on the second floor.
an if and else statement counts as more than one line of code inside of another if statement, even if it compiles the way you anticipate, it is still a bad habit to remove the curly braces from such a block of code. but hey maybe you would like VB or Python much better than C# or Java... — Lyle's Mug41 secs ago
I recently have encountered a memory leak in this code:
from PIL import Image
from PIL.ImageColor import getcolor, getrgb
from PIL.ImageOps import grayscale
import time
import gc
##def memory_usage_psutil():
## # return the memory usage in MB
## import psutil
## import os
## process...
I know this has been done a million times before, but this is my implementation of bubble-sort, insertion-sort, merge-sort, heap-sort, and quicksort. Any feedback on how to make it better would be most appreciated. Also, I seem to have a large number of functions in the code before main(). Is ...
> IronPython is an open-source implementation of the Python programming language which is tightly integrated with the .NET Framework. IronPython can use the .NET Framework and Python libraries, and other .NET languages can use Python code just as easily.
@JeroenVannevel I have heard of IronPython, and it has interested me, though I guess I mean, I'd like to have a flavor of C# that stole a few of pythons syntaxes
public class FizzBuzz{
public static void main(String[] args){
for(int i = 1 ; i < 101; i++)
if(i % (5*3) == 0)
System.out.println("FizzBuzz");
else if(i % 3 == 0)
System.out.println("Fizz");
else if(i % 5 == 0)
System.out.println("Buzz");
else
System.out.println(i);
}
}
Now, I want to add a counter to that code, to count the number of FizzBuzz outputs.
This is what the diff looks like:
If the code had the braces in to start with, this is what the diff would look like:
Having the braces in to begin with, makes the change management easier, saves time for the maintainer, and generally prevents complicated changes from breaking other things.
When people come along 2 years after a change was made, and they look at the diff, and see the 'conditional line' (the if-statement line) has changed, they will spend additional time checking to see why, and then discover that nothing was actually changed there.
@Joe TN or AR by chance? I have a pending senior iOS dev offer at a location in AR for a company based out of TN. I think they have a GA location as well, not certain.
My final requires me to create a class Human with constructors, accessors, and mutators, as well as to allow user input and to output a description of each object to the screen. I was hoping to get some general feedback on anything I should add or change, especially efficiency-wise. What do you t...
Pushing problems to future employees is the best way to not care about the health, well-being, or happiness of any of your future subordinates/colleagues/replacements.
And if I were in charge, it'd be a good way of getting yourself fires.
I don't mind one-lining things when it makes sense... But nothing should be sacrificed for the sake of saving a line on a file that will never be printed...
Your bracing style confused me a little bit at first, standard bracing style for C# is next line and not Egyptian style (that's for Java and JavaScript).
you can also streamline more than one using in a row so that you don't have to indent so many times.
So your code will go from this
pu...
I got bored in work and was creating a few things using plain JS (no frameworks allowed! I wanted to get used to progressive enhancement). I realized I would run into a problem if I wanted to access things in other scopes that might be loaded after my current file, and I didn't want to have to ex...
I finally solved this challenge with using recursion and figured out why the automatic scorer wasn't passing my previous solutions. I was using NSMutableArray to store the numbers and with N=18 i was running out of allowed memory by codeeval.com I rewrote the code using integer arrays and i rec...
I'm writing a mathematical expression solver. I'm having a problem with getting the right answer. I no the problem is in taking the last number. here is my code
`int r = 0;
int n = 0;
char op = '+';
for (int i = 0; i < e.length(); i++)
if (E.charAt(i) == '+' || E.ch...
I am looking at this Method
private void ValidatePassword()
{
var hash = Encryption.GetHash(_LoginView.UserID, _LoginView.Password);
var user = _DataService.GetPermissions(_DataService.GetUser(_LoginView.UserID));
if (user != null)
{
_Model = ...
@Hosch250 UNIQUE is used when creating tables and setting a primary key. If you're looking to SELECT unique records, you need SELECT DISTINCT Foo, Bar FROM MyTable
I have three classes Node, Stack and List.
The code works, but I feel there is a better way to do this.
I would like to have some general critique.
class Node:
def __init__(self):
self.item = None
self.link = None
class Stack:
def __init__(self):
self.top = 0...
> You've earned the "Revival" badge (Answered more than 30 days later as first answer scoring 2 or more) for "Converting a MongoDB BsonDocument to XML".
So I am working on a project for a class. Completely open project, implemented however we wanted. It was suggested to not use recursion, but I don't know of another way to tackle it.
We are given tables with attributes and a decision. We have to go through and basically make as many of the attri...
> I have completed the program and it works great for small data sets. For a table with 8 rows and 3 attributes, it completes in .002 seconds. For a table with 75 rows and 7 columns, it took about 12 minutes to complete.
I have the following Hibernate code which I believe should be working, but it throws an error:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.hibernate.exception.SQLGrammarException: ERROR: syntax error at or near "."
Position: 503
...
We want to send an byte[] of 8 000 000 bytes for exemple, but the function NetworkStream.Read can only accept int values, how can we get all the data?
we try to put ulong in this function but it's not possible.
//Reception of data
ulong sizeTrame = mySize;//Really big size
byte[] trame = new by...
But surely it's not difficult to do better than this:
> We are given tables with attributes and a decision. We have to go through and basically make as many of the attributes in the table the same, while still keeping the table as a whole consistent. Meaning no two rows can have the same attributes, while having different decision values.
@sᴉɔuɐɹɥԀ It seems to be some kind of optimization problem, so a naïve implementation could easily be exponential