I hereby claim:
- I am asif31iqbal on github.
- I am asif31iqbal (https://keybase.io/asif31iqbal) on keybase.
- I have a public key ASBm0K2uHWDp4Dxr2u1-2m2hdd15llI0IitAI013_cp07Qo
To claim this, I am signing this object:
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "time" | |
| ) | |
| // Fake a long and difficult work. | |
| func DoWork() { |
I hereby claim:
To claim this, I am signing this object:
| import os | |
| import torch | |
| import torch.nn as nn | |
| from torch.autograd import Variable | |
| import torchvision.datasets as dset | |
| import torchvision.transforms as transforms | |
| import torch.nn.functional as F | |
| import torch.optim as optim | |
| ## load mnist dataset | |
| use_cuda = torch.cuda.is_available() |
| import pandas as pd | |
| df = pd.DataFrame({'id': [12, None, 56], 'name': ['asif', 'iqbal', 'anika']}) | |
| # df to numpy array | |
| df.values | |
| # df to boolean df (null/ notnull) | |
| df.notnull() | |
| # oppposite of notnull | |
| df.isnull() |
| https://www.facebook.com/v2.8/dialog/oauth? | |
| client_id={app-id} | |
| &redirect_uri={redirect-uri} | |
| https://graph.facebook.com/v2.8/oauth/access_token? | |
| client_id={app-id} | |
| &redirect_uri={redirect-uri} | |
| &client_secret={app-secret} | |
| &code={code-parameter} |
| Analyzer | |
| - Tokenizer | |
| - Series of filters | |
| StandardAnalyzer | |
| - StandardTokenizer | |
| - StandardFilter, LowercaseFilter, StopFilter | |
| Stemming: | |
| - Swimming -> Swim, catlike, cattly -> cat | |
| - Create custom Analyzer, override createComponents() | |
| - PorterStemFilter |
| oauth: | |
| https://jaxenter.com/rest-api-spring-java-8-112289.html | |
| https://raymondhlee.wordpress.com/2014/12/21/implementing-oauth2-with-spring-security/ | |
| http://websystique.com/spring-security/secure-spring-rest-api-using-oauth2/ |
| JMX remote with jconsole via ssh tunneling with socks proxy: | |
| 1. Add this to JAVA_OPTS in remote process: | |
| -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port={remoteJMXport} -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false | |
| 2. ssh -D {proxyport} user@remotehost | |
| 3. jconsole -J-DsocksProxyHost=localhost -J-DsocksProxyPort={proxyport} service:jmx:rmi:///jndi/rmi://{remotehost}:{remoteJMXport}/jmxrmi | |
| For visualvm, see this link: | |
| https://theholyjava.wordpress.com/2012/09/21/visualvm-monitoring-remote-jvm-over-ssh-jmx-or-not/ | |
| For MAT: |
| Each spout and bolt can have one or more tasks, each of which corresponds to a thread. | |
| Each topology can run under one or more JVMs. For example, if the combined parallelism (number of tasks) of the topology is 300 and 50 | |
| workers are allocated, then each worker will execute 6 tasks (as threads within the worker). Storm tries to spread the tasks evenly | |
| across all the workers. | |
| Refer to this [http://storm.apache.org/releases/1.0.1/Understanding-the-parallelism-of-a-Storm-topology.html] | |
| also http://stackoverflow.com/questions/17257448/what-is-the-task-in-storm-parallelism |
| import static org.junit.Assert.*; | |
| import java.io.File; | |
| import java.io.FileInputStream; | |
| import java.io.IOException; | |
| import java.util.Properties; | |
| import org.apache.lucene.analysis.core.WhitespaceAnalyzer; | |
| import org.apache.lucene.analysis.standard.StandardAnalyzer; | |
| import org.apache.lucene.document.Document; |