Aspect Ratio with 800×480

800×480 is the most common resolution on Android powered devices. Your aspect ratio would be: 5:3 (which is the same as 800:480 just put in its simplest form). All your graphics should be created on a composition with the size 800×480, not to have stretched graphics when you run your game. I would suggest you … Read more

Using SUBSTITUTE with wildcard characters

To illustrate my issue, use the following simple example. I want to be able to replace any text that comes between “replace” and “that” to “it is done”. For example, the two following strings: to this string using the SUBSTITUTE function in excel using wildcard characters. This is the formula that I’m using: The formula … Read more

How to add an image to the “drawable” folder in Android Studio?

For Android Studio 1.5: Right click on res -> new -> Image Asset On Asset type choose Action Bar and Tab Icons Choose the image path Give your image a name in Resource name Next->Finish Update for Android Studio 2.2: Right click on res -> new -> Image Asset On Icon Type choose Action Bar and Tab Icons On Asset type choose Image On Path choose your image path Next->Finish The … Read more

Converting integer to binary in python

Just to explain the parts of the formatting string: {} places a variable into a string 0 takes the variable at argument position 0 : adds formatting options for this variable (otherwise it would represent decimal 6) 08 formats the number to eight digits zero-padded on the left b converts the number to its binary … Read more

What is the difference between %g and %f in C?

See any reference manual, such as the man page: f,F The double argument is rounded and converted to decimal notation in the style [-]ddd.ddd, where the number of digits after the decimal-point character is equal to the precision specification. If the precision is missing, it is taken as 6; if the precision is explicitly zero, no … Read more

Syntax error near unexpected token ‘then’

There must be a space between if and [, like this: These (and their combinations) would all be incorrect too: These on the other hand are all ok: Btw these are equivalent: These are also equivalent: And, the middle part of your script would have been better with an elif like this: (I also dropped … Read more

Import cycle not allowed

Here is an illustration of your first import cycle problem. As you can see with my bad ASCII chart, you are creating an import cycle when project/components/mux imports project/controllers/account. Since Go does not support circular dependencies you get the import cycle not allowed error during compile time.

Categories go