Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- CASE



  Inline IF and CASE statements in MySQL

There are times where running IF statements inside a query can be useful. MySQL provides a simple way to do this through the use of IF and CASE statements. The IF statement takes three arguments; the conditional, the true value and the false value. False and true values may be static values or column values. For example: SELECT IF(score > 100, 100, score) AS score FROM exam_results this will return the value in the score column limited to a maximum value of 100. IF statements can a...

   MySQK,IF,Condition,CASE,SQL     2012-04-22 10:37:01

  Case sensitivity in PHP

Case sensitivity in PHP is a bit messy. We recommend that you stick to the case sensitive rule in any language. Here we share some case sensitivity cases in PHP.1. Case sensitive1.1 Variable name is case sensitiveAll variables names are case sensitive, these include normal variables and superglobals such as $_GET,$_POST,$_REQUEST,$_COOKIE,$_SESSION,$_GLOBALS etc.<?php$abc = 'abcd';echo $abc; //Output 'abcd'echo $aBc; //No outputecho $ABC; //No output1.2 Constant name by default is case sensit...

   PHP,Case sensitivity,Summary     2012-06-25 05:48:17

  Can API be copyrighted? At least Oracle hopes so

  The result of the lawsuit case war between Oracle and Google is clearer now. The court said that 9 lines of code of Android has violated intellectual property right, these 9 lines of code can be ignored relative to the number of codes for the whole Android system. But just like LinuxToy points out that the reasons why this case catches so much attention are : 1). The amount of money Oracle asked from Google is $1 billion; 2). The statement says Java language itself doesn't violate the int...

   Oracle,Google,API,Copyright,Lawsuit case     2012-05-11 00:47:58

  Programmer's Mother's Day

Mother's Day is a celebration honoring mothers and motherhood, maternal bonds, and the influence of mothers in society. It is celebrated on various days in many parts of the world, most commonly in March or May. Mothers usually receive gifts on this day.Carnation is dedicated to be mother's flower. As a special group of people - programmers, our way of expression will naturally have our own characteristics. We can write programs to express our love to our mothers. Here is a Chines...

   Mother's day. Program     2013-05-12 01:10:15

  Accurate floating point number calculation in JavaScript

In JavaScript, since floating point is defined with IEEE754,there will be some accuracy issues while doing floating point number arithmetic. Here is a function which can resolve the accuracy issue. var calc = function(num1,operator,num2,len){    var numFixs = function(num){        var arr = num.toFixed(len).toString().split('.');        return parseInt(arr.join(''));    }    switch(operator){...

   JavaScript, floating point,IEEE 754,accuracy     2012-12-27 11:07:49

  combining dwarf failed: unknown load command 0x80000034 solution in GoLang

In case there is below error encountered while running some go program: combining dwarf failed: unknown load command 0x80000034 This may be due to that you are running go 1.16 on a Mac M! machine. If you go to check go version, it may tell you that you are running an arm version of go. go version go1.16.10 darwin/arm64 In such cases, you can try below methods to workaround the issue. Try to upgrade the go version to 1.17 and run the code again. If this is not an option for you because you have t...

   GO 1.16,0X80000034     2021-11-25 07:11:28

  Some cases where MySQL cannot be started

After installing MySQL, when we try to start MySQL, sometimes we may not be able to start it. The reasons can be different. We share some general cases where MySQL cannot be started. Case 1: Directory or file permission issue If the permission is set wrongly in MySQL's $datadir and its sub directories or files, MySQL will not be able to read and write files normally. Error message: mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data /usr/local/mysql/bin/mysqld_safe: lin...

   MySQL,Error,Log     2013-08-15 03:32:36

  What can select do in GoLang

In Go language, select is a keyword used to listen to and perform IO operations related to channels. With the select statement, we can simultaneously listen to multiple channels and perform corresponding operations when any of the channels are ready. This article will summarize the common uses of the select statement and provide some considerations when using it. Basic syntax The basic syntax of the select statement is as follows: select { case <-channel1: // when channel1 has data to ...

   GOLANG,SELECT,USAGE,SYNTAX,TUTORIAL     2023-08-12 20:17:02

  Use downcase! with caution in Ruby

Ruby provides ! to change state of some object in place. Hence if you see some functions have ! appended, it means the state of the caller of the function is expected to be changed. This is a very interesting Ruby feature. But sometimes one should be cautious when using this kind of functions because you would get unexpected behavior if using improperly. Let's take an example of String#downcase!. According to the documentation. Downcases the contents of str, returning nil if...

   RUBY,EXCLAMATION MARK,DOWNCASE     2017-02-10 06:34:44

  Converting Decimal Fractions to Binary

Converting Decimal Fractions to Binary In the text proper, we saw how to convert the decimal number 14.75 to a binary representation. In this instance, we \"eyeballed\" the fractional part of the binary expansion; 3/4 is obviously 1/2 + 1/4. While this worked for this particular example, we\'ll need a more systematic approach for less obvious cases. In fact, there is a simple, step-by-step method for computing the binary expansion on the right-hand side of the point. We will illustrate the metho...

   Decimal,Fractional,Binary     2011-03-19 06:45:35