⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public decimal GetTaxes(decimal salary) | |
{ | |
decimal tax = 0; | |
var progressiveTaxation = new[] { 0.1m, 0.14m, 0.23m, 0.3m, 0.33m, 0.45m }; | |
var progressionSlices = new[] { 5070 - 0, 8660 - 5070, 14070 - 8660, 21240 - 14070, 40230 - 21240, decimal.MaxValue }; | |
var progression = 0; | |
while (salary > 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
she loves travelling | |
she plays the guitar well; | |
first time i was impressed by a girl playing a guitar | |
she loves red and any shades of it | |
she loves to look at herself on the mirror everywhere she goes | |
she fixes her hair frequently | |
she only has powder and alcohol on her "kikay" kit; | |
as if that matters she looks beautiful without any makeup anyway | |
she has a "boyish" aura yet she's so feminine in so many ways |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.net.Uri; | |
public class BitmapUtil { | |
public static Bitmap getBitmap(Context context,String photoUriPath) throws Exception { | |
Uri photoUri = Uri.parse(photoUriPath); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SingleShotImageView extends ImageView { | |
public SingleShotImageView(Context context) { | |
super(context); | |
} | |
public SingleShotImageView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name Hex Decimal | |
E_UNEXPECTED 0x8000FFFF -2147418113 | |
E_NOTIMPL 0x80004001 -2147467263 | |
E_OUTOFMEMORY 0x8007000E -2147024882 | |
E_INVALIDARG 0x80070057 -2147024809 | |
E_NOINTERFACE 0x80004002 -2147467262 | |
E_POINTER 0x80004003 -2147467261 | |
E_HANDLE 0x80070006 -2147024890 | |
E_ABORT 0x80004004 -2147467260 | |
E_FAIL 0x80004005 -2147467259 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int getLastDayOfMonth() { | |
Calendar c = asCalendar(); | |
// move to next month and decrement from the 1st day | |
c.add(Calendar.MONTH, 1); | |
c.set(Calendar.MONTH, 1); | |
c.roll(Calendar.MONTH, 1); | |
return c.get(Calendar.DAY_OF_MONTH); | |
} | |
public String getMonthName() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Please remember to always state | |
what you wanted to achieve; | |
what you did (the version of git and the command sequence to reproduce the behavior); | |
what you saw happen (X above); | |
what you expected to see (Y above); and | |
how the last two are different. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://stackoverflow.com/questions/7889228/how-to-prevent-reflectiontypeloadexception-when-calling-assembly-gettypes | |
Type[] types; | |
try | |
{ | |
types = asm.GetTypes(); | |
} | |
catch (ReflectionTypeLoadException e) | |
{ | |
types = e.Types; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The original vision behind OOP wasn't at odds with functional programming. In fact, it looks more like modern FP than modern OOP, with its FactoryFactories and POJOs and cargo cult bullshit that are more an artifact of a failed attempt to commoditize programming talent (one which hijacked OOP) than anything else. | |
Pure functional programming is great. Alan Kay would agree. However, the world is stateful. The original inspiration for OOP was the cell, which encapsulates complex physical machinery (state and behavior) behind a simpler chemical or electrical interface. The idea wasn't that complexity is a good thing (it's not) but that, when it becomes inevitable, it needs to be sequestered so that it's only visible to the few who need to fuss with the object's internals, not to the many who need to interact with it at an API level only. | |
An "object" is a complex entity whose interface is designed for simplicity. An example of this would be a SQL database. Query optimization is complex, but the interface is much |
OlderNewer