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
# We multiply 10s 4 times together to get 10000 | |
print(10*10*10*10) | |
print(2*2*2*2*2) | |
from math import log, ceil | |
print(log(10000, 10)) # how many times do we multiply 10 together to get 10000? | |
print(log(32, 2)) # how many times do we multiply 2 together to get 32? |
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
#include <stdio.h> | |
#include <string.h> | |
struct Book { | |
char title[100]; | |
char author[100]; | |
int number_of_pages; | |
}; | |
int main() { |
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
#include <stdio.h> | |
// 1. Sum of max numbers from each row | |
int sum_row_max(int x[3][3]) { | |
int sum = 0; | |
int i, j, max; | |
for (i = 0; i < 3; i++) { | |
max = x[i][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
tinymce.init({ | |
selector: 'textarea#doc_editor', | |
height: 500, | |
theme: 'modern', | |
plugins: [ | |
'advlist placeholder autolink lists link image media charmap print preview hr anchor pagebreak', | |
'searchreplace wordcount visualblocks visualchars code fullscreen', | |
'insertdatetime media nonbreaking table contextmenu directionality', | |
'emoticons paste textcolor colorpicker textpattern codesample' | |
], |
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
#include <stdio.h> | |
int maxIdx(int x[], int size) { | |
int i; | |
int m = x[0]; | |
int idx = 0; | |
for (i = 0; i < size; i++) { | |
if (m < x[i]) { | |
m = x[i]; |
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
#include <stdio.h> | |
void main() { | |
int x[7]; | |
int i; | |
// ----- START OF 1 ----- // | |
printf("\n\n1. TAKE INPUT AND SHOW THE RESULT ------------------\n\n"); | |
// TAKE INPUT FROM THE USER |
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
#include <stdio.h> | |
#include <math.h> | |
int main() | |
{ | |
int a, b, c; | |
double root_1, root_2; | |
printf("For ax^2 + bx + c = 0 ; give the following inputs.\n"); | |
printf("Input a: "); |
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
def mask_characters(str): | |
str = str.replace('~', '~') | |
str = str.replace('!', '!') | |
str = str.replace('@', '@') | |
str = str.replace('#', '#') | |
str = str.replace('$', '$') | |
str = str.replace('%', '%') | |
str = str.replace('&', '&') | |
str = str.replace("'", ''') | |
str = str.replace('"', '"') |
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 boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, | |
Preference preference) { | |
super.onPreferenceTreeClick(preferenceScreen, preference); | |
if (preference != null) { | |
if (preference instanceof PreferenceScreen) { | |
if (((PreferenceScreen) preference).getDialog() != null) { | |
((PreferenceScreen) preference) | |
.getDialog() | |
.getWindow() |
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 | |
protected void onNewIntent(Intent intent) { | |
super.onNewIntent(intent); | |
if ((intent.getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) | |
!= Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) { | |
getFragmentManager().popBackStack(null, | |
FragmentManager.POP_BACK_STACK_INCLUSIVE); | |
} | |
} |