Syndicate content

limit

Can I create an INDEX to accelerate a SELECT MIN(IF(...)) in MySQL?

I have a table with a few columns, two of which are integers, one of which can be NULL in which case the other integer is to be used in my query.

CREATE TABLE my_table (col1 INTEGER NOT NULL, col2 INTEGER);

If `col2` is NULL, then use `col1`. As is, there is how my query looks like:

SELECT MIN(IF(col2, col2, col1)) AS smallest FROM my_table LIMIT 1;

In other words, I need to get the row with the smallest integer, but if one column is NULL, I want to use the other column value.

On a very small sample, the query is still very fast, but the real version is not unlikely to have thousands ...

MS-Access not limiting unbound text fields

When creating an unbound text in MS-Access it is not constrained in length. The text limit you get when the field is bound to the database table is really neat, but there is not direct way to access that code (it's probably something hard coded in the MS-Access system.)

This means you have to re-implement the behavior.

I found this page Unbound text box: limiting entry length which has a very good solution. Just in case the page disappears, there is what I use (a simplified version that doesn't manage errors because I do not like that — errors are not supposed to happen, when they do,

QtTest and "Cannot create a QWidget when no GUI is being used"

Problem

I have to use Qt these days. It's a good system, but there are a few tricks to know about.

As I was starting to write a test, the test needed a lot of numbers but nothing much otherwise. So I decided to limit the #include to a minimum by deleting all of those that I did not need.

The result was this error:

"Cannot create a QWidget when no GUI is being used"

I looked into it and sure enough people talking about it say: Well... where is your GUI?

Great, but I don't see how that helps me in fixing the problem, does it do it for you? Neither?!

Solution

...

wsprintf() limit under MS-Windows

Today I wanted to check out a set of floating value in my Visual C++ development environment.

You can use the OutputDebugString() to print a debug string in the VC++ output window when running a software. This is quite handy, but when working in C++, string handling can be tedious. I need to create a message and wrote something similar to this:

wchar_t msg[128];
swprintf(msg, "Float: %f\n", my_float);
...

[toc hidden:1]

Password Security

I suppose we could talk about security all day and only barely touch the tip of the iceberg, if even more than a spec of it.

Yet, I wanted to mention that in many instances, there are such limits to the characters you can use in a password that already the provider prevents you from creating a string password in the first place!

So... what is it I'm talking about?

I have one company I work with that does not support anything more than letters and digits. Not only that, they limit your password between 6 and 10 characters. Everyone knows that 6 characters is cracked very very quickly and

PostgreSQL VACUUM not working...

When you use a PostgreSQL database, it gets vacuumed every night (by default on most systems, verify on yours, it may not be the case...) This is a quite simple process to make sure that the database remains fast. And it works great, also. You can have millions of entries and it remains very fast (they have real good algorithms to auto-generate index files as required by your repetitive queries.)

The problem is that tables are being grown for 24h and then they get cleaned up. They can then grow again for 24h. If you don't clean up, the tables continue to grow, fast. Up to the point where ...

Number of friends on Facebook is limited!

Playing around with facebook for a couple weeks now and I bumped into a new one!

Yep! There is a limit to the number of friends you can have on Facebook... It is 5,000±10.

This explains why I have found several people with multiple accounts. That's the way to circumvent the limit. With 3 accounts, you can get 15,000 people in your circle.

Apache eating file descriptors

Today we again ran in an out of memory error. As we are adding more websites our foot print is growing... Our servers use a VPS that has limited resources and whenever the limit is reached, the system automatically kills processes. How the VPS selects the process to kill isn't clear to me, but twice it has been our database manager meaning that all of a sudden all the websites stop working.

So... We got an extra bit of RAM because our package allowed it, but that's still small.

GNU Free Documentation License

                GNU Free Documentation License
                 Version 1.3, 3 November 2008


 Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
     
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

0.

Syndicate content Syndicate content

Diverse Realty

Diverse Realty Team

Want a New Home?
Want to Sell Your House?

Call Alex at
+1 (916)
220 6482

Alexis Wilke, Realtor
Salesperson
Lic. # 02024063

Cory Marcus, Broker
Lic. # 01079165

     

Terms of Site Index

Find the page/content you are looking for with our index.

  • VACUUM

    The VACUUM instruction is used by PostgreSQL to query the server in cleaning up the corresponding database cluster. The work done is simply to remove the unused rows and clearly mark them are available. The VACUUM FULL command will go the extra distance of pushing the data so as to make the tables as small as possible. The command can be run on a per table basis.

  • dump

    The dump command, under a Unix system, is used to dump the entire file system to another device. By default, the dump output device is a tape device (/dev/tape). Now a day, however, it is often used with other devices such as another file system (from one hard drive to another.)

    Other systems use that same keyword. It is particularly the case of database systems. For instance, the PostgreSQL database has a pg_dump command.

    The opposite command is restore. That command is used to get the data from the output device and put it back on your hard drive.

  • low
  • socket
  • views

    A module Drupal that let people define lists of nodes, blocks, feeds, and whatever other data available in your Drupal installation.