The Linux Page
  • Simple Sum

    When you create a form in MS-Access and include a sub-form with a table in it, you may want to compute the sum of a field. This is done simply by creating a TextBox and writing the following in that box content:

    =Sum([Column-name])

    Where "Column-name" is (obviously) the name of the column you want to sum up.

    This is neat, but it breaks if the specified column has an unsupported type. Very strange, but for me it breaks with a currency column! That feels a bit weak to say the least. According to my testing and what I have found on the net, it should work with any ...

  • 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 ...

  • I found a different way which is to use the:
    Local Network or Host-only Network on your Virtual Machine

    Today I did my first full install of Snap on a VM in my Ubuntu development system that runs VirtualBox.

    This took me about 1h between getting all the files ready from our own APT repository, and then finding out all the setups needed (we have a few working installations, but we added all the necessary magic with time and did not clearly document all the steps yet... argh! so much to do!)

    At some point, I wanted to setup the "domains" and "websites" tables on the VM. ...

  • Today I wasted another hour or so in trying to get samba to work for one of my Windows computer so I could connect to one of my Linux computer. I knew that the installation was correct since I could log in with another computer/user that had worked for a long time. So... why would this one fail?

    Two things, for of all, I could see NOTHING happening in the logs. Really wondering why the default is to log close to nothing with such a non-secure piece of software, but that's a different question. I added the following to actually get about enough logs to understand what was happening:

    log ...
  • My Story

    I have had this problem for a while now.

    On my server, I run X11 whenever I work with it. Otherwise, I quit X11 since it otherwises uses a lot of resources. This gives my users a much better experience (i.e. better browsing and a lot of it happen at night for me because I live in California and I have loads of hits from France, Algeria, Tunisia, Marocco, etc.)

    So... my wife and I both have a Unix account and we both start our own version of X11.

    Hers rarely get stuck, mine seems to get stuck once a week or once a month.

    Often, it is because after she quits I have to wait for

  • Today I ran in a little bit of a problem with an new Cassandra node installation.

    After the node was created, I ran nodetool and got this:

     $ bin/nodetool status
    Datacenter: dc1
    ===============
    Status=Up/Down
    |/ State=Normal/Leaving/Joining/Moving
    --  Address    Load       Tokens       Owns (effective)  Host ID   Rack
    UN  127.0.0.1  219.83 KiB 256          0.0%              73bd8721  rack1

    It took me a little while to find out that the problem was the IP address. Although it clearly says 127.0.0.1 here, the cassandra.yaml configuration file had localhost.

    I edited the ...

  • Once in a while I check how the compilers are behaving in such and such situations to make sure that when I wrote code it gets properly optimized. Today I was surprised as I tried to put a break point of a variable and it looked like the compiler wasn't using it. Indeed, the optimizer 100% removed the variable from the final code. Quite interesting since trying to reverse engineer this assembly language would probably end up using a goto statement... (ouch!)

    The code goes more or less like this:

    [toc hidden:1]
  • Today I was trying to create a table in a post and just could not get the cell padding I wanted. Without the padding the data is all cramped together which did not look the way I wanted (see Alexis Wilke Accounts.)

    I knew I had the following entry in my CSS but did not think it was stronger than the table cellpadding and cellspacing specifications because I thought it worked for me before!

    * {
      margin: 0;
      padding: 0;
    }

    I was wrong, that definition applies to the td with a greater constrained. So I had to add another entry. I solved the problem using a td definition like this:

    
    
  • I had a problem with jQuery and was wondering what could be wrong. Looking around for a solution, it was clear that Internet Explorer is the problem. Not the other way around (As usual.) The thing is that the function works, just not in realtime.

    So... I have a Terms and Conditions flag, when you click it, I want to enable the Submit button in the form (by default the button is disabled.)

    So I have a function something like this:

    var valid = function check_valid() {
      // compute valid
      var valid = ...;
      // assume valid === true if button should be enabled
      ...
  • I use Drupal for most of my sites. I use it in many different ways and it has been working real good for me.

    On one of the sites, I use the ThemeKey module to select a different theme once you are logged in. This means, when I want to switch themes, that one theme selected for logged in users sticks, whether you disable it or not, it remains selected by the system.

    And?

    Well... one thing sticks from themes, their .info file. You just cannot refresh the cache properly unless you disable the theme, then re-enable it. (By the way, when disabled, don't go to the Blocks administration screen ...

Syndicate content

SMS From Me Logo

SMS From Me

To automatically start one on one conversations with your online leads.

     

   

Terms of Site Index

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

  • CSS

    CSS stands for Cascading Style Sheets. The sheets are used to describe the display of your HTML data. It is primarily used in Browsers, although some Graphical Interfaces are starting to make use of basic properties of the CSS. The basics are quite similar to the X11 resources.

  • browser
  • deassociate
  • not

    In programming there are two not operators. One is the logical not that transforms TRUE into FALSE and vice versa. The other transforms bits from 0 to 1 and vice versa. not is also used in documentation with a very specific meaning. Often, the accompagnying verb defines the meaning with more details (i.e. MUST NOT and SHOULD NOT.)

  • warning