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
#!/bin/sh | |
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
# CREATE block and create them in separate commands _after_ all the INSERTs. | |
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
# The mysqldump file is traversed only once. | |
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
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
Dictionary<string,string> dict = new Dictionary<string,string>(); | |
dict.add("name","POSTされた値"); | |
dict.add("address","POSTされた値"); | |
. | |
. | |
. | |
Session["data"] = dict; | |
//これを取り出す時にはこうなる |
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 class UserData | |
{ | |
public string Id { set; get; } | |
public string Username { set; get; } | |
public string Password { set; get; } | |
public string Name { set; get; } | |
public string Kana { set; get; } | |
public string Tel { set; get; } | |
public string MailAddress { set; get; } | |
public string UserRole { set; get; } |
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
UPDATE movie_log | |
INNER JOIN ( | |
SELECT | |
item_id, | |
date, | |
view + | |
( | |
comment * | |
( |
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
CakePHP Behaviouer 'Containable' is very useful,but it's not suitable plugin for fetch deep join records. | |
I want to join 4 Tables as such. | |
OrderEntryDetail->Item->Maker->Category | |
Containable runs sql for each model(equivalent each table) but this tricky BindModel/UnBindModel usage solves this problem. | |
<Before> | |
<?php |
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
<?php | |
function calcJanCodeDigit($num) { | |
$arr = str_split($num); | |
$odd = 0; | |
$mod = 0; | |
for($i=0;$i<count($arr);$i++){ | |
if(($i+1) % 2 == 0) { | |
//偶数の総和 | |
$mod += intval($arr[$i]); | |
} else { |
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
<?php | |
function renameForWelcartImage ( $path ) { | |
if (is_dir($path) === false) { | |
echo 'not directory path'; | |
exit(); | |
} | |
$file = scandir($path); | |
$count = 0; | |
foreach($file as $key){ | |
if ('.' == $key || '..' == $key) { continue; } |
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
<UserControl x:Class="Sample.Invoice" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
mc:Ignorable="d" | |
d:DesignHeight="1100" d:DesignWidth="800"> | |
<Grid Background="White" Margin="20" DataContext="{StaticResource VMContainer}"> | |
<Grid.RowDefinitions> | |
<!-- Title--> |
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
import uuid | |
import wtforms_json | |
from sqlalchemy import not_ | |
from sqlalchemy.dialects.postgresql import UUID | |
from wtforms import Form | |
from wtforms.fields import FormField, FieldList | |
from wtforms.validators import Length | |
from flask import current_app as app | |
from flask import request, json, jsonify, abort |
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
select | |
c.customer_id, | |
c.customer_age, | |
c.customer_name, | |
ca.name, | |
ca.rank | |
from | |
customers as c | |
inner join customer_category as ca | |
on (c.customer_age /5 *5) = ca.rank |
OlderNewer