sql-server and t-sql (short for Transact-SQL) both represent practically the same thing, which is Microsoft's proprietary RDBMS.
From Wikipedia:
Transact-SQL (T-SQL) is Microsoft's and Sybase's proprietary extension
to SQL. [...]
Transact-SQL is central to using Microsoft SQL Server....
I want to focus on just the getGraphStartAndEndPointsInRadians() method of your class, as this is the area I see the most problems with a cursory glance.
First of all, from the method name alone, I can tell it does too much. The word "and" should very rarely be used in method names. It's usage...
Recently, I decided to look over this post again.
As I was reading all the answers, I started to get the feeling that I had seen an answerer's name more than once. Scrolling back up the page, I found out that a single user had posted multiple answers.
When is this sort of thing okay? If you hav...
K so the algorithm does this. It gets the number associated with each char, then adds a random number to it, and saves the numbers it added. Better explained with the code. Anyway, I am going to post the entire project because otherwise it won't make sense to you. :/
I plan to make an Encrypter ...
I'm reading Jon Skeet's book these days (started it a while back but never finished) - learned very interesting things about how Java generics and C++ templates differ from C# generics
I think it was Eric Lippert that posted an answer here on CR, can't remember on what question, but it had to do with multithreading. Mentions Volatile in that answer - when Eric Lippert says nothing in C# is more complex than that, I believe him
Rather than reviewing your specific code -- which at first glance seems very, very buggy -- let me answer your question directly:
What are the best practices with multithreading in C#?
Don't. Multithreading is a bad idea. Programs are hard enough to understand already with a single point o...
> Oh, so you want to write your own code that shares memory? Then take the lock for heaven's sake. I see so much buggy code where people get into their heads that locks are expensive and they write this convoluted godawful wrong code that evades taking a lock that would have cost them twelve nanoseconds to just take. Avoiding a lock to save on its cost is like complaining that the electricity takes too long to get to the light bulb when you flip the switch.
> Admittedly my understanding of the full implications of volatile is incomplete, and is harder to quantify because I first learned Java at a time when volatile often simply did not work. volatile has maybe changed a bit, but, in general, don't use it unless you know what you are doing.
To learn F#, I've implemented this very simple inventory system. While I'm proud that that it's my first program, and that it works, there are still a few areas that I'd like tips on, namely these:
I don't like how I'm using a for ... in ... loop in Inventory.ChangeSelectedItem to find the leng...
Here's my script that I am using to generate thumbnails from urls, optional params are height & width & it's using Codeigniter's image library to achieve that.
Also to keep same files with different height or width separate, I saved the files using sha1 hash(filename+width+height).
public func...
if you have a variable that is "volatile", in Java, any time that variable is accessed you force the memory associated with the variable to be refreshed from/pushed back to the lowest common memory location for all cores.
@Phrancis 1996 or so....
So, a "volatile" variable in Java will be guaranteed to have the value that was last set in it by the most recent thread that ran before your access, when you access it.
I don't think there's a better person to answer this than Eric Lippert (emphasis in the original):
In C#, "volatile" means not only "make sure that the compiler and the
jitter do not perform any code reordering or register caching
optimizations on this variable". It also means "tell the ...
If you have something like a volatile variable inside a tight loop, like while (busy) {...} where busy is volatile, you may be spending your time managing memory, and not computing.
> Volatile fields are a sign that you are doing something downright crazy: you're attempting to read and write the same value on two different threads without putting a lock in place.
It is not only expensive, though, it is really, really complicated.
So, for example, the code volatile++ does not work.
because, the value you read when you get the volatile out of memory, and then increment, may be the same as some other thread that reads the value..... because both threads read at the same time....
then, they both increment the value, and both save the same value back to the same variable,.
Hello I am using Java with SQLite and I am wondering if I am in the right track onto writting good code i.e more or less reusable:
SQL scheme:
CREATE TABLE Foo (
a VARCHAR(11) NOT NULL ,
b INTEGER ,
celular INTEGER ,
nome VARCHAR(255) ,
PRIMARY KEY(a));
CREATE TABLE Bar...
It also is a crazy thing to debug, and diagnose, because the problems are often not visible in small systems.... and you tend to see them when you have 4 sockets, each with 16-core IBM Power chips - each core has 4 hyper-thresads, so you are looking at 256 virtual CPU's running. Each socket has their own dedicated memory, and each has their own memory controller, and l3 caches, etc... and you see the problem on a production server on some client.....
.... then you try to reproduce it on some test data on your dual-core laptop.... it ain't happening.
Other locking and memory management semantics are much, much better to manage, implement, and debug.
@EthanBierlein I don't do F#, but IMO idiomatic functional code would frown at mutable data structures. But I can't be sure, I know nothing of F# and/or functional programming. Never mind me.
Back in the 90's Sybase and Microsoft agreed that Sybase would license their database tech to microsoft, but MSoft would not run on any unix systems, and Sybase would not run on Windows.
Sybase did go to windows later, probably by agreement....
But, SQLServer is the windows "toy" version of Sybase.... of course, it grew up, and in many ways got better.
Sybase version 4.5.1 I think was where the fork happened.
> 1988: Sybase, Microsoft, and Ashton-Tate port the Sybase RDBMS to the OS/2 platform. Microsoft markets the new product as SQL Server. The terms of the agreement give Microsoft a license to Sybase's SQL Server code
The MSoft version was missing a lot of the enterprise-class features of the main code.
Think of it being, at the time, like SQLServer compared to Access.... that's what Sybase was like compared to SQLServer.
Yes. Sybase was the performance hitter of the lot, with some neat client-side tools that the other systems struggled with.
Sybase's procedures and triggers were the best to work with of them all.
also the permission systems and the DDL-in-the-database was industry-leading.
being able to query the database schema using SQL was really nice.
> Ashton-Tate soon drops out. Sybase SQL Server version 4.9 and Microsoft SQL Server 6.0 & 6.5 are virtually identical. Their Transact-SQL (T-SQL) procedural language is very similar, as is the basic process architecture. The main difference is Sybase has a Unix heritage, while Microsoft SQL Server was adapted and optimized originally for OS/2, then for the Microsoft Windows 3.0
sorry @Amadan I am trying to put the example code in here so it will be more clear to you. But for some reason it won't let me add comment again saying I don't have enough reputation by adding the code review. — ror42 secs ago
The syntax for Oracle looks miserable... I don't know much about DB2, come to think of it. I thought returning tables from functions was normal though, isn't that what TVFs do?
I'm talking about DB2's BLU Acceleration thing though, seems like it can work really fast from their numbers, but I can't really imagine how it's indexed and stuff
@Code Review The swap operation that will sort the array. There is no constraint on the type of swap whether consequent or swap of the two elements. — kapil jain54 secs ago
So, if you are reading only 1/7 of the columns, and the columns are compressed from say a double value (64-bits) to just 4 bits (16-different prices per database page of values).......
suddenly, to do a massive analytics statement, you can do 1/200 of the disk IO, and not even have to decompress the data to do the sums.
Of course, if you want to do "select * from transactions", then you're screwed, you have to read all the columns from different places, and then "stitch" them all together again.
The way the compression works, though, is that you can typically macro-index the data by having a "present" marker for each value in each database page.... so you can eliminate whole pages of information if you know the value is on none of that pages records.
I'm playing around with RAII a bit lately and i wan't to know if/how i can improve this (quite simple but very helpful) class.
A word to two decisions i've made and why:
No error handling in construct. I don't think throwing a exception would be appropriate so its up to the user to check valid...
I have a large image of an L-shaped painting on one page. I created divs over parts of the painting I want to explain. When the page loads, I want it to scroll down the length of the image, and then move to the left of the image, stopping at each div for a few seconds. I understand how to get the...
in a data warehouse you often have huge tables, very wide, because you denormalize the data before insertion. This saves having to 'join' huge tables against other huge tables.
So, for example, you often store the customer details on the transaction records, so you don't have to join "transactions" to "customers" at run time.
So, consider a "large" table, with a billion records, each has say 100 columns....
now, suddenly, if you can have a very efficient compression on the columns, and eliminate huge chunks of the data by not selecting those columns (or not referencing them in the where clause), then the savings are huge.
Additionally, the pages are optimized for massively parallel computation, so you can process all pages in an "embarassingly parallel" way....
You can access the class's public items, and override them, but it doesn't make you implement anything, even if the original class implements an interface.
@Mat'sMug Um. no. MDX is a multi-dimensional expression, you have to map the cubes back to the underlying data in funny ways, but, in essence, to process cubes you end up doing large numbers of aggregating queries on large tables....
class Test : Program
{
public void Test1()
{
T();
}
}
interface ITestX
{
void T();
}
class Program : ITestX
{
public void T()
{
throw new NotImplementedException();
}
private static void Main(string[] args)
{
}
}
ILegacyDataAccessService = soap class
UseCache= at httpRio.onafterExcecute event SOAPResponse will be saved to disk file. if UseCache=true then next calling time this function will request 1 dummy record from soap server and in httpRio.onafterExcecute event will load saved file to SOAPResponse: ...
I've reopened your question. However it would probably have been better to ask a new one, since this is now a completely different post. — Mat's Mug ♦34 secs ago
@Hosch250 leaving it closed would be messy IMO
@Jamal taking OP's word that the code works, I reopened. I just don't get why someone would want to start at -4 on a new question
Before entering the details, My question is : this C# implementation is performance the worst you can think of in compare to the c++ implementation of the author, The author offers a stand alone .exe file programmed in C++ and its at least 35 times faster. Why ? and how can I improve this code ?
...
If OP's code could result in an OOM in circumstances that OP isn't or doesn't seem to be aware of, then yeah it can fly. If OP is saying I have an OOM exception and can't figure it out, then it's broken code not working as intended.
According to the FAQ the following topics are wanted on Code Review.
Isn't there a point missing? I see a review of my code not only as a try to improve performance, security and structure, but also to reduce redundant, unnecessary code paths.
Isn't improving readability a major goal in a co...
I'm new to java and while working on my simple calculator program. I'm learning about JOptionPane and I want to add JOptionPane messages instead of the console output.
The problem I ran into is when I call showMenu() I want to only display the menu in this method. Then in getSelection() I want ...
I'm new to java and while working on my simple calculator program. I'm learning about JOptionPane and I want to add JOptionPane messages instead of the console output.
The problem I ran into is when I call showMenu() I want to only display the menu in this method. Then in getSelection() I want ...
ILegacyDataAccessService = soap class
UseCache= at httpRio.onafterExcecute event SOAPResponse will be saved to disk file. if UseCache=true then next calling time this function will request 1 dummy record from soap server and in httpRio.onafterExcecute event will load saved file to SOAPResponse: ...
OP at first said he gets an out of memory exception. Maybe someone sees the error in the code. Nowadays OOM are extremely rare in correct working code.
As part of our check-list for questions on CodeReview, we require that code is working to the best of the askers knowledge.
Does code with a known memory leak qualify is broken per this rule?
On the one hand, the code most likely does everything the asker wants, and from the user may never noti...
Welcome to Stackoverflow. Before posting questions, you should read How to ask, otherwise you will have a hard time getting answers. Your question maybe better put on codereview, especially since you're not asking anything. So btw.: What is your question? — Patrik Eckebrecht29 secs ago