text stringlengths 2 1.04M | meta dict |
|---|---|
/***********************************************************************************************************************************
BZ2 Common
***********************************************************************************************************************************/
#include "build.auto.h"
#include <bzlib.h>
#include "common/compress/bz2/common.h"
#include "common/debug.h"
#include "common/memContext.h"
/**********************************************************************************************************************************/
int
bz2Error(int error)
{
FUNCTION_TEST_BEGIN();
FUNCTION_TEST_PARAM(INT, error);
FUNCTION_TEST_END();
if (error < 0)
{
const char *errorMsg;
const ErrorType *errorType = &AssertError;
switch (error)
{
case BZ_SEQUENCE_ERROR:
errorMsg = "sequence error";
break;
case BZ_PARAM_ERROR:
errorMsg = "parameter error";
break;
case BZ_MEM_ERROR:
errorMsg = "memory error";
errorType = &MemoryError;
break;
case BZ_DATA_ERROR:
errorMsg = "data error";
errorType = &FormatError;
break;
case BZ_DATA_ERROR_MAGIC:
errorMsg = "data error magic";
errorType = &FormatError;
break;
case BZ_IO_ERROR:
errorMsg = "io error";
break;
case BZ_UNEXPECTED_EOF:
errorMsg = "unexpected eof";
break;
case BZ_OUTBUFF_FULL:
errorMsg = "outbuff full";
break;
case BZ_CONFIG_ERROR:
errorMsg = "config error";
break;
default:
errorMsg = "unknown error";
break;
}
THROWP_FMT(errorType, "bz2 error: [%d] %s", error, errorMsg);
}
FUNCTION_TEST_RETURN(INT, error);
}
| {
"content_hash": "d0bce64969513d72481a9a969cc37284",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 132,
"avg_line_length": 27.56,
"alnum_prop": 0.38122883405902275,
"repo_name": "pgbackrest/pgbackrest",
"id": "547aa3c3d24e730d93cd92852392dbca825f10d3",
"size": "2067",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "src/common/compress/bz2/common.c",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "7935427"
},
{
"name": "Dockerfile",
"bytes": "1467"
},
{
"name": "M4",
"bytes": "8197"
},
{
"name": "Makefile",
"bytes": "9789"
},
{
"name": "Meson",
"bytes": "20192"
},
{
"name": "Perl",
"bytes": "876207"
},
{
"name": "Shell",
"bytes": "15358"
}
],
"symlink_target": ""
} |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| URI ROUTING
| -------------------------------------------------------------------------
| This file lets you re-map URI requests to specific controller functions.
|
| Typically there is a one-to-one relationship between a URL string
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern:
|
| example.com/class/method/id/
|
| In some instances, however, you may want to remap this relationship
| so that a different class/function is called than the one
| corresponding to the URL.
|
| Please see the user guide for complete details:
|
| https://codeigniter.com/user_guide/general/routing.html
|
| -------------------------------------------------------------------------
| RESERVED ROUTES
| -------------------------------------------------------------------------
|
| There are three reserved routes:
|
| $route['default_controller'] = 'welcome';
|
| This route indicates which controller class should be loaded if the
| URI contains no data. In the above example, the "welcome" class
| would be loaded.
|
| $route['404_override'] = 'errors/page_missing';
|
| This route will tell the Router which controller/method to use if those
| provided in the URL cannot be matched to a valid route.
|
| $route['translate_uri_dashes'] = FALSE;
|
| This is not exactly a route, but allows you to automatically route
| controller and method names that contain dashes. '-' isn't a valid
| class or method name character, so it requires translation.
| When you set this option to TRUE, it will replace ALL dashes in the
| controller and method URI segments.
|
| Examples: my-controller/index -> my_controller/index
| my-controller/my-method -> my_controller/my_method
*/
// this route routes the register page
$route['email'] = 'sendMail/sendMail';
$route['question'] = 'question_controller';
$route['question/get'] = 'question_controller/get';
$route['question/get/(:num)'] = 'question_controller/get/$1';
//$route['profile/get/(:num)'] = 'profile/recent_act/$1';
$route['follows'] = 'follow_controller';
$route['tag'] = 'tag_controller';
$route['tag/get'] = 'tag_controller/get';
$route['tag/get/(:num)'] = 'tag_controller/get/$1';
$route['answer'] = 'verifyanswer';
$route['verifyemail'] = 'verifyemail';
$route['register'] = 'register';
$route['register/login'] = 'login';
$route['register/verifyregister'] = 'verifyregister';
$route['register/verifyupload'] = 'verifyupload';
$route['verifyprofile'] = 'verifyprofile';
$route['verifyquestion'] = 'verifyquestion';
$route['register/resend_verification_mail'] = 'verifyregister/resend_verification_mail';
$route['register/upload'] = 'upload';
$route['forgot'] = 'forgotpassword';
$route['default_controller'] = 'home';
$route['logout'] = 'home/logout';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
| {
"content_hash": "7eb31a536e6cfc8c5cd7dfe0308d91b8",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 88,
"avg_line_length": 33.438202247191015,
"alnum_prop": 0.6434811827956989,
"repo_name": "Shiza1aas/project",
"id": "28866c5cbbfeb4d45647a56c15edb9061eaeaa21",
"size": "2976",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "application/config/routes.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "240"
},
{
"name": "CSS",
"bytes": "162665"
},
{
"name": "HTML",
"bytes": "8227098"
},
{
"name": "JavaScript",
"bytes": "90708"
},
{
"name": "PHP",
"bytes": "1889942"
}
],
"symlink_target": ""
} |
package io.agrest.it.fixture.pojo.model;
import io.agrest.annotation.AgAttribute;
public class P1 {
private String name;
@AgAttribute
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| {
"content_hash": "86a21cfac89ab42218ae263a6a5a845e",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 40,
"avg_line_length": 13.777777777777779,
"alnum_prop": 0.7137096774193549,
"repo_name": "AbleOne/link-rest",
"id": "a1e90d2f6de7626c973d8b68c91f63e14a749d40",
"size": "248",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "agrest/src/test/java/io/agrest/it/fixture/pojo/model/P1.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "15181"
},
{
"name": "Java",
"bytes": "1332576"
}
],
"symlink_target": ""
} |
'''
(*)~---------------------------------------------------------------------------
Pupil - eye tracking platform
Copyright (C) 2012-2017 Pupil Labs
Distributed under the terms of the GNU
Lesser General Public License (LGPL v3.0).
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
'''
import sys, os
import platform
import cv2
import numpy as np
import csv
#threading and processing
if platform.system() == 'Darwin':
from multiprocessing import get_context
mp = get_context('spawn') #forkserver works as well. Not sure what would be faster.
else:
import multiprocessing as mp
from ctypes import c_bool
from itertools import chain
from OpenGL.GL import *
from methods import normalize, denormalize
from file_methods import Persistent_Dict, save_object
from cache_list import Cache_List
from glfw import *
from pyglui import ui
from pyglui.cygl.utils import *
from plugin import Plugin
#logging
import logging
logger = logging.getLogger(__name__)
from surface_tracker import Surface_Tracker
from square_marker_detect import draw_markers,m_marker_to_screen
from calibration_routines.camera_intrinsics_estimation import load_camera_calibration
from offline_reference_surface import Offline_Reference_Surface
from math import sqrt
class Offline_Surface_Tracker(Surface_Tracker):
"""
Special version of surface tracker for use with videofile source.
It uses a seperate process to search all frames in the world video file for markers.
- self.cache is a list containing marker positions for each frame.
- self.surfaces[i].cache is a list containing surface positions for each frame
Both caches are build up over time. The marker cache is also session persistent.
See marker_tracker.py for more info on this marker tracker.
"""
def __init__(self,g_pool,mode="Show Markers and Surfaces",min_marker_perimeter = 100,invert_image=False,robust_detection=True):
super().__init__(g_pool,mode,min_marker_perimeter,robust_detection)
self.order = .2
if g_pool.app == 'capture':
raise Exception('For Player only.')
self.marker_cache_version = 2
self.min_marker_perimeter_cacher = 20 #find even super small markers. The surface locater will filter using min_marker_perimeter
#check if marker cache is available from last session
self.persistent_cache = Persistent_Dict(os.path.join(g_pool.rec_dir,'square_marker_cache'))
version = self.persistent_cache.get('version',0)
cache = self.persistent_cache.get('marker_cache',None)
if cache is None:
self.cache = Cache_List([False for _ in g_pool.timestamps])
self.persistent_cache['version'] = self.marker_cache_version
elif version != self.marker_cache_version:
self.persistent_cache['version'] = self.marker_cache_version
self.cache = Cache_List([False for _ in g_pool.timestamps])
logger.debug("Marker cache version missmatch. Rebuilding marker cache.")
else:
self.cache = Cache_List(cache)
logger.debug("Loaded marker cache {} / {} frames had been searched before".format(len(self.cache)-self.cache.count(False),len(self.cache)) )
self.init_marker_cacher()
for s in self.surfaces:
s.init_cache(self.cache,self.camera_calibration,self.min_marker_perimeter,self.min_id_confidence)
self.recalculate()
def load_surface_definitions_from_file(self):
self.surface_definitions = Persistent_Dict(os.path.join(self.g_pool.rec_dir,'surface_definitions'))
if self.surface_definitions.get('offline_square_marker_surfaces',[]) != []:
logger.debug("Found ref surfaces defined or copied in previous session.")
self.surfaces = [Offline_Reference_Surface(self.g_pool,saved_definition=d) for d in self.surface_definitions.get('offline_square_marker_surfaces',[]) if isinstance(d,dict)]
elif self.surface_definitions.get('realtime_square_marker_surfaces',[]) != []:
logger.debug("Did not find ref surfaces def created or used by the user in player from earlier session. Loading surfaces defined during capture.")
self.surfaces = [Offline_Reference_Surface(self.g_pool,saved_definition=d) for d in self.surface_definitions.get('realtime_square_marker_surfaces',[]) if isinstance(d,dict)]
else:
logger.debug("No surface defs found. Please define using GUI.")
self.surfaces = []
def init_gui(self):
self.menu = ui.Scrolling_Menu('Offline Surface Tracker')
self.g_pool.gui.append(self.menu)
self.add_button = ui.Thumb('add_surface',setter=lambda x: self.add_surface(),getter=lambda:False,label='A',hotkey='a')
self.g_pool.quickbar.append(self.add_button)
self.update_gui_markers()
self.on_window_resize(glfwGetCurrentContext(),*glfwGetWindowSize(glfwGetCurrentContext()))
def deinit_gui(self):
if self.menu:
self.g_pool.gui.remove(self.menu)
self.menu= None
if self.add_button:
self.g_pool.quickbar.remove(self.add_button)
self.add_button = None
def update_gui_markers(self):
def close():
self.alive=False
def set_min_marker_perimeter(val):
self.min_marker_perimeter = val
self.notify_all({'subject':'min_marker_perimeter_changed','delay':1})
self.menu.elements[:] = []
self.menu.append(ui.Button('Close',close))
self.menu.append(ui.Slider('min_marker_perimeter',self,min=20,max=500,step=1,setter=set_min_marker_perimeter))
self.menu.append(ui.Info_Text('The offline surface tracker will look for markers in the entire video. By default it uses surfaces defined in capture. You can change and add more surfaces here.'))
self.menu.append(ui.Info_Text("Press the export button or type 'e' to start the export."))
self.menu.append(ui.Selector('mode',self,label='Mode',selection=["Show Markers and Surfaces","Show marker IDs","Show Heatmaps","Show Metrics"] ))
self.menu.append(ui.Info_Text('To see heatmap or surface metrics visualizations, click (re)-calculate gaze distributions. Set "X size" and "Y size" for each surface to see heatmap visualizations.'))
self.menu.append(ui.Button("(Re)-calculate gaze distributions", self.recalculate))
self.menu.append(ui.Button("Add surface", lambda:self.add_surface()))
for s in self.surfaces:
idx = self.surfaces.index(s)
s_menu = ui.Growing_Menu("Surface {}".format(idx))
s_menu.collapsed=True
s_menu.append(ui.Text_Input('name',s))
s_menu.append(ui.Text_Input('x',s.real_world_size,label='X size'))
s_menu.append(ui.Text_Input('y',s.real_world_size,label='Y size'))
s_menu.append(ui.Button('Open Debug Window',s.open_close_window))
#closure to encapsulate idx
def make_remove_s(i):
return lambda: self.remove_surface(i)
remove_s = make_remove_s(idx)
s_menu.append(ui.Button('remove',remove_s))
self.menu.append(s_menu)
def on_notify(self,notification):
if notification['subject'] == 'gaze_positions_changed':
logger.info('Gaze postions changed. Recalculating.')
self.recalculate()
if notification['subject'] == 'min_data_confidence_changed':
logger.info('Min_data_confidence changed. Recalculating.')
self.recalculate()
elif notification['subject'] == 'surfaces_changed':
logger.info('Surfaces changed. Recalculating.')
self.recalculate()
elif notification['subject'] == 'min_marker_perimeter_changed':
logger.info('Min marker perimeter adjusted. Re-detecting surfaces.')
self.invalidate_surface_caches()
elif notification['subject'] is "should_export":
self.save_surface_statsics_to_file(notification['range'],notification['export_dir'])
def on_window_resize(self,window,w,h):
self.win_size = w,h
def add_surface(self):
self.surfaces.append(Offline_Reference_Surface(self.g_pool))
self.update_gui_markers()
def recalculate(self):
in_mark = self.g_pool.trim_marks.in_mark
out_mark = self.g_pool.trim_marks.out_mark
section = slice(in_mark,out_mark)
# calc heatmaps
for s in self.surfaces:
if s.defined:
s.generate_heatmap(section)
# calc distirbution accross all surfaces.
results = []
for s in self.surfaces:
gaze_on_srf = s.gaze_on_srf_in_section(section)
results.append(len(gaze_on_srf))
self.metrics_gazecount = len(gaze_on_srf)
if results == []:
logger.warning("No surfaces defined.")
return
max_res = max(results)
results = np.array(results,dtype=np.float32)
if not max_res:
logger.warning("No gaze on any surface for this section!")
else:
results *= 255./max_res
results = np.uint8(results)
results_c_maps = cv2.applyColorMap(results, cv2.COLORMAP_JET)
for s,c_map in zip(self.surfaces,results_c_maps):
heatmap = np.ones((1,1,4),dtype=np.uint8)*125
heatmap[:,:,:3] = c_map
s.metrics_texture = Named_Texture()
s.metrics_texture.update_from_ndarray(heatmap)
def invalidate_surface_caches(self):
for s in self.surfaces:
s.cache = None
def recent_events(self,events):
frame = events.get('frame')
if not frame:
return
self.img_shape = frame.img.shape
self.update_marker_cache()
# self.markers = [m for m in self.cache[frame.index] if m['perimeter'>=self.min_marker_perimeter]
self.markers = self.cache[frame.index]
if self.markers == False:
self.markers = []
self.seek_marker_cacher(frame.index) # tell precacher that it better have every thing from here on analyzed
events['surfaces'] = []
# locate surfaces
for s in self.surfaces:
if not s.locate_from_cache(frame.index):
s.locate(self.markers,self.camera_calibration,self.min_marker_perimeter,self.min_id_confidence)
if s.detected:
events['surfaces'].append({'name':s.name,'uid':s.uid,'m_to_screen':s.m_to_screen,'m_from_screen':s.m_from_screen, 'timestamp':frame.timestamp})
if self.mode == "Show marker IDs":
draw_markers(frame.img,self.markers)
elif self.mode == "Show Markers and Surfaces":
# edit surfaces by user
if self.edit_surf_verts:
window = glfwGetCurrentContext()
pos = glfwGetCursorPos(window)
pos = normalize(pos,glfwGetWindowSize(window),flip_y=True)
for s,v_idx in self.edit_surf_verts:
if s.detected:
new_pos = s.img_to_ref_surface(np.array(pos))
s.move_vertex(v_idx,new_pos)
else:
# update srf with no or invald cache:
for s in self.surfaces:
if s.cache == None and s not in [s for s,i in self.edit_surf_verts]:
s.init_cache(self.cache,self.camera_calibration,self.min_marker_perimeter,self.min_id_confidence)
self.notify_all({'subject':'surfaces_changed','delay':1})
#allow surfaces to open/close windows
for s in self.surfaces:
if s.window_should_close:
s.close_window()
if s.window_should_open:
s.open_window()
def init_marker_cacher(self):
from marker_detector_cacher import fill_cache
visited_list = [False if x == False else True for x in self.cache]
video_file_path = self.g_pool.capture.source_path
timestamps = self.g_pool.capture.timestamps
self.cache_queue = mp.Queue()
self.cacher_seek_idx = mp.Value('i',0)
self.cacher_run = mp.Value(c_bool,True)
self.cacher = mp.Process(target=fill_cache, args=(visited_list,video_file_path,timestamps,self.cache_queue,self.cacher_seek_idx,self.cacher_run,self.min_marker_perimeter_cacher))
self.cacher.start()
def update_marker_cache(self):
while not self.cache_queue.empty():
idx,c_m = self.cache_queue.get()
self.cache.update(idx,c_m)
for s in self.surfaces:
s.update_cache(self.cache,camera_calibration=self.camera_calibration,min_marker_perimeter=self.min_marker_perimeter,min_id_confidence=self.min_id_confidence,idx=idx)
if self.cacher_run.value == False:
self.recalculate()
def seek_marker_cacher(self,idx):
self.cacher_seek_idx.value = idx
def close_marker_cacher(self):
self.update_marker_cache()
self.cacher_run.value = False
self.cacher.join(1.0)
if self.cacher.is_alive():
logger.error("Marker cacher unresponsive - terminating.")
self.cacher.terminate()
def gl_display(self):
"""
Display marker and surface info inside world screen
"""
self.gl_display_cache_bars()
super().gl_display()
if self.mode == "Show Heatmaps":
for s in self.surfaces:
s.gl_display_heatmap()
if self.mode == "Show Metrics":
#todo: draw a backdrop to represent the gaze that is not on any surface
for s in self.surfaces:
#draw a quad on surface with false color of value.
s.gl_display_metrics()
def gl_display_cache_bars(self):
"""
"""
padding = 30.
# Lines for areas that have been cached
cached_ranges = []
for r in self.cache.visited_ranges: # [[0,1],[3,4]]
cached_ranges += (r[0],0),(r[1],0) #[(0,0),(1,0),(3,0),(4,0)]
# Lines where surfaces have been found in video
cached_surfaces = []
for s in self.surfaces:
found_at = []
if s.cache is not None:
for r in s.cache.positive_ranges: # [[0,1],[3,4]]
found_at += (r[0],0),(r[1],0) #[(0,0),(1,0),(3,0),(4,0)]
cached_surfaces.append(found_at)
glMatrixMode(GL_PROJECTION)
glPushMatrix()
glLoadIdentity()
width,height = self.win_size
h_pad = padding * (self.cache.length-2)/float(width)
v_pad = padding* 1./(height-2)
glOrtho(-h_pad, (self.cache.length-1)+h_pad, -v_pad, 1+v_pad,-1,1) # ranging from 0 to cache_len-1 (horizontal) and 0 to 1 (vertical)
glMatrixMode(GL_MODELVIEW)
glPushMatrix()
glLoadIdentity()
color = RGBA(.8,.6,.2,.8)
draw_polyline(cached_ranges,color=color,line_type=GL_LINES,thickness=4)
color = RGBA(0,.7,.3,.8)
for s in cached_surfaces:
glTranslatef(0,.02,0)
draw_polyline(s,color=color,line_type=GL_LINES,thickness=2)
glMatrixMode(GL_PROJECTION)
glPopMatrix()
glMatrixMode(GL_MODELVIEW)
glPopMatrix()
def save_surface_statsics_to_file(self,export_range,export_dir):
"""
between in and out mark
report: gaze distribution:
- total gazepoints
- gaze points on surface x
- gaze points not on any surface
report: surface visisbility
- total frames
- surface x visible framecount
surface events:
frame_no, ts, surface "name", "id" enter/exit
for each surface:
fixations_on_name.csv
gaze_on_name_id.csv
positions_of_name_id.csv
"""
metrics_dir = os.path.join(export_dir,'surfaces')
section = export_range
in_mark = export_range.start
out_mark = export_range.stop
logger.info("exporting metrics to {}".format(metrics_dir))
if os.path.isdir(metrics_dir):
logger.info("Will overwrite previous export for this section")
else:
try:
os.mkdir(metrics_dir)
except:
logger.warning("Could not make metrics dir {}".format(metrics_dir))
return
with open(os.path.join(metrics_dir,'surface_visibility.csv'),'w',encoding='utf-8',newline='') as csvfile:
csv_writer = csv.writer(csvfile, delimiter=',')
# surface visibility report
frame_count = len(self.g_pool.timestamps[section])
csv_writer.writerow(('frame_count',frame_count))
csv_writer.writerow((''))
csv_writer.writerow(('surface_name','visible_frame_count'))
for s in self.surfaces:
if s.cache == None:
logger.warning("The surface is not cached. Please wait for the cacher to collect data.")
return
visible_count = s.visible_count_in_section(section)
csv_writer.writerow( (s.name, visible_count) )
logger.info("Created 'surface_visibility.csv' file")
with open(os.path.join(metrics_dir,'surface_gaze_distribution.csv'),'w',encoding='utf-8',newline='') as csvfile:
csv_writer = csv.writer(csvfile, delimiter=',')
# gaze distribution report
gaze_in_section = list(chain(*self.g_pool.gaze_positions_by_frame[section]))
not_on_any_srf = set([gp['timestamp'] for gp in gaze_in_section])
csv_writer.writerow(('total_gaze_point_count',len(gaze_in_section)))
csv_writer.writerow((''))
csv_writer.writerow(('surface_name','gaze_count'))
for s in self.surfaces:
gaze_on_srf = s.gaze_on_srf_in_section(section)
gaze_on_srf = set([gp['base_data']['timestamp'] for gp in gaze_on_srf])
not_on_any_srf -= gaze_on_srf
csv_writer.writerow( (s.name, len(gaze_on_srf)) )
csv_writer.writerow(('not_on_any_surface', len(not_on_any_srf) ) )
logger.info("Created 'surface_gaze_distribution.csv' file")
with open(os.path.join(metrics_dir,'surface_events.csv'),'w',encoding='utf-8',newline='') as csvfile:
csv_writer = csv.writer(csvfile, delimiter=',')
# surface events report
csv_writer.writerow(('frame_number','timestamp','surface_name','surface_uid','event_type'))
events = []
for s in self.surfaces:
for enter_frame_id,exit_frame_id in s.cache.positive_ranges:
events.append({'frame_id':enter_frame_id,'srf_name':s.name,'srf_uid':s.uid,'event':'enter'})
events.append({'frame_id':exit_frame_id,'srf_name':s.name,'srf_uid':s.uid,'event':'exit'})
events.sort(key=lambda x: x['frame_id'])
for e in events:
csv_writer.writerow( ( e['frame_id'],self.g_pool.timestamps[e['frame_id']],e['srf_name'],e['srf_uid'],e['event'] ) )
logger.info("Created 'surface_events.csv' file")
for s in self.surfaces:
# per surface names:
surface_name = '_'+s.name.replace('/','')+'_'+s.uid
# save surface_positions as pickle file
save_object(s.cache.to_list(),os.path.join(metrics_dir,'srf_positions'+surface_name))
#save surface_positions as csv
with open(os.path.join(metrics_dir,'srf_positons'+surface_name+'.csv'),'w',encoding='utf-8',newline='') as csvfile:
csv_writer =csv.writer(csvfile, delimiter=',')
csv_writer.writerow(('frame_idx','timestamp','m_to_screen','m_from_screen','detected_markers'))
for idx,ts,ref_srf_data in zip(range(len(self.g_pool.timestamps)),self.g_pool.timestamps,s.cache):
if in_mark <= idx <= out_mark:
if ref_srf_data is not None and ref_srf_data is not False:
csv_writer.writerow( (idx,ts,ref_srf_data['m_to_screen'],ref_srf_data['m_from_screen'],ref_srf_data['detected_markers']) )
# save gaze on srf as csv.
with open(os.path.join(metrics_dir,'gaze_positions_on_surface'+surface_name+'.csv'),'w',encoding='utf-8',newline='') as csvfile:
csv_writer = csv.writer(csvfile, delimiter=',')
csv_writer.writerow(('world_timestamp','world_frame_idx','gaze_timestamp','x_norm','y_norm','x_scaled','y_scaled','on_srf'))
for idx,ts,ref_srf_data in zip(range(len(self.g_pool.timestamps)),self.g_pool.timestamps,s.cache):
if in_mark <= idx <= out_mark:
if ref_srf_data is not None and ref_srf_data is not False:
for gp in s.gaze_on_srf_by_frame_idx(idx,ref_srf_data['m_from_screen']):
csv_writer.writerow( (ts,idx,gp['base_data']['timestamp'],gp['norm_pos'][0],gp['norm_pos'][1],gp['norm_pos'][0]*s.real_world_size['x'],gp['norm_pos'][1]*s.real_world_size['y'],gp['on_srf']) )
# save fixation on srf as csv.
with open(os.path.join(metrics_dir,'fixations_on_surface'+surface_name+'.csv'),'w',encoding='utf-8',newline='') as csvfile:
csv_writer = csv.writer(csvfile, delimiter=',')
csv_writer.writerow(('id','start_timestamp','duration','start_frame','end_frame','norm_pos_x','norm_pos_y','x_scaled','y_scaled','on_srf'))
fixations_on_surface = []
for idx,ref_srf_data in zip(range(len(self.g_pool.timestamps)),s.cache):
if in_mark <= idx <= out_mark:
if ref_srf_data is not None and ref_srf_data is not False:
for f in s.fixations_on_srf_by_frame_idx(idx,ref_srf_data['m_from_screen']):
fixations_on_surface.append(f)
removed_duplicates = dict([(f['base_data']['id'],f) for f in fixations_on_surface]).values()
for f_on_s in removed_duplicates:
f = f_on_s['base_data']
f_x,f_y = f_on_s['norm_pos']
f_on_srf = f_on_s['on_srf']
csv_writer.writerow( (f['id'],f['timestamp'],f['duration'],f['start_frame_index'],f['end_frame_index'],f_x,f_y,f_x*s.real_world_size['x'],f_y*s.real_world_size['y'],f_on_srf) )
logger.info("Saved surface positon gaze and fixation data for '{}' with uid:'{}'".format(s.name,s.uid))
if s.heatmap is not None:
logger.info("Saved Heatmap as .png file.")
cv2.imwrite(os.path.join(metrics_dir,'heatmap'+surface_name+'.png'),s.heatmap)
logger.info("Done exporting reference surface data.")
# if s.detected and self.img is not None:
# #let save out the current surface image found in video
# #here we get the verts of the surface quad in norm_coords
# mapped_space_one = np.array(((0,0),(1,0),(1,1),(0,1)),dtype=np.float32).reshape(-1,1,2)
# screen_space = cv2.perspectiveTransform(mapped_space_one,s.m_to_screen).reshape(-1,2)
# #now we convert to image pixel coods
# screen_space[:,1] = 1-screen_space[:,1]
# screen_space[:,1] *= self.img.shape[0]
# screen_space[:,0] *= self.img.shape[1]
# s_0,s_1 = s.real_world_size
# #no we need to flip vertically again by setting the mapped_space verts accordingly.
# mapped_space_scaled = np.array(((0,s_1),(s_0,s_1),(s_0,0),(0,0)),dtype=np.float32)
# M = cv2.getPerspectiveTransform(screen_space,mapped_space_scaled)
# #here we do the actual perspactive transform of the image.
# srf_in_video = cv2.warpPerspective(self.img,M, (int(s.real_world_size['x']),int(s.real_world_size['y'])) )
# cv2.imwrite(os.path.join(metrics_dir,'surface'+surface_name+'.png'),srf_in_video)
# logger.info("Saved current image as .png file.")
# else:
# logger.info("'%s' is not currently visible. Seek to appropriate frame and repeat this command."%s.name)
def cleanup(self):
""" called when the plugin gets terminated.
This happens either voluntarily or forced.
if you have a GUI or glfw window destroy it here.
"""
self.surface_definitions["offline_square_marker_surfaces"] = [rs.save_to_dict() for rs in self.surfaces if rs.defined]
self.surface_definitions.close()
self.close_marker_cacher()
self.persistent_cache["marker_cache"] = self.cache.to_list()
self.persistent_cache.close()
for s in self.surfaces:
s.close_window()
self.deinit_gui()
| {
"content_hash": "ad37e4c586cb73108999434c63411a56",
"timestamp": "",
"source": "github",
"line_count": 552,
"max_line_length": 223,
"avg_line_length": 45.6268115942029,
"alnum_prop": 0.5995394266656079,
"repo_name": "fsxfreak/esys-pbi",
"id": "40502dd49df3df39a1bd609bdd89df11ba79bcd0",
"size": "25186",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/pupil/pupil_src/shared_modules/offline_surface_tracker.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "118"
},
{
"name": "C++",
"bytes": "286538"
},
{
"name": "Python",
"bytes": "1172023"
},
{
"name": "Shell",
"bytes": "409"
}
],
"symlink_target": ""
} |
CREATE SET TABLE
%s.%s, FALLBACK
(Test_Id INTEGER)
UNIQUE PRIMARY INDEX (Test_Id); | {
"content_hash": "0a48e26d7012a840e48ea5b48984b839",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 33,
"avg_line_length": 23,
"alnum_prop": 0.6630434782608695,
"repo_name": "google/dwh-assessment-extraction-tool",
"id": "a33ea4f1bd086518b3695ff6ca7c9de5c2b9f01b",
"size": "681",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "integ-tests/teradata/src/main/java/com/google/sql/testdata/columns_data_2.sql",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "502390"
},
{
"name": "Shell",
"bytes": "20349"
},
{
"name": "Starlark",
"bytes": "25546"
}
],
"symlink_target": ""
} |
package io.warp10.script.functions;
import java.util.Vector;
import io.warp10.script.NamedWarpScriptFunction;
import io.warp10.script.WarpScriptException;
import io.warp10.script.WarpScriptStack;
import io.warp10.script.WarpScriptStackFunction;
public class EMPTYVECTOR extends NamedWarpScriptFunction implements WarpScriptStackFunction {
public EMPTYVECTOR(String name) {
super(name);
}
@Override
public Object apply(WarpScriptStack stack) throws WarpScriptException {
stack.push(new Vector<Object>());
return stack;
}
}
| {
"content_hash": "afbbd33a5edf07cd531fdff0a083f4fe",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 93,
"avg_line_length": 26.238095238095237,
"alnum_prop": 0.7912885662431942,
"repo_name": "StevenLeRoux/warp10-platform",
"id": "f99b785190aff230c394e08981efcc1297155c16",
"size": "1166",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "warp10/src/main/java/io/warp10/script/functions/EMPTYVECTOR.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "17974"
},
{
"name": "Java",
"bytes": "5065045"
},
{
"name": "JavaScript",
"bytes": "959"
},
{
"name": "Python",
"bytes": "21063"
},
{
"name": "Shell",
"bytes": "30036"
},
{
"name": "Thrift",
"bytes": "22180"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<!--
Copyright 2017
Code by Michael Leimstädtner
-->
<meta charset="utf-8"/>
<title>Classification Overview</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="shortcut icon" href="favicon.ico"/>
<link rel="icon" href="favicon.png" type="image/png"/>
<meta Name="description" content=""/>
<meta name="keywords" content="" />
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="css/overview.css"/>
</head>
<body>
<div id="wrappers">
<div style="display:none;" onclick="hideInfo()" class="overlay_blur"></div>
<div style="display:none" class="overlay_wrapper" id="predictionList_wrapper"> <!-- Overlay -->
<div class="container">
<h2>List prediction</h2>
<hr>
<blockquote>Insert or upload a list of GitHub repository links in order to run our classifier against them. The output of <strong>{{topMostName}}</strong> will be shown next to the link on the right side.</blockquote>
<div class="row">
<div class="col-xs-6">
<textarea placeholder="Insert one repository link per line" id="inputList"></textarea>
</div>
<div class="col-xs-6">
<textarea placeholder="Classification results will be shown here" readonly id="outputList"></textarea>
</div>
</div>
<br>
<div class="row">
<div class="col-xs-4 col-xs-offset-4 text-center">
<button v-on:click="predictList()"
class="btn btn-primary">Start prediction</button>
</div>
</div>
<!-- Fun but useless visualisation
<div class="row">
<div :class="expression"
id="expression">
<span>{{expression}}</span>
</div>
</div>
<div class="row text-center" style="font-style:italic">
<span><strong>{{exprState}}</strong></span><br>
<span>Images taken from the <a href="http://www.kasrl.org/jaffe.html" target="_blank">jaffe</a> dataset.</span>
</div>-->
</div>
</div> <!-- /Overlay -->
<div style="display:none" class="overlay_wrapper" id="stats_wrapper"> <!-- Overlay -->
<div class="container">
<h2>Statistics</h2>
<hr>
<div
v-show="(mode == 'test')"
:class="'trainCount '">
<h4><strong>Sample class distribution for set:
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{distribution}} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li v-on:click="changeDistribution('Test')"><span>Test</span></li>
<li v-on:click="changeDistribution('Train')"><span>Train</span></li>
</ul>
</div>
</strong></h4>
<table class="table table-bordered table-striped measure_table">
<!-- Strings -->
<colgroup> <col class="col-xs-6"> <col class="col-xs-6"></colgroup>
<thead> <tr> <th>Class</th> <th>#{{distribution}} samples</th> </tr> </thead>
<tbody>
<tr v-for="x in distributionArray"> <td scope="row">{{x.class}}</td> <td><code>{{x.count}}</code></td></tr>
</tbody>
</table>
</div>
<hr>
<h4><strong>View insights for table:
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{selectedTable}} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li v-for="t in tableList" v-on:click="selectTable(t)"><span>{{t}}</span></li>
</ul>
</div></strong></h4>
<h5 style="font-style: italic;">Note: Samples from `unlabeled` are most representative for average samples on GitHub</h5>
<table class="table table-bordered table-striped measure_table">
<colgroup> <col class="col-xs-4"> <col class="col-xs-2"><col class="col-xs-2"><col class="col-xs-2"><col class="col-xs-2"> </colgroup>
<thead> <tr> <th>Numerical Attribute</th> <th>Avg</th> <th>Min</th> <th>Max</th> <th>Sum</th> </tr> </thead>
<tbody>
<tr v-for="(val, m) in formatStats(numStats)"> <td scope="row"> <code>{{m}}</code> </td> <td><b>{{Math.round(parseFloat(val['AVG'])*100)/100}}</b></td> <td>{{val['MIN']}}</td> <td>{{val['MAX']}}</td> <td>{{val['SUM']}}</td> </tr>
</tbody>
</table>
<table class="table table-bordered table-striped measure_table">
<!-- Strings -->
<colgroup> <col class="col-xs-6"> <col class="col-xs-6"></colgroup>
<thead> <tr> <th>String Attribute</th> <th>Avg length</th> </tr> </thead>
<tbody>
<tr v-for="(val, m) in formatStats(strStats)"> <td scope="row"> <code>{{m.substr(12, m.length - 13)}}</code> </td> <td><b>{{Math.round(parseFloat(val['AVG'])*100)/100}}</b></td></tr>
</tbody>
</table>
</div>
</div> <!-- /Overlay -->
<div style="display:none;" class="overlay_wrapper" id="details_wrapper"> <!-- Overlay -->
<div class="container">
<h2>Classifier Module</h2>
<hr>
<div class="attributes">
<div class="row attribute">
<div class="col-xs-3">Name</div>
<div class="col-xs-9">{{currentName}}</div>
</div>
<div class="row attribute">
<div class="col-xs-3">Description</div>
<div class="col-xs-9">{{current.description}}</div>
</div>
<div class="row attribute">
<div class="col-xs-3">{{originalMeasureName(getMeasureName())}}</div>
<div class="col-xs-9">{{formatMeasure(current.confusionMatrix.measures[getMeasureName()])}}</div>
</div>
<div class="row attribute">
<div class="col-xs-3">Currently enabled</div>
<div class="col-xs-9">{{current.active ? 'Yes' : 'No'}}</div>
</div>
</div>
<h3>Actions</h3>
<hr>
<span class="action btn btn-default" v-on:click="retrain(currentName, false)">{{retrainstate}}</span>
<span disabled class="action btn btn-default" v-on:click="retrain_semi()">{{semiretrainstate}}</span>
<span class="action btn btn-default" v-on:click="save(currentName)">{{savestate}}</span>
<div class="version_wrapper">
<div class="input-group-btn select">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><b>{{formatFileName(selectedPoint)}}</b> <span class="caret"></span></button>
<ul class="dropdown-menu" style="margin: 0px auto;">
<li v-for="(sp, fileName) in savePoints"><span v-on:click="setSavePoint(fileName)">{{formatFileName(fileName)}}</span></li>
</ul>
</div>
<span class="action btn btn-default" v-on:click="load()">{{loadstate}}</span>
</div>
<h3>Performance</h3>
<div class="graph">
<h4 id="version_chart_header" style="display:none;"><strong>Overall precision per version</strong></h4>
<div id="version_precision_chart"></div>
</div>
<div class="graph">
<h4><strong>Confusion matrix</strong></h4>
<table id="confusion_matrix" class="table">
<tbody>
<tr>
<th>▼ Class. \ Reference ► </th>
<th v-for="(c, i) in current.confusionMatrix.order">{{c}}</th>
<th>Total</th>
<th>Precision</th>
</tr>
<tr v-for="(r, i) in current.confusionMatrix.matrix"
:class="(i >= current.confusionMatrix.order.length ? 'total' : '') ">
<td>
{{(i < current.confusionMatrix.order.length ? current.confusionMatrix.order[i] : (current.confusionMatrix.order.length == i ? 'Total' : 'Recall'))}}</td>
<td v-for="(r2, i2) in current.confusionMatrix.matrix[i]"
:class="(i == i2 ? 'cell_own' : (i < i2 ? 'cell_classifier': 'cell_reference'))">
{{Math.round(current.confusionMatrix.matrix[i][i2] * 100) / 100}}</td>
</tr>
</tbody>
</table>
<h4><strong>Measure table</strong></h4>
<table class="table table-bordered table-striped measure_table">
<colgroup> <col class="col-xs-6"> <col class="col-xs-6"> </colgroup>
<thead> <tr> <th>Measure</th> <th>Result</th> </tr> </thead>
<tbody>
<tr v-for="val in orderMeasures(current.confusionMatrix.measures)"> <td scope="row"> <code class="defaultCursor" data-toggle="tooltip" data-placement="top" :data-original-title="getMeasureDescription(val[0])">{{originalMeasureName(val[0])}}</code> </td> <td>{{Math.round(val[1] * 10000)/100}} %</td> </tr>
</tbody>
</table>
</div>
</div>
</div> <!-- /Overlay -->
<div style="display:none" class="overlay_wrapper" id="docs_wrapper"> <!-- Overlay -->
<div class="container">
<h2>Documentation</h2>
<hr>
<div
:class="'trainCount '">
<h4>
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{selectedDocumentation}} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li v-for="d in documentations" v-on:click="changeDocumentation(d)"><span>{{d}}</span></li>
</ul>
</div></h4>
</div>
<p id="md" v-html="documentationContent"></p>
</div>
</div> <!-- /Overlay -->
<div style="display:none" class="overlay_wrapper" id="team_wrapper"> <!-- Overlay -->
<div class="container">
<h2>The team</h2>
<hr>
<div class="row">
<div v-on:click="showTeam('stefan')"
:class="'col-xs-2 portrait ' + (activeMember == 'stefan' ? 'selected' : '')" style="background-image: url('images/stefan.jpg')"></div>
<div v-on:click="showTeam('michael')"
:class="'col-xs-2 portrait ' + (activeMember == 'michael' ? 'selected' : '')" style="background-image: url('images/michael.jpg')"></div>
<div v-on:click="showTeam('martin')"
:class="'col-xs-2 portrait ' + (activeMember == 'martin' ? 'selected' : '')" style="background-image: url('images/martin.jpg')"></div>
<div v-on:click="showTeam('andreas')"
:class="'col-xs-2 portrait ' + (activeMember == 'andreas' ? 'selected' : '')" style="background-image: url('images/andreas.jpg')"></div>
</div>
<hr>
<h2>{{name}}</h2>
<div class="row">
<div class="col-xs-4">Degree programme</div>
<div class="col-xs-8">{{degree}}</div>
</div>
<div class="row">
<div class="col-xs-4">Term</div>
<div class="col-xs-8">{{term}}</div>
</div>
<!--<div class="row">
<div class="col-xs-4">Expertise</div>
<div class="col-xs-8">{{expertise}}</div>
</div>-->
</div>
</div> <!-- /Overlay -->
</div> <!-- /Wrappers -->
<div id="page" class="container-fluid" style="display:none;">
<div id="header">
<div class="container">
<div class="col-xs-4" style="height:156px;">
<h1>Classification Overview<span class="glyphicon glyphicon-info-sign" data-toggle="tooltip" data-placement="top" title="Show documentation" v-on:click="showDocumentationWrapper()"></span></h1>
<span class="note">Note: Altough we list more than one classification module, only the top listed preordered module should be considered as our submission.</span>
<div
v-show="(mode == 'stream' || mode == 'pool')"
:class="'control_buttons '"><!--control-subgroup-->
<span :class="(action == 'loop' ? 'active ' : '') + 'glyphicon glyphicon-play'" v-on:click="loop('endless')" data-toggle="tooltip" data-placement="top" title="Classify random samples until paused"></span>
<span :class="(action == 'halt' ? 'active ' : '') + 'glyphicon glyphicon-pause'" v-on:click="halt()" data-toggle="tooltip" data-placement="top" title="Stop classifying"></span>
<span class="glyphicon glyphicon-step-forward" v-on:click="singleStep()" data-toggle="tooltip" data-placement="top" title="Classify a single random sample">
</span>
</div><!-- /control-subgroup -->
</div>
<div class="col-xs-8">
<div class="col-xs-6">
<div class="input-group">
<span class="input-group-addon">
<input id="mode_1" v-on:change="switchMode()" value="stream" v-model="mode" name="mode" type="radio">
</span>
<label for="mode_1" class="form-control">Stream Based AL</label>
</div><!-- /input-group -->
<div class="input-group">
<span class="input-group-addon">
<input id="mode_2" v-on:change="switchMode()" value="pool" v-model="mode" name="mode" type="radio">
</span>
<label for="mode_2" class="form-control">Pool Based AL</label>
</div><!-- /input-group -->
<div class="input-group">
<span class="input-group-addon">
<input id="mode_3" v-on:change="switchMode()" value="test" v-model="mode" name="mode" type="radio">
</span>
<label for="mode_3" class="form-control">Test all Classifiers</label>
</div><!-- /input-group -->
<div class="input-group">
<span class="input-group-addon">
<input id="mode_4" v-on:change="switchMode()" value="single" v-model="mode" name="mode" type="radio">
</span>
<label for="mode_4" class="form-control">Handle user input</label>
</div> <!-- /input-group -->
</div>
<div id="right" :class="'col-xs-6 '"><!-- right side options -->
<!-- Train instantly would take too long
<div
v-show="(mode != 'stream' && mode != 'pool')"
:class="'input-group '">
<span class="input-group-addon">
<input id="instant_train" v-model="trainInstantly" name="instant_train" type="checkbox">
</span>
<label for="instant_train" class="form-control">Classify instantly and train incrementaly</label>
</div>-->
<!-- Active Learning controls -->
<div
v-show="(mode == 'stream')"
:class="'input-group '"
data-toggle="tooltip" data-placement="bottom" data-original-title="Semi-supervised learning could be included at a future date. Right now the precision is too low to make use of semi-supervised learning.">
<span class="input-group-addon">
<input disabled="disabled" id="semi_supervised" v-model="isSemiSupervised" name="semi_supervised" type="checkbox">
</span>
<label for="semi_supervised" class="form-control">Semi-Supervised</label>
</div> <!-- /input-group -->
<div
v-show="(mode == 'stream' || mode == 'pool')"
:class="'input-group '">
<label id="formula" class="form-control">{{formula}}</label>
<div class="input-group-btn">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Uncertainty formula <span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right">
<li v-for="f in formulas"><span v-on:click="setFormula(f)">{{f}}</span></li>
</ul>
</div><!-- /btn-group -->
</div><!-- /input-group -->
<!-- Handle user input controls -->
<div
v-show="mode == 'single'"
:class="'input-group '"
data-toggle="tooltip" data-placement="bottom" data-original-title="If checked, the output will always consist of a label prediction.">
<span class="input-group-addon">
<input id="pH1" name="predictionHandling" v-model="predictionHandling" value="predict" type="radio">
</span>
<label for="pH1" class="form-control">Always show prediction</label>
</div><!-- /input-group -->
<div
v-show="mode == 'single'"
:class="'input-group '"
data-toggle="tooltip" data-placement="bottom" data-original-title="If checked, the user will be asked to classify the sample manually">
<span class="input-group-addon">
<input id="pH2" name="predictionHandling" v-model="predictionHandling" value="feedback" type="radio">
</span>
<label for="pH2" class="form-control">Always require user feedback</label>
</div><!-- /input-group -->
<input v-on:click="predictSingle('')"
v-show="(mode == 'single')"
:class="'btn btn-primary control '" style="width: 49.55%;"
title="Predict single samples" value="Predict single" type="button">
<input v-on:click="showListPrediction()"
v-show="(mode == 'single')"
:class="'btn btn-primary control '" style="width: 49.55%;"
title="Predict a list of samples" value="Predict list" type="button">
<!-- Test controls -->
<input v-on:click="retrainAll()" :value="retrainAllState"
v-show="(mode == 'test')"
:class="'btn btn-primary '" style="width: 49.55%;" type="button">
<input v-on:click="saveAll()" :value="saveAllState"
v-show="(mode == 'test')"
:class="'btn btn-primary '" style="width: 49.55%;" type="button">
<div
v-show="mode == 'test'" :class="'input-group '"
data-toggle="tooltip" data-placement="bottom" data-original-title="The extended test set contains additional samples classified by ourself while the standard set does not include OTHER samples.">
<span class="input-group-addon">
<input v-on:change="changeExtendedSet()" id="useExtendedTestSet" v-model="useExtendedTestSet" name="useExtendedTestSet" type="checkbox">
</span>
<label for="useExtendedTestSet" class="form-control">Use extended test set</label>
</div><!-- /input-group -->
<input v-on:click="startTest()"
v-show="(mode == 'test')"
:class="'btn btn-primary control '"
title="Test all Classifiers" value="Test classifiers" type="button">
<input v-on:click="showStats()" value="Statistics"
v-show="(mode == 'test')"
:class="'btn btn-primary '" type="button">
</div><!-- /right side options -->
</div><!-- /controls -->
</div><!-- /container -->
</div><!-- /header -->
<div class="container">
<div id="titles" class="row"><!-- titles -->
<div class="alert alert-warning" id="calls_warning" v-html="flag" v-show="flag != ''"></div>
<blockquote class="lead" v-html="getQuote()"></blockquote>
<div class="col-xs-2"><h3>Input</h3></div>
<div class="col-xs-7">
<div class="col-xs-4"><h3>Classifiers</h3></div>
<div class="col-xs-7 col-xs-offset-1"><h3>{{(mode != 'test' ? 'Classification results' : ' Precision per class')}}</h3></div>
</div>
<div class="col-xs-3"><h3>Output</h3></div>
</div><!-- /titles -->
<div class="row main"><!-- main -->
<div id="input" class="col-xs-2"><!-- input -->
<h4
class="subtitle"
v-show="state != 'showResult' && state != 'empty'"
>{{state}}</h4>
<div
v-show="(mode != 'test' && state == 'showResult')"
:class="'repoDetails '">
<h4 class="subtitle"><small><a target="_blank" :href="'https://github.com/' + repo.author">{{repo.author}}</a> / </small><a target="_blank" :href="'https://github.com/' + repo.author + '/' + repo.repoName">{{repo.repoName}}</a></h4>
<p>{{shortDesc}}</p>
<table class="table table-bordered table-striped measure_table">
<!-- Strings -->
<colgroup> <col class="col-xs-6"> <col class="col-xs-6"></colgroup>
<thead> <tr> <th>Feature</th> <th>Value</th> </tr> </thead>
<tbody>
<tr> <td scope="row">#Folders</td> <td><code>{{repo.folder_count}}</code></td></tr>
<tr> <td scope="row">#Files</td> <td><code>{{repo.file_count}}</code></td></tr>
<tr> <td scope="row">#Commits</td> <td><code>{{repo.commit_count}}</code></td></tr>
<tr> <td scope="row">Language</td> <td><code>{{repo.language}}</code></td></tr>
</tbody>
</table>
</div>
<div
v-show="(mode == 'test' && (state == 'showResult' || state == 'empty'))"
:class="'trainCount '">
<h4 class="subtitle">
Test sample distribution</h4>
<table class="table table-bordered table-striped measure_table">
<!-- Strings -->
<colgroup> <col class="col-xs-6"> <col class="col-xs-6"></colgroup>
<thead> <tr> <th>Class</th> <th>#Test samples</th> </tr> </thead>
<tbody>
<tr v-for="x in TestDistribution"> <td scope="row">{{x.class}}</td> <td><code>{{x.count}}</code></td></tr>
</tbody>
</table>
</div>
</div><!-- /input -->
<div class="col-xs-7">
<div id="classifier_wrapper">
<h4 class="subtitle"> Order classifiers by
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{originalMeasureName(selectedMeasure)}} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li v-for="measure in measures" v-on:click="changeMeasure(measure)"><span data-toggle="tooltip" data-placement="top" :data-original-title="getMeasureDescription(measure)">{{originalMeasureName(measure)}}</span></li>
</ul>
</div>
</h4>
<div id="classifiers">
<div v-for="c in orderedClassifiers" :class="'classifier_row' + (c.active ? '' : ' inactive') ">
<div :class="'classifier ' + (isAsking(c.name) ? 'asking' : '')"
data-toggle="tooltip" data-placement="bottom" :data-original-title="(isAsking(c.name) ? 'This module selected the sample because of a high uncertainty.' : '')">
<span class="name">{{c.name}}</span>
<div class="wrapper">
<span data-toggle="tooltip" data-placement="top" :data-original-title="'Current ' + originalMeasureName(getMeasureName())" class="stats">{{getMeasure(c)}}%<!-- <span title="Precision of previous version" class="old">/ 79%</span>--></span>
<span data-toggle="tooltip" data-placement="top" title="Show classifier details" v-on:click="showInfo(c.name)" class="glyphicon glyphicon-info-sign"></span>
<span data-toggle="tooltip" data-placement="top" title="Enable classifier" v-on:click="switchState(c.name)" class="glyphicon glyphicon-ban-circle"></span>
<span data-toggle="tooltip" data-placement="top" title="Disable classifier" v-on:click="switchState(c.name)" class="glyphicon glyphicon-ok-circle"></span>
</div>
</div>
<div class="arrow">=></div>
<div
v-show="(mode == 'test')"
:class="'result_vector'">
<div v-for="(r, i) in c.precision" :class="'v ' + (getMax(c.name) == r.val ? 'max' : '')">
<span>{{r.class}}</span><span>{{Math.round(r.val * 100) / 100}}</span>
</div>
</div>
<div
v-show="(mode != 'test')"
:class="'result_vector ' + (typeof(c.unsure) != 'undefined' && mode != 'single' ? (c.unsure ? 'uncertain ' : 'certain ') : ' ')">
<div v-for="(r, i) in c.probability" :class="'v ' + (getMax(c.name) == r.val ? 'max' : '')">
<span>{{r.class}}</span><span>{{Math.round(r.val * 100) / 100}}</span>
</div>
</div>
<div data-toggle="tooltip" data-placement="top" title="Classifier uncertainty"
v-show="(c.uncertainty > 0)"
:class="'uncertainty ' + (typeof(c.unsure) != 'undefined' ? (c.unsure ? 'uncertain ' : 'certain ') : ' ')">
{{Math.round(c.uncertainty * 100) / 100}}
</div>
</div>
</div><!-- /classifiers -->
</div>
</div>
<div class="col-xs-3" id="output"><!-- output -->
<div v-show="mode == 'test'">
<h4 class="subtitle">Top-most listed classifier performance</h4>
<p class="outputText">Final classifications are being made by <strong>{{topMostName}}</strong>. Its measures are listed below</p>
<table class="table table-bordered table-striped measure_table">
<colgroup> <col class="col-xs-8"> <col class="col-xs-4"> </colgroup>
<thead> <tr> <th>Measure</th> <th>Result</th> </tr> </thead>
<tbody>
<tr v-for="val in orderMeasures(outputMeasures)"> <td scope="row"> <code class="defaultCursor" data-toggle="tooltip" data-placement="top" :data-original-title="getMeasureDescription(val[0])">{{originalMeasureName(val[0])}}</code> </td> <td>{{formatMeasure(val[1])}}</td> </tr>
</tbody>
</table>
<hr>
<h4 class="text-center">Best precision of each classifiers</h4>
<table class="outputDistr table table-bordered table-striped measure_table">
<colgroup><col class="col-xs-2"> <col class="col-xs-10"></colgroup>
<thead><tr><th>Class</th> <th>#Best scores</th></tr></thead>
<tbody>
<tr v-for="(x, i) in precisionDistribution"><td scope="row">{{x.name}}</td> <td><div class="bar" :style="{width: x.percentage + '%'}">{{x.count}}</div></td></tr>
</tbody>
</table>
</div>
<div v-show="(mode != 'test' && state == 'showResult')">
<h4 class="subtitle">Predicted class</h4>
<table class="outputDistr table table-bordered table-striped measure_table">
<colgroup><col class="col-xs-2"> <col class="col-xs-10"></colgroup>
<thead><tr><th>Class</th> <th>#Predictions</th></tr></thead>
<tbody>
<tr v-for="(x, i) in predictionDistribution"><td scope="row">{{x.name}}</td> <td><div class="bar" :style="{width: x.percentage + '%'}">{{x.count}}</div></td></tr>
</tbody>
</table>
</div>
<p
v-show="(mode != 'test' && state == 'showResult')"
class="outputText"
>The top-most listed classifier says it's <strong>{{getOutputClass()}}</strong>.
<span
v-show="(state == 'showResult') && ((mode != 'test' && mode != 'single' && classifiersUnsure) || (mode == 'single' && predictionHandling == 'feedback'))">
Because one or more module is uncertain about its output, you can classify the sample manually.</span>
</p>
<h2 v-on:click="manualClassification()"
v-show="(state == 'showResult') && ((mode != 'test' && mode != 'single' && classifiersUnsure) || (mode == 'single' && predictionHandling == 'feedback'))"
:class="(manualClass == '?' ? 'uncertain' : '')"
:style="{top: 'calc( 35px * (-1 + '+getClassifierAmount()+') * 75px)'}"
:title="(manualClass == '?' ? 'Click to manually classify this sample' : 'Classification result')">{{( manualClass )}}</h2>
<!--This would display an overlapped radar chart of classifier accuracies
<div v-show="(mode == 'test')"
:style="{top: 'calc( -60px + (-1 + '+getClassifierAmount()+') * 75px)'}"
id="testOuputChart"></div>-->
</div><!-- /output -->
</div><!-- /main -->
</div><!-- /container -->
<footer>
<div class="container">
<div class="row">
<div class="col-xs-4"><h4>Submission for the <a href="http://informaticup.gi.de/" target="_blank">InformatiCup 2017</a></h4></div>
<div class="col-xs-2">
<h4 class="member" v-on:click="showTeam('stefan')">Team Augsburg</h4>
</div>
<div class="col-xs-6">
<div class="col-xs-6 member" v-on:click="showTeam('andreas')">Andreas Grafberger</div>
<div class="col-xs-6 member" v-on:click="showTeam('martin')">Martin Keßler</div>
<div class="col-xs-6 member" v-on:click="showTeam('michael')">Michael Leimstädtner</div>
<div class="col-xs-6 member" v-on:click="showTeam('stefan')">Stefan Grafberger</div>
</div>
</div>
</div>
</footer>
</div><!-- /container-fluid -->
<script type="text/javascript" src="scripts/lodash.min.js"></script>
<script type="text/javascript" src="scripts/showdown.min.js"></script>
<script type="text/javascript" src="scripts/vue.min.js"></script>
<script type="text/javascript" src="scripts/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="scripts/d3.v3.min.js"></script>
<script type="text/javascript" src="scripts/radarChart.js"></script>
<script type="text/javascript" src="scripts/frontend.js"></script>
</body>
</html> | {
"content_hash": "b53f485e81fd7156929cb6da1cdbd3e5",
"timestamp": "",
"source": "github",
"line_count": 550,
"max_line_length": 321,
"avg_line_length": 58.29090909090909,
"alnum_prop": 0.5167810355583281,
"repo_name": "Ichaelus/Github-Classifier",
"id": "63e8ba85bba23f5cc0e9d5910b089df7f60e7fee",
"size": "32067",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Application/Views/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "42"
},
{
"name": "Batchfile",
"bytes": "15"
},
{
"name": "CSS",
"bytes": "25708"
},
{
"name": "HTML",
"bytes": "43445"
},
{
"name": "JavaScript",
"bytes": "81211"
},
{
"name": "Jupyter Notebook",
"bytes": "45664"
},
{
"name": "PHP",
"bytes": "39760"
},
{
"name": "Python",
"bytes": "244259"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.igormaznitsa</groupId>
<artifactId>mvn-golang</artifactId>
<version>2.1.3-SNAPSHOT</version>
<packaging>pom</packaging>
<name>mvn-golang</name>
<description>Maven plugin to wrap main GoLang commands and provide way to build GoLang applications with Apache Maven build tool.</description>
<url>https://github.com/raydac/mvn-golang</url>
<inceptionYear>2016</inceptionYear>
<properties>
<main-project-version>2.1.3-SNAPSHOT</main-project-version>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
<meta.version>1.1.2</meta.version>
<uber.pom>1.0.1</uber.pom>
<mvn.version>3.0</mvn.version>
</properties>
<issueManagement>
<system>GitHub Issues</system>
<url>https://github.com/raydac/mvn-golang/issues</url>
</issueManagement>
<prerequisites>
<maven>${mvn.version}</maven>
</prerequisites>
<developers>
<developer>
<id>raydac</id>
<name>Igor Maznitsa</name>
<email>rrg4400@gmail.com</email>
<url>http://www.igormaznitsa.com</url>
<timezone>+3</timezone>
<roles>
<role>developer</role>
</roles>
</developer>
</developers>
<scm>
<url>https://github.com/raydac/mvn-golang</url>
<connection>scm:git:git://github.com/raydac/mvn-golang.git</connection>
<developerConnection>scm:git:git@github.com:raydac/mvn-golang.git</developerConnection>
</scm>
<organization>
<name>Igor Maznitsa</name>
<url>http://www.igormaznitsa.com</url>
</organization>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.5</version>
<configuration>
<detail>true</detail>
<aggregate>true</aggregate>
<format>html</format>
<verbose>true</verbose>
<printFailingErrors>true</printFailingErrors>
</configuration>
</plugin>
</plugins>
</reporting>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>localrepo</id>
<distributionManagement>
<snapshotRepository>
<id>local-oss-git-repo</id>
<url>file:///home/igorm/Projects_PET/iam-oss-mvn-snapshots</url>
</snapshotRepository>
</distributionManagement>
</profile>
<profile>
<id>plugin</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<modules>
<module>mvn-golang-wrapper</module>
<module>mvn-golang-hello</module>
</modules>
</profile>
<profile>
<id>examples</id>
<modules>
<module>mvn-golang-examples</module>
</modules>
</profile>
<profile>
<id>coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.5.201505241946</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.14</version>
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java16-sun</artifactId>
<version>1.10</version>
</signature>
</configuration>
<executions>
<execution>
<id>animal-sniffer</id>
<phase>test</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project> | {
"content_hash": "7db021b2dd4aaadd1ea148bc97c757df",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 204,
"avg_line_length": 29.713513513513515,
"alnum_prop": 0.5914134982717846,
"repo_name": "dantran/mvn-golang",
"id": "d55da893abb4fc59a2a67315fc13db0a456c3e73",
"size": "5497",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "7785"
},
{
"name": "Java",
"bytes": "127272"
}
],
"symlink_target": ""
} |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("01_PrintNumbers")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("01_PrintNumbers")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("21e9e5b7-0ab7-4cc2-bf07-eec2eb9b6738")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| {
"content_hash": "a2170a535534023b6432d356d82565e1",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 84,
"avg_line_length": 38.97222222222222,
"alnum_prop": 0.744832501781896,
"repo_name": "Etonchev/Telerik_CSharpPart1",
"id": "c048118f23baf9065b33fb058cb5884298cca708",
"size": "1406",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "06Loops/01_PrintNumbers/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "160159"
}
],
"symlink_target": ""
} |
{% extends "partials/layout.html" %}
{% block headerAdditionals %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.2.0/min/dropzone.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.2.0/min/dropzone.min.css"/>
{% endblock %}
{% block body %}
<div class="ui container">
<div class="ui segment">
<ol>
<li>Download and install sketchup.
<ul>
<li><a href="http://www.sketchup.com/download/sketchup-make/windows/thank-you">Windows</a></li>
<li><a href="http://www.sketchup.com/download/sketchup-make/mac/thank-you">Mac</a></li>
</ul>
<li>Install the Sketchup STL plugin</li>
<ul>
<li>Window -> Extension Warehouse</li>
<li>Sketchup STL</li>
</ul>
<li>Download a file below</li>
<li>Open the file in sketchup</li>
<li>Choose the architecture millimeters setting</li>
<li>Model your file</li>
<li>File -> Export STL...</li>
<li>Rename your file to something unique</li>
<li>Upload below</li>
</ol>
<h2>Choose one of these templates</h2>
<div class="ui three column grid">
<div class="column">
<a href="/files/hexagonal.skp">
<h3>Hexagonal</h3>
<img src="/static/img/hexagonal.png" class="ui small image">
</a>
</div>
<div class="column">
<a href="/files/square.skp">
<h3>Cube</h3>
<img src="/static/img/cube.png" class="ui small image">
</a>
</div>
<div class="column">
<a href="/files/cylinder.skp">
<h3>Cylinder</h3>
<img src="/static/img/Cylinder.png" class="ui small image">
</a>
</div>
</div>
</div>
<div class="ui segment">
<h2>Upload here when you're done</h2>
<form action="/upload" method="post" enctype="multipart/form-data" class="dropzone">
<div class="fallback">
<p>Error, loading upload form.</p>
</div>
</form>
</div>
</div>
{% endblock %}
| {
"content_hash": "88cdbffea7a398afd4f82544273b4e21",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 115,
"avg_line_length": 35.78787878787879,
"alnum_prop": 0.497883149872989,
"repo_name": "timlyo/timlyo.github.io",
"id": "54a3614e6c19d4354207aa99eb30a6d499109dee",
"size": "2362",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "templates/woggles.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "23609"
},
{
"name": "HTML",
"bytes": "8996"
},
{
"name": "JavaScript",
"bytes": "38950"
},
{
"name": "Makefile",
"bytes": "471"
},
{
"name": "Python",
"bytes": "5737"
}
],
"symlink_target": ""
} |
//
// SPDY.h
// SPDY library
//
// Created by Jim Morrison on 1/31/12.
// Copyright 2012 Twist Inc.
// 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 <Foundation/Foundation.h>
#import <SystemConfiguration/SystemConfiguration.h>
@class SpdySession;
typedef enum {
kSpdyConnectStateNotConnected,
kSpdyConnectStateConnecting,
kSpdyConnectStateSslHandshake,
kSpdyConnectStateConnected,
kSpdyConnectStateGoAwaySubmitted,
kSpdyConnectStateGoAwayReceived,
kSpdyConnectStateError,
kSpdyConnectStateStreamNotFound,
kSpdyConnectStateHostNotFound
} SpdyConnectState;
typedef enum {
kSpdyNetworkStatusNotReachable = 0,
#if TARGET_OS_IPHONE
kSpdyNetworkStatusReachableViaWWAN,
kSpdyNetworkStatusReachableViaWiFi,
#else
kSpdyNetworkStatusReachable, /* no wifi or wwan reachability info on macosx */
#endif
kSpdyNetworkStatusStreamNotFound,
kSpdyNetworkStatusHostNotFound
} SpdyNetworkStatus;
typedef enum {
SpdyRadioAccessTechnologyNone = 0,
SpdyRadioAccessTechnologyUnknown,
SpdyRadioAccessTechnologyGPRS,
SpdyRadioAccessTechnologyEdge,
SpdyRadioAccessTechnologyWCDMA,
SpdyRadioAccessTechnologyHSDPA,
SpdyRadioAccessTechnologyHSUPA,
SpdyRadioAccessTechnologyCDMA1x,
SpdyRadioAccessTechnologyCDMAEVDORev0,
SpdyRadioAccessTechnologyCDMAEVDORevA,
SpdyRadioAccessTechnologyCDMAEVDORevB,
SpdyRadioAccessTechnologyeHRPD,
SpdyRadioAccessTechnologyLTE
} SpdyRadioAccessTechnology;
@class SpdyCallback;
@class SpdyHTTPResponse;
typedef void (^SpdySuccessCallback)(SpdyHTTPResponse*,NSData*);
typedef void (^SpdyErrorCallback)(NSError*);
typedef void (^SpdyVoidCallback)();
typedef void (^SpdyIntCallback)(int);
typedef void (^SpdyBoolCallback)(BOOL);
typedef void (^SpdyNetworkStatusCallback)(SpdyNetworkStatus);
typedef void (^SpdyConnectStateCallback)(NSString *, SpdyConnectState);
typedef void (^SpdyRadioAccessTechnologyCallback)(SpdyRadioAccessTechnology);
typedef void (^SpdyReachabilityCallback)(SCNetworkReachabilityFlags);
typedef void (^SpdyTimeIntervalCallback)(NSTimeInterval);
// Returns a CFReadStream. If requestBody is non-NULL the request method in requestHeaders must
// support a message body and the requestBody will override the body that may already be in requestHeaders. If
// the request method in requestHeaders expects a body and requestBody is NULL then the body from requestHeaders
// will be used.
CFReadStreamRef SpdyCreateSpdyReadStream(CFAllocatorRef alloc, CFHTTPMessageRef requestHeaders, CFReadStreamRef requestBody);
extern NSString *kSpdyErrorDomain;
extern NSString *kOpenSSLErrorDomain;
extern NSString *kSpdyTimeoutHeader;
enum SpdyErrors {
kSpdyConnectionOk = 0,
kSpdyConnectionFailed = 1,
kSpdyRequestCancelled = 2,
kSpdyConnectionNotSpdy = 3,
kSpdyInvalidResponseHeaders = 4,
kSpdyHttpSchemeNotSupported = 5,
kSpdyStreamClosedWithNoRepsonseHeaders = 6,
kSpdyVoipRequestedButFailed = 7,
kSpdyDnsError = 8,
kSpdyConnectTimeout = 9,
};
@protocol SpdyRequestIdentifier <NSObject>
- (NSURL *)url;
- (void)close;
@end
@protocol SpdyUrlConnectionCallback <NSObject>
- (BOOL)shouldUseSpdyForUrl:(NSURL *)url;
@end
#ifdef CONF_Debug
// The SpdyLogger protocol is used to log from the spdy library. The default SpdyLogger prints out ugly logs with NSLog. You'll probably
// want to override the default.
@protocol SpdyLogger
- (void)writeSpdyLog:(NSString *)message file:(const char *)file line:(int)line;
@end
#endif
@interface SPDY : NSObject
+ (SPDY *)sharedSPDY;
@property (nonatomic,copy) SpdyVoidCallback needToStartBackgroundTaskBlock;
@property (nonatomic,copy) SpdyVoidCallback finishedWithBackgroundTaskBlock;
// Call registerForNSURLConnection to enable spdy when using NSURLConnection. SPDY responses can be identified (in iOS 5.0+) by looking for
// the @"protocol-was: spdy" header with the value @"YES". "protocol-was: spdy" is not a valid http header, thus it is safe to add it.
// WARNING: Using NSURLConnection means that upload progress can not be monitored. This is because of a lack of an API in URLProtocolClient.
- (void)registerForNSURLConnection;
// Like registerForNSURLConnection but callback is called for each request. Callback is retained.
- (void)registerForNSURLConnectionWithCallback:(id <SpdyUrlConnectionCallback>)callback;
- (BOOL)isSpdyRegistered;
- (BOOL)isSpdyRegisteredForUrl:(NSURL *)url;
- (void)unregisterForNSURLConnection;
- (int)pingWithCallback:(void (^)(BOOL success))callback;
- (void)pingUrlString:(NSString*)url callback:(void (^)(BOOL success))callback;
- (void)pingRequest:(NSURLRequest*)request callback:(void (^)(BOOL success))callback;
- (void)teardown:(NSString*)url;
- (void)teardownForRequest:(NSURLRequest*)url;
+ (SpdyNetworkStatus)networkStatusForReachabilityFlags:(SCNetworkReachabilityFlags)flags;
- (SpdyNetworkStatus)networkStatusForUrlString:(NSString*)url;
- (SpdyNetworkStatus)networkStatusForRequest:(NSURLRequest*)request;
- (SpdyConnectState)connectStateForUrlString:(NSString*)url;
- (SpdyConnectState)connectStateForRequest:(NSURLRequest*)request;
// A reference to delegate is kept until the stream is closed. The caller will get an onError or onStreamClose before the stream is closed.
- (SpdySession*)fetch:(NSString *)path delegate:(SpdyCallback *)delegate;
- (SpdySession*)fetch:(NSString *)path delegate:(SpdyCallback *)delegate voip:(BOOL)voip;
- (SpdySession*)fetchFromMessage:(CFHTTPMessageRef)request delegate:(SpdyCallback *)delegate;
- (SpdySession*)fetchFromRequest:(NSURLRequest *)request delegate:(SpdyCallback *)delegate;
- (SpdySession*)fetchFromRequest:(NSURLRequest *)request delegate:(SpdyCallback *)delegate voip:(BOOL)voip;
// Cancels all active requests and closes all connections. Returns the number of requests that were cancelled. Ideally this should be called when all requests have already been canceled.
- (NSInteger)closeAllSessions;
#ifdef CONF_Debug
@property (strong) NSObject<SpdyLogger> *logger;
#endif
// Like closeAllSessions above, but only cancels and closes for url.host:url.port.
- (NSInteger)closeAllSessionsForURL:(NSURL *)url;
+(NSString*)networkStatusString:(SpdyNetworkStatus)status;
+(NSString*)radioAccessString:(SpdyRadioAccessTechnology)status;
+(NSString*)connectionStateString:(SpdyConnectState)state;
@end
#ifdef CONF_Debug
/* logging only on the Debug configuration */
#define SPDY_LOG(fmt, ...) do { \
NSString * msg = [[NSString alloc] initWithFormat:fmt, ##__VA_ARGS__]; \
[[SPDY sharedSPDY].logger writeSpdyLog:msg file:__FILE__ line:__LINE__]; \
if (0) NSLog(fmt, ## __VA_ARGS__); \
} while (0);
#define SPDY_DEBUG_LOG(fmt, ...) do { \
NSString * msg = [[NSString alloc] initWithFormat:fmt, ##__VA_ARGS__]; \
[[SPDY sharedSPDY].logger writeSpdyLog:msg file:__FILE__ line:__LINE__];\
if (0) NSLog(fmt, ## __VA_ARGS__); \
} while (0);
#else
/* no logging at all on release builds */
#define SPDY_LOG(fmt, ...) { }
#define SPDY_DEBUG_LOG(fmt, ...) { }
#endif
#define SPDY_SESSION_STATE_KEY(session) [[NSString alloc] initWithFormat:@"%p", session]
| {
"content_hash": "038f1059556df8e1de87cb99eee271ec",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 188,
"avg_line_length": 37.15196078431372,
"alnum_prop": 0.7799181950125347,
"repo_name": "locationlabs/SPDY-for-iPhone",
"id": "7da073966e3a1b4b786304bc252361d2c30967db",
"size": "7579",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SPDY/SPDY/SPDY.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "25"
},
{
"name": "Objective-C",
"bytes": "231921"
},
{
"name": "Python",
"bytes": "1300"
}
],
"symlink_target": ""
} |
"use strict";
var Stream = require('stream');
/**
* A streaming, pipe-able interface for the protocol parser.
*
* @constructor
* @param {Protocol} protocol parser
* @param {Number} limit buffer limit
* @api public
*/
function ProtocolStream (protocol, limit) {
this.queue = '';
this.limit = limit;
this.protocol = protocol;
this.target = 0;
this.destroyed = false;
this.writable = true;
this.readable = false;
Stream.call(this);
}
ProtocolStream.prototype = new Stream;
ProtocolStream.prototype.constructor = ProtocolStream;
/**
* Receive data from the source.
*
* @param {Buffer} chunk
* @api private
*/
ProtocolStream.prototype.write = function write (chunk) {
this.queue += chunk.toString('UTF-8');
// parse the queue, so we might reduce the length of the queue because it
// would be successful to parse a packet
this.parse();
// check we have enough data to parse the queue
if (Buffer.byteLength(this.queue) >= this.limit) {
// now we have a decision to make here.. are we going to call it a day, or
// hope for little bit more data and parse the whole packet..
var difference = this.target - this.queue.length
, average = this.target + this.queue.length
, percentage = (difference/average) * 100;
// it can buffer 5 percent more if needed to parse this packet
if (~~percentage <= 5) return true;
this.destroy();
return false;
}
return true;
};
/**
* Check if we can dispatch a chunk of data our protocol decoder.
*
* @api private
*/
ProtocolStream.scan = /^\d+#\d+?#(\d+)/;
ProtocolStream.prototype.parse = function parse () {
var self = this
, match
, packet;
// if we don't have a buffer target, we need to parse it out of our queued
// data. We want to store the target if we don't have enough, so we don't have
// keep scanning every time.
if (!this.target) {
match = this.queue.match(ProtocolStream.scan);
if (!match || !match.length) return false; // not enough data
this.target = +match[1];
}
// not enough data buffered
if (this.queue.length < this.target) return false;
// extract, and decode it
packet = this.queue.substring(0, this.target);
this.queue = this.queue.substring(this.target);
this.target = 0;
this.protocol.decode(packet);
// check if we have more data to parse because a single #write could have send
// more than one data packet
if (this.queue.length) {
process.nextTick(function next () {
// if we don't have anything to parse, and we have ended, we should
// destroy our self
if (!self.parse() && !self.writable) self.destroy();
});
} else if (!this.writable) {
this.destroy();
}
return true;
};
/**
* Completely destroy all the things.
*
* @api public
*/
ProtocolStream.prototype.destroy = function destroy (exception) {
if (this.destroyed) return;
this.queue = '';
this.destroyed = true;
var self = this;
process.nextTick(function closing () {
if (exception) self.emit('error', exception);
self.emit('close', !!exception);
});
};
/**
* Safely kill the stream.
*
* @api public
*/
ProtocolStream.prototype.destroySoon = ProtocolStream.prototype.destroy;
/**
* End the stream
*
* @param {Buffer} chunk
* @api private
*/
ProtocolStream.prototype.end = function end (chunk) {
if (chunk) {
// if the write was successful we can do a destroy, so we don't emit the
// `close` event twice. In addition to this also check if we have something
// in our queue, as it could be that we do more parsing
if (this.write(chunk) && !this.queue.length) {
this.destroy();
}
} else {
// nothing to write, nothing to parse, save to close <3
this.destroy();
}
this.writable = false;
// the ProtocolStream#destroy emits a `close` event in the nextTick, so we can
// safely call that before we emit `close` so end event comes before close as
// required (and done by other Node.js streams)
this.emit('end');
return true;
};
/**
* Expose the stream.
*/
module.exports = ProtocolStream;
| {
"content_hash": "b83ef6fb160e854dea09d89a77c6c64f",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 80,
"avg_line_length": 23.68208092485549,
"alnum_prop": 0.658774713204784,
"repo_name": "observing/red",
"id": "56a9ecbcc3a28b49e9dd6f5e607d2430f469204c",
"size": "4199",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/protocol/protocolstream.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "121584"
},
{
"name": "Makefile",
"bytes": "867"
}
],
"symlink_target": ""
} |
passes-rest-samples/python
==========================
This sample demonstrates integration of the basic components of the Google Pay API for Passes. Review the [quickstart guide](https://developers.google.com/pay/save/samples/quickstart-python) to run the sample.
This sample showcases several aspects of the API
* Defining Class and Object resource definitions
* Insertion of classes and objects via Google Pay API for Passes REST API
* Signing a JSON Web Token that is used to generate save links or used in JS Web button
## Defining Class and Object resource definitions
The code for defining classes and objects can be found in the `resourceDefinitions.py`.
## Insertion of Classes and Objects
Make server to server calls with the Google Pay API for Passes REST API. Authorized OAuth2.0 calls are in `restMethods.py`. Preparation of the data and calling REST API insert amd get methods are in `services.py`.
## Signing JSON Web Token (JWT)
For users to save a Google pass, they need to click a save link or save button. To determine what pass is saved, the data is stored in a JSON Web Token (JWT). To make sure the JWT is valid, it is signed using RSA-SHA256. The signing key is the OAuth service account generated key. The JWT format and signing method is in `jwt.py`.
To see a use this quickstart to generate a signed jwt, in your terminal/console:
1. Follow steps 1 and 2 in [Get Access to REST API](https://developers.google.com/pay/passes/guides/get-started/basic-setup/get-access-to-rest-api) to create a Google Pay API for Passes account and tie your service account to it.
1. Set up [virtualenv](https://virtualenv.pypa.io/en/stable/) to create an isolated python environment. See [installing and using virtualenv](https://cloud.google.com/python/setup#installing_and_using_virtualenv)
1. Make sure you've "activated" the virtualenv install dependencies
1. `pip install -r requirements.txt`
1. In the directory you made a virtualenv for, place thequickstart files.
1. Edit the following string values in the file `config.py`:
1. SERVICE_ACCOUNT_EMAIL_ADDRESS: the value of the email in your service account key file.
1. SERVICE_ACCOUNT_FILE: the filename of your service account key.
1. ISSUER_ID: your Google Pay API for Passes Issuer Id.
1. Run the quickstart: `python main.py`.
1. Choose your pass type to demo in the quickstart.
Read the output, you should see:
1. The response of insertion of the Class.
1. The response of insertion of the Object.
1. Variations of a signed JWT and link. For preparing a JWT, check `services.py`.
## Changing the design and information on the pass.
Below is a procedure for modifying these sample passes:
1. Edit the definition for the pass in `resourceDefinitions.py`
1. Check design and API reference according to the specific pass type:
* Boarding Passes - [Design](https://developers.google.com/pay/passes/guides/pass-verticals/boarding-passes/design)
| [Class](https://developers.google.com/pay/passes/reference/v1/flightclass/insert)
| [Object](https://developers.google.com/pay/passes/reference/v1/flightobject/insert)
* Event Tickets - [Design](https://developers.google.com/pay/passes/guides/pass-verticals/event-tickets/design)
| [Class](https://developers.google.com/pay/passes/reference/v1/eventticketclass/insert)
| [Object](https://developers.google.com/pay/passes/reference/v1/eventticketobject/insert)
* Gift Cards - [Design](https://developers.google.com/pay/passes/guides/pass-verticals/gift-cards/design)
| [Class](https://developers.google.com/pay/passes/reference/v1/giftcardclass/insert)
| [Object](https://developers.google.com/pay/passes/reference/v1/giftcardobject/insert)
* Loyalty - [Design](https://developers.google.com/pay/passes/guides/pass-verticals/loyalty/design)
| [Class](https://developers.google.com/pay/passes/reference/v1/loyaltyclass/insert)
| [Object](https://developers.google.com/pay/passes/reference/v1/loyaltyobject/insert)
* Offers - [Design](https://developers.google.com/pay/passes/guides/pass-verticals/boarding-passes/design)
| [Class](https://developers.google.com/pay/passes/reference/v1/offerclass/insert)
| [Object](https://developers.google.com/pay/passes/reference/v1/offerobject/insert)
* Transit - [Design](https://developers.google.com/pay/passes/guides/pass-verticals/transit-passes/design)
| [Class](https://developers.google.com/pay/passes/reference/v1/transitclass/insert)
| [Object](https://developers.google.com/pay/passes/reference/v1/transitobject/insert)
1. Run the quickstart: `python main.py`.
1. Choose your pass type to demo in the program.
## Updating a Pass
In this quick start application, every demo run will have a unique class and object. If you want to change data of an already inserted class or object, as noted in our [use cases](https://developers.google.com/pay/passes/guides/get-started/implementing-the-api/engage-through-google-pay), implement the update or patch methods. Check reference API [summary](https://developers.google.com/pay/passes/rest).
| {
"content_hash": "b050a214459eb27ea20fc3b4aaed41a4",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 405,
"avg_line_length": 77.72307692307692,
"alnum_prop": 0.7717735550277118,
"repo_name": "google-pay/passes-rest-samples",
"id": "191ea26957d394820d7f87ba1e3920b485328726",
"size": "5052",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "python/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "648522"
},
{
"name": "Java",
"bytes": "142216"
},
{
"name": "PHP",
"bytes": "435285"
},
{
"name": "Python",
"bytes": "72181"
}
],
"symlink_target": ""
} |
<amount><bottle something="yes" .label="oops" data-something="yup">'</bottle></amount> | {
"content_hash": "dbb4efdeceee1769cfccf46d77910aa4",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 86,
"avg_line_length": 86,
"alnum_prop": 0.7093023255813954,
"repo_name": "netgusto/upndown",
"id": "1b794c094e0fc6276e11f6e1f3932f2878d1e9fa",
"size": "86",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "test/fixtures/html/attributes.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "2999"
},
{
"name": "JavaScript",
"bytes": "308238"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<lang value="FR">
<item id="Game not found">Cette partie n'existe pas</item>
<item id="The game has been created successfully.">La partie a été créé avec succès</item>
<item id="Add a game">Ajouter une partie</item>
<item id="Enemy's side">Side de l'ennemi</item>
<item id="Target">Cible</item>
<item id="Players">Joueurs</item>
<item id="Player %s name">Nom du joueur %s</item>
<item id="Player %s hero">Héro du joueur %s</item>
<item id="Submit">Envoyer</item>
<item id="Manage a game">Gérer une partie</item>
<item id="Safari timer">Durée de safari</item>
<item id="Start">Démarrer</item>
<item id="End">Arrêter</item>
<item id="Games">Parties</item>
<item id="Match date">Date de la partie</item>
<item id="Edit">Modifier</item>
<item id="Delete">Supprimer</item>
<item id="No games in database.">Aucune partie en base de donnée</item>
<item id="Games list">Liste des parties</item>
</lang>
| {
"content_hash": "ec745e622baf36f2c0a1650ccbbc3b30",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 92,
"avg_line_length": 44.18181818181818,
"alnum_prop": 0.6728395061728395,
"repo_name": "ThibaultVlacich/FroggedTV-CRS",
"id": "79157ab251f659fecee6faf53b78d4d40253a320",
"size": "983",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "apps/crs/admin/lang/fr.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "477"
},
{
"name": "CSS",
"bytes": "166734"
},
{
"name": "HTML",
"bytes": "381782"
},
{
"name": "JavaScript",
"bytes": "269118"
},
{
"name": "PHP",
"bytes": "1085336"
}
],
"symlink_target": ""
} |
<?php
namespace Cowtent\AccountBundle\Util;
class Canonicalizer implements CanonicalizerInterface
{
public function canonicalize($string)
{
return mb_convert_case($string, MB_CASE_LOWER, mb_detect_encoding($string));
}
}
| {
"content_hash": "760243827e356d47372a63d2155693ad",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 84,
"avg_line_length": 22.09090909090909,
"alnum_prop": 0.7242798353909465,
"repo_name": "smalot/cowtent-application",
"id": "9828b3d052876ac54c4ecc9607641f21bda0e77b",
"size": "243",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Cowtent/AccountBundle/Util/Canonicalizer.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "3606"
},
{
"name": "HTML",
"bytes": "14425"
},
{
"name": "PHP",
"bytes": "121197"
}
],
"symlink_target": ""
} |
[](https://travis-ci.org/daveshanley/gobeepme) [](http://godoc.org/github.com/daveshanley/gobeepme)
A simple console app/library/service to allow you to quickly ping and locate your iOS device.
## Update (October 2021)
This code is pretty old, the UI code is practically fossilized. **It does still work however**. Apple has not changed
the API, gobeepme will still beep you!
## What exactly is it though?
If you're like me, you are always putting your iPhone face down on a couch or table somewhere and forgetting where you put it.
Especially if it's face-down on a dark surface (and you have a dark colored iPhone). It always results
in having to login to iCloud on my laptop and sending a sound to my iPhone. This is annoying - so I wanted something
simpler. I wanted to simply ask my [Amazon Echo](http://amazon.com/echo) where my phone was and simply have it
beep. That would require some kind of hosted service, so I built this!
## What does it do?
### Well it runs in 2 different ways...
* Runs as an interactive console application that you can step through.
* Runs as a http service over TLS with very simple JSON API.
There is a simple UI available if you run `make ui`. It's old, but it still works well.
## Building
Check out the code.
```console
git clone https://github.com/daveshanley/gobeepme.git
```
The project is now using go modules, so just type:
```console
go build gobeepme.go
```
Then you should be able to run `./gobeepme`
## Running gobeepme
### Console experience
To run the console, simply run the `gobeepme` executable from a console. You will be guided from there. You can also supply
a number of flags to avoid typing them in. The flags are:
Usage of ./gobeepme:
-msg string
Message to be sent to iOS device (default "Beep Beep!")
-name string
Name of the iOS device you want to beep
-user string
Your iCloud ID / AppleID (normally an email)
-pass string
Pretty sure this is self explanatory
-port int
(service only) Port to run https service on (default 9443)
-service
Run as https service
-cert string
(service only) certificate to use
-key string
(service only) private server key
### Building the UI
The UI is using some old tech, when you build NPM will warn you about stuff, but it won't stop things from working.
```console
make ui
```
NPM will kick in and will be done after a few seconds. The UI will be compiled and ready to serve by the service.
### Service experience
To run the service you will need an SSL cert/private key. If you don't have this already (most likely you don't) then you can
generate a self signed cert using openssl by issuing the following command.
```bash
openssl req -nodes -new -x509 -keyout server.key -out server.cert
```
Or if you want to run gobeep me as a full stateless service in the cloud, then you will need an actual valid certificate. You can either pay
for one of these, or you can use [Let's Encrypt](https://letsencrypt.org/) for completely free and valid certs (with a short lifetime).
### Starting the service
Simply pass in the `-service` flag, your key and your cert location, and an optional port (defaults to 9443)
```bash
./gobeepme -service -port 8888 -key server.key -cert server.cert
```
You should then see a message stating:
```bash
Starting beepme as a service on port 8888
```
You can then hit `https://localhost:8888` in your web browser (providing you built the UI) and see it in action.
# Connect to your Amazon Echo
Pretty simple really. The Echo supports [IFTTT](https://ifttt.com/) (If This The That). You simply need to add the IFTTT channel to your Echo and use a simple recipe
to trigger an IFTTT Maker event when you speak a trigger word. To make this simple, I have created a *[gobeepme sample recipe](https://ifttt.com/recipes/378582-gobeepme-sample)*
it's the same one that I also use daily.
The service request for a beep is dead simple.
```json
{"apple_id": "your_id","password":"your_passwd", "name":"device_name","message":"Beep Beep!"}
```
The service endpoint is `/beep`, requires the data to be a POST and the content-type needs to be `application/json`
| {
"content_hash": "1648b7292e63de58b658a7c698b12b96",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 236,
"avg_line_length": 36.766666666666666,
"alnum_prop": 0.720081595648232,
"repo_name": "daveshanley/gobeepme",
"id": "0ef8892071a2cb852055a528aa2b66979095064f",
"size": "4424",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "11363"
},
{
"name": "Go",
"bytes": "22484"
},
{
"name": "HTML",
"bytes": "6828"
},
{
"name": "Makefile",
"bytes": "686"
},
{
"name": "TypeScript",
"bytes": "17915"
}
],
"symlink_target": ""
} |
var Transform = require('stream').Transform,
util = require('util');
if (!Transform) {
Transform = require('readable-stream').Transform;
}
function LMSStream(options) {
var defaults = {
highWaterMark: 32,
encoding: 'utf-8',
objectMode: false,
decodeStrings: true,
delimiter: '\t',
newline: '\n',
quote: '\"',
empty: '',
hastitle: true,
title: null
};
options = options || {};
Object.keys(defaults).forEach(function (key) {
options[key] = options[key] || defaults[key];
});
Transform.call(this, options);
this.delimiter = options.delimiter;
this.newline = options.newline;
this.quote = options.quote;
this.empty = options.empty;
this.hastitle = options.hastitle;
this.title = options.title;
// state
this.line = [];
this.jsonline = {};
this.quoted = false;
this.field = '';
this.linenumber = 0;
}
util.inherits(LMSStream, Transform);
LMSStream.prototype._transform = function _transform(chunk, encoding, done) {
var chunkstr = chunk.toString();
try {
this._parse(chunkstr);
done();
} catch (e) {
done(e);
}
};
LMSStream.prototype._parse = function _parse(data) {
var c = null,
i = 0,
j = data.length;
for (i = 0; i < j; i += 1) {
c = data.charAt(i);
if (this._hasquote(c, data.charAt(i + 1)) || this._endline(c) || this._endfield(c)) {
continue;
}
this.field += c;
}
};
LMSStream.prototype._hasquote = function _hasquote(c, cn) {
if (c === this.quote && cn !== this.quote) {
this.quoted = !this.quoted;
return true;
}
return false;
};
LMSStream.prototype._endfield = function _endfield(c) {
if (!this.quoted && c === this.delimiter) {
if (this.field === '') {
this.field = this.empty;
}
this.line.push(this.field);
this.field = '';
return true;
}
return false;
};
LMSStream.prototype._endline = function _endline(c) {
if (!this.quoted && this.newline.indexOf(c) >= 0) {
this.line.push(this.field);
this._send();
this.linenumber += 1;
this._reset();
return true;
}
return false;
};
LMSStream.prototype._reset = function _reset() {
// reset
this.field = '';
this.line = [];
this.jsonline = {};
this.quoted = false;
};
LMSStream.prototype._send = function _send() {
var send = Boolean((this.hastitle && this.linenumber) || !this.hastitle);
if (!this.title) {
this._maketitle();
}
if (!send) {
return false;
}
this._tojson();
this.push(JSON.stringify(this.jsonline));
};
LMSStream.prototype._tojson = function _tojson() {
var self = this;
this.title.forEach(function (value, index) {
self.jsonline[value] = Number(self.line[index]);
});
};
LMSStream.prototype._maketitle = function _maketitle() {
if (this.title) {
return false;
}
if (!this.hastitle) {
this._makedefaulttitle();
return false;
}
this.title = this.line.map(function (value) {
return value.toLowerCase().replace(' ', '-').replace('\r', '');
});
};
LMSStream.prototype._makedefaulttitle = function _makedefaulttitle() {
var len = this.field.length;
if (!this.title) {
this.title = [];
}
while (this.title.length < len) {
this.title.push('col-' + this.title.length);
}
};
LMSStream.prototype.end = function end(buf) {
Transform.prototype.end.call(this, buf);
};
module.exports = function (options) {
return new LMSStream(options);
};
module.exports.LMSStream = LMSStream;
| {
"content_hash": "ee8628a7d314bc50848e2fb9aab4e195",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 89,
"avg_line_length": 22.58823529411765,
"alnum_prop": 0.6137152777777778,
"repo_name": "joaodubas/growth",
"id": "d3ae0ee99c54b150dd2328544f33a383f694b72c",
"size": "3456",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/data/stream.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "64148"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 1988-2014 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below). A copy of the license is included in the section entitled
"GNU Free Documentation License".
(a) The FSF's Front-Cover Text is:
A GNU Manual
(b) The FSF's Back-Cover Text is:
You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development. -->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>GNU Compiler Collection (GCC) Internals: Working with declarations</title>
<meta name="description" content="GNU Compiler Collection (GCC) Internals: Working with declarations">
<meta name="keywords" content="GNU Compiler Collection (GCC) Internals: Working with declarations">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Declarations.html#Declarations" rel="up" title="Declarations">
<link href="Internal-structure.html#Internal-structure" rel="next" title="Internal structure">
<link href="Declarations.html#Declarations" rel="prev" title="Declarations">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Working-with-declarations"></a>
<div class="header">
<p>
Next: <a href="Internal-structure.html#Internal-structure" accesskey="n" rel="next">Internal structure</a>, Up: <a href="Declarations.html#Declarations" accesskey="u" rel="up">Declarations</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Working-with-declarations-1"></a>
<h4 class="subsection">10.4.1 Working with declarations</h4>
<p>Some macros can be used with any kind of declaration. These include:
</p><dl compact="compact">
<dt><code>DECL_NAME</code>
<a name="index-DECL_005fNAME"></a>
</dt>
<dd><p>This macro returns an <code>IDENTIFIER_NODE</code> giving the name of the
entity.
</p>
</dd>
<dt><code>TREE_TYPE</code>
<a name="index-TREE_005fTYPE-2"></a>
</dt>
<dd><p>This macro returns the type of the entity declared.
</p>
</dd>
<dt><code>EXPR_FILENAME</code>
<a name="index-EXPR_005fFILENAME"></a>
</dt>
<dd><p>This macro returns the name of the file in which the entity was
declared, as a <code>char*</code>. For an entity declared implicitly by the
compiler (like <code>__builtin_memcpy</code>), this will be the string
<code>"<internal>"</code>.
</p>
</dd>
<dt><code>EXPR_LINENO</code>
<a name="index-EXPR_005fLINENO"></a>
</dt>
<dd><p>This macro returns the line number at which the entity was declared, as
an <code>int</code>.
</p>
</dd>
<dt><code>DECL_ARTIFICIAL</code>
<a name="index-DECL_005fARTIFICIAL"></a>
</dt>
<dd><p>This predicate holds if the declaration was implicitly generated by the
compiler. For example, this predicate will hold of an implicitly
declared member function, or of the <code>TYPE_DECL</code> implicitly
generated for a class type. Recall that in C++ code like:
</p><div class="smallexample">
<pre class="smallexample">struct S {};
</pre></div>
<p>is roughly equivalent to C code like:
</p><div class="smallexample">
<pre class="smallexample">struct S {};
typedef struct S S;
</pre></div>
<p>The implicitly generated <code>typedef</code> declaration is represented by a
<code>TYPE_DECL</code> for which <code>DECL_ARTIFICIAL</code> holds.
</p>
</dd>
</dl>
<p>The various kinds of declarations include:
</p><dl compact="compact">
<dt><code>LABEL_DECL</code></dt>
<dd><p>These nodes are used to represent labels in function bodies. For more
information, see <a href="Functions.html#Functions">Functions</a>. These nodes only appear in block
scopes.
</p>
</dd>
<dt><code>CONST_DECL</code></dt>
<dd><p>These nodes are used to represent enumeration constants. The value of
the constant is given by <code>DECL_INITIAL</code> which will be an
<code>INTEGER_CST</code> with the same type as the <code>TREE_TYPE</code> of the
<code>CONST_DECL</code>, i.e., an <code>ENUMERAL_TYPE</code>.
</p>
</dd>
<dt><code>RESULT_DECL</code></dt>
<dd><p>These nodes represent the value returned by a function. When a value is
assigned to a <code>RESULT_DECL</code>, that indicates that the value should
be returned, via bitwise copy, by the function. You can use
<code>DECL_SIZE</code> and <code>DECL_ALIGN</code> on a <code>RESULT_DECL</code>, just as
with a <code>VAR_DECL</code>.
</p>
</dd>
<dt><code>TYPE_DECL</code></dt>
<dd><p>These nodes represent <code>typedef</code> declarations. The <code>TREE_TYPE</code>
is the type declared to have the name given by <code>DECL_NAME</code>. In
some cases, there is no associated name.
</p>
</dd>
<dt><code>VAR_DECL</code></dt>
<dd><p>These nodes represent variables with namespace or block scope, as well
as static data members. The <code>DECL_SIZE</code> and <code>DECL_ALIGN</code> are
analogous to <code>TYPE_SIZE</code> and <code>TYPE_ALIGN</code>. For a declaration,
you should always use the <code>DECL_SIZE</code> and <code>DECL_ALIGN</code> rather
than the <code>TYPE_SIZE</code> and <code>TYPE_ALIGN</code> given by the
<code>TREE_TYPE</code>, since special attributes may have been applied to the
variable to give it a particular size and alignment. You may use the
predicates <code>DECL_THIS_STATIC</code> or <code>DECL_THIS_EXTERN</code> to test
whether the storage class specifiers <code>static</code> or <code>extern</code> were
used to declare a variable.
</p>
<p>If this variable is initialized (but does not require a constructor),
the <code>DECL_INITIAL</code> will be an expression for the initializer. The
initializer should be evaluated, and a bitwise copy into the variable
performed. If the <code>DECL_INITIAL</code> is the <code>error_mark_node</code>,
there is an initializer, but it is given by an explicit statement later
in the code; no bitwise copy is required.
</p>
<p>GCC provides an extension that allows either automatic variables, or
global variables, to be placed in particular registers. This extension
is being used for a particular <code>VAR_DECL</code> if <code>DECL_REGISTER</code>
holds for the <code>VAR_DECL</code>, and if <code>DECL_ASSEMBLER_NAME</code> is not
equal to <code>DECL_NAME</code>. In that case, <code>DECL_ASSEMBLER_NAME</code> is
the name of the register into which the variable will be placed.
</p>
</dd>
<dt><code>PARM_DECL</code></dt>
<dd><p>Used to represent a parameter to a function. Treat these nodes
similarly to <code>VAR_DECL</code> nodes. These nodes only appear in the
<code>DECL_ARGUMENTS</code> for a <code>FUNCTION_DECL</code>.
</p>
<p>The <code>DECL_ARG_TYPE</code> for a <code>PARM_DECL</code> is the type that will
actually be used when a value is passed to this function. It may be a
wider type than the <code>TREE_TYPE</code> of the parameter; for example, the
ordinary type might be <code>short</code> while the <code>DECL_ARG_TYPE</code> is
<code>int</code>.
</p>
</dd>
<dt><code>DEBUG_EXPR_DECL</code></dt>
<dd><p>Used to represent an anonymous debug-information temporary created to
hold an expression as it is optimized away, so that its value can be
referenced in debug bind statements.
</p>
</dd>
<dt><code>FIELD_DECL</code></dt>
<dd><p>These nodes represent non-static data members. The <code>DECL_SIZE</code> and
<code>DECL_ALIGN</code> behave as for <code>VAR_DECL</code> nodes.
The position of the field within the parent record is specified by a
combination of three attributes. <code>DECL_FIELD_OFFSET</code> is the position,
counting in bytes, of the <code>DECL_OFFSET_ALIGN</code>-bit sized word containing
the bit of the field closest to the beginning of the structure.
<code>DECL_FIELD_BIT_OFFSET</code> is the bit offset of the first bit of the field
within this word; this may be nonzero even for fields that are not bit-fields,
since <code>DECL_OFFSET_ALIGN</code> may be greater than the natural alignment
of the field’s type.
</p>
<p>If <code>DECL_C_BIT_FIELD</code> holds, this field is a bit-field. In a bit-field,
<code>DECL_BIT_FIELD_TYPE</code> also contains the type that was originally
specified for it, while DECL_TYPE may be a modified type with lesser precision,
according to the size of the bit field.
</p>
</dd>
<dt><code>NAMESPACE_DECL</code></dt>
<dd><p>Namespaces provide a name hierarchy for other declarations. They
appear in the <code>DECL_CONTEXT</code> of other <code>_DECL</code> nodes.
</p>
</dd>
</dl>
<hr>
<div class="header">
<p>
Next: <a href="Internal-structure.html#Internal-structure" accesskey="n" rel="next">Internal structure</a>, Up: <a href="Declarations.html#Declarations" accesskey="u" rel="up">Declarations</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
| {
"content_hash": "2fa57a90b20c8bf2da0c548b5a4f3852",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 371,
"avg_line_length": 44.7125,
"alnum_prop": 0.7351598173515982,
"repo_name": "AlbandeCrevoisier/ldd-athens",
"id": "8503866d7639e89b6d8a4abf418a2a600a4c8884",
"size": "10731",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf/share/doc/gccint/Working-with-declarations.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "10184236"
},
{
"name": "Awk",
"bytes": "40418"
},
{
"name": "Batchfile",
"bytes": "81753"
},
{
"name": "C",
"bytes": "566858455"
},
{
"name": "C++",
"bytes": "21399133"
},
{
"name": "Clojure",
"bytes": "971"
},
{
"name": "Cucumber",
"bytes": "5998"
},
{
"name": "FORTRAN",
"bytes": "11832"
},
{
"name": "GDB",
"bytes": "18113"
},
{
"name": "Groff",
"bytes": "2686457"
},
{
"name": "HTML",
"bytes": "34688334"
},
{
"name": "Lex",
"bytes": "56961"
},
{
"name": "Logos",
"bytes": "133810"
},
{
"name": "M4",
"bytes": "3325"
},
{
"name": "Makefile",
"bytes": "1685015"
},
{
"name": "Objective-C",
"bytes": "920162"
},
{
"name": "Perl",
"bytes": "752477"
},
{
"name": "Perl6",
"bytes": "3783"
},
{
"name": "Python",
"bytes": "533352"
},
{
"name": "Shell",
"bytes": "468244"
},
{
"name": "SourcePawn",
"bytes": "2711"
},
{
"name": "UnrealScript",
"bytes": "12824"
},
{
"name": "XC",
"bytes": "33970"
},
{
"name": "XS",
"bytes": "34909"
},
{
"name": "Yacc",
"bytes": "113516"
}
],
"symlink_target": ""
} |
EEG analysis for R: Cutting EEG workshop
Course materials for the EEG in R workshop at Cutting EEG in Glasgow.
Any questions or issues, contact me at m.p.craddock@leeds.ac.uk or on Twitter at @matt_craddock.
2017
| {
"content_hash": "2a18d7da224a776725bf4f6900ab691e",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 97,
"avg_line_length": 31.142857142857142,
"alnum_prop": 0.7706422018348624,
"repo_name": "craddm/EEG_Workshop",
"id": "3a5a03898b9a5b2fa5ae0cd36d6aaa392333c70f",
"size": "233",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1660"
},
{
"name": "HTML",
"bytes": "11527601"
},
{
"name": "JavaScript",
"bytes": "66212"
}
],
"symlink_target": ""
} |
/* $Id: Any2LsRGBRed.java 1345683 2012-06-03 14:50:33Z gadams $ */
package org.apache.xmlgraphics.image.rendered;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.color.ColorSpace;
import java.awt.image.BandCombineOp;
import java.awt.image.BufferedImage;
import java.awt.image.ColorConvertOp;
import java.awt.image.ColorModel;
import java.awt.image.DataBuffer;
import java.awt.image.Raster;
import java.awt.image.SampleModel;
import java.awt.image.SinglePixelPackedSampleModel;
import java.awt.image.WritableRaster;
import org.apache.xmlgraphics.image.GraphicsUtil;
// CSOFF: ConstantName
// CSOFF: NeedBraces
// CSOFF: WhitespaceAfter
// CSOFF: WhitespaceAround
/**
* This function will tranform an image from any colorspace into a luminance
* image. The alpha channel if any will be copied to the new image.
*
* @version $Id: Any2LsRGBRed.java 1345683 2012-06-03 14:50:33Z gadams $
*
* Originally authored by Thomas DeWeese.
*/
public class Any2LsRGBRed extends AbstractRed {
boolean srcIssRGB = false;
/**
* Construct a luminace image from src.
*
* @param src
* The image to convert to a luminance image
*/
public Any2LsRGBRed(final CachableRed src) {
super(src, src.getBounds(), fixColorModel(src), fixSampleModel(src),
src.getTileGridXOffset(), src.getTileGridYOffset(), null);
final ColorModel srcCM = src.getColorModel();
if (srcCM == null) {
return;
}
final ColorSpace srcCS = srcCM.getColorSpace();
if (srcCS == ColorSpace.getInstance(ColorSpace.CS_sRGB)) {
this.srcIssRGB = true;
}
}
/**
* Gamma for linear to sRGB convertion
*/
private static final double GAMMA = 2.4;
private static final double LFACT = 1.0 / 12.92;
public static final double sRGBToLsRGB(final double value) {
if (value <= 0.003928) {
return value * LFACT;
}
return Math.pow((value + 0.055) / 1.055, GAMMA);
}
/**
* Lookup tables for RGB lookups. The linearToSRGBLut is used when noise
* values are considered to be on a linearScale. The linearToLinear table is
* used when the values are considered to be on the sRGB scale to begin
* with.
*/
private static final int[] sRGBToLsRGBLut = new int[256];
static {
final double scale = 1.0 / 255;
// log.info("S2L: ");
for (int i = 0; i < 256; ++i) {
final double value = sRGBToLsRGB(i * scale);
sRGBToLsRGBLut[i] = (int) Math.round(value * 255.0);
// log.info(sRGBToLsRGBLut[i] + ",");
}
// log.info("");
}
@Override
public WritableRaster copyData(final WritableRaster wr) {
// Get my source.
final CachableRed src = (CachableRed) getSources().get(0);
final ColorModel srcCM = src.getColorModel();
final SampleModel srcSM = src.getSampleModel();
// Fast case, SRGB source, INT Pack writable raster...
if (this.srcIssRGB && Any2sRGBRed.is_INT_PACK_COMP(wr.getSampleModel())) {
src.copyData(wr);
if (srcCM.hasAlpha()) {
GraphicsUtil.coerceData(wr, srcCM, false);
}
Any2sRGBRed.applyLut_INT(wr, sRGBToLsRGBLut);
return wr;
}
if (srcCM == null) {
// We don't really know much about this source, let's
// guess based on the number of bands...
float[][] matrix = null;
switch (srcSM.getNumBands()) {
case 1:
matrix = new float[1][3];
matrix[0][0] = 1; // Red
matrix[0][1] = 1; // Grn
matrix[0][2] = 1; // Blu
break;
case 2:
matrix = new float[2][4];
matrix[0][0] = 1; // Red
matrix[0][1] = 1; // Grn
matrix[0][2] = 1; // Blu
matrix[1][3] = 1; // Alpha
break;
case 3:
matrix = new float[3][3];
matrix[0][0] = 1; // Red
matrix[1][1] = 1; // Grn
matrix[2][2] = 1; // Blu
break;
default:
matrix = new float[srcSM.getNumBands()][4];
matrix[0][0] = 1; // Red
matrix[1][1] = 1; // Grn
matrix[2][2] = 1; // Blu
matrix[3][3] = 1; // Alpha
break;
}
final Raster srcRas = src.getData(wr.getBounds());
final BandCombineOp op = new BandCombineOp(matrix, null);
op.filter(srcRas, wr);
} else {
final ColorModel dstCM = getColorModel();
BufferedImage dstBI;
if (!dstCM.hasAlpha()) {
// No alpha ao we don't have to work around the bug
// in the color convert op.
dstBI = new BufferedImage(dstCM,
wr.createWritableTranslatedChild(0, 0),
dstCM.isAlphaPremultiplied(), null);
} else {
// All this nonsense is to work around the fact that
// the Color convert op doesn't properly copy the
// Alpha from src to dst.
SinglePixelPackedSampleModel dstSM;
dstSM = (SinglePixelPackedSampleModel) wr.getSampleModel();
final int[] masks = dstSM.getBitMasks();
final SampleModel dstSMNoA = new SinglePixelPackedSampleModel(
dstSM.getDataType(), dstSM.getWidth(),
dstSM.getHeight(), dstSM.getScanlineStride(),
new int[] { masks[0], masks[1], masks[2] });
final ColorModel dstCMNoA = GraphicsUtil.Linear_sRGB;
WritableRaster dstWr;
dstWr = Raster.createWritableRaster(dstSMNoA,
wr.getDataBuffer(), new Point(0, 0));
dstWr = dstWr.createWritableChild(
wr.getMinX() - wr.getSampleModelTranslateX(),
wr.getMinY() - wr.getSampleModelTranslateY(),
wr.getWidth(), wr.getHeight(), 0, 0, null);
dstBI = new BufferedImage(dstCMNoA, dstWr, false, null);
}
// Divide out alpha if we have it. We need to do this since
// the color convert may not be a linear operation which may
// lead to out of range values.
ColorModel srcBICM = srcCM;
WritableRaster srcWr;
if (srcCM.hasAlpha() && srcCM.isAlphaPremultiplied()) {
final Rectangle wrR = wr.getBounds();
final SampleModel sm = srcCM.createCompatibleSampleModel(
wrR.width, wrR.height);
srcWr = Raster
.createWritableRaster(sm, new Point(wrR.x, wrR.y));
src.copyData(srcWr);
srcBICM = GraphicsUtil.coerceData(srcWr, srcCM, false);
} else {
final Raster srcRas = src.getData(wr.getBounds());
srcWr = GraphicsUtil.makeRasterWritable(srcRas);
}
BufferedImage srcBI;
srcBI = new BufferedImage(srcBICM,
srcWr.createWritableTranslatedChild(0, 0), false, null);
/*
* log.info("src: " + srcBI.getWidth() + "x" + srcBI.getHeight());
* log.info("dst: " + dstBI.getWidth() + "x" + dstBI.getHeight());
*/
final ColorConvertOp op = new ColorConvertOp(null);
op.filter(srcBI, dstBI);
if (dstCM.hasAlpha()) {
copyBand(srcWr, srcSM.getNumBands() - 1, wr, getSampleModel()
.getNumBands() - 1);
}
}
return wr;
}
/**
* This function 'fixes' the source's color model. Right now it just selects
* if it should have one or two bands based on if the source had an alpha
* channel.
*/
protected static ColorModel fixColorModel(final CachableRed src) {
final ColorModel cm = src.getColorModel();
if (cm != null) {
if (cm.hasAlpha()) {
return GraphicsUtil.Linear_sRGB_Unpre;
}
return GraphicsUtil.Linear_sRGB;
} else {
// No ColorModel so try to make some intelligent
// decisions based just on the number of bands...
// 1 bands -> replicated into RGB
// 2 bands -> Band 0 replicated into RGB & Band 1 -> alpha premult
// 3 bands -> sRGB (not-linear?)
// 4 bands -> sRGB premult (not-linear?)
final SampleModel sm = src.getSampleModel();
switch (sm.getNumBands()) {
case 1:
return GraphicsUtil.Linear_sRGB;
case 2:
return GraphicsUtil.Linear_sRGB_Unpre;
case 3:
return GraphicsUtil.Linear_sRGB;
default:
return GraphicsUtil.Linear_sRGB_Unpre;
}
}
}
/**
* This function 'fixes' the source's sample model. Right now it just
* selects if it should have 3 or 4 bands based on if the source had an
* alpha channel.
*/
protected static SampleModel fixSampleModel(final CachableRed src) {
final SampleModel sm = src.getSampleModel();
final ColorModel cm = src.getColorModel();
boolean alpha = false;
if (cm != null) {
alpha = cm.hasAlpha();
} else {
switch (sm.getNumBands()) {
case 1:
case 3:
alpha = false;
break;
default:
alpha = true;
break;
}
}
if (alpha) {
return new SinglePixelPackedSampleModel(DataBuffer.TYPE_INT,
sm.getWidth(), sm.getHeight(), new int[] { 0xFF0000,
0xFF00, 0xFF, 0xFF000000 });
} else {
return new SinglePixelPackedSampleModel(DataBuffer.TYPE_INT,
sm.getWidth(), sm.getHeight(), new int[] { 0xFF0000,
0xFF00, 0xFF });
}
}
}
| {
"content_hash": "98128e90013f9763c106eac0d3eb68ee",
"timestamp": "",
"source": "github",
"line_count": 287,
"max_line_length": 82,
"avg_line_length": 36.12891986062718,
"alnum_prop": 0.5351528594850034,
"repo_name": "Guronzan/Apache-XmlGraphics",
"id": "32d44ccf7bcaefbe4fa0056fb81416e63a386e32",
"size": "11171",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/org/apache/xmlgraphics/image/rendered/Any2LsRGBRed.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "27688"
},
{
"name": "Java",
"bytes": "2276378"
}
],
"symlink_target": ""
} |
#if DOTNET35
using NUnit.Framework;
using Sooda.Linq;
using Sooda.UnitTests.BaseObjects;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace Sooda.UnitTests.TestCases.Linq
{
[TestFixture]
public class CollectionTest
{
[Test]
public void In0()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => new int[0].Contains(c.ContactId));
CollectionAssert.IsEmpty(ce);
ce = Contact.Linq().Where(c => new Contact[0].Contains(c));
CollectionAssert.IsEmpty(ce);
ce = Contact.Linq().Where(c => new ArrayList().Contains(c.Manager));
CollectionAssert.IsEmpty(ce);
}
}
[Test]
public void InArray1()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => new int[] { 1 }.Contains(c.ContactId));
CollectionAssert.AreEquivalent(new Contact[] { Contact.Mary }, ce);
}
}
[Test]
public void InRefArray()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => new Contact[] { Contact.Mary }.Contains(c.Manager));
CollectionAssert.AreEquivalent(new Contact[] { Contact.Ed, Contact.Eva }, ce);
}
}
[Test]
public void InArray3()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => new int[] { 1, 2, 3 }.Contains(c.ContactId));
CollectionAssert.AreEquivalent(new Contact[] { Contact.Mary, Contact.Ed, Contact.Eva }, ce);
}
}
[Test]
public void InArrayList()
{
using (new SoodaTransaction())
{
ArrayList managers = new ArrayList();
managers.Add(Contact.Mary);
IEnumerable<Contact> ce = Contact.Linq().Where(c => managers.Contains(c.Manager));
CollectionAssert.AreEquivalent(new Contact[] { Contact.Ed, Contact.Eva }, ce);
}
}
[Test]
public void InGenericList()
{
using (new SoodaTransaction())
{
List<Contact> managers = new List<Contact>();
managers.Add(Contact.Mary);
IEnumerable<Contact> ce = Contact.Linq().Where(c => managers.Contains(c.Manager));
CollectionAssert.AreEquivalent(new Contact[] { Contact.Ed, Contact.Eva }, ce);
}
}
[Test]
public void In5()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => new Contact[] { c.Manager }.Contains(c.Manager));
// "in" doesn't match nulls, at least in SQL Server
CollectionAssert.AreEquivalent(new Contact[] { Contact.Ed, Contact.Eva }, ce);
}
}
[Test]
public void In6()
{
using (new SoodaTransaction())
{
Contact c0 = null;
IEnumerable<Contact> ce = Contact.Linq().Where(c => new Contact[] { c0 }.Contains(c.Manager));
// "in" doesn't match nulls, at least in SQL Server
CollectionAssert.IsEmpty(ce);
}
}
[Test]
public void In7()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => Role.Manager.Members.Contains(c.Manager));
CollectionAssert.AreEquivalent(new Contact[] { Contact.Ed, Contact.Eva }, ce);
}
}
[Test]
public void InRangeVariable()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => new Contact[] { Contact.Mary }.Contains(c));
CollectionAssert.AreEquivalent(new Contact[] { Contact.Mary }, ce);
}
}
[Test]
public void CountOnSelfReferencing()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => c.Subordinates.Count == 2);
CollectionAssert.AreEquivalent(new Contact[] { Contact.Mary }, ce);
}
}
[Test]
public void CountOnSelfReferencingQuery()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => c.SubordinatesQuery.Count() == 2);
CollectionAssert.AreEquivalent(new Contact[] { Contact.Mary }, ce);
}
}
[Test]
public void CountOnFiltered()
{
using (new SoodaTransaction())
{
IEnumerable<Group> ge = Group.Linq().Where(g => g.Members.Count == 4);
CollectionAssert.AreEqual(new Group[] { Group.GetRef(10) }, ge);
ge = Group.Linq().Where(g => g.Managers.Count() == 1);
CollectionAssert.AreEquivalent(new Group[] { Group.GetRef(10), Group.GetRef(11) }, ge);
ge = Group.Linq().Where(g => g.Managers.Count != 1);
CollectionAssert.IsEmpty(ge);
}
}
[Test]
public void CountOnFilteredQuery()
{
using (new SoodaTransaction())
{
IEnumerable<Group> ge = Group.Linq().Where(g => g.MembersQuery.Count() == 4);
CollectionAssert.AreEqual(new Group[] { Group.GetRef(10) }, ge);
ge = Group.Linq().Where(g => g.Managers.Count() == 1);
CollectionAssert.AreEquivalent(new Group[] { Group.GetRef(10), Group.GetRef(11) }, ge);
ge = Group.Linq().Where(g => g.Managers.Count != 1);
CollectionAssert.IsEmpty(ge);
}
}
[Test]
public void CountOnSubclassTPT()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => c.Bikes1.Count == 1);
CollectionAssert.AreEquivalent(new Contact[] { Contact.Ed }, ce);
}
}
[Test]
public void CountOnSubclassTPTQuery()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => c.Bikes1Query.Count() == 1);
CollectionAssert.AreEquivalent(new Contact[] { Contact.Ed }, ce);
}
}
[Test]
public void ContainsOnSelfReferencing()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => c.Subordinates.Contains(Contact.Ed));
CollectionAssert.AreEquivalent(new Contact[] { Contact.Mary }, ce);
}
}
[Test]
public void ContainsOnSelfReferencingQuery()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => c.SubordinatesQuery.Contains(Contact.Ed));
CollectionAssert.AreEquivalent(new Contact[] { Contact.Mary }, ce);
}
}
[Test]
public void ContainsOnFiltered()
{
using (new SoodaTransaction())
{
IEnumerable<Group> ge = Group.Linq().Where(g => g.Members.Contains(Contact.Mary));
CollectionAssert.AreEqual(new Group[] { Group.GetRef(10) }, ge);
ge = Group.Linq().Where(g => g.Managers.Contains(Contact.Mary));
CollectionAssert.IsEmpty(ge);
}
}
[Test]
public void ContainsOnFilteredQuery()
{
using (new SoodaTransaction())
{
IEnumerable<Group> ge = Group.Linq().Where(g => g.MembersQuery.Contains(Contact.Mary));
CollectionAssert.AreEqual(new Group[] { Group.GetRef(10) }, ge);
ge = Group.Linq().Where(g => g.Managers.Contains(Contact.Mary));
CollectionAssert.IsEmpty(ge);
}
}
[Test]
public void ContainsOnSubclassTPT()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => c.Bikes1.Contains(Bike.GetRef(3)));
CollectionAssert.AreEquivalent(new Contact[] { Contact.Ed }, ce);
}
}
[Test]
public void ContainsOnSubclassTPTQuery()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => c.Bikes1Query.Contains(Bike.GetRef(3)));
CollectionAssert.AreEquivalent(new Contact[] { Contact.Ed }, ce);
}
}
[Test]
public void ContainsOnSubclassTPTWhere()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => c.Bikes1.Any(b => b.TwoWheels == 1));
CollectionAssert.AreEquivalent(new Contact[] { Contact.Ed }, ce);
}
}
[Test]
public void ContainsOnSubclassTPTWhereQuery()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => c.Bikes1Query.Any(b => b.TwoWheels == 1));
CollectionAssert.AreEquivalent(new Contact[] { Contact.Ed }, ce);
}
}
[Test]
public void NestedContains()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => c.PrimaryGroup.Members.Contains(Contact.GetRef(3)));
CollectionAssert.AreEqual(new Contact[] { Contact.Eva }, ce);
}
}
[Test]
public void NestedContainsQuery()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => c.PrimaryGroup.MembersQuery.Contains(Contact.GetRef(3)));
CollectionAssert.AreEqual(new Contact[] { Contact.Eva }, ce);
}
}
[Test]
public void ComplexTest5()
{
using (new SoodaTransaction())
{
IEnumerable<Group> ge = Group.Linq().Where(g =>
g.Manager.Name == "Mary Manager"
&& g.Members.Count > 3
&& g.Members.Any(c => c.Name == "ZZZ" && c.PrimaryGroup.Members.Contains(Contact.GetRef(3)))
&& g.Manager.Roles.Any(r => r.Name.Value == "Customer"));
CollectionAssert.IsEmpty(ge);
}
}
[Test]
public void ComplexTest5Query()
{
using (new SoodaTransaction())
{
IEnumerable<Group> ge = Group.Linq().Where(g =>
g.Manager.Name == "Mary Manager"
&& g.MembersQuery.Count() > 3
&& g.MembersQuery.Any(c => c.Name == "ZZZ" && c.PrimaryGroup.MembersQuery.Contains(Contact.GetRef(3)))
&& g.Manager.RolesQuery.Any(r => r.Name.Value == "Customer"));
CollectionAssert.IsEmpty(ge);
}
}
[Test]
public void OneToManyAll()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => c.Subordinates.All(s => s.Name.Like("E% Employee")));
Assert.AreEqual(7, ce.Count());
}
}
[Test]
public void OneToManyAllQuery()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => c.SubordinatesQuery.All(s => s.Name.Like("E% Employee")));
Assert.AreEqual(7, ce.Count());
}
}
[Test]
public void OneToManyAny()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => c.Subordinates.Any());
CollectionAssert.AreEquivalent(new Contact[] { Contact.Mary }, ce);
}
}
[Test]
public void OneToManyAnyQuery()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => c.SubordinatesQuery.Any());
CollectionAssert.AreEquivalent(new Contact[] { Contact.Mary }, ce);
}
}
[Test]
public void OneToManyAnyFiltered()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => c.Subordinates.Any(s => s.Name == "Ed Employee"));
CollectionAssert.AreEquivalent(new Contact[] { Contact.Mary }, ce);
}
}
[Test]
public void OneToManyAnyFilteredQuery()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => c.SubordinatesQuery.Any(s => s.Name == "Ed Employee"));
CollectionAssert.AreEquivalent(new Contact[] { Contact.Mary }, ce);
}
}
[Test]
public void AnyWithOuterRange()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => c.Subordinates.Any(s => s == c));
CollectionAssert.IsEmpty(ce);
}
}
[Test]
public void AnyWithOuterRangeQuery()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => c.SubordinatesQuery.Any(s => s == c));
CollectionAssert.IsEmpty(ce);
}
}
[Test]
public void AnyWithRangeVariableComparison()
{
using (new SoodaTransaction())
{
IEnumerable<Group> ge = Group.Linq().Where(g => g.Members.Any(c => c == Contact.Mary));
CollectionAssert.AreEqual(new Group[] { Group.GetRef(10) }, ge);
}
}
[Test]
public void AnyWithRangeVariableComparisonQuery()
{
using (new SoodaTransaction())
{
IEnumerable<Group> ge = Group.Linq().Where(g => g.MembersQuery.Any(c => c == Contact.Mary));
CollectionAssert.AreEqual(new Group[] { Group.GetRef(10) }, ge);
}
}
[Test]
public void AnyWithSoodaClass()
{
using (new SoodaTransaction())
{
IEnumerable<Group> ge = Group.Linq().Where(g => g.Members.Any(c => g.GetType().Name == "Group" && c.GetType().Name == "Contact"));
CollectionAssert.AreEquivalent(new Group[] { Group.GetRef(10), Group.GetRef(11) }, ge);
}
}
[Test]
public void AnyWithSoodaClassQuery()
{
using (new SoodaTransaction())
{
IEnumerable<Group> ge = Group.Linq().Where(g => g.MembersQuery.Any(c => g.GetType().Name == "Group" && c.GetType().Name == "Contact"));
CollectionAssert.AreEquivalent(new Group[] { Group.GetRef(10), Group.GetRef(11) }, ge);
}
}
[Test]
public void AnyArray()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => new int[] { 1, 3 }.Any(i => i == c.ContactId));
CollectionAssert.AreEquivalent(new Contact[] { Contact.Mary, Contact.Eva }, ce);
}
}
[Test]
public void AnySoodaCollection()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => Role.Employee.Members.Any(m => m.Manager == c));
CollectionAssert.AreEqual(new Contact[] { Contact.Mary }, ce);
}
}
[Test]
public void AnySoodaCollectionQuery()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => Role.Employee.MembersQuery.Any(m => m.Manager == c));
CollectionAssert.AreEqual(new Contact[] { Contact.Mary }, ce);
}
}
[Test]
public void HaveManagerWithRole()
{
using (new SoodaTransaction())
{
IEnumerable<Contact> ce = Contact.Linq().Where(c => c.Manager.Roles.Contains(Role.Employee));
CollectionAssert.AreEquivalent(new Contact[] { Contact.Ed, Contact.Eva }, ce);
}
}
[Test]
public void HaveManagerWithRoleCount()
{
using (new SoodaTransaction())
{
int i = Contact.Linq().Count(c => c.Manager.Roles.Contains(Role.Employee));
Assert.AreEqual(2, i);
}
}
[Test]
public void HaveManagerWithCarCount()
{
using (new SoodaTransaction())
{
int i = Contact.Linq().Count(c => c.Manager.Vehicles.Contains(Car.GetRef(2)));
Assert.AreEqual(0, i);
}
}
[Test]
public void HaveManagerWithBikeCount()
{
using (new SoodaTransaction())
{
int i = Contact.Linq().Count(c => c.Manager.Bikes.Contains(Vehicle.GetRef(3)));
Assert.AreEqual(0, i);
}
}
}
}
#endif
| {
"content_hash": "f6a36d3ef550386c67d83c86a9192e46",
"timestamp": "",
"source": "github",
"line_count": 519,
"max_line_length": 151,
"avg_line_length": 35.57418111753372,
"alnum_prop": 0.48946541732112875,
"repo_name": "pfusik/sooda",
"id": "284bf7e150e9c1803897b48362404fcb057234a4",
"size": "19887",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/TestCases/Linq/CollectionTest.cs",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "ASP",
"bytes": "2129"
},
{
"name": "Batchfile",
"bytes": "2786"
},
{
"name": "Boo",
"bytes": "325"
},
{
"name": "C#",
"bytes": "2192127"
},
{
"name": "CSS",
"bytes": "13056"
},
{
"name": "Perl",
"bytes": "7903"
},
{
"name": "Shell",
"bytes": "1244"
},
{
"name": "Visual Basic",
"bytes": "12634"
},
{
"name": "XSLT",
"bytes": "18309"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8" ?>
<com.daimajia.swipe.SwipeLayout
xmlns:swipe="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:wave="http://schemas.android.com/apk/res-auto"
android:id="@+id/swipe"
android:layout_width="match_parent"
android:layout_height="80dp"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="80dp"
android:gravity="center"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="horizontal"
>
<LinearLayout
android:id="@+id/back_color_ly"
android:layout_width="0dp"
android:background="@color/future_listview_back"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
/>
<LinearLayout
android:id="@+id/be_top_color_ly"
android:layout_width="0dp"
android:background="@color/future_listview_be_top"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
/>
<LinearLayout
android:id="@+id/set_remind_time_color_ly"
android:layout_width="0dp"
android:background="@color/future_listview_set_remind_time"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
/>
<LinearLayout
android:id="@+id/set_star_color_ly"
android:layout_width="0dp"
android:background="@color/future_listview_set_star"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
/>
<LinearLayout
android:id="@+id/delete_color_ly"
android:layout_width="0dp"
android:background="@color/future_listview_delete"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
>
<ImageView
android:id="@+id/right_arrow"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_weight="1"
android:src="@drawable/right_arrow"/>
<ImageView
android:id="@+id/be_top"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_weight="1"
android:src="@drawable/be_top"/>
<ImageView
android:id="@+id/set_time"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_weight="1"
android:src="@drawable/set_time" />
<ImageView
android:id="@+id/set_star"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_weight="1"
android:src="@drawable/set_star" />
<ImageView
android:id="@+id/delete"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_weight="1"
android:src="@drawable/delete" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="horizontal"
>
<LinearLayout
android:id="@+id/back_ly"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
/>
<LinearLayout
android:id="@+id/be_top_ly"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
/>
<LinearLayout
android:id="@+id/set_time_ly"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
/>
<LinearLayout
android:id="@+id/set_star_ly"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
/>
<LinearLayout
android:id="@+id/delete_ly"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:orientation="horizontal">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="80dp"
>
<com.timefleeting.app.WaveView
android:id="@+id/wave_view"
android:layout_width="match_parent"
android:layout_height="80dp"
android:background="@color/future_listview_background"
wave:above_wave_color="@color/future_listview_above_wave"
wave:blow_wave_color="@color/future_listview_below_wave"
wave:wave_height="little"
wave:wave_hz="normal"
wave:wave_length="middle" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingRight="5dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="10"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
>
<TextView
android:id="@+id/listview_item_title"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="20sp"
android:textColor="@color/future_listview_title"
android:singleLine="true"
/>
<ImageView
android:id="@+id/listview_item_betop"
android:layout_width="30dp"
android:layout_height="match_parent"
android:src="@drawable/be_top"
/>
<ImageView
android:id="@+id/listview_item_overdue"
android:layout_width="30dp"
android:layout_height="match_parent"
android:src="@drawable/overdue"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
>
<TextView
android:id="@+id/listview_item_create_time"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:textSize="10sp"
android:textColor="@color/future_listview_create_time"
android:gravity="right"
/>
<TextView
android:id="@+id/listview_item_remind_time"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:textSize="10sp"
android:textColor="@color/future_listview_remind_time"
android:gravity="right"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
>
<TextView
android:id="@+id/listview_item_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="@color/future_listview_content"
android:textSize="12sp"
android:singleLine="true"
android:layout_marginTop="10dp"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="20dp"
android:layout_height="match_parent"
android:orientation="vertical"
>
<ImageView
android:id="@+id/listview_item_star_1"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
/>
<ImageView
android:id="@+id/listview_item_star_2"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
/>
<ImageView
android:id="@+id/listview_item_star_3"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
/>
<ImageView
android:id="@+id/listview_item_star_4"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
/>
<ImageView
android:id="@+id/listview_item_star_5"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
/>
</LinearLayout>
</LinearLayout>
</FrameLayout>
</LinearLayout>
</com.daimajia.swipe.SwipeLayout> | {
"content_hash": "92ff56d160fa3dd6e85b8d514bb4d64a",
"timestamp": "",
"source": "github",
"line_count": 338,
"max_line_length": 82,
"avg_line_length": 38.16863905325444,
"alnum_prop": 0.4429114022168824,
"repo_name": "Nightonke/TimeFleeting",
"id": "3db5d1a90f91463ca4f8a1cb897589dab924fd2e",
"size": "12901",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "res/layout/listview_item.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "343240"
}
],
"symlink_target": ""
} |
/* */
'use strict';
module.exports.definition = {
set: function (v) {
this._setProperty('-webkit-border-end', v);
},
get: function () {
return this.getPropertyValue('-webkit-border-end');
},
enumerable: true,
configurable: true
};
| {
"content_hash": "05f2838ed0937ae6fbf0f20342892306",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 59,
"avg_line_length": 21,
"alnum_prop": 0.575091575091575,
"repo_name": "Stev3nT/Telerik-Academy",
"id": "899e3118538104de3b7c9ee989a3650315235a02",
"size": "273",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "00. Teamworks/04. JS Applications - FrenchConnection/lib/npm/cssstyle@0.2.29/lib/properties/webkitBorderEnd.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "515"
},
{
"name": "C#",
"bytes": "2218280"
},
{
"name": "C++",
"bytes": "23835"
},
{
"name": "CSS",
"bytes": "248759"
},
{
"name": "CoffeeScript",
"bytes": "3178"
},
{
"name": "HTML",
"bytes": "212973"
},
{
"name": "JavaScript",
"bytes": "14753920"
},
{
"name": "Makefile",
"bytes": "1715"
},
{
"name": "Ruby",
"bytes": "3945"
},
{
"name": "SQLPL",
"bytes": "23281"
},
{
"name": "Shell",
"bytes": "470"
},
{
"name": "Smalltalk",
"bytes": "1554"
},
{
"name": "XSLT",
"bytes": "2778"
}
],
"symlink_target": ""
} |
<?php
/**
* @license MIT
* Full license text in LICENSE file
*/
namespace Eadrax\Core\Usecase\Update\Edit;
use Eadrax\Core\Data;
use Eadrax\Core\Tool;
use Eadrax\Core\Exception;
class Image extends Data\Image implements Proposal
{
public $project;
public $private;
public $file;
public $thumbnail;
public $width;
public $height;
private $repository;
private $authenticator;
public function __construct(Data\Image $image, Repository $repository, Tool\Authenticator $authenticator)
{
$this->id = $image->id;
$this->project = new Data\Project;
$this->project->author = new Data\User;
$this->project->author->id = $repository->get_author_id($this->id);
$this->repository = $repository;
$this->authenticator = $authenticator;
}
public function authorise_ownership()
{
$logged_in_user = $this->authenticator->get_user();
if ($logged_in_user->id !== $this->project->author->id)
throw new Exception\Authorisation('You are not allowed to edit this update.');
}
public function load_prepared_proposal(Data\Update $image)
{
$this->private = $image->private;
$this->file = $image->file;
$this->thumbnail = $image->thumbnail;
$this->width = $image->width;
$this->height = $image->height;
}
public function submit()
{
$this->repository->purge_files($this->id);
$file_path = $this->repository->save_file(
$this->file->name,
$this->file->tmp_name,
$this->file->mimetype,
$this->file->filesize_in_bytes,
$this->file->error_code
);
$this->repository->save_image(
$this->id,
$this->private,
$file_path,
$this->repository->save_generated_file($this->thumbnail),
$this->width,
$this->height
);
}
}
| {
"content_hash": "1bb942ba085e2af41b3403cfdd004ab7",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 109,
"avg_line_length": 27.942857142857143,
"alnum_prop": 0.5807770961145194,
"repo_name": "Moult/eadrax-old",
"id": "f8b4fe42de1a371c9c40cfae6c292e82d77a7cd4",
"size": "1956",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "src/Eadrax/Core/Usecase/Update/Edit/Image.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "305222"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_101) on Mon Dec 04 22:22:47 MST 2017 -->
<title>R-Index</title>
<meta name="date" content="2017-12-04">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
<script type="text/javascript" src="../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="R-Index";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li><a href="../overview-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li class="navBarCell1Rev">Index</li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="index-14.html">Prev Letter</a></li>
<li><a href="index-16.html">Next Letter</a></li>
</ul>
<ul class="navList">
<li><a href="../index.html?index-files/index-15.html" target="_top">Frames</a></li>
<li><a href="index-15.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="contentContainer"><a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">D</a> <a href="index-5.html">E</a> <a href="index-6.html">F</a> <a href="index-7.html">G</a> <a href="index-8.html">H</a> <a href="index-9.html">I</a> <a href="index-10.html">L</a> <a href="index-11.html">M</a> <a href="index-12.html">N</a> <a href="index-13.html">O</a> <a href="index-14.html">P</a> <a href="index-15.html">R</a> <a href="index-16.html">S</a> <a href="index-17.html">T</a> <a href="index-18.html">U</a> <a href="index-19.html">V</a> <a name="I:R">
<!-- -->
</a>
<h2 class="title">R</h2>
<dl>
<dt><span class="memberNameLink"><a href="../cmput301f17t09/goalsandhabits/Profiles/Profile.html#removeFollowReq-cmput301f17t09.goalsandhabits.Profiles.Profile-">removeFollowReq(Profile)</a></span> - Method in class cmput301f17t09.goalsandhabits.Profiles.<a href="../cmput301f17t09/goalsandhabits/Profiles/Profile.html" title="class in cmput301f17t09.goalsandhabits.Profiles">Profile</a></dt>
<dd>
<div class="block">Removes follow request</div>
</dd>
<dt><span class="memberNameLink"><a href="../cmput301f17t09/goalsandhabits/Profiles/Profile.html#removeFollowReq-int-">removeFollowReq(int)</a></span> - Method in class cmput301f17t09.goalsandhabits.Profiles.<a href="../cmput301f17t09/goalsandhabits/Profiles/Profile.html" title="class in cmput301f17t09.goalsandhabits.Profiles">Profile</a></dt>
<dd>
<div class="block">Removes follow request</div>
</dd>
<dt><span class="memberNameLink"><a href="../cmput301f17t09/goalsandhabits/Profiles/Profile.html#removeHabitId-java.lang.String-">removeHabitId(String)</a></span> - Method in class cmput301f17t09.goalsandhabits.Profiles.<a href="../cmput301f17t09/goalsandhabits/Profiles/Profile.html" title="class in cmput301f17t09.goalsandhabits.Profiles">Profile</a></dt>
<dd>
<div class="block">Removes a habit ID</div>
</dd>
<dt><span class="memberNameLink"><a href="../cmput301f17t09/goalsandhabits/Main_Habits/MainActivity.html#REQUEST_CODE_LOGIN">REQUEST_CODE_LOGIN</a></span> - Static variable in class cmput301f17t09.goalsandhabits.Main_Habits.<a href="../cmput301f17t09/goalsandhabits/Main_Habits/MainActivity.html" title="class in cmput301f17t09.goalsandhabits.Main_Habits">MainActivity</a></dt>
<dd> </dd>
<dt><span class="memberNameLink"><a href="../cmput301f17t09/goalsandhabits/Main_Habits/MainActivity.html#REQUEST_CODE_NEW_HABIT">REQUEST_CODE_NEW_HABIT</a></span> - Static variable in class cmput301f17t09.goalsandhabits.Main_Habits.<a href="../cmput301f17t09/goalsandhabits/Main_Habits/MainActivity.html" title="class in cmput301f17t09.goalsandhabits.Main_Habits">MainActivity</a></dt>
<dd> </dd>
<dt><span class="memberNameLink"><a href="../cmput301f17t09/goalsandhabits/Main_Habits/MainActivity.html#REQUEST_CODE_NEW_HABIT_EVENT">REQUEST_CODE_NEW_HABIT_EVENT</a></span> - Static variable in class cmput301f17t09.goalsandhabits.Main_Habits.<a href="../cmput301f17t09/goalsandhabits/Main_Habits/MainActivity.html" title="class in cmput301f17t09.goalsandhabits.Main_Habits">MainActivity</a></dt>
<dd> </dd>
<dt><span class="memberNameLink"><a href="../cmput301f17t09/goalsandhabits/Main_Habits/MainActivity.html#REQUEST_CODE_SIGNUP">REQUEST_CODE_SIGNUP</a></span> - Static variable in class cmput301f17t09.goalsandhabits.Main_Habits.<a href="../cmput301f17t09/goalsandhabits/Main_Habits/MainActivity.html" title="class in cmput301f17t09.goalsandhabits.Main_Habits">MainActivity</a></dt>
<dd> </dd>
<dt><span class="memberNameLink"><a href="../cmput301f17t09/goalsandhabits/Maps/MapFiltersActivity.html#REQUEST_CODE_SIGNUP">REQUEST_CODE_SIGNUP</a></span> - Static variable in class cmput301f17t09.goalsandhabits.Maps.<a href="../cmput301f17t09/goalsandhabits/Maps/MapFiltersActivity.html" title="class in cmput301f17t09.goalsandhabits.Maps">MapFiltersActivity</a></dt>
<dd> </dd>
<dt><span class="memberNameLink"><a href="../cmput301f17t09/goalsandhabits/Profiles/MyHabitHistory.html#REQUEST_CODE_SIGNUP">REQUEST_CODE_SIGNUP</a></span> - Static variable in class cmput301f17t09.goalsandhabits.Profiles.<a href="../cmput301f17t09/goalsandhabits/Profiles/MyHabitHistory.html" title="class in cmput301f17t09.goalsandhabits.Profiles">MyHabitHistory</a></dt>
<dd> </dd>
<dt><span class="memberNameLink"><a href="../cmput301f17t09/goalsandhabits/Main_Habits/HabitHistoryActivity.html#REQUEST_CODE_VIEW_EVENT">REQUEST_CODE_VIEW_EVENT</a></span> - Static variable in class cmput301f17t09.goalsandhabits.Main_Habits.<a href="../cmput301f17t09/goalsandhabits/Main_Habits/HabitHistoryActivity.html" title="class in cmput301f17t09.goalsandhabits.Main_Habits">HabitHistoryActivity</a></dt>
<dd> </dd>
<dt><span class="memberNameLink"><a href="../cmput301f17t09/goalsandhabits/Main_Habits/MainActivity.html#REQUEST_CODE_VIEW_HABIT">REQUEST_CODE_VIEW_HABIT</a></span> - Static variable in class cmput301f17t09.goalsandhabits.Main_Habits.<a href="../cmput301f17t09/goalsandhabits/Main_Habits/MainActivity.html" title="class in cmput301f17t09.goalsandhabits.Main_Habits">MainActivity</a></dt>
<dd> </dd>
<dt><span class="memberNameLink"><a href="../cmput301f17t09/goalsandhabits/Main_Habits/MainActivity.html#REQUEST_CODE_VIEW_HABIT_HISTORY">REQUEST_CODE_VIEW_HABIT_HISTORY</a></span> - Static variable in class cmput301f17t09.goalsandhabits.Main_Habits.<a href="../cmput301f17t09/goalsandhabits/Main_Habits/MainActivity.html" title="class in cmput301f17t09.goalsandhabits.Main_Habits">MainActivity</a></dt>
<dd> </dd>
</dl>
<a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">D</a> <a href="index-5.html">E</a> <a href="index-6.html">F</a> <a href="index-7.html">G</a> <a href="index-8.html">H</a> <a href="index-9.html">I</a> <a href="index-10.html">L</a> <a href="index-11.html">M</a> <a href="index-12.html">N</a> <a href="index-13.html">O</a> <a href="index-14.html">P</a> <a href="index-15.html">R</a> <a href="index-16.html">S</a> <a href="index-17.html">T</a> <a href="index-18.html">U</a> <a href="index-19.html">V</a> </div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li><a href="../overview-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li class="navBarCell1Rev">Index</li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="index-14.html">Prev Letter</a></li>
<li><a href="index-16.html">Next Letter</a></li>
</ul>
<ul class="navList">
<li><a href="../index.html?index-files/index-15.html" target="_top">Frames</a></li>
<li><a href="index-15.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| {
"content_hash": "7991013efd74c6251824a1f09a2fe30a",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 700,
"avg_line_length": 63.645161290322584,
"alnum_prop": 0.7034972123669538,
"repo_name": "CMPUT301F17T09/GoalsAndHabits",
"id": "e00312c0d14fe9cb78ce4d053c20e3cbb7b8220f",
"size": "9865",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/JavaDoc/index-files/index-15.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "237462"
}
],
"symlink_target": ""
} |
struct Bug {
A: [(); { *"" }.len()],
//~^ ERROR: cannot move a value of type str
//~| ERROR: cannot move out of a shared reference
}
fn main() {}
| {
"content_hash": "d186f075fa68d70168d44bf17d35689a",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 53,
"avg_line_length": 22.714285714285715,
"alnum_prop": 0.5345911949685535,
"repo_name": "aidancully/rust",
"id": "79e75e655ff1f4574420dd0db7319984ef5c7bf2",
"size": "159",
"binary": false,
"copies": "13",
"ref": "refs/heads/master",
"path": "src/test/ui/mir/issue-67947.rs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "26968"
},
{
"name": "Assembly",
"bytes": "20050"
},
{
"name": "Awk",
"bytes": "159"
},
{
"name": "C",
"bytes": "726643"
},
{
"name": "C++",
"bytes": "54397"
},
{
"name": "CSS",
"bytes": "22328"
},
{
"name": "JavaScript",
"bytes": "38337"
},
{
"name": "LLVM",
"bytes": "5040"
},
{
"name": "Lex",
"bytes": "9238"
},
{
"name": "Makefile",
"bytes": "238787"
},
{
"name": "Pascal",
"bytes": "13073"
},
{
"name": "Puppet",
"bytes": "3193"
},
{
"name": "Python",
"bytes": "149063"
},
{
"name": "RenderScript",
"bytes": "26426"
},
{
"name": "Rust",
"bytes": "18504256"
},
{
"name": "Shell",
"bytes": "270708"
},
{
"name": "TeX",
"bytes": "57"
},
{
"name": "Yacc",
"bytes": "80496"
}
],
"symlink_target": ""
} |
// SBT
import sbt._
import Keys._
object BuildSettings {
lazy val compilerOptions = Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-unused-import",
"-Xfuture",
"-Xlint"
)
lazy val javaCompilerOptions = Seq(
"-source", "1.8",
"-target", "1.8"
)
// Makes our SBT app settings available from within the app
lazy val scalifySettings = Seq(
sourceGenerators in Compile += Def.task {
val file = (sourceManaged in Compile).value / "settings.scala"
IO.write(file, """package com.snowplowanalytics.snowplow.collectors.scalastream.generated
|object Settings {
| val organization = "%s"
| val version = "%s"
| val name = "%s"
| val shortName = "ssc"
|}
|""".stripMargin.format(organization.value, version.value, name.value))
Seq(file)
}.taskValue
)
// sbt-assembly settings for building an executable
import sbtassembly.AssemblyPlugin.autoImport._
lazy val sbtAssemblySettings = Seq(
assemblyJarName in assembly := { s"${name.value}-${version.value}.jar" }
)
}
| {
"content_hash": "c5382384e7102369f669e471f61e88d3",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 95,
"avg_line_length": 25.627450980392158,
"alnum_prop": 0.62203519510329,
"repo_name": "sspinc/snowplow",
"id": "693deffbe766cc6c9a833a73442fccb4b31f2f78",
"size": "2021",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "2-collectors/scala-stream-collector/project/BuildSettings.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "119"
},
{
"name": "Clojure",
"bytes": "18945"
},
{
"name": "HTML",
"bytes": "3654"
},
{
"name": "Java",
"bytes": "38516"
},
{
"name": "JavaScript",
"bytes": "7677"
},
{
"name": "LookML",
"bytes": "153378"
},
{
"name": "PLpgSQL",
"bytes": "60098"
},
{
"name": "Python",
"bytes": "10880"
},
{
"name": "Ruby",
"bytes": "195096"
},
{
"name": "Scala",
"bytes": "1484183"
},
{
"name": "Shell",
"bytes": "10735"
},
{
"name": "Thrift",
"bytes": "3707"
}
],
"symlink_target": ""
} |
ABBYY course tasks
| {
"content_hash": "f23fd818dbae364ef52388ade4101ce9",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 18,
"avg_line_length": 19,
"alnum_prop": 0.8421052631578947,
"repo_name": "AlexeyZhuravlev/Conceptions-of-Programming-Languages",
"id": "5f8d47a2fdf41dd471c7d3f47c243c7531ac5757",
"size": "59",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "813"
},
{
"name": "Python",
"bytes": "11497"
}
],
"symlink_target": ""
} |
namespace MiContact.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class BasicInfoAddOnAllTables : DbMigration
{
public override void Up()
{
DropForeignKey("dbo.Email", "ApplicationUserID", "dbo.AspNetUsers");
DropForeignKey("dbo.Image", "ApplicationUserID", "dbo.AspNetUsers");
DropForeignKey("dbo.Social", "ApplicationUserID", "dbo.AspNetUsers");
DropIndex("dbo.Email", new[] { "ApplicationUserID" });
DropIndex("dbo.Image", new[] { "ApplicationUserID" });
DropIndex("dbo.Social", new[] { "ApplicationUserID" });
AddColumn("dbo.Email", "BasicInfoID", c => c.Int(nullable: false));
AddColumn("dbo.Image", "BasicInfoID", c => c.Int(nullable: false));
AddColumn("dbo.Social", "BasicInfoID", c => c.Int(nullable: false));
DropColumn("dbo.Email", "ApplicationUserID");
DropColumn("dbo.Image", "ApplicationUserID");
DropColumn("dbo.Social", "ApplicationUserID");
}
public override void Down()
{
AddColumn("dbo.Social", "ApplicationUserID", c => c.String(maxLength: 128));
AddColumn("dbo.Image", "ApplicationUserID", c => c.String(maxLength: 128));
AddColumn("dbo.Email", "ApplicationUserID", c => c.String(maxLength: 128));
DropColumn("dbo.Social", "BasicInfoID");
DropColumn("dbo.Image", "BasicInfoID");
DropColumn("dbo.Email", "BasicInfoID");
CreateIndex("dbo.Social", "ApplicationUserID");
CreateIndex("dbo.Image", "ApplicationUserID");
CreateIndex("dbo.Email", "ApplicationUserID");
AddForeignKey("dbo.Social", "ApplicationUserID", "dbo.AspNetUsers", "Id");
AddForeignKey("dbo.Image", "ApplicationUserID", "dbo.AspNetUsers", "Id");
AddForeignKey("dbo.Email", "ApplicationUserID", "dbo.AspNetUsers", "Id");
}
}
}
| {
"content_hash": "ade9c5dfe8182ccdf9e76d3d516ca090",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 88,
"avg_line_length": 50.35,
"alnum_prop": 0.5978152929493545,
"repo_name": "janaanimator/ASP.NET-MVC-MiContact",
"id": "a761e368e308b136cee107dd7c3fc0ca8554ad81",
"size": "2014",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "MiContact/Migrations/201702011408238_BasicInfoAddOnAllTables.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "100"
},
{
"name": "C#",
"bytes": "236844"
},
{
"name": "CSS",
"bytes": "490761"
},
{
"name": "HTML",
"bytes": "112046"
},
{
"name": "JavaScript",
"bytes": "999695"
}
],
"symlink_target": ""
} |
def merge(left, right):
"""Merges two sorted lists.
Args:
left: A sorted list.
right: A sorted list.
Returns:
The sorted list resulting from merging the two sorted sublists.
Requires:
left and right are sorted.
"""
items = []
i = 0
j = 0
while i < len(left) and j < len(right):
if left[i] <= right[j]:
items.append(left[i])
i = i + 1
else:
items.append(right[j])
j = j + 1
if i < len(left):
items.extend(left[i:])
elif j < len(right):
items.extend(right[j:])
return items
def merge_sort(items):
"""Sorts a list of items.
Uses merge sort to sort the list items.
Args:
items: A list of items.
Returns:
The sorted list of items.
"""
n = len(items)
if n < 2:
return items
m = n // 2
left = merge_sort(items[:m])
right = merge_sort(items[m:])
return merge(left, right)
| {
"content_hash": "7334983c546ba019831d06e06ef0f7aa",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 71,
"avg_line_length": 19.403846153846153,
"alnum_prop": 0.512388503468781,
"repo_name": "kaveh256/clrs",
"id": "25d8fc58b37e8b8f1422cad5bf17ecef85d2df59",
"size": "1024",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "python/merge_sort_improved.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "15107"
}
],
"symlink_target": ""
} |
package org.jcodec.movtool.streaming.tracks.avc;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import org.jcodec.codecs.h264.H264Decoder;
import org.jcodec.codecs.h264.H264Encoder;
import org.jcodec.codecs.h264.H264Utils;
import org.jcodec.codecs.h264.H264Utils.SliceHeaderTweaker;
import org.jcodec.codecs.h264.encode.H264FixedRateControl;
import org.jcodec.codecs.h264.io.model.NALUnit;
import org.jcodec.codecs.h264.io.model.NALUnitType;
import org.jcodec.codecs.h264.io.model.PictureParameterSet;
import org.jcodec.codecs.h264.io.model.SeqParameterSet;
import org.jcodec.codecs.h264.io.model.SliceHeader;
import org.jcodec.codecs.h264.mp4.AvcCBox;
import org.jcodec.common.NIOUtils;
import org.jcodec.common.model.ColorSpace;
import org.jcodec.common.model.Picture;
import org.jcodec.movtool.streaming.CodecMeta;
import org.jcodec.movtool.streaming.VideoCodecMeta;
import org.jcodec.movtool.streaming.VirtualPacket;
import org.jcodec.movtool.streaming.VirtualTrack;
import org.jcodec.movtool.streaming.tracks.ClipTrack;
import org.jcodec.movtool.streaming.tracks.VirtualPacketWrapper;
/**
* This class is part of JCodec ( www.jcodec.org ) This software is distributed
* under FreeBSD License
*
* Clips AVC track replacing the remainder of a GOP at cut point with I-frames
*
* @author The JCodec project
*
*/
public class AVCClipTrack extends ClipTrack {
private AvcCBox avcC;
private H264FixedRateControl rc;
private int mbW;
private int mbH;
private VideoCodecMeta se;
private int frameSize;
private SeqParameterSet encSPS;
private PictureParameterSet encPPS;
public AVCClipTrack(VirtualTrack src, int frameFrom, int frameTo) {
super(src, frameFrom, frameTo);
VideoCodecMeta codecMeta = (VideoCodecMeta)src.getCodecMeta();
if (!"avc1".equals(codecMeta.getFourcc()))
throw new RuntimeException("Not an AVC source track");
rc = new H264FixedRateControl(1024);
H264Encoder encoder = new H264Encoder(rc);
avcC = H264Utils.parseAVCC(codecMeta.getCodecPrivate());
SeqParameterSet sps = H264Utils.readSPS(NIOUtils.duplicate(avcC.getSpsList().get(0)));
mbW = sps.pic_width_in_mbs_minus1 + 1;
mbH = H264Utils.getPicHeightInMbs(sps);
encSPS = encoder.initSPS(H264Utils.getPicSize(sps));
encSPS.seq_parameter_set_id = 1;
encPPS = encoder.initPPS();
encPPS.seq_parameter_set_id = 1;
encPPS.pic_parameter_set_id = 1;
encSPS.profile_idc = sps.profile_idc;
encSPS.level_idc = sps.level_idc;
encSPS.frame_mbs_only_flag = sps.frame_mbs_only_flag;
encSPS.frame_crop_bottom_offset = sps.frame_crop_bottom_offset;
encSPS.frame_crop_left_offset = sps.frame_crop_left_offset;
encSPS.frame_crop_right_offset = sps.frame_crop_right_offset;
encSPS.frame_crop_top_offset = sps.frame_crop_top_offset;
encSPS.vuiParams = sps.vuiParams;
avcC.getSpsList().add(H264Utils.writeSPS(encSPS, 128));
avcC.getPpsList().add(H264Utils.writePPS(encPPS, 20));
se = new VideoCodecMeta("avc1", H264Utils.getAvcCData(avcC), codecMeta.getSize(), codecMeta.getPasp());
frameSize = rc.calcFrameSize(mbW * mbH);
frameSize += frameSize >> 4;
}
protected List<VirtualPacket> getGop(VirtualTrack src, int from) throws IOException {
VirtualPacket packet = src.nextPacket();
List<VirtualPacket> head = new ArrayList<VirtualPacket>();
while (packet != null && packet.getFrameNo() < from) {
if (packet.isKeyframe())
head.clear();
head.add(packet);
packet = src.nextPacket();
}
List<VirtualPacket> tail = new ArrayList<VirtualPacket>();
while (packet != null && !packet.isKeyframe()) {
tail.add(packet);
packet = src.nextPacket();
}
List<VirtualPacket> gop = new ArrayList<VirtualPacket>();
GopTranscoder tr = new GopTranscoder(head, tail);
for (int i = 0; i < tail.size(); i++)
gop.add(new TranscodePacket(tail.get(i), tr, i));
gop.add(packet);
return gop;
}
public class GopTranscoder {
private List<VirtualPacket> tail;
private List<VirtualPacket> head;
private List<ByteBuffer> result;
public GopTranscoder(List<VirtualPacket> head, List<VirtualPacket> tail) {
this.head = head;
this.tail = tail;
}
public List<ByteBuffer> transcode() throws IOException {
H264Decoder decoder = new H264Decoder();
decoder.addSps(avcC.getSpsList());
decoder.addPps(avcC.getPpsList());
Picture buf = Picture.create(mbW << 4, mbH << 4, ColorSpace.YUV420);
Picture dec = null;
for (VirtualPacket virtualPacket : head) {
dec = decoder.decodeFrame(H264Utils.splitMOVPacket(virtualPacket.getData(), avcC), buf.getData());
}
H264Encoder encoder = new H264Encoder(rc);
ByteBuffer tmp = ByteBuffer.allocate(frameSize);
List<ByteBuffer> result = new ArrayList<ByteBuffer>();
for (VirtualPacket pkt : tail) {
dec = decoder.decodeFrame(H264Utils.splitMOVPacket(pkt.getData(), avcC), buf.getData());
tmp.clear();
ByteBuffer res = encoder.encodeFrame(dec, tmp);
ByteBuffer out = ByteBuffer.allocate(frameSize);
processFrame(res, out);
result.add(out);
}
return result;
}
private void processFrame(ByteBuffer in, ByteBuffer out) {
SliceHeaderTweaker st = new H264Utils.SliceHeaderTweaker() {
@Override
protected void tweak(SliceHeader sh) {
sh.pic_parameter_set_id = 1;
}
};
ByteBuffer dup = in.duplicate();
while (dup.hasRemaining()) {
ByteBuffer buf = H264Utils.nextNALUnit(dup);
if (buf == null)
break;
NALUnit nu = NALUnit.read(buf);
if (nu.type == NALUnitType.IDR_SLICE) {
ByteBuffer sp = out.duplicate();
out.putInt(0);
nu.write(out);
st.run(buf, out, nu, encSPS, encPPS);
sp.putInt(out.position() - sp.position() - 4);
}
}
if (out.remaining() >= 5) {
out.putInt(out.remaining() - 4);
new NALUnit(NALUnitType.FILLER_DATA, 0).write(out);
}
out.clear();
}
public synchronized List<ByteBuffer> getResult() throws IOException {
if (result == null)
result = transcode();
return result;
}
}
@Override
public CodecMeta getCodecMeta() {
return se;
}
public class TranscodePacket extends VirtualPacketWrapper {
private GopTranscoder tr;
private int off;
public TranscodePacket(VirtualPacket src, GopTranscoder tr, int off) {
super(src);
this.tr = tr;
this.off = off;
}
@Override
public ByteBuffer getData() throws IOException {
return NIOUtils.duplicate(tr.getResult().get(off));
}
@Override
public int getDataLen() throws IOException {
return frameSize;
}
@Override
public boolean isKeyframe() {
return true;
}
}
} | {
"content_hash": "db9eedbcbff48b2600971e71ac04b2fb",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 114,
"avg_line_length": 34.780269058295964,
"alnum_prop": 0.6150077359463642,
"repo_name": "java02014/jcodec",
"id": "deb7d4b17c0bc619599c99a5e0c53e5952c7f3e4",
"size": "7756",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/org/jcodec/movtool/streaming/tracks/avc/AVCClipTrack.java",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "CSS",
"bytes": "6726"
},
{
"name": "HTML",
"bytes": "3075"
},
{
"name": "Java",
"bytes": "4127864"
},
{
"name": "PostScript",
"bytes": "24963"
},
{
"name": "Shell",
"bytes": "158"
}
],
"symlink_target": ""
} |
<?php
namespace Psy\Formatter;
use Psy\Exception\RuntimeException;
/**
* A pretty-printer for code.
*/
class CodeFormatter implements Formatter
{
/**
* Format the code represented by $reflector.
*
* @param \Reflector $reflector
*
* @return string formatted code
*/
public static function format(\Reflector $reflector)
{
if ($fileName = $reflector->getFileName()) {
if (!is_file($fileName)) {
throw new RuntimeException('Source code unavailable.');
}
$file = file_get_contents($fileName);
$lines = preg_split('/\r?\n/', $file);
$start = $reflector->getStartLine() - 1;
$end = $reflector->getEndLine() - $start;
$code = array_slice($lines, $start, $end);
// no need to escape this bad boy, since (for now) it's being output raw.
// return OutputFormatter::escape(implode(PHP_EOL, $code));
return implode(PHP_EOL, $code);
} else {
throw new RuntimeException('Source code unavailable.');
}
}
}
| {
"content_hash": "c1a64bb73ebb243c63bfe33eb6b7f591",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 85,
"avg_line_length": 26.714285714285715,
"alnum_prop": 0.5588235294117647,
"repo_name": "barryvdh/psysh",
"id": "c4e6a6652a90d70964ae4380af5c8c4c46632182",
"size": "1327",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Psy/Formatter/CodeFormatter.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "393647"
},
{
"name": "Python",
"bytes": "6551"
}
],
"symlink_target": ""
} |
from __future__ import absolute_import, division, unicode_literals
import itertools
import pytest
try:
import lxml.etree
except ImportError:
pass
from .support import treeTypes
from html5lib import html5parser, treewalkers
from html5lib.filters.lint import Filter as Lint
import re
attrlist = re.compile(r"^(\s+)\w+=.*(\n\1\w+=.*)+", re.M)
def sortattrs(x):
lines = x.group(0).split("\n")
lines.sort()
return "\n".join(lines)
def test_all_tokens():
expected = [
{'data': {}, 'type': 'StartTag', 'namespace': 'http://www.w3.org/1999/xhtml', 'name': 'html'},
{'data': {}, 'type': 'StartTag', 'namespace': 'http://www.w3.org/1999/xhtml', 'name': 'head'},
{'type': 'EndTag', 'namespace': 'http://www.w3.org/1999/xhtml', 'name': 'head'},
{'data': {}, 'type': 'StartTag', 'namespace': 'http://www.w3.org/1999/xhtml', 'name': 'body'},
{'data': 'a', 'type': 'Characters'},
{'data': {}, 'type': 'StartTag', 'namespace': 'http://www.w3.org/1999/xhtml', 'name': 'div'},
{'data': 'b', 'type': 'Characters'},
{'type': 'EndTag', 'namespace': 'http://www.w3.org/1999/xhtml', 'name': 'div'},
{'data': 'c', 'type': 'Characters'},
{'type': 'EndTag', 'namespace': 'http://www.w3.org/1999/xhtml', 'name': 'body'},
{'type': 'EndTag', 'namespace': 'http://www.w3.org/1999/xhtml', 'name': 'html'}
]
for _, treeCls in sorted(treeTypes.items()):
if treeCls is None:
continue
p = html5parser.HTMLParser(tree=treeCls["builder"])
document = p.parse("<html><head></head><body>a<div>b</div>c</body></html>")
document = treeCls.get("adapter", lambda x: x)(document)
output = Lint(treeCls["walker"](document))
for expectedToken, outputToken in zip(expected, output):
assert expectedToken == outputToken
def set_attribute_on_first_child(docfrag, name, value, treeName):
"""naively sets an attribute on the first child of the document
fragment passed in"""
setter = {'ElementTree': lambda d: d[0].set,
'DOM': lambda d: d.firstChild.setAttribute}
setter['cElementTree'] = setter['ElementTree']
try:
setter.get(treeName, setter['DOM'])(docfrag)(name, value)
except AttributeError:
setter['ElementTree'](docfrag)(name, value)
def runTreewalkerEditTest(intext, expected, attrs_to_add, tree):
"""tests what happens when we add attributes to the intext"""
treeName, treeClass = tree
if treeClass is None:
pytest.skip("Treebuilder not loaded")
parser = html5parser.HTMLParser(tree=treeClass["builder"])
document = parser.parseFragment(intext)
for nom, val in attrs_to_add:
set_attribute_on_first_child(document, nom, val, treeName)
document = treeClass.get("adapter", lambda x: x)(document)
output = treewalkers.pprint(treeClass["walker"](document))
output = attrlist.sub(sortattrs, output)
if output not in expected:
raise AssertionError("TreewalkerEditTest: %s\nExpected:\n%s\nReceived:\n%s" % (treeName, expected, output))
def test_treewalker_six_mix():
"""Str/Unicode mix. If str attrs added to tree"""
# On Python 2.x string literals are of type str. Unless, like this
# file, the programmer imports unicode_literals from __future__.
# In that case, string literals become objects of type unicode.
# This test simulates a Py2 user, modifying attributes on a document
# fragment but not using the u'' syntax nor importing unicode_literals
sm_tests = [
('<a href="http://example.com">Example</a>',
[(str('class'), str('test123'))],
'<a>\n class="test123"\n href="http://example.com"\n "Example"'),
('<link href="http://example.com/cow">',
[(str('rel'), str('alternate'))],
'<link>\n href="http://example.com/cow"\n rel="alternate"\n "Example"')
]
for tree in sorted(treeTypes.items()):
for intext, attrs, expected in sm_tests:
yield runTreewalkerEditTest, intext, expected, attrs, tree
@pytest.mark.parametrize("tree,char", itertools.product(sorted(treeTypes.items()), ["x", "\u1234"]))
def test_fragment_single_char(tree, char):
expected = [
{'data': char, 'type': 'Characters'}
]
treeName, treeClass = tree
if treeClass is None:
pytest.skip("Treebuilder not loaded")
parser = html5parser.HTMLParser(tree=treeClass["builder"])
document = parser.parseFragment(char)
document = treeClass.get("adapter", lambda x: x)(document)
output = Lint(treeClass["walker"](document))
assert list(output) == expected
@pytest.mark.skipif(treeTypes["lxml"] is None, reason="lxml not importable")
def test_lxml_xml():
expected = [
{'data': {}, 'name': 'div', 'namespace': None, 'type': 'StartTag'},
{'data': {}, 'name': 'div', 'namespace': None, 'type': 'StartTag'},
{'name': 'div', 'namespace': None, 'type': 'EndTag'},
{'name': 'div', 'namespace': None, 'type': 'EndTag'}
]
lxmltree = lxml.etree.fromstring('<div><div></div></div>')
walker = treewalkers.getTreeWalker('lxml')
output = Lint(walker(lxmltree))
assert list(output) == expected
| {
"content_hash": "f477ed3aad94705d24186bb21cd1625a",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 115,
"avg_line_length": 38.588235294117645,
"alnum_prop": 0.6219512195121951,
"repo_name": "pannal/Subliminal.bundle",
"id": "67fc89e55f3b4ab6e1f291c46f1a99f7bc442998",
"size": "5248",
"binary": false,
"copies": "27",
"ref": "refs/heads/master",
"path": "Contents/Libraries/Shared/html5lib/tests/test_treewalkers.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "3012769"
},
{
"name": "Python",
"bytes": "3311785"
},
{
"name": "Shell",
"bytes": "273"
}
],
"symlink_target": ""
} |
<html><body>
<style>
body, h1, h2, h3, div, span, p, pre, a {
margin: 0;
padding: 0;
border: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
body {
font-size: 13px;
padding: 1em;
}
h1 {
font-size: 26px;
margin-bottom: 1em;
}
h2 {
font-size: 24px;
margin-bottom: 1em;
}
h3 {
font-size: 20px;
margin-bottom: 1em;
margin-top: 1em;
}
pre, code {
line-height: 1.5;
font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}
pre {
margin-top: 0.5em;
}
h1, h2, h3, p {
font-family: Arial, sans serif;
}
h1, h2, h3 {
border-bottom: solid #CCC 1px;
}
.toc_element {
margin-top: 0.5em;
}
.firstline {
margin-left: 2 em;
}
.method {
margin-top: 1em;
border: solid 1px #CCC;
padding: 1em;
background: #EEE;
}
.details {
font-weight: bold;
font-size: 14px;
}
</style>
<h1><a href="iap_v1beta1.html">Cloud Identity-Aware Proxy API</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
<code><a href="iap_v1beta1.v1beta1.html">v1beta1()</a></code>
</p>
<p class="firstline">Returns the v1beta1 Resource.</p>
<p class="toc_element">
<code><a href="#close">close()</a></code></p>
<p class="firstline">Close httplib2 connections.</p>
<p class="toc_element">
<code><a href="#new_batch_http_request">new_batch_http_request()</a></code></p>
<p class="firstline">Create a BatchHttpRequest object based on the discovery document.</p>
<h3>Method Details</h3>
<div class="method">
<code class="details" id="close">close()</code>
<pre>Close httplib2 connections.</pre>
</div>
<div class="method">
<code class="details" id="new_batch_http_request">new_batch_http_request()</code>
<pre>Create a BatchHttpRequest object based on the discovery document.
Args:
callback: callable, A callback to be called for each response, of the
form callback(id, response, exception). The first parameter is the
request id, and the second is the deserialized response object. The
third is an apiclient.errors.HttpError exception object if an HTTP
error occurred while processing the request, or None if no error
occurred.
Returns:
A BatchHttpRequest object based on the discovery document.
</pre>
</div>
</body></html> | {
"content_hash": "8b2442224314537a843fe6983a9a80f7",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 99,
"avg_line_length": 22.225225225225227,
"alnum_prop": 0.6274827725982975,
"repo_name": "googleapis/google-api-python-client",
"id": "14f2e687f47c9b03c40db6c9c7c23044c0ea2b44",
"size": "2467",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "docs/dyn/iap_v1beta1.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Makefile",
"bytes": "1276"
},
{
"name": "Python",
"bytes": "482401"
},
{
"name": "Shell",
"bytes": "32576"
}
],
"symlink_target": ""
} |
/* 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.
*/
package org.activiti5.engine.impl.bpmn.behavior;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.activiti.engine.DynamicBpmnConstants;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.Expression;
import org.activiti.engine.delegate.TaskListener;
import org.activiti.engine.delegate.event.ActivitiEventType;
import org.activiti.engine.impl.calendar.BusinessCalendar;
import org.activiti5.engine.ActivitiException;
import org.activiti5.engine.ActivitiIllegalArgumentException;
import org.activiti5.engine.delegate.event.impl.ActivitiEventBuilder;
import org.activiti5.engine.impl.bpmn.helper.SkipExpressionUtil;
import org.activiti5.engine.impl.context.Context;
import org.activiti5.engine.impl.el.ExpressionManager;
import org.activiti5.engine.impl.persistence.entity.ExecutionEntity;
import org.activiti5.engine.impl.persistence.entity.TaskEntity;
import org.activiti5.engine.impl.pvm.delegate.ActivityExecution;
import org.activiti5.engine.impl.task.TaskDefinition;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
/**
* activity implementation for the user task.
*
* @author Joram Barrez
*/
public class UserTaskActivityBehavior extends TaskActivityBehavior {
private static final long serialVersionUID = 1L;
private static final Logger LOGGER = LoggerFactory.getLogger(UserTaskActivityBehavior.class);
protected String userTaskId;
protected TaskDefinition taskDefinition;
public UserTaskActivityBehavior(String userTaskId, TaskDefinition taskDefinition) {
this.userTaskId = userTaskId;
this.taskDefinition = taskDefinition;
}
public void execute(DelegateExecution execution) {
ActivityExecution activityExecution = (ActivityExecution) execution;
TaskEntity task = TaskEntity.createAndInsert(activityExecution);
task.setExecution(execution);
Expression activeNameExpression = null;
Expression activeDescriptionExpression = null;
Expression activeDueDateExpression = null;
Expression activePriorityExpression = null;
Expression activeCategoryExpression = null;
Expression activeFormKeyExpression = null;
Expression activeSkipExpression = null;
Expression activeAssigneeExpression = null;
Expression activeOwnerExpression = null;
Set<Expression> activeCandidateUserExpressions = null;
Set<Expression> activeCandidateGroupExpressions = null;
if (Context.getProcessEngineConfiguration().isEnableProcessDefinitionInfoCache()) {
ObjectNode taskElementProperties = Context.getBpmnOverrideElementProperties(userTaskId, execution.getProcessDefinitionId());
activeNameExpression = getActiveValue(taskDefinition.getNameExpression(), DynamicBpmnConstants.USER_TASK_NAME, taskElementProperties);
taskDefinition.setNameExpression(activeNameExpression);
activeDescriptionExpression = getActiveValue(taskDefinition.getDescriptionExpression(), DynamicBpmnConstants.USER_TASK_DESCRIPTION, taskElementProperties);
taskDefinition.setDescriptionExpression(activeDescriptionExpression);
activeDueDateExpression = getActiveValue(taskDefinition.getDueDateExpression(), DynamicBpmnConstants.USER_TASK_DUEDATE, taskElementProperties);
taskDefinition.setDueDateExpression(activeDueDateExpression);
activePriorityExpression = getActiveValue(taskDefinition.getPriorityExpression(), DynamicBpmnConstants.USER_TASK_PRIORITY, taskElementProperties);
taskDefinition.setPriorityExpression(activePriorityExpression);
activeCategoryExpression = getActiveValue(taskDefinition.getCategoryExpression(), DynamicBpmnConstants.USER_TASK_CATEGORY, taskElementProperties);
taskDefinition.setCategoryExpression(activeCategoryExpression);
activeFormKeyExpression = getActiveValue(taskDefinition.getFormKeyExpression(), DynamicBpmnConstants.USER_TASK_FORM_KEY, taskElementProperties);
taskDefinition.setFormKeyExpression(activeFormKeyExpression);
activeSkipExpression = getActiveValue(taskDefinition.getSkipExpression(), DynamicBpmnConstants.TASK_SKIP_EXPRESSION, taskElementProperties);
taskDefinition.setSkipExpression(activeSkipExpression);
activeAssigneeExpression = getActiveValue(taskDefinition.getAssigneeExpression(), DynamicBpmnConstants.USER_TASK_ASSIGNEE, taskElementProperties);
taskDefinition.setAssigneeExpression(activeAssigneeExpression);
activeOwnerExpression = getActiveValue(taskDefinition.getOwnerExpression(), DynamicBpmnConstants.USER_TASK_OWNER, taskElementProperties);
taskDefinition.setOwnerExpression(activeOwnerExpression);
activeCandidateUserExpressions = getActiveValueSet(taskDefinition.getCandidateUserIdExpressions(), DynamicBpmnConstants.USER_TASK_CANDIDATE_USERS, taskElementProperties);
taskDefinition.setCandidateUserIdExpressions(activeCandidateUserExpressions);
activeCandidateGroupExpressions = getActiveValueSet(taskDefinition.getCandidateGroupIdExpressions(), DynamicBpmnConstants.USER_TASK_CANDIDATE_GROUPS, taskElementProperties);
taskDefinition.setCandidateGroupIdExpressions(activeCandidateGroupExpressions);
} else {
activeNameExpression = taskDefinition.getNameExpression();
activeDescriptionExpression = taskDefinition.getDescriptionExpression();
activeDueDateExpression = taskDefinition.getDueDateExpression();
activePriorityExpression = taskDefinition.getPriorityExpression();
activeCategoryExpression = taskDefinition.getCategoryExpression();
activeFormKeyExpression = taskDefinition.getFormKeyExpression();
activeSkipExpression = taskDefinition.getSkipExpression();
activeAssigneeExpression = taskDefinition.getAssigneeExpression();
activeOwnerExpression = taskDefinition.getOwnerExpression();
activeCandidateUserExpressions = taskDefinition.getCandidateUserIdExpressions();
activeCandidateGroupExpressions = taskDefinition.getCandidateGroupIdExpressions();
}
task.setTaskDefinition(taskDefinition);
if (activeNameExpression != null) {
String name = null;
try {
name = (String) activeNameExpression.getValue(execution);
} catch (ActivitiException e) {
name = activeNameExpression.getExpressionText();
LOGGER.warn("property not found in task name expression " + e.getMessage());
}
task.setName(name);
}
if (activeDescriptionExpression != null) {
String description = null;
try {
description = (String) activeDescriptionExpression.getValue(execution);
} catch (ActivitiException e) {
description = activeDescriptionExpression.getExpressionText();
LOGGER.warn("property not found in task description expression " + e.getMessage());
}
task.setDescription(description);
}
if (activeDueDateExpression != null) {
Object dueDate = activeDueDateExpression.getValue(execution);
if (dueDate != null) {
if (dueDate instanceof Date) {
task.setDueDate((Date) dueDate);
} else if (dueDate instanceof String) {
BusinessCalendar businessCalendar = Context
.getProcessEngineConfiguration()
.getBusinessCalendarManager()
.getBusinessCalendar(taskDefinition.getBusinessCalendarNameExpression().getValue(execution).toString());
task.setDueDate(businessCalendar.resolveDuedate((String) dueDate));
} else {
throw new ActivitiIllegalArgumentException("Due date expression does not resolve to a Date or Date string: " +
activeDueDateExpression.getExpressionText());
}
}
}
if (activePriorityExpression != null) {
final Object priority = activePriorityExpression.getValue(execution);
if (priority != null) {
if (priority instanceof String) {
try {
task.setPriority(Integer.valueOf((String) priority));
} catch (NumberFormatException e) {
throw new ActivitiIllegalArgumentException("Priority does not resolve to a number: " + priority, e);
}
} else if (priority instanceof Number) {
task.setPriority(((Number) priority).intValue());
} else {
throw new ActivitiIllegalArgumentException("Priority expression does not resolve to a number: " +
activePriorityExpression.getExpressionText());
}
}
}
if (activeCategoryExpression != null) {
final Object category = activeCategoryExpression.getValue(execution);
if (category != null) {
if (category instanceof String) {
task.setCategory((String) category);
} else {
throw new ActivitiIllegalArgumentException("Category expression does not resolve to a string: " +
activeCategoryExpression.getExpressionText());
}
}
}
if (activeFormKeyExpression != null) {
final Object formKey = activeFormKeyExpression.getValue(execution);
if (formKey != null) {
if (formKey instanceof String) {
task.setFormKey((String) formKey);
} else {
throw new ActivitiIllegalArgumentException("FormKey expression does not resolve to a string: " +
activeFormKeyExpression.getExpressionText());
}
}
}
Expression skipExpression = taskDefinition.getSkipExpression();
boolean skipUserTask = SkipExpressionUtil.isSkipExpressionEnabled(activityExecution, skipExpression) &&
SkipExpressionUtil.shouldSkipFlowElement(activityExecution, skipExpression);
if (!skipUserTask) {
handleAssignments(activeAssigneeExpression, activeOwnerExpression, activeCandidateUserExpressions,
activeCandidateGroupExpressions, task, activityExecution);
}
task.fireEvent(TaskListener.EVENTNAME_CREATE);
// All properties set, now firing 'create' events
if (Context.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
Context.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
ActivitiEventBuilder.createEntityEvent(ActivitiEventType.TASK_CREATED, task));
}
if (skipUserTask) {
task.complete(null, false);
}
}
public void signal(ActivityExecution execution, String signalName, Object signalData) throws Exception {
if (!((ExecutionEntity) execution).getTasks().isEmpty())
throw new ActivitiException("UserTask should not be signalled before complete");
leave(execution);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
protected void handleAssignments(Expression assigneeExpression, Expression ownerExpression, Set<Expression> candidateUserExpressions,
Set<Expression> candidateGroupExpressions, TaskEntity task, ActivityExecution execution) {
if (assigneeExpression != null) {
Object assigneeExpressionValue = assigneeExpression.getValue(execution);
String assigneeValue = null;
if (assigneeExpressionValue != null) {
assigneeValue = assigneeExpressionValue.toString();
}
task.setAssignee(assigneeValue, true, false);
}
if (ownerExpression != null) {
Object ownerExpressionValue = ownerExpression.getValue(execution);
String ownerValue = null;
if (ownerExpressionValue != null) {
ownerValue = ownerExpressionValue.toString();
}
task.setOwner(ownerValue);
}
if (candidateGroupExpressions != null && !candidateGroupExpressions.isEmpty()) {
for (Expression groupIdExpr : candidateGroupExpressions) {
Object value = groupIdExpr.getValue(execution);
if (value instanceof String) {
List<String> candidates = extractCandidates((String) value);
task.addCandidateGroups(candidates);
} else if (value instanceof Collection) {
task.addCandidateGroups((Collection) value);
} else {
throw new ActivitiIllegalArgumentException("Expression did not resolve to a string or collection of strings");
}
}
}
if (candidateUserExpressions != null && !candidateUserExpressions.isEmpty()) {
for (Expression userIdExpr : candidateUserExpressions) {
Object value = userIdExpr.getValue(execution);
if (value instanceof String) {
List<String> candiates = extractCandidates((String) value);
task.addCandidateUsers(candiates);
} else if (value instanceof Collection) {
task.addCandidateUsers((Collection) value);
} else {
throw new ActivitiException("Expression did not resolve to a string or collection of strings");
}
}
}
if (!taskDefinition.getCustomUserIdentityLinkExpressions().isEmpty()) {
Map<String, Set<Expression>> identityLinks = taskDefinition.getCustomUserIdentityLinkExpressions();
for (String identityLinkType : identityLinks.keySet()) {
for (Expression idExpression : identityLinks.get(identityLinkType) ) {
Object value = idExpression.getValue(execution);
if (value instanceof String) {
List<String> userIds = extractCandidates((String) value);
for (String userId : userIds) {
task.addUserIdentityLink(userId, identityLinkType);
}
} else if (value instanceof Collection) {
Iterator userIdSet = ((Collection) value).iterator();
while (userIdSet.hasNext()) {
task.addUserIdentityLink((String)userIdSet.next(), identityLinkType);
}
} else {
throw new ActivitiException("Expression did not resolve to a string or collection of strings");
}
}
}
}
if (!taskDefinition.getCustomGroupIdentityLinkExpressions().isEmpty()) {
Map<String, Set<Expression>> identityLinks = taskDefinition.getCustomGroupIdentityLinkExpressions();
for (String identityLinkType : identityLinks.keySet()) {
for (Expression idExpression : identityLinks.get(identityLinkType) ) {
Object value = idExpression.getValue(execution);
if (value instanceof String) {
List<String> groupIds = extractCandidates((String) value);
for (String groupId : groupIds) {
task.addGroupIdentityLink(groupId, identityLinkType);
}
} else if (value instanceof Collection) {
Iterator groupIdSet = ((Collection) value).iterator();
while (groupIdSet.hasNext()) {
task.addGroupIdentityLink((String)groupIdSet.next(), identityLinkType);
}
} else {
throw new ActivitiException("Expression did not resolve to a string or collection of strings");
}
}
}
}
}
/**
* Extract a candidate list from a string.
*
* @param str
* @return
*/
protected List<String> extractCandidates(String str) {
return Arrays.asList(str.split("[\\s]*,[\\s]*"));
}
protected Expression getActiveValue(Expression originalValue, String propertyName, ObjectNode taskElementProperties) {
Expression activeValue = originalValue;
if (taskElementProperties != null) {
JsonNode overrideValueNode = taskElementProperties.get(propertyName);
if (overrideValueNode != null) {
if (overrideValueNode.isNull()) {
activeValue = null;
} else {
activeValue = Context.getProcessEngineConfiguration().getExpressionManager().createExpression(overrideValueNode.asText());
}
}
}
return activeValue;
}
protected Set<Expression> getActiveValueSet(Set<Expression> originalValues, String propertyName, ObjectNode taskElementProperties) {
Set<Expression> activeValues = originalValues;
if (taskElementProperties != null) {
JsonNode overrideValuesNode = taskElementProperties.get(propertyName);
if (overrideValuesNode != null) {
if (overrideValuesNode.isNull() || overrideValuesNode.isArray() == false || overrideValuesNode.size() == 0) {
activeValues = null;
} else {
ExpressionManager expressionManager = Context.getProcessEngineConfiguration().getExpressionManager();
activeValues = new HashSet<Expression>();
for (JsonNode valueNode : overrideValuesNode) {
activeValues.add(expressionManager.createExpression(valueNode.asText()));
}
}
}
}
return activeValues;
}
// getters and setters //////////////////////////////////////////////////////
public TaskDefinition getTaskDefinition() {
return taskDefinition;
}
}
| {
"content_hash": "4de67b10249138a5f652489dfae8bbcf",
"timestamp": "",
"source": "github",
"line_count": 378,
"max_line_length": 179,
"avg_line_length": 46.044973544973544,
"alnum_prop": 0.7218040792875611,
"repo_name": "roberthafner/flowable-engine",
"id": "6c305fec704b5b3429bcab386b0ad3010b4d0f0a",
"size": "17405",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/flowable5-engine/src/main/java/org/activiti5/engine/impl/bpmn/behavior/UserTaskActivityBehavior.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "96556"
},
{
"name": "Batchfile",
"bytes": "166"
},
{
"name": "CSS",
"bytes": "654297"
},
{
"name": "HTML",
"bytes": "817955"
},
{
"name": "Java",
"bytes": "21184592"
},
{
"name": "JavaScript",
"bytes": "12295430"
},
{
"name": "Shell",
"bytes": "9820"
}
],
"symlink_target": ""
} |
package org.mybatis.generator.codegen;
import java.util.List;
import org.mybatis.generator.api.IntrospectedTable;
import org.mybatis.generator.api.ProgressCallback;
import org.mybatis.generator.config.Context;
/**
*
* @author Jeff Butler
*
*/
public abstract class AbstractGenerator {
protected Context context;
protected IntrospectedTable introspectedTable;
protected List<String> warnings;
protected ProgressCallback progressCallback;
public AbstractGenerator() {
super();
}
public Context getContext() {
return context;
}
public void setContext(Context context) {
this.context = context;
}
public IntrospectedTable getIntrospectedTable() {
return introspectedTable;
}
public void setIntrospectedTable(IntrospectedTable introspectedTable) {
this.introspectedTable = introspectedTable;
}
public List<String> getWarnings() {
return warnings;
}
public void setWarnings(List<String> warnings) {
this.warnings = warnings;
}
public ProgressCallback getProgressCallback() {
return progressCallback;
}
public void setProgressCallback(ProgressCallback progressCallback) {
this.progressCallback = progressCallback;
}
}
| {
"content_hash": "a1c5f2f7c7c535688b4ebb97668f4e1b",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 75,
"avg_line_length": 23.035714285714285,
"alnum_prop": 0.703875968992248,
"repo_name": "li24361/mybatis-generator-core",
"id": "991b0f125888a3a0f382c7b6ffee52f62c33f9fc",
"size": "1939",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/org/mybatis/generator/codegen/AbstractGenerator.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "117"
},
{
"name": "HTML",
"bytes": "259159"
},
{
"name": "Java",
"bytes": "1607686"
}
],
"symlink_target": ""
} |
package org.apache.accumulo.server.master.tableOps;
import org.apache.accumulo.trace.instrument.Span;
import org.apache.accumulo.trace.instrument.Trace;
import org.apache.accumulo.trace.instrument.Tracer;
import org.apache.accumulo.trace.thrift.TInfo;
import org.apache.accumulo.fate.Repo;
/**
*
*/
public class TraceRepo<T> implements Repo<T> {
private static final long serialVersionUID = 1L;
TInfo tinfo;
Repo<T> repo;
public TraceRepo(Repo<T> repo) {
this.repo = repo;
tinfo = Tracer.traceInfo();
}
/*
* (non-Javadoc)
*
* @see org.apache.accumulo.server.fate.Repo#isReady(long, java.lang.Object)
*/
@Override
public long isReady(long tid, T environment) throws Exception {
Span span = Trace.trace(tinfo, repo.getDescription());
try {
return repo.isReady(tid, environment);
} finally {
span.stop();
}
}
/*
* (non-Javadoc)
*
* @see org.apache.accumulo.server.fate.Repo#call(long, java.lang.Object)
*/
@Override
public Repo<T> call(long tid, T environment) throws Exception {
Span span = Trace.trace(tinfo, repo.getDescription());
try {
Repo<T> result = repo.call(tid, environment);
if (result == null)
return result;
return new TraceRepo<T>(result);
} finally {
span.stop();
}
}
/*
* (non-Javadoc)
*
* @see org.apache.accumulo.server.fate.Repo#undo(long, java.lang.Object)
*/
@Override
public void undo(long tid, T environment) throws Exception {
Span span = Trace.trace(tinfo, repo.getDescription());
try {
repo.undo(tid, environment);
} finally {
span.stop();
}
}
/*
* (non-Javadoc)
*
* @see org.apache.accumulo.server.fate.Repo#getDescription()
*/
@Override
public String getDescription() {
return repo.getDescription();
}
/*
* (non-Javadoc)
*
* @see org.apache.accumulo.server.fate.Repo#getReturn()
*/
@Override
public String getReturn() {
return repo.getReturn();
}
}
| {
"content_hash": "fffc98ee84f37a86931dd1e27ec05c47",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 78,
"avg_line_length": 21.70212765957447,
"alnum_prop": 0.6352941176470588,
"repo_name": "wjsl/jaredcumulo",
"id": "58a337fd4247eaaabfb09a1bd2af30a427e55527",
"size": "2841",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "server/src/main/java/org/apache/accumulo/server/master/tableOps/TraceRepo.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "27323"
},
{
"name": "C++",
"bytes": "19683"
},
{
"name": "CSS",
"bytes": "8226"
},
{
"name": "Java",
"bytes": "13855810"
},
{
"name": "JavaScript",
"bytes": "249599"
},
{
"name": "Perl",
"bytes": "15899"
},
{
"name": "Python",
"bytes": "290137"
},
{
"name": "Ruby",
"bytes": "1844"
},
{
"name": "Shell",
"bytes": "166724"
},
{
"name": "TeX",
"bytes": "104446"
}
],
"symlink_target": ""
} |
#include "curl_setup.h"
#ifndef CURL_DISABLE_FILE
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef HAVE_NET_IF_H
#include <net/if.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#include "strtoofft.h"
#include "urldata.h"
#include <curl/curl.h>
#include "progress.h"
#include "sendf.h"
#include "escape.h"
#include "file.h"
#include "speedcheck.h"
#include "getinfo.h"
#include "transfer.h"
#include "url.h"
#include "parsedate.h" /* for the week day and month names */
#include "warnless.h"
#include "curl_range.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
#include "curl_memory.h"
#include "memdebug.h"
#if defined(WIN32) || defined(MSDOS) || defined(__EMX__) || \
defined(__SYMBIAN32__)
#define DOS_FILESYSTEM 1
#endif
#ifdef OPEN_NEEDS_ARG3
# define open_readonly(p,f) open((p),(f),(0))
#else
# define open_readonly(p,f) open((p),(f))
#endif
/*
* Forward declarations.
*/
static CURLcode file_do(struct connectdata *, bool *done);
static CURLcode file_done(struct connectdata *conn,
CURLcode status, bool premature);
static CURLcode file_connect(struct connectdata *conn, bool *done);
static CURLcode file_disconnect(struct connectdata *conn,
bool dead_connection);
static CURLcode file_setup_connection(struct connectdata *conn);
/*
* FILE scheme handler.
*/
const struct Curl_handler Curl_handler_file = {
"FILE", /* scheme */
file_setup_connection, /* setup_connection */
file_do, /* do_it */
file_done, /* done */
ZERO_NULL, /* do_more */
file_connect, /* connect_it */
ZERO_NULL, /* connecting */
ZERO_NULL, /* doing */
ZERO_NULL, /* proto_getsock */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* domore_getsock */
ZERO_NULL, /* perform_getsock */
file_disconnect, /* disconnect */
ZERO_NULL, /* readwrite */
ZERO_NULL, /* connection_check */
0, /* defport */
CURLPROTO_FILE, /* protocol */
PROTOPT_NONETWORK | PROTOPT_NOURLQUERY /* flags */
};
static CURLcode file_setup_connection(struct connectdata *conn)
{
/* allocate the FILE specific struct */
conn->data->req.protop = calloc(1, sizeof(struct FILEPROTO));
if(!conn->data->req.protop)
return CURLE_OUT_OF_MEMORY;
return CURLE_OK;
}
/*
* file_connect() gets called from Curl_protocol_connect() to allow us to
* do protocol-specific actions at connect-time. We emulate a
* connect-then-transfer protocol and "connect" to the file here
*/
static CURLcode file_connect(struct connectdata *conn, bool *done)
{
struct Curl_easy *data = conn->data;
char *real_path;
struct FILEPROTO *file = data->req.protop;
int fd;
#ifdef DOS_FILESYSTEM
size_t i;
char *actual_path;
#endif
size_t real_path_len;
CURLcode result = Curl_urldecode(data, data->state.up.path, 0, &real_path,
&real_path_len, FALSE);
if(result)
return result;
#ifdef DOS_FILESYSTEM
/* If the first character is a slash, and there's
something that looks like a drive at the beginning of
the path, skip the slash. If we remove the initial
slash in all cases, paths without drive letters end up
relative to the current directory which isn't how
browsers work.
Some browsers accept | instead of : as the drive letter
separator, so we do too.
On other platforms, we need the slash to indicate an
absolute pathname. On Windows, absolute paths start
with a drive letter.
*/
actual_path = real_path;
if((actual_path[0] == '/') &&
actual_path[1] &&
(actual_path[2] == ':' || actual_path[2] == '|')) {
actual_path[2] = ':';
actual_path++;
real_path_len--;
}
/* change path separators from '/' to '\\' for DOS, Windows and OS/2 */
for(i = 0; i < real_path_len; ++i)
if(actual_path[i] == '/')
actual_path[i] = '\\';
else if(!actual_path[i]) { /* binary zero */
Curl_safefree(real_path);
return CURLE_URL_MALFORMAT;
}
fd = open_readonly(actual_path, O_RDONLY|O_BINARY);
file->path = actual_path;
#else
if(memchr(real_path, 0, real_path_len)) {
/* binary zeroes indicate foul play */
Curl_safefree(real_path);
return CURLE_URL_MALFORMAT;
}
fd = open_readonly(real_path, O_RDONLY);
file->path = real_path;
#endif
file->freepath = real_path; /* free this when done */
file->fd = fd;
if(!data->set.upload && (fd == -1)) {
failf(data, "Couldn't open file %s", data->state.up.path);
file_done(conn, CURLE_FILE_COULDNT_READ_FILE, FALSE);
return CURLE_FILE_COULDNT_READ_FILE;
}
*done = TRUE;
return CURLE_OK;
}
static CURLcode file_done(struct connectdata *conn,
CURLcode status, bool premature)
{
struct FILEPROTO *file = conn->data->req.protop;
(void)status; /* not used */
(void)premature; /* not used */
if(file) {
Curl_safefree(file->freepath);
file->path = NULL;
if(file->fd != -1)
close(file->fd);
file->fd = -1;
}
return CURLE_OK;
}
static CURLcode file_disconnect(struct connectdata *conn,
bool dead_connection)
{
struct FILEPROTO *file = conn->data->req.protop;
(void)dead_connection; /* not used */
if(file) {
Curl_safefree(file->freepath);
file->path = NULL;
if(file->fd != -1)
close(file->fd);
file->fd = -1;
}
return CURLE_OK;
}
#ifdef DOS_FILESYSTEM
#define DIRSEP '\\'
#else
#define DIRSEP '/'
#endif
static CURLcode file_upload(struct connectdata *conn)
{
struct FILEPROTO *file = conn->data->req.protop;
const char *dir = strchr(file->path, DIRSEP);
int fd;
int mode;
CURLcode result = CURLE_OK;
struct Curl_easy *data = conn->data;
char *buf = data->state.buffer;
curl_off_t bytecount = 0;
struct_stat file_stat;
const char *buf2;
/*
* Since FILE: doesn't do the full init, we need to provide some extra
* assignments here.
*/
conn->data->req.upload_fromhere = buf;
if(!dir)
return CURLE_FILE_COULDNT_READ_FILE; /* fix: better error code */
if(!dir[1])
return CURLE_FILE_COULDNT_READ_FILE; /* fix: better error code */
#ifdef O_BINARY
#define MODE_DEFAULT O_WRONLY|O_CREAT|O_BINARY
#else
#define MODE_DEFAULT O_WRONLY|O_CREAT
#endif
if(data->state.resume_from)
mode = MODE_DEFAULT|O_APPEND;
else
mode = MODE_DEFAULT|O_TRUNC;
fd = open(file->path, mode, conn->data->set.new_file_perms);
if(fd < 0) {
failf(data, "Can't open %s for writing", file->path);
return CURLE_WRITE_ERROR;
}
if(-1 != data->state.infilesize)
/* known size of data to "upload" */
Curl_pgrsSetUploadSize(data, data->state.infilesize);
/* treat the negative resume offset value as the case of "-" */
if(data->state.resume_from < 0) {
if(fstat(fd, &file_stat)) {
close(fd);
failf(data, "Can't get the size of %s", file->path);
return CURLE_WRITE_ERROR;
}
data->state.resume_from = (curl_off_t)file_stat.st_size;
}
while(!result) {
size_t nread;
size_t nwrite;
size_t readcount;
result = Curl_fillreadbuffer(conn, data->set.buffer_size, &readcount);
if(result)
break;
if(!readcount)
break;
nread = readcount;
/*skip bytes before resume point*/
if(data->state.resume_from) {
if((curl_off_t)nread <= data->state.resume_from) {
data->state.resume_from -= nread;
nread = 0;
buf2 = buf;
}
else {
buf2 = buf + data->state.resume_from;
nread -= (size_t)data->state.resume_from;
data->state.resume_from = 0;
}
}
else
buf2 = buf;
/* write the data to the target */
nwrite = write(fd, buf2, nread);
if(nwrite != nread) {
result = CURLE_SEND_ERROR;
break;
}
bytecount += nread;
Curl_pgrsSetUploadCounter(data, bytecount);
if(Curl_pgrsUpdate(conn))
result = CURLE_ABORTED_BY_CALLBACK;
else
result = Curl_speedcheck(data, Curl_now());
}
if(!result && Curl_pgrsUpdate(conn))
result = CURLE_ABORTED_BY_CALLBACK;
close(fd);
return result;
}
/*
* file_do() is the protocol-specific function for the do-phase, separated
* from the connect-phase above. Other protocols merely setup the transfer in
* the do-phase, to have it done in the main transfer loop but since some
* platforms we support don't allow select()ing etc on file handles (as
* opposed to sockets) we instead perform the whole do-operation in this
* function.
*/
static CURLcode file_do(struct connectdata *conn, bool *done)
{
/* This implementation ignores the host name in conformance with
RFC 1738. Only local files (reachable via the standard file system)
are supported. This means that files on remotely mounted directories
(via NFS, Samba, NT sharing) can be accessed through a file:// URL
*/
CURLcode result = CURLE_OK;
struct_stat statbuf; /* struct_stat instead of struct stat just to allow the
Windows version to have a different struct without
having to redefine the simple word 'stat' */
curl_off_t expected_size = 0;
bool size_known;
bool fstated = FALSE;
struct Curl_easy *data = conn->data;
char *buf = data->state.buffer;
curl_off_t bytecount = 0;
int fd;
struct FILEPROTO *file;
*done = TRUE; /* unconditionally */
Curl_pgrsStartNow(data);
if(data->set.upload)
return file_upload(conn);
file = conn->data->req.protop;
/* get the fd from the connection phase */
fd = file->fd;
/* VMS: This only works reliable for STREAMLF files */
if(-1 != fstat(fd, &statbuf)) {
/* we could stat it, then read out the size */
expected_size = statbuf.st_size;
/* and store the modification time */
data->info.filetime = statbuf.st_mtime;
fstated = TRUE;
}
if(fstated && !data->state.range && data->set.timecondition) {
if(!Curl_meets_timecondition(data, data->info.filetime)) {
*done = TRUE;
return CURLE_OK;
}
}
if(fstated) {
time_t filetime;
struct tm buffer;
const struct tm *tm = &buffer;
char header[80];
msnprintf(header, sizeof(header),
"Content-Length: %" CURL_FORMAT_CURL_OFF_T "\r\n",
expected_size);
result = Curl_client_write(conn, CLIENTWRITE_HEADER, header, 0);
if(result)
return result;
result = Curl_client_write(conn, CLIENTWRITE_HEADER,
(char *)"Accept-ranges: bytes\r\n", 0);
if(result)
return result;
filetime = (time_t)statbuf.st_mtime;
result = Curl_gmtime(filetime, &buffer);
if(result)
return result;
/* format: "Tue, 15 Nov 1994 12:45:26 GMT" */
msnprintf(header, sizeof(header),
"Last-Modified: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n%s",
Curl_wkday[tm->tm_wday?tm->tm_wday-1:6],
tm->tm_mday,
Curl_month[tm->tm_mon],
tm->tm_year + 1900,
tm->tm_hour,
tm->tm_min,
tm->tm_sec,
data->set.opt_no_body ? "": "\r\n");
result = Curl_client_write(conn, CLIENTWRITE_HEADER, header, 0);
if(result)
return result;
/* set the file size to make it available post transfer */
Curl_pgrsSetDownloadSize(data, expected_size);
if(data->set.opt_no_body)
return result;
}
/* Check whether file range has been specified */
result = Curl_range(conn);
if(result)
return result;
/* Adjust the start offset in case we want to get the N last bytes
* of the stream if the filesize could be determined */
if(data->state.resume_from < 0) {
if(!fstated) {
failf(data, "Can't get the size of file.");
return CURLE_READ_ERROR;
}
data->state.resume_from += (curl_off_t)statbuf.st_size;
}
if(data->state.resume_from <= expected_size)
expected_size -= data->state.resume_from;
else {
failf(data, "failed to resume file:// transfer");
return CURLE_BAD_DOWNLOAD_RESUME;
}
/* A high water mark has been specified so we obey... */
if(data->req.maxdownload > 0)
expected_size = data->req.maxdownload;
if(!fstated || (expected_size == 0))
size_known = FALSE;
else
size_known = TRUE;
/* The following is a shortcut implementation of file reading
this is both more efficient than the former call to download() and
it avoids problems with select() and recv() on file descriptors
in Winsock */
if(fstated)
Curl_pgrsSetDownloadSize(data, expected_size);
if(data->state.resume_from) {
if(data->state.resume_from !=
lseek(fd, data->state.resume_from, SEEK_SET))
return CURLE_BAD_DOWNLOAD_RESUME;
}
Curl_pgrsTime(data, TIMER_STARTTRANSFER);
while(!result) {
ssize_t nread;
/* Don't fill a whole buffer if we want less than all data */
size_t bytestoread;
if(size_known) {
bytestoread = (expected_size < data->set.buffer_size) ?
curlx_sotouz(expected_size) : (size_t)data->set.buffer_size;
}
else
bytestoread = data->set.buffer_size-1;
nread = read(fd, buf, bytestoread);
if(nread > 0)
buf[nread] = 0;
if(nread <= 0 || (size_known && (expected_size == 0)))
break;
bytecount += nread;
if(size_known)
expected_size -= nread;
result = Curl_client_write(conn, CLIENTWRITE_BODY, buf, nread);
if(result)
return result;
Curl_pgrsSetDownloadCounter(data, bytecount);
if(Curl_pgrsUpdate(conn))
result = CURLE_ABORTED_BY_CALLBACK;
else
result = Curl_speedcheck(data, Curl_now());
}
if(Curl_pgrsUpdate(conn))
result = CURLE_ABORTED_BY_CALLBACK;
return result;
}
#endif
| {
"content_hash": "3781c5593407e76cf5eb892391c38337",
"timestamp": "",
"source": "github",
"line_count": 524,
"max_line_length": 78,
"avg_line_length": 27.427480916030536,
"alnum_prop": 0.610631784024492,
"repo_name": "PooyaEimandar/WolfEngine",
"id": "d349cd9241cdc9ae93f5e4f5dc67a40cd6d57b84",
"size": "15397",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "engine/src/wolf.system/curl/src/file.c",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "5545"
},
{
"name": "C++",
"bytes": "317259"
},
{
"name": "Objective-C",
"bytes": "1179"
},
{
"name": "Python",
"bytes": "1532"
}
],
"symlink_target": ""
} |
import sys
import random
class BacktrackingIndependentSet:
"""Find a maximum independent set using backtracking."""
def __init__(self, graph):
"""The algorithm initialization."""
if graph.is_directed():
raise ValueError("the graph is directed")
self.graph = graph
for edge in self.graph.iteredges():
if edge.source == edge.target: # for multigraphs
raise ValueError("a loop detected")
self.independent_set = set()
self.current_set = set()
self.cardinality = 0
self._used = dict((node, 0) for node in self.graph.iternodes())
self.node_list = list(self.graph.iternodes())
#random.shuffle(self.node_list)
recursionlimit = sys.getrecursionlimit()
sys.setrecursionlimit(max(self.graph.v()*2, recursionlimit))
def run(self):
"""Executable pseudocode."""
# Musimy sprawdzic wszystkie mozliwosci, aby znalezc max iset.
self._try_node(0)
self.cardinality = len(self.independent_set)
def _try_node(self, k):
"""Try to add node_list[k] to an iset."""
node = self.node_list[k]
if self._used[node] > 0: # moge wstawiac tylko ze nie nalezy
if k < self.graph.v() - 1:
self._try_node(k+1)
else:
if len(self.current_set) > len(self.independent_set):
self.independent_set = set(self.current_set)
else: # _used[node]==0
# Najpierw sprawdzam mozliwosc, ze nalezy do iset.
self._add_iset(node)
if k < self.graph.v() - 1:
self._try_node(k+1)
else:
if len(self.current_set) > len(self.independent_set):
self.independent_set = set(self.current_set)
self._del_iset(node)
# Teraz sprawdzam mozliwosc, ze nie nalezy do iset.
if k < self.graph.v() - 1:
self._try_node(k+1)
else:
if len(self.current_set) > len(self.independent_set):
self.independent_set = set(self.current_set)
def _add_iset(self, node):
"""Add a node to iset."""
self.current_set.add(node)
self._used[node] += 1
for target in self.graph.iteradjacent(node):
self._used[target] += 1
def _del_iset(self, node):
"""Remove a node from iset."""
self.current_set.remove(node)
self._used[node] -= 1
for target in self.graph.iteradjacent(node):
self._used[target] -= 1
# EOF
| {
"content_hash": "db0edc1181b7b034787242825ce4a3f7",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 71,
"avg_line_length": 37.78260869565217,
"alnum_prop": 0.5546605293440736,
"repo_name": "ufkapano/graphs-dict",
"id": "fd06341a4642cb526098b20c1ddb9af6b6a1c612",
"size": "2631",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "graphtheory/independentsets/isetbt.py",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "Python",
"bytes": "970894"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "03284f079948cec4bd715e467fd601b2",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "35037357d459ad069ec7248d3c63015df496e11e",
"size": "195",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Bacillariophyta/Bacillariophyceae/Bacillariales/Bacillariaceae/Nitzschia/Nitzschia juba/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
import tools
import resource_properties
import val
from pyquery import PyQuery as q
from collections import OrderedDict
import requests
from cachecontrol import CacheControl
from cachecontrol.caches import FileCache
def parse_paremeter_types(dd):
types = [q(dt).text() for dt in dd('dl dt')]
types += ['List<String>'] # undocumented
result = OrderedDict()
result['type'] = 'string'
result['enum'] = types
return result
def parse_parameters():
parameters_href = tools.BASE + 'parameters-section-structure.html'
h = tools.get_pq(parameters_href)
dl = h('#main-col-body .variablelist dl').eq(0)
dl = q(dl)
dl = zip(dl.children('dt'), dl.children('dd'))
dl = OrderedDict((q(dt).text(), q(dd)) for dt, dd in dl)
result = OrderedDict()
result['Type'] = parse_paremeter_types(dl.pop('Type'))
for dt in dl.keys():
result[dt] = {'type': 'string'}
result['AllowedValues']['type'] = 'array'
result['NoEcho']['type'] = ['string', 'boolean']
return result
def main(argv):
sess = CacheControl(requests.Session(),
cache=FileCache('.web_cache'))
requests.get = sess.get
schema = tools.load('schema.json')
schema['definitions']['Parameter']['properties'] = parse_parameters()
tools.write(schema, 'schema.json')
if __name__ == '__main__':
import sys
sys.exit(main(sys.argv))
| {
"content_hash": "a13315dcc15d05bbc4d17f6eefeb64c3",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 73,
"avg_line_length": 28.02,
"alnum_prop": 0.6388294075660242,
"repo_name": "fungusakafungus/cloudformation-jsonschema",
"id": "d7ae8265e19756ab622953f498cb86cd73152ca2",
"size": "1424",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "update_parameter_types.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "26267"
},
{
"name": "Vim script",
"bytes": "29"
}
],
"symlink_target": ""
} |
namespace Envoy {
namespace Upstream {
// TODO(mergeconflict): Adjust locality weights for partial availability, as is done in
// HostSetImpl::effectiveLocalityWeight.
namespace {
void normalizeHostWeights(const HostVector& hosts, double normalized_locality_weight,
NormalizedHostWeightVector& normalized_host_weights,
double& min_normalized_weight, double& max_normalized_weight) {
uint32_t sum = 0;
for (const auto& host : hosts) {
sum += host->weight();
}
for (const auto& host : hosts) {
const double weight = host->weight() * normalized_locality_weight / sum;
normalized_host_weights.push_back({host, weight});
min_normalized_weight = std::min(min_normalized_weight, weight);
max_normalized_weight = std::max(max_normalized_weight, weight);
}
}
void normalizeLocalityWeights(const HostsPerLocality& hosts_per_locality,
const LocalityWeights& locality_weights,
NormalizedHostWeightVector& normalized_host_weights,
double& min_normalized_weight, double& max_normalized_weight) {
ASSERT(locality_weights.size() == hosts_per_locality.get().size());
uint32_t sum = 0;
for (const auto weight : locality_weights) {
sum += weight;
}
// Locality weights (unlike host weights) may be 0. If _all_ locality weights were 0, bail out.
if (sum == 0) {
return;
}
// Compute normalized weights for all hosts in each locality. If a locality was assigned zero
// weight, all hosts in that locality will be skipped.
for (LocalityWeights::size_type i = 0; i < locality_weights.size(); ++i) {
if (locality_weights[i] != 0) {
const HostVector& hosts = hosts_per_locality.get()[i];
const double normalized_locality_weight = static_cast<double>(locality_weights[i]) / sum;
normalizeHostWeights(hosts, normalized_locality_weight, normalized_host_weights,
min_normalized_weight, max_normalized_weight);
}
}
}
void normalizeWeights(const HostSet& host_set, bool in_panic,
NormalizedHostWeightVector& normalized_host_weights,
double& min_normalized_weight, double& max_normalized_weight) {
if (host_set.localityWeights() == nullptr || host_set.localityWeights()->empty()) {
// If we're not dealing with locality weights, just normalize weights for the flat set of hosts.
const auto& hosts = in_panic ? host_set.hosts() : host_set.healthyHosts();
normalizeHostWeights(hosts, 1.0, normalized_host_weights, min_normalized_weight,
max_normalized_weight);
} else {
// Otherwise, normalize weights across all localities.
const auto& hosts_per_locality =
in_panic ? host_set.hostsPerLocality() : host_set.healthyHostsPerLocality();
normalizeLocalityWeights(hosts_per_locality, *(host_set.localityWeights()),
normalized_host_weights, min_normalized_weight, max_normalized_weight);
}
}
} // namespace
void ThreadAwareLoadBalancerBase::initialize() {
// TODO(mattklein123): In the future, once initialized and the initial LB is built, it would be
// better to use a background thread for computing LB updates. This has the substantial benefit
// that if the LB computation thread falls behind, host set updates can be trivially collapsed.
// I will look into doing this in a follow up. Doing everything using a background thread heavily
// complicated initialization as the load balancer would need its own initialized callback. I
// think the synchronous/asynchronous split is probably the best option.
priority_set_.addPriorityUpdateCb(
[this](uint32_t, const HostVector&, const HostVector&) -> void { refresh(); });
refresh();
}
void ThreadAwareLoadBalancerBase::refresh() {
auto per_priority_state_vector = std::make_shared<std::vector<PerPriorityStatePtr>>(
priority_set_.hostSetsPerPriority().size());
auto healthy_per_priority_load =
std::make_shared<HealthyLoad>(per_priority_load_.healthy_priority_load_);
auto degraded_per_priority_load =
std::make_shared<DegradedLoad>(per_priority_load_.degraded_priority_load_);
for (const auto& host_set : priority_set_.hostSetsPerPriority()) {
const uint32_t priority = host_set->priority();
(*per_priority_state_vector)[priority] = std::make_unique<PerPriorityState>();
const auto& per_priority_state = (*per_priority_state_vector)[priority];
// Copy panic flag from LoadBalancerBase. It is calculated when there is a change
// in hosts set or hosts' health.
per_priority_state->global_panic_ = per_priority_panic_[priority];
// Normalize host and locality weights such that the sum of all normalized weights is 1.
NormalizedHostWeightVector normalized_host_weights;
double min_normalized_weight = 1.0;
double max_normalized_weight = 0.0;
normalizeWeights(*host_set, per_priority_state->global_panic_, normalized_host_weights,
min_normalized_weight, max_normalized_weight);
per_priority_state->current_lb_ =
createLoadBalancer(normalized_host_weights, min_normalized_weight, max_normalized_weight);
}
{
absl::WriterMutexLock lock(&factory_->mutex_);
factory_->healthy_per_priority_load_ = healthy_per_priority_load;
factory_->degraded_per_priority_load_ = degraded_per_priority_load;
factory_->per_priority_state_ = per_priority_state_vector;
}
}
HostConstSharedPtr
ThreadAwareLoadBalancerBase::LoadBalancerImpl::chooseHost(LoadBalancerContext* context) {
// Make sure we correctly return nullptr for any early chooseHost() calls.
if (per_priority_state_ == nullptr) {
return nullptr;
}
// If there is no hash in the context, just choose a random value (this effectively becomes
// the random LB but it won't crash if someone configures it this way).
// computeHashKey() may be computed on demand, so get it only once.
absl::optional<uint64_t> hash;
if (context) {
hash = context->computeHashKey();
}
const uint64_t h = hash ? hash.value() : random_.random();
const uint32_t priority =
LoadBalancerBase::choosePriority(h, *healthy_per_priority_load_, *degraded_per_priority_load_)
.first;
const auto& per_priority_state = (*per_priority_state_)[priority];
if (per_priority_state->global_panic_) {
stats_.lb_healthy_panic_.inc();
}
HostConstSharedPtr host;
const uint32_t max_attempts = context ? context->hostSelectionRetryCount() + 1 : 1;
for (uint32_t i = 0; i < max_attempts; ++i) {
host = per_priority_state->current_lb_->chooseHost(h, i);
// If host selection failed or the host is accepted by the filter, return.
// Otherwise, try again.
if (!host || !context || !context->shouldSelectAnotherHost(*host)) {
return host;
}
}
return host;
}
LoadBalancerPtr ThreadAwareLoadBalancerBase::LoadBalancerFactoryImpl::create() {
auto lb = std::make_unique<LoadBalancerImpl>(stats_, random_);
// We must protect current_lb_ via a RW lock since it is accessed and written to by multiple
// threads. All complex processing has already been precalculated however.
absl::ReaderMutexLock lock(&mutex_);
lb->healthy_per_priority_load_ = healthy_per_priority_load_;
lb->degraded_per_priority_load_ = degraded_per_priority_load_;
lb->per_priority_state_ = per_priority_state_;
return lb;
}
} // namespace Upstream
} // namespace Envoy
| {
"content_hash": "a4630be0786e25aca0ef650a54a0087b",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 100,
"avg_line_length": 44.03508771929825,
"alnum_prop": 0.6928286852589641,
"repo_name": "istio/envoy",
"id": "5ede9a31b64f83174ad26ffcf34cdcfddc4fc514",
"size": "7600",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "source/common/upstream/thread_aware_lb_impl.cc",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "35685"
},
{
"name": "C++",
"bytes": "19486055"
},
{
"name": "Dockerfile",
"bytes": "245"
},
{
"name": "Emacs Lisp",
"bytes": "966"
},
{
"name": "Go",
"bytes": "695"
},
{
"name": "JavaScript",
"bytes": "1760"
},
{
"name": "Makefile",
"bytes": "1985"
},
{
"name": "PowerShell",
"bytes": "6173"
},
{
"name": "PureBasic",
"bytes": "472"
},
{
"name": "Python",
"bytes": "418501"
},
{
"name": "Rust",
"bytes": "3471"
},
{
"name": "Shell",
"bytes": "120251"
},
{
"name": "Starlark",
"bytes": "1184414"
},
{
"name": "Thrift",
"bytes": "748"
}
],
"symlink_target": ""
} |
#if defined(USE_TI_FILESYSTEM) || defined(USE_TI_DATABASE) || defined(USE_TI_MEDIA)
#include <sys/xattr.h>
#import "TiBase.h"
#import "TiUtils.h"
#import "TiBlob.h"
#import "TiFilesystemFileProxy.h"
#import "TiFilesystemFileStreamProxy.h"
#define FILE_TOSTR(x) \
([x isKindOfClass:[TiFilesystemFileProxy class]]) ? [(TiFilesystemFileProxy*)x nativePath] : [TiUtils stringValue:x]
static const char* backupAttr = "com.apple.MobileBackup";
@implementation TiFilesystemFileProxy
-(id)initWithFile:(NSString*)path_
{
if (self = [super init])
{
fm = [[NSFileManager alloc] init];
path = [path_ retain];
}
return self;
}
-(void)dealloc
{
RELEASE_TO_NIL(fm);
RELEASE_TO_NIL(path);
[super dealloc];
}
-(NSString*)apiName
{
return @"Ti.Filesystem.File";
}
-(id)nativePath
{
return [[NSURL fileURLWithPath:path] absoluteString];
}
-(id)exists:(id)args
{
return NUMBOOL([fm fileExistsAtPath:path]);
}
#define FILEATTR(propName,attrKey,throwError) \
-(id) propName \
{ \
NSError *error = nil; \
NSDictionary * resultDict = [fm attributesOfItemAtPath:path error:&error];\
if ((throwError) && error!=nil) \
{ \
[self throwException:TiExceptionOSError subreason:[error localizedDescription] location:CODELOCATION]; \
} \
return [resultDict objectForKey:attrKey];\
}
FILEATTR(readonly,NSFileImmutable,NO)
FILEATTR(modificationTimestamp,NSFileModificationDate,YES);
-(id)createTimestamp
{
NSError *error = nil;
NSDictionary * resultDict = [fm attributesOfItemAtPath:path error:&error];
if ((YES) && error!=nil)
{
[self throwException:TiExceptionOSError subreason:[error localizedDescription] location:CODELOCATION];
}
// Have to do this one up special because of 3.x bug where NSFileCreationDate is sometimes undefined
id result = [resultDict objectForKey:NSFileCreationDate];
if (result == nil) {
result = [resultDict objectForKey:NSFileModificationDate];
}
return result;
}
//TODO: Should this be a method or a property? Until then, do both.
-(id)createTimestamp:(id)args
{
return [self createTimestamp];
}
-(id)modificationTimestamp:(id)args
{
return [self modificationTimestamp];
}
-(id)symbolicLink
{
NSError *error = nil;
NSDictionary * resultDict = [fm attributesOfItemAtPath:path error:&error];
if (error!=nil)
{
[self throwException:TiExceptionOSError subreason:[error localizedDescription] location:CODELOCATION];
}
NSString * fileType = [resultDict objectForKey:NSFileType];
return NUMBOOL([fileType isEqualToString:NSFileTypeSymbolicLink]);
}
-(id)writeable
{
// Note: Despite previous incarnations claiming writeable is the proper API,
// writable is the correct spelling.
DEPRECATED_REPLACED_REMOVED(@"Filesystem.FileProxy.writeable",@"1.8.1", @"6.0.0", @"Filesystem.FileProxy.writable");
return [self writable];
}
-(id)writable
{
return NUMBOOL(![[self readonly] boolValue]);
}
#define FILENOOP(name) \
-(id)name\
{\
return NUMBOOL(NO);\
}\
FILENOOP(executable);
FILENOOP(hidden);
FILENOOP(setReadonly:(id)x);
FILENOOP(setExecutable:(id)x);
FILENOOP(setHidden:(id)x);
-(id)getDirectoryListing:(id)args
{
NSError * error=nil;
NSArray * resultArray = [fm contentsOfDirectoryAtPath:path error:&error];
if(error!=nil)
{
//TODO: what should be do?
}
return resultArray;
}
-(id)spaceAvailable:(id)args
{
NSError *error = nil;
NSDictionary * resultDict = [fm attributesOfFileSystemForPath:path error:&error];
if (error!=nil) return NUMBOOL(NO);
return [resultDict objectForKey:NSFileSystemFreeSize];
}
-(NSString *)getProtectionKey:(id)args
{
NSError *error = nil;
NSDictionary * resultDict = [fm attributesOfItemAtPath:path error:&error];
if (error != nil) {
NSLog(@"[ERROR] Error getting protection key: %@", [TiUtils messageFromError:error]);
return nil;
}
return [resultDict objectForKey:NSFileProtectionKey];
}
-(NSNumber *)setProtectionKey:(id)args
{
ENSURE_SINGLE_ARG(args, NSString);
NSError *error = nil;
[fm setAttributes:[NSDictionary dictionaryWithObjectsAndKeys:args, NSFileProtectionKey, nil] ofItemAtPath:path error:&error];
if (error != nil) {
NSLog(@"[ERROR] Error setting protection key: %@", [TiUtils messageFromError:error]);
return NUMBOOL(NO);
}
return NUMBOOL(YES);
}
-(id)createDirectory:(id)args
{
BOOL result = NO;
if (![fm fileExistsAtPath:path])
{
BOOL recurse = args!=nil && [args count] > 0 ? [TiUtils boolValue:[args objectAtIndex:0]] : NO;
result = [fm createDirectoryAtPath:path withIntermediateDirectories:recurse attributes:nil error:nil];
}
return NUMBOOL(result);
}
-(id)isFile:(id)unused
{
BOOL isDirectory;
return NUMBOOL([fm fileExistsAtPath:path isDirectory:&isDirectory] && !isDirectory);
}
-(id)isDirectory:(id)unused
{
BOOL isDirectory;
return NUMBOOL([fm fileExistsAtPath:path isDirectory:&isDirectory] && isDirectory);
}
-(TiFilesystemFileStreamProxy *) open:(id) args {
NSNumber *mode = nil;
ENSURE_ARG_AT_INDEX(mode, args, 0, NSNumber);
ENSURE_VALUE_RANGE([mode intValue], TI_READ, TI_APPEND);
NSArray *payload = [NSArray arrayWithObjects:[self path], mode, nil];
return [[[TiFilesystemFileStreamProxy alloc] _initWithPageContext:[self executionContext] args:payload] autorelease];
}
-(id)createFile:(id)args
{
BOOL result = NO;
if(![fm fileExistsAtPath:path])
{
BOOL shouldCreate = args!=nil && [args count] > 0 ? [TiUtils boolValue:[args objectAtIndex:0]] : NO;
if(shouldCreate)
{
[fm createDirectoryAtPath:[path stringByDeletingLastPathComponent] withIntermediateDirectories:YES attributes:nil error:nil];
//We don't care if this fails.
}
result = [[NSData data] writeToFile:path options:NSDataWritingFileProtectionComplete | NSDataWritingAtomic error:nil];
}
return NUMBOOL(result);
}
-(id)deleteDirectory:(id)args
{
BOOL result = NO;
BOOL isDirectory = NO;
BOOL exists = [fm fileExistsAtPath:path isDirectory:&isDirectory];
if (exists && isDirectory)
{
NSError * error = nil;
BOOL shouldDelete = args!=nil && [args count] > 0 ? [TiUtils boolValue:[args objectAtIndex:0]] : NO;
if (!shouldDelete)
{
NSArray * remainers = [fm contentsOfDirectoryAtPath:path error:&error];
if(error==nil)
{
if([remainers count]==0)
{
shouldDelete = YES;
}
}
}
if(shouldDelete)
{
result = [fm removeItemAtPath:path error:&error];
}
}
return NUMBOOL(result);
}
-(id)deleteFile:(id)args
{
BOOL result = NO;
BOOL isDirectory = YES;
BOOL exists = [fm fileExistsAtPath:path isDirectory:&isDirectory];
if(exists && !isDirectory)
{
result = [fm removeItemAtPath:path error:nil];
}
return NUMBOOL(result);
}
-(NSString *)_grabFirstArgumentAsFileName_:(id)args {
NSString * arg = [args objectAtIndex:0];
NSString * file = FILE_TOSTR(arg);
NSURL * fileUrl = [NSURL URLWithString:file];
if([fileUrl isFileURL]){
file = [fileUrl path];
}
NSString * dest = [file stringByStandardizingPath];
return dest;
}
-(id)move:(id)args
{
ENSURE_TYPE(args,NSArray);
NSError * error=nil;
NSString * dest = [self _grabFirstArgumentAsFileName_:args];
if (![dest isAbsolutePath]) {
NSString * subpath = [path stringByDeletingLastPathComponent];
dest = [subpath stringByAppendingPathComponent:dest];
}
BOOL result = [fm moveItemAtPath:path toPath:dest error:&error];
return NUMBOOL(result);
}
-(id)rename:(id)args
{
ENSURE_TYPE(args,NSArray);
NSString * dest = [self _grabFirstArgumentAsFileName_:args];
NSString * ourSubpath = [path stringByDeletingLastPathComponent];
if ([dest isAbsolutePath]) {
NSString * destSubpath = [dest stringByDeletingLastPathComponent];
if (![ourSubpath isEqualToString:destSubpath]) {
return NUMBOOL(NO); // rename is not move
}
}
return [self move:args];
}
-(id)read:(id)args
{
BOOL exists = [fm fileExistsAtPath:path];
if(!exists) return nil;
return [[[TiBlob alloc] _initWithPageContext:[self executionContext] andFile:path] autorelease];
}
-(id)append:(id)args
{
ENSURE_TYPE(args,NSArray);
id arg = [args objectAtIndex:0];
if([arg isKindOfClass:[TiFile class]]) {
//allow the ability to append files to another file
//e.g. file.append(Ti.Filesystem.getFile('somewhere'));
TiFile *file_arg = (TiFile *) arg;
NSError *err = nil;
NSString *contents = [NSString stringWithContentsOfFile:[file_arg path] encoding:NSUTF8StringEncoding error:&err];
if(contents != nil && err == nil) {
arg = contents;
} else {
NSLog(@"[ERROR] Can't open file (%@) for reading!\n%@", [file_arg path], err);
return NUMBOOL(NO);
}
}
if ([arg isKindOfClass:[TiBlob class]] ||
[arg isKindOfClass:[NSString class]]) {
NSData *data = nil;
if([arg isKindOfClass:[NSString class]]) {
data = [arg dataUsingEncoding:NSUTF8StringEncoding];
} else {
data = [(TiBlob*) arg data];
}
if(data == nil) {
return NUMBOOL(NO);
}
if(![fm fileExistsAtPath:path]) {
//create the file if it doesn't exist already
NSError *writeError = nil;
[data writeToFile:path options:NSDataWritingFileProtectionComplete | NSDataWritingAtomic error:&writeError];
if(writeError != nil) {
NSLog(@"[ERROR] Could not write data to file at path \"%@\"", path);
}
return NUMBOOL(writeError == nil);
}
NSFileHandle *handle = [NSFileHandle fileHandleForUpdatingAtPath:path];
unsigned long long offset = [handle seekToEndOfFile];
[handle writeData:data];
BOOL success = ([handle offsetInFile] - offset) == [data length];
[handle closeFile];
return NUMBOOL(success);
} else {
NSLog(@"[ERROR] Can only append blobs and strings");
}
return NUMBOOL(NO);
}
-(id)write:(id)args
{
ENSURE_TYPE(args,NSArray);
id arg = [args objectAtIndex:0];
//Short-circuit against non-supported types
if(!([arg isKindOfClass:[TiFile class]] || [arg isKindOfClass:[TiBlob class]]
|| [arg isKindOfClass:[NSString class]])) {
return NUMBOOL(NO);
}
if([args count] > 1) {
ENSURE_TYPE([args objectAtIndex:1], NSNumber);
//We have a second argument, is it truthy?
//If yes, we'll hand the args to -append:
NSNumber *append = [args objectAtIndex:1];
if([append boolValue] == YES) {
return [self append:[args subarrayWithRange:NSMakeRange(0, 1)]];
}
}
if ([arg isKindOfClass:[TiBlob class]])
{
TiBlob *blob = (TiBlob*)arg;
return NUMBOOL([blob writeTo:path error:nil]);
}
else if ([arg isKindOfClass:[TiFile class]])
{
TiFile *file = (TiFile*)arg;
[[NSFileManager defaultManager] removeItemAtPath:path error:nil];
NSError *error = nil;
[[NSFileManager defaultManager] copyItemAtPath:[file path] toPath:path error:&error];
if (error!=nil)
{
NSLog(@"[ERROR] error writing file: %@ to: %@. Error: %@",[file path],path,error);
}
return NUMBOOL(error==nil);
}
NSString* dataString = [TiUtils stringValue:arg];
NSData* data = [dataString dataUsingEncoding:NSUTF8StringEncoding];
NSError *err = nil;
[data writeToFile:path options:NSDataWritingFileProtectionComplete | NSDataWritingAtomic error:&err];
if(err != nil) {
NSLog(@"[ERROR] Could not write data to file at path \"%@\" - details: %@", path, err);
}
return NUMBOOL(err == nil);
}
-(id)extension:(id)args
{
return [path pathExtension];
}
-(id)getParent:(id)args
{
return [path stringByDeletingLastPathComponent];
}
-(id)name
{
return [path lastPathComponent];
}
-(id)resolve:(id)args
{
return path;
}
-(id)description
{
return path;
}
+(id)makeTemp:(BOOL)isDirectory
{
NSString * tempDir = NSTemporaryDirectory();
NSError * error=nil;
NSFileManager *fm = [NSFileManager defaultManager];
if(![fm fileExistsAtPath:tempDir])
{
[fm createDirectoryAtPath:tempDir withIntermediateDirectories:YES attributes:nil error:&error];
if(error != nil)
{
//TODO: ?
return nil;
}
}
int timestamp = (int)(time(NULL) & 0xFFFFL);
NSString * resultPath;
do
{
resultPath = [tempDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%X",timestamp]];
timestamp ++;
} while ([fm fileExistsAtPath:resultPath]);
if(isDirectory)
{
[fm createDirectoryAtPath:resultPath withIntermediateDirectories:NO attributes:nil error:&error];
}
else
{
[[NSData data] writeToFile:resultPath options:NSDataWritingFileProtectionComplete | NSDataWritingAtomic error:&error];
}
if (error != nil)
{
//TODO: ?
return nil;
}
return [[[TiFilesystemFileProxy alloc] initWithFile:resultPath] autorelease];
}
-(NSNumber*)remoteBackup
{
u_int8_t value;
const char* fullPath = [[self path] fileSystemRepresentation];
ssize_t result = getxattr(fullPath, backupAttr, &value, sizeof(value), 0, 0);
if (result == -1) {
// Doesn't matter what errno is set to; this means that we're backing up.
return [NSNumber numberWithBool:YES];
}
// A value of 0 means backup, so:
return [NSNumber numberWithBool:!value];
}
-(void)setRemoteBackup:(NSNumber *)remoteBackup
{
// Value of 1 means nobackup
u_int8_t value = ![TiUtils boolValue:remoteBackup def:YES];
const char* fullPath = [[self path] fileSystemRepresentation];
int result = setxattr(fullPath, backupAttr, &value, sizeof(value), 0, 0);
if (result != 0) {
// Throw an exception with the errno
char* errmsg = strerror(errno);
[self throwException:@"Error setting remote backup flag:"
subreason:[NSString stringWithUTF8String:errmsg]
location:CODELOCATION];
return;
}
}
@end
#endif
| {
"content_hash": "b89f717cb05940fe3c438b3ad87de38a",
"timestamp": "",
"source": "github",
"line_count": 522,
"max_line_length": 128,
"avg_line_length": 25.814176245210728,
"alnum_prop": 0.6967717996289425,
"repo_name": "falkolab/titanium_mobile",
"id": "7ad827be10698072dfacc68d09231a5efa993443",
"size": "13712",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "iphone/Classes/TiFilesystemFileProxy.m",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2552"
},
{
"name": "C",
"bytes": "190358"
},
{
"name": "C#",
"bytes": "80533"
},
{
"name": "C++",
"bytes": "195232"
},
{
"name": "CSS",
"bytes": "16297"
},
{
"name": "HTML",
"bytes": "63276"
},
{
"name": "Java",
"bytes": "2710604"
},
{
"name": "JavaScript",
"bytes": "4566732"
},
{
"name": "Makefile",
"bytes": "7605"
},
{
"name": "Mako",
"bytes": "1855"
},
{
"name": "Objective-C",
"bytes": "3930464"
},
{
"name": "Objective-C++",
"bytes": "8560"
},
{
"name": "Python",
"bytes": "1481837"
},
{
"name": "Shell",
"bytes": "24162"
}
],
"symlink_target": ""
} |
<?php
namespace ONGR\ElasticsearchDSL\Query;
use ONGR\ElasticsearchDSL\BuilderInterface;
use ONGR\ElasticsearchDSL\DslTypeAwareTrait;
use ONGR\ElasticsearchDSL\ParametersTrait;
/**
* Elasticsearch function_score query class.
*/
class FunctionScoreQuery implements BuilderInterface
{
use ParametersTrait;
use DslTypeAwareTrait;
/**
* Query of filter.
*
* In Function score could be used query or filter. Use setDslType() to change type.
*
* @var BuilderInterface
*/
private $query;
/**
* @var array[]
*/
private $functions;
/**
* @param BuilderInterface $query
* @param array $parameters
*/
public function __construct(BuilderInterface $query, array $parameters = [])
{
$this->query = $query;
$this->setParameters($parameters);
$this->setDslType('query');
}
/**
* {@inheritdoc}
*/
public function getType()
{
return 'function_score';
}
/**
* Modifier to apply filter to the function score function.
*
* @param array $function
* @param BuilderInterface $filter
*/
private function applyFilter(array &$function, BuilderInterface $filter = null)
{
if ($filter) {
$function['filter'] = [
$filter->getType() => $filter->toArray(),
];
}
}
/**
* Creates field_value_factor function.
*
* @param string $field
* @param float $factor
* @param string $modifier
* @param BuilderInterface $filter
*
* @return $this
*/
public function addFieldValueFactorFunction($field, $factor, $modifier = 'none', BuilderInterface $filter = null)
{
$function = [
'field_value_factor' => [
'field' => $field,
'factor' => $factor,
'modifier' => $modifier,
],
];
$this->applyFilter($function, $filter);
$this->functions[] = $function;
return $this;
}
/**
* Add decay function to function score. Weight and filter are optional.
*
* @param string $type
* @param string $field
* @param array $function
* @param array $options
* @param BuilderInterface $filter
*
* @return $this
*/
public function addDecayFunction(
$type,
$field,
array $function,
array $options = [],
BuilderInterface $filter = null
) {
$function = [
$type => array_merge(
[$field => $function],
$options
),
];
$this->applyFilter($function, $filter);
$this->functions[] = $function;
return $this;
}
/**
* Adds function to function score without decay function. Influence search score only for specific filter.
*
* @param float $weight
* @param BuilderInterface $filter
*
* @return $this
*/
public function addWeightFunction($weight, BuilderInterface $filter = null)
{
$function = [
'weight' => $weight,
];
$this->applyFilter($function, $filter);
$this->functions[] = $function;
return $this;
}
/**
* Adds random score function. Seed is optional.
*
* @param mixed $seed
* @param BuilderInterface $filter
*
* @return $this
*/
public function addRandomFunction($seed = null, BuilderInterface $filter = null)
{
$function = [
'random_score' => $seed ? [ 'seed' => $seed ] : new \stdClass(),
];
$this->applyFilter($function, $filter);
$this->functions[] = $function;
return $this;
}
/**
* Adds script score function.
*
* @param string $script
* @param array $params
* @param array $options
* @param BuilderInterface $filter
*
* @return $this
*/
public function addScriptScoreFunction(
$script,
array $params = [],
array $options = [],
BuilderInterface $filter = null
) {
$function = [
'script_score' => [
'script' => $script,
'params' => $params,
$options
],
];
$this->applyFilter($function, $filter);
$this->functions[] = $function;
return $this;
}
/**
* Adds custom simple function. You can add to the array whatever you want.
*
* @param array $function
*
* @return $this
*/
public function addSimpleFunction(array $function)
{
$this->functions[] = $function;
return $this;
}
/**
* {@inheritdoc}
*/
public function toArray()
{
$query = [
strtolower($this->getDslType()) => [
$this->query->getType() => $this->query->toArray(),
],
'functions' => $this->functions,
];
$output = $this->processArray($query);
return $output;
}
}
| {
"content_hash": "e9eddde899717aa75f4f3ce24ab38ebb",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 117,
"avg_line_length": 22.912663755458514,
"alnum_prop": 0.5100057175528874,
"repo_name": "abhiesa-tolexo/ElasticsearchDSL",
"id": "9f5c31ced198138f41ce481f105ee660ebfc9533",
"size": "5471",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "src/Query/FunctionScoreQuery.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "335456"
}
],
"symlink_target": ""
} |
#ifndef AUDIO_TO_TACTILE_EXTRAS_TOOLS_CHANNEL_MAP_TUI_H_
#define AUDIO_TO_TACTILE_EXTRAS_TOOLS_CHANNEL_MAP_TUI_H_
#include "src/dsp/channel_map.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Parses `ChannelMap` from a comma-delimited list of base-1 channel sources and
* a comma-delimited list of channel gains in decibels. This is useful for user
* interface, e.g. taking the two lists as command line arguments. Supports up
* to `kChannelMapMaxChannels` channels. Returns 1 on success, 0 on failure.
*
* NOTE: `source_list` is base-1 indexed, while sources in the parsed ChannelMap
* are base-0 indexed. Base 1 is preferable for user interface, since it is the
* convention on the Motu and other audio interface hardware, while base 0 is
* better for implementation.
*
* Details:
* - A "0" in `source_list` means the output channel is filled with zeros.
* - If `gains_db_list` is shorter than `source_list`, remaining channels have
* 0 dB gain. If gains_db_list is longer, excess elements are ignored.
*
* Examples:
*
* ChannelMapParse(3, "3,1,2,2", "-1.5,-7.2,-8,-3", &channel_map)
* defines a map from 3-channel input to 4-channel output (written in base 0) as
* output[0] = input[2] * 10^(-1.5/20),
* output[1] = input[0] * 10^(-7.2/20),
* output[2] = input[1] * 10^(-8/20),
* output[3] = input[1] * 10^(-3/20).
*
* ChannelMapParse(2, "1,0,2", "-5.1", &channel_map)
* defines a map from stereo input to 3-channel output (written in base 0) as
* output[0] = input[0] * 10^(-5.1/20),
* output[1] = 0,
* output[2] = input[1].
*/
int ChannelMapParse(int num_input_channels, const char* source_list,
const char* gains_db_list, ChannelMap* channel_map);
/* Prints `channel_map` to stdout. */
void ChannelMapPrint(const ChannelMap* channel_map);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* AUDIO_TO_TACTILE_EXTRAS_TOOLS_CHANNEL_MAP_TUI_H_ */
| {
"content_hash": "8039f436afd68ad113c74d0a9848abcc",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 80,
"avg_line_length": 37.72549019607843,
"alnum_prop": 0.6746361746361746,
"repo_name": "google/audio-to-tactile",
"id": "f759664911bc102ca76570b96eaea83f579a7491",
"size": "2573",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "extras/tools/channel_map_tui.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "2034760"
},
{
"name": "C++",
"bytes": "320571"
},
{
"name": "CMake",
"bytes": "992"
},
{
"name": "CSS",
"bytes": "5330"
},
{
"name": "HTML",
"bytes": "108204"
},
{
"name": "JavaScript",
"bytes": "202111"
},
{
"name": "Jupyter Notebook",
"bytes": "110253"
},
{
"name": "Kotlin",
"bytes": "173194"
},
{
"name": "Makefile",
"bytes": "18821"
},
{
"name": "Python",
"bytes": "295644"
},
{
"name": "Starlark",
"bytes": "39654"
}
],
"symlink_target": ""
} |
<?php
/**
* admin actions.
*
* @package switcharoo
* @subpackage admin
* @author Your name here
* @version SVN: $Id: actions.class.php 12479 2008-10-31 10:54:40Z fabien $
*/
class adminActions extends sfActions
{
/**
* Executes index action
*
* @param sfRequest $request A request object
*/
public function executeIndex(sfWebRequest $request)
{
$this->userType =$this->getUser()->getAttribute("credential");
$this->userName = $this->getUser()->getAttribute('name');
}
public function executeAllBooksInStockList(sfWebRequest $request)
{
$this->userType =$this->getUser()->getAttribute("credential");
$this->userName = $this->getUser()->getAttribute('name');
$c = new Criteria();
$myBooks = BooksforsalePeer::doSelect($c);
//create array to store book info from bookDB table
$bookList = array();
//traversera böckerna som hittades och hämta mer info
foreach($myBooks as $book)
{
//hämta bokens info ifrån bookDB
$bookList[] = BookPeer::retrieveByPK($book->getIsbn10());
}
//check if any books were found, if not send a note to the user
if(count($bookList)==0)
{
$this->SearchInfo = "Systemet innehåller inga böcker";
} elseif(count($bookList)==1) {
$this->SearchInfo = "Det finns en bok i systemet.";
} else {
$this->SearchInfo = "Hittade ".count($bookList)." böcker i systemet.";
}
$this->BookList = $bookList;
}
public function executeUserList(sfWebRequest $request)
{
$this->userType =$this->getUser()->getAttribute("credential");
$this->userName = $this->getUser()->getAttribute('name');
$c = new Criteria();
$c->add(UserPeer::CREDENTIALS, "admin", Criteria::NOT_EQUAL);
$this->userList = UserPeer::doSelect($c);
}
public function executeSearch($request)
{
$this->forward('shared', 'search');
}
public function executeSearchFieldResult($request)
{
$this->userType =$this->getUser()->getAttribute("credential");
$this->userName = $this->getUser()->getAttribute('name');
$isbn10 = $request->getParameter('isbn10');
$category = $request->getParameter('category');
$course = $request->getParameter('course');
$title = $request->getParameter('title');
$author = $request->getParameter('title');
$this->query = array('isbn10'=>$isbn10,'author'=>$author,'title'=>$title,'category'=>$category,'course'=>$course);
}
public function executeRemoveUser($request)
{
$userId = $request->getParameter('userID');
$user = UserPeer::retrieveByPk($userId);
$user->delete();
return sfView::NONE;
}
public function executeAllCommentsList($request)
{
$this->userType =$this->getUser()->getAttribute("credential");
$this->userName = $this->getUser()->getAttribute('name');
$c = new Criteria();
$c->addJoin(CommentPeer::USER_ID, UserPeer::ID);
$this->commentList = CommentPeer::doSelectJoinUser($c);
}
public function executeManageCategorys($request)
{
$this->userType =$this->getUser()->getAttribute("credential");
$this->userName = $this->getUser()->getAttribute('name');
$c = new Criteria();
$this->categoryList = CategoryPeer::doSelect($c);
// $c = new Criteria();
// $this->userList = UserPeer::doSelect($c);
}
public function executeAddCategory($request)
{
// $categoryName = $request->getParameter('categoryName');
// $myCategory = new Category();
// $myCategory->setName($categoryName);
$this->form = new CategoryForm();
// echo $myCategory->getName();
// return sfView::NONE;
}
public function executeInsertCategory($request)
{
$categoryName = $request->getParameter('categoryName');
$myCategory = new Category();
$myCategory->setName($categoryName);
$myCategory->save();
echo "#".$myCategory->getName()."#";
return sfView::NONE;
}
public function executeRemoveCategory($request)
{
$categoryId = $request->getParameter('categoryId');
$category = CategoryPeer::retrieveByPk($categoryId);
$category->delete();
return sfView::NONE;
}
public function executeAddBookToCategory($request)
{
$categoryId = $request->getParameter('categoryId');
$isbn10 = $request->getParameter('isbn10');
$bookInCategory = new Bookincategory();
$bookInCategory->setIsbn10($isbn10);
$bookInCategory->setCategoryId($categoryId);
$bookInCategory->save();
return sfView::NONE;
}
}
| {
"content_hash": "4ac41a820f7ca2fb6ff9789d52334f1d",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 117,
"avg_line_length": 27.706586826347305,
"alnum_prop": 0.6291333477415172,
"repo_name": "tolu/liu-bookbox",
"id": "19a21bf276b15fa84ad20c60d55bf1fe811fb8be",
"size": "4634",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "apps/frontend/modules/admin/actions/actions.class.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "56262"
},
{
"name": "JavaScript",
"bytes": "293074"
},
{
"name": "PHP",
"bytes": "4207819"
},
{
"name": "Shell",
"bytes": "3583"
}
],
"symlink_target": ""
} |
<?php
class MY_Controller extends CI_Controller
{
public function __construct($name_controller, $type = null)
{
parent::__construct();
$this->load->helper(array("myfunction"));
session_init();
$this->load->library("mydb");
if ($type == "admin") {
if (file_exists($file_path = APPPATH . "models/adminsecurity/" . $name_controller . '_model.php')) {
$this->load->model("adminsecurity/" . $name_controller . '_model', 'model');
}
$this->url = $this->uri->rsegments;
$this->load->helper(array("mydata_helper"));
// kiểm tra quyền user theo controller và function
$this->load->library("adminsecurity");
$this->adminsecurity->mydb = $this->mydb;
$this->adminsecurity->checkrole($this->url[1], $this->url[2]);
$this->data["menu_item"] = $this->adminsecurity->menu_item();
load_config(array("CACHE", "URLANHCHEN", "LOGO", "WIDTHANHBAIVIET", "HEIGHTANHBAIVIET", "KIEUIMAGE", "TAIKHOANMAIL", "MATKHAUMAIL", "TENSHOP", "SDT", "DIACHI", "EMAIL"));
} else {
if (file_exists($file_path = APPPATH . "models/" . $name_controller . '_model.php')) {
$this->load->model($name_controller . '_model', 'model');
}
$this->load->driver('cache', array('adapter' => 'apc', 'backup' => 'file'));
load_config(array("CACHE", "LIMITDANHMUCIT", "LIMITDANHMUCNHIEU", "LIMITSANPHAMLIENQUAN",
"TENSHOP", "EMAIL", "LOGO", "SDT", "DIACHI", "MIEUTA", "THONGTINCHUYENKHOAN",
"WIDTHTHUMB", "LIMITDANHMUCTRANGCHU", "LIMITMODULE", "LIMITBAIVIET", "MAPLAT","MAPLNG", "TAIKHOANMAIL", "MATKHAUMAIL", "CAPTCHAKEY"));
}
}
public function error()
{
Header("Location:" . BASE_URL . "error");
die();
}
}
| {
"content_hash": "6f5433c61c99e03932cde65ba8e02287",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 182,
"avg_line_length": 47.02439024390244,
"alnum_prop": 0.5425311203319502,
"repo_name": "phongnguyenpro/furniture",
"id": "c48ba43171eaf33f8849a900da5529ed25cc5991",
"size": "1933",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "application/core/MY_Controller.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "551"
},
{
"name": "CSS",
"bytes": "1223354"
},
{
"name": "HTML",
"bytes": "431233"
},
{
"name": "JavaScript",
"bytes": "1677505"
},
{
"name": "PHP",
"bytes": "3171264"
}
],
"symlink_target": ""
} |
/* eslint-disable no-param-reassign */
import Vue from 'vue';
const global = window.gl || (window.gl = {});
global.cycleAnalytics = global.cycleAnalytics || {};
global.cycleAnalytics.StageReviewComponent = Vue.extend({
props: {
items: Array,
stage: Object,
},
template: `
<div>
<div class="events-description">
{{ stage.description }}
<limit-warning :count="items.length" />
</div>
<ul class="stage-event-list">
<li v-for="mergeRequest in items" class="stage-event-item">
<div class="item-details">
<img class="avatar" :src="mergeRequest.author.avatarUrl">
<h5 class="item-title merge-merquest-title">
<a :href="mergeRequest.url">
{{ mergeRequest.title }}
</a>
</h5>
<a :href="mergeRequest.url" class="issue-link">!{{ mergeRequest.iid }}</a>
·
<span>
{{ s__('OpenedNDaysAgo|Opened') }}
<a :href="mergeRequest.url" class="issue-date">{{ mergeRequest.createdAt }}</a>
</span>
<span>
{{ s__('ByAuthor|by') }}
<a :href="mergeRequest.author.webUrl" class="issue-author-link">{{ mergeRequest.author.name }}</a>
</span>
<template v-if="mergeRequest.state === 'closed'">
<span class="merge-request-state">
<i class="fa fa-ban"></i>
{{ mergeRequest.state.toUpperCase() }}
</span>
</template>
<template v-else>
<span class="merge-request-branch" v-if="mergeRequest.branch">
<i class= "fa fa-code-fork"></i>
<a :href="mergeRequest.branch.url">{{ mergeRequest.branch.name }}</a>
</span>
</template>
</div>
<div class="item-time">
<total-time :time="mergeRequest.totalTime"></total-time>
</div>
</li>
</ul>
</div>
`,
});
| {
"content_hash": "10257f5f03251c4dad91b319718d0d5b",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 112,
"avg_line_length": 34.93103448275862,
"alnum_prop": 0.508390918065153,
"repo_name": "htve/GitlabForChinese",
"id": "2b00593561f7fc4b954f7e346fcd716f7e6d67ac",
"size": "2026",
"binary": false,
"copies": "1",
"ref": "refs/heads/9-2-zh",
"path": "app/assets/javascripts/cycle_analytics/components/stage_review_component.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "499575"
},
{
"name": "Gherkin",
"bytes": "140955"
},
{
"name": "HTML",
"bytes": "979335"
},
{
"name": "JavaScript",
"bytes": "1909827"
},
{
"name": "Ruby",
"bytes": "10590735"
},
{
"name": "Shell",
"bytes": "26903"
},
{
"name": "Vue",
"bytes": "81150"
}
],
"symlink_target": ""
} |
<?php
class Google_Service_AlertCenter_BatchUndeleteAlertsResponse extends Google_Collection
{
protected $collection_key = 'successAlertIds';
protected $failedAlertStatusType = 'Google_Service_AlertCenter_Status';
protected $failedAlertStatusDataType = 'map';
public $successAlertIds;
/**
* @param Google_Service_AlertCenter_Status[]
*/
public function setFailedAlertStatus($failedAlertStatus)
{
$this->failedAlertStatus = $failedAlertStatus;
}
/**
* @return Google_Service_AlertCenter_Status[]
*/
public function getFailedAlertStatus()
{
return $this->failedAlertStatus;
}
public function setSuccessAlertIds($successAlertIds)
{
$this->successAlertIds = $successAlertIds;
}
public function getSuccessAlertIds()
{
return $this->successAlertIds;
}
}
| {
"content_hash": "826285aa87854acd407a80e11dcfa63c",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 86,
"avg_line_length": 24.696969696969695,
"alnum_prop": 0.7312883435582822,
"repo_name": "bshaffer/google-api-php-client-services",
"id": "e7170b34a581551cc9ffc101b6d36ae349751bac",
"size": "1405",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Google/Service/AlertCenter/BatchUndeleteAlertsResponse.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "PHP",
"bytes": "9540154"
}
],
"symlink_target": ""
} |
<h1>Global Settings</h1>
<form id="coreGlobalUpdateForm" name="coreGlobalUpdateForm" role="form" data-ng-submit="vm.updateCore(coreGlobalUpdateForm.$valid, 'global')" autocomplete="off">
<div class="form-group row">
<label for="core__global__language" class="col-sm-2 col-form-label">Language</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="core__global__language" data-ng-model="vm.global.language" placeholder="Site language" readonly>
</div>
</div>
<div class="form-group row">
<label for="core__global__navbar" class="col-sm-2 col-form-label">Navbar</label>
<div class="col-sm-10">
<div class="row m-x-0">
<div class="card col-md-12 col-lg-5 a-g-card" data-ng-repeat="nav in vm.global.navbar.navs | orderBy: 'order'">
<div class="card-header">
<div class="input-group">
<span class="input-group-addon">Name</span>
<input type="text" class="form-control" id="core__global__navbar__{{nav.name}}" data-ng-model="nav.name" placeholder="Nav name" required>
</div>
</div>
<div class="card-block">
<div class="input-group">
<span class="input-group-addon">🔗</span>
<input type="text" class="form-control" id="core__global__navbar__{{nav.root}}" data-ng-model="nav.url" placeholder="Nav url" required>
</div>
<div class="input-group">
<span class="input-group-addon">🔢</span>
<input type="number" min="0" class="form-control" id="core__global__navbar__{{nav.order}}" data-ng-model="nav.order" placeholder="Nav order" required>
</div>
</div>
<div class="card-footer text-muted text-xs-center">
<a href="#" class="text-danger" data-ng-click="vm.removeNav(nav)">❌ remove</a>
</div>
</div>
<div class="card card-inverse card-info text-xs-center col-md-12 col-lg-5 a-g-card">
<div class="card-block">
<blockquote class="card-blockquote">
<button type="button" class="btn btn-info btn-block" data-ng-click="vm.newNav()">New Nav</button>
</blockquote>
</div>
</div>
</div>
</div>
</div>
<div class="form-group row">
<label for="core__global__styles" class="col-sm-2 col-form-label">Styles</label>
<div class="col-sm-10">
<div class="row m-x-0">
<div class="card col-md-12 col-lg-5 a-g-card" data-ng-repeat="style in vm.global.styles track by $index">
<div class="card-header">
<div class="input-group">
<span class="input-group-addon">Name</span>
<input type="text" class="form-control" id="core__global__styles__{{style.name}}" data-ng-model="style.name" placeholder="Style name" required>
</div>
</div>
<div class="card-block">
<div class="input-group">
<span class="input-group-addon">🔗</span>
<input type="text" class="form-control" id="core__global__styles__{{style.root}}" data-ng-model="style.root" placeholder="Style url" required>
</div>
</div>
<div class="card-footer text-muted text-xs-center">
<a href="#" class="text-danger" data-ng-click="vm.removeStyle($index)">❌ remove</a>
</div>
</div>
<div class="card card-inverse card-info text-xs-center col-md-12 col-lg-5 a-g-card">
<div class="card-block">
<blockquote class="card-blockquote">
<button type="button" class="btn btn-info btn-block" data-ng-click="vm.newStyle()">New Style</button>
</blockquote>
</div>
</div>
</div>
</div>
</div>
<button type="submit" class="btn btn-large btn-primary btn-block" data-ng-class="{disabled: !coreGlobalUpdateForm.$valid}">Update</button>
</form>
| {
"content_hash": "eaf2f70a00c513d9d71b00d3e19bc6c7",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 164,
"avg_line_length": 52.026315789473685,
"alnum_prop": 0.5824481537683358,
"repo_name": "killua8q8/konko",
"id": "00e62b50b05b1da8de4387d578e8598491c4410c",
"size": "3958",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "static/styles/core/views/admin/global.admin.view.html",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "18911"
},
{
"name": "HTML",
"bytes": "32623"
},
{
"name": "JavaScript",
"bytes": "269875"
}
],
"symlink_target": ""
} |
<?php
App::uses('AppModel', 'Model');
/**
* Message Model
*
*/
class Message extends AppModel {
/**
* Display field
*
* @var string
*/
public $displayField = 'title';
/**
* Validation rules
*
* @var array
*/
public $validate = array(
'title' => array(
'notEmpty' => array(
'rule' => array('notEmpty'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
);
}
| {
"content_hash": "bd53f3d6e4555f4bc8ba0d5af8afba4f",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 78,
"avg_line_length": 17.666666666666668,
"alnum_prop": 0.5643224699828473,
"repo_name": "laravelartisan/cake",
"id": "7768713327f9676d6ef7af7d7a19859fafd14c6e",
"size": "583",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/Model/Message.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "1108"
},
{
"name": "CSS",
"bytes": "1454330"
},
{
"name": "CoffeeScript",
"bytes": "50148"
},
{
"name": "HTML",
"bytes": "7423781"
},
{
"name": "JavaScript",
"bytes": "2492979"
},
{
"name": "PHP",
"bytes": "10221763"
},
{
"name": "Shell",
"bytes": "7022"
}
],
"symlink_target": ""
} |
package com.sun.pdfview;
import com.hsl.txtreader.PDFRenderer;
import com.hsl.txtreader.Rectangle2D;
/**
* The abstract superclass of all drawing commands for a PDFPage.
* @author Mike Wessler
*/
public abstract class PDFCmd {
/**
* mark the page or change the graphics state
* @param state the current graphics state; may be modified during
* execution.
* @return the region of the page made dirty by executing this command
* or null if no region was touched. Note this value should be
* in the coordinates of the image touched, not the page.
*/
public abstract Rectangle2D execute(PDFRenderer state);
/**
* a human readable representation of this command
*/
@Override
public String toString() {
String name = getClass().getName();
int lastDot = name.lastIndexOf('.');
if (lastDot >= 0) {
return name.substring(lastDot + 1);
} else {
return name;
}
}
/**
* the details of this command
*/
public String getDetails() {
return super.toString();
}
}
| {
"content_hash": "ff7f0a204c1b737343ecd1017376e024",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 75,
"avg_line_length": 26.441860465116278,
"alnum_prop": 0.6165347405452947,
"repo_name": "Allogy/allogy-legacy-android-app",
"id": "3447d98ab9608f3f4e7c28fa5f6be195f898a7dd",
"size": "1742",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Allogy/src/com/sun/pdfview/PDFCmd.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1398436"
}
],
"symlink_target": ""
} |
package com.thoughtworks.go.apiv2.stageoperations;
import com.thoughtworks.go.api.ApiController;
import com.thoughtworks.go.api.ApiVersion;
import com.thoughtworks.go.api.spring.ApiAuthenticationHelper;
import com.thoughtworks.go.server.service.PipelineService;
import com.thoughtworks.go.server.service.ScheduleService;
import com.thoughtworks.go.server.service.result.HttpOperationResult;
import com.thoughtworks.go.spark.Routes;
import com.thoughtworks.go.spark.spring.SparkSpringController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import spark.Request;
import spark.Response;
import java.io.IOException;
import java.util.Optional;
import static com.thoughtworks.go.api.util.HaltApiResponses.haltBecauseOfReason;
import static spark.Spark.*;
@Component
public class StageOperationsControllerV2 extends ApiController implements SparkSpringController {
private static final Logger LOGGER = LoggerFactory.getLogger(StageOperationsControllerV2.class);
private final ScheduleService scheduleService;
private final ApiAuthenticationHelper apiAuthenticationHelper;
private final PipelineService pipelineService;
@Autowired
public StageOperationsControllerV2(ScheduleService scheduleService, ApiAuthenticationHelper apiAuthenticationHelper, PipelineService pipelineService) {
super(ApiVersion.v2);
this.scheduleService = scheduleService;
this.apiAuthenticationHelper = apiAuthenticationHelper;
this.pipelineService = pipelineService;
}
@Override
public String controllerBasePath() {
return Routes.Stage.BASE;
}
@Override
public void setupRoutes() {
path(controllerPath(), () -> {
before("", mimeType, this::setContentType);
before("/*", mimeType, this::setContentType);
before("", mimeType, this::verifyContentType);
before("/*", mimeType, this::verifyContentType);
before(Routes.Stage.TRIGGER_STAGE_PATH, mimeType, apiAuthenticationHelper::checkPipelineGroupOperateOfPipelineOrGroupInURLUserAnd403);
post(Routes.Stage.TRIGGER_STAGE_PATH, mimeType, this::triggerStage);
});
}
public String triggerStage(Request req, Response res) throws IOException {
String pipelineName = req.params("pipeline_name");
String pipelineCounter = req.params("pipeline_counter");
String stageName = req.params("stage_name");
HttpOperationResult result = new HttpOperationResult();
Optional<Integer> pipelineCounterValue = pipelineService.resolvePipelineCounter(pipelineName, pipelineCounter);
if (!pipelineCounterValue.isPresent()) {
String errorMessage = String.format("Error while running [%s/%s/%s]. Received non-numeric pipeline counter '%s'.", pipelineName, pipelineCounter, stageName, pipelineCounter);
LOGGER.error(errorMessage);
throw haltBecauseOfReason(errorMessage);
}
scheduleService.rerunStage(pipelineName, pipelineCounterValue.get(), stageName, result);
return renderHTTPOperationResult(result, req, res);
}
}
| {
"content_hash": "fd84f6748e3a59064b6fd93f0762cd65",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 186,
"avg_line_length": 42.60526315789474,
"alnum_prop": 0.7526250772081532,
"repo_name": "arvindsv/gocd",
"id": "010db21abf3b3823c111d0b2d518df1eb34a89a1",
"size": "3839",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "api/api-stage-operations-v2/src/main/java/com/thoughtworks/go/apiv2/stageoperations/StageOperationsControllerV2.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "466"
},
{
"name": "CSS",
"bytes": "797200"
},
{
"name": "FreeMarker",
"bytes": "9764"
},
{
"name": "Groovy",
"bytes": "2240189"
},
{
"name": "HTML",
"bytes": "640932"
},
{
"name": "Java",
"bytes": "21023083"
},
{
"name": "JavaScript",
"bytes": "2539209"
},
{
"name": "NSIS",
"bytes": "23526"
},
{
"name": "PowerShell",
"bytes": "691"
},
{
"name": "Ruby",
"bytes": "1888167"
},
{
"name": "Shell",
"bytes": "169149"
},
{
"name": "TSQL",
"bytes": "200114"
},
{
"name": "TypeScript",
"bytes": "3070898"
},
{
"name": "XSLT",
"bytes": "203240"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_25) on Fri Feb 05 08:44:26 CST 2016 -->
<title>Constant Field Values</title>
<meta name="date" content="2016-02-05">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Constant Field Values";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="clara/rules/package-summary.html">Package</a></li>
<li>Class</li>
<li><a href="clara/rules/package-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-all.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?constant-values.html" target="_top">Frames</a></li>
<li><a href="constant-values.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Constant Field Values" class="title">Constant Field Values</h1>
<h2 title="Contents">Contents</h2>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="clara/rules/package-summary.html">Package</a></li>
<li>Class</li>
<li><a href="clara/rules/package-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-all.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?constant-values.html" target="_top">Frames</a></li>
<li><a href="constant-values.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| {
"content_hash": "f923cb12a1b52a10e0082461585b5a58",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 112,
"avg_line_length": 29.6,
"alnum_prop": 0.6272522522522522,
"repo_name": "WilliamParker/clara-site",
"id": "de80da41cb546c88c239957e43c9f0871372b276",
"size": "3552",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "apidocs/0.10.0/java/constant-values.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "244476"
},
{
"name": "HTML",
"bytes": "1763351"
},
{
"name": "JavaScript",
"bytes": "48446"
},
{
"name": "Ruby",
"bytes": "209"
},
{
"name": "Shell",
"bytes": "419"
}
],
"symlink_target": ""
} |
require 'flickr_fu'
class FlickrTagsExtension < Radiant::Extension
version "0.2"
description "Provides tags for embedding Flickr slideshows and photos"
url "http://github.com/santry/flickrtags"
def activate
Page.send :include, FlickrTags
end
end | {
"content_hash": "82a234cf67bf81233723df3f614312e9",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 72,
"avg_line_length": 23.90909090909091,
"alnum_prop": 0.752851711026616,
"repo_name": "santry/flickrtags",
"id": "139a4a8ac99f7631265d37f081ea880d45d46c58",
"size": "263",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "flickr_tags_extension.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "4685"
}
],
"symlink_target": ""
} |
{-# LANGUAGE OverloadedStrings #-}
-- |
-- Available conduit combinators to process data from *.osm file.
-- For the best performance, use any of conduitNodes/Ways/Relations/NWR.
-- Example:
--
-- > import qualified Data.Conduit.List as CL
-- > import Text.XML.Stream.Parse (parseFile, def)
-- > printNodes filepath = parseFile def filepath =$ conduitNodes $$ CL.mapM_ print
--
module Data.Conduit.OSM
(
sourceFileOSM
, conduitNWR
, conduitNodes
, conduitWays
, conduitRelations
, conduitOSM
)
where
import Data.Conduit (Consumer, Conduit, Source, ConduitM, (=$))
import Data.Text (Text, unpack, toLower)
import Data.XML.Types (Event, Name)
import Control.Monad.Catch (MonadThrow, throwM)
import Control.Monad.Trans.Resource (MonadResource)
import Control.Exception (ErrorCall(..))
import Text.Read (readMaybe)
import Text.XML.Stream.Parse (AttrParser, tagName, requireAttr, attr
, ignoreAttrs, many, many', manyYield, manyYield'
, parseFile, def, choose, tagIgnoreAttrs)
import Data.Conduit.OSM.Types
sourceFileOSM :: MonadResource m => FilePath -> Source m OSM
sourceFileOSM path = parseFile def path =$ conduitOSM
conduitOSM :: MonadThrow m => Conduit Event m OSM
conduitOSM = manyYield parseOSM
conduitNodes :: MonadThrow m => Conduit Event m Node
conduitNodes = loopConduit $ tagIgnoreAttrs "osm" $ manyYield' parseNode
conduitWays :: MonadThrow m => Conduit Event m Way
conduitWays = loopConduit $ tagIgnoreAttrs "osm" $ manyYield' parseWay
conduitRelations :: MonadThrow m => Conduit Event m Relation
conduitRelations = loopConduit $ tagIgnoreAttrs "osm" $ manyYield' parseRelation
conduitNWR :: MonadThrow m => Conduit Event m NWRWrap
conduitNWR = loopConduit $ tagIgnoreAttrs "osm" $ manyYield' parseNWR
-- | Keep yielding output if parser can still parse anything remaining
loopConduit :: Monad m => ConduitM i o m (Maybe ()) -> Conduit i m o
loopConduit cond = loop
where
loop = cond >>= maybe (return ()) (const loop)
parseOSM :: MonadThrow m => Consumer Event m (Maybe OSM)
parseOSM = tagName "osm" tagParser $ \cont -> cont <$> parseBounds <*> many parseNode <*> many parseWay <*> many' parseRelation
where
tagParser = OSM <$> requireAttrRead "version" <*> attr "generator" <* ignoreAttrs
-- | Wrap nodes, ways and relations
parseNWR :: MonadThrow m => Consumer Event m (Maybe NWRWrap)
parseNWR = choose [ fmap N <$> parseNode
, fmap W <$> parseWay
, fmap R <$> parseRelation ]
parseNode :: MonadThrow m => Consumer Event m (Maybe Node)
parseNode = tagName "node" tagParser $ \cont -> cont <$> many' parseTag
where
tagParser = (\f latitude longitude tagz -> Node latitude longitude (f tagz))
<$> nwrCommonParser
<*> requireAttrRead "lat"
<*> requireAttrRead "lon"
<* ignoreAttrs
parseWay :: MonadThrow m => Consumer Event m (Maybe Way)
parseWay = tagName "way" (nwrCommonParser <* ignoreAttrs)
$ \cont -> Way <$> many parseNd <*> (cont <$> many' parseTag)
parseRelation :: MonadThrow m => Consumer Event m (Maybe Relation)
parseRelation = tagName "relation" (nwrCommonParser <* ignoreAttrs)
$ \cont -> Relation <$> many parseMember <*> (cont <$> many' parseTag)
parseMember :: MonadThrow m => Consumer Event m (Maybe Member)
parseMember = tagName "member" tagParser return
where
tagParser = Member <$> (requireAttr "type" >>= readNWRType)
<*> requireAttr "ref"
<*> attr "role"
<* ignoreAttrs
parseNd :: MonadThrow m => Consumer Event m (Maybe Nd)
parseNd = tagName "nd" (Nd <$> requireAttr "ref" <* ignoreAttrs) return
parseTag :: MonadThrow m => Consumer Event m (Maybe Tag)
parseTag = tagName "tag" tagParser (return . Tag)
where
tagParser = (,) <$> requireAttr "k" <*> requireAttr "v" <* ignoreAttrs
parseBounds :: MonadThrow m => Consumer Event m (Maybe Bounds)
parseBounds = tagName "bounds" tagParser return
where
tagParser = Bounds <$> requireAttrRead "minlat"
<*> requireAttrRead "minlon"
<*> requireAttrRead "maxlat"
<*> requireAttrRead "maxlon"
nwrCommonParser :: AttrParser ([Tag] -> NWRCommon)
nwrCommonParser = NWRCommon <$> requireAttr "id"
<*> fmap (>>= readBool) (attr "visible")
<*> attr "chageset"
<*> attr "timestamp"
<*> attr "user"
readNWRType :: Text -> AttrParser NWR
readNWRType a =
case toLower a of
"node" -> return NWRn
"relation" -> return NWRr
"way" -> return NWRw
_ -> throwM $ ErrorCall "unknown type in <member>"
fromStr :: Read a => Text -> Maybe a
fromStr = readMaybe . unpack
requireAttrRead :: Read a => Name -> AttrParser a
requireAttrRead str = requireAttr str
>>= maybe (throwM $ ErrorCall "Could not parse attribute value") return . fromStr
readBool :: Text -> Maybe Bool
readBool a
| toLower a == "true" = Just True
| toLower a == "false" = Just False
| otherwise = Nothing
| {
"content_hash": "6e450bad9d783a8ed9ea08d9be833e18",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 127,
"avg_line_length": 36.17123287671233,
"alnum_prop": 0.6360537776936186,
"repo_name": "przembot/osm-conduit",
"id": "c45243cbbb35d3015905910981205ad116516723",
"size": "5281",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Data/Conduit/OSM.hs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Haskell",
"bytes": "13704"
}
],
"symlink_target": ""
} |
package monix.reactive.internal.builders
import java.io.Reader
import java.util
import monix.execution.Ack.{Continue, Stop}
import monix.execution.atomic.Atomic
import monix.execution.cancelables.BooleanCancelable
import monix.execution._
import monix.execution.exceptions.APIContractViolationException
import monix.execution.internal.Platform
import scala.util.control.NonFatal
import monix.reactive.Observable
import monix.reactive.observers.Subscriber
import scala.annotation.tailrec
import scala.concurrent.{blocking, Future}
import scala.util.{Failure, Success}
private[reactive] final class CharsReaderObservable(in: Reader, chunkSize: Int) extends Observable[Array[Char]] {
require(chunkSize > 0, "chunkSize > 0")
private[this] val wasSubscribed = Atomic(false)
def unsafeSubscribeFn(out: Subscriber[Array[Char]]): Cancelable = {
if (!wasSubscribed.compareAndSet(false, true)) {
out.onError(APIContractViolationException("ReaderObservable does not support multiple subscribers"))
Cancelable.empty
} else {
val buffer = new Array[Char](chunkSize)
// A token that will be checked for cancellation
val cancelable = BooleanCancelable()
val em = out.scheduler.executionModel
// Schedule first cycle
reschedule(Continue, buffer, out, cancelable, em)(out.scheduler)
cancelable
}
}
private def reschedule(
ack: Future[Ack],
b: Array[Char],
out: Subscriber[Array[Char]],
c: BooleanCancelable,
em: ExecutionModel)(implicit s: Scheduler): Unit = {
ack.onComplete {
case Success(next) =>
// Should we continue, or should we close the stream?
if (next == Continue && !c.isCanceled) {
// Using Scala's BlockContext, since this is potentially a blocking call
blocking(fastLoop(b, out, c, em, 0))
}
// else stop
case Failure(ex) =>
reportFailure(ex)
}
}
@tailrec
private def fastLoop(
buffer: Array[Char],
out: Subscriber[Array[Char]],
c: BooleanCancelable,
em: ExecutionModel,
syncIndex: Int)(implicit s: Scheduler): Unit = {
// Dealing with mutable status in order to keep the
// loop tail-recursive :-(
var errorThrown: Throwable = null
var ack: Future[Ack] = Continue
var streamErrors = true
try {
val length = fillBuffer(in, buffer)
// From this point on, whatever happens is a protocol violation
streamErrors = false
ack = if (length >= 0) {
// As long as the returned length is positive, it means
// we haven't reached EOF. Making a copy of the array, because
// we cannot our mutable buffer.
val next = util.Arrays.copyOf(buffer, length)
out.onNext(next)
} else {
out.onComplete()
Stop
}
} catch {
case ex if NonFatal(ex) =>
errorThrown = ex
}
if (errorThrown == null) {
// Logic for collapsing execution loops
val nextIndex =
if (ack == Continue) em.nextFrameIndex(syncIndex)
else if (ack == Stop) -1
else 0
if (!c.isCanceled) {
if (nextIndex > 0)
fastLoop(buffer, out, c, em, nextIndex)
else if (nextIndex == 0)
reschedule(ack, buffer, out, c, em)
else
() // Stop!
}
} else {
// Dealing with unexpected errors
if (streamErrors)
sendError(out, errorThrown)
else
reportFailure(errorThrown)
}
}
@tailrec
private def fillBuffer(in: Reader, buffer: Array[Char], nTotalCharsRead: Int = 0): Int = {
if (nTotalCharsRead >= buffer.length) {
nTotalCharsRead
} else {
val nCharsRead = in.read(buffer, nTotalCharsRead, buffer.length - nTotalCharsRead)
if (nCharsRead >= 0) {
fillBuffer(in, buffer, nTotalCharsRead + nCharsRead)
} else { // stream has ended
if (nTotalCharsRead <= 0)
nCharsRead // no more chars (-1 via Reader.read contract) available, end the observable
else
nTotalCharsRead // we read the last chars available
}
}
}
private def sendError(out: Subscriber[Nothing], e: Throwable)(implicit s: UncaughtExceptionReporter): Unit = {
try {
out.onError(e)
} catch {
case NonFatal(e2) =>
reportFailure(Platform.composeErrors(e, e2))
}
}
private def reportFailure(e: Throwable)(implicit s: UncaughtExceptionReporter): Unit = {
s.reportFailure(e)
// Forcefully close in case of protocol violations, because we are
// not signaling the error downstream, which could lead to leaks
try in.close()
catch { case NonFatal(_) => () }
}
}
| {
"content_hash": "73718ac9b5e28608a906572807446051",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 113,
"avg_line_length": 30.24516129032258,
"alnum_prop": 0.6495307167235495,
"repo_name": "monifu/monifu",
"id": "73362b9410eb30b2928588702ba680a4e20bc181",
"size": "5361",
"binary": false,
"copies": "2",
"ref": "refs/heads/series/4.x",
"path": "monix-reactive/shared/src/main/scala/monix/reactive/internal/builders/CharsReaderObservable.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Scala",
"bytes": "1366167"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Assimp: BaseImporter.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Assimp
 <span id="projectnumber">v3.0 (July 2012)</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>File Members</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_ba936042867378405efc9067d78b7998.html">code</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> |
<a href="#namespaces">Namespaces</a> |
<a href="#define-members">Macros</a> </div>
<div class="headertitle">
<div class="title">BaseImporter.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_assimp_1_1_base_importer.html">Assimp::BaseImporter</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">FOR IMPORTER PLUGINS ONLY: The <a class="el" href="class_assimp_1_1_base_importer.html" title="FOR IMPORTER PLUGINS ONLY: The BaseImporter defines a common interface for all importer worker classe...">BaseImporter</a> defines a common interface for all importer worker classes. <a href="class_assimp_1_1_base_importer.html#details">More...</a><br/></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_assimp_1_1_scope_guard.html">Assimp::ScopeGuard< T ></a></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespace_assimp"><td class="memItemLeft" align="right" valign="top">namespace  </td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_assimp.html">Assimp</a></td></tr>
<tr class="memdesc:namespace_assimp"><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="namespace_assimp.html" title="Assimp's CPP-API and all internal APIs.">Assimp</a>'s CPP-API and all internal APIs. <br/></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a9bcea7601ce5a87775108e621ead5016"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="_base_importer_8h.html#a9bcea7601ce5a87775108e621ead5016">AI_MAKE_MAGIC</a>(string)</td></tr>
</table>
<hr/><h2>Macro Definition Documentation</h2>
<a class="anchor" id="a9bcea7601ce5a87775108e621ead5016"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AI_MAKE_MAGIC</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">string</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">((uint32_t)((<span class="keywordtype">string</span>[0] << 24) + \</div>
<div class="line"> (<span class="keywordtype">string</span>[1] << 16) + (<span class="keywordtype">string</span>[2] << 8) + <span class="keywordtype">string</span>[3]))</div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Jul 10 2012 17:55:53 for Assimp by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.1
</small></address>
</body>
</html>
| {
"content_hash": "0249273c96b160879385c22d29eede64",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 436,
"avg_line_length": 52.24752475247525,
"alnum_prop": 0.6522645442486261,
"repo_name": "mangostaniko/cg15-seganku",
"id": "b3ae08ac37f7afd99b04978b4492a2742b079f1a",
"size": "5277",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "external/assimp--3.0.1270-sdk/doc/assimp_html/_base_importer_8h.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "154813"
},
{
"name": "CMake",
"bytes": "10886"
},
{
"name": "CSS",
"bytes": "30987"
},
{
"name": "GLSL",
"bytes": "12600"
},
{
"name": "HTML",
"bytes": "1096615"
},
{
"name": "JavaScript",
"bytes": "52854"
}
],
"symlink_target": ""
} |
#ifndef QXTWEB_H_INCLUDED
#define QXTWEB_H_INCLUDED
#include "qxtabstracthttpconnector.h"
#include "qxtabstractwebservice.h"
#include "qxtabstractwebsessionmanager.h"
#include "qxthtmltemplate.h"
#include "qxthttpsessionmanager.h"
#include "qxtwebcgiservice.h"
#include "qxtwebcontent.h"
#include "qxtwebevent.h"
#include "qxtwebjsonrpcservice.h"
#include "qxtwebservicedirectory.h"
#include "qxtwebslotservice.h"
#endif // QXTWEB_H_INCLUDED
| {
"content_hash": "eca293fc62b6336688b0fd8c06996fb0",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 41,
"avg_line_length": 24.77777777777778,
"alnum_prop": 0.8026905829596412,
"repo_name": "hrobeers/qxtweb-qt5",
"id": "6c3e1cd6c3f2cab35904e04b52c3066eedb0f0f6",
"size": "2309",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/web/qxtweb.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "47608"
},
{
"name": "C++",
"bytes": "2347720"
},
{
"name": "CSS",
"bytes": "1452"
},
{
"name": "Lua",
"bytes": "38232"
},
{
"name": "Objective-C",
"bytes": "48654"
},
{
"name": "PHP",
"bytes": "546"
},
{
"name": "Prolog",
"bytes": "364"
},
{
"name": "Shell",
"bytes": "12787"
},
{
"name": "TypeScript",
"bytes": "668343"
}
],
"symlink_target": ""
} |
package org.uclab.mm.datamodel.sc.dataadapter;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.sql.Types;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.uclab.mm.datamodel.DataAccessInterface;
import org.uclab.mm.datamodel.sc.Facts;
import org.uclab.mm.datamodel.sc.Situation;
/**
* This is FactsAdapter class which implements the Data Access Interface for CRUD operations
* @author Taqdir Ali
*/
public class FactsAdapter implements DataAccessInterface {
private Connection objConn;
private static final Logger logger = LoggerFactory.getLogger(FactsAdapter.class);
public FactsAdapter()
{
}
/**
* This is implementation function for saving Facts.
* @param objFacts
* @return List of String
*/
@Override
public List<String> Save(Object objFacts) {
Facts objInnerFacts = new Facts();
objInnerFacts = (Facts) objFacts;
List<String> objDbResponse = new ArrayList<>();
try
{
CallableStatement objCallableStatement = objConn.prepareCall("{call dbo.usp_Add_Facts(?, ?, ?, ?, ?, ?)}");
objCallableStatement.setLong("SituationID", objInnerFacts.getSituationID());
objCallableStatement.setString("FactDescription", objInnerFacts.getFactDescription());
objCallableStatement.setString("SupportingLinks", objInnerFacts.getSupportingLinks());
if(objInnerFacts.getFactDate() != null)
{
SimpleDateFormat sdf = new SimpleDateFormat("yyyy MM dd HH:mm:ss"); // month updated to MM from mm
Date dtDate = sdf.parse(objInnerFacts.getFactDate());
Timestamp tsDate = new Timestamp(dtDate.getYear(),dtDate.getMonth(), dtDate.getDate(), dtDate.getHours(), dtDate.getMinutes(), dtDate.getSeconds(), 00);
objCallableStatement.setTimestamp("FactDate", tsDate);
}
objCallableStatement.setInt("FactStatusID", objInnerFacts.getFactStatusID());
objCallableStatement.registerOutParameter("FactID", Types.BIGINT);
objCallableStatement.execute();
Long intFactID = objCallableStatement.getLong("FactID");
objDbResponse.add(String.valueOf(intFactID));
objDbResponse.add("No Error");
objConn.close();
logger.info("Facts saved successfully, Facts Feedback Details="+objFacts);
}
catch (Exception e)
{
logger.info("Error in adding Facts");
objDbResponse.add("Error in adding Facts");
}
return objDbResponse;
}
/**
* This is implementation function for updating Facts.
* @param objFacts
* @return List of String
*/
@Override
public List<String> Update(Object objFacts) {
Facts objInnerFacts = new Facts();
objInnerFacts = (Facts) objFacts;
List<String> objDbResponse = new ArrayList<>();
try
{
CallableStatement objCallableStatement = objConn.prepareCall("{call dbo.usp_Update_Facts(?, ?, ?, ?, ?, ?)}");
objCallableStatement.setLong("FactID", objInnerFacts.getFactID());
objCallableStatement.setLong("SituationID", objInnerFacts.getSituationID());
objCallableStatement.setString("FactDescription", objInnerFacts.getFactDescription());
objCallableStatement.setString("SupportingLinks", objInnerFacts.getSupportingLinks());
if(objInnerFacts.getFactDate() != null)
{
SimpleDateFormat sdf = new SimpleDateFormat("yyyy MM dd HH:mm:ss"); // month updated to MM from mm
Date dtDate = sdf.parse(objInnerFacts.getFactDate());
Timestamp tsDate = new Timestamp(dtDate.getYear(),dtDate.getMonth(), dtDate.getDate(), dtDate.getHours(), dtDate.getMinutes(), dtDate.getSeconds(), 00);
objCallableStatement.setTimestamp("FactDate", tsDate);
}
objCallableStatement.setInt("FactStatusID", objInnerFacts.getFactStatusID());
objCallableStatement.execute();
Long intFactID = objInnerFacts.getFactID();
objDbResponse.add(String.valueOf(intFactID));
objDbResponse.add("No Error");
objConn.close();
logger.info("Facts updated successfully, Facts Details="+objFacts);
}
catch (Exception e)
{
logger.info("Error in updating Facts");
objDbResponse.add("Error in updating Facts");
}
return objDbResponse;
}
/**
* This is implementation function for retrieving Facts.
* @param objFacts
* @return List of Facts
*/
@Override
public List<Facts> RetriveData(Object objFacts) {
Facts objOuterFacts = new Facts();
List<Facts> objListInnerFacts = new ArrayList<Facts>();
objOuterFacts = (Facts) objFacts;
try
{
CallableStatement objCallableStatement = null;
if(objOuterFacts.getRequestType() == "ByUserOnly")
{
objCallableStatement = objConn.prepareCall("{call dbo.usp_Get_FactsByUser(?)}");
objCallableStatement.setLong("UserID", objOuterFacts.getUserID());
}
else if(objOuterFacts.getRequestType() == "ByUserandDate")
{
objCallableStatement = objConn.prepareCall("{call dbo.usp_Get_FactsByUserIDDate(?, ?, ?)}");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy MM dd HH:mm:ss"); // month updated to MM from mm
Date dtStartDate = sdf.parse(objOuterFacts.getStartDate());
Timestamp tsStartDate = new Timestamp(dtStartDate.getYear(),dtStartDate.getMonth(), dtStartDate.getDate(), dtStartDate.getHours(), dtStartDate.getMinutes(),dtStartDate.getSeconds(),0);
Date dtEndDate =sdf.parse( objOuterFacts.getEndDate()); //.getTime();
Timestamp tsEndDate = new Timestamp(dtEndDate.getYear(),dtEndDate.getMonth(), dtEndDate.getDate(), dtEndDate.getHours(), dtEndDate.getMinutes(),dtEndDate.getSeconds(),0);
objCallableStatement.setLong("UserID", objOuterFacts.getUserID());
objCallableStatement.setTimestamp("StartTime", tsStartDate);
objCallableStatement.setTimestamp("EndTime", tsEndDate);
}
ResultSet objResultSet = objCallableStatement.executeQuery();
while(objResultSet.next())
{
Facts objInnerFacts = new Facts();
objInnerFacts.setFactID(objResultSet.getLong("FactID"));
objInnerFacts.setSituationID(objResultSet.getLong("SituationID"));
objInnerFacts.setFactDescription(objResultSet.getString("FactDescription"));
objInnerFacts.setSupportingLinks(objResultSet.getString("SupportingLinks"));
if(objResultSet.getTimestamp("FactDate") != null)
{
Timestamp tsFactDate = objResultSet.getTimestamp("FactDate");
objInnerFacts.setFactDate(tsFactDate.toString());
}
objInnerFacts.setFactStatusID(objResultSet.getInt("FactStatusID"));
objInnerFacts.setFactStatusDescription(objResultSet.getString("RecommendationStatusDescription"));
objListInnerFacts.add(objInnerFacts);
}
objConn.close();
logger.info("Facts loaded successfully");
}
catch (Exception e)
{
logger.info("Error in loading Facts");
}
return objListInnerFacts;
}
@Override
public <T> List<T> Delete(T objEntity) {
throw new UnsupportedOperationException("Not supported yet.");
}
/**
* This is implementation function for connection database.
* @param objConf
*/
@Override
public void ConfigureAdapter(Object objConf) {
try
{
objConn = (Connection)objConf;
logger.info("Database connected successfully");
}
catch(Exception ex)
{
logger.info("Error in connection to Database");
}
}
}
| {
"content_hash": "ad6fa4168a8a8f9262827839360998b5",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 199,
"avg_line_length": 39.92165898617512,
"alnum_prop": 0.6176844049405518,
"repo_name": "ubiquitous-computing-lab/Mining-Minds",
"id": "6b683f4cb01c31701cebfa360870a7135852a2a4",
"size": "9220",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "data-curation-layer/lifelog-mapping-and-representation/IntermediateDatabaseLibrary/src/main/java/org/uclab/mm/datamodel/sc/dataadapter/FactsAdapter.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2388167"
},
{
"name": "CoffeeScript",
"bytes": "87725"
},
{
"name": "HTML",
"bytes": "6002417"
},
{
"name": "Java",
"bytes": "2523276"
},
{
"name": "JavaScript",
"bytes": "35544943"
},
{
"name": "Makefile",
"bytes": "1558"
},
{
"name": "PHP",
"bytes": "874945"
},
{
"name": "PowerShell",
"bytes": "468"
},
{
"name": "Python",
"bytes": "63930"
},
{
"name": "Shell",
"bytes": "3879"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "5433bc86cf15b00d7348f21c0d35be8d",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "c1442809356d399a7819f6ec30d8ba5a5df8a373",
"size": "206",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Saxifragales/Crassulaceae/Crassula/Crassula rupestris/Crassula rupestris commutata/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
@interface ZNGAvailablePhoneNumber : MTLModel<MTLJSONSerializing>
@property(nonatomic, strong) NSString* phoneNumber;
@property(nonatomic, strong) NSString* formattedPhoneNumber;
@property(nonatomic, strong) NSString* country;
@end
| {
"content_hash": "bb589b745a7f80b0362b016a1ec142e3",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 65,
"avg_line_length": 33.42857142857143,
"alnum_prop": 0.8205128205128205,
"repo_name": "Zingle/ios-sdk",
"id": "b3ff0527489aed391c455b2bba86a8800426a73b",
"size": "351",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "Pod/Classes/Models/ZNGAvailablePhoneNumber.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "33445"
},
{
"name": "Objective-C",
"bytes": "1449541"
},
{
"name": "Ruby",
"bytes": "3777"
},
{
"name": "Swift",
"bytes": "442"
}
],
"symlink_target": ""
} |
package org.datatransferproject.datatransfer.backblaze;
| {
"content_hash": "f4172be8c4d32d3d6c7c3ba910938f75",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 55,
"avg_line_length": 19.333333333333332,
"alnum_prop": 0.8620689655172413,
"repo_name": "google/data-transfer-project",
"id": "eaf39fae3ca346693f8d364deee82facd99fb6a6",
"size": "672",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "extensions/data-transfer/portability-data-transfer-backblaze/src/main/java/org/datatransferproject/datatransfer/backblaze/package-info.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "7334"
},
{
"name": "Java",
"bytes": "2226564"
},
{
"name": "JavaScript",
"bytes": "2259"
},
{
"name": "SCSS",
"bytes": "2383"
},
{
"name": "Shell",
"bytes": "29124"
},
{
"name": "TypeScript",
"bytes": "34008"
}
],
"symlink_target": ""
} |
package atmFuction;
/* Class: LogIn
* Fuction: ³B²zLogInFrameµøµ¡¬É±©MBankªº·¾³q(¤¶±ªÌ)
*/
public class LogIn {
private String aID, aPIN;
private Bank theBank;
public LogIn(Bank bank){
theBank = bank;
}
public void setAcc(String acc){
aID = acc;
}
public void setPassWD(String pwd){
aPIN = pwd;
}
public boolean findAccount(){
return theBank.validate(aID, aPIN);
}
public String getUserName(){
return theBank.getAccName(aID, aPIN);
}
}
| {
"content_hash": "de0f1a56ccb2b0f91218df64b051bdce",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 55,
"avg_line_length": 19.333333333333332,
"alnum_prop": 0.6875,
"repo_name": "ChadCYB/ATM-System",
"id": "ea11e5398f96adaaed707006a87165465d712773",
"size": "464",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/atmFuction/LogIn.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "38826"
}
],
"symlink_target": ""
} |
<!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">
<title>42 Login</title>
<link href="/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="navbar navbar-inverse" role="navigation">
<div class="container">
<div class="navbar-header">
<!--button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button-->
<a class="navbar-brand" href="#">42login</a>
</div>
<!--div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</div-->
</div>
</div>
<div class="container">
<div class="col-md-8">
<div class="row">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Users</h3>
</div>
<table id="users" class="table table-striped">
<thead>
<tr>
<th>NAME</th>
<th>TWITTER</th>
<th>MAC</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Arp</h3>
</div>
<table id="arps" class="table table-striped">
<thead>
<tr>
<th>IP</th>
<th>MAC</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<script src="/socket.io/socket.io.js"></script>
<script src="/js/jquery-1.11.1.min.js"></script>
<script src="app.js"></script>
<script src="/js/bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "11ce45c1018d4eec8534e4cede2208ad",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 123,
"avg_line_length": 32.03846153846154,
"alnum_prop": 0.4493797519007603,
"repo_name": "D33D33/42login",
"id": "52f4686145f558c47322c52cb8200d58e0b411da",
"size": "2499",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/back/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "7576"
}
],
"symlink_target": ""
} |
package com.devblogs.service.impl;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.devblogs.model.Provider;
import com.devblogs.service.ProviderService;
@Service("providerService")
@Transactional
public class ProviderServiceImpl implements ProviderService {
private Log log = LogFactory.getLog(ProviderServiceImpl.class);
@PersistenceContext
private EntityManager em;
@Transactional(readOnly = true)
public List<Provider> findAll() {
return em.createNamedQuery("Provider.findAll", Provider.class).getResultList();
}
@Transactional(readOnly = true)
public Provider findById(Long id) {
TypedQuery<Provider> query = em.createNamedQuery("Provider.findById", Provider.class);
query.setParameter("id", id);
return query.getSingleResult();
}
@Transactional(readOnly = false)
public Provider save(Provider provider) {
if (provider.getId() == null) {
log.info("Inserting new provider");
em.persist(provider);
} else {
em.merge(provider);
log.info("Updating existing provider");
}
log.info("Provider saved with id: " + provider.getId());
return provider;
}
@Transactional(readOnly = false)
public void delete(Provider provider) {
Provider mergedProvider = em.merge(provider);
em.remove(mergedProvider);
log.info("Provider with id: " + provider.getId() + " deleted successfully");
}
} | {
"content_hash": "208489194bd418776620e2e314a4f691",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 88,
"avg_line_length": 30.90566037735849,
"alnum_prop": 0.7673992673992674,
"repo_name": "dev-blogs/jpa",
"id": "50ac55c259d5fe1f5ca1ffc71b0ff3e657f3389b",
"size": "1638",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "simple-spring-jpa/src/main/java/com/devblogs/service/impl/ProviderServiceImpl.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "64566"
}
],
"symlink_target": ""
} |
@class JKViewController;
@interface JKAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) JKViewController *viewController;
@property (strong,nonatomic) NSMutableArray *members;
@end
| {
"content_hash": "f2fe5ca6e6ea1c8698604a6ea3cc414f",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 63,
"avg_line_length": 24,
"alnum_prop": 0.803030303030303,
"repo_name": "JamalK/Tutorials-Stuff",
"id": "40b913cd5c45c29a41a44c887e880a0796ec395e",
"size": "431",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Members/Members/JKAppDelegate.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "11255"
},
{
"name": "Objective-C",
"bytes": "316444"
},
{
"name": "Shell",
"bytes": "80"
}
],
"symlink_target": ""
} |
layout: post
status: publish
published: true
title: '"Estudantes criam sistema de orientação com Kinect"'
author:
display_name: Endrigo Antonini
url: http://blog.endrigoantonini.com.br
author_url: http://blog.endrigoantonini.com.br
excerpt: "<img src=\"http://blog.endrigoantonini.com.br/wp-content/uploads/2011/03/kinect-size-598-300x168.jpg\"
alt=\"\" title=\"kinect-size-598\" width=\"300\" height=\"168\" class=\"alignright
size-medium wp-image-551\" />\r\n\"Dispositivo da Microsoft é usado para criar um
sistema de “visão” que ajuda pessoas cegas a caminhar por corredores sem trombar
em nada.\r\n"
wordpress_id: 549
wordpress_url: http://blog.endrigoantonini.com.br/?p=549
date: '2011-03-21 15:19:27 -0300'
date_gmt: '2011-03-21 18:19:27 -0300'
categories:
- Tecnologia
tags:
- Tecnologia
- Pesquisa
- Kinect
- Acessibilidade
- Universidade de Konstanz
comments: []
---
<p><img src="/wp-content/uploads/2011/03/kinect-size-598-300x168.jpg" alt="" title="kinect-size-598" width="300" height="168" class="alignright size-medium wp-image-551" /><br />
"Dispositivo da Microsoft é usado para criar um sistema de “visão” que ajuda pessoas cegas a caminhar por corredores sem trombar em nada.<br />
<a id="more"></a><a id="more-549"></a><br />
Batizado de NAVI (Navigational Aids for the Visually Impaired) esse projeto foi desenvolvido por Michael Zöllner e Stephan Huber da <a href="http://www.uni-konstanz.de/">Universidade de Konstanz</a> e que chama a atenção pela engenhosidade com que eles utilizaram produtos facilmente encontrados no varejo para produzir algo realmente inovador.</p>
<p>Neste caso eles utilizam o Kinect como um dispositivo de “visão” que transmite seus dados para um notebook que envia sinais para uma espécie de cinta presa no tronco do usuário que emite vibrações em certos pontos que informam para o mesmo desviar para esquerda ou para direita. Fora isso o sistema tira proveito de sinais <a href="http://www.hitl.washington.edu/artoolkit/">ARToolkit</a> pregados em alguns locais que passam informações adicionais (via mensagem de voz para um fone bluetooth) como desviar de um obstáculo, avisar que o usuário está se aproximando de uma porta ou que ele deve parar e abrir a mesma.</p>
<p>http://www.youtube.com/watch?v=l6QY-eb6NoQ</p>
<p>Informações mais detalhadas sobre esse projeto e do programa de orientação podem ser vistos <a href="http://hci.uni-konstanz.de/blog/2011/03/15/navi/?lang=en">aqui</a>."</p>
<p>Fonte: <a href="http://zumo.com.br/2011/03/16/estudantes-criam-sistema-de-orientacao-com-kinect/">Zumo</a></p>
| {
"content_hash": "1bc3435d99870a95f6fa7988aba6e4f7",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 624,
"avg_line_length": 73.48571428571428,
"alnum_prop": 0.7562208398133748,
"repo_name": "antonini/blog.endrigoantonini.com.br",
"id": "1e9c4dc488850215e1d41d177207eb4b559957f4",
"size": "2611",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "_posts/2011-03-21-estudantes-criam-sistema-de-orientacao-com-kinect.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "606013"
},
{
"name": "JavaScript",
"bytes": "367"
},
{
"name": "Ruby",
"bytes": "6198"
},
{
"name": "SCSS",
"bytes": "20143"
}
],
"symlink_target": ""
} |
module Faker
class RockBand < Base
class << self
extend Gem::Deprecate
def name
Faker::Music::RockBand.name
end
deprecate :name, 'Faker::Music::RockBand.name', 2018, 12
end
end
end
| {
"content_hash": "1f19dc14851c44630128f82cf4fe4aa3",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 62,
"avg_line_length": 17.46153846153846,
"alnum_prop": 0.6035242290748899,
"repo_name": "Dakurei/faker",
"id": "b9c707b2a9d17262b4a9970cb512f28586ad47da",
"size": "258",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/faker/deprecate/rock_band.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "537051"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>fourcolor: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.5.0 / fourcolor - 1.2.3</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
fourcolor
<small>
1.2.3
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-11-23 11:02:22 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-11-23 11:02:22 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.5.0 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.04.2 The OCaml compiler (virtual package)
ocaml-base-compiler 4.04.2 Official 4.04.2 release
ocaml-config 1 OCaml Switch Configuration
# opam file:
opam-version: "2.0"
maintainer: "Mathematical Components <mathcomp-dev@sympa.inria.fr>"
homepage: "https://math-comp.github.io"
bug-reports: "Mathematical Components <mathcomp-dev@sympa.inria.fr>"
dev-repo: "git+https://github.com/math-comp/fourcolor"
license: "CECILL-B"
build: [ make "-j" "%{jobs}%" ]
install: [ make "install" ]
depends: [
"coq" { < "8.14" }
"coq-mathcomp-algebra" { >= "1.12.0" & < "1.13" }
]
tags: [ "keyword:Four color theorem" "keyword:small scale reflection" "keyword:mathematical components" ]
authors: [ "Georges Gonthier" ]
synopsis: "Mechanization of the Four Color Theorem"
description: """
Proof of the Four Color Theorem
This library contains a formalized proof of the Four Color Theorem, along
with the theories needed to support stating and then proving the Theorem.
This includes an axiomatization of the setoid of classical real numbers,
basic plane topology definitions, and a theory of combinatorial hypermaps.
"""
url {
src: "https://github.com/math-comp/fourcolor/archive/v1.2.3.tar.gz"
checksum: "sha256=09e4e03fa5d17306f901d3bfb9805b91032ea70d1cd3ac24e0b897237048c111"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-fourcolor.1.2.3 coq.8.5.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.5.0).
The following dependencies couldn't be met:
- coq-fourcolor -> coq-mathcomp-algebra >= 1.12.0 -> coq-mathcomp-fingroup >= 1.12.0 -> coq-mathcomp-ssreflect >= 1.12.0 -> coq >= 8.10 -> ocaml >= 4.05.0
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-fourcolor.1.2.3</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "94271fffba3deeb925dc7686159e113c",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 186,
"avg_line_length": 43.325301204819276,
"alnum_prop": 0.5510289210233593,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "e4287abea181db9010b99c344e0ea67d14200219",
"size": "7217",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.04.2-2.0.5/released/8.5.0/fourcolor/1.2.3.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("12-ExtractBitFromInteger")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("12-ExtractBitFromInteger")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1a317509-2146-40b9-8a81-3c8ce00d0465")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| {
"content_hash": "af1c81d88b509ceaad64a433ac9074c6",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 84,
"avg_line_length": 39.47222222222222,
"alnum_prop": 0.7480647431386348,
"repo_name": "mpenchev86/Telerik-Academy",
"id": "4705597179a7d43719cdf7e385ab7ddfd9d23bce",
"size": "1424",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CSharp-Part1/Operators-And-Expressions-Homework/12-ExtractBitFromInteger/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "799887"
},
{
"name": "CSS",
"bytes": "14114"
},
{
"name": "HTML",
"bytes": "63985"
},
{
"name": "JavaScript",
"bytes": "125305"
},
{
"name": "Smalltalk",
"bytes": "21181"
}
],
"symlink_target": ""
} |
<?php
/* FOSUserBundle:Resetting:request.html.twig */
class __TwigTemplate_cb7ed8b1650564b85a3ddf6c52fdde1cb3985ecd652ac5f9dbd7f42907076980 extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);
// line 1
$this->parent = $this->loadTemplate("FOSUserBundle::layout.html.twig", "FOSUserBundle:Resetting:request.html.twig", 1);
$this->blocks = array(
'fos_user_content' => array($this, 'block_fos_user_content'),
);
}
protected function doGetParent(array $context)
{
return "FOSUserBundle::layout.html.twig";
}
protected function doDisplay(array $context, array $blocks = array())
{
$this->parent->display($context, array_merge($this->blocks, $blocks));
}
// line 3
public function block_fos_user_content($context, array $blocks = array())
{
// line 4
$this->loadTemplate("FOSUserBundle:Resetting:request_content.html.twig", "FOSUserBundle:Resetting:request.html.twig", 4)->display($context);
}
public function getTemplateName()
{
return "FOSUserBundle:Resetting:request.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 31 => 4, 28 => 3, 11 => 1,);
}
}
| {
"content_hash": "83de4803524b8e1c6023e6808ee6579f",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 148,
"avg_line_length": 28.479166666666668,
"alnum_prop": 0.6298463789319678,
"repo_name": "ajaunasse/BlogScience",
"id": "8bd14bcc34567dceb22b1276bbb37a1118e67250",
"size": "1367",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/cache/dev/twig/cb/7e/d8b1650564b85a3ddf6c52fdde1cb3985ecd652ac5f9dbd7f42907076980.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "2643"
},
{
"name": "CSS",
"bytes": "29469"
},
{
"name": "CoffeeScript",
"bytes": "12197"
},
{
"name": "HTML",
"bytes": "24044"
},
{
"name": "JavaScript",
"bytes": "118"
},
{
"name": "PHP",
"bytes": "75833"
}
],
"symlink_target": ""
} |
package cmd
import (
bosherr "github.com/cloudfoundry/bosh-utils/errors"
boshdir "github.com/cloudfoundry/bosh-init/director"
)
//go:generate counterfeiter . LoginStrategy
type LoginStrategy interface {
Try() error
}
type LogInCmd struct {
basicStrategy LoginStrategy
uaaStrategy LoginStrategy
director boshdir.Director
}
func NewLogInCmd(
basicStrategy LoginStrategy,
uaaStrategy LoginStrategy,
director boshdir.Director,
) LogInCmd {
return LogInCmd{
basicStrategy: basicStrategy,
uaaStrategy: uaaStrategy,
director: director,
}
}
func (c LogInCmd) Run() error {
info, err := c.director.Info()
if err != nil {
return err
}
switch info.Auth.Type {
case "uaa":
return c.uaaStrategy.Try()
case "basic":
return c.basicStrategy.Try()
default:
return bosherr.Errorf("Unknown auth type '%s'", info.Auth.Type)
}
}
| {
"content_hash": "d4a50dcbb9236405795f43fe440fda56",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 65,
"avg_line_length": 18.361702127659573,
"alnum_prop": 0.727694090382387,
"repo_name": "forrestsill/bosh-init",
"id": "208111165221148841f4cc1ff246ae9237162c08",
"size": "863",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cmd/log_in.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "2758972"
},
{
"name": "Ruby",
"bytes": "974"
},
{
"name": "Shell",
"bytes": "18137"
}
],
"symlink_target": ""
} |
using namespace arangodb::basics;
using namespace arangodb::options;
// Please leave this code in for the next time we have to debug fuerte.
#if 0
void LogHackWriter(char const* p) {
LOG_DEVEL << p;
}
#endif
namespace arangodb {
LoggerFeature::LoggerFeature(application_features::ApplicationServer& server,
bool threaded)
: ApplicationFeature(server, "Logger"),
_timeFormatString(LogTimeFormats::defaultFormatName()),
_threaded(threaded) {
// note: we use the _threaded option to determine whether we are arangod
// (_threaded = true) or one of the client tools (_threaded = false). in
// the latter case we disable some options for the Logger, which only make
// sense when we are running in server mode
setOptional(false);
startsAfter<ShellColorsFeature>();
startsAfter<VersionFeature>();
_levels.push_back("info");
// if stdout is a tty, then the default for _foregroundTty becomes true
_foregroundTty = (isatty(STDOUT_FILENO) == 1);
}
LoggerFeature::~LoggerFeature() {
Logger::shutdown();
Logger::shutdownLogThread();
}
void LoggerFeature::collectOptions(std::shared_ptr<ProgramOptions> options) {
options->addOldOption("log.tty", "log.foreground-tty");
options
->addOption("--log", "the global or topic-specific log level",
new VectorParameter<StringParameter>(&_levels),
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Hidden))
.setDeprecatedIn(30500);
options->addSection("log", "logging");
options->addOption("--log.color", "use colors for TTY logging",
new BooleanParameter(&_useColor),
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Dynamic));
options->addOption("--log.escape", "escape characters when logging",
new BooleanParameter(&_useEscaped));
options->addOption(
"--log.output,-o",
"log destination(s), e.g. "
#ifdef _WIN32
"file://C:\\path\\to\\file"
#else
"file:///path/to/file"
#endif
" (any '$PID' will be replaced with the process id)",
new VectorParameter<StringParameter>(&_output));
options->addOption("--log.level,-l", "the global or topic-specific log level",
new VectorParameter<StringParameter>(&_levels));
options
->addOption("--log.max-entry-length", "maximum length of a log entry (in bytes)",
new UInt32Parameter(&_maxEntryLength))
.setIntroducedIn(30709);
options
->addOption("--log.use-local-time", "use local timezone instead of UTC",
new BooleanParameter(&_useLocalTime),
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Hidden))
.setDeprecatedIn(30500);
options
->addOption("--log.use-microtime", "use microtime instead",
new BooleanParameter(&_useMicrotime),
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Hidden))
.setDeprecatedIn(30500);
options
->addOption("--log.time-format", "time format to use in logs",
new DiscreteValuesParameter<StringParameter>(
&_timeFormatString, LogTimeFormats::getAvailableFormatNames()))
.setIntroducedIn(30500);
options
->addOption("--log.ids", "log unique message ids", new BooleanParameter(&_showIds))
.setIntroducedIn(30500);
options->addOption("--log.role", "log server role", new BooleanParameter(&_showRole));
options
->addOption("--log.file-mode",
"mode to use for new log file, umask will be applied as well",
new StringParameter(&_fileMode))
.setIntroducedIn(30405);
if (_threaded) {
// this option only makes sense for arangod, not for arangosh etc.
options->addOption("--log.api-enabled",
"whether the log api is enabled (true) or not (false), or only enabled for superuser JWT (jwt)",
new StringParameter(&_apiSwitch))
.setIntroducedIn(30411)
.setIntroducedIn(30506)
.setIntroducedIn(30605);
}
options
->addOption("--log.use-json-format", "use json output format",
new BooleanParameter(&_useJson))
.setIntroducedIn(30800);
#ifdef ARANGODB_HAVE_SETGID
options
->addOption(
"--log.file-group",
"group to use for new log file, user must be a member of this group",
new StringParameter(&_fileGroup))
.setIntroducedIn(30405);
#endif
options->addOption("--log.prefix", "prefix log message with this string",
new StringParameter(&_prefix),
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Hidden));
options->addOption("--log.file",
"shortcut for '--log.output file://<filename>'",
new StringParameter(&_file),
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Hidden));
options->addOption("--log.line-number", "append line number and file name",
new BooleanParameter(&_lineNumber),
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Hidden));
options->addOption(
"--log.shorten-filenames",
"shorten filenames in log output (use with --log.line-number)",
new BooleanParameter(&_shortenFilenames),
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Hidden));
options->addOption("--log.hostname",
"hostname to use in log message (empty for none, use 'auto' to automatically figure out hostname)",
new StringParameter(&_hostname))
.setIntroducedIn(30800);
options->addOption("--log.process", "show process identifier (pid) in log message",
new BooleanParameter(&_processId),
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Hidden))
.setIntroducedIn(30800);
options->addOption("--log.thread", "show thread identifier in log message",
new BooleanParameter(&_threadId),
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Hidden));
options->addOption("--log.thread-name", "show thread name in log message",
new BooleanParameter(&_threadName),
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Hidden));
options
->addOption("--log.performance",
"shortcut for '--log.level performance=trace'",
new BooleanParameter(&_performance),
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Hidden))
.setDeprecatedIn(30500);
if (_threaded) {
// this option only makes sense for arangod, not for arangosh etc.
options->addOption("--log.keep-logrotate",
"keep the old log file after receiving a sighup",
new BooleanParameter(&_keepLogRotate),
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Hidden));
}
options->addOption("--log.foreground-tty", "also log to tty if backgrounded",
new BooleanParameter(&_foregroundTty),
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Hidden,
arangodb::options::Flags::Dynamic));
options->addOption("--log.force-direct",
"do not start a seperate thread for logging",
new BooleanParameter(&_forceDirect),
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Hidden));
options->addOption(
"--log.request-parameters",
"include full URLs and HTTP request parameters in trace logs",
new BooleanParameter(&_logRequestParameters),
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Hidden));
options->addObsoleteOption("log.content-filter", "", true);
options->addObsoleteOption("log.source-filter", "", true);
options->addObsoleteOption("log.application", "", true);
options->addObsoleteOption("log.facility", "", true);
}
void LoggerFeature::loadOptions(std::shared_ptr<options::ProgramOptions>,
char const* binaryPath) {
// for debugging purpose, we set the log levels NOW
// this might be overwritten latter
Logger::setLogLevel(_levels);
}
void LoggerFeature::validateOptions(std::shared_ptr<ProgramOptions> options) {
if (options->processingResult().touched("log.file")) {
std::string definition;
if (_file == "+" || _file == "-") {
definition = _file;
} else {
definition = "file://" + _file;
}
_output.push_back(definition);
}
if (_performance) {
_levels.push_back("performance=trace");
}
if (options->processingResult().touched("log.time-format") &&
(options->processingResult().touched("log.use-microtime") ||
options->processingResult().touched("log.use-local-time"))) {
LOG_TOPIC("c3f28", FATAL, arangodb::Logger::FIXME)
<< "cannot combine `--log.time-format` with either "
"`--log.use-microtime` or `--log.use-local-time`";
FATAL_ERROR_EXIT();
}
// convert the deprecated options into the new timeformat
if (options->processingResult().touched("log.use-local-time")) {
_timeFormatString = "local-datestring";
// the following call ensures the string is actually valid.
// if not valid, the following call will throw an exception and
// abort the startup
LogTimeFormats::formatFromName(_timeFormatString);
} else if (options->processingResult().touched("log.use-microtime")) {
_timeFormatString = "timestamp-micros";
// the following call ensures the string is actually valid.
// if not valid, the following call will throw an exception and
// abort the startup
LogTimeFormats::formatFromName(_timeFormatString);
}
if (_apiSwitch == "true" || _apiSwitch == "on" ||
_apiSwitch == "On") {
_apiEnabled = true;
_apiSwitch = "true";
} else if (_apiSwitch == "jwt" || _apiSwitch == "JWT") {
_apiEnabled = true;
_apiSwitch = "jwt";
} else {
_apiEnabled = false;
_apiSwitch = "false";
}
if (!_fileMode.empty()) {
try {
int result = std::stoi(_fileMode, nullptr, 8);
LogAppenderFile::setFileMode(result);
} catch (...) {
LOG_TOPIC("797c2", FATAL, arangodb::Logger::FIXME)
<< "expecting an octal number for log.file-mode, got '" << _fileMode << "'";
FATAL_ERROR_EXIT();
}
}
#ifdef ARANGODB_HAVE_SETGID
if (!_fileGroup.empty()) {
int gidNumber = TRI_Int32String(_fileGroup.c_str());
if (TRI_errno() == TRI_ERROR_NO_ERROR && gidNumber >= 0) {
#ifdef ARANGODB_HAVE_GETGRGID
group* g = getgrgid(gidNumber);
if (g == nullptr) {
LOG_TOPIC("174c2", FATAL, arangodb::Logger::FIXME)
<< "unknown numeric gid '" << _fileGroup << "'";
FATAL_ERROR_EXIT();
}
#endif
} else {
#ifdef ARANGODB_HAVE_GETGRNAM
std::string name = _fileGroup;
group* g = getgrnam(name.c_str());
if (g != nullptr) {
gidNumber = g->gr_gid;
} else {
TRI_set_errno(TRI_ERROR_SYS_ERROR);
LOG_TOPIC("11a2c", FATAL, arangodb::Logger::FIXME)
<< "cannot convert groupname '" << _fileGroup
<< "' to numeric gid: " << TRI_last_error();
FATAL_ERROR_EXIT();
}
#else
LOG_TOPIC("1c96f", FATAL, arangodb::Logger::FIXME)
<< "cannot convert groupname '" << _fileGroup << "' to numeric gid";
FATAL_ERROR_EXIT();
#endif
}
LogAppenderFile::setFileGroup(gidNumber);
}
#endif
// replace $PID with current process id in filenames
for (auto& output : _output) {
output = StringUtils::replace(output, "$PID", std::to_string(Thread::currentProcessId()));
}
}
void LoggerFeature::prepare() {
#if _WIN32
if (!TRI_InitWindowsEventLog()) {
std::cerr << "failed to init event log" << std::endl;
FATAL_ERROR_EXIT();
}
#endif
// set maximum length for each log entry
Logger::defaultLogGroup().maxLogEntryLength(std::max<uint32_t>(256, _maxEntryLength));
Logger::setLogLevel(_levels);
Logger::setShowIds(_showIds);
Logger::setShowRole(_showRole);
Logger::setUseColor(_useColor);
Logger::setTimeFormat(LogTimeFormats::formatFromName(_timeFormatString));
Logger::setUseEscaped(_useEscaped);
Logger::setShowLineNumber(_lineNumber);
Logger::setShortenFilenames(_shortenFilenames);
Logger::setShowProcessIdentifier(_processId);
Logger::setShowThreadIdentifier(_threadId);
Logger::setShowThreadName(_threadName);
Logger::setOutputPrefix(_prefix);
Logger::setHostname(_hostname);
Logger::setKeepLogrotate(_keepLogRotate);
Logger::setLogRequestParameters(_logRequestParameters);
Logger::setUseJson(_useJson);
for (auto const& definition : _output) {
if (_supervisor && StringUtils::isPrefix(definition, "file://")) {
LogAppender::addAppender(Logger::defaultLogGroup(),
definition + ".supervisor");
} else {
LogAppender::addAppender(Logger::defaultLogGroup(), definition);
}
}
if (_foregroundTty) {
LogAppender::addAppender(Logger::defaultLogGroup(), "-");
}
if (_forceDirect || _supervisor) {
Logger::initialize(server(), false);
} else {
Logger::initialize(server(), _threaded);
}
}
void LoggerFeature::unprepare() { Logger::flush(); }
} // namespace arangodb
| {
"content_hash": "00de51b844d03b811bfdeb1e8aa4b9d2",
"timestamp": "",
"source": "github",
"line_count": 370,
"max_line_length": 120,
"avg_line_length": 36.82702702702703,
"alnum_prop": 0.6292382210479964,
"repo_name": "Simran-B/arangodb",
"id": "01eef093ce100acec9be3526c59f6aa7649d58a1",
"size": "15472",
"binary": false,
"copies": "1",
"ref": "refs/heads/devel",
"path": "lib/Logger/LoggerFeature.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "61827"
},
{
"name": "Batchfile",
"bytes": "3282"
},
{
"name": "C",
"bytes": "275955"
},
{
"name": "C++",
"bytes": "29221660"
},
{
"name": "CMake",
"bytes": "375992"
},
{
"name": "CSS",
"bytes": "212174"
},
{
"name": "EJS",
"bytes": "218744"
},
{
"name": "HTML",
"bytes": "23114"
},
{
"name": "JavaScript",
"bytes": "30616196"
},
{
"name": "LLVM",
"bytes": "14753"
},
{
"name": "Makefile",
"bytes": "526"
},
{
"name": "NASL",
"bytes": "129286"
},
{
"name": "NSIS",
"bytes": "49153"
},
{
"name": "PHP",
"bytes": "46519"
},
{
"name": "Pascal",
"bytes": "75391"
},
{
"name": "Perl",
"bytes": "9811"
},
{
"name": "PowerShell",
"bytes": "7885"
},
{
"name": "Python",
"bytes": "181384"
},
{
"name": "Ruby",
"bytes": "1041531"
},
{
"name": "SCSS",
"bytes": "254419"
},
{
"name": "Shell",
"bytes": "128175"
},
{
"name": "TypeScript",
"bytes": "25245"
},
{
"name": "Yacc",
"bytes": "68516"
}
],
"symlink_target": ""
} |
/**
* Provides types which allow the introduction of reactive programming concepts into plain old Java
* objects.
*
* @author <a href="mailto:johannesd@torchmind.com">Johannes Donath</a>
* @see com.torchmind.observable.concurrent for concurrent implementations of the same
* specifications.
*/
package com.torchmind.observable;
| {
"content_hash": "3d4c414cb1cb52bab38ca38a1afd7db4",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 99,
"avg_line_length": 30.636363636363637,
"alnum_prop": 0.7655786350148368,
"repo_name": "Torchmind/Observables",
"id": "c319ee5a9b0e2be6ed117ed1eeeba68f63c711f1",
"size": "1030",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "src/main/java/com/torchmind/observable/package-info.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "259064"
}
],
"symlink_target": ""
} |
package org.apache.ibatis.submitted.stringlist;
import java.util.List;
import java.util.Map;
public interface Mapper {
List<User> getUsersAndGroups(Integer id);
List<Map<String, Object>> getUsersAndGroupsMap(Integer id);
}
| {
"content_hash": "794f345483c1928c12a7b822ffe18137",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 61,
"avg_line_length": 17.923076923076923,
"alnum_prop": 0.7682403433476395,
"repo_name": "raupachz/mybatis-3",
"id": "7ad1040450f5c9b6e0fa28c4e3e548be78708ae8",
"size": "882",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/test/java/org/apache/ibatis/submitted/stringlist/Mapper.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "8370"
},
{
"name": "Java",
"bytes": "3260083"
},
{
"name": "PLpgSQL",
"bytes": "5675"
},
{
"name": "TSQL",
"bytes": "5683"
}
],
"symlink_target": ""
} |
package org.optaplanner.examples.flightcrewscheduling.domain;
import java.util.Map;
import org.optaplanner.examples.common.domain.AbstractPersistable;
public class Airport extends AbstractPersistable implements Comparable<Airport> {
private String code; // IATA 3-letter code
private String name;
private double latitude;
private double longitude;
private Map<Airport, Long> taxiTimeInMinutesMap;
public Airport() {
}
/**
* @param other never null
* @return null if no taxi connection
*/
public Long getTaxiTimeInMinutesTo(Airport other) {
return taxiTimeInMinutesMap.get(other);
}
public double getHaversineDistanceInKmTo(Airport other) {
if (this == other) {
return 0.0;
}
final int EARTH_RADIUS_IN_KM = 6371;
final int TWICE_EARTH_RADIUS_IN_KM = 2 * EARTH_RADIUS_IN_KM;
double latitudeInRads = Math.toRadians(latitude);
double longitudeInRads = Math.toRadians(longitude);
// Cartesian coordinates, normalized for a sphere of diameter 1.0
double cartesianX = 0.5 * Math.cos(latitudeInRads) * Math.sin(longitudeInRads);
double cartesianY = 0.5 * Math.cos(latitudeInRads) * Math.cos(longitudeInRads);
double cartesianZ = 0.5 * Math.sin(latitudeInRads);
double otherLatitudeInRads = Math.toRadians(other.latitude);
double otherLongitudeInRads = Math.toRadians(other.longitude);
// Cartesian coordinates, normalized for a sphere of diameter 1.0
double otherCartesianX = 0.5 * Math.cos(otherLatitudeInRads) * Math.sin(otherLongitudeInRads);
double otherCartesianY = 0.5 * Math.cos(otherLatitudeInRads) * Math.cos(otherLongitudeInRads);
double otherCartesianZ = 0.5 * Math.sin(otherLatitudeInRads);
// TODO cache the part above
double dX = cartesianX - otherCartesianX;
double dY = cartesianY - otherCartesianY;
double dZ = cartesianZ - otherCartesianZ;
double r = Math.sqrt((dX * dX) + (dY * dY) + (dZ * dZ));
return TWICE_EARTH_RADIUS_IN_KM * Math.asin(r);
}
@Override
public String toString() {
return name;
}
// ************************************************************************
// Simple getters and setters
// ************************************************************************
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getLatitude() {
return latitude;
}
public void setLatitude(double latitude) {
this.latitude = latitude;
}
public double getLongitude() {
return longitude;
}
public void setLongitude(double longitude) {
this.longitude = longitude;
}
public Map<Airport, Long> getTaxiTimeInMinutesMap() {
return taxiTimeInMinutesMap;
}
public void setTaxiTimeInMinutesMap(Map<Airport, Long> taxiTimeInMinutesMap) {
this.taxiTimeInMinutesMap = taxiTimeInMinutesMap;
}
@Override
public int compareTo(Airport o) {
return code.compareTo(o.code);
}
}
| {
"content_hash": "ae7e26fc2d943377cc7e66356c65bb0a",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 102,
"avg_line_length": 29.660714285714285,
"alnum_prop": 0.6243226971703792,
"repo_name": "droolsjbpm/optaplanner",
"id": "00756b9533469c5d0e832ead060f7443ef2bbaa0",
"size": "3942",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "optaplanner-examples/src/main/java/org/optaplanner/examples/flightcrewscheduling/domain/Airport.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2602"
},
{
"name": "CSS",
"bytes": "13781"
},
{
"name": "FreeMarker",
"bytes": "114386"
},
{
"name": "HTML",
"bytes": "678"
},
{
"name": "Java",
"bytes": "6988206"
},
{
"name": "JavaScript",
"bytes": "215434"
},
{
"name": "Shell",
"bytes": "1548"
}
],
"symlink_target": ""
} |
package ru.job4j.condition;
import org.junit.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.number.IsCloseTo.closeTo;
/**
* Test.
*
* @author Valery Labunets (mailto:vavilonw@gmail.com)
* @version $Id$
* @since 0.1
*/
public class TriangleTest {
/**
* Test distance.
*/
@Test
public void whenDistanceDiffPointsThen10() {
// создаем два объекта класса Point.
Point left = new Point(0, 0);
Point right = new Point(0, 10);
// Создаем объект треугольник и в качестве точек передает null.1
// так как нам не требуется их участие.
Triangle triangle = new Triangle(null, null, null);
double rsl = triangle.distance(left, right);
assertThat(rsl, closeTo(10, 0.01));
}
/**
* Test period.
*/
public void whenSetThreeDistanceThenTrianglePeriod() {
// создаем три объекта класса Point.
Point a = new Point(0, 0);
Point b = new Point(0, 2);
Point c = new Point(2, 0);
// Создаем объект треугольник и передаем в него объекты точек.
Triangle triangle = new Triangle(a, b, c);
// Вычисляем полупериметр.
double result = triangle.period(2.0, 2.0, Math.sqrt(8));
// Задаем ожидаемый результат.
double expected = (Math.sqrt(8) + 4) / 2;
//Проверяем результат и ожидаемое значение.
assertThat(result, closeTo(expected, 0.1));
}
/**
* Test area.
*/
public void whenAreaSetThreePointsThenTriangleArea() {
// создаем три объекта класса Point.
Point a = new Point(0, 0);
Point b = new Point(0, 2);
Point c = new Point(2, 0);
// Создаем объект треугольник и передаем в него объекты точек.
Triangle triangle = new Triangle(a, b, c);
// Вычисляем площадь.
double result = triangle.area();
// Задаем ожидаемый результат.
double expected = 2D;
//Проверяем результат и ожидаемое значение.
assertThat(result, closeTo(expected, 0.1));
}
} | {
"content_hash": "bef9bd3b0e3fa012b92f8c52d0e7a872",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 72,
"avg_line_length": 32.03076923076923,
"alnum_prop": 0.6104707012487992,
"repo_name": "valerylabunets/vlabunets",
"id": "2911fe64fa3f7b2b9ceaa0bb73b80fce108b72c4",
"size": "2484",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "chapter_001/src/test/java/ru/job4j/condition/TriangleTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "85216"
}
],
"symlink_target": ""
} |
package org.bouncycastle.openpgp.test;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.NoSuchProviderException;
import java.security.Security;
import java.security.SignatureException;
import java.util.Date;
import org.bouncycastle.bcpg.CompressionAlgorithmTags;
import org.bouncycastle.bcpg.HashAlgorithmTags;
import org.bouncycastle.bcpg.PublicKeyAlgorithmTags;
import org.bouncycastle.bcpg.SignatureSubpacketTags;
import org.bouncycastle.bcpg.SymmetricKeyAlgorithmTags;
import org.bouncycastle.bcpg.sig.KeyFlags;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.PGPLiteralData;
import org.bouncycastle.openpgp.PGPLiteralDataGenerator;
import org.bouncycastle.openpgp.PGPObjectFactory;
import org.bouncycastle.openpgp.PGPOnePassSignature;
import org.bouncycastle.openpgp.PGPOnePassSignatureList;
import org.bouncycastle.openpgp.PGPPrivateKey;
import org.bouncycastle.openpgp.PGPPublicKey;
import org.bouncycastle.openpgp.PGPSecretKey;
import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.bouncycastle.openpgp.PGPSignature;
import org.bouncycastle.openpgp.PGPSignatureGenerator;
import org.bouncycastle.openpgp.PGPSignatureList;
import org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator;
import org.bouncycastle.openpgp.PGPSignatureSubpacketVector;
import org.bouncycastle.openpgp.PGPV3SignatureGenerator;
import org.bouncycastle.util.encoders.Base64;
import org.bouncycastle.util.io.Streams;
import org.bouncycastle.util.test.SimpleTest;
import org.bouncycastle.util.test.UncloseableOutputStream;
public class PGPSignatureTest
extends SimpleTest
{
private static final int[] NO_PREFERENCES = null;
private static final int[] PREFERRED_SYMMETRIC_ALGORITHMS = new int[] { SymmetricKeyAlgorithmTags.AES_128, SymmetricKeyAlgorithmTags.TRIPLE_DES };
private static final int[] PREFERRED_HASH_ALGORITHMS = new int[] { HashAlgorithmTags.SHA1, HashAlgorithmTags.SHA256 };
private static final int[] PREFERRED_COMPRESSION_ALGORITHMS = new int[] { CompressionAlgorithmTags.ZLIB };
private static final int TEST_EXPIRATION_TIME = 10000;
private static final String TEST_USER_ID = "test user id";
private static final byte[] TEST_DATA = "hello world!\nhello world!\n".getBytes();
private static final byte[] TEST_DATA_WITH_CRLF = "hello world!\r\nhello world!\r\n".getBytes();
byte[] dsaKeyRing = Base64.decode(
"lQHhBD9HBzURBACzkxRCVGJg5+Ld9DU4Xpnd4LCKgMq7YOY7Gi0EgK92gbaa6+zQ"
+ "oQFqz1tt3QUmpz3YVkm/zLESBBtC1ACIXGggUdFMUr5I87+1Cb6vzefAtGt8N5VV"
+ "1F/MXv1gJz4Bu6HyxL/ncfe71jsNhav0i4yAjf2etWFj53zK6R+Ojg5H6wCgpL9/"
+ "tXVfGP8SqFvyrN/437MlFSUEAIN3V6j/MUllyrZglrtr2+RWIwRrG/ACmrF6hTug"
+ "Ol4cQxaDYNcntXbhlTlJs9MxjTH3xxzylyirCyq7HzGJxZzSt6FTeh1DFYzhJ7Qu"
+ "YR1xrSdA6Y0mUv0ixD5A4nPHjupQ5QCqHGeRfFD/oHzD4zqBnJp/BJ3LvQ66bERJ"
+ "mKl5A/4uj3HoVxpb0vvyENfRqKMmGBISycY4MoH5uWfb23FffsT9r9KL6nJ4syLz"
+ "aRR0gvcbcjkc9Z3epI7gr3jTrb4d8WPxsDbT/W1tv9bG/EHawomLcihtuUU68Uej"
+ "6/wZot1XJqu2nQlku57+M/V2X1y26VKsipolPfja4uyBOOyvbP4DAwIDIBTxWjkC"
+ "GGAWQO2jy9CTvLHJEoTO7moHrp1FxOVpQ8iJHyRqZzLllO26OzgohbiPYz8u9qCu"
+ "lZ9Xn7QzRXJpYyBFY2hpZG5hIChEU0EgVGVzdCBLZXkpIDxlcmljQGJvdW5jeWNh"
+ "c3RsZS5vcmc+iFkEExECABkFAj9HBzUECwcDAgMVAgMDFgIBAh4BAheAAAoJEM0j"
+ "9enEyjRDAlwAnjTjjt57NKIgyym7OTCwzIU3xgFpAJ0VO5m5PfQKmGJRhaewLSZD"
+ "4nXkHg==");
char[] dsaPass = "hello world".toCharArray();
byte[] rsaKeyRing = Base64.decode(
"lQIEBEBXUNMBBADScQczBibewnbCzCswc/9ut8R0fwlltBRxMW0NMdKJY2LF"
+ "7k2COeLOCIU95loJGV6ulbpDCXEO2Jyq8/qGw1qD3SCZNXxKs3GS8Iyh9Uwd"
+ "VL07nMMYl5NiQRsFB7wOb86+94tYWgvikVA5BRP5y3+O3GItnXnpWSJyREUy"
+ "6WI2QQAGKf4JAwIVmnRs4jtTX2DD05zy2mepEQ8bsqVAKIx7lEwvMVNcvg4Y"
+ "8vFLh9Mf/uNciwL4Se/ehfKQ/AT0JmBZduYMqRU2zhiBmxj4cXUQ0s36ysj7"
+ "fyDngGocDnM3cwPxaTF1ZRBQHSLewP7dqE7M73usFSz8vwD/0xNOHFRLKbsO"
+ "RqDlLA1Cg2Yd0wWPS0o7+qqk9ndqrjjSwMM8ftnzFGjShAdg4Ca7fFkcNePP"
+ "/rrwIH472FuRb7RbWzwXA4+4ZBdl8D4An0dwtfvAO+jCZSrLjmSpxEOveJxY"
+ "GduyR4IA4lemvAG51YHTHd4NXheuEqsIkn1yarwaaj47lFPnxNOElOREMdZb"
+ "nkWQb1jfgqO24imEZgrLMkK9bJfoDnlF4k6r6hZOp5FSFvc5kJB4cVo1QJl4"
+ "pwCSdoU6luwCggrlZhDnkGCSuQUUW45NE7Br22NGqn4/gHs0KCsWbAezApGj"
+ "qYUCfX1bcpPzUMzUlBaD5rz2vPeO58CDtBJ0ZXN0ZXIgPHRlc3RAdGVzdD6I"
+ "sgQTAQIAHAUCQFdQ0wIbAwQLBwMCAxUCAwMWAgECHgECF4AACgkQs8JyyQfH"
+ "97I1QgP8Cd+35maM2cbWV9iVRO+c5456KDi3oIUSNdPf1NQrCAtJqEUhmMSt"
+ "QbdiaFEkPrORISI/2htXruYn0aIpkCfbUheHOu0sef7s6pHmI2kOQPzR+C/j"
+ "8D9QvWsPOOso81KU2axUY8zIer64Uzqc4szMIlLw06c8vea27RfgjBpSCryw"
+ "AgAA");
char[] rsaPass = "2002 Buffalo Sabres".toCharArray();
byte[] nullPacketsSubKeyBinding = Base64.decode(
"iDYEGBECAAAAACp9AJ9PlJCrFpi+INwG7z61eku2Wg1HaQCgl33X5Egj+Kf7F9CXIWj2iFCvQDo=");
public void performTest()
throws Exception
{
//
// RSA tests
//
PGPSecretKeyRing pgpPriv = new PGPSecretKeyRing(rsaKeyRing);
PGPSecretKey secretKey = pgpPriv.getSecretKey();
PGPPrivateKey pgpPrivKey = secretKey.extractPrivateKey(rsaPass, "BC");
try
{
testSig(PublicKeyAlgorithmTags.DSA, HashAlgorithmTags.SHA1, secretKey.getPublicKey(), pgpPrivKey);
fail("RSA wrong key test failed.");
}
catch (PGPException e)
{
// expected
}
try
{
testSigV3(PublicKeyAlgorithmTags.DSA, HashAlgorithmTags.SHA1, secretKey.getPublicKey(), pgpPrivKey);
fail("RSA V3 wrong key test failed.");
}
catch (PGPException e)
{
// expected
}
//
// certifications
//
PGPSignatureGenerator sGen = new PGPSignatureGenerator(PublicKeyAlgorithmTags.RSA_GENERAL, HashAlgorithmTags.SHA1, "BC");
sGen.initSign(PGPSignature.KEY_REVOCATION, pgpPrivKey);
PGPSignature sig = sGen.generateCertification(secretKey.getPublicKey());
sig.initVerify(secretKey.getPublicKey(), "BC");
if (!sig.verifyCertification(secretKey.getPublicKey()))
{
fail("revocation verification failed.");
}
PGPSecretKeyRing pgpDSAPriv = new PGPSecretKeyRing(dsaKeyRing);
PGPSecretKey secretDSAKey = pgpDSAPriv.getSecretKey();
PGPPrivateKey pgpPrivDSAKey = secretDSAKey.extractPrivateKey(dsaPass, "BC");
sGen = new PGPSignatureGenerator(PublicKeyAlgorithmTags.DSA, HashAlgorithmTags.SHA1, "BC");
sGen.initSign(PGPSignature.SUBKEY_BINDING, pgpPrivDSAKey);
PGPSignatureSubpacketGenerator unhashedGen = new PGPSignatureSubpacketGenerator();
PGPSignatureSubpacketGenerator hashedGen = new PGPSignatureSubpacketGenerator();
hashedGen.setSignatureExpirationTime(false, TEST_EXPIRATION_TIME);
hashedGen.setSignerUserID(true, TEST_USER_ID);
hashedGen.setPreferredCompressionAlgorithms(false, PREFERRED_COMPRESSION_ALGORITHMS);
hashedGen.setPreferredHashAlgorithms(false, PREFERRED_HASH_ALGORITHMS);
hashedGen.setPreferredSymmetricAlgorithms(false, PREFERRED_SYMMETRIC_ALGORITHMS);
sGen.setHashedSubpackets(hashedGen.generate());
sGen.setUnhashedSubpackets(unhashedGen.generate());
sig = sGen.generateCertification(secretDSAKey.getPublicKey(), secretKey.getPublicKey());
byte[] sigBytes = sig.getEncoded();
PGPObjectFactory f = new PGPObjectFactory(sigBytes);
sig = ((PGPSignatureList) f.nextObject()).get(0);
sig.initVerify(secretDSAKey.getPublicKey(), "BC");
if (!sig.verifyCertification(secretDSAKey.getPublicKey(), secretKey.getPublicKey()))
{
fail("subkey binding verification failed.");
}
PGPSignatureSubpacketVector hashedPcks = sig.getHashedSubPackets();
PGPSignatureSubpacketVector unhashedPcks = sig.getUnhashedSubPackets();
if (hashedPcks.size() != 6)
{
fail("wrong number of hashed packets found.");
}
if (unhashedPcks.size() != 1)
{
fail("wrong number of unhashed packets found.");
}
if (!hashedPcks.getSignerUserID().equals(TEST_USER_ID))
{
fail("test userid not matching");
}
if (hashedPcks.getSignatureExpirationTime() != TEST_EXPIRATION_TIME)
{
fail("test signature expiration time not matching");
}
if (unhashedPcks.getIssuerKeyID() != secretDSAKey.getKeyID())
{
fail("wrong issuer key ID found in certification");
}
int[] prefAlgs = hashedPcks.getPreferredCompressionAlgorithms();
preferredAlgorithmCheck("compression", PREFERRED_COMPRESSION_ALGORITHMS, prefAlgs);
prefAlgs = hashedPcks.getPreferredHashAlgorithms();
preferredAlgorithmCheck("hash", PREFERRED_HASH_ALGORITHMS, prefAlgs);
prefAlgs = hashedPcks.getPreferredSymmetricAlgorithms();
preferredAlgorithmCheck("symmetric", PREFERRED_SYMMETRIC_ALGORITHMS, prefAlgs);
int[] criticalHashed = hashedPcks.getCriticalTags();
if (criticalHashed.length != 1)
{
fail("wrong number of critical packets found.");
}
if (criticalHashed[0] != SignatureSubpacketTags.SIGNER_USER_ID)
{
fail("wrong critical packet found in tag list.");
}
//
// no packets passed
//
sGen = new PGPSignatureGenerator(PublicKeyAlgorithmTags.DSA, HashAlgorithmTags.SHA1, "BC");
sGen.initSign(PGPSignature.SUBKEY_BINDING, pgpPrivDSAKey);
sGen.setHashedSubpackets(null);
sGen.setUnhashedSubpackets(null);
sig = sGen.generateCertification(TEST_USER_ID, secretKey.getPublicKey());
sig.initVerify(secretDSAKey.getPublicKey(), "BC");
if (!sig.verifyCertification(TEST_USER_ID, secretKey.getPublicKey()))
{
fail("subkey binding verification failed.");
}
hashedPcks = sig.getHashedSubPackets();
if (hashedPcks.size() != 1)
{
fail("found wrong number of hashed packets");
}
unhashedPcks = sig.getUnhashedSubPackets();
if (unhashedPcks.size() != 1)
{
fail("found wrong number of unhashed packets");
}
try
{
sig.verifyCertification(secretKey.getPublicKey());
fail("failed to detect non-key signature.");
}
catch (PGPException e)
{
// expected
}
//
// override hash packets
//
sGen = new PGPSignatureGenerator(PublicKeyAlgorithmTags.DSA, HashAlgorithmTags.SHA1, "BC");
sGen.initSign(PGPSignature.SUBKEY_BINDING, pgpPrivDSAKey);
hashedGen = new PGPSignatureSubpacketGenerator();
hashedGen.setSignatureCreationTime(false, new Date(0L));
sGen.setHashedSubpackets(hashedGen.generate());
sGen.setUnhashedSubpackets(null);
sig = sGen.generateCertification(TEST_USER_ID, secretKey.getPublicKey());
sig.initVerify(secretDSAKey.getPublicKey(), "BC");
if (!sig.verifyCertification(TEST_USER_ID, secretKey.getPublicKey()))
{
fail("subkey binding verification failed.");
}
hashedPcks = sig.getHashedSubPackets();
if (hashedPcks.size() != 1)
{
fail("found wrong number of hashed packets in override test");
}
if (!hashedPcks.hasSubpacket(SignatureSubpacketTags.CREATION_TIME))
{
fail("hasSubpacket test for creation time failed");
}
if (!hashedPcks.getSignatureCreationTime().equals(new Date(0L)))
{
fail("creation of overriden date failed.");
}
prefAlgs = hashedPcks.getPreferredCompressionAlgorithms();
preferredAlgorithmCheck("compression", NO_PREFERENCES, prefAlgs);
prefAlgs = hashedPcks.getPreferredHashAlgorithms();
preferredAlgorithmCheck("hash", NO_PREFERENCES, prefAlgs);
prefAlgs = hashedPcks.getPreferredSymmetricAlgorithms();
preferredAlgorithmCheck("symmetric", NO_PREFERENCES, prefAlgs);
if (hashedPcks.getKeyExpirationTime() != 0)
{
fail("unexpected key expiration time found");
}
if (hashedPcks.getSignatureExpirationTime() != 0)
{
fail("unexpected signature expiration time found");
}
if (hashedPcks.getSignerUserID() != null)
{
fail("unexpected signer user ID found");
}
criticalHashed = hashedPcks.getCriticalTags();
if (criticalHashed.length != 0)
{
fail("critical packets found when none expected");
}
unhashedPcks = sig.getUnhashedSubPackets();
if (unhashedPcks.size() != 1)
{
fail("found wrong number of unhashed packets in override test");
}
//
// general signatures
//
testSig(PublicKeyAlgorithmTags.RSA_GENERAL, HashAlgorithmTags.SHA256, secretKey.getPublicKey(), pgpPrivKey);
testSig(PublicKeyAlgorithmTags.RSA_GENERAL, HashAlgorithmTags.SHA384, secretKey.getPublicKey(), pgpPrivKey);
testSig(PublicKeyAlgorithmTags.RSA_GENERAL, HashAlgorithmTags.SHA512, secretKey.getPublicKey(), pgpPrivKey);
testSigV3(PublicKeyAlgorithmTags.RSA_GENERAL, HashAlgorithmTags.SHA1, secretKey.getPublicKey(), pgpPrivKey);
testTextSig(PublicKeyAlgorithmTags.RSA_GENERAL, HashAlgorithmTags.SHA1, secretKey.getPublicKey(), pgpPrivKey, TEST_DATA_WITH_CRLF, TEST_DATA_WITH_CRLF);
testTextSig(PublicKeyAlgorithmTags.RSA_GENERAL, HashAlgorithmTags.SHA1, secretKey.getPublicKey(), pgpPrivKey, TEST_DATA, TEST_DATA_WITH_CRLF);
testTextSigV3(PublicKeyAlgorithmTags.RSA_GENERAL, HashAlgorithmTags.SHA1, secretKey.getPublicKey(), pgpPrivKey, TEST_DATA_WITH_CRLF, TEST_DATA_WITH_CRLF);
testTextSigV3(PublicKeyAlgorithmTags.RSA_GENERAL, HashAlgorithmTags.SHA1, secretKey.getPublicKey(), pgpPrivKey, TEST_DATA, TEST_DATA_WITH_CRLF);
//
// DSA Tests
//
pgpPriv = new PGPSecretKeyRing(dsaKeyRing);
secretKey = pgpPriv.getSecretKey();
pgpPrivKey = secretKey.extractPrivateKey(dsaPass, "BC");
try
{
testSig(PublicKeyAlgorithmTags.RSA_GENERAL, HashAlgorithmTags.SHA1, secretKey.getPublicKey(), pgpPrivKey);
fail("DSA wrong key test failed.");
}
catch (PGPException e)
{
// expected
}
try
{
testSigV3(PublicKeyAlgorithmTags.RSA_GENERAL, HashAlgorithmTags.SHA1, secretKey.getPublicKey(), pgpPrivKey);
fail("DSA V3 wrong key test failed.");
}
catch (PGPException e)
{
// expected
}
testSig(PublicKeyAlgorithmTags.DSA, HashAlgorithmTags.SHA1, secretKey.getPublicKey(), pgpPrivKey);
testSigV3(PublicKeyAlgorithmTags.DSA, HashAlgorithmTags.SHA1, secretKey.getPublicKey(), pgpPrivKey);
testTextSig(PublicKeyAlgorithmTags.DSA, HashAlgorithmTags.SHA1, secretKey.getPublicKey(), pgpPrivKey, TEST_DATA_WITH_CRLF, TEST_DATA_WITH_CRLF);
testTextSig(PublicKeyAlgorithmTags.DSA, HashAlgorithmTags.SHA1, secretKey.getPublicKey(), pgpPrivKey, TEST_DATA, TEST_DATA_WITH_CRLF);
testTextSigV3(PublicKeyAlgorithmTags.DSA, HashAlgorithmTags.SHA1, secretKey.getPublicKey(), pgpPrivKey, TEST_DATA_WITH_CRLF, TEST_DATA_WITH_CRLF);
testTextSigV3(PublicKeyAlgorithmTags.DSA, HashAlgorithmTags.SHA1, secretKey.getPublicKey(), pgpPrivKey, TEST_DATA, TEST_DATA_WITH_CRLF);
// special cases
//
testMissingSubpackets(nullPacketsSubKeyBinding);
testMissingSubpackets(generateV3BinarySig(pgpPrivKey, PublicKeyAlgorithmTags.DSA, HashAlgorithmTags.SHA1));
// keyflags
testKeyFlagsValues();
}
private void testKeyFlagsValues()
{
checkValue(KeyFlags.CERTIFY_OTHER, 0x01);
checkValue(KeyFlags.SIGN_DATA, 0x02);
checkValue(KeyFlags.ENCRYPT_COMMS, 0x04);
checkValue(KeyFlags.ENCRYPT_STORAGE, 0x08);
checkValue(KeyFlags.SPLIT, 0x10);
checkValue(KeyFlags.AUTHENTICATION, 0x20);
checkValue(KeyFlags.SHARED, 0x80);
// yes this actually happens
checkValue(new byte[] { 4, 0, 0, 0 }, 0x04);
checkValue(new byte[] { 4, 0, 0 }, 0x04);
checkValue(new byte[] { 4, 0 }, 0x04);
checkValue(new byte[] { 4 }, 0x04);
}
private void checkValue(int flag, int value)
{
KeyFlags f = new KeyFlags(true, flag);
if (f.getFlags() != value)
{
fail("flag value mismatch");
}
}
private void checkValue(byte[] flag, int value)
{
KeyFlags f = new KeyFlags(true, flag);
if (f.getFlags() != value)
{
fail("flag value mismatch");
}
}
private void testMissingSubpackets(byte[] signature)
throws IOException
{
PGPObjectFactory f = new PGPObjectFactory(signature);
Object obj = f.nextObject();
while (!(obj instanceof PGPSignatureList))
{
obj = f.nextObject();
if (obj instanceof PGPLiteralData)
{
InputStream in = ((PGPLiteralData)obj).getDataStream();
Streams.drain(in);
}
}
PGPSignature sig = ((PGPSignatureList)obj).get(0);
if (sig.getVersion() > 3)
{
PGPSignatureSubpacketVector v = sig.getHashedSubPackets();
if (v.getKeyExpirationTime() != 0)
{
fail("key expiration time not zero for missing subpackets");
}
if (!sig.hasSubpackets())
{
fail("hasSubpackets() returns false with packets");
}
}
else
{
if (sig.getHashedSubPackets() != null)
{
fail("hashed sub packets found when none expected");
}
if (sig.getUnhashedSubPackets() != null)
{
fail("unhashed sub packets found when none expected");
}
if (sig.hasSubpackets())
{
fail("hasSubpackets() returns true with no packets");
}
}
}
private void preferredAlgorithmCheck(
String type,
int[] expected,
int[] prefAlgs)
{
if (expected == null)
{
if (prefAlgs != null)
{
fail("preferences for " + type + " found when none expected");
}
}
else
{
if (prefAlgs.length != expected.length)
{
fail("wrong number of preferred " + type + " algorithms found");
}
for (int i = 0; i != expected.length; i++)
{
if (expected[i] != prefAlgs[i])
{
fail("wrong algorithm found for " + type + ": expected " + expected[i] + " got " + prefAlgs);
}
}
}
}
private void testSig(
int encAlgorithm,
int hashAlgorithm,
PGPPublicKey pubKey,
PGPPrivateKey privKey)
throws Exception
{
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
ByteArrayInputStream testIn = new ByteArrayInputStream(TEST_DATA);
PGPSignatureGenerator sGen = new PGPSignatureGenerator(encAlgorithm, hashAlgorithm, "BC");
sGen.initSign(PGPSignature.BINARY_DOCUMENT, privKey);
sGen.generateOnePassVersion(false).encode(bOut);
PGPLiteralDataGenerator lGen = new PGPLiteralDataGenerator();
OutputStream lOut = lGen.open(
new UncloseableOutputStream(bOut),
PGPLiteralData.BINARY,
"_CONSOLE",
TEST_DATA.length * 2,
new Date());
int ch;
while ((ch = testIn.read()) >= 0)
{
lOut.write(ch);
sGen.update((byte)ch);
}
lOut.write(TEST_DATA);
sGen.update(TEST_DATA);
lGen.close();
sGen.generate().encode(bOut);
verifySignature(bOut.toByteArray(), hashAlgorithm, pubKey, TEST_DATA);
}
private void testTextSig(
int encAlgorithm,
int hashAlgorithm,
PGPPublicKey pubKey,
PGPPrivateKey privKey,
byte[] data,
byte[] canonicalData)
throws Exception
{
PGPSignatureGenerator sGen = new PGPSignatureGenerator(encAlgorithm, HashAlgorithmTags.SHA1, "BC");
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
ByteArrayInputStream testIn = new ByteArrayInputStream(data);
Date creationTime = new Date();
sGen.initSign(PGPSignature.CANONICAL_TEXT_DOCUMENT, privKey);
sGen.generateOnePassVersion(false).encode(bOut);
PGPLiteralDataGenerator lGen = new PGPLiteralDataGenerator();
OutputStream lOut = lGen.open(
new UncloseableOutputStream(bOut),
PGPLiteralData.TEXT,
"_CONSOLE",
data.length * 2,
creationTime);
int ch;
while ((ch = testIn.read()) >= 0)
{
lOut.write(ch);
sGen.update((byte)ch);
}
lOut.write(data);
sGen.update(data);
lGen.close();
PGPSignature sig = sGen.generate();
if (sig.getCreationTime().getTime() == 0)
{
fail("creation time not set in v4 signature");
}
sig.encode(bOut);
verifySignature(bOut.toByteArray(), hashAlgorithm, pubKey, canonicalData);
}
private void testSigV3(
int encAlgorithm,
int hashAlgorithm,
PGPPublicKey pubKey,
PGPPrivateKey privKey)
throws Exception
{
byte[] bytes = generateV3BinarySig(privKey, encAlgorithm, hashAlgorithm);
verifySignature(bytes, hashAlgorithm, pubKey, TEST_DATA);
}
private byte[] generateV3BinarySig(PGPPrivateKey privKey, int encAlgorithm, int hashAlgorithm)
throws Exception
{
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
ByteArrayInputStream testIn = new ByteArrayInputStream(TEST_DATA);
PGPV3SignatureGenerator sGen = new PGPV3SignatureGenerator(encAlgorithm, hashAlgorithm, "BC");
sGen.initSign(PGPSignature.BINARY_DOCUMENT, privKey);
sGen.generateOnePassVersion(false).encode(bOut);
PGPLiteralDataGenerator lGen = new PGPLiteralDataGenerator();
OutputStream lOut = lGen.open(
new UncloseableOutputStream(bOut),
PGPLiteralData.BINARY,
"_CONSOLE",
TEST_DATA.length * 2,
new Date());
int ch;
while ((ch = testIn.read()) >= 0)
{
lOut.write(ch);
sGen.update((byte)ch);
}
lOut.write(TEST_DATA);
sGen.update(TEST_DATA);
lGen.close();
sGen.generate().encode(bOut);
return bOut.toByteArray();
}
private void testTextSigV3(
int encAlgorithm,
int hashAlgorithm,
PGPPublicKey pubKey,
PGPPrivateKey privKey,
byte[] data,
byte[] canonicalData)
throws Exception
{
PGPV3SignatureGenerator sGen = new PGPV3SignatureGenerator(encAlgorithm, HashAlgorithmTags.SHA1, "BC");
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
ByteArrayInputStream testIn = new ByteArrayInputStream(data);
sGen.initSign(PGPSignature.CANONICAL_TEXT_DOCUMENT, privKey);
sGen.generateOnePassVersion(false).encode(bOut);
PGPLiteralDataGenerator lGen = new PGPLiteralDataGenerator();
OutputStream lOut = lGen.open(
new UncloseableOutputStream(bOut),
PGPLiteralData.TEXT,
"_CONSOLE",
data.length * 2,
new Date());
int ch;
while ((ch = testIn.read()) >= 0)
{
lOut.write(ch);
sGen.update((byte)ch);
}
lOut.write(data);
sGen.update(data);
lGen.close();
PGPSignature sig = sGen.generate();
if (sig.getCreationTime().getTime() == 0)
{
fail("creation time not set in v3 signature");
}
sig.encode(bOut);
verifySignature(bOut.toByteArray(), hashAlgorithm, pubKey, canonicalData);
}
private void verifySignature(
byte[] encodedSig,
int hashAlgorithm,
PGPPublicKey pubKey,
byte[] original)
throws IOException, PGPException, NoSuchProviderException, SignatureException
{
PGPObjectFactory pgpFact = new PGPObjectFactory(encodedSig);
PGPOnePassSignatureList p1 = (PGPOnePassSignatureList)pgpFact.nextObject();
PGPOnePassSignature ops = p1.get(0);
PGPLiteralData p2 = (PGPLiteralData)pgpFact.nextObject();
InputStream dIn = p2.getInputStream();
ops.initVerify(pubKey, "BC");
int ch;
while ((ch = dIn.read()) >= 0)
{
ops.update((byte)ch);
}
PGPSignatureList p3 = (PGPSignatureList)pgpFact.nextObject();
PGPSignature sig = p3.get(0);
Date creationTime = sig.getCreationTime();
Date now = new Date();
// Check creationTime is recent
if (creationTime.after(now)
|| creationTime.before(new Date(now.getTime() - 10 * 60 * 1000)))
{
fail("bad creation time in signature: " + creationTime);
}
if (sig.getKeyID() != pubKey.getKeyID())
{
fail("key id mismatch in signature");
}
if (!ops.verify(sig))
{
fail("Failed generated signature check - " + hashAlgorithm);
}
sig.initVerify(pubKey, "BC");
for (int i = 0; i != original.length; i++)
{
sig.update(original[i]);
}
sig.update(original);
if (!sig.verify())
{
fail("Failed generated signature check against original data");
}
}
public String getName()
{
return "PGPSignatureTest";
}
public static void main(
String[] args)
{
Security.addProvider(new BouncyCastleProvider());
runTest(new PGPSignatureTest());
}
}
| {
"content_hash": "bd3fba6cce1bbb141333aade58231ace",
"timestamp": "",
"source": "github",
"line_count": 780,
"max_line_length": 162,
"avg_line_length": 35.79102564102564,
"alnum_prop": 0.6184045563635061,
"repo_name": "sake/bouncycastle-java",
"id": "d49c88aeb551253c83882cc6b83079d602741456",
"size": "27917",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/src/org/bouncycastle/openpgp/test/PGPSignatureTest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "21610104"
},
{
"name": "Standard ML",
"bytes": "20502"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Sp. pl. 1:60. 1753
#### Original name
null
### Remarks
null | {
"content_hash": "c7082735bd6c5e09f6ff5a532a0a094e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 11.384615384615385,
"alnum_prop": 0.6756756756756757,
"repo_name": "mdoering/backbone",
"id": "673bd8c9c72aa7fdc34d7e5316b81d36875fc22d",
"size": "191",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Phleum/Phleum arenarium/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
const INIT_FORM = 'INIT_FORM';
const FORM_FIELD_CHANGE = 'FORM_FIELD_CHANGE';
const CLEAR_FORM = 'CLEAR_FORM';
const DELETE_FORM = 'DELETE_FORM';
const ADD_VALUE_TO_ARRAY_FIELD = 'ADD_VALUE_TO_ARRAY_FIELD';
const REMOVE_VALUE_FROM_ARRAY_FIELD = 'REMOVE_VALUE_FROM_ARRAY_FIELD';
export default {
INIT_FORM,
FORM_FIELD_CHANGE,
CLEAR_FORM,
DELETE_FORM,
ADD_VALUE_TO_ARRAY_FIELD,
REMOVE_VALUE_FROM_ARRAY_FIELD,
};
| {
"content_hash": "d135f99f310f7e243f8a7c69ef62cd25",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 70,
"avg_line_length": 28.2,
"alnum_prop": 0.7186761229314421,
"repo_name": "apconic/aos-forms",
"id": "df0fc3d9fbab6e44ce1506ceca1296a935494ae8",
"size": "423",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/actions/forms-action-types.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "64276"
}
],
"symlink_target": ""
} |
using System.Collections.Generic;
using System.Linq;
using PholioVisualisation.DataAccess;
using PholioVisualisation.Export.FileBuilder.Wrappers;
using PholioVisualisation.PholioObjects;
namespace PholioVisualisation.Export.FileBuilder.Containers
{
public class BodyPeriodTrendContainer
{
private readonly MultipleCoreDataCollector _coreDataCollector;
private readonly CsvBuilderAttributesForPeriodsWrapper _attributesForPeriods;
public BodyPeriodTrendContainer(MultipleCoreDataCollector coreDataCollector, CsvBuilderAttributesForPeriodsWrapper attributesForPeriods)
{
_coreDataCollector = coreDataCollector;
_attributesForPeriods = attributesForPeriods;
}
public TrendMarkerResult GetTrendMarker(IndicatorMetadata indicatorMetadata, CoreDataSet coreData,
ExportAreaHelper.GeographicalCategory geographicalCategory, Grouping grouping)
{
IList<CoreDataSet> trendDataList = null;
if (geographicalCategory == ExportAreaHelper.GeographicalCategory.National)
trendDataList = _coreDataCollector.GetDataListForEngland(coreData);
else if (geographicalCategory == ExportAreaHelper.GeographicalCategory.SubNational)
trendDataList = _coreDataCollector.GetDataListForParentArea(coreData);
else if (geographicalCategory == ExportAreaHelper.GeographicalCategory.Local)
trendDataList = _coreDataCollector.GetDataListForChildArea(coreData);
// CsvBuilderIndicatorDataBodyPeriodWriter.WriteSinglePeriodInFile
// In this method when collecting core data for child, the most recent time period
// does not get added and this results in wrong calculation of recent trends for csv download.
// This is a workaround to add the core data to the trend data list for most recent time period if it is not already included.
if (trendDataList != null)
{
var trendDataForMostRecentTimePeriod = trendDataList.FirstOrDefault(x => x.Year == coreData.Year);
if (trendDataForMostRecentTimePeriod == null)
{
trendDataList.Add(coreData);
}
}
var trendMarkerResult = _attributesForPeriods.TrendMarkersProvider.GetTrendMarkerResult(indicatorMetadata, coreData.YearRange, trendDataList, grouping);
return trendMarkerResult;
}
}
} | {
"content_hash": "9ec67a4ef4eb307353f2b1552f16c81f",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 164,
"avg_line_length": 49.96,
"alnum_prop": 0.7157726180944756,
"repo_name": "PublicHealthEngland/fingertips-open",
"id": "9ea2bf05fdf5f5afac3ad7c2c2fa8152aa4cec3a",
"size": "2500",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "PholioVisualisationWS/Export/FileBuilder/Containers/BodyPeriodTrendContainer.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "743"
},
{
"name": "C#",
"bytes": "4367358"
},
{
"name": "CSS",
"bytes": "373415"
},
{
"name": "HTML",
"bytes": "519215"
},
{
"name": "JavaScript",
"bytes": "998759"
},
{
"name": "PowerShell",
"bytes": "1119"
},
{
"name": "TypeScript",
"bytes": "857356"
}
],
"symlink_target": ""
} |
import unittest
class PackageDataTest(unittest.TestCase):
def test_test(self):
pass
| {
"content_hash": "4a988ae1242555d4f8424966082db0c6",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 41,
"avg_line_length": 14.142857142857142,
"alnum_prop": 0.696969696969697,
"repo_name": "IPMITMO/statan",
"id": "f4eba6f75b249d3c80a3db3b5a9e2618afe4bf20",
"size": "99",
"binary": false,
"copies": "23",
"ref": "refs/heads/master",
"path": "coala-bears/tests/python/pyroma_test_files/complete/complete/tests.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "101"
},
{
"name": "Batchfile",
"bytes": "10931"
},
{
"name": "C",
"bytes": "28190"
},
{
"name": "C#",
"bytes": "45474"
},
{
"name": "C++",
"bytes": "335"
},
{
"name": "CSS",
"bytes": "6631"
},
{
"name": "Go",
"bytes": "96"
},
{
"name": "HTML",
"bytes": "1564"
},
{
"name": "Java",
"bytes": "592"
},
{
"name": "JavaScript",
"bytes": "472227"
},
{
"name": "Makefile",
"bytes": "15304"
},
{
"name": "PHP",
"bytes": "1804"
},
{
"name": "Python",
"bytes": "2312447"
},
{
"name": "Ruby",
"bytes": "447"
},
{
"name": "Shell",
"bytes": "12706"
}
],
"symlink_target": ""
} |
module HeatAssets
class Pipe < Base
end
end
| {
"content_hash": "152ba89e085d373bab3cb34c338f18a9",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 19,
"avg_line_length": 12,
"alnum_prop": 0.7291666666666666,
"repo_name": "quintel/etmoses",
"id": "4da49b429f87ee488ee2c51cf65bc1b8815db8c3",
"size": "48",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/models/heat_assets/pipe.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "23073"
},
{
"name": "CoffeeScript",
"bytes": "11708"
},
{
"name": "HTML",
"bytes": "102592"
},
{
"name": "JavaScript",
"bytes": "183612"
},
{
"name": "Python",
"bytes": "66567"
},
{
"name": "Ruby",
"bytes": "844774"
},
{
"name": "Shell",
"bytes": "1278"
}
],
"symlink_target": ""
} |
import { Column, Entity, Index, PrimaryGeneratedColumn } from "typeorm";
@Index("index_taggings_on_tag_id", ["tagId"], {})
@Index(
"index_taggings_on_taggable_id_and_taggable_type_and_context",
["taggableId", "taggableType", "context"],
{}
)
@Entity("taggings", { schema: "portal_development" })
export class Taggings {
@PrimaryGeneratedColumn({ type: "int", name: "id" })
id: number;
@Column("int", { name: "tag_id", nullable: true })
tagId: number | null;
@Column("int", { name: "taggable_id", nullable: true })
taggableId: number | null;
@Column("int", { name: "tagger_id", nullable: true })
taggerId: number | null;
@Column("varchar", { name: "tagger_type", nullable: true, length: 255 })
taggerType: string | null;
@Column("varchar", { name: "taggable_type", nullable: true, length: 255 })
taggableType: string | null;
@Column("varchar", { name: "context", nullable: true, length: 255 })
context: string | null;
@Column("datetime", { name: "created_at", nullable: true })
createdAt: Date | null;
}
| {
"content_hash": "487b072ce43c1511b15646dfd44c45ae",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 76,
"avg_line_length": 30.852941176470587,
"alnum_prop": 0.646329837940896,
"repo_name": "concord-consortium/rigse",
"id": "cc44d2a75e5d8e5f5c374a0cbef3dbba932d34d2",
"size": "1049",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "admin-panel/graphql-backend/src/entities/unused/Taggings.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3508"
},
{
"name": "Dockerfile",
"bytes": "3214"
},
{
"name": "Gherkin",
"bytes": "117760"
},
{
"name": "HTML",
"bytes": "34770"
},
{
"name": "Haml",
"bytes": "244441"
},
{
"name": "JavaScript",
"bytes": "1216080"
},
{
"name": "PHP",
"bytes": "613"
},
{
"name": "Procfile",
"bytes": "99"
},
{
"name": "Ruby",
"bytes": "2864366"
},
{
"name": "SCSS",
"bytes": "310565"
},
{
"name": "Shell",
"bytes": "8028"
},
{
"name": "TypeScript",
"bytes": "208615"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>shuffle: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.8.0 / shuffle - 8.7.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
shuffle
<small>
8.7.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-02-19 02:36:57 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-02-19 02:36:57 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.8.0 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.09.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.09.1 Official release 4.09.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/shuffle"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/Shuffle"]
depends: [
"ocaml"
"coq" {>= "8.7" & < "8.8~"}
]
tags: [ "keyword: Gilbreath's card trick" "keyword: binary sequences" "category: Miscellaneous/Logical Puzzles and Entertainment" ]
authors: [ "Gérard Huet" ]
bug-reports: "https://github.com/coq-contribs/shuffle/issues"
dev-repo: "git+https://github.com/coq-contribs/shuffle.git"
synopsis: "Gilbreath's card trick"
description:
"A full axiomatization and proof development of a non-trivial property of binary sequences, inspired from a card trick of N. Gilbreath."
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/shuffle/archive/v8.7.0.tar.gz"
checksum: "md5=b10d5313b30fa87cbc72b226aa27998b"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-shuffle.8.7.0 coq.8.8.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.8.0).
The following dependencies couldn't be met:
- coq-shuffle -> coq < 8.8~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-shuffle.8.7.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "8a75f054657f818c630c59061f345895",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 165,
"avg_line_length": 41.86666666666667,
"alnum_prop": 0.5409669947886508,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "804d813f9a7272580fc0b0ba900b78123d3c1dd7",
"size": "6934",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.09.1-2.0.6/released/8.8.0/shuffle/8.7.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
title: Syllabus
published: true
---
##### Course Description
This course introduces students to the art and science of designing usable, useful and enjoyable human-computer interfaces, with an emphasis on user-centered design techniques. It stresses the importance and necessity of effective interaction design techniques and presents current design methodologies and principles across multiple platforms. Students will gain valuable knowledge and experience by working in groups on a term-long design project.
##### Grading (tentative)
Individual (60%)
* Weekly Reading Quizzes: 10%
* UI Analysis (including required peer reviews): 15%
* UX Topic Overview: 35%
* Weekly One Minute Wrap-up Summaries: max. 2.5% bonus
Group (40%)
* Needsfinding and Exploratory Sketches: 20%
* Mockups and Usability Testing: 20%
Reading quizzes must be submitted no later than 10:00am class day - no exceptions. Weekly one minute wrap-up summaries must be submitted no later than 11:59pm the day of class. Assignments are due at the start of class. Assignments submitted after the start of class will be deducted 10%, and no assignments will be accepted after class without valid documentation (e.g. medical certificate).
Students must attain an overall passing grade on the weighted average of exams in the course in order to obtain a clear pass (C or better).
##### Required Textbook
Are you kidding me, in 2016? All required readings will be available on-line.
[plugin:content-inject](/sidebar)
| {
"content_hash": "d08787cbeec85d1c7a10ae93d937052b",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 451,
"avg_line_length": 58.03846153846154,
"alnum_prop": 0.776673293571902,
"repo_name": "hibbitts-design/grav-theme-course-hub-bones",
"id": "9d0dd68e6d17e09aa0a83bb79396626e22b806dc",
"size": "1513",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "_demo/single-course/04.syllabus/fullwidthpage.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "24007"
},
{
"name": "HTML",
"bytes": "62835"
},
{
"name": "JavaScript",
"bytes": "23130"
},
{
"name": "PHP",
"bytes": "3366"
}
],
"symlink_target": ""
} |
package org.deeplearning4j.text.tokenization.tokenizerFactory;
import org.deeplearning4j.text.tokenization.tokenizer.ChineseTokenizer;
import org.deeplearning4j.text.tokenization.tokenizer.TokenPreProcess;
import org.deeplearning4j.text.tokenization.tokenizer.Tokenizer;
import org.deeplearning4j.text.tokenization.tokenizerfactory.TokenizerFactory;
import java.io.InputStream;
/**
* @date: June 2,2017
* @author: wangfeng
* @Description:
*/
public class ChineseTokenizerFactory implements TokenizerFactory {
private TokenPreProcess tokenPreProcess;
@Override
public Tokenizer create(String toTokenize) {
Tokenizer tokenizer = new ChineseTokenizer(toTokenize);
tokenizer.setTokenPreProcessor(tokenPreProcess);
return tokenizer;
}
@Override
public Tokenizer create(InputStream toTokenize) {
throw new UnsupportedOperationException();
/* Tokenizer t = new ChineseStreamTokenizer(toTokenize);
t.setTokenPreProcessor(tokenPreProcess);
return t;*/
}
@Override
public void setTokenPreProcessor(TokenPreProcess tokenPreProcess) {
this.tokenPreProcess = tokenPreProcess;
}
@Override
public TokenPreProcess getTokenPreProcessor() {
return tokenPreProcess;
}
}
| {
"content_hash": "155d64d6bbf1f3404301d453741fec86",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 78,
"avg_line_length": 28.08695652173913,
"alnum_prop": 0.7484520123839009,
"repo_name": "RobAltena/deeplearning4j",
"id": "e5cee4115ce4084f33c7a3526ca9a5afe24b3057",
"size": "2053",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/deeplearning4j/text/tokenization/tokenizerFactory/ChineseTokenizerFactory.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2469"
},
{
"name": "C",
"bytes": "144275"
},
{
"name": "C#",
"bytes": "138404"
},
{
"name": "C++",
"bytes": "16954560"
},
{
"name": "CMake",
"bytes": "77377"
},
{
"name": "CSS",
"bytes": "10363"
},
{
"name": "Cuda",
"bytes": "2324886"
},
{
"name": "Dockerfile",
"bytes": "1329"
},
{
"name": "FreeMarker",
"bytes": "77045"
},
{
"name": "HTML",
"bytes": "38914"
},
{
"name": "Java",
"bytes": "36293636"
},
{
"name": "JavaScript",
"bytes": "436278"
},
{
"name": "PureBasic",
"bytes": "12256"
},
{
"name": "Python",
"bytes": "325018"
},
{
"name": "Ruby",
"bytes": "4558"
},
{
"name": "Scala",
"bytes": "355054"
},
{
"name": "Shell",
"bytes": "80490"
},
{
"name": "Smarty",
"bytes": "900"
},
{
"name": "Starlark",
"bytes": "931"
},
{
"name": "TypeScript",
"bytes": "80252"
}
],
"symlink_target": ""
} |
/*
* 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.
*/
package com.facebook.presto.plugin.geospatial;
import com.esri.core.geometry.Envelope;
import com.facebook.presto.geospatial.KdbTreeUtils;
import com.facebook.presto.geospatial.Rectangle;
import com.facebook.presto.spi.PrestoException;
import com.facebook.presto.spi.block.BlockBuilder;
import com.facebook.presto.spi.function.AggregationFunction;
import com.facebook.presto.spi.function.CombineFunction;
import com.facebook.presto.spi.function.InputFunction;
import com.facebook.presto.spi.function.OutputFunction;
import com.facebook.presto.spi.function.SqlType;
import com.facebook.presto.spi.type.StandardTypes;
import io.airlift.slice.Slice;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import static com.facebook.presto.geospatial.KdbTree.buildKdbTree;
import static com.facebook.presto.geospatial.serde.GeometrySerde.deserializeEnvelope;
import static com.facebook.presto.plugin.geospatial.GeometryType.GEOMETRY_TYPE_NAME;
import static com.facebook.presto.plugin.geospatial.SpatialPartitioningAggregateFunction.NAME;
import static com.facebook.presto.spi.StandardErrorCode.INVALID_FUNCTION_ARGUMENT;
import static com.facebook.presto.spi.type.StandardTypes.INTEGER;
import static com.facebook.presto.spi.type.VarcharType.VARCHAR;
import static java.lang.Math.toIntExact;
@AggregationFunction(value = NAME, decomposable = false, hidden = true)
public class SpatialPartitioningInternalAggregateFunction
{
private static final int MAX_SAMPLE_COUNT = 1_000_000;
private SpatialPartitioningInternalAggregateFunction() {}
@InputFunction
public static void input(SpatialPartitioningState state, @SqlType(GEOMETRY_TYPE_NAME) Slice slice, @SqlType(INTEGER) long partitionCount)
{
Envelope envelope = deserializeEnvelope(slice);
if (envelope.isEmpty()) {
return;
}
Rectangle extent = new Rectangle(envelope.getXMin(), envelope.getYMin(), envelope.getXMax(), envelope.getYMax());
if (state.getCount() == 0) {
state.setPartitionCount(toIntExact(partitionCount));
state.setExtent(extent);
state.setSamples(new ArrayList<>());
}
else {
state.setExtent(state.getExtent().merge(extent));
}
// use reservoir sampling
List<Rectangle> samples = state.getSamples();
if (samples.size() <= MAX_SAMPLE_COUNT) {
samples.add(extent);
}
else {
long sampleIndex = ThreadLocalRandom.current().nextLong(state.getCount());
if (sampleIndex < MAX_SAMPLE_COUNT) {
samples.set(toIntExact(sampleIndex), extent);
}
}
state.setCount(state.getCount() + 1);
}
@CombineFunction
public static void combine(SpatialPartitioningState state, SpatialPartitioningState otherState)
{
throw new UnsupportedOperationException("spatial_partitioning must run on a single node");
}
@OutputFunction(StandardTypes.VARCHAR)
public static void output(SpatialPartitioningState state, BlockBuilder out)
{
if (state.getCount() == 0) {
throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "No rows supplied to spatial partition.");
}
List<Rectangle> samples = state.getSamples();
int partitionCount = state.getPartitionCount();
int maxItemsPerNode = (samples.size() + partitionCount - 1) / partitionCount;
Rectangle envelope = state.getExtent();
// Add a small buffer on the right and upper sides
Rectangle paddedExtent = new Rectangle(envelope.getXMin(), envelope.getYMin(), Math.nextUp(envelope.getXMax()), Math.nextUp(envelope.getYMax()));
VARCHAR.writeString(out, KdbTreeUtils.toJson(buildKdbTree(maxItemsPerNode, paddedExtent, samples)));
}
}
| {
"content_hash": "6757a1fa931c2f13893fe6bcd9e0a475",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 153,
"avg_line_length": 41.28971962616822,
"alnum_prop": 0.7270258035310095,
"repo_name": "nezihyigitbasi/presto",
"id": "81c671b81f8a9a639df06157b45071dfb9dca96a",
"size": "4418",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "presto-geospatial/src/main/java/com/facebook/presto/plugin/geospatial/SpatialPartitioningInternalAggregateFunction.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "27865"
},
{
"name": "CSS",
"bytes": "13127"
},
{
"name": "HTML",
"bytes": "28633"
},
{
"name": "Java",
"bytes": "35888266"
},
{
"name": "JavaScript",
"bytes": "215161"
},
{
"name": "Makefile",
"bytes": "6830"
},
{
"name": "PLSQL",
"bytes": "2797"
},
{
"name": "Python",
"bytes": "8714"
},
{
"name": "SQLPL",
"bytes": "926"
},
{
"name": "Shell",
"bytes": "29909"
},
{
"name": "TSQL",
"bytes": "161695"
},
{
"name": "Thrift",
"bytes": "12631"
}
],
"symlink_target": ""
} |
from django.db import models
from react_cms.renderers import ReactRenderer
from react_cms.helpers import get_settings
import requests
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.db import transaction
class ContentResource(models.Model):
name = models.CharField("Resource Name", max_length=100)
path = models.CharField("Resource Path", max_length=191, unique=True)
json = models.TextField("Components", blank=True, null=True)
rendered = models.TextField("Rendered component", blank=True, null=True)
def __str__(self):
return "{} - {}".format(self.name, self.path)
def save(self):
self.rendered = ReactRenderer(self.json).render()
super(ContentResource, self).save()
@receiver(post_save, sender=ContentResource, dispatch_uid="notify_client")
def notify_client(sender, instance, **kwargs):
if not kwargs.get('raw'):
s = get_settings()
notify_url = s.get('CLIENT_URL', '')
if notify_url:
def on_commit():
r = requests.post(notify_url, {"resourcePath": instance.path})
transaction.on_commit(on_commit)
class UploadedFile(models.Model):
title = models.CharField("Title", max_length=200, null=True, blank=True)
file = models.FileField(upload_to="cms/files")
def __str__(self):
return "{} - {}".format(self.title, self.file)
| {
"content_hash": "d8bbf2faae1e51458b6531d20f74a4ae",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 74,
"avg_line_length": 33.65,
"alnum_prop": 0.7109955423476969,
"repo_name": "leonardoarroyo/django-react-cms",
"id": "336cf817d2bc1df1f57fa4d00551e10c26ca2758",
"size": "1346",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "react_cms/models.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "23603"
},
{
"name": "Python",
"bytes": "16556"
}
],
"symlink_target": ""
} |
var mongoose = require("mongoose");
// USER - email, name
var userSchema = new mongoose.Schema({
email: String,
name: String,
posts: [
{
type: mongoose.Schema.Types.ObjectId,
ref: "Post"
}
]
});
module.exports = mongoose.model("User", userSchema); | {
"content_hash": "37aa387d5cf42d1891f19d683759582f",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 52,
"avg_line_length": 21.266666666666666,
"alnum_prop": 0.542319749216301,
"repo_name": "fbartnitzek/notes",
"id": "2610b5e19d58fb180f66c37504845620595fdfbd",
"size": "319",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "web_developer_bootcamp/10_associations/models/user.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1376"
},
{
"name": "CSS",
"bytes": "18055"
},
{
"name": "Erlang",
"bytes": "4535"
},
{
"name": "HTML",
"bytes": "101590"
},
{
"name": "Io",
"bytes": "12395"
},
{
"name": "JavaScript",
"bytes": "478635"
},
{
"name": "Prolog",
"bytes": "14747"
},
{
"name": "Ruby",
"bytes": "5967"
},
{
"name": "Scala",
"bytes": "7305"
},
{
"name": "Shell",
"bytes": "11857"
},
{
"name": "Visual Basic",
"bytes": "25905"
}
],
"symlink_target": ""
} |
module Fastlane
module Actions
class DangerAction < Action
def self.run(params)
Actions.verify_gem!('danger')
cmd = []
cmd << 'bundle exec' if params[:use_bundle_exec] && shell_out_should_use_bundle_exec?
cmd << 'danger'
cmd << '--verbose' if params[:verbose]
danger_id = params[:danger_id]
dangerfile = params[:dangerfile]
cmd << "--danger_id=#{danger_id}" if danger_id
cmd << "--dangerfile=#{dangerfile}" if dangerfile
ENV['DANGER_GITHUB_API_TOKEN'] = params[:github_api_token] if params[:github_api_token]
Actions.sh(cmd.join(' '))
end
def self.description
"Runs `danger` for the project"
end
def self.details
[
"Formalize your Pull Request etiquette.",
"More information: https://github.com/danger/danger"
].join("\n")
end
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :use_bundle_exec,
env_name: "FL_DANGER_USE_BUNDLE_EXEC",
description: "Use bundle exec when there is a Gemfile presented",
is_string: false,
default_value: true),
FastlaneCore::ConfigItem.new(key: :verbose,
env_name: "FL_DANGER_VERBOSE",
description: "Show more debugging information",
is_string: false,
default_value: false),
FastlaneCore::ConfigItem.new(key: :danger_id,
env_name: "FL_DANGER_ID",
description: "The identifier of this Danger instance",
is_string: true,
optional: true),
FastlaneCore::ConfigItem.new(key: :dangerfile,
env_name: "FL_DANGER_DANGERFILE",
description: "The location of your Dangerfile",
is_string: true,
optional: true),
FastlaneCore::ConfigItem.new(key: :github_api_token,
env_name: "FL_DANGER_GITHUB_API_TOKEN",
description: "GitHub API token for danger",
sensitive: true,
is_string: true,
optional: true)
]
end
def self.is_supported?(platform)
true
end
def self.example_code
[
'danger',
'danger(
danger_id: "unit-tests",
dangerfile: "tests/MyOtherDangerFile",
github_api_token: ENV["GITHUB_API_TOKEN"],
verbose: true
)'
]
end
def self.category
:misc
end
def self.authors
["KrauseFx"]
end
end
end
end
| {
"content_hash": "220556c7c493191fa92e88ff77023322",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 104,
"avg_line_length": 35.69662921348315,
"alnum_prop": 0.4485363550519358,
"repo_name": "RishabhTayal/fastlane",
"id": "b98410db748dd734366ce3c09e55f80f8fa255db",
"size": "3177",
"binary": false,
"copies": "2",
"ref": "refs/heads/GoodMirek-sh-action",
"path": "fastlane/lib/fastlane/actions/danger.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "44371"
},
{
"name": "Java",
"bytes": "30809"
},
{
"name": "JavaScript",
"bytes": "39"
},
{
"name": "MATLAB",
"bytes": "115"
},
{
"name": "Objective-C",
"bytes": "69198"
},
{
"name": "Ruby",
"bytes": "3779984"
},
{
"name": "Shell",
"bytes": "45362"
},
{
"name": "Swift",
"bytes": "17934"
}
],
"symlink_target": ""
} |
var isES5 = (function(){
"use strict";
return this === void 0;
})();
if (isES5) {
module.exports = {
freeze: Object.freeze,
defineProperty: Object.defineProperty,
keys: Object.keys,
getPrototypeOf: Object.getPrototypeOf,
isArray: Array.isArray,
isES5: isES5
};
}
else {
var has = {}.hasOwnProperty;
var str = {}.toString;
var proto = {}.constructor.prototype;
function ObjectKeys(o) {
var ret = [];
for (var key in o) {
if (has.call(o, key)) {
ret.push(key);
}
}
return ret;
}
function ObjectDefineProperty(o, key, desc) {
o[key] = desc.value;
return o;
}
function ObjectFreeze(obj) {
return obj;
}
function ObjectGetPrototypeOf(obj) {
try {
return Object(obj).constructor.prototype;
}
catch (e) {
return proto;
}
}
function ArrayIsArray(obj) {
try {
return str.call(obj) === "[object Array]";
}
catch(e) {
return false;
}
}
module.exports = {
isArray: ArrayIsArray,
keys: ObjectKeys,
defineProperty: ObjectDefineProperty,
freeze: ObjectFreeze,
getPrototypeOf: ObjectGetPrototypeOf,
isES5: isES5
};
}
| {
"content_hash": "54f370cd8557b24beb9cee2d45532556",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 54,
"avg_line_length": 20.441176470588236,
"alnum_prop": 0.5107913669064749,
"repo_name": "viniborges/designizando",
"id": "8de1340a360871d3f4600465af0c25eb134e590a",
"size": "2513",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "node_modules/bookshelf/node_modules/bluebird/js/zalgo/es5.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "215111"
},
{
"name": "JavaScript",
"bytes": "4008078"
}
],
"symlink_target": ""
} |
package com.kasabi.data.movies.dbpedia;
import org.openjena.atlas.lib.Pair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.hp.hpl.jena.rdf.model.Model;
public class DBPediaMovieLinker extends DBPediaBaseLinker {
private static final Logger log = LoggerFactory.getLogger(DBPediaMovieLinker.class) ;
public DBPediaMovieLinker(String base) {
super(base);
}
@Override
public String getURL ( String name ) {
String result = null;
try {
String[] tokens = name.split("\t");
Pair<String,Model> pair = get(httpclient, "film", tokens[0]);
String url = pair.getLeft();
if ( url != null ) {
result = url;
}
} catch (Exception e) {
log.error ( e.getMessage(), e );
}
log.debug("getURL({}) --> {}", name, result);
return result;
}
}
| {
"content_hash": "a85f6821d09a853cfd48155140bb7a2b",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 86,
"avg_line_length": 23.694444444444443,
"alnum_prop": 0.6295427901524033,
"repo_name": "castagna/dataset-movies",
"id": "3aa4bf913d5f245c11224eaf7f87d68e7a5cfb95",
"size": "1658",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/kasabi/data/movies/dbpedia/DBPediaMovieLinker.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "145316"
}
],
"symlink_target": ""
} |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package armyc2.c2sd.renderer.utilities;
/**
*
* @author michael.spinelli
*/
public class UnitDef {
/**
* Just a category in the milstd hierarchy.
* Not something we draw.
* WILL NOT RENDER
*/
static public final int DRAW_CATEGORY_DONOTDRAW = 0;
/**
* Shape is defined by a single point
* 0 control points
*/
static public final int DRAW_CATEGORY_POINT = 8;
private String _basicSymbolId = "";
private String _description = "";
private int _drawCategory = 0;
private String _hierarchy = "";
private String _path = "";
/**
*
* @param symbolID
* @param description
* @param idc drar
* @param hierarchy
* @param path
*/
public UnitDef(String basicSymbolID, String description, int drawCategory, String hierarchy, String path)
{
//Set fields to their default values.
_basicSymbolId = basicSymbolID;
_description = description;
_drawCategory = drawCategory;
_hierarchy = hierarchy;
_path = path;
}
/**
* The basic 15 character basic symbol Id.
*/
public String getBasicSymbolId()
{
return _basicSymbolId;
}
/**
* The description of this tactical graphic. Typically the name of the tactical graphic in MIL-STD-2525B.
*/
public String getDescription()
{
return _description;
}
/**
* 8 is singlepoint unit, 0 is category
* (do not draw because it's just a category node in the tree)
* @return
*/
public int getDrawCategory()
{
return _drawCategory;
}
/**
* Defines where the symbol goes in the ms2525 hierarchy.
* 2.X.whatever
*/
public String getHierarchy()
{
return _hierarchy;
}
/**
* Defines where the symbol goes in the ms2525 hierarchy.
* STBOPS.INDIV.WHATEVER
*/
/*private String _strAlphaHierarchy;
public String getAlphaHierarchy()
{
return _strAlphaHierarchy;
}//*/
/**
* Defines where the symbol goes in the ms2525 hierarchy.
* Warfighting/something/something
*/
public String getFullPath()
{
return _path;
}
}
| {
"content_hash": "0c4cd16001b631273b63a8839f905b09",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 109,
"avg_line_length": 19.310924369747898,
"alnum_prop": 0.6070496083550914,
"repo_name": "bn-dignitas/mil-sym-android",
"id": "04c09a87f555b8a2b78491b89122ccbf600dd083",
"size": "2298",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Renderer/src/main/java/armyc2/c2sd/renderer/utilities/UnitDef.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "3781931"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<link href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/shift.css" rel="stylesheet">
<link rel="stylesheet" href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/bootstrap.css">
<link rel="stylesheet" href="main.css">
</head>
<body>
<div class="nav">
<div class="container">
<div class="headername">
<ul class="pull-left">
<li><a href="index.html">Lucas Hawk</a></li>
</ul>
</div>
<ul class="pull-right nav nav-tabs">
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About Me</a></li>
<li><a href="projects.html">Projects</a></li>
<li class="active"><a href="contact.html">Contact Me</a></li>
</ul>
</div>
</div>
</body>
</html>
| {
"content_hash": "176dc370d09b52fb57179d2331c504eb",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 107,
"avg_line_length": 29.517241379310345,
"alnum_prop": 0.5478971962616822,
"repo_name": "LBHawk/LBHawk.github.io",
"id": "f07308c2a8c1eb90f50b3c2df7d6a56109d0f7a6",
"size": "856",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "contact.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "160714"
},
{
"name": "HTML",
"bytes": "25783"
},
{
"name": "JavaScript",
"bytes": "59346"
},
{
"name": "PHP",
"bytes": "1091"
}
],
"symlink_target": ""
} |
<TS language="mn" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Create a new address</source>
<translation>Шинэ хаяг нээх</translation>
</message>
<message>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Одоогоор сонгогдсон байгаа хаягуудыг сануулах</translation>
</message>
<message>
<source>&Copy Address</source>
<translation>Хаягийг &Хуулбарлах</translation>
</message>
<message>
<source>&Delete</source>
<translation>&Устгах</translation>
</message>
<message>
<source>Copy &Label</source>
<translation>&Шошгыг хуулбарлах</translation>
</message>
<message>
<source>&Edit</source>
<translation>&Ѳѳрчлѳх</translation>
</message>
<message>
<source>Comma separated file (*.csv)</source>
<translation>Таслалаар тусгаарлагдсан хүснэгтэн файл (.csv)</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<source>Label</source>
<translation>Шошго</translation>
</message>
<message>
<source>Address</source>
<translation>Хаяг</translation>
</message>
<message>
<source>(no label)</source>
<translation>(шошго алга)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<source>Enter passphrase</source>
<translation>Нууц үгийг оруул</translation>
</message>
<message>
<source>New passphrase</source>
<translation>Шинэ нууц үг</translation>
</message>
<message>
<source>Repeat new passphrase</source>
<translation>Шинэ нууц үгийг давтана уу</translation>
</message>
<message>
<source>Encrypt wallet</source>
<translation>Түрүйвчийг цоожлох</translation>
</message>
<message>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Энэ үйлдэлийг гүйцэтгэхийн тулд та нууц үгээрээ түрүйвчийн цоожийг тайлах хэрэгтэй</translation>
</message>
<message>
<source>Unlock wallet</source>
<translation>Түрүйвчийн цоожийг тайлах</translation>
</message>
<message>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Энэ үйлдэлийг гүйцэтгэхийн тулд та эхлээд түрүйвчийн нууц үгийг оруулж цоожийг тайлах шаардлагтай.</translation>
</message>
<message>
<source>Decrypt wallet</source>
<translation>Түрүйвчийн цоожийг устгах</translation>
</message>
<message>
<source>Change passphrase</source>
<translation>Нууц үгийг солих</translation>
</message>
<message>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Түрүйвчийн хуучин болоод шинэ нууц үгсийг оруулна уу</translation>
</message>
<message>
<source>Confirm wallet encryption</source>
<translation>Түрүйвчийн цоожийг баталгаажуулах</translation>
</message>
<message>
<source>Wallet encrypted</source>
<translation>Түрүйвч цоожлогдлоо</translation>
</message>
<message>
<source>FacileCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your facilecoins from being stolen by malware infecting your computer.</source>
<translation>Цоожлолтын процесыг дуусгахын тулд Биткойн одоо хаагдана. Ѳѳрийн түрүйвчийг цоожлох нь таны биткойнуудыг компьютерийн вирус хулгайлахаас бүрэн сэргийлж чадахгүй гэдгийг санаарай.</translation>
</message>
<message>
<source>Wallet encryption failed</source>
<translation>Түрүйвчийн цоожлол амжилттай болсонгүй</translation>
</message>
<message>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Түрүйвчийн цоожлол дотоод алдаанаас үүдэн амжилттай болсонгүй. Түрүйвч цоожлогдоогүй байна.</translation>
</message>
<message>
<source>The supplied passphrases do not match.</source>
<translation>Таны оруулсан нууц үг таарсангүй</translation>
</message>
<message>
<source>Wallet unlock failed</source>
<translation>Түрүйвчийн цоож тайлагдсангүй</translation>
</message>
<message>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Таны оруулсан түрүйвчийн цоожийг тайлах нууц үг буруу байна</translation>
</message>
<message>
<source>Wallet decryption failed</source>
<translation>Түрүйвчийн цоож амжилттай устгагдсангүй</translation>
</message>
<message>
<source>Wallet passphrase was successfully changed.</source>
<translation>Түрүйвчийн нууц үг амжилттай ѳѳр</translation>
</message>
</context>
<context>
<name>FacileCoinGUI</name>
<message>
<source>Sign &message...</source>
<translation>&Зурвас хавсаргах...</translation>
</message>
<message>
<source>Synchronizing with network...</source>
<translation>Сүлжээтэй тааруулж байна...</translation>
</message>
<message>
<source>Node</source>
<translation>Нод</translation>
</message>
<message>
<source>&Transactions</source>
<translation>Гүйлгээнүүд</translation>
</message>
<message>
<source>Browse transaction history</source>
<translation>Гүйлгээнүүдийн түүхийг харах</translation>
</message>
<message>
<source>E&xit</source>
<translation>Гарах</translation>
</message>
<message>
<source>Quit application</source>
<translation>Програмаас Гарах</translation>
</message>
<message>
<source>About &Qt</source>
<translation>&Клиентийн тухай</translation>
</message>
<message>
<source>Show information about Qt</source>
<translation>Клиентийн тухай мэдээллийг харуул</translation>
</message>
<message>
<source>&Options...</source>
<translation>&Сонголтууд...</translation>
</message>
<message>
<source>&Encrypt Wallet...</source>
<translation>&Түрүйвчийг цоожлох...</translation>
</message>
<message>
<source>&Backup Wallet...</source>
<translation>&Түрүйвчийг Жоорлох...</translation>
</message>
<message>
<source>&Change Passphrase...</source>
<translation>&Нууц Үгийг Солих...</translation>
</message>
<message>
<source>Change the passphrase used for wallet encryption</source>
<translation>Түрүйвчийг цоожлох нууц үгийг солих</translation>
</message>
<message>
<source>Open debugging and diagnostic console</source>
<translation>Оношилгоо ба засварын консолыг онгойлго</translation>
</message>
<message>
<source>FacileCoin</source>
<translation>Биткойн</translation>
</message>
<message>
<source>Wallet</source>
<translation>Түрүйвч</translation>
</message>
<message>
<source>&Show / Hide</source>
<translation>&Харуул / Нуу</translation>
</message>
<message>
<source>&File</source>
<translation>&Файл</translation>
</message>
<message>
<source>&Settings</source>
<translation>&Тохиргоо</translation>
</message>
<message>
<source>&Help</source>
<translation>&Тусламж</translation>
</message>
<message numerus="yes">
<source>%n active connection(s) to FacileCoin network</source>
<translation><numerusform>Биткойны сүлжээрүү %n идэвхитэй холболт байна </numerusform><numerusform>Биткойны сүлжээрүү %n идэвхитэй холболтууд байна </numerusform></translation>
</message>
<message numerus="yes">
<source>%n hour(s)</source>
<translation><numerusform>%n цаг</numerusform><numerusform>%n цаг</numerusform></translation>
</message>
<message numerus="yes">
<source>%n day(s)</source>
<translation><numerusform>%n ѳдѳр</numerusform><numerusform>%n ѳдрүүд</numerusform></translation>
</message>
<message>
<source>Error</source>
<translation>Алдаа</translation>
</message>
<message>
<source>Up to date</source>
<translation>Шинэчлэгдсэн</translation>
</message>
<message>
<source>Sent transaction</source>
<translation>Гадагшаа гүйлгээ</translation>
</message>
<message>
<source>Incoming transaction</source>
<translation>Дотогшоо гүйлгээ</translation>
</message>
<message>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Огноо: %1
Хэмжээ: %2
Тѳрѳл: %3
Хаяг: %4
</translation>
</message>
<message>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Түрүйвч <b>цоожтой</b> ба одоогоор цоож <b>онгорхой</b> байна</translation>
</message>
<message>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Түрүйвч <b>цоожтой</b> ба одоогоор цоож <b>хаалттай</b> байна</translation>
</message>
</context>
<context>
<name>ClientModel</name>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<source>Amount:</source>
<translation>Хэмжээ:</translation>
</message>
<message>
<source>Fee:</source>
<translation>Тѳлбѳр:</translation>
</message>
<message>
<source>Amount</source>
<translation>Хэмжээ</translation>
</message>
<message>
<source>Date</source>
<translation>Огноо</translation>
</message>
<message>
<source>Confirmed</source>
<translation>Баталгаажлаа</translation>
</message>
<message>
<source>Copy address</source>
<translation>Хаягийг санах</translation>
</message>
<message>
<source>Copy label</source>
<translation>Шошгыг санах</translation>
</message>
<message>
<source>Copy amount</source>
<translation>Хэмжээг санах</translation>
</message>
<message>
<source>Copy change</source>
<translation>Ѳѳрчлѳлтийг санах</translation>
</message>
<message>
<source>(no label)</source>
<translation>(шошгогүй)</translation>
</message>
<message>
<source>(change)</source>
<translation>(ѳѳрчлѳх)</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<source>Edit Address</source>
<translation>Хаягийг ѳѳрчлѳх</translation>
</message>
<message>
<source>&Label</source>
<translation>&Шошго</translation>
</message>
<message>
<source>&Address</source>
<translation>&Хаяг</translation>
</message>
<message>
<source>New receiving address</source>
<translation>Шинэ хүлээн авах хаяг</translation>
</message>
<message>
<source>New sending address</source>
<translation>Шинэ явуулах хаяг</translation>
</message>
<message>
<source>Edit receiving address</source>
<translation>Хүлээн авах хаягийг ѳѳрчлѳх</translation>
</message>
<message>
<source>Edit sending address</source>
<translation>Явуулах хаягийг ѳѳрчлѳх</translation>
</message>
<message>
<source>The entered address "%1" is already in the address book.</source>
<translation>Таны оруулсан хаяг "%1" нь хаягийн бүртгэлд ѳмнѳ нь орсон байна</translation>
</message>
<message>
<source>Could not unlock wallet.</source>
<translation>Түрүйвчийн цоожийг тайлж чадсангүй</translation>
</message>
<message>
<source>New key generation failed.</source>
<translation>Шинэ түлхүүр амжилттай гарсангүй</translation>
</message>
</context>
<context>
<name>FreespaceChecker</name>
</context>
<context>
<name>HelpMessageDialog</name>
<message>
<source>version</source>
<translation>хувилбар</translation>
</message>
<message>
<source>Usage:</source>
<translation>Хэрэглээ:</translation>
</message>
</context>
<context>
<name>Intro</name>
<message>
<source>Error</source>
<translation>Алдаа</translation>
</message>
</context>
<context>
<name>OpenURIDialog</name>
</context>
<context>
<name>OptionsDialog</name>
<message>
<source>Options</source>
<translation>Сонголтууд</translation>
</message>
<message>
<source>MB</source>
<translation>МБ</translation>
</message>
<message>
<source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>
<translation>проксигийн IP хаяг (жишээ нь: IPv4: 127.0.0.1 / IPv6: ::1)</translation>
</message>
<message>
<source>Client restart required to activate changes.</source>
<translation>Ѳѳрчлѳлтүүдийг идэвхижүүлхийн тулд клиентийг ахин эхлүүлэх шаардлагтай</translation>
</message>
<message>
<source>Client will be shutdown, do you want to proceed?</source>
<translation>Клиент унтрах гэж байна, яг унтраах уу?</translation>
</message>
<message>
<source>This change would require a client restart.</source>
<translation>Энэ ѳѳрчлѳлтийг оруулахын тулд кли1нт програмыг ахин эхлүүлэх шаардлагтай</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<source>Available:</source>
<translation>Хэрэглэж болох хэмжээ:</translation>
</message>
</context>
<context>
<name>PaymentServer</name>
</context>
<context>
<name>PeerTableModel</name>
</context>
<context>
<name>QObject</name>
<message>
<source>Amount</source>
<translation>Хэмжээ</translation>
</message>
<message>
<source>N/A</source>
<translation>Алга Байна</translation>
</message>
</context>
<context>
<name>QRImageWidget</name>
<message>
<source>PNG Image (*.png)</source>
<translation>PNG форматын зураг (*.png)</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<source>Client name</source>
<translation>Клиентийн нэр</translation>
</message>
<message>
<source>N/A</source>
<translation>Алга Байна</translation>
</message>
<message>
<source>Client version</source>
<translation>Клиентийн хувилбар</translation>
</message>
<message>
<source>&Information</source>
<translation>&Мэдээллэл</translation>
</message>
<message>
<source>General</source>
<translation>Ерѳнхий</translation>
</message>
<message>
<source>Network</source>
<translation>Сүлжээ</translation>
</message>
<message>
<source>Name</source>
<translation>Нэр</translation>
</message>
<message>
<source>Number of connections</source>
<translation>Холболтын тоо</translation>
</message>
<message>
<source>Block chain</source>
<translation>Блокийн цуваа</translation>
</message>
<message>
<source>Current number of blocks</source>
<translation>Одоогийн блокийн тоо</translation>
</message>
<message>
<source>Last block time</source>
<translation>Сүүлийн блокийн хугацаа</translation>
</message>
<message>
<source>&Open</source>
<translation>&Нээх</translation>
</message>
<message>
<source>&Console</source>
<translation>&Консол</translation>
</message>
<message>
<source>Clear console</source>
<translation>Консолыг цэвэрлэх</translation>
</message>
</context>
<context>
<name>ReceiveCoinsDialog</name>
<message>
<source>&Label:</source>
<translation>&Шошго:</translation>
</message>
<message>
<source>Show</source>
<translation>Харуул</translation>
</message>
<message>
<source>Remove the selected entries from the list</source>
<translation>Сонгогдсон ѳгѳгдлүүдийг устгах</translation>
</message>
<message>
<source>Remove</source>
<translation>Устгах</translation>
</message>
<message>
<source>Copy label</source>
<translation>Шошгыг санах</translation>
</message>
<message>
<source>Copy message</source>
<translation>Зурвасыг санах</translation>
</message>
<message>
<source>Copy amount</source>
<translation>Хэмжээг санах</translation>
</message>
</context>
<context>
<name>ReceiveRequestDialog</name>
<message>
<source>Address</source>
<translation>Хаяг</translation>
</message>
<message>
<source>Amount</source>
<translation>Хэмжээ</translation>
</message>
<message>
<source>Label</source>
<translation>Шошго</translation>
</message>
<message>
<source>Message</source>
<translation>Зурвас</translation>
</message>
</context>
<context>
<name>RecentRequestsTableModel</name>
<message>
<source>Date</source>
<translation>Огноо</translation>
</message>
<message>
<source>Label</source>
<translation>Шошго</translation>
</message>
<message>
<source>Message</source>
<translation>Зурвас</translation>
</message>
<message>
<source>Amount</source>
<translation>Хэмжээ</translation>
</message>
<message>
<source>(no label)</source>
<translation>(шошго алга)</translation>
</message>
<message>
<source>(no message)</source>
<translation>(зурвас алга)</translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<source>Send Coins</source>
<translation>Зоос явуулах</translation>
</message>
<message>
<source>automatically selected</source>
<translation>автоматаар сонгогдсон</translation>
</message>
<message>
<source>Insufficient funds!</source>
<translation>Таны дансны үлдэгдэл хүрэлцэхгүй байна!</translation>
</message>
<message>
<source>Amount:</source>
<translation>Хэмжээ:</translation>
</message>
<message>
<source>Fee:</source>
<translation>Тѳлбѳр:</translation>
</message>
<message>
<source>Send to multiple recipients at once</source>
<translation>Нэгэн зэрэг олон хүлээн авагчруу явуулах</translation>
</message>
<message>
<source>Add &Recipient</source>
<translation>&Хүлээн авагчийг Нэмэх</translation>
</message>
<message>
<source>Clear &All</source>
<translation>&Бүгдийг Цэвэрлэ</translation>
</message>
<message>
<source>Balance:</source>
<translation>Баланс:</translation>
</message>
<message>
<source>Confirm the send action</source>
<translation>Явуулах үйлдлийг баталгаажуулна уу</translation>
</message>
<message>
<source>S&end</source>
<translation>Яв&уул</translation>
</message>
<message>
<source>Confirm send coins</source>
<translation>Зоос явуулахыг баталгаажуулна уу</translation>
</message>
<message>
<source>Copy amount</source>
<translation>Хэмжээг санах</translation>
</message>
<message>
<source>Copy change</source>
<translation>Ѳѳрчлѳлтийг санах</translation>
</message>
<message>
<source>Total Amount %1 (= %2)</source>
<translation>Нийт дүн %1 (= %2)</translation>
</message>
<message>
<source>or</source>
<translation>эсвэл</translation>
</message>
<message>
<source>The amount to pay must be larger than 0.</source>
<translation>Тѳлѳх хэмжээ 0.-оос их байх ёстой</translation>
</message>
<message>
<source>The amount exceeds your balance.</source>
<translation>Энэ хэмжээ таны балансаас хэтэрсэн байна.</translation>
</message>
<message>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>Гүйлгээний тѳлбѳр %1-ийг тооцхоор нийт дүн нь таны балансаас хэтрээд байна.</translation>
</message>
<message>
<source>Warning: Invalid FacileCoin address</source>
<translation>Анхаар:Буруу Биткойны хаяг байна</translation>
</message>
<message>
<source>(no label)</source>
<translation>(шошгогүй)</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<source>A&mount:</source>
<translation>Дүн:</translation>
</message>
<message>
<source>Pay &To:</source>
<translation>Тѳлѳх &хаяг:</translation>
</message>
<message>
<source>Enter a label for this address to add it to your address book</source>
<translation>Энэ хаягийг ѳѳрийн бүртгэлдээ авахын тулд шошго оруул</translation>
</message>
<message>
<source>&Label:</source>
<translation>&Шошго:</translation>
</message>
<message>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<source>Paste address from clipboard</source>
<translation>Копидсон хаягийг буулгах</translation>
</message>
<message>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<source>Message:</source>
<translation>Зурвас:</translation>
</message>
</context>
<context>
<name>ShutdownWindow</name>
<message>
<source>FacileCoin Core is shutting down...</source>
<translation>Биткойны цѳм хаагдаж байна...</translation>
</message>
<message>
<source>Do not shut down the computer until this window disappears.</source>
<translation>Энэ цонхыг хаагдтал компьютерээ бүү унтраагаарай</translation>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<source>Paste address from clipboard</source>
<translation>Копидсон хаягийг буулгах</translation>
</message>
<message>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<source>Clear &All</source>
<translation>&Бүгдийг Цэвэрлэ</translation>
</message>
</context>
<context>
<name>SplashScreen</name>
</context>
<context>
<name>TrafficGraphWidget</name>
</context>
<context>
<name>TransactionDesc</name>
<message>
<source>Open until %1</source>
<translation>%1 хүртэл нээлттэй</translation>
</message>
<message>
<source>conflicted</source>
<translation>зѳрчилдлѳѳ</translation>
</message>
<message>
<source>%1/unconfirmed</source>
<translation>%1/баталгаажаагүй</translation>
</message>
<message>
<source>%1 confirmations</source>
<translation>%1 баталгаажилтууд</translation>
</message>
<message>
<source>Date</source>
<translation>Огноо</translation>
</message>
<message>
<source>Message</source>
<translation>Зурвас</translation>
</message>
<message>
<source>Transaction ID</source>
<translation>Тодорхойлолт</translation>
</message>
<message>
<source>Amount</source>
<translation>Хэмжээ</translation>
</message>
<message>
<source>, has not been successfully broadcast yet</source>
<translation>, хараахан амжилттай цацагдаагүй байна</translation>
</message>
<message>
<source>unknown</source>
<translation>үл мэдэгдэх</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<source>Transaction details</source>
<translation>Гүйлгээний мэдээллэл</translation>
</message>
<message>
<source>This pane shows a detailed description of the transaction</source>
<translation>Гүйлгээний дэлгэрэнгүйг энэ бичил цонх харуулж байна</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<source>Date</source>
<translation>Огноо</translation>
</message>
<message>
<source>Type</source>
<translation>Тѳрѳл</translation>
</message>
<message>
<source>Address</source>
<translation>Хаяг</translation>
</message>
<message>
<source>Open until %1</source>
<translation>%1 хүртэл нээлттэй</translation>
</message>
<message>
<source>Confirmed (%1 confirmations)</source>
<translation>Баталгаажлаа (%1 баталгаажилт)</translation>
</message>
<message>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Энэ блокийг аль ч нод хүлээн авсангүй ба ер нь зѳвшѳѳрѳгдѳхгүй байж мэднэ!</translation>
</message>
<message>
<source>Generated but not accepted</source>
<translation>Үүсгэгдсэн гэхдээ хүлээн авагдаагүй</translation>
</message>
<message>
<source>Unconfirmed</source>
<translation>Баталгаажаагүй</translation>
</message>
<message>
<source>Conflicted</source>
<translation>Зѳрчилдлѳѳ</translation>
</message>
<message>
<source>Received with</source>
<translation>Хүлээн авсан хаяг</translation>
</message>
<message>
<source>Received from</source>
<translation>Хүлээн авагдсан хаяг</translation>
</message>
<message>
<source>Sent to</source>
<translation>Явуулсан хаяг</translation>
</message>
<message>
<source>Payment to yourself</source>
<translation>Ѳѳрлүүгээ хийсэн тѳлбѳр</translation>
</message>
<message>
<source>Mined</source>
<translation>Олборлогдсон</translation>
</message>
<message>
<source>(n/a)</source>
<translation>(алга байна)</translation>
</message>
<message>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Гүйлгээний байдал. Энд хулганыг авчирч баталгаажуулалтын тоог харна уу.</translation>
</message>
<message>
<source>Date and time that the transaction was received.</source>
<translation>Гүйлгээг хүлээн авсан огноо ба цаг.</translation>
</message>
<message>
<source>Type of transaction.</source>
<translation>Гүйлгээний тѳрѳл</translation>
</message>
<message>
<source>Destination address of transaction.</source>
<translation>Гүйлгээг хүлээн авах хаяг</translation>
</message>
<message>
<source>Amount removed from or added to balance.</source>
<translation>Балансаас авагдсан болон нэмэгдсэн хэмжээ.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<source>All</source>
<translation>Бүгд</translation>
</message>
<message>
<source>Today</source>
<translation>Ѳнѳѳдѳр</translation>
</message>
<message>
<source>This week</source>
<translation>Энэ долоо хоног</translation>
</message>
<message>
<source>This month</source>
<translation>Энэ сар</translation>
</message>
<message>
<source>Last month</source>
<translation>Ѳнгѳрсѳн сар</translation>
</message>
<message>
<source>This year</source>
<translation>Энэ жил</translation>
</message>
<message>
<source>Received with</source>
<translation>Хүлээн авсан хаяг</translation>
</message>
<message>
<source>Sent to</source>
<translation>Явуулсан хаяг</translation>
</message>
<message>
<source>To yourself</source>
<translation>Ѳѳрлүүгээ</translation>
</message>
<message>
<source>Mined</source>
<translation>Олборлогдсон</translation>
</message>
<message>
<source>Other</source>
<translation>Бусад</translation>
</message>
<message>
<source>Enter address or label to search</source>
<translation>Хайлт хийхийн тулд хаяг эсвэл шошгыг оруул</translation>
</message>
<message>
<source>Min amount</source>
<translation>Хамгийн бага хэмжээ</translation>
</message>
<message>
<source>Copy address</source>
<translation>Хаягийг санах</translation>
</message>
<message>
<source>Copy label</source>
<translation>Шошгыг санах</translation>
</message>
<message>
<source>Copy amount</source>
<translation>Хэмжээг санах</translation>
</message>
<message>
<source>Edit label</source>
<translation>Шошгыг ѳѳрчлѳх</translation>
</message>
<message>
<source>Show transaction details</source>
<translation>Гүйлгээний дэлгэрэнгүйг харуул</translation>
</message>
<message>
<source>The transaction history was successfully saved to %1.</source>
<translation>Гүйлгээнүй түүхийг %1-д амжилттай хадгаллаа.</translation>
</message>
<message>
<source>Comma separated file (*.csv)</source>
<translation>Таслалаар тусгаарлагдсан хүснэгтэн файл (.csv)</translation>
</message>
<message>
<source>Confirmed</source>
<translation>Баталгаажлаа</translation>
</message>
<message>
<source>Date</source>
<translation>Огноо</translation>
</message>
<message>
<source>Type</source>
<translation>Тѳрѳл</translation>
</message>
<message>
<source>Label</source>
<translation>Шошго</translation>
</message>
<message>
<source>Address</source>
<translation>Хаяг</translation>
</message>
<message>
<source>ID</source>
<translation>Тодорхойлолт</translation>
</message>
<message>
<source>to</source>
<translation>-рүү/руу</translation>
</message>
</context>
<context>
<name>UnitDisplayStatusBarControl</name>
</context>
<context>
<name>WalletFrame</name>
<message>
<source>No wallet has been loaded.</source>
<translation>Ямар ч түрүйвч ачааллагдсангүй.</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<source>Send Coins</source>
<translation>Зоос явуулах</translation>
</message>
</context>
<context>
<name>WalletView</name>
</context>
<context>
<name>facilecoin-core</name>
<message>
<source>Options:</source>
<translation>Сонголтууд:</translation>
</message>
<message>
<source>Wallet options:</source>
<translation>Түрүйвчийн сонголтууд:</translation>
</message>
<message>
<source>Upgrade wallet to latest format</source>
<translation>Түрүйвчийг хамгийн сүүлийн үеийн форматруу шинэчлэх</translation>
</message>
<message>
<source>Loading addresses...</source>
<translation>Хаягуудыг ачааллаж байна...</translation>
</message>
<message>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>wallet.dat-ыг ачааллахад алдаа гарлаа: Түрүйвч эвдэрсэн байна</translation>
</message>
<message>
<source>Error loading wallet.dat</source>
<translation>wallet.dat-ыг ачааллахад алдаа гарлаа</translation>
</message>
<message>
<source>Invalid -proxy address: '%s'</source>
<translation>Эдгээр прокси хаягнууд буруу байна: '%s'</translation>
</message>
<message>
<source>Insufficient funds</source>
<translation>Таны дансны үлдэгдэл хүрэлцэхгүй байна</translation>
</message>
<message>
<source>Loading block index...</source>
<translation>Блокийн индексүүдийг ачааллаж байна...</translation>
</message>
<message>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Холболт хийхийн тулд мѳн холболтой онгорхой хадгалхын тулд шинэ нод нэм</translation>
</message>
<message>
<source>Loading wallet...</source>
<translation>Түрүйвчийг ачааллаж байна...</translation>
</message>
<message>
<source>Rescanning...</source>
<translation>Ахин уншиж байна...</translation>
</message>
<message>
<source>Done loading</source>
<translation>Ачааллаж дууслаа</translation>
</message>
<message>
<source>Error</source>
<translation>Алдаа</translation>
</message>
</context>
</TS> | {
"content_hash": "4586350bf693ddb2ddc0e67326e64746",
"timestamp": "",
"source": "github",
"line_count": 1065,
"max_line_length": 213,
"avg_line_length": 31.622535211267607,
"alnum_prop": 0.633262070194192,
"repo_name": "facilecoin/facilecoin-core",
"id": "8e8e98ec53f3a027571c4297bcce099b0dfd5aba",
"size": "38045",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/qt/locale/facilecoin_mn.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "7639"
},
{
"name": "C",
"bytes": "358032"
},
{
"name": "C++",
"bytes": "3503353"
},
{
"name": "CSS",
"bytes": "1127"
},
{
"name": "HTML",
"bytes": "50621"
},
{
"name": "M4",
"bytes": "141704"
},
{
"name": "Makefile",
"bytes": "850930"
},
{
"name": "Objective-C",
"bytes": "2023"
},
{
"name": "Objective-C++",
"bytes": "7258"
},
{
"name": "Protocol Buffer",
"bytes": "2317"
},
{
"name": "Python",
"bytes": "149459"
},
{
"name": "Shell",
"bytes": "694448"
}
],
"symlink_target": ""
} |
angular.module('el1.model')
.factory('CercleModel', function () {
// constructor
function CercleModel(data) {
angular.copy(data, this);
this.toString = function toString() {
return " " + this.label + " ";
}
}
return CercleModel;
})
.factory('CerclesModel', [ 'CercleModel', function (CercleModel) {
// constructor
function CerclesModel(data) {
this.items = new Array(data.length);
for (var i in data) {
this.items[i] = new CercleModel(data[i]);
}
}
return CerclesModel;
}]);
| {
"content_hash": "33c7a9052315f315bccc3c8fb8ce1841",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 70,
"avg_line_length": 27.666666666666668,
"alnum_prop": 0.49849397590361444,
"repo_name": "guillaume317/elink-port",
"id": "31c82719616807349a46b32e8f39919c3cd85e95",
"size": "664",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "www/js/model/cercle.model.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1160594"
},
{
"name": "HTML",
"bytes": "68170"
},
{
"name": "JavaScript",
"bytes": "6664698"
}
],
"symlink_target": ""
} |
CREATE TABLE country (id NVARCHAR(2) NOT NULL, name NVARCHAR(64) NOT NULL, PRIMARY KEY (id));
INSERT INTO [country] ([id], [name]) VALUES ('ab', 'abkhasisk');
INSERT INTO [country] ([id], [name]) VALUES ('ace', 'achinesisk');
INSERT INTO [country] ([id], [name]) VALUES ('ach', 'acoli');
INSERT INTO [country] ([id], [name]) VALUES ('ada', 'adangme');
INSERT INTO [country] ([id], [name]) VALUES ('ady', 'adyghe');
INSERT INTO [country] ([id], [name]) VALUES ('aa', 'afar');
INSERT INTO [country] ([id], [name]) VALUES ('afh', 'afrihili');
INSERT INTO [country] ([id], [name]) VALUES ('af', 'afrikaans');
INSERT INTO [country] ([id], [name]) VALUES ('afa', 'afroasiatisk språk');
INSERT INTO [country] ([id], [name]) VALUES ('ain', 'ainu');
INSERT INTO [country] ([id], [name]) VALUES ('ak', 'akan');
INSERT INTO [country] ([id], [name]) VALUES ('akk', 'akkadisk');
INSERT INTO [country] ([id], [name]) VALUES ('sq', 'albansk');
INSERT INTO [country] ([id], [name]) VALUES ('ale', 'aleutisk');
INSERT INTO [country] ([id], [name]) VALUES ('alg', 'algonkinsk språk');
INSERT INTO [country] ([id], [name]) VALUES ('tut', 'altaisk språk');
INSERT INTO [country] ([id], [name]) VALUES ('am', 'amharisk');
INSERT INTO [country] ([id], [name]) VALUES ('anp', 'angika');
INSERT INTO [country] ([id], [name]) VALUES ('mis', 'anna språk');
INSERT INTO [country] ([id], [name]) VALUES ('apa', 'apache-språk');
INSERT INTO [country] ([id], [name]) VALUES ('ar', 'arabisk');
INSERT INTO [country] ([id], [name]) VALUES ('an', 'aragonsk');
INSERT INTO [country] ([id], [name]) VALUES ('arc', 'arameisk');
INSERT INTO [country] ([id], [name]) VALUES ('arp', 'arapaho');
INSERT INTO [country] ([id], [name]) VALUES ('arn', 'araukansk');
INSERT INTO [country] ([id], [name]) VALUES ('arw', 'arawak');
INSERT INTO [country] ([id], [name]) VALUES ('hy', 'armensk');
INSERT INTO [country] ([id], [name]) VALUES ('rup', 'aromansk');
INSERT INTO [country] ([id], [name]) VALUES ('az', 'aserbajdsjansk');
INSERT INTO [country] ([id], [name]) VALUES ('as', 'assamisk');
INSERT INTO [country] ([id], [name]) VALUES ('ast', 'asturisk');
INSERT INTO [country] ([id], [name]) VALUES ('ath', 'athapaskansk språk');
INSERT INTO [country] ([id], [name]) VALUES ('cch', 'atsam');
INSERT INTO [country] ([id], [name]) VALUES ('de_AT', 'austerriksk tysk');
INSERT INTO [country] ([id], [name]) VALUES ('frs', 'austfrisisk');
INSERT INTO [country] ([id], [name]) VALUES ('aus', 'australsk språk');
INSERT INTO [country] ([id], [name]) VALUES ('map', 'austronesisk');
INSERT INTO [country] ([id], [name]) VALUES ('av', 'avarisk');
INSERT INTO [country] ([id], [name]) VALUES ('ae', 'avestisk');
INSERT INTO [country] ([id], [name]) VALUES ('awa', 'awadhi');
INSERT INTO [country] ([id], [name]) VALUES ('ay', 'aymara');
INSERT INTO [country] ([id], [name]) VALUES ('ban', 'balinesisk');
INSERT INTO [country] ([id], [name]) VALUES ('bat', 'baltisk språk');
INSERT INTO [country] ([id], [name]) VALUES ('bal', 'baluchi');
INSERT INTO [country] ([id], [name]) VALUES ('bm', 'bambara');
INSERT INTO [country] ([id], [name]) VALUES ('bai', 'bamilekisk språk');
INSERT INTO [country] ([id], [name]) VALUES ('bad', 'banda');
INSERT INTO [country] ([id], [name]) VALUES ('bnt', 'bantu');
INSERT INTO [country] ([id], [name]) VALUES ('bas', 'basa');
INSERT INTO [country] ([id], [name]) VALUES ('ba', 'basjkirsk');
INSERT INTO [country] ([id], [name]) VALUES ('eu', 'baskisk');
INSERT INTO [country] ([id], [name]) VALUES ('btk', 'batak');
INSERT INTO [country] ([id], [name]) VALUES ('bej', 'beja');
INSERT INTO [country] ([id], [name]) VALUES ('bem', 'bemba');
INSERT INTO [country] ([id], [name]) VALUES ('bn', 'bengali');
INSERT INTO [country] ([id], [name]) VALUES ('ber', 'berbisk');
INSERT INTO [country] ([id], [name]) VALUES ('bho', 'bhojpuri');
INSERT INTO [country] ([id], [name]) VALUES ('bh', 'bihari');
INSERT INTO [country] ([id], [name]) VALUES ('bik', 'bikol');
INSERT INTO [country] ([id], [name]) VALUES ('bin', 'bini');
INSERT INTO [country] ([id], [name]) VALUES ('bi', 'bislama');
INSERT INTO [country] ([id], [name]) VALUES ('byn', 'blin');
INSERT INTO [country] ([id], [name]) VALUES ('zbl', 'blissymbol');
INSERT INTO [country] ([id], [name]) VALUES ('nb', 'bokmål');
INSERT INTO [country] ([id], [name]) VALUES ('bs', 'bosnisk');
INSERT INTO [country] ([id], [name]) VALUES ('bra', 'braj');
INSERT INTO [country] ([id], [name]) VALUES ('pt_BR', 'brasiliansk portugisisk');
INSERT INTO [country] ([id], [name]) VALUES ('br', 'bretonsk');
INSERT INTO [country] ([id], [name]) VALUES ('bug', 'buginesisk');
INSERT INTO [country] ([id], [name]) VALUES ('bg', 'bulgarsk');
INSERT INTO [country] ([id], [name]) VALUES ('bua', 'burjatisk');
INSERT INTO [country] ([id], [name]) VALUES ('my', 'burmesisk');
INSERT INTO [country] ([id], [name]) VALUES ('cad', 'caddo');
INSERT INTO [country] ([id], [name]) VALUES ('ceb', 'cebuansk');
INSERT INTO [country] ([id], [name]) VALUES ('chg', 'chagatai');
INSERT INTO [country] ([id], [name]) VALUES ('ch', 'chamorro');
INSERT INTO [country] ([id], [name]) VALUES ('chr', 'cherokee');
INSERT INTO [country] ([id], [name]) VALUES ('chy', 'cheyenne');
INSERT INTO [country] ([id], [name]) VALUES ('chb', 'chibcha');
INSERT INTO [country] ([id], [name]) VALUES ('chn', 'chinook');
INSERT INTO [country] ([id], [name]) VALUES ('chp', 'chipewiansk');
INSERT INTO [country] ([id], [name]) VALUES ('cho', 'choctaw');
INSERT INTO [country] ([id], [name]) VALUES ('chk', 'chuukesisk');
INSERT INTO [country] ([id], [name]) VALUES ('cr', 'cree');
INSERT INTO [country] ([id], [name]) VALUES ('mus', 'creek');
INSERT INTO [country] ([id], [name]) VALUES ('dak', 'dakota');
INSERT INTO [country] ([id], [name]) VALUES ('da', 'dansk');
INSERT INTO [country] ([id], [name]) VALUES ('dar', 'dargwa');
INSERT INTO [country] ([id], [name]) VALUES ('day', 'dayak');
INSERT INTO [country] ([id], [name]) VALUES ('del', 'delaware');
INSERT INTO [country] ([id], [name]) VALUES ('din', 'dinka');
INSERT INTO [country] ([id], [name]) VALUES ('dv', 'divehi');
INSERT INTO [country] ([id], [name]) VALUES ('doi', 'dogri');
INSERT INTO [country] ([id], [name]) VALUES ('dgr', 'dogrib');
INSERT INTO [country] ([id], [name]) VALUES ('dra', 'dravidisk språk');
INSERT INTO [country] ([id], [name]) VALUES ('dua', 'duala');
INSERT INTO [country] ([id], [name]) VALUES ('dyu', 'dyula');
INSERT INTO [country] ([id], [name]) VALUES ('dz', 'dzongkha');
INSERT INTO [country] ([id], [name]) VALUES ('efi', 'efik');
INSERT INTO [country] ([id], [name]) VALUES ('eka', 'ekajuk');
INSERT INTO [country] ([id], [name]) VALUES ('elx', 'elamittisk');
INSERT INTO [country] ([id], [name]) VALUES ('smn', 'enaresamisk');
INSERT INTO [country] ([id], [name]) VALUES ('en', 'engelsk');
INSERT INTO [country] ([id], [name]) VALUES ('en_US', 'engelsk (amerikansk)');
INSERT INTO [country] ([id], [name]) VALUES ('cpe', 'engelskbasert kreol- eller pidginspråk');
INSERT INTO [country] ([id], [name]) VALUES ('myv', 'erzya');
INSERT INTO [country] ([id], [name]) VALUES ('eo', 'esperanto');
INSERT INTO [country] ([id], [name]) VALUES ('et', 'estisk');
INSERT INTO [country] ([id], [name]) VALUES ('ee', 'ewe');
INSERT INTO [country] ([id], [name]) VALUES ('ewo', 'ewondo');
INSERT INTO [country] ([id], [name]) VALUES ('fan', 'fang');
INSERT INTO [country] ([id], [name]) VALUES ('fat', 'fanti');
INSERT INTO [country] ([id], [name]) VALUES ('fj', 'fijiansk');
INSERT INTO [country] ([id], [name]) VALUES ('fil', 'filippinsk');
INSERT INTO [country] ([id], [name]) VALUES ('phi', 'filippinsk språk');
INSERT INTO [country] ([id], [name]) VALUES ('fi', 'finsk');
INSERT INTO [country] ([id], [name]) VALUES ('fiu', 'finsk-ugrisk språk');
INSERT INTO [country] ([id], [name]) VALUES ('nl_BE', 'flamsk');
INSERT INTO [country] ([id], [name]) VALUES ('mul', 'fleire språk');
INSERT INTO [country] ([id], [name]) VALUES ('fon', 'fon');
INSERT INTO [country] ([id], [name]) VALUES ('zh_Hans', 'forenkla kinesisk');
INSERT INTO [country] ([id], [name]) VALUES ('fr', 'fransk');
INSERT INTO [country] ([id], [name]) VALUES ('cpf', 'franskbasert kreol- eller pidginspråk');
INSERT INTO [country] ([id], [name]) VALUES ('fur', 'friuliansk');
INSERT INTO [country] ([id], [name]) VALUES ('ff', 'fulani');
INSERT INTO [country] ([id], [name]) VALUES ('fo', 'færøysk');
INSERT INTO [country] ([id], [name]) VALUES ('phn', 'fønikisk');
INSERT INTO [country] ([id], [name]) VALUES ('gaa', 'ga');
INSERT INTO [country] ([id], [name]) VALUES ('gl', 'galicisk');
INSERT INTO [country] ([id], [name]) VALUES ('egy', 'gammalegyptisk');
INSERT INTO [country] ([id], [name]) VALUES ('ang', 'gammalengelsk');
INSERT INTO [country] ([id], [name]) VALUES ('fro', 'gammalfransk');
INSERT INTO [country] ([id], [name]) VALUES ('grc', 'gammalgresk');
INSERT INTO [country] ([id], [name]) VALUES ('goh', 'gammalhøgtysk');
INSERT INTO [country] ([id], [name]) VALUES ('sga', 'gammalirsk');
INSERT INTO [country] ([id], [name]) VALUES ('non', 'gammalnorsk');
INSERT INTO [country] ([id], [name]) VALUES ('peo', 'gammalpersisk');
INSERT INTO [country] ([id], [name]) VALUES ('pro', 'gammalprovençalsk');
INSERT INTO [country] ([id], [name]) VALUES ('lg', 'ganda');
INSERT INTO [country] ([id], [name]) VALUES ('gay', 'gayo');
INSERT INTO [country] ([id], [name]) VALUES ('gba', 'gbaya');
INSERT INTO [country] ([id], [name]) VALUES ('ka', 'georgisk');
INSERT INTO [country] ([id], [name]) VALUES ('gem', 'germansk språk');
INSERT INTO [country] ([id], [name]) VALUES ('gez', 'ges');
INSERT INTO [country] ([id], [name]) VALUES ('gon', 'gondi');
INSERT INTO [country] ([id], [name]) VALUES ('gor', 'gorontalo');
INSERT INTO [country] ([id], [name]) VALUES ('got', 'gotisk');
INSERT INTO [country] ([id], [name]) VALUES ('grb', 'grebo');
INSERT INTO [country] ([id], [name]) VALUES ('el', 'gresk');
INSERT INTO [country] ([id], [name]) VALUES ('gn', 'guarani');
INSERT INTO [country] ([id], [name]) VALUES ('gu', 'gujarati');
INSERT INTO [country] ([id], [name]) VALUES ('gwi', 'gwichin');
INSERT INTO [country] ([id], [name]) VALUES ('hai', 'haida');
INSERT INTO [country] ([id], [name]) VALUES ('ht', 'haitisk');
INSERT INTO [country] ([id], [name]) VALUES ('ha', 'hausa');
INSERT INTO [country] ([id], [name]) VALUES ('haw', 'hawaiisk');
INSERT INTO [country] ([id], [name]) VALUES ('he', 'hebraisk');
INSERT INTO [country] ([id], [name]) VALUES ('hz', 'herero');
INSERT INTO [country] ([id], [name]) VALUES ('hit', 'hettittisk');
INSERT INTO [country] ([id], [name]) VALUES ('hil', 'hiligaynon');
INSERT INTO [country] ([id], [name]) VALUES ('him', 'himachali');
INSERT INTO [country] ([id], [name]) VALUES ('hi', 'hindi');
INSERT INTO [country] ([id], [name]) VALUES ('ho', 'hiri motu');
INSERT INTO [country] ([id], [name]) VALUES ('hmn', 'hmong');
INSERT INTO [country] ([id], [name]) VALUES ('hup', 'hupa');
INSERT INTO [country] ([id], [name]) VALUES ('hsb', 'høgsorbisk');
INSERT INTO [country] ([id], [name]) VALUES ('iba', 'iban');
INSERT INTO [country] ([id], [name]) VALUES ('es_ES', 'iberisk spansk');
INSERT INTO [country] ([id], [name]) VALUES ('ig', 'ibo');
INSERT INTO [country] ([id], [name]) VALUES ('io', 'ido');
INSERT INTO [country] ([id], [name]) VALUES ('ijo', 'ijo');
INSERT INTO [country] ([id], [name]) VALUES ('und', 'ikkje bestemt');
INSERT INTO [country] ([id], [name]) VALUES ('ilo', 'iloko');
INSERT INTO [country] ([id], [name]) VALUES ('inc', 'indisk språk');
INSERT INTO [country] ([id], [name]) VALUES ('ine', 'indo-europeisk språk');
INSERT INTO [country] ([id], [name]) VALUES ('id', 'indonesisk');
INSERT INTO [country] ([id], [name]) VALUES ('inh', 'ingusjisk');
INSERT INTO [country] ([id], [name]) VALUES ('ia', 'interlingua');
INSERT INTO [country] ([id], [name]) VALUES ('ie', 'interlingue');
INSERT INTO [country] ([id], [name]) VALUES ('iu', 'inuktitut');
INSERT INTO [country] ([id], [name]) VALUES ('ik', 'inupiak');
INSERT INTO [country] ([id], [name]) VALUES ('ira', 'iransk');
INSERT INTO [country] ([id], [name]) VALUES ('iro', 'irokansk språk');
INSERT INTO [country] ([id], [name]) VALUES ('ga', 'irsk');
INSERT INTO [country] ([id], [name]) VALUES ('is', 'islandsk');
INSERT INTO [country] ([id], [name]) VALUES ('it', 'italiensk');
INSERT INTO [country] ([id], [name]) VALUES ('sah', 'jakutsk');
INSERT INTO [country] ([id], [name]) VALUES ('ja', 'japansk');
INSERT INTO [country] ([id], [name]) VALUES ('jv', 'javanesisk');
INSERT INTO [country] ([id], [name]) VALUES ('yi', 'jiddisk');
INSERT INTO [country] ([id], [name]) VALUES ('kaj', 'jju');
INSERT INTO [country] ([id], [name]) VALUES ('yo', 'joruba');
INSERT INTO [country] ([id], [name]) VALUES ('ypk', 'jupisk språk');
INSERT INTO [country] ([id], [name]) VALUES ('jrb', 'jødearabisk');
INSERT INTO [country] ([id], [name]) VALUES ('jpr', 'jødepersisk');
INSERT INTO [country] ([id], [name]) VALUES ('kbd', 'kabardisk');
INSERT INTO [country] ([id], [name]) VALUES ('kab', 'kabylsk');
INSERT INTO [country] ([id], [name]) VALUES ('kac', 'kachin');
INSERT INTO [country] ([id], [name]) VALUES ('kl', 'kalaallisut; grønlandsk');
INSERT INTO [country] ([id], [name]) VALUES ('xal', 'kalmyk');
INSERT INTO [country] ([id], [name]) VALUES ('kam', 'kamba');
INSERT INTO [country] ([id], [name]) VALUES ('cmc', 'kamisk språk');
INSERT INTO [country] ([id], [name]) VALUES ('en_CA', 'kanadisk engelsk');
INSERT INTO [country] ([id], [name]) VALUES ('fr_CA', 'kanadisk fransk');
INSERT INTO [country] ([id], [name]) VALUES ('kn', 'kannada');
INSERT INTO [country] ([id], [name]) VALUES ('kr', 'kanuri');
INSERT INTO [country] ([id], [name]) VALUES ('krc', 'karachay-balkar');
INSERT INTO [country] ([id], [name]) VALUES ('kaa', 'karakalpakisk');
INSERT INTO [country] ([id], [name]) VALUES ('krl', 'karelsk');
INSERT INTO [country] ([id], [name]) VALUES ('kar', 'karensk');
INSERT INTO [country] ([id], [name]) VALUES ('car', 'karibisk');
INSERT INTO [country] ([id], [name]) VALUES ('kk', 'kasakhisk');
INSERT INTO [country] ([id], [name]) VALUES ('ks', 'kasjmiri');
INSERT INTO [country] ([id], [name]) VALUES ('csb', 'kasjubisk');
INSERT INTO [country] ([id], [name]) VALUES ('ca', 'katalansk');
INSERT INTO [country] ([id], [name]) VALUES ('cau', 'kaukasisk språk');
INSERT INTO [country] ([id], [name]) VALUES ('kaw', 'kawi');
INSERT INTO [country] ([id], [name]) VALUES ('cel', 'keltisk språk');
INSERT INTO [country] ([id], [name]) VALUES ('kha', 'khasi');
INSERT INTO [country] ([id], [name]) VALUES ('km', 'khmer');
INSERT INTO [country] ([id], [name]) VALUES ('khi', 'khoisanspråk');
INSERT INTO [country] ([id], [name]) VALUES ('kho', 'khotanesisk');
INSERT INTO [country] ([id], [name]) VALUES ('kg', 'kikongo');
INSERT INTO [country] ([id], [name]) VALUES ('ki', 'kikuyu');
INSERT INTO [country] ([id], [name]) VALUES ('kmb', 'kimbundu');
INSERT INTO [country] ([id], [name]) VALUES ('zh', 'kinesisk');
INSERT INTO [country] ([id], [name]) VALUES ('rw', 'kinjarwanda');
INSERT INTO [country] ([id], [name]) VALUES ('ky', 'kirgisisk');
INSERT INTO [country] ([id], [name]) VALUES ('gil', 'kiribatisk');
INSERT INTO [country] ([id], [name]) VALUES ('nwc', 'klassisk newarisk');
INSERT INTO [country] ([id], [name]) VALUES ('syc', 'klassisk syrisk');
INSERT INTO [country] ([id], [name]) VALUES ('tlh', 'klingon');
INSERT INTO [country] ([id], [name]) VALUES ('kv', 'komi');
INSERT INTO [country] ([id], [name]) VALUES ('kok', 'konkani');
INSERT INTO [country] ([id], [name]) VALUES ('cop', 'koptisk');
INSERT INTO [country] ([id], [name]) VALUES ('ko', 'koreansk');
INSERT INTO [country] ([id], [name]) VALUES ('kw', 'kornisk');
INSERT INTO [country] ([id], [name]) VALUES ('kfo', 'koro');
INSERT INTO [country] ([id], [name]) VALUES ('co', 'korsikansk');
INSERT INTO [country] ([id], [name]) VALUES ('kos', 'kosraeansk');
INSERT INTO [country] ([id], [name]) VALUES ('kpe', 'kpelle');
INSERT INTO [country] ([id], [name]) VALUES ('crp', 'kreol- eller pidginspråk');
INSERT INTO [country] ([id], [name]) VALUES ('crh', 'krimtatarisk');
INSERT INTO [country] ([id], [name]) VALUES ('hr', 'kroatisk');
INSERT INTO [country] ([id], [name]) VALUES ('kro', 'kru');
INSERT INTO [country] ([id], [name]) VALUES ('kj', 'kuanyama');
INSERT INTO [country] ([id], [name]) VALUES ('kum', 'kumyk');
INSERT INTO [country] ([id], [name]) VALUES ('art', 'kunstig språk');
INSERT INTO [country] ([id], [name]) VALUES ('ku', 'kurdisk');
INSERT INTO [country] ([id], [name]) VALUES ('kru', 'kurukh');
INSERT INTO [country] ([id], [name]) VALUES ('cus', 'kusjitisk språk');
INSERT INTO [country] ([id], [name]) VALUES ('kut', 'kutenai');
INSERT INTO [country] ([id], [name]) VALUES ('be', 'kviterussisk');
INSERT INTO [country] ([id], [name]) VALUES ('cu', 'kyrkjeslavisk');
INSERT INTO [country] ([id], [name]) VALUES ('lad', 'ladinsk');
INSERT INTO [country] ([id], [name]) VALUES ('lah', 'lahnda');
INSERT INTO [country] ([id], [name]) VALUES ('lam', 'lamba');
INSERT INTO [country] ([id], [name]) VALUES ('lo', 'laotisk');
INSERT INTO [country] ([id], [name]) VALUES ('la', 'latin');
INSERT INTO [country] ([id], [name]) VALUES ('es_419', 'latinamerikansk spansk');
INSERT INTO [country] ([id], [name]) VALUES ('lv', 'latvisk');
INSERT INTO [country] ([id], [name]) VALUES ('lez', 'lezghian');
INSERT INTO [country] ([id], [name]) VALUES ('li', 'limburgisk');
INSERT INTO [country] ([id], [name]) VALUES ('ln', 'lingala');
INSERT INTO [country] ([id], [name]) VALUES ('lt', 'litauisk');
INSERT INTO [country] ([id], [name]) VALUES ('jbo', 'lojban');
INSERT INTO [country] ([id], [name]) VALUES ('loz', 'lozi');
INSERT INTO [country] ([id], [name]) VALUES ('lu', 'luba-katanga');
INSERT INTO [country] ([id], [name]) VALUES ('lua', 'luba-lulua');
INSERT INTO [country] ([id], [name]) VALUES ('lui', 'luiseno');
INSERT INTO [country] ([id], [name]) VALUES ('smj', 'lulesamisk');
INSERT INTO [country] ([id], [name]) VALUES ('lun', 'lunda');
INSERT INTO [country] ([id], [name]) VALUES ('luo', 'luo');
INSERT INTO [country] ([id], [name]) VALUES ('lus', 'lushai');
INSERT INTO [country] ([id], [name]) VALUES ('lb', 'luxemburgsk');
INSERT INTO [country] ([id], [name]) VALUES ('dsb', 'lågsorbisk');
INSERT INTO [country] ([id], [name]) VALUES ('nds', 'lågtysk');
INSERT INTO [country] ([id], [name]) VALUES ('mg', 'madagassisk');
INSERT INTO [country] ([id], [name]) VALUES ('mad', 'maduresisk');
INSERT INTO [country] ([id], [name]) VALUES ('mag', 'magahi');
INSERT INTO [country] ([id], [name]) VALUES ('mai', 'maithili');
INSERT INTO [country] ([id], [name]) VALUES ('mak', 'makasar');
INSERT INTO [country] ([id], [name]) VALUES ('mk', 'makedonsk');
INSERT INTO [country] ([id], [name]) VALUES ('ml', 'malayalam');
INSERT INTO [country] ([id], [name]) VALUES ('ms', 'malayisk');
INSERT INTO [country] ([id], [name]) VALUES ('mt', 'maltesisk');
INSERT INTO [country] ([id], [name]) VALUES ('mdr', 'mandar');
INSERT INTO [country] ([id], [name]) VALUES ('man', 'mandingo');
INSERT INTO [country] ([id], [name]) VALUES ('mnc', 'mandsju');
INSERT INTO [country] ([id], [name]) VALUES ('mni', 'manipuri');
INSERT INTO [country] ([id], [name]) VALUES ('mno', 'manobospråk');
INSERT INTO [country] ([id], [name]) VALUES ('gv', 'manx');
INSERT INTO [country] ([id], [name]) VALUES ('mi', 'maori');
INSERT INTO [country] ([id], [name]) VALUES ('mr', 'marathi');
INSERT INTO [country] ([id], [name]) VALUES ('chm', 'mari');
INSERT INTO [country] ([id], [name]) VALUES ('mh', 'marshallesisk');
INSERT INTO [country] ([id], [name]) VALUES ('mwr', 'marwari');
INSERT INTO [country] ([id], [name]) VALUES ('mas', 'masai');
INSERT INTO [country] ([id], [name]) VALUES ('myn', 'mayaspråk');
INSERT INTO [country] ([id], [name]) VALUES ('enm', 'mellomengelsk');
INSERT INTO [country] ([id], [name]) VALUES ('frm', 'mellomfransk');
INSERT INTO [country] ([id], [name]) VALUES ('gmh', 'mellomhøgtysk');
INSERT INTO [country] ([id], [name]) VALUES ('mga', 'mellomirsk');
INSERT INTO [country] ([id], [name]) VALUES ('dum', 'mellumnederlandsk');
INSERT INTO [country] ([id], [name]) VALUES ('men', 'mende');
INSERT INTO [country] ([id], [name]) VALUES ('mic', 'micmac');
INSERT INTO [country] ([id], [name]) VALUES ('min', 'minangkabau');
INSERT INTO [country] ([id], [name]) VALUES ('mwl', 'mirandesisk');
INSERT INTO [country] ([id], [name]) VALUES ('moh', 'mohawk');
INSERT INTO [country] ([id], [name]) VALUES ('mdf', 'moksha');
INSERT INTO [country] ([id], [name]) VALUES ('mo', 'moldavisk');
INSERT INTO [country] ([id], [name]) VALUES ('mkh', 'mon-khmerspråk');
INSERT INTO [country] ([id], [name]) VALUES ('lol', 'mongo');
INSERT INTO [country] ([id], [name]) VALUES ('mn', 'mongolsk');
INSERT INTO [country] ([id], [name]) VALUES ('mos', 'mossi');
INSERT INTO [country] ([id], [name]) VALUES ('mun', 'mundaspråk');
INSERT INTO [country] ([id], [name]) VALUES ('nqo', 'n''ko');
INSERT INTO [country] ([id], [name]) VALUES ('nah', 'nahuatl');
INSERT INTO [country] ([id], [name]) VALUES ('nap', 'napolitansk');
INSERT INTO [country] ([id], [name]) VALUES ('na', 'nauru');
INSERT INTO [country] ([id], [name]) VALUES ('nv', 'navajo');
INSERT INTO [country] ([id], [name]) VALUES ('ng', 'ndonga');
INSERT INTO [country] ([id], [name]) VALUES ('nl', 'nederlandsk');
INSERT INTO [country] ([id], [name]) VALUES ('ne', 'nepalsk');
INSERT INTO [country] ([id], [name]) VALUES ('new', 'newari');
INSERT INTO [country] ([id], [name]) VALUES ('nia', 'nias');
INSERT INTO [country] ([id], [name]) VALUES ('nic', 'niger-kordofaniansk språk');
INSERT INTO [country] ([id], [name]) VALUES ('ssa', 'nilo-saharaspråk');
INSERT INTO [country] ([id], [name]) VALUES ('niu', 'niueansk');
INSERT INTO [country] ([id], [name]) VALUES ('nog', 'nogai');
INSERT INTO [country] ([id], [name]) VALUES ('nd', 'nord-ndebele');
INSERT INTO [country] ([id], [name]) VALUES ('nai', 'nordamerikansk indiansk språk');
INSERT INTO [country] ([id], [name]) VALUES ('frr', 'nordfrisisk');
INSERT INTO [country] ([id], [name]) VALUES ('se', 'nordsamisk');
INSERT INTO [country] ([id], [name]) VALUES ('nso', 'nordsotho');
INSERT INTO [country] ([id], [name]) VALUES ('no', 'norsk');
INSERT INTO [country] ([id], [name]) VALUES ('nub', 'nubisk språk');
INSERT INTO [country] ([id], [name]) VALUES ('nym', 'nyamwezi');
INSERT INTO [country] ([id], [name]) VALUES ('ny', 'nyanja');
INSERT INTO [country] ([id], [name]) VALUES ('nyn', 'nyankole');
INSERT INTO [country] ([id], [name]) VALUES ('nn', 'nynorsk');
INSERT INTO [country] ([id], [name]) VALUES ('nyo', 'nyoro');
INSERT INTO [country] ([id], [name]) VALUES ('nzi', 'nzima');
INSERT INTO [country] ([id], [name]) VALUES ('oj', 'ojibwa');
INSERT INTO [country] ([id], [name]) VALUES ('oc', 'oksitansk');
INSERT INTO [country] ([id], [name]) VALUES ('or', 'oriya');
INSERT INTO [country] ([id], [name]) VALUES ('om', 'oromo');
INSERT INTO [country] ([id], [name]) VALUES ('osa', 'osage');
INSERT INTO [country] ([id], [name]) VALUES ('os', 'ossetisk');
INSERT INTO [country] ([id], [name]) VALUES ('oto', 'otomisk språk');
INSERT INTO [country] ([id], [name]) VALUES ('ota', 'ottomansk tyrkisk');
INSERT INTO [country] ([id], [name]) VALUES ('pal', 'pahlavi');
INSERT INTO [country] ([id], [name]) VALUES ('pau', 'palauisk');
INSERT INTO [country] ([id], [name]) VALUES ('pi', 'pali');
INSERT INTO [country] ([id], [name]) VALUES ('pam', 'pampanga');
INSERT INTO [country] ([id], [name]) VALUES ('pag', 'pangasinan');
INSERT INTO [country] ([id], [name]) VALUES ('pa', 'panjabi');
INSERT INTO [country] ([id], [name]) VALUES ('pap', 'papiamento');
INSERT INTO [country] ([id], [name]) VALUES ('paa', 'papuisk språk');
INSERT INTO [country] ([id], [name]) VALUES ('ps', 'pashto');
INSERT INTO [country] ([id], [name]) VALUES ('fa', 'persisk');
INSERT INTO [country] ([id], [name]) VALUES ('pl', 'polsk');
INSERT INTO [country] ([id], [name]) VALUES ('pon', 'ponapisk');
INSERT INTO [country] ([id], [name]) VALUES ('pt', 'portugisisk');
INSERT INTO [country] ([id], [name]) VALUES ('cpp', 'portugisiskbasert kreol- eller pidginspråk');
INSERT INTO [country] ([id], [name]) VALUES ('pra', 'prakrit-språk');
INSERT INTO [country] ([id], [name]) VALUES ('qu', 'quechua');
INSERT INTO [country] ([id], [name]) VALUES ('raj', 'rajasthani');
INSERT INTO [country] ([id], [name]) VALUES ('rap', 'rapanui');
INSERT INTO [country] ([id], [name]) VALUES ('rar', 'rarotongansk');
INSERT INTO [country] ([id], [name]) VALUES ('rm', 'retoromansk');
INSERT INTO [country] ([id], [name]) VALUES ('rom', 'romani');
INSERT INTO [country] ([id], [name]) VALUES ('roa', 'romansk språk');
INSERT INTO [country] ([id], [name]) VALUES ('root', 'rot');
INSERT INTO [country] ([id], [name]) VALUES ('ro', 'rumensk');
INSERT INTO [country] ([id], [name]) VALUES ('rn', 'rundi');
INSERT INTO [country] ([id], [name]) VALUES ('ru', 'russisk');
INSERT INTO [country] ([id], [name]) VALUES ('sal', 'salishansk språk');
INSERT INTO [country] ([id], [name]) VALUES ('sam', 'samaritansk arameisk');
INSERT INTO [country] ([id], [name]) VALUES ('smi', 'samisk språk');
INSERT INTO [country] ([id], [name]) VALUES ('sm', 'samoansk');
INSERT INTO [country] ([id], [name]) VALUES ('sad', 'sandawe');
INSERT INTO [country] ([id], [name]) VALUES ('sg', 'sango');
INSERT INTO [country] ([id], [name]) VALUES ('sa', 'sanskrit');
INSERT INTO [country] ([id], [name]) VALUES ('sat', 'santali');
INSERT INTO [country] ([id], [name]) VALUES ('sc', 'sardinsk');
INSERT INTO [country] ([id], [name]) VALUES ('sas', 'sasak');
INSERT INTO [country] ([id], [name]) VALUES ('sel', 'selkupisk');
INSERT INTO [country] ([id], [name]) VALUES ('sem', 'semittisk språk');
INSERT INTO [country] ([id], [name]) VALUES ('cai', 'sentralamerikansk indiansk språk');
INSERT INTO [country] ([id], [name]) VALUES ('sr', 'serbisk');
INSERT INTO [country] ([id], [name]) VALUES ('sh', 'serbokroatisk');
INSERT INTO [country] ([id], [name]) VALUES ('srr', 'serer');
INSERT INTO [country] ([id], [name]) VALUES ('shn', 'shan');
INSERT INTO [country] ([id], [name]) VALUES ('sn', 'shona');
INSERT INTO [country] ([id], [name]) VALUES ('ii', 'sichuan-yi');
INSERT INTO [country] ([id], [name]) VALUES ('scn', 'siciliansk');
INSERT INTO [country] ([id], [name]) VALUES ('sid', 'sidamo');
INSERT INTO [country] ([id], [name]) VALUES ('bla', 'siksika');
INSERT INTO [country] ([id], [name]) VALUES ('sd', 'sindhi');
INSERT INTO [country] ([id], [name]) VALUES ('si', 'singalesisk');
INSERT INTO [country] ([id], [name]) VALUES ('sit', 'sino-tibetansk språk');
INSERT INTO [country] ([id], [name]) VALUES ('sio', 'sioux-språk');
INSERT INTO [country] ([id], [name]) VALUES ('sms', 'skoltesamisk');
INSERT INTO [country] ([id], [name]) VALUES ('sco', 'skotsk');
INSERT INTO [country] ([id], [name]) VALUES ('gd', 'skotsk-gælisk');
INSERT INTO [country] ([id], [name]) VALUES ('den', 'slavej');
INSERT INTO [country] ([id], [name]) VALUES ('sla', 'slavisk språk');
INSERT INTO [country] ([id], [name]) VALUES ('sk', 'slovakisk');
INSERT INTO [country] ([id], [name]) VALUES ('sl', 'slovensk');
INSERT INTO [country] ([id], [name]) VALUES ('sog', 'sogdisk');
INSERT INTO [country] ([id], [name]) VALUES ('so', 'somali');
INSERT INTO [country] ([id], [name]) VALUES ('son', 'songhai');
INSERT INTO [country] ([id], [name]) VALUES ('snk', 'soninke');
INSERT INTO [country] ([id], [name]) VALUES ('wen', 'sorbisk språk');
INSERT INTO [country] ([id], [name]) VALUES ('es', 'spansk');
INSERT INTO [country] ([id], [name]) VALUES ('srn', 'sranan tongo');
INSERT INTO [country] ([id], [name]) VALUES ('suk', 'sukuma');
INSERT INTO [country] ([id], [name]) VALUES ('sux', 'sumerisk');
INSERT INTO [country] ([id], [name]) VALUES ('su', 'sundanesisk');
INSERT INTO [country] ([id], [name]) VALUES ('sus', 'susu');
INSERT INTO [country] ([id], [name]) VALUES ('gsw', 'sveitsertysk');
INSERT INTO [country] ([id], [name]) VALUES ('fr_CH', 'sveitsisk fransk');
INSERT INTO [country] ([id], [name]) VALUES ('de_CH', 'sveitsisk høgtysk');
INSERT INTO [country] ([id], [name]) VALUES ('sv', 'svensk');
INSERT INTO [country] ([id], [name]) VALUES ('sw', 'swahili');
INSERT INTO [country] ([id], [name]) VALUES ('ss', 'swati');
INSERT INTO [country] ([id], [name]) VALUES ('syr', 'syrisk');
INSERT INTO [country] ([id], [name]) VALUES ('alt', 'sør-altai');
INSERT INTO [country] ([id], [name]) VALUES ('nr', 'sør-ndebele');
INSERT INTO [country] ([id], [name]) VALUES ('sai', 'søramerikansk indiansk språk');
INSERT INTO [country] ([id], [name]) VALUES ('sma', 'sørsamisk');
INSERT INTO [country] ([id], [name]) VALUES ('st', 'sørsotho');
INSERT INTO [country] ([id], [name]) VALUES ('tl', 'tagalog');
INSERT INTO [country] ([id], [name]) VALUES ('ty', 'tahitisk');
INSERT INTO [country] ([id], [name]) VALUES ('tai', 'taispråk');
INSERT INTO [country] ([id], [name]) VALUES ('tmh', 'tamasjek');
INSERT INTO [country] ([id], [name]) VALUES ('ta', 'tamil');
INSERT INTO [country] ([id], [name]) VALUES ('tt', 'tatarisk');
INSERT INTO [country] ([id], [name]) VALUES ('tg', 'tatsjikisk');
INSERT INTO [country] ([id], [name]) VALUES ('sgn', 'teiknspråk');
INSERT INTO [country] ([id], [name]) VALUES ('te', 'telugu');
INSERT INTO [country] ([id], [name]) VALUES ('tem', 'temne');
INSERT INTO [country] ([id], [name]) VALUES ('ter', 'tereno');
INSERT INTO [country] ([id], [name]) VALUES ('tet', 'tetum');
INSERT INTO [country] ([id], [name]) VALUES ('th', 'thai');
INSERT INTO [country] ([id], [name]) VALUES ('bo', 'tibetansk');
INSERT INTO [country] ([id], [name]) VALUES ('ti', 'tigrinja');
INSERT INTO [country] ([id], [name]) VALUES ('tig', 'tigré');
INSERT INTO [country] ([id], [name]) VALUES ('tiv', 'tivi');
INSERT INTO [country] ([id], [name]) VALUES ('tli', 'tlingit');
INSERT INTO [country] ([id], [name]) VALUES ('tpi', 'tok pisin');
INSERT INTO [country] ([id], [name]) VALUES ('tkl', 'tokelau');
INSERT INTO [country] ([id], [name]) VALUES ('tog', 'tonga (Nyasa)');
INSERT INTO [country] ([id], [name]) VALUES ('to', 'tonga (Tonga-øyane)');
INSERT INTO [country] ([id], [name]) VALUES ('zh_Hant', 'tradisjonell kinesisk');
INSERT INTO [country] ([id], [name]) VALUES ('tsi', 'tsimshian');
INSERT INTO [country] ([id], [name]) VALUES ('cs', 'tsjekkisk');
INSERT INTO [country] ([id], [name]) VALUES ('ce', 'tsjetsjensk');
INSERT INTO [country] ([id], [name]) VALUES ('cv', 'tsjuvansk');
INSERT INTO [country] ([id], [name]) VALUES ('ts', 'tsonga');
INSERT INTO [country] ([id], [name]) VALUES ('tn', 'tswana');
INSERT INTO [country] ([id], [name]) VALUES ('tum', 'tumbuka');
INSERT INTO [country] ([id], [name]) VALUES ('tup', 'tupi-språk');
INSERT INTO [country] ([id], [name]) VALUES ('tk', 'turkmensk');
INSERT INTO [country] ([id], [name]) VALUES ('tvl', 'tuvalu');
INSERT INTO [country] ([id], [name]) VALUES ('tyv', 'tuvinisk');
INSERT INTO [country] ([id], [name]) VALUES ('tw', 'twi');
INSERT INTO [country] ([id], [name]) VALUES ('kcg', 'tyap');
INSERT INTO [country] ([id], [name]) VALUES ('tr', 'tyrkisk');
INSERT INTO [country] ([id], [name]) VALUES ('de', 'tysk');
INSERT INTO [country] ([id], [name]) VALUES ('udm', 'udmurt');
INSERT INTO [country] ([id], [name]) VALUES ('uga', 'ugaritisk');
INSERT INTO [country] ([id], [name]) VALUES ('ug', 'uigurisk');
INSERT INTO [country] ([id], [name]) VALUES ('uk', 'ukrainsk');
INSERT INTO [country] ([id], [name]) VALUES ('umb', 'umbundu');
INSERT INTO [country] ([id], [name]) VALUES ('hu', 'ungarsk');
INSERT INTO [country] ([id], [name]) VALUES ('ur', 'urdu');
INSERT INTO [country] ([id], [name]) VALUES ('uz', 'usbekisk');
INSERT INTO [country] ([id], [name]) VALUES ('zxx', 'utan språkleg innhald');
INSERT INTO [country] ([id], [name]) VALUES ('vai', 'vai');
INSERT INTO [country] ([id], [name]) VALUES ('wa', 'vallonsk');
INSERT INTO [country] ([id], [name]) VALUES ('ve', 'venda');
INSERT INTO [country] ([id], [name]) VALUES ('fy', 'vestfrisisk');
INSERT INTO [country] ([id], [name]) VALUES ('vi', 'vietnamesisk');
INSERT INTO [country] ([id], [name]) VALUES ('vo', 'volapyk');
INSERT INTO [country] ([id], [name]) VALUES ('vot', 'votisk');
INSERT INTO [country] ([id], [name]) VALUES ('wak', 'wakasjansk språk');
INSERT INTO [country] ([id], [name]) VALUES ('wal', 'walamo');
INSERT INTO [country] ([id], [name]) VALUES ('cy', 'walisisk');
INSERT INTO [country] ([id], [name]) VALUES ('war', 'waray');
INSERT INTO [country] ([id], [name]) VALUES ('was', 'washo');
INSERT INTO [country] ([id], [name]) VALUES ('wo', 'wolof');
INSERT INTO [country] ([id], [name]) VALUES ('xh', 'xhosa');
INSERT INTO [country] ([id], [name]) VALUES ('yao', 'yao');
INSERT INTO [country] ([id], [name]) VALUES ('yap', 'yapesisk');
INSERT INTO [country] ([id], [name]) VALUES ('znd', 'zande');
INSERT INTO [country] ([id], [name]) VALUES ('zap', 'zapotec');
INSERT INTO [country] ([id], [name]) VALUES ('zza', 'zaza');
INSERT INTO [country] ([id], [name]) VALUES ('zen', 'zenaga');
INSERT INTO [country] ([id], [name]) VALUES ('za', 'zhuang');
INSERT INTO [country] ([id], [name]) VALUES ('zu', 'zulu');
INSERT INTO [country] ([id], [name]) VALUES ('zun', 'zuni');
| {
"content_hash": "15b3ee817ae48da7b8a9cb6d5df6b208",
"timestamp": "",
"source": "github",
"line_count": 505,
"max_line_length": 98,
"avg_line_length": 65.30891089108911,
"alnum_prop": 0.614323398320245,
"repo_name": "JumpLink/country-list",
"id": "2436409c7a3f851e85fb989b2633a12bcee29c6a",
"size": "33057",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "country/cldr/nn_NO/language.sqlserver.sql",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "3084"
},
{
"name": "PHP",
"bytes": "9858933"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.