This file contains 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
-- How to use this script: | |
-- 1. Install the Logitech Gaming Software: http://support.logitech.com/en_us/software/lgs | |
-- 2. Launch it, and right click on your profile (the gear icon) and then click on "Scripts". | |
-- 3. Add the following code into the Script window, save it, and close it. Enjoy. | |
-- Now G1 is bound to F13, G2 to G14, ... G12 to F24. | |
function OnEvent(event, arg) | |
-- OutputLogMessage("event = %s, arg = %s\n", event, arg) |
This file contains 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
@TargetApi(Build.VERSION_CODES.KITKAT) | |
private void setupSimplePreferencesScreen() { | |
if (!isSimplePreferences(this)) { | |
return; | |
} | |
if (android.os.Build.VERSION.SDK_INT >= C.SDK_19) { | |
if (!isValidFragment(initialFragment)) { | |
throw new IllegalArgumentException("Invalid fragment for this activity: " | |
+ initialFragment); |
This file contains 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
@TargetApi(Build.VERSION_CODES.KITKAT) | |
private void setupSimplePreferencesScreen() { | |
if (!isSimplePreferences(this)) { | |
return; | |
} | |
if (android.os.Build.VERSION.SDK_INT >= C.SDK_19) { | |
if (!isValidFragment(initialFragment)) { | |
throw new IllegalArgumentException("Invalid fragment for this activity: " | |
+ initialFragment); |
This file contains 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
for x in `find . -type f -iname "*.png"`; do convert -colorspace gray $i gray-$i; done |
This file contains 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 String getNetFile(String device, String url, boolean isJ) { | |
DefaultHttpClient defaultClient = new DefaultHttpClient(); | |
String urlStr = url; | |
HttpGet httpGetRequest = new HttpGet(urlStr); | |
HttpResponse httpResponse = null; | |
try { | |
httpResponse = defaultClient.execute(httpGetRequest); | |
} catch (IllegalStateException e) { | |
return null; | |
} catch (IllegalArgumentException e) { |
This file contains 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 | |
protected boolean drawChild(Canvas canvas, View child, long drawingTime) { | |
final LayoutParams lp = (LayoutParams) child.getLayoutParams(); | |
boolean result; | |
final int save = canvas.save(Canvas.CLIP_SAVE_FLAG); | |
boolean drawScrim = false; | |
boolean mDrawBehind = true; | |
if (!mDrawBehind && mCanSlide && !lp.slideable && mSlideableView != null) { |
This file contains 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 javax.swing.JOptionPane; | |
public class Main { | |
public static void main(String[] args){ | |
String s; | |
s = JOptionPane.showInputDialog("Enter batch size: "); | |
Recipe.request = Double.parseDouble(s); | |
Recipe.factor = Recipe.request / Recipe.food; | |
for (int i = (int) r.z; i < Recipe.sFoodList.length; i++){ | |
Recipe.sFoodList[i] = Recipe.factor * Recipe.sFoodList[i]; |
This file contains 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
//Main.java | |
import javax.swing.JOptionPane; | |
public class Main { | |
public static void main(String[] args){ | |
String s; | |
Secondary f; | |
f = new Secondary(); |
This file contains 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
##### | |
# OnClick | |
##### | |
mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { | |
@Override | |
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { | |
new MessageTable(mContext).deleteItem(mMessageArray.get(position)[MESSAGE_ID]); | |
new MessageLoader().execute(); | |
} |
This file contains 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
mRecorder = new MediaRecorder(); | |
mRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT); | |
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); | |
mRecorder.setAudioChannels(2); | |
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC); | |
mRecorder.setAudioEncodingBitRate(96000); | |
mRecorder.setAudioSamplingRate(44100); |
NewerOlder