Syndicate content

size

My JavaScript code does not get the correct widget size, why?

As I am developing a set of pages for a customer, I ran in an intersting problem: my JavaScript function could not properly define the sizes of a box.

That box is heavily tweaked with the CSS assigned to it, as well as all of its neighbors. So I thought that may have something to do with it.

What I hadn't realized so far is that the ready() function of jQuery() is called once the script that includes it is ready (as in loaded) and not once the document as a whole is ready (done loading, i.e. onload event.)

With that knowledge it was easy to understand that I was actually finding myself ...

HTML background that fits the screen

You can actually define an image or a background (with CSS) that fits the area in which is it shown.

For a simple image use a width of 100%, then the browser computes the height for you.

  <div class="header"><img src="images/background.png" width="100%"></div>

This code will make the image width match the width of the <div> tag. Assuming the <div> tag fits the screen width, it will show in the full width, stretching as required.

When trying to do that with a background image in CSS, you want to use the background-size parameter ...

MS-Access sub-form auto-resize instead of staying put

Problem

Today I ran in a problem where I created a new form and the sub-form inside that form would auto-resize itself. Strangely enough, all my other forms also have a sub-form and that sub-form is not auto-resized... so what gives?!

I did not find anything about preventing an auto-resize of a sub-form. Found many pages on the net about how to write code to resize a form "manually". But that really did not help.

Solution

As I created that new form, I marked it as "Auto Resize" to No. This seems logical if you do not want a form to get resized. Think again! The ...

A C++ implementation of a UDP client/server

I have noticed that quite a few people were trying to create UDP communication and I thought that proposing my class could help them. This is very basic as it does not define anything such as the size of a packet or any protocol to ensure arrival of the packets. However, it can be useful if you want to send a signal from one process to another, which is exactly how I use this implementation.

This code is part of the Snap! C++ implementation. It can be found in the corresponding SourceForge.net repository.

Header file:

// UDP Client Server -- send/receive UDP packets
// Copyright (C) 2013 ...

Breaking TCP/IP with a simple client/server implementation in Qt

I've been working on a TCP/IP server/client with Qt and got a problem which I present in the attached package.

The example called tcp-bug. Start it with:

tcp-bug -s

in one console and then start the same command without the -s in another console:

tcp-bug

The client (this second tcp-bug without the -s) saves the file sent by the server in /tmp/out.html and it has to be exactly the same as the example.html file in the project. If not, then the transfer failed.

Most often, the transfer works so I wrote a script called many-hits.sh to run the client many times and test the result. ...

MS-Access prints white pages

Problem

One of my customers changed a report and all of a sudden was getting an empty page for every other page (it will look like the last page in case you print a single page, but it really is every other page.)

Did you think about the margins?

When you create a report to be printed, you must define its size properly. So if you are printing 8"1/2 x 11" paper, you want to create a report that's exactly (to about 1/100th) the same size.

The total height must be 11" and the total width must be 8"1/2. However, the actual page that you create does NOT include the ...

tar: Record size = 8 blocks

The tar utility has changed over time and older versions would generate what is viewed as incompatible files. Although most tar utilities will still support older version (before 1988), the may generate this one warning:

   tar: Record size = 8 blocks

I tried, a couple times, to create tar files and they worked just fine but I would get this warning... This is rather annoying so I looked in a way to avoid the warning. Why do you think we get it?

The answer is in the newest versions of POSIX the block size of a tar file was decided to be 10Kb. Internally, the block sizes are still 512

Testing your memory on a live Linux system

Today I wanted to test the memory on a remote server. I could not just reboot and run memtest86+ so instead I had to look for a different solution to testing most of the computer memory without having to reboot...

I found an interesting page in that regard describing a way to do so using md5sum on a very large file.

The is a verbatim copy of the Linux command line proposed.

  dd if=/dev/urandom bs=768304 of=/tmp/memtest count=1050
   md5sum /tmp/memtest; md5sum /tmp/memtest; md5sum /tmp/memtest

The size, 768304 is expected to be close to your memory size. You should know how much memory

There are some forms where Drupal '#size' does not seem to work, why?!

I created a form a while back and included an entry like this:

  '#size' => 10

in several text fields of the form. Especially useful when you add a suffix:

  '#field_suffix' => 'Something'

But that would not do anything... I looked at the output of the form and it looked 100% correct. In other words, the input tag had its size="10" properly set. So the next step was to find whether some CSS code would be in the way.

You bet! The node.css file includes the following:

/var is 99% full...

Problem

On Unix systems, you create partitions and assign them a folder such as /usr, /home, and /var. Many people like to put different things on different partitions. Very frankly, it is often complicated to do that, so if you don't have a real need, only break up the /home and /tmp folders from the rest. The /var is a good idea to break up if you use databases or very heavy logs. The /etc can be separate mainly for ease of backup.

Syndicate content Syndicate content

     

Terms of Site Index

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

  • bug
  • Hardy
  • IDE
  • thread
  • views

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