https://techcrunch.com/2018/08/12/a-private-tesla-backed-by-saudi-arabia-might-not-be-as-far-fetched-as-you-think/
#news #elun #tesla
#news #elun #tesla
TechCrunch
A private Tesla backed by Saudi Arabia might not be as far-fetched as you think
This week the business and tech world was stunned when Elon Musk hinted on August 7, via Twitter of course, that he wanted to take Tesla private. The estimated price tag for such a move is commonly put at up to $72 billion. Shortly after that no ‘white knights’…
How to prepend a string to all file names in a directory in a bash script?
The above one-line will loop over all files in current directory with
So for example a file with name
#python #bash #script #prepend #move #rename #for
for f in *.py; do mv "$f" "old-$f"; done
The above one-line will loop over all files in current directory with
.py
extension and prepend old-
into the files.So for example a file with name
main.py
will be renamed to old-main.py
#python #bash #script #prepend #move #rename #for
How do you know if a remote web server is Linux based or Windows based? (Ignore this if there is pfsense/ha proxy in front)
The output is similar to:
Look at the
#os #linux #windows #ping #ttl #iranhost
ping
the remote ip:ping iranhost.com
The output is similar to:
PING iranhost.com (174.142.214.47): 56 data bytes
64 bytes from 174.142.214.47: icmp_seq=0 ttl=105 time=174.379 ms
64 bytes from 174.142.214.47: icmp_seq=1 ttl=105 time=180.315 ms
64 bytes from 174.142.214.47: icmp_seq=2 ttl=105 time=177.937 ms
Look at the
ttl
part of the output. If it's above 100, it is a windows based machine otherwise it is a Linux based machine.#os #linux #windows #ping #ttl #iranhost
Forwarded from Alireza Hos.
This media is not supported in your browser
VIEW IN TELEGRAM
🔺حمایت کم نظیر مردم ترکیه از پول کشورشان
🔹کاهش 13درصدی ارزش دلار نسبت به لیر از زمان شروع کمپین مردمی
🔹کاهش 13درصدی ارزش دلار نسبت به لیر از زمان شروع کمپین مردمی
Did you know that the below code returns
That's because
1- s == 'True'
Do not use this piece of code if you don't know what you're doing. Misusing this technic puts a mess in your code! Be cautious.
2- The other more elegant way is to use
#python #boolean #true #false #cast #convert #bool
True
?>>> bool("False")
True
That's because
False
is a string and boolean of non-empty string is True
. There are workarounds:1- s == 'True'
Do not use this piece of code if you don't know what you're doing. Misusing this technic puts a mess in your code! Be cautious.
2- The other more elegant way is to use
json
library like below:>>> import json
>>> json.loads("false".lower())
False
>>> json.loads("True".lower())
True
NOTE:
you need to make it lower case in order to turn the string into a boolean value.#python #boolean #true #false #cast #convert #bool
How to use thousand separator in
The python way is to use
And in
#python #jinja2 #separator #thousand_separator
Python
& Jinja2
?The python way is to use
format
as below:'user credit is {:,}'.format(10000)
And in
Jinja2
it is like the following line:user credit is {{ '{0:,}'.format(user_credit | int) }}
#python #jinja2 #separator #thousand_separator
How to query on Google Big Query?
Big Query or for short BQ is a data warehousing solution that puts your data on a serverless platform with no limit on data size and processing power. It is design for this specific purpose and returns aggregated results in a fraction of a second most of the time.
In python you can use its library by installing
Now create a service account as stated in link below:
https://cloud.google.com/bigquery/docs/reference/libraries
We assume that you have done the installation and configuration process for now. To query on
You can send
#google #BI #bigdata #bigquery #warehouse #data_warehouse
Big Query or for short BQ is a data warehousing solution that puts your data on a serverless platform with no limit on data size and processing power. It is design for this specific purpose and returns aggregated results in a fraction of a second most of the time.
In python you can use its library by installing
google-cloud-bigquery
:pip install --upgrade google-cloud-bigquery
Now create a service account as stated in link below:
https://cloud.google.com/bigquery/docs/reference/libraries
We assume that you have done the installation and configuration process for now. To query on
BQ
:from google.cloud import bigquery
bigquery_client = bigquery.Client()
dataset_id = 'MY_PROJECT'
query = ("SELECT user_id FROM MY_PROJECT.users LIMIT 100")
# API CALL
query_job = bigquery_client.query(query)
for row in query_job:
print row.user_id, row['user_id']
You can send
update
commands like the above query too.#google #BI #bigdata #bigquery #warehouse #data_warehouse
Google Cloud
BigQuery API Client Libraries | Google Cloud
Information about interacting with BigQuery API in C++, C#, Go, Java, Node.js, PHP, Python, and Ruby.
Tech C**P
How to query on Google Big Query? Big Query or for short BQ is a data warehousing solution that puts your data on a serverless platform with no limit on data size and processing power. It is design for this specific purpose and returns aggregated results…
How to implement email tracking solution?
The above code check if
nginX
has a module called empty_gif
that generates a 1*1 pixel image. It is usually put at the end of campaign emails in order to track how many users have opened the email. The code for nginX
is:location = /empty.gif {
empty_gif;
expires -1;
post_action @track;
}
location @track {
internal;
proxy_pass http://tracking-backend/track$is_args$args;
proxy_set_header x-ip $remote_addr;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
}
The above code check if
/empty.gif
URL is requested, if answer is yes then serve the image and makes expires
to -1
to not cache the image and finally using post_action
which calls a sub request after the current request has been fininshed. The parameters you need to pass is put after the image link in email like:https://www.example.com/empty.gif?token=SOMETHING_TO_TRACK#nginx #email #empty_gif #email_tracking #pixel
https://stackoverflow.blog/2018/09/05/developer-salaries-in-2018-updating-the-stack-overflow-salary-calculator/?cb=1
#salary #stackoverflow #report
#salary #stackoverflow #report
Stack Overflow Blog
Developer Salaries in 2018: Updating the Stack Overflow Salary Calculator
Today we launched the 2018 update to the Stack Overflow Salary Calculator, a tool that allows developers and employers to find typical salaries for the software industry based on experience level, location, education, and specific technologies.