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
# Things that must be added | |
gem 'devise' | |
gem 'omniauth-facebook' | |
gem 'omniauth-github' |
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
def func(num): | |
first = num % 10000 | |
last = num / 10000 | |
fmtString = '' | |
while last: | |
fmtString += str(unichr((last % 26) + 65)) | |
last /= 26 | |
return ("AAA" + fmtString[::-1])[-3:] + ("0000" + str(first))[-4:] | |
def invfunc(num): | |
parsed = int(num[-4:]) |
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
[{ | |
"id": "1", | |
"district": "CUA", | |
"lon": "-99.168051", | |
"lat": "19.433296", | |
"bikes": "0", | |
"slots": "27", | |
"zip": "06500", | |
"address": "001 - R\u00edo Balsas-R\u00edo Sena", | |
"addressNumber": "S\/N", |
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
x | freq | ||
---|---|---|---|
1 | 295 | 5435 | |
2 | 390 | 4419 | |
3 | 398 | 3921 | |
4 | 302 | 3748 | |
5 | 305 | 3652 | |
6 | 317 | 3430 | |
7 | 340 | 3403 | |
8 | 372 | 3392 | |
9 | 291 | 3274 |
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
x freq | |
1 295 5279 | |
2 390 4536 | |
3 398 4135 | |
4 302 3605 | |
5 305 3543 | |
6 291 3380 | |
7 340 3177 | |
8 372 3173 | |
9 317 3108 |
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
** (exit) exited in: GenServer.call(#PID<0.148.0>, {:query, "CREATE TABLE IF NOT EXISTS \"schema_migrations\" (\"version\" bigint PRIMARY KEY, \"inserted_at\" timestamp)", []}, :infinity) | |
** (EXIT) an exception was raised: | |
** (UndefinedFunctionError) undefined function: Geo.PostGIS.Extension.init/2 (module Geo.PostGIS.Extension is not available) | |
Geo.PostGIS.Extension.init(%{"DateStyle" => "ISO, MDY", "IntervalStyle" => "postgres", "TimeZone" => "America/Monterrey", "application_name" => "", "client_encoding" => "UTF8", "integer_datetimes" => "on", "is_superuser" => "on", "server_encoding" => "UTF8", "server_version" => "9.4.4", "session_authorization" => "postgres", "standard_conforming_strings" => "on"}, [library: Geo]) | |
(postgrex) lib/postgrex/types.ex:56: anonymous fn/2 in Postgrex.Types.prepare_extensions/2 | |
(elixir) lib/enum.ex:909: anonymous fn/4 in Enum.into/3 | |
(elixir) lib/enum.ex:1261: Enum."-reduce/3-lists^foldl/2-0-"/3 | |
(elixir) li |
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
def create(conn, %{"stress" => stress_params}) do | |
changeset = Stress.changeset(%Stress{}, stress_params) | |
IO.inspect stress_params | |
{long, lat, type} = {stress_params["long"], stress_params["lat"], stress_params["type"]} | |
q = from p in Plataforma.Average, | |
select: p, | |
where: p.long == ^long and p.lat == ^lat and p.type == ^type | |
average = Repo.all(q) |> first_or_create | |
average_params = %Plataforma.Average{"long" => stress_params["long"], | |
"lat" => stress_params["lat"], |
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
sum(range(100)) # -> 4950 | |
from multiprocessing import Pool | |
def chunkify(lst, n): | |
return [lst[i::n] for i in range(n)] | |
# Ejemplo | |
partes = chunkify(range(100), 8) | |
# [range(0, 100, 8), range(1, 100, 8), range(2, 100, 8)... |
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
Java (Groovy, Scala, Clojure, Kotlin) ; The Javas | |
C (C++, D, Rust, Nim) ; System Programming | |
Python (Coconut) | Ruby | Crystal | Io | Smalltalk ; Multis/OOPs | |
JavaScript (Dart, Scala.js, Elm, ClojureScript, CoffeeScript) ; The Browser Languages | |
Assembly (x86, ARM, PowerPC, RISC-V) ; Assemblers | |
R | Sage ; Math | |
Perl | Lua ; Sysadmin/Scripting | |
Lisp (Scheme, Common Lisp, Emacs Lisp) ; Lisps | |
Prolog ; Logic Programming | |
Erlang (Elixir, LFE) | Go ; Concurrent/Distributed |
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
homeassistant/util/__init__.py:320: error: "module" has no attribute "PriorityQueue" | |
homeassistant/util/package.py:34: error: "module" has no attribute "SubprocessError" | |
homeassistant/util/package.py:59: error: Iterable expected | |
homeassistant/scripts/macos.py:17: error: Incompatible types in assignment (expression has type IO[Any], variable has type "TextIO") | |
homeassistant/helpers/event.py:88: error: Callable[..., Any] has no attribute "run" | |
homeassistant/loader.py:44: error: "module" has no attribute "__path__" | |
homeassistant/helpers/config_validation.py:353: error: Cannot determine type of 'CONDITION_SCHEMA' | |
homeassistant/helpers/config_validation.py:362: error: Cannot determine type of 'CONDITION_SCHEMA' | |
homeassistant/config.py:107: error: Cannot determine type of 'DEFAULT_CONFIG' | |
homeassistant/config.py:115: error: Cannot determine type of 'DEFAULT_CONFIG' |
OlderNewer