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
parseInt('5x'); //=> 5 | |
parseInt('0y'); //=> 0 | |
parseInt('0x'); //=> NaN | |
parseInt('', 16) //=> NaN |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>山手座標</title> | |
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> | |
<script src="main.js"></script> | |
</head> | |
<body> | |
<table class="table-station"> |
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
@each $type in "facebook" "twitter" { | |
.#{$type} { | |
@if $type == "facebook" { | |
$button: "button_like.png"; | |
} @else if $type == "twitter" { | |
$button: "button_tweet.png"; | |
} | |
width: image-width($button); | |
height: image-height($button); | |
background-image: image-url($button); |
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
<html> | |
<head> | |
<title>スーパーツイート</title> | |
</head> | |
<body> | |
<div class="twitter"> | |
<a href="https://twitter.com/share" class="twitter-share-button" data-via="butchi_y" data-hashtags="すごいパンチ" data-url="http://jsdo.it/butchi/super_tweet">Tweet</a> | |
</div> |
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
(* http://ch.nicovideo.jp/programing/blomaga/ar620922 *) | |
lastDigit[n_, m_] := With[ | |
{rd = RealDigits[n/m, 10]}, | |
Piecewise[{ | |
{-1, Depth[First[rd]] > 2 || Head[Last[rd]] === List}, | |
{Last[Cases[First[rd], Except[_?(#1 === 0 & )]]], True}} | |
] | |
] | |
lastDigit[95367431640626, 95367431640625] |
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
(* http://yukicoder.me/problems/27 *) | |
h[n_] := With[{a = FactorInteger[n]}, ! MatchQ[a, {{_, 1}}] && ! MatchQ[a, {{_, 1}, {_, 1}}] && ! MatchQ[a, {{_, 2}}]] |
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
(* http://yukicoder.me/problems/no/39 *) | |
maxPos[li_] := Last[Position[li, Max[li]]][[1]] | |
replace[li_] := ReplacePart[li, {maxPos[li] -> First[li], 1 -> Max[li]}] | |
f[n_] := FromDigits[replace[IntegerDigits[n]]] |
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
(* http://yukicoder.me/problems/no/40 *) | |
cl[li_] := | |
CoefficientList[PolynomialRemainder[FromDigits[Reverse[li], x], x^3 - x, x], x] | |
ans[{}] := {0} | |
ans[li_] := li | |
In[1]:= ans[f[{1, 1, 1, 0, 0, 1}]] | |
Out[1]= {1, 2, 1} |
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
(* http://yukicoder.me/problems/no/39 *) | |
replace[li_, {posA_, posB_}] := ReplacePart[li, {posA -> li[[posB]], posB -> li[[posA]]}] | |
replacePos[li_] := Select[Tuples[Range[Length[li]], 2], OrderedQ] | |
map[li_] := replace[li, #] & /@ replacePos[li] | |
f[n_] := Max[FromDigits[#] & /@ map[IntegerDigits[n]]] |
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
(* http://yukicoder.me/problems/no/46 *) | |
ans[a_, b_] := Floor[(b + a - 1)/a] |
OlderNewer