Hacker Newsnew | past | comments | ask | show | jobs | submit | more chappar's commentslogin

A correction, it is kannada not kannad :-)


>>we have estimated that about 50% of the people have their own private water source. BUT- less than 1% sell that water.

I appreciate that you are trying to solve this important issue. I was wondering if individuals selling bore water is legal in India


Does this mean that ^; and ^{ are also equivalent to ESC?


^{ is, but on my terminal ^; just prints out a ;

iTerm2, in vim 1.8


^[ and ^{ do the same thing in Terminal.app (macOS Sierra) and vim 8.0. However, I get the bell sound (which generally denotes invalid input in macOS) for ^; and it prints nothing.


You have control characters for the characters from 64 to 95.

    Control-@ is 0.  
    Control-A is 1, through control-Z is 26.
    Control-[ is 27, escape.
    Control-\ is 28.
    Control-] is 29.
    Control-^ is 30.
    Control-_ is 31.


I guess it could in theory, on my keyboard, however, CTRL seems to override other control chars, so typing ^{ doesn't seem possible at all, at least without any hacks. (I don't have a US layout keyboard.)


According to the bit-wise AND at the end of the article it should, but it seems like there's more to it than just zeroing out the 'column' bits.


Not sure if this is specifically related, but-

CTRL does not actually modify the character code sent from the keyboard. For letters, the same keycode (which maps to ASCII with a constant addition of 0x3D) is always sent. Another byte in the HID report contains bit flags for modifier keys (L/R CTRL, SHIFT, etc); the OS decides what happens after that.

Note that this holds under USB HID.


Not on a modern PC, but on the machine ASCII was originally developed for I could definitely see the CTRL key just pulling one bit low on the keyboard encoder.


>>China has anywhere from 69 to 85 million vacant homes (approx. same population as India)

I am not sure I understand this calculation. India's population is more than a billion


I meant China has approx. the same population as India.


Looks very cool. Sorry for nitpicking, there seems to be off by one at "ascii_values[min((intensity + 40) / 9, sizeof(ascii_values))];" :-)


I am not familiar with embedded asm. Can someone explan what the following line does?

"register long r10 __asm__( "r10" ) = a3"


It declares a variable named r10 and instructs the compiler to store it in the r10 CPU register. It's a GCC extension; the farthest you can get in standards-compliant C is

    register long r10 = a3;
but the register keyword is advisory only (the compiler is free to ignore it) and you cannot specify the exact register you want to be used.

Reference: https://gcc.gnu.org/onlinedocs/gcc/Local-Reg-Vars.html


I am curious what you would be using this for


Here is a simple c program to demonstrate this.

#include<stdio.h>

#include <stdlib.h>

int main()

{

   setenv("VAR", "() { :;}; echo vulnerable", 0);
   system("ls");
}

#./a.out

vulnerable

a.out

#


That's awesome.

Does system() invoke /bin/sh? Does it look for 'sh' on the path? What are the rules?


You can't do that for ",", because it will break the existing code. For example, int x = 0; x = 1,2; is perfectly valid pre c++11 code. This will assign 1 to x. Now if you make "," as digit separator, it will assign 12 to x


I mentioned the possibility of a special prefix in my previous post. In other words, that parsing ambiguity goes away if the standards committee wanted to define a special prefix such as 'd', 'k', or '_' to inform the parser that the next comma is a "digit separator" instead of "comma operator" such as _1,000,000 . E.g. there's already intelligence about commas in the parser to disambiguate function calls with commas as in "repositionxyz(914,348,122)"

Or, they could have defined C++14 to simply invalidate your example syntax of "x=1,2". As an example, the "auto" keyword was made a "breaking change" such that "for (auto int i = 0;;)" no longer compiles.

The bottom line is that there are a myriad of ways to address (potential) parsing ambiguities when introducing new language features and syntax. (Whether or not a comma digit separator is worth the clumsier syntax of a special prefix or inflicting the pain of a breaking change is a separate concept.)


C++ doesn't have the friendliest grammar for addressing potential parsing ambiguities.

As an example, your proposed solutions

   _1,000,000
   k1,000,000
Both are already valid if variables or functions _1 or k1 are in scope, and evaluate to (octal) zero.

And I haven't checked, but it would guess that invalidating "x=1,2" in the parser would not be "simple". I cannot think of a reason, but it also might turn out to be more common then one would think due to macro expansions.


Unlike voice, SMS will be stored in a server and in case your mobile is switched off you will still get the message, when you switch on your phone. So, there will be bit extra cost for maintaining these servers.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: