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
/** | |
* Two controller and a service, by Angular | |
*/ | |
var app = angular.module("gcm_user_based_stats",[]); | |
app.controller("ChartController",['$http','ChartDataService',function($http,ChartDataService){ | |
ChartDataService.on_get_data().then(null, null, function(data) { | |
//to when notified by the service | |
}); |
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
class Solution { | |
public int[] twoSum(int[] nums, int target) { | |
HashMap<Integer,Integer> hash = new HashMap<Integer,Integer>(); | |
for(int i=0; i < nums.length; i++){ | |
int searched = target - nums[i]; | |
if(hash.containsKey(searched)){ | |
return new int[] {hash.get(searched),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
import java.util.Arrays; | |
class Solution { | |
public List<List<Integer>> threeSum(int[] nums) { | |
int sum=0; | |
List<List<Integer>> ret = new ArrayList<List<Integer>>(); | |
Arrays.sort(nums); | |
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
https://answers.unity.com/questions/422186/remove-points-of-linerenderer.html |
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 static void ReplaceJsonValue() | |
{ | |
string filepath = "../../json1.json"; | |
string result = string.Empty; | |
using (StreamReader r = new StreamReader(filepath)) | |
{ | |
var json = r.ReadToEnd(); | |
var jobj = JObject.Parse(json); | |
foreach (var item in jobj.Properties()) { | |
item.Value = item.Value.ToString().Replace("v1", "v2"); |
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
https://aws.amazon.com/premiumsupport/knowledge-center/view-storage-rds-mysql-mariadb/ | |
#Run the following query to find the size of each user-created database: | |
select table_schema, round(sum(data_length+index_length)/1024/1024/1024,2) "size in GB" from information_schema.tables group by 1 order by 2 desc; | |
#In some cases, MySQL creates internal temporary tables that can't be removed because a query is intervening. These temporary tables aren't part of the table named "tables" inside information_schema. Run the following query to find these internal temporary tables: | |
select * from innodb_sys_tables where name like '%#%'; | |
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
cd JAVA-HOME/bin | |
keytool -genkey -alias <alias> -keyalg RSA -keystore <path/key-store> -storepass <password> | |
keytool -importkeystore -srckeystore <path/key-store> -destkeystore <path/key-store> -deststoretype pkcs12 | |
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
Connect to machine you want to give access | |
$ sudo adduser <onur.demir> | |
$ sudo su <onur.demir> | |
make sure your are in user's home directory. | |
$ cd | |
Create .ssh directory, and change the directory permission to 700 (only the file owner can read, write or open the directory): | |
$ mkdir .ssh | |
$ chmod 700 .ssh | |
Create an empty file called authorized_keys in the .ssh directory and change its permissions to 600 (only the file owner can read or write to the file) |
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
POST /productionusers/_update_by_query | |
{ | |
"query": { | |
"bool": { | |
"filter": [ | |
{ | |
"terms": { | |
"id": [ | |
108513 | |
] |