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
NSCountedSet *nsCountedSet = [[NSCountedSet alloc] initWithArray:@[@"abc",@"abc",@"abc",@"abc",@"other"]]; | |
NSUInteger maxDublication = 0; | |
NSUInteger actualCount = 0; | |
for(NSString *s in [nsCountedSet objectEnumerator]) { | |
actualCount = [nsCountedSet countForObject:s]; // unnecessary checking, I want just array/enumarator of amounts. | |
if(maxDublication < actualCount) { | |
maxDublication = actualCount; | |
} |
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="pCX-2V-Cdw"> | |
<dependencies> | |
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/> | |
</dependencies> | |
<scenes> | |
<!--Card Game View Controller--> | |
<scene sceneID="RGL-OG-MdP"> | |
<objects> | |
<viewController id="pCX-2V-Cdw" customClass="CardGameViewController" sceneMemberID="viewController"> |
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
@Override | |
public View getView(int i, View view, ViewGroup viewGroup) { | |
Log.v(MainActivity.TAG, "getView executed"); | |
LayoutInflater layoutInflater = (LayoutInflater)MainActivity.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE); | |
View taskRoot = layoutInflater.inflate(R.layout.one_task, null); | |
((TextView) taskRoot.findViewById(R.id.seconds_edit_text)).setText("00"); | |
((TextView) taskRoot.findViewById(R.id.minutes_edit_text)).setText("00"); | |
((TextView) taskRoot.findViewById(R.id.hours_edit_text)).setText("00"); | |
return taskRoot; |
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
private int myMethod () { | |
try { | |
someCodeThatCouldThrowException (); | |
} catch (someCodeThatCouldThrowException's_Exception e) { // pseudocode | |
throw new myCustomDesignedExceptionForMyMethod(); | |
} | |
} |
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
private int myMethod () { | |
try { | |
someCodeThatCouldThrowException (); | |
} catch (someCodeThatCouldThrowException's_Exception e) { // pseudocode | |
throw new myCustomDesignedExceptionForMyMethod(); | |
} | |
} |
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
private int myMethod () { | |
try { | |
someCodeThatCouldThrowException (); | |
} catch (someCodeThatCouldThrowException's_Exception e) { // pseudocode | |
throw new myCustomDesigned | |
} | |
} |
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
private int getIntFromEditText (EditText et) throws NumberFormatException { | |
return Integer.parseInt(et.getText().toString()); | |
} |
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
private int getIntFromEditText (EditText et) throws Exception { | |
try { | |
return Integer.parseInt(et.getText().toString()); | |
} catch (NumberFormatException e) { | |
throw e; // because NumberFormatException describe my problem exactly | |
} catch (Exception e) { | |
throw e; // every other exception | |
} | |
} |
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
private int getIntFromEditText (EditText et) throws Exception { | |
try { | |
return Integer.parseInt(et.getText().toString()); | |
} catch (Exception e) { | |
throw new Exception(); | |
} | |
} |
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 IdentifyMyParts { | |
public static int x = 7; | |
public int y = 3; | |
} |