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
from langdetect import detect_langs | |
from collections import defaultdict | |
def split_english_bangla(mixed_string): | |
# To hold the detected languages and their corresponding text parts | |
language_dict = defaultdict(str) | |
# Split the string into words (or tokens) | |
words = mixed_string.split() | |
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
// Idea: | |
// get the main result set into: | |
// three seperate list in a main list: [[1,2,3], [1,2], [1,2....,n]] | |
// Maybe here in this case js will not clone the main list . | |
// it will manipulate the main list. Attention to it. | |
list = [1,2,3,4,5,6,7,8,9] | |
const group_by_n = (list) => { | |
// same as before: |
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 group(arr): | |
print("given set of the array: ", arr) | |
temp_list = [] | |
group_maker_spice = 3 # base jumper | |
group_maker_spice_special_case_second_row = 2 | |
result_list = [] | |
for item in arr: | |
if item == 0 and len(arr) > group_maker_spice: | |
# insert the first 3 in a group |
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://www.codewars.com/kata/the-builder-of-things/ruby | |
# https://www.codewars.com/kata/reviews/5571e09a385f59d95f000063/groups/59426d64e6049310a70006ce | |
# imported to handle any plural/singular conversions | |
require 'active_support/core_ext/string' | |
class Thing | |
def initialize(name) | |
@properties = {} | |
is_the.name.send(name) |
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
let os = substitute(system('uname'), "\n", "", "") | |
call plug#begin('~/.config/nvim/autoload/') | |
Plug 'morhetz/gruvbox' | |
Plug 'chusiang/vim-sdcv' " How to install dict see https://askubuntu.com/questions/191125/is-there-an-offline-command-line-dictionary | |
Plug 'scrooloose/nerdtree' | |
Plug 'kassio/neoterm' | |
Plug 'janko-m/vim-test' | |
Plug 'benekastah/neomake' |
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
defmodule Router.SitesRouter do | |
import Plug.Conn | |
use Plug.Router | |
plug :match | |
plug :dispatch | |
get "/" do | |
page = EEx.eval_file("views/sites/index.html.eex") | |
conn |
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
defmodule Router.MainRouter do | |
use Plug.Router | |
plug :match | |
plug :dispatch | |
get "/" do | |
page = EEx.eval_file("views/index.html.eex") | |
conn | |
|> put_resp_content_type("text/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
defmodule TodoList.Repo.Migrations.CreateTasks do | |
use Ecto.Migration | |
def change do | |
create table("tasks") do | |
add :task_name, :string | |
add :task_description, :string | |
add :task_status, :string | |
timestamps() | |
end |
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
defmodule TodoList.Task do | |
use Ecto.Schema | |
import Poison | |
alias TodoList.Repo | |
schema "tasks" do | |
field :task_name | |
field :task_description | |
field :task_status |
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
use Mix.Config | |
config :todolist, TodoList.Repo, [ | |
adapter: Ecto.Adapters.Postgres, | |
database: "todolist_#{Mix.env}", | |
username: "postgres", | |
password: "", | |
hostname: "localhost", | |
] |
NewerOlder