code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>parse_annotation (JrubyGate::XMLParse)</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> </head> <body class="standalone-code"> <pre><span class="ruby-comment cmt"># File lib/jruby-gate/xmlparse.rb, line 15</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_annotation</span>(<span class="ruby-identifier">str</span>) <span class="ruby-identifier">doc</span> = <span class="ruby-constant">Hpricot</span>(<span class="ruby-identifier">str</span>) <span class="ruby-identifier">children</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">at</span>(<span class="ruby-value str">&quot;textwithnodes&quot;</span>).<span class="ruby-identifier">children</span> <span class="ruby-comment cmt">## Find the TextWithNodes element and then loop through</span> <span class="ruby-comment cmt">## each child element. The text next to each node gets associated</span> <span class="ruby-comment cmt">## with the node id into the hash</span> (<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-identifier">doc</span>.<span class="ruby-identifier">at</span>(<span class="ruby-value str">&quot;textwithnodes&quot;</span>).<span class="ruby-identifier">children</span>.<span class="ruby-identifier">size</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">children</span>[<span class="ruby-identifier">i</span>].<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'Hpricot::Elem'</span> <span class="ruby-ivar">@nodehash</span>[<span class="ruby-identifier">children</span>[<span class="ruby-identifier">i</span>].<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">&quot;id&quot;</span>]] = <span class="ruby-identifier">children</span>[<span class="ruby-identifier">i</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">''</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">2</span> <span class="ruby-keyword kw">end</span> } <span class="ruby-ivar">@nodehash</span> <span class="ruby-keyword kw">end</span></pre> </body> </html>
denen99/jruby-gate
doc/classes/JrubyGate/XMLParse.src/M000003.html
HTML
mit
2,882
 namespace Corlib.Configuration { public class TriggerConfig { public string TriggerFile { get; set; } public ProcessAction ProcessAction { get; set; } public TriggerType GetTriggerType () { if (!string.IsNullOrWhiteSpace (TriggerFile)) return TriggerType.File; return TriggerType.Undefined; } public ActionType GetActionType () { if (null != ProcessAction) return ActionType.Process; return ActionType.Undefined; } } }
corlib/trigger
source/cltrigger/Configuration/TriggerConfig.cs
C#
mit
564
#!/bin/sh ##### begin batch route ##### # Google DNS and OpenDNS route add -host 8.8.8.8 gw $VPNGW route add -host 8.8.4.4 gw $VPNGW route add -host 208.67.222.222 gw $VPNGW # www.dropbox.com #route add -host 174.36.30.70 gw $VPNGW route add -net 174.36.30.0/24 gw $VPNGW # dl-web.dropbox.com route add -net 184.73.0.0/16 gw $VPNGW route add -net 75.101.159.0/24 gw $VPNGW route add -net 75.101.140.0/24 gw $VPNGW # wiki.dropbox.com route add -host 174.36.51.41 gw $VPNGW # login.facebook.com #route add -net 66.220.147.0/24 gw $VPNGW #route add -net 66.220.146.0/24 gw $VPNGW # for Google route add -net 72.14.192.0/18 gw $VPNGW route add -net 74.125.0.0/16 gw $VPNGW # static.cache.l.google.com in Taiwan route add -net 60.199.175.0/24 gw $VPNGW # webcache.googleusercontent.com route add -host 72.14.203.132 gw $VPNGW route add -host 78.16.49.15 gw $VPNGW # for all facebook route add -net 66.220.0.0/16 gw $VPNGW route add -net 69.63.0.0/16 gw $VPNGW # fbcdn route add -net 96.17.8.0/24 gw $VPNGW # imgN.imageshack.us route add -net 208.75.252.0/24 gw $VPNGW route add -net 208.94.3.0/24 gw $VPNGW route add -net 38.99.77.0/24 gw $VPNGW route add -net 38.99.76.0/24 gw $VPNGW # static.plurk.com route add -host 74.120.123.19 gw $VPNGW # statics.plurk.com route add -net 216.137.53.0/24 gw $VPNGW route add -net 216.137.55.0/24 gw $VPNGW #tumblr.com route add -host 174.120.238.130 gw $VPNGW # tw.nextmedia.com route add -host 210.242.234.140 gw $VPNGW # {www|api}.twitter.com route add -net 168.143.161.0/24 gw $VPNGW route add -net 168.143.162.0/24 gw $VPNGW route add -net 168.143.171.0/24 gw $VPNGW route add -net 128.242.240.0/24 gw $VPNGW route add -net 128.242.245.0/24 gw $VPNGW route add -net 128.242.250.0/24 gw $VPNGW # tw.news.yahoo.com route add -net 203.84.204.0/24 gw $VPNGW # pixnet.net route add -net 103.23.108.0/24 gw $VPNGW # tw.rd.yahoo.com route add -net 203.84.203.0/24 gw $VPNGW # tw.blog.yahoo route add -net 203.84.202.0/24 gw $VPNGW # for all TW Yahoo route add -net 116.214.0.0/16 gw $VPNGW # yam.com route add -net 60.199.252.0/24 gw $VPNGW # c.youtube.com #route add -net 74.125.164.0/24 gw $VPNGW # ytimg.com #route add -net 74.125.6.0/24 gw $VPNGW #route add -net 74.125.15.0/24 gw $VPNGW #route add -net 74.125.19.0/24 gw $VPNGW # for all youtube route add -net 66.102.0.0/20 gw $VPNGW route add -net 72.14.213.0/24 gw $VPNGW # for vimeo # av.vimeo.com route add -net 117.104.138.0/24 gw $VPNGW route add -net 24.143.203.0/24 gw $VPNGW route add -net 198.173.160.0/24 gw $VPNGW route add -net 198.173.161.0/24 gw $VPNGW # assets.vimeo.com route add -net 124.40.51.0/24 gw $VPNGW route add -net 198.87.176.0/24 gw $VPNGW route add -net 96.17.8.0/24 gw $VPNGW route add -net 204.2.171.0/24 gw $VPNGW route add -net 208.46.163.0/24 gw $VPNGW # *.vimeo.com route add -net 66.235.126.0/24 gw $VPNGW #route add -net 74.125.0.0/16 gw $VPNGW route add -net 173.194.0.0/16 gw $VPNGW route add -net 208.117.224.0/19 gw $VPNGW route add -net 64.233.160.0/19 gw $VPNGW # embed.wretch.cc route add -net 203.188.204.0/24 gw $VPNGW # pic.wretch.cc route add -host 116.214.13.248 gw $VPNGW route add -host 119.160.252.14 gw $VPNGW # for all xuite route add -net 210.242.17.0/24 gw $VPNGW route add -net 210.242.18.0/24 gw $VPNGW # www.books.com.tw route add -net 61.31.206.0/24 gw $VPNGW route add -net 58.86.40.0/24 gw $VPNGW # all others route add -host 101.101.96.51 gw $VPNGW route add -host 101.78.134.153 gw $VPNGW route add -host 101.78.204.26 gw $VPNGW route add -host 101.78.207.166 gw $VPNGW route add -host 103.11.101.3 gw $VPNGW route add -host 103.11.228.146 gw $VPNGW route add -host 106.10.165.51 gw $VPNGW route add -host 106.187.100.93 gw $VPNGW route add -host 106.187.101.41 gw $VPNGW route add -host 106.187.34.220 gw $VPNGW route add -host 106.187.35.119 gw $VPNGW route add -host 106.187.47.148 gw $VPNGW route add -host 107.6.105.234 gw $VPNGW route add -host 107.6.13.39 gw $VPNGW route add -host 108.162.194.95 gw $VPNGW route add -host 108.162.195.95 gw $VPNGW route add -host 108.162.200.31 gw $VPNGW route add -host 108.162.205.106 gw $VPNGW route add -host 108.162.206.106 gw $VPNGW route add -host 108.163.157.56 gw $VPNGW route add -host 108.163.184.238 gw $VPNGW route add -host 108.166.165.187 gw $VPNGW route add -host 108.166.70.105 gw $VPNGW route add -host 108.168.255.241 gw $VPNGW route add -host 108.174.150.118 gw $VPNGW route add -host 108.175.161.226 gw $VPNGW route add -host 108.61.37.254 gw $VPNGW route add -host 108.61.74.51 gw $VPNGW route add -host 109.104.79.84 gw $VPNGW route add -host 109.201.152.100 gw $VPNGW route add -host 109.233.153.1 gw $VPNGW route add -host 110.34.141.187 gw $VPNGW route add -host 110.45.229.152 gw $VPNGW route add -host 111.90.137.166 gw $VPNGW route add -host 111.92.226.12 gw $VPNGW route add -host 111.92.236.61 gw $VPNGW route add -host 111.92.237.110 gw $VPNGW route add -host 113.253.129.176 gw $VPNGW route add -host 114.108.161.80 gw $VPNGW route add -host 114.141.199.247 gw $VPNGW route add -host 114.141.72.50 gw $VPNGW route add -host 115.160.156.212 gw $VPNGW route add -host 115.182.15.77 gw $VPNGW route add -host 115.30.20.130 gw $VPNGW route add -host 116.251.211.227 gw $VPNGW route add -host 116.90.87.217 gw $VPNGW route add -host 117.56.25.3 gw $VPNGW route add -host 117.56.6.1 gw $VPNGW route add -host 118.142.78.123 gw $VPNGW route add -host 118.143.65.100 gw $VPNGW route add -host 118.173.204.2 gw $VPNGW route add -host 118.244.165.19 gw $VPNGW route add -host 119.246.130.197 gw $VPNGW route add -host 12.130.132.30 gw $VPNGW route add -host 12.69.32.89 gw $VPNGW route add -host 121.119.174.67 gw $VPNGW route add -host 121.127.250.228 gw $VPNGW route add -host 121.50.176.24 gw $VPNGW route add -host 122.115.46.125 gw $VPNGW route add -host 122.147.183.31 gw $VPNGW route add -host 122.152.128.109 gw $VPNGW route add -host 122.209.125.55 gw $VPNGW route add -host 122.248.242.240 gw $VPNGW route add -host 122.248.248.5 gw $VPNGW route add -host 123.204.22.158 gw $VPNGW route add -host 123.242.224.113 gw $VPNGW route add -host 124.150.129.145 gw $VPNGW route add -host 124.150.130.98 gw $VPNGW route add -host 124.150.132.8 gw $VPNGW route add -host 124.219.45.238 gw $VPNGW route add -host 124.244.10.135 gw $VPNGW route add -host 124.244.43.52 gw $VPNGW route add -host 125.114.250.163 gw $VPNGW route add -host 125.6.190.4 gw $VPNGW route add -host 128.100.171.12 gw $VPNGW route add -host 131.111.179.80 gw $VPNGW route add -host 133.242.1.242 gw $VPNGW route add -host 14.102.149.23 gw $VPNGW route add -host 14.136.71.113 gw $VPNGW route add -host 14.199.46.38 gw $VPNGW route add -host 140.109.29.253 gw $VPNGW route add -host 140.123.188.66 gw $VPNGW route add -host 140.211.166.152 gw $VPNGW route add -host 141.0.17.94 gw $VPNGW route add -host 141.101.125.52 gw $VPNGW route add -host 141.101.126.52 gw $VPNGW route add -host 141.101.127.30 gw $VPNGW route add -host 141.8.226.4 gw $VPNGW route add -host 142.234.84.46 gw $VPNGW route add -host 142.4.16.124 gw $VPNGW route add -host 142.4.50.154 gw $VPNGW route add -host 145.58.28.152 gw $VPNGW route add -host 152.19.134.40 gw $VPNGW route add -host 154.35.129.122 gw $VPNGW route add -host 154.35.131.132 gw $VPNGW route add -host 154.35.164.8 gw $VPNGW route add -host 157.55.96.251 gw $VPNGW route add -host 157.55.97.253 gw $VPNGW route add -host 158.182.41.82 gw $VPNGW route add -host 160.68.205.231 gw $VPNGW route add -host 163.29.36.96 gw $VPNGW route add -host 165.83.19.13 gw $VPNGW route add -host 168.144.28.183 gw $VPNGW route add -host 169.207.67.17 gw $VPNGW route add -host 170.140.52.142 gw $VPNGW route add -host 170.140.53.44 gw $VPNGW route add -host 170.149.168.130 gw $VPNGW route add -host 170.149.172.130 gw $VPNGW route add -host 173.192.64.147 gw $VPNGW route add -host 173.192.88.10 gw $VPNGW route add -host 173.193.197.35 gw $VPNGW route add -host 173.193.216.117 gw $VPNGW route add -host 173.194.77.121 gw $VPNGW route add -host 173.201.141.91 gw $VPNGW route add -host 173.201.216.69 gw $VPNGW route add -host 173.201.82.168 gw $VPNGW route add -host 173.201.98.128 gw $VPNGW route add -host 173.203.217.152 gw $VPNGW route add -host 173.203.221.57 gw $VPNGW route add -host 173.203.238.64 gw $VPNGW route add -host 173.224.208.13 gw $VPNGW route add -host 173.224.213.17 gw $VPNGW route add -host 173.231.9.232 gw $VPNGW route add -host 173.234.235.36 gw $VPNGW route add -host 173.236.162.231 gw $VPNGW route add -host 173.236.241.90 gw $VPNGW route add -host 173.236.43.122 gw $VPNGW route add -host 173.245.60.205 gw $VPNGW route add -host 173.245.61.205 gw $VPNGW route add -host 173.245.80.2 gw $VPNGW route add -host 173.247.252.117 gw $VPNGW route add -host 173.249.151.129 gw $VPNGW route add -host 173.252.100.27 gw $VPNGW route add -host 173.252.110.27 gw $VPNGW route add -host 173.254.212.124 gw $VPNGW route add -host 173.254.22.21 gw $VPNGW route add -host 173.254.224.195 gw $VPNGW route add -host 173.254.50.224 gw $VPNGW route add -host 173.255.192.14 gw $VPNGW route add -host 173.255.226.201 gw $VPNGW route add -host 173.255.246.187 gw $VPNGW route add -host 173.255.249.229 gw $VPNGW route add -host 174.120.117.124 gw $VPNGW route add -host 174.120.146.114 gw $VPNGW route add -host 174.120.189.254 gw $VPNGW route add -host 174.120.29.254 gw $VPNGW route add -host 174.120.6.7 gw $VPNGW route add -host 174.121.180.210 gw $VPNGW route add -host 174.121.219.140 gw $VPNGW route add -host 174.122.246.123 gw $VPNGW route add -host 174.122.45.123 gw $VPNGW route add -host 174.127.109.132 gw $VPNGW route add -host 174.132.147.60 gw $VPNGW route add -host 174.132.157.59 gw $VPNGW route add -host 174.132.96.140 gw $VPNGW route add -host 174.133.203.186 gw $VPNGW route add -host 174.133.217.98 gw $VPNGW route add -host 174.136.35.43 gw $VPNGW route add -host 174.139.15.210 gw $VPNGW route add -host 174.139.75.124 gw $VPNGW route add -host 174.143.243.139 gw $VPNGW route add -host 174.34.155.20 gw $VPNGW route add -host 174.35.35.7 gw $VPNGW route add -host 174.35.36.38 gw $VPNGW route add -host 174.36.107.130 gw $VPNGW route add -host 174.36.138.21 gw $VPNGW route add -host 174.36.153.130 gw $VPNGW route add -host 174.36.183.108 gw $VPNGW route add -host 174.36.186.208 gw $VPNGW route add -host 174.36.228.137 gw $VPNGW route add -host 174.36.28.11 gw $VPNGW route add -host 174.36.58.169 gw $VPNGW route add -host 174.37.129.192 gw $VPNGW route add -host 174.37.135.211 gw $VPNGW route add -host 174.37.15.12 gw $VPNGW route add -host 174.37.152.145 gw $VPNGW route add -host 174.37.99.236 gw $VPNGW route add -host 175.99.91.1 gw $VPNGW route add -host 176.32.92.8 gw $VPNGW route add -host 176.34.42.54 gw $VPNGW route add -host 176.9.137.75 gw $VPNGW route add -host 176.9.151.136 gw $VPNGW route add -host 176.9.28.8 gw $VPNGW route add -host 178.32.28.100 gw $VPNGW route add -host 178.33.229.188 gw $VPNGW route add -host 178.63.94.57 gw $VPNGW route add -host 180.188.194.12 gw $VPNGW route add -host 180.188.196.43 gw $VPNGW route add -host 180.210.243.10 gw $VPNGW route add -host 180.233.142.129 gw $VPNGW route add -host 182.163.74.136 gw $VPNGW route add -host 183.178.67.214 gw $VPNGW route add -host 183.179.172.170 gw $VPNGW route add -host 183.179.189.129 gw $VPNGW route add -host 183.81.166.110 gw $VPNGW route add -host 184.106.180.60 gw $VPNGW route add -host 184.106.20.99 gw $VPNGW route add -host 184.107.142.114 gw $VPNGW route add -host 184.107.18.92 gw $VPNGW route add -host 184.154.128.246 gw $VPNGW route add -host 184.154.48.218 gw $VPNGW route add -host 184.168.116.149 gw $VPNGW route add -host 184.168.120.2 gw $VPNGW route add -host 184.168.152.27 gw $VPNGW route add -host 184.168.192.25 gw $VPNGW route add -host 184.168.229.1 gw $VPNGW route add -host 184.168.55.1 gw $VPNGW route add -host 184.168.70.179 gw $VPNGW route add -host 184.169.172.216 gw $VPNGW route add -host 184.172.173.99 gw $VPNGW route add -host 184.173.166.40 gw $VPNGW route add -host 184.173.175.224 gw $VPNGW route add -host 184.26.1.147 gw $VPNGW route add -host 184.51.229.50 gw $VPNGW route add -host 184.82.204.5 gw $VPNGW route add -host 184.82.34.68 gw $VPNGW route add -host 184.82.38.87 gw $VPNGW route add -host 184.86.85.135 gw $VPNGW route add -host 184.87.1.249 gw $VPNGW route add -host 184.87.12.79 gw $VPNGW route add -host 188.165.218.147 gw $VPNGW route add -host 188.190.97.231 gw $VPNGW route add -host 188.241.112.92 gw $VPNGW route add -host 188.40.16.220 gw $VPNGW route add -host 188.40.179.86 gw $VPNGW route add -host 190.93.240.19 gw $VPNGW route add -host 190.93.241.19 gw $VPNGW route add -host 190.93.242.99 gw $VPNGW route add -host 190.93.243.99 gw $VPNGW route add -host 192.110.163.13 gw $VPNGW route add -host 192.121.86.163 gw $VPNGW route add -host 192.155.90.203 gw $VPNGW route add -host 192.168.1.1 gw $VPNGW route add -host 192.210.63.172 gw $VPNGW route add -host 192.81.128.65 gw $VPNGW route add -host 193.111.95.72 gw $VPNGW route add -host 194.55.26.46 gw $VPNGW route add -host 194.55.30.46 gw $VPNGW route add -host 194.71.107.50 gw $VPNGW route add -host 194.9.94.79 gw $VPNGW route add -host 194.90.190.55 gw $VPNGW route add -host 195.14.0.137 gw $VPNGW route add -host 195.189.143.107 gw $VPNGW route add -host 195.191.164.13 gw $VPNGW route add -host 195.234.175.160 gw $VPNGW route add -host 195.242.152.250 gw $VPNGW route add -host 198.1.105.52 gw $VPNGW route add -host 198.105.209.237 gw $VPNGW route add -host 198.144.99.188 gw $VPNGW route add -host 198.20.70.218 gw $VPNGW route add -host 198.23.129.56 gw $VPNGW route add -host 198.244.51.13 gw $VPNGW route add -host 198.61.201.42 gw $VPNGW route add -host 198.65.239.132 gw $VPNGW route add -host 199.119.201.156 gw $VPNGW route add -host 199.127.180.2 gw $VPNGW route add -host 199.15.252.221 gw $VPNGW route add -host 199.167.201.159 gw $VPNGW route add -host 199.175.49.70 gw $VPNGW route add -host 199.187.121.51 gw $VPNGW route add -host 199.27.73.131 gw $VPNGW route add -host 199.34.228.100 gw $VPNGW route add -host 199.58.84.76 gw $VPNGW route add -host 199.58.86.133 gw $VPNGW route add -host 199.59.161.102 gw $VPNGW route add -host 199.59.163.213 gw $VPNGW route add -host 199.83.93.62 gw $VPNGW route add -host 202.123.82.23 gw $VPNGW route add -host 202.145.199.35 gw $VPNGW route add -host 202.153.205.176 gw $VPNGW route add -host 202.167.238.189 gw $VPNGW route add -host 202.172.25.33 gw $VPNGW route add -host 202.172.28.100 gw $VPNGW route add -host 202.181.167.115 gw $VPNGW route add -host 202.181.195.252 gw $VPNGW route add -host 202.181.207.207 gw $VPNGW route add -host 202.181.238.98 gw $VPNGW route add -host 202.190.173.52 gw $VPNGW route add -host 202.190.186.43 gw $VPNGW route add -host 202.214.8.82 gw $VPNGW route add -host 202.215.175.240 gw $VPNGW route add -host 202.218.113.54 gw $VPNGW route add -host 202.218.250.72 gw $VPNGW route add -host 202.248.110.140 gw $VPNGW route add -host 202.27.28.10 gw $VPNGW route add -host 202.39.176.53 gw $VPNGW route add -host 202.55.227.29 gw $VPNGW route add -host 202.55.234.106 gw $VPNGW route add -host 202.66.130.29 gw $VPNGW route add -host 202.67.226.114 gw $VPNGW route add -host 202.71.100.186 gw $VPNGW route add -host 202.81.252.243 gw $VPNGW route add -host 202.82.219.241 gw $VPNGW route add -host 203.105.2.20 gw $VPNGW route add -host 203.131.229.102 gw $VPNGW route add -host 203.137.0.166 gw $VPNGW route add -host 203.141.139.184 gw $VPNGW route add -host 203.171.229.98 gw $VPNGW route add -host 203.174.49.104 gw $VPNGW route add -host 203.209.156.119 gw $VPNGW route add -host 203.27.227.220 gw $VPNGW route add -host 203.62.135.1 gw $VPNGW route add -host 203.69.33.151 gw $VPNGW route add -host 203.69.37.172 gw $VPNGW route add -host 203.75.155.153 gw $VPNGW route add -host 203.90.230.221 gw $VPNGW route add -host 204.1.152.83 gw $VPNGW route add -host 204.107.28.181 gw $VPNGW route add -host 204.12.211.132 gw $VPNGW route add -host 204.145.120.172 gw $VPNGW route add -host 204.152.254.121 gw $VPNGW route add -host 204.152.255.35 gw $VPNGW route add -host 204.179.240.180 gw $VPNGW route add -host 204.197.242.129 gw $VPNGW route add -host 204.232.175.78 gw $VPNGW route add -host 204.236.239.5 gw $VPNGW route add -host 204.246.162.230 gw $VPNGW route add -host 204.69.221.10 gw $VPNGW route add -host 204.74.216.174 gw $VPNGW route add -host 204.9.177.195 gw $VPNGW route add -host 205.164.24.45 gw $VPNGW route add -host 205.178.152.24 gw $VPNGW route add -host 205.186.152.122 gw $VPNGW route add -host 205.186.175.157 gw $VPNGW route add -host 205.188.100.58 gw $VPNGW route add -host 205.188.101.58 gw $VPNGW route add -host 205.196.221.62 gw $VPNGW route add -host 205.209.175.94 gw $VPNGW route add -host 206.108.49.19 gw $VPNGW route add -host 206.125.164.82 gw $VPNGW route add -host 206.125.171.170 gw $VPNGW route add -host 206.190.37.187 gw $VPNGW route add -host 206.46.232.39 gw $VPNGW route add -host 207.192.72.226 gw $VPNGW route add -host 207.198.101.122 gw $VPNGW route add -host 207.200.74.38 gw $VPNGW route add -host 208.100.23.180 gw $VPNGW route add -host 208.101.9.144 gw $VPNGW route add -host 208.109.181.211 gw $VPNGW route add -host 208.113.152.221 gw $VPNGW route add -host 208.113.199.138 gw $VPNGW route add -host 208.113.201.160 gw $VPNGW route add -host 208.131.25.34 gw $VPNGW route add -host 208.167.225.104 gw $VPNGW route add -host 208.43.237.140 gw $VPNGW route add -host 208.51.62.2 gw $VPNGW route add -host 208.69.4.141 gw $VPNGW route add -host 208.73.211.208 gw $VPNGW route add -host 208.75.184.192 gw $VPNGW route add -host 208.79.34.5 gw $VPNGW route add -host 208.80.56.11 gw $VPNGW route add -host 208.81.164.153 gw $VPNGW route add -host 208.82.16.68 gw $VPNGW route add -host 208.86.184.80 gw $VPNGW route add -host 208.87.35.103 gw $VPNGW route add -host 208.88.182.181 gw $VPNGW route add -host 208.91.197.132 gw $VPNGW route add -host 208.92.218.173 gw $VPNGW route add -host 208.94.1.8 gw $VPNGW route add -host 208.94.2.7 gw $VPNGW route add -host 208.94.244.98 gw $VPNGW route add -host 208.95.172.130 gw $VPNGW route add -host 208.97.189.209 gw $VPNGW route add -host 208.99.72.37 gw $VPNGW route add -host 209.116.59.227 gw $VPNGW route add -host 209.141.47.86 gw $VPNGW route add -host 209.15.13.134 gw $VPNGW route add -host 209.160.20.56 gw $VPNGW route add -host 209.17.68.216 gw $VPNGW route add -host 209.191.83.66 gw $VPNGW route add -host 209.197.73.62 gw $VPNGW route add -host 209.20.95.202 gw $VPNGW route add -host 209.200.244.207 gw $VPNGW route add -host 209.222.1.145 gw $VPNGW route add -host 209.222.2.149 gw $VPNGW route add -host 209.237.150.20 gw $VPNGW route add -host 209.246.126.162 gw $VPNGW route add -host 209.25.137.150 gw $VPNGW route add -host 209.54.49.240 gw $VPNGW route add -host 209.62.122.165 gw $VPNGW route add -host 209.62.69.106 gw $VPNGW route add -host 209.84.24.126 gw $VPNGW route add -host 209.85.171.121 gw $VPNGW route add -host 210.0.141.99 gw $VPNGW route add -host 210.155.3.54 gw $VPNGW route add -host 210.17.215.63 gw $VPNGW route add -host 210.17.235.241 gw $VPNGW route add -host 210.17.252.133 gw $VPNGW route add -host 210.200.133.135 gw $VPNGW route add -host 210.202.41.248 gw $VPNGW route add -host 210.242.195.60 gw $VPNGW route add -host 210.242.70.146 gw $VPNGW route add -host 210.59.244.7 gw $VPNGW route add -host 210.69.23.212 gw $VPNGW route add -host 210.69.90.1 gw $VPNGW route add -host 211.233.75.83 gw $VPNGW route add -host 211.72.203.61 gw $VPNGW route add -host 211.72.96.25 gw $VPNGW route add -host 211.75.131.205 gw $VPNGW route add -host 212.1.214.60 gw $VPNGW route add -host 212.118.245.201 gw $VPNGW route add -host 212.27.48.10 gw $VPNGW route add -host 212.44.108.73 gw $VPNGW route add -host 212.58.241.131 gw $VPNGW route add -host 212.58.246.95 gw $VPNGW route add -host 212.58.251.195 gw $VPNGW route add -host 212.58.253.67 gw $VPNGW route add -host 212.64.146.224 gw $VPNGW route add -host 212.7.192.139 gw $VPNGW route add -host 212.7.193.163 gw $VPNGW route add -host 213.108.105.38 gw $VPNGW route add -host 213.139.108.166 gw $VPNGW route add -host 213.186.33.2 gw $VPNGW route add -host 213.239.206.103 gw $VPNGW route add -host 213.83.51.94 gw $VPNGW route add -host 216.108.229.6 gw $VPNGW route add -host 216.12.198.251 gw $VPNGW route add -host 216.131.83.58 gw $VPNGW route add -host 216.139.208.243 gw $VPNGW route add -host 216.139.245.46 gw $VPNGW route add -host 216.139.249.222 gw $VPNGW route add -host 216.15.252.72 gw $VPNGW route add -host 216.155.144.20 gw $VPNGW route add -host 216.157.85.105 gw $VPNGW route add -host 216.172.154.34 gw $VPNGW route add -host 216.172.180.59 gw $VPNGW route add -host 216.172.184.211 gw $VPNGW route add -host 216.172.189.146 gw $VPNGW route add -host 216.178.47.11 gw $VPNGW route add -host 216.18.205.213 gw $VPNGW route add -host 216.18.22.50 gw $VPNGW route add -host 216.21.239.197 gw $VPNGW route add -host 216.224.185.189 gw $VPNGW route add -host 216.230.250.151 gw $VPNGW route add -host 216.239.120.160 gw $VPNGW route add -host 216.239.138.60 gw $VPNGW route add -host 216.239.32.21 gw $VPNGW route add -host 216.239.34.21 gw $VPNGW route add -host 216.239.36.21 gw $VPNGW route add -host 216.239.38.21 gw $VPNGW route add -host 216.240.187.140 gw $VPNGW route add -host 216.35.74.104 gw $VPNGW route add -host 216.40.204.139 gw $VPNGW route add -host 216.45.50.42 gw $VPNGW route add -host 216.55.175.205 gw $VPNGW route add -host 216.67.225.90 gw $VPNGW route add -host 216.69.227.70 gw $VPNGW route add -host 216.74.34.10 gw $VPNGW route add -host 216.75.233.248 gw $VPNGW route add -host 216.92.168.131 gw $VPNGW route add -host 216.97.88.9 gw $VPNGW route add -host 217.118.169.226 gw $VPNGW route add -host 217.160.115.96 gw $VPNGW route add -host 217.70.184.38 gw $VPNGW route add -host 218.188.30.99 gw $VPNGW route add -host 218.211.37.253 gw $VPNGW route add -host 218.213.85.33 gw $VPNGW route add -host 218.213.98.181 gw $VPNGW route add -host 218.240.40.222 gw $VPNGW route add -host 218.48.157.142 gw $VPNGW route add -host 219.85.64.200 gw $VPNGW route add -host 219.85.68.33 gw $VPNGW route add -host 219.87.83.8 gw $VPNGW route add -host 219.94.182.150 gw $VPNGW route add -host 219.94.192.102 gw $VPNGW route add -host 220.128.150.146 gw $VPNGW route add -host 220.181.136.233 gw $VPNGW route add -host 220.216.107.66 gw $VPNGW route add -host 220.228.175.97 gw $VPNGW route add -host 220.232.227.228 gw $VPNGW route add -host 220.232.251.174 gw $VPNGW route add -host 222.122.118.36 gw $VPNGW route add -host 222.239.226.97 gw $VPNGW route add -host 23.0.37.50 gw $VPNGW route add -host 23.21.158.252 gw $VPNGW route add -host 23.21.241.131 gw $VPNGW route add -host 23.21.41.90 gw $VPNGW route add -host 23.23.133.251 gw $VPNGW route add -host 23.23.192.105 gw $VPNGW route add -host 23.23.252.223 gw $VPNGW route add -host 23.23.56.189 gw $VPNGW route add -host 23.23.84.136 gw $VPNGW route add -host 23.23.89.103 gw $VPNGW route add -host 23.23.90.136 gw $VPNGW route add -host 23.8.17.162 gw $VPNGW route add -host 23.8.19.153 gw $VPNGW route add -host 24.173.168.101 gw $VPNGW route add -host 27.124.116.225 gw $VPNGW route add -host 31.131.20.107 gw $VPNGW route add -host 31.186.3.99 gw $VPNGW route add -host 31.192.112.104 gw $VPNGW route add -host 31.192.116.24 gw $VPNGW route add -host 31.192.117.132 gw $VPNGW route add -host 37.208.111.121 gw $VPNGW route add -host 37.235.49.16 gw $VPNGW route add -host 38.103.23.89 gw $VPNGW route add -host 38.117.78.21 gw $VPNGW route add -host 38.118.195.244 gw $VPNGW route add -host 38.127.224.164 gw $VPNGW route add -host 38.99.106.19 gw $VPNGW route add -host 4.53.82.215 gw $VPNGW route add -host 42.121.98.156 gw $VPNGW route add -host 46.105.190.218 gw $VPNGW route add -host 46.105.242.149 gw $VPNGW route add -host 46.163.85.198 gw $VPNGW route add -host 46.165.210.145 gw $VPNGW route add -host 46.229.161.228 gw $VPNGW route add -host 46.4.95.26 gw $VPNGW route add -host 46.51.243.56 gw $VPNGW route add -host 49.212.20.140 gw $VPNGW route add -host 49.212.71.38 gw $VPNGW route add -host 49.212.9.175 gw $VPNGW route add -host 49.213.1.89 gw $VPNGW route add -host 5.226.176.11 gw $VPNGW route add -host 5.226.178.10 gw $VPNGW route add -host 5.34.241.230 gw $VPNGW route add -host 5.9.126.141 gw $VPNGW route add -host 5.9.135.157 gw $VPNGW route add -host 50.112.108.30 gw $VPNGW route add -host 50.112.119.247 gw $VPNGW route add -host 50.112.138.148 gw $VPNGW route add -host 50.112.143.8 gw $VPNGW route add -host 50.116.113.92 gw $VPNGW route add -host 50.116.20.29 gw $VPNGW route add -host 50.116.4.235 gw $VPNGW route add -host 50.116.60.56 gw $VPNGW route add -host 50.116.85.107 gw $VPNGW route add -host 50.117.116.204 gw $VPNGW route add -host 50.16.102.253 gw $VPNGW route add -host 50.16.185.16 gw $VPNGW route add -host 50.16.193.31 gw $VPNGW route add -host 50.16.233.102 gw $VPNGW route add -host 50.18.105.129 gw $VPNGW route add -host 50.19.122.222 gw $VPNGW route add -host 50.19.247.208 gw $VPNGW route add -host 50.19.82.94 gw $VPNGW route add -host 50.19.93.35 gw $VPNGW route add -host 50.22.112.32 gw $VPNGW route add -host 50.22.174.50 gw $VPNGW route add -host 50.22.218.180 gw $VPNGW route add -host 50.22.91.46 gw $VPNGW route add -host 50.23.120.99 gw $VPNGW route add -host 50.23.146.178 gw $VPNGW route add -host 50.23.85.172 gw $VPNGW route add -host 50.28.69.147 gw $VPNGW route add -host 50.28.86.184 gw $VPNGW route add -host 50.31.83.77 gw $VPNGW route add -host 50.56.152.232 gw $VPNGW route add -host 50.57.202.71 gw $VPNGW route add -host 50.57.205.237 gw $VPNGW route add -host 50.63.121.1 gw $VPNGW route add -host 50.63.220.1 gw $VPNGW route add -host 50.63.44.1 gw $VPNGW route add -host 50.63.59.173 gw $VPNGW route add -host 50.63.67.229 gw $VPNGW route add -host 50.63.91.1 gw $VPNGW route add -host 50.63.98.1 gw $VPNGW route add -host 50.7.30.242 gw $VPNGW route add -host 50.7.31.226 gw $VPNGW route add -host 50.87.181.206 gw $VPNGW route add -host 50.93.194.9 gw $VPNGW route add -host 50.97.230.236 gw $VPNGW route add -host 50.97.231.108 gw $VPNGW route add -host 54.235.188.56 gw $VPNGW route add -host 54.235.205.92 gw $VPNGW route add -host 54.236.70.108 gw $VPNGW route add -host 54.243.161.147 gw $VPNGW route add -host 54.243.232.228 gw $VPNGW route add -host 54.243.252.10 gw $VPNGW route add -host 54.248.143.107 gw $VPNGW route add -host 54.248.33.195 gw $VPNGW route add -host 54.248.39.145 gw $VPNGW route add -host 54.248.82.230 gw $VPNGW route add -host 54.252.30.135 gw $VPNGW route add -host 54.252.86.225 gw $VPNGW route add -host 58.176.49.146 gw $VPNGW route add -host 58.64.139.25 gw $VPNGW route add -host 58.64.176.204 gw $VPNGW route add -host 58.68.255.34 gw $VPNGW route add -host 59.105.179.175 gw $VPNGW route add -host 59.106.167.73 gw $VPNGW route add -host 59.106.87.155 gw $VPNGW route add -host 59.120.18.8 gw $VPNGW route add -host 59.124.62.237 gw $VPNGW route add -host 59.188.14.180 gw $VPNGW route add -host 59.188.16.248 gw $VPNGW route add -host 59.188.24.8 gw $VPNGW route add -host 59.190.139.168 gw $VPNGW route add -host 60.199.178.101 gw $VPNGW route add -host 60.199.201.119 gw $VPNGW route add -host 60.199.223.194 gw $VPNGW route add -host 60.199.244.6 gw $VPNGW route add -host 60.199.249.6 gw $VPNGW route add -host 60.244.109.99 gw $VPNGW route add -host 60.248.100.104 gw $VPNGW route add -host 60.250.9.219 gw $VPNGW route add -host 60.251.100.130 gw $VPNGW route add -host 60.51.221.70 gw $VPNGW route add -host 61.111.250.219 gw $VPNGW route add -host 61.115.234.56 gw $VPNGW route add -host 61.147.67.181 gw $VPNGW route add -host 61.152.104.212 gw $VPNGW route add -host 61.219.35.230 gw $VPNGW route add -host 61.219.96.84 gw $VPNGW route add -host 61.220.180.66 gw $VPNGW route add -host 61.238.158.50 gw $VPNGW route add -host 61.239.33.213 gw $VPNGW route add -host 61.31.193.65 gw $VPNGW route add -host 61.63.25.209 gw $VPNGW route add -host 61.63.27.33 gw $VPNGW route add -host 61.63.34.194 gw $VPNGW route add -host 61.63.52.100 gw $VPNGW route add -host 61.63.73.81 gw $VPNGW route add -host 62.212.83.1 gw $VPNGW route add -host 62.219.11.10 gw $VPNGW route add -host 63.135.90.224 gw $VPNGW route add -host 63.217.89.66 gw $VPNGW route add -host 63.226.5.2 gw $VPNGW route add -host 63.247.137.26 gw $VPNGW route add -host 64.111.126.0 gw $VPNGW route add -host 64.12.79.57 gw $VPNGW route add -host 64.12.89.186 gw $VPNGW route add -host 64.120.176.194 gw $VPNGW route add -host 64.14.48.143 gw $VPNGW route add -host 64.145.94.19 gw $VPNGW route add -host 64.147.115.80 gw $VPNGW route add -host 64.150.183.194 gw $VPNGW route add -host 64.151.91.178 gw $VPNGW route add -host 64.202.189.170 gw $VPNGW route add -host 64.210.140.16 gw $VPNGW route add -host 64.224.10.166 gw $VPNGW route add -host 64.229.176.82 gw $VPNGW route add -host 64.237.53.214 gw $VPNGW route add -host 64.26.27.113 gw $VPNGW route add -host 64.34.174.11 gw $VPNGW route add -host 64.50.180.60 gw $VPNGW route add -host 64.62.140.100 gw $VPNGW route add -host 64.62.174.152 gw $VPNGW route add -host 64.71.168.162 gw $VPNGW route add -host 64.71.33.150 gw $VPNGW route add -host 64.71.34.21 gw $VPNGW route add -host 64.78.163.162 gw $VPNGW route add -host 64.78.167.62 gw $VPNGW route add -host 64.85.160.208 gw $VPNGW route add -host 64.88.249.35 gw $VPNGW route add -host 64.88.254.216 gw $VPNGW route add -host 64.93.76.17 gw $VPNGW route add -host 65.182.101.84 gw $VPNGW route add -host 65.254.231.126 gw $VPNGW route add -host 65.254.248.219 gw $VPNGW route add -host 65.254.250.109 gw $VPNGW route add -host 65.39.205.54 gw $VPNGW route add -host 65.60.52.107 gw $VPNGW route add -host 66.115.130.53 gw $VPNGW route add -host 66.147.240.159 gw $VPNGW route add -host 66.151.111.150 gw $VPNGW route add -host 66.160.183.121 gw $VPNGW route add -host 66.175.223.124 gw $VPNGW route add -host 66.175.58.9 gw $VPNGW route add -host 66.180.175.246 gw $VPNGW route add -host 66.212.30.253 gw $VPNGW route add -host 66.215.3.167 gw $VPNGW route add -host 66.218.87.80 gw $VPNGW route add -host 66.220.12.208 gw $VPNGW route add -host 66.220.152.19 gw $VPNGW route add -host 66.226.82.194 gw $VPNGW route add -host 66.230.193.63 gw $VPNGW route add -host 66.232.115.130 gw $VPNGW route add -host 66.244.151.60 gw $VPNGW route add -host 66.252.2.46 gw $VPNGW route add -host 66.254.104.55 gw $VPNGW route add -host 66.254.109.120 gw $VPNGW route add -host 66.28.60.100 gw $VPNGW route add -host 66.33.200.220 gw $VPNGW route add -host 66.39.5.40 gw $VPNGW route add -host 66.54.66.154 gw $VPNGW route add -host 66.6.21.25 gw $VPNGW route add -host 66.6.44.4 gw $VPNGW route add -host 66.7.221.78 gw $VPNGW route add -host 66.96.133.14 gw $VPNGW route add -host 66.96.147.105 gw $VPNGW route add -host 66.96.163.134 gw $VPNGW route add -host 67.18.91.26 gw $VPNGW route add -host 67.192.97.104 gw $VPNGW route add -host 67.195.61.65 gw $VPNGW route add -host 67.20.55.15 gw $VPNGW route add -host 67.201.54.41 gw $VPNGW route add -host 67.202.41.251 gw $VPNGW route add -host 67.205.29.250 gw $VPNGW route add -host 67.205.3.59 gw $VPNGW route add -host 67.205.56.172 gw $VPNGW route add -host 67.205.93.146 gw $VPNGW route add -host 67.213.218.16 gw $VPNGW route add -host 67.220.50.32 gw $VPNGW route add -host 67.221.180.135 gw $VPNGW route add -host 67.227.136.136 gw $VPNGW route add -host 67.227.181.208 gw $VPNGW route add -host 67.228.102.72 gw $VPNGW route add -host 67.228.116.150 gw $VPNGW route add -host 67.228.120.147 gw $VPNGW route add -host 67.228.223.11 gw $VPNGW route add -host 67.228.224.19 gw $VPNGW route add -host 67.228.226.225 gw $VPNGW route add -host 67.228.247.187 gw $VPNGW route add -host 67.228.7.2 gw $VPNGW route add -host 67.228.87.82 gw $VPNGW route add -host 67.23.1.237 gw $VPNGW route add -host 67.23.36.223 gw $VPNGW route add -host 68.169.65.142 gw $VPNGW route add -host 68.180.206.184 gw $VPNGW route add -host 68.233.241.196 gw $VPNGW route add -host 68.67.61.247 gw $VPNGW route add -host 68.71.38.118 gw $VPNGW route add -host 68.71.52.214 gw $VPNGW route add -host 69.10.32.156 gw $VPNGW route add -host 69.10.35.192 gw $VPNGW route add -host 69.147.246.154 gw $VPNGW route add -host 69.161.144.104 gw $VPNGW route add -host 69.162.78.10 gw $VPNGW route add -host 69.163.154.207 gw $VPNGW route add -host 69.163.171.42 gw $VPNGW route add -host 69.163.176.62 gw $VPNGW route add -host 69.163.178.255 gw $VPNGW route add -host 69.163.192.7 gw $VPNGW route add -host 69.163.204.186 gw $VPNGW route add -host 69.163.205.225 gw $VPNGW route add -host 69.163.208.63 gw $VPNGW route add -host 69.163.221.87 gw $VPNGW route add -host 69.163.223.11 gw $VPNGW route add -host 69.163.224.254 gw $VPNGW route add -host 69.163.232.239 gw $VPNGW route add -host 69.163.242.152 gw $VPNGW route add -host 69.163.249.178 gw $VPNGW route add -host 69.171.233.18 gw $VPNGW route add -host 69.172.200.91 gw $VPNGW route add -host 69.181.52.124 gw $VPNGW route add -host 69.191.215.14 gw $VPNGW route add -host 69.191.242.22 gw $VPNGW route add -host 69.191.252.14 gw $VPNGW route add -host 69.197.153.220 gw $VPNGW route add -host 69.197.183.149 gw $VPNGW route add -host 69.20.11.136 gw $VPNGW route add -host 69.25.102.7 gw $VPNGW route add -host 69.25.27.173 gw $VPNGW route add -host 69.26.170.8 gw $VPNGW route add -host 69.28.65.65 gw $VPNGW route add -host 69.31.136.5 gw $VPNGW route add -host 69.36.241.244 gw $VPNGW route add -host 69.44.181.242 gw $VPNGW route add -host 69.46.91.229 gw $VPNGW route add -host 69.56.174.148 gw $VPNGW route add -host 69.56.187.226 gw $VPNGW route add -host 69.59.151.152 gw $VPNGW route add -host 69.60.2.210 gw $VPNGW route add -host 69.65.24.114 gw $VPNGW route add -host 69.65.41.15 gw $VPNGW route add -host 69.65.42.159 gw $VPNGW route add -host 69.65.60.129 gw $VPNGW route add -host 69.72.177.140 gw $VPNGW route add -host 69.73.138.107 gw $VPNGW route add -host 69.89.29.106 gw $VPNGW route add -host 69.89.31.221 gw $VPNGW route add -host 69.93.115.144 gw $VPNGW route add -host 70.32.107.173 gw $VPNGW route add -host 70.32.34.86 gw $VPNGW route add -host 70.32.76.212 gw $VPNGW route add -host 70.32.81.66 gw $VPNGW route add -host 70.32.96.58 gw $VPNGW route add -host 70.37.162.207 gw $VPNGW route add -host 70.39.99.89 gw $VPNGW route add -host 70.42.185.10 gw $VPNGW route add -host 70.85.48.246 gw $VPNGW route add -host 70.86.20.29 gw $VPNGW route add -host 70.87.59.134 gw $VPNGW route add -host 70.99.192.168 gw $VPNGW route add -host 71.18.18.68 gw $VPNGW route add -host 71.19.241.65 gw $VPNGW route add -host 71.245.120.18 gw $VPNGW route add -host 72.13.82.90 gw $VPNGW route add -host 72.14.203.121 gw $VPNGW route add -host 72.167.183.56 gw $VPNGW route add -host 72.167.232.85 gw $VPNGW route add -host 72.167.84.237 gw $VPNGW route add -host 72.172.88.49 gw $VPNGW route add -host 72.20.18.52 gw $VPNGW route add -host 72.21.91.19 gw $VPNGW route add -host 72.21.92.20 gw $VPNGW route add -host 72.232.112.73 gw $VPNGW route add -host 72.232.114.5 gw $VPNGW route add -host 72.232.160.83 gw $VPNGW route add -host 72.233.127.217 gw $VPNGW route add -host 72.233.2.58 gw $VPNGW route add -host 72.233.69.6 gw $VPNGW route add -host 72.249.109.102 gw $VPNGW route add -host 72.249.186.50 gw $VPNGW route add -host 72.26.228.26 gw $VPNGW route add -host 72.29.65.136 gw $VPNGW route add -host 72.29.95.244 gw $VPNGW route add -host 72.3.220.6 gw $VPNGW route add -host 72.32.196.156 gw $VPNGW route add -host 72.32.231.8 gw $VPNGW route add -host 72.44.63.18 gw $VPNGW route add -host 72.47.224.117 gw $VPNGW route add -host 72.51.25.40 gw $VPNGW route add -host 72.52.77.3 gw $VPNGW route add -host 72.8.129.76 gw $VPNGW route add -host 72.8.150.2 gw $VPNGW route add -host 72.9.144.165 gw $VPNGW route add -host 72.9.158.227 gw $VPNGW route add -host 74.112.130.78 gw $VPNGW route add -host 74.116.248.251 gw $VPNGW route add -host 74.117.221.72 gw $VPNGW route add -host 74.120.180.22 gw $VPNGW route add -host 74.120.182.22 gw $VPNGW route add -host 74.121.196.42 gw $VPNGW route add -host 74.124.197.201 gw $VPNGW route add -host 74.124.208.14 gw $VPNGW route add -host 74.125.127.100 gw $VPNGW route add -host 74.125.128.121 gw $VPNGW route add -host 74.125.45.100 gw $VPNGW route add -host 74.125.53.121 gw $VPNGW route add -host 74.125.67.100 gw $VPNGW route add -host 74.125.71.121 gw $VPNGW route add -host 74.200.220.215 gw $VPNGW route add -host 74.201.86.21 gw $VPNGW route add -host 74.208.10.7 gw $VPNGW route add -host 74.208.161.24 gw $VPNGW route add -host 74.208.163.140 gw $VPNGW route add -host 74.208.17.142 gw $VPNGW route add -host 74.208.186.70 gw $VPNGW route add -host 74.208.22.197 gw $VPNGW route add -host 74.208.31.254 gw $VPNGW route add -host 74.208.36.253 gw $VPNGW route add -host 74.208.62.234 gw $VPNGW route add -host 74.220.202.45 gw $VPNGW route add -host 74.220.221.34 gw $VPNGW route add -host 74.3.235.18 gw $VPNGW route add -host 74.50.3.52 gw $VPNGW route add -host 74.52.179.82 gw $VPNGW route add -host 74.52.63.28 gw $VPNGW route add -host 74.54.30.85 gw $VPNGW route add -host 74.55.98.186 gw $VPNGW route add -host 74.63.80.66 gw $VPNGW route add -host 74.82.173.199 gw $VPNGW route add -host 74.86.142.3 gw $VPNGW route add -host 75.101.145.87 gw $VPNGW route add -host 75.101.163.44 gw $VPNGW route add -host 75.119.196.136 gw $VPNGW route add -host 75.119.202.194 gw $VPNGW route add -host 75.119.205.36 gw $VPNGW route add -host 75.119.207.79 gw $VPNGW route add -host 75.125.11.11 gw $VPNGW route add -host 75.125.244.150 gw $VPNGW route add -host 75.125.252.77 gw $VPNGW route add -host 75.126.101.243 gw $VPNGW route add -host 75.126.17.46 gw $VPNGW route add -host 75.126.178.177 gw $VPNGW route add -host 75.126.182.36 gw $VPNGW route add -host 75.126.199.99 gw $VPNGW route add -host 75.98.17.24 gw $VPNGW route add -host 76.12.10.110 gw $VPNGW route add -host 76.73.36.165 gw $VPNGW route add -host 76.73.40.250 gw $VPNGW route add -host 76.73.45.186 gw $VPNGW route add -host 76.73.67.28 gw $VPNGW route add -host 76.74.248.252 gw $VPNGW route add -host 77.238.178.122 gw $VPNGW route add -host 77.247.178.32 gw $VPNGW route add -host 77.247.179.176 gw $VPNGW route add -host 77.87.181.63 gw $VPNGW route add -host 78.140.150.140 gw $VPNGW route add -host 78.47.142.183 gw $VPNGW route add -host 79.125.7.219 gw $VPNGW route add -host 79.143.186.171 gw $VPNGW route add -host 79.175.164.233 gw $VPNGW route add -host 8.18.200.7 gw $VPNGW route add -host 8.23.224.108 gw $VPNGW route add -host 8.254.60.254 gw $VPNGW route add -host 8.254.63.254 gw $VPNGW route add -host 8.26.218.126 gw $VPNGW route add -host 80.179.147.202 gw $VPNGW route add -host 80.94.76.5 gw $VPNGW route add -host 81.169.149.84 gw $VPNGW route add -host 82.129.24.69 gw $VPNGW route add -host 82.147.11.31 gw $VPNGW route add -host 82.195.75.101 gw $VPNGW route add -host 83.138.187.34 gw $VPNGW route add -host 83.169.41.77 gw $VPNGW route add -host 83.222.126.242 gw $VPNGW route add -host 83.223.73.52 gw $VPNGW route add -host 84.16.80.73 gw $VPNGW route add -host 84.16.92.183 gw $VPNGW route add -host 84.45.13.39 gw $VPNGW route add -host 84.45.63.21 gw $VPNGW route add -host 85.10.213.97 gw $VPNGW route add -host 85.17.153.54 gw $VPNGW route add -host 85.17.25.118 gw $VPNGW route add -host 85.17.27.208 gw $VPNGW route add -host 85.17.73.226 gw $VPNGW route add -host 85.17.84.98 gw $VPNGW route add -host 85.214.105.129 gw $VPNGW route add -host 85.214.130.224 gw $VPNGW route add -host 85.214.153.59 gw $VPNGW route add -host 85.214.18.161 gw $VPNGW route add -host 85.214.21.187 gw $VPNGW route add -host 85.214.47.70 gw $VPNGW route add -host 85.233.202.178 gw $VPNGW route add -host 85.30.129.177 gw $VPNGW route add -host 86.59.30.40 gw $VPNGW route add -host 87.106.116.167 gw $VPNGW route add -host 87.106.148.28 gw $VPNGW route add -host 87.248.120.148 gw $VPNGW route add -host 87.255.36.131 gw $VPNGW route add -host 87.98.250.193 gw $VPNGW route add -host 88.198.35.74 gw $VPNGW route add -host 88.86.118.186 gw $VPNGW route add -host 89.151.99.84 gw $VPNGW route add -host 89.187.143.69 gw $VPNGW route add -host 89.238.130.247 gw $VPNGW route add -host 89.250.176.209 gw $VPNGW route add -host 89.45.197.238 gw $VPNGW route add -host 91.102.100.16 gw $VPNGW route add -host 91.121.133.57 gw $VPNGW route add -host 91.121.145.34 gw $VPNGW route add -host 91.121.160.169 gw $VPNGW route add -host 91.121.182.159 gw $VPNGW route add -host 91.121.27.37 gw $VPNGW route add -host 91.196.127.59 gw $VPNGW route add -host 91.207.59.161 gw $VPNGW route add -host 91.227.221.115 gw $VPNGW route add -host 91.228.153.161 gw $VPNGW route add -host 91.250.81.8 gw $VPNGW route add -host 93.184.216.229 gw $VPNGW route add -host 93.46.8.89 gw $VPNGW route add -host 93.95.227.222 gw $VPNGW route add -host 94.102.63.244 gw $VPNGW route add -host 94.136.55.26 gw $VPNGW route add -host 94.185.82.42 gw $VPNGW route add -host 94.198.114.135 gw $VPNGW route add -host 94.76.205.195 gw $VPNGW route add -host 94.76.239.85 gw $VPNGW route add -host 95.174.9.211 gw $VPNGW route add -host 95.211.143.200 gw $VPNGW route add -host 95.211.200.37 gw $VPNGW route add -host 95.211.80.51 gw $VPNGW route add -host 95.211.99.37 gw $VPNGW route add -host 96.125.162.11 gw $VPNGW route add -host 96.126.119.119 gw $VPNGW route add -host 96.127.180.202 gw $VPNGW route add -host 96.30.24.127 gw $VPNGW route add -host 96.31.35.82 gw $VPNGW route add -host 96.44.129.122 gw $VPNGW route add -host 96.44.155.216 gw $VPNGW route add -host 96.44.184.110 gw $VPNGW route add -host 96.44.185.116 gw $VPNGW route add -host 96.46.7.187 gw $VPNGW route add -host 97.107.131.29 gw $VPNGW route add -host 97.74.214.128 gw $VPNGW route add -host 97.74.215.37 gw $VPNGW route add -host 97.74.25.83 gw $VPNGW route add -host 97.74.26.128 gw $VPNGW route add -host 98.124.195.15 gw $VPNGW route add -host 98.124.198.1 gw $VPNGW route add -host 98.124.199.1 gw $VPNGW route add -host 98.129.174.16 gw $VPNGW route add -host 98.129.178.208 gw $VPNGW route add -host 98.130.128.34 gw $VPNGW route add -host 98.137.46.72 gw $VPNGW route add -host 98.139.102.145 gw $VPNGW route add -host 98.142.220.179 gw $VPNGW route add -host 98.143.152.26 gw $VPNGW route add -host 99.192.218.36 gw $VPNGW route add -host 99.231.89.35 gw $VPNGW route add -net 101.78.230.0/24 gw $VPNGW route add -net 103.23.108.0/24 gw $VPNGW route add -net 108.162.196.0/24 gw $VPNGW route add -net 108.162.197.0/24 gw $VPNGW route add -net 108.162.198.0/24 gw $VPNGW route add -net 108.162.199.0/24 gw $VPNGW route add -net 108.162.201.0/24 gw $VPNGW route add -net 108.162.202.0/24 gw $VPNGW route add -net 108.62.192.0/24 gw $VPNGW route add -net 110.45.152.0/24 gw $VPNGW route add -net 116.251.204.0/24 gw $VPNGW route add -net 118.142.53.0/24 gw $VPNGW route add -net 118.151.231.0/24 gw $VPNGW route add -net 123.242.230.0/24 gw $VPNGW route add -net 127.0.0.0/24 gw $VPNGW route add -net 128.241.116.0/24 gw $VPNGW route add -net 128.242.186.0/24 gw $VPNGW route add -net 137.227.232.0/24 gw $VPNGW route add -net 137.227.241.0/24 gw $VPNGW route add -net 137.227.252.0/24 gw $VPNGW route add -net 140.112.172.0/24 gw $VPNGW route add -net 141.101.112.0/24 gw $VPNGW route add -net 141.101.113.0/24 gw $VPNGW route add -net 141.101.116.0/24 gw $VPNGW route add -net 141.101.117.0/24 gw $VPNGW route add -net 141.101.121.0/24 gw $VPNGW route add -net 141.101.123.0/24 gw $VPNGW route add -net 141.8.224.0/24 gw $VPNGW route add -net 149.174.144.0/24 gw $VPNGW route add -net 149.174.149.0/24 gw $VPNGW route add -net 149.48.228.0/24 gw $VPNGW route add -net 154.35.160.0/24 gw $VPNGW route add -net 157.166.226.0/24 gw $VPNGW route add -net 157.166.248.0/24 gw $VPNGW route add -net 157.166.249.0/24 gw $VPNGW route add -net 157.166.255.0/24 gw $VPNGW route add -net 165.254.26.0/24 gw $VPNGW route add -net 173.193.137.0/24 gw $VPNGW route add -net 173.193.138.0/24 gw $VPNGW route add -net 173.194.79.0/24 gw $VPNGW route add -net 173.254.28.0/24 gw $VPNGW route add -net 174.120.113.0/24 gw $VPNGW route add -net 174.127.195.0/24 gw $VPNGW route add -net 174.37.172.0/24 gw $VPNGW route add -net 184.168.221.0/24 gw $VPNGW route add -net 184.173.182.0/24 gw $VPNGW route add -net 188.132.190.0/24 gw $VPNGW route add -net 188.65.120.0/24 gw $VPNGW route add -net 198.62.75.0/24 gw $VPNGW route add -net 199.27.74.0/24 gw $VPNGW route add -net 199.47.216.0/24 gw $VPNGW route add -net 199.47.217.0/24 gw $VPNGW route add -net 199.59.148.0/24 gw $VPNGW route add -net 199.59.149.0/24 gw $VPNGW route add -net 199.59.150.0/24 gw $VPNGW route add -net 199.59.243.0/24 gw $VPNGW route add -net 199.66.238.0/24 gw $VPNGW route add -net 199.80.55.0/24 gw $VPNGW route add -net 202.125.90.0/24 gw $VPNGW route add -net 202.130.82.0/24 gw $VPNGW route add -net 202.181.198.0/24 gw $VPNGW route add -net 202.39.235.0/24 gw $VPNGW route add -net 202.60.254.0/24 gw $VPNGW route add -net 202.67.247.0/24 gw $VPNGW route add -net 202.85.162.0/24 gw $VPNGW route add -net 203.175.165.0/24 gw $VPNGW route add -net 203.69.42.0/24 gw $VPNGW route add -net 203.69.66.0/24 gw $VPNGW route add -net 203.80.0.0/24 gw $VPNGW route add -net 203.85.62.0/24 gw $VPNGW route add -net 204.2.145.0/24 gw $VPNGW route add -net 204.74.212.0/24 gw $VPNGW route add -net 204.77.213.0/24 gw $VPNGW route add -net 204.93.63.0/24 gw $VPNGW route add -net 204.95.26.0/24 gw $VPNGW route add -net 205.185.204.0/24 gw $VPNGW route add -net 205.188.28.0/24 gw $VPNGW route add -net 205.188.87.0/24 gw $VPNGW route add -net 205.196.120.0/24 gw $VPNGW route add -net 206.108.51.0/24 gw $VPNGW route add -net 206.190.57.0/24 gw $VPNGW route add -net 207.152.124.0/24 gw $VPNGW route add -net 207.198.113.0/24 gw $VPNGW route add -net 208.109.138.0/24 gw $VPNGW route add -net 208.43.167.0/24 gw $VPNGW route add -net 208.43.60.0/24 gw $VPNGW route add -net 208.51.193.0/24 gw $VPNGW route add -net 208.69.40.0/24 gw $VPNGW route add -net 208.80.154.0/24 gw $VPNGW route add -net 208.80.184.0/24 gw $VPNGW route add -net 208.88.180.0/24 gw $VPNGW route add -net 208.94.0.0/24 gw $VPNGW route add -net 208.94.146.0/24 gw $VPNGW route add -net 208.94.241.0/24 gw $VPNGW route add -net 208.96.32.0/24 gw $VPNGW route add -net 209.107.220.0/24 gw $VPNGW route add -net 209.162.253.0/24 gw $VPNGW route add -net 210.242.17.0/24 gw $VPNGW route add -net 210.242.234.0/24 gw $VPNGW route add -net 210.243.166.0/24 gw $VPNGW route add -net 210.244.31.0/24 gw $VPNGW route add -net 210.59.228.0/24 gw $VPNGW route add -net 211.72.204.0/24 gw $VPNGW route add -net 211.72.248.0/24 gw $VPNGW route add -net 213.52.252.0/24 gw $VPNGW route add -net 216.115.110.0/24 gw $VPNGW route add -net 216.146.46.0/24 gw $VPNGW route add -net 216.155.135.0/24 gw $VPNGW route add -net 216.218.229.0/24 gw $VPNGW route add -net 216.24.199.0/24 gw $VPNGW route add -net 220.228.147.0/24 gw $VPNGW route add -net 222.239.76.0/24 gw $VPNGW route add -net 223.27.37.0/24 gw $VPNGW route add -net 23.0.160.0/24 gw $VPNGW route add -net 23.19.35.0/24 gw $VPNGW route add -net 23.19.81.0/24 gw $VPNGW route add -net 27.98.194.0/24 gw $VPNGW route add -net 31.222.72.0/24 gw $VPNGW route add -net 31.222.74.0/24 gw $VPNGW route add -net 38.101.236.0/24 gw $VPNGW route add -net 38.103.161.0/24 gw $VPNGW route add -net 38.110.30.0/24 gw $VPNGW route add -net 38.121.72.0/24 gw $VPNGW route add -net 38.229.72.0/24 gw $VPNGW route add -net 4.28.99.0/24 gw $VPNGW route add -net 50.16.215.0/24 gw $VPNGW route add -net 50.22.161.0/24 gw $VPNGW route add -net 50.23.200.0/24 gw $VPNGW route add -net 50.63.202.0/24 gw $VPNGW route add -net 54.243.89.0/24 gw $VPNGW route add -net 54.249.39.0/24 gw $VPNGW route add -net 58.68.168.0/24 gw $VPNGW route add -net 59.152.227.0/24 gw $VPNGW route add -net 59.188.18.0/24 gw $VPNGW route add -net 60.199.245.0/24 gw $VPNGW route add -net 62.212.73.0/24 gw $VPNGW route add -net 63.141.200.0/24 gw $VPNGW route add -net 64.13.192.0/24 gw $VPNGW route add -net 64.145.84.0/24 gw $VPNGW route add -net 64.237.33.0/24 gw $VPNGW route add -net 64.237.47.0/24 gw $VPNGW route add -net 64.62.138.0/24 gw $VPNGW route add -net 64.74.223.0/24 gw $VPNGW route add -net 65.49.2.0/24 gw $VPNGW route add -net 65.49.26.0/24 gw $VPNGW route add -net 65.49.68.0/24 gw $VPNGW route add -net 66.114.53.0/24 gw $VPNGW route add -net 66.147.242.0/24 gw $VPNGW route add -net 66.147.244.0/24 gw $VPNGW route add -net 66.155.11.0/24 gw $VPNGW route add -net 66.155.9.0/24 gw $VPNGW route add -net 66.96.130.0/24 gw $VPNGW route add -net 66.96.131.0/24 gw $VPNGW route add -net 66.96.162.0/24 gw $VPNGW route add -net 67.228.17.0/24 gw $VPNGW route add -net 67.228.27.0/24 gw $VPNGW route add -net 67.23.129.0/24 gw $VPNGW route add -net 68.233.230.0/24 gw $VPNGW route add -net 69.163.141.0/24 gw $VPNGW route add -net 69.163.142.0/24 gw $VPNGW route add -net 69.167.127.0/24 gw $VPNGW route add -net 69.175.106.0/24 gw $VPNGW route add -net 69.31.132.0/24 gw $VPNGW route add -net 69.31.72.0/24 gw $VPNGW route add -net 69.43.161.0/24 gw $VPNGW route add -net 69.55.53.0/24 gw $VPNGW route add -net 69.58.188.0/24 gw $VPNGW route add -net 72.12.215.0/24 gw $VPNGW route add -net 72.233.104.0/24 gw $VPNGW route add -net 72.52.124.0/24 gw $VPNGW route add -net 72.52.81.0/24 gw $VPNGW route add -net 72.52.99.0/24 gw $VPNGW route add -net 74.120.121.0/24 gw $VPNGW route add -net 74.122.174.0/24 gw $VPNGW route add -net 74.125.224.0/24 gw $VPNGW route add -net 74.125.31.0/24 gw $VPNGW route add -net 74.201.154.0/24 gw $VPNGW route add -net 74.206.187.0/24 gw $VPNGW route add -net 74.220.199.0/24 gw $VPNGW route add -net 74.220.207.0/24 gw $VPNGW route add -net 74.220.215.0/24 gw $VPNGW route add -net 74.53.4.0/24 gw $VPNGW route add -net 75.119.198.0/24 gw $VPNGW route add -net 76.74.159.0/24 gw $VPNGW route add -net 76.74.254.0/24 gw $VPNGW route add -net 76.74.255.0/24 gw $VPNGW route add -net 78.109.93.0/24 gw $VPNGW route add -net 78.129.203.0/24 gw $VPNGW route add -net 8.26.221.0/24 gw $VPNGW route add -net 8.5.1.0/24 gw $VPNGW route add -net 82.98.86.0/24 gw $VPNGW route add -net 84.20.200.0/24 gw $VPNGW route add -net 85.17.121.0/24 gw $VPNGW route add -net 85.17.122.0/24 gw $VPNGW route add -net 85.17.123.0/24 gw $VPNGW route add -net 88.208.24.0/24 gw $VPNGW route add -net 92.122.210.0/24 gw $VPNGW route add -net 92.61.153.0/24 gw $VPNGW route add -net 93.115.84.0/24 gw $VPNGW route add -net 95.211.147.0/24 gw $VPNGW route add -net 96.7.48.0/24 gw $VPNGW route add -net 97.74.144.0/24 gw $VPNGW route add -net 98.129.229.0/24 gw $VPNGW route add -net 98.138.81.0/24 gw $VPNGW ##### end batch route ##### route add -host 108.174.2.100 gw $VPNGW route add -net 107.162.0.0/16 gw $VPNGW route add -net 108.160.160.0/20 gw $VPNGW route add -host 72.52.4.91 gw $VPNGW route add -host 119.235.235.44 gw $VPNGW route add -net 162.212.40.0/21 gw $VPNGW route add -net 118.155.230.0/24 gw $VPNGW route add -net 199.96.160.0/22 gw $VPNGW route add -net 184.72.0.0/15 gw $VPNGW route add -net 107.20.0.0/14 gw $VPNGW route add -net 174.129.0.0/16 gw $VPNGW route add -net 23.20.0.0/14 gw $VPNGW route add -net 54.240.0.0/12 gw $VPNGW route add -host 128.199.191.142 gw $VPNGW route add -net 72.246.0.0/15 gw $VPNGW route add -host 204.45.120.82 gw $VPNGW route add -host 50.62.11.160 gw $VPNGW route add -net 106.187.61.0/24 gw $VPNGW route add -net 192.30.252.0/22 gw $VPNGW route add -net 209.85.128.0/17 gw $VPNGW route add -net 31.13.70.0/24 gw $VPNGW route add -net 31.13.79.0/24 gw $VPNGW route add -host 198.35.26.106 gw $VPNGW route add -net 207.171.160.0/19 gw $VPNGW route add -host 142.4.214.161 gw $VPNGW route add -host 174.36.196.168 gw $VPNGW route add -host 74.208.170.59 gw $VPNGW route add -host 210.61.56.32 gw $VPNGW route add -host 210.61.56.25 gw $VPNGW route add -host 106.187.40.13 gw $VPNGW route add -host 61.244.110.199 gw $VPNGW route add -host 74.220.126.92 gw $VPNGW route add -net 23.0.0.0/12 gw $VPNGW route add -net 192.33.24.0/21 gw $VPNGW route add -net 202.177.192.0/20 gw $VPNGW route add -net 72.21.80.0/20 gw $VPNGW route add -host 106.187.93.16 gw $VPNGW route add -host 204.10.32.68 gw $VPNGW route add -net 204.10.32.0/22 gw $VPNGW route add -host 178.33.44.27 gw $VPNGW route add -host 23.10.8.118 gw $VPNGW route add -host 23.46.133.29 gw $VPNGW route add -host 23.33.37.79 gw $VPNGW route add -net 23.32.0.0/11 gw $VPNGW route add -net 184.50.0.0/15 gw $VPNGW route add -net 212.58.224.0/19 gw $VPNGW route add -net 54.224.0.0/12 gw $VPNGW route add -net 173.252.64.0/18 gw $VPNGW route add -net 50.16.0.0/14 gw $VPNGW route add -net 23.72.0.0/13 gw $VPNGW route add -host 207.241.224.2 gw $VPNGW route add -host 207.241.226.190 gw $VPNGW route add -net 192.229.128.0/17 gw $VPNGW route add -net 37.187.0.0/16 gw $VPNGW route add -net 216.58.192.0/19 gw $VPNGW route add -host 103.245.222.223 gw $VPNGW route add -host 190.93.247.237 gw $VPNGW route add -host 190.93.246.237 gw $VPNGW route add -host 91.190.218.18 gw $VPNGW route add -host 148.251.50.164 gw $VPNGW route add -host 216.34.181.96 gw $VPNGW route add -net http://178.33.61.76/ gw $VPNGW route add -host 178.33.61.76 gw $VPNGW route add -host 5.196.44.172 gw $VPNGW route add -net 210.155.101.128/25 gw $VPNGW route add -net 23.64.0.0/14 gw $VPNGW route add -host 198.140.134.76 gw $VPNGW route add -host 207.96.174.152 gw $VPNGW route add -net 50.112.0.0/16 gw $VPNGW route add -host 199.96.57.7 gw $VPNGW route add -net 61.244.110.0/24 gw $VPNGW route add -host 23.235.47.193 gw $VPNGW route add -host 199.27.79.193 gw $VPNGW route add -host 173.241.248.219 gw $VPNGW route add -host 194.132.198.165 gw $VPNGW route add -host 194.132.196.212 gw $VPNGW route add -host 194.132.196.98 gw $VPNGW route add -host 194.68.30.162 gw $VPNGW route add -host 194.68.30.146 gw $VPNGW route add -host 194.68.30.114 gw $VPNGW route add -host 104.16.55.15 gw $VPNGW route add -host 104.16.54.15 gw $VPNGW route add -host 103.245.222.249 gw $VPNGW route add -net 190.93.240.0/20 gw $VPNGW route add -host 141.101.114.59 gw $VPNGW route add -host 198.35.26.96 gw $VPNGW route add -host 68.234.31.77 gw $VPNGW route add -host 68.234.25.109 gw $VPNGW route add -host 96.44.178.158 gw $VPNGW route add -host 157.188.12.32 gw $VPNGW route add -net 131.103.20.172/31 gw $VPNGW route add -host 131.103.20.167 gw $VPNGW route add -host 131.103.20.168 gw $VPNGW route add -net 216.239.32.0/19 gw $VPNGW route add -net 199.16.156.0/22 gw $VPNGW route add -host 54.219.162.117 gw $VPNGW route add -host 54.67.3.127 gw $VPNGW route add -net 199.96.56.0/21 gw $VPNGW route add -host 52.1.215.192 gw $VPNGW route add -host 169.253.219.225 gw $VPNGW route add -host 174.129.25.170 gw $VPNGW route add -host 162.159.245.89 gw $VPNGW route add -net 162.158.0.0/15 gw $VPNGW route add -net 54.192.0.0/16 gw $VPNGW route add -net 54.160.0.0/12 gw $VPNGW route add -host 198.41.184.78 gw $VPNGW route add -host 198.41.185.78 gw $VPNGW route add -host 192.241.240.89 gw $VPNGW route add -host 72.167.131.126 gw $VPNGW route add -net 94.176.148.0/24 gw $VPNGW route add -net 89.46.100.0/22 gw $VPNGW
philiptzou/tomato-scripts
openvpn/routes.sh
Shell
mit
55,194
package objects; public enum CommandSecurityRating { syscmd, topsec, medsec, lowsec, unknown }
ofirl/HackerSwamp
src/main/java/objects/CommandSecurityRating.java
Java
mit
100
--- layout: post title: 命运的好坏是如何产生的? author: 贤善 trim: 王盼 category: buddha tags: 正信 excerpt: --- ![]({{ site.url }}/assets/images/00001.jpg) 有人说:“胎儿一旦离开母体,呱呱落地之时,就注定了一生的命运。”所谓“一朝落地命安排。”相命学家就根据这个出生的时刻,作出种种命运预言。一生的幸运与不幸,就完全*命运的主宰所赐予。而世人的贫*富贵之间,往往相差太远,如此而论,命运之神的赐予,不是太不公平了吗? 运途阻滞的人,往往会仰问上苍:“为什么他人青云直上。东成西就;而我却如此多滞多磨?” 婚姻失意的人在辗转不寐之时;亦会反问自己:“为什么他人夫唱妇随。白头偕老,而我会遭受到抛弃?” 病魔缠身的人,在痛苦呻吟之际,或见到他人身壮力健之时,亦会暗中自问:“为什么他人健康长寿,而我却遭受疾苦之厄?” 甚至有人打开报纸,看到意外丧生的新闻,亦会在叹息之余,喃喃自问:“为什么他会遭到上天如此不幸的安排呢?” 诸如此类的问题,一般相命学家都会用阴阳五行来解释:“这是出生的八字命理某某运,某某部位的不好所致。” 但是,有没有人再深入地提出一个问题:“为什么有人生出来就会八字好,有人生出来就八字坏?命运的主宰真的这样不公平吗?” 要深入彻底地研究这种“宿命’的根本渊源,就必须明白佛学的“三世因果”。“三世因果”与“宿命”有什么关系呢?原来“宿命论”是以“因”和“果”的法则作为基础的。“三世因果”是唯一可以透过今世出生之前的时空,清楚地明了到一个很重要的循环过程——即是今世出生之前的“因”,与出生之后的“果’,这种“因”和“果”的循环往今后推而远之,形成“过去”(前世)——“现在”(今世)——“未来”(后世),如此三世的循环规律,而改善命运的唯一可行方法亦是以这个循环规律作为根本依据。 佛教的《因果经》有四句最具原则性的经文: “欲知前世因,今生受者是。欲知来世果,今生作者是。” 意思是说:你前生种了什么因,今生就会受到什么果。今生种了什么因,后世也会得到什么果。 《佛说净意优婆塞所问经》里,对因果循环有较详细的著述。以下摘录数段并译其大意来阐述种种因果的报应: 世有男子女人,心怀恶毒,持刀执杖,杀害生命,无悲悯心,不生惭愧,或自手杀,或教他人杀,同造恶业,同招苦报。待命终时,下堕地狱,受地狱苦刑,地狱报尽,纵得出生为人,亦寿命短促,或则生来多病无日无时能享安乐。由杀命之因,得短寿之果。 世有男子女人,心无恶毒,不持刀杖,不杀生命,具悲悯心,有大惭愧,待命终后,享天堂福,天堂报尽,来生人间,亦享长寿。由不杀命之因,得长寿之果。 世有男子女人,时用杖木瓦石掷打生物,或损伤触恼他人。待命终时,受地狱苦,地狱报尽,出生为人,诸多疾病缠身。由损伤恼害生物之因,得多病之果。 世有男子女人,常起忿恨嗔怒之心,生诸过失。待命终时,受地狱苦。地狱报尽,出生为人,相貌丑陋。由忿怒憎恨之因,得丑陋之果。 世有男子女人,若见他人得到利益,或听到他人有称意之事,即利用自己的方便阻碍他人,不令他得。待命终时,受地狱苦,地狱报尽,纵得出生为人,凡所求望,皆不如意,甚多阻滞。由阻碍他人利益之因,得运程阻滞之果。 世有男子女人,于他所应尊重者,而不尊重。所应恭敬者,而不恭敬。所应供养者,而不供养。常起傲慢自高之心。待命终时,受地狱苦。地狱报尽,纵得出生为人,亦生来下贱,不受尊贵。由傲慢自高之因,得下贱之果。 世有男子女人,于他人所应尊重者,即起尊重。所应恭敬者,即起恭敬,所应供养者,即乐于供养,不起傲慢自高之心。待命终后,享天堂福,天堂报尽,来生人间,亦受尊贵。由尊重恭敬他人之因,得受尊贵之果。 世有男子女人,其心悭吝,不愿以金钱物质救济他人之穷困,亦不愿施赠医药给贫病之人。或常起贪心,占用他人财物。待命终后,受地狱苦,地狱报尽,纵得为人,亦贫穷困乏。由悭吝贪心之因,得贫穷之果。 世有男子女人,心不悭吝,常以金钱衣物救济他人,或常以医药施赠贫病,不起贪心,不占用他人财物。待命终后,享天堂福,天堂报尽,来生人间,富贵自在。由不悭不贪之因,得富贵之果。 以上是摘译经文的数段大意而已。由此可知,善恶因果报应的原理,就是“种瓜得瓜,种豆得豆。”杀害生命者短寿,贪心悭吝者贫穷。不尊重他人,所得的果报是下贱。损伤了生物,得到的是多病。阻碍了他人的利益,自己得到的是阻滞。因果的报应是很公平的,而且都自作自受。 此外,因果报应的循环规律尚有很多复杂的部分,例如冤冤相报是复仇性的循环,答恩谢德是报恩性的循环等等。更有不少循环是“现世报”,今世所作的善或恶,今世就报应。亦有些隔二三世之后才报应的循环。这要视各人原有的积善或积恶之多少来定。
10share/10share.github.io
_posts/2009-06-08-buddha_00376.md
Markdown
mit
5,691
#pragma warning disable 1591 using Braintree.Exceptions; using System; using System.IO; using System.Net; #if netcore using System.Net.Http; #endif using System.Collections; using System.Collections.Generic; using System.Threading.Tasks; using Newtonsoft.Json; using Newtonsoft.Json.Converters; namespace Braintree { public class GraphQLResponse { public Dictionary<string, object> data { get; set; } public Dictionary<string, object> extensions { get; set; } public IList<GraphQLError> errors { get; set; } public class Deserializer : CustomCreationConverter<IDictionary<string, object>> { public override IDictionary<string, object> Create(Type objectType) { return new Dictionary<string, object>(); } public override bool CanConvert(Type objectType) { return objectType == typeof(object) || base.CanConvert(objectType); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { if (reader.TokenType == JsonToken.StartObject || reader.TokenType == JsonToken.Null) { return base.ReadJson(reader, objectType, existingValue, serializer); } return serializer.Deserialize(reader); } } } public class GraphQLError { public string message { get; set; } public Dictionary<string, object> extensions { get; set; } } public class BraintreeGraphQLService : HttpService { public BraintreeGraphQLService(Configuration configuration) : base(configuration) { } public string GraphQLApiVersion = "2018-09-10"; #if netcore public override void SetRequestHeaders(HttpRequestMessage request) { base.SetRequestHeaders(request); request.Headers.Add("Braintree-Version", GraphQLApiVersion); request.Headers.Add("Accept", "application/json"); } #else public override void SetRequestHeaders(HttpWebRequest request) { base.SetRequestHeaders(request); request.Headers.Add("Braintree-Version", GraphQLApiVersion); request.Accept = "application/json"; request.ContentType = "application/json"; } #endif public GraphQLResponse QueryGraphQL(string definition, Dictionary<string, object> variables) { var request = GetGraphQLHttpRequest(definition, variables); var response = GetHttpResponse(request); var result = JsonConvert.DeserializeObject<GraphQLResponse>(response, new JsonConverter[] {new GraphQLResponse.Deserializer()}); ThrowExceptionIfGraphQLErrorResponseHasError(result); return result; } public async Task<GraphQLResponse> QueryGraphQLAsync(string definition, Dictionary<string, object> variables) { var request = GetGraphQLHttpRequest(definition, variables); var response = await GetHttpResponseAsync(request).ConfigureAwait(false); var result = JsonConvert.DeserializeObject<GraphQLResponse>(response, new JsonConverter[] {new GraphQLResponse.Deserializer()}); ThrowExceptionIfGraphQLErrorResponseHasError(result); return result; } #if netcore public HttpRequestMessage GetGraphQLHttpRequest(string definition, Dictionary<string, object> variables) { var request = GetHttpRequest(Configuration.GetGraphQLUrl(), "post"); var body = FormatGraphQLRequest(definition, variables); var body_bytes = encoding.GetBytes(body); var utf8_string = encoding.GetString(body_bytes); request.Content = new StringContent(utf8_string, encoding, "application/json"); request.Content.Headers.ContentLength = System.Text.UTF8Encoding.UTF8.GetByteCount(utf8_string); return request; } #else public HttpWebRequest GetGraphQLHttpRequest(string definition, Dictionary<string, object> variables) { var request = GetHttpRequest(Configuration.GetGraphQLUrl(), "post"); var body = FormatGraphQLRequest(definition, variables); var body_bytes = encoding.GetBytes(body); request.ContentLength = body_bytes.Length; using (Stream requestStream = request.GetRequestStream()) { requestStream.Write(body_bytes, 0, body_bytes.Length); } return request; } #endif private string FormatGraphQLRequest(string definition, Dictionary<string, object> variables) { Dictionary<string, object> body = new Dictionary<string, object>(); body["query"] = definition; body["variables"] = variables; return JsonConvert.SerializeObject(body, Newtonsoft.Json.Formatting.None); } public static void ThrowExceptionIfGraphQLErrorResponseHasError(GraphQLResponse response) { var errors = response.errors; if (errors == null) { return; } foreach (var error in errors) { var message = error.message; if (error.extensions == null) { throw new UnexpectedException(); } switch ((string)error.extensions["errorClass"]) { case "VALIDATION": continue; case "AUTHENTICATION": throw new AuthenticationException(); case "AUTHORIZATION": throw new AuthorizationException(message); case "NOT_FOUND": throw new NotFoundException(message); case "UNSUPPORTED_CLIENT": throw new UpgradeRequiredException(); case "RESOURCE_LIMIT": throw new TooManyRequestsException(); case "INTERNAL": throw new ServerException(); case "SERVICE_AVAILABILITY": throw new ServiceUnavailableException(); case "UNKNOWN": default: throw new UnexpectedException(); } } } } } #pragma warning restore 1591
braintree/braintree_dotnet
src/Braintree/BraintreeGraphQLService.cs
C#
mit
6,542
<?php namespace DFZ\Dola\Models; use Illuminate\Database\Eloquent\Model; class Translation extends Model { protected $table = 'translations'; protected $fillable = ['table_name', 'column_name', 'foreign_key', 'locale', 'value']; }
jaeder/Dola
src/Models/Translation.php
PHP
mit
243
# keyclic_sdk_api.model.AssignmentLinksSelfIriTemplate ## Load the model package ```dart import 'package:keyclic_sdk_api/api.dart'; ``` ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapping** | [**AssignmentLinksSelfIriTemplateMapping**](AssignmentLinksSelfIriTemplateMapping.md) | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Keyclic/keyclic-sdk
dart/doc/AssignmentLinksSelfIriTemplate.md
Markdown
mit
546
import logging logger = logging.getLogger(__name__) import sys import os import json import requests from requests.exceptions import Timeout, ReadTimeout, ConnectionError import time import threading import concurrent.futures import collections import binascii import hashlib from dogepartylib.lib import config, script, util raw_transactions_cache = util.DictCache(size=config.BACKEND_RAW_TRANSACTIONS_CACHE_SIZE) #used in getrawtransaction_batch() unconfirmed_transactions_cache = None class BackendRPCError(Exception): pass def rpc_call(payload): url = config.BACKEND_URL response = None TRIES = 12 for i in range(TRIES): try: response = requests.post(url, data=json.dumps(payload), headers={'content-type': 'application/json'}, verify=(not config.BACKEND_SSL_NO_VERIFY), timeout=config.REQUESTS_TIMEOUT) if i > 0: logger.debug('Successfully connected.') break except (Timeout, ReadTimeout, ConnectionError): logger.debug('Could not connect to backend at `{}`. (Try {}/{})'.format(url, i+1, TRIES)) time.sleep(5) if response == None: if config.TESTNET: network = 'testnet' else: network = 'mainnet' raise BackendRPCError('Cannot communicate with backend at `{}`. (server is set to run on {}, is backend?)'.format(url, network)) elif response.status_code not in (200, 500): raise BackendRPCError(str(response.status_code) + ' ' + response.reason) # Return result, with error handling. response_json = response.json() # Batch query returns a list if isinstance(response_json, list): return response_json if 'error' not in response_json.keys() or response_json['error'] == None: return response_json['result'] elif response_json['error']['code'] == -5: # RPC_INVALID_ADDRESS_OR_KEY raise BackendRPCError('{} Is `txindex` enabled in {} Core?'.format(response_json['error'], config.BTC_NAME)) elif response_json['error']['code'] in [-28, -8, -2]: # “Verifying blocks...” or “Block height out of range” or “The network does not appear to fully agree!“ logger.debug('Backend not ready. Sleeping for ten seconds.') # If Bitcoin Core takes more than `sys.getrecursionlimit() * 10 = 9970` # seconds to start, this’ll hit the maximum recursion depth limit. time.sleep(10) return rpc_call(payload) else: raise BackendRPCError('{}'.format(response_json['error'])) def rpc(method, params): payload = { "method": method, "params": params, "jsonrpc": "2.0", "id": 0, } return rpc_call(payload) def rpc_batch(request_list): responses = collections.deque() def make_call(chunk): #send a list of requests to bitcoind to be executed #note that this is list executed serially, in the same thread in bitcoind #e.g. see: https://github.com/bitcoin/bitcoin/blob/master/src/rpcserver.cpp#L939 responses.extend(rpc_call(chunk)) chunks = util.chunkify(request_list, config.RPC_BATCH_SIZE) with concurrent.futures.ThreadPoolExecutor(max_workers=config.BACKEND_RPC_BATCH_NUM_WORKERS) as executor: for chunk in chunks: executor.submit(make_call, chunk) return list(responses) def extract_addresses(txhash_list): tx_hashes_tx = getrawtransaction_batch(txhash_list, verbose=True) tx_hashes_addresses = {} tx_inputs_hashes = set() #use set to avoid duplicates for tx_hash, tx in tx_hashes_tx.items(): tx_hashes_addresses[tx_hash] = set() for vout in tx['vout']: if 'addresses' in vout['scriptPubKey']: tx_hashes_addresses[tx_hash].update(tuple(vout['scriptPubKey']['addresses'])) tx_inputs_hashes.update([vin['txid'] for vin in tx['vin']]) raw_transactions = getrawtransaction_batch(list(tx_inputs_hashes), verbose=True) for tx_hash, tx in tx_hashes_tx.items(): for vin in tx['vin']: vin_tx = raw_transactions[vin['txid']] if vin_tx is None: #bogus transaction continue vout = vin_tx['vout'][vin['vout']] if 'addresses' in vout['scriptPubKey']: tx_hashes_addresses[tx_hash].update(tuple(vout['scriptPubKey']['addresses'])) return tx_hashes_addresses, tx_hashes_tx def unconfirmed_transactions(address): logger.debug("unconfirmed_transactions called: %s" % address) if unconfirmed_transactions_cache is None: raise Exception("Unconfirmed transactions cache is not initialized") return unconfirmed_transactions_cache.get(address, []) def refresh_unconfirmed_transactions_cache(mempool_txhash_list): # NOTE: This operation can be very slow. global unconfirmed_transactions_cache unconfirmed_txes = {} tx_hashes_addresses, tx_hashes_tx = extract_addresses(mempool_txhash_list) for tx_hash, addresses in tx_hashes_addresses.items(): for address in addresses: if address not in unconfirmed_txes: unconfirmed_txes[address] = [] unconfirmed_txes[address].append(tx_hashes_tx[tx_hash]) unconfirmed_transactions_cache = unconfirmed_txes logger.debug('Unconfirmed transactions cache refreshed ({} entries, from {} supported mempool txes)'.format( len(unconfirmed_transactions_cache), len(mempool_txhash_list))) def searchrawtransactions(address, unconfirmed=False): # Get unconfirmed transactions. if unconfirmed: logger.debug('searchrawtransactions: Getting unconfirmed transactions.') unconfirmed = unconfirmed_transactions(address) else: unconfirmed = [] # Get confirmed transactions. try: logger.debug('Searching raw transactions.') rawtransactions = rpc('searchrawtransactions', [address, 1, 0, 9999999]) except BackendRPCError as e: if str(e) == '404 Not Found': raise BackendRPCError('Unknown RPC command: `searchrawtransactions`. Please use a version of {} Core which supports an address index.'.format(config.BTC_NAME)) else: raise BackendRPCError(str(e)) confirmed = [tx for tx in rawtransactions if 'confirmations' in tx and tx['confirmations'] > 0] return unconfirmed + confirmed def getblockcount(): return rpc('getblockcount', []) def getblockhash(blockcount): return rpc('getblockhash', [blockcount]) def getblock(block_hash): return rpc('getblock', [block_hash, False]) def getrawtransaction(tx_hash, verbose=False): return getrawtransaction_batch([tx_hash], verbose=verbose)[tx_hash] def getrawmempool(): return rpc('getrawmempool', []) def sendrawtransaction(tx_hex): return rpc('sendrawtransaction', [tx_hex]) def getrawtransaction_batch(txhash_list, verbose=False, _recursing=False): if len(txhash_list) > config.BACKEND_RAW_TRANSACTIONS_CACHE_SIZE: #don't try to load in more than BACKEND_RAW_TRANSACTIONS_CACHE_SIZE entries in a single call txhash_list_chunks = util.chunkify(txhash_list, config.BACKEND_RAW_TRANSACTIONS_CACHE_SIZE) txes = {} for txhash_list_chunk in txhash_list_chunks: txes.update(getrawtransaction_batch(txhash_list_chunk, verbose=verbose)) return txes tx_hash_call_id = {} payload = [] noncached_txhashes = set() txhash_list = set(txhash_list) # payload for transactions not in cache for tx_hash in txhash_list: if tx_hash not in raw_transactions_cache: call_id = binascii.hexlify(os.urandom(5)).decode('utf8') payload.append({ "method": 'getrawtransaction', "params": [tx_hash, 1], "jsonrpc": "2.0", "id": call_id }) noncached_txhashes.add(tx_hash) tx_hash_call_id[call_id] = tx_hash #refresh any/all cache entries that already exist in the cache, # so they're not inadvertently removed by another thread before we can consult them #(this assumes that the size of the working set for any given workload doesn't exceed the max size of the cache) for tx_hash in txhash_list.difference(noncached_txhashes): raw_transactions_cache.refresh(tx_hash) logger.debug("getrawtransaction_batch: txhash_list size: {} / raw_transactions_cache size: {} / # getrawtransaction calls: {}".format( len(txhash_list), len(raw_transactions_cache), len(payload))) # populate cache added_entries_to_cache = [] if len(payload) > 0: batch_responses = rpc_batch(payload) for response in batch_responses: if 'error' not in response or response['error'] is None: tx_hex = response['result'] tx_hash = tx_hash_call_id[response['id']] raw_transactions_cache[tx_hash] = tx_hex added_entries_to_cache.append(tx_hash) #for debugging else: #TODO: this seems to happen for bogus transactions? Maybe handle it more gracefully than just erroring out? raise BackendRPCError('{} (txhash:: {})'.format(response['error'], tx_hash_call_id.get(response.get('id', '??'), '??'))) # get transactions from cache result = {} for tx_hash in txhash_list: try: if verbose: result[tx_hash] = raw_transactions_cache[tx_hash] else: result[tx_hash] = raw_transactions_cache[tx_hash]['hex'] except KeyError: #shows up most likely due to finickyness with addrindex not always returning results that we need... logger.debug("tx missing in rawtx cache: {} -- txhash_list size: {}, hash: {} / raw_transactions_cache size: {} / # rpc_batch calls: {} / txhash in noncached_txhashes: {} / txhash in txhash_list: {} -- list {}".format( e, len(txhash_list), hashlib.md5(json.dumps(list(txhash_list)).encode()).hexdigest(), len(raw_transactions_cache), len(payload), tx_hash in noncached_txhashes, tx_hash in txhash_list, list(txhash_list.difference(noncached_txhashes)) )) if not _recursing: #try again r = getrawtransaction_batch([tx_hash], verbose=verbose, _recursing=True) result[tx_hash] = r[tx_hash] else: raise #already tried again, give up return result # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
coinwarp/dogeparty-lib
dogepartylib/lib/backend/addrindex.py
Python
mit
10,532
package com.ahmedadelsaid.simplenetworkproject.view; import android.content.Context; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.ProgressBar; import android.widget.TextView; import com.ahmedadelsaid.simplenetworklibrary.imagerequest.OnCompleteImageListener; import com.ahmedadelsaid.simplenetworklibrary.imagerequest.RequestImageView; import com.ahmedadelsaid.simplenetworkproject.R; import com.ahmedadelsaid.simplenetworkproject.model.ItemList; import java.util.ArrayList; import static com.ahmedadelsaid.simplenetworkproject.R.drawable.loading; /** * Created by Ahmed Adel on 19/06/2017. * * MainAdapter is the main adapter that handles the design of returned pastebin API */ class MainAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { static final int VIEW_TYPE_ITEM = 0; static final int VIEW_TYPE_LOADING = 1; private Context context; private LayoutInflater layoutInflater; private ArrayList<ItemList> items; private int lastPosition = -1; private OnCompleteImageListener onCompleteImageListener; private OnMainAdapterClickListener onMainAdapterClickListener; private OnLoadMoreListener onLoadMoreListener; private boolean isLoading; private int visibleThreshold = 1; private int lastVisibleItem, totalItemCount; MainAdapter(Context context, ArrayList<ItemList> items, RecyclerView recyclerView, OnCompleteImageListener onCompleteImageListener) { this.context = context; this.layoutInflater = LayoutInflater.from(context); this.items = items; this.onCompleteImageListener = onCompleteImageListener; if (recyclerView.getLayoutManager() instanceof LinearLayoutManager) { final LinearLayoutManager linearLayoutManager = (LinearLayoutManager) recyclerView .getLayoutManager(); recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); totalItemCount = linearLayoutManager.getItemCount(); lastVisibleItem = linearLayoutManager .findLastVisibleItemPosition(); if (!isLoading && totalItemCount <= (lastVisibleItem + visibleThreshold)) { if (onLoadMoreListener != null) { onLoadMoreListener.onLoadMore(true); } isLoading = true; } else { if (onLoadMoreListener != null) { onLoadMoreListener.onLoadMore(false); } } } }); } } @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { RecyclerView.ViewHolder viewHolder = null; if (viewType == VIEW_TYPE_ITEM) { viewHolder = new ItemViewHolder(layoutInflater.inflate(R.layout.item_list, parent, false)); } else if (viewType == VIEW_TYPE_LOADING) { viewHolder = new LoadingViewHolder(layoutInflater.inflate(R.layout.loading_progress_item, parent, false)); } return viewHolder; } @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { if (holder instanceof ItemViewHolder) { ItemList item = items.get(position); ((ItemViewHolder) holder).userNameTextView.setText(item.getUser().getName()); ((ItemViewHolder) holder).userImageView.setImageUrl(item.getUser().getProfileImage().getLarge(), R.drawable.warning, loading, onCompleteImageListener); setAnimation(holder.itemView, position); } else if (holder instanceof LoadingViewHolder) { ((LoadingViewHolder) holder).progressBar.setIndeterminate(true); } } @Override public int getItemCount() { return items.size(); } @Override public int getItemViewType(int position) { return items.get(position) == null ? VIEW_TYPE_LOADING : VIEW_TYPE_ITEM; } private void setAnimation(View viewToAnimate, int position) { if (position > lastPosition) { Animation animation = AnimationUtils.loadAnimation(context, R.anim.up_from_bottom); viewToAnimate.startAnimation(animation); lastPosition = position; } } void setItems(ArrayList<ItemList> items) { this.items = items; notifyDataSetChanged(); } void clear() { items.clear(); notifyDataSetChanged(); } void setOnMainAdapterClickListener(OnMainAdapterClickListener onMainAdapterClickListener) { this.onMainAdapterClickListener = onMainAdapterClickListener; } void setOnLoadMoreListener(OnLoadMoreListener onLoadMoreListener) { this.onLoadMoreListener = onLoadMoreListener; } void setLoaded(boolean isLoading) { this.isLoading = isLoading; } private class ItemViewHolder extends RecyclerView.ViewHolder { RequestImageView userImageView; TextView userNameTextView; ItemViewHolder(View itemView) { super(itemView); userImageView = (RequestImageView) itemView.findViewById(R.id.user_image_iv); userNameTextView = (TextView) itemView.findViewById(R.id.user_name_tv); itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (onMainAdapterClickListener != null) onMainAdapterClickListener.onMainAdapterClickListener(items.get(getAdapterPosition()), userImageView); } }); } } private class LoadingViewHolder extends RecyclerView.ViewHolder { ProgressBar progressBar; LoadingViewHolder(View itemView) { super(itemView); progressBar = (ProgressBar) itemView.findViewById(R.id.loading_progressBar); } } }
ahmed-adel-said/SimpleNetworkLibrary
app/src/main/java/com/ahmedadelsaid/simplenetworkproject/view/MainAdapter.java
Java
mit
6,520
DTiled: D language Tiled map parser. === [![Gitter chat](https://badges.gitter.im/rcorre/dtiled.png)](https://gitter.im/rcorre/dtiled) [![Dub Package](https://img.shields.io/dub/dt/dtiled.svg)](http://code.dlang.org/packages/dtiled) Do you like tilemap-based games? How about the D programming language? Would you like to make a tilemapped game in D? If so, you'll probably need to implement a lot of commonly-needed tilemap functionality, like mapping between screen coordinates and grid coordinates, iterating through groups of tiles, loading a map from a file, and more. I've spent enough time re-implementing or copying my tilemap logic between game projects that I decided to factor it out into a library. Here's a quick overview of what dtiled can do: ```d // row/col coordinates are explicitly specified to avoid nasty bugs tilemap.tileAt(RowCol(2,3)); // convert between 'grid' (row/column) and 'pixel' (x/y) coordinates auto tileUnderMouse = tilemap.tileAtPoint(myGameEngine.mousePos); auto pos = tilemap.tileCenter(RowCol(3,2)).as!MyVectorType; // no nested for loops! Conveniently foreach over all tiles in a map: foreach(coord, ref tile ; tilemap) { tile.awesomeness += 10; // if your tiles are structs, use ref to modify them } // need a range? Use `allTiles` or `allCoords`. auto tileRange = tilemap.allTiles.filter!(x => someCondition(x)); // finding the neighbors of a tile is an oft-needed task auto adjacent = tilemap.adjacentTiles(RowCol(3,3)); auto surrounding = tilemap.adjacentTiles(RowCol(3,3), Diagonals.yes); // use masks for grabbing tiles in some pattern uint[3][3] newWallShape = [ [ 1, 1, 1 ], [ 0, 1, 0 ], [ 0, 1, 0 ], ]; bool blocked = tilemap .maskTilesAround(RowCol(5,5), newWallShape) .any!(x => x.obstructed); // load data for maps created with the Tiled map editor auto mapData = MapData.load("map.json"); foreach(gid ; mapData.getLayer("ground").data) { ... } ``` To see the full suite of features offered by dtiled, check out the [docs](http://rcorre.github.io/dtiled/index.html). If you're more of the 'see things in action' type, check out the [Demo](https://github.com/rcorre/dtiled-example). It uses either [Allegro](http://code.dlang.org/packages/allegro) or [DGame](http://code.dlang.org/packages/dgame) to pop up a window and render a pretty tilemap you can play around with. If you're still here, keep on reading for a 'crash course' in using dtiled. I'll try to keep it terse, but there's a fair amount to cover here, so bear with me. # Picking a game engine First things first, dtiled is not a game engine. It cares only about tiles and maps, and knows nothing about rendering or input events. I expect you already have an engine of choice for your game. dtiled strives to integrate with your engine's functionality rather than replace it. If you don't have an engine, here are a few options: - [Allegro](http://code.dlang.org/packages/allegro) - [SDL](http://code.dlang.org/packages/derelict-sdl2) - [SFML](http://code.dlang.org/packages/dsfml) - [DGame](http://code.dlang.org/packages/dgame) The following examples assume you or your engine provide: - `Vector2!T`: A point with numeric `x` and `y` components - `Rect2!T`: A rectangle with numeric `x`, `y`, `width`, and `height` components - `drawBitmapRegion(bmp, pos, rect)`: draw a rectangular subsection `rect` of a bitmap/spritesheet `bmp` to the screen at Vector position `pos` - `getMousePos()`: Get the current mouse position as a Vector. # Defining our Tile We'll need to define a type that represents a single tile within the tilemap. ```d struct Tile { Rect2!int spriteRect; } ``` Well, that was simple. For now, our tile just defines the rectangular region of a bitmap that should be used to render this tile. That bitmap will be our 'tile atlas'; something like this: <img src="https://github.com/rcorre/dtiled-example/blob/master/content/ground.png"/> # Loading a map Unless your map is procedurally generated, you will probably want to create map files with some application and load them in your game. DTiled can help you load maps created with [Tiled](http://mapeditor.org), a popular open-source tilemap editor. Create your map in Tiled, export it to json using the in-editor menu or the `--export-map` command-line switch, and use `dtiled.data` to interpret the json map file. Currently DTiled only supports Tiled's JSON format. Support for tmx and csv may be added, but the json format should provide all necessary information. For now, lets say your map has a single tile layer named 'ground'. Lets take the data in that file and build an in-game map structure. ```d auto loadMap(string path) { auto mapData = MapData.load(path); auto buildTile(TiledGid gid) { // each GID uniquely maps to a single tile within a single tileset // in our case, this will always return our only have a single tileset // if you use more than one tileset, this will choose the appropriate // tileset based on the GID. auto tileset = mapData.getTileset(gid); // find which region in the 'tile atlas' this GID is mapped to. // this will be the `region` argument to our `drawBitmapRegion` function auto region = Rect2!int(tileset.tileOffsetX(gid), tileset.tileOffsetY(gid), tileset.tileWidth, tileset.tileHeight); return Tile(region); } auto tiles = mapData .getLayer("ground") // grab the layer named ground .data // iterate over the GIDs in that layer .map!(x => buildTile(x)) // build a Tile based on the GID .chunks(mapData.numCols) // chunk into rows .map!(x => x.array) // create an array from each row .array; // create an array of all the row arrays // our map wraps the 2D tile array, also storing information about tile size. return OrthoMap!Tile(tiles, mapData.tileWidth, mapData.tileHeight); } ``` `OrthoMap!T` is a type dtiled provides to represent an 'Orthogonal' map. Later versions of dtiled may also support isometric and hexagonal maps, but this will do for our needs. # Dealing with on-screen positions Now that we know which region of our tile atlas each tile should be drawn with (the `Tile.spriteRect` field we populated when loading the map), rendering the map just requires us to know which position each tile should be rendered to the screen at. Fortunately, our `OrthoMap` can translate grid coordinates to on-screen positions: ```d Bitmap tileAtlas; // assume we load our tile sheet at some point void drawMap(OrthoMap!Tile tileMap) { foreach(coord, tile ; tileMap) { // you could use tileCenter to get the offset of the tile's center instead auto topLeft = tileMap.tileOffset(coord).as!(Vector2!int); drawBitmap(tileAtlas, topLeft, tile.spriteRect); } } ``` Remember that `Vector2!T` is a type I am assuming you or your game library provides. `tileOffset` (and `tileCenter`) return a simple (x,y) tuple, and `dtiled.coords` provides a helper `as!T` to convert it to a vector type of your choice. We can also go the other way and find out which coordinate or tile lies at a given screen position. This is useful for, say, figuring out which tile is under the player's mouse: ```d auto tileUnderMouse = tileMap.tileAtPoint(mousePos); // or auto coordUnderMouse = tileMap.coordAtPoint(mousePos); ``` Just as `tileOffset` returns a general 'vector-ish' type `tileAtPoint` will accept anything vector-like as an argument (anything that has a numeric `x` or `y` component). DTiled tries not to make too many assumptions about the types you want to use. # The Grid A grid is a thin wrapper around a 2D array that enforces `RowCol`-based access and provides grid-related functionality. The `OrthoMap` we created earlier supports all of this as it is a wrapper around a `RectGrid`, but you can apply these same functions to any 2D array by wrapping it with `rectGrid`. The simplest grid operation is to access a tile by its coordinate: ```d auto tile = tileMap.tileAt(RowCol(2,3)); // grab the tile at row 2, column 3 ``` Now, you may be wondering how `grid.tileAt(RowCol(r,c))` is any different from `grid[r][c]`. The answer is, its not. At least, not until you get a bit tired and type `grid[c][r]`. The use of `RowCol` as an index throughout dtiled strives to avoid these annoying mistakes. As a bonus, `RowCol` is a nice way to pass around coordinate pairs and provides a few other benefits: ```d RowCol(2,3).south(5) // (7,3) RowCol(2,3).south.east // (3,4) RowCol(2,3).adjacent // [ (1,3), (2,2), (2,4), (3,3) ] RowCol(0,0).span(RowCol(2,2)) // [ (0,0), (0,1), (1,0), (1,1) ] ``` Here are some other useful things you can do with a grid: ```d auto neighbors = grid.adjacentTiles(RowCol(2,3)); auto surrounding = grid.adjacentTiles(RowCol(2,3), Diagonals.yes); auto coords = grid.adjacentCoords(RowCol(2,3)); // coords instead of tiles ``` Nice, but still pretty standard fare. What if you need to select tiles with a bit more finesse? Suppose you are making a game where the player can place walls of various shapes. The player wants to place an 'L' shaped wall at the coordinate (5,3), and you need to know if every tile the wall would cover is currently empty: ```d uint[3][3] mask = [ [ 0, 1, 0 ] [ 0, 1, 1 ] [ 0, 0, 0 ] ]; auto tilesUnderWall = grid.maskTilesAround(RowCol(5,3), mask); bool canPlaceWall = tilesUnderWall.all!(x => !x.hasObstruction); ``` `OrthoMap` supports all of this functionality as it is a wrapper around a `RectGrid`. # Algorithms Most of the above was pretty mundane, so lets break out `dtiled.algorithm`. Suppose your map has some walls on it, represented by a `hasWall` field on your `Tile`. You want to know if the player is standing in a 'room' entirely enclosed by walls: ```d auto room = map.enclosedTiles!(x => x.hasWall)(playerCoord); if (!room.empty) // player is in a room ``` A more general function is `floodTiles`, which returns a range that lazily flood-fills tiles meeting a certain condition. By contrast, `enclosedTiles` is evaluated eagerly to determine if the area is totally enclosed. gs sometimes it is useful to get coordinates instead of tiles, most functions that yield tiles have a counterpart that yields coordinates. Instead of `floodTiles` and `enclosedTiles`, you could use `floodCoords` and `enclosedCoords`.
rcorre/dtiled
README.md
Markdown
mit
10,413
<table width="90%" border="0"><tr><td><script>function openfile(url) {fullwin = window.open(url, "fulltext", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");}</script><div class="flayoutclass"><div class="flayoutclass_first"><table class="tableoutfmt2"><tr><th class="std1"><b>條目&nbsp;</b></th><td class="std2">蛛網塵封</td></tr> <tr><th class="std1"><b>注音&nbsp;</b></th><td class="std2">ㄓㄨ ㄨㄤ<sup class="subfont">ˇ</sup> ㄔㄣ<sup class="subfont">ˊ</sup> ㄈㄥ</td></tr> <tr><th class="std1"><b>漢語拼音&nbsp;</b></th><td class="std2"><font class="english_word">zhū wǎng chén fēng</font></td></tr> <tr><th class="std1"><b>釋義&nbsp;</b></th><td class="std2">被蜘蛛網所纏繞,被塵土所覆蓋。形容居室、器物等長期無人居住使用。清˙袁枚˙隨園詩話補遺˙卷三:<img src=/cydic/dicword/fa40.gif border=0 alt=* class=fontimg valign=center>記得當時心醉處,蛛網塵封。<img src=/cydic/dicword/fa41.gif border=0 alt=* class=fontimg valign=center></td></tr> <tr><th class="std1"><b><font class="fltypefont">附錄</font>&nbsp;</b></th><td class="std2">修訂本參考資料</td></tr> </td></tr></table></div> <!-- flayoutclass_first --><div class="flayoutclass_second"></div> <!-- flayoutclass_second --></div> <!-- flayoutclass --></td></tr></table>
BuzzAcademy/idioms-moe-unformatted-data
all-data/25000-25999/25043-22.html
HTML
mit
1,375
/* * jQuery File Upload AngularJS Plugin 1.5.0 * https://github.com/blueimp/jQuery-File-Upload * * Copyright 2013, Sebastian Tschan * https://blueimp.net * * Licensed under the MIT license: * http://www.opensource.org/licenses/MIT */ /*jslint nomen: true, unparam: true */ /*global define, angular */ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { // Register as an anonymous AMD module: define([ 'jquery', 'angular', './jquery.fileupload-image', './jquery.fileupload-audio', './jquery.fileupload-video', './jquery.fileupload-validate' ], factory); } else { factory(); } }(function () { 'use strict'; angular.module('blueimp.fileuploader', []) // The fileUpload service provides configuration options // for the fileUpload directive and default handlers for // File Upload events: .provider('fileUpload', function () { var scopeApply = function () { var scope = angular.element(this) .fileupload('option', 'scope')(), $timeout = angular.injector(['ng']) .get('$timeout'); // Safe apply, makes sure $apply is called // asynchronously outside of the $digest cycle: $timeout(function () { scope.$apply(); }); }, $config; $config = this.defaults = { handleResponse: function (e, data) { var files = data.result && data.result.files; if (files) { data.scope().replace(data.files, files); } else if (data.errorThrown || data.textStatus === 'error') { data.files[0].error = data.errorThrown || data.textStatus; } }, add: function (e, data) { if (e.isDefaultPrevented()) { return false; } var scope = data.scope(); data.process(function () { return scope.process(data); }).always( function () { var file = data.files[0], submit = function () { return data.submit(); }; angular.forEach(data.files, function (file, index) { file._index = index; file.$state = function () { return data.state(); }; file.$progress = function () { return data.progress(); }; file.$response = function () { return data.response(); }; }); file.$cancel = function () { scope.clear(data.files); return data.abort(); }; if (file.$state() === 'rejected') { file._$submit = submit; } else { file.$submit = submit; } scope.$apply(function () { var method = scope.option('prependFiles') ? 'unshift' : 'push'; Array.prototype[method].apply( scope.queue, data.files ); if (file.$submit && (scope.option('autoUpload') || data.autoUpload) && data.autoUpload !== false) { file.$submit(); } }); } ); }, progress: function (e, data) { if (e.isDefaultPrevented()) { return false; } data.scope().$apply(); }, done: function (e, data) { if (e.isDefaultPrevented()) { return false; } var that = this; data.scope().$apply(function () { data.handleResponse.call(that, e, data); }); }, fail: function (e, data) { if (e.isDefaultPrevented()) { return false; } var that = this; if (data.errorThrown === 'abort') { return; } if (data.dataType && data.dataType.indexOf('json') === data.dataType.length - 4) { try { data.result = angular.fromJson(data.jqXHR.responseText); } catch (ignore) {} } data.scope().$apply(function () { data.handleResponse.call(that, e, data); }); }, stop: scopeApply, processstart: scopeApply, processstop: scopeApply, getNumberOfFiles: function () { return this.scope().queue.length; }, dataType: 'json', autoUpload: false }; this.$get = [ function () { return { defaults: $config }; } ]; }) // Format byte numbers to readable presentations: .provider('formatFileSizeFilter', function () { var $config = { // Byte units following the IEC format // http://en.wikipedia.org/wiki/Kilobyte units: [ {size: 1000000000, suffix: ' GB'}, {size: 1000000, suffix: ' MB'}, {size: 1000, suffix: ' KB'} ] }; this.defaults = $config; this.$get = function () { return function (bytes) { if (!angular.isNumber(bytes)) { return ''; } var unit = true, i = 0, prefix, suffix; while (unit) { unit = $config.units[i]; prefix = unit.prefix || ''; suffix = unit.suffix || ''; if (i === $config.units.length - 1 || bytes >= unit.size) { return prefix + (bytes / unit.size).toFixed(2) + suffix; } i += 1; } }; }; }) // The FileUploadController initializes the fileupload widget and // provides scope methods to control the File Upload functionality: .controller('FileUploadController', [ '$scope', '$element', '$attrs', '$window', 'fileUpload', function ($scope, $element, $attrs, $window, fileUpload) { var uploadMethods = { progress: function () { return $element.fileupload('progress'); }, active: function () { return $element.fileupload('active'); }, option: function (option, data) { return $element.fileupload('option', option, data); }, add: function (data) { return $element.fileupload('add', data); }, send: function (data) { return $element.fileupload('send', data); }, process: function (data) { return $element.fileupload('process', data); }, processing: function (data) { return $element.fileupload('processing', data); } }; $scope.disabled = !$window.jQuery.support.fileInput; $scope.queue = $scope.queue || []; $scope.clear = function (files) { var queue = this.queue, i = queue.length, file = files, length = 1; if (angular.isArray(files)) { file = files[0]; length = files.length; } while (i) { i -= 1; if (queue[i] === file) { return queue.splice(i, length); } } }; $scope.replace = function (oldFiles, newFiles) { var queue = this.queue, file = oldFiles[0], i, j; for (i = 0; i < queue.length; i += 1) { if (queue[i] === file) { for (j = 0; j < newFiles.length; j += 1) { queue[i + j] = newFiles[j]; } return; } } }; $scope.applyOnQueue = function (method) { var list = this.queue.slice(0), i, file; for (i = 0; i < list.length; i += 1) { file = list[i]; if (file[method]) { file[method](); } } }; $scope.submit = function () { this.applyOnQueue('$submit'); }; $scope.cancel = function () { this.applyOnQueue('$cancel'); }; // Add upload methods to the scope: angular.extend($scope, uploadMethods); // The fileupload widget will initialize with // the options provided via "data-"-parameters, // as well as those given via options object: $element.fileupload(angular.extend( {scope: function () { return $scope; }}, fileUpload.defaults )).on('fileuploadadd', function (e, data) { data.scope = $scope.option('scope'); }).on([ 'fileuploadadd', 'fileuploadsubmit', 'fileuploadsend', 'fileuploaddone', 'fileuploadfail', 'fileuploadalways', 'fileuploadprogress', 'fileuploadprogressall', 'fileuploadstart', 'fileuploadstop', 'fileuploadchange', 'fileuploadpaste', 'fileuploaddrop', 'fileuploaddragover', 'fileuploadchunksend', 'fileuploadchunkdone', 'fileuploadchunkfail', 'fileuploadchunkalways', 'fileuploadprocessstart', 'fileuploadprocess', 'fileuploadprocessdone', 'fileuploadprocessfail', 'fileuploadprocessalways', 'fileuploadprocessstop' ].join(' '), function (e, data) { if ($scope.$emit(e.type, data).defaultPrevented) { e.preventDefault(); } }).on('remove', function () { // Remove upload methods from the scope, // when the widget is removed: var method; for (method in uploadMethods) { if (uploadMethods.hasOwnProperty(method)) { delete $scope[method]; } } }); // Observe option changes: $scope.$watch( $attrs.fileUpload, function (newOptions) { if (newOptions) { $element.fileupload('option', newOptions); } } ); } ]) // Provide File Upload progress feedback: .controller('FileUploadProgressController', [ '$scope', '$attrs', '$parse', function ($scope, $attrs, $parse) { var fn = $parse($attrs.fileUploadProgress), update = function () { var progress = fn($scope); if (!progress || !progress.total) { return; } $scope.num = Math.floor( progress.loaded / progress.total * 100 ); }; update(); $scope.$watch( $attrs.fileUploadProgress + '.loaded', function (newValue, oldValue) { if (newValue !== oldValue) { update(); } } ); } ]) // Display File Upload previews: .controller('FileUploadPreviewController', [ '$scope', '$element', '$attrs', '$parse', function ($scope, $element, $attrs, $parse) { var fn = $parse($attrs.fileUploadPreview), file = fn($scope); if (file.preview) { $element.append(file.preview); } } ]) .directive('fileUpload', function () { return { controller: 'FileUploadController', scope: true }; }) .directive('fileUploadProgress', function () { return { controller: 'FileUploadProgressController', scope: true }; }) .directive('fileUploadPreview', function () { return { controller: 'FileUploadPreviewController' }; }) // Enhance the HTML5 download attribute to // allow drag&drop of files to the desktop: .directive('download', function () { return function (scope, elm) { elm.on('dragstart', function (e) { try { e.originalEvent.dataTransfer.setData( 'DownloadURL', [ 'application/octet-stream', elm.prop('download'), elm.prop('href') ].join(':') ); } catch (ignore) {} }); }; }); }));
abstractiondev/TheBallDeveloperExamples
WebTemplates/AdminTemplates/categoriesandcontent/assets/lib/jQuery-File-Upload/js/jquery.fileupload-angular.js
JavaScript
mit
16,327
package j2p.J2P1.translators.specalized; import java.awt.Color; import java.awt.Rectangle; import java.util.List; import org.apache.poi.sl.usermodel.TableCell.BorderEdge; import org.apache.poi.sl.usermodel.TextParagraph.TextAlign; import org.apache.poi.xslf.usermodel.XMLSlideShow; import org.apache.poi.xslf.usermodel.XSLFSlide; import org.apache.poi.xslf.usermodel.XSLFTable; import org.apache.poi.xslf.usermodel.XSLFTableCell; import org.apache.poi.xslf.usermodel.XSLFTableRow; import org.apache.poi.xslf.usermodel.XSLFTextParagraph; import org.apache.poi.xslf.usermodel.XSLFTextRun; import j2p.J2P1.data.QuarterBasedData; import j2p.J2P1.objects.IssueObject; import j2p.J2P1.objects.PriorityObject; import j2p.J2P1.objects.SprintObject; import j2p.J2P1.objects.TaskObject; public class QuarterlyReport extends Report { private QuarterBasedData qbd; private List<SprintObject> sprints; public QuarterlyReport(List<SprintObject> sprints, List<IssueObject> issues, List<TaskObject> tasks, List<PriorityObject> priorities, boolean incldWknd, int numDays) { super(issues, tasks, priorities); qbd = new QuarterBasedData(issues, gd.priorities.length); qbd.preCheck(); qbd.calculateSprintLengths(sprints, incldWknd, numDays); qbd.parseData(); this.sprints = sprints; } @Override public void writeReport(XMLSlideShow ss, SprintObject so) { // TODO: Replace SprintReport's writeReport (XMLSlideShow, SprintObject) with the new writeReport(XMLSlideShow ss) } @Override public void writeReport(XMLSlideShow ss) { for(int x=0;x<qbd.getNumOfSprints(); x++) { XSLFSlide slide = ss.createSlide(); XSLFTable completedPoints = slide.createTable(); completedPoints.setAnchor(new Rectangle(50, 50, 450, 300)); int numColumns = 4; int numRows = 12; XSLFTableRow headerRow = completedPoints.addRow(); headerRow.setHeight(50); // header for(int i = 0; i < numColumns; i++) { XSLFTableCell th = headerRow.addCell(); XSLFTextParagraph p = th.addNewTextParagraph(); p.setTextAlign(TextAlign.CENTER); XSLFTextRun r = p.addNewTextRun(); if(i==0) { r.setText(sprints.get(x).getBoardObject().getName()); } else if(i==1) { r.setText("Committed"); } else if(i==2) { r.setText("Completed"); } else if(i==3) { r.setText("Target"); } r.setBold(true); r.setFontColor(Color.white); th.setFillColor(new Color(79, 129, 189)); th.setBorderWidth(BorderEdge.bottom, 2.0); th.setBorderColor(BorderEdge.bottom, Color.white); completedPoints.setColumnWidth(i, 150); // all columns are equally sized } // rows for(int rownum = 0; rownum < numRows; rownum ++){ XSLFTableRow tr = completedPoints.addRow(); tr.setHeight(25); // header for(int i = 0; i < numColumns; i++) { XSLFTableCell cell = tr.addCell(); XSLFTextParagraph p = cell.addNewTextParagraph(); XSLFTextRun r = p.addNewTextRun(); if(i==0) { if(rownum==0) { r.setText("January"); }else if(rownum==1) { r.setText("February"); }else if(rownum==2) { r.setText("March"); }else if(rownum==3) { r.setText("April"); }else if(rownum==4) { r.setText("May"); }else if(rownum==5) { r.setText("June"); }else if(rownum==6) { r.setText("July"); }else if(rownum==7) { r.setText("August"); }else if(rownum==8) { r.setText("September"); }else if(rownum==9) { r.setText("October"); }else if(rownum==10) { r.setText("November"); }else if(rownum==11) { r.setText("December"); } } else if(i==1) { r.setText(qbd.getTotalPoints()[x][rownum]+""); } else if(i==2) { r.setText(qbd.getClosedPoints()[x][rownum]+""); } else { r.setText((double)(qbd.getClosedPoints()[x][rownum])/(double)(qbd.getTotalPoints()[x][rownum])*100+"%"); } if(rownum % 2 == 0) cell.setFillColor(new Color(208, 216, 232)); else cell.setFillColor(new Color(233, 247, 244)); } } slide = ss.createSlide(); XSLFTable ticketsPerDay = slide.createTable(); ticketsPerDay.setAnchor(new Rectangle(50, 50, 450, 300)); numColumns = 3; numRows = 12; headerRow = ticketsPerDay.addRow(); headerRow.setHeight(50); for(int i = 0; i < numColumns; i++) { XSLFTableCell th = headerRow.addCell(); XSLFTextParagraph p = th.addNewTextParagraph(); p.setTextAlign(TextAlign.CENTER); XSLFTextRun r = p.addNewTextRun(); if(i==0) { r.setText(sprints.get(x).getBoardObject().getName()); } else if(i==1) { r.setText("Total Tickets"); } else if(i==2) { r.setText("Daily Average"); } r.setBold(true); r.setFontColor(Color.white); th.setFillColor(new Color(79, 129, 189)); th.setBorderWidth(BorderEdge.bottom, 2.0); th.setBorderColor(BorderEdge.bottom, Color.white); ticketsPerDay.setColumnWidth(i, 150); // all columns are equally sized } for(int rownum = 0; rownum < numRows; rownum ++){ XSLFTableRow tr = ticketsPerDay.addRow(); tr.setHeight(25); // header for(int i = 0; i < numColumns; i++) { XSLFTableCell cell = tr.addCell(); XSLFTextParagraph p = cell.addNewTextParagraph(); XSLFTextRun r = p.addNewTextRun(); if(i==0) { if(rownum==0) { r.setText("January"); }else if(rownum==1) { r.setText("February"); }else if(rownum==2) { r.setText("March"); }else if(rownum==3) { r.setText("April"); }else if(rownum==4) { r.setText("May"); }else if(rownum==5) { r.setText("June"); }else if(rownum==6) { r.setText("July"); }else if(rownum==7) { r.setText("August"); }else if(rownum==8) { r.setText("September"); }else if(rownum==9) { r.setText("October"); }else if(rownum==10) { r.setText("November"); }else if(rownum==11) { r.setText("December"); } } else if(i==1) { r.setText(qbd.totalTickets()[x][rownum]+""); } else { r.setText((double)(qbd.totalTickets()[x][rownum])/(double)(qbd.getNumOfDays()[x][rownum])+""); } if(rownum % 2 == 0) cell.setFillColor(new Color(208, 216, 232)); else cell.setFillColor(new Color(233, 247, 244)); } } slide = ss.createSlide(); XSLFTable bugs = slide.createTable(); bugs.setAnchor(new Rectangle(50, 50, 900, 500)); numColumns = 6; numRows = 2; headerRow = bugs.addRow(); headerRow.setHeight(50); for(int i = 0; i < numColumns; i++) { XSLFTableCell th = headerRow.addCell(); XSLFTextParagraph p = th.addNewTextParagraph(); p.setTextAlign(TextAlign.CENTER); XSLFTextRun r = p.addNewTextRun(); if(i==0) { r.setText("Status"); } else { r.setText(gd.priorityNames.get(i-1)+""); } r.setBold(true); r.setFontColor(Color.white); th.setFillColor(new Color(79, 129, 189)); th.setBorderWidth(BorderEdge.bottom, 2.0); th.setBorderColor(BorderEdge.bottom, Color.white); bugs.setColumnWidth(i, 80); // all columns are equally sized } for(int rownum = 0; rownum < numRows; rownum ++){ XSLFTableRow tr = bugs.addRow(); tr.setHeight(25); // header for(int i = 0; i < numColumns; i++) { XSLFTableCell cell = tr.addCell(); XSLFTextParagraph p = cell.addNewTextParagraph(); XSLFTextRun r = p.addNewTextRun(); if(i==0) { if(rownum==0) { r.setText("Open"); }else if(rownum==1) { r.setText("Closed"); } } else { if(rownum==0) { r.setText(qbd.getOpenTickets()[x][i-1]+""); } else { r.setText(qbd.getClosedTickets()[x][i-1]+""); } } if(rownum % 2 == 0) cell.setFillColor(new Color(208, 216, 232)); else cell.setFillColor(new Color(233, 247, 244)); } } } } }
MichaelGardone/Jira2Pres
J2P1/src/main/java/j2p/J2P1/translators/specalized/QuarterlyReport.java
Java
mit
9,111
import * as p2 from 'p2'; import Door from './parts/Door'; import Entity from '../core/Entity'; import * as Util from '../gameutil/Util'; var roomCount = 0; const FLOW_CONSTANT = 1.0; // Stuff breaks when this goes over 1.0. const SUCTION = 10; const THRUST = 2000; /** * Represents on contiguous set of interior pieces. * Controls air pressure. */ class Room { constructor(manager) { this._doors = new Set(); this._holes = new Set(); this.airCapacity = 0; this.dirty = true; this.manager = manager; this.parts = new Set(); this.people = new Set(); this.roomId = roomCount++; this.totalAir = 0; } /** * @returns {number} */ get pressure() { return (this.totalAir / this.airCapacity) || 0; } /** * True if the room is air tight. * @returns {boolean} */ get sealed() { return this.holes.size === 0; } /** * All the doors that are connected to this room * @returns {Set} */ get doors() { if (this.dirty) { this.findHoles(); } return this._doors; } /** * The set of grid positions where holes are * @returns {Set} */ get holes() { if (this.dirty) { this.findHoles(); } return this._holes; } /** * @returns {Ship} */ get ship() { return this.manager.ship; } /** * Update calculations for air and stuff */ tick() { // TODO: Balance flow between all holes. This need to happen in a lot of places. Lot's of math cleanup here. this.holes.forEach((hole) => { const flow = this.giveAir(-FLOW_CONSTANT * this.pressure); if (flow !== 0) { this.applySuction(hole, [0, 0], -flow); const forceDirection = [0, 0]; if (!this.ship.partAtGrid([hole[0], hole[1] + 1])) { forceDirection[1] += -1; } if (!this.ship.partAtGrid([hole[0], hole[1] - 1])) { forceDirection[1] += 1; } if (!this.ship.partAtGrid([hole[0] + 1, hole[1]])) { forceDirection[0] += -1; } if (!this.ship.partAtGrid([hole[0] - 1, hole[1]])) { forceDirection[0] += 1; } const magnitude = flow * flow * THRUST; const angle = Math.atan2(forceDirection[1], forceDirection[0]) + this.ship.body.angle; const force = [Math.cos(angle) * magnitude, Math.sin(angle) * magnitude]; const forcePoint = this.ship.gridToWorld(hole); return this.ship.body.applyForce(force, forcePoint); } }); return this.doors.forEach((door) => { if (door.isOpen) { const adjacentRooms = door.getAdjacentRooms(); return adjacentRooms.forEach((otherRoom) => { if ((typeof otherRoom !== "undefined" && otherRoom !== null)) { // door to other room const pressureDifference = this.pressure - otherRoom.pressure; if (pressureDifference > 0.001) { const flowRate = -pressureDifference * FLOW_CONSTANT; const change = this.giveAir(flowRate); otherRoom.giveAir(-change); return this.applySuction(door.position, [0, 0], -change); } } else { // door to outside const flow = this.giveAir(-FLOW_CONSTANT * this.pressure); this.applySuction(door.position, [0, 0], -flow); // TODO: Don't repeat code const forceDirection = [0, 0]; if (!this.ship.partAtGrid([door.position[0], door.position[1] + 1])) { forceDirection[1] += -1; } if (!this.ship.partAtGrid([door.position[0], door.position[1] - 1])) { forceDirection[1] += 1; } if (!this.ship.partAtGrid([door.position[0] + 1, door.position[1]])) { forceDirection[0] += -1; } if (!this.ship.partAtGrid([door.position[0] - 1, door.position[1]])) { forceDirection[0] += 1; } const magnitude = flow * flow * THRUST; const angle = Math.atan2(forceDirection[1], forceDirection[0]) + this.ship.body.angle; const force = [Math.cos(angle) * magnitude, Math.sin(angle) * magnitude]; const forcePoint = this.ship.gridToLocal(door.position); return this.ship.body.applyForce(force, forcePoint); } }); } }); } /** * Apply a suction force to everyone in the room * @param position {Array.<number>} * @param direction {Array.<number>} * @param flow {number} */ applySuction(position, direction, flow) { position = this.ship.gridToWorld(position); this.people.forEach((person) => { var dx = position[0] - person.x; var dy = position[1] - person.y; const l = p2.vec2.length([dx, dy]); dx = dx / l || 0; dy = dy / l || 0; person.body.force[0] += dx * flow * SUCTION / l; person.body.force[1] += dy * flow * SUCTION / l; }); } /** * Include a part in this room * @param part {Part} * @returns {number} */ addPart(part) { if (!part) { throw new Error(`Bad Part: ${part}`); } this.parts.add(part); part.room = this; this.dirty = true; return this.airCapacity += 1; } /** * Remove a part from this room. * * TODO: Possibly splits room * * @param part * @returns {number} */ removePart(part) { this.parts.delete(part); if (part.room === this) { part.room = null; } this.dirty = true; return this.airCapacity -= 1; } /** * True if the part is part of this room * @param part {Part} * @returns {boolean} */ hasPart(part) { return this.parts.has(part); } /** * Recalculate the positions of all the holes. */ findHoles() { this._holes.clear(); this.parts.forEach((part) => { part.getAdjacentPoints().forEach((pos) => { const adjacentPart = this.ship.partAtGrid(pos); if (!adjacentPart) { this._holes.add(pos); } else if (adjacentPart instanceof Door) { this._doors.add(adjacentPart); } }); }); } /** * Add an amount of air into the room (can be negative) * @param amount * @returns {number} - the amount of air actually added */ giveAir(amount) { const old = this.totalAir; this.totalAir += amount; this.totalAir = Util.clamp(this.totalAir, 0, this.airCapacity); return this.totalAir - old; } /** * Join this room with another, keeping this room, destroying the other. * @param other {Room} */ join(other) { if (other === this) { throw new Error(`Joining room ${this.roomId} with itself`); } other.parts.forEach((part) => { this.addPart(part); }); this.giveAir(other.totalAir); } /** * Destroy this. */ destroy() { this.parts.forEach((part) => { part.room = null; }); return this.parts.clear(); } /** * @returns {string} */ toString() { return `<Room size: ${this.parts.size}>`; } } /** * Keeps track of rooms on a ship */ export default class RoomManager extends Entity { /** * Create a new RoomManager * @param ship {Ship} */ constructor(ship) { super(); this.parts = []; // list of all parts this.partSet = new Set(); // set of all parts this has (I don't know why there are both) this.rooms = []; this.ship = ship; this.calculateRooms(); } /** * Called when any part is added * @param part {Part} */ partAdded(part) { if (part.interior) { this.parts.push(part); this.partSet.add(part); const adjacentRooms = this.getAdjacentRooms(part); if (adjacentRooms.length === 0) { const room = new Room(this); room.addPart(part); this.rooms.push(room); } else if (adjacentRooms.length === 1) { adjacentRooms[0].addPart(part); } else { const room = adjacentRooms.pop(); room.addPart(part); for (var i = 0, otherRoom; i < adjacentRooms.length; i++) { otherRoom = adjacentRooms[i]; room.join(otherRoom); this.rooms.splice(this.rooms.indexOf(otherRoom), 1); } } } this.getAdjacentRooms(part).forEach((room) => room.dirty = true); } /** * Called when any part is removed * @param part {Part} */ partRemoved(part) { if (this.partSet.has(part)) { this.parts.splice(this.parts.indexOf(part), 1); this.calculateRooms(); // TODO: Don't be dumb } this.rooms.forEach((room) => room.dirty = true); } /** * Called during the tick. */ tick() { this.rooms.forEach((room) => room.tick()); } /** * Return all the rooms adjacent to a part * @param part {Part} * @returns {Array.<Room>} */ getAdjacentRooms(part) { const adjacentRooms = new Set(); part.getAdjacentParts().forEach((p) => { if (this.partSet.has(p)) { this.rooms.forEach((room) => { if (room.hasPart(p)) { adjacentRooms.add(room) } }); } }); return Array.from(adjacentRooms); } /** * Calculate which rooms exist */ calculateRooms() { while (this.rooms.length) { this.rooms.pop().destroy(); // remove all existing rooms so we can start fresh } const remaining = new Set(this.parts); while (remaining.size > 0) { const room = new Room(this); this.rooms.push(room); const queue = [remaining.values().next().value]; while (queue.length > 0) { const currentPart = queue.pop(); room.addPart(currentPart); remaining.delete(currentPart); currentPart.getAdjacentParts().forEach((adjacentPart) => { if (remaining.has(adjacentPart)) { queue.push(adjacentPart); } }); } } } }
simonbw/space-game
src/ship/RoomManager.js
JavaScript
mit
9,864
// Simple React Native specific changes export default { // font scaling override - RN default is on allowTextFontScaling: true, };
okmttdhr/YoutuVote
App/Config/AppConfig.js
JavaScript
mit
137
// // Pythagoras - a collection of geometry classes // http://github.com/samskivert/pythagoras package pythagoras.f; import java.io.Serializable; /** * Represents a quadratic curve. */ public class QuadCurve extends AbstractQuadCurve implements Serializable { /** The x-coordinate of the start of this curve. */ public float x1; /** The y-coordinate of the start of this curve. */ public float y1; /** The x-coordinate of the control point. */ public float ctrlx; /** The y-coordinate of the control point. */ public float ctrly; /** The x-coordinate of the end of this curve. */ public float x2; /** The y-coordinate of the end of this curve. */ public float y2; /** * Creates a quad curve with all points at (0,0). */ public QuadCurve () { } /** * Creates a quad curve with the specified start, control, and end points. */ public QuadCurve (float x1, float y1, float ctrlx, float ctrly, float x2, float y2) { setCurve(x1, y1, ctrlx, ctrly, x2, y2); } /** * Configures the start, control, and end points for this curve. */ public void setCurve (float x1, float y1, float ctrlx, float ctrly, float x2, float y2) { this.x1 = x1; this.y1 = y1; this.ctrlx = ctrlx; this.ctrly = ctrly; this.x2 = x2; this.y2 = y2; } /** * Configures the start, control, and end points for this curve. */ public void setCurve (IPoint p1, IPoint cp, IPoint p2) { setCurve(p1.x(), p1.y(), cp.x(), cp.y(), p2.x(), p2.y()); } /** * Configures the start, control, and end points for this curve, using the values at the * specified offset in the {@code coords} array. */ public void setCurve (float[] coords, int offset) { setCurve(coords[offset + 0], coords[offset + 1], coords[offset + 2], coords[offset + 3], coords[offset + 4], coords[offset + 5]); } /** * Configures the start, control, and end points for this curve, using the values at the * specified offset in the {@code points} array. */ public void setCurve (IPoint[] points, int offset) { setCurve(points[offset + 0].x(), points[offset + 0].y(), points[offset + 1].x(), points[offset + 1].y(), points[offset + 2].x(), points[offset + 2].y()); } /** * Configures the start, control, and end points for this curve to be the same as the supplied * curve. */ public void setCurve (IQuadCurve curve) { setCurve(curve.x1(), curve.y1(), curve.ctrlX(), curve.ctrlY(), curve.x2(), curve.y2()); } @Override // from interface IQuadCurve public float x1 () { return x1; } @Override // from interface IQuadCurve public float y1 () { return y1; } @Override // from interface IQuadCurve public float ctrlX () { return ctrlx; } @Override // from interface IQuadCurve public float ctrlY () { return ctrly; } @Override // from interface IQuadCurve public float x2 () { return x2; } @Override // from interface IQuadCurve public float y2 () { return y2; } }
Deadrik/jMapGen
src/pythagoras/f/QuadCurve.java
Java
mit
3,306
using System; using JetBrains.Annotations; using Newtonsoft.Json; namespace VimeoDotNet.Models { [Serializable] public class ChannelMetadata { [PublicAPI] [JsonProperty(PropertyName = "connections")] public ChannelConnections Connections { get; set; } [PublicAPI] [JsonProperty(PropertyName = "interactions")] public ChannelInteractions Interactions { get; set; } } }
mfilippov/vimeo-dot-net
src/VimeoDotNet/Models/ChannelMetadata.cs
C#
mit
437
// MESSAGE SIM_STATE PACKING #define MAVLINK_MSG_ID_SIM_STATE 108 typedef struct __mavlink_sim_state_t { float q1; /*< True attitude quaternion component 1, w (1 in null-rotation)*/ float q2; /*< True attitude quaternion component 2, x (0 in null-rotation)*/ float q3; /*< True attitude quaternion component 3, y (0 in null-rotation)*/ float q4; /*< True attitude quaternion component 4, z (0 in null-rotation)*/ float roll; /*< Attitude roll expressed as Euler angles, not recommended except for human-readable outputs*/ float pitch; /*< Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs*/ float yaw; /*< Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs*/ float xacc; /*< X acceleration m/s/s*/ float yacc; /*< Y acceleration m/s/s*/ float zacc; /*< Z acceleration m/s/s*/ float xgyro; /*< Angular speed around X axis rad/s*/ float ygyro; /*< Angular speed around Y axis rad/s*/ float zgyro; /*< Angular speed around Z axis rad/s*/ float lat; /*< Latitude in degrees*/ float lon; /*< Longitude in degrees*/ float alt; /*< Altitude in meters*/ float std_dev_horz; /*< Horizontal position standard deviation*/ float std_dev_vert; /*< Vertical position standard deviation*/ float vn; /*< True velocity in m/s in NORTH direction in earth-fixed NED frame*/ float ve; /*< True velocity in m/s in EAST direction in earth-fixed NED frame*/ float vd; /*< True velocity in m/s in DOWN direction in earth-fixed NED frame*/ } mavlink_sim_state_t; #define MAVLINK_MSG_ID_SIM_STATE_LEN 84 #define MAVLINK_MSG_ID_108_LEN 84 #define MAVLINK_MSG_ID_SIM_STATE_CRC 32 #define MAVLINK_MSG_ID_108_CRC 32 #define MAVLINK_MESSAGE_INFO_SIM_STATE { \ "SIM_STATE", \ 21, \ { { "q1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sim_state_t, q1) }, \ { "q2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_sim_state_t, q2) }, \ { "q3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_sim_state_t, q3) }, \ { "q4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_sim_state_t, q4) }, \ { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_sim_state_t, roll) }, \ { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_sim_state_t, pitch) }, \ { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_sim_state_t, yaw) }, \ { "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_sim_state_t, xacc) }, \ { "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_sim_state_t, yacc) }, \ { "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_sim_state_t, zacc) }, \ { "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_sim_state_t, xgyro) }, \ { "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_sim_state_t, ygyro) }, \ { "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_sim_state_t, zgyro) }, \ { "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_sim_state_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_sim_state_t, lon) }, \ { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_sim_state_t, alt) }, \ { "std_dev_horz", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_sim_state_t, std_dev_horz) }, \ { "std_dev_vert", NULL, MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_sim_state_t, std_dev_vert) }, \ { "vn", NULL, MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_sim_state_t, vn) }, \ { "ve", NULL, MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_sim_state_t, ve) }, \ { "vd", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_sim_state_t, vd) }, \ } \ } /** * @brief Pack a sim_state message * @param system_id ID of this system * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * * @param q1 True attitude quaternion component 1, w (1 in null-rotation) * @param q2 True attitude quaternion component 2, x (0 in null-rotation) * @param q3 True attitude quaternion component 3, y (0 in null-rotation) * @param q4 True attitude quaternion component 4, z (0 in null-rotation) * @param roll Attitude roll expressed as Euler angles, not recommended except for human-readable outputs * @param pitch Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs * @param yaw Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs * @param xacc X acceleration m/s/s * @param yacc Y acceleration m/s/s * @param zacc Z acceleration m/s/s * @param xgyro Angular speed around X axis rad/s * @param ygyro Angular speed around Y axis rad/s * @param zgyro Angular speed around Z axis rad/s * @param lat Latitude in degrees * @param lon Longitude in degrees * @param alt Altitude in meters * @param std_dev_horz Horizontal position standard deviation * @param std_dev_vert Vertical position standard deviation * @param vn True velocity in m/s in NORTH direction in earth-fixed NED frame * @param ve True velocity in m/s in EAST direction in earth-fixed NED frame * @param vd True velocity in m/s in DOWN direction in earth-fixed NED frame * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_sim_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, float q1, float q2, float q3, float q4, float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float lat, float lon, float alt, float std_dev_horz, float std_dev_vert, float vn, float ve, float vd) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[MAVLINK_MSG_ID_SIM_STATE_LEN]; _mav_put_float(buf, 0, q1); _mav_put_float(buf, 4, q2); _mav_put_float(buf, 8, q3); _mav_put_float(buf, 12, q4); _mav_put_float(buf, 16, roll); _mav_put_float(buf, 20, pitch); _mav_put_float(buf, 24, yaw); _mav_put_float(buf, 28, xacc); _mav_put_float(buf, 32, yacc); _mav_put_float(buf, 36, zacc); _mav_put_float(buf, 40, xgyro); _mav_put_float(buf, 44, ygyro); _mav_put_float(buf, 48, zgyro); _mav_put_float(buf, 52, lat); _mav_put_float(buf, 56, lon); _mav_put_float(buf, 60, alt); _mav_put_float(buf, 64, std_dev_horz); _mav_put_float(buf, 68, std_dev_vert); _mav_put_float(buf, 72, vn); _mav_put_float(buf, 76, ve); _mav_put_float(buf, 80, vd); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SIM_STATE_LEN); #else mavlink_sim_state_t packet; packet.q1 = q1; packet.q2 = q2; packet.q3 = q3; packet.q4 = q4; packet.roll = roll; packet.pitch = pitch; packet.yaw = yaw; packet.xacc = xacc; packet.yacc = yacc; packet.zacc = zacc; packet.xgyro = xgyro; packet.ygyro = ygyro; packet.zgyro = zgyro; packet.lat = lat; packet.lon = lon; packet.alt = alt; packet.std_dev_horz = std_dev_horz; packet.std_dev_vert = std_dev_vert; packet.vn = vn; packet.ve = ve; packet.vd = vd; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SIM_STATE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SIM_STATE; #if MAVLINK_CRC_EXTRA return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC); #else return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SIM_STATE_LEN); #endif } /** * @brief Pack a sim_state message on a channel * @param system_id ID of this system * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into * @param q1 True attitude quaternion component 1, w (1 in null-rotation) * @param q2 True attitude quaternion component 2, x (0 in null-rotation) * @param q3 True attitude quaternion component 3, y (0 in null-rotation) * @param q4 True attitude quaternion component 4, z (0 in null-rotation) * @param roll Attitude roll expressed as Euler angles, not recommended except for human-readable outputs * @param pitch Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs * @param yaw Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs * @param xacc X acceleration m/s/s * @param yacc Y acceleration m/s/s * @param zacc Z acceleration m/s/s * @param xgyro Angular speed around X axis rad/s * @param ygyro Angular speed around Y axis rad/s * @param zgyro Angular speed around Z axis rad/s * @param lat Latitude in degrees * @param lon Longitude in degrees * @param alt Altitude in meters * @param std_dev_horz Horizontal position standard deviation * @param std_dev_vert Vertical position standard deviation * @param vn True velocity in m/s in NORTH direction in earth-fixed NED frame * @param ve True velocity in m/s in EAST direction in earth-fixed NED frame * @param vd True velocity in m/s in DOWN direction in earth-fixed NED frame * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_sim_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, float q1,float q2,float q3,float q4,float roll,float pitch,float yaw,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float lat,float lon,float alt,float std_dev_horz,float std_dev_vert,float vn,float ve,float vd) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[MAVLINK_MSG_ID_SIM_STATE_LEN]; _mav_put_float(buf, 0, q1); _mav_put_float(buf, 4, q2); _mav_put_float(buf, 8, q3); _mav_put_float(buf, 12, q4); _mav_put_float(buf, 16, roll); _mav_put_float(buf, 20, pitch); _mav_put_float(buf, 24, yaw); _mav_put_float(buf, 28, xacc); _mav_put_float(buf, 32, yacc); _mav_put_float(buf, 36, zacc); _mav_put_float(buf, 40, xgyro); _mav_put_float(buf, 44, ygyro); _mav_put_float(buf, 48, zgyro); _mav_put_float(buf, 52, lat); _mav_put_float(buf, 56, lon); _mav_put_float(buf, 60, alt); _mav_put_float(buf, 64, std_dev_horz); _mav_put_float(buf, 68, std_dev_vert); _mav_put_float(buf, 72, vn); _mav_put_float(buf, 76, ve); _mav_put_float(buf, 80, vd); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SIM_STATE_LEN); #else mavlink_sim_state_t packet; packet.q1 = q1; packet.q2 = q2; packet.q3 = q3; packet.q4 = q4; packet.roll = roll; packet.pitch = pitch; packet.yaw = yaw; packet.xacc = xacc; packet.yacc = yacc; packet.zacc = zacc; packet.xgyro = xgyro; packet.ygyro = ygyro; packet.zgyro = zgyro; packet.lat = lat; packet.lon = lon; packet.alt = alt; packet.std_dev_horz = std_dev_horz; packet.std_dev_vert = std_dev_vert; packet.vn = vn; packet.ve = ve; packet.vd = vd; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SIM_STATE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_SIM_STATE; #if MAVLINK_CRC_EXTRA return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC); #else return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SIM_STATE_LEN); #endif } /** * @brief Encode a sim_state struct * * @param system_id ID of this system * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * @param sim_state C-struct to read the message contents from */ static inline uint16_t mavlink_msg_sim_state_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_sim_state_t* sim_state) { return mavlink_msg_sim_state_pack(system_id, component_id, msg, sim_state->q1, sim_state->q2, sim_state->q3, sim_state->q4, sim_state->roll, sim_state->pitch, sim_state->yaw, sim_state->xacc, sim_state->yacc, sim_state->zacc, sim_state->xgyro, sim_state->ygyro, sim_state->zgyro, sim_state->lat, sim_state->lon, sim_state->alt, sim_state->std_dev_horz, sim_state->std_dev_vert, sim_state->vn, sim_state->ve, sim_state->vd); } /** * @brief Encode a sim_state struct on a channel * * @param system_id ID of this system * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into * @param sim_state C-struct to read the message contents from */ static inline uint16_t mavlink_msg_sim_state_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_sim_state_t* sim_state) { return mavlink_msg_sim_state_pack_chan(system_id, component_id, chan, msg, sim_state->q1, sim_state->q2, sim_state->q3, sim_state->q4, sim_state->roll, sim_state->pitch, sim_state->yaw, sim_state->xacc, sim_state->yacc, sim_state->zacc, sim_state->xgyro, sim_state->ygyro, sim_state->zgyro, sim_state->lat, sim_state->lon, sim_state->alt, sim_state->std_dev_horz, sim_state->std_dev_vert, sim_state->vn, sim_state->ve, sim_state->vd); } /** * @brief Send a sim_state message * @param chan MAVLink channel to send the message * * @param q1 True attitude quaternion component 1, w (1 in null-rotation) * @param q2 True attitude quaternion component 2, x (0 in null-rotation) * @param q3 True attitude quaternion component 3, y (0 in null-rotation) * @param q4 True attitude quaternion component 4, z (0 in null-rotation) * @param roll Attitude roll expressed as Euler angles, not recommended except for human-readable outputs * @param pitch Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs * @param yaw Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs * @param xacc X acceleration m/s/s * @param yacc Y acceleration m/s/s * @param zacc Z acceleration m/s/s * @param xgyro Angular speed around X axis rad/s * @param ygyro Angular speed around Y axis rad/s * @param zgyro Angular speed around Z axis rad/s * @param lat Latitude in degrees * @param lon Longitude in degrees * @param alt Altitude in meters * @param std_dev_horz Horizontal position standard deviation * @param std_dev_vert Vertical position standard deviation * @param vn True velocity in m/s in NORTH direction in earth-fixed NED frame * @param ve True velocity in m/s in EAST direction in earth-fixed NED frame * @param vd True velocity in m/s in DOWN direction in earth-fixed NED frame */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS static inline void mavlink_msg_sim_state_send(mavlink_channel_t chan, float q1, float q2, float q3, float q4, float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float lat, float lon, float alt, float std_dev_horz, float std_dev_vert, float vn, float ve, float vd) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[MAVLINK_MSG_ID_SIM_STATE_LEN]; _mav_put_float(buf, 0, q1); _mav_put_float(buf, 4, q2); _mav_put_float(buf, 8, q3); _mav_put_float(buf, 12, q4); _mav_put_float(buf, 16, roll); _mav_put_float(buf, 20, pitch); _mav_put_float(buf, 24, yaw); _mav_put_float(buf, 28, xacc); _mav_put_float(buf, 32, yacc); _mav_put_float(buf, 36, zacc); _mav_put_float(buf, 40, xgyro); _mav_put_float(buf, 44, ygyro); _mav_put_float(buf, 48, zgyro); _mav_put_float(buf, 52, lat); _mav_put_float(buf, 56, lon); _mav_put_float(buf, 60, alt); _mav_put_float(buf, 64, std_dev_horz); _mav_put_float(buf, 68, std_dev_vert); _mav_put_float(buf, 72, vn); _mav_put_float(buf, 76, ve); _mav_put_float(buf, 80, vd); #if MAVLINK_CRC_EXTRA _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, buf, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC); #else _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, buf, MAVLINK_MSG_ID_SIM_STATE_LEN); #endif #else mavlink_sim_state_t packet; packet.q1 = q1; packet.q2 = q2; packet.q3 = q3; packet.q4 = q4; packet.roll = roll; packet.pitch = pitch; packet.yaw = yaw; packet.xacc = xacc; packet.yacc = yacc; packet.zacc = zacc; packet.xgyro = xgyro; packet.ygyro = ygyro; packet.zgyro = zgyro; packet.lat = lat; packet.lon = lon; packet.alt = alt; packet.std_dev_horz = std_dev_horz; packet.std_dev_vert = std_dev_vert; packet.vn = vn; packet.ve = ve; packet.vd = vd; #if MAVLINK_CRC_EXTRA _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, (const char *)&packet, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC); #else _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, (const char *)&packet, MAVLINK_MSG_ID_SIM_STATE_LEN); #endif #endif } #if MAVLINK_MSG_ID_SIM_STATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN /* This varient of _send() can be used to save stack space by re-using memory from the receive buffer. The caller provides a mavlink_message_t which is the size of a full mavlink message. This is usually the receive buffer for the channel, and allows a reply to an incoming message with minimum stack space usage. */ static inline void mavlink_msg_sim_state_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float q1, float q2, float q3, float q4, float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float lat, float lon, float alt, float std_dev_horz, float std_dev_vert, float vn, float ve, float vd) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char *buf = (char *)msgbuf; _mav_put_float(buf, 0, q1); _mav_put_float(buf, 4, q2); _mav_put_float(buf, 8, q3); _mav_put_float(buf, 12, q4); _mav_put_float(buf, 16, roll); _mav_put_float(buf, 20, pitch); _mav_put_float(buf, 24, yaw); _mav_put_float(buf, 28, xacc); _mav_put_float(buf, 32, yacc); _mav_put_float(buf, 36, zacc); _mav_put_float(buf, 40, xgyro); _mav_put_float(buf, 44, ygyro); _mav_put_float(buf, 48, zgyro); _mav_put_float(buf, 52, lat); _mav_put_float(buf, 56, lon); _mav_put_float(buf, 60, alt); _mav_put_float(buf, 64, std_dev_horz); _mav_put_float(buf, 68, std_dev_vert); _mav_put_float(buf, 72, vn); _mav_put_float(buf, 76, ve); _mav_put_float(buf, 80, vd); #if MAVLINK_CRC_EXTRA _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, buf, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC); #else _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, buf, MAVLINK_MSG_ID_SIM_STATE_LEN); #endif #else mavlink_sim_state_t *packet = (mavlink_sim_state_t *)msgbuf; packet->q1 = q1; packet->q2 = q2; packet->q3 = q3; packet->q4 = q4; packet->roll = roll; packet->pitch = pitch; packet->yaw = yaw; packet->xacc = xacc; packet->yacc = yacc; packet->zacc = zacc; packet->xgyro = xgyro; packet->ygyro = ygyro; packet->zgyro = zgyro; packet->lat = lat; packet->lon = lon; packet->alt = alt; packet->std_dev_horz = std_dev_horz; packet->std_dev_vert = std_dev_vert; packet->vn = vn; packet->ve = ve; packet->vd = vd; #if MAVLINK_CRC_EXTRA _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, (const char *)packet, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC); #else _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, (const char *)packet, MAVLINK_MSG_ID_SIM_STATE_LEN); #endif #endif } #endif #endif // MESSAGE SIM_STATE UNPACKING /** * @brief Get field q1 from sim_state message * * @return True attitude quaternion component 1, w (1 in null-rotation) */ static inline float mavlink_msg_sim_state_get_q1(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 0); } /** * @brief Get field q2 from sim_state message * * @return True attitude quaternion component 2, x (0 in null-rotation) */ static inline float mavlink_msg_sim_state_get_q2(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 4); } /** * @brief Get field q3 from sim_state message * * @return True attitude quaternion component 3, y (0 in null-rotation) */ static inline float mavlink_msg_sim_state_get_q3(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 8); } /** * @brief Get field q4 from sim_state message * * @return True attitude quaternion component 4, z (0 in null-rotation) */ static inline float mavlink_msg_sim_state_get_q4(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 12); } /** * @brief Get field roll from sim_state message * * @return Attitude roll expressed as Euler angles, not recommended except for human-readable outputs */ static inline float mavlink_msg_sim_state_get_roll(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 16); } /** * @brief Get field pitch from sim_state message * * @return Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs */ static inline float mavlink_msg_sim_state_get_pitch(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 20); } /** * @brief Get field yaw from sim_state message * * @return Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs */ static inline float mavlink_msg_sim_state_get_yaw(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 24); } /** * @brief Get field xacc from sim_state message * * @return X acceleration m/s/s */ static inline float mavlink_msg_sim_state_get_xacc(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 28); } /** * @brief Get field yacc from sim_state message * * @return Y acceleration m/s/s */ static inline float mavlink_msg_sim_state_get_yacc(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 32); } /** * @brief Get field zacc from sim_state message * * @return Z acceleration m/s/s */ static inline float mavlink_msg_sim_state_get_zacc(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 36); } /** * @brief Get field xgyro from sim_state message * * @return Angular speed around X axis rad/s */ static inline float mavlink_msg_sim_state_get_xgyro(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 40); } /** * @brief Get field ygyro from sim_state message * * @return Angular speed around Y axis rad/s */ static inline float mavlink_msg_sim_state_get_ygyro(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 44); } /** * @brief Get field zgyro from sim_state message * * @return Angular speed around Z axis rad/s */ static inline float mavlink_msg_sim_state_get_zgyro(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 48); } /** * @brief Get field lat from sim_state message * * @return Latitude in degrees */ static inline float mavlink_msg_sim_state_get_lat(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 52); } /** * @brief Get field lon from sim_state message * * @return Longitude in degrees */ static inline float mavlink_msg_sim_state_get_lon(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 56); } /** * @brief Get field alt from sim_state message * * @return Altitude in meters */ static inline float mavlink_msg_sim_state_get_alt(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 60); } /** * @brief Get field std_dev_horz from sim_state message * * @return Horizontal position standard deviation */ static inline float mavlink_msg_sim_state_get_std_dev_horz(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 64); } /** * @brief Get field std_dev_vert from sim_state message * * @return Vertical position standard deviation */ static inline float mavlink_msg_sim_state_get_std_dev_vert(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 68); } /** * @brief Get field vn from sim_state message * * @return True velocity in m/s in NORTH direction in earth-fixed NED frame */ static inline float mavlink_msg_sim_state_get_vn(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 72); } /** * @brief Get field ve from sim_state message * * @return True velocity in m/s in EAST direction in earth-fixed NED frame */ static inline float mavlink_msg_sim_state_get_ve(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 76); } /** * @brief Get field vd from sim_state message * * @return True velocity in m/s in DOWN direction in earth-fixed NED frame */ static inline float mavlink_msg_sim_state_get_vd(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 80); } /** * @brief Decode a sim_state message into a struct * * @param msg The message to decode * @param sim_state C-struct to decode the message contents into */ static inline void mavlink_msg_sim_state_decode(const mavlink_message_t* msg, mavlink_sim_state_t* sim_state) { #if MAVLINK_NEED_BYTE_SWAP sim_state->q1 = mavlink_msg_sim_state_get_q1(msg); sim_state->q2 = mavlink_msg_sim_state_get_q2(msg); sim_state->q3 = mavlink_msg_sim_state_get_q3(msg); sim_state->q4 = mavlink_msg_sim_state_get_q4(msg); sim_state->roll = mavlink_msg_sim_state_get_roll(msg); sim_state->pitch = mavlink_msg_sim_state_get_pitch(msg); sim_state->yaw = mavlink_msg_sim_state_get_yaw(msg); sim_state->xacc = mavlink_msg_sim_state_get_xacc(msg); sim_state->yacc = mavlink_msg_sim_state_get_yacc(msg); sim_state->zacc = mavlink_msg_sim_state_get_zacc(msg); sim_state->xgyro = mavlink_msg_sim_state_get_xgyro(msg); sim_state->ygyro = mavlink_msg_sim_state_get_ygyro(msg); sim_state->zgyro = mavlink_msg_sim_state_get_zgyro(msg); sim_state->lat = mavlink_msg_sim_state_get_lat(msg); sim_state->lon = mavlink_msg_sim_state_get_lon(msg); sim_state->alt = mavlink_msg_sim_state_get_alt(msg); sim_state->std_dev_horz = mavlink_msg_sim_state_get_std_dev_horz(msg); sim_state->std_dev_vert = mavlink_msg_sim_state_get_std_dev_vert(msg); sim_state->vn = mavlink_msg_sim_state_get_vn(msg); sim_state->ve = mavlink_msg_sim_state_get_ve(msg); sim_state->vd = mavlink_msg_sim_state_get_vd(msg); #else memcpy(sim_state, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SIM_STATE_LEN); #endif }
oroca/oroca_bldc_dev
oroca_bldc_FW/lib/mavlink/common/mavlink_msg_sim_state.h
C
mit
26,727
### Consumer key and secret provided in *test.json* are only for test purposes. ### Do not use it on your own project. Set accessToken and accessTokenSecret manually before calling APIs which requires access token. For example, Realtime/getUserChannel, which is used on basic_comet.js and robot.js. ```json { "https": true , "consumerKey": "MY_CONSUMER_KEY" , "consumerSecret": "MY_CONSUMER_SECRET" , "accessToken": "MY_ACCESS_TOKEN" , "accessTokenSecret": "MY_ACCESS_TOKEN_SECRET" } ```
pH200/node-plurk
examples/README.md
Markdown
mit
513
namespace Contega { internal class Program { private static void Main(string[] args) { } } }
melazarus/contega
Contega/Program.cs
C#
mit
131
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.cache_classes = true # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web servers # and those relying on copy on write to perform better. # Rake tasks automatically ignore this option for performance. config.eager_load = true # Full error reports are disabled and caching is turned on. config.consider_all_requests_local = false config.action_controller.perform_caching = true # Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.action_controller.asset_host = 'http://assets.example.com' # Specifies the header that your server uses for sending files. # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX # Mount Action Cable outside main process or domain # config.action_cable.mount_path = nil # config.action_cable.url = 'wss://example.com/cable' # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true # Use the lowest log level to ensure availability of diagnostic information # when problems arise. config.log_level = :debug # Prepend all log lines with the following tags. config.log_tags = [ :request_id ] # Use a different cache store in production. # config.cache_store = :mem_cache_store # Use a real queuing backend for Active Job (and separate queues per environment) # config.active_job.queue_adapter = :resque # config.active_job.queue_name_prefix = "ticket-system_#{Rails.env}" config.action_mailer.perform_caching = false # Ignore bad email addresses and do not raise email delivery errors. # Set this to true and configure the email server for immediate delivery to raise delivery errors. # config.action_mailer.raise_delivery_errors = false # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true # Send deprecation notices to registered listeners. config.active_support.deprecation = :notify # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = ::Logger::Formatter.new # Use a different logger for distributed setups. # require 'syslog/logger' # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') if ENV["RAILS_LOG_TO_STDOUT"].present? logger = ActiveSupport::Logger.new(STDOUT) logger.formatter = config.log_formatter config.logger = ActiveSupport::TaggedLogging.new(logger) end # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false end
niltonvasques/rails-graphql-sample
config/environments/production.rb
Ruby
mit
3,259
require File.dirname(__FILE__) + '/translate' require 'yaml' def translations default = YAML.load_file(File.dirname(__FILE__) + '/../translations/en_us.yml') translated = YAML.load_file(File.dirname(__FILE__) + '/../translations/zh_cn.yml') default.merge(translated) end
gcao/jsgameviewer
lib/zh_cn.rb
Ruby
mit
277
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FluentHub.ModelConverter.FluentBuilderItems { public class BuildItemChain<T, BuildItem> : IBuildItemChain<T, BuildItem> where BuildItem : IBuildItem<T> { public IModelBuilder<T> Builder { get; set; } public IBinaryConverter Converter { get; set; } public IChain<IBuildItem<T>> Next { get; set; } public IBuildItem<T> Value { get; set; } } }
shchy/FluentHub
FluentHub/ModelConverter/FluentBuilderItems/BuildItemChain.cs
C#
mit
526
<!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <title>IconFont</title> <link rel="stylesheet" href="/xfd-mobile/styles/font/demo.css"> <link rel="stylesheet" href="/xfd-mobile/styles/font/iconfont.css"> </head> <body> <div class="main markdown"> <h1>IconFont 图标</h1> <ul class="icon_lists clear"> <li> <i class="icon iconfont icon-deletefill"></i> <div class="name">delete_fill</div> <div class="fontclass">.icon-deletefill</div> </li> <li> <i class="icon iconfont icon-downloadfill"></i> <div class="name">download-fill</div> <div class="fontclass">.icon-downloadfill</div> </li> <li> <i class="icon iconfont icon-download"></i> <div class="name">download</div> <div class="fontclass">.icon-download</div> </li> <li> <i class="icon iconfont icon-guanbi2fill"></i> <div class="name">关闭2-fill</div> <div class="fontclass">.icon-guanbi2fill</div> </li> <li> <i class="icon iconfont icon-tishifill"></i> <div class="name">提示-fill</div> <div class="fontclass">.icon-tishifill</div> </li> <li> <i class="icon iconfont icon-yuanxingxuanzhongfill"></i> <div class="name">圆形选中-fill</div> <div class="fontclass">.icon-yuanxingxuanzhongfill</div> </li> <li> <i class="icon iconfont icon-dingdan"></i> <div class="name">订单</div> <div class="fontclass">.icon-dingdan</div> </li> <li> <i class="icon iconfont icon-gengduo1"></i> <div class="name">更多</div> <div class="fontclass">.icon-gengduo1</div> </li> <li> <i class="icon iconfont icon-qiapianxingshi"></i> <div class="name">卡片形式</div> <div class="fontclass">.icon-qiapianxingshi</div> </li> <li> <i class="icon iconfont icon-liebiaoxingshi"></i> <div class="name">列表形式</div> <div class="fontclass">.icon-liebiaoxingshi</div> </li> <li> <i class="icon iconfont icon-liuyanfill"></i> <div class="name">留言-fill</div> <div class="fontclass">.icon-liuyanfill</div> </li> <li> <i class="icon iconfont icon-liuyan"></i> <div class="name">留言</div> <div class="fontclass">.icon-liuyan</div> </li> <li> <i class="icon iconfont icon-shanchu"></i> <div class="name">删除</div> <div class="fontclass">.icon-shanchu</div> </li> <li> <i class="icon iconfont icon-shezhi"></i> <div class="name">设置</div> <div class="fontclass">.icon-shezhi</div> </li> <li> <i class="icon iconfont icon-sousuoleimufill"></i> <div class="name">搜索类目-fill</div> <div class="fontclass">.icon-sousuoleimufill</div> </li> <li> <i class="icon iconfont icon-sousuoleimu"></i> <div class="name">搜索类目</div> <div class="fontclass">.icon-sousuoleimu</div> </li> <li> <i class="icon iconfont icon-xiangji1fill"></i> <div class="name">相机1-fill</div> <div class="fontclass">.icon-xiangji1fill</div> </li> <li> <i class="icon iconfont icon-xiangji2"></i> <div class="name">相机2</div> <div class="fontclass">.icon-xiangji2</div> </li> <li> <i class="icon iconfont icon-androidgengduo"></i> <div class="name">Android更多</div> <div class="fontclass">.icon-androidgengduo</div> </li> <li> <i class="icon iconfont icon-leimu"></i> <div class="name">类目</div> <div class="fontclass">.icon-leimu</div> </li> <li> <i class="icon iconfont icon-caidan"></i> <div class="name">菜单</div> <div class="fontclass">.icon-caidan</div> </li> <li> <i class="icon iconfont icon-zantongfill"></i> <div class="name">赞同-fill</div> <div class="fontclass">.icon-zantongfill</div> </li> <li> <i class="icon iconfont icon-yduixingxingkongxin"></i> <div class="name">YDUI-星星(空心)</div> <div class="fontclass">.icon-yduixingxingkongxin</div> </li> <li> <i class="icon iconfont icon-yduixingxingshixin"></i> <div class="name">YDUI-星星(实心)</div> <div class="fontclass">.icon-yduixingxingshixin</div> </li> <li> <i class="icon iconfont icon-duozhongzhifu"></i> <div class="name">多种支付</div> <div class="fontclass">.icon-duozhongzhifu</div> </li> <li> <i class="icon iconfont icon-erweima"></i> <div class="name">二维码</div> <div class="fontclass">.icon-erweima</div> </li> <li> <i class="icon iconfont icon-huwai"></i> <div class="name">户外</div> <div class="fontclass">.icon-huwai</div> </li> <li> <i class="icon iconfont icon-jujia"></i> <div class="name">居家</div> <div class="fontclass">.icon-jujia</div> </li> <li> <i class="icon iconfont icon-kuzi"></i> <div class="name">裤子 </div> <div class="fontclass">.icon-kuzi</div> </li> <li> <i class="icon iconfont icon-muying"></i> <div class="name">母婴</div> <div class="fontclass">.icon-muying</div> </li> <li> <i class="icon iconfont icon-nanzhuang"></i> <div class="name">男装</div> <div class="fontclass">.icon-nanzhuang</div> </li> <li> <i class="icon iconfont icon-neiyi"></i> <div class="name">内衣</div> <div class="fontclass">.icon-neiyi</div> </li> <li> <i class="icon iconfont icon-nvzhuang"></i> <div class="name">女装</div> <div class="fontclass">.icon-nvzhuang</div> </li> <li> <i class="icon iconfont icon-xiangbao"></i> <div class="name">箱包</div> <div class="fontclass">.icon-xiangbao</div> </li> <li> <i class="icon iconfont icon-others"></i> <div class="name">others</div> <div class="fontclass">.icon-others</div> </li> <li> <i class="icon iconfont icon-lishijilu"></i> <div class="name">历史记录</div> <div class="fontclass">.icon-lishijilu</div> </li> <li> <i class="icon iconfont icon-zhuangxiubi"></i> <div class="name">装修币</div> <div class="fontclass">.icon-zhuangxiubi</div> </li> <li> <i class="icon iconfont icon-weixintubiao"></i> <div class="name">微信图标</div> <div class="fontclass">.icon-weixintubiao</div> </li> <li> <i class="icon iconfont icon-gengduo"></i> <div class="name">右</div> <div class="fontclass">.icon-gengduo</div> </li> <li> <i class="icon iconfont icon-wanchengchenggong"></i> <div class="name">完成成功</div> <div class="fontclass">.icon-wanchengchenggong</div> </li> <li> <i class="icon iconfont icon-zhifubao"></i> <div class="name">支付宝</div> <div class="fontclass">.icon-zhifubao</div> </li> <li> <i class="icon iconfont icon-weixinfukuan"></i> <div class="name">微信付款</div> <div class="fontclass">.icon-weixinfukuan</div> </li> <li> <i class="icon iconfont icon-jiaofeigray"></i> <div class="name">缴费</div> <div class="fontclass">.icon-jiaofeigray</div> </li> <li> <i class="icon iconfont icon-fanhui"></i> <div class="name">返回</div> <div class="fontclass">.icon-fanhui</div> </li> <li> <i class="icon iconfont icon-weixinhaoyou"></i> <div class="name">微信好友</div> <div class="fontclass">.icon-weixinhaoyou</div> </li> <li> <i class="icon iconfont icon-pengyouquan"></i> <div class="name">朋友圈</div> <div class="fontclass">.icon-pengyouquan</div> </li> <li> <i class="icon iconfont icon-faxian"></i> <div class="name">发现</div> <div class="fontclass">.icon-faxian</div> </li> <li> <i class="icon iconfont icon-wode"></i> <div class="name">我的</div> <div class="fontclass">.icon-wode</div> </li> <li> <i class="icon iconfont icon-bianjiezhifu-"></i> <div class="name">便捷支付-01</div> <div class="fontclass">.icon-bianjiezhifu-</div> </li> <li> <i class="icon iconfont icon-fujinshangwu"></i> <div class="name">附近选中</div> <div class="fontclass">.icon-fujinshangwu</div> </li> <li> <i class="icon iconfont icon-xuanzhong"></i> <div class="name">选中</div> <div class="fontclass">.icon-xuanzhong</div> </li> <li> <i class="icon iconfont icon-saoyisao"></i> <div class="name">扫一扫</div> <div class="fontclass">.icon-saoyisao</div> </li> <li> <i class="icon iconfont icon-guanbi1"></i> <div class="name">关闭</div> <div class="fontclass">.icon-guanbi1</div> </li> <li> <i class="icon iconfont icon-wangluoyichang"></i> <div class="name">网络异常</div> <div class="fontclass">.icon-wangluoyichang</div> </li> <li> <i class="icon iconfont icon-fenxiang"></i> <div class="name">分享</div> <div class="fontclass">.icon-fenxiang</div> </li> <li> <i class="icon iconfont icon-qianbao"></i> <div class="name">钱包</div> <div class="fontclass">.icon-qianbao</div> </li> <li> <i class="icon iconfont icon-lianxikefu"></i> <div class="name">联系客服</div> <div class="fontclass">.icon-lianxikefu</div> </li> <li> <i class="icon iconfont icon-saoma"></i> <div class="name">扫码</div> <div class="fontclass">.icon-saoma</div> </li> <li> <i class="icon iconfont icon-yichang"></i> <div class="name">异常</div> <div class="fontclass">.icon-yichang</div> </li> <li> <i class="icon iconfont icon-jijianfasong"></i> <div class="name">16寄件、发送</div> <div class="fontclass">.icon-jijianfasong</div> </li> <li> <i class="icon iconfont icon-zuzhijiagoujiekou"></i> <div class="name">24组织架构、接口</div> <div class="fontclass">.icon-zuzhijiagoujiekou</div> </li> <li> <i class="icon iconfont icon-shezhi-xianxing"></i> <div class="name">205设置-线性</div> <div class="fontclass">.icon-shezhi-xianxing</div> </li> <li> <i class="icon iconfont icon-shezhi2"></i> <div class="name">205设置</div> <div class="fontclass">.icon-shezhi2</div> </li> <li> <i class="icon iconfont icon-xianshikejian"></i> <div class="name">240显示、可见</div> <div class="fontclass">.icon-xianshikejian</div> </li> <li> <i class="icon iconfont icon-jia-xianxingyuankuang"></i> <div class="name">301加-线性圆框</div> <div class="fontclass">.icon-jia-xianxingyuankuang</div> </li> <li> <i class="icon iconfont icon-jia-yuankuang"></i> <div class="name">301加-圆框</div> <div class="fontclass">.icon-jia-yuankuang</div> </li> <li> <i class="icon iconfont icon-jian-yuankuang"></i> <div class="name">302减-圆框</div> <div class="fontclass">.icon-jian-yuankuang</div> </li> <li> <i class="icon iconfont icon-jian-xianxingyuankuang"></i> <div class="name">302减-线性圆框</div> <div class="fontclass">.icon-jian-xianxingyuankuang</div> </li> <li> <i class="icon iconfont icon-shouji"></i> <div class="name">手机</div> <div class="fontclass">.icon-shouji</div> </li> <li> <i class="icon iconfont icon-renzheng"></i> <div class="name">认证</div> <div class="fontclass">.icon-renzheng</div> </li> <li> <i class="icon iconfont icon-renzhengshibai"></i> <div class="name">认证失败</div> <div class="fontclass">.icon-renzhengshibai</div> </li> <li> <i class="icon iconfont icon-chepaibangdingchenggong"></i> <div class="name">车牌绑定成功</div> <div class="fontclass">.icon-chepaibangdingchenggong</div> </li> <li> <i class="icon iconfont icon-renzhengchenggong"></i> <div class="name">认证成功</div> <div class="fontclass">.icon-renzhengchenggong</div> </li> <li> <i class="icon iconfont icon-chepaiyibangding"></i> <div class="name">车牌已绑定</div> <div class="fontclass">.icon-chepaiyibangding</div> </li> <li> <i class="icon iconfont icon-shoufeiyuanquxiaodingdan"></i> <div class="name">收费员取消订单</div> <div class="fontclass">.icon-shoufeiyuanquxiaodingdan</div> </li> <li> <i class="icon iconfont icon-laidian"></i> <div class="name">来电</div> <div class="fontclass">.icon-laidian</div> </li> <li> <i class="icon iconfont icon-chepaibangdingshibai"></i> <div class="name">车牌绑定失败</div> <div class="fontclass">.icon-chepaibangdingshibai</div> </li> <li> <i class="icon iconfont icon-jiazai"></i> <div class="name">加载</div> <div class="fontclass">.icon-jiazai</div> </li> <li> <i class="icon iconfont icon-jiankongcheliang"></i> <div class="name">监控车辆</div> <div class="fontclass">.icon-jiankongcheliang</div> </li> <li> <i class="icon iconfont icon-wangluochucuo"></i> <div class="name">网络出错</div> <div class="fontclass">.icon-wangluochucuo</div> </li> <li> <i class="icon iconfont icon-wushuju"></i> <div class="name">无数据</div> <div class="fontclass">.icon-wushuju</div> </li> <li> <i class="icon iconfont icon-cheweiguanjia"></i> <div class="name">车位管家</div> <div class="fontclass">.icon-cheweiguanjia</div> </li> <li> <i class="icon iconfont icon-faxian1"></i> <div class="name">发现</div> <div class="fontclass">.icon-faxian1</div> </li> <li> <i class="icon iconfont icon-fujin"></i> <div class="name">附近</div> <div class="fontclass">.icon-fujin</div> </li> <li> <i class="icon iconfont icon-bianjiezhifu"></i> <div class="name">便捷支付</div> <div class="fontclass">.icon-bianjiezhifu</div> </li> <li> <i class="icon iconfont icon-gerenzhongxin"></i> <div class="name">个人中心</div> <div class="fontclass">.icon-gerenzhongxin</div> </li> <li> <i class="icon iconfont icon-dagou"></i> <div class="name">打钩</div> <div class="fontclass">.icon-dagou</div> </li> <li> <i class="icon iconfont icon-picture_fill"></i> <div class="name">picture_fill</div> <div class="fontclass">.icon-picture_fill</div> </li> <li> <i class="icon iconfont icon-ditu"></i> <div class="name">地图</div> <div class="fontclass">.icon-ditu</div> </li> <li> <i class="icon iconfont icon-tupian"></i> <div class="name"> 图片</div> <div class="fontclass">.icon-tupian</div> </li> <li> <i class="icon iconfont icon-shezhi1"></i> <div class="name">设置</div> <div class="fontclass">.icon-shezhi1</div> </li> <li> <i class="icon iconfont icon-tuichu"></i> <div class="name">退出</div> <div class="fontclass">.icon-tuichu</div> </li> <li> <i class="icon iconfont icon-dingdan1"></i> <div class="name"> 订单</div> <div class="fontclass">.icon-dingdan1</div> </li> <li> <i class="icon iconfont icon-dingdanjihe"></i> <div class="name"> 订单集合</div> <div class="fontclass">.icon-dingdanjihe</div> </li> <li> <i class="icon iconfont icon-dingdanyichenggong"></i> <div class="name"> 订单 已成功</div> <div class="fontclass">.icon-dingdanyichenggong</div> </li> <li> <i class="icon iconfont icon-yijianfankui"></i> <div class="name"> 意见反馈</div> <div class="fontclass">.icon-yijianfankui</div> </li> <li> <i class="icon iconfont icon-feijizhong"></i> <div class="name">飞机中</div> <div class="fontclass">.icon-feijizhong</div> </li> <li> <i class="icon iconfont icon-xiangxiajiantoucuxiao"></i> <div class="name"> 向下箭头粗小</div> <div class="fontclass">.icon-xiangxiajiantoucuxiao</div> </li> <li> <i class="icon iconfont icon-xitongfanmang"></i> <div class="name">系统繁忙</div> <div class="fontclass">.icon-xitongfanmang</div> </li> <li> <i class="icon iconfont icon-fuwuqi"></i> <div class="name">服务器</div> <div class="fontclass">.icon-fuwuqi</div> </li> <li> <i class="icon iconfont icon-shibai"></i> <div class="name">失败</div> <div class="fontclass">.icon-shibai</div> </li> <li> <i class="icon iconfont icon-empty"></i> <div class="name">空</div> <div class="fontclass">.icon-empty</div> </li> <li> <i class="icon iconfont icon-jia"></i> <div class="name">加</div> <div class="fontclass">.icon-jia</div> </li> <li> <i class="icon iconfont icon-zanwuxiaoxijilu"></i> <div class="name">暂无消息记录1</div> <div class="fontclass">.icon-zanwuxiaoxijilu</div> </li> <li> <i class="icon iconfont icon-wuquankeyong"></i> <div class="name">无券可用</div> <div class="fontclass">.icon-wuquankeyong</div> </li> <li> <i class="icon iconfont icon-wuquanguoqi"></i> <div class="name">无券过期</div> <div class="fontclass">.icon-wuquanguoqi</div> </li> <li> <i class="icon iconfont icon-gouwuxinxi"></i> <div class="name">购物信息</div> <div class="fontclass">.icon-gouwuxinxi</div> </li> <li> <i class="icon iconfont icon-huodongjieshu"></i> <div class="name">活动结束</div> <div class="fontclass">.icon-huodongjieshu</div> </li> <li> <i class="icon iconfont icon-huodongweikaishi"></i> <div class="name">活动未开始</div> <div class="fontclass">.icon-huodongweikaishi</div> </li> <li> <i class="icon iconfont icon-chenggong"></i> <div class="name">成功(1)</div> <div class="fontclass">.icon-chenggong</div> </li> <li> <i class="icon iconfont icon-zanwukeyongtingchequan"></i> <div class="name">暂无可用停车券</div> <div class="fontclass">.icon-zanwukeyongtingchequan</div> </li> <li> <i class="icon iconfont icon-car"></i> <div class="name">car</div> <div class="fontclass">.icon-car</div> </li> <li> <i class="icon iconfont icon-zanwushuju"></i> <div class="name">暂无数据</div> <div class="fontclass">.icon-zanwushuju</div> </li> <li> <i class="icon iconfont icon-wangluoyichang1"></i> <div class="name">网络异常</div> <div class="fontclass">.icon-wangluoyichang1</div> </li> <li> <i class="icon iconfont icon-jiazaishibai"></i> <div class="name">加载失败</div> <div class="fontclass">.icon-jiazaishibai</div> </li> <li> <i class="icon iconfont icon-bianjiezhifu1"></i> <div class="name">便捷支付</div> <div class="fontclass">.icon-bianjiezhifu1</div> </li> <li> <i class="icon iconfont icon-saoyisao1"></i> <div class="name">扫一扫</div> <div class="fontclass">.icon-saoyisao1</div> </li> <li> <i class="icon iconfont icon-daohang"></i> <div class="name">导航</div> <div class="fontclass">.icon-daohang</div> </li> <li> <i class="icon iconfont icon-weizhi"></i> <div class="name">位置</div> <div class="fontclass">.icon-weizhi</div> </li> <li> <i class="icon iconfont icon-biaoji"></i> <div class="name">标记</div> <div class="fontclass">.icon-biaoji</div> </li> <li> <i class="icon iconfont icon-weixinsousuoicon"></i> <div class="name">微信搜索icon</div> <div class="fontclass">.icon-weixinsousuoicon</div> </li> <li> <i class="icon iconfont icon-bunengxianshangzhifu"></i> <div class="name">不能线上支付</div> <div class="fontclass">.icon-bunengxianshangzhifu</div> </li> <li> <i class="icon iconfont icon-biaojichenggong"></i> <div class="name">标记成功</div> <div class="fontclass">.icon-biaojichenggong</div> </li> <li> <i class="icon iconfont icon-gengduo-copy"></i> <div class="name">右</div> <div class="fontclass">.icon-gengduo-copy</div> </li> <li> <i class="icon iconfont icon-xuanze"></i> <div class="name">选择</div> <div class="fontclass">.icon-xuanze</div> </li> <li> <i class="icon iconfont icon-agulogo"></i> <div class="name">阿古logo</div> <div class="fontclass">.icon-agulogo</div> </li> <li> <i class="icon iconfont icon-caigou"></i> <div class="name">采购</div> <div class="fontclass">.icon-caigou</div> </li> <li> <i class="icon iconfont icon-dingwei"></i> <div class="name">定位</div> <div class="fontclass">.icon-dingwei</div> </li> <li> <i class="icon iconfont icon-baofei"></i> <div class="name">报废</div> <div class="fontclass">.icon-baofei</div> </li> <li> <i class="icon iconfont icon-fujian"></i> <div class="name">附件</div> <div class="fontclass">.icon-fujian</div> </li> <li> <i class="icon iconfont icon-geren"></i> <div class="name">个人</div> <div class="fontclass">.icon-geren</div> </li> <li> <i class="icon iconfont icon-guzhang"></i> <div class="name">故障</div> <div class="fontclass">.icon-guzhang</div> </li> <li> <i class="icon iconfont icon-jieyong"></i> <div class="name">借用</div> <div class="fontclass">.icon-jieyong</div> </li> <li> <i class="icon iconfont icon-jian"></i> <div class="name">减</div> <div class="fontclass">.icon-jian</div> </li> <li> <i class="icon iconfont icon-saoyisaoxiao"></i> <div class="name">扫一扫小</div> <div class="fontclass">.icon-saoyisaoxiao</div> </li> <li> <i class="icon iconfont icon-shouye"></i> <div class="name">首页</div> <div class="fontclass">.icon-shouye</div> </li> <li> <i class="icon iconfont icon-lingyongshenqing"></i> <div class="name">领用申请</div> <div class="fontclass">.icon-lingyongshenqing</div> </li> <li> <i class="icon iconfont icon-shangchuantupian"></i> <div class="name">上传图片</div> <div class="fontclass">.icon-shangchuantupian</div> </li> <li> <i class="icon iconfont icon-tianjia"></i> <div class="name">添加</div> <div class="fontclass">.icon-tianjia</div> </li> <li> <i class="icon iconfont icon-wodeshenqing"></i> <div class="name">我的申请</div> <div class="fontclass">.icon-wodeshenqing</div> </li> <li> <i class="icon iconfont icon-tuikushenqing"></i> <div class="name">退库申请</div> <div class="fontclass">.icon-tuikushenqing</div> </li> <li> <i class="icon iconfont icon-zhuanyishenqing"></i> <div class="name">转移申请</div> <div class="fontclass">.icon-zhuanyishenqing</div> </li> <li> <i class="icon iconfont icon-xuanze1"></i> <div class="name">选择2</div> <div class="fontclass">.icon-xuanze1</div> </li> <li> <i class="icon iconfont icon-xuanze2"></i> <div class="name">选择</div> <div class="fontclass">.icon-xuanze2</div> </li> <li> <i class="icon iconfont icon-xiaoxi"></i> <div class="name">消息</div> <div class="fontclass">.icon-xiaoxi</div> </li> </ul> <h2 id="font-class-">font-class引用</h2> <hr> <p>font-class是unicode使用方式的一种变种,主要是解决unicode书写不直观,语意不明确的问题。</p> <p>与unicode使用方式相比,具有如下特点:</p> <ul> <li>兼容性良好,支持ie8+,及所有现代浏览器。</li> <li>相比于unicode语意明确,书写更直观。可以很容易分辨这个icon是什么。</li> <li>因为使用class来定义图标,所以当要替换图标时,只需要修改class里面的unicode引用。</li> <li>不过因为本质上还是使用的字体,所以多色图标还是不支持的。</li> </ul> <p>使用步骤如下:</p> <h3 id="-fontclass-">第一步:引入项目下面生成的fontclass代码:</h3> <pre><code class="lang-js hljs javascript"><span class="hljs-comment">&lt;link rel="stylesheet" type="text/css" href="./iconfont.css"&gt;</span></code></pre> <h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h3> <pre><code class="lang-css hljs">&lt;<span class="hljs-selector-tag">i</span> <span class="hljs-selector-tag">class</span>="<span class="hljs-selector-tag">iconfont</span> <span class="hljs-selector-tag">icon-xxx</span>"&gt;&lt;/<span class="hljs-selector-tag">i</span>&gt;</code></pre> <blockquote> <p>"iconfont"是你项目下的font-family。可以通过编辑项目查看,默认是"iconfont"。</p> </blockquote> </div> </body> </html>
v-xiaofendui/XFD-UI
www/styles/font/demo_fontclass.html
HTML
mit
36,720
#!/usr/bin/env python3 import sys, os, collections from pathlib import Path from PyQt5.QtCore import * from PyQt5.QtWidgets import QApplication from PyQt5.QtWebKitWidgets import QWebView from PyQt5.QtWebKit import QWebSettings from PyQt5.QtNetwork import QNetworkRequest Signal = pyqtSignal Slot = pyqtSlot class ExampleScript(object): def __call__(self, input): return {"result": 1.2, "input": input} class DataContainer(QObject): def __init__(self, data): self.data = data class ReactHub(QObject): def __init__(self): super().__init__() self.exampleExecutor = ExampleScript() @Slot(str) def run(self, input, data): print("Executing input", signalName, input) if hasattr(self, signalName): signal = getattr(self, signalName) signal.emit(DataContainer(data)) on_client_event = Signal(str) signal_test = Signal(DataContainer) class ReactApplication(QWebView): def __init__(self, htmlName="empty.html"): super(ReactApplication, self).__init__() self.baseHtml = Path(__file__).parent / "www" / htmlName print("Base Html:",self.baseHtml) self.hub = ReactHub() def init(self): self.loadFinished.connect(self.onLoad) self.load(QUrl("file://"+self.baseHtml.as_posix())) self.show() def onLoad(self): # This is the body of a web browser tab self.page().settings().setAttribute(QWebSettings.DeveloperExtrasEnabled, True) # This is the actual context/frame a webpage is running in. # Other frames could include iframes or such. self.myFrame = self.page().mainFrame() # ATTENTION here's the magic that sets a bridge between Python to HTML self.myFrame.addToJavaScriptWindowObject("hub", self.hub) # Tell the HTML side, we are open for business # self.myFrame.evaluateJavaScript("ApplicationIsReady()") self.myFrame.evaluateJavaScript(""" """) def main(): #Kickoff the QT environment app = QApplication(sys.argv) # reactApp = ReactApplication("empty.html") # reactApp = ReactApplication("timer.html") reactApp = ReactApplication("trees.html") reactApp.init() sys.exit(app.exec_()) if __name__ == '__main__': main()
elcritch/reactqt
main.py
Python
mit
2,414
#!/usr/bin/env python # coding=utf-8 ''' 这个题目很无聊,纯粹考操作和递归,居然没看清楚矩阵可以不是方的,还检查了好一会儿 ''' class Solution(object): def updateBoard(self, board, click): """ :type board: List[List[str]] :type click: List[int] :rtype: List[List[str]] """ if board[click[0]][click[1]] == 'M': self.revealMine(board,click) if board[click[0]][click[1]] == 'E': self.revealEmptySquare(board,click) return board def revealMine(self, board, click): board[click[0]][click[1]] = 'X' return def revealEmptySquare(self, board, click): xl = len(board) yl = len(board[0]) adjList = [] count = 0 idir = [-1,-1,-1,0,1,1,1,0] jdir = [-1,0,1,1,1,0,-1,-1] for i in range(8): x, y = click[0]+idir[i], click[1]+jdir[i] if x>=0 and x<xl and y>=0 and y<yl: if board[x][y] == 'M': count += 1 elif board[x][y] == 'E': adjList.append([x,y]) if count: board[click[0]][click[1]] = str(count) else: board[click[0]][click[1]] = 'B' for c in adjList: self.revealEmptySquare(board, c) return if __name__ == '__main__': s = Solution() print s.updateBoard([['E', 'E', 'E', 'E', 'E'], ['E', 'E', 'M', 'E', 'E'], ['E', 'E', 'E', 'E', 'E'], ['E', 'E', 'E', 'E', 'E']],[3,0])
xijunlee/leetcode
529.py
Python
mit
1,422
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.analytics.synapse.artifacts.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; import java.util.Map; /** HDInsight Spark activity. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @JsonTypeName("HDInsightSpark") @JsonFlatten @Fluent public class HDInsightSparkActivity extends ExecutionActivity { /* * The root path in 'sparkJobLinkedService' for all the job’s files. Type: * string (or Expression with resultType string). */ @JsonProperty(value = "typeProperties.rootPath", required = true) private Object rootPath; /* * The relative path to the root folder of the code/package to be executed. * Type: string (or Expression with resultType string). */ @JsonProperty(value = "typeProperties.entryFilePath", required = true) private Object entryFilePath; /* * The user-specified arguments to HDInsightSparkActivity. */ @JsonProperty(value = "typeProperties.arguments") private List<Object> arguments; /* * Debug info option. */ @JsonProperty(value = "typeProperties.getDebugInfo") private HDInsightActivityDebugInfoOption getDebugInfo; /* * The storage linked service for uploading the entry file and * dependencies, and for receiving logs. */ @JsonProperty(value = "typeProperties.sparkJobLinkedService") private LinkedServiceReference sparkJobLinkedService; /* * The application's Java/Spark main class. */ @JsonProperty(value = "typeProperties.className") private String className; /* * The user to impersonate that will execute the job. Type: string (or * Expression with resultType string). */ @JsonProperty(value = "typeProperties.proxyUser") private Object proxyUser; /* * Spark configuration property. */ @JsonProperty(value = "typeProperties.sparkConfig") private Map<String, Object> sparkConfig; /** * Get the rootPath property: The root path in 'sparkJobLinkedService' for all the job’s files. Type: string (or * Expression with resultType string). * * @return the rootPath value. */ public Object getRootPath() { return this.rootPath; } /** * Set the rootPath property: The root path in 'sparkJobLinkedService' for all the job’s files. Type: string (or * Expression with resultType string). * * @param rootPath the rootPath value to set. * @return the HDInsightSparkActivity object itself. */ public HDInsightSparkActivity setRootPath(Object rootPath) { this.rootPath = rootPath; return this; } /** * Get the entryFilePath property: The relative path to the root folder of the code/package to be executed. Type: * string (or Expression with resultType string). * * @return the entryFilePath value. */ public Object getEntryFilePath() { return this.entryFilePath; } /** * Set the entryFilePath property: The relative path to the root folder of the code/package to be executed. Type: * string (or Expression with resultType string). * * @param entryFilePath the entryFilePath value to set. * @return the HDInsightSparkActivity object itself. */ public HDInsightSparkActivity setEntryFilePath(Object entryFilePath) { this.entryFilePath = entryFilePath; return this; } /** * Get the arguments property: The user-specified arguments to HDInsightSparkActivity. * * @return the arguments value. */ public List<Object> getArguments() { return this.arguments; } /** * Set the arguments property: The user-specified arguments to HDInsightSparkActivity. * * @param arguments the arguments value to set. * @return the HDInsightSparkActivity object itself. */ public HDInsightSparkActivity setArguments(List<Object> arguments) { this.arguments = arguments; return this; } /** * Get the getDebugInfo property: Debug info option. * * @return the getDebugInfo value. */ public HDInsightActivityDebugInfoOption getGetDebugInfo() { return this.getDebugInfo; } /** * Set the getDebugInfo property: Debug info option. * * @param getDebugInfo the getDebugInfo value to set. * @return the HDInsightSparkActivity object itself. */ public HDInsightSparkActivity setGetDebugInfo(HDInsightActivityDebugInfoOption getDebugInfo) { this.getDebugInfo = getDebugInfo; return this; } /** * Get the sparkJobLinkedService property: The storage linked service for uploading the entry file and dependencies, * and for receiving logs. * * @return the sparkJobLinkedService value. */ public LinkedServiceReference getSparkJobLinkedService() { return this.sparkJobLinkedService; } /** * Set the sparkJobLinkedService property: The storage linked service for uploading the entry file and dependencies, * and for receiving logs. * * @param sparkJobLinkedService the sparkJobLinkedService value to set. * @return the HDInsightSparkActivity object itself. */ public HDInsightSparkActivity setSparkJobLinkedService(LinkedServiceReference sparkJobLinkedService) { this.sparkJobLinkedService = sparkJobLinkedService; return this; } /** * Get the className property: The application's Java/Spark main class. * * @return the className value. */ public String getClassName() { return this.className; } /** * Set the className property: The application's Java/Spark main class. * * @param className the className value to set. * @return the HDInsightSparkActivity object itself. */ public HDInsightSparkActivity setClassName(String className) { this.className = className; return this; } /** * Get the proxyUser property: The user to impersonate that will execute the job. Type: string (or Expression with * resultType string). * * @return the proxyUser value. */ public Object getProxyUser() { return this.proxyUser; } /** * Set the proxyUser property: The user to impersonate that will execute the job. Type: string (or Expression with * resultType string). * * @param proxyUser the proxyUser value to set. * @return the HDInsightSparkActivity object itself. */ public HDInsightSparkActivity setProxyUser(Object proxyUser) { this.proxyUser = proxyUser; return this; } /** * Get the sparkConfig property: Spark configuration property. * * @return the sparkConfig value. */ public Map<String, Object> getSparkConfig() { return this.sparkConfig; } /** * Set the sparkConfig property: Spark configuration property. * * @param sparkConfig the sparkConfig value to set. * @return the HDInsightSparkActivity object itself. */ public HDInsightSparkActivity setSparkConfig(Map<String, Object> sparkConfig) { this.sparkConfig = sparkConfig; return this; } }
Azure/azure-sdk-for-java
sdk/synapse/azure-analytics-synapse-artifacts/src/main/java/com/azure/analytics/synapse/artifacts/models/HDInsightSparkActivity.java
Java
mit
7,677
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ /* Default standalone editor fonts */ .monaco-editor { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif; --monaco-monospace-font: "SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace; } .monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label { stroke-width: 1.2px; } .monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label, .monaco-editor.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label { stroke-width: 1.2px; } .monaco-hover p { margin: 0; } /* See https://github.com/microsoft/monaco-editor/issues/2168#issuecomment-780078600 */ .monaco-aria-container { position: absolute !important; height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); } /* The hc-black theme is already high contrast optimized */ .monaco-editor.hc-black { -ms-high-contrast-adjust: none; } /* In case the browser goes into high contrast mode and the editor is not configured with the hc-black theme */ @media screen and (-ms-high-contrast:active) { /* current line highlight */ .monaco-editor.vs .view-overlays .current-line, .monaco-editor.vs-dark .view-overlays .current-line { border-color: windowtext !important; border-left: 0; border-right: 0; } /* view cursors */ .monaco-editor.vs .cursor, .monaco-editor.vs-dark .cursor { background-color: windowtext !important; } /* dnd target */ .monaco-editor.vs .dnd-target, .monaco-editor.vs-dark .dnd-target { border-color: windowtext !important; } /* selected text background */ .monaco-editor.vs .selected-text, .monaco-editor.vs-dark .selected-text { background-color: highlight !important; } /* allow the text to have a transparent background. */ .monaco-editor.vs .view-line, .monaco-editor.vs-dark .view-line { -ms-high-contrast-adjust: none; } /* text color */ .monaco-editor.vs .view-line span, .monaco-editor.vs-dark .view-line span { color: windowtext !important; } /* selected text color */ .monaco-editor.vs .view-line span.inline-selected-text, .monaco-editor.vs-dark .view-line span.inline-selected-text { color: highlighttext !important; } /* allow decorations */ .monaco-editor.vs .view-overlays, .monaco-editor.vs-dark .view-overlays { -ms-high-contrast-adjust: none; } /* various decorations */ .monaco-editor.vs .selectionHighlight, .monaco-editor.vs-dark .selectionHighlight, .monaco-editor.vs .wordHighlight, .monaco-editor.vs-dark .wordHighlight, .monaco-editor.vs .wordHighlightStrong, .monaco-editor.vs-dark .wordHighlightStrong, .monaco-editor.vs .reference-decoration, .monaco-editor.vs-dark .reference-decoration { border: 2px dotted highlight !important; background: transparent !important; box-sizing: border-box; } .monaco-editor.vs .rangeHighlight, .monaco-editor.vs-dark .rangeHighlight { background: transparent !important; border: 1px dotted activeborder !important; box-sizing: border-box; } .monaco-editor.vs .bracket-match, .monaco-editor.vs-dark .bracket-match { border-color: windowtext !important; background: transparent !important; } /* find widget */ .monaco-editor.vs .findMatch, .monaco-editor.vs-dark .findMatch, .monaco-editor.vs .currentFindMatch, .monaco-editor.vs-dark .currentFindMatch { border: 2px dotted activeborder !important; background: transparent !important; box-sizing: border-box; } .monaco-editor.vs .find-widget, .monaco-editor.vs-dark .find-widget { border: 1px solid windowtext; } /* list - used by suggest widget */ .monaco-editor.vs .monaco-list .monaco-list-row, .monaco-editor.vs-dark .monaco-list .monaco-list-row { -ms-high-contrast-adjust: none; color: windowtext !important; } .monaco-editor.vs .monaco-list .monaco-list-row.focused, .monaco-editor.vs-dark .monaco-list .monaco-list-row.focused { color: highlighttext !important; background-color: highlight !important; } .monaco-editor.vs .monaco-list .monaco-list-row:hover, .monaco-editor.vs-dark .monaco-list .monaco-list-row:hover { background: transparent !important; border: 1px solid highlight; box-sizing: border-box; } /* scrollbars */ .monaco-editor.vs .monaco-scrollable-element > .scrollbar, .monaco-editor.vs-dark .monaco-scrollable-element > .scrollbar { -ms-high-contrast-adjust: none; background: background !important; border: 1px solid windowtext; box-sizing: border-box; } .monaco-editor.vs .monaco-scrollable-element > .scrollbar > .slider, .monaco-editor.vs-dark .monaco-scrollable-element > .scrollbar > .slider { background: windowtext !important; } .monaco-editor.vs .monaco-scrollable-element > .scrollbar > .slider:hover, .monaco-editor.vs-dark .monaco-scrollable-element > .scrollbar > .slider:hover { background: highlight !important; } .monaco-editor.vs .monaco-scrollable-element > .scrollbar > .slider.active, .monaco-editor.vs-dark .monaco-scrollable-element > .scrollbar > .slider.active { background: highlight !important; } /* overview ruler */ .monaco-editor.vs .decorationsOverviewRuler, .monaco-editor.vs-dark .decorationsOverviewRuler { opacity: 0; } /* minimap */ .monaco-editor.vs .minimap, .monaco-editor.vs-dark .minimap { display: none; } /* squiggles */ .monaco-editor.vs .squiggly-d-error, .monaco-editor.vs-dark .squiggly-d-error { background: transparent !important; border-bottom: 4px double #E47777; } .monaco-editor.vs .squiggly-c-warning, .monaco-editor.vs-dark .squiggly-c-warning { border-bottom: 4px double #71B771; } .monaco-editor.vs .squiggly-b-info, .monaco-editor.vs-dark .squiggly-b-info { border-bottom: 4px double #71B771; } .monaco-editor.vs .squiggly-a-hint, .monaco-editor.vs-dark .squiggly-a-hint { border-bottom: 4px double #6c6c6c; } /* contextmenu */ .monaco-editor.vs .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label, .monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label { -ms-high-contrast-adjust: none; color: highlighttext !important; background-color: highlight !important; } .monaco-editor.vs .monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .action-label, .monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .action-label { -ms-high-contrast-adjust: none; background: transparent !important; border: 1px solid highlight; box-sizing: border-box; } /* diff editor */ .monaco-diff-editor.vs .diffOverviewRuler, .monaco-diff-editor.vs-dark .diffOverviewRuler { display: none; } .monaco-editor.vs .line-insert, .monaco-editor.vs-dark .line-insert, .monaco-editor.vs .line-delete, .monaco-editor.vs-dark .line-delete { background: transparent !important; border: 1px solid highlight !important; box-sizing: border-box; } .monaco-editor.vs .char-insert, .monaco-editor.vs-dark .char-insert, .monaco-editor.vs .char-delete, .monaco-editor.vs-dark .char-delete { background: transparent !important; } } /*.monaco-editor.vs [tabindex="0"]:focus { outline: 1px solid rgba(0, 122, 204, 0.4); outline-offset: -1px; opacity: 1 !important; } .monaco-editor.vs-dark [tabindex="0"]:focus { outline: 1px solid rgba(14, 99, 156, 0.6); outline-offset: -1px; opacity: 1 !important; }*/
Krzysztof-Cieslak/vscode
src/vs/editor/standalone/browser/standalone-tokens.css
CSS
mit
7,895
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::ADHybridHealthService::Mgmt::V2014_01_01 module Models # # The password management settings. # class PasswordManagementSettings include MsRestAzure # @return [Boolean] Indicates if the password extension is enabled. attr_accessor :enabled # @return [String] The file path of the password management extension. attr_accessor :extension_file_path # @return [String] Connection point of password management. attr_accessor :connect_to # @return [Integer] Connection timeout for password extension. attr_accessor :connection_timeout # @return [String] User to execute password extension. attr_accessor :user # @return [PasswordOperationTypes] The supported password operations. # Possible values include: 'Undefined', 'Set', 'Change' attr_accessor :supported_password_operations # @return [Integer] The maximum number of retries. attr_accessor :maximum_retry_count # @return [Integer] The time between retries. attr_accessor :retry_interval_in_seconds # @return [Boolean] Indicates if a secure connection is required for # password management. attr_accessor :requires_secure_connection # @return [Boolean] Indicates if accounts should be unlocked when # resetting password. attr_accessor :unlock_account # # Mapper for PasswordManagementSettings class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { client_side_validation: true, required: false, serialized_name: 'PasswordManagementSettings', type: { name: 'Composite', class_name: 'PasswordManagementSettings', model_properties: { enabled: { client_side_validation: true, required: false, serialized_name: 'enabled', type: { name: 'Boolean' } }, extension_file_path: { client_side_validation: true, required: false, serialized_name: 'extensionFilePath', type: { name: 'String' } }, connect_to: { client_side_validation: true, required: false, serialized_name: 'connectTo', type: { name: 'String' } }, connection_timeout: { client_side_validation: true, required: false, serialized_name: 'connectionTimeout', type: { name: 'Number' } }, user: { client_side_validation: true, required: false, serialized_name: 'user', type: { name: 'String' } }, supported_password_operations: { client_side_validation: true, required: false, serialized_name: 'supportedPasswordOperations', type: { name: 'String' } }, maximum_retry_count: { client_side_validation: true, required: false, serialized_name: 'maximumRetryCount', type: { name: 'Number' } }, retry_interval_in_seconds: { client_side_validation: true, required: false, serialized_name: 'retryIntervalInSeconds', type: { name: 'Number' } }, requires_secure_connection: { client_side_validation: true, required: false, serialized_name: 'requiresSecureConnection', type: { name: 'Boolean' } }, unlock_account: { client_side_validation: true, required: false, serialized_name: 'unlockAccount', type: { name: 'Boolean' } } } } } end end end end
Azure/azure-sdk-for-ruby
management/azure_mgmt_adhybridhealth_service/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/password_management_settings.rb
Ruby
mit
4,642
import {expect} from "chai"; import {default as Tree} from "wasabi-common/lib/collection/Tree"; /* tslint:disable no-unused-expression */ describe("collection/Tree", () => { it("constructor", () => { let map = new Tree(); expect(map.get()).to.be.deep.eq({}); map = new Tree({}); expect(map.get()).to.be.deep.eq({}); const obj = { key1: { childOfKey1: "", }, key2: "", }; map = new Tree(obj); expect(map.get()).to.be.deep.eq(obj); }); it("put & get", () => { const expectedValue = "test"; const map = new Tree(); map.put("key1", true); expect(map.get()).to.be.deep.eq({ key1: true, }); expect(map.get("key1")).to.be.deep.eq(true); map.put("key1.key2.key3", expectedValue); expect(map.get()).to.be.deep.eq({ key1: { key2: { key3: expectedValue, }, }, }); expect(map.get("key1.key2.key3")).to.be.deep.eq(expectedValue); expect(map.get("key1", "key2.key3")).to.be.deep.eq(expectedValue); map.put("key2", null); expect(map.get("key2")).to.be.null; expect(map.get("key5")).to.be.undefined; map.put("key3", { key4: "example", }); expect(map.get("key3", "key4")).to.be.eq("example"); }); it("putAll", () => { const map = new Tree(); map.putAll({ key1: true, }); expect(map.get()).to.be.deep.eq({ key1: true, }); expect(map.get("key1")).to.be.deep.eq(true); const obj = { key1: { key2: { key3: "example", }, }, }; map.putAll(obj); expect(map.get()).to.be.deep.eq(obj); expect(map.get("key1.key2.key3")).to.be.deep.eq(obj.key1.key2.key3); expect(map.get("key1", "key2.key3")).to.be.deep.eq(obj.key1.key2.key3); }); it("tree", () => { const map = new Tree(); const obj = { key1: { key2: { key3: "example", }, }, }; map.putAll(obj); expect(map.tree("key1")).to.be.deep.eq(new Tree(obj.key1)); expect(map.tree("key1.key2")).to.be.deep.eq(new Tree(obj.key1.key2)); }); it("remove", () => { const map = new Tree(); const obj = { key1: { key2: { key3: "example", }, }, }; map.putAll(obj); expect(map.tree("key1")).to.be.deep.eq(new Tree(obj.key1)); expect(map.remove("key1.key2")).to.be.true; expect(map.get()).to.be.deep.eq({ key1: {}, }); expect(map.remove("key1.key2")).to.be.false; expect(map.remove("key1", "key2")).to.be.false; expect(map.remove("a")).to.be.false; expect(map.remove("key1")).to.be.true; expect(map.remove()).to.be.false; }); it("clear", () => { const map = new Tree<string>(); const obj = { key1: { key2: { key3: "example", }, }, }; map.putAll(obj); expect(map.tree("key1")).to.be.deep.eq(new Tree(obj.key1)); map.clear(); expect(map.get()).to.be.deep.eq({}); }); });
wasabi-io/wasabi-common
__test__/collection/Tree.spec.ts
TypeScript
mit
3,535
<?php /* * This file is part of the Alice package. * * (c) Nelmio <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare(strict_types=1); namespace Nelmio\Alice\Definition\Value; use Nelmio\Alice\Definition\ValueInterface; /** * Contains a list of values representing the possible values, i.e. that the actual value can picked in the given list. */ final class ChoiceListValue implements ValueInterface { /** * @var ValueInterface[]|array */ private $values; /** * @param ValueInterface[]|array $values */ public function __construct(array $values) { $this->values = deep_clone($values); } /** * {@inheritdoc} * * @return ValueInterface[]|array */ public function getValue(): array { return deep_clone($this->values); } /** * @inheritdoc */ public function __toString(): string { return sprintf('(choice) %s', var_export($this->values, true)); } }
theofidry/alice
src/Definition/Value/ChoiceListValue.php
PHP
mit
1,094
<?php /** * Created by PhpStorm. * User: alvin * Date: 29/03/15 * Time: 7:45 PM */ class Admin_model extends CI_Model{ public function __construct(){ parent::__construct(); } public function insertRecord($data, $table){ //converting date to sql format date if(array_key_exists('wo_date', $data)){ $data['wo_date'] = date('Y-m-d', strtotime($data['wo_date'])); } if(array_key_exists('po_date', $data)){ $data['po_date'] = date('Y-m-d', strtotime($data['po_date'])); } if(array_key_exists('delivery_date', $data)){ $data['delivery_date'] = date('Y-m-d', strtotime($data['delivery_date'])); } if(array_key_exists('supplier_dc_date', $data)){ $data['supplier_dc_date'] = date('Y-m-d', strtotime($data['supplier_dc_date'])); } if(array_key_exists('lr_date', $data)){ $data['lr_date'] = date('Y-m-d', strtotime($data['lr_date'])); } if(array_key_exists('created_date', $data)){ $data['created_date'] = date('Y-m-d', strtotime($data['created_date'])); } //echo mysql_info(); $this->db->insert($table, $data); return $this->db->insert_id(); } public function updateRecord($data, $table, $column_name, $value){ //converting date to sql format date if(array_key_exists('wo_date', $data)){ $data['wo_date'] = date('Y-m-d', strtotime($data['wo_date'])); } if(array_key_exists('po_date', $data)){ $data['po_date'] = date('Y-m-d', strtotime($data['po_date'])); } if(array_key_exists('delivery_date', $data)){ $data['delivery_date'] = date('Y-m-d', strtotime($data['delivery_date'])); } if(array_key_exists('supplier_dc_date', $data)){ $data['supplier_dc_date'] = date('Y-m-d', strtotime($data['supplier_dc_date'])); } if(array_key_exists('lr_date', $data)){ $data['lr_date'] = date('Y-m-d', strtotime($data['lr_date'])); } if(array_key_exists('created_date', $data)){ $data['created_date'] = date('Y-m-d', strtotime($data['created_date'])); } //print_r($data); $this->db->where($column_name, $value); $update_result = $this->db->update($table, $data); //echo mysql_info(); return $this->db->affected_rows(); } //get all values by passing table name public function getAllValues($table_name){ $query = $this->db->get($table_name); return $query->result_array(); } /** * @param $table_name * @return mixed */ public function getLastId($table_name){ $this->db->order_by('id', 'desc'); $this->db->limit(1); $query = $this->db->get($table_name); return $query->result_array(); } }
alvinchettiar/kalp-chain
application/models/admin_model.php
PHP
mit
2,924
/* =========================================================================== Copyright (C) 1999-2005 Id Software, Inc. This file is part of Quake III Arena source code. Quake III Arena source code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Quake III Arena source code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Quake III Arena source code; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA =========================================================================== */ /***************************************************************************** * name: be_aas_bspq3.c * * desc: BSP, Environment Sampling * * $Archive: /MissionPack/code/botlib/be_aas_bspq3.c $ * *****************************************************************************/ #include "../qcommon/q_shared.h" #include "../qcommon/qcommon.h" #include "l_memory.h" #include "l_script.h" #include "l_precomp.h" #include "l_struct.h" #include "aasfile.h" #include "botlib.h" #include "be_aas.h" #include "be_aas_funcs.h" #include "be_aas_def.h" extern botlib_import_t botimport; //#define TRACE_DEBUG #define ON_EPSILON 0.005 //#define DEG2RAD( a ) (( a * M_PI ) / 180.0F) #define MAX_BSPENTITIES 2048 typedef struct rgb_s { int red; int green; int blue; } rgb_t; //bsp entity epair typedef struct bsp_epair_s { char *key; char *value; struct bsp_epair_s *next; } bsp_epair_t; //bsp data entity typedef struct bsp_entity_s { bsp_epair_t *epairs; } bsp_entity_t; //id Sofware BSP data typedef struct bsp_s { //true when bsp file is loaded int loaded; //entity data int entdatasize; char *dentdata; //bsp entities int numentities; bsp_entity_t entities[MAX_BSPENTITIES]; } bsp_t; //global bsp bsp_t bspworld; #ifdef BSP_DEBUG typedef struct cname_s { int value; char *name; } cname_t; cname_t contentnames[] = { {CONTENTS_SOLID,"CONTENTS_SOLID"}, {CONTENTS_WINDOW,"CONTENTS_WINDOW"}, {CONTENTS_AUX,"CONTENTS_AUX"}, {CONTENTS_LAVA,"CONTENTS_LAVA"}, {CONTENTS_SLIME,"CONTENTS_SLIME"}, {CONTENTS_WATER,"CONTENTS_WATER"}, {CONTENTS_MIST,"CONTENTS_MIST"}, {LAST_VISIBLE_CONTENTS,"LAST_VISIBLE_CONTENTS"}, {CONTENTS_AREAPORTAL,"CONTENTS_AREAPORTAL"}, {CONTENTS_PLAYERCLIP,"CONTENTS_PLAYERCLIP"}, {CONTENTS_MONSTERCLIP,"CONTENTS_MONSTERCLIP"}, {CONTENTS_CURRENT_0,"CONTENTS_CURRENT_0"}, {CONTENTS_CURRENT_90,"CONTENTS_CURRENT_90"}, {CONTENTS_CURRENT_180,"CONTENTS_CURRENT_180"}, {CONTENTS_CURRENT_270,"CONTENTS_CURRENT_270"}, {CONTENTS_CURRENT_UP,"CONTENTS_CURRENT_UP"}, {CONTENTS_CURRENT_DOWN,"CONTENTS_CURRENT_DOWN"}, {CONTENTS_ORIGIN,"CONTENTS_ORIGIN"}, {CONTENTS_MONSTER,"CONTENTS_MONSTER"}, {CONTENTS_DEADMONSTER,"CONTENTS_DEADMONSTER"}, {CONTENTS_DETAIL,"CONTENTS_DETAIL"}, {CONTENTS_TRANSLUCENT,"CONTENTS_TRANSLUCENT"}, {CONTENTS_LADDER,"CONTENTS_LADDER"}, {0, 0} }; void PrintContents(int contents) { int i; for (i = 0; contentnames[i].value; i++) { if (contents & contentnames[i].value) { botimport.Print(PRT_MESSAGE, "%s\n", contentnames[i].name); } //end if } //end for } //end of the function PrintContents #endif // BSP_DEBUG //=========================================================================== // traces axial boxes of any size through the world // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== bsp_trace_t AAS_Trace(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int passent, int contentmask) { bsp_trace_t bsptrace; botimport.Trace(&bsptrace, start, mins, maxs, end, passent, contentmask); return bsptrace; } //end of the function AAS_Trace //=========================================================================== // returns the contents at the given point // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int AAS_PointContents(vec3_t point) { return botimport.PointContents(point); } //end of the function AAS_PointContents //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== qboolean AAS_EntityCollision(int entnum, vec3_t start, vec3_t boxmins, vec3_t boxmaxs, vec3_t end, int contentmask, bsp_trace_t *trace) { bsp_trace_t enttrace; botimport.EntityTrace(&enttrace, start, boxmins, boxmaxs, end, entnum, contentmask); if (enttrace.fraction < trace->fraction) { Com_Memcpy(trace, &enttrace, sizeof(bsp_trace_t)); return qtrue; } //end if return qfalse; } //end of the function AAS_EntityCollision //=========================================================================== // returns true if in Potentially Hearable Set // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== qboolean AAS_inPVS(vec3_t p1, vec3_t p2) { return botimport.inPVS(p1, p2); } //end of the function AAS_InPVS //=========================================================================== // returns true if in Potentially Visible Set // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== qboolean AAS_inPHS(vec3_t p1, vec3_t p2) { return qtrue; } //end of the function AAS_inPHS //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== void AAS_BSPModelMinsMaxsOrigin(int modelnum, vec3_t angles, vec3_t mins, vec3_t maxs, vec3_t origin) { botimport.BSPModelMinsMaxsOrigin(modelnum, angles, mins, maxs, origin); } //end of the function AAS_BSPModelMinsMaxs //=========================================================================== // unlinks the entity from all leaves // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== void AAS_UnlinkFromBSPLeaves(bsp_link_t *leaves) { } //end of the function AAS_UnlinkFromBSPLeaves //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== bsp_link_t *AAS_BSPLinkEntity(vec3_t absmins, vec3_t absmaxs, int entnum, int modelnum) { return NULL; } //end of the function AAS_BSPLinkEntity //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int AAS_BoxEntities(vec3_t absmins, vec3_t absmaxs, int *list, int maxcount) { return 0; } //end of the function AAS_BoxEntities //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int AAS_NextBSPEntity(int ent) { ent++; if (ent >= 1 && ent < bspworld.numentities) return ent; return 0; } //end of the function AAS_NextBSPEntity //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int AAS_BSPEntityInRange(int ent) { if (ent <= 0 || ent >= bspworld.numentities) { botimport.Print(PRT_MESSAGE, "bsp entity out of range\n"); return qfalse; } //end if return qtrue; } //end of the function AAS_BSPEntityInRange //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int AAS_ValueForBSPEpairKey(int ent, char *key, char *value, int size) { bsp_epair_t *epair; value[0] = '\0'; if (!AAS_BSPEntityInRange(ent)) return qfalse; for (epair = bspworld.entities[ent].epairs; epair; epair = epair->next) { if (!strcmp(epair->key, key)) { Q_strncpyz( value, epair->value, size ); return qtrue; } //end if } //end for return qfalse; } //end of the function AAS_FindBSPEpair //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int AAS_VectorForBSPEpairKey(int ent, char *key, vec3_t v) { char buf[MAX_EPAIRKEY], *s[3]; VectorClear(v); if (!AAS_ValueForBSPEpairKey(ent, key, buf, MAX_EPAIRKEY)) return qfalse; //scanf into doubles, then assign, so it is vec_t size independent Com_Split( buf, s, 3, ' ' ); v[0] = atof( s[0] ); v[1] = atof( s[1] ); v[2] = atof( s[2] ); return qtrue; } //end of the function AAS_VectorForBSPEpairKey //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int AAS_FloatForBSPEpairKey(int ent, char *key, float *value) { char buf[MAX_EPAIRKEY]; *value = 0; if (!AAS_ValueForBSPEpairKey(ent, key, buf, MAX_EPAIRKEY)) return qfalse; *value = atof(buf); return qtrue; } //end of the function AAS_FloatForBSPEpairKey //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int AAS_IntForBSPEpairKey(int ent, char *key, int *value) { char buf[MAX_EPAIRKEY]; *value = 0; if (!AAS_ValueForBSPEpairKey(ent, key, buf, MAX_EPAIRKEY)) return qfalse; *value = atoi(buf); return qtrue; } //end of the function AAS_IntForBSPEpairKey //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== void AAS_FreeBSPEntities(void) { int i; bsp_entity_t *ent; bsp_epair_t *epair, *nextepair; for (i = 1; i < bspworld.numentities; i++) { ent = &bspworld.entities[i]; for (epair = ent->epairs; epair; epair = nextepair) { nextepair = epair->next; // if (epair->key) FreeMemory(epair->key); if (epair->value) FreeMemory(epair->value); FreeMemory(epair); } //end for } //end for bspworld.numentities = 0; } //end of the function AAS_FreeBSPEntities //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== void AAS_ParseBSPEntities(void) { script_t *script; token_t token; bsp_entity_t *ent; bsp_epair_t *epair; script = LoadScriptMemory(bspworld.dentdata, bspworld.entdatasize, "entdata"); SetScriptFlags(script, SCFL_NOSTRINGWHITESPACES|SCFL_NOSTRINGESCAPECHARS);//SCFL_PRIMITIVE); bspworld.numentities = 1; while(PS_ReadToken(script, &token)) { if (strcmp(token.string, "{")) { ScriptError(script, "invalid %s", token.string); AAS_FreeBSPEntities(); FreeScript(script); return; } //end if if (bspworld.numentities >= MAX_BSPENTITIES) { botimport.Print(PRT_MESSAGE, "too many entities in BSP file\n"); break; } //end if ent = &bspworld.entities[bspworld.numentities]; bspworld.numentities++; ent->epairs = NULL; while(PS_ReadToken(script, &token)) { if (!strcmp(token.string, "}")) break; epair = (bsp_epair_t *) GetClearedHunkMemory(sizeof(bsp_epair_t)); epair->next = ent->epairs; ent->epairs = epair; if (token.type != TT_STRING) { ScriptError(script, "invalid %s", token.string); AAS_FreeBSPEntities(); FreeScript(script); return; } //end if StripDoubleQuotes(token.string); epair->key = (char *) GetHunkMemory(strlen(token.string) + 1); strcpy(epair->key, token.string); if (!PS_ExpectTokenType(script, TT_STRING, 0, &token)) { AAS_FreeBSPEntities(); FreeScript(script); return; } //end if StripDoubleQuotes(token.string); epair->value = (char *) GetHunkMemory(strlen(token.string) + 1); strcpy(epair->value, token.string); } //end while if (strcmp(token.string, "}")) { ScriptError(script, "missing }"); AAS_FreeBSPEntities(); FreeScript(script); return; } //end if } //end while FreeScript(script); } //end of the function AAS_ParseBSPEntities //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int AAS_BSPTraceLight(vec3_t start, vec3_t end, vec3_t endpos, int *red, int *green, int *blue) { return 0; } //end of the function AAS_BSPTraceLight //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== void AAS_DumpBSPData(void) { AAS_FreeBSPEntities(); if (bspworld.dentdata) FreeMemory(bspworld.dentdata); bspworld.dentdata = NULL; bspworld.entdatasize = 0; // bspworld.loaded = qfalse; Com_Memset( &bspworld, 0, sizeof(bspworld) ); } //end of the function AAS_DumpBSPData //=========================================================================== // load a .bsp file // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int AAS_LoadBSPFile(void) { AAS_DumpBSPData(); bspworld.entdatasize = strlen(botimport.BSPEntityData()) + 1; bspworld.dentdata = (char *) GetClearedHunkMemory(bspworld.entdatasize); Com_Memcpy(bspworld.dentdata, botimport.BSPEntityData(), bspworld.entdatasize); AAS_ParseBSPEntities(); bspworld.loaded = qtrue; return BLERR_NOERROR; } //end of the function AAS_LoadBSPFile
ooonum/q3ultima
code/botlib/be_aas_bspq3.c
C
mit
14,641
<% menu_section='MORE' %> <% include ../add_ins/begin.ejs %> <div class="title fa fa-anchor">User Profile</div> <% if (messages.success) { %> <div class="alert_flash_message_success"><%= messages.success %></div> <% }else if(messages.fail){ %> <div class="alert_flash_message_fail"><%= messages.fail %></div> <% } %> <br> <!-- USER INFORMATION --> <div class="row"> <div class="col-lg-3"></div> <div class="col-lg-6"> <div class="well"> <h3><span class="fa fa-user"></span></h3> <p> <strong>UserID</strong>: <%= user.user_id %> <% if(user.username !== 'guest'){ %> <div class='pull-right'> <a href='change_password'>Change Password</a><br> <a href='update_account'>Update Email or Institution</a><br> <!-- <% if(user.username == 'avoorhis'){ %> <p><a href="/users/forgotten_password">AV only: TESTing Forgot your password?</a></p> <% } %> --> </div> <% } %> <strong>username</strong>: <%= user.username %><br> <strong>First Name</strong>: <%= user.first_name %><br> <strong>Last Name</strong>: <%= user.last_name %><br> <strong>Email</strong>: <%= user.email %><br> <strong>Institution</strong>: <%= user.institution %><br> <% if(user.security_level === 1) { %> <strong>Security Level</strong>: <%= user.security_level %> (Administrator) -- Access to all the data and administrative pages.<br> <% }else if(user.security_level === 10) { %> <strong>Security Level</strong>: <%= user.security_level %> (MBL User) -- Access to all the projects public and private.<br> <% }else if(user.security_level === 45) { %> <strong>Security Level</strong>: <%= user.security_level %> (CoDL Metadata Editor) -- Access to Edit CoDL (DCO) Metadata.<br> <% }else if(user.security_level === 50) { %> <strong>Security Level</strong>: <%= user.security_level %> (Registered User) -- Public project access plus other projects with permission.<br> <% }else { %> <strong>Security Level</strong>: <%= user.security_level %> (Guest) -- Public project access only<br> <% } %> <% if(user.security_level == 1) { %> <div style='padding-left:20px;'> _________________________________ <br> <strong>Upload File</strong>:<input id='myFile' type="file" name="upload_files" class="" > <input type="SUBMIT" onclick="upload_file('<%= user.username %>')" style='margin-top:5px'> </div> <br> <div id='bar_div' class="progress" style='display:none'> <div id='bar' class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="" aria-valuemin="0" aria-valuemax="100" style="width:0%"> </div> </div> <% } %> </p> </div> </div> </div> <% include ../add_ins/end.ejs %> <script type="text/javascript" src="/javascripts/user_data.js"></script> </body> </html>
avoorhis/vamps-node.js
views/user_admin/profile.html
HTML
mit
3,247
/** @constructor */ ScalaJS.c.scala_collection_immutable_LongMapValueIterator = (function() { ScalaJS.c.scala_collection_immutable_LongMapIterator.call(this) }); ScalaJS.c.scala_collection_immutable_LongMapValueIterator.prototype = new ScalaJS.inheritable.scala_collection_immutable_LongMapIterator(); ScalaJS.c.scala_collection_immutable_LongMapValueIterator.prototype.constructor = ScalaJS.c.scala_collection_immutable_LongMapValueIterator; ScalaJS.c.scala_collection_immutable_LongMapValueIterator.prototype.valueOf__Lscala_collection_immutable_LongMap$Tip__O = (function(tip) { return tip.value__O() }); /** @constructor */ ScalaJS.inheritable.scala_collection_immutable_LongMapValueIterator = (function() { /*<skip>*/ }); ScalaJS.inheritable.scala_collection_immutable_LongMapValueIterator.prototype = ScalaJS.c.scala_collection_immutable_LongMapValueIterator.prototype; ScalaJS.is.scala_collection_immutable_LongMapValueIterator = (function(obj) { return (!(!((obj && obj.$classData) && obj.$classData.ancestors.scala_collection_immutable_LongMapValueIterator))) }); ScalaJS.as.scala_collection_immutable_LongMapValueIterator = (function(obj) { if ((ScalaJS.is.scala_collection_immutable_LongMapValueIterator(obj) || (obj === null))) { return obj } else { ScalaJS.throwClassCastException(obj, "scala.collection.immutable.LongMapValueIterator") } }); ScalaJS.isArrayOf.scala_collection_immutable_LongMapValueIterator = (function(obj, depth) { return (!(!(((obj && obj.$classData) && (obj.$classData.arrayDepth === depth)) && obj.$classData.arrayBase.ancestors.scala_collection_immutable_LongMapValueIterator))) }); ScalaJS.asArrayOf.scala_collection_immutable_LongMapValueIterator = (function(obj, depth) { if ((ScalaJS.isArrayOf.scala_collection_immutable_LongMapValueIterator(obj, depth) || (obj === null))) { return obj } else { ScalaJS.throwArrayCastException(obj, "Lscala.collection.immutable.LongMapValueIterator;", depth) } }); ScalaJS.data.scala_collection_immutable_LongMapValueIterator = new ScalaJS.ClassTypeData({ scala_collection_immutable_LongMapValueIterator: 0 }, false, "scala.collection.immutable.LongMapValueIterator", ScalaJS.data.scala_collection_immutable_LongMapIterator, { scala_collection_immutable_LongMapValueIterator: 1, scala_collection_immutable_LongMapIterator: 1, scala_collection_AbstractIterator: 1, scala_collection_Iterator: 1, scala_collection_TraversableOnce: 1, scala_collection_GenTraversableOnce: 1, java_lang_Object: 1 }); ScalaJS.c.scala_collection_immutable_LongMapValueIterator.prototype.$classData = ScalaJS.data.scala_collection_immutable_LongMapValueIterator; //@ sourceMappingURL=LongMapValueIterator.js.map
ignaciocases/hermeneumatics
node_modules/scala-node/main/target/streams/compile/externalDependencyClasspath/$global/package-js/extracted-jars/scalajs-library_2.10-0.4.0.jar--29fb2f8b/scala/collection/immutable/LongMapValueIterator.js
JavaScript
mit
2,716
// -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*- #ifndef YB__ORM__EXPRESSION__INCLUDED #define YB__ORM__EXPRESSION__INCLUDED #include <vector> #include <string> #include <set> #include <map> #include "util/utility.h" #include "util/exception.h" #include "util/value_type.h" #include "orm_config.h" namespace Yb { typedef std::map<String, int> ParamNums; enum SqlIdQuotes {NO_QUOTES, DBL_QUOTES, AUTO_DBL_QUOTES}; enum SqlPagerModel {PAGER_POSTGRES, PAGER_MYSQL, PAGER_INTERBASE, PAGER_ORACLE}; struct SqlGeneratorOptions { SqlIdQuotes quotes_; SqlPagerModel pager_model_; bool has_for_update_; bool collect_params_; bool numbered_params_; SqlGeneratorOptions(SqlIdQuotes quotes = NO_QUOTES, bool has_for_update = true, bool collect_params = false, bool numbered_params = false, SqlPagerModel pager_model = PAGER_POSTGRES) : quotes_(quotes) , pager_model_(pager_model) , has_for_update_(has_for_update) , collect_params_(collect_params) , numbered_params_(numbered_params) {} }; struct SqlGeneratorContext { Values params_; int counter_; SqlGeneratorContext(int counter = 0): counter_(counter) {} }; const String subst_param(const Value &value, const SqlGeneratorOptions &options, SqlGeneratorContext *ctx); class YBORM_DECL ExpressionBackend: public RefCountBase { public: virtual const String generate_sql( const SqlGeneratorOptions &options, SqlGeneratorContext *ctx) const = 0; virtual ~ExpressionBackend(); }; typedef IntrusivePtr<ExpressionBackend> ExprBEPtr; class Column; class ExpressionList; class YBORM_DECL Expression { protected: ExprBEPtr backend_; String sql_; bool parentheses_; public: Expression(); explicit Expression(const String &sql); Expression(const Column &col); explicit Expression(ExprBEPtr backend, bool parentheses = false); const String generate_sql( const SqlGeneratorOptions &options, SqlGeneratorContext *ctx) const; const String get_sql() const { return generate_sql(SqlGeneratorOptions(), NULL); } bool is_empty() const { return str_empty(sql_) && !backend_.get(); } ExpressionBackend *backend() const { return backend_.get(); } const Expression like_(const Expression &b) const; const Expression in_(const Expression &b) const; }; YBORM_DECL bool is_number_or_object_name(const String &s); YBORM_DECL bool is_string_constant(const String &s); YBORM_DECL bool is_in_parentheses(const String &s); YBORM_DECL const String sql_parentheses_as_needed(const String &s); YBORM_DECL const String sql_prefix(const String &s, const String &prefix); YBORM_DECL const String sql_alias(const String &s, const String &alias); class YBORM_DECL ColumnExprBackend: public ExpressionBackend { Expression expr_; String tbl_name_, col_name_, alias_; public: ColumnExprBackend(const Expression &expr, const String &alias); ColumnExprBackend(const String &tbl_name, const String &col_name, const String &alias); const String generate_sql( const SqlGeneratorOptions &options, SqlGeneratorContext *ctx) const; const String &alias() const { return alias_; } }; class YBORM_DECL ColumnExpr: public Expression { public: ColumnExpr(const Expression &expr, const String &alias = _T("")); ColumnExpr(const String &tbl_name, const String &col_name, const String &alias = _T("")); const String &alias() const; }; class YBORM_DECL ConstExprBackend: public ExpressionBackend { Value value_; public: ConstExprBackend(const Value &x); const String generate_sql( const SqlGeneratorOptions &options, SqlGeneratorContext *ctx) const; const Value &const_value() const { return value_; } }; class YBORM_DECL ConstExpr: public Expression { public: ConstExpr(); ConstExpr(const Value &x); const Value &const_value() const; }; class YBORM_DECL UnaryOpExprBackend: public ExpressionBackend { bool prefix_; String op_; Expression expr_; public: UnaryOpExprBackend(bool prefix, const String &op, const Expression &expr); const String generate_sql( const SqlGeneratorOptions &options, SqlGeneratorContext *ctx) const; bool prefix() const { return prefix_; } const String &op() const { return op_; } const Expression &expr() const { return expr_; } }; class YBORM_DECL UnaryOpExpr: public Expression { public: UnaryOpExpr(bool prefix, const String &op, const Expression &expr); bool prefix() const; const String &op() const; const Expression &expr() const; }; class YBORM_DECL BinaryOpExprBackend: public ExpressionBackend { Expression expr1_, expr2_; String op_; public: BinaryOpExprBackend(const Expression &expr1, const String &op, const Expression &expr2); const String generate_sql( const SqlGeneratorOptions &options, SqlGeneratorContext *ctx) const; const String &op() const { return op_; } const Expression &expr1() const { return expr1_; } const Expression &expr2() const { return expr2_; } }; class YBORM_DECL BinaryOpExpr: public Expression { public: BinaryOpExpr(const Expression &expr1, const String &op, const Expression &expr2); const String &op() const; const Expression &expr1() const; const Expression &expr2() const; }; class YBORM_DECL JoinExprBackend: public ExpressionBackend { Expression expr1_, expr2_, cond_; public: JoinExprBackend(const Expression &expr1, const Expression &expr2, const Expression &cond) : expr1_(expr1), expr2_(expr2), cond_(cond) {} const String generate_sql( const SqlGeneratorOptions &options, SqlGeneratorContext *ctx) const; const Expression &expr1() const { return expr1_; } const Expression &expr2() const { return expr2_; } const Expression &cond() const { return cond_; } }; class YBORM_DECL JoinExpr: public Expression { public: JoinExpr(const Expression &expr1, const Expression &expr2, const Expression &cond); const Expression &expr1() const; const Expression &expr2() const; const Expression &cond() const; }; class YBORM_DECL ExpressionListBackend: public ExpressionBackend { std::vector<Expression> items_; public: ExpressionListBackend() {} void append(const Expression &expr) { items_.push_back(expr); } const String generate_sql( const SqlGeneratorOptions &options, SqlGeneratorContext *ctx) const; int size() const { return items_.size(); } const Expression &item(int n) const { YB_ASSERT(n >= 0 && (size_t)n < items_.size()); return items_[n]; } }; class YBORM_DECL ExpressionList: public Expression { template <typename T, typename E> void fill_from_container(const T &cont) { typename T::const_iterator it = cont.begin(), end = cont.end(); for (; it != end; ++it) append(E(*it)); } public: ExpressionList(); ExpressionList(const Expression &expr); ExpressionList(const Expression &expr1, const Expression &expr2); ExpressionList(const Expression &expr1, const Expression &expr2, const Expression &expr3); ExpressionList(const Strings &cont) : Expression(ExprBEPtr(new ExpressionListBackend)) { fill_from_container<Strings, Expression>(cont); } ExpressionList(const StringSet &cont) : Expression(ExprBEPtr(new ExpressionListBackend)) { fill_from_container<StringSet, Expression>(cont); } ExpressionList(const Values &cont) : Expression(ExprBEPtr(new ExpressionListBackend)) { fill_from_container<Values, ConstExpr>(cont); } #if defined(YB_USE_TUPLE) template <class T0, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9> ExpressionList(const boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> &t) : Expression(ExprBEPtr(new ExpressionListBackend)) { Values v; tuple_values(t, v); fill_from_container<Values, ConstExpr>(v); } #endif // defined(YB_USE_TUPLE) #if defined(YB_USE_STDTUPLE) template <typename... Tp> ExpressionList(const std::tuple<Tp...> &t) : Expression(ExprBEPtr(new ExpressionListBackend)) { Values v; stdtuple_values<0, std::tuple<Tp...>>(t, v); fill_from_container<Values, ConstExpr>(v); } #endif // defined(YB_USE_STDTUPLE) void append(const Expression &expr); ExpressionList &operator << (const Expression &expr) { append(expr); return *this; } int size() const; const Expression &item(int n) const; const Expression &operator [] (int n) const { return item(n); } }; class YBORM_DECL SelectExprBackend: public ExpressionBackend { Expression select_expr_, from_expr_, where_expr_, group_by_expr_, having_expr_, order_by_expr_; bool distinct_flag_; String lock_mode_; int pager_limit_, pager_offset_; public: SelectExprBackend(const Expression &select_expr) : select_expr_(select_expr) , distinct_flag_(false) , pager_limit_(0) , pager_offset_(0) {} void from_(const Expression &from_expr) { from_expr_ = from_expr; } void where_(const Expression &where_expr) { where_expr_ = where_expr; } void group_by_(const Expression &group_by_expr) { group_by_expr_ = group_by_expr; } void having_(const Expression &having_expr) { having_expr_ = having_expr; } void order_by_(const Expression &order_by_expr) { order_by_expr_ = order_by_expr; } void distinct(bool flag) { distinct_flag_ = flag; } void with_lockmode(const String &lock_mode) { lock_mode_ = lock_mode; } void pager(int limit, int offset) { pager_limit_ = limit; pager_offset_ = offset; } const Expression &select_expr() const { return select_expr_; } const Expression &from_expr() const { return from_expr_; } const Expression &where_expr() const { return where_expr_; } const Expression &group_by_expr() const { return group_by_expr_; } const Expression &having_expr() const { return having_expr_; } const Expression &order_by_expr() const { return order_by_expr_; } bool distinct_flag() const { return distinct_flag_; } const String &lock_mode() const { return lock_mode_; } const String generate_sql( const SqlGeneratorOptions &options, SqlGeneratorContext *ctx) const; int pager_limit() const { return pager_limit_; } int pager_offset() const { return pager_offset_; } }; class YBORM_DECL SelectExpr: public Expression { public: SelectExpr(const Expression &select_expr); SelectExpr &from_(const Expression &from_expr); SelectExpr &where_(const Expression &where_expr); SelectExpr &group_by_(const Expression &group_by_expr); SelectExpr &having_(const Expression &having_expr); SelectExpr &order_by_(const Expression &order_by_expr); SelectExpr &distinct(bool flag = true); SelectExpr &with_lockmode(const String &lock_mode); SelectExpr &for_update(bool flag = true); SelectExpr &pager(int limit, int offset); const Expression &select_expr() const; const Expression &from_expr() const; const Expression &where_expr() const; const Expression &group_by_expr() const; const Expression &having_expr() const; const Expression &order_by_expr() const; bool distinct_flag() const; const String &lock_mode() const; bool for_update_flag() const; int pager_limit() const; int pager_offset() const; }; YBORM_DECL const Expression operator ! (const Expression &a); YBORM_DECL const Expression operator && (const Expression &a, const Expression &b); YBORM_DECL const Expression operator || (const Expression &a, const Expression &b); YBORM_DECL const Expression operator == (const Expression &a, const Expression &b); YBORM_DECL const Expression operator == (const Expression &a, const Value &b); YBORM_DECL const Expression operator == (const Value &a, const Expression &b); YBORM_DECL const Expression operator == (const Expression &a, const Column &b); YBORM_DECL const Expression operator == (const Column &a, const Expression &b); YBORM_DECL const Expression operator == (const Column &a, const Column &b); YBORM_DECL const Expression operator == (const Column &a, const Value &b); YBORM_DECL const Expression operator == (const Value &a, const Column &b); YBORM_DECL const Expression operator != (const Expression &a, const Expression &b); YBORM_DECL const Expression operator != (const Expression &a, const Value &b); YBORM_DECL const Expression operator != (const Value &a, const Expression &b); YBORM_DECL const Expression operator != (const Expression &a, const Column &b); YBORM_DECL const Expression operator != (const Column &a, const Expression &b); YBORM_DECL const Expression operator != (const Column &a, const Column &b); YBORM_DECL const Expression operator != (const Column &a, const Value &b); YBORM_DECL const Expression operator != (const Value &a, const Column &b); YBORM_DECL const Expression operator > (const Expression &a, const Expression &b); YBORM_DECL const Expression operator > (const Expression &a, const Value &b); YBORM_DECL const Expression operator > (const Value &a, const Expression &b); YBORM_DECL const Expression operator > (const Expression &a, const Column &b); YBORM_DECL const Expression operator > (const Column &a, const Expression &b); YBORM_DECL const Expression operator > (const Column &a, const Column &b); YBORM_DECL const Expression operator > (const Column &a, const Value &b); YBORM_DECL const Expression operator > (const Value &a, const Column &b); YBORM_DECL const Expression operator < (const Expression &a, const Expression &b); YBORM_DECL const Expression operator < (const Expression &a, const Value &b); YBORM_DECL const Expression operator < (const Value &a, const Expression &b); YBORM_DECL const Expression operator < (const Expression &a, const Column &b); YBORM_DECL const Expression operator < (const Column &a, const Expression &b); YBORM_DECL const Expression operator < (const Column &a, const Column &b); YBORM_DECL const Expression operator < (const Column &a, const Value &b); YBORM_DECL const Expression operator < (const Value &a, const Column &b); YBORM_DECL const Expression operator >= (const Expression &a, const Expression &b); YBORM_DECL const Expression operator >= (const Expression &a, const Value &b); YBORM_DECL const Expression operator >= (const Value &a, const Expression &b); YBORM_DECL const Expression operator >= (const Expression &a, const Column &b); YBORM_DECL const Expression operator >= (const Column &a, const Expression &b); YBORM_DECL const Expression operator >= (const Column &a, const Column &b); YBORM_DECL const Expression operator >= (const Column &a, const Value &b); YBORM_DECL const Expression operator >= (const Value &a, const Column &b); YBORM_DECL const Expression operator <= (const Expression &a, const Expression &b); YBORM_DECL const Expression operator <= (const Expression &a, const Value &b); YBORM_DECL const Expression operator <= (const Value &a, const Expression &b); YBORM_DECL const Expression operator <= (const Expression &a, const Column &b); YBORM_DECL const Expression operator <= (const Column &a, const Expression &b); YBORM_DECL const Expression operator <= (const Column &a, const Column &b); YBORM_DECL const Expression operator <= (const Column &a, const Value &b); YBORM_DECL const Expression operator <= (const Value &a, const Column &b); inline const Expression filter_eq(const String &name, const Value &value) { return Expression(name) == value; } inline const Expression filter_ne(const String &name, const Value &value) { return Expression(name) != value; } inline const Expression filter_lt(const String &name, const Value &value) { return Expression(name) < value; } inline const Expression filter_gt(const String &name, const Value &value) { return Expression(name) > value; } inline const Expression filter_le(const String &name, const Value &value) { return Expression(name) <= value; } inline const Expression filter_ge(const String &name, const Value &value) { return Expression(name) >= value; } class YBORM_DECL FilterBackendByPK: public ExpressionBackend { Expression expr_; Key key_; static const Expression build_expr(const Key &key); public: FilterBackendByPK(const Key &key); const String generate_sql( const SqlGeneratorOptions &options, SqlGeneratorContext *ctx) const; const Key &key() const { return key_; } }; class YBORM_DECL KeyFilter: public Expression { public: KeyFilter(const Key &key); const Key &key() const; }; typedef Expression Filter; class Schema; YBORM_DECL void find_all_tables(const Expression &expr, Strings &tables); YBORM_DECL SelectExpr make_select(const Schema &schema, const Expression &from_where, const Expression &filter, const Expression &order_by, bool for_update_flag = false, int limit = 0, int offset = 0); } // namespace Yb // vim:ts=4:sts=4:sw=4:et: #endif // YB__ORM__EXPRESSION__INCLUDED
kamaroly/yb-orm
include/yb/orm/expression.h
C
mit
17,451
// Copyright and license at: https://github.com/MatthewMWR/MeasureTraceAutomation/blob/master/LICENSE namespace MeasureTraceAutomation { public class MeasurementStoreConfig { public StoreType StoreType { get; set; } public string ConnectionString { get; set; } } }
MatthewMWR/MeasureTraceAutomation
src/MeasureTraceAutomation/MeasurementStoreConfig.cs
C#
mit
295
# frozen_string_literal: true require "test_helper" module CleanupIdTest class CleanupIdWithXLinkNamespaceTest < Minitest::Test plugin_class SvgOptimizer::Plugins::CleanupId with_svg_plugin "cleanup_id.svg" test "applies plugin" do assert_equal "a", xml.css("linearGradient").first["id"] assert_equal "url(#a)", xml.css("circle").first["fill"] assert xml.css("circle[id]").empty? assert xml.css("g[id]").empty? assert_equal 2, xml.css("tref[xlink|href='#b']").size assert_equal "b", xml.css("text").first["id"] end end class CleanupIdWithoutXLinkNamespaceTest < Minitest::Test plugin_class SvgOptimizer::Plugins::CleanupId with_svg_plugin "cleanup_id_without_xlink.svg" test "applies plugin" do svg = File.read("./test/fixtures/cleanup_id_without_xlink_expected.svg") assert_equal svg.to_s.chomp, xml.root.to_s end end end
fnando/svg_optimizer
test/svg_optimizer/plugins/cleanup_id_test.rb
Ruby
mit
916
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var Lint = require("tslint"); var NoStringParameterToFunctionCallWalker_1 = require("./utils/NoStringParameterToFunctionCallWalker"); var Rule = (function (_super) { __extends(Rule, _super); function Rule() { return _super !== null && _super.apply(this, arguments) || this; } Rule.prototype.apply = function (sourceFile) { return this.applyWithProgram(sourceFile, undefined); }; Rule.prototype.applyWithProgram = function (sourceFile, program) { var walker = new NoStringParameterToFunctionCallWalker_1.NoStringParameterToFunctionCallWalker(sourceFile, 'setTimeout', this.getOptions(), program); return this.applyWithWalker(walker); }; return Rule; }(Lint.Rules.OptionallyTypedRule)); Rule.metadata = { ruleName: 'no-string-based-set-timeout', type: 'maintainability', description: 'Do not use the version of setTimeout that accepts code as a string argument.', options: null, optionsDescription: '', typescriptOnly: true, issueClass: 'SDL', issueType: 'Error', severity: 'Critical', level: 'Mandatory', group: 'Security', commonWeaknessEnumeration: '95, 676, 242, 116' }; exports.Rule = Rule; //# sourceMappingURL=noStringBasedSetTimeoutRule.js.map
PerkdAS/tslint-perkd-rules
rules/noStringBasedSetTimeoutRule.js
JavaScript
mit
1,831
/* * Copyright (c) 2017 Node7 Team * * Licensed under MIT (https://github.com/tienthanh2509/isc-node7/blob/master/LICENSE) */ "use strict"; module.exports = function (grunt) { // Force use of Unix newlines grunt.util.linefeed = '\n'; // Cấu hình tùy chỉnh & biến var resources = './src'; // var bower = './bower_components'; // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), banner: '/*!\n' + ' * app <%= pkg.name %> v<%= pkg.version %> (<%= pkg.homepage %>)\n' + ' * Build on <%= grunt.template.today("yyyy-mm-dd hh:mm:ss") %>\n' + ' * Copyright 2017 Node7\n' + ' * Licensed under MIT (https://github.com/tienthanh2509/isc-node7/blob/master/LICENSE)\n' + ' */\n', // Tasks configuration sass: { dist: { options: { //cacheLocation: '/tmp/.sass', style: 'expanded' }, files: { 'public/dist/css/app.css': resources + '/scss/app.scss' } } }, concat: { options: { stripBanners: true, banner: '<%= banner %>' }, dist: { src: [ resources + '/js/helpers/smartresize.js', resources + '/js/app.js' ], dest: 'public/dist/js/app.js' } }, cssmin: { dist: { options: { sourceMap: true }, files: [{ expand: true, cwd: 'public/dist/css', src: ['*.css', '!*.min.css'], dest: 'public/dist/css', ext: '.min.css' }] } }, uglify: { dist: { options: { banner: '<%= banner %>', sourceMap: true, mangle: false }, files: [{ 'public/dist/js/app.min.js': ['public/dist/js/app.js'] }] } }, watch: { sass_app: { files: [resources + '/scss/*.scss'], tasks: ['sass'], options: { debounceDelay: 1000, spawn: false } }, cssmin_app: { files: ['public/dist/css/app.css'], tasks: ['cssmin'], options: { debounceDelay: 1000, spawn: false } }, concat_app: { files: [resources + '/js/*.js'], tasks: ['concat'], options: { debounceDelay: 1000, spawn: false } }, uglify_app: { files: ['public/dist/js/app.js'], tasks: ['uglify'], options: { debounceDelay: 1000, spawn: false } } }, clean: { dist: 'public/dist/' } }); // Load the plugin grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-cssmin'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-sass'); grunt.loadNpmTasks('grunt-contrib-watch'); // Register task(s). grunt.registerTask('css', ['sass', 'cssmin']); grunt.registerTask('js', ['concat', 'uglify']); // Grunt default task grunt.registerTask('default', ['css', 'js']); };
tienthanh2509/isc-node7
Gruntfile.js
JavaScript
mit
3,850
// gui_Window.h // \author Logan Jones ///////////////// \date 4/20/2002 /// \file /// \brief ... ///////////////////////////////////////////////////////////////////// #ifndef _GUI_WINDOW_H_ #define _GUI_WINDOW_H_ ///////////////////////////////////////////////////////////////////// ///////////////////////////// gui_Window ///////////////////////////// // class gui_Window : public wnd_Window { typedef list< gui_Gadget* > GadgetList_t; ///////////////////////////////////////////////// // INTERFACE public: // Loads and processes the given gui file BOOL LoadGui( LPCTSTR strGuiName ); // Retrieves a pointer to the desired gadget INLINE gui_Gadget* GetGadget( LPCTSTR strName ); // Default load panel method. Returns FALSE virtual BOOL LoadPanel( LPCTSTR strPanel ); ///////////////////////////////////////////////// // Event Handlers BOOL OnCreate(); void OnDestroy(); void OnRender(); void OnKeyboardButton( DWORD dwButton, BOOL bDown, DWORD dwFlags ); ///////////////////////////////////////////////// // Utility virtual void ApplyGuiHeader( ta_gui_Common_t& Common, ta_gui_Header_t& Header ); virtual void CreateButton( ta_gui_Common_t& Common, ta_gui_Button& Info ); virtual void CreateListBox( ta_gui_Common_t& Common, ta_gui_ListBox& Info ); virtual void CreateTextEdit( ta_gui_Common_t& Common, ta_gui_TextEdit& Info ); virtual void CreateSlider( ta_gui_Common_t& Common, ta_gui_Slider& Info ); virtual void CreateString( ta_gui_Common_t& Common, ta_gui_String& Info ); virtual void CreatePic( ta_gui_Common_t& Common, ta_gui_Pic& Info ); virtual void CreateFont( ta_gui_Common_t& Common, ta_gui_Font& Info ); ///////////////////////////////////////////////// // Data members protected: // List of all gadgets allocated by this class GadgetList_t m_Gadgets; // Background panel for the window gfx_Surface* m_Panel; // Gadgets invoked on key commands gui_Gadget* m_EscDefault; gui_Gadget* m_CrDefault; ///////////////////////////////////////////////// // Default Constructor/Deconstructor public: gui_Window(); virtual ~gui_Window(); ///////////////////////////////////////////////// }; // End class - gui_Window ///////////////////////////////////////////////////////////////////// // Include INLINE implementaions here for a NON-debug build #ifndef _DEBUG #include "gui_Window.inl" #endif // !defined( _DEBUG ) ///////////////////////////////////////////////////////////////////// #endif // !defined(_GUI_WINDOW_H_)
loganjones/nTA-Total-Annihilation-Clone
nTA/Source/gui_Window.h
C
mit
2,645
The MIT License (MIT) Copyright (c) 2017-present Alex Henderson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
alexghenderson/react-redux-basic-modal
LICENSE.md
Markdown
mit
1,089
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # c4stl documentation build configuration file, created by # sphinx-quickstart on Fri Jun 9 20:43:12 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # # import os # import sys # sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = ['sphinx.ext.todo', 'sphinx.ext.imgmath', 'sphinx.ext.ifconfig', 'sphinx.ext.todo', 'breathe' ] breathe_projects = {'c4stl': './doxygen/xml'} breathe_default_project = 'c4stl' breathe_default_members = ('members', 'undoc-members') # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] source_suffix = '.rst' # The master toctree document. master_doc = 'index' # General information about the project. project = 'c4stl' copyright = '2017, Joao Paulo Magalhaes' author = 'Joao Paulo Magalhaes' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '' # The full version, including alpha/beta/rc tags. release = '' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = None # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = True # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'alabaster' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # # html_theme_options = {} # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # -- Options for HTMLHelp output ------------------------------------------ # Output file base name for HTML help builder. htmlhelp_basename = 'c4stldoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). # # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. # # 'preamble': '', # Latex figure (float) alignment # # 'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, 'c4stl.tex', 'c4stl Documentation', 'Joao Paulo Magalhaes', 'manual'), ] # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, 'c4stl', 'c4stl Documentation', [author], 1) ] # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'c4stl', 'c4stl Documentation', author, 'c4stl', 'One line description of project.', 'Miscellaneous'), ]
biojppm/c4stl
doc/conf.py
Python
mit
4,994
/** * Author: Terence-Lee 'Zinglish' Davis * License: MIT * Email: zinglish[at]gmail.com * Twitter: @zingatsu */ #include "ipc_server_man.h" #include "rabbit_hole.h" #include "../globals.h" #include "limbo.h" #include <sys/un.h> #include <sys/socket.h> #include <unistd.h> #include <netinet/in.h> std::vector<RabbitHole*> IPCServer::rabbitHoles; std::vector<IPCCoD4Event*> IPCServer::broadcastEvents; std::mutex IPCServer::bcastEventStackLock; std::vector<Limbo*> IPCServer::limbo; int IPCServer::serverInitialized = 0; IPCServer::IPCServer(char* wid) { // Initialize the client holder this->rabbitHoles.reserve(5); // Allocate some memory for the broadcastEvents stack IPCServer::broadcastEvents.reserve(20); // Allocate some space for limbo players IPCServer::limbo.reserve(20); unsigned int limboSize = 20; for(unsigned int i = 0; i < limboSize; i++) { IPCServer::limbo.push_back(NULL); } this->wid = wid; this->rabbitHolePrefix = "rabbithole-"; this->rabbitHolePrefix += wid; this->rabbitHolePrefix += "-"; this->rabbitHolePath = "/tmp/"; // Create the management thread pthread_create(&this->listener, NULL, &IPCServer::ThreadedCommAllocator, this); } IPCServer::IPCServer(const IPCServer& orig) {} IPCServer::~IPCServer() {} /*===============================================================*\ * THREADS \*===============================================================*/ /** * Manages incoming link requests to the server. If the client is allowed to then * the thread will construct a new link + thread to communicate fully with Alice. */ void* IPCServer::ThreadedCommAllocator(void* serverPtr) { IPCServer* server = (IPCServer*) serverPtr; int localSock; struct sockaddr_un local; // Create the socket if((localSock = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { printf("Socket creation failed, error: %i\n", errno); exit(1); } // Prepare and bind the socket local.sun_family = AF_UNIX; strcpy(local.sun_path, "/tmp/wonderland-"); memcpy(&(local.sun_path[16]), server->wid, strlen(server->wid) + 1); printf("Preparing path %s\n", local.sun_path); unlink(local.sun_path); // Delete the original socket unsigned int len = strlen(local.sun_path) + sizeof(local.sun_family); if(bind(localSock, (struct sockaddr *)&local, len) == -1) { printf("Binding failed, error: %i\n", errno); exit(1); } // Start listening if (listen(localSock, 5) == -1) { printf("Listen failed, error: %i\n", errno); exit(1); } printf("IPC (v%i) server started\n", IPC_VER); // Accept connections indefinitely while(true) { printf("Awaiting new connection\n"); struct sockaddr_un remote; int clientSock; unsigned int clientSockSize = sizeof(remote); // Hang until a connection is incoming if((clientSock = accept(localSock, (struct sockaddr *)&remote, &clientSockSize)) == -1) { printf("Accept failed, error: %i\n", errno); exit(1); } printf("Connection established\n"); // Once connected we need to get data from the client char rxRaw[8]; // 8bytes (1st int is version, 2nd int is size of payload) std::string rxString = ""; // Used for debugging int rxStatus = 0; char* payload = NULL; while(true) { rxStatus = recv(clientSock, &rxRaw, 8, 0); // An error occurred -OR- EOS if(rxStatus <= 0) break; // Get the version and payload length u_int32_t version = ntohl(*(u_int32_t*) &rxRaw[0]); u_int32_t payloadLen = ntohl(*(u_int32_t*) &rxRaw[4]); // Double check protocol version if(version != (u_int32_t) IPC_VER) { printf("IPC protocol version mismatch (RX: %i | IPC_VER: %i)\n", version, IPC_VER); break; } // Get the full payload payload = server->RecvChunk(clientSock, payloadLen); // General debugging printf("Version: %i\n", version); printf("Payload length: %i\n", payloadLen); printf("Payload: %s\n", payload); // Handle the response back to the client server->ResponseHandler(clientSock, payload); delete payload; } printf("Client disconnected\n"); } } /*===============================================================*\ * FUNCTIONS \*===============================================================*/ char* IPCServer::RecvChunk(int socket, u_int32_t chunkSize) { // Make space for the payload, setting the last byte to 0x00 as if // it was a C style string char* payload = new char[chunkSize + 1]; memset(&payload[chunkSize], 0x00, 1); unsigned int curPos = 0; unsigned int currLen = 0; // Amount of chars written to payload unsigned int bufferSize = 8; // Recv 8 bytes every read while(curPos < chunkSize) { currLen = chunkSize - curPos; // Set the recv size under certain circumstances if(currLen < bufferSize) bufferSize = currLen; if(chunkSize < bufferSize) bufferSize = chunkSize; recv(socket, &payload[curPos], bufferSize, 0); curPos += bufferSize; } return payload; } void IPCServer::ResponseHandler(int socket, char* pkt) { char* payload = NULL; // Modify payload to send it back to the client // A request to go deeper into the rabbit hole if(strncmp("RABBITHOLE", pkt, 10) == 0) { // Prepare the full path to the rabbit hole unsigned int commId = this->CreateNewComm(); std::string fullCommPath = rabbitHoles.at(commId)->GetPath(); payload = new char[fullCommPath.length() + 1]; fullCommPath.copy(payload, fullCommPath.length(), 0); payload[fullCommPath.length()] = '\0'; } // Version request else if(strncmp("VERSION", pkt, 7) == 0) { unsigned int s = strlen(WONDERLAND_VER); payload = new char[s + 1]; memcpy(payload, WONDERLAND_VER, s + 1); } // If the response handler matched any commands if(payload != NULL) { unsigned int payloadSize = strlen(payload); char* packet = new char[4 + payloadSize + 1]; // Prepare the packet u_int32_t s = htonl(payloadSize); memcpy(packet, &s, 4); memcpy(packet + 4, payload, payloadSize); packet[4 + payloadSize] = '\0'; send(socket, packet, 4 + payloadSize, 0); delete packet; delete payload; } return; } unsigned int IPCServer::CreateNewComm() { unsigned int emptySlotIndex = 0; bool emptySlotFound = false; // Loop through all rabbit holes and find an inactive slot and to clean up // any inactive slots. unsigned int s = this->rabbitHoles.size(); for(unsigned int i = 0; i < s; i++) { // Completely destroy the rabbit hole if(this->rabbitHoles[i] != NULL && !this->rabbitHoles[i]->IsActive()) { delete this->rabbitHoles[i]; this->rabbitHoles[i] = NULL; } if(this->rabbitHoles[i] == NULL) { if(emptySlotFound == false) { emptySlotIndex = i; emptySlotFound = true; } } } unsigned int commId = 0; // Push on to the stack, forcing the stack to get larger if(!emptySlotFound) { commId = this->rabbitHoles.size(); this->rabbitHoles.push_back(new RabbitHole(commId, this->rabbitHolePath, this->rabbitHolePrefix)); } // Insert into an empty slot else { commId = emptySlotIndex; this->rabbitHoles[commId] = new RabbitHole(commId, this->rabbitHolePath, this->rabbitHolePrefix); } return commId; } void IPCServer::SetEventForBroadcast(IPCCoD4Event* event) { // Guards against events stacking and then releasing all at once when a rabbit // hole connects during the duration of the server running. bool proceed = false; RabbitHole* rabbitHole = NULL; unsigned int s = IPCServer::rabbitHoles.size(); for(unsigned int i = 0; i < s; i++) { rabbitHole = IPCServer::rabbitHoles[i]; if(rabbitHole != NULL && rabbitHole->IsActive()) { proceed = true; break; } } // Destroy the event, to prevent memory leak if(!proceed) { delete event; return; } // Add the event to the broadcast events vector IPCServer::bcastEventStackLock.lock(); printf("Setting event for broadcast\n"); bool found = false; s = IPCServer::broadcastEvents.size(); for(unsigned int i = 0; i < s; i++) { if(IPCServer::broadcastEvents[i] == NULL) { IPCServer::broadcastEvents[i] = event; found = true; break; } } // If no free spot was found in the list then just push into the stack if(!found) IPCServer::broadcastEvents.push_back(event); IPCServer::bcastEventStackLock.unlock(); // Signal all comm channels that an event has triggered s = IPCServer::rabbitHoles.size(); for(unsigned int i = 0; i < s; i++) { rabbitHole = IPCServer::rabbitHoles[i]; // Guard against signalling a rabbit hole that has actually disconnected // or doesn't have a client connected at all. if(rabbitHole != NULL && rabbitHole->IsActive()) { printf("Rabbit Hole active, signalling\n"); rabbitHole->SignalEventSend(); } } rabbitHole = NULL; } void IPCServer::DestroyEvent(IPCCoD4Event* event) { //IPCServer::bcastEventStackLock.lock(); unsigned int s = IPCServer::broadcastEvents.size(); for(unsigned int i = 0; i < s; i++) { if(event == IPCServer::broadcastEvents[i]) { // Free the memory first delete IPCServer::broadcastEvents[i]; IPCServer::broadcastEvents[i] = NULL; } } //IPCServer::bcastEventStackLock.unlock(); } void IPCServer::LimboDeny(char* ip, uint32_t qPort, char* reason) { bool foundOpenLimbo = false; unsigned int s = IPCServer::limbo.size(); for(unsigned int i = 0; i < s; i++) { Limbo* limbo = IPCServer::limbo[i]; if(!limbo) { foundOpenLimbo = true; limbo = new Limbo(); // Set the deny reason unsigned int reasonSize = strlen(reason); limbo->denyReason = new char[6 + reasonSize + 1]; strcpy(limbo->denyReason, "error\n"); strcpy(limbo->denyReason + 6, reason); // Set the IP limbo->ip = new char[strlen(ip) + 1]; memcpy(limbo->ip, ip, strlen(ip)); limbo->ip[strlen(ip)] = '\0'; // Set the qPort limbo->qPort = qPort; limbo->state = 2; IPCServer::limbo.at(i) = limbo; break; } } } void IPCServer::LimboAccept(char* ip, uint32_t qPort) { bool foundOpenLimbo = false; unsigned int s = IPCServer::limbo.size(); for(unsigned int i = 0; i < s; i++) { Limbo* limbo = IPCServer::limbo[i]; if(!limbo) { foundOpenLimbo = true; limbo = new Limbo(); // Set the IP limbo->ip = new char[strlen(ip) + 1]; memcpy(limbo->ip, ip, strlen(ip)); limbo->ip[strlen(ip)] = '\0'; // Set the qPort limbo->qPort = qPort; limbo->state = 1; IPCServer::limbo.at(i) = limbo; break; } } } /*===============================================================*\ * GTORS & STORS \*===============================================================*/ void IPCServer::Initialized() { IPCServer::serverInitialized = 1; } int IPCServer::IsServerInitialized() { return IPCServer::serverInitialized; }
Zinglish/wonderland
src/ipc/ipc_server_man.cpp
C++
mit
10,838
load '../fontex' require'tmpdir' require'fileutils' describe "Fontex" do before(:each) do @dir = Dir.mktmpdir end after(:each) do FileUtils.rm_rf @dir end it "extracts two woff fonts from css-tricks.com" do expect(decode(@dir,["http://cloud.typography.com/610186/691184/css/fonts.css", "referer=http://css-tricks.com/forums/topic/font-face-in-base64-is-cross-browser-compatible/"])).to eq(["#{@dir}/gotham_rounded_a-500.woff","#{@dir}/gotham_rounded_b-500.woff"]) expect(`file #{@dir}/gotham_rounded_a-500.woff`.chomp).to eq("#{@dir}/gotham_rounded_a-500.woff: Web Open Font Format, flavor 1330926671, length 15604, version 1.0") expect(`file #{@dir}/gotham_rounded_b-500.woff`.chomp).to eq("#{@dir}/gotham_rounded_b-500.woff: Web Open Font Format, flavor 1330926671, length 6148, version 1.0") end it "extracts two woff fonts from local css-tricks.com.woff.css" do # file downloaded as (refferrer) # wget --referer='http://css-tricks.com/forums/topic/font-face-in-base64-is-cross-browser-compatible/' http://cloud.typography.com/610186/691184/css/fonts.css expect(decode(@dir,["css/css-tricks.com.woff.css"])).to eq(["#{@dir}/gotham_rounded_a-500.woff","#{@dir}/gotham_rounded_b-500.woff"]) expect(`file #{@dir}/gotham_rounded_a-500.woff`.chomp).to eq("#{@dir}/gotham_rounded_a-500.woff: Web Open Font Format, flavor 1330926671, length 15604, version 1.0") expect(`file #{@dir}/gotham_rounded_b-500.woff`.chomp).to eq("#{@dir}/gotham_rounded_b-500.woff: Web Open Font Format, flavor 1330926671, length 6148, version 1.0") end it "extracts two otf fonts from local css-tricks.com.otf.css" do # file downloaded as (referrer + user agent) # wget --referer='http://css-tricks.com/forums/topic/font-face-in-base64-is-cross-browser-compatible/' http://cloud.typography.com/610186/691184/css/fonts.css -U 'Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0' expect(decode(@dir,["css/css-tricks.com.otf.css"])).to eq(["#{@dir}/gotham_rounded_a-500.otf","#{@dir}/gotham_rounded_b-500.otf"]) expect(`file #{@dir}/gotham_rounded_a-500.otf`.chomp).to eq("#{@dir}/gotham_rounded_a-500.otf: OpenType font data") expect(`file #{@dir}/gotham_rounded_b-500.otf`.chomp).to eq("#{@dir}/gotham_rounded_b-500.otf: OpenType font data") end it "extracts three woff fonts from http://basecamp.com" do expect(decode(@dir,["http://www.basecamp.com"])).to eq(["#{@dir}/proxima_nova.woff","#{@dir}/proxima_nova-italic.woff","#{@dir}/proxima_nova-bold.woff"]) expect(`file #{@dir}/proxima_nova.woff`.chomp).to eq("#{@dir}/proxima_nova.woff: Web Open Font Format, flavor 65536, length 23860, version 1.0") expect(`file #{@dir}/proxima_nova-bold.woff`.chomp).to eq("#{@dir}/proxima_nova-bold.woff: Web Open Font Format, flavor 65536, length 24188, version 1.0") expect(`file #{@dir}/proxima_nova-italic.woff`.chomp).to eq("#{@dir}/proxima_nova-italic.woff: Web Open Font Format, flavor 65536, length 26132, version 1.0") end # file downloaded as # wget https://d1pqgpjinf0thr.cloudfront.net/assets/main-ba90ebfb39f0038852433a3d1bf4dc60.css -O basecamp.css it "extracts three woff fonts from local basecamp.css" do expect(decode(@dir,["css/basecamp.css"])).to eq(["#{@dir}/proxima_nova.woff","#{@dir}/proxima_nova-italic.woff","#{@dir}/proxima_nova-bold.woff"]) expect(`file #{@dir}/proxima_nova.woff`.chomp).to eq("#{@dir}/proxima_nova.woff: Web Open Font Format, flavor 65536, length 23860, version 1.0") expect(`file #{@dir}/proxima_nova-bold.woff`.chomp).to eq("#{@dir}/proxima_nova-bold.woff: Web Open Font Format, flavor 65536, length 24188, version 1.0") expect(`file #{@dir}/proxima_nova-italic.woff`.chomp).to eq("#{@dir}/proxima_nova-italic.woff: Web Open Font Format, flavor 65536, length 26132, version 1.0") end # file downloaded unknown it "extracts four woff fonts from local ruble_arial.css" do expect(decode(@dir,["css/ruble_arial.css"])).to eq(["#{@dir}/ruble_arial.woff","#{@dir}/ruble_arial-bold.woff","#{@dir}/ruble_arial-italic.woff","#{@dir}/ruble_arial-bold-italic.woff"]) expect(`file #{@dir}/ruble_arial.woff`.chomp).to eq("#{@dir}/ruble_arial.woff: Web Open Font Format, flavor 65536, length 1644, version 1.0") expect(`file #{@dir}/ruble_arial-italic.woff`.chomp).to eq("#{@dir}/ruble_arial-italic.woff: Web Open Font Format, flavor 65536, length 1664, version 1.0") expect(`file #{@dir}/ruble_arial-bold.woff`.chomp).to eq("#{@dir}/ruble_arial-bold.woff: Web Open Font Format, flavor 65536, length 1676, version 1.0") expect(`file #{@dir}/ruble_arial-bold-italic.woff`.chomp).to eq("#{@dir}/ruble_arial-bold-italic.woff: Web Open Font Format, flavor 65536, length 1712, version 1.0") end # file downloaded as # wget https://assets.digital.cabinet-office.gov.uk/static/fonts-607c54f71c7c1f98257595cedaa13a34.css -O nta.css it "extracts three woff fonts from local nta.css" do expect(decode(@dir,["css/nta.css"])).to eq(["#{@dir}/nta.woff","#{@dir}/nta-bold.woff","#{@dir}/ntatabularnumbers.woff", "#{@dir}/ntatabularnumbers-bold.woff"]) expect(`file #{@dir}/nta.woff`.chomp).to eq("#{@dir}/nta.woff: Web Open Font Format, flavor 65536, length 95856, version 2012.0") expect(`file #{@dir}/nta-bold.woff`.chomp).to eq("#{@dir}/nta-bold.woff: Web Open Font Format, flavor 65536, length 72644, version 2012.0") expect(`file #{@dir}/ntatabularnumbers.woff`.chomp).to eq("#{@dir}/ntatabularnumbers.woff: Web Open Font Format, flavor 65536, length 14388, version 1.2") expect(`file #{@dir}/ntatabularnumbers-bold.woff`.chomp).to eq("#{@dir}/ntatabularnumbers-bold.woff: Web Open Font Format, flavor 65536, length 9672, version 1.0") end end
johnlane/fontex
spec/fontex_spec.rb
Ruby
mit
5,742
'use strict'; const fs = require('fs'), Bluebird = require('bluebird'), yaml = require('js-yaml'), AWS = require('aws-sdk'); const Episodes = require('./lib/episodes'), Templates = require('./lib/templates'), Auth = require('./lib/auth'); const config = yaml.safeLoad( fs.readFileSync(`config.${process.env.STAGE}.yml`, 'utf8')); AWS.config.setPromisesDependency(Bluebird); AWS.config.update({ region: config.region }); const s3 = new AWS.S3({apiVersion: '2006-03-01'}); module.exports.updatePages = (event, context, callback) => { Episodes.list(s3, config) .then(episodes => Episodes.fetchMetadata(s3, config, episodes)) .then(episodes => Episodes.sort(episodes)) .then(episodes => { return Bluebird.all([ Templates.updateFeed(s3, config, episodes), Templates.updateIndex(s3, config, episodes), Templates.updateError(s3, config), Templates.updateSuccess(s3, config), ]) }) .then(() => { callback(null) }) .catch(err => { callback(err); }); }; module.exports.updatePublish = (event, context, callback) => { const expireDate = Auth.expireDate(), credential = [config.accessKeyID, expireDate.format('YYYYMMDD'), config.region, 's3/aws4_request'].join('/'), policyBase64 = Auth.policyBase64(config.bucket, expireDate, credential), signature = Auth.signature(expireDate, config.region, policyBase64, config.secretAccessKey); Templates.updatePublish(s3, config, { expireDate: { short: expireDate.format('YYYYMMDD'), long: expireDate.format('YYYYMMDDT000000[Z]') }, policyBase64, signature }).then(() => { callback(null) }) .catch(err => { callback(err); }); }
bahlo/serverless-podcast
handler.js
JavaScript
mit
1,784
'use strict'; var React = require('react'); var mui = require('material-ui'); var SvgIcon = mui.SvgIcon; var createClass = require('create-react-class'); var NotificationAdb = createClass({ displayName: 'NotificationAdb', render: function render() { return React.createElement( SvgIcon, this.props, React.createElement('path', { d: 'M5 16c0 3.87 3.13 7 7 7s7-3.13 7-7v-4H5v4zM16.12 4.37l2.1-2.1-.82-.83-2.3 2.31C14.16 3.28 13.12 3 12 3s-2.16.28-3.09.75L6.6 1.44l-.82.83 2.1 2.1C6.14 5.64 5 7.68 5 10v1h14v-1c0-2.32-1.14-4.36-2.88-5.63zM9 9c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm6 0c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z' }) ); } }); module.exports = NotificationAdb;
mikamaunula/react-material-icons
icons/notification/adb.js
JavaScript
mit
724
/* * Copyright 2015 The WebRTC Project Authors. All rights reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef RTC_BASE_NETWORKMONITOR_H_ #define RTC_BASE_NETWORKMONITOR_H_ #include BOSS_WEBRTC_U_rtc_base__logging_h //original-code:"rtc_base/logging.h" #include BOSS_WEBRTC_U_rtc_base__network_constants_h //original-code:"rtc_base/network_constants.h" #include BOSS_WEBRTC_U_rtc_base__third_party__sigslot__sigslot_h //original-code:"rtc_base/third_party/sigslot/sigslot.h" #include BOSS_WEBRTC_U_rtc_base__thread_h //original-code:"rtc_base/thread.h" namespace rtc { class IPAddress; enum class NetworkBindingResult { SUCCESS = 0, // No error FAILURE = -1, // Generic error NOT_IMPLEMENTED = -2, ADDRESS_NOT_FOUND = -3, NETWORK_CHANGED = -4 }; class NetworkBinderInterface { public: // Binds a socket to the network that is attached to |address| so that all // packets on the socket |socket_fd| will be sent via that network. // This is needed because some operating systems (like Android) require a // special bind call to put packets on a non-default network interface. virtual NetworkBindingResult BindSocketToNetwork( int socket_fd, const IPAddress& address) = 0; virtual ~NetworkBinderInterface() {} }; /* * Receives network-change events via |OnNetworksChanged| and signals the * networks changed event. * * Threading consideration: * It is expected that all upstream operations (from native to Java) are * performed from the worker thread. This includes creating, starting and * stopping the monitor. This avoids the potential race condition when creating * the singleton Java NetworkMonitor class. Downstream operations can be from * any thread, but this class will forward all the downstream operations onto * the worker thread. * * Memory consideration: * NetworkMonitor is owned by the caller (NetworkManager). The global network * monitor factory is owned by the factory itself but needs to be released from * the factory creator. */ // Generic network monitor interface. It starts and stops monitoring network // changes, and fires the SignalNetworksChanged event when networks change. class NetworkMonitorInterface { public: NetworkMonitorInterface(); virtual ~NetworkMonitorInterface(); sigslot::signal0<> SignalNetworksChanged; virtual void Start() = 0; virtual void Stop() = 0; // Implementations should call this method on the base when networks change, // and the base will fire SignalNetworksChanged on the right thread. virtual void OnNetworksChanged() = 0; virtual AdapterType GetAdapterType(const std::string& interface_name) = 0; virtual AdapterType GetVpnUnderlyingAdapterType( const std::string& interface_name) = 0; }; class NetworkMonitorBase : public NetworkMonitorInterface, public MessageHandler, public sigslot::has_slots<> { public: NetworkMonitorBase(); ~NetworkMonitorBase() override; void OnNetworksChanged() override; void OnMessage(Message* msg) override; AdapterType GetVpnUnderlyingAdapterType( const std::string& interface_name) override; protected: Thread* worker_thread() { return worker_thread_; } private: Thread* worker_thread_; }; /* * NetworkMonitorFactory creates NetworkMonitors. */ class NetworkMonitorFactory { public: // This is not thread-safe; it should be called once (or once per audio/video // call) during the call initialization. static void SetFactory(NetworkMonitorFactory* factory); static void ReleaseFactory(NetworkMonitorFactory* factory); static NetworkMonitorFactory* GetFactory(); virtual NetworkMonitorInterface* CreateNetworkMonitor() = 0; virtual ~NetworkMonitorFactory(); protected: NetworkMonitorFactory(); }; } // namespace rtc #endif // RTC_BASE_NETWORKMONITOR_H_
koobonil/Boss2D
Boss2D/addon/webrtc-jumpingyang001_for_boss/rtc_base/networkmonitor.h
C
mit
4,152
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>XMM101: a single, unlensed galaxy &mdash; uvmcmcfit 0.1 documentation</title> <link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: './', VERSION: '0.1', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> <link rel="top" title="uvmcmcfit 0.1 documentation" href="index.html" /> <link rel="up" title="Examples" href="examples.html" /> <link rel="next" title="Preliminary Setup Procedures" href="setup.html" /> <link rel="prev" title="Examples" href="examples.html" /> </head> <body> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="setup.html" title="Preliminary Setup Procedures" accesskey="N">next</a> |</li> <li class="right" > <a href="examples.html" title="Examples" accesskey="P">previous</a> |</li> <li><a href="index.html">uvmcmcfit 0.1 documentation</a> &raquo;</li> <li><a href="examples.html" accesskey="U">Examples</a> &raquo;</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="xmm101-a-single-unlensed-galaxy"> <h1>XMM101: a single, unlensed galaxy<a class="headerlink" href="#xmm101-a-single-unlensed-galaxy" title="Permalink to this headline">¶</a></h1> <p>This example shows how to run <tt class="docutils literal"><span class="pre">uvmcmcfit</span></tt> on the simplest of systems: a single galaxy that is unaffected by lensing of any kind.</p> <div class="toctree-wrapper compound"> <ul> <li class="toctree-l1"><a class="reference internal" href="setup.html">Preliminary Setup Procedures</a><ul> <li class="toctree-l2"><a class="reference internal" href="setup.html#inputs">Inputs</a></li> <li class="toctree-l2"><a class="reference internal" href="setup.html#outputs">Outputs</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="xmm101-config.html">Configuring config.yaml</a><ul> <li class="toctree-l2"><a class="reference internal" href="xmm101-config.html#required-keywords">Required keywords</a></li> <li class="toctree-l2"><a class="reference internal" href="xmm101-config.html#optional-keywords">Optional keywords</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="usage.html">Running <tt class="docutils literal"><span class="pre">uvmcmcfit</span></tt></a></li> <li class="toctree-l1"><a class="reference internal" href="xmm101-inspect.html">Inspecting the Model Results for XMM101</a><ul> <li class="toctree-l2"><a class="reference internal" href="xmm101-access.html">Accessing the Data Directly</a></li> <li class="toctree-l2"><a class="reference internal" href="xmm101-convergence.html">Testing Convergence</a></li> <li class="toctree-l2"><a class="reference internal" href="xmm101-bestfit.html">Plot the Best-fit Model</a></li> <li class="toctree-l2"><a class="reference internal" href="xmm101-goodfits.html">Plot Several Acceptable Model Fits</a></li> <li class="toctree-l2"><a class="reference internal" href="xmm101-posteriors.html">Plot the Posterior PDFs</a></li> <li class="toctree-l2"><a class="reference internal" href="xmm101-covariance.html">Plot the Covariance Matrix</a></li> </ul> </li> </ul> </div> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h4>Previous topic</h4> <p class="topless"><a href="examples.html" title="previous chapter">Examples</a></p> <h4>Next topic</h4> <p class="topless"><a href="setup.html" title="next chapter">Preliminary Setup Procedures</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="_sources/xmm101.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="setup.html" title="Preliminary Setup Procedures" >next</a> |</li> <li class="right" > <a href="examples.html" title="Examples" >previous</a> |</li> <li><a href="index.html">uvmcmcfit 0.1 documentation</a> &raquo;</li> <li><a href="examples.html" >Examples</a> &raquo;</li> </ul> </div> <div class="footer"> &copy; Copyright 2014, Shane Bussmann. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2. </div> </body> </html>
astro313/uvmcmcfit
docs/_build/html/xmm101.html
HTML
mit
6,259
--- layout: page landingpage: true key: apps-overview title: Overview --- # Introduction The ePages API is based on RESTful principles, allowing you to code in whatever language you prefer. It supports JSON media types and uses UTF-8 character encoding. Making use of this API, you can create awesome apps or single shop connections. It is designed to give developers a convenient way to access data contained within ePages shops. With a standard interface to store data, it is very simple to create applications that can communicate with our merchant's stores. In a first approach, we support 3rd party applications that connect via the REST API to ePages shops, allowing them to exchange data and allowing the merchant to work with these data. # Registration Before you can start coding away, you'll need to sign up for the ePages Developer Program and create a test shop. To use the ePages API you will need an application registration. 1. [Sign up](http://www.epages.com/en/partner/developer-program/) for the Developer Program. * Enter your name and email address in the required fields. * Agree to the terms and conditions. * Check your mailbox for the login details from your registration and create a test shop. 2. Log in to your test shop. 3. Get your [**Client ID** and **Client Secret**](page:apps-create#get-your-credentials). {% callout info Note: %} The account for your test shop will be active for 365 days. After this period has expired, the shop account can be prolonged for free. If you're eager for more information on how to set up your test shop, check out our [Online Help](https://www.online-help-center.com/) for merchants. {% endcallout %}
UlfS/epages-docs
apps/index.md
Markdown
mit
1,687
var baseCallback = require('../internal/baseCallback'), baseEachRight = require('../internal/baseEachRight'), baseFind = require('../internal/baseFind'); /** * This method is like `_.find` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to search. * @param {Function|Object|string} [predicate=_.identity] The function invoked * per iteration. * @param {*} [thisArg] The `this` binding of `predicate`. * @returns {*} Returns the matched element, else `undefined`. * @example * * _.findLast([1, 2, 3, 4], function(n) { * return n % 2 == 1; * }); * // => 3 */ function findLast(collection, predicate, thisArg) { predicate = baseCallback(predicate, thisArg, 3); return baseFind(collection, predicate, baseEachRight); } module.exports = findLast;
hejiheji001/HexoBlog
node_modules/hexo/node_modules/lodash/collection/findLast.js
JavaScript
mit
940
<?php namespace Davidmgilo\Myframework\core; class Request { public static function uri(){ return trim($_SERVER['REQUEST_URI'],'/'); // return urldecode( // parse_url($_SERVER['REQUEST_URI'],PHP_URL_PATH) // ); } }
davidmgilo/php-learning
src/core/Request.php
PHP
mit
258
require 'spec_helper' RSpec.describe EventReporter::Load do context "when getting a filename" do before do instream = StringIO.new @outstream = StringIO.new printer = EventReporter::Printer.new(@outstream) criteria = [] @loader = EventReporter::Load.new(instream, @outstream, printer, criteria) end it "defaults filename if no critera are provided" do @loader.get_filename expect(@loader.file_name).to eq('event_attendees.csv') end it "sets one criterion as the filename" do @loader.criteria = ["x.csv"] @loader.get_filename expect(@loader.file_name).to eq("x.csv") end it "returns invalid if multiple criteron are passed in" do @loader.criteria = ["y.csv", "w.csv"] @loader.call expect(@outstream.string).to include("Invalid load criteria:") end it "returns error if the file does not exist in files dir" do @loader.criteria = ["dskgjslasd.csv"] @loader.call expect(@outstream.string).to include("does not exist") end it "generates a load path" do @loader.criteria = ["x.csv"] @loader.get_filename path = @loader.generate_file_path expect(path).to eql('././files/x.csv') end end context "when loading a file" do before do instream = StringIO.new @outstream = StringIO.new printer = EventReporter::Printer.new(@outstream) criteria = [] @loader = EventReporter::Load.new(instream, @outstream, printer, criteria) end it "reads in a csv file" do @loader.file_name = ['event_attendees.csv'] path = @loader.generate_file_path opened_csv = @loader.read_in_csv(path) expect(opened_csv).to be_a CSV end it "converts csv row objects to hashes" do @loader.file_name = ['event_attendees.csv'] path = @loader.generate_file_path opened_csv = @loader.read_in_csv(path) hashes = @loader.csv_to_hash(opened_csv) expect(hashes[0]).to be_a Hash end it "creates a new EntryRepository object" do @loader.call expect($entry_repository).to be_a EventReporter::EntryRepository end end end
bmrsny/event_reporter
spec/load_spec.rb
Ruby
mit
2,180
package com.enigmabridge.provider; import com.enigmabridge.provider.rsa.RSA; import org.bouncycastle.asn1.ASN1ObjectIdentifier; import org.bouncycastle.jcajce.provider.config.ConfigurableProvider; import org.bouncycastle.jcajce.provider.config.ProviderConfiguration; import org.bouncycastle.jcajce.provider.util.AsymmetricKeyInfoConverter; import javax.crypto.Cipher; import javax.crypto.CipherSpi; import javax.crypto.SecretKey; import java.io.ByteArrayOutputStream; import java.lang.reflect.Constructor; import java.security.*; import java.util.HashMap; import java.util.Map; /** * Testing implementation. * Created by dusanklinec on 21.04.16. */ public class EnigmaProviderOld extends Provider implements ConfigurableProvider { // reference to the crypto backend that implements all the algorithms final CryptoBackend cryptoBackend; public static final String PROVIDER_NAME = "EB"; public static final double VERSION = 0.0; public static final ProviderConfiguration CONFIGURATION = new EBProviderConfigurationCrypto(); private static final Map keyInfoConverters = new HashMap(); public EnigmaProviderOld() { super(PROVIDER_NAME, VERSION, "JCA/JCE provider for " + PROVIDER_NAME); this.cryptoBackend = null; AccessController.doPrivileged(new PrivilegedAction() { public Object run() { setup(); return null; } }); } private void setup() { // Register our RSA engine. new RSA.Mappings().configure(this); // register the algorithms we support (MD5, SHA1, DES, and AES) putService(new MyService (this, "MessageDigest", "MD5", "com.foo.ExampleProvider$MyMessageDigest")); putService(new MyService (this, "MessageDigest", "SHA1", "com.foo.ExampleProvider$MyMessageDigest")); putService(new MyCipherService (this, "Cipher", "DES", "com.foo.ExampleProvider$MyCipher")); putService(new MyCipherService (this, "Cipher", "AES", "com.foo.ExampleProvider$MyCipher")); } public void setParameter(String parameterName, Object parameter) { synchronized (CONFIGURATION) { ((EBProviderConfigurationCrypto)CONFIGURATION).setParameter(parameterName, parameter); } } public boolean hasAlgorithm(String type, String name) { return containsKey(type + "." + name) || containsKey("Alg.Alias." + type + "." + name); } public void addAlgorithm(String key, String value) { if (containsKey(key)) { throw new IllegalStateException("duplicate provider key (" + key + ") found"); } put(key, value); } public void addAlgorithm(String type, ASN1ObjectIdentifier oid, String className) { addAlgorithm(type + "." + oid, className); addAlgorithm(type + ".OID." + oid, className); } public void addKeyInfoConverter(ASN1ObjectIdentifier oid, AsymmetricKeyInfoConverter keyInfoConverter) { keyInfoConverters.put(oid, keyInfoConverter); } // the API of our fictitious crypto backend static abstract class CryptoBackend { abstract byte[] digest(String algorithm, byte[] data); abstract byte[] encrypt(String algorithm, KeyHandle key, byte[] data); abstract byte[] decrypt(String algorithm, KeyHandle key, byte[] data); abstract KeyHandle createKey(String algorithm, byte[] keyData); } // the shell of the representation the crypto backend uses for keys private static final class KeyHandle { // fill in code } // we have our own ServiceDescription implementation that overrides newInstance() // that calls the (Provider, String) constructor instead of the no-args constructor private static class MyService extends Service { private static final Class[] paramTypes = {Provider.class, String.class}; MyService(Provider provider, String type, String algorithm, String className) { super(provider, type, algorithm, className, null, null); } public Object newInstance(Object param) throws NoSuchAlgorithmException { try { // get the Class object for the implementation class Class clazz; Provider provider = getProvider(); ClassLoader loader = provider.getClass().getClassLoader(); if (loader == null) { clazz = Class.forName(getClassName()); } else { clazz = loader.loadClass(getClassName()); } // fetch the (Provider, String) constructor Constructor cons = clazz.getConstructor(paramTypes); // invoke constructor and return the SPI object Object obj = cons.newInstance(new Object[] {provider, getAlgorithm()}); return obj; } catch (Exception e) { throw new NoSuchAlgorithmException("Could not instantiate service", e); } } } // custom ServiceDescription class for Cipher objects. See supportsParameter() below private static class MyCipherService extends MyService { MyCipherService(Provider provider, String type, String algorithm, String className) { super(provider, type, algorithm, className); } // we override supportsParameter() to let the framework know which // keys we can support. We support instances of MySecretKey, if they // are stored in our provider backend, plus SecretKeys with a RAW encoding. public boolean supportsParameter(Object obj) { if (obj instanceof SecretKey == false) { return false; } SecretKey key = (SecretKey)obj; if (key.getAlgorithm().equals(getAlgorithm()) == false) { return false; } if (key instanceof MySecretKey) { MySecretKey myKey = (MySecretKey)key; return myKey.provider == getProvider(); } else { return "RAW".equals(key.getFormat()); } } } // our generic MessageDigest implementation. It implements all digest // algorithms in a single class. We only implement the bare minimum // of MessageDigestSpi methods private static final class MyMessageDigest extends MessageDigestSpi { private final EnigmaProviderOld provider; private final String algorithm; private ByteArrayOutputStream buffer; MyMessageDigest(Provider provider, String algorithm) { super(); this.provider = (EnigmaProviderOld)provider; this.algorithm = algorithm; engineReset(); } protected void engineReset() { buffer = new ByteArrayOutputStream(); } protected void engineUpdate(byte b) { buffer.write(b); } protected void engineUpdate(byte[] b, int ofs, int len) { buffer.write(b, ofs, len); } protected byte[] engineDigest() { byte[] data = buffer.toByteArray(); byte[] digest = provider.cryptoBackend.digest(algorithm, data); engineReset(); return digest; } } // our generic Cipher implementation, only partially complete. It implements // all cipher algorithms in a single class. We implement only as many of the // CipherSpi methods as required to show how it could work private static abstract class MyCipher extends CipherSpi { private final EnigmaProviderOld provider; private final String algorithm; private int opmode; private MySecretKey myKey; private ByteArrayOutputStream buffer; MyCipher(Provider provider, String algorithm) { super(); this.provider = (EnigmaProviderOld)provider; this.algorithm = algorithm; } protected void engineInit(int opmode, Key key, SecureRandom random) throws InvalidKeyException { this.opmode = opmode; myKey = MySecretKey.getKey(provider, algorithm, key); if (myKey == null) { throw new InvalidKeyException(); } buffer = new ByteArrayOutputStream(); } protected byte[] engineUpdate(byte[] b, int ofs, int len) { buffer.write(b, ofs, len); return new byte[0]; } protected int engineUpdate(byte[] b, int ofs, int len, byte[] out, int outOfs) { buffer.write(b, ofs, len); return 0; } protected byte[] engineDoFinal(byte[] b, int ofs, int len) { buffer.write(b, ofs, len); byte[] in = buffer.toByteArray(); byte[] out; if (opmode == Cipher.ENCRYPT_MODE) { out = provider.cryptoBackend.encrypt(algorithm, myKey.handle, in); } else { out = provider.cryptoBackend.decrypt(algorithm, myKey.handle, in); } buffer = new ByteArrayOutputStream(); return out; } // code for remaining CipherSpi methods goes here } // our SecretKey implementation. All our keys are stored in our crypto // backend, we only have an opaque handle available. There is no // encoded form of these keys. private static final class MySecretKey implements SecretKey { final String algorithm; final Provider provider; final KeyHandle handle; MySecretKey(Provider provider, String algorithm, KeyHandle handle) { super(); this.provider = provider; this.algorithm = algorithm; this.handle = handle; } public String getAlgorithm() { return algorithm; } public String getFormat() { return null; // this key has no encoded form } public byte[] getEncoded() { return null; // this key has no encoded form } // Convert the given key to a key of the specified provider, if possible static MySecretKey getKey(EnigmaProviderOld provider, String algorithm, Key key) { if (key instanceof SecretKey == false) { return null; } // algorithm name must match if (!key.getAlgorithm().equals(algorithm)) { return null; } // if key is already an instance of MySecretKey and is stored // on this provider, return it right away if (key instanceof MySecretKey) { MySecretKey myKey = (MySecretKey)key; if (myKey.provider == provider) { return myKey; } } // otherwise, if the input key has a RAW encoding, convert it if (!"RAW".equals(key.getFormat())) { return null; } byte[] encoded = key.getEncoded(); KeyHandle handle = provider.cryptoBackend.createKey(algorithm, encoded); return new MySecretKey(provider, algorithm, handle); } } }
EnigmaBridge/client.java
client/src/main/java/com/enigmabridge/provider/EnigmaProviderOld.java
Java
mit
11,396
/***** * functions for the expert script creation process. * ******/ function chgStage(chg, loc){ if(chg==-1 && currentStage==1) return; if(chg>=1 && currentStage==maxStage){ alert("last stage"); return; } if(chg==1 || chg==-1){ var oldStage = currentStage; currentStage += chg; } else if(chg>1) currentStage = chg; var winloc = window.location.href; if(winloc.indexOf("stage")<0) winloc = loc+"?stage="+currentStage; else { winloc = location.href.replace("stage="+oldStage, "stage="+currentStage); } window.location.href = winloc; } /** ** We either display the map at the current stage of the case or display the complete map (as if on last card) */ /*function toggleMapDisplay(){ sendAjax(0, callBackReload, "toggleShowAll", ""); }*/ /** * we change the language of the map and reload the page to display the changed list items */ function chgMapLang(){ var newLang = $("#scriptloc").val(); listUrl="../jsonp_"+newLang+".json"; scriptlang = newLang; //alert(listUrl); if(isEmptyScript=="true"){ //trigger submit, script is empty sendAjax(newLang, callBackReload, "changeLangOfScript", ""); } else{ //we have to ask user what he/she wants to do with the already created items var cont = confirm("Wollen Sie die Sprache ändern? Es wird versucht alle bereits eingegebenen Knoten in die neue Sprache zu übersetzen.") if(cont){ sendAjax(newLang, callBackReload, "changeLangOfScript", ""); } } //location.reload(); } /*function chgBox2(){ var newType = $("#chgbox2").val(); sendAjax(newType, callBackReload, "changeBoxType2", ""); //location.reload(); } function chgBox3(){ var newType = $("#chgbox3").val(); sendAjax(newType, callBackReload, "changeBoxType3", ""); //location.reload(); } function chgBox4(){ var newType = $("#chgbox4").val(); sendAjax(newType, callBackReload, "changeBoxType4", ""); //location.reload(); } function chgBox6(){ var newType = $("#chgbox6").val(); sendAjax(newType, callBackReload, "changeBoxType6", ""); //location.reload(); }*/ function toggleDisplayMode(){ if(sessionStorage.displayMode==1) sessionStorage.displayMode = 0; else sessionStorage.displayMode = 1; /*if (displayMode==1) displayMode = 0; else displayMode = 1;*/ toggleShowAll(); } /** * the display of the individual map is either as a step-thru (0) or complete map display (1) * @param url * @returns */ function toggleShowAll(){ var winloc = window.location.href; if(winloc.indexOf("repdm")<0) winloc = winloc+"&repdm=0"; if (sessionStorage.displayMode==1){ winloc = winloc.replace("repdm=1", "repdm=0"); } else winloc = winloc.replace("repdm=0", "repdm=1"); //alert ( winloc); window.location.href = winloc; } /* * expert has chosen a diagnosis to be a final one... */ function expFinalDiagnosis(id){ sendAjax(id, expFinalDiagnosisCallback, "expSetFinalDiagnosis", ""); } /* * expert has chosen a diagnosis to be a final one... */ function expNoFinalDiagnosis(id){ sendAjax(id, expFinalDiagnosisCallback, "expSetNoFinalDiagnosis", ""); } function expFinalDiagnosisCallback(){ diagnosisCallBack(); } /* expert changes the stage for a problem or ddx or ...*/ function chgStageItem(obj){ var id = obj.id; var realId = id.substring(9); var newStage = $("#"+id).val(); if(newStage<=0 || newStage>maxStage){ //check that the new card idx is within the case length! alert("Invalid card number"); return; } else sendAjax(realId, chgStageCallback, "chgStateOfItem", newStage); } /* changes the stage when the final diagnosis is made */ function chgStageFinal(obj){ var id = obj.id; var realId = id.substring(14); var newStage = $("#"+id).val(); sendAjax(realId, chgStageCallback, "chgFinalState", newStage); } /** * the stage at which the connection appears is changed */ function chgStageEdge(obj){ var cnxId = $("#conn_id").html(); // form of "cnx_12345" //var cnx = getConnectionById(cnxId); var newStage = $("#conn_stage").val(); sendAjax(cnxId, chgStageCallback, "chgStateOfEdge", newStage); } function chgSummStCrd(obj){ var id = obj.id; var newStage = $("#"+id).val(); sendAjax(newStage, chgStageCallback, "chgSummStCard", newStage); } /** * we reload the changed box and the connections. */ function chgStageCallback(){ location.reload(); } /** * open the jdialog to display the editor to create a new script **/ function createNewScript(){ $("#jdialog").dialog( "option", "width", ['350'] ); $("#jdialog").dialog( "option", "height", ['250'] ); $("#jdialog").dialog( "option", "title", "Create new script" ); $("#jdialog").dialog( "option", "buttons", [ ] ); $("#jdialog").dialog( "open" ); $("#jdialog").dialog( "option", "position", [0,0] ); $("#jdialog").html(); $("#jdialog").show(); } function toggleStageDisplay(){ $(".stagedisplay").hide(); $(".stagestepon").show(); $(".stagestepoff").hide(); if(displayMode==1){ $(".stagedisplay").show(); //display of stages $(".stagestepon").hide(); //the navigation $(".stagestepoff").show(); } } function openSelBoxes(){ $("#boxesSel").dialog( "option", "width", ['200'] ); $("#boxesSel").dialog( "option", "height", ['200'] ); $("#boxesSel").dialog( "option", "title", ""); $("#boxesSel").dialog( "option", "buttons", [ ] ); $("#boxesSel" ).dialog( "open" ); $("#boxesSel").show(); } /** * we check whether the author has checked 4 or less boxes, if more we alert a warning. */ function checkBoxNum(){ var boxesNum = ($('.boxeschk :checked').size()); if(boxesNum>4) alert("Please only select 4 Boxes."); } function saveBoxesSel(){ if(($('.boxeschk :checked').size())>4){ alert("Please only select max. 4 Boxes."); } else{ var arr = []; $(".boxeschk").each(function(){ if($(this).is(":checked")){ arr.push($(this).val()); } else{ arr.push(0); } }) var vals = arr.join(","); //alert(vals); sendAjax(vals, callBackReload, "changeBoxType", ""); } } function initBoxesSel(){ for(var i=1; i<=6;i++){ //var val = box1type; if(box1Type==i || box2Type==i || box3Type==i || box4Type==i) $("#boxtypes"+i).prop("checked", true); } } /*function chgBox(boxNo){ var newType = $("#chgbox"+boxNo).val(); sendAjax(newType, callBackReload, "changeBoxType"+boxNo, ""); //location.reload(); }*/
clinReasonTool/ClinicalReasoningTool
ClinReasonTool/src/scripts/editexp.js
JavaScript
mit
6,297
using System; using System.Diagnostics; using System.Threading.Tasks; using Nimbus.Tests.Integration.Extensions; using NUnit.Framework; namespace Nimbus.Tests.Integration { [TestFixture] //[Timeout(TimeoutSeconds*1000)] public abstract class SpecificationForAsync<T> where T : class { protected const int TimeoutSeconds = 30; protected readonly TimeSpan Timeout = TimeSpan.FromSeconds(TimeoutSeconds); protected T Subject; protected abstract Task<T> Given(); protected abstract Task When(); private Stopwatch _sw; [OneTimeSetUp] public void TestFixtureSetUp() { Task.Run(async () => { Subject = await Given(); _sw = Stopwatch.StartNew(); await When(); _sw.Stop(); Console.WriteLine("Elapsed time: {0} seconds", _sw.Elapsed.TotalSeconds); }).Wait(); } [SetUp] public virtual void SetUp() { } [TearDown] public virtual void TearDown() { TestLoggingExtensions.LogTestResult(); } [OneTimeTearDown] public void TestFixtureTearDown() { var disposable = Subject as IDisposable; if (disposable != null) disposable.Dispose(); Subject = null; } } }
NimbusAPI/Nimbus
src/Nimbus.Tests.Integration/SpecificationForAsync.cs
C#
mit
1,513
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\PropertyAccess\Tests; class PropertyAccessorCollectionTest_Car { private $axes; public function __construct($axes = null) { $this->axes = $axes; } // In the test, use a name that StringUtil can't uniquely singularify public function addAxis($axis) { $this->axes[] = $axis; } public function removeAxis($axis) { foreach ($this->axes as $key => $value) { if ($value === $axis) { unset($this->axes[$key]); return; } } } public function getAxes() { return $this->axes; } } class PropertyAccessorCollectionTest_CarOnlyAdder { public function addAxis($axis) { } public function getAxes() { } } class PropertyAccessorCollectionTest_CarOnlyRemover { public function removeAxis($axis) { } public function getAxes() { } } class PropertyAccessorCollectionTest_CarNoAdderAndRemover { public function getAxes() { } } class PropertyAccessorCollectionTest_CompositeCar { public function getStructure() { } public function setStructure($structure) { } } class PropertyAccessorCollectionTest_CarStructure { public function addAxis($axis) { } public function removeAxis($axis) { } public function getAxes() { } } abstract class PropertyAccessorCollectionTest extends PropertyAccessorArrayAccessTest { public function testSetValueCallsAdderAndRemoverForCollections() { $axesBefore = $this->getContainer([1 => 'second', 3 => 'fourth', 4 => 'fifth']); $axesMerged = $this->getContainer([1 => 'first', 2 => 'second', 3 => 'third']); $axesAfter = $this->getContainer([1 => 'second', 5 => 'first', 6 => 'third']); $axesMergedCopy = \is_object($axesMerged) ? clone $axesMerged : $axesMerged; // Don't use a mock in order to test whether the collections are // modified while iterating them $car = new PropertyAccessorCollectionTest_Car($axesBefore); $this->propertyAccessor->setValue($car, 'axes', $axesMerged); $this->assertEquals($axesAfter, $car->getAxes()); // The passed collection was not modified $this->assertEquals($axesMergedCopy, $axesMerged); } public function testSetValueCallsAdderAndRemoverForNestedCollections() { $car = $this->getMockBuilder(__CLASS__.'_CompositeCar')->getMock(); $structure = $this->getMockBuilder(__CLASS__.'_CarStructure')->getMock(); $axesBefore = $this->getContainer([1 => 'second', 3 => 'fourth']); $axesAfter = $this->getContainer([0 => 'first', 1 => 'second', 2 => 'third']); $car->expects($this->any()) ->method('getStructure') ->willReturn($structure); $structure->expects($this->once()) ->method('getAxes') ->willReturn($axesBefore); $structure->expects($this->once()) ->method('removeAxis') ->with('fourth'); $structure->expects($this->exactly(2)) ->method('addAxis') ->withConsecutive( ['first'], ['third'] ); $this->propertyAccessor->setValue($car, 'structure.axes', $axesAfter); } public function testSetValueFailsIfNoAdderNorRemoverFound() { $this->expectException(\Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException::class); $this->expectExceptionMessageMatches('/Could not determine access type for property "axes" in class "Mock_PropertyAccessorCollectionTest_CarNoAdderAndRemover_[^"]*"./'); $car = $this->getMockBuilder(__CLASS__.'_CarNoAdderAndRemover')->getMock(); $axesBefore = $this->getContainer([1 => 'second', 3 => 'fourth']); $axesAfter = $this->getContainer([0 => 'first', 1 => 'second', 2 => 'third']); $car->expects($this->any()) ->method('getAxes') ->willReturn($axesBefore); $this->propertyAccessor->setValue($car, 'axes', $axesAfter); } public function testIsWritableReturnsTrueIfAdderAndRemoverExists() { $car = new PropertyAccessorCollectionTest_Car(); $this->assertTrue($this->propertyAccessor->isWritable($car, 'axes')); } public function testIsWritableReturnsFalseIfOnlyAdderExists() { $car = new PropertyAccessorCollectionTest_CarOnlyAdder(); $this->assertFalse($this->propertyAccessor->isWritable($car, 'axes')); } public function testIsWritableReturnsFalseIfOnlyRemoverExists() { $car = new PropertyAccessorCollectionTest_CarOnlyRemover(); $this->assertFalse($this->propertyAccessor->isWritable($car, 'axes')); } public function testIsWritableReturnsFalseIfNoAdderNorRemoverExists() { $car = new PropertyAccessorCollectionTest_CarNoAdderAndRemover(); $this->assertFalse($this->propertyAccessor->isWritable($car, 'axes')); } public function testSetValueFailsIfAdderAndRemoverExistButValueIsNotTraversable() { $this->expectException(\Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException::class); $this->expectExceptionMessageMatches('/Could not determine access type for property "axes" in class "Symfony\\\\Component\\\\PropertyAccess\\\\Tests\\\\PropertyAccessorCollectionTest_Car[^"]*": The property "axes" in class "Symfony\\\\Component\\\\PropertyAccess\\\\Tests\\\\PropertyAccessorCollectionTest_Car[^"]*" can be defined with the methods "addAxis\(\)", "removeAxis\(\)" but the new value must be an array or an instance of \\\\Traversable, "string" given./'); $car = new PropertyAccessorCollectionTest_Car(); $this->propertyAccessor->setValue($car, 'axes', 'Not an array or Traversable'); } }
zerkms/symfony
src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorCollectionTest.php
PHP
mit
6,123
import classic from 'ember-classic-decorator'; import Base from './base'; @classic export default class UsersRoute extends Base { queryParams = { date_range: { refreshModel: true, }, start_at: { refreshModel: true, }, end_at: { refreshModel: true, }, query: { refreshModel: true, }, search: { refreshModel: true, }, }; model() { return {}; } }
NREL/api-umbrella
src/api-umbrella/admin-ui/app/routes/stats/users.js
JavaScript
mit
429
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class User extends Model { /** * The database table used by the model. * * @var string */ protected $table = 'users'; /** * Indicates if the model should be timestamped. * * @var bool */ public $timestamps = true; /** * The attributes excluded from the model's JSON form. * * @var array */ protected $hidden = array('password'); /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'name', 'email', 'password', ]; }
lozy219/tangerine
app/Models/User.php
PHP
mit
572
<?php /** * @package SIGen * @subpackage Exception * @author Alexander Wühr <[email protected]> * @copyright 2013 Alexander Wühr <[email protected]> * @license http://opensource.org/licenses/MIT The MIT License (MIT) * @link https://boolshit.de */ namespace Lx\SIGen\Exception; /** * Exception which is thrown, when errors occur while evaluating expressions in InterfaceBuilder */ class EvalException extends Exception { }
l-x/SIGen
src/Exception/EvalException.php
PHP
mit
450
// // UIViewController+Nav.h // iAuto360 // // Created by Steven on 15/1/21. // Copyright (c) 2015年 YaMei. All rights reserved. // #import <UIKit/UIKit.h> #import "UINavigationController+extend.h" /// UIViewController 导航扩充 @interface UIViewController (UIViewController_Nav) /// 父级 ViewController @property (nonatomic, weak) UIViewController * parentVC; /// 用于界面间传递参数, viewDidLoad 时 self.param 获取 @property (nonatomic, strong) id param; /// Storyboard中获取ViewonController + (UIViewController *)getViewControllerFromStoryboard:(NSString *)storyboardName key:(NSString *)key; /// 通过字符串类名查找ViewController - (UIViewController *)getControllerWithKey:(NSString *)key; /** * push storyboard 的初始化界面 * * @param storyBoardName storyBoard 名字 * @param param 界面传参 * @param animated 是否动画 * * @return 已经初始化对控制器 */ - (id)pushInstantiateIntiaViewController:(NSString *)storyBoardName param:(id)param animated:(BOOL)animated; /** * push storyboard 的初始化界面, 开启动画 * * @param storyBoardName storyBoard 名字 * @param param 界面传参 * * @return 已经初始化对控制器 */ - (id)pushInstantiateIntiaViewController:(NSString *)storyBoardName param:(id)param; /** * push viewController * * @param viewController viewController * @param param 界面传参 * @param animated 是否动画 * * @return 已经初始化对控制器 */ - (id)pushViewController:(UIViewController *)viewController param:(id)param animated:(BOOL)animated; /** * push viewController * * @param storyboardKey storyboard的名字 * @param viewControllerKey viewController 在 storyboard 中的 key * @param param 界面传参 * @param animated 是否动画 * * @return 已经初始化对控制器 */ - (id)pushStoryboardKey:(NSString *)storyboardKey viewControllerKey:(NSString *)viewControllerKey param:(id)param animated:(BOOL)animated; /** * push viewController 开启动画 * * @param storyboardKey storyboard的名字 * @param viewControllerKey viewController 在 storyboard 中的 key * @param param 界面传参 * @param animated 是否动画 * * @return 已经初始化对控制器 */ - (id)pushStoryboardKey:(NSString *)storyboardKey viewControllerKey:(NSString *)viewControllerKey param:(id)param; /** * push viewController * * @param viewControllerKey viewController 在 storyboard 中的 key * @param param 界面传参 * @param animated 是否动画 * * @return 已经初始化对控制器 */ - (id)pushViewControllerKey:(NSString *)viewControllerKey param:(id)param animated:(BOOL)animated; /** * push viewController , 开启动画 * * @param viewControllerKey viewController 在 storyboard 中的 key * @param param 界面传参 * * @return 已经初始化对控制器 */ - (id)pushViewControllerKey:(NSString *)viewControllerKey param:(id)param; /** * present viewController ( 模态推出 ) * * @param stroyboardKey storyboard的名字 * @param viewControllerKey viewController 在 storyboard 中的 key * @param param 界面传参 * @param animated 是否动画 * * @return 已经初始化对控制器 */ - (id)presentStoryboardKey:(NSString *)storyboardKey viewControllerKey:(NSString *)viewControllerKey param:(id)param; /// 动画过渡,替换栈内控制器, 通过字符串索引到控制器 - (void)replaceViewControllerKey:(NSString *)viewControllerKey toStoryboardKey:(NSString *)toStoryboardKey toViewControllerKey:(NSString *)toViewControllerKey param:(id)param animated:(UINavigationControllerAnimated)animated; /// 动画过渡,替换栈内控制器,self 到 新的指定控制器 - (void)replaceToStoryboardKey:(NSString *)toStoryboardKey toViewControllerKey:(NSString *)toViewControllerKey param:(id)param animated:(UINavigationControllerAnimated)animated; /// 动画过渡,替换栈内控制器, 栈内所有控制器出栈,新的指定控制器如栈 - (void)replaceAllToStorayboardKey:(NSString *)toStoryboardKey toViewControllerKey:(NSString *)toViewControllerKey param:(id)param animated:(UINavigationControllerAnimated)animated; /// 动画过渡,替换underViewController之上的控制器, 通过key索引 - (void)replaceUnderViewControllerKey:(NSString *)underViewControllerKey toStoryboardKey:(NSString *)toStoryboardKey toViewControllerKey:(NSString *)toViewControllerKey param:(id)param animated:(UINavigationControllerAnimated)animated; @end
Anddward/NSObject_extend
NSObject+extend/UIViewController+Nav.h
C
mit
5,275
### Install project Клонуємо ``` bash $ git clone https://github.com/mendeleev/require-js-learning.git ``` Встановлюємо необхідні модулі та бібліотеки: ``` bash $ npm install -g bower $ npm install -g requirejs $ cd your_path/require-js-learning $ bower install ``` Запускаємо оптимізатор (певна річ перш ніж його запустити, потрібно зробити всі необхідні налаштування для збірки) ``` bash $ r.js -o your_path/build.js ``` ## Troubleshooting #### При спробі витягнути і прочитати файл з проекту може виникати така помилка: ``` Loading local file via ajax doesn't work in Chrome browser (security restrictions) (tested in Version 49.0.2623.87) Error - "Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource." ``` Тому проект краще запускати використовуючи локальний сервер. Найпростіший і найшвидший спосіб використати модуль [http-server](https://www.npmjs.com/package/http-server), який можна встановити із npm репозиторію. ``` bash $ npm install -g http-server ``` Запускається дуже просто. ``` bash $ cd project_path $ http-server ./ Starting up http-server, serving ./ Available on: http:127.0.0.1:8081 http:10.1.18.139:8081 Hit CTRL-C to stop the server ``` У моєму випадку проект піднявся за адресою http://127.0.0.1:8081 та http://10.1.18.139:8081, у вас скоріш за все буде інша. Відкриваємо проект за цією адресою і проблема зникне. ### Requirements - не використовуємо EcmaScript 6, стараємось щоб проект працював у максимальній кількості браузерів ## "RequireJS & JQuery" home task Домашнє завдання по лекції "RequireJS & JQuery" [Minions Clicker](http://mendeleev.github.io/minions/app/) ### Суть завдання Отже в нас є прототип веб-додатку, який демонструє як саме це повинно працювати. Тепер з цього потрібно зробити більш робочий і динамічний проект. Перш за все це підвантаження даних. На реальному проекті, дані постійно змінюються і нам потрібно підготуватись до того, щоб інформація яку ми відображаємо була актуальною. Припустимо, що дані нам повинен віддавати якийсь **backend**, розробкою якого займається програміст John. Але ми не можемо і не повинні чекати поки John розбереться зі своєю частиною роботи, тому розробку клієнтської частини ми виконуємо незалежно. ### Формат даних Початковий формат даних які ми очікуємо, відомий, а тому ми можемо створити звичайний .json файл, і заповнити його будь-якими тестовими даними, який буде лежати прямо в проекті. ```json [ { "id":1, "title": "Cake", "image": "Minion-Cake-icon.png", "count": 0 }, { "id":2, "title": "Curious", "image": "Minion-Curious-icon.png", "count": 0 } ] ``` ### Завантаження даних На щастя, JQuery однаково добре вміє витягувати дані, і з бекенду, і з файлу. Тому, нам цілком достатньо буде функції $.ajax(), почитати про яку можна [тут](http://devdocs.io/jquery/jquery.ajax). Також не варто забувати, що в секції **Ajax** є й [інші корисні штуки](http://devdocs.io/jquery-ajax/), які можливо підійдуть краще. ``` javascript $.ajax({ url: "files/data.json", dataType: "json", success: function(data) { //do smth }, error: function(error) { //houston we have a problem } }); ``` Також нагадаю, що ця штука повертає [проміс](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise) і замість **success/error** можна використовувати .**then()** чи **.done()** ```javascript function getData() { return $.ajax({ url: "files/data.json", dataType: "json" }); } getData().done(function(data) { //do smth }, function(error) { //do smth if error }); ``` ### Візуалізація Приступаємо до мабуть найцікавішої частини, а саме, відмальовки отриманих даних. Тут нам знадобляться такі розділи як: - [Селектори (selectors)](http://devdocs.io/jquery-selectors/) - [Бродяги (traversing)](http://devdocs.io/jquery-traversing/) - [Маніпуляції (manipulations)](http://devdocs.io/jquery-manipulation/) - [Події (events)](http://devdocs.io/jquery-events/) За допомогою JQuery можна не лише тягнути елементи зі сторінки, але можна також створювати нові. Наприклад: ``` javascript var $headline = $("<h1>Hello, World!</h1>") $("body").append($headline) ``` ### Шаблон На даному етапі в нас є верстка галереї, в якій знаходиться шаблон для одного елементу: ``` html <li class="item"> <img src="images/Minion-Curious-icon.png" alt="Curious" /> <span class="counter">0</span> </li> ``` Всі елементи складаються в контейнер: ``` html <ul class="gallery"></ul> ``` ### Модулі Для того, щоб нам було зручно підтримувати і тестувати написаний код, розкладаємо все на модулі за допомогою бібліотеки [RequireJS](http://requirejs.org/docs/start.html). ### Build Отже, все готово, залишається тільки оптимізувати написані модулі, щоб весь код був мініфікований і можна було його використовувати в production версії. Детальніше можна почитати про це [тут](http://requirejs.org/docs/optimization.html). Також для прикладу я накидав певну структуру і налаштував збірку. Щоб подивитись як це виглядає потрібно переключитись на гілку **build**. Але для кращого засвоєння і щоб розібратись як працює цей механізм, дуже добре буде почати все з нуля, а сюди інколи підглядати якщо будуть виникати якісь нерозуміння. ``` bash $ git checkout build ``` ### Збереження даних Ми створили функціонал, перевірили, зібрали, оновили сторінку і тут халепа, лічильники позбивались на нуль. Тому потрібно результати кліків десь зберігати, наприклад в [localStorage](https://developer.mozilla.org/en/docs/Web/API/Window/localStorage). ### Matherials Про всяк випадок залишу тут всі матеріали, які були задіяні під час лекції: - [Презентація](https://docs.google.com/presentation/d/1RXJ0Wiis0HR4qm1xBrqTODOB3EBcJ79WtZ92Xue0gsQ/edit?usp=sharing) - Приклади: - [багаторівневий список](https://jsfiddle.net/mendart/xj9cewux/4/) - [вимикач](https://jsfiddle.net/mendart/44enr2er/) - [фільтр](https://jsfiddle.net/mendart/0sLjg9jL/) - Документація: - [офіційний сайт JQuery](https://jquery.com/) - [офіційний сайт RequireJS](http://requirejs.org/) - [збірка документацій | Devdocs](https://devdocs.io/) - Література/Курси: - [книга «JQuery для початківців»](http://anton.shevchuk.name/jquery-book/), - [онлайн курс RequireJS](https://www.pluralsight.com/courses/requirejs-javascript-dependency-injection)
mendeleev/require-js-learning
README.md
Markdown
mit
8,999
<?php namespace MCPI; /** * Abstract Controller */ class Core_Controller_Abstract extends Core_Abstract { }
chrisputnam9/money
app/code/core/controller/abstract.php
PHP
mit
112
--- layout: default title: Zhiyu Jiang --- <center> <h3><font color="#000080"> Zhiyu Jiang 姜志宇<a href="http://en.wikipedia.org/wiki/Chinese_character"><i class="icon-question-sign"></i></a></font> </h3> <P> School of Artificial <b>I</b>ntelligence, <b>OP</b>tics and <b>E</b>lectro<b>N</b>ics (iOPEN) <br/> Northwestern Polytechnical University <br/> </P> </center> <!-- Do I want to show a pic on the phone screen? <div class="text-center visible-phone"> <img src="assets/img/zhiyu.png" alt="photo" width="100px"/> </div> --> <a class="visible-phone pull-left" href="#"> <img class="media-object" src="assets/img/zhiyu.png" width="80px" height = "100px" style="margin: 0px 10px" /> </a> <p> You can contact me by zhiyu.jiang.chn at gmail dot com. <a href="/pages/love.html" target="_blank"> </a> </p> <h3><font color="red"> News:</font> </h3> <p> <ul> <li> 06/2018, Scene Content Parsing for Visual Image Data, doctoral dissertation. <a href="http://ir.opt.ac.cn/handle/181661/30121" target="_blank">[Web]</a> </ul> </p> <!-- *** Work *** --> <h3> <a name='work'></a> Work Experience </h3> <p> <ul> <li> 08/2020-now, Associate Professor, Northwestern Polytechnical University, China. <li> 09/2018-08/2020, Postdoctral Research Fellow, Northwestern Polytechnical University, China. </ul> </p> <!-- *** Education *** --> <h3> <a name='education'></a> Education Background </h3> <p> <ul> <li> 09/2013-07/2018, Ph.D., Signal and Information Processing, <a href="http://english.ucas.ac.cn" target="_blank">University of Chinese Academy of Sciences</a>, under the supervision of Prof. Yuan Yuan, Prof. <a href="http://crabwq.github.io/" target="_blank">Qi Wang</a>, and Prof. Xuelong Li. <li> 09/2009-07/2013, B.E., Electronic Engineering, <a href="http://en.xidian.edu.cn/" target="_blank">Xidian University</a>. </ul> </p> <!-- *** Research *** --> <h3> <a name='research'></a> Research </h3> <p> My current research topics include: <ul> <li> Artificial intelligence, machine learning and computer vision. <li> Machine Learning, focusing on small-sample learning, few-shot learning, and open-set recognition.. <li> Computer Vision, focusing on Intelligent Traffic and Remote Sensing, including target detection, change detection, semantic parsing. </ul> </p> <!-- *** Publications *** --> <h3> <a name='publications'></a> Recent Publications </h3> <p> Links to: <a href="publications.html" target="_blank">[Full List]</a> <a href="demo.html" target="_blank">[Online Demo]</a> <a href="http://dblp.uni-trier.de/pers/hd/j/Jiang:Zhiyu" target="_blank">[dblb]</a> <!--<a href="projects.html"> [Unpublished Projects]</a>--> </p> {% include pub_highlight.html %} <!-- *** Professional Activities *** --> <h3> <a name='activities'></a> Professional Activities </h3> <p> <b>Reports</b> <ul> <li> HDPA: Hierarchical Deep Probability Analysis for Scene Parsing, IEEE International Conference on Multimedia and Expo, Hong Kong, Aug. 2017. <li> Adaptive Road Detection towards Multiscale-Multilevel Probabilistic Analysis, IEEE China Summit and International Conference on Signal and Information Processing, Xi'an, Jul. 2014. </ul> </p> <p> <b>Editorial board</b> <ul> <li> Guest Editor, Remote Sensing, MDPI. <li> Track Chair, International Conference on Information, Communication and Networks. </ul> </p> <p> <b>Reviewer</b> <ul> <li> Transactions and Journals <ul> <li> PeerJ Computer Science (PeerJ), (2021-now) <li> Drones (MDPI), (2020-now) <li> IEEE Transactions on Industrial Electronics (IEEE, T-IE), (2018-now) <li> IEEE Transactions on Intelligent Transportation Systems (IEEE, T-ITS), (2016-now) <li> IEEE Transactions on Cybernetics (IEEE, T-CYB), (2016-now) <li> Pattern Recognition (Elsevier, PR), (2016-now) <li> Computer Vision and Image Understanding (Elsevier, CVIU), (2016-now) <li> Scientia Sinica Informationis, (2016-now) <li> Neurocomputing (Elsevier), (2015-now) </ul> <li> International Conferences <ul> Served as TPC members of 50+ International Conferences, including ACM ICMR 2019, ICASSP2017, CCPR2016. </ul> </ul> </p> <!-- *** Honors and Awards *** --> <h3> <a name='awards'></a>Honors and Awards </h3> <p> <ul> <li> Outstanding reviewer, Pattern Recognition/Neurocomputing/CVIU, 2018. <li> IEEE ChinaSIP Best Paper Award, IEEE Signal Processing Society, 2014. </ul> </p>
zhiyu-jiang/zhiyu-jiang.github.io
index.html
HTML
mit
4,479
import click from cloudcompose.ecs.controller import Controller from cloudcompose.config import CloudConfig from cloudcompose.exceptions import CloudComposeException @click.group() def cli(): pass @cli.command() @click.option('--upgrade-image/--no-upgrade-image', default=False, help="Upgrade the image to the newest version instead of keeping the cluster consistent") def up(upgrade_image): """ updates cluster configuration """ try: cloud_config = CloudConfig(upgrade_image=upgrade_image) controller = Controller(cloud_config) controller.cluster_up() except CloudComposeException as ex: print((ex.message)) @cli.command() @click.option('--force/--no-force', default=False, help="Force the cluster to go down even if terminate protection is enabled") def down(force): """ destroy ECS cluster """ try: cloud_config = CloudConfig() controller = Controller(cloud_config) controller.cluster_down(force) except CloudComposeException as ex: print((ex.message)) @cli.command() @click.option('--verbose/--no-verbose', default=False, help="Output detailed health check information") def health(verbose): """ check ECS cluster health """ try: cloud_config = CloudConfig() controller = Controller(cloud_config) name = cloud_config.config_data('cluster')['name'] healthy = controller.cluster_health(verbose) if healthy: print(("{} is healthy".format(name))) else: print(("{} is unhealthy".format(name))) except CloudComposeException as ex: print((ex.message)) @cli.command() @click.option('--single-step/--no-single-step', default=False, help="Perform only one upgrade step and then exit") @click.option('--upgrade-image/--no-upgrade-image', default=True, help="Upgrade the image to the newest version instead of keeping the cluster consistent") def upgrade(single_step, upgrade_image): """ upgrade the ECS cluster """ try: cloud_config = CloudConfig() controller = Controller(cloud_config, upgrade_image=upgrade_image) controller.upgrade(single_step) except CloudComposeException as ex: print((ex.message)) @cli.command() def cleanup(): """ deletes launch configs and auto scaling group """ try: cloud_config = CloudConfig() controller = Controller(cloud_config) controller.cleanup() except CloudComposeException as ex: print((ex.message))
cloud-compose/cloud-compose-ecs
cloudcompose/ecs/commands/cli.py
Python
mit
2,554
package com.smartbit8.laravelstorm.run; import com.intellij.execution.configurations.ConfigurationFactory; import com.intellij.execution.configurations.ConfigurationType; import com.intellij.execution.configurations.RunConfiguration; import com.intellij.openapi.project.Project; import com.smartbit8.laravelstorm.Icons; import org.jetbrains.annotations.NotNull; import javax.swing.*; public class LaravelRunType implements ConfigurationType { @Override public String getDisplayName() { return "Laravel"; } @Override public String getConfigurationTypeDescription() { return "Artisan server runner"; } @Override public Icon getIcon() { return Icons.LARAVEL; } @NotNull @Override public String getId() { return "LaravelStorm_run_conf_serve"; } @Override public ConfigurationFactory[] getConfigurationFactories() { return new ConfigurationFactory[]{new ConfigurationFactory(this) { @NotNull @Override public RunConfiguration createTemplateConfiguration(@NotNull Project project) { return new LaravelRunConf(project, this, "Laravel"); } }}; } }
3mmarg97/LaravelStorm
src/com/smartbit8/laravelstorm/run/LaravelRunType.java
Java
mit
1,224
<?php namespace Fisharebest\Localization\Locale; /** * Class LocaleTeIn * * @author Greg Roach <[email protected]> * @copyright (c) 2015 Greg Roach * @license GPLv3+ */ class LocaleTeIn extends LocaleTe { }
fweber1/Annies-Ancestors
webtrees/vendor/fisharebest/localization/src/Locale/LocaleTeIn.php
PHP
mit
231
/** * @file sw-precache一些设置项,staticFileGlobs主要是设置具体需要缓存的文件 * 在webpack.prod.conf.js 中被使用 * 参考链接 * https://github.com/goldhand/sw-precache-webpack-plugin * https://github.com/GoogleChromeLabs/sw-precache */ var reposConfig = require('./repos.config'); const host = `^https:\\/\\/api\\.github\\.com\\/repos\\/${reposConfig.owner}\\/${reposConfig.repo}\\/content\\/`; console.log(host); module.exports = { /** * build时的配置文件 * @type {Object} */ build: { cacheId: 'sw-cache-app', filename: 'service-worker.js', /** * 需缓存的文件配置 * 需动态缓存的放到runtimeCaching中处理 * * @type {Array} */ staticFileGlob: ['dist/**/*.{js,html,css}'], minify: false, /** * 需要省略掉的前缀名 * * @type {string} */ stripPrefix: 'dist/', /** * [mergeStaticsConfig description] * * @type {boolean} */ mergeStaticsConfig: true, /** * 过滤不需要缓存的内容 * * map文件不需要缓存 */ staticFileGlobsIgnorePatterns: [ /\.map$/ ], /** * 当请求路径不在缓存里的返回,对于单页应用来说,入口点是一样的 * * @type {string} */ navigateFallback: '/index.html', /** * 使用navigateFallback的白名单 * 默认为[],即任意路径的访问都会访问navigateFallback设置的内容。 * 如果为 /test/ ,则只有当访问路径为 https://example.com/test/ 才能访问。 * 可参考: * https://github.com/GoogleChromeLabs/sw-precache#navigatefallbackwhitelist-arrayregexp * @type {Array} */ navigateFallbackWhitelist: [], /** * 自定义service-worker.js文件的模板,不配置时采用默认的配置 * 可参考: * https://github.com/GoogleChromeLabs/sw-precache/blob/master/service-worker.tmpl * @type {String} */ templateFilePath: 'config/sw.tmpl.js', /** * 是否 verbose * * 参考: * https://github.com/GoogleChromeLabs/sw-precache#verbose-boolean * @type {boolean} */ verbose: true, /** * 需要根据路由动态处理的文件 * * @type {Array} */ runtimeCaching: [ { urlPattern: new RegExp(`${host}all`), handler: 'networkFirst', options: { cache: { name: 'blog-list' } } }, { urlPattern: new RegExp(`${host}classify\\/\w*`), handler: 'networkFirst', options: { cache: { name: 'classify-blog-list' } } }, { urlPattern: new RegExp(`${host}all\\/\w*\\.md$`), handler: 'networkFirst', options: { cache: { name: 'some-blogs' } } } ] } }
targeral/vug
config/sw-precache.js
JavaScript
mit
3,446
#!/usr/bin/env python from distutils.core import setup setup(name='dyneav', version='1.0', description='A little EAV package that lets you create dynamic classes using EAV to store attributes.', author='Jason Goodell', author_email='[email protected]', packages=['dyneav'], )
jgoodell/dyneav
setup.py
Python
mit
317
<?php namespace Huntie\JsonApi\Serializers; use JsonSerializable; use Request; abstract class JsonApiSerializer implements JsonSerializable { /** * The JSON API version being implemented. * * @var string */ const JSON_API_VERSION = '1.0'; /** * The base URL for links. * * @var string */ protected $baseUrl; /** * Meta information to include. * * @var array */ protected $meta = []; /** * Resource links to include, relative to the base URL. * * @var array */ protected $links = []; /** * Create a new JSON API document serializer. */ public function __construct() { $this->baseUrl = Request::url(); $this->addLinks('self', urldecode(str_replace(Request::url(), '', Request::fullUrl()))); } /** * Return primary data for the JSON API document. * * @return mixed */ abstract protected function getPrimaryData(); /** * Return any links related to the primary data. */ public function getLinks(): array { return array_map(function ($path) { return $this->baseUrl . $path; }, $this->links); } /** * Return any secondary included resource objects. * * @return \Illuminate\Support\Collection */ public function getIncluded() { return collect(); } /** * Set the base URL for document links. * * @param string $url */ public function setBaseUrl(string $url) { $this->baseUrl = preg_replace('/\/$/', '', $url); } /** * Add included meta information. * * @param string|array $key * @param string|int|null $value */ public function addMeta($key, $value = null) { $this->meta = array_merge($this->meta, is_array($key) ? $key : [$key => $value]); } /** * Add one or more included links. * * @param string|array $key * @param string|int|null $value */ public function addLinks($key, $value = null) { $this->links = array_merge($this->links, is_array($key) ? $key : [$key => $value]); } /** * Serialise JSON API document to an array. */ public function serializeToObject(): array { return array_merge( ['data' => $this->getPrimaryData()], array_filter([ 'included' => $this->getIncluded()->values()->toArray(), 'links' => $this->getLinks(), 'meta' => $this->meta, 'jsonapi' => $this->getDocumentMeta(), ]) ); } /** * Convert the object into something JSON serializable. */ public function jsonSerialize(): array { return $this->serializeToObject(); } /** * Serialise JSON API document to a JSON string. */ public function serializeToJson(): string { return json_encode($this->jsonSerialize()); } /** * Reduce a collection of records to unique entries, by comparing their * resource identifier values. * * @param \Illuminate\Support\Collection $records * * @return \Illuminate\Support\Collection */ protected function filterUnique($records) { return $records->unique(function ($record) { return implode(array_only($record, ['type', 'id'])); }); } /** * Return JSON API implementation information. */ private function getDocumentMeta(): array { return array_filter([ 'version' => config('jsonapi.include_version') ? self::JSON_API_VERSION : null, ]); } }
huntie/laravel-simple-jsonapi
src/Serializers/JsonApiSerializer.php
PHP
mit
3,727
<?php /* TwigBundle:Exception:traces_text.html.twig */ class __TwigTemplate_af4ee8219d8e7d6736f3288f55594318cc572333fbc1dc41d7df5579ecef3074 extends Twig_Template { public function __construct(Twig_Environment $env) { parent::__construct($env); $this->parent = false; $this->blocks = array( ); } protected function doDisplay(array $context, array $blocks = array()) { // line 1 echo "<div class=\"block\"> <h2> Stack Trace (Plain Text)&nbsp; "; // line 4 ob_start(); // line 5 echo " <a href=\"#\" onclick=\"toggle('traces-text'); switchIcons('icon-traces-text-open', 'icon-traces-text-close'); return false;\"> <img class=\"toggle\" id=\"icon-traces-text-close\" alt=\"-\" src=\"data:image/gif;base64,R0lGODlhEgASAMQSANft94TG57Hb8GS44ez1+mC24IvK6ePx+Wa44dXs92+942e54o3L6W2844/M6dnu+P/+/l614P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAAASABIAQAVCoCQBTBOd6Kk4gJhGBCTPxysJb44K0qD/ER/wlxjmisZkMqBEBW5NHrMZmVKvv9hMVsO+hE0EoNAstEYGxG9heIhCADs=\" style=\"display: none\" /> <img class=\"toggle\" id=\"icon-traces-text-open\" alt=\"+\" src=\"data:image/gif;base64,R0lGODlhEgASAMQTANft99/v+Ga44bHb8ITG52S44dXs9+z1+uPx+YvK6WC24G+944/M6W28443L6dnu+Ge54v/+/l614P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABMALAAAAAASABIAQAVS4DQBTiOd6LkwgJgeUSzHSDoNaZ4PU6FLgYBA5/vFID/DbylRGiNIZu74I0h1hNsVxbNuUV4d9SsZM2EzWe1qThVzwWFOAFCQFa1RQq6DJB4iIQA7\" style=\"display: inline\" /> </a> "; echo trim(preg_replace('/>\s+</', '><', ob_get_clean())); // line 10 echo " </h2> <div id=\"traces-text\" class=\"trace\" style=\"display: none;\"> <pre>"; // line 13 $context['_parent'] = (array) $context; $context['_seq'] = twig_ensure_traversable($this->getAttribute((isset($context["exception"]) ? $context["exception"] : $this->getContext($context, "exception")), "toarray")); foreach ($context['_seq'] as $context["i"] => $context["e"]) { // line 14 echo "["; echo twig_escape_filter($this->env, ((isset($context["i"]) ? $context["i"] : $this->getContext($context, "i")) + 1), "html", null, true); echo "] "; echo twig_escape_filter($this->env, $this->getAttribute((isset($context["e"]) ? $context["e"] : $this->getContext($context, "e")), "class"), "html", null, true); echo ": "; echo twig_escape_filter($this->env, $this->getAttribute((isset($context["e"]) ? $context["e"] : $this->getContext($context, "e")), "message"), "html", null, true); echo " "; // line 15 $this->env->loadTemplate("TwigBundle:Exception:traces.txt.twig")->display(array("exception" => (isset($context["e"]) ? $context["e"] : $this->getContext($context, "e")))); } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['i'], $context['e'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 16 echo "</pre> </div> </div> "; } public function getTemplateName() { return "TwigBundle:Exception:traces_text.html.twig"; } public function isTraitable() { return false; } public function getDebugInfo() { return array ( 42 => 14, 38 => 13, 35 => 4, 26 => 5, 87 => 20, 80 => 19, 55 => 13, 46 => 7, 44 => 10, 36 => 7, 31 => 5, 25 => 4, 21 => 2, 94 => 22, 92 => 21, 89 => 20, 85 => 19, 79 => 18, 75 => 17, 72 => 16, 68 => 14, 64 => 12, 56 => 9, 50 => 8, 41 => 9, 27 => 4, 24 => 4, 22 => 2, 201 => 92, 199 => 91, 196 => 90, 187 => 84, 183 => 82, 173 => 74, 171 => 73, 168 => 72, 166 => 71, 163 => 70, 158 => 67, 156 => 66, 151 => 63, 142 => 59, 138 => 57, 136 => 56, 133 => 55, 123 => 47, 121 => 46, 117 => 44, 115 => 43, 112 => 42, 105 => 40, 101 => 24, 91 => 31, 86 => 28, 69 => 25, 66 => 15, 62 => 23, 51 => 15, 49 => 19, 39 => 6, 32 => 12, 19 => 1, 57 => 16, 54 => 21, 43 => 8, 40 => 7, 33 => 10, 30 => 3,); } }
lukniewiara/RugbyFanPage
app/cache/dev/twig/af/4e/e8219d8e7d6736f3288f55594318cc572333fbc1dc41d7df5579ecef3074.php
PHP
mit
4,232
<?php return [ /* |-------------------------------------------------------------------------- | Application Name |-------------------------------------------------------------------------- | | This value is the name of your application. This value is used when the | framework needs to place the application's name in a notification or | any other location as required by the application or its packages. */ 'name' => 'Laravel', /* |-------------------------------------------------------------------------- | Application Environment |-------------------------------------------------------------------------- | | This value determines the "environment" your application is currently | running in. This may determine how you prefer to configure various | services your application utilizes. Set this in your ".env" file. | */ 'env' => env('APP_ENV', 'production'), /* |-------------------------------------------------------------------------- | Application Debug Mode |-------------------------------------------------------------------------- | | When your application is in debug mode, detailed error messages with | stack traces will be shown on every error that occurs within your | application. If disabled, a simple generic error page is shown. | */ 'debug' => env('APP_DEBUG', false), /* |-------------------------------------------------------------------------- | Application URL |-------------------------------------------------------------------------- | | This URL is used by the console to properly generate URLs when using | the Artisan command line tool. You should set this to the root of | your application so that it is used when running Artisan tasks. | */ 'url' => env('APP_URL', 'http://localhost'), /* |-------------------------------------------------------------------------- | Application Timezone |-------------------------------------------------------------------------- | | Here you may specify the default timezone for your application, which | will be used by the PHP date and date-time functions. We have gone | ahead and set this to a sensible default for you out of the box. | */ 'timezone' => 'UTC', /* |-------------------------------------------------------------------------- | Application Locale Configuration |-------------------------------------------------------------------------- | | The application locale determines the default locale that will be used | by the translation service provider. You are free to set this value | to any of the locales which will be supported by the application. | */ 'locale' => 'en', /* |-------------------------------------------------------------------------- | Application Fallback Locale |-------------------------------------------------------------------------- | | The fallback locale determines the locale to use when the current one | is not available. You may change the value to correspond to any of | the language folders that are provided through your application. | */ 'fallback_locale' => 'en', /* |-------------------------------------------------------------------------- | Encryption Key |-------------------------------------------------------------------------- | | This key is used by the Illuminate encrypter service and should be set | to a random, 32 character string, otherwise these encrypted strings | will not be safe. Please do this before deploying an application! | */ 'key' => env('APP_KEY'), 'cipher' => 'AES-256-CBC', /* |-------------------------------------------------------------------------- | Logging Configuration |-------------------------------------------------------------------------- | | Here you may configure the log settings for your application. Out of | the box, Laravel uses the Monolog PHP logging library. This gives | you a variety of powerful log handlers / formatters to utilize. | | Available Settings: "single", "daily", "syslog", "errorlog" | */ 'log' => env('APP_LOG', 'single'), 'log_level' => env('APP_LOG_LEVEL', 'debug'), /* |-------------------------------------------------------------------------- | Autoloaded Service Providers |-------------------------------------------------------------------------- | | The service providers listed here will be automatically loaded on the | request to your application. Feel free to add your own services to | this array to grant expanded functionality to your applications. | */ 'providers' => [ /* * Laravel Framework Service Providers... */ Illuminate\Auth\AuthServiceProvider::class, Illuminate\Broadcasting\BroadcastServiceProvider::class, Illuminate\Bus\BusServiceProvider::class, Illuminate\Cache\CacheServiceProvider::class, Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, Illuminate\Cookie\CookieServiceProvider::class, Illuminate\Database\DatabaseServiceProvider::class, Illuminate\Encryption\EncryptionServiceProvider::class, Illuminate\Filesystem\FilesystemServiceProvider::class, Illuminate\Foundation\Providers\FoundationServiceProvider::class, Illuminate\Hashing\HashServiceProvider::class, Illuminate\Mail\MailServiceProvider::class, Illuminate\Notifications\NotificationServiceProvider::class, Illuminate\Pagination\PaginationServiceProvider::class, Illuminate\Pipeline\PipelineServiceProvider::class, Illuminate\Queue\QueueServiceProvider::class, Illuminate\Redis\RedisServiceProvider::class, Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, Illuminate\Session\SessionServiceProvider::class, Illuminate\Translation\TranslationServiceProvider::class, Illuminate\Validation\ValidationServiceProvider::class, Illuminate\View\ViewServiceProvider::class, //Login Social (SSO) Laravel\Socialite\SocialiteServiceProvider::class, /* * Package Service Providers... */ // /* * Application Service Providers... */ SeCoT\Providers\AppServiceProvider::class, SeCoT\Providers\AuthServiceProvider::class, // SeCoT\Providers\BroadcastServiceProvider::class, SeCoT\Providers\EventServiceProvider::class, SeCoT\Providers\RouteServiceProvider::class, ], /* |-------------------------------------------------------------------------- | Class Aliases |-------------------------------------------------------------------------- | | This array of class aliases will be registered when this application | is started. However, feel free to register as many as you wish as | the aliases are "lazy" loaded so they don't hinder performance. | */ 'aliases' => [ 'App' => Illuminate\Support\Facades\App::class, 'Artisan' => Illuminate\Support\Facades\Artisan::class, 'Auth' => Illuminate\Support\Facades\Auth::class, 'Blade' => Illuminate\Support\Facades\Blade::class, 'Bus' => Illuminate\Support\Facades\Bus::class, 'Cache' => Illuminate\Support\Facades\Cache::class, 'Config' => Illuminate\Support\Facades\Config::class, 'Cookie' => Illuminate\Support\Facades\Cookie::class, 'Crypt' => Illuminate\Support\Facades\Crypt::class, 'DB' => Illuminate\Support\Facades\DB::class, 'Eloquent' => Illuminate\Database\Eloquent\Model::class, 'Event' => Illuminate\Support\Facades\Event::class, 'File' => Illuminate\Support\Facades\File::class, 'Gate' => Illuminate\Support\Facades\Gate::class, 'Hash' => Illuminate\Support\Facades\Hash::class, 'Lang' => Illuminate\Support\Facades\Lang::class, 'Log' => Illuminate\Support\Facades\Log::class, 'Mail' => Illuminate\Support\Facades\Mail::class, 'Notification' => Illuminate\Support\Facades\Notification::class, 'Password' => Illuminate\Support\Facades\Password::class, 'Queue' => Illuminate\Support\Facades\Queue::class, 'Redirect' => Illuminate\Support\Facades\Redirect::class, 'Redis' => Illuminate\Support\Facades\Redis::class, 'Request' => Illuminate\Support\Facades\Request::class, 'Response' => Illuminate\Support\Facades\Response::class, 'Route' => Illuminate\Support\Facades\Route::class, 'Schema' => Illuminate\Support\Facades\Schema::class, 'Session' => Illuminate\Support\Facades\Session::class, 'Storage' => Illuminate\Support\Facades\Storage::class, 'URL' => Illuminate\Support\Facades\URL::class, 'Validator' => Illuminate\Support\Facades\Validator::class, 'View' => Illuminate\Support\Facades\View::class, //Login Social (SSO) 'Socialite' => Laravel\Socialite\Facades\Socialite::class, ], ];
lubuzzo/palestras-php
config/app.php
PHP
mit
9,287
#pragma once #include <stdint.h> #include "driver.hpp" namespace driver { class Timer : public Driver { public: Timer(); void install() override; void reset(); uint32_t count(); }; }
MasterQ32/DasOS
prototypes/include/driver/timer.hpp
C++
mit
208
<?php namespace AppBundle\Controller; use AppBundle\Entity\Document; use AppBundle\Entity\Letter; use AppBundle\Form\LetterType; use AppBundle\Form\DocumentType; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; class DefaultController extends Controller { /** * @Route("/", name="homepage") */ public function indexAction(Request $request) { return $this->render('AppBundle:default:index.html.twig', array()); } /** * @Route("/letter/{id}/docs/upload", name="document_upload") * @param Request $request * @return \Symfony\Component\HttpFoundation\Response */ public function documentUploadAction(Request $request, $id) { // get the Letter in question $repo = $this->getDoctrine()->getRepository('AppBundle:Letter'); $qb = $repo->createQueryBuilder('l') ->where('l.id = :id') ->setParameter('id', $id); $letter = $qb->getQuery()->getOneOrNullResult(); if ($letter == null) { throw $this->createNotFoundException('Letter #'.$id.' does not exist.'); } // let's validate the document form $document = new Document(); $form = $this->createForm(DocumentType::class, $document); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { $document = $form->getData(); $document->setLetter($letter); $file = $document->getFile(); $filesystem = $this->container->get('knp_gaufrette.filesystem_map')->get('letters'); $adapter = $filesystem->getAdapter(); $adapter->setMetadata($id.'/'.$document->getName(), array('contentType' => $file->getClientMimeType())); $adapter->write($id.'/'.$document->getName(), file_get_contents($file->getPathname())); $em = $this->getDoctrine()->getManager(); $em->persist($document); $em->flush(); return $this->redirectToRoute('letter_view', ['id' => $letter->getId()]); } throw $this->createAccessDeniedException(); } /** * @Route("/letter/{id}/doc/{file}", name="document_read") * @param Request $request * @return \Symfony\Component\HttpFoundation\Response */ public function documentReadAction(Request $request, $id, $file) { $key = $id.'/'.$file; $s3bucket = $this->container->getParameter('aws_s3_bucket'); $s3client = $this->container->get('acme.aws_s3.client'); $request = $s3client->get($s3bucket.'/'.$key); $url = $s3client->createPresignedUrl($request, '+1 hour'); return new RedirectResponse($url, 302); } /** * @Route("/letter/{id}/docs/delete/{docid}", name="document_delete") * @param Request $request * @return \Symfony\Component\HttpFoundation\Response */ public function documentDeleteAction(Request $request, $id, $docid) { // TODO everything about this function is terrible and i hate it // get the Document in question $repo = $this->getDoctrine()->getRepository('AppBundle:Document'); $qb = $repo->createQueryBuilder('d') ->where('d.id = :id') ->setParameter('id', $docid); $document = $qb->getQuery()->getOneOrNullResult(); if ($document == null) { throw $this->createNotFoundException('Document #'.$docid.' does not exist.'); } if ($document->getLetter()->getId() != $id) { throw $this->createNotFoundException('Document #'.$docid.' not associated with Letter #'.$id.'.'); } $form = $this->createDocumentDeleteForm($document); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { $filesystem = $this->container->get('knp_gaufrette.filesystem_map')->get('letters'); $adapter = $filesystem->getAdapter(); $adapter->delete($id.'/'.$document->getName()); $em = $this->getDoctrine()->getManager(); $em->remove($document); $em->flush(); return $this->redirectToRoute('letter_view', ['id' => $document->getLetter()->getId()]); } throw $this->createAccessDeniedException(); } private function createDocumentDeleteForm(Document $document) { $form = $this->createFormBuilder($document) ->setAction($this->generateUrl('document_delete', [ 'id' => $document->getLetter()->getId(), 'docid' => $document->getId(), ])) ->getForm(); return $form; } /** * @Route("/letters/new", name="letters_new") * @param Request $request * @return \Symfony\Component\HttpFoundation\Response */ public function lettersNewAction(Request $request) { $letter = new Letter(); $form = $this->createForm(LetterType::class, $letter); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { $letter = $form->getData(); $em = $this->getDoctrine()->getManager(); $em->persist($letter); $em->flush(); return $this->redirectToRoute('letter_view', ['id' => $letter->getId()]); } return $this->render('AppBundle:default:letters_new.html.twig', array( 'letterForm' => $form->createView(), )); } /** * @Route("/letters", name="letters_list") * @param Request $request * @return \Symfony\Component\HttpFoundation\Response */ public function lettersListAction(Request $request) { return $this->render('AppBundle:default:letters_list.html.twig'); } /** * @Route("/letter/{id}", name="letter_view") * @param Request $request * @return \Symfony\Component\HttpFoundation\Response */ public function letterViewAction(Request $request, $id) { $repoLtrs = $this->getDoctrine()->getRepository('AppBundle:Letter'); $qbLtrs = $repoLtrs->createQueryBuilder('l') ->where('l.id = :id') ->setParameter('id', $id); $letter = $qbLtrs->getQuery()->getOneOrNullResult(); if (is_null($letter)) { throw $this->createNotFoundException('The letter does not exist.'); } $repoDocs = $this->getDoctrine()->getRepository('AppBundle:Document'); $qbDocs = $repoDocs->createQueryBuilder('d') ->where('d.letter = :l') ->setParameter('l', $letter); $docs = $qbDocs->getQuery()->getResult(); $document = new Document(); $form = $this->createForm(DocumentType::class, $document); $documentDeleteForms = []; foreach ($docs as $d) { $documentDeleteForms[] = $this->createDocumentDeleteForm($d)->createView(); } return $this->render('AppBundle:default:letter_view.html.twig', [ 'letter' => $letter->jsonSerialize(), 'documents' => $docs, 'documentForm' => $form->createView(), 'docDeleteForms' => $documentDeleteForms, ]); } /** * @Route("/letter/{id}/edit", name="letter_edit") * @param Request $request * @return \Symfony\Component\HttpFoundation\Response */ public function letterEditAction(Request $request, $id) { $letter = $this->getDoctrine()->getRepository('AppBundle:Letter')->find($id); if (is_null($letter)) { throw $this->createNotFoundException('The letter does not exist.'); } $form = $this->createForm(LetterType::class, $letter); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { $letter = $form->getData(); $em = $this->getDoctrine()->getManager(); $em->flush(); return $this->redirectToRoute('letter_view', ['id' => $letter->getId()]); } return $this->render('AppBundle:default:letter_edit.html.twig', array( 'letter' => $letter->jsonSerialize(), 'letterForm' => $form->createView(), )); } /** * @Route("/letters/json", name="letters_json") * @param Request $request * @return \Symfony\Component\HttpFoundation\Response */ public function lettersListJsonAction(Request $request) { // error message to pass to DataTables $error = ''; // start a query builder $repo = $this->getDoctrine()->getRepository('AppBundle:Letter'); $qb = $repo->createQueryBuilder('l'); // implement searches for each column $columns = $request->get('columns', []); if (!is_array($columns)) { return $this->generateDataTablesError("Missing/invalid columns array."); } $dummyLetter = new Letter(); $index = 0; foreach ($columns as $key=>$value) { // check that their array is a consecutively-numbered non-associative array if (intval($key) !== $index++) { return $this->generateDataTablesError("Columns array is not sequentially indexed."); } // if a column is marked unsearchable and unorderable, skip it if ($value['searchable'] == 'false' && $value['orderable'] == 'false') { continue; } // check that they gave us a legitimate column name $colName = $value['data']; if (!array_key_exists($colName, $dummyLetter->jsonSerialize())) { return $this->generateDataTablesError("Invalid column name: $colName."); } // I ain't implementing regex, so make sure they aren't expecting me to if ($value['search']['regex'] != 'false') { return $this->generateDataTablesError("Regex is not supported for column searches."); } // add a WHERE clause for their search query (if they have one) $search = $value['search']['value']; if ($search != null && $search != '') { $qb->andWhere("l.$colName LIKE ?$index"); $qb->setParameter($index, "%$search%"); } } // implement ordering $order = $request->get('order'); $hasResetPreviousOrdering = false; foreach ($order as $o) { $column = $columns[intval($o['column'])]; if ($column['orderable'] == 'false') { return $this->generateDataTablesError("Tried to order an non-orderable column."); } $colName = 'l.'.$column['data']; $dir = $o['dir'] == "asc" ? "ASC" : "DESC"; // we need to use orderBy instead of addOrderBy for the first order clause, to remove default ordering if (!$hasResetPreviousOrdering) { $qb->orderBy($colName, $dir); $hasResetPreviousOrdering = true; } else { $qb->addOrderBy($colName, $dir); } } // TODO: Implement multi-column searching // get the count of rows for this filtered query $qb->select($qb->expr()->count('l.id')); $countFiltered = intval($qb->getQuery()->getSingleScalarResult()); // change the SELECT from "count(id)" back to "*", then add offset and limit (AKA first and max) $qb->select('l'); $qb->setFirstResult(intval($request->get('start'))); $qb->setMaxResults(intval($request->get('length'))); // get the results for this query $letters = $qb->getQuery()->getResult(); // use a new query to get count of all rows (without filtering) $qbAll = $repo->createQueryBuilder('l'); $qbAll->select($qbAll->expr()->count('l.id')); $countAll = intval($qbAll->getQuery()->getSingleScalarResult()); // build the response object $obj = new \stdClass(); $obj->draw = intval($request->get('draw')); $obj->recordsTotal = $countAll; $obj->recordsFiltered = $countFiltered; $obj->data = $letters; if ($error != '') { $obj->error = trim($error, "\r\n"); } return new JsonResponse($obj); } private function generateDataTablesError($message) { $obj = new \stdClass(); $obj->error = $message; return new JsonResponse($obj); } }
oxguy3/jimbox
src/AppBundle/Controller/DefaultController.php
PHP
mit
12,823
--- layout: post title: "windows-python-virtualenv" description: "윈도우에서 쉽게 Python Virtualenv를 만들어보자." date: "2016-12-27 13:25" tag: [windows, python, pip, virtualenv] comments: true share: true --- Python을 개발하다보면, 별도의 개발환경이 필요할 때가 많습니다. 2.x 와 3.x 버전을 오가면서 작업을 하거나, 패키지 버전을 달리해야할 때 등 여러 상황이 있는데 virtualenv라는 패키지가 이때 도움을 줍니다. --- ### 설치 ``` pip install virtaulenv ``` 추가로, 이걸 터미널(윈도우 프롬프트)상에서도 쉽게 작업할 수 있게 도와주는 ``` pip install virtualenvwrapper ``` ``` # 윈도우의 경우엔 pip install virtualenvwrapper-win ``` 이걸 설치해주면 간단하게 가상환경을 제작할 수 있습니다. ### 사용법 ``` mkvirtualenv [환경이름] ``` ![생성화면]({{ site.url }}/assets/posts/2016-12-27-windows-python-virtualenv-59f90.jpg)
recall2300/recall2300.github.io
_posts/2016-12-27-windows-python-virtualenv.md
Markdown
mit
984
# Change Log * **Version 7.0.1**: *(2020/02/04)* - Updated for Xcode 11.3.1, adds in missing convenience methods for notice, alert, and emergency (thanks @hk05) * **Version 7.0.0**: *(2019/03/26)* - Updated for Xcode 10.2/Swift 5.0, adds additional log levels: notice, alert, and emergency * **Version 6.1.0**: *(2018/09/16)* - Fix for Xcode 10.0 warnings/Swift 4.2, other minor tweaks * **Version 6.0.4**: *(2018/06/11)* - Fix for Xcode 9.3 warnings/Swift 4.1 (thanks @ijaureguialzo), and other fixes * **Version 6.0.2**: *(2017/11/30)* - Fix for Xcode warning about deprecated .characters (thanks @WeidongGu) * **Version 6.0.1**: *(2017/09/30)* - Set the SWIFT_VERSION value in the Podspec (via `pod_target_xcconfig`) * **Version 6.0.0**: *(2017/09/28)* - Updated for Xcode 9 and Swift 4.0 * **Version 5.0.5**: *(2017/09/28)* - Fixed a warning in Xcode 9 when still using Swift 3 * **Version 5.0.4**: *(2017/09/27)* - Fixed some issues in the AutoRotatingFileDestination class, added fileAttribute options, other fixes * **Version 5.0.1**: *(2017/04/06)* - Updated for Xcode 8.3/Swift 3.1. Added a new fancy AutoRotatingFileDestination, that will automatically archive your log files based on size, and/or time interval. Check out the macOS demo app for a usage example. All new tags on the branches for versioning to be compatible with the Swift Package Manager. If you're referencing tags such as `Version_4.0.0`, please convert to the new equivalent tag `4.0.0`. * **Version 5.0.0**: *(2017/04/01)* - Invalid version, due to a merged PR that included stray tags. * **Version 4.1.0**: *(2017/04/01)* - Invalid version, due to a merged PR that included stray tags. * **Version 4.0.0**: *(2016/09/20)* - First full release for Swift 3.0. Squeezed in a couple of feature requests: ability to change log level labels, and a formatter to add a prefix and/or postfix to messages. * **Version 4.0.0-beta.5**: *(2016/09/19)* - Tweaked userInfo handling for Tags/Devs, introduced subspecs for CocoaPods, made the userInfo helpers optional (consider them experimental and subject to change even after 4.0.0 is actually moved out of beta status). * **Version 4.0.0-beta.4**: *(2016/09/14)* - Removed escaping from closures, fixed issue using String/StaticString for function/file names. * **Version 3.6.0**: *(2016/09/14)* - Updated for Swift 2.3. * **Version 3.5.3**: *(2016/09/14)* - Fixed podspec. * **Version 3.5.2**: *(2016/09/13)* - Backported Objective-C exception handling, removed escaping from closures, fixed issue using String/StaticString for function/file names. * **Version 4.0.0-beta.3**: *(2016/09/11)* - Fixed issue with CocoaPods using multiple `XCGLogger.h` files, added Objective-C exception handling to fix #123 * **Version 4.0.0-beta.2**: *(2016/09/04)* - Updated docs, added filtering by tag and developer, added demo for filters * **Version 4.0.0-beta.1**: *(2016/09/01)* - First beta for Swift 3 compatibility, including a lot of architecture changes * **Version 3.5.1**: *(2016/08/28)* - Added documentation, improved tests. * **Version 3.5**: *(2016/08/23)* - Added the ability to log anything, no longer limited to strings, or required to use string interpolation. Thanks to @Zyphrax #130 and @mishimay #140. Can also now call a logging method with no parameters, such as `log.debug()`. This will log the result of customizable `testNoMessageClosure` property. By default that's just an empty string, but should allow for some interesting features, (like an automatic counter). * **Version 3.4**: *(2016/08/21)* - Finally added an option to append to an existing log file, and added a basic log rotation method. Other bug fixes. * **Version 3.3**: *(2016/03/27)* - Updated for Xcode 7.3 (Swift 2.2). If you're still using 7.2 (Swift 2.1), you must use XCGLogger 3.2. * **Version 3.2**: *(2016/01/04)* - Added option to omit the default destination (for advanced usage), added background logging option * **Version 3.1.1**: *(2015/11/18)* - Minor clean up, fixes an app submission issue for tvOS * **Version 3.1**: *(2015/10/23)* - Initial support for tvOS * **Version 3.1b1**: *(2015/09/09)* - Initial support for tvOS * **Version 3.0**: *(2015/09/09)* - Bug fix, and WatchOS 2 support (thanks @ymyzk) * **Version 2.4**: *(2015/09/09)* - Minor bug fix, likely the last release for Swift 1.x * **Version 3.0b3**: *(2015/08/24)* - Added option to include the log identifier in log messages #79 * **Version 2.3**: *(2015/08/24)* - Added option to include the log identifier in log messages #79 * **Version 3.0b2**: *(2015/08/11)* - Updated for Swift 2.0 (Xcode 7 Beta 5) * **Version 2.2**: *(2015/08/11)* - Internal restructuring, easier to create new log destination subclasses. Can disable function names, and/or dates. Added optional new log destination that uses NSLog instead of println(). * **Version 3.0b1**: *(2015/06/18)* - Swift 2.0 support/required. Consider this unstable for now, as Swift 2.0 will likely see changes before final release, and this library may undergo some architecture changes (time permitting). * **Version 2.1.1**: *(2015/06/18)* - Fixed two minor bugs wrt XcodeColors. * **Version 2.1**: *(2015/06/17)* - Added support for XcodeColors (https://github.com/robbiehanson/XcodeColors). Undeprecated the \*Exec() methods. * **Version 2.0**: *(2015/04/14)* - Requires Swift 1.2. Removed some workarounds/hacks for older versions of Xcode. Removed thread based caching of NSDateFormatter objects since they're now thread safe. You can now use the default date formatter, or create and assign your own and it'll be used. Added Thread name option (Thanks to Nick Strecker https://github.com/tekknick ). Add experimental support for CocoaPods. * **Version 1.9**: *(2015/04/14)* - Deprecated the \*Exec() methods in favour of just using a trailing closure on the logging methods (Thanks to Nick Strecker https://github.com/tekknick ). This will be the last version for Swift 1.1. * **Version 1.8.1**: *(2014/12/31)* - Added a workaround to the Swift compiler's optimization bug, restored optimization level back to Fastest * **Version 1.8**: *(2014/11/16)* - Added warning log level (Issue #16) * **Version 1.7**: *(2014/09/27)* - Reorganized to be used as a subproject instead of a framework, fixed threading * **Version 1.6**: *(2014/09/09)* - Updated for Xcode 6.1 Beta 1 * **Version 1.5**: *(2014/08/23)* - Updated for Xcode 6 Beta 6 * **Version 1.4**: *(2014/08/04)* - Updated for Xcode 6 Beta 5, removed `__FUNCTION__` workaround * **Version 1.3**: *(2014/07/27)* - Updated to use public/internal/private access modifiers * **Version 1.2**: *(2014/07/01)* - Added exec methods to selectively execute code * **Version 1.1**: *(2014/06/22)* - Changed the internal architecture to allow for more flexibility * **Version 1.0**: *(2014/06/09)* - Initial Release
DaveWoodCom/XCGLogger
CHANGELOG.md
Markdown
mit
6,809
package ua.kata; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; class StringCalcTest { private StringCalc calc; @BeforeEach void setUp() { calc = new StringCalc(); } @Test void computeNegativeNumber() throws Exception { assertThat(calc.compute("-43")).isEqualTo(-43); } @Test void computeAddition() throws Exception { assertThat(calc.compute("13+2")).isEqualTo(13 + 2); } @Test void computeSubtraction() throws Exception { assertThat(calc.compute("21-12")).isEqualTo(21 - 12); } @Test void computeMultiplication() throws Exception { assertThat(calc.compute("4*2")).isEqualTo(4 * 2); } @Test void computeDivision() throws Exception { assertThat(calc.compute("16/4")).isEqualTo(16 / 4); } @Test void computeMultipleOperation() throws Exception { assertThat(calc.compute("4+12*8-121/11")).isEqualTo(4 + 12 * 8 - 121 / 11); } @Test void computeOperationsWithParenthesis() throws Exception { assertThat(calc.compute("(4+12)*8-121/(5+6)")).isEqualTo((4 + 12) * 8 - 121 / (5 + 6)); } }
Alex-Diez/Java-TDD-Katas
string-calc-kata/string-calc-day-11/src/test/java/ua/kata/StringCalcTest.java
Java
mit
1,199
using System; using System.Collections; using System.Collections.Generic; using System.Globalization; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Numerics; using System.Linq; using GlmSharp.Swizzle; // ReSharper disable InconsistentNaming namespace GlmSharp { /// <summary> /// A matrix of type uint with 2 columns and 4 rows. /// </summary> [Serializable] [DataContract(Namespace = "mat")] [StructLayout(LayoutKind.Sequential)] public struct umat2x4 : IReadOnlyList<uint>, IEquatable<umat2x4> { #region Fields /// <summary> /// Column 0, Rows 0 /// </summary> [DataMember] public uint m00; /// <summary> /// Column 0, Rows 1 /// </summary> [DataMember] public uint m01; /// <summary> /// Column 0, Rows 2 /// </summary> [DataMember] public uint m02; /// <summary> /// Column 0, Rows 3 /// </summary> [DataMember] public uint m03; /// <summary> /// Column 1, Rows 0 /// </summary> [DataMember] public uint m10; /// <summary> /// Column 1, Rows 1 /// </summary> [DataMember] public uint m11; /// <summary> /// Column 1, Rows 2 /// </summary> [DataMember] public uint m12; /// <summary> /// Column 1, Rows 3 /// </summary> [DataMember] public uint m13; #endregion #region Constructors /// <summary> /// Component-wise constructor /// </summary> public umat2x4(uint m00, uint m01, uint m02, uint m03, uint m10, uint m11, uint m12, uint m13) { this.m00 = m00; this.m01 = m01; this.m02 = m02; this.m03 = m03; this.m10 = m10; this.m11 = m11; this.m12 = m12; this.m13 = m13; } /// <summary> /// Constructs this matrix from a umat2. Non-overwritten fields are from an Identity matrix. /// </summary> public umat2x4(umat2 m) { this.m00 = m.m00; this.m01 = m.m01; this.m02 = 0u; this.m03 = 0u; this.m10 = m.m10; this.m11 = m.m11; this.m12 = 0u; this.m13 = 0u; } /// <summary> /// Constructs this matrix from a umat3x2. Non-overwritten fields are from an Identity matrix. /// </summary> public umat2x4(umat3x2 m) { this.m00 = m.m00; this.m01 = m.m01; this.m02 = 0u; this.m03 = 0u; this.m10 = m.m10; this.m11 = m.m11; this.m12 = 0u; this.m13 = 0u; } /// <summary> /// Constructs this matrix from a umat4x2. Non-overwritten fields are from an Identity matrix. /// </summary> public umat2x4(umat4x2 m) { this.m00 = m.m00; this.m01 = m.m01; this.m02 = 0u; this.m03 = 0u; this.m10 = m.m10; this.m11 = m.m11; this.m12 = 0u; this.m13 = 0u; } /// <summary> /// Constructs this matrix from a umat2x3. Non-overwritten fields are from an Identity matrix. /// </summary> public umat2x4(umat2x3 m) { this.m00 = m.m00; this.m01 = m.m01; this.m02 = m.m02; this.m03 = 0u; this.m10 = m.m10; this.m11 = m.m11; this.m12 = m.m12; this.m13 = 0u; } /// <summary> /// Constructs this matrix from a umat3. Non-overwritten fields are from an Identity matrix. /// </summary> public umat2x4(umat3 m) { this.m00 = m.m00; this.m01 = m.m01; this.m02 = m.m02; this.m03 = 0u; this.m10 = m.m10; this.m11 = m.m11; this.m12 = m.m12; this.m13 = 0u; } /// <summary> /// Constructs this matrix from a umat4x3. Non-overwritten fields are from an Identity matrix. /// </summary> public umat2x4(umat4x3 m) { this.m00 = m.m00; this.m01 = m.m01; this.m02 = m.m02; this.m03 = 0u; this.m10 = m.m10; this.m11 = m.m11; this.m12 = m.m12; this.m13 = 0u; } /// <summary> /// Constructs this matrix from a umat2x4. Non-overwritten fields are from an Identity matrix. /// </summary> public umat2x4(umat2x4 m) { this.m00 = m.m00; this.m01 = m.m01; this.m02 = m.m02; this.m03 = m.m03; this.m10 = m.m10; this.m11 = m.m11; this.m12 = m.m12; this.m13 = m.m13; } /// <summary> /// Constructs this matrix from a umat3x4. Non-overwritten fields are from an Identity matrix. /// </summary> public umat2x4(umat3x4 m) { this.m00 = m.m00; this.m01 = m.m01; this.m02 = m.m02; this.m03 = m.m03; this.m10 = m.m10; this.m11 = m.m11; this.m12 = m.m12; this.m13 = m.m13; } /// <summary> /// Constructs this matrix from a umat4. Non-overwritten fields are from an Identity matrix. /// </summary> public umat2x4(umat4 m) { this.m00 = m.m00; this.m01 = m.m01; this.m02 = m.m02; this.m03 = m.m03; this.m10 = m.m10; this.m11 = m.m11; this.m12 = m.m12; this.m13 = m.m13; } /// <summary> /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix. /// </summary> public umat2x4(uvec2 c0, uvec2 c1) { this.m00 = c0.x; this.m01 = c0.y; this.m02 = 0u; this.m03 = 0u; this.m10 = c1.x; this.m11 = c1.y; this.m12 = 0u; this.m13 = 0u; } /// <summary> /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix. /// </summary> public umat2x4(uvec3 c0, uvec3 c1) { this.m00 = c0.x; this.m01 = c0.y; this.m02 = c0.z; this.m03 = 0u; this.m10 = c1.x; this.m11 = c1.y; this.m12 = c1.z; this.m13 = 0u; } /// <summary> /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix. /// </summary> public umat2x4(uvec4 c0, uvec4 c1) { this.m00 = c0.x; this.m01 = c0.y; this.m02 = c0.z; this.m03 = c0.w; this.m10 = c1.x; this.m11 = c1.y; this.m12 = c1.z; this.m13 = c1.w; } #endregion #region Properties /// <summary> /// Creates a 2D array with all values (address: Values[x, y]) /// </summary> public uint[,] Values => new[,] { { m00, m01, m02, m03 }, { m10, m11, m12, m13 } }; /// <summary> /// Creates a 1D array with all values (internal order) /// </summary> public uint[] Values1D => new[] { m00, m01, m02, m03, m10, m11, m12, m13 }; /// <summary> /// Gets or sets the column nr 0 /// </summary> public uvec4 Column0 { get { return new uvec4(m00, m01, m02, m03); } set { m00 = value.x; m01 = value.y; m02 = value.z; m03 = value.w; } } /// <summary> /// Gets or sets the column nr 1 /// </summary> public uvec4 Column1 { get { return new uvec4(m10, m11, m12, m13); } set { m10 = value.x; m11 = value.y; m12 = value.z; m13 = value.w; } } /// <summary> /// Gets or sets the row nr 0 /// </summary> public uvec2 Row0 { get { return new uvec2(m00, m10); } set { m00 = value.x; m10 = value.y; } } /// <summary> /// Gets or sets the row nr 1 /// </summary> public uvec2 Row1 { get { return new uvec2(m01, m11); } set { m01 = value.x; m11 = value.y; } } /// <summary> /// Gets or sets the row nr 2 /// </summary> public uvec2 Row2 { get { return new uvec2(m02, m12); } set { m02 = value.x; m12 = value.y; } } /// <summary> /// Gets or sets the row nr 3 /// </summary> public uvec2 Row3 { get { return new uvec2(m03, m13); } set { m03 = value.x; m13 = value.y; } } #endregion #region Static Properties /// <summary> /// Predefined all-zero matrix /// </summary> public static umat2x4 Zero { get; } = new umat2x4(0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u); /// <summary> /// Predefined all-ones matrix /// </summary> public static umat2x4 Ones { get; } = new umat2x4(1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u); /// <summary> /// Predefined identity matrix /// </summary> public static umat2x4 Identity { get; } = new umat2x4(1u, 0u, 0u, 0u, 0u, 1u, 0u, 0u); /// <summary> /// Predefined all-MaxValue matrix /// </summary> public static umat2x4 AllMaxValue { get; } = new umat2x4(uint.MaxValue, uint.MaxValue, uint.MaxValue, uint.MaxValue, uint.MaxValue, uint.MaxValue, uint.MaxValue, uint.MaxValue); /// <summary> /// Predefined diagonal-MaxValue matrix /// </summary> public static umat2x4 DiagonalMaxValue { get; } = new umat2x4(uint.MaxValue, 0u, 0u, 0u, 0u, uint.MaxValue, 0u, 0u); /// <summary> /// Predefined all-MinValue matrix /// </summary> public static umat2x4 AllMinValue { get; } = new umat2x4(uint.MinValue, uint.MinValue, uint.MinValue, uint.MinValue, uint.MinValue, uint.MinValue, uint.MinValue, uint.MinValue); /// <summary> /// Predefined diagonal-MinValue matrix /// </summary> public static umat2x4 DiagonalMinValue { get; } = new umat2x4(uint.MinValue, 0u, 0u, 0u, 0u, uint.MinValue, 0u, 0u); #endregion #region Functions /// <summary> /// Returns an enumerator that iterates through all fields. /// </summary> public IEnumerator<uint> GetEnumerator() { yield return m00; yield return m01; yield return m02; yield return m03; yield return m10; yield return m11; yield return m12; yield return m13; } /// <summary> /// Returns an enumerator that iterates through all fields. /// </summary> IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); #endregion /// <summary> /// Returns the number of Fields (2 x 4 = 8). /// </summary> public int Count => 8; /// <summary> /// Gets/Sets a specific indexed component (a bit slower than direct access). /// </summary> public uint this[int fieldIndex] { get { switch (fieldIndex) { case 0: return m00; case 1: return m01; case 2: return m02; case 3: return m03; case 4: return m10; case 5: return m11; case 6: return m12; case 7: return m13; default: throw new ArgumentOutOfRangeException("fieldIndex"); } } set { switch (fieldIndex) { case 0: this.m00 = value; break; case 1: this.m01 = value; break; case 2: this.m02 = value; break; case 3: this.m03 = value; break; case 4: this.m10 = value; break; case 5: this.m11 = value; break; case 6: this.m12 = value; break; case 7: this.m13 = value; break; default: throw new ArgumentOutOfRangeException("fieldIndex"); } } } /// <summary> /// Gets/Sets a specific 2D-indexed component (a bit slower than direct access). /// </summary> public uint this[int col, int row] { get { return this[col * 4 + row]; } set { this[col * 4 + row] = value; } } /// <summary> /// Returns true iff this equals rhs component-wise. /// </summary> public bool Equals(umat2x4 rhs) => (((m00.Equals(rhs.m00) && m01.Equals(rhs.m01)) && (m02.Equals(rhs.m02) && m03.Equals(rhs.m03))) && ((m10.Equals(rhs.m10) && m11.Equals(rhs.m11)) && (m12.Equals(rhs.m12) && m13.Equals(rhs.m13)))); /// <summary> /// Returns true iff this equals rhs type- and component-wise. /// </summary> public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) return false; return obj is umat2x4 && Equals((umat2x4) obj); } /// <summary> /// Returns true iff this equals rhs component-wise. /// </summary> public static bool operator ==(umat2x4 lhs, umat2x4 rhs) => lhs.Equals(rhs); /// <summary> /// Returns true iff this does not equal rhs (component-wise). /// </summary> public static bool operator !=(umat2x4 lhs, umat2x4 rhs) => !lhs.Equals(rhs); /// <summary> /// Returns a hash code for this instance. /// </summary> public override int GetHashCode() { unchecked { return ((((((((((((((m00.GetHashCode()) * 397) ^ m01.GetHashCode()) * 397) ^ m02.GetHashCode()) * 397) ^ m03.GetHashCode()) * 397) ^ m10.GetHashCode()) * 397) ^ m11.GetHashCode()) * 397) ^ m12.GetHashCode()) * 397) ^ m13.GetHashCode(); } } /// <summary> /// Returns a transposed version of this matrix. /// </summary> public umat4x2 Transposed => new umat4x2(m00, m10, m01, m11, m02, m12, m03, m13); /// <summary> /// Returns the minimal component of this matrix. /// </summary> public uint MinElement => Math.Min(Math.Min(Math.Min(Math.Min(Math.Min(Math.Min(Math.Min(m00, m01), m02), m03), m10), m11), m12), m13); /// <summary> /// Returns the maximal component of this matrix. /// </summary> public uint MaxElement => Math.Max(Math.Max(Math.Max(Math.Max(Math.Max(Math.Max(Math.Max(m00, m01), m02), m03), m10), m11), m12), m13); /// <summary> /// Returns the euclidean length of this matrix. /// </summary> public float Length => (float)Math.Sqrt((((m00*m00 + m01*m01) + (m02*m02 + m03*m03)) + ((m10*m10 + m11*m11) + (m12*m12 + m13*m13)))); /// <summary> /// Returns the squared euclidean length of this matrix. /// </summary> public float LengthSqr => (((m00*m00 + m01*m01) + (m02*m02 + m03*m03)) + ((m10*m10 + m11*m11) + (m12*m12 + m13*m13))); /// <summary> /// Returns the sum of all fields. /// </summary> public uint Sum => (((m00 + m01) + (m02 + m03)) + ((m10 + m11) + (m12 + m13))); /// <summary> /// Returns the euclidean norm of this matrix. /// </summary> public float Norm => (float)Math.Sqrt((((m00*m00 + m01*m01) + (m02*m02 + m03*m03)) + ((m10*m10 + m11*m11) + (m12*m12 + m13*m13)))); /// <summary> /// Returns the one-norm of this matrix. /// </summary> public float Norm1 => (((m00 + m01) + (m02 + m03)) + ((m10 + m11) + (m12 + m13))); /// <summary> /// Returns the two-norm of this matrix. /// </summary> public float Norm2 => (float)Math.Sqrt((((m00*m00 + m01*m01) + (m02*m02 + m03*m03)) + ((m10*m10 + m11*m11) + (m12*m12 + m13*m13)))); /// <summary> /// Returns the max-norm of this matrix. /// </summary> public uint NormMax => Math.Max(Math.Max(Math.Max(Math.Max(Math.Max(Math.Max(Math.Max(m00, m01), m02), m03), m10), m11), m12), m13); /// <summary> /// Returns the p-norm of this matrix. /// </summary> public double NormP(double p) => Math.Pow((((Math.Pow((double)m00, p) + Math.Pow((double)m01, p)) + (Math.Pow((double)m02, p) + Math.Pow((double)m03, p))) + ((Math.Pow((double)m10, p) + Math.Pow((double)m11, p)) + (Math.Pow((double)m12, p) + Math.Pow((double)m13, p)))), 1 / p); /// <summary> /// Executes a matrix-matrix-multiplication umat2x4 * umat2 -> umat2x4. /// </summary> public static umat2x4 operator*(umat2x4 lhs, umat2 rhs) => new umat2x4((lhs.m00 * rhs.m00 + lhs.m10 * rhs.m01), (lhs.m01 * rhs.m00 + lhs.m11 * rhs.m01), (lhs.m02 * rhs.m00 + lhs.m12 * rhs.m01), (lhs.m03 * rhs.m00 + lhs.m13 * rhs.m01), (lhs.m00 * rhs.m10 + lhs.m10 * rhs.m11), (lhs.m01 * rhs.m10 + lhs.m11 * rhs.m11), (lhs.m02 * rhs.m10 + lhs.m12 * rhs.m11), (lhs.m03 * rhs.m10 + lhs.m13 * rhs.m11)); /// <summary> /// Executes a matrix-matrix-multiplication umat2x4 * umat3x2 -> umat3x4. /// </summary> public static umat3x4 operator*(umat2x4 lhs, umat3x2 rhs) => new umat3x4((lhs.m00 * rhs.m00 + lhs.m10 * rhs.m01), (lhs.m01 * rhs.m00 + lhs.m11 * rhs.m01), (lhs.m02 * rhs.m00 + lhs.m12 * rhs.m01), (lhs.m03 * rhs.m00 + lhs.m13 * rhs.m01), (lhs.m00 * rhs.m10 + lhs.m10 * rhs.m11), (lhs.m01 * rhs.m10 + lhs.m11 * rhs.m11), (lhs.m02 * rhs.m10 + lhs.m12 * rhs.m11), (lhs.m03 * rhs.m10 + lhs.m13 * rhs.m11), (lhs.m00 * rhs.m20 + lhs.m10 * rhs.m21), (lhs.m01 * rhs.m20 + lhs.m11 * rhs.m21), (lhs.m02 * rhs.m20 + lhs.m12 * rhs.m21), (lhs.m03 * rhs.m20 + lhs.m13 * rhs.m21)); /// <summary> /// Executes a matrix-matrix-multiplication umat2x4 * umat4x2 -> umat4. /// </summary> public static umat4 operator*(umat2x4 lhs, umat4x2 rhs) => new umat4((lhs.m00 * rhs.m00 + lhs.m10 * rhs.m01), (lhs.m01 * rhs.m00 + lhs.m11 * rhs.m01), (lhs.m02 * rhs.m00 + lhs.m12 * rhs.m01), (lhs.m03 * rhs.m00 + lhs.m13 * rhs.m01), (lhs.m00 * rhs.m10 + lhs.m10 * rhs.m11), (lhs.m01 * rhs.m10 + lhs.m11 * rhs.m11), (lhs.m02 * rhs.m10 + lhs.m12 * rhs.m11), (lhs.m03 * rhs.m10 + lhs.m13 * rhs.m11), (lhs.m00 * rhs.m20 + lhs.m10 * rhs.m21), (lhs.m01 * rhs.m20 + lhs.m11 * rhs.m21), (lhs.m02 * rhs.m20 + lhs.m12 * rhs.m21), (lhs.m03 * rhs.m20 + lhs.m13 * rhs.m21), (lhs.m00 * rhs.m30 + lhs.m10 * rhs.m31), (lhs.m01 * rhs.m30 + lhs.m11 * rhs.m31), (lhs.m02 * rhs.m30 + lhs.m12 * rhs.m31), (lhs.m03 * rhs.m30 + lhs.m13 * rhs.m31)); /// <summary> /// Executes a matrix-vector-multiplication. /// </summary> public static uvec4 operator*(umat2x4 m, uvec2 v) => new uvec4((m.m00 * v.x + m.m10 * v.y), (m.m01 * v.x + m.m11 * v.y), (m.m02 * v.x + m.m12 * v.y), (m.m03 * v.x + m.m13 * v.y)); /// <summary> /// Executes a component-wise * (multiply). /// </summary> public static umat2x4 CompMul(umat2x4 A, umat2x4 B) => new umat2x4(A.m00 * B.m00, A.m01 * B.m01, A.m02 * B.m02, A.m03 * B.m03, A.m10 * B.m10, A.m11 * B.m11, A.m12 * B.m12, A.m13 * B.m13); /// <summary> /// Executes a component-wise / (divide). /// </summary> public static umat2x4 CompDiv(umat2x4 A, umat2x4 B) => new umat2x4(A.m00 / B.m00, A.m01 / B.m01, A.m02 / B.m02, A.m03 / B.m03, A.m10 / B.m10, A.m11 / B.m11, A.m12 / B.m12, A.m13 / B.m13); /// <summary> /// Executes a component-wise + (add). /// </summary> public static umat2x4 CompAdd(umat2x4 A, umat2x4 B) => new umat2x4(A.m00 + B.m00, A.m01 + B.m01, A.m02 + B.m02, A.m03 + B.m03, A.m10 + B.m10, A.m11 + B.m11, A.m12 + B.m12, A.m13 + B.m13); /// <summary> /// Executes a component-wise - (subtract). /// </summary> public static umat2x4 CompSub(umat2x4 A, umat2x4 B) => new umat2x4(A.m00 - B.m00, A.m01 - B.m01, A.m02 - B.m02, A.m03 - B.m03, A.m10 - B.m10, A.m11 - B.m11, A.m12 - B.m12, A.m13 - B.m13); /// <summary> /// Executes a component-wise + (add). /// </summary> public static umat2x4 operator+(umat2x4 lhs, umat2x4 rhs) => new umat2x4(lhs.m00 + rhs.m00, lhs.m01 + rhs.m01, lhs.m02 + rhs.m02, lhs.m03 + rhs.m03, lhs.m10 + rhs.m10, lhs.m11 + rhs.m11, lhs.m12 + rhs.m12, lhs.m13 + rhs.m13); /// <summary> /// Executes a component-wise + (add) with a scalar. /// </summary> public static umat2x4 operator+(umat2x4 lhs, uint rhs) => new umat2x4(lhs.m00 + rhs, lhs.m01 + rhs, lhs.m02 + rhs, lhs.m03 + rhs, lhs.m10 + rhs, lhs.m11 + rhs, lhs.m12 + rhs, lhs.m13 + rhs); /// <summary> /// Executes a component-wise + (add) with a scalar. /// </summary> public static umat2x4 operator+(uint lhs, umat2x4 rhs) => new umat2x4(lhs + rhs.m00, lhs + rhs.m01, lhs + rhs.m02, lhs + rhs.m03, lhs + rhs.m10, lhs + rhs.m11, lhs + rhs.m12, lhs + rhs.m13); /// <summary> /// Executes a component-wise - (subtract). /// </summary> public static umat2x4 operator-(umat2x4 lhs, umat2x4 rhs) => new umat2x4(lhs.m00 - rhs.m00, lhs.m01 - rhs.m01, lhs.m02 - rhs.m02, lhs.m03 - rhs.m03, lhs.m10 - rhs.m10, lhs.m11 - rhs.m11, lhs.m12 - rhs.m12, lhs.m13 - rhs.m13); /// <summary> /// Executes a component-wise - (subtract) with a scalar. /// </summary> public static umat2x4 operator-(umat2x4 lhs, uint rhs) => new umat2x4(lhs.m00 - rhs, lhs.m01 - rhs, lhs.m02 - rhs, lhs.m03 - rhs, lhs.m10 - rhs, lhs.m11 - rhs, lhs.m12 - rhs, lhs.m13 - rhs); /// <summary> /// Executes a component-wise - (subtract) with a scalar. /// </summary> public static umat2x4 operator-(uint lhs, umat2x4 rhs) => new umat2x4(lhs - rhs.m00, lhs - rhs.m01, lhs - rhs.m02, lhs - rhs.m03, lhs - rhs.m10, lhs - rhs.m11, lhs - rhs.m12, lhs - rhs.m13); /// <summary> /// Executes a component-wise / (divide) with a scalar. /// </summary> public static umat2x4 operator/(umat2x4 lhs, uint rhs) => new umat2x4(lhs.m00 / rhs, lhs.m01 / rhs, lhs.m02 / rhs, lhs.m03 / rhs, lhs.m10 / rhs, lhs.m11 / rhs, lhs.m12 / rhs, lhs.m13 / rhs); /// <summary> /// Executes a component-wise / (divide) with a scalar. /// </summary> public static umat2x4 operator/(uint lhs, umat2x4 rhs) => new umat2x4(lhs / rhs.m00, lhs / rhs.m01, lhs / rhs.m02, lhs / rhs.m03, lhs / rhs.m10, lhs / rhs.m11, lhs / rhs.m12, lhs / rhs.m13); /// <summary> /// Executes a component-wise * (multiply) with a scalar. /// </summary> public static umat2x4 operator*(umat2x4 lhs, uint rhs) => new umat2x4(lhs.m00 * rhs, lhs.m01 * rhs, lhs.m02 * rhs, lhs.m03 * rhs, lhs.m10 * rhs, lhs.m11 * rhs, lhs.m12 * rhs, lhs.m13 * rhs); /// <summary> /// Executes a component-wise * (multiply) with a scalar. /// </summary> public static umat2x4 operator*(uint lhs, umat2x4 rhs) => new umat2x4(lhs * rhs.m00, lhs * rhs.m01, lhs * rhs.m02, lhs * rhs.m03, lhs * rhs.m10, lhs * rhs.m11, lhs * rhs.m12, lhs * rhs.m13); /// <summary> /// Executes a component-wise % (modulo). /// </summary> public static umat2x4 operator%(umat2x4 lhs, umat2x4 rhs) => new umat2x4(lhs.m00 % rhs.m00, lhs.m01 % rhs.m01, lhs.m02 % rhs.m02, lhs.m03 % rhs.m03, lhs.m10 % rhs.m10, lhs.m11 % rhs.m11, lhs.m12 % rhs.m12, lhs.m13 % rhs.m13); /// <summary> /// Executes a component-wise % (modulo) with a scalar. /// </summary> public static umat2x4 operator%(umat2x4 lhs, uint rhs) => new umat2x4(lhs.m00 % rhs, lhs.m01 % rhs, lhs.m02 % rhs, lhs.m03 % rhs, lhs.m10 % rhs, lhs.m11 % rhs, lhs.m12 % rhs, lhs.m13 % rhs); /// <summary> /// Executes a component-wise % (modulo) with a scalar. /// </summary> public static umat2x4 operator%(uint lhs, umat2x4 rhs) => new umat2x4(lhs % rhs.m00, lhs % rhs.m01, lhs % rhs.m02, lhs % rhs.m03, lhs % rhs.m10, lhs % rhs.m11, lhs % rhs.m12, lhs % rhs.m13); /// <summary> /// Executes a component-wise ^ (xor). /// </summary> public static umat2x4 operator^(umat2x4 lhs, umat2x4 rhs) => new umat2x4(lhs.m00 ^ rhs.m00, lhs.m01 ^ rhs.m01, lhs.m02 ^ rhs.m02, lhs.m03 ^ rhs.m03, lhs.m10 ^ rhs.m10, lhs.m11 ^ rhs.m11, lhs.m12 ^ rhs.m12, lhs.m13 ^ rhs.m13); /// <summary> /// Executes a component-wise ^ (xor) with a scalar. /// </summary> public static umat2x4 operator^(umat2x4 lhs, uint rhs) => new umat2x4(lhs.m00 ^ rhs, lhs.m01 ^ rhs, lhs.m02 ^ rhs, lhs.m03 ^ rhs, lhs.m10 ^ rhs, lhs.m11 ^ rhs, lhs.m12 ^ rhs, lhs.m13 ^ rhs); /// <summary> /// Executes a component-wise ^ (xor) with a scalar. /// </summary> public static umat2x4 operator^(uint lhs, umat2x4 rhs) => new umat2x4(lhs ^ rhs.m00, lhs ^ rhs.m01, lhs ^ rhs.m02, lhs ^ rhs.m03, lhs ^ rhs.m10, lhs ^ rhs.m11, lhs ^ rhs.m12, lhs ^ rhs.m13); /// <summary> /// Executes a component-wise | (bitwise-or). /// </summary> public static umat2x4 operator|(umat2x4 lhs, umat2x4 rhs) => new umat2x4(lhs.m00 | rhs.m00, lhs.m01 | rhs.m01, lhs.m02 | rhs.m02, lhs.m03 | rhs.m03, lhs.m10 | rhs.m10, lhs.m11 | rhs.m11, lhs.m12 | rhs.m12, lhs.m13 | rhs.m13); /// <summary> /// Executes a component-wise | (bitwise-or) with a scalar. /// </summary> public static umat2x4 operator|(umat2x4 lhs, uint rhs) => new umat2x4(lhs.m00 | rhs, lhs.m01 | rhs, lhs.m02 | rhs, lhs.m03 | rhs, lhs.m10 | rhs, lhs.m11 | rhs, lhs.m12 | rhs, lhs.m13 | rhs); /// <summary> /// Executes a component-wise | (bitwise-or) with a scalar. /// </summary> public static umat2x4 operator|(uint lhs, umat2x4 rhs) => new umat2x4(lhs | rhs.m00, lhs | rhs.m01, lhs | rhs.m02, lhs | rhs.m03, lhs | rhs.m10, lhs | rhs.m11, lhs | rhs.m12, lhs | rhs.m13); /// <summary> /// Executes a component-wise &amp; (bitwise-and). /// </summary> public static umat2x4 operator&(umat2x4 lhs, umat2x4 rhs) => new umat2x4(lhs.m00 & rhs.m00, lhs.m01 & rhs.m01, lhs.m02 & rhs.m02, lhs.m03 & rhs.m03, lhs.m10 & rhs.m10, lhs.m11 & rhs.m11, lhs.m12 & rhs.m12, lhs.m13 & rhs.m13); /// <summary> /// Executes a component-wise &amp; (bitwise-and) with a scalar. /// </summary> public static umat2x4 operator&(umat2x4 lhs, uint rhs) => new umat2x4(lhs.m00 & rhs, lhs.m01 & rhs, lhs.m02 & rhs, lhs.m03 & rhs, lhs.m10 & rhs, lhs.m11 & rhs, lhs.m12 & rhs, lhs.m13 & rhs); /// <summary> /// Executes a component-wise &amp; (bitwise-and) with a scalar. /// </summary> public static umat2x4 operator&(uint lhs, umat2x4 rhs) => new umat2x4(lhs & rhs.m00, lhs & rhs.m01, lhs & rhs.m02, lhs & rhs.m03, lhs & rhs.m10, lhs & rhs.m11, lhs & rhs.m12, lhs & rhs.m13); /// <summary> /// Executes a component-wise left-shift with a scalar. /// </summary> public static umat2x4 operator<<(umat2x4 lhs, int rhs) => new umat2x4(lhs.m00 << rhs, lhs.m01 << rhs, lhs.m02 << rhs, lhs.m03 << rhs, lhs.m10 << rhs, lhs.m11 << rhs, lhs.m12 << rhs, lhs.m13 << rhs); /// <summary> /// Executes a component-wise right-shift with a scalar. /// </summary> public static umat2x4 operator>>(umat2x4 lhs, int rhs) => new umat2x4(lhs.m00 >> rhs, lhs.m01 >> rhs, lhs.m02 >> rhs, lhs.m03 >> rhs, lhs.m10 >> rhs, lhs.m11 >> rhs, lhs.m12 >> rhs, lhs.m13 >> rhs); /// <summary> /// Executes a component-wise lesser-than comparison. /// </summary> public static bmat2x4 operator<(umat2x4 lhs, umat2x4 rhs) => new bmat2x4(lhs.m00 < rhs.m00, lhs.m01 < rhs.m01, lhs.m02 < rhs.m02, lhs.m03 < rhs.m03, lhs.m10 < rhs.m10, lhs.m11 < rhs.m11, lhs.m12 < rhs.m12, lhs.m13 < rhs.m13); /// <summary> /// Executes a component-wise lesser-than comparison with a scalar. /// </summary> public static bmat2x4 operator<(umat2x4 lhs, uint rhs) => new bmat2x4(lhs.m00 < rhs, lhs.m01 < rhs, lhs.m02 < rhs, lhs.m03 < rhs, lhs.m10 < rhs, lhs.m11 < rhs, lhs.m12 < rhs, lhs.m13 < rhs); /// <summary> /// Executes a component-wise lesser-than comparison with a scalar. /// </summary> public static bmat2x4 operator<(uint lhs, umat2x4 rhs) => new bmat2x4(lhs < rhs.m00, lhs < rhs.m01, lhs < rhs.m02, lhs < rhs.m03, lhs < rhs.m10, lhs < rhs.m11, lhs < rhs.m12, lhs < rhs.m13); /// <summary> /// Executes a component-wise lesser-or-equal comparison. /// </summary> public static bmat2x4 operator<=(umat2x4 lhs, umat2x4 rhs) => new bmat2x4(lhs.m00 <= rhs.m00, lhs.m01 <= rhs.m01, lhs.m02 <= rhs.m02, lhs.m03 <= rhs.m03, lhs.m10 <= rhs.m10, lhs.m11 <= rhs.m11, lhs.m12 <= rhs.m12, lhs.m13 <= rhs.m13); /// <summary> /// Executes a component-wise lesser-or-equal comparison with a scalar. /// </summary> public static bmat2x4 operator<=(umat2x4 lhs, uint rhs) => new bmat2x4(lhs.m00 <= rhs, lhs.m01 <= rhs, lhs.m02 <= rhs, lhs.m03 <= rhs, lhs.m10 <= rhs, lhs.m11 <= rhs, lhs.m12 <= rhs, lhs.m13 <= rhs); /// <summary> /// Executes a component-wise lesser-or-equal comparison with a scalar. /// </summary> public static bmat2x4 operator<=(uint lhs, umat2x4 rhs) => new bmat2x4(lhs <= rhs.m00, lhs <= rhs.m01, lhs <= rhs.m02, lhs <= rhs.m03, lhs <= rhs.m10, lhs <= rhs.m11, lhs <= rhs.m12, lhs <= rhs.m13); /// <summary> /// Executes a component-wise greater-than comparison. /// </summary> public static bmat2x4 operator>(umat2x4 lhs, umat2x4 rhs) => new bmat2x4(lhs.m00 > rhs.m00, lhs.m01 > rhs.m01, lhs.m02 > rhs.m02, lhs.m03 > rhs.m03, lhs.m10 > rhs.m10, lhs.m11 > rhs.m11, lhs.m12 > rhs.m12, lhs.m13 > rhs.m13); /// <summary> /// Executes a component-wise greater-than comparison with a scalar. /// </summary> public static bmat2x4 operator>(umat2x4 lhs, uint rhs) => new bmat2x4(lhs.m00 > rhs, lhs.m01 > rhs, lhs.m02 > rhs, lhs.m03 > rhs, lhs.m10 > rhs, lhs.m11 > rhs, lhs.m12 > rhs, lhs.m13 > rhs); /// <summary> /// Executes a component-wise greater-than comparison with a scalar. /// </summary> public static bmat2x4 operator>(uint lhs, umat2x4 rhs) => new bmat2x4(lhs > rhs.m00, lhs > rhs.m01, lhs > rhs.m02, lhs > rhs.m03, lhs > rhs.m10, lhs > rhs.m11, lhs > rhs.m12, lhs > rhs.m13); /// <summary> /// Executes a component-wise greater-or-equal comparison. /// </summary> public static bmat2x4 operator>=(umat2x4 lhs, umat2x4 rhs) => new bmat2x4(lhs.m00 >= rhs.m00, lhs.m01 >= rhs.m01, lhs.m02 >= rhs.m02, lhs.m03 >= rhs.m03, lhs.m10 >= rhs.m10, lhs.m11 >= rhs.m11, lhs.m12 >= rhs.m12, lhs.m13 >= rhs.m13); /// <summary> /// Executes a component-wise greater-or-equal comparison with a scalar. /// </summary> public static bmat2x4 operator>=(umat2x4 lhs, uint rhs) => new bmat2x4(lhs.m00 >= rhs, lhs.m01 >= rhs, lhs.m02 >= rhs, lhs.m03 >= rhs, lhs.m10 >= rhs, lhs.m11 >= rhs, lhs.m12 >= rhs, lhs.m13 >= rhs); /// <summary> /// Executes a component-wise greater-or-equal comparison with a scalar. /// </summary> public static bmat2x4 operator>=(uint lhs, umat2x4 rhs) => new bmat2x4(lhs >= rhs.m00, lhs >= rhs.m01, lhs >= rhs.m02, lhs >= rhs.m03, lhs >= rhs.m10, lhs >= rhs.m11, lhs >= rhs.m12, lhs >= rhs.m13); } }
Philip-Trettner/GlmSharp
GlmSharp/GlmSharp/Mat2x4/umat2x4.cs
C#
mit
34,097
using System; namespace MiniTrello.Win8Phone.Areas.HelpPage { /// <summary> /// This represents an image sample on the help page. There's a display template named ImageSample associated with this class. /// </summary> public class ImageSample { /// <summary> /// Initializes a new instance of the <see cref="ImageSample"/> class. /// </summary> /// <param name="src">The URL of an image.</param> public ImageSample(string src) { if (src == null) { throw new ArgumentNullException("src"); } Src = src; } public string Src { get; private set; } public override bool Equals(object obj) { ImageSample other = obj as ImageSample; return other != null && Src == other.Src; } public override int GetHashCode() { return Src.GetHashCode(); } public override string ToString() { return Src; } } }
Siwady/ProyectoIV
MiniTrello.Api/Areas/HelpPage/SampleGeneration/ImageSample.cs
C#
mit
1,063
# weatherbot Send me weather deltas
MagRelo/weatherbot
README.md
Markdown
mit
36
package com.sls.listService; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NoArgsConstructor; import javax.persistence.*; import java.util.List; @Entity @Table(name = "entities") @Access(AccessType.FIELD) @NoArgsConstructor @EqualsAndHashCode(of = {"value", "reference"}) public class DataListEntity { @Id @Column(name = "id") @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(name = "list_id") @Getter private Long listId; @Column(name = "value", nullable = false) @Getter private String value; @Column(name = "reference", nullable = false) @Getter private String reference; @Column(name = "parent_entity_id") @Getter private Long parentId; @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) @JoinColumn(name ="parent_entity_id", referencedColumnName = "id") @Getter private List<DataListEntity> subEntities; public DataListEntity(String value, String reference) { this.value = value; this.reference = reference; } public DataListEntity(String value, String reference, List<DataListEntity> subEntities ) { this.value = value; this.reference = reference; this.subEntities = subEntities; } }
nmcmahon01/simple-list-service
src/main/java/com/sls/listService/DataListEntity.java
Java
mit
1,299
/** * Automatically generated file. Please do not edit. * @author Highcharts Config Generator by Karasiq * @see [[http://api.highcharts.com/highmaps]] */ package com.highmaps.config import scalajs.js, js.`|` import com.highcharts.CleanJsObject import com.highcharts.HighchartsUtils._ /** * @note JavaScript name: <code>series&lt;solidgauge&gt;-point-events</code> */ @js.annotation.ScalaJSDefined class SeriesSolidgaugePointEvents extends com.highcharts.HighchartsGenericObject { /** * <p>Callback that fires when starting to drag a point. The mouse event object is * passed in as an argument. If a drag handle is used, <code>e.updateProp</code> is set to * the data property being dragged. The <code>this</code> context is the point. See * <a href="plotOptions.series.dragDrop">drag and drop options</a>.</p> * <p>Requires the <code>draggable-points</code> module.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/dragdrop/drag-xrange">Drag events</a> * @since 6.2.0 */ val dragStart: js.UndefOr[js.Function] = js.undefined /** * <p>Callback that fires while dragging a point. The mouse event is passed in as * parameter. The original data can be accessed from <code>e.origin</code>, and the new * point values can be accessed from <code>e.newPoints</code>. If there is only a single * point being updated, it can be accessed from <code>e.newPoint</code> for simplicity, and * its ID can be accessed from <code>e.newPointId</code>. The <code>this</code> context is the point * being dragged. To stop the default drag action, return false. * See <a href="plotOptions.series.dragDrop">drag and drop options</a>.</p> * <p>Requires the <code>draggable-points</code> module.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/dragdrop/drag-xrange">Drag events</a> * @since 6.2.0 */ val drag: js.UndefOr[js.Function] = js.undefined /** * <p>Callback that fires when the point is dropped. The parameters passed are the * same as for <a href="#plotOptions.series.point.events.drag">drag</a>. To stop the * default drop action, return false. See * <a href="plotOptions.series.dragDrop">drag and drop options</a>.</p> * <p>Requires the <code>draggable-points</code> module.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/dragdrop/drag-xrange">Drag events</a> * @since 6.2.0 */ val drop: js.UndefOr[js.Function] = js.undefined /** * <p>Fires when a point is clicked. One parameter, <code>event</code>, is passed * to the function, containing common event information.</p> * <p>If the <code>series.allowPointSelect</code> option is true, the default * action for the point&#39;s click event is to toggle the point&#39;s * select state. Returning <code>false</code> cancels this action.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-point-events-click/">Click marker to alert values</a> <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-point-events-click-column/">Click column</a> <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-point-events-click-url/">Go to URL</a> <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/maps/plotoptions/series-point-events-click/">Click marker to display values</a> <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/maps/plotoptions/series-point-events-click-url/">Go to URL</a> */ val click: js.UndefOr[js.Function] = js.undefined /** * <p>Fires when the mouse leaves the area close to the point. One * parameter, <code>event</code>, is passed to the function, containing common * event information.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-point-events-mouseover/">Show values in the chart's corner on mouse over</a> */ val mouseOut: js.UndefOr[js.Function] = js.undefined /** * <p>Fires when the mouse enters the area close to the point. One * parameter, <code>event</code>, is passed to the function, containing common * event information.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-point-events-mouseover/">Show values in the chart's corner on mouse over</a> */ val mouseOver: js.UndefOr[js.Function] = js.undefined /** * <p>Fires when the point is removed using the <code>.remove()</code> method. One * parameter, <code>event</code>, is passed to the function. Returning <code>false</code> * cancels the operation.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-point-events-remove/">Remove point and confirm</a> * @since 1.2.0 */ val remove: js.UndefOr[js.Function] = js.undefined /** * <p>Fires when the point is selected either programmatically or * following a click on the point. One parameter, <code>event</code>, is passed * to the function. Returning <code>false</code> cancels the operation.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-point-events-select/">Report the last selected point</a> <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/maps/plotoptions/series-allowpointselect/">Report select and unselect</a> * @since 1.2.0 */ val select: js.UndefOr[js.Function] = js.undefined /** * <p>Fires when the point is unselected either programmatically or * following a click on the point. One parameter, <code>event</code>, is passed * to the function. * Returning <code>false</code> cancels the operation.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-point-events-unselect/">Report the last unselected point</a> <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/maps/plotoptions/series-allowpointselect/">Report select and unselect</a> * @since 1.2.0 */ val unselect: js.UndefOr[js.Function] = js.undefined /** * <p>Fires when the point is updated programmatically through the * <code>.update()</code> method. One parameter, <code>event</code>, is passed to the * function. The new point options can be accessed through * <code>event.options</code>. Returning <code>false</code> cancels the operation.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-point-events-update/">Confirm point updating</a> * @since 1.2.0 */ val update: js.UndefOr[js.Function] = js.undefined } object SeriesSolidgaugePointEvents { /** * @param dragStart <p>Callback that fires when starting to drag a point. The mouse event object is. passed in as an argument. If a drag handle is used, <code>e.updateProp</code> is set to. the data property being dragged. The <code>this</code> context is the point. See. <a href="plotOptions.series.dragDrop">drag and drop options</a>.</p>. <p>Requires the <code>draggable-points</code> module.</p> * @param drag <p>Callback that fires while dragging a point. The mouse event is passed in as. parameter. The original data can be accessed from <code>e.origin</code>, and the new. point values can be accessed from <code>e.newPoints</code>. If there is only a single. point being updated, it can be accessed from <code>e.newPoint</code> for simplicity, and. its ID can be accessed from <code>e.newPointId</code>. The <code>this</code> context is the point. being dragged. To stop the default drag action, return false.. See <a href="plotOptions.series.dragDrop">drag and drop options</a>.</p>. <p>Requires the <code>draggable-points</code> module.</p> * @param drop <p>Callback that fires when the point is dropped. The parameters passed are the. same as for <a href="#plotOptions.series.point.events.drag">drag</a>. To stop the. default drop action, return false. See. <a href="plotOptions.series.dragDrop">drag and drop options</a>.</p>. <p>Requires the <code>draggable-points</code> module.</p> * @param click <p>Fires when a point is clicked. One parameter, <code>event</code>, is passed. to the function, containing common event information.</p>. <p>If the <code>series.allowPointSelect</code> option is true, the default. action for the point&#39;s click event is to toggle the point&#39;s. select state. Returning <code>false</code> cancels this action.</p> * @param mouseOut <p>Fires when the mouse leaves the area close to the point. One. parameter, <code>event</code>, is passed to the function, containing common. event information.</p> * @param mouseOver <p>Fires when the mouse enters the area close to the point. One. parameter, <code>event</code>, is passed to the function, containing common. event information.</p> * @param remove <p>Fires when the point is removed using the <code>.remove()</code> method. One. parameter, <code>event</code>, is passed to the function. Returning <code>false</code>. cancels the operation.</p> * @param select <p>Fires when the point is selected either programmatically or. following a click on the point. One parameter, <code>event</code>, is passed. to the function. Returning <code>false</code> cancels the operation.</p> * @param unselect <p>Fires when the point is unselected either programmatically or. following a click on the point. One parameter, <code>event</code>, is passed. to the function.. Returning <code>false</code> cancels the operation.</p> * @param update <p>Fires when the point is updated programmatically through the. <code>.update()</code> method. One parameter, <code>event</code>, is passed to the. function. The new point options can be accessed through. <code>event.options</code>. Returning <code>false</code> cancels the operation.</p> */ def apply(dragStart: js.UndefOr[js.Function] = js.undefined, drag: js.UndefOr[js.Function] = js.undefined, drop: js.UndefOr[js.Function] = js.undefined, click: js.UndefOr[js.Function] = js.undefined, mouseOut: js.UndefOr[js.Function] = js.undefined, mouseOver: js.UndefOr[js.Function] = js.undefined, remove: js.UndefOr[js.Function] = js.undefined, select: js.UndefOr[js.Function] = js.undefined, unselect: js.UndefOr[js.Function] = js.undefined, update: js.UndefOr[js.Function] = js.undefined): SeriesSolidgaugePointEvents = { val dragStartOuter: js.UndefOr[js.Function] = dragStart val dragOuter: js.UndefOr[js.Function] = drag val dropOuter: js.UndefOr[js.Function] = drop val clickOuter: js.UndefOr[js.Function] = click val mouseOutOuter: js.UndefOr[js.Function] = mouseOut val mouseOverOuter: js.UndefOr[js.Function] = mouseOver val removeOuter: js.UndefOr[js.Function] = remove val selectOuter: js.UndefOr[js.Function] = select val unselectOuter: js.UndefOr[js.Function] = unselect val updateOuter: js.UndefOr[js.Function] = update com.highcharts.HighchartsGenericObject.toCleanObject(new SeriesSolidgaugePointEvents { override val dragStart: js.UndefOr[js.Function] = dragStartOuter override val drag: js.UndefOr[js.Function] = dragOuter override val drop: js.UndefOr[js.Function] = dropOuter override val click: js.UndefOr[js.Function] = clickOuter override val mouseOut: js.UndefOr[js.Function] = mouseOutOuter override val mouseOver: js.UndefOr[js.Function] = mouseOverOuter override val remove: js.UndefOr[js.Function] = removeOuter override val select: js.UndefOr[js.Function] = selectOuter override val unselect: js.UndefOr[js.Function] = unselectOuter override val update: js.UndefOr[js.Function] = updateOuter }) } }
Karasiq/scalajs-highcharts
src/main/scala/com/highmaps/config/SeriesSolidgaugePointEvents.scala
Scala
mit
12,307
import './Viewing.Extension.Tree' export default 'Viewing.Extension.Tree'
jaimerosales/visual-reports-bim360dc
src/client/Viewer.Components/Viewer.Extensions.Dynamic/Viewing.Extension.Tree/index.js
JavaScript
mit
74
import collections import importlib import importlib.machinery import io import itertools from itertools import chain import pprint import sys from tokenize import * #tokenize, untokenize, ERRORTOKEN, NAME, OP def _call_with_frames_removed(f, *args, **kwargs): return f(*args, **kwargs) def consume(iterator, n): "Advance the iterator n-steps ahead. If n is none, consume entirely." # Use functions that consume iterators at C speed. if n is None: # feed the entire iterator into a zero-length deque collections.deque(iterator, maxlen=0) else: # advance to the empty slice starting at position n next(itertools.islice(iterator, n, n), None) def groupwise_longest(iterable, n): bits = itertools.tee(iterable, n) for i, bit in enumerate(bits): consume(bit, i) return itertools.zip_longest(*bits) def retokenize(tokens): """Coalesce None. Replace: name?.attr with: name.attr if name is not None else None """ # See http://bugs.python.org/issue16224#msg211469 # "Switching from 5-tuples to 2-tuples... is not currently a # supported use case". In particular, if you do so in the middle # of an indented block, the dedent doesn't match the indent. So, # we have to force everything to 2-tuples. groups = groupwise_longest(tokens, 4) for w, x, y, z in groups: if (w[0] == NAME and z is not None and x[0] == ERRORTOKEN and x[1] == '?' and y[0] == OP and y[1] == '.'): yield w[0], w[1] yield y[0], y[1] yield z[0], z[1] yield NAME, 'if' yield w[0], w[1] yield NAME, 'is' yield NAME, 'not' yield NAME, 'None' yield NAME, 'else' yield NAME, 'None' consume(groups, 3) else: yield w[0], w[1] class NoneCoaLoader(importlib.machinery.SourceFileLoader): def source_to_code(self, data, path, *, _optimize=-1): print(path) source = importlib._bootstrap.decode_source(data) tokens = tokenize(io.BytesIO(source.encode('utf-8')).readline) tokens = retokenize(tokens) source = untokenize(tokens).decode('utf-8') return _call_with_frames_removed(compile, source, path, 'exec', dont_inherit=True, optimize=_optimize) _real_pathfinder = sys.meta_path[-1] class NoneCoaFinder(type(_real_pathfinder)): @classmethod def find_module(cls, fullname, path=None): spec = _real_pathfinder.find_spec(fullname, path) if not spec: return spec loader = spec.loader if type(loader).__name__ == 'SourceFileLoader': loader.__class__ = NoneCoaLoader return loader sys.meta_path[-1] = NoneCoaFinder
abarnert/nonehack
nonecoa.py
Python
mit
2,928
## Calculate the Statistics of Organizations At times, an organization would like to know general stats about how their datasets are doing. CKAN's base functionality doesn't provide a total count of downloads that datasets and resources have much less a time-series of how they are performing. This service addresses those needs by creating a simple HTTP JSON API that both calculate and tracks that functionality. [![Build Status](https://travis-ci.org/luiscape/hdx-monitor-org-stats.svg)](https://travis-ci.org/luiscape/hdx-monitor-org-stats) [![Coverage Status](https://coveralls.io/repos/luiscape/hdx-monitor-org-stats/badge.svg?branch=master&service=github)](https://coveralls.io/github/luiscape/hdx-monitor-org-stats?branch=master) ### Usage The API has the following working methods: * `/[ORGANIZATION_ID]` **GET**: Retrieves statistics about an organization in CKAN. * `/historic/[ORGANIZATION_ID]` **GET**: Retrieves a historic time-series about an organization in CKAN. Example request: ```shell $ curl -X GET localhost:2000/foo-bar ``` The output will then be: ```json { "success": true, "message": "Fetched organization information successfully.", "organization": "foo-bar", "result": { "users": { "total": 6, "admins": 4, "editors": 0, "members": 2, "details": { "admins": ["dabo", "djiguiba", "ouane", "sekou"], "editors": [], "members": ["guido", "olivieruzel"] } }, "datasets": { "total": 22, "views": { "total": 2657, "recent": 205, "mean": 121, "details": [ { "id": "236bcfcb-e05e-4b8b-8df0-e62d133828e5", "name": "Mali - Population Statistics 2013", "views": 21 }, ... ] }, "downloads": { "total": 608, "recent": 147, "mean": 28, "details": [ { "id": "236bcfcb-e05e-4b8b-8df0-e62d133828e5", "name": "Mali - Population Statistics 2013", "downloads": 0 }, ... ] } } } } ``` It is also possible to get a historic time-line by querying the `/historic` endpoint with an organization id. Here's an example: ```shell $ curl http://localhost:2000/historic/foo-bar ``` The response will be: ```json { "success": true, "message": "Successfully fetched historic organization records.", "organization": "foo-bar", "result": { "count": 3, "records": [{ "organization": "foo-bar", "date": "2015-09-28", "number_of_datasets": 1, "total_views": 1, "recent_views": 1, "mean_views": 1, "total_downloads": 1, "recent_downloads": 1, "mean_downloads": 1 }, { "organization": "foo-bar", "date": "2015-09-29", "number_of_datasets": 17, "total_views": 973, "recent_views": 62, "mean_views": 58, "total_downloads": 81, "recent_downloads": 42, "mean_downloads": 5 }, { "organization": "foo-bar", "date": "2015-09-30", "number_of_datasets": 17, "total_views": 975, "recent_views": 61, "mean_views": 58, "total_downloads": 81, "recent_downloads": 42, "mean_downloads": 5 }] } } ``` ### Docker Usage [![](https://badge.imagelayers.io/luiscape/hdx-monitor-org-stats:latest.svg)](https://imagelayers.io/?images=luiscape/hdx-monitor-org-stats:latest 'Get your own badge on imagelayers.io') Run the docker command below passing your CKAN API key as the environment variable `DEFAULT_API_KEY`. ```shell $ docker run -d --name org_stats \ -e DEFAULT_API_KEY=foo \ luiscape/hdx-monitor-org-stats:latest ``` ### Coding Standard [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
luiscape/hdx-monitor-org-stats
README.md
Markdown
mit
4,353
/* This is the default Tooltipster theme (feel free to modify or duplicate and create multiple themes!): */ .tooltipster-default { border-radius: 5px; /*border: 2px solid #000;*/ background: #4c4c4c; color: #fff; } /* Use this next selector to style things like font-size and line-height: */ .tooltipster-default .tooltipster-content { font-family: Arial, sans-serif; font-size: 14px; line-height: 16px; padding: 8px 10px; overflow: hidden; } /* This next selector defines the color of the border on the outside of the arrow. This will automatically match the color and size of the border set on the main tooltip styles. Set display: none; if you would like a border around the tooltip but no border around the arrow */ .tooltipster-default .tooltipster-arrow .tooltipster-arrow-border { /* border-color: ... !important; */ } /* If you're using the icon option, use this next selector to style them */ .tooltipster-icon { cursor: help; margin-left: 4px; } /* This is the base styling required to make all Tooltipsters work */ .tooltipster-base { padding: 0; font-size: 0; line-height: 0; position: absolute; left: 0; top: 0; z-index: 9999999; pointer-events: none; width: auto; overflow: visible; } .tooltipster-base .tooltipster-content { overflow: hidden; } /* These next classes handle the styles for the little arrow attached to the tooltip. By default, the arrow will inherit the same colors and border as what is set on the main tooltip itself. */ .tooltipster-arrow { display: block; text-align: center; width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: -1; } .tooltipster-arrow span, .tooltipster-arrow-border { display: block; width: 0; height: 0; position: absolute; } .tooltipster-arrow-top span, .tooltipster-arrow-top-right span, .tooltipster-arrow-top-left span { border-left: 8px solid transparent !important; border-right: 8px solid transparent !important; border-top: 8px solid; bottom: -7px; } .tooltipster-arrow-top .tooltipster-arrow-border, .tooltipster-arrow-top-right .tooltipster-arrow-border, .tooltipster-arrow-top-left .tooltipster-arrow-border { border-left: 9px solid transparent !important; border-right: 9px solid transparent !important; border-top: 9px solid; bottom: -7px; } .tooltipster-arrow-bottom span, .tooltipster-arrow-bottom-right span, .tooltipster-arrow-bottom-left span { border-left: 8px solid transparent !important; border-right: 8px solid transparent !important; border-bottom: 8px solid; top: -7px; } .tooltipster-arrow-bottom .tooltipster-arrow-border, .tooltipster-arrow-bottom-right .tooltipster-arrow-border, .tooltipster-arrow-bottom-left .tooltipster-arrow-border { border-left: 9px solid transparent !important; border-right: 9px solid transparent !important; border-bottom: 9px solid; top: -7px; } .tooltipster-arrow-top span, .tooltipster-arrow-top .tooltipster-arrow-border, .tooltipster-arrow-bottom span, .tooltipster-arrow-bottom .tooltipster-arrow-border { left: 0; right: 0; margin: 0 auto; } .tooltipster-arrow-top-left span, .tooltipster-arrow-bottom-left span { left: 6px; } .tooltipster-arrow-top-left .tooltipster-arrow-border, .tooltipster-arrow-bottom-left .tooltipster-arrow-border { left: 5px; } .tooltipster-arrow-top-right span, .tooltipster-arrow-bottom-right span { right: 6px; } .tooltipster-arrow-top-right .tooltipster-arrow-border, .tooltipster-arrow-bottom-right .tooltipster-arrow-border { right: 5px; } .tooltipster-arrow-left span, .tooltipster-arrow-left .tooltipster-arrow-border { border-top: 8px solid transparent !important; border-bottom: 8px solid transparent !important; border-left: 8px solid; top: 50%; margin-top: -7px; right: -7px; } .tooltipster-arrow-left .tooltipster-arrow-border { border-top: 9px solid transparent !important; border-bottom: 9px solid transparent !important; border-left: 9px solid; margin-top: -8px; } .tooltipster-arrow-right span, .tooltipster-arrow-right .tooltipster-arrow-border { border-top: 8px solid transparent !important; border-bottom: 8px solid transparent !important; border-right: 8px solid; top: 50%; margin-top: -7px; left: -7px; } .tooltipster-arrow-right .tooltipster-arrow-border { border-top: 9px solid transparent !important; border-bottom: 9px solid transparent !important; border-right: 9px solid; margin-top: -8px; } /* Some CSS magic for the awesome animations - feel free to make your own custom animations and reference it in your Tooltipster settings! */ .tooltipster-fade { opacity: 0; -webkit-transition-property: opacity; -moz-transition-property: opacity; -o-transition-property: opacity; -ms-transition-property: opacity; transition-property: opacity; } .tooltipster-fade-show { opacity: 1; } .tooltipster-grow { -webkit-transform: scale(0,0); -moz-transform: scale(0,0); -o-transform: scale(0,0); -ms-transform: scale(0,0); transform: scale(0,0); -webkit-transition-property: -webkit-transform; -moz-transition-property: -moz-transform; -o-transition-property: -o-transform; -ms-transition-property: -ms-transform; transition-property: transform; -webkit-backface-visibility: hidden; } .tooltipster-grow-show { -webkit-transform: scale(1,1); -moz-transform: scale(1,1); -o-transform: scale(1,1); -ms-transform: scale(1,1); transform: scale(1,1); -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); -moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); -ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); } .tooltipster-swing { opacity: 0; -webkit-transform: rotateZ(4deg); -moz-transform: rotateZ(4deg); -o-transform: rotateZ(4deg); -ms-transform: rotateZ(4deg); transform: rotateZ(4deg); -webkit-transition-property: -webkit-transform, opacity; -moz-transition-property: -moz-transform; -o-transition-property: -o-transform; -ms-transition-property: -ms-transform; transition-property: transform; } .tooltipster-swing-show { opacity: 1; -webkit-transform: rotateZ(0deg); -moz-transform: rotateZ(0deg); -o-transform: rotateZ(0deg); -ms-transform: rotateZ(0deg); transform: rotateZ(0deg); -webkit-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 1); -webkit-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4); -moz-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4); -ms-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4); -o-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4); transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4); } .tooltipster-fall { top: 0; -webkit-transition-property: top; -moz-transition-property: top; -o-transition-property: top; -ms-transition-property: top; transition-property: top; -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); -moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); -ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); } .tooltipster-fall-show { } .tooltipster-fall.tooltipster-dying { -webkit-transition-property: all; -moz-transition-property: all; -o-transition-property: all; -ms-transition-property: all; transition-property: all; top: 0px !important; opacity: 0; } .tooltipster-slide { left: -40px; -webkit-transition-property: left; -moz-transition-property: left; -o-transition-property: left; -ms-transition-property: left; transition-property: left; -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); -moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); -ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); } .tooltipster-slide.tooltipster-slide-show { } .tooltipster-slide.tooltipster-dying { -webkit-transition-property: all; -moz-transition-property: all; -o-transition-property: all; -ms-transition-property: all; transition-property: all; left: 0px !important; opacity: 0; } /* CSS transition for when contenting is changing in a tooltip that is still open. The only properties that will NOT transition are: width, height, top, and left */ .tooltipster-content-changing { opacity: 0.5; -webkit-transform: scale(1.1, 1.1); -moz-transform: scale(1.1, 1.1); -o-transform: scale(1.1, 1.1); -ms-transform: scale(1.1, 1.1); transform: scale(1.1, 1.1); }
GunnHacks/gunnhacks
css/tooltipster.css
CSS
mit
9,047
var test = require('tape'); var Collection = require('ampersand-collection'); var Model = require('ampersand-state'); var PaginatedSubcollection = require('../'); // our widget model var Widget = Model.extend({ props: { id: 'number', name: 'string', awesomeness: 'number', sweet: 'boolean' } }); // our base collection var Widgets = Collection.extend({ model: Widget, comparator: 'awesomeness' }); // helper for getting a base collection function getBaseCollection(items) { var widgets = new Widgets(); // add a hundred items to our base collection items = items || 100; while (items--) { widgets.add({ id: items, name: 'abcdefghij'.split('')[items % 10], awesomeness: (items % 10), sweet: (items % 2 === 0) }); } return widgets; } test('initial state', function (t) { var base = getBaseCollection(); var sub = new PaginatedSubcollection(base); t.equal(sub.page, 1, 'default initial page is 1'); t.equal(sub.pages, Math.ceil(sub.filtered.length / 50), 'default pages is ceil(filtered.length / 50), filtered.length: ' + sub.filtered.length); t.equal(sub.last, sub.pages, 'last page is equal to pages'); t.end(); });
aaronmccall/ampersand-paginated-subcollection
test/main.js
JavaScript
mit
1,282
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Unity Web Player | Ninja Wars</title> <script type='text/javascript' src='https://ssl-webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/jquery.min.js'></script> <script type="text/javascript"> <!-- var unityObjectUrl = "http://webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/UnityObject2.js"; if (document.location.protocol == 'https:') unityObjectUrl = unityObjectUrl.replace("http://", "https://ssl-"); document.write('<script type="text\/javascript" src="' + unityObjectUrl + '"><\/script>'); --> </script> <script type="text/javascript"> <!-- var config = { width: 960, height: 600, params: { enableDebugging:"0" } }; var u = new UnityObject2(config); jQuery(function() { var $missingScreen = jQuery("#unityPlayer").find(".missing"); var $brokenScreen = jQuery("#unityPlayer").find(".broken"); $missingScreen.hide(); $brokenScreen.hide(); u.observeProgress(function (progress) { switch(progress.pluginStatus) { case "broken": $brokenScreen.find("a").click(function (e) { e.stopPropagation(); e.preventDefault(); u.installPlugin(); return false; }); $brokenScreen.show(); break; case "missing": $missingScreen.find("a").click(function (e) { e.stopPropagation(); e.preventDefault(); u.installPlugin(); return false; }); $missingScreen.show(); break; case "installed": $missingScreen.remove(); break; case "first": break; } }); u.initPlugin(jQuery("#unityPlayer")[0], "NinjaWars.unity3d"); }); --> </script> <style type="text/css"> <!-- body { font-family: Helvetica, Verdana, Arial, sans-serif; background-color: white; color: black; text-align: center; } a:link, a:visited { color: #000; } a:active, a:hover { color: #666; } p.header { font-size: small; } p.header span { font-weight: bold; } p.footer { font-size: x-small; } div.content { margin: auto; width: 960px; } div.broken, div.missing { margin: auto; position: relative; top: 50%; width: 193px; } div.broken a, div.missing a { height: 63px; position: relative; top: -31px; } div.broken img, div.missing img { border-width: 0px; } div.broken { display: none; } div#unityPlayer { cursor: default; height: 600px; width: 960px; } --> </style> </head> <body> <p class="header"><span>Unity Web Player | </span>Ninja Wars</p> <div class="content"> <div id="unityPlayer"> <div class="missing"> <a href="http://unity3d.com/webplayer/" title="Unity Web Player. Install now!"> <img alt="Unity Web Player. Install now!" src="http://webplayer.unity3d.com/installation/getunity.png" width="193" height="63" /> </a> </div> <div class="broken"> <a href="http://unity3d.com/webplayer/" title="Unity Web Player. Install now! Restart your browser after install."> <img alt="Unity Web Player. Install now! Restart your browser after install." src="http://webplayer.unity3d.com/installation/getunityrestart.png" width="193" height="63" /> </a> </div> </div> </div> <p class="footer">&laquo; created with <a href="http://unity3d.com/unity/" title="Go to unity3d.com">Unity</a> &raquo;</p> </body> </html>
Ghully007/ghully007.github.io
NinjaWars/NinjaWars.html
HTML
mit
3,654
// Modules var privateData = require('./private.js'); var ping = require('ping'); var postJson = require('post-json'); var moment = require('moment'); var humanizeDuration = require('humanize-duration'); var shortEnglishHumanizer = humanizeDuration.humanizer({ language: 'shortEn', languages: { shortEn: { y: function () { return 'y'; }, mo: function () { return 'mo'; }, w: function () { return 'w'; }, d: function () { return 'd'; }, h: function () { return 'h'; }, m: function () { return 'm'; }, s: function () { return 's'; }, ms: function () { return 'ms'; } } }, delimiter: ' ', round: true, spacer: '', units: ['y', 'mo', 'w', 'd', 'h', 'm'] }); // Variables var host = privateData.server; var webhook = { 'url': privateData.url, // Webhook URL 'body': {} // POST body for webhook }; var dateSystemStatus = +moment(); var loopCount = 0; var mark = dateSystemStatus; // Set initial moment for getting diffs var markPrecise = process.hrtime(); var offset; var offsetPrecise; var offsetReadable; var status = false; // Set initial server 'reachable' status to false/offline // Execute isDown(); // Initiate with the assumption that the device is offline; causes first webhook event to be about device being online // Functions function isDown () { // Loop until connection succeeds, then switch to isUp ping.sys.probe(host, function (isAlive) { // Ping host if (isAlive) { loopCount++; if (loopCount > 1) { // Double-check before taking action timeOffset(); webhook.body.value1 = 'Modem is back online'; // Change value of the first key in the webhook JSON body object webhook.body.value2 = 'Downtime was ' + offsetReadable; // Change value of the second key in the webhook JSON body object logChange(); isUp(); } else { isDown(); } } else { logStatus(); setTimeout(isDown, (30 * 1000)); // Run isDown in 30s } }); } function isUp () { // Loop until connection fails, then switch to isDown ping.sys.probe(host, function (isAlive) { // Ping host if (isAlive) { logStatus(); setTimeout(isUp, (30 * 1000)); // Run isUp in 30s } else { loopCount++; if (loopCount > 1) { // Double-check before taking action timeOffset(); webhook.body.value1 = 'Modem is not responding'; // Change value of the first key in the webhook JSON body object webhook.body.value2 = 'Uptime was ' + offsetReadable; // Change value of the second key in the webhook JSON body object logChange(); isDown(); } else { isUp(); } } }); } function logChange () { mark = +moment(); // Reset moment for getting diffs markPrecise = process.hrtime(); status = !status; // Toggle server 'reachable' status var msg = { 'dateFull': moment(mark).format(), 'dateUnix': mark, 'diffClock': offset, 'diffPrecise': offsetPrecise, 'diffReadable': offsetReadable // 'host': host }; if (status) { msg.reachable = true; } else { msg.reachable = false; } console.error(JSON.stringify(msg) + ','); // Log status change webhook.body.value3 = moment(+moment() - 21600000).format('D MMM HH:mm') + ' CST'; // Change value of the third key in the webhook JSON body object postJson(webhook.url, webhook.body, function (err, result) { // Trigger webhook if (err) { console.error(err); } }); loopCount = 0; } function logStatus () { var timeStamp = +moment(); if (timeStamp > (dateSystemStatus + 86400000)) { // Greater than at least 24 hours dateSystemStatus = timeStamp; var msg = { 'dateFull': moment(timeStamp).format() // 'dateUnix': +moment(timeStamp), // 'host': host }; if (status) { msg.reachable = true; } else { msg.reachable = false; } console.log(JSON.stringify(msg) + ','); } loopCount = 0; } function timeOffset () { offset = moment().diff(moment(mark)); offsetPrecise = process.hrtime(markPrecise); offsetReadable = shortEnglishHumanizer(offset); // Round to nearest minute and display with units }
jsejcksn/ping-test
server.js
JavaScript
mit
4,174
/*jshint expr:true */ 'use strict'; const Crawler = require('../lib/crawler'); const expect = require('chai').expect; describe('Errors', function () { afterEach(function () { }); describe('timeout', function () { const crawler = new Crawler({ timeout: 3000, retryTimeout: 1000, retries: 2, jquery: false, http2: true }); it('should retry after timeout', function(finishTest) { let options = { uri: 'https://nghttp2.org/httpbin/delay/4', callback: (error, response, done) => { expect(error).to.exist; expect(response.options.retries).to.equal(0); done(); finishTest(); } }; crawler.queue(options); expect(options.retries).to.equal(2); }); it('should return a timeout error after ~9sec', function(finishTest) { crawler.queue({ uri: 'https://nghttp2.org/httpbin/delay/4', callback: (error, response, done) => { expect(error).to.exist; expect(error.code === 'ETIMEDOUT' || error.code === 'ESOCKETTIMEDOUT').to.be.true; done(); finishTest(); } }); }); }); describe('error status code', function () { const crawler = new Crawler({ retryTimeout: 1000, retries: 2, jquery: false, http2: true }); it('should not return an error on status code 400 (Bad Request)', function(finishTest) { crawler.queue({ uri: 'http://nghttp2.org/httpbin/status/400', callback: (error, response, done) => { expect(error).to.be.null; expect(response.statusCode).to.equal(400); done(); finishTest(); } }); }); it('should not return an error on status code 401 (Unauthorized)', function(finishTest) { crawler.queue({ uri: 'http://nghttp2.org/httpbin/status/401', callback: (error, response, done) => { expect(error).to.be.null; expect(response.statusCode).to.equal(401); done(); finishTest(); } }); }); it('should not return an error on status code 403 (Forbidden)', function(finishTest) { crawler.queue({ uri: 'http://nghttp2.org/httpbin/status/403', callback: (error, response, done) => { expect(error).to.be.null; expect(response.statusCode).to.equal(403); done(); finishTest(); } }); }); it('should not return an error on a 404', function(finishTest) { crawler.queue({ uri : 'http://nghttp2.org/httpbin/status/404', callback : (error, response, done) => { expect(error).to.be.null; expect(response.statusCode).to.equal(404); done(); finishTest(); } }); }); it('should not return an error on a 500', function(finishTest) { crawler.queue({ uri : 'http://nghttp2.org/httpbin/status/500', callback : (error, response, done) => { expect(error).to.be.null; expect(response.statusCode).to.equal(500); done(); finishTest(); } }); }); it('should not failed on empty response', function(finishTest) { crawler.queue({ uri : 'http://nghttp2.org/httpbin/status/200', callback : (error, response, done) => { expect(error).to.be.null; done(); finishTest(); } }); }); }); });
bda-research/node-crawler
tests/http2errorHandling.test.js
JavaScript
mit
3,142
const logger = require('./../logger/logger'); const config = { dbUri: 'mongodb://localhost:27017/fn_en_170', logger: logger.info, frameNetDir: '/Users/AKB/Dropbox/FrameNetData/fndata-1.7', splitsDir: '/Users/AKB/Dropbox/FrameNetData/fndata-1.7', importLexUnits: true, importFullTexts: true, importHierarchy: true, frameChunkSize: 150, lexUnitChunkSize: 200, }; module.exports = config;
akb89/noframenet
config/production.js
JavaScript
mit
406
<?php class UserDetails { // Constant Declaration // -------------------- const sADDRESS_NOT_AVAILABLE = "Address not available"; // Private Declarations // -------------------- private $_objConnection; private $_userId; private $_firstName; private $_lastName; private $_gender; private $_dateOfBirth; private $_address; private $_city; private $_province; private $_nationality; private $_phoneNumber; private $_lastTrip; private $_nextTrip; private $_favouritePlaces; private $_joinedOn; private $_imageSrc; // Constructor // ----------- public function __construct($objConnection, $userId) { $this->_objConnection = $objConnection; $this->_userId = $userId; } // Public Properties // ----------------- /** * @return mixed */ public function getFirstName() { return $this->_firstName; } /** * @param mixed $firstName */ public function setFirstName($firstName) { if(Fanta_Valid::isNullOrEmpty($firstName)) { $this->_firstName = null; } else { $this->_firstName = $firstName; } } /** * @return mixed */ public function getLastName() { return $this->_lastName; } /** * @param mixed $lastName */ public function setLastName($lastName) { if(Fanta_Valid::isNullOrEmpty($lastName)) { $this->_lastName = null; } else { $this->_lastName = $lastName; } } /** * @return mixed */ public function getGender() { return $this->_gender; } /** * @param mixed $gender */ public function setGender($gender) { if(Fanta_Valid::isNullOrEmpty($gender)) { $this->_gender = null; } else { $this->_gender = $gender; } } /** * @return mixed */ public function getDateOfBirth() { return $this->_dateOfBirth; } /** * @param mixed $dateOfBirth */ public function setDateOfBirth($dateOfBirth) { if(Fanta_Valid::isNullOrEmpty($dateOfBirth)) { $this->_dateOfBirth = null; } else { $this->_dateOfBirth = $dateOfBirth; } } /** * @return mixed */ public function getAddress() { if(Fanta_Valid::isNullOrEmpty($this->_address)) { return self::sADDRESS_NOT_AVAILABLE; } else { return $this->_address; } } /** * @param mixed $address */ public function setAddress($address) { if(Fanta_Valid::isNullOrEmpty($address)) { $this->_address = null; } else { $this->_address = $address; } } /** * @return mixed */ public function getCity() { return $this->_city; } /** * @param mixed $city */ public function setCity($city) { if(Fanta_Valid::isNullOrEmpty($city)) { $this->_city = null; } else { $this->_city = $city; } } /** * @return mixed */ public function getProvince() { return $this->_province; } /** * @param mixed $province */ public function setProvince($province) { if(Fanta_Valid::isNullOrEmpty($province)) { $this->_province = null; } else { $this->_province = $province; } } /** * @return mixed */ public function getNationality() { return $this->_nationality; } /** * @param mixed $nationality */ public function setNationality($nationality) { if(Fanta_Valid::isNullOrEmpty($nationality)) { $this->_nationality = null; } else { $this->_nationality = $nationality; } } /** * @return mixed */ public function getPhoneNumber() { return $this->_phoneNumber; } /** * @param mixed $phoneNumber */ public function setPhoneNumber($phoneNumber) { if(Fanta_Valid::isNullOrEmpty($phoneNumber)) { $this->_phoneNumber = null; } else { $this->_phoneNumber = $phoneNumber; } } /** * @return mixed */ public function getLastTrip() { return $this->_lastTrip; } /** * @param mixed $lastTrip */ public function setLastTrip($lastTrip) { if(Fanta_Valid::isNullOrEmpty($lastTrip)) { $this->_lastTrip = null; } else { $this->_lastTrip = $lastTrip; } } /** * @return mixed */ public function getNextTrip() { return $this->_nextTrip; } /** * @param mixed $nextTrip */ public function setNextTrip($nextTrip) { if(Fanta_Valid::isNullOrEmpty($nextTrip)) { $this->_nextTrip = null; } else { $this->_nextTrip = $nextTrip; } } /** * @return mixed */ public function getFavouritePlaces() { return $this->_favouritePlaces; } /** * @param mixed $favouritePlaces */ public function setFavouritePlaces($favouritePlaces) { if(Fanta_Valid::isNullOrEmpty($favouritePlaces)) { $this->_favouritePlaces = null; } else { $this->_favouritePlaces = $favouritePlaces; } } /** * @return mixed */ public function getJoinedOn() { $dJoinedDate = strtotime($this->_joinedOn); return 'Joined on ' . date('M d, Y', $dJoinedDate); } /** * @return mixed */ public function getImageSrc() { return $this->_imageSrc; } /** * @param mixed $imageSrc */ public function setImageSrc($imageSrc) { $this->_imageSrc = $imageSrc; } // Public Functions Declaration // ---------------------------- /** * Function to read a user's profile details and fill object's property values * * @return int * * author: Irfaan */ public function Read() { $iRowRetrieved = 0; try { // Query database to fetch user's details $sQueryReadDetails = " SELECT user_details.* FROM user_details WHERE user_details.user_id = :user_id; "; $objPDOStmt = $this->_objConnection->prepare($sQueryReadDetails); $objPDOStmt->bindValue(':user_id', $this->_userId); $iRowRetrieved = $objPDOStmt->execute(); $userDetails = $objPDOStmt->fetch(PDO::FETCH_OBJ); // Fill in the property values $this->_firstName = $userDetails->first_name; $this->_lastName = $userDetails->last_name; $this->_gender = $userDetails->gender; $this->_dateOfBirth = $userDetails->date_of_birth; $this->_address = $userDetails->address; $this->_city = $userDetails->city; $this->_province = $userDetails->province; $this->_nationality = $userDetails->nationality; $this->_phoneNumber = $userDetails->phone_number; $this->_lastTrip = $userDetails->last_trip; $this->_nextTrip = $userDetails->next_trip; $this->_favouritePlaces = $userDetails->favourite_places; $this->_joinedOn = $userDetails->joined_on; $this->_imageSrc = $userDetails->image_src; } catch(Exception $e) { // Unable to fetch user details } return $iRowRetrieved; } /** * Function to update a user's profile details * * @return int * * author: Irfaan */ public function Update() { $iRowUpdated = 0; $dateArray = null; $sqlDate = null; try { // Format date to SQL format $dateArray = explode('/', $this->_dateOfBirth); if(count($dateArray) === 3) { $sqlDate = $dateArray[2].'-'.$dateArray[0].'-'.$dateArray[1]; } else { $sqlDate = $this->_dateOfBirth; } $sQueryUpdateDetails = " UPDATE user_details SET first_name = :fname , last_name = :lname , gender = :gender , date_of_birth = :dob , address = :address , city = :city , province = :province , nationality = :nationality , phone_number = :phonenum , last_trip = :ltrip , next_trip = :ntrip , favourite_places = :favplaces WHERE user_id = :userid "; $objPDOStmt = $this->_objConnection->prepare($sQueryUpdateDetails); $objPDOStmt->bindValue(':fname', $this->_firstName); $objPDOStmt->bindValue(':lname', $this->_lastName); $objPDOStmt->bindValue(':gender', $this->_gender); $objPDOStmt->bindValue(':dob', $sqlDate); $objPDOStmt->bindValue(':address', ($this->_address == self::sADDRESS_NOT_AVAILABLE)? null : $this->_address); $objPDOStmt->bindValue(':city', $this->_city); $objPDOStmt->bindValue(':province', $this->_province); $objPDOStmt->bindValue(':nationality', $this->_nationality); $objPDOStmt->bindValue(':phonenum', $this->_phoneNumber); $objPDOStmt->bindValue(':ltrip', $this->_lastTrip); $objPDOStmt->bindValue(':ntrip', $this->_nextTrip); $objPDOStmt->bindValue(':favplaces', $this->_favouritePlaces); $objPDOStmt->bindValue(':userid', $this->_userId); $iRowUpdated = $objPDOStmt->execute(); } catch(Exception $e) { // Unable to update details } return $iRowUpdated; } /** * Function that returns the correct profile picture URL * * @return string * * author: Irfaan */ public function getProfilePictureURL() { //if img src is from google+ if (substr($this->_imageSrc, 0, 4) == 'http') { return $this->_imageSrc; } //if img is from local folder else { return "../static/img/profile/users/" . $this->_imageSrc; } } /** * Function that returns the full name of the user * * @return string * * author: Irfaan */ public function getFullName() { return ucwords($this->getFirstName() . ' ' . $this->getLastName()); } /** * Function that deletes the user's account details * * author: Irfaan */ public function deleteUserAccount() { $sDeleteQuery = "DELETE FROM user_details WHERE user_id = :userId"; $objPDOStmt = $this->_objConnection->prepare($sDeleteQuery); $objPDOStmt->bindValue(':userId', $this->_userId, PDO::PARAM_INT); $objPDOStmt->execute(); } }
byn9826/canada-parks
lib/profile/UserDetails.php
PHP
mit
11,820
package iso20022 // Provides more details on the response such as the response type, the collateral identification, and optionally further details in case of rejection. type OtherCollateralResponse1 struct { // Specifies the status of the collateral proposal. ResponseType *Status4Code `xml:"RspnTp"` // Provides the identification of the proposed collateral. CollateralIdentification *Max35Text `xml:"CollId,omitempty"` // Identifies the register number of the collateral deposit assigned by the central counterparty. AssetNumber *Max35Text `xml:"AsstNb,omitempty"` // Specifies the reason why the instruction/cancellation request has a rejected status. RejectionReason *RejectionReasonV021Code `xml:"RjctnRsn,omitempty"` // Additional information regarding why the collateral proposal has a rejected status. RejectionInformation *Max35Text `xml:"RjctnInf,omitempty"` } func (o *OtherCollateralResponse1) SetResponseType(value string) { o.ResponseType = (*Status4Code)(&value) } func (o *OtherCollateralResponse1) SetCollateralIdentification(value string) { o.CollateralIdentification = (*Max35Text)(&value) } func (o *OtherCollateralResponse1) SetAssetNumber(value string) { o.AssetNumber = (*Max35Text)(&value) } func (o *OtherCollateralResponse1) SetRejectionReason(value string) { o.RejectionReason = (*RejectionReasonV021Code)(&value) } func (o *OtherCollateralResponse1) SetRejectionInformation(value string) { o.RejectionInformation = (*Max35Text)(&value) }
fgrid/iso20022
OtherCollateralResponse1.go
GO
mit
1,492
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>persistent-union-find: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.15.0 / persistent-union-find - 8.10.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> persistent-union-find <small> 8.10.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-03-09 10:04:44 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-03-09 10:04:44 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-gmp 4 Virtual package relying on a GMP lib system installation coq 8.15.0 Formal proof management system dune 3.0.3 Fast, portable, and opinionated build system ocaml 4.09.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.09.1 Official release 4.09.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.3 A library manager for OCaml zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;http://www.lri.fr/~filliatr/puf/&quot; license: &quot;Unknown&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/PersistentUnionFind&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.10&quot; &amp; &lt; &quot;8.11~&quot;} ] tags: [ &quot;keyword: program verification&quot; &quot;keyword: union-find&quot; &quot;keyword: data structures&quot; &quot;keyword: Tarjan&quot; &quot;category: Computer Science/Decision Procedures and Certified Algorithms/Correctness proofs of algorithms&quot; ] authors: [ &quot;Jean-Christophe Filliâtre&quot; ] bug-reports: &quot;https://github.com/coq-contribs/persistent-union-find/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/persistent-union-find.git&quot; synopsis: &quot;Persistent Union Find&quot; description: &quot;&quot;&quot; Correctness proof of the Ocaml implementation of a persistent union-find data structure. See http://www.lri.fr/~filliatr/puf/ for more details.&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/persistent-union-find/archive/v8.10.0.tar.gz&quot; checksum: &quot;md5=9d860c3649cb724e3f5e513d1b1ff60b&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-persistent-union-find.8.10.0 coq.8.15.0</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.15.0). The following dependencies couldn&#39;t be met: - coq-persistent-union-find -&gt; coq &lt; 8.11~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-persistent-union-find.8.10.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.09.1-2.0.6/released/8.15.0/persistent-union-find/8.10.0.html
HTML
mit
7,261
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define(factory); else if(typeof exports === 'object') exports["Phlux"] = factory(); else root["Phlux"] = factory(); })(this, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; var Store = exports.Store = (function () { function Store() { _classCallCheck(this, Store); this.currentAction = null; this.currentActionHandled = false; this.listeners = {}; this.currentListenId = 0; } _prototypeProperties(Store, null, { register: { value: function register(dispatcher) { var _this = this; this.dispatcher = dispatcher; this.id = dispatcher.register(this, function (action, payload) { return _this.matchAction(action, payload); }); return this; }, writable: true, configurable: true }, isHandled: { value: function isHandled() { return this.currentActionHandled === true; }, writable: true, configurable: true }, unhandled: { value: function unhandled() { this.currentActionHandled = false; }, writable: true, configurable: true }, handled: { value: function handled() { this.currentActionHandled = true; }, writable: true, configurable: true }, matchAction: { value: function matchAction(action, payload) { if (this.isHandled()) { return; } this.currentAction = action; var func = this["handle" + action.replace(/(?:^|[:\-_])(\w)/g, function (i, c) { return c ? c.toUpperCase() : ""; })]; if (func) { func.bind(this)(payload); } this.currentAction = null; }, writable: true, configurable: true }, await: { value: function await(stores) { this.dispatcher.await(stores.map(function (s) { return s.id; })); }, writable: true, configurable: true }, dispatch: { value: function dispatch(action, payload) { this.dispatcher.dispatch(action, payload); }, writable: true, configurable: true }, isPending: { value: function isPending() { return this.currentAction !== null; }, writable: true, configurable: true }, on: { value: function on(ev, context, callback) { if (!context.__listenId) { context.__listenId = (this.currentListenId += 1).toString(); } if (!this.listeners[ev]) { this.listeners[ev] = []; } this.listeners[ev].push({ callback: callback, id: context.__listenId }); }, writable: true, configurable: true }, off: { value: function off(ev, context) { this.listeners[ev] = this.listeners[ev].filter(function (_ref) { var cb = _ref.cb; var id = _ref.id; return id != context.__listenId; }); }, writable: true, configurable: true }, emit: { value: function emit(ev) { (this.listeners[ev] || []).forEach(function (_ref) { var callback = _ref.callback; var id = _ref.id; return callback(); }); }, writable: true, configurable: true } }); return Store; })(); var Dispatcher = exports.Dispatcher = (function () { function Dispatcher() { _classCallCheck(this, Dispatcher); this.registrations = {}; this.currentId = 0; this.dispatching = false; this.dispatchBuffer = []; this.currentAction = { type: null, payload: null }; } _prototypeProperties(Dispatcher, null, { nextId: { value: function nextId() { return (this.currentId += 1).toString(); }, writable: true, configurable: true }, isDispatching: { value: function isDispatching() { return this.dispatching === true; }, writable: true, configurable: true }, register: { value: function register(store, callback) { var id = this.nextId(); this.registrations[id] = { store: store, callback: callback }; return id; }, writable: true, configurable: true }, unregister: { value: function unregister(id) { if (this.registrations[id]) { delete this.registrations[id]; return true; } else { throw Error("No registration found for id \"" + id + "\""); } }, writable: true, configurable: true }, dispatch: { value: function dispatch(actionType, payload) { var action = { type: actionType, payload: payload }; if (this.isDispatching()) { return this.dispatchBuffer.push(action); } this.dispatching = true; this.currentAction = action; try { for (var id in this.registrations) { this.registrations[id].store.unhandled(); } for (var id in this.registrations) { var _registrations$id = this.registrations[id]; var store = _registrations$id.store; var callback = _registrations$id.callback; this.invoke(store, callback, actionType, payload); } } finally { this.dispatching = false; var _action = this.dispatchBuffer.pop(); if (_action) { this.dispatch(_action.type, _action.payload); } } }, writable: true, configurable: true }, invoke: { value: function invoke(store, callback, actionType, payload) { callback(actionType, payload); store.handled(); }, writable: true, configurable: true }, await: { value: function await(ids) { var _this = this; var _currentAction = this.currentAction; var type = _currentAction.type; var payload = _currentAction.payload; ids.forEach(function (id) { var reg = _this.registrations[id]; if (!reg) { throw Error("No registration found for id \"" + id + "\""); } var store = reg.store; var callback = reg.callback; if (store.isPending()) { throw Error("circular dependency detected while awaiting \"" + id + "\""); } if (!store.isHandled()) { _this.invoke(store, callback, type, payload); } }); }, writable: true, configurable: true } }); return Dispatcher; })(); if (typeof window === "object") { window.Phlux = exports; } Object.defineProperty(exports, "__esModule", { value: true }); /***/ } /******/ ]) });
chrismccord/phlux
dist/phlux.js
JavaScript
mit
8,986
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strdel.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: afillion <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2015/11/29 17:10:38 by afillion #+# #+# */ /* Updated: 2015/12/03 13:27:32 by afillion ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" void ft_strdel(char **as) { if (as == NULL || *as == NULL) return ; ft_memdel((void**)as); }
afillion/libft
ft_strdel.c
C
mit
1,009
<aside class="logo"> {% if page.url == '/index.html' or page.url == '/' %} {% assign link = site.author_github %} {% assign prompt = 'Я на github' %} {% else %} {% assign link = '/' %} {% assign prompt = 'На Главную' %} {% endif %} <a href="{{ link | prepend: site.baseurl }}"> <img src="{{ site.baseurl }}/assets/avatar.png" class="gravatar"> </a> <span class="logo-prompt">{{ prompt }}</span> </aside>
FreeCX/freecx.github.io
_includes/header.html
HTML
mit
433
using System; namespace Passed { public class Startup { public static void Main() { var grade = double.Parse(Console.ReadLine()); if (3.00 <= grade) { Console.WriteLine("Passed!"); } } } }
BlueDress/School
Programming Fundamentals C#/Conditional Statements and Loops/Passed/Startup.cs
C#
mit
294
--- layout: page title: Rain Sail Logistics Award Ceremony date: 2016-05-24 author: Lori Kent tags: weekly links, java status: published summary: Etiam tincidunt aliquam nisl, semper faucibus leo iaculis sed. Lorem. banner: images/banner/office-01.jpg booking: startDate: 01/13/2018 endDate: 01/17/2018 ctyhocn: NUQCAHX groupCode: RSLAC published: true --- Proin varius est eu commodo facilisis. Donec quis feugiat risus. Suspendisse tincidunt dui vel diam fringilla pulvinar. Ut in nisi tellus. Nunc non faucibus elit. In aliquam urna vitae ex suscipit, in aliquet lorem posuere. Nunc molestie rhoncus mi, at efficitur turpis. Aenean ut erat turpis. Morbi tincidunt magna velit. Pellentesque venenatis ligula at orci mollis aliquet. Aliquam sit amet dui aliquam, lobortis sem tempus, cursus elit. Morbi mattis elementum massa non laoreet. Suspendisse sagittis urna augue, a euismod dui vulputate vel. Ut feugiat turpis vel quam fringilla rhoncus. Maecenas ipsum ante, bibendum at dolor eu, sagittis ultrices ante. Sed eleifend eros odio, vitae tincidunt magna tempus ut. Ut nec elit non elit cursus volutpat vel vel orci. Sed consectetur est lorem, sit amet ultrices elit porta vel. Suspendisse hendrerit tincidunt varius. Donec eleifend pulvinar libero, ut lobortis magna faucibus sit amet. Nulla id nisl ligula. Ut eget sagittis purus. Morbi auctor id mauris id vehicula. In viverra nulla et urna tincidunt consequat. In ante urna, facilisis sed est non, euismod auctor tellus. * Curabitur a neque sit amet mi convallis lacinia * Fusce ac sapien aliquet augue tempor ultricies * Mauris ultrices sapien vitae nisi feugiat bibendum * Nullam quis neque luctus, sagittis ex egestas, ultricies ligula * Ut vel purus ut quam pretium congue et a lacus. Sed finibus justo nisi. Suspendisse feugiat ut ipsum nec pulvinar. Etiam vestibulum ipsum libero, sed rutrum nisl cursus vel. Donec a pulvinar ligula. Quisque egestas libero quis bibendum ornare. Duis suscipit et magna ornare accumsan. Aenean dignissim leo sapien, id venenatis nunc posuere eu. Pellentesque egestas nisi tellus, at sodales nunc egestas at. Donec vestibulum lobortis dignissim. Donec quis lectus in tellus vehicula faucibus. Integer odio dui, sagittis porta mattis quis, ultrices ut metus. Curabitur ac metus sed mauris imperdiet lobortis. Maecenas vitae auctor justo. In sagittis quam risus. Aliquam dictum maximus tellus, et venenatis felis tempor sit amet.
KlishGroup/prose-pogs
pogs/N/NUQCAHX/RSLAC/index.md
Markdown
mit
2,435