hexsha
stringlengths
40
40
size
int64
5
1.05M
ext
stringclasses
98 values
lang
stringclasses
21 values
max_stars_repo_path
stringlengths
3
945
max_stars_repo_name
stringlengths
4
118
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
368k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
945
max_issues_repo_name
stringlengths
4
118
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
134k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
945
max_forks_repo_name
stringlengths
4
135
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
5
1.05M
avg_line_length
float64
1
1.03M
max_line_length
int64
2
1.03M
alphanum_fraction
float64
0
1
c2bdd3ff142d7473bc243d41c9b3a2775acf536b
35
c
C
backend/m2c/tests/end_to_end/hi-offsets-type-info/manual-out.c
ChrisNonyminus/decomp.me
b51e8d586ba95bd20f6b2e5881ecc34459e761bc
[ "MIT" ]
47
2021-11-05T14:20:58.000Z
2022-03-19T18:56:46.000Z
backend/m2c/tests/end_to_end/hi-offsets-type-info/manual-out.c
ChrisNonyminus/decomp.me
b51e8d586ba95bd20f6b2e5881ecc34459e761bc
[ "MIT" ]
131
2021-10-20T09:17:16.000Z
2022-03-31T22:22:54.000Z
backend/m2c/tests/end_to_end/hi-offsets-type-info/manual-out.c
ChrisNonyminus/decomp.me
b51e8d586ba95bd20f6b2e5881ecc34459e761bc
[ "MIT" ]
20
2021-11-23T18:49:45.000Z
2022-03-29T06:25:10.000Z
s32 test(void) { return a.b; }
8.75
16
0.542857
f045d86d216c12997fdeba7ede1459e7c2fe52ad
1,389
sql
SQL
models/intermediate/int_iterable__recurring_campaigns.sql
fivetran/dbt_iterable
1f4f5ce7edf93fc9c9ff9ce2ba2585e5dd892551
[ "Apache-2.0" ]
null
null
null
models/intermediate/int_iterable__recurring_campaigns.sql
fivetran/dbt_iterable
1f4f5ce7edf93fc9c9ff9ce2ba2585e5dd892551
[ "Apache-2.0" ]
6
2021-07-01T01:36:16.000Z
2022-01-10T20:22:17.000Z
models/intermediate/int_iterable__recurring_campaigns.sql
fivetran/dbt_iterable
1f4f5ce7edf93fc9c9ff9ce2ba2585e5dd892551
[ "Apache-2.0" ]
1
2021-06-28T09:34:30.000Z
2021-06-28T09:34:30.000Z
with latest_campaign as ( select * from {{ ref('int_iterable__latest_campaign') }} ), recurring_campaign_join as ( select latest_campaign.campaign_id, latest_campaign.campaign_name, latest_campaign.updated_at, latest_campaign.campaign_state, latest_campaign.campaign_type, latest_campaign.send_size, latest_campaign.start_at, latest_campaign.ended_at, latest_campaign.created_at, latest_campaign.created_by_user_id, latest_campaign.template_id, latest_campaign.recurring_campaign_id, recurring_campaign.campaign_name as recurring_campaign_name, recurring_campaign.campaign_state as recurring_campaign_state, recurring_campaign.send_size as recurring_campaign_send_size, recurring_campaign.start_at as recurring_campaign_start_at from latest_campaign left join latest_campaign as recurring_campaign on latest_campaign.recurring_campaign_id = recurring_campaign.campaign_id ), final as ( select recurring_campaign_join.*, case when latest_campaign.recurring_campaign_id is not null then true else false end as is_campaign_recurring from recurring_campaign_join left join latest_campaign on recurring_campaign_join.campaign_id = latest_campaign.recurring_campaign_id ) select * from final
32.302326
108
0.75162
bc9db8892cfddbc26b12298e4c2ef3348d3a3246
352
lua
Lua
MMOCoreORB/bin/scripts/object/custom_content/static/worldbuilding/structures/mun_nboo_building_chunk_destoyed_07.lua
V-Fib/FlurryClone
40e0ca7245ec31b3815eb6459329fd9e70f88936
[ "Zlib", "OpenSSL" ]
18
2017-02-09T15:36:05.000Z
2021-12-21T04:22:15.000Z
MMOCoreORB/bin/scripts/object/custom_content/static/worldbuilding/structures/mun_nboo_building_chunk_destoyed_07.lua
V-Fib/FlurryClone
40e0ca7245ec31b3815eb6459329fd9e70f88936
[ "Zlib", "OpenSSL" ]
61
2016-12-30T21:51:10.000Z
2021-12-10T20:25:56.000Z
MMOCoreORB/bin/scripts/object/custom_content/static/worldbuilding/structures/mun_nboo_building_chunk_destoyed_07.lua
V-Fib/FlurryClone
40e0ca7245ec31b3815eb6459329fd9e70f88936
[ "Zlib", "OpenSSL" ]
71
2017-01-01T05:34:38.000Z
2022-03-29T01:04:00.000Z
object_static_worldbuilding_structures_mun_nboo_building_chunk_destoyed_07 = object_static_worldbuilding_structures_shared_mun_nboo_building_chunk_destoyed_07:new { } ObjectTemplates:addTemplate(object_static_worldbuilding_structures_mun_nboo_building_chunk_destoyed_07, "object/static/worldbuilding/structures/mun_nboo_building_chunk_destoyed_07.iff")
117.333333
185
0.940341
3f0ebe793088ca919aa9883528df1d5958cf53f2
2,122
php
PHP
Modules/Product/Resources/views/attributes/attributes_list.blade.php
uzzwalbadal/laravelecommerce-amazcart-
d83a5f93b5b9edb4808e976c6ffc951746615a82
[ "MIT" ]
null
null
null
Modules/Product/Resources/views/attributes/attributes_list.blade.php
uzzwalbadal/laravelecommerce-amazcart-
d83a5f93b5b9edb4808e976c6ffc951746615a82
[ "MIT" ]
null
null
null
Modules/Product/Resources/views/attributes/attributes_list.blade.php
uzzwalbadal/laravelecommerce-amazcart-
d83a5f93b5b9edb4808e976c6ffc951746615a82
[ "MIT" ]
null
null
null
<table class="table Crm_table_active3"> <thead> <tr> <th scope="col">{{__('common.sl')}}</th> <th scope="col">{{__('product.attribute_name')}}</th> <th scope="col" width="60%">{{__('common.description')}}</th> <th scope="col">{{__('common.status')}}</th> <th scope="col">{{__('common.action')}}</th> </tr> </thead> <tbody> @foreach($attributes as $key => $variant_value) <tr> <th>{{ $key+1 }}</th> <td>{{ $variant_value->name }}</td> <td>{{ $variant_value->description }}</td> <td> @if($variant_value->status === 1) <span class="badge_1">{{__("common.active")}}</span> @else <span class="badge_4">{{__("common.inactive")}}</span> @endif </td> <td> <!-- shortby --> <div class="dropdown CRM_dropdown"> <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> {{__('common.select')}} </button> <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenu2"> <a data-id="{{$variant_value->id}}" class="dropdown-item show_attribute">{{__('common.view')}}</a> @if (permissionCheck('product.attribute.edit')) <a class="dropdown-item edit_variant" data-value="{{$variant_value->id}}" type="button">{{__('common.edit')}}</a> @endif @if (permissionCheck('product.attribute.destroy')) <a class="dropdown-item delete_attribute" data-value="{{route('product.attribute.destroy', $variant_value->id)}}">{{__('common.delete')}}</a> @endif </div> </div> <!-- shortby --> </td> </tr> @endforeach </tbody> </table>
43.306122
170
0.472196
da6d6217a93d132b81c4ae5b12d6a84b5416a08f
5,882
rb
Ruby
lib/ruby_aem/resources/certificate.rb
shinesolutions/ruby_aem
35b721fdeb6aa90176cd4e9c1210ce1d77317dbb
[ "Apache-2.0" ]
10
2016-10-02T06:44:57.000Z
2019-07-06T17:20:20.000Z
lib/ruby_aem/resources/certificate.rb
shinesolutions/ruby_aem
35b721fdeb6aa90176cd4e9c1210ce1d77317dbb
[ "Apache-2.0" ]
21
2016-11-02T04:08:24.000Z
2021-09-29T05:32:07.000Z
lib/ruby_aem/resources/certificate.rb
shinesolutions/ruby_aem
35b721fdeb6aa90176cd4e9c1210ce1d77317dbb
[ "Apache-2.0" ]
9
2017-09-01T15:03:38.000Z
2020-11-18T11:48:49.000Z
# Copyright 2016-2018-2021 Shine Solutions Group # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. require 'openssl' require 'retries' require 'tempfile' require 'ruby_aem/error' require 'ruby_aem/resources/truststore' module RubyAem module Resources # AEM class contains API calls related to managing a certificate within AEM Truststore. # Since there is only 0 or 1 AEM Truststore with a global scope, a certificate # is by default associated to that global AEM Truststore. class Certificate # Initialise certificate. # Certificate resource uses serial number as identifier because AEM API endpoint # for importing a certificate does not allow the ability to specify an alias, # hence alias is assigned randomly by AEM, and this force us to use serial # number as the identifier because serial number is immutable on the certificate. # This is obviously not ideal, but we have to do it due to AEM API limitations. # # @param client RubyAem::Client # @param serial_number the certificate's serial number # @return new RubyAem::Resources::Certificate instance def initialize( client, serial_number ) @client = client @truststore = RubyAem::Resources::Truststore.new(client) @serial_number = serial_number @call_params = { serial_number: serial_number } @cert_alias = _get_alias end # Create is an alias to import. # Create is needed to satisfy Puppet resource `ensure`. # # @param file_path local file path to certificate file # @return RubyAem::Result def create(file_path) import(file_path) end # Import a certificate file into AEM Truststore. # # @param file_path local file path to certificate file # @return RubyAem::Result def import(file_path) @call_params[:file_path] = file_path result = @client.call(self.class, __callee__.to_s, @call_params) @cert_alias = _get_alias result end # Export a certificate file from AEM Truststore. # # @param truststore_password Password for AEM Truststore # @return RubyAem::Result def export(truststore_password) temp_file = Tempfile.new.path @truststore.download(temp_file) truststore_raw = File.read temp_file truststore = OpenSSL::PKCS12.new(truststore_raw, truststore_password) certificate = nil truststore.ca_certs.each { |ca_cert| certificate = ca_cert if ca_cert.serial.to_s == @serial_number.to_s } result = RubyAem::Result.new('Certificate exported', nil) result.data = certificate result end # Delete a specific certificate from AEM Truststore by alias name or serial number. # # @return RubyAem::Result def delete result = exists raise RubyAem::Error.new('Certificate not found', result) if result.data == false @call_params[:cert_alias] = @cert_alias @client.call(self.class, __callee__.to_s, @call_params) end # Check if the certificate exists in AEM truststore. # # @return RubyAem::Result def exists @client.call(self.class, __callee__.to_s, @call_params) end def _get_alias truststore_info = @truststore.info.data cert_alias = nil truststore_info.aliases.each { |certificate_alias| cert_alias = certificate_alias._alias.to_s if certificate_alias.serial_number.to_s == @serial_number.to_s } cert_alias end # Import a certificate file into AEM Truststore and wait until the certificate is imported. # # @param file_path local file path to certificate file # @param opts optional parameters: # - _retries: retries library's options (http://www.rubydoc.info/gems/retries/0.0.5#Usage), restricted to max_tries, base_sleep_seconds, max_sleep_seconds # @return RubyAem::Result def import_wait_until_ready( file_path, opts = { _retries: { max_tries: 30, base_sleep_seconds: 2, max_sleep_seconds: 2 } } ) opts[:_retries] ||= {} opts[:_retries][:max_tries] ||= 30 opts[:_retries][:base_sleep_seconds] ||= 2 opts[:_retries][:max_sleep_seconds] ||= 2 # ensure integer retries setting (Puppet 3 passes numeric string) opts[:_retries][:max_tries] = opts[:_retries][:max_tries].to_i opts[:_retries][:base_sleep_seconds] = opts[:_retries][:base_sleep_seconds].to_i opts[:_retries][:max_sleep_seconds] = opts[:_retries][:max_sleep_seconds].to_i result = import(file_path) with_retries(max_tries: opts[:_retries][:max_tries], base_sleep_seconds: opts[:_retries][:base_sleep_seconds], max_sleep_seconds: opts[:_retries][:max_sleep_seconds]) { |retries_count| check_result = exists puts format('Import check #%<retries_count>d: %<check_result_data>s - %<check_result_message>s', retries_count: retries_count, check_result_data: check_result.data, check_result_message: check_result.message) raise StandardError.new(check_result.message) if check_result.data == false } result end end end end
37.948387
218
0.67222
15a02c10cbe0858202ef5867943e8880602fadc6
10,156
dart
Dart
lib/main.dart
benitarego/E-Card-Generator
3024f077adb9237c7176857ea880ab0111c55b39
[ "MIT" ]
null
null
null
lib/main.dart
benitarego/E-Card-Generator
3024f077adb9237c7176857ea880ab0111c55b39
[ "MIT" ]
null
null
null
lib/main.dart
benitarego/E-Card-Generator
3024f077adb9237c7176857ea880ab0111c55b39
[ "MIT" ]
null
null
null
//import 'dart:js'; import 'package:eazzycard/Animation/FadeAnimation.dart'; import 'package:eazzycard/dashboard.dart'; //import 'package:eazzycard/navigator_drawer.dart'; import 'package:flutter/material.dart'; import 'package:eazzycard/register.dart'; import 'package:eazzycard/DrawerItems/uploadcv_screen.dart'; void main() { runApp(MaterialApp( initialRoute: '/', routes: { '/': (context) => Home(), '/register': (context) => Register(), '/dashboard': (context) => Dashboard(), '/uploadcv': (BuildContext context) => new UploadCVScreen(), }, )); } class Home extends StatelessWidget { @override Widget build(BuildContext context) { return new MaterialApp( debugShowCheckedModeBanner: false, routes: <String, WidgetBuilder>{ '/register': (BuildContext context) => new Register(), '/dashboard': (BuildContext context) => new Dashboard(), '/uploadcv': (BuildContext context) => new UploadCVScreen(), }, home: new MyHomePage(), ); } } class MyHomePage extends StatefulWidget { @override _MyHomePageState createState() => new _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> { @override Widget build(BuildContext context) { return Scaffold( body: Container( width: double.infinity, decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.topCenter, colors: [ Colors.purple[900], Colors.purple[700], Colors.purple[400] ] ) ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ SizedBox(height: 30,), Padding( padding: EdgeInsets.all(20), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ SizedBox(height: 10,), FadeAnimation(1, Text("Login", style: TextStyle(color: Colors.white, fontSize: 40),)), SizedBox(height: 10,), FadeAnimation(1.3, Text("Welcome to EazzyCard.", style: TextStyle(color: Colors.white, fontSize: 18),)), ], ), ), SizedBox(height: 10), Expanded( child: Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only(topLeft: Radius.circular(60), topRight: Radius.circular(60)) ), child: SingleChildScrollView( child: Padding( padding: EdgeInsets.all(30), child: Column( children: <Widget>[ SizedBox(height: 20,), FadeAnimation(1.4, Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(10), boxShadow: [BoxShadow( color: Color.fromRGBO(20, 50, 75, 70), blurRadius: 20, offset: Offset(0, 10) )] ), child: Column( children: <Widget>[ Container( padding: EdgeInsets.all(10), decoration: BoxDecoration( border: Border(bottom: BorderSide(color: Colors.grey[200])) ), child: TextField( decoration: InputDecoration( prefixIcon: Icon(Icons.email), hintText: "Email or Phone number", hintStyle: TextStyle(color: Colors.grey[600]), border: InputBorder.none ), ), ), Container( padding: EdgeInsets.all(10), decoration: BoxDecoration( border: Border(bottom: BorderSide(color: Colors.grey[200])) ), child: TextField( decoration: InputDecoration( prefixIcon: Icon(Icons.lock), hintText: "Password", hintStyle: TextStyle(color: Colors.grey[600]), border: InputBorder.none ), ), ), ], ), )), SizedBox(height: 30,), FadeAnimation(1.5, Text("Forgot Password?", style: TextStyle(color: Colors.grey),)), SizedBox(height: 20,), new GestureDetector( onTap: (){ Navigator.pushNamed(context, '/dashboard'); }, child: FadeAnimation(1.6, Container( height: 50, margin: EdgeInsets.symmetric(horizontal: 50), decoration: BoxDecoration( borderRadius: BorderRadius.circular(50), color: Colors.purple[700] ), child: Center( child: Text("Login", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), ), )), ), SizedBox(height: 20,), FadeAnimation(1.7, Text("-- Login with --", style: TextStyle(color: Colors.grey),)), SizedBox(height: 20,), Row( children: <Widget>[ Expanded( child: FadeAnimation(1.8, Container( height: 40, decoration: BoxDecoration( borderRadius: BorderRadius.circular(50), color: Colors.white ), child: Center( child: Image.asset('assets/google.png'), // child: Text("", style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold),), ), )), ), SizedBox(width: 20,), ], ), SizedBox(height: 15.0), FadeAnimation(1.7, Row( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Text( "Don't have an account?", style: TextStyle( color: Colors.grey, fontFamily: 'Montserrat', ), ), SizedBox(width: 5.0), new GestureDetector( onTap: (){ Navigator.pushNamed(context, '/register'); }, child: InkWell( child: Text('Register', style: TextStyle( color: Colors.purple[700], fontFamily: 'Montserrat', fontWeight: FontWeight.bold, decoration: TextDecoration.underline)), ) ), ], ), ), // SizedBox(width: 30,height: 20,), // FadeAnimation(1.7, Text("Don't have an Account? ", style: TextStyle(color: Colors.grey),)), // SizedBox(width: 30,height: 15,), // new GestureDetector( // onTap: (){ // Navigator.pushNamed(context, '/register'); // }, // child: FadeAnimation(1.6, Container( // height: 50, // margin: EdgeInsets.symmetric(horizontal: 50), // decoration: BoxDecoration( // borderRadius: BorderRadius.circular(50), // color: Colors.purple[700] // ), // child: Center( // child: Text("Register", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), // ), // )), // ), ], ), ), ), ), ) ], ), ), ); } }
44.156522
125
0.373277
dd60e635ad9723c45b9098d770f13e996b14c37b
1,360
java
Java
matrix-people-back-end/src/main/java/com/hocassian/people/mapper/web/PersonWebMapper.java
hokaso/hocassian-media-matrix
2c2e5a4c72dfa43d2eed0f083f5b19238aea2765
[ "MIT" ]
141
2021-06-27T03:18:54.000Z
2022-03-17T03:24:26.000Z
matrix-people-back-end/src/main/java/com/hocassian/people/mapper/web/PersonWebMapper.java
hokaso/hocassian-media-matrix
2c2e5a4c72dfa43d2eed0f083f5b19238aea2765
[ "MIT" ]
1
2021-08-06T17:35:01.000Z
2021-08-06T17:35:01.000Z
matrix-people-back-end/src/main/java/com/hocassian/people/mapper/web/PersonWebMapper.java
hokaso/hocassian-media-matrix
2c2e5a4c72dfa43d2eed0f083f5b19238aea2765
[ "MIT" ]
24
2021-06-29T01:58:59.000Z
2022-03-02T01:42:43.000Z
package com.hocassian.people.mapper.web; import com.hocassian.people.domain.web.PersonWeb; import org.neo4j.driver.Record; import org.springframework.stereotype.Repository; import java.util.List; /** * @author Hocassian */ @Repository public interface PersonWebMapper { /** * 查询全部 * * @return Record格式的列表 */ List<Record> selectPersonWebMap(); /** * 查询全部 * * @return List格式的列表 */ List<PersonWeb> selectPersonWebList(); /** * 查询全部(搜索使用) * * @return List格式的列表(搜索使用) */ List<PersonWeb> selectPersonWebSearchList(String personWebName); /** * 查询全部(搜索使用) * * @return List格式的列表(搜索使用) */ List<PersonWeb> selectPersonWebSearchListOther(String personWebName, String personWebId); /** * 查询单个节点信息 * * @param personWebId 节点id * @return PersonWeb实体信息 */ PersonWeb selectPersonWebById(String personWebId); /** * 插入单个节点信息 * * @param personWeb 节点实体 * @return 插入个数 */ int insertPersonWeb(PersonWeb personWeb); /** * 修改单个节点信息 * * @param personWeb 节点实体 * @return 修改个数 */ int updatePersonWeb(PersonWeb personWeb); /** * 删除单个节点 * * @param personWebId 节点实体 * @return 删除个数 */ int deletePersonWeb(String personWebId); }
17.894737
93
0.6
1a5924e6067593ef52dc6f3579f5b229420b417a
26
py
Python
custom_components/sshhio_door_sensor/__init__.py
sshh12/home-assistant-sshhio
4f93b732b33f490a2364ae05b609fab8e28a84ae
[ "MIT" ]
null
null
null
custom_components/sshhio_door_sensor/__init__.py
sshh12/home-assistant-sshhio
4f93b732b33f490a2364ae05b609fab8e28a84ae
[ "MIT" ]
null
null
null
custom_components/sshhio_door_sensor/__init__.py
sshh12/home-assistant-sshhio
4f93b732b33f490a2364ae05b609fab8e28a84ae
[ "MIT" ]
null
null
null
"Camera based door sensor"
26
26
0.807692
c401731f8ee6fcef335edaccdf03a53c2e0d7768
4,166
hh
C++
lsl/runtime/types.hh
vinzenz/lsl-emu
3f799248ee57d0d11d6f12e6ff0f48cf359ced1e
[ "Apache-2.0" ]
1
2018-03-28T19:26:44.000Z
2018-03-28T19:26:44.000Z
lsl/runtime/types.hh
vinzenz/lsl-emu
3f799248ee57d0d11d6f12e6ff0f48cf359ced1e
[ "Apache-2.0" ]
null
null
null
lsl/runtime/types.hh
vinzenz/lsl-emu
3f799248ee57d0d11d6f12e6ff0f48cf359ced1e
[ "Apache-2.0" ]
null
null
null
// Copyright 2014 Vinzenz Feenstra // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef GUARD_LSL_RUNTIME_TYPES_HH_INCLUDED #define GUARD_LSL_RUNTIME_TYPES_HH_INCLUDED #include <lsl/runtime/vector.hh> #include <lsl/runtime/quaternion.hh> #include <lsl/types.hh> #include <boost/variant.hpp> #include <boost/ref.hpp> #include <sstream> namespace lsl { namespace runtime { typedef std::string String; typedef int32_t Integer; typedef double Float; typedef lsl::Key Key; typedef Quaternion Rotation; inline String to_string(Integer val) { std::ostringstream ostr; ostr << val; return ostr.str(); } inline String to_string(Float val) { std::ostringstream ostr; ostr << std::setiosflags(std::ios::fixed) << std::setprecision(6) << val; return ostr.str(); } inline String to_string(Vector val) { std::ostringstream ostr; ostr << '<' << std::setiosflags(std::ios::fixed) << std::setprecision(5) << val.x << ", " << val.y << ", " << val.z << '>'; return ostr.str(); } inline String to_string(Quaternion val) { std::ostringstream ostr; ostr << '<' << std::setiosflags(std::ios::fixed) << std::setprecision(5) << val.x << ", " << val.y << ", " << val.z << ", " << val.s << '>'; return ostr.str(); } enum class ValueType : lsl::runtime::Integer { Void = 0, Integer = 1, Float = 2, String = 3, Key = 4, Vector = 5, Rotation = 6, List = 7 }; struct ScriptValue { typedef String string_type; typedef Key key_type; typedef Integer integer_type; typedef Float float_type; typedef Vector vector_type; typedef Quaternion rotation_type; typedef boost::make_recursive_variant< string_type, key_type, rotation_type, vector_type, integer_type, float_type, boost::reference_wrapper<ScriptValue>,// References to Variables global or local boost::reference_wrapper<float_type>, // Members of Vector or Quaternion std::vector<ScriptValue> >::type value_type; typedef std::vector<ScriptValue> list_type; ScriptValue() : type(), value(), reference(false){} ScriptValue(ValueType t, value_type const & v, bool r) : type(t), value(v), reference(r){} ValueType type; value_type value; bool reference; key_type as_key() const; string_type as_string() const; integer_type as_integer() const; float_type as_float() const; vector_type as_vector() const; rotation_type as_rotation() const; list_type as_list() const; integer_type as_bool() const; rotation_type & get_rotation(); vector_type & get_vector(); string_type & get_string(); key_type & get_key(); integer_type & get_integer(); float_type & get_float(); list_type & get_list(); boost::reference_wrapper<float_type> & get_member_ref(); boost::reference_wrapper<ScriptValue> & get_ref(); }; bool operator==(ScriptValue const & left, ScriptValue const & right); bool operator<(ScriptValue const & left, ScriptValue const & right); inline bool operator>(ScriptValue const & left, ScriptValue const & right) { return right < left; } typedef ScriptValue::list_type List; }} namespace std { template<> struct hash<lsl::Key> : std::hash<lsl::String> {}; } #endif //GUARD_LSL_RUNTIME_TYPES_HH_INCLUDED
27.407895
94
0.62722
45dbcd585c32353a3d3252d06c6f021c1bbef733
640
py
Python
n26/util.py
rxall/python-n26
7f20e122152553ca08d1e3567e53de5c7b6e4e53
[ "MIT" ]
163
2017-03-21T08:49:32.000Z
2022-03-29T22:48:19.000Z
n26/util.py
rxall/python-n26
7f20e122152553ca08d1e3567e53de5c7b6e4e53
[ "MIT" ]
74
2017-03-21T20:23:41.000Z
2022-03-30T18:21:31.000Z
n26/util.py
rxall/python-n26
7f20e122152553ca08d1e3567e53de5c7b6e4e53
[ "MIT" ]
28
2017-03-21T08:49:36.000Z
2021-12-29T12:48:23.000Z
def create_request_url(url: str, params: dict = None): """ Adds query params to the given url :param url: the url to extend :param params: query params as a keyed dictionary :return: the url including the given query params """ if params: first_param = True for k, v in sorted(params.items(), key=lambda entry: entry[0]): if not v: # skip None values continue if first_param: url += '?' first_param = False else: url += '&' url += "%s=%s" % (k, v) return url
24.615385
71
0.501563
4d7379a92b082ea675f9f87f0883a365401a6ede
676
cs
C#
src/core/ShardingConnector.Merge/Engine/Merger/IResultMerger.cs
xuejmnet/sharding-connector
65c6fd51cd74c32f6442bf8dfc37166c940f4161
[ "Apache-2.0" ]
5
2021-03-23T13:38:15.000Z
2021-11-09T09:36:58.000Z
src/core/ShardingConnector.Merge/Engine/Merger/IResultMerger.cs
xuejmnet/sharding-connector
65c6fd51cd74c32f6442bf8dfc37166c940f4161
[ "Apache-2.0" ]
null
null
null
src/core/ShardingConnector.Merge/Engine/Merger/IResultMerger.cs
xuejmnet/sharding-connector
65c6fd51cd74c32f6442bf8dfc37166c940f4161
[ "Apache-2.0" ]
2
2021-12-08T04:38:26.000Z
2022-03-30T06:50:04.000Z
using System; using System.Collections.Generic; using System.Text; using ShardingConnector.CommandParser.Command; using ShardingConnector.Executor; using ShardingConnector.Merge.Reader; using ShardingConnector.ParserBinder.Command; using ShardingConnector.ParserBinder.MetaData.Schema; namespace ShardingConnector.Merge.Engine.Merger { /* * @Author: xjm * @Description: * @Date: 2021/4/25 10:36:05 * @Ver: 1.0 * @Email: 326308290@qq.com */ public interface IResultMerger { IMergedEnumerator Merge(List<IQueryEnumerator> queryEnumerators, ISqlCommandContext<ISqlCommand> sqlCommandContext, SchemaMetaData schemaMetaData); } }
27.04
155
0.758876
f48371db93858e2859ef72e6b0f4bd1ff20f307c
349
ts
TypeScript
app/extend/context.d.ts
xiangsx/egg-super-router
a8d780700f9a7ab9385e7a739516d7db903ba649
[ "MIT" ]
1
2021-12-05T10:22:16.000Z
2021-12-05T10:22:16.000Z
app/extend/context.d.ts
xiangsx/egg-super-router
a8d780700f9a7ab9385e7a739516d7db903ba649
[ "MIT" ]
null
null
null
app/extend/context.d.ts
xiangsx/egg-super-router
a8d780700f9a7ab9385e7a739516d7db903ba649
[ "MIT" ]
null
null
null
import {Context} from 'egg'; import {Method, RouteInfo} from "../../lib/routes"; export interface wrapOpts { status: number, msg: string, } export default class SRContext extends Context { reqEnd: boolean method: Method routeInfo: RouteInfo userAccess: number wrap: (data: any, errCode = Error | Number, opts) => {} };
21.8125
59
0.661891
e264c40561157ade3fffbb3c65aa3184abf7433f
2,229
rb
Ruby
lib/chassis/dirty_session.rb
ahawkins/chassis
a5020318304f6158d64afbe22c00a2bc688a1bb0
[ "MIT" ]
34
2015-01-04T18:24:45.000Z
2019-11-19T20:03:25.000Z
lib/chassis/dirty_session.rb
ahawkins/chassis
a5020318304f6158d64afbe22c00a2bc688a1bb0
[ "MIT" ]
null
null
null
lib/chassis/dirty_session.rb
ahawkins/chassis
a5020318304f6158d64afbe22c00a2bc688a1bb0
[ "MIT" ]
3
2015-04-30T10:00:11.000Z
2015-12-16T22:02:53.000Z
require 'set' module Chassis class DirtySession < Proxy def initialize(*args) super @original_values = { } @new_values = { } end def clean? new_values.empty? end def dirty? !clean? end def original_values @original_values end def new_values @new_values end def changes Set.new original_values.keys end def reset! original_values.clear new_values.clear end def method_missing(name, *args, &block) raise MissingObject, name unless __getobj__ if writer_method?(name) handle_writer_method name, *args, &block elsif changed_method?(name) handle_changed_method name elsif original_method?(name) handle_original_method name else __getobj__.send name, *args, &block end end def respond_to_missing?(name, include_private = false) if changed_method?(name) || original_method?(name) __getobj__.respond_to? reader_method(name) else super end end private def handle_writer_method(name, *args, &block) method_key = reader_method name original_value = __getobj__.send method_key new_value = __getobj__.send name, *args, &block if new_value != original_value original_values[method_key] = original_value unless original_values.key? method_key new_values[method_key] = new_value end new_value end def writer_method?(name) name =~ /=$/ end def reader_method(name) method_name = name.to_s if writer_method? method_name method_name.match(/(.+)=$/)[1].to_sym elsif changed_method? method_name method_name.match(/(.+)_changed\?$/)[1].to_sym elsif original_method? method_name method_name.match(/original_(.+)$/)[1].to_sym end end def original_method?(name) name =~ /original_.+$/ end def changed_method?(name) name =~ /_changed\?$/ end def handle_changed_method(name) original_values.key? reader_method(name) end def handle_original_method(name) original_values[reader_method(name)] end end end
21.028302
91
0.634814
223502b931f90edeeb2afed2bf1c1234fe387ed6
8,613
sql
SQL
app/postcode/queries/local_data_se.sql
domdomegg/coronavirus-dashboard-frontend-server
f08a7928b1b87aeea701924e8e5d2687fa6e3fab
[ "MIT" ]
17
2020-10-29T20:24:32.000Z
2022-01-23T19:11:41.000Z
app/postcode/queries/local_data_se.sql
domdomegg/coronavirus-dashboard-frontend-server
f08a7928b1b87aeea701924e8e5d2687fa6e3fab
[ "MIT" ]
74
2020-11-02T09:02:16.000Z
2022-03-29T09:05:20.000Z
app/postcode/queries/local_data_se.sql
domdomegg/coronavirus-dashboard-frontend-server
f08a7928b1b87aeea701924e8e5d2687fa6e3fab
[ "MIT" ]
7
2021-01-11T09:21:30.000Z
2022-02-28T16:20:20.000Z
CREATE TEMPORARY TABLE data AS ( SELECT * FROM ( SELECT hash, metric, priority, area_code AS area_code, postcode AS postcode, area_type AS area_type, area_name AS area_name, date AS date, payload FROM covid19.time_series_p{partition_date}_other AS ts JOIN covid19.release_reference AS rr ON rr.id = release_id JOIN covid19.metric_reference AS mr ON mr.id = metric_id JOIN ( SELECT id, ref.area_type, area_code, area_name, postcode, priority FROM covid19.postcode_lookup_reference JOIN covid19.area_reference AS ref ON ref.id = area_id JOIN covid19.area_priorities AS ap ON ref.area_type = ap.area_type WHERE UPPER(REPLACE(postcode, ' ', '')) = $2 ) AS location ON location.id = area_id WHERE rr.released IS TRUE AND metric ILIKE ANY ($1::VARCHAR[]) UNION ALL ( SELECT hash, metric, priority, area_code AS area_code, postcode AS postcode, area_type AS area_type, area_name AS area_name, date AS date, payload FROM covid19.time_series_p{partition_date}_utla AS ts JOIN covid19.release_reference AS rr ON rr.id = release_id JOIN covid19.metric_reference AS mr ON mr.id = metric_id JOIN ( SELECT id, ref.area_type, area_code, area_name, postcode, priority FROM covid19.postcode_lookup_reference JOIN covid19.area_reference AS ref ON ref.id = area_id JOIN covid19.area_priorities AS ap ON ref.area_type = ap.area_type WHERE UPPER(REPLACE(postcode, ' ', '')) = $2 ) AS location ON location.id = area_id WHERE rr.released IS TRUE AND metric ILIKE ANY ($1::VARCHAR[]) ) UNION ALL ( SELECT hash, metric, priority, area_code AS area_code, postcode AS postcode, area_type AS area_type, area_name AS area_name, date AS date, payload FROM covid19.time_series_p{partition_date}_ltla AS ts JOIN covid19.release_reference AS rr ON rr.id = release_id JOIN covid19.metric_reference AS mr ON mr.id = metric_id JOIN ( SELECT id, ref.area_type, area_code, area_name, postcode, priority FROM covid19.postcode_lookup_reference JOIN covid19.area_reference AS ref ON ref.id = area_id JOIN covid19.area_priorities AS ap ON ref.area_type = ap.area_type WHERE UPPER(REPLACE(postcode, ' ', '')) = $2 ) AS location ON location.id = area_id WHERE rr.released IS TRUE AND metric ILIKE ANY ($1::VARCHAR[]) ) UNION ALL ( SELECT hash, metric, priority, area_code AS area_code, postcode AS postcode, area_type AS area_type, area_name AS area_name, date AS date, payload FROM covid19.time_series_p{partition_date}_nhstrust AS ts JOIN covid19.release_reference AS rr ON rr.id = release_id JOIN covid19.metric_reference AS mr ON mr.id = metric_id JOIN ( SELECT id, ref.area_type, area_code, area_name, postcode, priority FROM covid19.postcode_lookup_reference JOIN covid19.area_reference AS ref ON ref.id = area_id JOIN covid19.area_priorities AS ap ON ref.area_type = ap.area_type WHERE UPPER(REPLACE(postcode, ' ', '')) = $2 ) AS location ON location.id = area_id WHERE rr.released IS TRUE AND metric ILIKE ANY ($1::VARCHAR[]) ) ) as f ); CREATE TEMPORARY TABLE msoa AS ( SELECT area_code, postcode, area_type, area_name, date, metric, key, value, priority FROM covid19.time_series_p{partition_date}_msoa AS ts JOIN covid19.release_reference AS rr ON rr.id = release_id JOIN covid19.metric_reference AS mr ON mr.id = metric_id JOIN ( SELECT id, ref.area_type, area_code, area_name, postcode, priority FROM covid19.postcode_lookup_reference JOIN covid19.area_reference AS ref ON ref.id = area_id JOIN covid19.area_priorities AS ap ON ref.area_type = ap.area_type WHERE UPPER(REPLACE(postcode, ' ', '')) = $2 ) AS location ON location.id = area_id, jsonb_each(payload) AS pa WHERE rr.released IS TRUE AND metric ILIKE ANY ($1::VARCHAR[]) OFFSET 0 ); SELECT "areaCode", postcode, "areaType", "areaName", date, metric, value, priority FROM ( SELECT area_code AS "areaCode", postcode, area_type AS "areaType", area_name AS "areaName", date, metric, ( CASE WHEN value::TEXT = 'UP' THEN 0 WHEN value::TEXT = 'DOWN' THEN 180 WHEN value::TEXT = 'SAME' THEN 90 WHEN area_type = 'msoa' AND metric LIKE $1 THEN value::NUMERIC WHEN metric ILIKE ANY ($2::VARCHAR[]) THEN value::NUMERIC ELSE round(value::NUMERIC)::INT END ) AS "value", priority FROM ( SELECT metric, priority, area_code AS area_code, postcode AS postcode, area_type AS area_type, area_name AS area_name, date AS date, (payload ->> 'value')::TEXT AS "value", RANK() OVER ( PARTITION BY (metric) ORDER BY priority, date DESC ) AS rank FROM (SELECT * FROM data OFFSET 0) AS t UNION ALL ( SELECT (metric || UPPER(LEFT(key, 1)) || RIGHT(key, -1)) AS metric, 1 AS priority, area_code, postcode, area_type, area_name, date, ( CASE WHEN value::TEXT <> 'null' THEN TRIM(BOTH '"' FROM value::TEXT) WHEN value::TEXT = 'null' THEN '-999999' END ) AS value, RANK() OVER ( PARTITION BY (key) ORDER BY date DESC ) AS rank FROM msoa ) ) AS result_inner WHERE result_inner.rank = 1 ) AS result;
45.094241
100
0.427609
79424563a98ca339a060c63de27ca196aee6eb6f
289
rb
Ruby
app/models/link.rb
bcncybersecurity/frab
f6d6c503b80acbad31e4d157400cd53a36438437
[ "MIT" ]
592
2015-01-01T10:20:08.000Z
2022-03-10T16:53:56.000Z
app/models/link.rb
bcncybersecurity/frab
f6d6c503b80acbad31e4d157400cd53a36438437
[ "MIT" ]
485
2015-01-27T12:02:33.000Z
2022-03-06T13:23:11.000Z
app/models/link.rb
bcncybersecurity/frab
f6d6c503b80acbad31e4d157400cd53a36438437
[ "MIT" ]
144
2015-01-12T22:27:47.000Z
2022-03-15T17:36:10.000Z
class Link < ApplicationRecord belongs_to :linkable, polymorphic: true, optional: true validates :title, :url, presence: true has_paper_trail meta: { associated_id: :linkable_id, associated_type: :linkable_type } def to_s "#{model_name.human}: #{title}" end end
19.266667
57
0.705882
df84d4bcae6a640abf9d17a0a25f405bc80f1398
435
cs
C#
Assets/UdonSpaceVehicles/Scripts/ParticleDriver.cs
esnya/UdonSpaceVehicles
ff00f234b278a3e205797cd3d4140c37cb272ca2
[ "MIT" ]
7
2021-03-16T16:44:05.000Z
2022-02-14T13:57:09.000Z
Assets/UdonSpaceVehicles/Scripts/ParticleDriver.cs
esnya/UdonSpaceVehicles
ff00f234b278a3e205797cd3d4140c37cb272ca2
[ "MIT" ]
4
2021-03-16T15:00:11.000Z
2021-04-07T08:10:23.000Z
Assets/UdonSpaceVehicles/Scripts/ParticleDriver.cs
esnya/UdonSpaceVehicles
ff00f234b278a3e205797cd3d4140c37cb272ca2
[ "MIT" ]
null
null
null
 using UdonSharp; using UdonToolkit; using UnityEngine; namespace UdonSpaceVehicles { [CustomName("USV Particle Driver")] [HelpMessage("Emits particle by custom event \"Trigger\".")] [RequireComponent(typeof(ParticleSystem))] public class ParticleDriver : UdonSharpBehaviour { public int count = 1; public void Trigger() { GetComponent<ParticleSystem>().Emit(count); } } }
22.894737
64
0.664368
da81565cf90085faee4b04d9dd2edd6726324dff
3,660
php
PHP
resources/views/admin/orders/order-invoice.blade.php
charlesdazelndc/LaravelEcommerce
eabf934e8ca09e8ac02ea041bfb84c0f2ca85f3a
[ "MIT" ]
null
null
null
resources/views/admin/orders/order-invoice.blade.php
charlesdazelndc/LaravelEcommerce
eabf934e8ca09e8ac02ea041bfb84c0f2ca85f3a
[ "MIT" ]
null
null
null
resources/views/admin/orders/order-invoice.blade.php
charlesdazelndc/LaravelEcommerce
eabf934e8ca09e8ac02ea041bfb84c0f2ca85f3a
[ "MIT" ]
null
null
null
@extends('admin.master'); @section('body') <br> <div class="row"> <div class="invoice-box"> <table cellpadding="0" cellspacing="0"> <tr class="top"> <td colspan="2"> <table class="table table-bordered"> <tr> <div class="logo-nav-left"> <h1>New Shop </h1> </div> </tr> <tr class="information"> <tr> <th>Customer Info</th> <td> {{$customer->first_name.''.$customer->last_name}}.<br> {{$customer->email_address}}<br> {{$customer->address}}<br> {{$customer->phone_number}}<br> </td> </tr> <tr> <th>Shipping Info</th> <td> {{$shipping->full_name}}.<br> {{$shipping->email_address}}.<br> {{$shipping->address}}<br> {{$shipping->phone_number}} </td> </tr> </tr> <tr> <th>Invoice Info</th> <td> Invoice #: {{$orders->id}}<br> Created: {{$orders->created_at}}<br> Amount Due: {{$orders->total_order}} </td> </tr> </table> </td> </tr> <tr class="heading"> <td> Payment Method </td> <td> Check # </td> </tr> <tr class="details"> <td> {{$payment->payment_type}} </td> <td> 1000 </td> </tr> <tr class="item table table-bordered bg-primary"> <th> Item </th> <th> Quantity </th> <th> Price </th> <th> Total Price </th> </tr> @foreach($orderDetails as $orderdetail) <tr class="item table table-bordered"> <td> {{$orderdetail->product_name}} </td> <td>{{$orderdetail->product_quantity}}</td> <td> {{$orderdetail->product_price}} </td> <td> {{$orderdetail->product_price*$orderdetail->product_quantity}} </td> </tr> @endforeach </table> </div> </div> @endsection
28.818898
102
0.253279
8708aa1cc68ee98af7c114dd7e6273adb2015aae
2,701
kt
Kotlin
YTKJsBridge/ytkjsbridge/src/androidTest/java/com/fenbi/android/ytkjsbridge/TestDynamicCallJs.kt
mrrobot97/YTKJsBridge-Android
fc428a0f33abc919ff2983680d9fcd32423d625d
[ "MIT" ]
null
null
null
YTKJsBridge/ytkjsbridge/src/androidTest/java/com/fenbi/android/ytkjsbridge/TestDynamicCallJs.kt
mrrobot97/YTKJsBridge-Android
fc428a0f33abc919ff2983680d9fcd32423d625d
[ "MIT" ]
1
2019-01-03T11:12:15.000Z
2019-01-03T11:12:15.000Z
YTKJsBridge/ytkjsbridge/src/androidTest/java/com/fenbi/android/ytkjsbridge/TestDynamicCallJs.kt
mrrobot97/YTKJsBridge-Android
fc428a0f33abc919ff2983680d9fcd32423d625d
[ "MIT" ]
null
null
null
package com.fenbi.android.ytkjsbridge import android.support.test.InstrumentationRegistry import android.support.test.runner.AndroidJUnit4 import android.webkit.WebChromeClient import android.webkit.WebView import android.webkit.WebViewClient import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.delay import kotlinx.coroutines.launch import org.junit.Assert.assertEquals import org.junit.Test import org.junit.runner.RunWith import java.util.concurrent.CountDownLatch import java.util.concurrent.TimeUnit /** * Created by yangjw on 2019/1/9. */ @RunWith(AndroidJUnit4::class) class TestDynamicCallJs { private fun initWebView() = WebView(InstrumentationRegistry.getTargetContext()).apply { webViewClient = WebViewClient() webChromeClient = WebChromeClient() initYTKJsBridge() loadUrl("file:///android_asset/test-call-js.html") } @Test fun testCallSync() { val countDownLatch = CountDownLatch(1) var ret: Int? = null InstrumentationRegistry.getInstrumentation().runOnMainSync { val webView = initWebView() GlobalScope.launch { delay(5000) //wait js script to be load ret = webView.call<Int>("testSync", 1, 2) countDownLatch.countDown() } } countDownLatch.await(60, TimeUnit.SECONDS) assertEquals(3, ret) } @Test fun testCallAsyncWithJsCall() { val countDownLatch = CountDownLatch(1) var ret: String? = null InstrumentationRegistry.getInstrumentation().runOnMainSync { val webView = initWebView() GlobalScope.launch { delay(5000) webView.call("testAsyncWithJsCall", "tom", callback = object : JsCallback<String> { override fun onReceiveValue(msg: String?) { ret = msg countDownLatch.countDown() } }) } } countDownLatch.await(60, TimeUnit.SECONDS) assertEquals("hello tom", ret) } @Test fun testCallAsyncWithLambda() { val countDownLatch = CountDownLatch(1) var ret: String? = null InstrumentationRegistry.getInstrumentation().runOnMainSync { val webView = initWebView() GlobalScope.launch { delay(5000) webView.call<String>("testAsyncWithLambda","lisa"){ ret = it countDownLatch.countDown() } } } countDownLatch.await(60, TimeUnit.SECONDS) assertEquals("hello lisa", ret) } }
32.542169
99
0.615328
8eb6d25e94bd8ffd2e55317510a2054ea497e502
42
js
JavaScript
src/views/DashboardAnalytics/components/TopReferrals/index.js
TaHanh/reactjs_templae
904c7d444429eeb57e24193f9c01f40706432d31
[ "Apache-2.0" ]
null
null
null
src/views/DashboardAnalytics/components/TopReferrals/index.js
TaHanh/reactjs_templae
904c7d444429eeb57e24193f9c01f40706432d31
[ "Apache-2.0" ]
null
null
null
src/views/DashboardAnalytics/components/TopReferrals/index.js
TaHanh/reactjs_templae
904c7d444429eeb57e24193f9c01f40706432d31
[ "Apache-2.0" ]
1
2021-04-28T16:30:35.000Z
2021-04-28T16:30:35.000Z
export { default } from './TopReferrals';
21
41
0.690476
a3682f35845ff81c5742cba200d1f7aeecb886fe
1,167
java
Java
src/util/Score.java
dickyhermawan12/Final-Project-OOP
e7205a0228db76a10e0327d38e161c98b6c475a3
[ "MIT" ]
null
null
null
src/util/Score.java
dickyhermawan12/Final-Project-OOP
e7205a0228db76a10e0327d38e161c98b6c475a3
[ "MIT" ]
12
2020-11-19T17:18:17.000Z
2021-11-16T05:10:22.000Z
src/util/Score.java
dickyhermawan12/Final-Project-OOP
e7205a0228db76a10e0327d38e161c98b6c475a3
[ "MIT" ]
1
2020-11-19T18:02:22.000Z
2020-11-19T18:02:22.000Z
package util; import java.awt.Graphics; public class Score extends Instances { private int p1_score, p2_score, maxScore; // konstruktor, keadaan awal skor public Score() { this.maxScore = 10; reset(); } // increment skor player 1 public void addP1Score() { p1_score++; } // increment skor player 2 public void addP2Score() { p2_score++; } // ubah skor maksimal public void changeMaxScore(int maxScore) { this.maxScore = maxScore; } // ambil skor maksimal public int getMaxScore() { return this.maxScore; } // ambil pemain yang menang public int hasWon() { if (p1_score == maxScore) { return 1; } else if (p2_score == maxScore) { return 2; } return 0; } // mengembalikan keadaan skor ke awal public void reset() { p1_score = p2_score = 0; } // method draw untuk score public void draw(Graphics g) { g.setFont(g.getFont().deriveFont(28f)); g.drawString(Integer.toString(p1_score), maxWidth / 4, maxHeight / 5); g.drawString(":", maxWidth / 2, maxHeight / 5); g.drawString(Integer.toString(p2_score), maxWidth * 3 / 4, maxHeight / 5); } }
20.839286
78
0.637532
d30593aed6f0dd27f7668154bc4f4d16f3ead43b
27
rb
Ruby
Languages/Ruby/Tests/Experiments/Methods/AliasLookupLoad.rb
rifraf/IronRuby_Framework_4.7.2
f0dad68e8235cd414e08c13032eb91ab3f54b844
[ "MIT" ]
null
null
null
Languages/Ruby/Tests/Experiments/Methods/AliasLookupLoad.rb
rifraf/IronRuby_Framework_4.7.2
f0dad68e8235cd414e08c13032eb91ab3f54b844
[ "MIT" ]
null
null
null
Languages/Ruby/Tests/Experiments/Methods/AliasLookupLoad.rb
rifraf/IronRuby_Framework_4.7.2
f0dad68e8235cd414e08c13032eb91ab3f54b844
[ "MIT" ]
null
null
null
load 'AliasLookup.rb', true
27
27
0.777778
38cf1faa62a32bc740a8168ad59bb785fe90b94a
1,317
swift
Swift
HackathonChange/RequestManager.swift
jjcc1421/Huge-Hackathon-2017-IOS
2aaa2781c4dc553907e7f9633e45bca1900b2a53
[ "MIT" ]
null
null
null
HackathonChange/RequestManager.swift
jjcc1421/Huge-Hackathon-2017-IOS
2aaa2781c4dc553907e7f9633e45bca1900b2a53
[ "MIT" ]
null
null
null
HackathonChange/RequestManager.swift
jjcc1421/Huge-Hackathon-2017-IOS
2aaa2781c4dc553907e7f9633e45bca1900b2a53
[ "MIT" ]
null
null
null
// // RequestManager.swift // HackathonChange // // Created by Laura Mejia Arroyave on 1/12/17. // Copyright © 2017 Laura Mejia Arroyave. All rights reserved. // import UIKit import Alamofire import SwiftyJSON class RequestManager: NSObject { let textToSpeech = TextToSpeech() func makeRequestPost(URL: String, JSON: [String: Any], feature: String) { let nsurl = NSURL(string: URL)! var request = URLRequest(url: nsurl as URL) request.httpMethod = "POST" request.setValue("application/json", forHTTPHeaderField: "Content-Type") request.httpBody = try! JSONSerialization.data(withJSONObject: JSON) Alamofire.request(request).responseString { response in let result = response.result switch result { case .failure(let error): if feature == "email" { self.textToSpeech.speak(text: "Error sending the email, please try again!") } print(error) case .success(let responseObject): if feature == "email" { self.textToSpeech.speak(text: "Email sent!") } } } } }
28.021277
95
0.545178
d3bf4fb1fe9b16d4a8bc7097032b8401b70873a9
705
rb
Ruby
app/models/flow_core/steps/end.rb
demillir/flow_core
4c538193b3e6ace4af4c0a70959c9e47d1df5a54
[ "MIT" ]
148
2020-02-17T22:57:54.000Z
2022-01-27T11:33:30.000Z
app/models/flow_core/steps/end.rb
demillir/flow_core
4c538193b3e6ace4af4c0a70959c9e47d1df5a54
[ "MIT" ]
13
2020-05-22T17:22:38.000Z
2022-02-11T21:51:41.000Z
app/models/flow_core/steps/end.rb
demillir/flow_core
4c538193b3e6ace4af4c0a70959c9e47d1df5a54
[ "MIT" ]
8
2020-03-11T09:50:40.000Z
2021-04-29T00:26:13.000Z
# frozen_string_literal: true module FlowCore::Steps class End < FlowCore::Step def deploy_to_workflow!(workflow, input_place_or_transition) target_place = workflow.end_place || workflow.create_end_place! if input_place_or_transition.is_a? FlowCore::Transition target_place.input_transitions << input_place_or_transition else input_place_or_transition.input_arcs.update place: target_place input_place_or_transition.reload.destroy! end nil end class << self def creatable? true end def redirection_step? true end def redirection_configurable? false end end end end
21.363636
71
0.68227
54c190a77fb95348475d38180243a1dfb68b1007
486
css
CSS
packages/ui/src/pages/Settings/SettingsPage.css
max-vorabhol-zipmex/express-app
455efc2eaebd64b0a50fba98c19e4e8eda5a13f6
[ "MIT" ]
null
null
null
packages/ui/src/pages/Settings/SettingsPage.css
max-vorabhol-zipmex/express-app
455efc2eaebd64b0a50fba98c19e4e8eda5a13f6
[ "MIT" ]
3
2021-07-12T02:06:20.000Z
2021-08-11T01:48:33.000Z
packages/ui/src/pages/Settings/SettingsPage.css
max-vorabhol-zipmex/express-app
455efc2eaebd64b0a50fba98c19e4e8eda5a13f6
[ "MIT" ]
null
null
null
.settings-page__content { width: 100%; display: flex; flex-direction: column; flex: 1; overflow-y: auto; overflow-x: hidden; } .settings-page__menu { display: flex; flex-direction: column; } .settings-page__footer { flex-shrink: 0; } /* MEDIA QUERIES */ /* Extra Small Devices, Phones */ @media only screen and (max-width: 590px) { .settings-page__content { flex-direction: column; flex: 1 0 auto; } .settings-page__container { padding: 0; } }
15.677419
43
0.654321
a43c009ef2473d7d0b4886fd6afcd94e35eeb373
26,042
dart
Dart
lib/p_main_app/utils_p/app_color.dart
dexbytes/flutter-freebs
25f423f1d29b5ae0ee92f354ad09046bdf6c7d55
[ "BSD-2-Clause" ]
null
null
null
lib/p_main_app/utils_p/app_color.dart
dexbytes/flutter-freebs
25f423f1d29b5ae0ee92f354ad09046bdf6c7d55
[ "BSD-2-Clause" ]
null
null
null
lib/p_main_app/utils_p/app_color.dart
dexbytes/flutter-freebs
25f423f1d29b5ae0ee92f354ad09046bdf6c7d55
[ "BSD-2-Clause" ]
null
null
null
import 'dart:ui'; import 'package:flutter/material.dart'; class AppColors { int intWhite = 0xFFF44336; Color colorPrimary = Color.fromARGB(255, 51, 51, 51); Color colorPrimaryDark = Color.fromARGB(255, 41, 41, 41); Color colorAccent = Color.fromARGB(255, 30, 198, 89); Color orange = Color.fromARGB(255, 252, 109, 38); Color greyUnselected = Color.fromARGB(255, 96, 96, 96); Color whiteCard = Color.fromARGB(255, 250, 250, 250); Color chromeGrey = Color.fromARGB(255, 240, 240, 240); Color white = Color.fromARGB(255, 255, 255, 255); Color whiteSecondary = Color.fromARGB(255, 220, 220, 220); Color whiteUnSelected = Color.fromARGB(255, 180, 180, 180); Color indigo = Color.fromARGB(255, 51, 105, 231); Color primaryText = Color.fromARGB(255, 51, 51, 51); Color secondaryText = Color.fromARGB(255, 114, 114, 114); Color grey = Color.fromARGB(255, 188, 187, 187); //Extra colors Color primaryShadeColor1 = Color(0xFFaccfdc); Color primaryShadeColor2 = Color(0xFF6cc3e3); Color darkRed = Color(0xFF620F0F); Color red = Color(0xFFDD2E37); Color yellow = Color(0xFFFDD65E); Color lightBackgroundColor = Color(0xFFF5F5F5); Color lightBlack = Color(0xFF231F20); Color lightblack = Color(0xFF231F20); Color black = Color(0xFF000000); Color wordGreyColor = Color(0xFFCCCCCC); MaterialAccentColor primaryColor = MaterialAccentColor( 0xFF0D47A1, <int, Color>{ 100: Color(0xFF0D47A1), 200: Color(0xFF9b8560), 300: Color(0x509b8560), 400: Color(0xFF00aeef), 500: Color(0xFFffc3f5), 600: Color(0xFFffc3f5), 700: Color(0x00ffc3f5), }, ); MaterialAccentColor passwordVisibleEyeColor = MaterialAccentColor( 0xFF242424, <int, Color>{ 100: Color(0xFF00aeef), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor appThemeColor = MaterialColor(0xFF9b8560, <int, Color>{ 50: Color.fromRGBO(155, 133, 96, .1), 100: Color.fromRGBO(155, 133, 96, .2), 200: Color.fromRGBO(155, 133, 96, .3), 300: Color.fromRGBO(155, 133, 96, .4), 400: Color.fromRGBO(155, 133, 96, .5), 500: Color.fromRGBO(155, 133, 96, .6), 600: Color.fromRGBO(155, 133, 96, .7), 700: Color.fromRGBO(155, 133, 96, .8), 800: Color.fromRGBO(155, 133, 96, .9), 900: Color.fromRGBO(155, 133, 96, 1), }); //Status bar color Color appStatusBarTransColor = Color(0x00000000); //Loader Color ******************************** MaterialColor loaderColor = MaterialColor( 0xFF9b8560, <int, Color>{ 100: Color(0xFF00aeef), 200: Color(0xFF696969), 300: Color(0xFFffc3f5), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor loaderBgColor = MaterialColor( 0xFFFFFFFF, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); //AppBar color start MaterialColor appBarLetIconColor = MaterialColor( 0xFF000000, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF62696e), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor appBarTextColor = MaterialColor( 0xFF2c3134, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0xFF242424), 700: Color(0x0D000000), }, ); MaterialColor appBarSubTextColor = MaterialColor( 0xFF2c3134, <int, Color>{ 100: Color(0xFFf1a7dc), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor appBarRightIconColor = MaterialColor( 0xFF000000, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor appBarBgColor = MaterialColor( 0xFFf2f4f5, <int, Color>{ 100: Color(0xFFf4f6f7), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFF33302b), 600: Color(0x0D000CC0), 700: Color(0x00000000), }, ); MaterialColor appBarBorderColor = MaterialColor( 0xFFA9A9A9, <int, Color>{ 100: Color(0xFF000000), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); //AppBar color end //Drawer color ********************************************* MaterialColor drawerLetIconMaterialColor = MaterialColor( 0xFF000000, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor drawerTextColor = MaterialColor( 0xFF000000, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor drawerRightIconColor = MaterialColor( 0xFF000000, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor drawerBgColor = MaterialColor( 0xFFFFFFFF, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor drawerBorderColor = MaterialColor( 0xFFFFFFFF, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor drawerDividerColor = MaterialColor( 0xFF000000, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor drawerBottomViewBgColor = MaterialColor( 0xFFFFFFFF, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor drawerHeaderViewBgColor = MaterialColor( 0xFFFFFFFF, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor drawerSelectedItemBgColor = MaterialColor( 0xFF000000, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor drawerSelectedItemTextColor = MaterialColor( 0xFF000000, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor drawerSelectedItemIconColor = MaterialColor( 0xFF000000, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor drawerDisabledItemColor = MaterialColor( 0xFFCCCCCC, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); //* Bottom bar color *********************************** MaterialColor bottomBarIconColor = MaterialColor( 0xFF000000, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor bottomBarTextColor = MaterialColor( 0xFF000000, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor bottomBarBgColor = MaterialColor( 0xFFFFFFFF, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor bottomBarBorderColor = MaterialColor( 0xFFeff4f9, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor bottomBarDividerColor = MaterialColor( 0xFF000000, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor bottomBarSelectedItemBgColor = MaterialColor( 0xFFDD2E37, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor bottomBarSelectedItemTextColor = MaterialColor( 0xFF00aeef, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor bottomBarSelectedItemIconColor = MaterialColor( 0xFF00aeef, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); MaterialColor bottomBarDisabledItemColor = MaterialColor( 0xFF9E9E9E, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x0D000CC0), 700: Color(0x0D000000), }, ); //*Application Main containers BG color *********************************** MaterialColor appBgColor = MaterialColor( 0xFFFFFFFF, <int, Color>{ 100: Color(0xFFfdfdfd), 200: Color(0xFFf2f4f5), 300: Color(0xFFf2f2f2), 400: Color(0xFFf4f6f7), 500: Color(0xFF33302b), 600: Color(0xFFf0f1f2), 700: Color(0x0D000000), }, ); MaterialColor appTopBgColor = MaterialColor( 0xFFFFFFFF, <int, Color>{ 100: Color(0xFF00aeef), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFf6f8f9), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); MaterialColor appCenterBgColor = MaterialColor( 0xFFFFFFFF, <int, Color>{ 100: Color(0xFF000000), 200: Color(0xFF696969), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); MaterialColor appBottomBgColor = MaterialColor( 0xFFFFFFFF, <int, Color>{ 100: Color(0xFF000000), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); //* Bottom bar color *********************************** MaterialColor appStatusBarColor = MaterialColor( 0xFF00aeef, <int, Color>{ 100: Color(0xFF00aeef), 200: Color(0xFF00aeef), 400: Color(0xFF00aeef), 500: Color(0xFF00aeef), 600: Color(0xFF00aeef), 700: Color(0xFF00aeef), }, ); MaterialColor appDisabledColor = MaterialColor( 0xFF6C6C6C, <int, Color>{ 100: Color(0xFF8D8D8D), //previous color - 0xFF6C6C6C 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); MaterialColor appErrorTextColor = MaterialColor( 0xFFDD2E37, <int, Color>{ 100: Color(0xFF000000), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFA9A9A9), }, ); MaterialColor appDividerColor = MaterialColor( 0xFF000000, <int, Color>{ 100: Color(0xFF000000), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFdadfe2), 700: Color(0x0D000000), }, ); MaterialColor appListDividerColor = MaterialColor( 0xFF000000, <int, Color>{ 100: Color(0xFF000000), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFdadfe2), 600: Color(0x1a000000), 700: Color(0x0D000000), }, ); MaterialColor appTransColor = MaterialColor( 0xFF000000, <int, Color>{ 100: Color(0xFF000000), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFCCCCCC), 600: Color(0x80000000), 700: Color(0x00000000), }, ); //Buttons Color ************************************ MaterialColor buttonBgColor = MaterialColor( 0xFF2196F3, <int, Color>{ 100: Color(0xFF00aeef), 200: Color(0xFFf9f7ef), 300: Color(0xFFf4f1ec), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFf9f7ef), 700: Color(0xFFf9f7ef), }, ); MaterialColor buttonTextColor = MaterialColor( 0xFFFFFFFF, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF0D47A1), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFF2196F3), 700: Color(0xFFC0C0C0), }, ); MaterialColor buttonIconColor = MaterialColor( 0xFFFFFFFF, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF0D47A1), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); MaterialColor buttonBorderColor = MaterialColor( 0xFFCCCCCC, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF0D47A1), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); //Card bg color ************************************ MaterialColor cardBgColor = MaterialColor( 0xFFFFFFFF, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF0D47A1), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); //Edit field Color ********************************* MaterialColor editTextColor = MaterialColor( 0xFF2c3134, <int, Color>{ 100: Color(0xFF000000), 200: Color(0xF2000000), 300: Color(0xB3000000), 400: Color(0x50000000), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); MaterialColor editTextHintColor = MaterialColor( 0xFFbcbfc3, <int, Color>{ 100: Color(0xFFa2adb5), 200: Color(0xFF8fa0b4), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); MaterialColor editTextBgColor = MaterialColor( 0xFFFFFFFF, <int, Color>{ 100: Color(0xFFf0f1f2), 200: Color(0xFFf2f2f2), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFf4f6f7), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); //Edit field Color MaterialColor editCursorColor = MaterialColor( 0xFFffc3f5, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); MaterialColor editTextFocusedBorderColor = MaterialColor( 0xFF2196F3, <int, Color>{ 100: Color(0xFFf0f1f2), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), }, ); MaterialColor editTextBorderColor = MaterialColor( 0xFFffc3f5, <int, Color>{ 100: Color(0xFFf0f1f2), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), }, ); MaterialColor editTextEnabledBorderColor = MaterialColor( 0xFFffc3f5, <int, Color>{ 100: Color(0xFFf0f1f2), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), }, ); MaterialColor editTextIconColor = MaterialColor( 0xFF000000, <int, Color>{ 100: Color(0xFF000000), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); MaterialColor editTextErrorColor = MaterialColor( 0xFFDD2E37, <int, Color>{ 100: Color(0xFF000000), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); //Text field Color ********************************* MaterialColor textBgColor = MaterialColor( 0xFFFFFFFF, <int, Color>{ 100: Color(0xFF000000), 200: Color(0xF2696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFF2196F3), 700: Color(0xFF2c3134), }, ); MaterialColor textNormalColor = MaterialColor( 0xFF2c3134, <int, Color>{ 100: Color(0xFF8d8d8d), 200: Color(0xF2bcbfc3), 300: Color(0xFFa2adb5), 400: Color(0xFF62696e), 500: Color(0xFF2c2d30), 600: Color(0xFF2196F3), 700: Color(0xFF3b3b3b), }, ); MaterialColor textSubHeadingColor = MaterialColor( 0xFF000000, <int, Color>{ 100: Color(0xFF000000), 200: Color(0xE6000000), 300: Color(0xB3000000), 400: Color(0x80000000), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); MaterialColor textHeadingColor = MaterialColor( 0xFF2c3134, <int, Color>{ 100: Color(0xFF2c3134), 200: Color(0xE6000000), 300: Color(0xB3000000), 400: Color(0x80000000), 500: Color(0xFF2196F3), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); MaterialColor textDisabledColor = MaterialColor( 0xFFCCCCCC, <int, Color>{ 100: Color(0xFFCCCCCC), 200: Color(0xFFCCCCCC), 400: Color(0xFFCCCCCC), 500: Color(0xFFCCCCCC), 600: Color(0xFFCCCCCC), 700: Color(0xFFCCCCCC), }, ); MaterialColor textIconColor = MaterialColor( 0xFF000000, <int, Color>{ 100: Color(0xFFCCCCCC), 200: Color(0xFFCCCCCC), 400: Color(0xFFCCCCCC), 500: Color(0xFFCCCCCC), 600: Color(0xFFCCCCCC), 700: Color(0xFFCCCCCC), }, ); MaterialColor textBorderColor = MaterialColor( 0xFFDD2E37, <int, Color>{ 100: Color(0xFFCCCCCC), 200: Color(0xFFCCCCCC), 400: Color(0xFFCCCCCC), 500: Color(0xFFCCCCCC), 600: Color(0xFFCCCCCC), 700: Color(0xFFCCCCCC), }, ); //List field Color ***************************** MaterialColor listRowBgColor = MaterialColor( 0xFFFFFFFF, <int, Color>{ 100: Color(0xFFf6f8f9), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0x00000000), }, ); MaterialColor listBgColor = MaterialColor( 0xFFF5F5F5, <int, Color>{ 100: Color(0x00FFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); MaterialColor listTextColor = MaterialColor( 0xFF000000, <int, Color>{ 100: Color(0x00FFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); MaterialColor listRowBorderColor = MaterialColor( 0xFFFFFFFF, <int, Color>{ 100: Color(0x00FFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); //Amount color ********************************** MaterialColor activeAmountColor = MaterialColor( 0xFF0ca84b, <int, Color>{ 100: Color(0x00FFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); MaterialColor activeAmountColor2 = MaterialColor( 0xFF32CD32, <int, Color>{ 100: Color(0x00FFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); MaterialColor chatTimeTextColor = MaterialColor( 0xFFFFFFFF, <int, Color>{ 100: Color(0xFF000000), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); MaterialColor chatSenderRowBgColor = MaterialColor( 0xFF2196F3, <int, Color>{ 100: Color(0x502196F3), 200: Color(0xFF2196F3), 300: Color(0xFF2196F3), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); MaterialColor chatSenderTextColor = MaterialColor( 0xFFFFFFFF, <int, Color>{ 100: Color(0xFFFFFFFF), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); MaterialColor chatSelfRowBgColor = MaterialColor( 0xFFf4f1ec, <int, Color>{ 100: Color(0xFFf4f1ec), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); MaterialColor chatSelfTextColor = MaterialColor( 0xFF242424, <int, Color>{ 100: Color(0xFF000000), 200: Color(0xFF696969), 300: Color(0xFF808080), 400: Color(0xFFA9A9A9), 500: Color(0xFFC0C0C0), 600: Color(0xFFC0C0C0), 700: Color(0xFFC0C0C0), }, ); MaterialAccentColor circleColor = MaterialAccentColor( 0xFF0D47A1, <int, Color>{ 100: Color(0xFF0D47A1), 200: Color(0xFFded7ca), 300: Color(0xFF00aeef), 400: Color(0xFF00aeef), 500: Color(0xFFffc3f5), 600: Color(0xFFffc3f5), 700: Color(0xFFffc3f5), }, ); MaterialAccentColor iconColor = MaterialAccentColor( 0xFF0D47A1, <int, Color>{ 100: Color(0xFFdadfe2), 200: Color(0xFF2196F3), 300: Color(0xFFf4f6f7), 400: Color(0xFFded7ca), 500: Color(0xFFffc3f5), 600: Color(0xFFffc3f5), 700: Color(0xFFffc3f5), }, ); MaterialAccentColor datetimeColor = MaterialAccentColor( 0xFF8fa0b4, <int, Color>{ 100: Color(0xFFdadfe2), 200: Color(0xFF2196F3), 300: Color(0xFF00aeef), 400: Color(0xFF00aeef), 500: Color(0xFFffc3f5), 600: Color(0xFFffc3f5), 700: Color(0xFFffc3f5), }, ); } final appColors = AppColors(); //different color opacity code /* 100% — FF 95% — F2 90% — E6 85% — D9 80% — CC 75% — BF 70% — B3 65% — A6 60% — 99 55% — 8C 50% — 80 45% — 73 40% — 66 35% — 59 30% — 4D 25% — 40 20% — 33 15% — 26 10% — 1A 5% — 0D 0% — 00 */
25.809713
77
0.606789
ae80af6712a44aec0119654884e36a2be960f694
485
cs
C#
src/Connections/IConnection.cs
achinn/fluentcassandra
ed23a146928c19ead356026eae2bef76a1e394ff
[ "Apache-2.0" ]
56
2015-01-01T17:43:25.000Z
2021-03-21T17:02:52.000Z
src/Connections/IConnection.cs
achinn/fluentcassandra
ed23a146928c19ead356026eae2bef76a1e394ff
[ "Apache-2.0" ]
6
2015-07-28T14:57:27.000Z
2018-03-21T07:20:11.000Z
src/Connections/IConnection.cs
achinn/fluentcassandra
ed23a146928c19ead356026eae2bef76a1e394ff
[ "Apache-2.0" ]
23
2015-03-09T13:55:12.000Z
2022-03-22T00:18:10.000Z
using FluentCassandra.Apache.Cassandra; using System; namespace FluentCassandra.Connections { public interface IConnection : IDisposable { DateTime Created { get; } bool IsOpen { get; } Server Server { get; } Cassandra.Client Client { get; } void SetKeyspace(string keyspace); [Obsolete("This will be retired soon, please pass the CQL version through the Execute method.", error: false)] void SetCqlVersion(string cqlVersion); void Open(); void Close(); } }
21.086957
112
0.725773
f468cf774e7e372a4c0f0b7913902df88340bfd6
1,423
ts
TypeScript
typescript-with-angular-material/src/app/hd/hd.component.ts
fergusonjason/astro-client
30eaef29f80ddd491f4ea6ee70c563314af4bd8d
[ "MIT" ]
null
null
null
typescript-with-angular-material/src/app/hd/hd.component.ts
fergusonjason/astro-client
30eaef29f80ddd491f4ea6ee70c563314af4bd8d
[ "MIT" ]
12
2020-09-20T10:05:46.000Z
2022-03-02T06:15:20.000Z
typescript-with-angular-material/src/app/hd/hd.component.ts
fergusonjason/astro-client
30eaef29f80ddd491f4ea6ee70c563314af4bd8d
[ "MIT" ]
null
null
null
import { Component, OnInit } from "@angular/core"; import { FormGroup, FormBuilder } from "@angular/forms"; import { MatTableDataSource } from "@angular/material/table"; import { AstroService } from "../astro.service"; import { IDisplaysDataTable } from "../model/DisplaysColumns"; import { IQuery } from "../model/Query"; import { HD } from "./hd"; @Component({ selector: "app-hd", templateUrl: "./hd.component.html", styleUrls: ["./hd.component.css"], providers: [AstroService] }) export class HdComponent implements OnInit, IDisplaysDataTable<HD> { queryForm: FormGroup; queryObj: IQuery = { offset: 0, limit: 20, filter: {}}; private formGroupTemplate: object = { queryField: "ID", queryOp: "$eq", queryParam: "", sortField: "ID", sortDir: 1, offset: 0, limit: 20 }; displayedItems: HD[] = []; dataSource: MatTableDataSource<HD>; displayColumns: string[] = ["ID", "Ptm", "Ptg", "Intensity", "SpectralType", "Rem"]; queryableFields: any[] = ["ID"]; allowedOperations: string[] = ["$eq", "$ne"]; constructor(private astroService: AstroService, private formBuilder: FormBuilder) { this.formBuilder.group(this.formGroupTemplate); } ngOnInit() { this.astroService.getPage<HD>("hd", 0, 20).subscribe((data) => { this.displayedItems = data.result; this.dataSource = new MatTableDataSource<HD>(this.displayedItems); }); } }
24.534483
86
0.657063
1a9a0a7194937f6c2c468824b9cea3bb2f16bdc5
745
py
Python
roles/dustinspecker.vim/molecule/default/tests/test_default.py
dustinspecker/ansible-dotfiles
cada81d6ad52bd900041b72250b68a74fe3928e6
[ "MIT" ]
1
2022-03-01T13:59:13.000Z
2022-03-01T13:59:13.000Z
roles/dustinspecker.vim/molecule/default/tests/test_default.py
dustinspecker/ansible-dotfiles
cada81d6ad52bd900041b72250b68a74fe3928e6
[ "MIT" ]
13
2019-01-22T14:52:29.000Z
2021-12-06T17:32:13.000Z
roles/dustinspecker.vim/molecule/default/tests/test_default.py
dustinspecker/ansible-dotfiles
cada81d6ad52bd900041b72250b68a74fe3928e6
[ "MIT" ]
null
null
null
import os import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') def test_vim_apt_repo_setup(host): assert host.file('/etc/apt/sources.list.d/vim.list').exists def test_vim_installed(host): assert host.package('vim').is_installed def test_vimrc_copied(host): assert host.file('/home/ubuntu/.vimrc').exists def test_vim_plug_installed(host): assert host.file('/home/ubuntu/.vim/autoload/plug.vim').exists def test_vim_plugins_installed(host): assert host.file('/home/ubuntu/.vim/plugged').exists def test_vim_has_clipboard_support(host): assert host.run_expect([0], "vim --version | grep +clipboard")
24.032258
66
0.758389
7e62228852ac1e27665925a658fadaf627c1ab18
467
rs
Rust
examples/custom_property.rs
hoodie/icalendar-rs
c0ffee24858e0739b9964395d0ae61f6a582aa94
[ "MIT" ]
44
2016-11-11T23:26:21.000Z
2022-03-12T12:34:42.000Z
examples/custom_property.rs
hoodie/icalendar-rs
c0ffee24858e0739b9964395d0ae61f6a582aa94
[ "MIT" ]
20
2017-04-21T09:27:50.000Z
2021-12-19T11:16:09.000Z
examples/custom_property.rs
hoodie/icalendar-rs
c0ffee24858e0739b9964395d0ae61f6a582aa94
[ "MIT" ]
13
2017-04-20T22:09:43.000Z
2021-03-20T19:14:40.000Z
use icalendar::*; fn main() -> Result<(), Box<dyn std::error::Error>> { let event = Event::new() .summary("test event") .append_property( Property::new("TEST", "FOOBAR") .add_parameter("IMPORTANCE", "very") .add_parameter("DUE", "tomorrow") .done(), ) .uid("my.own.id") .done(); let calendar = Calendar::from([event]); calendar.print()?; Ok(()) }
22.238095
53
0.477516
584371fe1b72bfd6a3321dca313819f0de21a9e4
977
podspec
Ruby
ConfettiView-NSHipster.podspec
chepiok/ConfettiView
07d4dd486d6cc22dd4e4b363471477b895622380
[ "MIT" ]
null
null
null
ConfettiView-NSHipster.podspec
chepiok/ConfettiView
07d4dd486d6cc22dd4e4b363471477b895622380
[ "MIT" ]
null
null
null
ConfettiView-NSHipster.podspec
chepiok/ConfettiView
07d4dd486d6cc22dd4e4b363471477b895622380
[ "MIT" ]
null
null
null
# frozen_string_literal: true Pod::Spec.new do |s| s.name = 'ConfettiView-NSHipster' s.module_name = 'ConfettiView' s.version = '0.2.0' s.summary = 'A view that emits confetti.' s.description = <<~DESC A view that emits confetti with shapes, images, and text of your choosing for a specified duration, and then fades out. DESC s.homepage = 'https://github.com/nshipster/ConfettiView' s.screenshots = 'https://user-images.githubusercontent.com/7659/63643817-48c47100-c68e-11e9-9d02-cbcc79b178bf.gif' s.license = { type: 'MIT', file: 'LICENSE' } s.author = { 'Mattt' => 'mattt@nshipster.com' } s.source = { git: 'https://github.com/NSHipster/ConfettiView.git', tag: s.version.to_s } s.social_media_url = 'https://twitter.com/nshipster' s.ios.deployment_target = '10.0' s.swift_versions = ['5.1'] s.source_files = 'Sources/**/*' s.frameworks = 'UIKit' end
36.185185
123
0.635619
1439ce8b141c64abc000e56ac2894af582616883
1,335
ts
TypeScript
src/controllers/carrera.controller.ts
LucasNahuel945/API_materias
46d30764763482fa0a2bb9ca71a759426b01a48e
[ "MIT" ]
null
null
null
src/controllers/carrera.controller.ts
LucasNahuel945/API_materias
46d30764763482fa0a2bb9ca71a759426b01a48e
[ "MIT" ]
1
2021-03-23T13:02:44.000Z
2021-03-23T13:02:44.000Z
src/controllers/carrera.controller.ts
LucasNahuel945/API_materias
46d30764763482fa0a2bb9ca71a759426b01a48e
[ "MIT" ]
null
null
null
import { Request, Response } from 'express'; import { getRepository } from 'typeorm'; import Carrera from '../entities/carrera'; export const getCarreras = async ( req: Request, res: Response, ): Promise<Response> => { const carreras = await getRepository(Carrera).find(); return res.json(carreras); }; export const getCarrera = async ( req: Request, res: Response, ): Promise<Response> => { const results = await getRepository(Carrera).findOne(req.params.id); return res.json(results); }; export const createCarrera = async (req:Request, res: Response): Promise<Response> => { const newCarrera = getRepository(Carrera).create(req.body); const results = await getRepository(Carrera).save(newCarrera); return res.json(results); }; export const updateCarrera = async ( req: Request, res: Response, ): Promise<Response> => { const carrera = await getRepository(Carrera).findOne(req.params.id); if (carrera) { getRepository(Carrera).merge(carrera, req.body); const results = await getRepository(Carrera).save(carrera); return res.json(results); } return res.json({ msg: 'Carrera not found' }); }; export const deleteCarrera = async (req: Request, res: Response): Promise<Response> => { const results = await getRepository(Carrera).delete(req.params.id); return res.json(results); };
29.666667
88
0.709363
0a157bfe264bbef276ea286e5d20d542a2deff21
1,751
swift
Swift
Sources/CZNetworking/StubSupport/URLProtocolMock.swift
geekaurora/CZNetworking
8b886524ee1805eb25a2ac5159279c904c9af69d
[ "MIT" ]
9
2017-10-01T04:48:23.000Z
2017-10-24T01:31:23.000Z
Sources/CZNetworking/StubSupport/URLProtocolMock.swift
showt1me/CZNetworking
d7b96c26ceeb35b9c137428781e374ca72603af2
[ "MIT" ]
4
2021-05-30T03:15:03.000Z
2022-01-25T13:30:36.000Z
Sources/CZNetworking/StubSupport/URLProtocolMock.swift
geekaurora/CZNetworking
8b886524ee1805eb25a2ac5159279c904c9af69d
[ "MIT" ]
null
null
null
import Foundation import CZUtils /** Mock that be used to inject data into default`URLSession` with `URLSessionConfiguration`. - Note: Return mockData for `url` if exists, otherwise it will let other URLProtocols to handle it. */ public class URLProtocolMock: URLProtocol { // TestData for url - [testURL: testData]. public typealias MockDataMap = [URL: Data] static var mockDataMap = MockDataMap() // MARK: - Whether to handle request public override class func canInit(with request: URLRequest) -> Bool { // Only handle `url` if exists in `mockDataMap`. if let url = request.url, Self.mockDataMap[url] != nil { return true } return false } // MARK: - Load data /** Return mockData for `url` if exists, otherwise call `super.startLoading()`. */ public override func startLoading() { // Check whether `url` exists in `mockDataMap`. if let url = request.url, let data = Self.mockDataMap[url] { let response = HTTPURLResponse(url: url, statusCode: 200, httpVersion: nil, headerFields: nil)! self.client?.urlProtocol(self, didReceive: response, cacheStoragePolicy: .notAllowed) // Return mockData for `url`. self.client?.urlProtocol(self, didLoad: data) // Mark as finished. self.client?.urlProtocolDidFinishLoading(self) return } // Otherwise call `super.startLoading()` to handle it. super.startLoading() } public override func stopLoading() {} public override class func canonicalRequest(for request: URLRequest) -> URLRequest { return request } // TODO: Check url of URLSessionTask. // public override class func canInit(with task: URLSessionTask) -> Bool {} }
30.719298
101
0.671616
dfa7942a5a8c0b0f788332f7739418218bd6d8d7
858
cs
C#
Src/ClashClient/Net/IApiClient.cs
xDaevax/clash-client
4c01ebd444c37e57bc687d9ebe1ff41721d6904d
[ "MIT" ]
2
2016-03-22T00:25:25.000Z
2020-10-20T20:27:42.000Z
Src/ClashClient/Net/IApiClient.cs
xDaevax/clash-client
4c01ebd444c37e57bc687d9ebe1ff41721d6904d
[ "MIT" ]
null
null
null
Src/ClashClient/Net/IApiClient.cs
xDaevax/clash-client
4c01ebd444c37e57bc687d9ebe1ff41721d6904d
[ "MIT" ]
1
2016-03-08T19:07:14.000Z
2016-03-08T19:07:14.000Z
namespace ClashClient.Net { /// <summary> /// Interface that exposes a contract for a client that can consume the clash-of-clans API. /// </summary> public interface IApiClient { #region --Functions-- /// <summary> /// Returns the data from making a call to the clash-of-clans API. /// </summary> /// <typeparam name="TResponse">The type of response object expected back from the API.</typeparam> /// <param name="apiRequest">The <see cref="ApiRequest"/> that contains the data used to customize the API call.</param> /// <returns>A new <see cref="ApiResponse"/> instance with the results of the API call.</returns> ApiResponse<TResponse> Load<TResponse>(ApiRequest apiRequest) where TResponse : class; #endregion } // end interface IApiClient } // end namespace
45.157895
128
0.652681
7596d54b40cd2b4c01581d4881da2fd1f97dac71
611
css
CSS
css/resume.css
johnholl/johnholl.github.io
215b62368d9662def7fea20dd668af32482db052
[ "MIT" ]
null
null
null
css/resume.css
johnholl/johnholl.github.io
215b62368d9662def7fea20dd668af32482db052
[ "MIT" ]
null
null
null
css/resume.css
johnholl/johnholl.github.io
215b62368d9662def7fea20dd668af32482db052
[ "MIT" ]
null
null
null
.highlightcolumn { flex: 25%; background-color: #2526A6; color: white; padding: 10px; } .highlightcolumn > * { margin: 10px 0; } .detailcolumn { flex: 50%; padding:10px; } .detailcolumn > * { margin:10px; } .datescolumn{ flex:10% } .experiencecolumn{ flex:90% } .detailcolumn h1 { color: #2526A6; } .row { display: flex; } h3 { background-color: #14155E; padding: 5px 5px 5px 5px; } .attribute { font-weight: bold; } hr.solid { border-top: 1px solid #bbb; } ul > * { margin: 10px 0; } body { font-family: Calibri; }
10.910714
31
0.563011
cac87fbbb23b349f792885ecfd4200ba738be896
584
cs
C#
Assets/Scripts/ScaleScript.cs
jotheshjolly/COVID19AR
b0b32ed71e8f713e31f0fd4072f72a9569555bd3
[ "MIT" ]
2
2020-09-27T15:45:41.000Z
2021-06-15T04:05:10.000Z
Assets/Scripts/ScaleScript.cs
jotheshjolly/COVID19AR
b0b32ed71e8f713e31f0fd4072f72a9569555bd3
[ "MIT" ]
null
null
null
Assets/Scripts/ScaleScript.cs
jotheshjolly/COVID19AR
b0b32ed71e8f713e31f0fd4072f72a9569555bd3
[ "MIT" ]
null
null
null
using System.Collections; using System.Collections.Generic; using UnityEngine; public class ScaleScript : MonoBehaviour { public float min = 0.5f; public float max = 2.5f; void Start() { var recognizer = new TKPinchRecognizer(); recognizer.gestureRecognizedEvent += ( r ) => { Vector3 newScale = transform.localScale + Vector3.one * recognizer.deltaScale; if (newScale.x > min && newScale.x < max) { transform.localScale = newScale; } }; TouchKit.addGestureRecognizer( recognizer ); } }
25.391304
94
0.626712
05fa64741db475afdb8a2a8628222bd718e7bd0f
185
py
Python
src/api/models/article/author.py
nhardy/py-js-web-scaffold
adf3e3ada0b21cdb9620676de795579107442dd7
[ "MIT" ]
null
null
null
src/api/models/article/author.py
nhardy/py-js-web-scaffold
adf3e3ada0b21cdb9620676de795579107442dd7
[ "MIT" ]
null
null
null
src/api/models/article/author.py
nhardy/py-js-web-scaffold
adf3e3ada0b21cdb9620676de795579107442dd7
[ "MIT" ]
null
null
null
from ..base import BaseModel from ..href import HrefModel class AuthorModel(BaseModel): def init(self): self.add_property('name') self.add_model_property('link', HrefModel)
20.555556
46
0.740541
e70182bd47a12a316edad35332904ce320597335
10,661
php
PHP
resources/views/manage/hosocanbo/include/luong.blade.php
mylovecoi/hsns
f39308da9a1ae84269db82129cfd73ae5f7aae4f
[ "MIT" ]
1
2016-06-16T08:27:43.000Z
2016-06-16T08:27:43.000Z
resources/views/manage/hosocanbo/include/luong.blade.php
mylovecoi/hsns
f39308da9a1ae84269db82129cfd73ae5f7aae4f
[ "MIT" ]
null
null
null
resources/views/manage/hosocanbo/include/luong.blade.php
mylovecoi/hsns
f39308da9a1ae84269db82129cfd73ae5f7aae4f
[ "MIT" ]
null
null
null
<!--form1 thông tin cơ bản --> <div id="tab4" class="tab-pane" > <div class="form-horizontal"> <div class="row"> <div class="col-md-4"> <div class="form-group"> <label class="col-sm-6 control-label" for="plnb">Mã ngạch <span class="require">*</span></label> <div class="col-sm-6 controls"> {!!Form::text('msngbac', null, array('id' => 'msngbac','class' => 'form-control','autofocus'=>'autofocus','readonly'=>'true'))!!} </div> </div> </div> <!-- 1. Tham chiếu thông tin bên bảng ngachbac --> <div class="col-md-4"> <div class="form-group"> <label class="col-sm-6 control-label">Nhóm ngạch bậc </label> <div class="col-sm-6"> <select class="form-control" name="plnb" id="plnb" onchange="getPLNB()"> <option value="">-- Chọn nhóm ngạch bậc --</option> @if(!isset($m_msnb)) @foreach($m_plnb as $nb) <option value="{{$nb->plnb}}">{{$nb->plnb}}</option> @endforeach @else @foreach($m_plnb as $nb) <option value="{{$nb->plnb}}" {{$m_msnb->plnb==$nb->plnb?'selected':''}} >{{$nb->plnb}}</option> @endforeach @endif </select> </div> </div> </div> <div class="col-md-4"> <div class="form-group"> <label class="col-sm-6 control-label">Tên ngạch bậc </label> <div class="col-sm-6"> <select class="form-control" name="tennb" id="tennb" onchange="getBac()"> <option value="">-- Chọn tên ngạch bậc --</option> @if(isset($m_msnb)) @foreach($m_pln as $nb) <option value="{{$nb->tennb}}" {{$m_msnb->tennb==$nb->tennb?'selected':''}} >{{$nb->tennb}}</option> @endforeach @endif </select> </div> </div> </div> <!-- Hết 1. --> </div> <div class="row"> <div class="col-md-4"> <div class="form-group"> <label class="col-sm-6 control-label">Bậc lương </label> <div class="col-sm-6 controls"> <select class="form-control" name="bac" id="bac" onchange="getHS()"> <option value="">-- Chọn bậc lương --</option> @if(isset($m_msnb)) @foreach($m_bac as $nb) <option value="{{$nb->bac}}" {{$model->bac==$nb->bac?'selected':''}} >{{$nb->bac}}</option> @endforeach @endif </select> </div> </div> </div> <div class="col-md-4"> <div class="form-group"> <label class="col-sm-6 control-label">Hệ số lương </label> <div class="col-sm-6 controls"> {!!Form::text('heso', null, array('id' => 'heso','class' => 'form-control', 'data-mask'=>'fdecimal'))!!} </div> </div> </div> <div class="col-md-4"> <div class="form-group"> <label class="col-sm-6 control-label">Hệ số vượt khung </label> <div class="col-sm-6 controls"> {!!Form::text('vuotkhung', null, array('id' => 'vuotkhung','class' => 'form-control', 'data-mask'=>'fdecimal'))!!} </div> </div> </div> </div> <div class="row"> <div class="col-md-4"> <div class="form-group"> <label class="col-sm-6 control-label">Phần trăm hưởng </label> <div class="col-sm-6 controls"> {!!Form::text('pthuong', null, array('id' => 'pthuong','class' => 'form-control', 'data-mask'=>'fdecimal'))!!} </div> </div> </div> <div class="col-md-4"> <div class="form-group"> <label class="col-sm-6 control-label">Từ ngày <span class="require">*</span></label> <div class="col-sm-6 controls"> {!! Form::input('date','ngaytu',null,array('id' => 'ngaytu', 'class' => 'form-control'))!!} </div> </div> </div> <div class="col-md-4"> <div class="form-group"> <label class="col-sm-6 control-label">Đến ngày <span class="require">*</span></label> <div class="col-sm-6 controls"> {!! Form::input('date','ngayden',null,array('id' => 'ngayden', 'class' => 'form-control'))!!} </div> </div> </div> </div> <div class="row"> <div class="col-md-4"> <div class="form-group"> <label class="col-sm-6 control-label">Phụ cấp chức vụ </label> <div class="col-sm-6 controls"> {!!Form::text('pccv', null, array('id' => 'pccv','class' => 'form-control', 'data-mask'=>'fdecimal'))!!} </div> </div> </div> <div class="col-md-4"> <div class="form-group"> <label class="col-sm-6 control-label">PC thâm niên nghề </label> <div class="col-sm-6 controls"> {!!Form::text('pctnn', null, array('id' => 'pctnn','class' => 'form-control', 'data-mask'=>'fdecimal'))!!} </div> </div> </div> <div class="col-md-4"> <div class="form-group"> <label class="col-sm-6 control-label">PC thâm niên VK </label> <div class="col-sm-6 controls"> {!!Form::text('pcvk', null, array('id' => 'pcvk','class' => 'form-control', 'data-mask'=>'fdecimal'))!!} </div> </div> </div> </div> <div class="row"> <div class="col-md-4"> <div class="form-group"> <label class="col-sm-6 control-label">Phụ cấp kiêm nhiệm </label> <div class="col-sm-6 controls"> {!!Form::text('pckn', null, array('id' => 'pckn','class' => 'form-control', 'data-mask'=>'fdecimal'))!!} </div> </div> </div> <div class="col-md-4"> <div class="form-group"> <label class="col-sm-6 control-label">Phụ cấp trách nhiệm </label> <div class="col-sm-6 controls"> {!!Form::text('pctn', null, array('id' => 'pctn','class' => 'form-control', 'data-mask'=>'fdecimal'))!!} </div> </div> </div> <div class="col-md-4"> <div class="form-group"> <label class="col-sm-6 control-label">Phụ cấp khu vực </label> <div class="col-sm-6 controls"> {!!Form::text('pckv', null, array('id' => 'pckv','class' => 'form-control', 'data-mask'=>'fdecimal'))!!} </div> </div> </div> </div> <div class="row"> <div class="col-md-4"> <div class="form-group"> <label class="col-sm-6 control-label">Phụ cấp thu hút </label> <div class="col-sm-6 controls"> {!!Form::text('pcth', null, array('id' => 'pcth','class' => 'form-control', 'data-mask'=>'fdecimal'))!!} </div> </div> </div> <div class="col-md-4"> <div class="form-group"> <label class="col-sm-6 control-label">Phụ cấp ưu đãi </label> <div class="col-sm-6 controls"> {!!Form::text('pcudn', null, array('id' => 'pcudn','class' => 'form-control', 'data-mask'=>'fdecimal'))!!} </div> </div> </div> <div class="col-md-4"> <div class="form-group"> <label class="col-sm-6 control-label">Phụ cấp đặc biệt </label> <div class="col-sm-6 controls"> {!!Form::text('pcdbn', null, array('id' => 'pcdbn','class' => 'form-control', 'data-mask'=>'fdecimal'))!!} </div> </div> </div> </div> <div class="row"> <div class="col-md-4"> <div class="form-group"> <label class="col-sm-6 control-label">Phụ cấp lưu động </label> <div class="col-sm-6 controls"> {!!Form::text('pcld', null, array('id' => 'pcld','class' => 'form-control', 'data-mask'=>'fdecimal'))!!} </div> </div> </div> <div class="col-md-4"> <div class="form-group"> <label class="col-sm-6 control-label">Phụ cấp độc hại </label> <div class="col-sm-6 controls"> {!!Form::text('pcdh', null, array('id' => 'pcdh','class' => 'form-control', 'data-mask'=>'fdecimal'))!!} </div> </div> </div> <div class="col-md-4"> <div class="form-group"> <label class="col-sm-6 control-label">Phụ cấp khác </label> <div class="col-sm-6 controls"> {!!Form::text('pck', null, array('id' => 'pck','class' => 'form-control', 'data-mask'=>'fdecimal'))!!} </div> </div> </div> </div> </div> </div> @include('includes.script.func_msnb') <!--end form4 -->
42.474104
153
0.396492
aa8cd021798d1309d5864ea8909653353d6e9227
2,674
sql
SQL
src/SFA.Apprenticeships.Data.AvmsPlus/Scripts/Data/Reference.StandardSector.Upsert.sql
BugsUK/FindApprenticeship
cd261c9199c3563031aab66582c0a10ecc055f8a
[ "MIT" ]
2
2019-02-14T17:06:44.000Z
2021-02-22T13:02:31.000Z
src/SFA.Apprenticeships.Data.AvmsPlus/Scripts/Data/Reference.StandardSector.Upsert.sql
BugsUK/FindApprenticeship
cd261c9199c3563031aab66582c0a10ecc055f8a
[ "MIT" ]
1
2020-03-13T15:39:54.000Z
2020-03-13T15:39:54.000Z
src/SFA.Apprenticeships.Data.AvmsPlus/Scripts/Data/Reference.StandardSector.Upsert.sql
BugsUK/FindApprenticeship
cd261c9199c3563031aab66582c0a10ecc055f8a
[ "MIT" ]
2
2020-03-13T15:27:47.000Z
2020-11-04T04:39:21.000Z
SET IDENTITY_INSERT [Reference].[StandardSector] ON; MERGE INTO [Reference].[StandardSector] AS Target USING (VALUES (1, N'Actuarial', 1), (2, N'Aerospace', 17), (3, N'Automotive', 17), (4, N'Automotive retail', 13), (5, N'Butchery', 13), (6, N'Conveyancing and probate', 1), (7, N'Defence', 17), (8, N'Dental health', 20), (9, N'Digital Industries', 15), (10, N'Electrotechnical', 17), (11, N'Energy & Utilities', 17), (12, N'Financial Services', 1), (13, N'Food and Drink', 17), (14, N'Horticulture', 1), (15, N'Insurance', 1), (16, N'Law', 1), (17, N'Leadership & Management', 1), (18, N'Life and Industrial Sciences', 17), (19, N'Maritime', 17), (20, N'Newspaper and Broadcast Media', 3), (21, N'Nuclear', 17), (22, N'Property services', 7), (23, N'Public Service', 20), (24, N'Rail Design', 17), (25, N'Refrigeration Air Conditioning and Heat Pump (RACHP)', 17), (26, N'Surveying', 7), (27, N'Housing', 20), (28, N'Non-destructive Testing', 17), (29, N'Energy Management', 13), (30, N'Visual Effects', 15), (31, N'Aviation', 17), (32, N'Bespoke Tailoring', 13), (33, N'Boatbuilding', 17), (34, N'Hospitality', 13), (35, N'Engineering, Design and Draughting', 17), (36, N'Healthcare', 20), (37, N'Management Consultancy', 1), (38, N'Land-Based Engineering', 17), (39, N'Live Events', 17), (40, N'Advanced Manufacturing', 17), (41, N'Welding', 17), (42, N'TV Production & Broadcasting', 13), (43, N'Rail Engineering', 17), (44, N'Retail', 13), (45, N'Transport', 17), (46,N'Accounting',1), (47,N'Adult care',20), (48,N'Airworthiness',17), (49,N'Construction',7), (50,N'Customer service',13), (51,N'Electronic Systems',17), (52,N'Fire Emergency and Security Systems',17), (53,N'HM Armed Forces',20), (54,N'Logistics and Supply Chain',17), (55,N'Papermaking',7), (56,N'Project Management',1), (57,N'Public Sector',20), (58,N'Travel',13), (59,N'Bus, Coach and HGV',17), (60,N'Furniture',17), (61,N'Groundsmanship',1), (62,N'Media',1) ) AS Source (StandardSectorId, FullName, ApprenticeshipOccupationId) ON Target.StandardSectorId = Source.StandardSectorId -- update matched rows WHEN MATCHED THEN UPDATE SET FullName = Source.FullName, ApprenticeshipOccupationId = Source.ApprenticeshipOccupationId -- insert new rows WHEN NOT MATCHED BY TARGET THEN INSERT (StandardSectorId, FullName, ApprenticeshipOccupationId) VALUES (StandardSectorId, FullName, ApprenticeshipOccupationId) -- delete rows that are in the target but not the source WHEN NOT MATCHED BY SOURCE THEN DELETE; SET IDENTITY_INSERT [Reference].[StandardSector] OFF;
33.012346
101
0.655572
45b0417b5ab3724d4b1cdf390370677b80510f31
3,229
py
Python
utils.py
techner3/Wikipedia_Scrapper
05a1f1799655acbc5b6b70bbd7cfe49ba1dd9049
[ "MIT" ]
null
null
null
utils.py
techner3/Wikipedia_Scrapper
05a1f1799655acbc5b6b70bbd7cfe49ba1dd9049
[ "MIT" ]
null
null
null
utils.py
techner3/Wikipedia_Scrapper
05a1f1799655acbc5b6b70bbd7cfe49ba1dd9049
[ "MIT" ]
null
null
null
from nltk.corpus import stopwords from nltk.tokenize import word_tokenize, sent_tokenize import base64 import requests import re import pandas as pd from logger import getLog logger=getLog('Utils.py') def beautifyTextData(info): try: text='' for content in info: text+=content.text text = re.sub(r'\[.*?\]+', '', text) text=text.replace('\n', '') logger.info('Text data beautified') return text except Exception as e: logger.exception(f"Failed to beautify Text data: \n{e}") def summarize(info): try: text=beautifyTextData(info) stopWords = set(stopwords.words("english")) words = word_tokenize(text) freqTable = dict() for word in words: word = word.lower() if word in stopWords: continue if word in freqTable: freqTable[word] += 1 else: freqTable[word] = 1 sentences = sent_tokenize(text) sentenceValue = dict() for sentence in sentences: for word, freq in freqTable.items(): if word in sentence.lower(): if sentence in sentenceValue: sentenceValue[sentence] += freq else: sentenceValue[sentence] = freq sumValues = 0 for sentence in sentenceValue: sumValues += sentenceValue[sentence] average = int(sumValues / len(sentenceValue)) summary = '' for sentence in sentences: if (sentence in sentenceValue) and (sentenceValue[sentence] > (1.2 * average)): summary += " " + sentence logger.info("Text data summarized") return summary except Exception as e: logger.exception("Failed to summarize text data : \n{e}") def Imgtobase64(img): encodedImg=base64.b64encode(img) return encodedImg def beautifyLink(textLink,searchString): if "http" not in textLink: if "#" in textLink: appendLink="https://en.wikipedia.org/"+searchString+"/"+str(textLink) elif "wiki" in textLink: appendLink="https://en.wikipedia.org/"+str(textLink) else: appendLink="https://"+str(textLink) else: appendLink=textLink return appendLink def beautifyLinkData(info,searchString): try: refList=[] for link in info: appendLink=beautifyLink(link['href'],searchString) refList.append(appendLink) logger.info("Link data beautified") return refList except Exception as e: logger.exception(f"Failed to beautify link data: \n{e}") def beautifyImgdata(info): try: imgList=[] for imglink in info: img=requests.get("https:"+str(imglink['src']),stream = True) encodeImg=Imgtobase64(img.content) imgList.append(encodeImg) logger.info("Image data beautfied") return imgList except Exception as e: logger.exception(f"Failed to beautify image data: \n{e}") def Dict_DF(data): return pd.DataFrame(data)
29.09009
91
0.580056
c511b84ec45b07ebf746ccbabb1256d519bf54f9
107
css
CSS
web/app/themes/theme/tailwind/custom/fonts.css
GooUlla/starter
e461445f706ac925ac6b99dc7d1c4b943f91ff97
[ "MIT" ]
null
null
null
web/app/themes/theme/tailwind/custom/fonts.css
GooUlla/starter
e461445f706ac925ac6b99dc7d1c4b943f91ff97
[ "MIT" ]
null
null
null
web/app/themes/theme/tailwind/custom/fonts.css
GooUlla/starter
e461445f706ac925ac6b99dc7d1c4b943f91ff97
[ "MIT" ]
null
null
null
/** * Custom `@font-face` rules * * These will be added immediately before Tailwind’s `base` layer. */
17.833333
66
0.654206
3901afac46ec6c84fa8df4ed80c74bb44b5c7ec9
2,658
py
Python
google/cloud/pubsublite/types/paths.py
tmdiep/python-pubsublite
8edef6708fab60ce29c040f3de60783fe31b55ae
[ "Apache-2.0" ]
null
null
null
google/cloud/pubsublite/types/paths.py
tmdiep/python-pubsublite
8edef6708fab60ce29c040f3de60783fe31b55ae
[ "Apache-2.0" ]
null
null
null
google/cloud/pubsublite/types/paths.py
tmdiep/python-pubsublite
8edef6708fab60ce29c040f3de60783fe31b55ae
[ "Apache-2.0" ]
null
null
null
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from typing import NamedTuple, Union from google.api_core.exceptions import InvalidArgument from google.cloud.pubsublite.types.location import CloudZone class LocationPath(NamedTuple): project: Union[int, str] location: CloudZone def __str__(self): return f"projects/{self.project}/locations/{self.location}" class TopicPath(NamedTuple): project: Union[int, str] location: CloudZone name: str def __str__(self): return f"projects/{self.project}/locations/{self.location}/topics/{self.name}" def to_location_path(self): return LocationPath(self.project, self.location) @staticmethod def parse(to_parse: str) -> "TopicPath": splits = to_parse.split("/") if ( len(splits) != 6 or splits[0] != "projects" or splits[2] != "locations" or splits[4] != "topics" ): raise InvalidArgument( "Topic path must be formatted like projects/{project_number}/locations/{location}/topics/{name} but was instead " + to_parse ) return TopicPath(splits[1], CloudZone.parse(splits[3]), splits[5]) class SubscriptionPath(NamedTuple): project: Union[int, str] location: CloudZone name: str def __str__(self): return f"projects/{self.project}/locations/{self.location}/subscriptions/{self.name}" def to_location_path(self): return LocationPath(self.project, self.location) @staticmethod def parse(to_parse: str) -> "SubscriptionPath": splits = to_parse.split("/") if ( len(splits) != 6 or splits[0] != "projects" or splits[2] != "locations" or splits[4] != "subscriptions" ): raise InvalidArgument( "Subscription path must be formatted like projects/{project_number}/locations/{location}/subscriptions/{name} but was instead " + to_parse ) return SubscriptionPath(splits[1], CloudZone.parse(splits[3]), splits[5])
32.414634
143
0.651242
1a57ff2ab97fb14495e8b34972b20131ae84e47d
550
py
Python
scratch/haar_wavelets.py
hvanwyk/drifter
a08df0cef81bc6ca76084ae8cac089644e2bd56b
[ "MIT" ]
6
2019-06-04T09:26:15.000Z
2021-10-21T05:00:23.000Z
scratch/haar_wavelets.py
hvanwyk/drifter
a08df0cef81bc6ca76084ae8cac089644e2bd56b
[ "MIT" ]
9
2018-02-28T22:04:43.000Z
2022-02-18T17:14:30.000Z
scratch/haar_wavelets.py
hvanwyk/drifter
a08df0cef81bc6ca76084ae8cac089644e2bd56b
[ "MIT" ]
null
null
null
from mesh import QuadMesh, Mesh1D from plot import Plot from fem import QuadFE, DofHandler from function import Explicit import numpy as np plot = Plot() mesh = Mesh1D() Q0 = QuadFE(1,'DQ0') dh0 = DofHandler(mesh,Q0) n_levels = 10 for l in range(n_levels): mesh.cells.refine(new_label=l) dh0.distribute_dofs(subforest_flag=l) f = Explicit(lambda x: np.abs(x-0.5), dim=1) fQ = f.interpolant(dh0, subforest_flag=3) plot.line(fQ, mesh) plot.mesh(mesh, dofhandler=dh0, subforest_flag=0) mesh = QuadMesh(resolution=(10,10)) plot.mesh(mesh)
21.153846
49
0.734545
f6a4d0c57c26e51c04242c8ef1ac5b784a9dd4a7
7,553
lua
Lua
asteroides/principal.lua
izaquias/Asteroides
c6d118f882269832d7b988f687be3cc7d304494c
[ "MIT" ]
null
null
null
asteroides/principal.lua
izaquias/Asteroides
c6d118f882269832d7b988f687be3cc7d304494c
[ "MIT" ]
null
null
null
asteroides/principal.lua
izaquias/Asteroides
c6d118f882269832d7b988f687be3cc7d304494c
[ "MIT" ]
null
null
null
--code here --Cena principal local composer = require("composer") local scene = composer.newScene() local widget = require("widget") local physics = require("physics") physics.start() physics.setGravity( 0, 9.8) physics.setDrawMode("normal") math.randomseed( os.time() ) local sheetInfo = require("sprites.sprite") local sheetObjects = graphics.newImageSheet( "sprites/sprite.png", sheetInfo:getSheet() ) local w = display.contentWidth local h = display.contentHeight local asteroidsTable = {} --local fundo = {} local buttons = {} local vidaTexto local pontosTexto local vidas = 3 local pontos = 0 local morreu = false local navePlayer local gameLoopTimer local grupoPlanodeFundo = display.newGroup() local menuJogo = display.newGroup() local uiGrupo = display.newGroup() local novoAsteroid = {} local asteroid local fundoTela --[[ --buttons[1] = display.newRect(0, 0, 60, 80) buttons[1] = display.newImage("button.png") buttons[1].x = 495 buttons[1].y = 880 buttons[1].move = "up" buttons[1].rotation = -90 buttons[2] = display.newImage("button.png") buttons[2].x = 495 buttons[2].y = 1020 buttons[2].move = "down" buttons[2].rotation = 90 buttons[3] = display.newImage("button.png") buttons[3].x = 380 buttons[3].y = 950 buttons[3].move = "left" buttons[3].rotation = 180 buttons[4] = display.newImage("button.png") buttons[4].x = 600 buttons[4].y = 950 buttons[4].move = "right" function scene:create(evento) local CenaGrupo = self.view phase = evento.phase fundoTela = display.newImageRect(grupoPlanodeFundo, "fundo.png", 800, 1400) fundoTela.x = display.contentCenterX fundoTela.y = display.contentCenterY CenaGrupo:insert(fundoTela) vidaTexto = display.newText( uiGrupo, "vidas: ".. vidas, 200, 80, native.systemFont, 36 ) pontosTexto = display.newText( uiGrupo, "pontos: "..pontos, 600, 80, native.systemFont, 36 ) CenaGrupo:insert(vidaTexto) CenaGrupo:insert(pontosTexto) navePlayer = display.newImageRect("ship.png", 200, 200) --physics.addBody( navePlayer, {radius = 30}) navePlayer.x = w * .5 + 10 navePlayer.y = h * .5 + 150 CenaGrupo:insert(navePlayer) --buttons[1] = display.newRect(0, 0, 60, 80) CenaGrupo:insert(buttons[1]) --buttons[2] = display.newRect(0, 0, 60, 80) CenaGrupo:insert(buttons[2]) --buttons[3] = display.newRect(0, 0, 80, 60) CenaGrupo:insert(buttons[3]) --buttons[4] = display.newRect(0, 0, 80, 60) CenaGrupo:insert(buttons[4]) end -- show() function scene:show(evento) local CenaGrupo = self.view local phase = evento.phase if ( phase == "did") then -- Code here runs when the scene is still off screen (but is about to come on screen) end end -- hide() function scene:hide(evento) local CenaGrupo = self.view local phase = evento.phase if ( phase == "will" ) then -- Code here runs when the scene is on screen (but is about to go off screen) end end -- destroy() function scene:destroy(evento) local CenaGrupo = self.view -- Code here runs prior to the removal of scene's view end local function criarAsteroid(evento) asteroid = display.newCircle( menuJogo, display.contentCenterX, display.contentCenterY, 30) asteroid:setFillColor( 0.2 ) asteroid.strokeWidth = 5 asteroid:setStrokeColor( 1, 0, 0 ) table.insert( novoAsteroid, asteroid) physics.addBody( asteroid, "dinamic", {radius = 40, bounce = 0.8} ) asteroid.myName = "asteroid" local geraPosiAsteroid = math.random(3) if geraPosiAsteroid == 1 then -- esquerda asteroid.x = -60 asteroid.y = math.random(512) asteroid:setLinearVelocity( math.random( 40, 120 ), math.random( 20, 60 ) ) elseif geraPosiAsteroid == 2 then -- cima asteroid.x = math.random( display.contentWidth ) asteroid.y = -60 asteroid:setLinearVelocity( math.random(-40, 40), math.random(40,120) ) elseif geraPosiAsteroid == 3 then -- direita asteroid.x = display.contentWidth + 60 asteroid.y = math.random( 512 ) asteroid:setLinearVelocity( math.random( -120, -40 ), math.random( 20, 60 ) ) end asteroid:applyTorque( math.random(-6,6) ) end criarAsteroid() local function gerarLaser(evento) local laser = display.newImageRect( menuJogo, "laser.png", 14, 40 ) physics.addBody( laser, "dinamic", {isSensor = true}) laser.isBullet = true laser.myName = "laser" laser.x = navePlayer.x laser.y = navePlayer.y laser:toBack( ) transition.to( laser, {y= -40, time = 500, onComplete = function() display.remove( laser ) end} ) end --navePlayer:addEventListener( "tap", gerarLaser ) local function atualizarStatusPlayer() vidaTexto.text = "vidas: "..vidas pontosTexto.text = "pontos: "..pontos end local rotacionarObjeto = function(e) local eventName = e.phase local direction = e.target.move if eventName == "began" or eventName == "moved" then if direction == "up" then navePlayer.rotation = 0 elseif direction == "down" then navePlayer.rotation = 180 elseif direction == "right" then navePlayer.rotation = 90 elseif direction == "left" then navePlayer.rotation = -90 end end end local xAxis = 0 local yAxis = 0 local function moverNavePlayer(evento) local eventName = evento.phase local direction = evento.target.move if eventName == "began" or eventName == "moved" then if direction == "up" then yAxis = -5 xAxis = 0 elseif direction == "down" then yAxis = 5 xAxis = 0 elseif direction == "right" then xAxis = 5 yAxis = 0 elseif direction == "left" then xAxis = -5 yAxis = 0 end else yAxis = 0 xAxis = 0 end end for j=1, #buttons do buttons[j]:addEventListener("touch", moverNavePlayer) end local function movimentarObjeto(evento) if evento.phase == "ended" then transition.to( navePlayer, {x = evento.x, y = evento.y}) end end local function atualizarCordenadasObjeto(evento) if evento.phase == "began" then local j=1 for j=1, #buttons do buttons[j]:addEventListener("touch", rotacionarObjeto) --Runtime:addEventListener("touch", movimentarObjeto) end else if evento.phase == "ended" or evento.phase == "canceled" then end end end local atualizarPosicaoPlayer = function() navePlayer.x = navePlayer.x + xAxis navePlayer.y = navePlayer.y + yAxis if navePlayer.x <= navePlayer.width * .1 then navePlayer.x = navePlayer.width * .1 elseif navePlayer.x >= w - navePlayer.width * .1 then navePlayer.x = w - navePlayer.width * .1 end if navePlayer.y <= navePlayer.height * -5 then navePlayer.y = navePlayer.height * -5 elseif navePlayer.y >= h - navePlayer.height * -5 then navePlayer.y = h - navePlayer.height * -5 end end Runtime:addEventListener("enterFrame", atualizarPosicaoPlayer) -- ----------------------------------------------------------------------------------- -- Scene event function listeners -- ----------------------------------------------------------------------------------- --Runtime:addEventListener("touch", movimentarObjeto) Runtime:addEventListener("touch", atualizarCordenadasObjeto) scene:addEventListener( "create", scene ) scene:addEventListener( "show", scene ) scene:addEventListener( "hide", scene ) scene:addEventListener( "destroy", scene ) -- ----------------------------------------------------------------------------------- return scene ]]
23.751572
96
0.652721
77a8fad285634f144ad02d5a57e54c6d1ed41890
4,601
dart
Dart
lib/viewmodel/viewmodel_settings.dart
Shakibuzzaman3104/my_prayer
9910e212efec5035e5f2823ec7aa48befe351c19
[ "Apache-2.0" ]
3
2021-02-15T15:53:16.000Z
2021-02-18T15:02:02.000Z
lib/viewmodel/viewmodel_settings.dart
Shakibuzzaman3104/my_prayer
9910e212efec5035e5f2823ec7aa48befe351c19
[ "Apache-2.0" ]
null
null
null
lib/viewmodel/viewmodel_settings.dart
Shakibuzzaman3104/my_prayer
9910e212efec5035e5f2823ec7aa48befe351c19
[ "Apache-2.0" ]
1
2021-02-14T18:10:55.000Z
2021-02-14T18:10:55.000Z
import 'package:dio/dio.dart'; import 'package:geocoder/geocoder.dart'; import 'package:geolocator/geolocator.dart'; import 'package:my_prayer/local_database/sharedpreferences.dart'; import 'package:my_prayer/repository/repository.dart'; import 'package:my_prayer/utils/utils.dart'; import 'package:my_prayer/viewmodel/base_view_model.dart'; class ViewModelSettings extends BaseViewModel { MySharedPreferences sharedPreferences; PrayerRepository _repository; String _location; bool _isFetchingData = false; List<Address> _addresses; PERMISSIONS _permission = PERMISSIONS.APPROVED; int _onBoradingPosition = 0; List<String> _modes = [ "Shia Ithna-Ansari", "University of Islamic Sciences, Karachi", "Islamic Society of North America", "Muslim World League", "Umm Al-Qura University, Makkah", "Egyptian General Authority of Survey", "Institute of Geophysics, University of Tehran", "Gulf Region", "Kuwait", "Qatar", "Majlis Ugama Islam Singapura, Singapore", "Union Organization islamic de France", "Diyanet İşleri Başkanlığı, Turkey", "Spiritual Administration of Muslims of Russia", ]; bool get isFetchingData => _isFetchingData; int get onBoardingPosition => _onBoradingPosition; PERMISSIONS get permission => _permission; changeOnBoardingPosition(int pos) { _onBoradingPosition = pos; notifyListeners(); } Future changeFirstBoot() async { await sharedPreferences.setIsFirstBoot(false); return await fetchPrayers(); } fetchCoordinateFromName(String query) async { _isFetchingData = true; _addresses = await Geocoder.local.findAddressesFromQuery(query); _isFetchingData = false; notifyListeners(); } Future checkPermission() async { _permission = await determinePermission(); setBusy(false); return _permission; } List<String> get modes => _modes; int _position = 2; int get position => _position; String get location => _location; List<Address> get addresses => _addresses; resetAddress() { _addresses = []; } ViewModelSettings() { _repository = PrayerRepository(); sharedPreferences = MySharedPreferences.getInstance(); } Future fetchPosition() async { _position = await sharedPreferences.getMethod(); _location = await sharedPreferences.getAddress(); notifyListeners(); } int getPositionFromString(String data) { return _modes.indexOf(data); } Future changeLocationAndFetchData(Address address) async { await sharedPreferences.setIsCustomLocation(address == null ? false : true); Position pos; if (address == null) { pos = await Geolocator.getCurrentPosition( desiredAccuracy: LocationAccuracy.low); } else { pos = Position( timestamp: DateTime.now(), latitude: address.coordinates.latitude, longitude: address.coordinates.longitude); await sharedPreferences.setLatitude(address.coordinates.latitude); await sharedPreferences.setLongitude(address.coordinates.longitude); } return await _repository .fetchAndInsertData(pos) .then((value) async => await fetchPosition()); } Future changeLocation(Address address) async { await sharedPreferences.setIsCustomLocation(address == null ? false : true); if (address != null) { await sharedPreferences.setLatitude(address.coordinates.latitude); await sharedPreferences.setLongitude(address.coordinates.longitude); } } Future changeMethodAndFetchData(String data) async { _position = getPositionFromString(data); await sharedPreferences.setMethod(_position); Position position = await Geolocator.getCurrentPosition( desiredAccuracy: LocationAccuracy.low); return await _repository .fetchAndInsertData(position) .catchError((error) {}) .catchError((e) {}); } Future fetchPrayers() async { return await checkConnectionStatus().then((value) async { await _repository .getPrayersFromServer() .then((response) { if (response is DioError) { print(response.message); } else if (response == null) { print("Already updated"); } }) .catchError((error) async => {}) .catchError((e) {}); }); //await upcomingPrayer(); } Future changeMethod(String data) async { _position = getPositionFromString(data); await sharedPreferences.setMethod(_position); await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.low); } }
29.305732
80
0.700717
05c7dc4e2433a18015f8d00acc60cf062f193b23
21,941
py
Python
PyFunceble/__init__.py
Centaurioun/PyFunceble
59b809f3322118f7824195752c6015220738d4a0
[ "Apache-2.0" ]
213
2017-11-19T16:00:29.000Z
2022-03-30T20:51:35.000Z
PyFunceble/__init__.py
Centaurioun/PyFunceble
59b809f3322118f7824195752c6015220738d4a0
[ "Apache-2.0" ]
270
2018-01-10T12:42:41.000Z
2022-03-22T00:03:23.000Z
PyFunceble/__init__.py
Centaurioun/PyFunceble
59b809f3322118f7824195752c6015220738d4a0
[ "Apache-2.0" ]
48
2017-12-09T22:53:49.000Z
2022-01-29T15:50:52.000Z
# pylint: disable=invalid-name """ The tool to check the availability or syntax of domain, IP or URL. :: ██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗ ██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝ ██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ ██████╔╝██║ █████╗ ██╔═══╝ ╚██╔╝ ██╔══╝ ██║ ██║██║╚██╗██║██║ ██╔══╝ ██╔══██╗██║ ██╔══╝ ██║ ██║ ██║ ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝ Author: Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom Special thanks: https://pyfunceble.github.io/#/special-thanks Contributors: https://pyfunceble.github.io/#/contributors Project link: https://github.com/funilrys/PyFunceble Project documentation: https://pyfunceble.readthedocs.io/en/dev/ Project homepage: https://pyfunceble.github.io/ License: :: Copyright 2017, 2018, 2019, 2020, 2021 Nissar Chababy Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ import warnings from typing import List import PyFunceble.storage from PyFunceble.checker.availability.domain import DomainAvailabilityChecker from PyFunceble.checker.availability.domain_and_ip import DomainAndIPAvailabilityChecker from PyFunceble.checker.availability.ip import IPAvailabilityChecker from PyFunceble.checker.availability.status import AvailabilityCheckerStatus from PyFunceble.checker.availability.url import URLAvailabilityChecker from PyFunceble.checker.reputation.domain import DomainReputationChecker from PyFunceble.checker.reputation.domain_and_ip import DomainAndIPReputationChecker from PyFunceble.checker.reputation.ip import IPReputationChecker from PyFunceble.checker.reputation.url import URLReputationChecker from PyFunceble.checker.syntax.domain import DomainSyntaxChecker from PyFunceble.checker.syntax.ip import IPSyntaxChecker from PyFunceble.checker.syntax.ipv4 import IPv4SyntaxChecker from PyFunceble.checker.syntax.ipv6 import IPv6SyntaxChecker from PyFunceble.checker.syntax.second_lvl_domain import SecondLvlDomainSyntaxChecker from PyFunceble.checker.syntax.subdomain import SubDomainSyntaxChecker from PyFunceble.checker.syntax.url import URLSyntaxChecker from PyFunceble.converter.subject2complements import Subject2Complements __version__ = PyFunceble.storage.PROJECT_VERSION def load_config(*args, **kwargs) -> None: """ Placeholder before deletion. Since 4.0.0, you are not required to load the configuration before hand. If you still want too because you may want to use a special CLI related method, you can doing it so: :: import PyFunceble.facility PyFunceble.facility.ConfigLoader.start() """ warnings.warn( "PyFunceble.load_config may be removed in the future." "As of today, because the configuration is not necessary (anymore), " "this method does nothing. Consider it a placeholder.I" "Please consider using PyFunceble.facility.ConfigLoader.start instead.", DeprecationWarning, ) _, _ = args, kwargs def test(subject: str, **kwargs) -> AvailabilityCheckerStatus: """ Checks the avaialbility of the given subject assuming that it is a domain or an IP. .. warning:: This method may be removed in the future. It is still available for convenience. Please consider the following alternative example: :: from PyFunceble import DomainAndIPAvailabilityChecker my_subject = "example.org" the_status = DomainAndIPAvailabilityChecker( my_subject ).get_status() # Get the status in dict format. print(the_status.to_dict()) # Get the status in json format. print(the_status.to_json()) # Check if it is available. print(f"{my_subject} is available ? {the_status.is_available()}") :param subject: The subject to work with. """ warnings.warn( "PyFunceble.test may be removed in the future." "Please consider using PyFunceble.DomainAndIPAvailabilityChecker explicitly.", DeprecationWarning, ) return DomainAndIPAvailabilityChecker(subject, **kwargs).get_status() def url_test(subject: str, **kwargs) -> AvailabilityCheckerStatus: """ Checks the availability of the given subject assuming that it is a URL. .. warning:: This method may be removed in the future. It is still available for convenience. Please consider the following alternative example: :: from PyFunceble import URLAvailabilityChecker my_subject = "http://example.org" the_status = URLAvailabilityChecker( my_subject ).get_status() # Get the status in dict format. print(the_status.to_dict()) # Get the status in json format. print(the_status.to_json()) # Check if it is available. print(f"{my_subject} is available ? {the_status.is_available()}") :param subject: The subject to work with. """ warnings.warn( "PyFunceble.test may be removed in the future." "Please consider using PyFunceble.URLAvailabilityChecker explicitly.", DeprecationWarning, ) return URLAvailabilityChecker(subject, **kwargs).get_status() def is_second_level_domain(subject: str, **kwargs) -> bool: """ Checks if the given subject is a syntactically valid second level domain. .. warning:: This method was added for retrocompatibility. It may be removed in the future and is still available for convenience. Please consider the following alternative example: :: from PyFunceble import SecondLvlDomainSyntaxChecker my_subject = "example.org" the_status = SecondLvlDomainSyntaxChecker( my_subject ).get_status() # Get the status in dict format. print(the_status.to_dict()) # Get the status in json format. print(the_status.to_json()) # Check if it is a second level domain. print(f"{my_subject} is 2nd level domain ? {the_status.is_valid()}") :param subject: The subject to work with. """ warnings.warn( "PyFunceble.is_second_level_domain was added for retro compatibility. " "It may be removed in the future." "Please consider using PyFunceble.SecondLvlDomainSyntaxChecker explicitly.", ) return SecondLvlDomainSyntaxChecker(subject, **kwargs).is_valid() def is_domain(subject: str, **kwargs) -> bool: """ Checks if the given subject is a syntactically valid second level domain or subdomain. .. warning:: This method may be removed in the future. It is still available for convenience. Please consider the following alternative example: :: from PyFunceble import DomainSyntaxChecker my_subject = "example.org" the_status = DomainSyntaxChecker( my_subject ).get_status() # Get the status in dict format. print(the_status.to_dict()) # Get the status in json format. print(the_status.to_json()) # Check if it is a domain (2nd level or subdomain). print(f"{my_subject} is domain ? {the_status.is_valid()}") :param subject: The subject to work with. """ warnings.warn( "PyFunceble.is_domain may be removed in the future." "Please consider using PyFunceble.DomainSyntaxChecker explicitly.", DeprecationWarning, ) return DomainSyntaxChecker(subject, **kwargs).is_valid() def is_subdomain(subject: str, **kwargs) -> bool: """ Checks if the given subject is a syntactically valid subdomain. .. warning:: This method may be removed in the future. It is still available for convenience. Please consider the following alternative example: :: from PyFunceble import SubDomainSyntaxChecker my_subject = "hello.example.org" the_status = SubDomainSyntaxChecker( my_subject ).get_status() # Get the status in dict format. print(the_status.to_dict()) # Get the status in json format. print(the_status.to_json()) # Check if it is a subdomain. print(f"{my_subject} is subdomain ? {the_status.is_valid()}") :param subject: The subject to work with. """ warnings.warn( "PyFunceble.is_subdomain may be removed in the future." "Please consider using PyFunceble.SubDomainSyntaxChecker explicitly.", DeprecationWarning, ) return SubDomainSyntaxChecker(subject, **kwargs).is_valid() def is_ip(subject: str, **kwargs) -> bool: """ Checks if the given subject is a syntactically valid IP range. .. warning:: This method may be removed in the future. It is still available for convenience. Please consider the following alternative example: :: from PyFunceble import IPSyntaxChecker my_subject = "192.168.0.0" the_status = IPSyntaxChecker( my_subject ).get_status() # Get the status in dict format. print(the_status.to_dict()) # Get the status in json format. print(the_status.to_json()) # Check if it is an IP (v4 or v6). print(f"{my_subject} is IP ? {the_status.is_valid()}") :param subject: The subject to work with. """ warnings.warn( "PyFunceble.is_ip may be removed in the future." "Please consider using PyFunceble.IPSyntaxChecker explicitly.", DeprecationWarning, ) return IPSyntaxChecker(subject, **kwargs).is_valid() def is_ipv4(subject: str, **kwargs) -> bool: """ Checks if the given subject is a syntactically valid IPv4. .. warning:: This method may be removed in the future. It is still available for convenience. Please consider the following alternative example: :: from PyFunceble import IPSyntaxChecker my_subject = "192.168.0.0" the_status = IPSyntaxChecker( my_subject ).get_status() # Get the status in dict format. print(the_status.to_dict()) # Get the status in json format. print(the_status.to_json()) # Check if it is an IPv4. print(f"{my_subject} is IPv4 ? {the_status.is_valid_v4()}") :param subject: The subject to work with. """ warnings.warn( "PyFunceble.is_ipv4 be removed in the future." "Please consider using PyFunceble.IPSyntaxChecker explicitly.", DeprecationWarning, ) return IPSyntaxChecker(subject, **kwargs).is_valid_v4() def is_ipv6(subject: str, **kwargs) -> bool: """ Checks if the given subject is a syntactically valid IPv6. .. warning:: This method may be removed in the future. It is still available for convenience. Please consider the following alternative example: :: from PyFunceble import IPSyntaxChecker my_subject = "192.168.0.0" the_status = IPSyntaxChecker( my_subject ).get_status() # Get the status in dict format. print(the_status.to_dict()) # Get the status in json format. print(the_status.to_json()) # Check if it is an IPv6. print(f"{my_subject} is IPv6 ? {the_status.is_valid_v6()}") :param subject: The subject to work with. """ warnings.warn( "PyFunceble.is_ipv6 be removed in the future." "Please consider using PyFunceble.IPSyntaxChecker explicitly.", DeprecationWarning, ) return IPSyntaxChecker(subject, **kwargs).is_valid_v6() def is_ip_range(subject: str, **kwargs) -> bool: """ Checks if the given subject is a syntactically valid IP range. .. warning:: This method may be removed in the future. It is still available for convenience. Please consider the following alternative example: :: from PyFunceble import IPSyntaxChecker my_subject = "192.168.0.0" the_status = IPSyntaxChecker( my_subject ).get_status() # Get the status in dict format. print(the_status.to_dict()) # Get the status in json format. print(the_status.to_json()) # Check if it is an IP range (v4 or v6). print(f"{my_subject} is IP range ? {the_status.is_valid_range()}") :param subject: The subject to work with. """ warnings.warn( "PyFunceble.is_ip_range may be removed in the future." "Please consider using PyFunceble.IPSyntaxChecker explicitly.", DeprecationWarning, ) return IPSyntaxChecker(subject, **kwargs).is_valid_range() def is_ipv4_range(subject: str, **kwargs) -> bool: """ Checks if the given subject is a syntactically valid IPv4 range. .. warning:: This method may be removed in the future. It is still available for convenience. Please consider the following alternative example: :: from PyFunceble import IPSyntaxChecker my_subject = "192.168.0.0" the_status = IPSyntaxChecker( my_subject ).get_status() # Get the status in dict format. print(the_status.to_dict()) # Get the status in json format. print(the_status.to_json()) # Check if it is IPv4 range. print(f"{my_subject} is IPv4 range ? {the_status.is_valid_v4_range()}") :param subject: The subject to work with. """ warnings.warn( "PyFunceble.is_ipv4_range may be removed in the future." "Please consider using PyFunceble.IPSyntaxChecker explicitly.", DeprecationWarning, ) return IPSyntaxChecker(subject, **kwargs).is_valid_v4_range() def is_ipv6_range(subject: str, **kwargs) -> bool: """ Checks if the given subject is a syntactically valid IPv6 range. .. warning:: This method may be removed in the future. It is still available for convenience. Please consider the following alternative example: :: from PyFunceble import IPSyntaxChecker my_subject = "::1" the_status = IPSyntaxChecker( my_subject ).get_status() # Get the status in dict format. print(the_status.to_dict()) # Get the status in json format. print(the_status.to_json()) # Check if it is IPv6 range. print(f"{my_subject} is IPv6 range ? {the_status.is_valid_v6_range()}") :param subject: The subject to work with. """ warnings.warn( "PyFunceble.is_ipv6_range may be removed in the future." "Please consider using PyFunceble.IPSyntaxChecker explicitly.", DeprecationWarning, ) return IPSyntaxChecker(subject, **kwargs).is_valid_v6_range() def is_url(subject: str, **kwargs) -> bool: """ Checks if the given subject is syntactically a valid URL. .. warning:: This method may be removed in the future. It is still available for convenience. Please consider the following alternative example: :: from PyFunceble import DomainReputationChecker my_subject = "https://example.org" the_status = URLSyntaxChecker( my_subject ).get_status() # Get the status in dict format. print(the_status.to_dict()) # Get the status in json format. print(the_status.to_json()) # Check if it is a URL. print(f"{my_subject} is URL ? {the_status.is_valid()}") :parma subject: The subject to check. """ warnings.warn( "PyFunceble.is_url may be removed in the future." "Please consider using PyFunceble.URLSyntaxChecker explicitly.", DeprecationWarning, ) # pylint: disable=no-member return URLSyntaxChecker(subject, **kwargs).get_status().is_valid() def is_domain_malicious(subject: str, **kwargs) -> bool: """ Checks if the given domain is malicious. .. warning:: This method may be removed in the future. It is still available for convenience. Please consider the following alternative example: :: from PyFunceble import DomainReputationChecker my_subject = "example.org" the_status = DomainReputationChecker( my_subject ).get_status() # Get the status in dict format. print(the_status.to_dict()) # Get the status in json format. print(the_status.to_json()) # Check if it is malicious. print(f"{my_subject} is Malicious ? {the_status.is_malicious()}") :param subject: The subject to work with. """ warnings.warn( "PyFunceble.is_domain_malicious may be removed in the future." "Please consider using PyFunceble.DomainReputationChecker explicitly.", DeprecationWarning, ) # pylint: disable=no-member return DomainReputationChecker(subject, **kwargs).get_status().is_malicious() def is_ipv4_malicious(subject: str, **kwargs) -> bool: """ Checks if the given IPv4 is malicious. .. warning:: This method may be removed in the future. It is still available for convenience. Please consider the following alternative example: :: from PyFunceble import IPReputationChecker my_subject = "192.168.0.1" the_status = IPReputationChecker( my_subject ).get_status() # Get the status in dict format. print(the_status.to_dict()) # Get the status in json format. print(the_status.to_json()) # Check if it is malicious. print(f"{my_subject} is Malicious ? {the_status.is_malicious()}") :param subject: The subject to work with. """ warnings.warn( "PyFunceble.is_ipv4_malicious may be removed in the future." "Please consider using PyFunceble.IPReputationChecker explicitly.", DeprecationWarning, ) # pylint: disable=no-member return IPReputationChecker(subject, **kwargs).get_status().is_malicious() def is_url_malicious(subject: str, **kwargs) -> bool: """ Checks if the given URL is malicious. .. warning:: This method may be removed in the future. It is still available for convenience. Please consider the following alternative example: :: from PyFunceble import URLReputationChecker my_subject = "https://example.org" the_status = URLReputationChecker( my_subject ).get_status() # Get the status in dict format. print(the_status.to_dict()) # Get the status in json format. print(the_status.to_json()) # Check if it is malicious. print(f"{my_subject} is Malicious ? {the_status.is_malicious()}") :param subject: The subject to work with. """ warnings.warn( "PyFunceble.is_url_malicious may be removed in the future." "Please consider using PyFunceble.URLReputationChecker explicitly.", DeprecationWarning, ) # pylint: disable=no-member return URLReputationChecker(subject, **kwargs).get_status().is_malicious() def get_complements(subject: str, include_given: bool = False) -> List[str]: """ Provides the complements of a given subject. A complement is a for example :code:`example.org` if :code:`www.example.org` is given and vice-versa. .. warning:: This method may be removed in the future. It is still available for convenience. Please consider the following alternative example: :: from PyFunceble import Subject2Complements my_subject = "example.org" complements = Subject2Complements( my_subject ).get_converted(include_given=True) :param subject: The subject to work with. :param include_given: Include the given subject in the result. """ warnings.warn( "PyFunceble.get_complements may be removed in the future." "Please consider using PyFunceble.Subject2Complements explicitly", DeprecationWarning, ) return Subject2Complements(subject, include_given=include_given).get_converted()
28.869737
88
0.622715
6853edcfd75c5bcbf8f0e5051e5181c5f1e60c0c
500
php
PHP
app/Models/SubmissionFile.php
trs5051/BJEE
c0d1e1f6ef628323d52a0469131170a1187a3f20
[ "MIT" ]
null
null
null
app/Models/SubmissionFile.php
trs5051/BJEE
c0d1e1f6ef628323d52a0469131170a1187a3f20
[ "MIT" ]
null
null
null
app/Models/SubmissionFile.php
trs5051/BJEE
c0d1e1f6ef628323d52a0469131170a1187a3f20
[ "MIT" ]
null
null
null
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class SubmissionFile extends Model { use SoftDeletes; /** * The table associated with the model. * * @var string */ protected $table = 'submission_files'; protected $guarded = []; public function user() { return $this->belongsTo('App\User', 'userid'); } public function submission() { return $this->belongsTo('App\Models\Submissions', 'submission_id'); } }
16.666667
69
0.702
c3a930dddbe406ce75d64af612c135b4fb7812e1
5,965
cs
C#
AddonManager/Logic/Storage.cs
BuloZB/Addon
b37f07e08aa5110db51e35e22f4babd762d9267c
[ "MIT" ]
3
2019-05-15T20:51:54.000Z
2020-05-07T12:22:21.000Z
AddonManager/Logic/Storage.cs
BuloZB/Addon
b37f07e08aa5110db51e35e22f4babd762d9267c
[ "MIT" ]
35
2019-05-15T15:41:34.000Z
2020-01-15T19:19:18.000Z
AddonManager/Logic/Storage.cs
BuloZB/Addon
b37f07e08aa5110db51e35e22f4babd762d9267c
[ "MIT" ]
1
2019-11-24T15:55:28.000Z
2019-11-24T15:55:28.000Z
using AddonManager.Core.Helpers; using AddonManager.Core.Models; using AddonManager.Core.Storage; using AddonManager.Helpers; using AddonToolkit.Model; using Microsoft.Toolkit.Uwp.Helpers; using System; using System.Collections.Generic; using System.Diagnostics; using System.Threading.Tasks; using Windows.ApplicationModel; using Windows.Storage; namespace AddonManager.Logic { public static class Storage { private static readonly StorageFolder LOCAL_FOLDER = ApplicationData.Current.LocalFolder; // private static readonly StorageFolder APP_INSTALLED_FOLDER = Package.Current.InstalledLocation; public static async Task SaveSession() { try { var instance = Singleton<Session>.Instance.AsSaveableSession(); await LOCAL_FOLDER.SaveAsync("session", instance); //var addonDataSet = new HashSet<AddonData>(); //foreach (var game in instance.Games) //{ // var addonDataList = game.Addons // .Where(saveableAddon => // !string.IsNullOrEmpty(saveableAddon.FolderName) && // !string.IsNullOrEmpty(saveableAddon.ProjectUrl)) // .Select(saveableAddon => saveableAddon.AsAddonData()) // .ToList(); // addonDataSet.UnionWith(addonDataList); //} // await LOCAL_FOLDER.SaveAsync("addondata", addonDataSet); // Debug.WriteLine("Saved Session to " + localFolder.Path); } catch (Exception e) { Debug.WriteLine("ERROR when saveing session, " + e.Message); } } public static async Task LoadTask() { var session = Singleton<Session>.Instance; var saveableSession = await LOCAL_FOLDER.ReadAsync<SaveableSession>("session"); if (saveableSession == null) return; //session.SelectedGame = saveableSession.SelectedGame.AsGame(); session.Games.Clear(); foreach (var saveableGame in saveableSession.Games) { var game = saveableGame.AsGame(); foreach (var addon in game.Addons) { if (addon.ProjectUrl.Contains("https://www.wowace") || addon.ProjectUrl.Contains("https://wow.curseforge")) { addon.ProjectUrl = string.Empty; addon.Downloads = new List<Download>(); } } session.Games.Add(game); if (saveableSession.SelectedGame.AbsolutePath.Equals(game.AbsolutePath)) { session.SelectedGame = game; } } // Debug.WriteLine("Loaded from " + localFolder.Path); } //public static async Task<HashSet<string>> LoadKnownSubFolders() //{ // var assets = await APP_INSTALLED_FOLDER.GetFolderAsync("Assets"); // return await assets.ReadAsync<HashSet<string>>("knownsubfolders"); //} public static async Task<HashSet<string>> LoadKnownSubFoldersFromUser() { var knownFolders = await LOCAL_FOLDER.ReadAsync<HashSet<string>>("knownsubfolders"); return knownFolders; } public static async Task SaveKnownSubFolders() { try { var instance = Singleton<Session>.Instance.KnownSubFolders; await LOCAL_FOLDER.SaveAsync("knownsubfolders", instance); // Debug.WriteLine("Saved knownsubfolders"); } catch (Exception e) { Debug.WriteLine("ERROR when saveing knownsubfolders, " + e.Message); } } public static async Task<List<AddonData>> LoadAddonData() { using (var stream = await StreamHelper.GetPackagedFileStreamAsync("Assets/allvalidaddondata1-345.json")) { var fileContent = await stream.ReadTextAsync(); var addonDatas = await Json.ToObjectAsync<List<AddonData>>(fileContent); addonDatas.Add(new AddonData() { FolderName = "ElvUI", Title = "ElvUI", Description = "A user interface designed around user-friendliness with extra features that are not included in the standard UI.", NrOfDownloads = 100000000, UpdatedEpoch = 1557784800, CreatedEpoch = 0, ProjectName = "elvui", //ProjectUrl = Version.ELVUI, SubFolders = new HashSet<string>() { "ElvUI_Config", "ElvUI_OptionsUI" }, Files = 100, Size = 100, HasRetail = true }); return addonDatas; } //var assets = await APP_INSTALLED_FOLDER.GetFolderAsync("Assets"); //var addonDatas = await assets.ReadAsync<List<AddonData>>("allvalidaddondata1-340"); //addonDatas.Add(new AddonData() //{ // FolderName = "ElvUI", // Title = "ElvUI", // Description = "A user interface designed around user-friendliness with extra features that are not included in the standard UI.", // NrOfDownloads = 100000000, // UpdatedEpoch = 1557784800, // CreatedEpoch = 0, // ProjectName = "elvui", // ProjectUrl = Version.ELVUI, // SubFolders = new HashSet<string>() { "ElvUI_Config" }, // Files = 100, // Size = 100 //}); //return addonDatas; } } }
39.766667
149
0.541827
72d1ea38cd43edf94d02c81af99d8c50d989c5f7
3,475
cs
C#
SpectraLogic.SpectraRioBrokerClient/Calls/Broker/ArchiveRequest.cs
barjonas/ep_net_sdk
07c0f57c65fc7fa8f96e396ad3bbadfe6e774977
[ "Apache-2.0" ]
null
null
null
SpectraLogic.SpectraRioBrokerClient/Calls/Broker/ArchiveRequest.cs
barjonas/ep_net_sdk
07c0f57c65fc7fa8f96e396ad3bbadfe6e774977
[ "Apache-2.0" ]
null
null
null
SpectraLogic.SpectraRioBrokerClient/Calls/Broker/ArchiveRequest.cs
barjonas/ep_net_sdk
07c0f57c65fc7fa8f96e396ad3bbadfe6e774977
[ "Apache-2.0" ]
null
null
null
/* * ****************************************************************************** * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * * http://www.apache.org/licenses/LICENSE-2.0 * * or in the "license" file accompanying this file. * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * **************************************************************************** */ using System; using System.Collections.Generic; using Newtonsoft.Json; using SpectraLogic.SpectraRioBrokerClient.Model; using SpectraLogic.SpectraRioBrokerClient.Utils; namespace SpectraLogic.SpectraRioBrokerClient.Calls.Broker { /// <summary> /// /// </summary> /// <seealso cref="SpectraLogic.SpectraRioBrokerClient.Calls.RestRequest" /> public class ArchiveRequest : RestRequest { #region Public Fields /// <summary> /// The files to be archive /// </summary> [JsonProperty(PropertyName = "files")] public IEnumerable<ArchiveFile> Files; #endregion Public Fields #region Public Constructors /// <summary> /// Initializes a new instance of the <see cref="ArchiveRequest" /> class. /// </summary> /// <param name="brokerName">Name of the broker.</param> /// <param name="files">The files.</param> /// <param name="uploadNewFilesOnly">If enabled, when a file already exists in RioBroker it is ignored in the archive job and no update occurs; only new files are uploaded. Default = false.</param> /// <param name="failFast">If enabled, when a validation error occurs the job fails immediately. If disabled, the job continues even though a validation error occurred. Default = true.</param> /// <exception cref="ArgumentNullException"></exception> public ArchiveRequest(string brokerName, IEnumerable<ArchiveFile> files, bool uploadNewFilesOnly = false, bool failFast = true) { Contract.Requires<ArgumentNullException>(brokerName != null, "brokerName"); Contract.Requires<ArgumentNullException>(files != null, "files"); BrokerName = brokerName; Files = files; AddQueryParam("upload-new-files-only", uploadNewFilesOnly.ToString()); AddQueryParam("fail-fast", failFast.ToString()); } #endregion Public Constructors #region Public Properties /// <summary> /// Gets the name of the broker. /// </summary> /// <value> /// The name of the broker. /// </value> [JsonIgnore] public string BrokerName { get; private set; } #endregion Public Properties #region Internal Properties internal override string Path => $"/api/brokers/{BrokerName}/archive"; internal override HttpVerb Verb => HttpVerb.POST; #endregion Internal Properties #region Internal Methods internal override string GetBody() { return JsonConvert.SerializeObject(this); } #endregion Internal Methods } }
37.365591
205
0.621871
5bf67987e04c6ae9d631de6bcd0f137cc48244c6
42,913
css
CSS
src/styles/global.css
zairabbas/ceg
7dd83c2fb9bd54f706cfd9a2f19e2a6ce94467a9
[ "RSA-MD" ]
null
null
null
src/styles/global.css
zairabbas/ceg
7dd83c2fb9bd54f706cfd9a2f19e2a6ce94467a9
[ "RSA-MD" ]
null
null
null
src/styles/global.css
zairabbas/ceg
7dd83c2fb9bd54f706cfd9a2f19e2a6ce94467a9
[ "RSA-MD" ]
null
null
null
@import url('https://fonts.googleapis.com/css?family=Raleway:400,400i,700,800&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;700&display=swap'); html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video { margin:0; padding:0; border:0; outline:0; font-size:100%; vertical-align:baseline; background:transparent; } html,body { height: 100%; } body { line-height:1; background-color: #181d24; font-family: "Raleway", Helvetica, Arial, "Lucida Grande", sans-serif; } .absolute.loader-wrapper { position: fixed; top: 0; left: 0; bottom: 0; right: 0; background-color: black; z-index: 1; } .loader-wrapper { display: flex; align-items: center; justify-content: center; flex-direction: column; transition: "all 0.25s ease-in-out"; background-color: #191919; color: #dbd8d6; } .loader-wrapper h1 { font-size: 1.5vw; text-transform: uppercase; font-family: "Bai Jamjuree", sans-serif; font-weight: 600; } .loader-wrapper h2 { font-size: 1.5vw; text-transform: uppercase; font-family: "Bodoni Moda", serif; font-style: italic; margin-top: 10px; } article,aside,details,figcaption,figure, footer,header,hgroup,menu,nav,section { display:block; } nav ul { list-style:none; } blockquote, q { quotes:none; } blockquote:before, blockquote:after, q:before, q:after { content:''; content:none; } a { margin:0; padding:0; font-size:100%; vertical-align:baseline; background:transparent; text-decoration: none; transition: all 0.2s linear; -webkit-transition: all 0.2s linear; } p { font-weight: 400; line-height: 1.6em; margin-bottom: 10px; } p:last-child { margin-bottom: 0; } /* change colours to suit your needs */ ins { background-color:#ff9; color:#000; text-decoration:none; } mark { background-color:#ff9; color:#000; font-style:italic; font-weight:bold; } del { text-decoration: line-through; } abbr[title], dfn[title] { border-bottom:1px dotted; cursor:help; } table { border-collapse:collapse; border-spacing:0; } hr { display:block; height:1px; border:0; margin:1em 0; padding:0; } input, select { vertical-align:middle; } .clearfix:after, .input-group:after, .btn-group:after, .container:after, .row:after, .full-container:after { content: ""; display: table; clear: both; } .pull-left { float: left; } .pull-right { float: right; } h1 { font-weight: 600; font-size: 4em; line-height: 1.1; } h2 { font-family: 'SangBleuEmpire-Regular', serif; font-weight: 400; font-size: 2.8em; line-height: 1.1; } h3 { font-family: 'SangBleuEmpire-Regular', serif; font-weight: 400; font-size: 2.2em; line-height: 1.2; } h4 { font-family: 'SangBleuEmpire-Regular', serif; font-weight: 400; font-size: 1.6em; line-height: 1.3; } .ttm-block h4 { line-height: 1.5; } h5 { font-family: 'SangBleuEmpire-Regular', serif; font-weight: 400; font-size: 1.4em; letter-spacing: .2em; line-height: 1.2; text-transform: uppercase; } h6 { font-weight: 700; font-size: 1.1em; letter-spacing: .3em; text-transform: uppercase; } *, *:before, *:after { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } b, .bold { font-weight: 700; } button, input, textarea { -webkit-appearance: none; -moz-appearance: none; } input::-moz-focus-inner { border: 0; padding: 0; margin-top:-2px; margin-bottom: -2px; } .container { width: 1180px; margin: 0 auto; position: relative; } /* ********************************************************************************************************************* One% CSS Grid - 12 Columns Fluid CSS Grid System Why One% ? Let’s count ... we have 12 columns (magic number divided by 2, 3, 4, 6) for 12 columns we need 11 margins so if we count margin 3%, then 3% * 11 margins = 33% and if we count width of 1 column 5.5%, than 5.5% * 12 columns = 66% in the end we have 33% + 66% = 99% aaand ??? 1% is still here so that's the name - One% 2 starting options ? Let’s count a bit more ... 1200px - perfectly fits 1280 screens 12 columns margin 3% / 36px (full-width) col1 5.5% / 66px (full-width) 1000px - perfectly fits 1024 screens 12 columns margin 3% / 30px (full-width) col1 5.5% / 55px (full-width) */ /* ********************************************************************************************************************* * Main container for all */ .onepcssgrid-1000, .onepcssgrid-1200 { margin: 0 auto; padding: 0 0 0 1%; /* THAT'S THE NAME ;) */ } .onepcssgrid-1200 { max-width: 1220px; } .onepcssgrid-1000 { max-width: 1020px; } .onerow { clear: both; padding: 0 10px; position: relative; } .row { position: relative; } .rir-adjust .onerow { padding: 0; } /* ********************************************************************************************************************* * Common columns definitions */ .col1, .col2, .col3, .col4, .col5, .col6, .col7, .col8, .col9, .col10, .col11, .col12 { float: left; margin: 0 3% 0 0; position: relative; } .col1:last-child, .col2:last-child, .col3:last-child, .col4:last-child, .col5:last-child, .col6:last-child, .col7:last-child, .col8:last-child, .col9:last-child, .col10:last-child, .col11:last-child, .col12 { margin-right: 0; } .col1 { width: 5.5%; } .col2 { width: 14%; } .col3 { width: 22.5%; } .col4 { width: 31%; } .col5 { width: 39.5%; } .col6 { width: 48%; } .col7 { width: 56.5%; } .col8 { width: 65%; } .col9 { width: 73.5%; } .col10 { width: 82%; } .col11 { width: 90.5%; } .col12 { width: 99%; margin: 0; } /* ********************************************************************************************************************* * Disable padding left/right 10px if I'm 1024 or gibber - correct percentage math */ @media all and (min-width: 1024px) { .onepcssgrid-1000 { max-width: 1000px; } .onepcssgrid-1000 .onerow { padding: 0; } } /* ********************************************************************************************************************* * Small devices */ @media all and (max-width: 768px) { .col1, .col2, .col3, .col4, .col5, .col6, .col7, .col8, .col9, .col10, .col11 { float: none; width: 99%; } } .slick-dots { position: absolute; bottom: -40px; right: 0px; display: block; padding: 0; margin: 0; list-style: none; text-align: center; } .slick-dots li { position: relative; display: inline-block; margin: 0 5px; padding: 0; cursor: pointer; border-radius: 50%; } .slick-dots li button { display: block; width: 8px; height: 8px; padding: 0px 3px; border-radius: 50%; cursor: pointer; color: transparent; border: solid 1px #e0c080; outline: none; background: transparent; } .slick-dots li.slick-active button { background-color: #e0c080; } .slick-dots li button:hover, .slick-dots li button:focus { outline: none; } .btn { display: inline-block; font-family: "Cinzel", sans-serif; text-align: center; vertical-align: middle; cursor: pointer; background-image: none; border: 1px solid transparent; white-space: nowrap; padding: 6px 15px; font-size: 0.9em; letter-spacing: 0.1em; font-weight: 800; border-radius: 4px; user-select: none; outline: 0; transition: all 0.3s linear; -webkit-transition: all 0.3s linear; } .btn.btn-primary.disabled { opacity: 0.6; cursor: not-allowed; box-shadow: rgba(0,0,0,0) 0 4px 12px 0; } .btn.full-btn { width: 100%; } .btn.btn-sm { color: #20293e; background: #e0c080; padding: 9px 20px; box-shadow: rgba(0,0,0,0.24) 0 4px 12px 0; } .btn.btn-icon { color: #20293e; background: transparent; padding: 3px 0; } .btn.btn-icon i { margin-left: 5px; } .btn.btn-primary:hover { background: rgb(255,255,255); box-shadow: rgba(0,0,0,0.34) 0 12px 20px 0; } .btn.btn-primary.disabled:hover { background: #e0c080; box-shadow: rgba(0,0,0,0) 0 12px 20px 0; } .body-sec { position: relative; padding: 120px 0; } .body-sm-sec { position: relative; padding: 60px 0; } .sm-body-sec { position: relative; padding: 100px 0; } .body-bt-sec { position: relative; padding: 120px 0 200px; } .full-sec { height: 100%; width: 100%; position: relative; overflow: hidden; color: #fff; } .circle-btn { width: 50px; height: 50px; background-color: #fff; border-radius: 50%; position: absolute; right: 0; top: 50%; margin-top: -25px; } .sm-container { width: 800px; margin: 0 auto; position: relative; } .xsm-container { width: 600px; margin: 0 auto; position: relative; } .full-bg { width: 100%; height: 100%; background-position: center; background-size: cover; background-repeat: no-repeat; } .para-bg { width: 100%; height: 130%; background-position: center; background-size: cover; background-repeat: no-repeat; position: absolute; left:0; top:0; } .panel-header, .fs-img, .para-img-inner, .bi-img { background-position: center; background-size: cover; background-repeat: no-repeat; position: relative; } #home-program .panel-header { height: 140px; background-color: #ccc; } .dark-cover { width: 100%; height: 100%; position: absolute; left: 0; top: 0; background-color: rgba(0,0,0,0.5); } @-webkit-keyframes scroll { 0% { -webkit-transform: translateY(-4px); } 50% { -webkit-transform: translateY(4px); } 100% { -webkit-transform: translateY(-4px); } } @-moz-keyframes scroll { 0% { transform: translateY(-4px); } 50% { transform: translateY(4px); } 100% { transform: translateY(-4px); } } @keyframes scroll { 0% { transform: translateY(-4px); } 50% { transform: translateY(4px); } 100% { transform: translateY(-4px); } } .side-cover { width: 48%; height: auto; position: absolute; top: 50%; display: block; transform:translateY(-50%); -webkit-transform:translateY(-50%); } .img-left .side-cover { left: 0; } .img-right .side-cover { right: 0; } header { position: fixed; width: 100%; left: 0; top: 0; box-shadow: rgba(0,0,0,0.24) 0 14px 24px 0; z-index: 98; transition: all 0.3s ease-out; -webkit-transition: all 0.3s ease-out; } header.stuck { top: -36px; } .header-lower { background-color: #fff; padding: 15px 3%; position: relative; } .header-upper-nav { padding: 10px 3%; background-color: #20293e; position: relative; } .header-upper-nav a { color: #e0c080; font-size: .7em; font-weight: 700; } .header-upper-nav .pull-left a { margin-right: 10px; } .header-upper-nav .pull-right a { margin-left: 10px; } #rcb-btn { font-size: .7em; padding: 12px 20px 11px; font-weight: 700; position: relative; top: 5px; } .footer-program-nav a { color: #fff; display: inline-block; margin: 0 15px; font-size: .8em; } #main-nav { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); -webkit-transform: translate(-50%,-50%); } #main-nav a { display: inline-block; padding: 18px; font-weight: 700; color: #20293e; text-transform: uppercase; border-radius: 4px; font-size: .8em; } #main-nav a:hover { background-color:#e0c080; } #sub-nav a { display: inline-block; font-weight: 400; color: #20293e; font-size: .8em; padding: 18px 10px; } #sub-nav a:hover { color:#e0c080; } .icon-left i { margin-right: 5px; } .icon-right i { margin-left: 5px; } #sub-nav a.search-icon { font-size: 1.1em; padding: 15px 5px; position: relative; top: 3px; } .xsm-space { height: 10px; } .sm-space { height: 20px; } .md-space { height: 30px; } .lg-space { height: 60px; } .xlg-space { height: 160px; } .text-slider { color: #e0c080; overflow: hidden; position: relative; height: 21px; } .ar { font-family: 'Changa', sans-serif; font-weight: 400; direction: rtl; } .text-slider h6 { letter-spacing: .3em; line-height: 1.2; } .bg-content-slider h6 { line-height: 1.3; letter-spacing: 0; text-transform: none; } #logo { display: block; width: 200px; height: 50px; background-size: contain; background-repeat: no-repeat; background-position: center; /* background-image:url(../../img/logo-dark.svg); */ position: relative; } .content.container { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); -webkit-transform: translate(-50%,-50%); } /* Slider */ .slick-slider { position: relative; display: block; box-sizing: border-box; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-touch-callout: none; -khtml-user-select: none; -ms-touch-action: pan-y; touch-action: pan-y; -webkit-tap-highlight-color: transparent; } .slick-list { position: relative; display: block; overflow: hidden; margin: 0; padding: 0; } .slick-list:focus { outline: none; } .slick-list.dragging { cursor: pointer; cursor: hand; } .slick-slider .slick-track, .slick-slider .slick-list { -webkit-transform: translate3d(0, 0, 0); -moz-transform: translate3d(0, 0, 0); -ms-transform: translate3d(0, 0, 0); -o-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } .slick-track { position: relative; top: 0; left: 0; display: block; } .slick-track:before, .slick-track:after { display: table; content: ''; } .slick-track:after { clear: both; } .slick-loading .slick-track { visibility: hidden; } .slick-slide { display: none; float: left; height: 100%; min-height: 1px; } [dir='rtl'] .slick-slide { float: right; } .slick-slide img { display: block; } .slick-slide.slick-loading img { display: none; } .slick-slide.dragging img { pointer-events: none; } .slick-initialized .slick-slide { display: block; } .slick-loading .slick-slide { visibility: hidden; } .slick-vertical .slick-slide { display: block; height: auto; border: 1px solid transparent; } .slick-arrow.slick-hidden { display: none; } .slick-track, .slick-slide, .slick-list, .fs-img { height: 100%; } .bg-slider { position: relative; height: 100%; background-color: #20293e; } .para-slide { height: 100%; position: absolute; top:0; left: 0; width: 100%; overflow: hidden; } .perspective { perspective: 900px; -webkit-perspective: 900px; -moz-perspective: 900px; } .np-sec { position: relative; width: 100%; margin: 0 auto; } .light-theme, .md-theme h3 { color: #fff; } .sm-desc { color: #999; font-size: .8em; } .light-theme h5, .md-theme h5, .md-theme h4, .md-theme h6 { color: #AC8361; } .md-theme { color: #AC8361; } .md-theme h2 { color: #fff; } .dark-theme { color: #777; } .dark-theme h2, .dark-theme h5, .dark-theme h4, .dark-theme h3 { color: #20293e; } #home-welcome { height: 700px; z-index: 3; } .ring-icon { color: #fff; position: relative; height: 0; padding-bottom: 31%; border-radius: 50%; border: 1px solid #e0c080; text-align: center; } .ri-content { position: absolute; top: 50%; width: 90%; left: 5%; transform: translateY(-50%); -webkit-transform: translateY(-50%); } .ri-content i { font-size: 2.6em; margin-bottom: 10px; } .ri-content h6 { font-size: .9em; position: relative; left: 2px; letter-spacing: .1em; } .img-text-sec .its-img { height: 90%; position: absolute; top: 5%; width: 48%; overflow: hidden; } .its-img-inner { background-position: center; background-size: cover; display: block; background-repeat: no-repeat; width: 100%; height: 130%; } .img-left .its-content { float:right; } .img-left .its-img { left:0; } .img-right .its-img { right:0; } .bg-sec { padding: 100px 0; width: 94%; margin: 0 auto; position: relative; z-index: 2; box-shadow: 0px 10px 18px rgba(0,0,0,0.28); overflow: hidden; } .lg-bg-sec { padding: 160px 0; width: 94%; margin: 0 auto; position: relative; z-index: 2; box-shadow: 0px 10px 18px rgba(0,0,0,0.28); overflow: hidden; } .col-item-5 { float: left; width: 18.4%; margin-right: 2%; } .col-item-5:last-child { margin-right: 0; } .panel:hover .ph-button { opacity: 1; } .pg-side-item p.icon-left { font-size: .9em; margin-bottom: 5px; } .ph-button { width: 100%; height: 100%; position: absolute; top: 0; left: 0; opacity: 0; background-color:rgba(0,0,0,0.5); transition: all .3s linear; -webkit-transition: all .3s linear; } .ph-button .btn { position: absolute; left: 50%; top: 50%; transform:translate(-50%,-50%); -webkit-transform:translate(-50%,-50%); } .panel { min-height: 100%; background-color: #fff; display: block; color: #20293e; box-shadow: 0px 2px 8px rgba(0,0,0,0.18); } .pg-item { background-color: #fff; display: block; color: #20293e; box-shadow: 0px 2px 8px rgba(0,0,0,0.18); } #pg-map { width: 100%; height: 340px; background-color: #999; } .pg-side-item { margin-bottom: 25px; } .pg-side-item a { color: #fff; } .pg-side-item:last-child { margin-bottom: 0; } .pg-side-item h6 { margin-bottom: 5px; } .form .country-name { color: #555; } .form .col6 { margin-right: 4%; } #office-map { height: 440px; background-color: #666; } .form .col6:last-child { margin-right: 0; } textarea { min-height: 260px; } .text-col { padding: 30px 220px 30px 40px; } .pgi-link { position: absolute; right: 40px; top: 50%; margin-top: -20px; } .sm-text { font-size: .7em; } .img-col { overflow: hidden; } .pg-item h6, .pg-side-item h6 { letter-spacing: .2em; font-size: .85em; margin-bottom: 5px; } .pg-item h3 { font-weight: 800; font-size: 2em; margin-bottom: 2px; } .pkg-option { position: relative; padding-left: 90px; } .pkg-number { font-size: 8em; opacity: 0.3; position: absolute; left: 0; top:0; line-height: .8; } .panel:hover { box-shadow: 0px 7px 18px rgba(0,0,0,0.3); } .panel-body { padding: 20px; } .bold-para { font-weight: 700; text-transform: uppercase; line-height: 1.1; font-size: 1.2em; } .scroll-btn { width: 50px; height: 50px; position: absolute; cursor: pointer; left: 50%; text-align: center; margin-left: -25px; bottom: -25px; color: #20293e; -webkit-animation: scroll 2s infinite ease-in-out; -moz-animation: scroll 2s infinite ease-in-out; animation: scroll 2s infinite ease-in-out; transition: all 0.3s linear; -webkit-transition: all 0.3s linear; } .scroll-btn i { font-size: 5em; position: relative; top: 60px; text-align: center; color: #fff; } .scroll-btn-bg { background-color: #e0c080; width: 100%; height: 100%; border-radius: 6px; transform: rotate(45deg); -webkit-transform: rotate(45deg); box-shadow: rgba(0,0,0,0.24) 0 8px 14px 0; position: absolute; left: 0; top: 0; } .fs-slider { position: relative; height: 460px; } .fs-slide { position: relative; } .fs-img { width: 110%; } .fs-content { width: 32%; position: absolute; right:0; top: 50%; transform: translateY(-50%); -webkit-transform: translateY(-50%); } .fs-content a { opacity: 0; transform: translateX(-80px); -webkit-transform: translateX(-80px); } .gold-panel { padding: 20px; background-color: #e0c080; display: block; width: 100%; color: #20293e; outline: 0; } .gold-panel h6 { color: #fff; } .action-sec { padding: 80px 40px; background-color: #fff; margin-top: -90px; box-shadow: rgba(0,0,0,0.24) 0 8px 14px 0; } .para-img { position: relative; overflow: hidden; } .cc3-height { height: 180px; } .cc4-height { height: 220px; } .cc6-height { height: 300px; } .pgi-img { height: 280px; position: relative; overflow: hidden; } .pgi-img h2 { color: #fff; position: absolute; left: 0; bottom: 0; padding: 80px 40px 20px; font-weight: 800; font-size: 3em; width: 100%; background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,0.8) 100%); background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0.8) 100%); background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(0,0,0,0.8) 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#cc000000',GradientType=0 ); } .para-img-inner { height: 130%; width: 100%; } .action-sec .para-img { width: 57%; height: 100%; position: absolute; top: 0; right: 0; } .alt-bg { background-color: #fff; } footer { padding: 60px 0 20px; } footer a { color: #fff; } footer a:hover { color: #e0c080; } .footer-divider { padding: 40px 0; } .footer-logo { display: block; position: relative; margin: 0 auto; width: 18%; } .footer-divide-line { width: 38%; height: 1px; position: absolute; background-color: rgba(255,255,255,0.6); top: 50%; } .footer-divide-line.left { left: 0; } .footer-divide-line.right { right: 0; } .footer-upper h6 { font-size: .8em; letter-spacing: 0.2em; line-height: 1.4; } .footer-upper i { font-size: 2em; margin-bottom: 15px; } footer nav p { font-size:0.7em; line-height: 1.2; } .form-control { display: block; border: 1px solid transparent; border-radius: 4px; padding: 12px 15px; font-weight: 400; background-color: #e8e8e8; font-size: .9em; font-family: "Raleway", Helvetica, Arial, "Lucida Grande", sans-serif; width: 100%; outline: 0; } .footer-subscrib .form-control { background-color: #fff; } label { display: block; font-weight: 700; margin-bottom: 7px; text-align: left; text-transform: uppercase; } .input-group .form-control { width: 70%; float: left; -webkit-border-top-right-radius: 0px; -webkit-border-bottom-right-radius: 0px; -moz-border-radius-topright: 0px; -moz-border-radius-bottomright: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; } .input-group .btn { width: 30%; float: left; -webkit-border-top-left-radius: 0px; -webkit-border-bottom-left-radius: 0px; -moz-border-radius-topleft: 0px; -moz-border-radius-bottomleft: 0px; border-top-left-radius: 0px; border-bottom-left-radius: 0px; } .social-icons a { display: inline-block; margin: 0 10px; font-size: 1.6em; } .footer-lower { font-size: .75em; } .footer-lower a { font-size: .9em; margin-left: 10px; } .title-loading h1.h-font { font-size: 20rem; padding: 240px 0; text-align: center; color: #ca9d75; } .preloader { width: 100%; height: 100%; position: fixed; top: 0; left: 0; z-index: 99999; overflow: hidden; background-color: #000; z-index: 100; transform-origin: center bottom; -webkit-transform-origin: center bottom; } /*.preloader { width: 100%; height: 100%; position: fixed; top: 0; left: 0; z-index: 999; } .preload-cover { width: 100%; height: 100%; background-color: #fff; transform-origin: right center; -webkit-transform-origin: right center; } .loader { display: block; width: 30px; height: 30px; position: absolute;; border: 4px solid #20293e; top: 50%; left: 50%; margin-top: -15px; margin-left: -15px; animation: loader 2s infinite ease; } .loader-inner { vertical-align: top; display: inline-block; width: 100%; background-color: #20293e; animation: loader-inner 2s infinite ease-in; }*/ .bg-content-slider { overflow: hidden; position: absolute; width: 600px; left: 50%; bottom: 80px; margin-left: -300px; text-align: center; color: #e0c080; } .table { width: 100%; max-width: 100%; background-color: transparent; border-spacing: 0; border-collapse: collapse; } .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th { padding: 10px; line-height: 1.5; vertical-align: top; border-top: 1px solid #ddd; font-size: .9em; } th { text-align: left; color: #e0c080; } .table-striped>tbody>tr:nth-of-type(odd) { background-color: #f9f9f9; } .table>thead>tr>th { vertical-align: bottom; border-top: none; } .content-slider .slick-slide { height: auto; } .slideup-h { opacity: 0; transform: translateY(60px); -webkit-transform: translateY(60px); overflow: hidden; } /*.slideup { opacity: 0; transform: translateY(60px); -webkit-transform: translateY(60px); overflow: hidden; }*/ /*.slidedown { opacity: 0; transform: translateY(-60px); -webkit-transform: translateY(-60px); } .slideleft { opacity: 0; transform: translateX(60px); -webkit-transform: translateX(60px); } .slideright { opacity: 0; transform: translateX(-60px); -webkit-transform: translateX(-60px); } .scalex { transform: scale(0,1); -webkit-transform: scale(0,1); } .scaleup { opacity: 0; transform: scale(0.4); -webkit-transform: scale(0.4); }*/ .slidein { position: relative; overflow: hidden; } .fade { opacity: 0; } .slidein > * { transform: translateY(100%); -webkit-transform: translateY(100%); } /* * Remodal - v1.0.6 * Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking. * http://vodkabears.github.io/remodal/ * * Made by Ilya Makarov * Under MIT License */ /* ========================================================================== Remodal's necessary styles ========================================================================== */ /* Hide scroll bar */ html.remodal-is-locked { overflow: hidden; -ms-touch-action: none; touch-action: none; } /* Anti FOUC */ .remodal, [data-remodal-id] { display: none; } /* Necessary styles of the overlay */ .remodal-overlay { position: fixed; z-index: 9999; top: -5000px; right: -5000px; bottom: -5000px; left: -5000px; display: none; } /* Necessary styles of the wrapper */ .remodal-wrapper { position: fixed; z-index: 10000; top: 0; right: 0; bottom: 0; left: 0; display: none; overflow: auto; color: rgb(32,41,62); -webkit-overflow-scrolling: touch; } .remodal-wrapper:after { display: inline-block; height: 100%; margin-left: -0.05em; content: ""; } /* Fix iPad, iPhone glitches */ .remodal-overlay, .remodal-wrapper { -webkit-backface-visibility: hidden; backface-visibility: hidden; } /* Necessary styles of the modal dialog */ .remodal { position: relative; outline: none; border-radius: 6px; -webkit-text-size-adjust: 100%; -moz-text-size-adjust: 100%; -ms-text-size-adjust: 100%; text-size-adjust: 100%; text-align: left; } .remodal-is-initialized { /* Disable Anti-FOUC */ display: inline-block; } /* * Remodal - v1.0.6 * Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking. * http://vodkabears.github.io/remodal/ * * Made by Ilya Makarov * Under MIT License */ /* ========================================================================== Remodal's default mobile first theme ========================================================================== */ /* Default theme styles for the background */ .remodal-bg.remodal-is-opening, .remodal-bg.remodal-is-opened { -webkit-filter: blur(3px); filter: blur(3px); } /* Default theme styles of the overlay */ .remodal-overlay { background-color: rgba(32,41,62,0.7); } .remodal-overlay.remodal-is-opening, .remodal-overlay.remodal-is-closing { -webkit-animation-duration: 0.3s; animation-duration: 0.3s; -webkit-animation-fill-mode: forwards; animation-fill-mode: forwards; } .remodal-overlay.remodal-is-opening { -webkit-animation-name: remodal-overlay-opening-keyframes; animation-name: remodal-overlay-opening-keyframes; } .remodal-overlay.remodal-is-closing { -webkit-animation-name: remodal-overlay-closing-keyframes; animation-name: remodal-overlay-closing-keyframes; } /* Default theme styles of the wrapper */ .remodal-wrapper { padding: 10px 10px 0; text-align: center; } /* Default theme styles of the modal dialog */ .remodal { -webkit-box-sizing: border-box; box-sizing: border-box; width: 100%; margin-bottom: 10px; padding: 20px; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); color: #2b2e38; background: #fff; } .remodal.remodal-is-opening, .remodal.remodal-is-closing { -webkit-animation-duration: 0.3s; animation-duration: 0.3s; -webkit-animation-fill-mode: forwards; animation-fill-mode: forwards; } .remodal.remodal-is-opening { -webkit-animation-name: remodal-opening-keyframes; animation-name: remodal-opening-keyframes; } .remodal.remodal-is-closing { -webkit-animation-name: remodal-closing-keyframes; animation-name: remodal-closing-keyframes; } /* Vertical align of the modal dialog */ .remodal, .remodal-wrapper:after { vertical-align: middle; } /* Close button */ .remodal-close { position: absolute; top: 0; right: 0; display: block; overflow: visible; margin: 0; cursor: pointer; -webkit-transition: color 0.2s; transition: color 0.2s; text-decoration: none; color: #95979c; border: 0; outline: 0; background: transparent; padding: 10px; } .remodal-close:hover, .remodal-close:focus { color: #2b2e38; } .remodal-close i { font-size: 2.2em; } /* Keyframes ========================================================================== */ @-webkit-keyframes remodal-opening-keyframes { from { -webkit-transform: scale(1.05); transform: scale(1.05); opacity: 0; } to { -webkit-transform: none; transform: none; opacity: 1; } } @keyframes remodal-opening-keyframes { from { -webkit-transform: scale(1.05); transform: scale(1.05); opacity: 0; } to { -webkit-transform: none; transform: none; opacity: 1; } } @-webkit-keyframes remodal-closing-keyframes { from { -webkit-transform: scale(1); transform: scale(1); opacity: 1; } to { -webkit-transform: scale(0.95); transform: scale(0.95); opacity: 0; } } @keyframes remodal-closing-keyframes { from { -webkit-transform: scale(1); transform: scale(1); opacity: 1; } to { -webkit-transform: scale(0.95); transform: scale(0.95); opacity: 0; } } @-webkit-keyframes remodal-overlay-opening-keyframes { from { opacity: 0; } to { opacity: 1; } } @keyframes remodal-overlay-opening-keyframes { from { opacity: 0; } to { opacity: 1; } } @-webkit-keyframes remodal-overlay-closing-keyframes { from { opacity: 1; } to { opacity: 0; } } @keyframes remodal-overlay-closing-keyframes { from { opacity: 1; } to { opacity: 0; } } select.form-control { -webkit-appearance: none; -moz-appearance: none; color: #777; } .select-group i { position: absolute; right: 15px; bottom: 10px; font-size: 1.4em; color: #777; } ::-webkit-input-placeholder { /* Chrome/Opera/Safari */ color: #777; } ::-moz-placeholder { /* Firefox 19+ */ color: #777; } :-ms-input-placeholder { /* IE 10+ */ color: #777; } :-moz-placeholder { /* Firefox 18- */ color: #777; } /* Media queries ========================================================================== */ @media only screen and (min-width: 641px) { .remodal { max-width: 800px; } } /* IE8 ========================================================================== */ .lt-ie9 .remodal-overlay { background: #2b2e38; } .lt-ie9 .remodal { width: 700px; } @keyframes loader { 0% { transform: rotate(0deg); } 25% { transform: rotate(180deg); } 50% { transform: rotate(180deg); } 75% { transform: rotate(360deg); } 100% { transform: rotate(360deg); } } @keyframes loader-inner { 0% { height: 0%; } 25% { height: 0%; } 50% { height: 100%; } 75% { height: 100%; } 100% { height: 0%; } } .page-cover { height: 85%; position: relative; z-index: 1; text-align: center; background-color: #20293e; } .page-cover .content { width: 800px; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); -webkit-transform: translate(-50%,-50%); color: #fff; } .lg-para { font-size: 1.6em; } .pc-para { overflow: hidden; width: 100%; height: 100%; } .line-divider { margin: 20px auto; height: 3px; width: 200px; background-color: #e0c080; } .pc-bg { width: 100%; height: 100%; position: relative; background-position: center; background-size: cover; } .tli-left .timeline-item { padding-right: 100px; } .timeline-item { display: block; float: left; width: 50%; padding-top: 30px; padding-bottom: 30px; position: relative; } .timeline { height: 100%; width: 2px; background-color: #e0c080; position: absolute; bottom:0; } .first .timeline { height: 50%; } .last .timeline { height: 50%; top:0; bottom: auto; } .tl-dot { width: 30px; height: 30px; border-radius: 50%; background-color: #fff; box-shadow: 1px 4px 7px rgba(0,0,0,0.2); position: absolute; top: 50%; margin-top: -15px; } .tl-dot:after { content: " "; width: 14px; height: 14px; background-color: #20293e; border-radius: 50%; position: absolute; left: 50%; top: 50%; margin-left: -7px; margin-top: -7px; } .tli-left .tl-dot { right: -15px; } .tli-right .tl-dot { left: -15px; } .tli-left .timeline { right: -1px; } .tli-right .timeline { left: -1px; } .tli-right .timeline-item { padding-left: 100px; float: right; } .timeline-item p { font-size: .9em; } .lg-icon { font-size: 3em; color: #e0c080; } .md-icon { font-size: 1.8em; color: #e0c080; } .para-bg, .pc-bg, .fade, .scalex, .slideright, .slideleft, .slidedown, .para-img-inner, .scaleup, .gold-panel, .panel, .para-img-inner, .its-img-inner, .slideup, .slidein > *, .preload-cover { backface-visibility: hidden; -webkit-backface-visibility: hidden; } /* my css */ @font-face { font-family: SangBleuEmpire-Regular; src: url('../../static/fonts/SangBleuEmpire-Regular.woff2') format('woff2'), url('../../static/fonts/SangBleuEmpire-Regular.woff') format('woff2'); } .fluid-container { width: 94%; margin: 0 auto; position: relative; } .btn.btn-primary { color: #ca9d75; border: 1px solid #ca9d75; font-weight: 400; font-size: 1rem; padding: 16px 40px; border-radius: 40px; background: transparent; padding: 12px 35px; } .down-arrow { width: 40px; height: 40px; background-size: cover; position: absolute; z-index: 999; display: block; top: 50%; left: 50%; transform: translate(-50%,-50%); -webkit-transform: translate(-50%,-50%); } .center-content h1 { mix-blend-mode: difference; } .scroll-btn { width: 200px; height: 200px; color: #ca9d75; border: 1px solid #ca9d75; border-radius: 50%; position: absolute; cursor: pointer; left: 50%; text-align: center; margin-left: -100px; bottom: -40px; color: #20293e; -webkit-animation: scroll 2s infinite ease-in-out; -moz-animation: scroll 2s infinite ease-in-out; animation: scroll 2s infinite ease-in-out; } .center-content { position: absolute; top: 50%; left: 50%; width: 1000px; transform: translate(-50%,-50%); -webkit-transform: translate(-50%,-50%); } .center-align { text-align: center; } .right-align { text-align: right; } .p-w {color: #fff} .h-font { font-size: 4rem; line-height: 1.01266em; letter-spacing: -.05em; text-transform: uppercase; font-family: 'SangBleuEmpire-Regular', serif; font-weight: lighter; } .big-text { font-size: 8rem;} .l-big-text { font-size: 12rem;} .pos { position: relative; } .about-us { height: 100vh } .h-left-img { width: 60vw; height: 70vh; left: 0; overflow: hidden; position: absolute; background-size: cover; } .h-right-content { position: absolute; right: 0; width: 38vw; padding: 40px; color: #ca9d75; } .text-center { text-align: center; } .projects { width: 140%; left: -24%; position: relative; display: flex; flex-flow: row nowrap; align-items: center; } #services { width: 300%; height: 100%; position: relative; display: flex; flex-flow: row nowrap; align-items: center; } .Ycenter { position: absolute; top: 50%; width: 100%; text-align: center; transform: translateY(-50%); -webkit-transform: translateY(-50%); z-index: 99; } .p-img { display: block; position: relative; width: 600px; margin-right: 50px; height: 600px; background-size: cover; } .p-img-1 { display: block; position: relative; width: 800px; margin-right: 50px; height: 400px; background-size: cover; } .q-text { width: 1000px; text-transform: uppercase; padding: 0 100px; } .q-text h2 { font-size: 4rem; } .q-text h2 span{ color: #ca9d75; } .image-holder{ width:70%; } img{ width:100%; height:100%; object-fit:cover; object-position:50% 50%; } .gallery{ padding:2em; height:200vh; } .image-pop{ width:20%; height:30vh; position:relative; } #one{ top:3em; left:5em; } #two{ top:4em; left:60%; } #three{ top:8em; left:10%; } #four{ top:3em; left:70%; } #five{ top:6em; left:30%; } .ui-light-color { background-color: #f9f0ec } .o-image_wrapper { position: relative; overflow: hidden; background-color: #f9f0ec } .o-image { opacity: 1; mix-blend-mode: multiply; } .o-image.is-inview img { opacity: 1; transform: scale(1); transition-delay: .6s; } .o-image img { width: 100%; opacity: 0; transform: scale(1.2); transition: opacity 1.2s cubic-bezier(.215,.61,.355,1),transform 1.2s cubic-bezier(.215,.61,.355,1); } .o-image.is-reveal img { opacity: 1; transform: scale(1); } .s-left { width: 40vw; } .is-inview .sc-img { opacity: 0.9; transform: scale(1); transition-delay: .8s; } .sui-card { width: 31.3333%; height: 250px; position: relative; float: left; margin: 0 1%; transition: opacity 1.2s cubic-bezier(.215,.61,.355,1),transform 1.2s cubic-bezier(.215,.61,.355,1); } .sui-card:hover { cursor: pointer; } .sui-card:hover .sc-img { opacity: 0.9; transform: scale(1.1); transition-delay: .6s; } .sui-card .sc-img { width: 100%; height: 100%; position: absolute; display: block; background-size: cover; opacity: 0.7; transition: opacity 1.2s cubic-bezier(.215,.61,.355,1),transform 1.2s cubic-bezier(.215,.61,.355,1); } .sc-cont { position: absolute; top: 50%; left: 50%; width: 100%; transform: translate(-50%,-50%); -webkit-transform: translate(-50%,-50%); z-index: 999; text-align: center; } .o-media-wrapper--1-2 { height: 0; padding-bottom: 200%; } .o-media-wrapper { position: relative; overflow: hidden; width: 100%; max-width: 100%; } .c-video { position: absolute; top: 0; left: 50%; right: 0; height: 100%; display: block; -webkit-transform: translateX(-50%); transform: translateX(-50%); } .w-40-right { width: 40%; right: 0; float: right; height: 100vh; overflow: hidden; } .f-color { color: #AC8361; } .s-item { position: relative; width: 50%; min-height: 200px; float: left; padding: 0 30px 0 0; } .s-icon { width: 40px; height: 40px; margin-bottom: 10px; display: block; background-size: cover; } .s-item p { margin-top: 10px; color: #000; font-size: .9rem; } .w60 { width: 60%; float: left; position: relative; padding: 80px 0; } video { height: 100vh; } .project .scroll-btn{ bottom: 50px; } input.f-field { width: 50%; height: 40px; background: transparent; border: none; border-bottom: 1px solid #ac835e; color: #ac835e; margin-bottom: 20px; padding: 0 0 8px; min-width: 0; outline: none; } .ui-black-background { background: #482f2f; } .form-group { width: 80%; margin: auto; padding:40px 0 60px; } .f-h { height: 100vh; } a.submit { width: 100px; height: 100px; color: #ca9d75; border: 1px solid #ca9d75; border-radius: 50%; position: absolute; cursor: pointer; left: 50%; text-align: center; margin-left: -50px; bottom: 40px; color: #20293e; -webkit-animation: scroll 2s infinite ease-in-out; -moz-animation: scroll 2s infinite ease-in-out; animation: scroll 2s infinite ease-in-out; transition: all 0.3s linear; -webkit-transition: all 0.3s linear; } a.submit:hover { background-color: #ca9d75; } a.submit i { font-size: 2em; position: relative; top: 32px; text-align: center; color: #fff; } .scroll-btn:hover { background-color: #ca9d75; } .w40 { width: 50%; margin: auto; padding: 120px 0; } .logo { width: 200px; height: 80px; background-size: contain; background-repeat: no-repeat; margin: auto; } .hero-logo { position: absolute; left: 50%; margin-top: 30px; margin-left: -100px; z-index: 999; } .social-media { display: flex; width: 157px; margin: 40px auto; color: #fff; } .social-media i { font-size: 2rem; margin: 0 10px; color: #fff; } .social-media i:hover { color: #ca9d75 } a:hover{ color: #fff; } a:hover .f-color { color: #fff; } .preloader.title-loading { text-align: center; overflow: hidden; } .center-loading { top: 50%; left: 50%; width: 80%; transform: translate(-50%,-50%); -webkit-transform: translate(-50%,-50%); position: absolute; } .title-loading div { display: inline-block; font-size: 20rem; color: #ca9d75; font-weight: lighter; } @media (min-width:1700px) { .fluid-container { width: 1400px; } #home-welcome { height: 900px; } .body-sec { padding: 160px 0; } .bg-sec { padding: 140px 0; } }
16.126644
208
0.610864
aecf6f9cf1536f0dedd3adf5daf79ad47bea23ed
2,211
cs
C#
SnakeConsoleGame-master/src/SimpleSnakeNoBorders/GameObjects/Point.cs
DeyanDanailov/SoftUni-OOP
1f9fdf0704267b73c148e90ab1ba6ce014b20bfd
[ "MIT" ]
1
2020-11-03T21:39:56.000Z
2020-11-03T21:39:56.000Z
SnakeConsoleGame-master/src/SimpleSnakeNoBorders/GameObjects/Point.cs
DeyanDanailov/SoftUni-OOP
1f9fdf0704267b73c148e90ab1ba6ce014b20bfd
[ "MIT" ]
null
null
null
SnakeConsoleGame-master/src/SimpleSnakeNoBorders/GameObjects/Point.cs
DeyanDanailov/SoftUni-OOP
1f9fdf0704267b73c148e90ab1ba6ce014b20bfd
[ "MIT" ]
null
null
null
namespace SimpleSnakeNoBorders.GameObjects { using System; using System.Collections.Generic; using System.Linq; public class Point { private int leftX; private int topY; private readonly Random random; public Point() { this.random = new Random(); } public Point(int leftX, int topY) : this() { this.LeftX = leftX; this.TopY = topY; } public int LeftX { get { return leftX; } set { if (value < -1 || value > Console.WindowWidth) { throw new IndexOutOfRangeException(); } leftX = value; } } public int TopY { get { return topY; } set { if (value < -1 || value > Console.WindowHeight) { throw new IndexOutOfRangeException(); } topY = value; } } public Point GetRandomPosition(Queue<Point> snakeElements) { this.LeftX = this.random.Next(2, Console.WindowWidth - 2); this.TopY = this.random.Next(2, Console.WindowHeight - 2); while (IsPointOfSnake(snakeElements)) { this.LeftX = this.random.Next(2, Console.WindowWidth - 2); this.TopY = this.random.Next(2, Console.WindowHeight - 2); } var newPoint = new Point(this.LeftX, this.TopY); return newPoint; } private bool IsPointOfSnake(Queue<Point> snakeElements) => snakeElements.Any(x => x.TopY == this.TopY && x.LeftX == this.LeftX); public void Draw(char symbol) { Console.SetCursorPosition(this.LeftX, this.TopY); Console.Write(symbol); } public void Draw(int left, int top, char symbol) { Console.SetCursorPosition(left, top); Console.Write(symbol); } } }
24.296703
85
0.464043
938f671f9f92625615d14e8e1d73924b6a778ee4
445
cs
C#
Sample/CQRSCode/ReadModel/Events/InventoryItemCreated.cs
mvandevy/CQRSlite
1449c18d585475f5f2cf81951cb939dea8ae0891
[ "Apache-2.0" ]
1
2015-06-22T01:08:57.000Z
2015-06-22T01:08:57.000Z
Sample/CQRSCode/ReadModel/Events/InventoryItemCreated.cs
mvandevy/CQRSlite
1449c18d585475f5f2cf81951cb939dea8ae0891
[ "Apache-2.0" ]
null
null
null
Sample/CQRSCode/ReadModel/Events/InventoryItemCreated.cs
mvandevy/CQRSlite
1449c18d585475f5f2cf81951cb939dea8ae0891
[ "Apache-2.0" ]
null
null
null
using System; using CQRSlite.Events; namespace CQRSCode.ReadModel.Events { public class InventoryItemCreated : IEvent { public readonly string Name; public InventoryItemCreated(Guid id, string name) { Id = id; Name = name; } public Guid Id { get; set; } public int Version { get; set; } public DateTimeOffset TimeStamp { get; set; } } }
23.421053
59
0.566292
bb6a8fccac675c6b1faa92f0cd54076552e3034c
750
cs
C#
src/XUnitTestProject1/DotNetZipTest.cs
paonath/PH.RollingZipRotator.log4net
0e5af677daa590fd5003ab8d65bc7b5b89fdba12
[ "BSD-3-Clause" ]
null
null
null
src/XUnitTestProject1/DotNetZipTest.cs
paonath/PH.RollingZipRotator.log4net
0e5af677daa590fd5003ab8d65bc7b5b89fdba12
[ "BSD-3-Clause" ]
null
null
null
src/XUnitTestProject1/DotNetZipTest.cs
paonath/PH.RollingZipRotator.log4net
0e5af677daa590fd5003ab8d65bc7b5b89fdba12
[ "BSD-3-Clause" ]
null
null
null
using Ionic.Zip; using Xunit; namespace XUnitTestProject1 { public class DotNetZipTest : BaseTest { [Fact] public void Test01() { var filename = @"c:\temp\soffas-fms-uploadftp-sql.log"; using(ZipFile zip= new ZipFile()) { zip.AddFile(filename); zip.Save(".\\test01.zip"); } } [Fact] public void Test02() { var filename = @"c:\temp\p1maintenance-sql.log"; var zipFile = @".\test01.zip"; using(ZipFile zip= new ZipFile(zipFile)) { zip.AddFile(filename); zip.Save(); } } } }
17.44186
67
0.441333
62a16808ba042a768b8919feb1946db88a74866b
721
swift
Swift
MiniPedia/App/AppCoordinator.swift
balitax/MiniPedia
de9cebdbb5d5966233175591e7db19288b5a440e
[ "MIT" ]
6
2020-11-26T06:38:56.000Z
2021-01-01T14:07:47.000Z
MiniPedia/App/AppCoordinator.swift
balitax/MiniPedia
de9cebdbb5d5966233175591e7db19288b5a440e
[ "MIT" ]
null
null
null
MiniPedia/App/AppCoordinator.swift
balitax/MiniPedia
de9cebdbb5d5966233175591e7db19288b5a440e
[ "MIT" ]
4
2020-11-26T07:06:44.000Z
2021-03-11T15:56:35.000Z
// // AppCoordinator.swift // MiniPedia // // Created by Agus Cahyono on 12/10/20. // Copyright © 2020 Agus Cahyono. All rights reserved. // import RxSwift class AppCoordinator: ReactiveCoordinator<Void> { var window: UIWindow init(window: UIWindow) { self.window = window } override func start() -> Observable<Void> { // HOME let tabBarController = AppRootBarViewController() let tabbarCoordinator = AppRootCoordinator(rootViewController: tabBarController) window.rootViewController = tabBarController window.makeKeyAndVisible() return coordinate(to: tabbarCoordinator).take(1) } }
21.848485
88
0.632455
38cfb9c0ca292045d882b466fff1d5d26c232a13
830
php
PHP
app/Model/Customer/Service/Group/Get/Groups/GetCustomerGroups.php
timigen2010/crm
0a3c27311292c939509b049fc757dc5f5c123cc5
[ "MIT" ]
null
null
null
app/Model/Customer/Service/Group/Get/Groups/GetCustomerGroups.php
timigen2010/crm
0a3c27311292c939509b049fc757dc5f5c123cc5
[ "MIT" ]
null
null
null
app/Model/Customer/Service/Group/Get/Groups/GetCustomerGroups.php
timigen2010/crm
0a3c27311292c939509b049fc757dc5f5c123cc5
[ "MIT" ]
null
null
null
<?php namespace App\Model\Customer\Service\Group\Get\Groups; use App\Model\Customer\Entity\Group\CustomerGroup; use App\Model\Customer\Repository\CustomerGroupRepository; use App\Model\Customer\Service\Group\Get\GetCustomerGroupsInterface; use Illuminate\Database\Eloquent\Collection; class GetCustomerGroups implements GetCustomerGroupsInterface { private CustomerGroupRepository $customerGroupRepository; public function __construct(CustomerGroupRepository $customerGroupRepository) { $this->customerGroupRepository = $customerGroupRepository; } /** * @param mixed $data * @return Collection<CustomerGroup> */ public function getGroups($data = []) { return $this->customerGroupRepository->findBy([]) ->loadMissing('customerGroupDescriptions'); } }
28.62069
81
0.746988
37988844dd07ed6b4028840bee296eb844415a43
598
lua
Lua
AzurLaneData/zh-CN/mod/battle/command/gate/battlegatesimulation.lua
FlandreCirno/AzurLaneWikiUtilitiesManual
b525fd9086dd716bb65848a8cd0635b261ab6fdf
[ "MIT" ]
null
null
null
AzurLaneData/zh-CN/mod/battle/command/gate/battlegatesimulation.lua
FlandreCirno/AzurLaneWikiUtilitiesManual
b525fd9086dd716bb65848a8cd0635b261ab6fdf
[ "MIT" ]
null
null
null
AzurLaneData/zh-CN/mod/battle/command/gate/battlegatesimulation.lua
FlandreCirno/AzurLaneWikiUtilitiesManual
b525fd9086dd716bb65848a8cd0635b261ab6fdf
[ "MIT" ]
null
null
null
slot0 = class("BattleGateSimulation") ys.Battle.BattleGateSimulation = slot0 slot0.__name = "BattleGateSimulation" slot0.Entrance = function (slot0, slot1) slot1:sendNotification(GAME.BEGIN_STAGE_DONE, { prefabFleet = ys.Battle.BattleDataFunction.GetDungeonTmpDataByID(slot3).fleet_prefab, stageId = slot0.stageId, system = SYSTEM_SIMULATION, exitCallback = slot0.exitCallback, warnMsg = slot0.warnMsg }) end slot0.Exit = function (slot0, slot1) slot1:sendNotification(GAME.FINISH_STAGE_DONE, { system = SYSTEM_SIMULATION, exitCallback = slot0.exitCallback }) end return slot0
26
87
0.784281
a012a52e4b04d880006939ea8e4e63d6773c1296
1,933
ts
TypeScript
angular/projects/spark-angular/src/lib/components/sprk-autocomplete/directives/sprk-autocomplete-results/sprk-autocomplete-results.directive.spec.ts
sgowell-rm/spark-design-system
9753543b1df06fc6a435c3662f627ca21e82eae9
[ "MIT" ]
101
2017-09-26T23:48:46.000Z
2022-03-29T18:48:30.000Z
angular/projects/spark-angular/src/lib/components/sprk-autocomplete/directives/sprk-autocomplete-results/sprk-autocomplete-results.directive.spec.ts
sgowell-rm/spark-design-system
9753543b1df06fc6a435c3662f627ca21e82eae9
[ "MIT" ]
2,737
2017-09-28T19:25:54.000Z
2022-03-23T11:55:55.000Z
angular/projects/spark-angular/src/lib/components/sprk-autocomplete/directives/sprk-autocomplete-results/sprk-autocomplete-results.directive.spec.ts
sgowell-rm/spark-design-system
9753543b1df06fc6a435c3662f627ca21e82eae9
[ "MIT" ]
102
2017-09-29T13:33:56.000Z
2022-02-03T10:22:10.000Z
import { Component } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { SprkAutocompleteResultsDirective } from './sprk-autocomplete-results.directive'; @Component({ selector: 'sprk-test', template: ` <ul sprkAutocompleteResults analyticsString="results1" idString="resultsId1" ></ul> <ul sprkAutocompleteResults></ul> `, }) class TestComponent {} describe('Spark Autocomplete Results Directive', () => { let component: TestComponent; let fixture: ComponentFixture<TestComponent>; let element: HTMLElement; let emptyElement: HTMLElement; beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [SprkAutocompleteResultsDirective, TestComponent], }).compileComponents(); fixture = TestBed.createComponent(TestComponent); component = fixture.componentInstance; element = fixture.nativeElement.querySelectorAll('ul')[0]; emptyElement = fixture.nativeElement.querySelectorAll('ul')[1]; fixture.detectChanges(); })); it('should create itself', () => { expect(component).toBeTruthy(); }); it('should add the correct base class', () => { expect(emptyElement.classList.toString()).toEqual( 'sprk-c-Autocomplete__results', ); }); it('should add a value for data-analytics if analyticsString has a value', () => { expect(element.getAttribute('data-analytics')).toEqual('results1'); }); it('should add a value for data-id if idString has a value', () => { expect(element.getAttribute('data-id')).toEqual('resultsId1'); }); it('should not add a value for data-analytics if analyticsString has no value', () => { expect(emptyElement.getAttribute('data-analytics')).toEqual(null); }); it('should not add a value for data-id if idString has no value', () => { expect(emptyElement.getAttribute('data-id')).toEqual(null); }); });
30.68254
89
0.687532
8bf93fddea375027e532286bfbf0e1d95ec51dfd
3,580
rb
Ruby
spec/ruby/core/encoding/converter/last_error_spec.rb
prathamesh-sonpatki/jruby
7b25a2f75a116f87a9ef09e603fd08e415b829b6
[ "Ruby", "Apache-2.0" ]
173
2015-01-02T11:14:08.000Z
2022-03-05T09:54:54.000Z
spec/ruby/core/encoding/converter/last_error_spec.rb
prathamesh-sonpatki/jruby
7b25a2f75a116f87a9ef09e603fd08e415b829b6
[ "Ruby", "Apache-2.0" ]
263
2015-01-05T04:35:22.000Z
2021-09-07T06:00:02.000Z
spec/ruby/core/encoding/converter/last_error_spec.rb
prathamesh-sonpatki/jruby
7b25a2f75a116f87a9ef09e603fd08e415b829b6
[ "Ruby", "Apache-2.0" ]
77
2015-01-12T20:57:18.000Z
2022-02-17T15:15:14.000Z
require File.expand_path('../../../../spec_helper', __FILE__) with_feature :encoding do describe "Encoding::Converter#last_error" do it "returns nil when the no conversion has been attempted" do ec = Encoding::Converter.new('ascii','utf-8') ec.last_error.should be_nil end it "returns nil when the last conversion did not produce an error" do ec = Encoding::Converter.new('ascii','utf-8') ec.convert('a'.force_encoding('ascii')) ec.last_error.should be_nil end it "returns nil when #primitive_convert last returned :destination_buffer_full" do ec = Encoding::Converter.new("utf-8", "iso-2022-jp") ec.primitive_convert("\u{9999}", "", 0, 0, :partial_input => false) \ .should == :destination_buffer_full ec.last_error.should be_nil end it "returns nil when #primitive_convert last returned :finished" do ec = Encoding::Converter.new("utf-8", "iso-8859-1") ec.primitive_convert("glark".force_encoding('utf-8'),"").should == :finished ec.last_error.should be_nil end it "returns nil if the last conversion succeeded but the penultimate failed" do ec = Encoding::Converter.new("utf-8", "iso-8859-1") ec.primitive_convert("\xf1abcd","").should == :invalid_byte_sequence ec.primitive_convert("glark".force_encoding('utf-8'),"").should == :finished ec.last_error.should be_nil end it "returns an Encoding::InvalidByteSequenceError when #primitive_convert last returned :invalid_byte_sequence" do ec = Encoding::Converter.new("utf-8", "iso-8859-1") ec.primitive_convert("\xf1abcd","").should == :invalid_byte_sequence ec.last_error.should be_an_instance_of(Encoding::InvalidByteSequenceError) end it "returns an Encoding::UndefinedConversionError when #primitive_convert last returned :undefined_conversion" do ec = Encoding::Converter.new("utf-8", "iso-8859-1") ec.primitive_convert("\u{9876}","").should == :undefined_conversion ec.last_error.should be_an_instance_of(Encoding::UndefinedConversionError) end it "returns an Encoding::InvalidByteSequenceError when #primitive_convert last returned :incomplete_input" do ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1") ec.primitive_convert("\xa4", "", nil, 10).should == :incomplete_input ec.last_error.should be_an_instance_of(Encoding::InvalidByteSequenceError) end it "returns an Encoding::InvalidByteSequenceError when the last call to #convert produced one" do ec = Encoding::Converter.new("utf-8", "iso-8859-1") exception = nil lambda do begin ec.convert("\xf1abcd") rescue Encoding::InvalidByteSequenceError => e exception = e raise e end end.should raise_error(Encoding::InvalidByteSequenceError) ec.last_error.should be_an_instance_of(Encoding::InvalidByteSequenceError) ec.last_error.message.should == exception.message end it "returns an Encoding::UndefinedConversionError when the last call to #convert produced one" do ec = Encoding::Converter.new("utf-8", "iso-8859-1") exception = nil lambda do begin ec.convert("\u{9899}") rescue Encoding::UndefinedConversionError => e exception = e raise e end end.should raise_error(Encoding::UndefinedConversionError) ec.last_error.should be_an_instance_of(Encoding::UndefinedConversionError) ec.last_error.message.should == exception.message end end end
42.117647
118
0.690782
9e2bec041f7b47de22fe6f86957314c1516c1c75
3,033
cs
C#
src/core/Jenetics/LongChromosome.cs
lvv88/jenetics.net
7317b9bd7a07c6826880ab9f9ab5b8f45fcbf9bf
[ "Apache-2.0" ]
6
2017-09-13T12:07:27.000Z
2020-05-10T06:11:29.000Z
src/core/Jenetics/LongChromosome.cs
lvv88/jenetics.net
7317b9bd7a07c6826880ab9f9ab5b8f45fcbf9bf
[ "Apache-2.0" ]
null
null
null
src/core/Jenetics/LongChromosome.cs
lvv88/jenetics.net
7317b9bd7a07c6826880ab9f9ab5b8f45fcbf9bf
[ "Apache-2.0" ]
4
2018-10-12T13:49:57.000Z
2020-12-02T14:37:09.000Z
// Java Genetic Algorithm Library. // Copyright (c) 2017 Franz Wilhelmstötter // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // Author: // Franz Wilhelmstötter (franz.wilhelmstoetter@gmx.at) using System; using System.Collections.Generic; using System.Runtime.Serialization; using Jenetics.Internal.Util; using Jenetics.Util; namespace Jenetics { [Serializable] public class LongChromosome : BoundedChromosomeBase<long, LongGene>, INumericChromosome<long, LongGene>, ISerializable { private LongChromosome(IImmutableSeq<LongGene> genes) : base(genes) { } public LongChromosome(long min, long max, int length = 1) : this(LongGene.Seq(min, max, length)) { Valid = true; } protected LongChromosome(SerializationInfo info, StreamingContext context) { var genes = MutableSeq.OfLength<LongGene>(info.GetInt32("_length")); Min = info.GetInt64("_min"); Max = info.GetInt64("_max"); for (var i = 0; i < genes.Length; ++i) genes[i] = new LongGene(info.GetInt64("_gene_" + i), Min, Max); Genes = genes.ToImmutableSeq(); } public override IEnumerator<LongGene> GetEnumerator() { return Genes.GetEnumerator(); } public override IChromosome<LongGene> NewInstance() { return new LongChromosome(Min, Max, Length); } public override IChromosome<LongGene> NewInstance(IImmutableSeq<LongGene> genes) { return new LongChromosome(genes); } public void GetObjectData(SerializationInfo info, StreamingContext context) { info.AddValue("_length", Length); info.AddValue("_min", Min); info.AddValue("_max", Max); for (var i = 0; i < Genes.Length; i++) info.AddValue("_gene_" + i, Genes[i].Allele); } public override bool Equals(object obj) { return Equality.Of(this, obj)(base.Equals); } public override int GetHashCode() { return Hash.Of(GetType()).And(base.GetHashCode()).Value; } public static LongChromosome Of(LongRange range) { return new LongChromosome(range.Min, range.Max); } public static LongChromosome Of(long min, long max, int length) { return new LongChromosome(min, max, length); } } }
31.268041
108
0.620508
b2bf757f740ac95de0446007169030697d1295f7
644
css
CSS
public/css/recipe.css
enggsuraj/Food-Recipe-App
9241f056b8c10f8e8c50d5de8905d2498e30d678
[ "MIT" ]
null
null
null
public/css/recipe.css
enggsuraj/Food-Recipe-App
9241f056b8c10f8e8c50d5de8905d2498e30d678
[ "MIT" ]
null
null
null
public/css/recipe.css
enggsuraj/Food-Recipe-App
9241f056b8c10f8e8c50d5de8905d2498e30d678
[ "MIT" ]
1
2021-03-06T06:29:36.000Z
2021-03-06T06:29:36.000Z
* { margin: 0; padding: 0; text-decoration: none; font-family: sans-serif; box-sizing: border-box; } h1, h2, h3 { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } p, span, .nutritions { font-family: "Source Sans Pro"; } .container-recipe { width: 50%; margin: 0 auto; padding: 20px; font-family: sans-serif; } div, #steps { margin: 20px 0; } .ingredient-box { width: 80%; } .ingredient-text { float: right; } #add-ingredient, #btn-ingredient { padding: 10px 20px; } .ingredient-text { padding: 5px; } input[type="checkbox"] { height: 20px; width: 20px; } span { padding-left: 10px; }
11.709091
63
0.628882
01b6125e262027617acaf7199ba8f040d62552f1
912
html
HTML
js/dom/index.html
brunomichalski/Curso-Fullstack
d6bb860cfd4bd1e23e1a253fbe87a04d38fb670a
[ "MIT" ]
null
null
null
js/dom/index.html
brunomichalski/Curso-Fullstack
d6bb860cfd4bd1e23e1a253fbe87a04d38fb670a
[ "MIT" ]
null
null
null
js/dom/index.html
brunomichalski/Curso-Fullstack
d6bb860cfd4bd1e23e1a253fbe87a04d38fb670a
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="js/registro-casa.js"></script> <title>Document</title> </head> <body> <h3>Resgistro de casa</h3> <form action=""> <p> <label>Area: </label> <input type="text" name="area"> </p> <p> <label>Número: </label> <input type="text" name="numero"> </p> <p> <label>Bairro: </label> <input type="text" name="bairro"> </p> <p> <label>Cidade: </label> <input type="text" name="cidade"> </p> <button onclick="saveHouse()" type="button">Salvar</button> <ul id="lista-casa"> </ul> </form> </body> </html>
24.648649
74
0.492325
aee785acda85717d145056ef1a0de664998ecbe8
517
cs
C#
Assets/DMMap/Editor/DMMapPointEditor.cs
luffy-yu/DMMap
677be1328f58e9949f9701999312fcc643cda9f5
[ "MIT" ]
16
2021-02-22T09:54:58.000Z
2022-03-25T02:00:57.000Z
Assets/DMMap/Editor/DMMapPointEditor.cs
luffy-yu/DMMap
677be1328f58e9949f9701999312fcc643cda9f5
[ "MIT" ]
1
2022-02-23T02:12:19.000Z
2022-02-23T02:26:15.000Z
Assets/DMMap/Editor/DMMapPointEditor.cs
luffy-yu/DMMap
677be1328f58e9949f9701999312fcc643cda9f5
[ "MIT" ]
3
2021-02-25T09:06:04.000Z
2022-02-22T01:12:52.000Z
using UnityEngine; using System.Collections; using UnityEditor; namespace DMM { [CustomEditor(typeof(DMMapPoint))] public class DMMapPointEditor : Editor { public override void OnInspectorGUI() { base.OnInspectorGUI(); if (GUILayout.Button("New Point")) { DMMapPoint p = (DMMapPoint)target; GameObject v = p.parentShape.NewPoint(); UnityEditor.Selection.activeGameObject = v; } } } }
24.619048
60
0.574468
23d0c8978f76cd12d0f48f2533b10100249616d1
2,329
js
JavaScript
src/components/PrettyHtml/index.js
Do-you-dream-up/CV5
4c2a61ccfb02dd132a989fee1c462192cd0aedab
[ "MIT" ]
2
2020-12-16T10:20:28.000Z
2021-12-09T15:55:58.000Z
src/components/PrettyHtml/index.js
Do-you-dream-up/CV5
4c2a61ccfb02dd132a989fee1c462192cd0aedab
[ "MIT" ]
7
2022-01-14T13:20:42.000Z
2022-03-24T14:13:03.000Z
src/components/PrettyHtml/index.js
Do-you-dream-up/CV5
4c2a61ccfb02dd132a989fee1c462192cd0aedab
[ "MIT" ]
1
2021-11-21T08:38:48.000Z
2021-11-21T08:38:48.000Z
import c from 'classnames'; import PropTypes from 'prop-types'; import React from 'react'; import { useTranslation } from 'react-i18next'; import { CAROUSSEL_TEMPLATE, PRODUCT_TEMPLATE, QUICK_REPLY, knownTemplates } from '../../tools/template'; import CarouselTemplate from '../CarouselTemplate'; import ProductTemplate from '../ProductTemplate'; import QuickreplyTemplate from '../QuickreplyTemplate'; import useStyles from './styles'; /** * Prettify children and string passed as parameter. * * Basically an opinionated reset. */ export default function PrettyHtml({ children, className, component, hasExternalLink, html, templatename, type, ...rest }) { const classes = useStyles(); const { t } = useTranslation('translation'); const RE_ONCLICK = /onclick=".+?"/gm; const RE_REWORD = /class="reword/gm; const RE_HREF = /(<a href([^>]+)>)/g; const RE_HREF_EMPTY = /href="#"/g; const hrefMatchs = html && html.match(RE_HREF); hrefMatchs && hrefMatchs.map((el) => { if (!el.match(RE_REWORD)) { html = html.replace(el, el.replace(RE_ONCLICK, '')); } else { html = html.replace(el, el.replace(RE_HREF_EMPTY, '')); } }); const interactionType = type === 'response' ? t('screenReader.chatbot') : t('screenReader.me'); return React.createElement( component, { className: c(classes.root, className), ...rest }, <> {children} {<span className={classes.srOnly} dangerouslySetInnerHTML={{ __html: interactionType }}></span>} {templatename === PRODUCT_TEMPLATE && <ProductTemplate html={html} />} {templatename === CAROUSSEL_TEMPLATE && <CarouselTemplate html={html} />} {templatename === QUICK_REPLY && <QuickreplyTemplate html={html} />} {!knownTemplates.includes(templatename) && <div dangerouslySetInnerHTML={{ __html: html }} />} {hasExternalLink && ( <img className={classes.externalLinkIcon} src={`${process.env.PUBLIC_URL}icons/dydu-open-in-new-black.svg`} /> )} </>, ); } PrettyHtml.defaultProps = { component: 'div', }; PrettyHtml.propTypes = { children: PropTypes.node, className: PropTypes.string, component: PropTypes.elementType, hasExternalLink: PropTypes.bool, html: PropTypes.string, templatename: PropTypes.string, type: PropTypes.string, };
30.644737
118
0.671962
149ffd6413d96efdbee91929285c850a1f017d16
542
kt
Kotlin
lib/src/main/java/com/aednlaxer/lib/units/Reaumur.kt
aednlaxer/kold
795ad3f51a5a4d8ae60e995394c26f6ba17af1f5
[ "MIT" ]
null
null
null
lib/src/main/java/com/aednlaxer/lib/units/Reaumur.kt
aednlaxer/kold
795ad3f51a5a4d8ae60e995394c26f6ba17af1f5
[ "MIT" ]
null
null
null
lib/src/main/java/com/aednlaxer/lib/units/Reaumur.kt
aednlaxer/kold
795ad3f51a5a4d8ae60e995394c26f6ba17af1f5
[ "MIT" ]
null
null
null
package com.aednlaxer.lib.units class Reaumur(value: Double) : TemperatureUnit(value) { override fun toCelsius() = value * 5.0 / 4.0 override fun toFahrenheit() = value * 9.0 / 4.0 + 32.0 override fun toKelvin() = value * 5.0 / 4.0 + 273.15 override fun toRankine() = value * 9.0 / 4.0 + 491.67 override fun toDelisle() = (80.0 - value) * 15.0 / 8.0 override fun toNewton() = value * 33.0 / 80.0 override fun toReaumur() = value override fun toRomer() = value * 21.0 / 32.0 + 7.5 override fun getSymbol(): String = "°Ré" }
38.714286
56
0.642066
0d47e4d98f4a24b30784444c9fcfe387ef5833e8
687
cs
C#
Source/StandardLibrary/StandardLibrary.Core/DeepCopying/IDeepCopyable.cs
FlightSimHelpingFramework/FlightSimInformation
87c204ef2641ec7f6cfebb29885e340ad312d6c5
[ "MIT" ]
null
null
null
Source/StandardLibrary/StandardLibrary.Core/DeepCopying/IDeepCopyable.cs
FlightSimHelpingFramework/FlightSimInformation
87c204ef2641ec7f6cfebb29885e340ad312d6c5
[ "MIT" ]
null
null
null
Source/StandardLibrary/StandardLibrary.Core/DeepCopying/IDeepCopyable.cs
FlightSimHelpingFramework/FlightSimInformation
87c204ef2641ec7f6cfebb29885e340ad312d6c5
[ "MIT" ]
null
null
null
// This is an open source non-commercial project. Dear PVS-Studio, please check it. // PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com #region Usings using JetBrains.Annotations; #endregion namespace StandardLibrary.DeepCopying { /// <summary> /// Interface of an object, that support deep copying. /// </summary> /// <typeparam name="T">Type of copyable object.</typeparam> public interface IDeepCopyable<out T> { /// <summary> /// Creates deep copy of an object. /// </summary> /// <returns>Deep copy.</returns> [NotNull] [UsedImplicitly] T DeepCopy(); } }
26.423077
84
0.614265
4c373ebdfbb1bfedd0a366e0da3cd5544b6a02b8
1,300
lua
Lua
menus.lua
SamyBencherif/stephanie
c9be7e58149c6ae945524ae9fd058cab10c7f0b8
[ "MIT" ]
null
null
null
menus.lua
SamyBencherif/stephanie
c9be7e58149c6ae945524ae9fd058cab10c7f0b8
[ "MIT" ]
null
null
null
menus.lua
SamyBencherif/stephanie
c9be7e58149c6ae945524ae9fd058cab10c7f0b8
[ "MIT" ]
null
null
null
-- Entity imports local Button = require "entities/menu/button" local Object = require("libraries/classic/classic") local assets = require("libraries/cargo/cargo").init("assets") -- Unit constants -- World width local W = 512 -- World height local H = 512 -- Block size (both dim) local B = 64 -- (Derived) : these are now hardcoded, -- please ensure they are consistent with above -- Half of world width local W2 = 512/2 -- Half of world height local H2 = 512/2 -- Half of block size (both dim) local B2 = 64/2 -- Blocks per world width local WB = W/B -- Block per world height local HB = H/B -- Block size without border, -- useful so I can tightly -- pack them together local b = B-12 -- I am also defining these constants -- They are useful for placing Ground primitives, -- since they use half blocks. -- Half blocks per world width local WB2 = WB*2 -- Half blocks per world height local HB2 = HB*2 -- Levels are listed in reverse order because each level -- must have a reference to the one it will spawn function start(Game) local entities = Game.entities local world = Game.world entities[#entities+1] = Button(Game, W/2, H/2) end return {start=start}
24.074074
62
0.645385
fb0b12c24b35b73b47c5ee3924d976397a79040b
2,705
h
C
inetsrv/iis/inc/iisver.h
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
inetsrv/iis/inc/iisver.h
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
inetsrv/iis/inc/iisver.h
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
// // Apps' rc files should look like this: // /** #include "windows.h" #include "ntverp.h" #define VER_FILEDESCRIPTION_STR "File Description" #define VER_INTERNALNAME_STR "Internal Name" #define VER_ORIGINALFILENAME_STR "Original Name" #define VER_FILETYPE VFT_DLL #include "iisver.h" #include "common.ver" **/ // // Apps may also define, in the same place as the other defines, above: // VER_FILESUBTYPE // VER_IISPRODUCTNAME_STR // VER_IISMAJORVERSION // VER_IISMINORVERSION // VER_IISPRODUCTVERSION_STR // VER_IISPRODUCTVERSION // VER_IISPRODUCTBUILD // #ifndef VER_FILEDESCRIPTION_STR #define VER_FILEDESCRIPTION_STR "IIS Executable" #endif #ifndef VER_INTERNALNAME_STR #define VER_INTERNALNAME_STR "IISFile.exe" #endif #ifndef VER_ORIGINALFILENAME_STR #define VER_ORIGINALFILENAME_STR VER_INTERNALNAME_STR #endif #ifdef VER_PRODUCTNAME_STR #undef VER_PRODUCTNAME_STR #endif #ifndef VER_IISPRODUCTNAME_STR #define VER_IISPRODUCTNAME_STR "Internet Information Services" #endif #define VER_PRODUCTNAME_STR VER_IISPRODUCTNAME_STR #ifndef VER_IISMAJORVERSION #if _IIS_5_1 #define VER_IISMAJORVERSION 5 #else #define VER_IISMAJORVERSION 6 #endif #endif #ifndef VER_IISMINORVERSION #if _IIS_5_1 #define VER_IISMINORVERSION 1 #else #define VER_IISMINORVERSION 0 #endif #endif #ifdef VER_PRODUCTVERSION_STR #undef VER_PRODUCTVERSION_STR #endif #define VER_IISPRODUCTVERSION_STRING VER_PRODUCTVERSION_MAJORMINOR1(VER_IISMAJORVERSION, VER_IISMINORVERSION) #define VER_IISPRODUCTVERSION_STR2(x,y) VER_IISPRODUCTVERSION_STRING "." VER_BPAD #x "." #y #define VER_IISPRODUCTVERSION_STR1(x,y) VER_IISPRODUCTVERSION_STR2(x, y) #define VER_PRODUCTVERSION_STR VER_IISPRODUCTVERSION_STR1(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE) // // VER_PRODUCTBUILD is defined by ntverp.h as the nt build number // #ifndef VER_PRODUCTBUILD #define VER_PRODUCTBUILD 0984 #endif #ifndef VER_IISPRODUCTBUILD #define VER_IISPRODUCTBUILD VER_PRODUCTBUILD #endif #ifdef VER_PRODUCTVERSION #undef VER_PRODUCTVERSION #endif #ifndef VER_IISPRODUCTVERSION #define VER_IISPRODUCTVERSION VER_IISMAJORVERSION,VER_IISMINORVERSION,VER_IISPRODUCTBUILD,VER_PRODUCTBUILD_QFE #endif #define VER_PRODUCTVERSION VER_IISPRODUCTVERSION #ifndef VER_FILEVERSION #define VER_FILEVERSION VER_PRODUCTVERSION #endif #ifndef VER_FILETYPE #define VER_FILETYPE VFT_DLL #endif #ifndef VER_FILESUBTYPE #define VER_FILESUBTYPE VFT2_UNKNOWN #endif
24.816514
120
0.744177
a3e434dbd8e9fb17462114d1429a14a03a7caf37
19,543
java
Java
paas-common-dbclient/src/test/java/dbtest/ClickHouseTest.java
maoge/zzstack
aa8b356571dbb0f250057a291d76d9355a8b471b
[ "MIT" ]
null
null
null
paas-common-dbclient/src/test/java/dbtest/ClickHouseTest.java
maoge/zzstack
aa8b356571dbb0f250057a291d76d9355a8b471b
[ "MIT" ]
null
null
null
paas-common-dbclient/src/test/java/dbtest/ClickHouseTest.java
maoge/zzstack
aa8b356571dbb0f250057a291d76d9355a8b471b
[ "MIT" ]
null
null
null
package dbtest; import java.sql.Array; import java.util.HashMap; import java.util.List; import java.util.Map.Entry; import java.util.Set; import java.util.UUID; import com.zzstack.paas.underlying.dbclient.CRUD; import com.zzstack.paas.underlying.dbclient.LoadBalancedDBSrcPool; import com.zzstack.paas.underlying.dbclient.SqlBean; import com.zzstack.paas.underlying.dbclient.exception.DBException; public class ClickHouseTest { private static final String INSERT_SQL = "insert into test(user_id, create_date, update_count) values(?, ?, ?)"; // private static final String UPDATE_SQL = "ALTER TABLE test UPDATE update_count = ? WHERE user_id = ?"; private static final String UPSERT_SQL = "insert into test(user_id, create_date, update_count) select user_id, create_date, ? from test where user_id = ?"; private static final String SELECT_SQL = "select user_id, create_date, update_count from test"; private static final String SELECT_NESTED = "select abstract.slice_id, abstract.slice_type, abstract.slice_content from dt_paper"; private static final String INSERT_NESTED = "INSERT INTO dt_paper(" + "doc_id," + "source," + "title_content," + "authors.name," + "authors.organization," + "authors.email," + "abstract_id," + "abstract_title," + "abstract.slice_id," + "abstract.slice_type," + "abstract.slice_content," + "introduction_id," + "introduction_title," + "introduction.slice_id," + "introduction.slice_type," + "introduction.slice_content," + "results_id," + "results_title," + "results.slice_id," + "results.slice_type," + "results.slice_content," + "discussion_id," + "discussion_title," + "discussion.slice_id," + "discussion.slice_type," + "discussion.slice_content," + "methods_id," + "methods_title," + "methods.slice_id," + "methods.slice_type," + "methods.slice_content," + "reference_id," + "reference_title," + "reference_item.slice_content" + ") format Values (" + "?, ?, ?, ?, ?, ?, " + "?, ?, ?, ?, ?, " + "?, ?, ?, ?, ?, " + "?, ?, ?, ?, ?, " + "?, ?, ?, ?, ?, " + "?, ?, ?, ?, ?, " + "?, ?, ?" + ")"; /* CREATE TABLE smsdb.test\ (\ user_id UInt64,\ create_date Date DEFAULT toDate(now()),\ update_count UInt8 DEFAULT 0\ ) ENGINE = ReplacingMergeTree()\ PARTITION BY toYYYYMMDD(create_date)\ ORDER BY (user_id)\ primary key (user_id); */ public static void main(String[] args) { LoadBalancedDBSrcPool.get("clickhouse"); testInsert(); testUpdate(); testSelect(); testNestedInsert(); testNestedSelect(); } private static String genUUID() { UUID uuid = UUID.randomUUID(); return uuid.toString(); } private static void testNestedInsert() { CRUD c = new CRUD("clickhouse"); SqlBean sqlBean1 = new SqlBean(INSERT_NESTED); sqlBean1.putParam(new Long(1)); sqlBean1.putParam("https://doi.org/10.1038/s41467-022-29443-w"); sqlBean1.putParam("Learning meaningful representations of protein sequences"); sqlBean1.putParam(new String[] {"Nicki Skafte Detlefsen", "Søren Hauberg", "Wouter Boomsma"}); sqlBean1.putParam(new String[] {"", "", ""}); sqlBean1.putParam(new String[] {"", "", ""}); sqlBean1.putParam(genUUID()); sqlBean1.putParam("Abstract"); sqlBean1.putParam(new String[] {genUUID(), genUUID(), genUUID()}); sqlBean1.putParam(new Integer[] {1, 1, 1}); sqlBean1.putParam(new String[] { "How we choose to represent our data has a fundamental impact on our ability to subsequently extract information from them. Machine learning promises to automatically determine efficient representations from large unstructured datasets, such as those arising in biology. However, empirical evidence suggests that seemingly minor changes to these machine learning models yield drastically different data representations that result in different biological interpretations of data. ", "This begs the question of what even constitutes the most meaningful representation. Here, we approach this question for representations of protein sequences, which have received considerable attention in the recent literature. We explore two key contexts in which representations naturally arise: transfer learning and interpretable learning. ", "In the first context, we demonstrate that several contemporary practices yield suboptimal performance, and in the latter we demonstrate that taking representation geometry into account significantly improves interpretability and lets the models reveal biological information that is otherwise obscured." }); sqlBean1.putParam(genUUID()); sqlBean1.putParam("Introduction"); sqlBean1.putParam(new String[] {genUUID(), genUUID(), genUUID()}); sqlBean1.putParam(new Integer[] {1, 1, 1}); sqlBean1.putParam(new String[] { "Data representations play a crucial role in the statistical analysis of biological data. At its core, a representation is a distillation of raw data into an abstract, high-level and often lower-dimensional space that captures the essential features of the original data. This can subsequently be used for data exploration, e.g. through visualization, or task-specific predictions where limited data is available.", "Given the importance of representations it is no surprise that we see a rise in biology of representation learning1, a subfield of machine learning where the representation is estimated alongside the statistical model. In the analysis of protein sequences in particular, the last years have produced a number of studies that demonstrate how representations can help extract important biological information automatically from the millions of observations acquired through modern sequencing technologies2,3,4,5,6,7,8,9,10,11,12,13,14.", "While these promising results indicate that learned representations can have substantial impact on scientific data analysis, they also beg the question: what is a good representation? This elementary question is the focus of this paper." }); sqlBean1.putParam(genUUID()); sqlBean1.putParam("Results"); sqlBean1.putParam(new String[] {genUUID(), genUUID(), genUUID()}); sqlBean1.putParam(new Integer[] {1, 1, 1}); sqlBean1.putParam(new String[] { "Representation learning has at least two uses: In transfer learning we seek a representation that improves a downstream task, and in data interpretation the representation should reveal the data’s underlying patterns, e.g. through visualization. Since the first has been at the center of recent literature4,5,8,9,10,20,21, we place our initial focus there, and turn later to data interpretation.", "Representations for transfer learning Transfer learning addresses the problems caused by limited access to labeled data. For instance, when predicting the stability of a given protein, we only have limited training data available as it is experimentally costly to measure stability. The key idea is to leverage the many available unlabeled protein sequences to learn (pre-train) a general protein representation through an embedding model, and then train a problem-specific task model on top using the limited labeled training data (Fig. 1).", "In the protein setting, learning representations for transfer learning can be implemented at different scopes. It can be addressed at a universal scope, where representations are learned to reflect general properties of all proteins, or it can be implemented at the scope of an individual protein family, where an embedding model is pre-trained only on closely related sequences. Initially, we will focus on universal setting, but will return to family-specific models in the second half of the paper." }); sqlBean1.putParam(genUUID()); sqlBean1.putParam("Discussion"); sqlBean1.putParam(new String[] {genUUID(), genUUID(), genUUID()}); sqlBean1.putParam(new Integer[] {1, 1, 1}); sqlBean1.putParam(new String[] { "Learned representations of protein sequences can substantially improve systems for making biological predictions, and may also help to reveal previously uncovered biological information. In this paper, we have illuminated parts of the answer to the question of what constitutes a meaningful representation of proteins. One of the conclusions is that the question itself does not have a single general answer, and must always be qualified with a specification of the purpose of the representation. A representation that is suitable for making predictions may not be optimal for a human investigator to better understand the underlying biology, and vice versa. The enticing idea of a single protein representation for all tasks thus seems unworkable in practice.", "Designing purposeful representations Designing a representation for a given task requires reflection over which biological properties we wish the representation to encapsulate. Different biological aspects of a protein will place different demands on the representations, but it is not straightforward to enforce specific properties in a representation. We can, however, steer the representation learning by (1) picking appropriate model architectures, (2) preprocessing the data, (3) choosing suitable objective functions, and (4) placing prior distributions on parts of the model. We discuss each of these in turn.", "Informed network architectures can be difficult to construct as the usual neural network ‘building blocks’ are fairly elementary mathematical functions that are not immediately linked to high-level biological information. Nonetheless, our discussion of length-invariant sequence representations is a simple example of how one might inform the model architecture of the biology of the task. It is generally acknowledged that global protein properties are not linearly related to local properties. It is therefore not surprising when we show that the model performance significantly improves when we allow the model to learn such a nonlinear relationship instead of relying on the common linear average of local representations. It would be interesting to push this idea beyond the Resnet architecture that we explored here, in particular in combination with the recent large-scale transformer-based language models. We speculate that while similar ‘low-hanging fruit’ may remain in currently applied network architectures, they are limited, and more advanced tools are needed to encode biological information into network architectures. The internal representations in attention-based architectures have been shown to recover known physical interactions between proteins37,38, opening the door to the incorporation of prior information about known physical interactions in a protein. Recent work on permutation and rotation invariance/equivariance in neural networks49,50 hold promise, though they have yet to be explored exhaustively in representation learning." }); sqlBean1.putParam(genUUID()); sqlBean1.putParam("Methods"); sqlBean1.putParam(new String[] {genUUID(), genUUID(), genUUID()}); sqlBean1.putParam(new Integer[] {1, 1, 1}); sqlBean1.putParam(new String[] { "Variational autoencoders", "A variational autoencoder assumes that data X is generated from some (unknown) latent factors Z though the process pθ(X∣Z). The latent variables Z can be viewed as the compressed representation of X. Latent space models try to model the joint distribution of X and Z as pθ(X, Z) = pθ(Z)pθ(X∣Z). ", "The generating process can then be viewed as a two-step procedure: first a latent variable Z is sampled from the prior and then data X is sampled from the conditional pθ(X∣Z) (often called the decoder). Since X is discrete by nature, pθ(X∣Z) is modeled as a Categorical distribution pθ(X∣Z) ~ Cat(C, lθ(Z)) with C classes and lθ(Z) being the log-probabilities for each class. To make the model flexible enough to capture higher-order amino acid interactions, we model lθ(Z) as a neural network. Even though data X is discrete, we use continuous latent variables Z ~ N(0, 1)." }); sqlBean1.putParam(genUUID()); sqlBean1.putParam("References"); sqlBean1.putParam(new String[] { "Bengio, Y., Courville, A. & Vincent, P. Representation Learning: A Review and New Perspectives. IEEE Trans. Pattern Anal. Mach. Intell. 35, 1798–1828 (2013).", "Riesselman, A. J., Ingraham, J. B. & Marks, D. S. Deep generative models of genetic variation capture the effects of mutations. Nat. Methods 15, 816–822 (2018).", "Bepler, T. & Berger, B. Learning protein sequence embeddings using information from structure. In International Conference on Learning Representations (2019)." }); c.putSqlBean(sqlBean1); if (c.executeUpdate()) { System.out.println("nested insert OK ......"); } else { System.err.println("nested insert NOK ......"); } } private static void testNestedSelect() { SqlBean sqlBean = new SqlBean(SELECT_NESTED); CRUD c = new CRUD("clickhouse"); c.putSqlBean(sqlBean); try { List<HashMap<String, Object>> result = c.queryForList(); if (result != null && !result.isEmpty()) { for (HashMap<String, Object> map : result) { Set<Entry<String, Object>> entrySet = map.entrySet(); for (Entry<String, Object> entry : entrySet) { Object val = entry.getValue(); Class<?> clazz = val.getClass(); String type = clazz.getSimpleName(); if (val instanceof Array) { Array arr = (Array) val; String baseTypeName = arr.getBaseTypeName(); Object data = arr.getArray(); Object[] arrData = (Object[]) data; printArray(entry.getKey(), type, baseTypeName, arrData); } else { printObject(entry.getKey(), type, val); } } } } } catch (Exception e) { e.printStackTrace(); } } private static void printObject(String key, String type, Object obj) { String info = String.format("%s | %s | %s", key, type, obj.toString()); System.out.println(info); } private static void printArray(String key, String type, String baseTypeName, Object[] arrData) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < arrData.length; ++i) { if (i > 0) { sb.append("|"); } sb.append(arrData[i].toString()); } String info = String.format("%s | %s | %s | %s", key, type, baseTypeName, sb.toString()); System.out.println(info); } private static void testInsert() { CRUD c = new CRUD("clickhouse"); java.sql.Timestamp ts = new java.sql.Timestamp(System.currentTimeMillis()); SqlBean sqlBean1 = new SqlBean(INSERT_SQL); sqlBean1.addParams(new Object[] { 1000, ts, 0 }); c.putSqlBean(sqlBean1); SqlBean sqlBean2 = new SqlBean(INSERT_SQL); sqlBean2.addParams(new Object[] { 1001, ts, 0 }); c.putSqlBean(sqlBean2); c.batchUpdate(); } private static void testUpdate() { CRUD c = new CRUD("clickhouse"); SqlBean sqlBean1 = new SqlBean(UPSERT_SQL); sqlBean1.addParams(new Object[] { 3, 1000 }); c.putSqlBean(sqlBean1); c.executeUpdate(); SqlBean sqlBean2 = new SqlBean(UPSERT_SQL); sqlBean2.addParams(new Object[] { 3, 1001 }); c.putSqlBean(sqlBean2); c.executeUpdate(); // c.batchUpdate(); } private static void testSelect() { SqlBean sqlBean = new SqlBean(SELECT_SQL); CRUD c = new CRUD("clickhouse"); c.putSqlBean(sqlBean); try { List<HashMap<String, Object>> result = c.queryForList(); if (result != null && !result.isEmpty()) { for (HashMap<String, Object> map : result) { Set<Entry<String, Object>> entrySet = map.entrySet(); for (Entry<String, Object> entry : entrySet) { Object val = entry.getValue(); String type = val.getClass().getName(); String info = String.format("%s | %s | %s", entry.getKey(), type, val.toString()); System.out.println(info); } } } } catch (DBException e) { e.printStackTrace(); } } }
70.046595
1,579
0.595917
249c7f7f3c345bd52f83062fb9e820c8000d1fb6
306
php
PHP
tests/Fixtures/DecoratorCommand.php
zlikavac32/nsb-decorators
d47c35311f7ddd128d4d93966fb46bcd77e41e74
[ "MIT" ]
null
null
null
tests/Fixtures/DecoratorCommand.php
zlikavac32/nsb-decorators
d47c35311f7ddd128d4d93966fb46bcd77e41e74
[ "MIT" ]
null
null
null
tests/Fixtures/DecoratorCommand.php
zlikavac32/nsb-decorators
d47c35311f7ddd128d4d93966fb46bcd77e41e74
[ "MIT" ]
null
null
null
<?php declare(strict_types=1); namespace Zlikavac32\NSBDecorators\Tests\Fixtures; class DecoratorCommand implements Command { private Command $command; public function __construct(Command $command) { $this->command = $command; } public function run(): void { } }
13.909091
50
0.669935
339934a79dfc3ef12adf1c5bb33fb20f3c90fb17
834
h
C
contracts/libc++/upstream/include/setjmp.h
cubetrain/CubeTrain
b930a3e88e941225c2c54219267f743c790e388f
[ "MIT" ]
1
2019-12-13T05:51:34.000Z
2019-12-13T05:51:34.000Z
contracts/libc++/upstream/include/setjmp.h
cubetrain/CubeTrain
b930a3e88e941225c2c54219267f743c790e388f
[ "MIT" ]
null
null
null
contracts/libc++/upstream/include/setjmp.h
cubetrain/CubeTrain
b930a3e88e941225c2c54219267f743c790e388f
[ "MIT" ]
1
2021-09-17T15:41:36.000Z
2021-09-17T15:41:36.000Z
// -*- C++ -*- //===--------------------------- setjmp.h ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef _LIBCPP_SETJMP_H #define _LIBCPP_SETJMP_H /* setjmp.h synopsis Macros: setjmp Types: jmp_buf void longjmp(jmp_buf env, int val); */ #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif #include_next <setjmp.h> #ifdef __cplusplus #ifndef setjmp #define setjmp(env) setjmp(env) #endif #endif // __cplusplus #endif // _LIBCPP_SETJMP_H
18.130435
81
0.534772
b767de3fcf18ad1ff838a3b3ee458af38573a642
5,173
cpp
C++
test/System/Session.cpp
ntoskrnl7/win32api-ex
e91521b53745655fd8fb7d6532770f4888420814
[ "MIT" ]
18
2022-01-12T23:01:55.000Z
2022-03-28T01:50:56.000Z
test/System/Session.cpp
ntoskrnl7/win32api-ex
e91521b53745655fd8fb7d6532770f4888420814
[ "MIT" ]
null
null
null
test/System/Session.cpp
ntoskrnl7/win32api-ex
e91521b53745655fd8fb7d6532770f4888420814
[ "MIT" ]
3
2022-02-25T10:55:41.000Z
2022-02-25T13:06:21.000Z
#include <Win32Ex/System/Session.hpp> #include <gtest/gtest.h> TEST(SessionTest, ThisSession) { EXPECT_EQ(Win32Ex::ThisSession::Id(), WTSGetActiveConsoleSessionId()); EXPECT_STREQ(Win32Ex::ThisSession::Name().c_str(), Win32Ex::System::Session(Win32Ex::ThisSession::Id()).Name().c_str()); EXPECT_STREQ(Win32Ex::ThisSession::UserName().c_str(), Win32Ex::System::Session(Win32Ex::ThisSession::Id()).UserName().c_str()); } TEST(SessionTest, ThisSessionNewProcessT) { #if defined(WIN32EX_USE_TEMPLATE_FUNCTION_DEFAULT_ARGUMENT_STRING_T) auto process = Win32Ex::ThisSession::NewProcessT(Win32Ex::System::UserAccount, TEXT("notepad")); #else Win32Ex::Result<Win32Ex::System::SessionT<>::RunnableProcessPtr> process = Win32Ex::ThisSession::NewProcessT<Win32Ex::StringT>(Win32Ex::System::UserAccount, TEXT("notepad")); #endif if (process.IsOk()) { process->RunAsync().Wait(500); process->Exit(); } process = Win32Ex::ThisSession::NewProcessT<Win32Ex::StringT>(Win32Ex::System::SystemAccount, TEXT("notepad")); if (process.IsOk()) { process->RunAsync().Wait(500); process->Exit(); } } TEST(SessionTest, ThisSessionNewProcess) { #if defined(WIN32EX_USE_TEMPLATE_FUNCTION_DEFAULT_ARGUMENT_STRING_T) auto process = Win32Ex::ThisSession::NewProcess(Win32Ex::System::UserAccount, "notepad"); #else Win32Ex::Result<Win32Ex::System::Session::RunnableProcessPtr> process = Win32Ex::ThisSession::NewProcess(Win32Ex::System::UserAccount, "notepad"); #endif if (process.IsOk()) { process->RunAsync().Wait(500); process->Exit(); } process = Win32Ex::ThisSession::NewProcess(Win32Ex::System::SystemAccount, "notepad"); if (process.IsOk()) { process->RunAsync().Wait(500); process->Exit(); } } TEST(SessionTest, ThisSessionNewProcessW) { #if defined(WIN32EX_USE_TEMPLATE_FUNCTION_DEFAULT_ARGUMENT_STRING_T) auto process = Win32Ex::ThisSession::NewProcessW(Win32Ex::System::UserAccount, L"notepad"); #else Win32Ex::Result<Win32Ex::System::SessionW::RunnableProcessPtr> process = Win32Ex::ThisSession::NewProcessW(Win32Ex::System::UserAccount, L"notepad"); #endif if (process.IsOk()) { process->RunAsync().Wait(500); process->Exit(); } process = Win32Ex::ThisSession::NewProcessW(Win32Ex::System::SystemAccount, L"notepad"); if (process.IsOk()) { process->RunAsync().Wait(500); process->Exit(); } } TEST(SessionTest, SessionNewProcess) { #if defined(__cpp_range_based_for) for (auto session : Win32Ex::System::Session::All()) { auto process = session.NewProcess(Win32Ex::System::UserAccount, "notepad"); #else // clang-format off for each (Win32Ex::System::Session session in Win32Ex::System::Session::All()) { Win32Ex::Result<Win32Ex::System::Session::RunnableProcessPtr> process = session.NewProcess(Win32Ex::System::UserAccount, "notepad"); // clang-format on #endif if (process.IsOk()) { process->RunAsync().Wait(500); process->Exit(); } process = session.NewProcess(Win32Ex::System::SystemAccount, "notepad"); if (process.IsOk()) { process->RunAsync().Wait(500); process->Exit(); } } } TEST(SessionTest, SessionWNewProcess) { #if defined(__cpp_range_based_for) for (auto session : Win32Ex::System::SessionW::All()) { auto process = session.NewProcess(Win32Ex::System::UserAccount, L"notepad"); #else // clang-format off for each (Win32Ex::System::SessionW session in Win32Ex::System::SessionW::All()) { Win32Ex::Result<Win32Ex::System::SessionW::RunnableProcessPtr> process = session.NewProcess(Win32Ex::System::UserAccount, L"notepad"); // clang-format on #endif if (process.IsOk()) { process->RunAsync().Wait(500); process->Exit(); } process = session.NewProcess(Win32Ex::System::SystemAccount, L"notepad"); if (process.IsOk()) { process->RunAsync().Wait(500); process->Exit(); } } } TEST(SessionTest, SessionTNewProcess) { #if defined(__cpp_range_based_for) for (auto session : Win32Ex::System::SessionT<>::All()) { auto process = session.NewProcess(Win32Ex::System::UserAccount, TEXT("notepad")); #else // clang-format off for each (Win32Ex::System::SessionT<> session in Win32Ex::System::SessionT<>::All()) { Win32Ex::Result<Win32Ex::System::SessionT<>::RunnableProcessPtr> process = session.NewProcess(Win32Ex::System::UserAccount, TEXT("notepad")); // clang-format on #endif if (process.IsOk()) { process->RunAsync().Wait(500); process->Exit(); } process = session.NewProcess(Win32Ex::System::SystemAccount, TEXT("notepad")); if (process.IsOk()) { process->RunAsync().Wait(500); process->Exit(); } } }
32.534591
115
0.635028
d6019b51e43d1a2ec3dc292badfed7c354d7f582
3,150
rs
Rust
src/lib.rs
Xe-forks/rs621
64cbe47e611cd2a4f1b945c74f471dfcae625309
[ "Apache-2.0", "MIT" ]
null
null
null
src/lib.rs
Xe-forks/rs621
64cbe47e611cd2a4f1b945c74f471dfcae625309
[ "Apache-2.0", "MIT" ]
null
null
null
src/lib.rs
Xe-forks/rs621
64cbe47e611cd2a4f1b945c74f471dfcae625309
[ "Apache-2.0", "MIT" ]
null
null
null
//! Wrapper crate for the [e621.net](https://e926.net) API. //! //! ## Usage //! //! First, create a [`Client`]. You have to provide a descriptive User-Agent for your project. The //! official API encourages you to include your E621 username so that you may be contacted if your //! project causes problems. //! //! ```no_run //! # use xe621::client::Client; //! # fn main() -> Result<(), xe621::error::Error> { //! let client = Client::new("MyProject/1.0 (by username on e621)")?; //! # Ok(()) } //! ``` //! //! Now it's ready to go! For example you can get post #8595 like this: //! //! ```no_run //! # use xe621::client::Client; //! # fn main() -> Result<(), xe621::error::Error> { //! # let client = Client::new("MyProject/1.0 (by username on e621)")?; //! let post = client.get_post(8595)?; //! //! assert_eq!(post.id, 8595); //! # Ok(()) } //! ``` //! //! Or you can make a search like on the website, using tags: //! //! ```no_run //! # use xe621::client::Client; //! # fn main() -> Result<(), xe621::error::Error> { //! # let client = Client::new("MyProject/1.0 (by username on e621)")?; //! for post in client.post_search(&["fluffy", "rating:s"][..]).take(20) { //! println!("#{}", post?.id); //! } //! # Ok(()) } //! ``` //! //! ## Notes from the official API: //! //! ### User Agents //! //! > A non-empty User-Agent header is required for all requests. Please pick a descriptive //! > User-Agent for your project. You are encouraged to include your e621 username so that you may //! > be contacted if your project causes problems. **DO NOT impersonate a browser user agent, as //! > this will get you blocked.** An example user-agent would be //! > ```text //! > MyProject/1.0 (by username on e621) //! > ``` //! > Due to frequent abuse, default user agents for programming languages and libraries are usually //! > blocked. Please make sure that you are defining a user agent that is in line with our policy. //! > //! > [[...]](https://e926.net/help/show/api#basics) //! //! Thus, `xe621` doesn't have a default user agent and you are required to specify your own. //! //! ### Rate Limiting //! //! > E621/E926 have a hard rate limit of two requests per second. This is a hard upper limit and if //! > you are hitting it, you are already going way too fast. Hitting the rate limit will result in //! > a 503 HTTP response code. You should make a best effort not to make more than one request per //! > second over a sustained period. //! //! `xe621` will enforce this limit with a short sleeping time after every API request being made. //! This short sleep time only happens in the thread the request is being made and requests made in //! other threads will NOT be affected. Thus, **if you are using `xe621` across multiple threads, //! you are responsible for making sure that you aren't exceeding the upper rate limit.** Waiting //! for functions performing requests in other threads to return should be enough. //! //! [`Client`]: client/struct.Client.html mod utils; /// Client related structures. pub mod client; /// Error management. pub mod error; /// Post management. pub mod post; /// Pool management. pub mod pool;
36.627907
100
0.655556
e287c9beb0016455581c661dd30db0e2ddc4ee07
4,212
py
Python
tests/rip/test_rip.py
My-Little-Cable-Co/rip
7d540721fea3d76601ad8af21b307d2ef70701a1
[ "MIT" ]
null
null
null
tests/rip/test_rip.py
My-Little-Cable-Co/rip
7d540721fea3d76601ad8af21b307d2ef70701a1
[ "MIT" ]
6
2020-09-20T03:51:09.000Z
2020-11-15T07:01:39.000Z
tests/rip/test_rip.py
My-Little-Cable-Co/rip
7d540721fea3d76601ad8af21b307d2ef70701a1
[ "MIT" ]
1
2020-10-05T02:24:18.000Z
2020-10-05T02:24:18.000Z
import pytest import subprocess from rip.rip import Rip from unittest.mock import patch @pytest.mark.usefixtures('capsys') @patch('rip.rip.subprocess.run') def test_requirements_check__dvd_info_not_in_path(subprocess_run, capsys): def subprocess_run_side_effect(*args, **kwargs): if args == (['dvd_info', '--version'],): # For this test we are testing what happens when dvd_info is not # in the PATH, so we will mimic this condition by raising a # FileNotFoundError. raise FileNotFoundError('dvd_info not in PATH') elif args == (['HandBrakeCLI', '--version'],): # For this test we are focused on dvd_info, so we'll assume no # issues with HandBrakeCLI. pass else: raise ValueError(f'Unexpected arguments for mocked subprocess.run: {args}') subprocess_run.side_effect = subprocess_run_side_effect # assert the method returned False assert not Rip().requirements_check() stdout, stderr = capsys.readouterr() assert "ERROR, dependency not found: This program requires the 'dvd_info' binary to be in the PATH." in stdout @pytest.mark.usefixtures('capsys') @patch('rip.rip.subprocess.run') def test_requirements_check__dvd_info_in_path(subprocess_run, capsys): def subprocess_run_side_effect(*args, **kwargs): if args == (['dvd_info', '--version'],): # For this test we are testing what happens when dvd_info is in # the PATH, so we will mimic this condition by doing nothing. pass elif args == (['HandBrakeCLI', '--version'],): # For this test we are focused on dvd_info, so we'll assume no # issues with HandBrakeCLI. pass else: raise ValueError(f'Unexpected arguments for mocked subprocess.run: {args}') subprocess_run.side_effect = subprocess_run_side_effect # assert the method returned True assert Rip().requirements_check() stdout, stderr = capsys.readouterr() # assert that nothing was output as the result of running this assert not stdout @pytest.mark.usefixtures('capsys') @patch('rip.rip.subprocess.run') def test_requirements_check__handbrakecli_not_in_path(subprocess_run, capsys): def subprocess_run_side_effect(*args, **kwargs): if args == (['dvd_info', '--version'],): # For this test we are focused on HandBrakeCLI, so we'll assume no # issues with dvd_info. pass elif args == (['HandBrakeCLI', '--version'],): # For this test we are testing what happens when HandBrakeCLI is not # in the PATH, so we will mimic this condition by raising a # FileNotFoundError. raise FileNotFoundError('HandBrakeCLI not in PATH') else: raise ValueError(f'Unexpected arguments for mocked subprocess.run: {args}') subprocess_run.side_effect = subprocess_run_side_effect # assert the method returned False assert not Rip().requirements_check() stdout, stderr = capsys.readouterr() assert "ERROR, dependency not found: This program requires the 'HandBrakeCLI' binary to be in the PATH." in stdout @pytest.mark.usefixtures('capsys') @patch('rip.rip.subprocess.run') def test_requirements_check__handbrakecli_in_path(subprocess_run, capsys): def subprocess_run_side_effect(*args, **kwargs): if args == (['dvd_info', '--version'],): # For this test we are focused on HandBrakeCLI, so we'll assume no # issues with dvd_info. pass elif args == (['HandBrakeCLI', '--version'],): # For this test we are testing what happens when HandBrakeCLI is in # the PATH, so we will mimic this condition by doing nothing. pass else: raise ValueError(f'Unexpected arguments for mocked subprocess.run: {args}') subprocess_run.side_effect = subprocess_run_side_effect # assert the method returned True assert Rip().requirements_check() stdout, stderr = capsys.readouterr() # assert that nothing was output as the result of running this assert not stdout
40.114286
118
0.668091
3a942d9fb7ec561ca33ebf6535581a2d811e6bbf
3,044
lua
Lua
loader/TestDataLoader.lua
karmaok/im2recipe
833e945137817f4abbc074fb733f030ce037ca1f
[ "MIT" ]
312
2017-06-25T23:34:01.000Z
2022-03-28T18:14:31.000Z
loader/TestDataLoader.lua
karmaok/im2recipe
833e945137817f4abbc074fb733f030ce037ca1f
[ "MIT" ]
30
2017-06-29T12:50:36.000Z
2021-04-12T12:40:12.000Z
loader/TestDataLoader.lua
karmaok/im2recipe
833e945137817f4abbc074fb733f030ce037ca1f
[ "MIT" ]
89
2017-06-25T23:34:42.000Z
2022-03-16T11:22:28.000Z
require 'paths' require 'hdf5' local TestDataLoader = torch.class('TestDataLoader') require 'loader.utils' function TestDataLoader:__init(dataTest, opts) self.batchSize = opts.batchSize self.data = dataTest groupByLen(dataTest) self.imfeatDim = opts.imfeatDim self.stDim = opts.stDim self.maxIngrs = opts.maxIngrs self.net = opts.net self.meanstd = { mean = { 0.485, 0.456, 0.406 }, std = { 0.229, 0.224, 0.225 }, } self.vgg_mean = torch.FloatTensor{123.68, 116.779, 103.939} self.imsize = opts.imsize self.imstore = opts.imstore self.dataset = opts.dataset collectgarbage() end function TestDataLoader:makebatch() collectgarbage() local partData = self.data if partData.lenFreqs:sum() == 0 then return nil end local seqlenInd = torch.multinomial(partData.lenFreqs, 1)[1] local seqlen = partData.lengths[seqlenInd] local seqlenInds = partData.indsByLen[seqlen] local batchSize = math.min(#seqlenInds, self.batchSize) imagefile = hdf5.open(self.dataset, 'r'):read('/ims_'..partData.partition) local selIndInds = torch.randperm(#seqlenInds):sub(1, batchSize):sort() local remainingInds = {} local riPtr = 1 -- for all idxs with the selected legth for i=1,#seqlenInds do -- remove selected indices (draw w/o replacement) if riPtr > selIndInds:size(1) or i ~= selIndInds[riPtr] then remainingInds[#remainingInds+1] = seqlenInds[i] else -- if riPtr is smaller than the batch size, increase it riPtr = riPtr + 1 end end partData.indsByLen[seqlen] = #remainingInds > 0 and remainingInds or nil if #remainingInds == 0 then partData.lenFreqs[seqlenInd] = 0 end local batchIds = torch.CharTensor(batchSize, 11):zero() local batchImgs = torch.Tensor(batchSize, 3,self.imsize,self.imsize) local batchInstrs = torch.Tensor(seqlen, batchSize, self.stDim) local batchIngrs = torch.LongTensor(batchSize, self.maxIngrs) for i=1,batchSize do local selInd = seqlenInds[selIndInds[i]] batchIds[i]:sub(1, 10):copy(partData.ids[selInd]) local mean_pixel = self.vgg_mean:view(1,3,1,1) local numims = partData.numims[selInd] local imid = torch.randperm(numims)[1] local impos = partData.impos[selInd][imid] local img = imagefile:partial({impos,impos},{1,3},{1,self.imstore},{1,self.imstore}):float() img = improc(self.imsize,img) img = img:view(1, img:size(1), img:size(2), img:size(3)) -- batch the image if self.net == 'resnet' then img:div(256) img = ImageNormalize(img,self.meanstd) else img:add(-1, mean_pixel:expandAs(img)) end batchImgs[i] = img batchIngrs[i] = partData.ingrs[selInd] local rbp = partData.rbps[selInd] local rlen = partData.rlens[selInd] batchInstrs[{{1, seqlen}, i}] = partData.stvecs:narrow(1, rbp, rlen) end imagefile:close() return {batchImgs, batchInstrs, batchIngrs}, batchIds end function TestDataLoader:partitionSize(partition) return self.data.rlens:size(1) end function TestDataLoader:terminate() end
29.269231
96
0.700394
5682a4f7ad67992d027317d0315daf8e12f29a12
933
rs
Rust
src/pgn/convert.rs
iandraves/Nymbit
3502f9a2a698c6873d6b0c898af517cc782d76a3
[ "CC0-1.0" ]
2
2021-12-05T06:50:38.000Z
2021-12-09T01:05:04.000Z
src/pgn/convert.rs
iandraves/Nymbit
3502f9a2a698c6873d6b0c898af517cc782d76a3
[ "CC0-1.0" ]
null
null
null
src/pgn/convert.rs
iandraves/Nymbit
3502f9a2a698c6873d6b0c898af517cc782d76a3
[ "CC0-1.0" ]
null
null
null
use pleco::{Board, PieceType}; pub fn uci_to_pgn(board: &Board, piece: PieceType) -> String { if piece.is_some() { let move_dest = board.last_move().unwrap().get_dest(); let move_uci = board.last_move().unwrap().stringify(); let piece_type = piece.char_upper(); let is_promo = board.last_move().unwrap().is_promo(); if is_promo { format!("{}={}", move_dest, piece_type).to_string() } else { match piece_type { 'P' => format!("{}", move_dest).to_string(), 'K' => format!("{}{}", piece_type, move_dest).to_string(), _ => format!("{}{}", piece_type, move_uci).to_string(), } } } else { let is_king_castle = board.last_move().unwrap().is_king_castle(); if is_king_castle { "O-O".to_string() } else { "O-O-O".to_string() } } }
32.172414
74
0.517685
25a1f69da723eaa0893de1665b2d2dd2b509c337
2,765
cs
C#
src/Biz.Dfch.CraftmanEngineer.ProtoType/TypeResolver.cs
dfensgmbh/Biz.Dfch.CraftmanEngineer.ProtoType
056262932b5999db751f28705ab5fe7ebb187dc0
[ "Apache-2.0" ]
null
null
null
src/Biz.Dfch.CraftmanEngineer.ProtoType/TypeResolver.cs
dfensgmbh/Biz.Dfch.CraftmanEngineer.ProtoType
056262932b5999db751f28705ab5fe7ebb187dc0
[ "Apache-2.0" ]
null
null
null
src/Biz.Dfch.CraftmanEngineer.ProtoType/TypeResolver.cs
dfensgmbh/Biz.Dfch.CraftmanEngineer.ProtoType
056262932b5999db751f28705ab5fe7ebb187dc0
[ "Apache-2.0" ]
null
null
null
/** * Copyright 2017 d-fens GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; using System.Diagnostics; using System.Linq; using System.Linq.Expressions; using System.Reflection; using biz.dfch.CS.Commons; namespace Biz.Dfch.CraftmanEngineer.ProtoType { public class TypeResolver : ITypeResolver { private const string APPLICATION_NAMESPACE = "Biz.Dfch.CraftmanEngineer.ProtoType."; private static readonly Func<TypeInfo, bool> _isInNamespace = e => e.FullName.StartsWith(APPLICATION_NAMESPACE); private static readonly Lazy<IQueryable<Type>> _types = new Lazy<IQueryable<Type>>(() => { var types = Assembly.GetExecutingAssembly().DefinedTypes.Where(_isInNamespace).ToList(); types.AddRange(Assembly.GetCallingAssembly().DefinedTypes.Where(_isInNamespace)); var entryAssembly = Assembly.GetEntryAssembly(); if (null != entryAssembly) { types.AddRange(entryAssembly.DefinedTypes.Where(_isInNamespace)); } types.AddRange(typeof(BaseDto).Assembly.DefinedTypes.Where(e => e.IsPublic)); types.AddRange(typeof(TypeResolver).Assembly.DefinedTypes.Where(_isInNamespace)); var frames = new StackTrace().GetFrames(); if (null != frames) { foreach (var stackFrame in frames) { var assembly = stackFrame.GetMethod().Module.Assembly; types.AddRange(assembly.DefinedTypes.Where(_isInNamespace)); } } return types.Distinct().ToList().AsQueryable(); }); public virtual IQueryable<Type> Types => _types.Value; public virtual IQueryable<Type> Where() { return Types; } public virtual IQueryable<Type> Where(Expression<Func<Type, bool>> predicate) { return Types.Where(predicate); } public virtual Type FirstOrDefault() { return Types.FirstOrDefault(); } public virtual Type FirstOrDefault(Expression<Func<Type, bool>> predicate) { return Types.FirstOrDefault(predicate); } } }
33.719512
120
0.6434
7f2d1cc3099195bc39276ebc3a455ea8aade92ab
482
cs
C#
camerapitch.cs
MunirMuratovic/unity-scripts
afb0ea35b29c0232a4fda84f5dfd20175b4e3383
[ "MIT" ]
null
null
null
camerapitch.cs
MunirMuratovic/unity-scripts
afb0ea35b29c0232a4fda84f5dfd20175b4e3383
[ "MIT" ]
null
null
null
camerapitch.cs
MunirMuratovic/unity-scripts
afb0ea35b29c0232a4fda84f5dfd20175b4e3383
[ "MIT" ]
null
null
null
using System.Collections; using System.Collections.Generic; using UnityEngine; public class camerapitch : MonoBehaviour { private float pitch; private float pitchspeed = 2; private int xBoxEnabled = 0; // Use this for initialization void Start () { } // Update is called once per frame void Update () { pitch = - Input.GetAxis("Mouse Y")*pitchspeed; transform.Rotate(pitch, 0, 0); if (Input.GetKeyDown(KeyCode.X)) { xBoxEnabled = 1 - xBoxEnabled; } } }
17.851852
48
0.697095
44379af04dbcb0fc02b5addf632317252cda69d2
1,418
sql
SQL
table_schemata.sql
AlvinMcCray/SQL-Challenge
a92e46283914c1c1542c2cd6548bfa74297fa11e
[ "ADSL" ]
null
null
null
table_schemata.sql
AlvinMcCray/SQL-Challenge
a92e46283914c1c1542c2cd6548bfa74297fa11e
[ "ADSL" ]
null
null
null
table_schemata.sql
AlvinMcCray/SQL-Challenge
a92e46283914c1c1542c2cd6548bfa74297fa11e
[ "ADSL" ]
null
null
null
DROP TABLE IF EXISTS departments; CREATE TABLE departments ( dept_no VARCHAR(4) NOT NULL, dept_name VARCHAR(40) NOT NULL, UNIQUE (dept_name), PRIMARY KEY (dept_no) ); DROP TABLE IF EXISTS employees; CREATE TABLE employees ( emp_no INT NOT NULL, emp_title VARCHAR NOT NULL, birth_date DATE NOT NULL, first_name VARCHAR NOT NULL, last_name VARCHAR NOT NULL, gender VARCHAR NOT NULL, hire_date DATE NOT NULL, UNIQUE (emp_title), PRIMARY KEY (emp_no) ); DROP TABLE IF EXISTS dept_emp; CREATE TABLE dept_emp ( emp_no INT NOT NULL, dept_no VARCHAR(4) NOT NULL, PRIMARY KEY (emp_no,dept_no), FOREIGN KEY (emp_no) REFERENCES employees (emp_no), FOREIGN KEY (dept_no) REFERENCES departments (dept_no) ); DROP TABLE IF EXISTS dept_manager; CREATE TABLE dept_manager ( dept_no VARCHAR(4) NOT NULL, emp_no INT NOT NULL, PRIMARY KEY (emp_no,dept_no), FOREIGN KEY (emp_no) REFERENCES employees (emp_no), FOREIGN KEY (dept_no) REFERENCES departments (dept_no) ); DROP TABLE IF EXISTS salaries; CREATE TABLE salaries ( emp_no INT NOT NULL, salary INT NOT NULL, PRIMARY KEY (emp_no), FOREIGN KEY (emp_no) REFERENCES employees (emp_no) ); DROP TABLE IF EXISTS titles; CREATE TABLE titles ( title_id VARCHAR NOT NULL, title VARCHAR NOT NULL, PRIMARY KEY (title_id), FOREIGN KEY (title_id) REFERENCES employees (emp_title) );
21.815385
56
0.720028
7f199b9cf65658e8029c888d487335f66bb31945
744
cs
C#
sketches/cqrs/sample-app/WebFrontend/Domain.cs
Slesa/Poseidon
36a05c6f6193617226210847fa0164c4f6c414a6
[ "Unlicense" ]
1
2016-10-10T22:16:06.000Z
2016-10-10T22:16:06.000Z
sketches/cqrs/sample-app/WebFrontend/Domain.cs
Slesa/Poseidon
36a05c6f6193617226210847fa0164c4f6c414a6
[ "Unlicense" ]
null
null
null
sketches/cqrs/sample-app/WebFrontend/Domain.cs
Slesa/Poseidon
36a05c6f6193617226210847fa0164c4f6c414a6
[ "Unlicense" ]
null
null
null
using Cafe.Infrastructure; using Edument.CQRS; using CafeReadModels; using Cafe.Tab; namespace WebFrontend { public static class Domain { public static MessageDispatcher Dispatcher; public static IOpenTabQueries OpenTabQueries; public static IChefTodoListQueries ChefTodoListQueries; public static void Setup() { Dispatcher = new MessageDispatcher(new InMemoryEventStore()); Dispatcher.ScanInstance(new TabCommandHandlers()); OpenTabQueries = new OpenTabs(); Dispatcher.ScanInstance(OpenTabQueries); ChefTodoListQueries = new ChefTodoList(); Dispatcher.ScanInstance(ChefTodoListQueries); } } }
27.555556
73
0.665323
2c7183575fdea134290e1296269d4c3748f2420c
22,817
py
Python
spacebreeder.py
SimonPreissner/semantic-fruitfly-1.0.0
189d946632f881f319eaed5db14f314494e3e10b
[ "MIT" ]
3
2018-12-10T09:44:54.000Z
2021-09-06T04:47:00.000Z
spacebreeder.py
SimonPreissner/semantic-fruitfly-1.0.0
189d946632f881f319eaed5db14f314494e3e10b
[ "MIT" ]
null
null
null
spacebreeder.py
SimonPreissner/semantic-fruitfly-1.0.0
189d946632f881f319eaed5db14f314494e3e10b
[ "MIT" ]
null
null
null
import os import sys import time import math import numpy as np from tqdm import tqdm import MEN import utils from Fruitfly import Fruitfly from Incrementor import Incrementor """parameters (via console input)""" # paths global corpus_dir, testset_file, overlap_file, \ pipedir, \ count_file, fly_dir, space_dir, results_dir, vip_words_dir, \ w2v_corpus_file, w2v_exe_file, w2v_space_dir, w2v_results_file, \ summary_file # Fruitfly parameters global pns, kcs, con, red, flat, max_pns # Incrementor parameters global window, max_dims, tokenize, postag_simple, min_count, \ test_interval, vip_words_n, verbose # variables/objects global run, breeder, t_thisrun, performance_summary #========== Initial parameter input and setup def param_input_files(): global corpus_dir, testset_file, overlap_file, \ pipedir, \ count_file, fly_dir, space_dir, vip_words_dir, results_dir, \ w2v_corpus_file, w2v_exe_file, w2v_space_dir, w2v_results_file, \ summary_file print("=== Resources and Output Directories ===") corpus_dir = utils.loop_input(rtype=str, default="data/chunks_wiki", msg="Path to text resources (default: data/chunks_wiki): ") w2v_exe_file = utils.loop_input(rtype=str, default=None, msg="Path to Word2Vec code (optional): ") testset_file = utils.loop_input(rtype=str, default="data/MEN_dataset_natural_form_full", msg="Path to test set (default: data/MEN_dataset_natural_form_full): ") overlap_file = utils.loop_input(rtype=str, default=None, msg="Path to a word list to be checked for overlap (optional): ") pipedir = utils.loop_input(rtype=str, default="results/pipe00", msg="Path to the resulting directories (default: results/pipe_00): ") summary_file = pipedir + "/" + "summary.tsv" results_dir = pipedir + "/" + "ffa/results/stats/" w2v_results_file = pipedir + "/" + "w2v/results.txt" if w2v_exe_file is not None else None count_file = pipedir + "/" + "ffa/cooc" fly_dir = pipedir + "/" + "ffa/configs/" space_dir = pipedir + "/" + "ffa/spaces/" vip_words_dir = pipedir + "/" + "ffa/results/words/" w2v_corpus_file = pipedir + "/" + "w2v/resource.txt" if w2v_exe_file is not None else None w2v_space_dir = pipedir + "/" + "w2v/" if w2v_exe_file is not None else None for f in [fly_dir, space_dir, results_dir, vip_words_dir, w2v_space_dir]: if f is not None and not os.path.isdir(f): os.makedirs(f, exist_ok=True) def param_input_FFA(): global pns, kcs, con, red, flat, max_pns print("=== Fruitfly Parameters ===") # Initial Fruitfly parameters (taken from the ukwac_100m gridsearch on 10k dims) pns, kcs, con, red, flat, max_pns = 50, 40000, 20, 8, "log", 10000 d = True if input("use default FFA parameters ({0}, {1}, {2}, {3}, {4}, {5}) [y/n]? " .format(pns, kcs, con, red, flat, max_pns)).upper() == "Y" else False if d is False: pns = utils.loop_input(rtype=int, default=pns, msg="Initial number of PNs: ") kcs = utils.loop_input(rtype=int, default=kcs, msg="Number of KCs: ") con = utils.loop_input(rtype=int, default=con, msg="Connections per KC: ") red = utils.loop_input(rtype=int, default=red, msg="WTA-percentage (whole number): ") flat = utils.loop_input(rtype=str, default=flat, msg="Flattening function (log/log2/log10): ") max_pns = utils.loop_input(rtype=int, default=max_pns, msg="Maximum number of PNs: ") def param_input_misc(): global window, max_dims, tokenize, postag_simple, min_count, \ test_interval, vip_words_n, verbose print("=== Other Parameters ===") window = utils.loop_input(rtype=int, default=5, msg="Window size (to each side) for counting (default: 5): ") min_count = utils.loop_input(rtype=int, default=None, msg="Periodic deletion of words with n occurrences or fewer from the count (optional) -- n: ") max_dims = utils.loop_input(rtype=int, default = None, msg="Maximum vocabulary size for the count (skip this for true incrementality): ") test_interval = utils.loop_input(rtype=int, default=None, msg="Test interval in words; leave empty for filewise testing): ") vip_words_n = utils.loop_input(rtype=int, default=50, msg="Number of important words to be extracted (default: 50): ") tokenize = False if input("Tokenize the input text? (default: yes) [y/n]").upper() == "N" else True postag_simple = True if input("Only count NN/VB/ADJ (requires pos-tagged testset for evaluation)? [y/n]").upper() == "Y" else False verbose = False if input("Be verbose while running? (default: yes) [y/n]").upper() == "N" else True def setup_loop_environment(): """ Compiles a list of file paths of the resource files. Instantiates and logs an initial Fruitfly object. Instantiates the Incrementor object (without text resources) :return: [str] -- list of file paths :return: Incrementor -- main component of the script """ # Make a list of file paths to be passed one by one to an Incrementor object #try: corpus_files = [] if os.path.isfile(corpus_dir): corpus_files = [corpus_dir] else: for (dirpath, dirnames, filenames) in os.walk(corpus_dir): corpus_files.extend([dirpath + "/" + f for f in filenames]) # Create the initial FFA beforehand because Incrementor can't do custom FFA initialization initial_fly_file = fly_dir + "fly_run_0.cfg" first_fly = Fruitfly.from_scratch(pn_size=pns, kc_size=kcs, proj_size=con, hash_percent=red, max_pn_size=max_pns, flattening=flat) first_fly.log_params(filename=initial_fly_file, timestamp=False) """ The constructor of Incrementor 1) reads in text files from a directory (if specified) 2) computes a frequency distribution over the current text 3) sets up or loads a Fruitfly object from an already-logged Fruitfly 4) sets up or loads a co-occurence matrix, with a limit if specified - matrix_incremental=False because it would need to load an existing matrix; however, in this setup, as only one Incrementor object is used, it can increment all the way from an initial matrix. - corpus_linewise=False because it cannot be handled by the loop as of now. - Initialization without corpus. File paths are passed to the Incrementor via the loop. """ breeder = Incrementor(None, count_file, corpus_tokenize=tokenize, corpus_linewise=False, corpus_checkvoc=overlap_file, matrix_incremental=False, matrix_maxdims=max_dims, min_count=min_count, contentwords_only=postag_simple, fly_new=False, fly_grow=True, fly_file=initial_fly_file, verbose=verbose) #except Exception as e: # with open(errorlog, "a") as f: # f.write(str(e)[:500]+"\n") # print("An error occured while setting up the loop environment. Check", errorlog, "for further information.") # sys.exit() return corpus_files, breeder #========== Core functionalities within the loop def new_paths(run): """ Adds the current run's number to file paths to make the run-specific file paths for the fruitfly, the hashed space, the results, and the important words. Returns these 4 file paths as strings. :param run: int -- the current run of the loop """ a = fly_dir + "fly_run_" + str(run) + ".cfg" # for logging b = space_dir + "space_run_" + str(run) + ".dh" # the hashes c = results_dir + "stats_run_" + str(run) + ".txt" d = vip_words_dir + "words_run_" + str(run) + ".txt" return a,b,c,d def count_test_log(count_these): """ The core part of the loop setting. Lets an Incrementor object count co-occurrences (and maintain a Fruitfly object). Saves the new count to a file and applies the FFA to it. Evaluates the resulting hashes and logs them along with the FFA. If specified, trains a Word2Vec model on the accumulated text data. :param count_these: [str] -- tokens to be taken into the co-occurrence count """ # only counts co-occurrences of words within breeder.freq (which can be limited by matrix_maxdims) t_count = breeder.count_cooccurrences(words=count_these, window=window, timed=True) # delete very infrequent words from the count matrix nr_of_del_dims, t_cooc_del = breeder.reduce_count_size(verbose=verbose, timed=True) breeder.log_matrix() fly_these, unhashed_space, words_to_i = prepare_flight() # space_dic and space_ind are the words_to_i and i_to_words of the cropped vectors (done in Fruitfly.fit_space()) hashed_space, space_dic, space_ind, t_flight = breeder.fruitfly.fly(fly_these, words_to_i, timed=True) eval_and_log_FFA(count_these, hashed_space, space_ind, t_count, t_cooc_del, t_flight, unhashed_space) if w2v_exe_file is not None: w2v_min_count, w2v_space_file, w2v_vocab_file = prepare_w2v(count_these) t_train = execute_w2v(w2v_min_count, w2v_space_file, w2v_vocab_file) eval_and_log_w2v(t_train, w2v_space_file) #========== FFA application functions def prepare_flight(): """ read in the count vectors etc. and choose which ones to fly based on a list of required words. :return fly_these: {str:[float]} -- possibly a subset of unhashed_space :return unhashed_space: {str:[float]} -- words and their corresponding co-occurrence counts :return_words_to_i: {str:int} -- mapping of context words to their position in the count """ if verbose: print("Preparing hashing ...") unhashed_space = utils.readDM(breeder.outspace) i_to_words, words_to_i = utils.readCols(breeder.outcols) # only select words that will be needed for evaluation: if overlap_file is None: # in this case, fly() is applied to the whole of unhashed_space fly_these = unhashed_space else: words_for_flight = breeder.read_checklist(overlap_file) fly_these = {w: unhashed_space[w] for w in words_for_flight if w in unhashed_space} return fly_these, unhashed_space, words_to_i def eval_and_log_FFA(count_these, hashed_space, space_ind, t_count, t_cooc_del, t_flight, unhashed_space): """ Evaluates hashes that were produced by a Fruitfly object. The evaluation metric is the Spearman correlation. Evaluation is designed to use the MEN dataset described in Bruni et al. (2014). Logs the results along with times taken for counting and "flying", and other stats. :param count_these: [str] -- tokens to be taken into the co-occurrence count :param hashed_space: {str:[int]} -- words and their associated hash signatures :param space_ind: {int:str} -- mapping of index:word for the input to the FFA :param t_count: float -- time taken to count co-occurrences :param t_cooc_del: float -- time taken to delete infrequent words from the count :param t_flight: float -- time taken to apply the FFA :param unhashed_space: {str:[float]} -- words and their corresponding co-occurrence counts """ global performance_summary # Evaluate the hashed space if verbose: print("Evaluating against",testset_file,"...") spb, tsb = MEN.compute_men_spearman(unhashed_space, testset_file) spa, tsa = MEN.compute_men_spearman(hashed_space, testset_file) sp_diff = spa - spb if verbose: print("Spearman correlations:") print("\tbefore hashing:", round(spb, 4)) print("\tafter hashing: ", round(spa, 4)) print("\tdifference: ", round(sp_diff, 4)) connectednesses = [len(cons) for cons in breeder.fruitfly.pn_to_kc.values()] avg_PN_con = round(sum(connectednesses) / breeder.fruitfly.pn_size, 6) var_PN_con = round(float(np.var(connectednesses, ddof=1)), 6) std_PN_con = round(float(np.std(connectednesses, ddof=1)), 6) t_thisrun = time.time() - t0_thisrun # Log the hashed space utils.writeDH(hashed_space, space_file) # space_file is updated above # Log words of the most important PNs for each word if verbose: print("Logging most important words to", vip_words_file, "...") with open(vip_words_file, "w") as f: for w in tqdm(hashed_space): vip_words = breeder.fruitfly.important_words_for(hashed_space[w], space_ind, n=vip_words_n) vip_words_string = ", ".join(vip_words) f.write("{0} --> {1}\n".format(w, vip_words_string)) # logs parameters and connections to a new file (breeder.flyfile is updated at the very beginning of the run) breeder.log_fly() # log the results with open(results_file, "w") as f: result_string = "RESULTS FOR RUN " + str(run) + ":\n" + \ "\nsp_corr_diff: " + str(sp_diff) + \ "\nsp_corr_after: " + str(spa) + \ "\nsp_corr_before: " + str(spb) + \ "\nitems_tested_after: " + str(tsa) + \ "\nitems_tested_before:" + str(tsb) + "\n" # fly config fc = breeder.fruitfly.get_specs() t = [fc["pn_size"], fc["kc_size"], fc["proj_size"], fc["hash_percent"], fc["flattening"], fc["max_pn_size"]] fruitfly_string = "\nFFA_CONFIG: (" + ", ".join([str(i) for i in t]) + ")" + \ "\navg_PN_connections: " + str(avg_PN_con) + \ "\nvar_PN_connections: " + str(var_PN_con) + \ "\nstd_PN_connections: " + str(std_PN_con) + "\n" time_string = "\nTIME TAKEN: " + \ "\ncounting: " + str(t_count) + \ "\nreducing: " + str(t_cooc_del) + \ "\nflying: " + str(t_flight) + \ "\ntotal: " + str(t_thisrun) + "\n" file_string = "\nRELATED FILES:" \ "\nfruitfly: " + breeder.flyfile + \ "\nhashed_space: " + space_file + \ "\nimportant_words: " + vip_words_file + "\n" f.write(result_string + fruitfly_string + time_string + file_string) # keep internal log performance_summary[run] = [len(count_these), fc["pn_size"], tsb, spb, spa, sp_diff, t_thisrun] #========== Word2Vec application functions def prepare_w2v(count_these): """ Prepares the input file, the minimum count, and the output file names for the execution of Word2Vec code. :param count_these: [str] -- list of tokens to be added to a .txt file. :return w2v_min_count: int -- minimum occurrences of a word in the text data to be taken into account by w2v :return w2v_space_file: str -- file path of the w2v model to be trained :return w2v_vocab_file: str -- file path to the vocabulary of the w2v embeddings """ if verbose: print("\nPreparing to run Word2Vec ...\n") # add the current text slice to a file that can be used by w2v with open(w2v_corpus_file, "a") as f: f.write(" ".join(count_these) + " ") # choose the minimum word count for the w2v run: it's connected to the lowest count in the FFA's PN layer occs = sorted([sum(vec) for vec in breeder.cooc])[:breeder.fruitfly.max_pn_size] # selects the smallest number w2v_min_count = math.floor(occs[0] / (window * 2)) w2v_space_file = w2v_space_dir + "space.txt" w2v_vocab_file = w2v_space_dir + "space.vocab" return w2v_min_count, w2v_space_file, w2v_vocab_file def execute_w2v(w2v_min_count, w2v_space_file, w2v_vocab_file): """ Runs Word2Vec code with a terminal command. :param w2v_min_count: int -- minimum occurrences of a word in the text data to be taken into account by w2v :param w2v_space_file: str -- file path of the w2v model to be trained :param w2v_vocab_file: str -- file path to the vocabulary of the w2v embeddings :return: float -- time taken to execute the Word2Vec code """ if verbose: print("training Word2Vec with minimum count", w2v_min_count, "...") # run the w2v code t0 = time.time() try: os.system(w2v_exe_file + " -train " + w2v_corpus_file + " -output " + w2v_space_file + " -size 300 " + " -window " + str(window) + " -sample 1e-3 " + " -negative 10 " + " -iter 1 " + " -min-count " + str(w2v_min_count) + " -save-vocab " + w2v_vocab_file) except Exception as e: with open(errorlog, "a") as f: f.write(str(e)[:500]+"\n") print("An error occured while running Word2Vec. Check", errorlog, "for further information.") print("Continuing without running Word2Vec ...") return time.time() - t0 def eval_and_log_w2v(t_train, w2v_space_file): """ Evaluates the trained Word2Vec model. The evaluation metric is the Spearman correlation. Evaluation is designed to use the MEN dataset described in Bruni et al. (2014). :param t_train: float -- time taken to train the Word2Vec model :param w2v_space_file: str -- file path of the w2v model that was trained """ global performance_summary if verbose: print("evaluating and logging the Word2Vec model ...") # evaluate the w2v model try: w2v_space = utils.readDM(w2v_space_file) spcorr, pairs = MEN.compute_men_spearman(w2v_space, testset_file) with open(w2v_results_file, "a+") as f: f.write("RUN " + str(run) + ":" + \ "\tSP_CORR: " + str(spcorr) + \ "\tTEST_PAIRS: " + str(pairs) + \ "\tTRAIN_TIME: " + str(t_train) + "\n") # keep internal log performance_summary[run].extend([spcorr, pairs, t_train]) except Exception as e: with open(errorlog, "a") as f: f.write(str(e)[:500]+"\n") print("An error occured while evaluating Word2Vec. Check", errorlog, "for further information.") #========== def log_final_summary(run_to_stats): """ Creates a file that contains the most important statistics of every run. This is useful for an overview of a setup with many iterations (=runs) :param run_to_stats: {int:[float]} -- sore statistics collected throughout the runs """ if verbose: print("\n\nFinished all runs.") column_labels = ["run", "new_data_in_words", "PN_size", "testset", "sp.corr_before", "sp.corr_after", "sp_diff", "time-taken", "w2v_score", "w2v_testset"] # +1 because the first row is the run (which is not contained in the values of the summary dict) row_length = len(run_to_stats[list(run_to_stats.keys())[0]])+1 with open(summary_file, "w") as f: # summary header f.write("\t".join(column_labels[:row_length]) + "\n\n") # summary body for k, stat_tuple in run_to_stats.items(): f.write(str(k) + "\t" + "\t".join([str(v) for v in stat_tuple]) + "\n") #========== END OF FUNCTIONS if __name__ == '__main__': """ This is the full pipeline of the incremental Fruitfly. It reads text resources as needed, counts co-occurrences and grows a Fruitfly alongside, then applies the FFA to the counts, optionally runs Word2Vec on the same corpus, evaluates the results, and logs them. """ errorlog = "spacebreeder_errorlog.txt" # parameter input via terminal param_input_files() param_input_FFA() param_input_misc() print("=== Let's go! ===") runtime_zero = time.time() # set up resource paths, initial Fruitfly, and Incrementor corpus_files, breeder = setup_loop_environment() # for a final summary performance_summary = {} # wc = word count; used for slicing breeder.words t0_thisrun, wc, run = 0, 0, 0 for (file_n, file) in enumerate(corpus_files): # read in a new file (but no counting yet) breeder.extend_corpus(file) # Count and test in word intervals if test_interval is not None: # Last run with the remaining words of breeder.words if file_n+1 == len(corpus_files) and len(breeder.words) < wc+test_interval: # ends before logging t0_thisrun = time.time() run += 1 if verbose: print("\n\nStarting the last run ...") breeder.flyfile, space_file, results_file, vip_words_file = new_paths(run) # take the whole rest of breeder.words() count_these = breeder.words[wc:len(breeder.words)] if verbose: print("Size of the final corpus slice:", len(count_these)) # this is the actual loop content count_test_log(count_these) if verbose: print("End of the last run.\n\n") # Loop as long as there are enough words for a whole slice while len(breeder.words) >= wc+test_interval: # ends before logging t0_thisrun = time.time() run = int(wc / test_interval) + 1 if verbose: print("\n\nStarting run",run,"...") breeder.flyfile, space_file, results_file, vip_words_file = new_paths(run) count_these = breeder.words[wc: wc + test_interval] if verbose: print("Size of corpus slice:", len(count_these)) # this is the actual loop content count_test_log(count_these) wc += test_interval if verbose: print("End of run "+str(run)+".\n\n") # Count and test once per file else: # ends before logging t0_thisrun = time.time() run += 1 if verbose: print("\n\nStarting run", run, "with file", file, "...") breeder.flyfile, space_file, results_file, vip_words_file = new_paths(run) # count the whole newly read-in document count_these = breeder.words[wc:len(breeder.words)] if verbose: print("Size of text resource in this run:", len(count_these)) # this is the actual loop content count_test_log(count_these) wc = len(breeder.words) if verbose: print("End of run " + str(run) + ".\n\n") log_final_summary(performance_summary) print("Total time taken:",round((time.time()-runtime_zero)/60, 2),"minutes.\ndone.")
49.71024
135
0.640049
c2312032ea72f7ea985def5453b704cecf61f26b
4,727
lua
Lua
Game/Resource/Script/PlayScene/PlayIO_Set.lua
CBE7F1F65/fb43b70cb3d36ad8b8ee3a9aed9c6493
da25260dc8128ed66b48d391c738eb15134d7d4f
[ "Zlib", "MIT-0", "MIT" ]
null
null
null
Game/Resource/Script/PlayScene/PlayIO_Set.lua
CBE7F1F65/fb43b70cb3d36ad8b8ee3a9aed9c6493
da25260dc8128ed66b48d391c738eb15134d7d4f
[ "Zlib", "MIT-0", "MIT" ]
null
null
null
Game/Resource/Script/PlayScene/PlayIO_Set.lua
CBE7F1F65/fb43b70cb3d36ad8b8ee3a9aed9c6493
da25260dc8128ed66b48d391c738eb15134d7d4f
[ "Zlib", "MIT-0", "MIT" ]
null
null
null
function PS_SetMenuEnable(toplayer, toptag, bEnable) local layertag = toptag + CCPSTL_Menu; local grouptag = layertag + CCPSTM_Menu_Main; local menunode = game.GetNode({toplayer, grouptag}); game.SetMenuEnabled(menunode, bEnable); end function PS_SetHPAPSP(toplayer, toptag) local hp, ap, sp = game.GetHPAPSP(); local layertag = toptag + CCPSTL_HPAPSP; local grouptag = layertag + CCPSTM_HPAPSP_HPAP; local hpslowbar = game.GetNode({toplayer, grouptag+1}); local hpbar = game.GetNode({toplayer, grouptag+2}); local apslowbar = game.GetNode({toplayer, grouptag+3}); local apbar = game.GetNode({toplayer, grouptag+4}); if LGlobal_PlayData.nowhp ~= hp then local oldhp = LGlobal_PlayData.nowhp; LGlobal_PlayData.nowhp = hp; if hp < 0 then hp = 0; end local hpscale = hp/10000.0; local hpscaleaction = game.ActionScale(CCAF_To, hpscale, 1, LConst_HPAPChangeTime, true); if oldhp > hp then game.RunAction(hpslowbar, hpscaleaction); game.StopAction(hpbar); game.SetScale(hpbar, hpscale, 1); else game.RunAction(hpbar, hpscaleaction); game.StopAction(hpslowbar); game.SetScale(hpslowbar, hpscale, 1); end end if LGlobal_PlayData.nowap ~= ap then local oldap = LGlobal_PlayData.nowap; LGlobal_PlayData.nowap = ap; if ap < 0 then ap = 0; end local apscale = ap/10000.0; local apscaleaction = game.ActionScale(CCAF_To, apscale, 1, LConst_HPAPChangeTime, true); if oldap > ap then game.RunAction(apslowbar, apscaleaction); game.StopAction(apbar); game.SetScale(apbar, apscale, 1); else game.RunAction(apbar, apscaleaction); game.StopAction(apslowbar); game.SetScale(apslowbar, apscale, 1); end end local grouptag = layertag + CCPSTM_HPAPSP_SP; if LGlobal_PlayData.nowsp ~= sp then local nowsp = LGlobal_PlayData.nowsp; LGlobal_PlayData.nowsp = sp; if nowsp > sp then for i=sp+1, nowsp do local spitem = game.GetNode({toplayer, grouptag+i}); local spfadeaction = game.ActionFade(CCAF_To, 0, LConst_SPChangeTime); game.RunAction(spitem, spfadeaction); end else for i=nowsp+1, sp do local spitem = game.GetNode({toplayer, grouptag+i}); local spfadeaction = game.ActionFade(CCAF_To, 0xFF, LConst_SPChangeTime); game.RunAction(spitem, spfadeaction); end end end end function PS_SetTouchLayerRect(toplayer, toptag) local layertag = toptag + CCPSTL_Touch; local grouptag = layertag + CCPSTM_Touch_Layer; local touchlayer = game.GetNode({toplayer, grouptag}); local xcen, ycen, width, height; if LGlobal_PlayData.bZoomed then xcen = 480; ycen = 320; width = 960; height = 640; else xcen = 480; ycen = 336; width = 832; height = 480; end local x = xcen-width/2; local y = ycen-height/2; game.SetTouchLayerRect(touchlayer, {x, y, width, height}); return x, y, width, height; end function PS_UpdateScoreDisplay(toplayer, toptag) local scorerate, score, hiscore, rank = game.GetMissionRateScore(); local layertag = toptag + CCPSTL_TopMessage; local grouptag = layertag + CCPSTM_TopMessage_Score; local scorestr = LGlobal_TranslateGameStr_Score()..": "..score; local scorestr = string.format("%s (%.1f)", scorestr, scorerate); if score > hiscore then hiscore = score; end local hiscorestr = LGlobal_TranslateGameStr_HiScore()..": "..hiscore; local hiscoreatlasnode = game.GetNode({toplayer, grouptag+1}); game.SetAtlasTextString(hiscoreatlasnode, hiscorestr); local scoreatlasnode = game.GetNode({toplayer, grouptag+2}); game.SetAtlasTextString(scoreatlasnode, scorestr); end function PS_SetGoldenEggDisplay(toplayer, toptag, index) local layertag = toptag + CCPSTL_TopMessage; local grouptag = layertag + CCPSTM_TopMessage_RankEgg; local goldeneggnode = game.GetNode({toplayer, grouptag+index}); local fadeaction = game.ActionFade(CCAF_To, 0xff, LConst_ItemVanishTime); local tintaction = game.ActionTint(CCAF_To, 0xffffff, LConst_ItemVanishTime); local nodeaction = game.ActionSpawn({fadeaction, tintaction}); game.RunAction(goldeneggnode, nodeaction); end function PS_UpdateEggDisplay(toplayer, toptag) local layertag = toptag + CCPSTL_TopMessage; local grouptag = layertag + CCPSTM_TopMessage_RankEgg; local atlasgnode = game.GetNode({toplayer, grouptag+MISSION_GoldenEggMax+1}); local str = string.format("%c*%d", LConst_AtlasIndex_Egg, LGlobal_PlayData.eggcount); game.SetAtlasTextString(atlasgnode, str); end function PS_SetScore(toplayer, toptag, nowscore) game.SetMissionRateScore(-1, nowscore); PS_UpdateScoreDisplay(toplayer, toptag); end
30.895425
92
0.716734
74d18bef676a74cfee56024ffd87495ad8b732d9
940
css
CSS
src/styles/globals/typography.css
yashsehgal-tutorial-projects/react-components-basics
f3533dcd84f43d131f782d269281d2d9572862fb
[ "MIT" ]
null
null
null
src/styles/globals/typography.css
yashsehgal-tutorial-projects/react-components-basics
f3533dcd84f43d131f782d269281d2d9572862fb
[ "MIT" ]
null
null
null
src/styles/globals/typography.css
yashsehgal-tutorial-projects/react-components-basics
f3533dcd84f43d131f782d269281d2d9572862fb
[ "MIT" ]
null
null
null
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap"); :root { --font-inter: 'Inter', sans-serif; } h1, h2, h3, h4, h5, h6 { color: inherit; font-family: inherit; text-decoration: none; } p, b, i, u, font, text, strong, sup, sub, a, a:active, a:visited, span { color: inherit; text-decoration: none; font-family: inherit; } h1, h2 { font-weight: 800; } h3, h4 { font-weight: 700; } h5, h6 { font-weight: 600; } .gradient-text { background-color: #000; background: linear-gradient(94.51deg, rgba(20, 0, 255, 0.77) -6.05%, rgba(255, 2, 230, 0.67) 109.2%); background-size: 100%; background-repeat: repeat; -webkit-background-clip: text; -webkit-text-fill-color: transparent; -moz-background-clip: text; -moz-text-fill-color: transparent; font-family: inherit; } .page-title { margin: 1em; } /*# sourceMappingURL=typography.css.map */
20.888889
116
0.659574
3f717ee72f050db4990318cfe8cbf34812a7cda2
2,194
rb
Ruby
lib/httpclient/lru_cache.rb
glebtv/httpclient
f044de6918c007fbbac3aaa78cb233df261d3c95
[ "Ruby" ]
null
null
null
lib/httpclient/lru_cache.rb
glebtv/httpclient
f044de6918c007fbbac3aaa78cb233df261d3c95
[ "Ruby" ]
null
null
null
lib/httpclient/lru_cache.rb
glebtv/httpclient
f044de6918c007fbbac3aaa78cb233df261d3c95
[ "Ruby" ]
null
null
null
# for DNS cache # We do it manually because Ruby won't do it for us # Taken from: https://github.com/kindkid/lrucache/blob/master/lib/lrucache.rb # (MIT Licensed). Thanks! require "lru_redux" require 'thread' class HTTPClient class LRUCache attr_reader :max_size, :ttl, :soft_ttl, :retry_delay def initialize(opts={}) @mutex = Mutex.new @max_size = Integer(opts[:max_size] || 100) @ttl = Float(opts[:ttl] || 0) @soft_ttl = Float(opts[:soft_ttl] || 0) @retry_delay = Float(opts[:retry_delay] || 0) raise "max_size must not be negative" if @max_size < 0 raise "ttl must not be negative" if @ttl < 0 raise "soft_ttl must not be negative" if @soft_ttl < 0 raise "retry_delay must not be negative" if @retry_delay < 0 # we don't use thread safe variant, as we're doing thread safety ourselves @data = LruRedux::Cache.new(@max_size) end def fetch(key) # for now, this means that DNS resolving is single-threaded @mutex.synchronize do datum = @data[key] if datum.nil? store(key, value = yield) elsif datum.expired? @data.delete(key) store(key, value = yield) elsif datum.soft_expired? begin store(key, value = yield) rescue RuntimeError => e datum.soft_expiration = (Time.now + retry_delay) if retry_delay > 0 datum.value end else datum.value end end end private def store(key, value) expiration = Time.now + @ttl soft_expiration = Time.now + @soft_ttl @data[key] = Datum.new(value, expiration, soft_expiration) value end class Datum attr_reader :value, :expiration, :soft_expiration attr_writer :soft_expiration def initialize(value, expiration, soft_expiration) @value = value @expiration = expiration @soft_expiration = soft_expiration end def expired? !@expiration.nil? && @expiration <= Time.now end def soft_expired? !@soft_expiration.nil? && @soft_expiration <= Time.now end end end end
27.08642
80
0.612124
9b092f21c1ce6da346d1215f859f02de09524560
634
swift
Swift
Sources/SwiftColorGenLibrary/Asset.swift
ernestsheridan/SwiftColorGenLibrary
30a7f2cbb31ac73c6df7cc04b126cbe6fb076f5b
[ "MIT" ]
1
2017-12-10T00:07:11.000Z
2017-12-10T00:07:11.000Z
Sources/SwiftColorGenLibrary/Asset.swift
ernestsheridan/SwiftColorGenLibrary
30a7f2cbb31ac73c6df7cc04b126cbe6fb076f5b
[ "MIT" ]
3
2017-12-10T00:04:20.000Z
2017-12-10T00:22:28.000Z
Sources/SwiftColorGenLibrary/Asset.swift
ernestsheridan/SwiftColorGenLibrary
30a7f2cbb31ac73c6df7cc04b126cbe6fb076f5b
[ "MIT" ]
1
2019-01-18T20:54:13.000Z
2019-01-18T20:54:13.000Z
// // Asset.swift // SwiftColorGen // // Created by Fernando del Rio (fernandomdr@gmail.com) on 24/11/17. // import Foundation public enum AssetType { case original // Generated from storyboard case customRenamed // User renamed a color in the Assets folder case customAdded // User added a color in the Assets folder case customUnmodified // Asset didn't changed since last run } // Data structure for the Asset in the Assets folder open class Asset { open var originalName: String? open var currentName: String? open var path: String? open var type: AssetType? open var color: ColorData? }
25.36
68
0.712934
c2e147b07d84c18d6f5579d002708d755b8a6ad5
700
lua
Lua
test/assets/view/user/top100.lua
skynetlua/skynetlua
c8e25b83e497f6748b1edaeecfaf551de0ad1220
[ "Apache-2.0" ]
5
2019-08-17T13:32:27.000Z
2021-09-08T01:40:48.000Z
test/assets/view/user/top100.lua
skynetlua/skynetlua
c8e25b83e497f6748b1edaeecfaf551de0ad1220
[ "Apache-2.0" ]
null
null
null
test/assets/view/user/top100.lua
skynetlua/skynetlua
c8e25b83e497f6748b1edaeecfaf551de0ad1220
[ "Apache-2.0" ]
3
2019-10-10T02:45:47.000Z
2020-04-08T05:24:34.000Z
<%- partial('../sidebar') %> <div id='content'> <div class='panel'> <div class='header'> <ul class='breadcrumb'> <li><a href='/'>主页</a><span class='divider'>/</span></li> <li class='active'>Top100 积分榜</li> </ul> </div> <div class='inner'> <% if type(users) == 'table' and #users > 0 then %> <table class='table table-condensed table-striped'> <thead> <th>#</th><th>用户名</th><th>积分</th><th>主题数</th><th>评论数</th> </thead> <tbody> <%- partial('./top100_user',{collection = users, as = 'user'}) %> </tbody> </table> <% else %> <p>还没有用户</p> <% end %> </div> </div> </div>
25.925926
73
0.474286
f9cdae287eeebf6c9ed916c65c7f3035829b7bfb
881
sh
Shell
src/sample/run.sh
SecuritasMachina/docker-headless-securitaswall
94fae3f8099a75229acaff3112a69c3c096f7567
[ "Apache-2.0" ]
null
null
null
src/sample/run.sh
SecuritasMachina/docker-headless-securitaswall
94fae3f8099a75229acaff3112a69c3c096f7567
[ "Apache-2.0" ]
null
null
null
src/sample/run.sh
SecuritasMachina/docker-headless-securitaswall
94fae3f8099a75229acaff3112a69c3c096f7567
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env bash host_ip_cmd=($(echo $(hostname -I) | tr ' ' '\n')) proxy_ip="${host_ip_cmd[0]}" proxy_port="3128" # Replace Proxy with company proxy: proxy="http://$proxy_ip:$proxy_port" echo "Using proxy: $proxy" volume_path=/home/shared/DockerVolumes/developer-desktop echo "Checking for $volume_path" if [ ! -d $volume_path ]; then echo "!! $volume_path not found !! - aborting run" exit 1 fi echo "Clearing firefox cache, cookies, files etc in :" for f in `find $volume_path/.cache -type d -name "entries"`; do echo "$f"; done for f in `find $volume_path/.cache -type d -name "entries"`; do rm -f "$f/*"; done docker run --cap-add=NET_ADMIN -it -e VNC_RESOLUTION=1800x900 \ -e HTTP_PROXY="$proxy" -e HTTPS_PROXY="$proxy" -e http_proxy="$proxy" \ -e https_proxy="$proxy" -v $volume_path:/home/hostVolume \ ackdev/secure_proxy_securitas-wall:2019-05-01_10.26.50
38.304348
82
0.700341
bb658556a4f3e384c59aa1e8f2ca3a2d68a1471e
679
cs
C#
src/Services/Wms_inventoryBoxTaskService.cs
lindenrty2/KopSoftWms
e41402af81bcba9cac3e632a1782a33b274ad0c5
[ "MIT" ]
1
2019-05-17T09:22:07.000Z
2019-05-17T09:22:07.000Z
src/Services/Wms_inventoryBoxTaskService.cs
lindenrty2/KopSoftWms
e41402af81bcba9cac3e632a1782a33b274ad0c5
[ "MIT" ]
null
null
null
src/Services/Wms_inventoryBoxTaskService.cs
lindenrty2/KopSoftWms
e41402af81bcba9cac3e632a1782a33b274ad0c5
[ "MIT" ]
null
null
null
using IRepository; using IServices; using Repository; using SqlSugar; using System; using System.Collections.Generic; using System.Text; using YL.Core.Entity; namespace Services { public class Wms_inventoryBoxTaskServices : BaseServices<Wms_inventoryboxTask>, IWms_inventoryBoxTaskServices { private readonly SqlSugarClient _client; private readonly IWms_inventoryboxtaskRepository _repository; public Wms_inventoryBoxTaskServices( SqlSugarClient client, IWms_inventoryboxtaskRepository repository) : base(repository) { _client = client; _repository = repository; } } }
25.148148
113
0.71134
0e78ad1f512c2018a54c689c14933421724bc1dc
2,089
dart
Dart
lib/grid_mode_files/bloc/grid_mode_files_state.dart
air-controller/air-controller-desktop
d07ab4906bc7fbdeebb8880a83cba732498e5b6d
[ "MIT" ]
18
2022-01-22T13:26:33.000Z
2022-03-31T23:25:35.000Z
lib/grid_mode_files/bloc/grid_mode_files_state.dart
air-controller/air-controller-desktop
d07ab4906bc7fbdeebb8880a83cba732498e5b6d
[ "MIT" ]
1
2022-02-14T14:31:45.000Z
2022-03-25T14:15:30.000Z
lib/grid_mode_files/bloc/grid_mode_files_state.dart
air-controller/air-controller-desktop
d07ab4906bc7fbdeebb8880a83cba732498e5b6d
[ "MIT" ]
1
2022-03-31T13:11:47.000Z
2022-03-31T13:11:47.000Z
import 'dart:ui'; import 'package:equatable/equatable.dart'; import '../../model/file_node.dart'; class GridModeFilesMenuStatus extends Equatable { final bool isOpened; final Offset? position; final FileNode? current; const GridModeFilesMenuStatus( {this.isOpened = false, this.position = null, this.current = null}); @override List<Object?> get props => [isOpened, position, current]; } enum GridModeFilesCopyStatus { initial, start, copying, success, failure } class GridModeFilesCopyStatusUnit extends Equatable { final GridModeFilesCopyStatus status; final int current; final int total; final String fileName; final String? error; const GridModeFilesCopyStatusUnit({ this.status = GridModeFilesCopyStatus.initial, this.current = 0, this.total = 0, this.fileName = '', this.error }); @override List<Object?> get props => [status, current, total, fileName, error]; } class GridModeFilesState extends Equatable { final GridModeFilesMenuStatus menuStatus; final FileNode? currentRenamingFile; final bool isRenamingMode; final String? newFileName; final GridModeFilesCopyStatusUnit copyStatus; const GridModeFilesState({ this.menuStatus = const GridModeFilesMenuStatus(), this.currentRenamingFile = null, this.isRenamingMode = false, this.newFileName = null, this.copyStatus = const GridModeFilesCopyStatusUnit() }); @override List<Object?> get props => [menuStatus, currentRenamingFile, isRenamingMode, newFileName, copyStatus]; GridModeFilesState copyWith({ GridModeFilesMenuStatus? openMenuStatus, FileNode? currentRenamingFile, bool? isRenamingMode, String? newFileName, GridModeFilesCopyStatusUnit? copyStatus }) { return GridModeFilesState( menuStatus: openMenuStatus ?? this.menuStatus, currentRenamingFile: currentRenamingFile ?? this.currentRenamingFile, isRenamingMode: isRenamingMode ?? this.isRenamingMode, newFileName: newFileName ?? this.newFileName, copyStatus: copyStatus ?? this.copyStatus ); } }
28.22973
78
0.737674
3f80f141c341aeb439edeefa1c8c606e8a3e980b
80
rb
Ruby
vendor/ruby/2.3.0/gems/aws-sdk-core-2.10.125/lib/aws-sdk-core/empty_structure.rb
epfl-lasa/TutorialICRA2018
a7e03f6ee0c5ffc0cbb9d01ece40c8b23780f30f
[ "Unlicense" ]
4
2017-03-07T07:55:14.000Z
2018-08-07T04:52:39.000Z
vendor/ruby/2.3.0/gems/aws-sdk-core-2.10.125/lib/aws-sdk-core/empty_structure.rb
epfl-lasa/TutorialICRA2018
a7e03f6ee0c5ffc0cbb9d01ece40c8b23780f30f
[ "Unlicense" ]
8
2020-01-15T23:28:32.000Z
2020-01-15T23:28:47.000Z
vendor/ruby/2.3.0/gems/aws-sdk-core-2.10.125/lib/aws-sdk-core/empty_structure.rb
epfl-lasa/TutorialICRA2018
a7e03f6ee0c5ffc0cbb9d01ece40c8b23780f30f
[ "Unlicense" ]
2
2020-07-18T12:09:36.000Z
2020-11-04T03:22:38.000Z
module Aws EmptyStructure = Class.new(Structure.new('AwsEmptyStructure')) end
20
64
0.7875
99d84fac184d08eee9fac645de7c69bd3994000b
178
sql
SQL
src/test/resources/boundary3.test_637.sql
jdkoren/sqlite-parser
9adf75ff5eca36f6e541594d2e062349f9ced654
[ "MIT" ]
131
2015-03-31T18:59:14.000Z
2022-03-09T09:51:06.000Z
src/test/resources/boundary3.test_637.sql
jdkoren/sqlite-parser
9adf75ff5eca36f6e541594d2e062349f9ced654
[ "MIT" ]
20
2015-03-31T21:35:38.000Z
2018-07-02T16:15:51.000Z
src/test/resources/boundary3.test_637.sql
jdkoren/sqlite-parser
9adf75ff5eca36f6e541594d2e062349f9ced654
[ "MIT" ]
43
2015-04-28T02:01:55.000Z
2021-06-06T09:33:38.000Z
-- boundary3.test -- -- db eval { -- SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=35 -- } SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=35
29.666667
72
0.646067
201e3389d984fcfea81f7feb61ea13a7b38d913f
6,510
dart
Dart
flutter/sample/lib/pages/referral_page.dart
xclud/docker-images-flutter
5505e86dea66711be80d4a248854257ace5fa7aa
[ "MIT" ]
1
2021-12-04T22:04:27.000Z
2021-12-04T22:04:27.000Z
flutter/sample/lib/pages/referral_page.dart
xclud/docker-images-flutter
5505e86dea66711be80d4a248854257ace5fa7aa
[ "MIT" ]
null
null
null
flutter/sample/lib/pages/referral_page.dart
xclud/docker-images-flutter
5505e86dea66711be80d4a248854257ace5fa7aa
[ "MIT" ]
null
null
null
import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:novinpay/colors.dart' as colors; import 'package:novinpay/models/get_invitation_link_response.dart'; import 'package:novinpay/repository/response.dart'; import 'package:novinpay/strings.dart' as strings; import 'package:novinpay/sun.dart'; import 'package:novinpay/toast_utils.dart'; import 'package:novinpay/utils.dart'; import 'package:novinpay/widgets/general/custom_text.dart'; import 'package:novinpay/widgets/general/general.dart'; import 'package:novinpay/widgets/loading.dart'; import 'package:persian/persian.dart'; class ReferralPage extends StatefulWidget { @override _ReferralPageState createState() => _ReferralPageState(); } class _ReferralPageState extends State<ReferralPage> { Response<GetInvitationLinkResponse> _data; String _phoneNumber = ''; @override void initState() { WidgetsBinding.instance.addPostFrameCallback((timeStamp) { _getData(); }); super.initState(); } @override Widget build(BuildContext context) { return HeadedPage( title: Text('دعوت از دوستان'), body: _buildChild(), ); } Widget _buildInvitationData() { return ListView( children: [ SizedBox( height: 24, ), Text( 'کد معرف یا لینک دعوت را برای دوستان خود ارسال فرمایید', textAlign: TextAlign.center, style: colors.bodyStyle(context), ), Container( margin: EdgeInsetsDirectional.fromSTEB(24, 24, 24, 8), padding: EdgeInsetsDirectional.fromSTEB(24, 8, 8, 8), decoration: BoxDecoration( borderRadius: BorderRadius.circular(16), border: Border.all(color: colors.accentColor, width: 2), ), child: Row( children: [ Expanded( child: Text( 'کد معرف :${_phoneNumber}'.withPersianNumbers(), style: colors .boldStyle(context) .copyWith(color: colors.primaryColor), ), ), IconButton( onPressed: () async { Clipboard.setData(ClipboardData(text: _phoneNumber ?? '')); ToastUtils.showCustomToast( context, 'کپی شد', Image.asset('assets/ok.png')); }, icon: Icon(SunIcons.copy)), ], ), ), Container( padding: EdgeInsetsDirectional.fromSTEB(24, 16, 24, 24), margin: EdgeInsetsDirectional.fromSTEB(24, 8, 24, 24), decoration: BoxDecoration( borderRadius: BorderRadius.circular(16), border: Border.all(color: colors.accentColor, width: 2), ), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Text( _data.content.invitationModel.header?.withPersianNumbers() ?? '', style: colors .boldStyle(context) .copyWith(color: colors.primaryColor), ), Space(), Text( _data.content.invitationModel.slogan?.withPersianNumbers() ?? '', style: colors .regularStyle(context) .copyWith(color: colors.primaryColor), ), Space(), Text( 'لینک دانلود نسخه:', style: colors .tabStyle(context) .copyWith(color: colors.primaryColor), ), Space(), Text( _data.content.invitationModel.androidInvitationLink ?.withPersianNumbers() ?? '', textAlign: TextAlign.end, style: colors .bodyStyle(context) .copyWith(color: colors.primaryColor), ), Space(), Space(), Text( _data.content.invitationModel.iosInvitationLink ?.withPersianNumbers() ?? '', textAlign: TextAlign.end, style: colors .bodyStyle(context) .copyWith(color: colors.primaryColor), ), Space(), Text( 'پشتیبانی: $rlm${_data.content.invitationModel.supportTel[0]}' ?.withPersianNumbers() ?? '', style: colors .bodyStyle(context) .copyWith(color: colors.primaryColor), ), Space(2), Align( alignment: Alignment.bottomCenter, child: ConfirmButton( onPressed: () async { Clipboard.setData( ClipboardData(text: _data.content.text ?? '')) .then((value) => ToastUtils.showCustomToast( context, 'کپی شد', Image.asset('assets/ok.png'))); }, child: CustomText( 'کپی متن دعوت از دوستان', textAlign: TextAlign.center, ), ), ) ], ), ), ], ); } void _getData() async { final data = await Loading.run(context, nh.novinPay.application.getInvitationLink()); _phoneNumber = await appState.getPhoneNumber(); setState(() { _data = data; }); } Widget _buildChild() { if (_data == null) { return _buildLoadingMessage(); } if (_data.isError || _data.content == null) { return _buildMessage(strings.connectionError); } if (_data.content.status != true) { return _buildMessage( _data.content.description ?? strings.connectionError); } return _buildInvitationData(); } Widget _buildMessage(String text) => Center( child: Text( text ?? '', textAlign: TextAlign.center, softWrap: true, style: colors .regularStyle(context) .copyWith(color: colors.greyColor.shade900), ), ); Widget _buildLoadingMessage() => _buildMessage(strings.please_wait); }
32.38806
80
0.516436
09b05bfec1aadc482d733d700af18728b72e0977
7,537
swift
Swift
Partner/Partner/Service/Controller/ServiceMainViewController.swift
liuCodeBoy/Partner
a60602c8ed7637ecad1e13d99f9feec13f2b3a39
[ "Apache-2.0" ]
1
2018-04-18T10:00:38.000Z
2018-04-18T10:00:38.000Z
Partner/Partner/Service/Controller/ServiceMainViewController.swift
liuCodeBoy/Partner
a60602c8ed7637ecad1e13d99f9feec13f2b3a39
[ "Apache-2.0" ]
null
null
null
Partner/Partner/Service/Controller/ServiceMainViewController.swift
liuCodeBoy/Partner
a60602c8ed7637ecad1e13d99f9feec13f2b3a39
[ "Apache-2.0" ]
2
2017-12-25T10:52:54.000Z
2018-01-19T07:44:10.000Z
// // ServiceMainViewController.swift // Partner // // Created by Weslie on 31/01/2018. // import UIKit import SCLAlertView class ServiceMainViewController: UIViewController { @IBOutlet weak var serviceTableView: UITableView! var modelArr = [ServiceProvideListModel]() var modelSelectedArr = [SelectedProviderModel]() override func viewWillAppear(_ animated: Bool) { self.tabBarController?.tabBar.isHidden = false } override func viewDidLoad() { super.viewDidLoad() self.navigationController?.navigationBar.isHidden = true getListType() getSelectedProviderList() } @IBAction func getMoreProvider(_ sender: Any) { let destVC = UIStoryboard.init(name: "ServiceProvider", bundle: nil).instantiateViewController(withIdentifier: "searchVCID") as! searchVC self.navigationController?.pushViewController(destVC, animated: true) } @IBAction func getMoreInvestor(_ sender: Any) { let dest = UIStoryboard.init(name: "InvestFinance", bundle: nil).instantiateViewController(withIdentifier: "InvestorListVCID") as! InvestorListVC self.navigationController?.pushViewController(dest, animated: true) } } extension ServiceMainViewController: UITableViewDelegate, UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return modelSelectedArr.count + 3 } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { var cell = UITableViewCell() switch indexPath.row { case 0: let singleCell = tableView.dequeueReusableCell(withIdentifier: "ServiceMainHeaderTableViewCell") as! ServiceMainHeaderTableViewCell if modelArr.count > 0 { singleCell.modelArr = modelArr } singleCell.pushClouse = { (id ,typename) in let showProviderVC = UIStoryboard.init(name: "Service", bundle: nil).instantiateViewController(withIdentifier: "GetProvideVCID") as! GetProvideVC showProviderVC.provideID = id showProviderVC.showTypeName = typename self.navigationController?.pushViewController(showProviderVC, animated: true) } cell = singleCell case 1: let singleCell = tableView.dequeueReusableCell(withIdentifier: "ServiceMainFounderListTableViewCell") as! ServiceMainFounderListTableViewCell singleCell.pushVC = { (id) in let uid = UserDefaults.standard.integer(forKey: "uid") if id == uid { let showProviderVC = UIStoryboard.init(name: "MyHomePage", bundle: nil).instantiateViewController(withIdentifier: "MyHomePageViewControllerID") as! MyHomePageViewController self.navigationController?.pushViewController(showProviderVC, animated: true) }else{ let showProviderVC = UIStoryboard.init(name: "InvestFinance", bundle: nil).instantiateViewController(withIdentifier: "ServiceInvestorProfileViewControllerID") as! ServiceInvestorProfileViewController showProviderVC.id = id self.navigationController?.pushViewController(showProviderVC, animated: true) } // let showProviderVC = UIStoryboard.init(name: "InvestFinance", bundle: nil).instantiateViewController(withIdentifier: "ServiceInvestorProfileViewControllerID") as! ServiceInvestorProfileViewController // showProviderVC.id = id // self.navigationController?.pushViewController(showProviderVC, animated: true) } cell = singleCell case 2: let singleCell = tableView.dequeueReusableCell(withIdentifier: "ServiceMainProviderHeaderTableViewCell") as! ServiceMainProviderHeaderTableViewCell singleCell.showVC = {(num) in let destvC = UIStoryboard.init(name: "ServiceProvider", bundle: nil).instantiateViewController(withIdentifier: "ServiceProviderViewControllerID") self.navigationController?.pushViewController(destvC, animated: true) } cell = singleCell default: if self.modelSelectedArr.count > 0 && indexPath.row > 2{ let singleCell = tableView.dequeueReusableCell(withIdentifier: "ServiceMainProviderListTableViewCell") as! ServiceMainProviderListTableViewCell let model = modelSelectedArr[indexPath.row - 3] singleCell.model = model cell = singleCell } } return cell } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { if self.modelSelectedArr.count > 0 && indexPath.row > 2{ let destvC = UIStoryboard.init(name: "ServiceProvider", bundle: nil).instantiateViewController(withIdentifier: "ServiceDetialViewControllerID") as! ServiceDetialViewController let model = modelSelectedArr[indexPath.row - 3] NetWorkTool.shareInstance.scanProvider(id: (model.providerId as? Int)!, finished: { (result, error) in }) destvC.id = model.providerId as? Int self.navigationController?.pushViewController(destvC, animated: true) } } } extension ServiceMainViewController { func getListType(){ NetWorkTool.shareInstance.getTypeList(typeCate: 2) { [weak self](info, error) in if error == nil { // MARK:- judge the return data from server if info?["code"] as? Int == 200 { if let dictARR = info?["result"] as? [NSDictionary]{ for dict in dictARR{ let model = ServiceProvideListModel.mj_object(withKeyValues: dict) self?.modelArr.append(model!) } self?.serviceTableView.reloadData() } } else { let errorShow = info!["msg"] as! String self?.presentHintMessage(hintMessgae: errorShow, completion: nil) self?.serviceTableView.reloadData() } } } } //获取精选服务商 func getSelectedProviderList(){ NetWorkTool.shareInstance.getSelectedProviderList { (result, error) in weak var weakSelf = self if error != nil { SCLAlertView().showError("request error", subTitle: "\(error as AnyObject)") return } if result!["code"] as! Int == 200 { // TODO:- save data into model if let dictArr = result!["result"] as? [NSDictionary] { for dict in dictArr { let model = SelectedProviderModel.mj_object(withKeyValues: dict) weakSelf?.modelSelectedArr.append(model!) } weakSelf?.serviceTableView.reloadData() } } else { SCLAlertView().showError("post request failed, code: \(String(describing: result!["code"]!))", subTitle: "reason: \(String(describing: result!["msg"]!))") } } } }
46.524691
224
0.612711
0a45a8a7cfaa10f77e137843fa4a39951b9e9e49
215
cs
C#
tests/Simple/CSharp/Incrementing/Test7.cs
GrapeCity/pagefx
0ab027edb818fa0913f203c9771b2aaa88fb166e
[ "MIT" ]
18
2019-08-03T09:55:53.000Z
2021-12-11T20:32:30.000Z
tests/Simple/CSharp/Incrementing/Test7.cs
GrapeCity/pagefx
0ab027edb818fa0913f203c9771b2aaa88fb166e
[ "MIT" ]
1
2021-11-22T21:39:07.000Z
2021-11-23T04:52:41.000Z
tests/Simple/CSharp/Incrementing/Test7.cs
GrapeCity/pagefx
0ab027edb818fa0913f203c9771b2aaa88fb166e
[ "MIT" ]
2
2019-07-31T09:50:21.000Z
2021-11-24T16:30:12.000Z
using System; class Test7 { static void Main() { int i = 0; while (i++ < 5) { Console.WriteLine(i); } Console.WriteLine("<%END%>"); } }
14.333333
38
0.386047
98dcc547789ef4d366605ce6cb13d847c92a8b46
601
sql
SQL
src/Nether.Data.Sql.Schema/GetHighScores.sql
vflorusso/nether
09d54e310f5cd7c48fdfdd830a6fac770edb3da5
[ "MIT" ]
null
null
null
src/Nether.Data.Sql.Schema/GetHighScores.sql
vflorusso/nether
09d54e310f5cd7c48fdfdd830a6fac770edb3da5
[ "MIT" ]
null
null
null
src/Nether.Data.Sql.Schema/GetHighScores.sql
vflorusso/nether
09d54e310f5cd7c48fdfdd830a6fac770edb3da5
[ "MIT" ]
null
null
null
/* Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information. */ CREATE PROCEDURE [dbo].[GetHighScores] @StartRank int = 0, @Count int AS SELECT Score, Gamertag, CustomTag, Ranking FROM (SELECT Score, Gamertag, CustomTag, RANK() OVER(ORDER BY Score DESC) AS Ranking FROM ( SELECT Gamertag, MAX(Score) AS Score, MAX(CustomTag) AS CustomTag FROM Scores GROUP BY GamerTag ) AS T ) AS T2 WHERE Ranking BETWEEN @StartRank AND (@StartRank + @Count) ORDER BY Score DESC RETURN 0
19.387097
101
0.710483
239c23d0513ee6848d1e03de6e856fb50b84d607
1,381
js
JavaScript
src/flux/logic/__tests__/onCatch.test.js
ZhnZhn/ZhnZhn.github.io
5da20b779c05fb87b4d6ee569487fef1163ab4f4
[ "BSD-3-Clause" ]
8
2016-07-25T06:51:32.000Z
2022-03-21T13:42:45.000Z
src/flux/logic/__tests__/onCatch.test.js
ZhnZhn/ZhnZhn.github.io
5da20b779c05fb87b4d6ee569487fef1163ab4f4
[ "BSD-3-Clause" ]
null
null
null
src/flux/logic/__tests__/onCatch.test.js
ZhnZhn/ZhnZhn.github.io
5da20b779c05fb87b4d6ee569487fef1163ab4f4
[ "BSD-3-Clause" ]
1
2020-07-18T12:47:04.000Z
2020-07-18T12:47:04.000Z
import onCatch from '../onCatch' import Msg from '../../../constants/Msg'; const M = Msg.Alert; const _crAlertDescrFrom = ({ caption, descr }) => ({ alertCaption: caption, alertDescr: descr }); describe('onCatch', ()=>{ test('should call onFailed with option with alertDesr', ()=>{ const onFailed = jest.fn() , _callWithAndTestFor = (error, errDescr) => { onCatch({ error, option: {}, onFailed }) expect(onFailed) .toBeCalledWith(_crAlertDescrFrom(errDescr)) }; _callWithAndTestFor((new TypeError('fetch')), M.NETWORK_ERROR) _callWithAndTestFor((new TypeError('429')), M.TOO_MANY_REQUEST) _callWithAndTestFor({ message: M.ERR_10.token }, M.ERR_10) _callWithAndTestFor( { errCaption: 'Some Err', message: 'msg' }, { caption: 'Some Err', descr: 'msg' } ) const ERR_DESCR_MSG = { caption: 'ERROR', descr: 'msg' }; _callWithAndTestFor({ message: 'msg' }, ERR_DESCR_MSG) _callWithAndTestFor({ errCaption: '', message: 'msg' }, ERR_DESCR_MSG) const DF_ERR_DESCR = { caption: 'ERROR', descr: '' }; _callWithAndTestFor({}, DF_ERR_DESCR) _callWithAndTestFor(void 0, DF_ERR_DESCR) _callWithAndTestFor(null, DF_ERR_DESCR) }) test('should does not throw in case onFailed is not function', ()=>{ expect(() => onCatch({ option: {}, error: {}})) .not.toThrow() }) })
30.688889
74
0.641564
f4060d600ce0192b005344f2a56c13cd5e861b03
2,655
cs
C#
sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/RoleInstanceView.Serialization.cs
gjy5885/azure-sdk-for-net
5491b723c94176509a91c340485f10009189ac72
[ "MIT" ]
3,268
2015-01-08T04:21:52.000Z
2022-03-31T11:10:48.000Z
sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/RoleInstanceView.Serialization.cs
gjy5885/azure-sdk-for-net
5491b723c94176509a91c340485f10009189ac72
[ "MIT" ]
18,748
2015-01-06T00:12:22.000Z
2022-03-31T23:55:50.000Z
sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/RoleInstanceView.Serialization.cs
gjy5885/azure-sdk-for-net
5491b723c94176509a91c340485f10009189ac72
[ "MIT" ]
4,179
2015-01-07T20:13:22.000Z
2022-03-31T09:09:02.000Z
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // <auto-generated/> #nullable disable using System.Collections.Generic; using System.Text.Json; using Azure.Core; namespace Azure.ResourceManager.Compute.Models { public partial class RoleInstanceView { internal static RoleInstanceView DeserializeRoleInstanceView(JsonElement element) { Optional<int> platformUpdateDomain = default; Optional<int> platformFaultDomain = default; Optional<string> privateId = default; Optional<IReadOnlyList<ResourceInstanceViewStatus>> statuses = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("platformUpdateDomain")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } platformUpdateDomain = property.Value.GetInt32(); continue; } if (property.NameEquals("platformFaultDomain")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } platformFaultDomain = property.Value.GetInt32(); continue; } if (property.NameEquals("privateId")) { privateId = property.Value.GetString(); continue; } if (property.NameEquals("statuses")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } List<ResourceInstanceViewStatus> array = new List<ResourceInstanceViewStatus>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(ResourceInstanceViewStatus.DeserializeResourceInstanceViewStatus(item)); } statuses = array; continue; } } return new RoleInstanceView(Optional.ToNullable(platformUpdateDomain), Optional.ToNullable(platformFaultDomain), privateId.Value, Optional.ToList(statuses)); } } }
38.478261
169
0.52693
1aabb028d620244869a6b383238014bc17340a28
1,599
py
Python
NN_models/models/alexnet_tanh.py
ThomasMrY/ActivationFunctionDemo
1f75c7964e354e7593e1fe54932877feb2961488
[ "MIT" ]
12
2018-10-29T02:07:43.000Z
2022-03-18T09:56:34.000Z
NN_models/models/alexnet_tanh.py
ThomasMrY/Activation_function_demo
1f75c7964e354e7593e1fe54932877feb2961488
[ "MIT" ]
null
null
null
NN_models/models/alexnet_tanh.py
ThomasMrY/Activation_function_demo
1f75c7964e354e7593e1fe54932877feb2961488
[ "MIT" ]
6
2019-05-31T08:54:39.000Z
2021-08-15T03:09:33.000Z
import torch import torch.nn as nn from torch.nn.modules.module import Module import NN_models.ops as ops class APX_TANH(Module): def __init__(self,file_name,inplace=False): super(APX_TANH, self).__init__() self.inplace = inplace self.file_name = file_name def forward(self, input): return ops.tanh_apx(input, self.file_name) class AlexNet_tanh(nn.Module): def __init__(self,file_name,num_classes=1000): super(AlexNet_tanh, self).__init__() self.features = nn.Sequential( nn.Conv2d(3, 64, kernel_size=11, stride=4, padding=2), APX_TANH(file_name), nn.MaxPool2d(kernel_size=3, stride=2), nn.Conv2d(64, 192, kernel_size=5, padding=2), APX_TANH(file_name), nn.MaxPool2d(kernel_size=3, stride=2), nn.Conv2d(192, 384, kernel_size=3, padding=1), APX_TANH(file_name), nn.Conv2d(384, 256, kernel_size=3, padding=1), APX_TANH(file_name), nn.Conv2d(256, 256, kernel_size=3, padding=1), APX_TANH(file_name), nn.MaxPool2d(kernel_size=3, stride=2), ) self.classifier = nn.Sequential( nn.Dropout(), nn.Linear(256 * 6 * 6, 4096), APX_TANH(file_name), nn.Dropout(), nn.Linear(4096, 4096), APX_TANH(file_name), nn.Linear(4096, num_classes), ) def forward(self, x): x = self.features(x) x = x.view(x.size(0), 256 * 6 * 6) x = self.classifier(x) return x
34.021277
66
0.581614
b32feded72fb245e8cd46db51bca43f62c6ebb63
680
lua
Lua
applications/luci-app-ltqtapi/luasrc/model/cbi/luci_ltqtapi/contact.lua
spiccinini/luci
1893892581707fcd83e684a7a03dd6b5d3c2c3a2
[ "Apache-2.0" ]
4,459
2015-01-03T10:01:37.000Z
2022-03-31T23:35:44.000Z
applications/luci-app-ltqtapi/luasrc/model/cbi/luci_ltqtapi/contact.lua
spiccinini/luci
1893892581707fcd83e684a7a03dd6b5d3c2c3a2
[ "Apache-2.0" ]
3,636
2015-01-03T01:36:37.000Z
2022-03-31T17:07:01.000Z
applications/luci-app-ltqtapi/luasrc/model/cbi/luci_ltqtapi/contact.lua
spiccinini/luci
1893892581707fcd83e684a7a03dd6b5d3c2c3a2
[ "Apache-2.0" ]
2,799
2015-01-01T03:02:58.000Z
2022-03-31T06:33:26.000Z
-- Copyright 2010 John Crispin <blogic@openwrt.org> -- Licensed to the public under the Apache License 2.0. m = Map("telephony", translate("VoIP")) m.on_after_commit = function() luci.sys.call("/etc/init.d/telephony reload") end s = m:section(TypedSection, "contact", translate("Contact"), translate("Here You can specify the SIP contacts that you want to use.")) s.anonymous = true s.addremove = true s.template = "cbi/tsection" s:option(Value, "desc", translate("Name")) s:option(Value, "code", translate("Shortdial")) s:option(Value, "dial", translate("Dial")) t = s:option(ListValue, "type", translate("Type")) t:value("sip", "SIP") t:value("realm", "Landline") return m
32.380952
134
0.707353
4550e07424659f10c763f7b2986b72d7f423753b
706
sql
SQL
scripts/setup/workspaces/instance_settings.sql
MaikMichel/bash4xcl
9c80e217a1760e23abba8eca54dd4018c5733874
[ "MIT" ]
null
null
null
scripts/setup/workspaces/instance_settings.sql
MaikMichel/bash4xcl
9c80e217a1760e23abba8eca54dd4018c5733874
[ "MIT" ]
null
null
null
scripts/setup/workspaces/instance_settings.sql
MaikMichel/bash4xcl
9c80e217a1760e23abba8eca54dd4018c5733874
[ "MIT" ]
null
null
null
set define '^' set concat on set concat . set verify off @../env.sql ------------------------------------------------------------------------------------- PROMPT ============================================================================= PROMPT == Configure instance settings PROMPT ============================================================================= PROMPT -- Wir wechslen unser aktives Schema ALTER SESSION SET CURRENT_SCHEMA = ^apex_user; begin apex_instance_admin.set_parameter('MAX_SESSION_IDLE_SEC', '28800'); apex_instance_admin.set_parameter('MAX_SESSION_LENGTH_SEC', '28800'); apex_instance_admin.set_parameter('SESSION_TIMEOUT_WARNING_SEC', '180'); commit; end; /
28.24
85
0.502833
8e291cc6df76b51a304144cd45de4a9b2c220c62
4,639
rb
Ruby
lib/trueskill/gaussian_distribution.rb
theorygeek/trueskill-ruby
bcd23840eaee9a4c81a304a44294f840856948a6
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
lib/trueskill/gaussian_distribution.rb
theorygeek/trueskill-ruby
bcd23840eaee9a4c81a304a44294f840856948a6
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
lib/trueskill/gaussian_distribution.rb
theorygeek/trueskill-ruby
bcd23840eaee9a4c81a304a44294f840856948a6
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
module TrueSkill class GaussianDistribution attr_accessor :mean, :standard_deviation, :variance, :precision, :precision_mean def initialize(mean, standard_deviation) self.mean = mean self.standard_deviation = standard_deviation self.variance = standard_deviation ** 2 self.precision = 1.0 / variance self.precision_mean = precision * mean end def self.from_precision_mean(precision_mean, precision) precision = precision.to_f precision_mean = precision_mean.to_f variance = 1.0 / precision standard_deviation = Math.sqrt(variance) mean = precision_mean / precision result = new(mean, standard_deviation) result.precision = precision result.precision_mean = precision_mean result.variance = variance result end def inspect "mean=#{mean} stdev=#{standard_deviation} variance=#{variance} precision=#{precision} precision_mean=#{precision_mean}" end alias to_s inspect def normalization_constant 1.0 / (Math.sqrt(2 * Math::PI) * standard_deviation) end def *(other) GaussianDistribution.from_precision_mean( precision_mean + other.precision_mean, precision + other.precision ) end def self.absolute_difference(left, right) [ (left.precision_mean - right.precision_mean).abs, Math.sqrt((left.precision - right.precision).abs) ].max end def -(other) GaussianDistribution.absolute_difference(self, other) end def /(denominator) GaussianDistribution.from_precision_mean(precision_mean - denominator.precision_mean, precision - denominator.precision) end LOG_SQRT_2_PI = Math.log(Math.sqrt(2 * Math::PI)) def self.log_product_normalization(left, right) return 0.to_f if left.precision == 0 || right.precision == 0 variance_sum = left.variance + right.variance mean_difference = left.mean - right.mean -LOG_SQRT_2_PI - (Math.log(variance_sum) / 2.0) - ((mean_difference ** 2) / (2.0 * variance_sum)) end def self.log_ratio_normalization(numerator, denominator) return 0.to_f if numerator.precision == 0 || denominator.precision == 0 variance_difference = denominator.variance - numerator.variance mean_difference = numerator.mean - denominator.mean Math.log(denominator.variance) + LOG_SQRT_2_PI - Math.log(variance_difference) / 2.0 + (mean_difference ** 2) / (2 * variance_difference) end def self.cumulative_to(x, mean = 0, standard_deviation = 1) invsqrt2 = -0.707106781186547524400844362104 result = error_function_cumulative_to(invsqrt2 * x) 0.5 * result end def self.inverse_cumulative_to(x, mean = 0, standard_deviation = 1) mean - Math.sqrt(2) * standard_deviation * inverse_error_function_cumulative_to(2 * x) end def self.at(x, mean = 0, standard_deviation = 1) multiplier = 1.0 / (standard_deviation * Math.sqrt(2 * Math::PI)) exp_part = Math.exp((-1.0 * ((x - mean) ** 2.0)) / (2 * (standard_deviation ** 2))) multiplier * exp_part end def self.inverse_error_function_cumulative_to(p) return -100.0 if p >= 2.0 return 100.0 if p <= 0.0 pp = (p < 1.0) ? p : 2 - p t = Math.sqrt(-2 * Math.log(pp / 2.0)) x = -0.70711 * ((2.30753 + t * 0.27061) / (1.0 + t * (0.99229 + t * 0.04481)) - t) j = 0 while j < 2 err = error_function_cumulative_to(x) - pp x += err / (1.12837916709551257 * Math.exp(-(x * x)) - x * err) j += 1 end return p < 1.0 ? x : -x end def self.error_function_cumulative_to(x) z = x.abs t = 2.0 / (2.0 + z) ty = 4 * t - 2 coefficients = [ -1.3026537197817094, 6.4196979235649026e-1, 1.9476473204185836e-2, -9.561514786808631e-3, -9.46595344482036e-4, 3.66839497852761e-4, 4.2523324806907e-5, -2.0278578112534e-5, -1.624290004647e-6, 1.303655835580e-6, 1.5626441722e-8, -8.5238095915e-8, 6.529054439e-9, 5.059343495e-9, -9.91364156e-10, -2.27365122e-10, 9.6467911e-11, 2.394038e-12, -6.886027e-12, 8.94487e-13, 3.13092e-13, -1.12708e-13, 3.81e-16, 7.106e-15, -1.523e-15, -9.4e-17, 1.21e-16, -2.8e-17 ] ncof = coefficients.size d = 0.0 dd = 0.0 coefficients[1..-1].reverse_each do |val| tmp = d d = ty * d - dd + val dd = tmp end ans = t * Math.exp(-z * z + 0.5 * (coefficients[0] + ty * d) - dd) x >= 0.0 ? ans : (2.0 - ans) end end end
31.993103
143
0.628368
458b4b69d1906cbf0b99d07d40a2ca9421803ccc
181
py
Python
BOJ/13000~13999/13700~13799/13772.py
shinkeonkim/today-ps
f3e5e38c5215f19579bb0422f303a9c18c626afa
[ "Apache-2.0" ]
2
2020-01-29T06:54:41.000Z
2021-11-07T13:23:27.000Z
BOJ/13000~13999/13700~13799/13772.py
shinkeonkim/Today_PS
bb0cda0ee1b9c57e1cfa38355e29d0f1c6167a44
[ "Apache-2.0" ]
null
null
null
BOJ/13000~13999/13700~13799/13772.py
shinkeonkim/Today_PS
bb0cda0ee1b9c57e1cfa38355e29d0f1c6167a44
[ "Apache-2.0" ]
null
null
null
s = "12010000000000111100000000" for _ in range(int(input())): ans = 0 k = input() for i in k: if i != " ": ans += int(s[ord(i) - 65]) print(ans)
22.625
38
0.480663