Reputation: 304 Architect
- Active Posts:
- 676 (0.42 per day)
- 27-June 09
- Profile Views:
- Last Active:
- Yesterday, 11:22 AM
- OS Preference:
- Favorite Browser:
- Favorite Processor:
- Who Cares
- Favorite Gaming Platform:
- Your Car:
- Who Cares
- Dream Kudos:
- Expert In:
- Computer Science
Posts I've Made
Posted 5 Dec 2013f(3) prints a certain output. The last thing f(3) prints is "3". Before that "3" it loops 3 times and calls f(2). So, the output is f(2) f(2) f(2) 3. Now you just need to figure out the output of f(2) and replace each instance with that output. You can probably see from the output that f(2) will evaluate to "1 1 2", but you should trace through the logic to understand it.
Posted 4 Dec 2013I am assumming the Order.weightgroup starts out blank, so when you join Order O on W.nr = O.weightgroup the result is blank because W.nr never equals any O.weightgroup. The way to get the correct update syntax is to first write a select statement to select the values
select O.OrderId, O.weightgroup, W.nr from Weightgroup W inner join Order O on W.beginweight<=O.weight and O.weight<W.endweight
The result should be the order, a blank weightgroup, and what value that weightgroup should be. Then copy portions of the select code and fill in the following template
update /*TableAlias*/ set /*UpdateTableFields*/ = /*SelectStatementFields*/ from /*select statement's "from" clause*/
Your code should look something like
update O set O.weightgroup = W.nr from Weightgroup W inner join Order O on W.beginweight<=O.weight and O.weight<W.endweight
This will populate the weightgroup of every order
Posted 4 Dec 2013You can find comparisons by googling "stack vs heap".
QuoteI suppose when allocation would occur in the stack, it would take up less space
You phrase that as if it's a good thing. On the stack you are limited in the amount of space you can use. If you exceed that limit, you run into a fairly common error of "stack overflow". You can also talk about whether or not a variable can be resized on the stack.
Quotebut more time
I think this was a typo. Access to a stack is fast and organized. It takes less time. It's faster.
Quotewhereas in a heap, it would take longer to sort through
Correct, though I would be more specific as to why you are searching (not sorting) through the heap. It may also be worth noting that heap access is relatively slower than stack access.
Quotebut less size needed for allocation?
No, the size "needed" for allocation is the same. It is the amount of space "available" that differs. You can also talk about whether or not a variable can be resized on the heap.
Posted 4 Dec 2013
QuoteCan we not solve the clique problem by using an intrinsic property that we know the answer has, which is that it has the highest number of nodes all connected to one another. Can we not use this to make the answer present itself? Perhaps by giving each node a synergistic property that expresses itself in an exponential manner, but only when it participates in a clique. In this case, the largest clique would produce the highest number. It would perhaps, light up.
You seem to be suggesting that we shift the work from being done upon asking the problem to being done when the graph is being assembled. You are simply trying to cheat the system by waiting to ask the question until after the answer has been found. The work still has to be done and will still take a really long time, thus still being not P.
Posted 2 Dec 2013So, your command sp_rename 'product.category', 'product.category_id', 'column' renamed the column "category" to "product.category_id". To remove the extra "product." in the column name, the syntax is sp_rename 'product.[product.category_id]', 'category_id', 'column'
- Member Title:
- D.I.C Addict
- 29 years old
- July 23, 1984
- Chess, math, computers, AI
- Years Programming:
- Programming Languages:
- C++, C#, VB.net, SQL, OCAML, LISP, MIPS
- Website URL: