c ++ – What is the efficient way to write large data in a .csv file?

I am trying to write the big data in a csv file and the number of rows I am dealing with is in millions.

My code is generating the rows in the form of a double matrix. The code takes a long time to write data to the file (twice as much as writing the same number of records in the database with a massive 10k insert on the same machine).

I tried to buffer rows 10000 and 100000 in the std :: string.

m_Csvfile.open("Fact.csv", std::ios_base::out | std::ios_base::app);
void class::PrepareRow()
    for (int i = 1; i < m_nColumnCount; i++)
        if (arrayOfRowVals(i) != NULL_NUMBER)
            char buffer(50) = {};
            sprintf(buffer, "%9.7lf", arrayOfRowVals(i));
            strBulkcsvString.append(buffer); // strBulkcsvString is std::string

        if (i < m_nColumnCount)

    if (m_rowcount == 10000)
        m_rowcount = 0;
        m_Csvfile << strBulkcsvString.c_str();
        m_rowcount = 0;

SupremeVPS: large pools of SSD resources in the cloud in the cloud: multiple locations, starting at $ 69 a year!

SupremeVPS returns with some exclusive offers for the community. These are large groups of VPS resources available in various locations.
A VPS SSD resource group allows you to create multiple VPS servers within the limitations of your resource group according to your plan. You can create a large VPS or several VPS using the resources available in your group.

Your WHOIS is public, and you can find your ToS / Legal Documents here. They accept PayPal, credit cards, Alipay, WeChat Pay, Bitcoin, Litecoin and Ethereum as payment methods.

This is what they had to say:

“We have the mission of making VPS hosting affordable, easy to use and transparent. From day one, we have been on a constant mission to change the VPS hosting industry. Having experienced it ourselves, we have found that VPS hosting is quite tedious with hidden fees, additional sales, poor support, etc., and SupremeVPS was born to change that and set a new standard, a high standard, for that matter. Today we are successfully training more than 1500 clients from all over the world!

Our prices are simple, flat rate and easy to understand. No calculator is needed, and there is absolutely no hidden fee. SupremeVPS was born to be simple and easy to use, and our intuitive platform allows you to implement in less than 60 seconds. "

Here are the offers:

8x SSD Cloud VPS Pool

  • Create up to 8 VPS
  • 8 vCPU cores
  • 8 GB of RAM
  • 100 GB SSD storage
  • 10 TB monthly transfer
  • 1Gbps port
  • 8 IPv4 addresses
  • Linux operating system options
  • Resource Manager Panel
  • Openvz
  • Los Angeles, Chicago and New York locations
  • $ 69 / year
  • (ORDER)

16x SSD Cloud VPS Pool

  • Create up to 16 VPS
  • 16 vCPU cores
  • 16 GB of RAM
  • 300 GB of SSD storage
  • 30 TB monthly transfer
  • 1Gbps port
  • 16 IPv4 addresses
  • Linux operating system options
  • Resource Manager Panel
  • Openvz
  • Los Angeles, Chicago and New York locations
  • $ 110 / year
  • (ORDER)


Los Angeles, California (530 W. 6th St. Datacenter Facility)

IPv4 test:

Test file:

Chicago, Illinois (2200 Busse Rd., Elk Grove Village Installation)

IPv4 test:

Test file:

Buffalo, New York (325 Delaware Ave. Buffalo, NY Facility)

IPv4 test:

Test file:

Host node specifications:

– Dual Intel Xeon E5-2660v2

– 128 GB of DDR3 RAM

– 4x SSD RAID-10 Samsung 860

– 1 Gbps uplinks

Let us know if you have any questions / comments and enjoy!

Quality made in Germany: all KVM Flash companies with redundant power with large recurring discounts

Hi, we are the first root.


All our nodes run on enterprise hardware. That includes Intel Datacenter solid state drives, hardware raid controller, dual Xeon processors, n + 1 network links and redundant power supplies!

NEW: Now you can get a private network between all your VPS without additional costs!

————————————————– —-

————————————————– —-

Developed for all customers with high demand for RAM and CPU. Now with 33% discount for life.

KVM Power Edition Light – Configure now!

CPU: 1 Intel Xeon Core shared
RAM: 1,024 MB of ECC RAM
TRAFFIC: 5 TB at 1 Gbit / s (mirror)

PRICE: 3.00 EUR / month

Start of KVM Power Edition – Configure now!

CPU: 2 Intel Xeon Core shared
RAM: 2,048 MB of ECC RAM
TRAFFIC: 5 TB at 1 Gbit / s (mirror)

PRICE: 4.00 EUR / month

KVM Power Edition Pro – Configure now!

CPU: 3 Intel Xeon Core shared
RAM: 4,096 MB of ECC RAM
TRAFFIC: 5 TB at 1 Gbit / s (mirror)

PRICE: 7.00 EUR / month

KVM Power Edition Premium – Configure now!

CPU: 4 Intel Xeon Core shared
TRAFFIC: 5 TB at 1 Gbit / s (mirror)

PRICE: 13.00 EUR / month

KVM Power Edition Ultra – Configure now!

CPU: 6 Intel Xeon Core shared
RAM: 16,384 MB ECC Ram
TRAFFIC: 10 TB at 1 Gbit / s (mirror)

PRICE: 22.00 EUR / month

KVM Power Edition Ultimate – Configure now!

CPU: 8 Intel Xeon Core shared
RAM: 32,768 MB ECC Ram
TRAFFIC: 10 TB at 1 Gbit / s (mirror)

PRICE: 38.00 EUR / month

The prices shown are without taxes (VAT) and for clients living outside the European Union. If you live within the European Union, your local VAT will apply.

F-Com terminal


Since the company was founded in 2011, we have been developing and using our own customer portal. Our vision is to create a place where you can handle all your needs conveniently and easily. We love the advantage that we can simply develop and implement new functions ourselves instead of relying on third parties.




There is nothing more annoying than unreliable services or downtime. As one of our main objectives is to provide solid services like a rock and avoid downtime and problems at all costs, all our systems are based on thoroughly tested components with the highest reliability.




To provide the best services and availability, we own and operate all our servers, switching and routing equipment. In case of problems, our office is 5 minutes from our placement, so we can guarantee faster response times.




As we know that our clients trust our services, we guarantee 99.9% availability throughout the year.


————————————————– ——————

————————————————– ——————

No one is perfect, but we can try. See what our customers write about us.




Choose between 4 contract models within the configuration process. These contract models are currently available:

1. Model contract: 1 month – 0% discount for life
2. Model contract: 3 months – 2% discount for life
3. Model contract: 6 months – 4% discount for life
4. Model contract: 12 months – 10% discount for life

You can also deactivate the subscription, so that the contract is automatically terminated once the contract period ends.



All VPS are provided with a dedicated IPv4 address and a dedicated / 64 IPv6 network.
We offer free BGP sessions (IPv4 and IPv6) for all KVM Power Edition VPS.



Get two or more VPS and create private interconnections between them for free.



First Root offers a 14-day money back guarantee for new customers.



Our options for your payment.

– Bank transfer / bank transfer
– SEPA direct debit (for EU customers)
– PayPal
– Credit card (VISA, Mastercard, American Express)
– Bitcoin

All payment methods are free, we do not charge credit card fees!



First root UG (haftungsbeschraenkt)
Münsterstr. 330
40470 Düsseldorf

Email: info@first-root.com
Web: www.first-root.com
Telephone: +49 211/41 74 12 23 (Mon. – P. 09:00 – 18:00 CE (S) T)

Registration court: Amtsgericht Düsseldorf, Germany
Registration number: HRB 66599

VAT identification number: DE815299021
General Directors: Michael Hoffrath

sql server: the clustered index occupies a large amount of space

I have been working on indexing a database that deals with historical data and recently found a problem with a clustered index that surprised me.

The database is SQL Server 2018. The table itself deals with the account information and is essentially a fact table, it is completed with around 200k records per day and has 200 columns. It is currently in 68 thousand records, and before the index occupied about 120 GB of space.

Because it is a historical table about the account information, and we do not have UUID configured (which would be a great effort that my boss told me not to devote my time to this database), I created the primary key + clustered index in the Date field and account number with an extract equivalent to:

ALTER TABLE AcctHistory 

The Date field is a Date and time field (This is a DEV environment that I did not configure but I am now building. I only know that I plan to update it to a date soon, but I provide the type if it is relevant.), The Account_Number field It is a bigint.

After executing this declaration, according to the SSMS disk space report per table, the amount of space consumed by the table skyrocketed up to 480 GB, 4 times what it took before the index.

I know that indexes take up space, but I've never heard of anything like that. Is this normal or is it indicative of a problem that I can solve to save space?

Large touch screen and UX / UI kiosk

I am looking for some entries such as research, articles and things related to large touch screens / UX / UI kiosks

Thank you

java – Deal with large base code quickly in agile

In my current company, the project I work on is coded in Java, at least for the systems / backend part. Every time I am assigned a task related to Java code, it takes me hours or even days to solve everything and apply my solutions. The reasons are:

1] Very large Java EE code base

2] A lot of abstraction

3] I get lost in discovering all abstractions, such as methods, then I often go around a hole where I think of something else and forget my original solution, etc.

My work environment is agile and I am expected to deliver quickly, but as a fairly new member of the company and a huge code base that was created before joining, it is difficult for me to meet the "agile" time.

How are we supposed to deal with such a large code base where almost all lines / functions lead to another abstraction and within them there are even more abstractions in a timely manner?

Edit: I know I can ask my classmates, but at the same time I don't want to bother them constantly, since problem solving is part of my job.

Controls – How large should an analog stick be in a mobile game?

I am developing a mobile game, for fun, and I add an analog stick to control the main character. It looks something like this:

enter the description of the image here

I hope to get some advice on the right size and position.

Key Considerations:

  1. When the user moves the analog stick, the central part moves outside its boundary circle, which means that the larger the stick, the more it could run off the screen.

enter the description of the image here

  1. If the user's finger leaves the screen by mistake, the analog stick will return to the center and stop the movement of the players; This could be crucial in a tense part of the game.

  2. The larger the analog stick, the more control the user has, but also more space the stick occupies.

  3. For older devices we have much less space in pixels. An analog memory of 100 pixels suddenly occupies more than a third of the screen once we consider the padding.

Ideally, there will be an additional analog stick in the lower right corner, but this could be more an action button to interact with an element, object, etc.

I know that touch screen devices are not as tactile as a real controller, but that is why I want to make sure that my controls feel as natural as possible. Mainly looking at the size of the analog stick (diameter) and the position in the lower left corner.

Probability theory: Efficient algorithm to simulate cards from a large deck of cards?

In spill-type card games, the dealer starts by distributing a shuffled deck to the players (if there is N players card i goes to the player i mod N) If the number of each type of card is known, is there a way to simulate the distribution of the cards and get a count of each type of card each player has?

For example, if there are N = 3 players, and there are 5 types of cards and the count of each card is (3000000000, 3000000000, 3000000000, 3000000000, 2), one possible way out is (1000000000, 1000000000, 1000000000, 1000000000, 1), (1000000000, 1000000000, 1000000000, 1000000000, 1), (1000000000, 1000000000, 1000000000, 1000000000, 0), which represents the number of cards of each type that each player has.

A naive algorithm is to create a wide variety of all cards, mix them with Fisher-Yates and then go through each item and increase the card count for the current player and set the current player for the next player. . For the previous example, this creates an array of size 12000000002 and requires many iterations, but there are only 5 types of cards and 3 players (the output is size 15).

Is there a more efficient algorithm? He would have to generate the output with the same probability as the naive algorithm would.