|
You are welcome friend
Happy coding.
|
|
|
|
|
What processor were you using that had a "jump far" instruction whose effect could be simulated with many shorter jumps? Were you using a 68000 and with the "bra" instruction rather than "jmp"? The "near jmp" instruction on the 8088 can't go between segments; were you using something else?
BTW, I have done some creative code-rearranging on some cycle-critical stuff for processors where conditional branches were limited to +/-127 instructions and I couldn't afford excessive jmp's. From a design standpoint, a horror, but it made things work which would otherwise take too long.
|
|
|
|
|
We were using 8088 Assembly and i was using simple "jmp" instruction which has limitation to +/- 127 bytes.
And i forgot to mention that my this 65K lines of code produced an executable of only 3.5K bytes... how about that?
Cheers
|
|
|
|
|
I've got a co-worker, who has done some great job in producing handsome and easy to understand pieces of code. The previos pearl was a 238 lines method, and when I asked to refactor it, he told that it was just fine.
Still, this one is my favorite. (The name of the metHod is not that important)
<pre>public void SendMetod<T, T1, T2>(IEnumerable<T> t)
where T: class
where T1: class
where T2: class</pre>
For some company issues I cannot post the method itself(a nice piece of work too, trust me), but it's header is adorable. T, T1, T2 and t is kinna brain explosive
-- Modified Thursday, September 2, 2010 5:53 AM
|
|
|
|
|
T2 was one of those rare movies where the sequel was better than the original. I understand what T1 and T2 are, but what is T? A prequel, perhaps? In any event, I'm glad they're making it with class.
|
|
|
|
|
Ha-ha)
Probably you are right. In this case, what does "t" stands for?
Most likely (bc it is an instance of T), this is from the first Terminator, the one that got smashed by Sarah Connor during the final battle inside the factory.
Luckily, the author of that generic is not a fan of Aliens series )
|
|
|
|
|
aspdotnetdev wrote: I understand what T1 and T2 are, but what is T?
It's a typo... I think, he was suppose to write T0 ...
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
|
|
|
|
|
Finding good names for things is always difficult!
I have seen names like T, T0, T1, T2. A truly odd pattern
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
Yeah ) From time to time I (and many other programmers) also got stuck when it comes to naming ))
Probably, the part of the problem is that people who don't know generics usually google the first working example and rather often it uses such naming. To make things worse, Microsoft's MSDN website also "teaches" such generics namings.
However, common sence should have won in my co-workers's case. Besides, he could have looked at other generics in that very same project, where type arguments are named like "TWrapper" or "TBaseObject" and thus bear some helpful info. Obvoiusly, exploding my poor brain with a whole bunch of T's wasn't a good option
|
|
|
|
|
I have seen shops where they think that T1, T2, etc is poor naming. Instead their standard is to use T, U, V; a far better naming convention.
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
I didn't think I would get voted a 2 on my post. Maybe they didn't notice the wink? Or perhaps they like the T, U, V naming convention?
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
SELECT VALADMREC INTO vVALADMREC FROM CUSTOMERS WHERE IDTYPE =linea;
SELECT PF INTO vPF FROM CUSTOMERS WHERE IDTYPE =linea;
SELECT TDP INTO vTDP FROM CUSTOMERS WHERE IDTYPE =linea;
SELECT DP INTO vDPA FROM CUSTOMERS WHERE IDTYPE =linea;
SELECT DPR INTO vDPR FROM CUSTOMERS WHERE IDTYPE =linea;
SELECT TIPODESRES INTO vTIPODESRES FROM CUSTOMERS WHERE IDTYPE =linea;
SELECT PAGOPREV INTO vPAGOPREV FROM CUSTOMERS WHERE IDTYPE =linea;
SELECT Prima INTO vPORCPRIMA FROM CUSTOMERS WHERE IDTYPE =linea;
SELECT TIPO_TERCERO INTO vTIPOTERCERO FROM CUSTOMERS WHERE IDTYPE =linea;
|
|
|
|
|
I don't see the problem...why can't that be valid in the right context?
|
|
|
|
|
That is valid, but is not necesary to create a SELECT stmt by each field, just creating SELECT field1, field2, field3 INTO var1, var2, va3... can get the values in one line.
|
|
|
|
|
It looks like each table being inserted into is different. That cannot be done with one line. There might be a good reason for that.
|
|
|
|
|
I think those vXXXXX thingies are (local) variables in the procedure and no tables.
|
|
|
|
|
You are correct sir
I need an app that will automatically deliver a new BBBBBBBBaBB (beautiful blonde bimbo brandishing bountiful bobbing bare breasts and bodacious butt) every day.
John Simmons / outlaw programmer
|
|
|
|
|
In SqlServer unless those were declared somewhere it would create a table vXXXXX for each statement, if you wanted an assignment it would just be SELECT vXXXX = XXXX from table. You can string as many of those together in one statement as you like afaik.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
No, variables have "@" in front of them. For example:
DECLARE @SomeVariable int
SELECT @SomeVariable
A SELECT INTO statement copies one set of values into a new table (it creates the new table).
|
|
|
|
|
This is PL/SQL, not T-SQL. (Oracle, not SQL Server)
|
|
|
|
|
|
Hey! Where did you get my code?!! o_O
|
|
|
|
|
I know where this may actually be valid. If the customer table is a monster and you need to do multiple complex joins and filtering then dropping them into table vars may be valid, 9 of them does seem somewhat excessive. It would depend on the downstream requirement.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Yes, but even if there are 9 variables, you don't need 9 different queries to populate them. I think that's the point of the OP.
Instead of:
SELECT X INTO vX FROM CUSTOMERS WHERE IDTYPE =linea;
SELECT Y INTO vY FROM CUSTOMERS WHERE IDTYPE =linea;
SELECT Z INTO vZ FROM CUSTOMERS WHERE IDTYPE =linea;
you can do:
SELECT X, Y, Z INTO vX, vY, vZ FROM CUSTOMERS WHERE IDTYPE =linea;
The selection criteria in this case are identical for all 9 variables, so you can fetch them all in one hit.
|
|
|
|
|
Find in code :
if (Area.GetValueOrDefault(-1) == -1)
{
return 0;
}
return Area;
It's lucky that Area is non negative.
|
|
|
|