This file contains hidden or 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 Hangman.MasterCatController do | |
use Hangman.Web, :controller | |
alias Hangman.MasterCat | |
def index(conn, _params) do | |
query = from p in MasterCat, | |
select: p | |
a = Repo.all(query) |
This file contains hidden or 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 Hangman.CategoryController do | |
use Hangman.Web, :controller | |
alias Hangman.Category | |
def create(conn, %{ "category" => params }) do | |
IO.inspect(params) | |
a = Category.changeset(%Category{},params) | |
Repo.insert(a) | |
text(conn, a.valid?) |
This file contains hidden or 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
/* | |
Zrodla : | |
http://www.cplusplus.com/reference/stack/stack/push/ | |
http://www.cplusplus.com/reference/string/string/ | |
Opublikowano na pastebin.com | |
Dlaczego unsigned ? - bo nie niesie za soba, bo wymaga bardzo malo pamieci | |
Dlaczego stack ? - bo chcialem sprawdzic jak to dziala |
This file contains hidden or 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 show_details(conn, _params) do | |
name_param = Map.get(_params, "name") | |
permission_level = get_session(conn, :role) | |
case permission_level do | |
User.student -> | |
session_login = get_session(conn, :login) | |
IO.inspect(session_login) | |
IO.inspect(name_param) | |
case name_param do | |
^session_login -> |
This file contains hidden or 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 edit(conn, %{ "edit" => newData }) do | |
#TODO: naprawic to | |
case Repo.one(User.unique_user(User, "login")) do | |
nil -> conn | |
|> put_flash(:error, "Błąd bazy danych") | |
result -> | |
if Map.get(newData, "password") == "" do | |
newData = Map.put(newData,"password", result.password) | |
end | |
if Map.get(newData, "avatar") == "" do |
This file contains hidden or 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
package com.cronline.haito.projectbeggining.util; | |
import android.content.Context; | |
import android.hardware.Camera; | |
import android.util.Log; | |
import android.view.SurfaceHolder; | |
import android.view.SurfaceView; | |
import com.cronline.haito.projectbeggining.activities.camera.CameraActivity; |
This file contains hidden or 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 Bitmap flipHorizontallu(Bitmap bmp){ | |
Matrix matrix = new Matrix(); | |
matrix.postScale(-1.0f, 1.0f); | |
return Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), matrix, true); | |
} | |
public static Bitmap flipVertically(Bitmap bmp){ | |
Matrix matrix = new Matrix(); | |
matrix.postScale(1.0f, -1.0f); | |
return Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), matrix, true); |
This file contains hidden or 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
Application.ensure_all_started(:hound) | |
ExUnit.start | |
Mix.Task.run "ecto.create", ~w(-r PatronLeague.Repo --quiet) | |
Mix.Task.run "ecto.migrate", ~w(-r PatronLeague.Repo --quiet) | |
Ecto.Adapters.SQL.begin_test_transaction(PatronLeague.Repo) | |
defmodule ApiHelper do | |
use ExUnit.Case, async: false | |
use PatronLeague.ConnCase |
This file contains hidden or 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
exited in: GenServer.call(Hound.SessionServer, {:change_session, #PID<0.373.0>, :default, %{}}, 60000) | |
** (EXIT) an exception was raised: | |
** (MatchError) no match of right hand side value: {:error, %HTTPoison.Error{id: nil, reason: :timeout}} | |
(hound) lib/hound/request_utils.ex:43: Hound.RequestUtils.send_req/4 | |
(hound) lib/hound/session_server.ex:67: Hound.SessionServer.handle_call/3 | |
(stdlib) gen_server.erl:629: :gen_server.try_handle_call/4 | |
(stdlib) gen_server.erl:661: :gen_server.handle_msg/5 | |
(stdlib) proc_lib.erl:239: :proc_lib.init_p_do_apply/3 |