code
stringlengths
4
1.01M
language
stringclasses
2 values
if (isset($_POST['upload'])) { $target = "../img".basename($_FILES['image']['name']); $image = $_FILES['image']['name']; $msg = ""; $sql = "UPDATE user SET avatar='$image' WHERE id='$id'"; mysqli_query($conn, $sql); if (move_uploaded_file($_FILES['image']['tmp_name'], $target)) { $msg = "Uploaded file."; } else { $msg = "there was a problem uploading image"; } } if (isset($_POST['upload'])) { $imageName = mysqli_real_escape_string($conn, $_FILES['image']['name']); $imageData = mysqli_real_escape_string($conn,file_get_contents($_FILES['image']['tmp_name'])); $imageType = mysqli_real_escape_string($conn, $_FILES['image']['type']); if (substr($imageType, 0, 5) == "image") { $sql = "UPDATE user SET avatar='$imageData' WHERE id='$id'"; mysqli_query($conn, $sql); echo "Image uploaded!"; } else { echo "only images are allowed"; } } $sql = "SELECT * FROM user"; $result = mysqli_query($conn, $sql); if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_assoc($result)) { $id = $row['id']; $sqlImg = "SELECT * FROM profileimg WHERE userid='$id'"; $resultImg = mysqli_query($conn, $sqlImg); while ($rowImg = mysqli_fetch_assoc($resultImg)) { echo "<div class='user-container'>"; if ($rowImg['status'] == 0) { echo "<img src='img/profile".$id.".jpg?'".mt_rand().">"; } else { echo "<img src='img/profiledefault.jpg'>"; } echo "<p>".$row['uid']."</p>"; echo "</div>"; } } } else { echo "There are no users yet!"; } // if ($userRow['image'] == "") { echo "<form action='".upload($conn)."' method='POST' enctype='multipart/form-data'> <input type='file' name='file'> <button type='submit' name='submit'>UPLOAD</button> </form>"; if (isset($_POST['upload'])) { } else { } // } // function upload($conn) { // $id = $_SESSION['id']; // // // if (isset($_POST['submit'])) { // $file = $_FILES['file']; // $fileName = $file['name']; // $fileTmpName = $file['tmp_name']; // $fileSize = $file['size']; // $fileError = $file['error']; // $fileType = $file['type']; // // $fileExt = explode('.', $fileName); // $fileActualExt = strtolower(end($fileExt)); // // $allowed = array('jpg', 'jpeg', 'png', 'pdf'); // // if (in_array($fileActualExt, $allowed)) { // if ($fileError === 0) { // if ($fileSize < 1000000) { // $fileNameNew = "profile".$id.".".$fileActualExt; // $fileDestination = 'uploads/'.$fileNameNew; // move_uploaded_file($fileTmpName, $fileDestination); // $sql = "UPDATE profileimg SET status =0 WHERE userid='$id'"; // $result = mysqli_query($conn, $sql); // header("Location: index.php?uploadsuccess"); // } else { // echo "Your file is too big!"; // } // } else { // echo "There was an error uploading your file!"; // } // } else { // echo "You cannot upload files of this type!"; // } // } // }
Java
module Twitter class JSONStream protected def reconnect_after timeout @reconnect_callback.call(timeout, @reconnect_retries) if @reconnect_callback if timeout == 0 reconnect @options[:host], @options[:port] start_tls if @options[:ssl] else EventMachine.add_timer(timeout) do reconnect @options[:host], @options[:port] start_tls if @options[:ssl] end end end end end module TwitterOAuth class Client private def consumer @consumer ||= OAuth::Consumer.new( @consumer_key, @consumer_secret, { :site => 'https://api.twitter.com', :proxy => @proxy } ) end end end class String def c(*codes) return self if Earthquake.config[:lolize] codes = codes.flatten.map { |code| case code when String, Symbol Earthquake.config[:color][code.to_sym] rescue nil else code end }.compact.unshift(0) "\e[#{codes.join(';')}m#{self}\e[0m" end def coloring(pattern, color = nil, &block) return self if Earthquake.config[:lolize] self.gsub(pattern) do |i| applied_colors = $`.scan(/\e\[[\d;]+m/) c = color || block.call(i) "#{i.c(c)}#{applied_colors.join}" end end t = { ?& => "&amp;", ?< => "&lt;", ?> => "&gt;", ?' => "&apos;", ?" => "&quot;", } define_method(:u) do gsub(/(#{Regexp.union(t.values)})/o, t.invert) end define_method(:e) do gsub(/[#{t.keys.join}]/o, t) end end
Java
namespace Jello.Nodes { public abstract class TerminalNode<T> : Node<T> where T : class { public override INode GetSingleChild() { return null; } } }
Java
module Dotify class Version # The Checkup class is responsible for # reaching out to Rubygems.org and retrieving # the latest gem version. class Checker class << self attr_reader :result, :resp end def self.check_latest_release! @result = (latest == Version.build.level) end def self.latest fetch.map { |v| v['number'] }.max end private def self.fetch require 'multi_json' @resp = Net::HTTP.get('rubygems.org', '/api/v1/versions/dotify.json') MultiJson.load(@resp) end end end end
Java
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Copyright (c) 2011-2012 Litecoin Developers // Copyright (c) 2013 Fastcoin Developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "irc.h" #include "net.h" #include "strlcpy.h" #include "base58.h" using namespace std; using namespace boost; int nGotIRCAddresses = 0; void ThreadIRCSeed2(void* parg); #pragma pack(push, 1) struct ircaddr { struct in_addr ip; short port; }; #pragma pack(pop) string EncodeAddress(const CService& addr) { struct ircaddr tmp; if (addr.GetInAddr(&tmp.ip)) { tmp.port = htons(addr.GetPort()); vector<unsigned char> vch(UBEGIN(tmp), UEND(tmp)); return string("u") + EncodeBase58Check(vch); } return ""; } bool DecodeAddress(string str, CService& addr) { vector<unsigned char> vch; if (!DecodeBase58Check(str.substr(1), vch)) return false; struct ircaddr tmp; if (vch.size() != sizeof(tmp)) return false; memcpy(&tmp, &vch[0], sizeof(tmp)); addr = CService(tmp.ip, ntohs(tmp.port)); return true; } static bool Send(SOCKET hSocket, const char* pszSend) { if (strstr(pszSend, "PONG") != pszSend) printf("IRC SENDING: %s\n", pszSend); const char* psz = pszSend; const char* pszEnd = psz + strlen(psz); while (psz < pszEnd) { int ret = send(hSocket, psz, pszEnd - psz, MSG_NOSIGNAL); if (ret < 0) return false; psz += ret; } return true; } bool RecvLineIRC(SOCKET hSocket, string& strLine) { loop { bool fRet = RecvLine(hSocket, strLine); if (fRet) { if (fShutdown) return false; vector<string> vWords; ParseString(strLine, ' ', vWords); if (vWords.size() >= 1 && vWords[0] == "PING") { strLine[1] = 'O'; strLine += '\r'; Send(hSocket, strLine.c_str()); continue; } } return fRet; } } int RecvUntil(SOCKET hSocket, const char* psz1, const char* psz2=NULL, const char* psz3=NULL, const char* psz4=NULL) { loop { string strLine; strLine.reserve(10000); if (!RecvLineIRC(hSocket, strLine)) return 0; printf("IRC %s\n", strLine.c_str()); if (psz1 && strLine.find(psz1) != string::npos) return 1; if (psz2 && strLine.find(psz2) != string::npos) return 2; if (psz3 && strLine.find(psz3) != string::npos) return 3; if (psz4 && strLine.find(psz4) != string::npos) return 4; } } bool Wait(int nSeconds) { if (fShutdown) return false; printf("IRC waiting %d seconds to reconnect\n", nSeconds); for (int i = 0; i < nSeconds; i++) { if (fShutdown) return false; Sleep(1000); } return true; } bool RecvCodeLine(SOCKET hSocket, const char* psz1, string& strRet) { strRet.clear(); loop { string strLine; if (!RecvLineIRC(hSocket, strLine)) return false; vector<string> vWords; ParseString(strLine, ' ', vWords); if (vWords.size() < 2) continue; if (vWords[1] == psz1) { printf("IRC %s\n", strLine.c_str()); strRet = strLine; return true; } } } bool GetIPFromIRC(SOCKET hSocket, string strMyName, CNetAddr& ipRet) { Send(hSocket, strprintf("USERHOST %s\r", strMyName.c_str()).c_str()); string strLine; if (!RecvCodeLine(hSocket, "302", strLine)) return false; vector<string> vWords; ParseString(strLine, ' ', vWords); if (vWords.size() < 4) return false; string str = vWords[3]; if (str.rfind("@") == string::npos) return false; string strHost = str.substr(str.rfind("@")+1); // Hybrid IRC used by lfnet always returns IP when you userhost yourself, // but in case another IRC is ever used this should work. printf("GetIPFromIRC() got userhost %s\n", strHost.c_str()); CNetAddr addr(strHost, true); if (!addr.IsValid()) return false; ipRet = addr; return true; } void ThreadIRCSeed(void* parg) { IMPLEMENT_RANDOMIZE_STACK(ThreadIRCSeed(parg)); // Make this thread recognisable as the IRC seeding thread RenameThread("bitcoin-ircseed"); try { ThreadIRCSeed2(parg); } catch (std::exception& e) { PrintExceptionContinue(&e, "ThreadIRCSeed()"); } catch (...) { PrintExceptionContinue(NULL, "ThreadIRCSeed()"); } printf("ThreadIRCSeed exited\n"); } void ThreadIRCSeed2(void* parg) { /* Dont advertise on IRC if we don't allow incoming connections */ if (mapArgs.count("-connect") || fNoListen) return; if (!GetBoolArg("-irc", false)) return; printf("ThreadIRCSeed started\n"); int nErrorWait = 10; int nRetryWait = 10; while (!fShutdown) { CService addrConnect("92.243.23.21", 6667); // irc.lfnet.org CService addrIRC("irc.lfnet.org", 6667, true); if (addrIRC.IsValid()) addrConnect = addrIRC; SOCKET hSocket; if (!ConnectSocket(addrConnect, hSocket)) { printf("IRC connect failed\n"); nErrorWait = nErrorWait * 11 / 10; if (Wait(nErrorWait += 60)) continue; else return; } if (!RecvUntil(hSocket, "Found your hostname", "using your IP address instead", "Couldn't look up your hostname", "ignoring hostname")) { closesocket(hSocket); hSocket = INVALID_SOCKET; nErrorWait = nErrorWait * 11 / 10; if (Wait(nErrorWait += 60)) continue; else return; } CNetAddr addrIPv4("1.2.3.4"); // arbitrary IPv4 address to make GetLocal prefer IPv4 addresses CService addrLocal; string strMyName; if (GetLocal(addrLocal, &addrIPv4)) strMyName = EncodeAddress(GetLocalAddress(&addrConnect)); if (strMyName == "") strMyName = strprintf("x%u", GetRand(1000000000)); Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str()); Send(hSocket, strprintf("USER %s 8 * : %s\r", strMyName.c_str(), strMyName.c_str()).c_str()); int nRet = RecvUntil(hSocket, " 004 ", " 433 "); if (nRet != 1) { closesocket(hSocket); hSocket = INVALID_SOCKET; if (nRet == 2) { printf("IRC name already in use\n"); Wait(10); continue; } nErrorWait = nErrorWait * 11 / 10; if (Wait(nErrorWait += 60)) continue; else return; } Sleep(500); // Get our external IP from the IRC server and re-nick before joining the channel CNetAddr addrFromIRC; if (GetIPFromIRC(hSocket, strMyName, addrFromIRC)) { printf("GetIPFromIRC() returned %s\n", addrFromIRC.ToString().c_str()); if (addrFromIRC.IsRoutable()) { // IRC lets you to re-nick AddLocal(addrFromIRC, LOCAL_IRC); strMyName = EncodeAddress(GetLocalAddress(&addrConnect)); Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str()); } } if (fTestNet) { Send(hSocket, "JOIN #fastcoinTEST3\r"); Send(hSocket, "WHO #fastcoinTEST3\r"); } else { // randomly join #fastcoin00-#fastcoin99 int channel_number = GetRandInt(100); channel_number = 0; // Fastcoin: for now, just use one channel Send(hSocket, strprintf("JOIN #fastcoin%02d\r", channel_number).c_str()); Send(hSocket, strprintf("WHO #fastcoin%02d\r", channel_number).c_str()); } int64 nStart = GetTime(); string strLine; strLine.reserve(10000); while (!fShutdown && RecvLineIRC(hSocket, strLine)) { if (strLine.empty() || strLine.size() > 900 || strLine[0] != ':') continue; vector<string> vWords; ParseString(strLine, ' ', vWords); if (vWords.size() < 2) continue; char pszName[10000]; pszName[0] = '\0'; if (vWords[1] == "352" && vWords.size() >= 8) { // index 7 is limited to 16 characters // could get full length name at index 10, but would be different from join messages strlcpy(pszName, vWords[7].c_str(), sizeof(pszName)); printf("IRC got who\n"); } if (vWords[1] == "JOIN" && vWords[0].size() > 1) { // :username!username@50000007.F000000B.90000002.IP JOIN :#channelname strlcpy(pszName, vWords[0].c_str() + 1, sizeof(pszName)); if (strchr(pszName, '!')) *strchr(pszName, '!') = '\0'; printf("IRC got join\n"); } if (pszName[0] == 'u') { CAddress addr; if (DecodeAddress(pszName, addr)) { addr.nTime = GetAdjustedTime(); if (addrman.Add(addr, addrConnect, 51 * 60)) printf("IRC got new address: %s\n", addr.ToString().c_str()); nGotIRCAddresses++; } else { printf("IRC decode failed\n"); } } } closesocket(hSocket); hSocket = INVALID_SOCKET; if (GetTime() - nStart > 20 * 60) { nErrorWait /= 3; nRetryWait /= 3; } nRetryWait = nRetryWait * 11 / 10; if (!Wait(nRetryWait += 60)) return; } } #ifdef TEST int main(int argc, char *argv[]) { WSADATA wsadata; if (WSAStartup(MAKEWORD(2,2), &wsadata) != NO_ERROR) { printf("Error at WSAStartup()\n"); return false; } ThreadIRCSeed(NULL); WSACleanup(); return 0; } #endif
Java
package fyskam.fyskamssngbok; import android.app.Activity; import android.app.ActionBar; import android.app.Fragment; import android.support.v4.app.ActionBarDrawerToggle; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.content.SharedPreferences; import android.content.res.Configuration; import android.os.Bundle; import android.preference.PreferenceManager; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.Toast; /** * Fragment used for managing interactions for and presentation of a navigation drawer. * See the <a href="https://developer.android.com/design/patterns/navigation-drawer.html#Interaction"> * design guidelines</a> for a complete explanation of the behaviors implemented here. */ public class NavigationDrawerFragment extends Fragment { /** * Remember the position of the selected item. */ private static final String STATE_SELECTED_POSITION = "selected_navigation_drawer_position"; /** * Per the design guidelines, you should show the drawer on launch until the user manually * expands it. This shared preference tracks this. */ private static final String PREF_USER_LEARNED_DRAWER = "navigation_drawer_learned"; /** * A pointer to the current callbacks instance (the Activity). */ private NavigationDrawerCallbacks mCallbacks; /** * Helper component that ties the action bar to the navigation drawer. */ private ActionBarDrawerToggle mDrawerToggle; private DrawerLayout mDrawerLayout; private ListView mDrawerListView; private View mFragmentContainerView; private int mCurrentSelectedPosition = 0; private boolean mFromSavedInstanceState; private boolean mUserLearnedDrawer; public NavigationDrawerFragment() { } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Read in the flag indicating whether or not the user has demonstrated awareness of the // drawer. See PREF_USER_LEARNED_DRAWER for details. SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getActivity()); mUserLearnedDrawer = sp.getBoolean(PREF_USER_LEARNED_DRAWER, false); if (savedInstanceState != null) { mCurrentSelectedPosition = savedInstanceState.getInt(STATE_SELECTED_POSITION); mFromSavedInstanceState = true; } // Select either the default item (0) or the last selected item. selectItem(mCurrentSelectedPosition); } @Override public void onActivityCreated (Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); // Indicate that this fragment would like to influence the set of actions in the action bar. setHasOptionsMenu(true); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { mDrawerListView = (ListView) inflater.inflate( R.layout.fragment_navigation_drawer, container, false); mDrawerListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { selectItem(position); } }); mDrawerListView.setAdapter(new ArrayAdapter<String>( getActionBar().getThemedContext(), android.R.layout.simple_list_item_activated_1, android.R.id.text1, new String[]{ getString(R.string.title_section1), getString(R.string.title_section2), getString(R.string.title_section3), })); mDrawerListView.setItemChecked(mCurrentSelectedPosition, true); return mDrawerListView; } public boolean isDrawerOpen() { return mDrawerLayout != null && mDrawerLayout.isDrawerOpen(mFragmentContainerView); } /** * Users of this fragment must call this method to set up the navigation drawer interactions. * * @param fragmentId The android:id of this fragment in its activity's layout. * @param drawerLayout The DrawerLayout containing this fragment's UI. */ public void setUp(int fragmentId, DrawerLayout drawerLayout) { mFragmentContainerView = getActivity().findViewById(fragmentId); mDrawerLayout = drawerLayout; // set a custom shadow that overlays the main content when the drawer opens mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START); // set up the drawer's list view with items and click listener ActionBar actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setHomeButtonEnabled(true); // ActionBarDrawerToggle ties together the the proper interactions // between the navigation drawer and the action bar app icon. mDrawerToggle = new ActionBarDrawerToggle( getActivity(), /* host Activity */ mDrawerLayout, /* DrawerLayout object */ R.drawable.ic_drawer, /* nav drawer image to replace 'Up' caret */ R.string.navigation_drawer_open, /* "open drawer" description for accessibility */ R.string.navigation_drawer_close /* "close drawer" description for accessibility */ ) { @Override public void onDrawerClosed(View drawerView) { super.onDrawerClosed(drawerView); if (!isAdded()) { return; } getActivity().invalidateOptionsMenu(); // calls onPrepareOptionsMenu() } @Override public void onDrawerOpened(View drawerView) { super.onDrawerOpened(drawerView); if (!isAdded()) { return; } if (!mUserLearnedDrawer) { // The user manually opened the drawer; store this flag to prevent auto-showing // the navigation drawer automatically in the future. mUserLearnedDrawer = true; SharedPreferences sp = PreferenceManager .getDefaultSharedPreferences(getActivity()); sp.edit().putBoolean(PREF_USER_LEARNED_DRAWER, true).apply(); } getActivity().invalidateOptionsMenu(); // calls onPrepareOptionsMenu() } }; // If the user hasn't 'learned' about the drawer, open it to introduce them to the drawer, // per the navigation drawer design guidelines. if (!mUserLearnedDrawer && !mFromSavedInstanceState) { mDrawerLayout.openDrawer(mFragmentContainerView); } // Defer code dependent on restoration of previous instance state. mDrawerLayout.post(new Runnable() { @Override public void run() { mDrawerToggle.syncState(); } }); mDrawerLayout.setDrawerListener(mDrawerToggle); } private void selectItem(int position) { mCurrentSelectedPosition = position; if (mDrawerListView != null) { mDrawerListView.setItemChecked(position, true); } if (mDrawerLayout != null) { mDrawerLayout.closeDrawer(mFragmentContainerView); } if (mCallbacks != null) { mCallbacks.onNavigationDrawerItemSelected(position); } } @Override public void onAttach(Activity activity) { super.onAttach(activity); try { mCallbacks = (NavigationDrawerCallbacks) activity; } catch (ClassCastException e) { throw new ClassCastException("Activity must implement NavigationDrawerCallbacks."); } } @Override public void onDetach() { super.onDetach(); mCallbacks = null; } @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putInt(STATE_SELECTED_POSITION, mCurrentSelectedPosition); } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); // Forward the new configuration the drawer toggle component. mDrawerToggle.onConfigurationChanged(newConfig); } @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { // If the drawer is open, show the global app actions in the action bar. See also // showGlobalContextActionBar, which controls the top-left area of the action bar. if (mDrawerLayout != null && isDrawerOpen()) { inflater.inflate(R.menu.global, menu); showGlobalContextActionBar(); } super.onCreateOptionsMenu(menu, inflater); } @Override public boolean onOptionsItemSelected(MenuItem item) { if (mDrawerToggle.onOptionsItemSelected(item)) { return true; } if (item.getItemId() == R.id.action_example) { Toast.makeText(getActivity(), "Example action.", Toast.LENGTH_SHORT).show(); return true; } return super.onOptionsItemSelected(item); } /** * Per the navigation drawer design guidelines, updates the action bar to show the global app * 'context', rather than just what's in the current screen. */ private void showGlobalContextActionBar() { ActionBar actionBar = getActionBar(); actionBar.setDisplayShowTitleEnabled(true); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); actionBar.setTitle(R.string.app_name); } private ActionBar getActionBar() { return getActivity().getActionBar(); } /** * Callbacks interface that all activities using this fragment must implement. */ public static interface NavigationDrawerCallbacks { /** * Called when an item in the navigation drawer is selected. */ void onNavigationDrawerItemSelected(int position); } }
Java
/*************************************************************************/ /* surface_tool.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #ifndef SURFACE_TOOL_H #define SURFACE_TOOL_H #include "scene/resources/mesh.h" #include "thirdparty/misc/mikktspace.h" class SurfaceTool : public Reference { GDCLASS(SurfaceTool, Reference); public: struct Vertex { Vector3 vertex; Color color; Vector3 normal; // normal, binormal, tangent Vector3 binormal; Vector3 tangent; Vector2 uv; Vector2 uv2; Vector<int> bones; Vector<float> weights; bool operator==(const Vertex &p_vertex) const; Vertex() {} }; private: struct VertexHasher { static _FORCE_INLINE_ uint32_t hash(const Vertex &p_vtx); }; bool begun; bool first; Mesh::PrimitiveType primitive; int format; Ref<Material> material; //arrays List<Vertex> vertex_array; List<int> index_array; Map<int, bool> smooth_groups; //memory Color last_color; Vector3 last_normal; Vector2 last_uv; Vector2 last_uv2; Vector<int> last_bones; Vector<float> last_weights; Plane last_tangent; void _create_list_from_arrays(Array arr, List<Vertex> *r_vertex, List<int> *r_index, int &lformat); void _create_list(const Ref<Mesh> &p_existing, int p_surface, List<Vertex> *r_vertex, List<int> *r_index, int &lformat); //mikktspace callbacks static int mikktGetNumFaces(const SMikkTSpaceContext *pContext); static int mikktGetNumVerticesOfFace(const SMikkTSpaceContext *pContext, const int iFace); static void mikktGetPosition(const SMikkTSpaceContext *pContext, float fvPosOut[], const int iFace, const int iVert); static void mikktGetNormal(const SMikkTSpaceContext *pContext, float fvNormOut[], const int iFace, const int iVert); static void mikktGetTexCoord(const SMikkTSpaceContext *pContext, float fvTexcOut[], const int iFace, const int iVert); static void mikktSetTSpaceBasic(const SMikkTSpaceContext *pContext, const float fvTangent[], const float fSign, const int iFace, const int iVert); protected: static void _bind_methods(); public: void begin(Mesh::PrimitiveType p_primitive); void add_vertex(const Vector3 &p_vertex); void add_color(Color p_color); void add_normal(const Vector3 &p_normal); void add_tangent(const Plane &p_tangent); void add_uv(const Vector2 &p_uv); void add_uv2(const Vector2 &p_uv); void add_bones(const Vector<int> &p_indices); void add_weights(const Vector<float> &p_weights); void add_smooth_group(bool p_smooth); void add_triangle_fan(const Vector<Vector3> &p_vertexes, const Vector<Vector2> &p_uvs = Vector<Vector2>(), const Vector<Color> &p_colors = Vector<Color>(), const Vector<Vector2> &p_uv2s = Vector<Vector2>(), const Vector<Vector3> &p_normals = Vector<Vector3>(), const Vector<Plane> &p_tangents = Vector<Plane>()); void add_index(int p_index); void index(); void deindex(); void generate_normals(); void generate_tangents(); void add_to_format(int p_flags) { format |= p_flags; } void set_material(const Ref<Material> &p_material); void clear(); List<Vertex> &get_vertex_array() { return vertex_array; } void create_from_triangle_arrays(const Array &p_arrays); Array commit_to_arrays(); void create_from(const Ref<Mesh> &p_existing, int p_surface); void append_from(const Ref<Mesh> &p_existing, int p_surface, const Transform &p_xform); Ref<ArrayMesh> commit(const Ref<ArrayMesh> &p_existing = Ref<ArrayMesh>()); SurfaceTool(); }; #endif
Java
#pragma once class Menu : public QWidget { private: QGridLayout layout; QPushButton play_single; QPushButton play_2v2; QPushButton play_multi; public: Menu(Window *window, Game *game); };
Java
import uuid from uqbar.objects import new from supriya.patterns.Pattern import Pattern class EventPattern(Pattern): ### CLASS VARIABLES ### __slots__ = () ### SPECIAL METHODS ### def _coerce_iterator_output(self, expr, state=None): import supriya.patterns if not isinstance(expr, supriya.patterns.Event): expr = supriya.patterns.NoteEvent(**expr) if expr.get("uuid") is None: expr = new(expr, uuid=uuid.uuid4()) return expr ### PUBLIC METHODS ### def play(self, clock=None, server=None): import supriya.patterns import supriya.realtime event_player = supriya.patterns.RealtimeEventPlayer( self, clock=clock, server=server or supriya.realtime.Server.default() ) event_player.start() return event_player def with_bus(self, calculation_rate="audio", channel_count=None, release_time=0.25): import supriya.patterns return supriya.patterns.Pbus( self, calculation_rate=calculation_rate, channel_count=channel_count, release_time=release_time, ) def with_effect(self, synthdef, release_time=0.25, **settings): import supriya.patterns return supriya.patterns.Pfx( self, synthdef=synthdef, release_time=release_time, **settings ) def with_group(self, release_time=0.25): import supriya.patterns return supriya.patterns.Pgroup(self, release_time=release_time)
Java
/* Copyright (c) 2011 Andrei Mackenzie Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Compute the edit distance between the two given strings exports.getEditDistance = function(a, b){ if(a.length == 0) return b.length; if(b.length == 0) return a.length; var matrix = []; // increment along the first column of each row var i; for(i = 0; i <= b.length; i++){ matrix[i] = [i]; } // increment each column in the first row var j; for(j = 0; j <= a.length; j++){ matrix[0][j] = j; } // Fill in the rest of the matrix for(i = 1; i <= b.length; i++){ for(j = 1; j <= a.length; j++){ if(b.charAt(i-1) == a.charAt(j-1)){ matrix[i][j] = matrix[i-1][j-1]; } else { matrix[i][j] = Math.min(matrix[i-1][j-1] + 1, // substitution Math.min(matrix[i][j-1] + 1, // insertion matrix[i-1][j] + 1)); // deletion } } } return matrix[b.length][a.length]; };
Java
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Pervasive_Heart_Monitor { class Program { static bool checknum(string s) { return (s.Contains("1") || s.Contains("2") || s.Contains("3") || s.Contains("4") || s.Contains("5") || s.Contains("6") || s.Contains("7") || s.Contains("8") || s.Contains("9") || s.Contains(".")); } static void Main(string[] args) { string s = Console.ReadLine(); while (!string.IsNullOrEmpty(s)) { float total=0; int n=0; string name = ""; string[] ssplit = s.Split(); for(int i = 0; i < ssplit.Length; i++) { if (!checknum(ssplit[i])) { name += (ssplit[i] + " "); } else { total += float.Parse(ssplit[i]); n++; } } Console.WriteLine("{0:F6} {1}", (float)(total / n), name); s = Console.ReadLine(); } } } }
Java
//! \file ArcSG.cs //! \date 2018 Feb 01 //! \brief 'fSGX' multi-frame image container. // // Copyright (C) 2018 by morkt // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. // using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; namespace GameRes.Formats.Ivory { [Export(typeof(ArchiveFormat))] public class SgOpener : ArchiveFormat { public override string Tag { get { return "SG/cOBJ"; } } public override string Description { get { return "Ivory multi-frame image"; } } public override uint Signature { get { return 0x58475366; } } // 'fSGX' public override bool IsHierarchic { get { return false; } } public override bool CanWrite { get { return false; } } public override ArcFile TryOpen (ArcView file) { long offset = 8; var base_name = Path.GetFileNameWithoutExtension (file.Name); var dir = new List<Entry>(); while (offset < file.MaxOffset && file.View.AsciiEqual (offset, "cOBJ")) { uint obj_size = file.View.ReadUInt32 (offset+4); if (0 == obj_size) break; if (file.View.AsciiEqual (offset+0x10, "fSG ")) { var entry = new Entry { Name = string.Format ("{0}#{1}", base_name, dir.Count), Type = "image", Offset = offset+0x10, Size = file.View.ReadUInt32 (offset+0x14), }; dir.Add (entry); } offset += obj_size; } if (0 == dir.Count) return null; return new ArcFile (file, this, dir); } } }
Java
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace track_downloader { class Program { static void Main(string[] args) { string[] blacklisted = Console.ReadLine().Split(); List<string> filenames = ReadFilenames(); filenames = filenames .Where(a => ContainsBlackListed(a, blacklisted)) .OrderBy(a => a) .ToList(); Console.WriteLine(string.Join("\r\n", filenames)); } private static bool ContainsBlackListed(string a, string[] blacklisted) { for (int i = 0; i < blacklisted.Length; i++) { if (a.Contains(blacklisted[i])) { return false; } } return true; } private static List<string> ReadFilenames() { List<string> output = new List<string>(); string filename = Console.ReadLine(); while (filename != "end") { output.Add(filename); filename = Console.ReadLine(); } return output; } } }
Java
import React, { PropTypes } from 'react'; import { connect } from 'react-redux'; import GroupPage from './GroupPage.js'; import GroupNotFoundPage from './GroupNotFoundPage.js'; const Group = ({ isValid, groupId }) => (isValid ? <GroupPage groupId={groupId} /> : <GroupNotFoundPage groupId={groupId} />); Group.propTypes = { groupId: PropTypes.string, isValid: PropTypes.bool.isRequired }; export default connect(state => ({ groupId: state.router.params.groupId, isValid: !!state.groups.data[state.router.params.groupId] }))(Group);
Java
using System; using System.Data.Entity; using System.Data.Entity.Migrations; using SimplePersistence.Example.Console.Models.Logging; using SimplePersistence.Example.Console.UoW.EF.Mapping; namespace SimplePersistence.Example.Console.UoW.EF.Migrations { public sealed class Configuration : DropCreateDatabaseIfModelChanges<ConsoleDbContext>//DbMigrationsConfiguration<ConsoleDbContext> { //public Configuration() //{ // AutomaticMigrationsEnabled = false; //} protected override void Seed(ConsoleDbContext context) { context.Applications.AddOrUpdate( e => e.Id, new Application { Id = "SimplePersistence.Example.Console", Description = "The SimplePersistence.Example.Console application", CreatedOn = DateTime.Now, CreatedBy = "seed.migration" }); context.Levels.AddOrUpdate( e => e.Id, new Level { Id = "DEBUG", Description = "Debug", CreatedOn = DateTime.Now, CreatedBy = "seed.migration" }, new Level { Id = "Info", Description = "Information", CreatedOn = DateTime.Now, CreatedBy = "seed.migration" }, new Level { Id = "WARN", Description = "Warning", CreatedOn = DateTime.Now, CreatedBy = "seed.migration" }, new Level { Id = "ERROR", Description = "Error", CreatedOn = DateTime.Now, CreatedBy = "seed.migration" }, new Level { Id = "FATAL", Description = "Fatal", CreatedOn = DateTime.Now, CreatedBy = "seed.migration" }); } } }
Java
class CreateItineraries < ActiveRecord::Migration def change create_table :itineraries do |t| t.references :user t.timestamps null: false end end end
Java
// node-vcdiff // https://github.com/baranov1ch/node-vcdiff // // Copyright 2014 Alexey Baranov <me@kotiki.cc> // Released under the MIT license #ifndef VCDIFF_H_ #define VCDIFF_H_ #include <memory> #include <string> #include <node.h> #include <node_object_wrap.h> #include <uv.h> #include <v8.h> namespace open_vcdiff { class OutputStringInterface; } class VcdCtx : public node::ObjectWrap { public: enum class Mode { ENCODE, DECODE, }; enum class Error { OK, INIT_ERROR, ENCODE_ERROR, DECODE_ERROR, }; class Coder { public: virtual Error Start(open_vcdiff::OutputStringInterface* out) = 0; virtual Error Process(const char* data, size_t len, open_vcdiff::OutputStringInterface* out) = 0; virtual Error Finish(open_vcdiff::OutputStringInterface* out) = 0; virtual ~Coder() {} }; VcdCtx(std::unique_ptr<Coder> coder); virtual ~VcdCtx(); static void Init(v8::Handle<v8::Object> exports); static v8::Persistent<v8::Function> constructor; static void New(const v8::FunctionCallbackInfo<v8::Value>& args); static void WriteAsync(const v8::FunctionCallbackInfo<v8::Value>& args); static void WriteSync(const v8::FunctionCallbackInfo<v8::Value>& args); static void Close(const v8::FunctionCallbackInfo<v8::Value>& args); private: enum class State { IDLE, PROCESSING, FINALIZING, DONE, }; struct WorkData { VcdCtx* ctx; v8::Isolate* isolate; const char* data; size_t len; bool is_last; }; static void WriteInternal( const v8::FunctionCallbackInfo<v8::Value>& args, bool async); v8::Local<v8::Object> Write( v8::Local<v8::Object> buffer, bool is_last, bool async); v8::Local<v8::Array> FinishWrite(v8::Isolate* isolate); void Process(const char* data, size_t len, bool is_last); bool CheckError(v8::Isolate* isolate); void SendError(v8::Isolate* isolate); void Close(); void Reset(); bool HasError() const; v8::Local<v8::Object> GetOutputBuffer(v8::Isolate* isolate); static const char* GetErrorString(Error err); static void ProcessShim(uv_work_t* work_req); static void AfterShim(uv_work_t* work_req, int status); std::unique_ptr<Coder> coder_; v8::Persistent<v8::Object> in_buffer_; // hold reference when async uv_work_t work_req_; bool write_in_progress_ = false; bool pending_close_ = false; State state_ = State::IDLE; Error err_ = Error::OK; std::string output_buffer_; VcdCtx(const VcdCtx& other) = delete; VcdCtx& operator=(const VcdCtx& other) = delete; }; #endif // VCDIFF_H_
Java
import assert from 'assert' import { THREAD_COUNT, CURSOR_BUFFER_SIZE, THREAD_COUNTER_BYTE_LENGTH, } from './constants' import { InputCursor, StoredEventBatchPointer, StoredEventPointer, } from './types' const checkThreadArrayLength = (threadArray: Array<number>): void => { assert.strictEqual( threadArray.length, THREAD_COUNT, 'Cursor must be represented by array of 256 numbers' ) } export const initThreadArray = (): Array<number> => { const threadCounters = new Array<number>(THREAD_COUNT) threadCounters.fill(0) return threadCounters } export const threadArrayToCursor = (threadArray: Array<number>): string => { checkThreadArrayLength(threadArray) const cursorBuffer: Buffer = Buffer.alloc(CURSOR_BUFFER_SIZE) for (let i = 0; i < threadArray.length; ++i) { cursorBuffer.writeUIntBE( threadArray[i], i * THREAD_COUNTER_BYTE_LENGTH, THREAD_COUNTER_BYTE_LENGTH ) } return cursorBuffer.toString('base64') } export const cursorToThreadArray = (cursor: InputCursor): Array<number> => { if (cursor == null) return initThreadArray() const cursorBuffer = Buffer.from(cursor, 'base64') assert.strictEqual( cursorBuffer.length, CURSOR_BUFFER_SIZE, 'Wrong size of cursor buffer' ) const threadCounters = new Array<number>(THREAD_COUNT) for (let i = 0; i < cursorBuffer.length / THREAD_COUNTER_BYTE_LENGTH; i++) { threadCounters[i] = cursorBuffer.readUIntBE( i * THREAD_COUNTER_BYTE_LENGTH, THREAD_COUNTER_BYTE_LENGTH ) } return threadCounters } export const emptyLoadEventsResult = ( cursor: InputCursor ): StoredEventBatchPointer => { return { cursor: cursor == null ? threadArrayToCursor(initThreadArray()) : cursor, events: [], } } const calculateMaxThreadArray = ( threadArrays: Array<Array<number>> ): Array<number> => { const maxThreadArray = initThreadArray() for (const threadArray of threadArrays) { checkThreadArrayLength(threadArray) for (let i = 0; i < THREAD_COUNT; ++i) { maxThreadArray[i] = Math.max(maxThreadArray[i], threadArray[i]) } } return maxThreadArray } export const checkEventsContinuity = ( startingCursor: InputCursor, eventCursorPairs: StoredEventPointer[] ): boolean => { const startingThreadArray = cursorToThreadArray(startingCursor) const tuples = eventCursorPairs.map(({ event, cursor }) => { return { event, cursor, threadArray: cursorToThreadArray(cursor), } }) for (let i = 0; i < tuples.length; ++i) { assert.strictEqual( tuples[i].event.threadCounter, tuples[i].threadArray[tuples[i].event.threadId] - 1 ) if ( startingThreadArray[tuples[i].event.threadId] > tuples[i].event.threadCounter ) { return false } } const maxThreadArray = calculateMaxThreadArray( tuples.map((t) => t.threadArray) ) for (const t of tuples) { startingThreadArray[t.event.threadId]++ } for (let i = 0; i < THREAD_COUNT; ++i) { if (maxThreadArray[i] !== startingThreadArray[i]) { return false } } return true }
Java
--- layout: post title: Week 1 Review --- ## Weekly Review (8/30/15) It's Sunday afternoon on the 30th of August, and I've finally managed to set this Jekyll thing up, which means I can now talk about my time in the class this past week! Hooray! Besides being the only class I have on Mondays, Wednesdays, and Fridays, Object Oriented Programming is great so far. Professor Downing structures the course so that the incoming student has a background in programming, but not necessarily in C++. This is great because myself (as well as many other students in the course, I'd assume), have made it through Data Structures (CS 314, a prerequisite to the prerequisite of this class, CS 429), but have no background in the language of C++. While I'm not the biggest fan of the teaching method Prof. Downing uses (the calling out of students at random to answerom questions), the lectures he has given thus far are very interesting and in-depth, taking time to explain even the most minute things. I feel like this course will give students more than just knowledge in a new language at the end of the day; I think it'll give them a much more in-depth idea of how to approach programming problems as well as a set of tools to use during the development process that they didn't even know they had. ## Tip of the Week http://gitref.org/ Familiarizing yourself with Git and the commands associated with it will prove to be invaluable to you as you progress in your programming career. The above website is a bare-bones, to-the-point reference site that helps this process.
Java
'use strict' let ugly = require('gulp-uglify') ,gulp = require('gulp') ,watch = require('gulp-watch') ,plumber = require('gulp-plumber') ,newer = require('gulp-newer') ,stylus = require('gulp-stylus') ,jade = require('gulp-jade') ,concat = require('gulp-concat') ,rename = require('gulp-rename') ,runSequence = require('run-sequence') ,_ = require('lodash') ,path = require('path') ,fs = require('fs') ,spawn = require('cross-spawn') let cssFolder = __dirname + '/public/css' ,jsFolder = __dirname + '/public/js' ,views = __dirname + '/views' ,stylusOptions = { compress: true } ,uglyOptions = { } gulp.task('stylus', function() { gulp.src(cssFolder + '/*.styl') /* .pipe(newer({ dest: cssFolder ,map: function(path) { return path.replace(/\.styl$/, '.css') } })) */ .pipe(plumber()) .pipe(stylus(stylusOptions)) .pipe(gulp.dest(cssFolder)) }) gulp.task('ugly', function() { gulp.src(jsFolder + '/*.js') .pipe(newer({ dest: jsFolder ,map: function(path) { return path.replace(/\.dev.js$/, '.min.js') } })) .pipe(plumber()) .pipe(rename(function (path) { path.basename = path.basename.replace('.dev', '.min') })) .pipe(gulp.dest(jsFolder)) .pipe(ugly(uglyOptions)) .pipe(gulp.dest(jsFolder)) }) let config = require('./config') let pack = require('./package.json') let packj = require('./node_modules/jade-press/package.json') config.version = pack.version config.siteDesc = packj.description gulp.task('jade', function() { gulp.src(views + '/*.jade') .pipe(plumber()) .pipe(jade({ locals: config })) .pipe(gulp.dest(__dirname)) }) gulp.task('server', function (cb) { var runner = spawn( 'node' ,['server'] ,{ stdio: 'inherit' } ) runner.on('exit', function (code) { process.exit(code) }) runner.on('error', function (err) { cb(err) }) }) gulp.task('watch', function () { runSequence('server') watch([cssFolder + '/*.styl', cssFolder + '/parts/*.styl'], function() { runSequence('stylus') }) watch(jsFolder, function() { runSequence('ugly') }) watch([ views + '/*.jade' ,views + '/parts/*.jade' ], function() { runSequence('jade') } ) }) gulp.task('default', ['watch']) gulp.task('dist', function() { runSequence('stylus', 'ugly', 'jade') })
Java
<section class="user-job-wrapper"> <user-job-header></user-job-header> <div class="main-title primary" ng-show="!ctrl.hasInvoice && ctrl.showStatus"> <div class="job-owner-header"> <!-- Choose candidate --> <div ng-show="!ctrl.accepted && !ctrl.will_perform"> <h2>{{'common.you_have' | translate}} {{job_user.data.length}} {{'company.assignments.applications' | translate}}</h2> </div> <div ng-show="!ctrl.accepted && !ctrl.will_perform && job_user.data.length > 0"> <a class="button" href="#{{routes.company.job_candidates.resolve(job_obj)}}">{{'company.assignments.candidates.select.title' | translate}}</a> </div> <!-- Wait user accepted --> <div ng-show="ctrl.accepted && !ctrl.will_perform" ng-click="ctrl.gotoAcceptedCandidate()"> <h2>{{ctrl.user_apply.attributes["first-name"]}} {{'common.have' | translate}} {{ctrl.remainHours}}{{'common.hour' | translate}} {{ctrl.remainMinutes}}{{'common.min' | translate}}<br/> {{'assignment.status.user_application.time_remaining' | translate}}</h2> </div> <!-- Job ongoing --> <div ng-show="ctrl.will_perform && !ctrl.canPerformed" ng-click="ctrl.gotoAcceptedCandidate()"> <h2>{{ctrl.user_apply.attributes["first-name"]}} {{'assignment.status.applicant_approved' | translate}}</h2> </div> <!-- Job performed confirmation --> <div ng-show="(ctrl.will_perform || ctrl.performed) && ctrl.canPerformed"> <h2>{{'assignment.is_approved' | translate}}</h2> </div> <div class="buttons" ng-show="(ctrl.will_perform || ctrl.performed) && ctrl.canPerformed"> <a class="button small" href="" ng-click="ctrl.ownerCancelPerformed()">{{'common.no' | translate}}</a> <a class="button small" href="" ng-click="modalPerformShow=true; isPerformed=false;">{{'common.yes' | translate}}</a> </div> </div> </div> <div class="main-content" ng-hide="userModalPerformShow"> <ul> <li class="select"> <a href="#{{routes.company.job_comments.resolve(job_obj)}}"> <span>{{'user.assignments.comments' | translate}}</span><br/> {{comments_amt}} {{'user.assignments.comment_count' | translate}} </a> </li> <li class="select" ng-repeat="chat in ctrl.userChats.data"> <a href="" ng-click="ctrl.gotoChat(chat['job-users'].id,chat.id);"><span>{{'user.assignments.chat' | translate}}</span><br>{{'user.assignments.conversation' | translate}} {{chat.users.attributes["first-name"]}} {{chat.users.attributes["last-name"]}}</a> </li> </ul> </div> <!-- OWNER modal form performed to create invoice --> <company-job-perform></company-job-perform> </section>
Java
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.13"/> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="all_3.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">載入中...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">搜尋中...</div> <div class="SRStatus" id="NoMatches">無符合項目</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
Java
<?php require_once __DIR__.'/../../../vendor/autoload.php'; require 'templates/base.php'; session_start(); $client = new Google_Client(); $client->setApplicationName("Slide-Summarizer"); if ($credentials_file = getOAuthCredentialsFile()) { // set the location manually $client->setAuthConfig($credentials_file); $credentials_json = json_decode(file_get_contents($credentials_file)); } else { echo missingServiceAccountDetailsWarning(); return; } $client->setRedirectUri('https://' . $_SERVER['HTTP_HOST'] . '/oauth2callback'); $client->addScope(Google_Service_Drive::DRIVE_READONLY); if (! isset($_GET['code'])) { $auth_url = $client->createAuthUrl(); header('Location: ' . filter_var($auth_url, FILTER_SANITIZE_URL)); } else { $client->authenticate($_GET['code']); $_SESSION['access_token'] = $client->getAccessToken(); $redirect_uri = 'https://' . $_SERVER['HTTP_HOST'] . '/'; header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL)); }
Java
/** --------------------------------------------------------------------------- * -*- c++ -*- * @file: particlebody.cpp * * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com> * MIT License, see LICENSE file for more details. * ---------------------------------------------------------------------------- */ #include <yage/physics/particlebody.h> #include <cmath> namespace yage { ParticleBody::ParticleBody(const Vector2d &position, double mass, const Vector2d &velocity, bool gravity) : Body(position, mass, velocity, gravity) { } void ParticleBody::applyForce(const Vector2d &force) { force_ += force; } void ParticleBody::update() { // set the time_step for 60fps double time_step = 1.0 / 60.0; // set the last acceleration Vector2d last_acceleration = acceleration_; // update the position of the body position_ += velocity_ * time_step + (0.5 * last_acceleration * std::pow(time_step, 2)); // update the acceleration if (gravity_) { acceleration_ = Vector2d(force_.x() / mass_, (GRAVITY + force_.y()) / mass_); } else { acceleration_ = Vector2d(force_.x() / mass_, force_.y() / mass_); } Vector2d avg_acceleration = (acceleration_ + last_acceleration) / 2.0; // update the velocity of the body velocity_ += avg_acceleration * time_step; } } // namespace yage
Java
/******************************************************************************** ** Form generated from reading UI file 'modifystationdlg.ui' ** ** Created by: Qt User Interface Compiler version 5.7.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ #ifndef UI_MODIFYSTATIONDLG_H #define UI_MODIFYSTATIONDLG_H #include <QtCore/QVariant> #include <QtWidgets/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QButtonGroup> #include <QtWidgets/QDialog> #include <QtWidgets/QGridLayout> #include <QtWidgets/QGroupBox> #include <QtWidgets/QHBoxLayout> #include <QtWidgets/QHeaderView> #include <QtWidgets/QLabel> #include <QtWidgets/QLineEdit> #include <QtWidgets/QPushButton> #include <QtWidgets/QSpacerItem> #include <QtWidgets/QVBoxLayout> QT_BEGIN_NAMESPACE class Ui_ModifyStationDlg { public: QGridLayout *gridLayout_2; QGroupBox *groupBox; QGridLayout *gridLayout; QVBoxLayout *verticalLayout; QHBoxLayout *horizontalLayout; QLabel *label; QLineEdit *lineEdit; QHBoxLayout *horizontalLayout_2; QSpacerItem *horizontalSpacer; QPushButton *pushButton; void setupUi(QDialog *ModifyStationDlg) { if (ModifyStationDlg->objectName().isEmpty()) ModifyStationDlg->setObjectName(QStringLiteral("ModifyStationDlg")); ModifyStationDlg->resize(311, 111); gridLayout_2 = new QGridLayout(ModifyStationDlg); gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); groupBox = new QGroupBox(ModifyStationDlg); groupBox->setObjectName(QStringLiteral("groupBox")); gridLayout = new QGridLayout(groupBox); gridLayout->setObjectName(QStringLiteral("gridLayout")); verticalLayout = new QVBoxLayout(); verticalLayout->setObjectName(QStringLiteral("verticalLayout")); horizontalLayout = new QHBoxLayout(); horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); label = new QLabel(groupBox); label->setObjectName(QStringLiteral("label")); label->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); horizontalLayout->addWidget(label); lineEdit = new QLineEdit(groupBox); lineEdit->setObjectName(QStringLiteral("lineEdit")); horizontalLayout->addWidget(lineEdit); verticalLayout->addLayout(horizontalLayout); horizontalLayout_2 = new QHBoxLayout(); horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2")); horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); horizontalLayout_2->addItem(horizontalSpacer); pushButton = new QPushButton(groupBox); pushButton->setObjectName(QStringLiteral("pushButton")); horizontalLayout_2->addWidget(pushButton); verticalLayout->addLayout(horizontalLayout_2); gridLayout->addLayout(verticalLayout, 0, 0, 1, 1); gridLayout_2->addWidget(groupBox, 0, 0, 1, 1); retranslateUi(ModifyStationDlg); QMetaObject::connectSlotsByName(ModifyStationDlg); } // setupUi void retranslateUi(QDialog *ModifyStationDlg) { ModifyStationDlg->setWindowTitle(QApplication::translate("ModifyStationDlg", "ModifyStation", 0)); groupBox->setTitle(QApplication::translate("ModifyStationDlg", "GroupBox", 0)); label->setText(QApplication::translate("ModifyStationDlg", "\350\257\267\350\276\223\345\205\245\344\277\256\346\224\271\345\200\274\357\274\232", 0)); pushButton->setText(QApplication::translate("ModifyStationDlg", "\346\217\220\344\272\244", 0)); } // retranslateUi }; namespace Ui { class ModifyStationDlg: public Ui_ModifyStationDlg {}; } // namespace Ui QT_END_NAMESPACE #endif // UI_MODIFYSTATIONDLG_H
Java
package hu.autsoft.nytimes.exception; public class OkHttpException extends RuntimeException { public OkHttpException(Throwable cause) { super(cause); } }
Java
const Lib = require("../src/main"); const assert = require("assert"); describe("plain object output", function () { context("for `JSON.stringify` serializable objects", function () { it("should have resembling structure", function () { const obj1 = { a: 1, b: "b", c: true }; const res = Lib.write(obj1); const exp1 = { f: [ ["a", 1], ["b", "b"], ["c", true] ] }; assert.deepStrictEqual(res, exp1); assert.equal(Lib.stringify(obj1), JSON.stringify(res)); const obj2 = { obj1 }; const exp2 = { f: [["obj1", exp1]] }; assert.deepStrictEqual(Lib.write(obj2), exp2); assert.equal(Lib.stringify(obj2), JSON.stringify(exp2)); }); context("with `alwaysByRef: true`", function () { it("should use references environment", function () { const obj1 = { a: { a: 1 }, b: { b: "b" }, c: { c: true } }; const res = Lib.write(obj1, { alwaysByRef: true }); const exp1 = { r: 3, x: [ { f: [["c", true]] }, { f: [["b", "b"]] }, { f: [["a", 1]] }, { f: [ ["a", { r: 2 }], ["b", { r: 1 }], ["c", { r: 0 }] ] } ] }; assert.deepStrictEqual(res, exp1); const obj2 = Lib.read(res); assert.notStrictEqual(obj1, obj2); assert.deepStrictEqual(obj1, obj2); }); }); }); it("should have correct format for shared values", function () { const root = { val: "hi" }; root.rec1 = { obj1: root, obj2: root, obj3: { obj: root } }; root.rec2 = root; assert.deepStrictEqual(Lib.write(root), { r: 0, x: [ { f: [ ["val", "hi"], [ "rec1", { f: [ ["obj1", { r: 0 }], ["obj2", { r: 0 }], ["obj3", { f: [["obj", { r: 0 }]] }] ] } ], ["rec2", { r: 0 }] ] } ] }); }); }); describe("special values", function () { it("should correctly restore them", function () { const root = { undef: undefined, nul: null, nan: NaN }; const res = Lib.write(root); assert.deepStrictEqual(res, { f: [ ["undef", { $: "undefined" }], ["nul", null], ["nan", { $: "NaN" }] ] }); const { undef, nul, nan } = Lib.read(res); assert.strictEqual(undef, undefined); assert.strictEqual(nul, null); assert.ok(typeof nan === "number" && Number.isNaN(nan)); }); }); describe("reading plain object", function () { it("should correctly assign shared values", function () { const obj = Lib.read({ r: 0, x: [ { f: [ ["val", "hi"], [ "rec1", { f: [ ["obj1", { r: 0 }], ["obj2", { r: 0 }], ["obj3", { f: [["obj", { r: 0 }]] }] ] } ], ["rec2", { r: 0 }] ] } ] }); assert.strictEqual(Object.keys(obj).sort().join(), "rec1,rec2,val"); assert.strictEqual(obj.val, "hi"); assert.strictEqual(Object.keys(obj.rec1).sort().join(), "obj1,obj2,obj3"); assert.strictEqual(Object.keys(obj.rec1.obj3).sort().join(), "obj"); assert.strictEqual(obj.rec2, obj); assert.strictEqual(obj.rec1.obj1, obj); assert.strictEqual(obj.rec1.obj2, obj); assert.strictEqual(obj.rec1.obj3.obj, obj); }); }); describe("object with parent", function () { function MyObj() { this.a = 1; this.b = "b"; this.c = true; } Lib.regConstructor(MyObj); it("should output `$` attribute", function () { const obj1 = new MyObj(); assert.deepEqual(Lib.write(obj1), { $: "MyObj", f: [ ["a", 1], ["b", "b"], ["c", true] ] }); function Object() { this.a = obj1; } Lib.regConstructor(Object); assert.deepEqual(Lib.write(new Object()), { $: "Object_1", f: [ [ "a", { f: [ ["a", 1], ["b", "b"], ["c", true] ], $: "MyObj" } ] ] }); }); it("should use `$` attribute to resolve a type on read", function () { const obj1 = Lib.read({ $: "MyObj", f: [ ["a", 1], ["b", "b"], ["c", true] ] }); assert.strictEqual(obj1.constructor, MyObj); assert.equal(Object.keys(obj1).sort().join(), "a,b,c"); assert.strictEqual(obj1.a, 1); assert.strictEqual(obj1.b, "b"); assert.strictEqual(obj1.c, true); }); context("for shared values", function () { function Obj2() {} Lib.regConstructor(Obj2); it("should write shared values in `shared` map", function () { const root = new Obj2(); root.l1 = new Obj2(); root.l1.back = root.l1; assert.deepStrictEqual(Lib.write(root), { f: [["l1", { r: 0 }]], $: "Obj2", x: [{ f: [["back", { r: 0 }]], $: "Obj2" }] }); }); it("should use `#shared` keys to resolve prototypes on read", function () { const obj1 = Lib.read({ f: [["l1", { r: 0 }]], $: "Obj2", x: [{ f: [["back", { r: 0 }]], $: "Obj2" }] }); assert.strictEqual(obj1.constructor, Obj2); assert.deepEqual(Object.keys(obj1), ["l1"]); assert.deepEqual(Object.keys(obj1.l1), ["back"]); assert.strictEqual(obj1.l1.constructor, Obj2); assert.strictEqual(obj1.l1.back, obj1.l1); }); }); }); describe("prototypes chain", function () { it("should correctly store and recover all references", function () { class C1 { constructor(p) { this.p1 = p; } } class C2 extends C1 { constructor() { super("A"); this.c1 = new C1(this); } } Lib.regOpaqueObject(C1.prototype, "C1"); Lib.regOpaqueObject(C2.prototype, "C2"); const obj = new C2(); C1.prototype.p_prop_1 = "prop_1"; const res = Lib.write(obj); C1.prototype.p_prop_1 = "changed"; assert.deepEqual(res, { r: 0, x: [ { p: { $: "C2" }, f: [ ["p1", "A"], [ "c1", { p: { $: "C1", f: [["p_prop_1", "prop_1"]] }, f: [["p1", { r: 0 }]] } ] ] } ] }); const r2 = Lib.read(res); assert.ok(r2 instanceof C1); assert.ok(r2 instanceof C2); assert.strictEqual(r2.constructor, C2); assert.strictEqual(Object.getPrototypeOf(r2).constructor, C2); assert.strictEqual(r2.c1.constructor, C1); assert.strictEqual(r2.c1.p1, r2); assert.equal(r2.p1, "A"); assert.strictEqual(C1.prototype.p_prop_1, "prop_1"); class C3 { constructor(val) { this.a = val; } } Lib.regOpaqueObject(C3.prototype, "C3", { props: false }); class C4 extends C3 { constructor() { super("A"); this.b = "B"; } } Lib.regOpaqueObject(C4.prototype, "C4"); const obj2 = new C4(); const res2 = Lib.write(obj2); assert.deepEqual(res2, { p: { $: "C4" }, f: [ ["a", "A"], ["b", "B"] ] }); const obj3 = Lib.read(res2); assert.ok(obj3 instanceof C3); assert.ok(obj3 instanceof C4); assert.equal(obj3.a, "A"); assert.equal(obj3.b, "B"); assert.equal( Object.getPrototypeOf(Object.getPrototypeOf(obj3)), Object.getPrototypeOf(Object.getPrototypeOf(obj2)) ); }); }); describe("property's descriptor", function () { it("should correctly store and recover all settings", function () { const a = {}; let setCalled = 0; let getCalled = 0; let back; let val; const descr = { set(value) { assert.strictEqual(this, back); setCalled++; val = value; }, get() { assert.strictEqual(this, back); getCalled++; return a; } }; Object.defineProperty(a, "prop", descr); const psym1 = Symbol("prop"); const psym2 = Symbol("prop"); Object.defineProperty(a, psym1, { value: "B", enumerable: true }); Object.defineProperty(a, psym2, { value: "C", configurable: true }); Object.defineProperty(a, Symbol.for("prop"), { value: "D", writable: true }); Lib.regOpaqueObject(descr.set, "dset"); Lib.regOpaqueObject(descr.get, "dget"); const opts = { symsByName: new Map() }; const res = Lib.write(a, opts); assert.deepEqual(res, { f: [ ["prop", null, 15, { $: "dget" }, { $: "dset" }], [{ name: "prop" }, "B", 5], [{ name: "prop", id: 1 }, "C", 6], [{ key: "prop" }, "D", 3] ] }); back = Lib.read(res, opts); assert.deepEqual(Object.getOwnPropertySymbols(back), [ psym1, psym2, Symbol.for("prop") ]); assert.strictEqual(setCalled, 0); assert.strictEqual(getCalled, 0); back.prop = "A"; assert.strictEqual(setCalled, 1); assert.strictEqual(getCalled, 0); assert.strictEqual(val, "A"); assert.strictEqual(back.prop, a); assert.strictEqual( Object.getOwnPropertyDescriptor(back, Symbol("prop")), void 0 ); assert.deepEqual(Object.getOwnPropertyDescriptor(back, "prop"), { enumerable: false, configurable: false, ...descr }); assert.deepEqual(Object.getOwnPropertyDescriptor(back, psym1), { value: "B", writable: false, enumerable: true, configurable: false }); assert.deepEqual(Object.getOwnPropertyDescriptor(back, psym2), { value: "C", writable: false, enumerable: false, configurable: true }); assert.deepEqual( Object.getOwnPropertyDescriptor(back, Symbol.for("prop")), { value: "D", writable: true, enumerable: false, configurable: false } ); }); }); describe("arrays serialization", function () { context("without shared references", function () { it("should be similar to `JSON.stringify`/`JSON.parse`", function () { const obj = { arr: [1, "a", [true, [false, null]], undefined] }; const res = Lib.write(obj); assert.deepStrictEqual(res, { f: [["arr", [1, "a", [true, [false, null]], { $: "undefined" }]]] }); const back = Lib.read(res); assert.deepStrictEqual(obj, back); }); it("doesn't support Array as root", function () { assert.throws(() => Lib.write([1, 2]), TypeError); }); }); it("should handle shared references", function () { const obj = { arr: [1, "a", [true, [false, null]], undefined] }; obj.arr.push(obj.arr); const res = Lib.write(obj); assert.notStrictEqual(res, obj); assert.deepStrictEqual(res, { f: [["arr", { r: 0 }]], x: [[1, "a", [true, [false, null]], { $: "undefined" }, { r: 0 }]] }); const back = Lib.read(res); assert.notStrictEqual(res, back); assert.deepStrictEqual(obj, back); }); }); describe("`Set` serialization", function () { context("without shared references", function () { it("should output `JSON.stringify` serializable object", function () { const arr = [1, "a", [true, [false, null]], undefined]; const obj = { set: new Set(arr) }; obj.set.someNum = 100; obj.set.self = obj.set; const res = Lib.write(obj); assert.deepStrictEqual(res, { f: [["set", { r: 0 }]], x: [ { $: "Set", l: [1, "a", [true, [false, null]], { $: "undefined" }], f: [ ["someNum", 100], ["self", { r: 0 }] ] } ] }); const back = Lib.read(res); assert.deepStrictEqual(obj, back); }); }); it("should handle shared references", function () { const obj = new Set([1, "a", [true, [false, null]], undefined]); obj.add(obj); const res = Lib.write(obj); assert.notStrictEqual(res, obj); assert.deepStrictEqual(res, { r: 0, x: [ { $: "Set", l: [1, "a", [true, [false, null]], { $: "undefined" }, { r: 0 }] } ] }); const back = Lib.read(res); assert.notStrictEqual(res, back); assert.deepStrictEqual(obj, back); }); }); describe("`Map` serialization", function () { context("without shared references", function () { it("should output `JSON.stringify` serializable object", function () { const arr = [[1, "a"], [true, [false, null]], [undefined]]; const obj = { map: new Map(arr) }; const res = Lib.write(obj); assert.deepStrictEqual(res, { f: [ [ "map", { $: "Map", k: [1, true, { $: "undefined" }], v: ["a", [false, null], { $: "undefined" }] } ] ] }); const back = Lib.read(res); assert.deepStrictEqual(obj, back); }); }); it("should handle shared references", function () { const obj = new Map([[1, "a"], [true, [false, null]], [undefined]]); obj.set(obj, obj); const res = Lib.write(obj); assert.notStrictEqual(res, obj); assert.deepStrictEqual(res, { r: 0, x: [ { $: "Map", k: [1, true, { $: "undefined" }, { r: 0 }], v: ["a", [false, null], { $: "undefined" }, { r: 0 }] } ] }); const back = Lib.read(res); assert.notStrictEqual(res, back); assert.deepStrictEqual(obj, back); }); }); describe("opaque objects serialization", function () { it("should throw for not registered objects", function () { function a() {} assert.throws(() => Lib.write({ a }), TypeError); }); it("should not throw if `ignore:true`", function () { function a() {} assert.deepStrictEqual(Lib.write({ a }, { ignore: true }), {}); }); it("should output object's name if registered", function () { function a() {} Lib.regOpaqueObject(a); assert.deepStrictEqual(Lib.write({ a }), { f: [["a", { $: "a" }]] }); Lib.regOpaqueObject(a); assert.deepStrictEqual(Lib.read({ f: [["a", { $: "a" }]] }), { a }); (function () { function a() {} Lib.regOpaqueObject(a); assert.deepStrictEqual(Lib.write({ a }), { f: [["a", { $: "a_1" }]] }); assert.deepStrictEqual(Lib.read({ f: [["a", { $: "a_1" }]] }), { a }); })(); }); it("should not serialize properties specified before its registration", function () { const obj = { prop1: "p1", [Symbol.for("sym#a")]: "s1", [Symbol.for("sym#b")]: "s2", prop2: "p2", [3]: "N3", [4]: "N4" }; Lib.regOpaqueObject(obj, "A"); obj.prop1 = "P2"; obj.prop3 = "p3"; obj[Symbol.for("sym#a")] = "S1"; obj[Symbol.for("sym#c")] = "s3"; obj[4] = "n4"; obj[5] = "n5"; assert.deepStrictEqual(Lib.write({ obj }), { f: [ [ "obj", { $: "A", f: [ ["4", "n4"], ["5", "n5"], ["prop1", "P2"], ["prop3", "p3"], [ { key: "sym#a" }, "S1" ], [ { key: "sym#c" }, "s3" ] ] } ] ] }); }); }); describe("opaque primitive value serialization", function () { it("should output object's name if registered", function () { const a = Symbol("a"); Lib.regOpaquePrim(a, "sa"); assert.ok(!a[Lib.descriptorSymbol]); assert.deepStrictEqual(Lib.write({ a }), { f: [["a", { $: "sa" }]] }); Lib.regOpaquePrim(a, "sb"); assert.deepStrictEqual(Lib.read({ f: [["a", { $: "sa" }]] }), { a }); (function () { const a = Symbol("a"); Lib.regOpaquePrim(a, "sa"); assert.deepStrictEqual(Lib.write({ a }), { f: [["a", { $: "sa_1" }]] }); assert.deepStrictEqual(Lib.read({ f: [["a", { $: "sa_1" }]] }), { a }); })(); }); }); describe("Symbols serialization", function () { it("should keep values", function () { const a1 = Symbol("a"); const a2 = Symbol("a"); const b = Symbol("b"); const g = Symbol.for("g"); const opts = { symsByName: new Map() }; const res = Lib.write({ a1, a2, b1: b, b2: b, g }, opts); assert.deepStrictEqual(res, { f: [ ["a1", { name: "a", $: "Symbol" }], ["a2", { name: "a", id: 1, $: "Symbol" }], ["b1", { name: "b", $: "Symbol" }], ["b2", { name: "b", $: "Symbol" }], ["g", { key: "g", $: "Symbol" }] ] }); const { a1: ra1, a2: ra2, b1: rb1, b2: rb2, g: rg } = Lib.read(res, opts); assert.strictEqual(a1, ra1); assert.strictEqual(a2, ra2); assert.strictEqual(b, rb1); assert.strictEqual(b, rb2); assert.strictEqual(rg, g); const { a1: la1, a2: la2, b1: lb1, b2: lb2, g: lg } = Lib.read(res, { ignore: true }); assert.notStrictEqual(a1, la1); assert.notStrictEqual(a2, la2); assert.notStrictEqual(lb1, b); assert.notStrictEqual(lb2, b); assert.strictEqual(lg, g); assert.strictEqual(lb1, lb2); assert.equal(String(la1), "Symbol(a)"); assert.equal(String(la2), "Symbol(a)"); assert.equal(String(lb1), "Symbol(b)"); assert.equal(String(lb2), "Symbol(b)"); }); }); describe("type with `$$typeof` attribute", function () { Lib.regDescriptor({ name: "hundred", typeofTag: 100, read(ctx, json) { return { $$typeof: 100 }; }, write(ctx, value) { return { $: "hundred" }; }, props: false }); it("should use overriden methods", function () { assert.deepStrictEqual(Lib.write({ $$typeof: 100 }), { $: "hundred" }); assert.deepStrictEqual(Lib.read({ $: "hundred" }), { $$typeof: 100 }); }); }); describe("bind function arguments", function () { it("should be serializable", function () { const obj = {}; function f1(a1, a2, a3) { return [this, a1, a2, a3]; } const a1 = {}, a2 = {}, a3 = {}; Lib.regOpaqueObject(obj, "obj"); Lib.regOpaqueObject(f1); Lib.regOpaqueObject(a1, "arg"); Lib.regOpaqueObject(a2, "arg"); const bind = Lib.bind(f1, obj, a1, a2); bind.someNum = 100; bind.rec = bind; const fjson = Lib.write({ f: bind }); assert.deepStrictEqual(fjson, { f: [ [ "f", { r: 0 } ] ], x: [ { f: [ ["someNum", 100], [ "rec", { r: 0 } ], [ { $: "#this" }, { $: "obj" } ], [ { $: "#fun" }, { $: "f1" } ], [ { $: "#args" }, [ { $: "arg" }, { $: "arg_1" } ] ] ], $: "Bind" } ] }); const f2 = Lib.read(fjson).f; assert.notStrictEqual(f1, f2); const res = f2(a3); assert.strictEqual(res.length, 4); const [robj, ra1, ra2, ra3] = res; assert.strictEqual(obj, robj); assert.strictEqual(a1, ra1); assert.strictEqual(a2, ra2); assert.strictEqual(a3, ra3); }); }); describe("RegExp", function () { it("should be serializable", function () { const re1 = /\w+/; const re2 = /ho/g; const s1 = "uho-ho-ho"; re2.test(s1); const res = Lib.write({ re1, re2 }); assert.deepEqual(res, { f: [ ["re1", { src: "\\w+", flags: "", $: "RegExp" }], ["re2", { src: "ho", flags: "g", last: 3, $: "RegExp" }] ] }); const { re1: bre1, re2: bre2 } = Lib.read(res); assert.equal(re1.src, bre1.src); assert.equal(re1.flags, bre1.flags); assert.equal(re1.lastIndex, bre1.lastIndex); assert.equal(re2.src, bre2.src); assert.equal(re2.flags, bre2.flags); assert.equal(re2.lastIndex, bre2.lastIndex); }); }); describe("not serializable values", function () { it("should throw an exception if `ignore:falsy`", function () { function A() {} try { Lib.write({ A }); } catch (e) { assert.equal(e.constructor, TypeError); assert.equal( e.message, `not serializable value "function A() {}" at "1"(A) of "A"` ); return; } assert.fail("should throw"); }); it("should be ignored if `ignore:true`", function () { function A() {} const d = Lib.write({ A }, { ignore: true }); const r = Lib.read(d); assert.deepEqual(r, {}); }); it('should register an opaque descriptor `ignore:"opaque"`', function () { function A() {} const d = Lib.write({ A, b: A }, { ignore: "opaque" }); const r = Lib.read(d); assert.deepEqual(r, { A, b: A }); }); it("should register an opaque descriptor with auto-opaque descriptor", function () { function A() {} Lib.regAutoOpaqueConstr(A, true); const a = new A(); const d = Lib.write({ a, b: a }, { ignore: "opaque" }); const r = Lib.read(d); assert.deepEqual(r, { a, b: a }); }); it('should be converted into a not usable placeholder if `ignore:"placeholder"`', function () { function A() {} const d = Lib.write({ A }, { ignore: "placeholder" }); const r = Lib.read(d); try { r.A(); } catch (e) { assert.equal(e.constructor, TypeError); assert.equal(e.message, "apply in a not restored object"); return; } assert.fail("should throw"); }); }); describe("TypedArray", function () { it("should be serializable", function () { const arr1 = new Int32Array([1, 2, 3, 4, 5]); const arr2 = new Uint32Array(arr1.buffer, 8); const d = Lib.write({ arr1, arr2 }, {}); assert.deepStrictEqual(d, { f: [ [ "arr1", { o: 0, l: 5, b: { r: 0 }, $: "Int32Array" } ], [ "arr2", { o: 8, l: 3, b: { r: 0 }, $: "Uint32Array" } ] ], x: [ { d: "AQAAAAIAAAADAAAABAAAAAUAAAA=", $: "ArrayBuffer" } ] }); const { arr1: rarr1, arr2: rarr2 } = Lib.read(d); assert.equal(rarr1.constructor, Int32Array); assert.equal(rarr2.constructor, Uint32Array); assert.notStrictEqual(arr1, rarr1); assert.notStrictEqual(arr2, rarr2); assert.deepStrictEqual(arr1, rarr1); assert.deepStrictEqual(arr2, rarr2); }); }); describe("WeakSet/WeakMap", function () { it("should be serializable", function () { const set = new WeakSet(); const map = new WeakMap(); const map2 = new WeakMap(); const obj1 = {}; const obj2 = {}; Lib.regOpaqueObject(obj1, "w#obj1"); set.add(obj1).add(obj2); map.set(obj1, "obj1").set(obj2, "obj2"); map2.set(obj1, "2obj1"); assert.ok(set.has(obj1)); assert.ok(map.has(obj1)); assert.strictEqual(map.get(obj1), "obj1"); assert.strictEqual(map.get({}), void 0); const d = Lib.write({ set, map, map2, obj1, obj2 }); assert.deepStrictEqual(d, { x: [{}, { $: "w#obj1" }], f: [ ["set", { v: [{ r: 0 }, { r: 1 }], $: "WeakSet" }], [ "map", { k: [{ r: 1 }, { r: 0 }], v: ["obj1", "obj2"], $: "WeakMap" } ], [ "map2", { k: [{ r: 1 }], v: ["2obj1"], $: "WeakMap" } ], ["obj1", { r: 1 }], ["obj2", { r: 0 }] ] }); const { set: rset, map: rmap, map2: rmap2, obj1: robj1, obj2: robj2 } = Lib.read(d); assert.strictEqual(robj1, obj1); assert.notStrictEqual(robj2, obj2); assert.ok(rset.has(obj1)); assert.ok(set.delete(obj1)); assert.ok(!set.has(obj1)); assert.ok(rset.has(obj1)); assert.ok(rset.has(robj2)); assert.ok(!rset.has(obj2)); assert.ok(!set.has(robj2)); assert.strictEqual(rmap.get(obj1), "obj1"); assert.strictEqual(rmap2.get(obj1), "2obj1"); assert.ok(map.delete(obj1)); assert.strictEqual(rmap.get(obj1), "obj1"); assert.ok(rset.delete(robj2)); assert.ok(!rset.has(robj2)); assert.ok(!rset.delete(robj2)); assert.ok(!rset.has(robj2)); }); }); describe("WeakSet/WeakMap workaround", function () { it("should be serializable", function () { const set = new Lib.WeakSetWorkaround(); const map = new Lib.WeakMapWorkaround(); const map2 = new Lib.WeakMapWorkaround(); const obj1 = {}; const obj2 = {}; Lib.regOpaqueObject(obj1, "w##obj1"); set.add(obj1).add(obj2); map.set(obj1, "obj1").set(obj2, "obj2"); map2.set(obj1, "2obj1"); assert.ok(set.has(obj1)); assert.ok(map.has(obj1)); assert.strictEqual(map.get(obj1), "obj1"); assert.strictEqual(map.get({}), void 0); const d = Lib.write({ set, map, map2, obj1, obj2 }); assert.deepStrictEqual(d, { f: [ [ "set", { f: [["prop", { name: "@effectful/weakset", $: "Symbol" }]], $: "WeakSet#" } ], [ "map", { f: [["prop", { name: "@effectful/weakmap", $: "Symbol" }]], $: "WeakMap#" } ], [ "map2", { f: [["prop", { name: "@effectful/weakmap", id: 1, $: "Symbol" }]], $: "WeakMap#" } ], [ "obj1", { $: "w##obj1", f: [ [{ name: "@effectful/weakset" }, true, 2], [{ name: "@effectful/weakmap" }, "obj1", 2], [{ name: "@effectful/weakmap", id: 1 }, "2obj1", 2] ] } ], [ "obj2", { f: [ [{ name: "@effectful/weakset" }, true, 2], [{ name: "@effectful/weakmap" }, "obj2", 2] ] } ] ] }); const { set: rset, map: rmap, map2: rmap2, obj1: robj1, obj2: robj2 } = Lib.read(d); assert.strictEqual(robj1, obj1); assert.notStrictEqual(robj2, obj2); assert.ok(rset.has(obj1)); assert.ok(set.delete(obj1)); assert.ok(!set.has(obj1)); assert.ok(rset.has(obj1)); assert.ok(rset.has(robj2)); assert.ok(!rset.has(obj2)); assert.ok(!set.has(robj2)); assert.strictEqual(rmap.get(obj1), "obj1"); assert.strictEqual(rmap2.get(obj1), "2obj1"); assert.ok(map.delete(obj1)); assert.strictEqual(rmap.get(obj1), "obj1"); assert.ok(rset.delete(robj2)); assert.ok(!rset.has(robj2)); assert.ok(!rset.delete(robj2)); assert.ok(!rset.has(robj2)); }); }); describe("BigInt", function () { it("should be serializable", function () { const num = 2n ** 10000n; const doc = Lib.write({ num }); assert.equal(doc.f[0][0], "num"); assert.ok(doc.f[0][1].int.substr); assert.equal(doc.f[0][1].int.length, 3011); assert.strictEqual(Lib.read(doc).num, num); }); });
Java
#include "GameCtrl.h" char title[16][30]= { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,1,1,1,1,1,0,1,0,0,0,1,0,0,1,1,0,0,0,1,0,0,1,0,1,1,1,1,1,0}, {0,1,0,0,0,0,0,1,1,0,0,1,0,1,0,0,1,0,0,1,0,1,0,0,1,0,0,0,0,0}, {0,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,0,0,1,1,0,0,0,1,1,1,1,1,0}, {0,0,0,0,0,1,0,1,0,0,1,1,0,1,0,0,1,0,0,1,0,1,0,0,1,0,0,0,0,0}, {0,1,1,1,1,1,0,1,0,0,0,1,0,1,0,0,1,0,0,1,0,0,1,0,1,1,1,1,1,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,1,1,1,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,1,1,1,1,1,0}, {0,0,1,0,0,0,0,0,0,1,0,0,1,0,0,1,1,0,0,0,1,1,0,0,1,0,0,0,0,0}, {0,0,1,0,0,1,1,0,0,1,1,1,1,0,0,1,0,1,0,1,0,1,0,0,1,1,1,1,1,0}, {0,0,1,1,1,1,1,0,0,1,0,0,1,0,0,1,0,1,0,1,0,1,0,0,1,0,0,0,0,0}, {0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,1,1,1,1,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} }; int main() { int menu = 0; for(int x=0;x<16;x++){ printf("\t"); for(int y=0;y<30;y++){ if(title[x][y] == 1){ printf("¡á"); } if(title[x][y] == 0){ printf("¡à"); } } printf("\n"); } printf("\n"); printf("\t\t\t\t<MENU>\n"); printf("\t\t\t 1.Snake Game(Manual Mode)\n"); printf("\t\t\t 2.See How to find Shortest Path\n"); printf("\t\t\t 3.See How to find Longest Path\n"); printf("\t\t\t 4.AI Hamiltonian Cycle\n"); printf("\t\t\t 5.AI Graph Search\n"); printf("\t\t\t 6.Exit\n"); printf("\t\t\t =>Input Menu Number : "); scanf("%d",&menu); auto game = GameCtrl::getInstance(0); // Set FPS. Default is 60.0 game->setFPS(60.0); // Set the interval time between each snake's movement. Default is 30 ms. // To play classic snake game, set to 150 ms is perfect. game->setMoveInterval(150); // Set whether to record the snake's movements to file. Default is true. // The movements will be written to a file named "movements.txt". game->setRecordMovements(true); // Set map's size(including boundaries). Default is 10*10. Minimum is 5*5. game->setMapRow(10); game->setMapCol(10); if(menu==1){ //Snake Game // Set whether to enable the snake AI. Default is true. game->setEnableAI(false); // Set whether to use a hamiltonian cycle to guide the AI. Default is true. game->setEnableHamilton(true); // Set whether to run the test program. Default is false. // You can select different testing methods by modifying GameCtrl::test(). game->setRunTest(false); } else if(menu==2){ //Shortest Path game->setEnableAI(false); game->setEnableHamilton(true); game->setRunTest(true); game->setMapRow(20); game->setMapCol(20); } else if(menu==3){ //Longest Path auto game = GameCtrl::getInstance(1); game->setEnableAI(false); game->setEnableHamilton(true); game->setRunTest(true); game->setMapRow(20); game->setMapCol(20); } else if(menu==4){ //Hamiltonian Cycle game->setEnableAI(true); game->setEnableHamilton(true); game->setRunTest(false); } else if(menu==5){ //AI game->setEnableAI(true); game->setEnableHamilton(false); game->setRunTest(false); } else return 0; return game->run(); }
Java
require 'simplecov' $VERBOSE = nil #FIXME SimpleCov.start require 'minitest/autorun' require 'minitest/pride' require_relative '../lib/cw' class TestNumbers < MiniTest::Test ROOT = File.expand_path File.dirname(__FILE__) + '/../' def setup @dsl = CW::Dsl.new end def teardown @dsl = nil end def test_words_returns_words words = @dsl.words assert words.is_a? Array assert_equal 1000, words.size assert_equal 'the', words.first end def test_load_common_words_returns_words words = @dsl.load_common_words assert words.is_a? Array assert_equal 1000, words.size assert_equal 'the', words.first end def test_most_load_most_common_words_returns_words words = @dsl.load_most_common_words assert words.is_a? Array assert_equal 500, words.size assert_equal 'the', words.first end def test_load_abbreviations words = @dsl.load_abbreviations assert words.is_a? Array assert_equal 85, words.size assert_equal 'abt', words.first end def test_reverse @dsl.words = %w[a b c] assert_equal CW::Dsl, @dsl.class @dsl.reverse assert_equal 'c', @dsl.words.first end def test_double_words @dsl.words = %w[a b] @dsl.double_words assert_equal %w[a a b b], @dsl.words end def test_letters_numbers assert_equal %w[a b c d e], @dsl.letters_numbers[0..4] assert_equal %w[y z], @dsl.words[24..25] assert_equal %w[0 1], @dsl.words[26..27] assert_equal %w[8 9], @dsl.words[34..35] end def test_random_numbers @dsl.random_numbers assert_equal Array, @dsl.words.class assert_equal 50, @dsl.words.size @dsl.words.each do |wrd| assert wrd.size == 4 assert wrd.to_i > 0 assert wrd.to_i < 10000 end end def test_random_letters @dsl.random_letters assert_equal Array, @dsl.words.class assert_equal 50, @dsl.words.size @dsl.words.each do |wrd| assert wrd.size == 4 end end def test_random_letters_numbers @dsl.random_letters_numbers assert_equal Array, @dsl.words.class assert_equal 50, @dsl.words.size @dsl.words.each do |wrd| assert wrd.size == 4 end end def test_alphabet @dsl.alphabet assert_equal ["a b c d e f g h i j k l m n o p q r s t u v w x y z"], @dsl.words end def test_numbers assert_equal ['0', '1', '2', '3', '4'], @dsl.numbers[0..4] end end
Java
package se.leiflandia.lroi.utils; import android.accounts.Account; import android.accounts.AccountManager; import android.content.Context; import android.content.SharedPreferences; import android.text.TextUtils; import se.leiflandia.lroi.auth.model.AccessToken; import se.leiflandia.lroi.auth.model.UserCredentials; public class AuthUtils { private static final String PREF_ACTIVE_ACCOUNT = "active_account"; private static final String PREFS_NAME = "se.leiflandia.lroi.prefs"; public static void removeActiveAccount(Context context, String accountType) { Account account = getActiveAccount(context, accountType); if (account != null) { AccountManager.get(context).removeAccount(account, null, null); } setActiveAccountName(context, null); } public static Account getActiveAccount(final Context context, final String accountType) { Account[] accounts = AccountManager.get(context).getAccountsByType(accountType); return getActiveAccount(accounts, getActiveAccountName(context)); } public static boolean hasActiveAccount(final Context context, final String accountType) { return getActiveAccount(context, accountType) != null; } private static String getActiveAccountName(final Context context) { return getSharedPreferences(context) .getString(PREF_ACTIVE_ACCOUNT, null); } public static void setActiveAccountName(final Context context, final String name) { getSharedPreferences(context).edit() .putString(PREF_ACTIVE_ACCOUNT, name) .commit(); } private static Account getActiveAccount(final Account[] accounts, final String activeAccountName) { for (Account account : accounts) { if (TextUtils.equals(account.name, activeAccountName)) { return account; } } return null; } private static SharedPreferences getSharedPreferences(final Context context) { return context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE); } /** * Saves an authorized account in account manager and set as active account. */ public static void setAuthorizedAccount(Context context, UserCredentials credentials, AccessToken token, String authtokenType, String accountType) { final AccountManager accountManager = AccountManager.get(context); Account account = findOrCreateAccount(accountManager, credentials.getUsername(), token.getRefreshToken(), accountType); accountManager.setAuthToken(account, authtokenType, token.getAccessToken()); setActiveAccountName(context, account.name); } /** * Sets password of account, creates a new account if necessary. */ private static Account findOrCreateAccount(AccountManager accountManager, String username, String refreshToken, String accountType) { for (Account account : accountManager.getAccountsByType(accountType)) { if (account.name.equals(username)) { accountManager.setPassword(account, refreshToken); return account; } } Account account = new Account(username, accountType); accountManager.addAccountExplicitly(account, refreshToken, null); return account; } }
Java
/* Copyright (C) 2001-2015 Peter Selinger. This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ #ifndef BACKEND_GEO_H #define BACKEND_GEO_H #include "potracelib.h" int page_geojson(FILE *fout, potrace_path_t *plist, int as_polygons); #endif /* BACKEND_GEO_H */
Java
docker run -d \ --name=sickbeard \ -v $(pwd)/data:/data \ -v $(pwd)/config/config.ini:/app/config.ini \ -p 8081:8081 \ chamunks/alpine-sickbeard-arm:latest
Java
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Xml.Linq; using Reportz.Scripting.Attributes; using Reportz.Scripting.Classes; using Reportz.Scripting.Interfaces; namespace Reportz.Scripting.Commands { [ScriptElementAlias("execute-script")] public class ExecuteScriptCommand : IExecutable, IScriptElement { private IScriptParser _instantiator; private XElement _element; private ArgCollection _argsCollection; private EventCollection _eventsCollection; public ExecuteScriptCommand() { } public string ScriptName { get; private set; } public IExecutableResult Execute(IExecutableArgs args) { IExecutableResult result = null; args = args ?? new ExecutableArgs { Scope = new VariableScope() }; try { var ctx = args?.Scope.GetScriptContext(); var scriptName = args?.Arguments?.FirstOrDefault(x => x.Key == "scriptName")?.Value?.ToString(); scriptName = scriptName ?? ScriptName; if (string.IsNullOrWhiteSpace(scriptName)) throw new Exception($"Invalid script name."); var script = ctx?.ScriptScope?.GetScript(scriptName); if (script == null) throw new Exception($"Could not get script '{scriptName}'. "); var scriptArgs = new ExecutableArgs(); scriptArgs.Scope = args.Scope.CreateChild(); //scriptArgs.Arguments = _argsCollection?._vars?.Values?.ToArray(); var scriptArgVars = _argsCollection?._vars?.Values?.ToArray(); if (scriptArgVars != null) { foreach (var scriptVar in scriptArgVars) { var r = scriptVar.Execute(scriptArgs); } } result = script.Execute(scriptArgs); return result; } catch (Exception ex) { IEvent errorEvent; if (_eventsCollection._events.TryGetValue("error", out errorEvent) && errorEvent != null) { var exceptionVar = new Variable { Key = "$$Exception", Value = ex, }; args.Scope?.SetVariable(exceptionVar); errorEvent.Execute(args); } return result; // todo: implement 'catch' logic. catch="true" on <event key="error">. Or only if wrapped inside <try> <catch> // todo: implement test <throw> tag //throw; } finally { IEvent completeEvent; if (_eventsCollection._events.TryGetValue("complete", out completeEvent) && completeEvent != null) { var resultVar = new Variable { Key = "$$Result", Value = result?.Result, }; args.Scope?.SetVariable(resultVar); completeEvent.Execute(args); } } } public void Configure(IScriptParser parser, XElement element) { _instantiator = parser; _element = element; ScriptName = element?.Attribute("scriptName")?.Value ?? element?.Attribute("name")?.Value; var argsElem = element?.Element("arguments"); if (argsElem != null) { var arg = new ArgCollection(); arg.Configure(parser, argsElem); _argsCollection = arg; } var eventsElem = element?.Element("events"); if (eventsElem != null) { var events = new EventCollection(); events.Configure(parser, eventsElem); _eventsCollection = events; } } } }
Java
(function () { 'use strict'; angular .module('crimes.routes') .config(routeConfig); routeConfig.$inject = ['$stateProvider']; function routeConfig($stateProvider) { $stateProvider .state('crimes', { abstract: true, url: '/crimes', template: '<ui-view/>' }) .state('crimes.list', { url: '', templateUrl: '/modules/crimes/client/views/list-crimes.client.view.html', controller: 'CrimesListController', controllerAs: 'vm', data: { pageTitle: 'Crimes List' } }) .state('crimes.view', { url: '/:crimeId', templateUrl: '/modules/crimes/client/views/view-crimes.client.view.html', controller: 'CrimesController', controllerAs: 'vm', resolve: { crimeResolve: getCrime }, data: { pageTitle: 'Crimes {{ crimeResolve.title }}' } }); } getCrime.$inject = ['$stateParams', 'CrimesService']; function getCrime($stateParams, CrimesService) { return CrimesService.get({ crimeId: $stateParams.crimeId }).$promise; } }());
Java
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSObject.h" // Not exported @interface GQDWPColumn : NSObject { long long mIndex; float mWidth; float mSpacing; _Bool mHasSpacing; } + (const struct StateSpec *)stateForReading; - (float)spacing; - (_Bool)hasSpacing; - (float)width; - (long long)index; - (int)readAttributesFromReader:(struct _xmlTextReader *)arg1; @end
Java
// // AppDelegate.h // discovery // // Created by Karthik Rao on 1/20/17. // Copyright © 2017 Karthik Rao. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
Java
<?php if( $kind = ic_get_post( 'kind' ) ) { if( $kind == 'c' || $kind == 'cod' ) { $sym = '#'; $kind = 'cod'; } else if( $kind == 'l' || $kind == 'loc' ) { $sym = '@'; $kind = 'loc'; } else if( $kind == 's' || $kind == 'str' ) { $sym = '*'; $kind = 'str'; } else if( $kind == 'u' || $kind == 'usr' ) { $sym = '+'; $kind = 'usr'; } if( $name = ic_get_post( 'filters-req' ) ) { $filter = $_SESSION['filters'][$sym.$name]; $filter->manage( 'req' ); } else if( $name = ic_get_post( 'filters-sign' ) ) { $filter = $_SESSION['filters'][$sym.$name]; $filter->manage( 'sign' ); } else if( $name = ic_get_post( 'trashed_filter' ) ) { $filter = $_SESSION['filters'][$sym.$name]; $filter->manage( 'clear' ); } else if( $name = ic_get_post( 'new_filter' ) ) { $sign = ( $post_meta = ic_get_post( 'new_sign' ) ) ? $post_meta : 'd'; $filter = new filter( $name, $kind, $sign ); $filter->manage( 'add' ); } $filter_change = TRUE; } if( isset( $filter_change ) || ic_get_post( 'filters_refresh' ) ) { foreach( $_SESSION['filters'] as $filter ) $filter->tag(); } else { $sign_filters = get_setting( 'sign_filters'); $on = $sign_filters != 1 ? ',\'d\'' : ',0'; $filts = $sign_filters != 1 ? 'style="display:none;"' : ''; $hover = get_setting( 'hover_help' ); ?> <div id="hover-help"> <div class="hover-off" id="hh-ftradd"><?php tr( 'ftradd', 'h' ) ?></div> </div> <div class="text-box" id="shell-filters"> <div class="filters-choice filters-choice-signs"><?php filter::add_filters( 'input-filters', 'addFilter()', 'addFilterSelect()' ) ?></div> <div id="filters"> <?php $filter_change = TRUE; include( 'filters-main.php' ); echo '</div></div>'; }
Java
class IssueTrackerService < Service validate :one_issue_tracker, if: :activated?, on: :manual_change default_value_for :category, 'issue_tracker' # Pattern used to extract links from comments # Override this method on services that uses different patterns # This pattern does not support cross-project references # The other code assumes that this pattern is a superset of all # overriden patterns. See ReferenceRegexes::EXTERNAL_PATTERN def self.reference_pattern @reference_pattern ||= %r{(\b[A-Z][A-Z0-9_]+-|#{Issue.reference_prefix})(?<issue>\d+)} end def default? default end def issue_url(iid) self.issues_url.gsub(':id', iid.to_s) end def issue_tracker_path project_url end def new_issue_path new_issue_url end def issue_path(iid) issue_url(iid) end def fields [ { type: 'text', name: 'description', placeholder: description }, { type: 'text', name: 'project_url', placeholder: 'Project url', required: true }, { type: 'text', name: 'issues_url', placeholder: 'Issue url', required: true }, { type: 'text', name: 'new_issue_url', placeholder: 'New Issue url', required: true } ] end # Initialize with default properties values # or receive a block with custom properties def initialize_properties(&block) return unless properties.nil? if enabled_in_gitlab_config if block_given? yield else self.properties = { title: issues_tracker['title'], project_url: issues_tracker['project_url'], issues_url: issues_tracker['issues_url'], new_issue_url: issues_tracker['new_issue_url'] } end else self.properties = {} end end def self.supported_events %w(push) end def execute(data) return unless supported_events.include?(data[:object_kind]) message = "#{self.type} was unable to reach #{self.project_url}. Check the url and try again." result = false begin response = HTTParty.head(self.project_url, verify: true) if response message = "#{self.type} received response #{response.code} when attempting to connect to #{self.project_url}" result = true end rescue HTTParty::Error, Timeout::Error, SocketError, Errno::ECONNRESET, Errno::ECONNREFUSED, OpenSSL::SSL::SSLError => error message = "#{self.type} had an error when trying to connect to #{self.project_url}: #{error.message}" end Rails.logger.info(message) result end private def enabled_in_gitlab_config Gitlab.config.issues_tracker && Gitlab.config.issues_tracker.values.any? && issues_tracker end def issues_tracker Gitlab.config.issues_tracker[to_param] end def one_issue_tracker return if template? return if project.blank? if project.services.external_issue_trackers.where.not(id: id).any? errors.add(:base, 'Another issue tracker is already in use. Only one issue tracker service can be active at a time') end end end
Java
/** * Compile sass files to css using compass */ module.exports = { dev: { options: { config: 'config.rb', environment: 'development' } }, };
Java
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Cognito.Stripe.Classes { public class FileUpload : BaseObject { public override string Object { get { return "file_upload"; } } public string Purpose { get; set; } public int Size { get; set; } public string Type { get; set; } public string URL { get; set; } } }
Java
class ChangeIntegerLimits < ActiveRecord::Migration def change change_column :projects, :federal_contribution, :integer, limit: 8 change_column :projects, :total_eligible_cost, :integer, limit: 8 end end
Java
<?php exit; include_once "config/config.php"; include_once "engine/fhq_class_security.php"; include_once "engine/fhq_class_database.php"; include_once "engine/fhq_class_mail.php"; if(!isset($_GET['email'])) { echo "not found parametr ?email="; exit; }; $email = $_GET['email']; echo "send to mail: ".$email."<br>"; $security = new fhq_security(); $db = new fhq_database(); $mail = new fhq_mail(); echo "mail created <br>"; $error = ""; echo "try send email<br>"; $mail->send($email,'','','Test Mail', 'Test messages', $error); echo "sended"; echo $error; ?>
Java
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = r''' --- module: bigiq_regkey_license_assignment short_description: Manage regkey license assignment on BIG-IPs from a BIG-IQ description: - Manages the assignment of regkey licenses on a BIG-IQ. Assignment means the license is assigned to a BIG-IP, or it needs to be assigned to a BIG-IP. Additionally, this module supports revoking the assignments from BIG-IP devices. version_added: "1.0.0" options: pool: description: - The registration key pool to use. type: str required: True key: description: - The registration key you want to assign from the pool. type: str required: True device: description: - When C(managed) is C(no), specifies the address, or hostname, where the BIG-IQ can reach the remote device to register. - When C(managed) is C(yes), specifies the managed device, or device UUID, that you want to register. - If C(managed) is C(yes), it is very important you do not have more than one device with the same name. BIG-IQ internally recognizes devices by their ID, and therefore, this module cannot guarantee the correct device will be registered. The device returned is the device that is used. type: str required: True managed: description: - Whether the specified device is a managed or un-managed device. - When C(state) is C(present), this parameter is required. type: bool device_port: description: - Specifies the port of the remote device to connect to. - If this parameter is not specified, the default is C(443). type: int default: 443 device_username: description: - The username used to connect to the remote device. - This username should be one that has sufficient privileges on the remote device to do licensing. Usually this is the C(Administrator) role. - When C(managed) is C(no), this parameter is required. type: str device_password: description: - The password of the C(device_username). - When C(managed) is C(no), this parameter is required. type: str state: description: - When C(present), ensures the device is assigned the specified license. - When C(absent), ensures the license is revoked from the remote device and freed on the BIG-IQ. type: str choices: - present - absent default: present extends_documentation_fragment: f5networks.f5_modules.f5 author: - Tim Rupp (@caphrim007) ''' EXAMPLES = r''' - name: Register an unmanaged device bigiq_regkey_license_assignment: pool: my-regkey-pool key: XXXX-XXXX-XXXX-XXXX-XXXX device: 1.1.1.1 managed: no device_username: admin device_password: secret state: present provider: user: admin password: secret server: lb.mydomain.com delegate_to: localhost - name: Register a managed device, by name bigiq_regkey_license_assignment: pool: my-regkey-pool key: XXXX-XXXX-XXXX-XXXX-XXXX device: bigi1.foo.com managed: yes state: present provider: user: admin password: secret server: lb.mydomain.com delegate_to: localhost - name: Register a managed device, by UUID bigiq_regkey_license_assignment: pool: my-regkey-pool key: XXXX-XXXX-XXXX-XXXX-XXXX device: 7141a063-7cf8-423f-9829-9d40599fa3e0 managed: yes state: present provider: user: admin password: secret server: lb.mydomain.com delegate_to: localhost ''' RETURN = r''' # only common fields returned ''' import re import time from datetime import datetime from ansible.module_utils.basic import AnsibleModule from ..module_utils.bigip import F5RestClient from ..module_utils.common import ( F5ModuleError, AnsibleF5Parameters, f5_argument_spec ) from ..module_utils.icontrol import bigiq_version from ..module_utils.ipaddress import is_valid_ip from ..module_utils.teem import send_teem class Parameters(AnsibleF5Parameters): api_map = { 'deviceReference': 'device_reference', 'deviceAddress': 'device_address', 'httpsPort': 'device_port' } api_attributes = [ 'deviceReference', 'deviceAddress', 'httpsPort', 'managed' ] returnables = [ 'device_address', 'device_reference', 'device_username', 'device_password', 'device_port', 'managed' ] updatables = [ 'device_reference', 'device_address', 'device_username', 'device_password', 'device_port', 'managed' ] def to_return(self): result = {} try: for returnable in self.returnables: result[returnable] = getattr(self, returnable) result = self._filter_params(result) except Exception: raise return result class ApiParameters(Parameters): pass class ModuleParameters(Parameters): @property def device_password(self): if self._values['device_password'] is None: return None return self._values['device_password'] @property def device_username(self): if self._values['device_username'] is None: return None return self._values['device_username'] @property def device_address(self): if self.device_is_address: return self._values['device'] @property def device_port(self): if self._values['device_port'] is None: return None return int(self._values['device_port']) @property def device_is_address(self): if is_valid_ip(self.device): return True return False @property def device_is_id(self): pattern = r'[A-Za-z0-9]{8}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{12}' if re.match(pattern, self.device): return True return False @property def device_is_name(self): if not self.device_is_address and not self.device_is_id: return True return False @property def device_reference(self): if not self.managed: return None if self.device_is_address: # This range lookup is how you do lookups for single IP addresses. Weird. filter = "address+eq+'{0}...{0}'".format(self.device) elif self.device_is_name: filter = "hostname+eq+'{0}'".format(self.device) elif self.device_is_id: filter = "uuid+eq+'{0}'".format(self.device) else: raise F5ModuleError( "Unknown device format '{0}'".format(self.device) ) uri = "https://{0}:{1}/mgmt/shared/resolver/device-groups/cm-bigip-allBigIpDevices/devices/" \ "?$filter={2}&$top=1".format(self.client.provider['server'], self.client.provider['server_port'], filter) resp = self.client.api.get(uri) try: response = resp.json() except ValueError as ex: raise F5ModuleError(str(ex)) if resp.status == 200 and response['totalItems'] == 0: raise F5ModuleError( "No device with the specified address was found." ) elif 'code' in response and response['code'] == 400: if 'message' in response: raise F5ModuleError(response['message']) else: raise F5ModuleError(resp._content) id = response['items'][0]['uuid'] result = dict( link='https://localhost/mgmt/shared/resolver/device-groups/cm-bigip-allBigIpDevices/devices/{0}'.format(id) ) return result @property def pool_id(self): filter = "(name%20eq%20'{0}')".format(self.pool) uri = 'https://{0}:{1}/mgmt/cm/device/licensing/pool/regkey/licenses?$filter={2}&$top=1'.format( self.client.provider['server'], self.client.provider['server_port'], filter ) resp = self.client.api.get(uri) try: response = resp.json() except ValueError as ex: raise F5ModuleError(str(ex)) if resp.status == 200 and response['totalItems'] == 0: raise F5ModuleError( "No pool with the specified name was found." ) elif 'code' in response and response['code'] == 400: if 'message' in response: raise F5ModuleError(response['message']) else: raise F5ModuleError(resp._content) return response['items'][0]['id'] @property def member_id(self): if self.device_is_address: # This range lookup is how you do lookups for single IP addresses. Weird. filter = "deviceAddress+eq+'{0}...{0}'".format(self.device) elif self.device_is_name: filter = "deviceName+eq+'{0}'".format(self.device) elif self.device_is_id: filter = "deviceMachineId+eq+'{0}'".format(self.device) else: raise F5ModuleError( "Unknown device format '{0}'".format(self.device) ) uri = 'https://{0}:{1}/mgmt/cm/device/licensing/pool/regkey/licenses/{2}/offerings/{3}/members/' \ '?$filter={4}'.format(self.client.provider['server'], self.client.provider['server_port'], self.pool_id, self.key, filter) resp = self.client.api.get(uri) try: response = resp.json() except ValueError as ex: raise F5ModuleError(str(ex)) if resp.status == 200 and response['totalItems'] == 0: return None elif 'code' in response and response['code'] == 400: if 'message' in response: raise F5ModuleError(response['message']) else: raise F5ModuleError(resp._content) result = response['items'][0]['id'] return result class Changes(Parameters): pass class UsableChanges(Changes): @property def device_port(self): if self._values['managed']: return None return self._values['device_port'] @property def device_username(self): if self._values['managed']: return None return self._values['device_username'] @property def device_password(self): if self._values['managed']: return None return self._values['device_password'] @property def device_reference(self): if not self._values['managed']: return None return self._values['device_reference'] @property def device_address(self): if self._values['managed']: return None return self._values['device_address'] @property def managed(self): return None class ReportableChanges(Changes): pass class Difference(object): def __init__(self, want, have=None): self.want = want self.have = have def compare(self, param): try: result = getattr(self, param) return result except AttributeError: return self.__default(param) def __default(self, param): attr1 = getattr(self.want, param) try: attr2 = getattr(self.have, param) if attr1 != attr2: return attr1 except AttributeError: return attr1 class ModuleManager(object): def __init__(self, *args, **kwargs): self.module = kwargs.get('module', None) self.client = F5RestClient(**self.module.params) self.want = ModuleParameters(params=self.module.params, client=self.client) self.have = ApiParameters() self.changes = UsableChanges() def _set_changed_options(self): changed = {} for key in Parameters.returnables: if getattr(self.want, key) is not None: changed[key] = getattr(self.want, key) if changed: self.changes = UsableChanges(params=changed) def _update_changed_options(self): diff = Difference(self.want, self.have) updatables = Parameters.updatables changed = dict() for k in updatables: change = diff.compare(k) if change is None: continue else: if isinstance(change, dict): changed.update(change) else: changed[k] = change if changed: self.changes = UsableChanges(params=changed) return True return False def should_update(self): result = self._update_changed_options() if result: return True return False def exec_module(self): start = datetime.now().isoformat() version = bigiq_version(self.client) changed = False result = dict() state = self.want.state if state == "present": changed = self.present() elif state == "absent": changed = self.absent() reportable = ReportableChanges(params=self.changes.to_return()) changes = reportable.to_return() result.update(**changes) result.update(dict(changed=changed)) self._announce_deprecations(result) send_teem(start, self.module, version) return result def _announce_deprecations(self, result): warnings = result.pop('__warnings', []) for warning in warnings: self.module.deprecate( msg=warning['msg'], version=warning['version'] ) def present(self): if self.exists(): return False return self.create() def exists(self): if self.want.member_id is None: return False uri = 'https://{0}:{1}/mgmt/cm/device/licensing/pool/regkey/licenses/{2}/offerings/{3}/members/{4}'.format( self.client.provider['server'], self.client.provider['server_port'], self.want.pool_id, self.want.key, self.want.member_id ) resp = self.client.api.get(uri) if resp.status == 200: return True return False def remove(self): self._set_changed_options() if self.module.check_mode: return True self.remove_from_device() if self.exists(): raise F5ModuleError("Failed to delete the resource.") # Artificial sleeping to wait for remote licensing (on BIG-IP) to complete # # This should be something that BIG-IQ can do natively in 6.1-ish time. time.sleep(60) return True def create(self): self._set_changed_options() if not self.want.managed: if self.want.device_username is None: raise F5ModuleError( "You must specify a 'device_username' when working with unmanaged devices." ) if self.want.device_password is None: raise F5ModuleError( "You must specify a 'device_password' when working with unmanaged devices." ) if self.module.check_mode: return True self.create_on_device() if not self.exists(): raise F5ModuleError( "Failed to license the remote device." ) self.wait_for_device_to_be_licensed() # Artificial sleeping to wait for remote licensing (on BIG-IP) to complete # # This should be something that BIG-IQ can do natively in 6.1-ish time. time.sleep(60) return True def create_on_device(self): params = self.changes.api_params() uri = 'https://{0}:{1}/mgmt/cm/device/licensing/pool/regkey/licenses/{2}/offerings/{3}/members/'.format( self.client.provider['server'], self.client.provider['server_port'], self.want.pool_id, self.want.key ) if not self.want.managed: params['username'] = self.want.device_username params['password'] = self.want.device_password resp = self.client.api.post(uri, json=params) try: response = resp.json() except ValueError as ex: raise F5ModuleError(str(ex)) if 'code' in response and response['code'] == 400: if 'message' in response: raise F5ModuleError(response['message']) else: raise F5ModuleError(resp.content) def wait_for_device_to_be_licensed(self): count = 0 uri = 'https://{0}:{1}/mgmt/cm/device/licensing/pool/regkey/licenses/{2}/offerings/{3}/members/{4}'.format( self.client.provider['server'], self.client.provider['server_port'], self.want.pool_id, self.want.key, self.want.member_id ) while count < 3: resp = self.client.api.get(uri) try: response = resp.json() except ValueError as ex: raise F5ModuleError(str(ex)) if 'code' in response and response['code'] == 400: if 'message' in response: raise F5ModuleError(response['message']) else: raise F5ModuleError(resp.content) if response['status'] == 'LICENSED': count += 1 else: count = 0 def absent(self): if self.exists(): return self.remove() return False def remove_from_device(self): uri = 'https://{0}:{1}/mgmt/cm/device/licensing/pool/regkey/licenses/{2}/offerings/{3}/members/{4}'.format( self.client.provider['server'], self.client.provider['server_port'], self.want.pool_id, self.want.key, self.want.member_id ) params = {} if not self.want.managed: params.update(self.changes.api_params()) params['id'] = self.want.member_id params['username'] = self.want.device_username params['password'] = self.want.device_password self.client.api.delete(uri, json=params) class ArgumentSpec(object): def __init__(self): self.supports_check_mode = True argument_spec = dict( pool=dict(required=True), key=dict(required=True, no_log=True), device=dict(required=True), managed=dict(type='bool'), device_port=dict(type='int', default=443), device_username=dict(no_log=True), device_password=dict(no_log=True), state=dict(default='present', choices=['absent', 'present']) ) self.argument_spec = {} self.argument_spec.update(f5_argument_spec) self.argument_spec.update(argument_spec) self.required_if = [ ['state', 'present', ['key', 'managed']], ['managed', False, ['device', 'device_username', 'device_password']], ['managed', True, ['device']] ] def main(): spec = ArgumentSpec() module = AnsibleModule( argument_spec=spec.argument_spec, supports_check_mode=spec.supports_check_mode, required_if=spec.required_if ) try: mm = ModuleManager(module=module) results = mm.exec_module() module.exit_json(**results) except F5ModuleError as ex: module.fail_json(msg=str(ex)) if __name__ == '__main__': main()
Java
<?php /** * * @author thiago */ interface ConsoleFactory { public function create_console_microsoft(); public function create_console_sony(); }
Java
<!DOCTYPE html> <html lang="en-us"> <head> <link href="http://gmpg.org/xfn/11" rel="profile"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <!-- Enable responsiveness on mobile devices--> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> <title> Posts Tagged &ldquo;systemjs&rdquo; &middot; Mike Loll </title> <!-- CSS --> <link rel="stylesheet" href="/public/css/poole.css"> <link rel="stylesheet" href="/public/css/syntax.css"> <link rel="stylesheet" href="/public/css/lanyon.css"> <link rel="stylesheet" href="/public/css/mikeloll.css"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=PT+Serif:400,400italic,700%7CPT+Sans:400"> <!-- Icons --> <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/public/apple-touch-icon-precomposed.png"> <link rel="shortcut icon" href="/public/favicon.ico"> <!-- RSS --> <link rel="alternate" type="application/rss+xml" title="RSS" href="/atom.xml"> </head> <body> <!-- Target for toggling the sidebar `.sidebar-checkbox` is for regular styles, `#sidebar-checkbox` for behavior. --> <input type="checkbox" class="sidebar-checkbox" id="sidebar-checkbox"> <!-- Toggleable sidebar --> <div class="sidebar" id="sidebar"> <div class="sidebar-item"> <p></p> </div> <nav class="sidebar-nav"> <a class="sidebar-nav-item" href="/">Home</a> <a class="sidebar-nav-item" href="/about/">About</a> <a class="sidebar-nav-item" href="/archive/">Archive</a> </nav> <div class="sidebar-item"> <p> &copy; 2015. All rights reserved. </p> </div> </div> <!-- Wrap is the content to shift when toggling the sidebar. We wrap the content to avoid any CSS collisions with our real content. --> <div class="wrap"> <div class="masthead"> <div class="container"> <h3 class="masthead-title"> <a href="/" title="Home">Mike Loll</a> <small>A collection of random tech related things.</small> </h3> </div> </div> <div class="container content"> <h2 class="post_title">Posts Tagged &ldquo;systemjs&rdquo;</h2> 01/02/14<a class="archive_list_article_link" href='/2014/01/02/introducing-lanyon/'>Introducing Lanyon</a> <p class="summary"></p> <a class="tag_list_link" href="/tag/angular2">angular2</a>&nbsp;&nbsp;<a class="tag_list_link" href="/tag/typescript">typescript</a>&nbsp;&nbsp;<a class="tag_list_link" href="/tag/systemjs">systemjs</a>&nbsp;&nbsp; </ul> </div> </div> <label for="sidebar-checkbox" class="sidebar-toggle"></label> <script> (function(document) { var toggle = document.querySelector('.sidebar-toggle'); var sidebar = document.querySelector('#sidebar'); var checkbox = document.querySelector('#sidebar-checkbox'); document.addEventListener('click', function(e) { var target = e.target; if(!checkbox.checked || sidebar.contains(target) || (target === checkbox || target === toggle)) return; checkbox.checked = false; }, false); })(document); </script> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-70120850-1', 'auto'); ga('send', 'pageview'); </script> </body> </html>
Java
class ApplicationController < Sinatra::Base require 'bundler' Bundler.require end
Java
// JSON Object of all of the icons and their tags export default { apple : { name : 'apple', color: '#be0000', image : 'apple67.svg', tags: ['apple', 'fruit', 'food'], categories: ['food', 'supermarket'] }, bread : { name : 'bread', color: '#c26b24', image : 'bread14.svg', tags: ['bread', 'food', 'wheat', 'bake'], categories: ['food', 'supermarket'] }, broccoli : { name : 'broccoli', color: '#16a900', image : 'broccoli.svg', tags: ['broccoli', 'food', 'vegetable'], categories: ['food', 'supermarket'] }, cheese : { name : 'cheese', color: '#ffe625', image : 'cheese7.svg', tags: ['cheese', 'food', 'dairy'], categories: ['food', 'supermarket'] }, shopping : { name : 'shopping', color: '#f32393', image : 'shopping225.svg', tags: ['shopping', 'bag'], categories: ['shopping', 'supermarket'] }, cart : { name : 'cart', color: '#9ba990', image : 'supermarket1.svg', tags: ['cart', 'shopping'], categories: ['shopping', 'supermarket'] }, fish : { name : 'fish', color: '#6d7ca9', image : 'fish52.svg', tags: ['fish', 'food'], categories: ['fish', 'supermarket'] }, giftbox : { name : 'giftbox', color: '#f32393', image : 'giftbox56.svg', tags: ['giftbox', 'gift', 'present'], categories: ['gift', 'shopping', 'supermarket'] } };
Java
#!/bin/bash # # bash strict mode set -euo pipefail IFS=$'\n\t' USAGE="Usage:\n Requires AWS CLI tools and credentials configured.\n ./tool.sh install mySourceDirectory\n ./tool.sh create mySourceDirectory myAWSLambdaFunctionName myIAMRoleARN\n ./tool.sh update mySourceDirectory myAWSLambdaFunctionName\n ./tool.sh invoke myAWSLambdaFunctionName\n " REGION="eu-west-1" PROFILE="heap" # Install pip requirements for a Python lambda function install_requirements { FUNCTION_DIRECTORY=$2 cd $FUNCTION_DIRECTORY pip install -r requirements.txt -t . } # Creates a new lambda function function create { FUNCTION_DIRECTORY=$2 FUNCTION_ARN_NAME=$3 ROLE_ARN=$4 mkdir -p build cd $FUNCTION_DIRECTORY zip -FSr ../build/$FUNCTION_DIRECTORY.zip . cd .. aws lambda create-function\ --function-name $FUNCTION_ARN_NAME\ --runtime python2.7\ --role $4\ --handler main.lambda_handler\ --timeout 15\ --memory-size 128\ --zip-file fileb://build/$FUNCTION_DIRECTORY.zip } # Packages and uploads the source code of a AWS Lambda function and deploys it live. function upload_lambda_source { FUNCTION_DIRECTORY=$2 FUNCTION_ARN_NAME=$3 mkdir -p build cd $FUNCTION_DIRECTORY zip -FSr ../build/$FUNCTION_DIRECTORY.zip . cd .. aws lambda update-function-code --profile $PROFILE --region $REGION --function-name $FUNCTION_ARN_NAME --zip-file fileb://build/$FUNCTION_DIRECTORY.zip } # Invokes an AWS Lambda function and outputs its result function invoke { FUNCTION_ARN_NAME=$2 aws lambda invoke --profile $PROFILE --region $REGION --function-name $FUNCTION_ARN_NAME /dev/stdout } function help_and_exit { echo -e $USAGE exit 1 } # Subcommand handling if [ $# -lt 1 ] then help_and_exit fi case "$1" in install) if (( $# == 2 )); then install_requirements "$@" else help_and_exit fi ;; create) if (( $# == 4 )); then create "$@" else help_and_exit fi ;; update) if (( $# == 3 )); then upload_lambda_source "$@" else help_and_exit fi ;; invoke) if (( $# == 2 )); then invoke "$@" else help_and_exit fi ;; *) echo "Error: No such subcommand" help_and_exit esac
Java
package sudoku import "fmt" const ( n = 3 N = 3 * 3 ) var ( resolved bool ) func solveSudoku(board [][]byte) [][]byte { // box size 3 row := make([][]int, N) columns := make([][]int, N) box := make([][]int, N) res := make([][]byte, N) for i := 0; i < N; i++ { row[i] = make([]int, N+1) columns[i] = make([]int, N+1) box[i] = make([]int, N+1) res[i] = make([]byte, N) copy(res[i], board[i]) } for i := 0; i < N; i++ { for j := 0; j < N; j++ { if board[i][j] != '.' { placeNumberAtPos(res, i, j, int(board[i][j]-'0'), row, columns, box) } } } fmt.Printf("row: %v\n, column: %v\n, box: %v\n", row, columns, box) permute(res, 0, 0, row, columns, box) return res } func placeNumberAtPos(board [][]byte, i, j, num int, row, columns, box [][]int) { boxIdx := (i/n)*n + j/n (row)[i][num]++ (columns)[j][num]++ (box)[boxIdx][num]++ (board)[i][j] = byte('0' + num) } func removeNumberAtPos(board [][]byte, i, j, num int, row, columns, box [][]int) { boxIdx := (i/n)*n + j/n row[i][num]++ columns[j][num]++ box[boxIdx][num]++ board[i][j] = '.' } func isValidPosForNum(i, j, num int, row, columns, box [][]int) bool { boxIdx := (i/n)*n + j/n return row[i][num]+columns[j][num]+box[boxIdx][num] == 0 } func permute(board [][]byte, i, j int, row, column, box [][]int) { if board[i][j] == '.' { for k := 1; k <= N; k++ { if isValidPosForNum(i, j, k, row, column, box) { placeNumberAtPos(board, i, j, k, row, column, box) fmt.Printf("place k:%d at row: %d and col:%d, row[i][k]= %d, col[j][k] = %d and box[boxidx][k] = %d\n", k, i, j, row[i][k], column[j][k], box[(i/n)*n+j/n][k]) placeNext(board, i, j, row, column, box) fmt.Printf("place next then k:%d at row: %d and col:%d, row[i][k]= %d, col[j][k] = %d and box[boxidx][k] = %d\n", k, i, j, row[i][k], column[j][k], box[(i/n)*n+j/n][k]) if !resolved { removeNumberAtPos(board, i, j, k, row, column, box) } } } } else { placeNext(board, i, j, row, column, box) } } func placeNext(board [][]byte, i, j int, row, column, box [][]int) { if i == N-1 && j == N-1 { resolved = true } fmt.Printf("board: %v\n, row: %v \n, column: %v\n, box: %v\n", board, row, column, box) if j == N-1 { fmt.Println("next row") permute(board, i+1, 0, row, column, box) } else { fmt.Println("next column") permute(board, i, j+1, row, column, box) } } func solveSudoku2(board [][]byte) [][]byte { if len(board) == 0 { return board } solve(board) return board } func solve(board [][]byte) bool { var c byte for i := 0; i < len(board); i++ { for j := 0; j < len(board[0]); j++ { if board[i][j] == '.' { for c = '1'; c <= '9'; c++ { if isValid(board, i, j, c) { board[i][j] = c if solve(board) { return true } else { board[i][j] = '.' } } } return false } } } return true } func isValid(board [][]byte, row int, col int, c byte) bool { for i := 0; i < 9; i++ { if board[i][col] != '.' && board[i][col] == c { return false } if board[row][i] != '.' && board[row][i] == c { return false } if board[3*(row/3)+i/3][3*(col/3)+i%3] != '.' && board[3*(row/3)+i/3][3*(col/3)+i%3] == c { return false } } return true }
Java
<div> The version string to use when patching assembly version files. </div>
Java
return function(parameters) return { position = parameters.position or {x = 0, y = 0, z = 0}, scale = parameters.scale or {x = 0, y = 0}, anchors = parameters.anchors or {up = 1, left = 1, right = 1, down = 1}, offset = parameters.offset or {up = 0, left = 0, right = 0, down = 0}, useTween = parameters.useTween or true, velocity = parameters.velocity or 5 } end
Java
#include "Fractal.h" Color::Color() : r(0.0), g(0.0), b(0.0) {} Color::Color(double rin, double gin, double bin) : r(rin), g(gin), b(bin) {} Fractal::Fractal(int width, int height) : width_(width), height_(height), center_x_(0.0), center_y_(0.0), max_distance_sqr_(4.0), max_iteration_(32) { pixel_size_ = 4.0 / width_; } Fractal::~Fractal() {} void Fractal::Initialize() { RecalcMins(); CreateColors(); CalculateEscapeTime(); } void Fractal::CreateColors() { int i; double r, g, b; colors_.resize(max_iteration_ + 1); for (i = 0; i < max_iteration_; i++) { r = 1.0 * i / (double) max_iteration_; g = 0.5 * i / (double) max_iteration_; b = 1.0 * i / (double) max_iteration_; colors_[i] = Color(r, g, b); } colors_[max_iteration_] = Color(0.0, 0.0, 0.0); } void Fractal::CalculateEscapeTime() { int i, j; double x, y, xmin, ymin; xmin = center_x_ - pixel_size_ * (width_ / 2.0 - 0.5); ymin = center_y_ - pixel_size_ * (height_ / 2.0 - 0.5); escape_times_.resize(height_); for (j = 0; j < height_; j++) { escape_times_[j].resize(width_); for (i = 0; i < width_; i++) { x = xmin + i * pixel_size_; y = ymin + j * pixel_size_; escape_times_[j][i] = EscapeOne(x, y); } } } void Fractal::Draw() { int x, y, iter; for (y = 0; y < height_; y++) { for (x = 0; x < width_; x++) { iter = escape_times_[y][x]; glColor3d(colors_[iter].r, colors_[iter].g, colors_[iter].b); glBegin(GL_POINTS); glVertex2d(x, y); glEnd(); } } } void Fractal::Center(double x, double y) { RecalcCenter(x, y); RecalcMins(); CalculateEscapeTime(); } void Fractal::ZoomIn(double x, double y) { RecalcCenter(x, y); pixel_size_ /= 2.0; RecalcMins(); CalculateEscapeTime(); } void Fractal::ZoomOut(double x, double y) { RecalcCenter(x, y); pixel_size_ *= 2.0; RecalcMins(); CalculateEscapeTime(); } void Fractal::RecalcCenter(double x, double y) { center_x_ = min_x_ + pixel_size_ * x; center_y_ = min_y_ + pixel_size_ * y; } void Fractal::RecalcMins() { min_x_ = center_x_ - pixel_size_ * (width_ / 2.0 - 0.5); min_y_ = center_y_ - pixel_size_ * (height_ / 2.0 - 0.5); }
Java
using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; using Mechanical3.Core; namespace Mechanical3.IO.FileSystems { //// NOTE: For still more speed, you could ditch abstract file systems, file paths and streams alltogether, and just use byte arrays directly. //// Obviously this is a compromize between performance and ease of use. /// <summary> /// Provides performant, semi thread-safe access to an in-memory copy of the contants of an <see cref="IFileSystemReader"/>. /// Access to <see cref="IFileSystemReader"/> members is thread-safe. /// <see cref="Stream"/> instances returned are NOT thread-safe, and they must not be used after they are closed or disposed (one of which should happen exactly one time). /// </summary> public class SemiThreadSafeMemoryFileSystemReader : IFileSystemReader { #region ByteArrayReaderStream /// <summary> /// Provides thread-safe, read-only access to the wrapped byte array. /// </summary> private class ByteArrayReaderStream : Stream { //// NOTE: the default asynchronous implementations call their synchronous versions. //// NOTE: we don't use Store*, to save a few allocations #region ObjectPool internal static class ObjectPool { private static readonly ConcurrentBag<ByteArrayReaderStream> Pool = new ConcurrentBag<ByteArrayReaderStream>(); internal static ByteArrayReaderStream Get( byte[] data ) { ByteArrayReaderStream stream; if( !Pool.TryTake(out stream) ) stream = new ByteArrayReaderStream(); stream.OnInitialize(data); return stream; } internal static void Put( ByteArrayReaderStream stream ) { Pool.Add(stream); } internal static void Clear() { ByteArrayReaderStream stream; while( true ) { if( Pool.TryTake(out stream) ) GC.SuppressFinalize(stream); else break; // pool is empty } } } #endregion #region Private Fields private byte[] array; private int position; // NOTE: (position == length) == EOF private bool isOpen; #endregion #region Constructor private ByteArrayReaderStream() : base() { } #endregion #region Private Methods private void OnInitialize( byte[] data ) { this.array = data; this.position = 0; this.isOpen = true; } private void OnClose() { this.isOpen = false; this.array = null; this.position = -1; } private void ThrowIfClosed() { if( !this.isOpen ) throw new ObjectDisposedException(message: "The stream was already closed!", innerException: null); } #endregion #region Stream protected override void Dispose( bool disposing ) { this.OnClose(); ObjectPool.Put(this); if( !disposing ) { // called from finalizer GC.ReRegisterForFinalize(this); } } public override bool CanRead { get { this.ThrowIfClosed(); return true; } } public override bool CanSeek { get { this.ThrowIfClosed(); return true; } } public override bool CanTimeout { get { this.ThrowIfClosed(); return false; } } public override bool CanWrite { get { this.ThrowIfClosed(); return false; } } public override long Length { get { this.ThrowIfClosed(); return this.array.Length; } } public override long Position { get { this.ThrowIfClosed(); return this.position; } set { this.ThrowIfClosed(); if( value < 0 || this.array.Length < value ) throw new ArgumentOutOfRangeException(); this.position = (int)value; } } public override long Seek( long offset, SeekOrigin origin ) { this.ThrowIfClosed(); int newPosition; switch( origin ) { case SeekOrigin.Begin: newPosition = (int)offset; break; case SeekOrigin.Current: newPosition = this.position + (int)offset; break; case SeekOrigin.End: newPosition = this.array.Length + (int)offset; break; default: throw new ArgumentException("Invalid SeekOrigin!"); } if( newPosition < 0 || newPosition > this.array.Length ) throw new ArgumentOutOfRangeException(); this.position = newPosition; return this.position; } public override int ReadByte() { this.ThrowIfClosed(); if( this.position == this.array.Length ) { // end of stream return -1; } else { return this.array[this.position++]; } } public override int Read( byte[] buffer, int offset, int bytesToRead ) { this.ThrowIfClosed(); int bytesLeft = this.array.Length - this.position; if( bytesLeft < bytesToRead ) bytesToRead = bytesLeft; if( bytesToRead == 0 ) return 0; Buffer.BlockCopy(src: this.array, srcOffset: this.position, dst: buffer, dstOffset: offset, count: bytesToRead); this.position += bytesToRead; return bytesToRead; } public override void Flush() { throw new NotSupportedException(); } public override void SetLength( long value ) { throw new NotSupportedException(); } public override void WriteByte( byte value ) { throw new NotSupportedException(); } public override void Write( byte[] buffer, int offset, int count ) { throw new NotSupportedException(); } #endregion } #endregion #region Private Fields /* From MSDN: * A Dictionary can support multiple readers concurrently, as long as the collection is not modified. * Even so, enumerating through a collection is intrinsically not a thread-safe procedure. In the * rare case where an enumeration contends with write accesses, the collection must be locked during * the entire enumeration. To allow the collection to be accessed by multiple threads for reading * and writing, you must implement your own synchronization. * * ... (or there is also ConcurrentDictionary) */ //// NOTE: since after they are filled, the dictionaries won't be modified, we are fine. private readonly FilePath[] rootFolderEntries; private readonly Dictionary<FilePath, FilePath[]> nonRootFolderEntries; private readonly Dictionary<FilePath, byte[]> fileContents; private readonly Dictionary<FilePath, string> hostPaths; private readonly string rootHostPath; #endregion #region Constructors /// <summary> /// Copies the current contents of the specified <see cref="IFileSystemReader"/> /// into a new <see cref="SemiThreadSafeMemoryFileSystemReader"/> instance. /// </summary> /// <param name="readerToCopy">The abstract file system to copy the current contents of, into memory.</param> /// <returns>A new <see cref="SemiThreadSafeMemoryFileSystemReader"/> instance.</returns> public static SemiThreadSafeMemoryFileSystemReader CopyFrom( IFileSystemReader readerToCopy ) { return new SemiThreadSafeMemoryFileSystemReader(readerToCopy); } /// <summary> /// Initializes a new instance of the <see cref="SemiThreadSafeMemoryFileSystemReader"/> class. /// </summary> /// <param name="readerToCopy">The abstract file system to copy the current contents of, into memory.</param> private SemiThreadSafeMemoryFileSystemReader( IFileSystemReader readerToCopy ) { this.rootFolderEntries = readerToCopy.GetPaths(); this.nonRootFolderEntries = new Dictionary<FilePath, FilePath[]>(); this.fileContents = new Dictionary<FilePath, byte[]>(); if( readerToCopy.SupportsToHostPath ) { this.hostPaths = new Dictionary<FilePath, string>(); this.rootHostPath = readerToCopy.ToHostPath(null); } using( var tmpStream = new MemoryStream() ) { foreach( var e in this.rootFolderEntries ) this.AddRecursively(e, readerToCopy, tmpStream); } } #endregion #region Private Methods private void AddRecursively( FilePath entry, IFileSystemReader readerToCopy, MemoryStream tmpStream ) { if( entry.IsDirectory ) { var subEntries = readerToCopy.GetPaths(entry); this.nonRootFolderEntries.Add(entry, subEntries); foreach( var e in subEntries ) this.AddRecursively(e, readerToCopy, tmpStream); } else { this.fileContents.Add(entry, ReadFileContents(entry, readerToCopy, tmpStream)); } if( this.SupportsToHostPath ) this.hostPaths.Add(entry, readerToCopy.ToHostPath(entry)); } private static byte[] ReadFileContents( FilePath filePath, IFileSystemReader readerToCopy, MemoryStream tmpStream ) { tmpStream.SetLength(0); long? fileSize = null; if( readerToCopy.SupportsGetFileSize ) { fileSize = readerToCopy.GetFileSize(filePath); ThrowIfFileTooBig(filePath, fileSize.Value); } using( var stream = readerToCopy.ReadFile(filePath) ) { if( !fileSize.HasValue && stream.CanSeek ) { fileSize = stream.Length; ThrowIfFileTooBig(filePath, fileSize.Value); } stream.CopyTo(tmpStream); if( !fileSize.HasValue ) ThrowIfFileTooBig(filePath, tmpStream.Length); return tmpStream.ToArray(); } } private static void ThrowIfFileTooBig( FilePath filePath, long fileSize ) { if( fileSize > int.MaxValue ) // that's the largest our stream implementation can support throw new Exception("One of the files is too large!").Store(nameof(filePath), filePath).Store(nameof(fileSize), fileSize); } #endregion #region IFileSystemBase /// <summary> /// Gets a value indicating whether the ToHostPath method is supported. /// </summary> /// <value><c>true</c> if the method is supported; otherwise, <c>false</c>.</value> public bool SupportsToHostPath { get { return this.hostPaths.NotNullReference(); } } /// <summary> /// Gets the string the underlying system uses to represent the specified file or directory. /// </summary> /// <param name="path">The path to the file or directory.</param> /// <returns>The string the underlying system uses to represent the specified <paramref name="path"/>.</returns> public string ToHostPath( FilePath path ) { if( !this.SupportsToHostPath ) throw new NotSupportedException().StoreFileLine(); if( path.NullReference() ) return this.rootHostPath; string result; if( this.hostPaths.TryGetValue(path, out result) ) return result; else throw new FileNotFoundException("The specified file or directory was not found!").Store(nameof(path), path); } #endregion #region IFileSystemReader /// <summary> /// Gets the paths to the direct children of the specified directory. /// Subdirectories are not searched. /// </summary> /// <param name="directoryPath">The path specifying the directory to list the direct children of; or <c>null</c> to specify the root of this file system.</param> /// <returns>The paths of the files and directories found.</returns> public FilePath[] GetPaths( FilePath directoryPath = null ) { if( directoryPath.NotNullReference() && !directoryPath.IsDirectory ) throw new ArgumentException("Argument is not a directory!").Store(nameof(directoryPath), directoryPath); FilePath[] paths; if( directoryPath.NullReference() ) { paths = this.rootFolderEntries; } else { if( !this.nonRootFolderEntries.TryGetValue(directoryPath, out paths) ) throw new FileNotFoundException("The specified file or directory was not found!").Store(nameof(directoryPath), directoryPath); } // NOTE: Unfortunately we need to make a copy, since arrays are writable. // TODO: return ImmutableArray from GetPaths. var copy = new FilePath[paths.Length]; Array.Copy(sourceArray: paths, destinationArray: copy, length: paths.Length); return copy; } /// <summary> /// Opens the specified file for reading. /// </summary> /// <param name="filePath">The path specifying the file to open.</param> /// <returns>A <see cref="Stream"/> representing the file opened.</returns> public Stream ReadFile( FilePath filePath ) { if( filePath.NullReference() || filePath.IsDirectory ) throw new ArgumentException("Argument is not a file!").Store(nameof(filePath), filePath); byte[] bytes; if( !this.fileContents.TryGetValue(filePath, out bytes) ) throw new FileNotFoundException("The specified file or directory was not found!").Store(nameof(filePath), filePath); return ByteArrayReaderStream.ObjectPool.Get(bytes); } /// <summary> /// Gets a value indicating whether the GetFileSize method is supported. /// </summary> /// <value><c>true</c> if the method is supported; otherwise, <c>false</c>.</value> public bool SupportsGetFileSize { get { return true; } } /// <summary> /// Gets the size, in bytes, of the specified file. /// </summary> /// <param name="filePath">The file to get the size of.</param> /// <returns>The size of the specified file in bytes.</returns> public long GetFileSize( FilePath filePath ) { if( filePath.NullReference() || filePath.IsDirectory ) throw new ArgumentException("Argument is not a file!").Store(nameof(filePath), filePath); byte[] bytes; if( !this.fileContents.TryGetValue(filePath, out bytes) ) throw new FileNotFoundException("The specified file or directory was not found!").Store(nameof(filePath), filePath); return bytes.Length; } #endregion } }
Java
http_path = "/" css_dir = "assets/css/src" sass_dir = "assets/sass" images_dir = "assets/img" javascripts_dir = "assets/js" fonts_dir = "assets/font" http_fonts_path = "assets/font" http_images_path = "assets/img" output_style = :nested relative_assets = false line_comments = false
Java
FROM ubuntu:14.04 MAINTAINER Johannes Wettinger, http://github.com/jojow ENV ENGINE_BRANCH maven ENV ENGINE_REV HEAD ENV MAVEN_VERSION 3.3.9 ENV MAVEN_URL http://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz ENV HOME /root WORKDIR ${HOME} ENV DEBIAN_FRONTEND noninteractive ENV PATH ${PATH}:/opt/apache-maven-${MAVEN_VERSION}/bin/ # Replace /dev/random by /dev/urandom to avoid blocking RUN rm /dev/random && ln -s /dev/urandom /dev/random # Install dependencies RUN apt-get update -y && \ apt-get install -y curl wget git openjdk-7-jdk && \ apt-get clean -y RUN wget ${MAVEN_URL} && \ tar -zxf apache-maven-${MAVEN_VERSION}-bin.tar.gz && \ cp -R apache-maven-${MAVEN_VERSION} /opt # Install Docker, partly from https://github.com/docker-library/docker/blob/master/1.12/Dockerfile ENV DOCKER_BUCKET get.docker.com ENV DOCKER_VERSION 1.12.0 ENV DOCKER_SHA256 3dd07f65ea4a7b4c8829f311ab0213bca9ac551b5b24706f3e79a97e22097f8b ENV DOCKER_COMPOSE_VERSION 1.8.0 RUN set -x && \ curl -fSL "https://${DOCKER_BUCKET}/builds/Linux/x86_64/docker-${DOCKER_VERSION}.tgz" -o docker.tgz && \ echo "${DOCKER_SHA256} *docker.tgz" | sha256sum -c - && \ tar -xzvf docker.tgz && \ mv docker/* /usr/local/bin/ && \ rmdir docker && \ rm docker.tgz && \ docker -v && \ curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose && \ chmod +x /usr/local/bin/docker-compose && \ docker-compose --version # Install engine RUN git clone --recursive https://github.com/OpenTOSCA/container.git -b ${ENGINE_BRANCH} /opt/engine WORKDIR /opt/engine RUN git checkout ${ENGINE_REV} && git reset --hard RUN mvn clean package #RUN mvn clean install RUN ln -s /opt/engine/org.opentosca.container.product/target/products/org.opentosca.container.product/linux/gtk/x86_64/OpenTOSCA /usr/local/bin/opentosca-engine && \ chmod +x /usr/local/bin/opentosca-engine EXPOSE 1337 CMD [ "/usr/local/bin/opentosca-engine" ]
Java
flask-dogstatsd =============== [![PyPI version](https://badge.fury.io/py/Flask-DogStatsd.png)](http://badge.fury.io/py/Flask-DogStatsd) [![Build Status](https://travis-ci.org/xsleonard/flask-dogstatsd.png)](https://travis-ci.org/xsleonard/flask-dogstatsd) [![Coverage Status](https://coveralls.io/repos/xsleonard/flask-dogstatsd/badge.png)](https://coveralls.io/r/xsleonard/flask-dogstatsd) Flask extension for [dogstatsd-python-fixed](https://github.com/xsleonard/dogstatsd-python) Compatible with Python 2.7, 3.3 and pypy Installation ============ ``` pip install flask-dogstatsd ``` Tests ===== ``` pip install -r requirements.txt pip install -r tests/requirements.txt ./setup.py develop ./setup.py test ``` Example ======= ```python # app.py from flask import Flask from flask.ext.dogstatsd import DogStatsd app = Flask(__name__) app.config['DOGSTATSD_HOST'] = 'localhost' # This is the default app.config['DOGSTATSD_PORT'] = 8125 # This is the default app.config['DOGSTATSD_PREFIX'] = 'app' # False-y values disable prefixing dogstatsd = DogStatsd(app) @app.route('/'): def index(): # See dogstatsd-python for the full API. # Methods are forwarded to that. # Since our prefix is 'app', the full key will be 'app.index.views' dogstatsd.increment('index.views') return 'Home' ```
Java
<h1> FOOTBALL </h1> </body> Since the beginning of school we have been analyzing our opponents data for our football team. Since I do not obtain any mathematical skills, it was a challenge. All I could and did offer to the table was what appeared the most important out of the data. Such as, certain number of times a certain play/form was used and the probability of the plays they would execute. My process is shown below. <img src="power cat - Google Docs.mhtml"
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>java枚举类型的使用,查一下</title> <meta name="author" content="盒子"> <!-- Le HTML5 shim, for IE6-8 support of HTML elements --> <!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <!-- Le styles --> <link href="https://cdn.jsdelivr.net/npm/bootstrap/dist/css/bootstrap.min.css" type="text/css" rel="stylesheet" media="all"> <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script> <script src="/assets/twitter/javascripts/qrcode.js"></script> <!-- Le fav and touch icons --> <!-- Update these with your own images <link rel="shortcut icon" href="images/favicon.ico"> <link rel="apple-touch-icon" href="images/apple-touch-icon.png"> <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png"> <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png"> --> </head> <body> <nav class="navbar navbar-expand-lg navbar-light bg-light"> <a class="navbar-brand" href="/">韭菜盒子</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarSupportedContent"> <ul class="navbar-nav mr-auto"> <li class="nav-item"> <a class="nav-link" href="/archive">归档</a> </li> <li class="nav-item"> <a class="nav-link" href="/tags">标签</a> </li> <li class="nav-item"> <a class="nav-link" href="/categories">分类</a> </li> <li class="nav-item"> <a class="nav-link" href="/pages">分页</a> </li> <li class="nav-item"> <a class="nav-link" href="/about">关于我</a> </li> </ul> </div> </nav> <div class="container"> <div class="page-header"> <h1>java枚举类型的使用,查一下 </h1> </div> <div class="row"> <div class="span8"> <p>她轻轻的动了动鼠标没留下一行文字</p> <hr> <div class="pagination"> <ul> <ul> <li class="prev"><a href="/2012/291.html" title="大概闲了2个星期了">&larr; Previous</a></li> <li><a href="/archive">Archive</a></li> <li class="next"><a href="/2012/289.html" title="分享一首诗">Next &rarr;</a></li> </ul> </ul> </div> <hr> </div> <div class="span4"> <h4>Published</h4> <div class="date"><span>2012-09-12 02:56:35</span></div> <br> <h4>Share to Weixin</h4> <div id="share-qrcode"></div> <script type="text/javascript"> new QRCode(document.getElementById("share-qrcode"), { text:document.URL, width:128, height:128 }); </script> <br> <h4>Categories</h4> <ul class="tag_box"> <li> <a href="/categories/#%E5%BC%80%E5%8F%91%E6%8A%80%E6%9C%AF%E7%B1%BB--%E8%B0%8B%E7%94%9F%E7%AF%87-ref">开发技术类--谋生篇 <span>51</span></a> </li> </ul> <br> <h4>Tags</h4> <ul class="tag_box"> </ul> </div> </div> <footer> <p>&copy; 盒子 2016 with help from <a href="http://github.com/wendal/gor" target="_blank" title="Gor -- Fast Blog">Gor</a> and <a href="http://twitter.github.com/bootstrap/" target="_blank">Twitter Bootstrap</a> and Idea from <a href="http://ruhoh.com" target="_blank" title="The Definitive Technical Blogging Framework">ruhoh</a> <a href="http://www.miitbeian.gov.cn" target="_blank">京ICP备17040577号-1</a> </p> </footer> </div> <!-- /container --> </body> </html>
Java
<!doctype html> <!-- Minimal Mistakes Jekyll Theme 4.13.0 by Michael Rose Copyright 2013-2018 Michael Rose - mademistakes.com | @mmistakes Free for personal and commercial use under the MIT license https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE.txt --> <html lang="en" class="no-js"> <head> <meta charset="utf-8"> <!-- begin _includes/seo.html --><title>Swift - Preslav Rachev</title> <meta name="description" content="Finding beauty in everyday things."> <meta property="og:type" content="website"> <meta property="og:locale" content="en_US"> <meta property="og:site_name" content="Preslav Rachev"> <meta property="og:title" content="Swift"> <meta property="og:url" content="https://preslav.me/tags/swift/"> <link rel="canonical" href="https://preslav.me/tags/swift/"> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "Person", "name": "Your Name", "url": "https://preslav.me", "sameAs": null } </script> <!-- end _includes/seo.html --> <link href="/feed.xml" type="application/atom+xml" rel="alternate" title="Preslav Rachev Feed"> <!-- http://t.co/dKP3o1e --> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script> document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + ' js '; </script> <!-- For all browsers --> <link rel="stylesheet" href="/assets/css/main.css"> <!--[if lte IE 9]> <style> /* old IE unsupported flexbox fixes */ .greedy-nav .site-title { padding-right: 3em; } .greedy-nav button { position: absolute; top: 0; right: 0; height: 100%; } </style> <![endif]--> <link href="https://fonts.googleapis.com/css?family=PT+Sans+Narrow:400,700|PT+Serif:400,700,400italic" rel="stylesheet" type="text/css"> <link href="https://micro.blog/preslavrachev" rel="me" /> </head> <body class="layout--archive-taxonomy"> <!--[if lt IE 9]> <div class="notice--danger align-center" style="margin: 0;">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience.</div> <![endif]--> <div class="masthead"> <div class="masthead__inner-wrap"> <div class="masthead__menu"> <nav id="site-nav" class="greedy-nav"> <a class="site-title" href="/">Preslav Rachev</a> <ul class="visible-links"><li class="masthead__menu-item"> <a href="/about-me" >About</a> </li><li class="masthead__menu-item"> <a href="/micro" >Microblog</a> </li><li class="masthead__menu-item"> <a href="/archive" >Archive</a> </li><li class="masthead__menu-item"> <a href="/contact" >Contact</a> </li></ul> <button class="search__toggle" type="button"> <svg class="icon" width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.99 16"> <path d="M15.5,13.12L13.19,10.8a1.69,1.69,0,0,0-1.28-.55l-0.06-.06A6.5,6.5,0,0,0,5.77,0,6.5,6.5,0,0,0,2.46,11.59a6.47,6.47,0,0,0,7.74.26l0.05,0.05a1.65,1.65,0,0,0,.5,1.24l2.38,2.38A1.68,1.68,0,0,0,15.5,13.12ZM6.4,2A4.41,4.41,0,1,1,2,6.4,4.43,4.43,0,0,1,6.4,2Z" transform="translate(-.01)"></path> </svg> </button> <button class="greedy-nav__toggle hidden" type="button"> <span class="visually-hidden">Toggle menu</span> <div class="navicon"></div> </button> <ul class="hidden-links hidden"></ul> </nav> </div> </div> </div> <div class="initial-content"> <div id="main" role="main"> <div class="archive"> <h1 class="page__title">Swift</h1> <div class="list__item"> <article class="archive__item" itemscope itemtype="http://schema.org/CreativeWork"> <h2 class="archive__item-title" itemprop="headline"> <a href="/2018/07/20/dont-throw-react-native-away-just-yet/" rel="permalink">Don’t Throw React Native Away Just Yet </a> </h2> <p class="page__meta"><i class="far fa-clock" aria-hidden="true"></i> 6 minute read </p> <p class="archive__item-excerpt" itemprop="description">The main reason why mobile developers get enticed by the cross-platform development capabilities of frameworks like React Native, is, of course, the ability to share code across platforms. A smaller, but no less important reason is the ability to build, debug, and refactor faster. Last but not least, such solutions often help broaden up the variety of tools, beyond the ones dictated by the platform vendor. </p> </article> </div> <div class="list__item"> <article class="archive__item" itemscope itemtype="http://schema.org/CreativeWork"> <h2 class="archive__item-title" itemprop="headline"> <a href="/2018/06/17/embracing-the-future/" rel="permalink">Embracing the Future </a> </h2> <p class="page__meta"><i class="far fa-clock" aria-hidden="true"></i> 5 minute read </p> <p class="archive__item-excerpt" itemprop="description">Dominik Wagner (a.k.a. @monkeydom) published an article a few days ago, called On my misalignment with Apple’s love affair with Swift. </p> </article> </div> </div> </div> </div> <div class="search-content"> <div class="search-content__inner-wrap"><input type="text" id="search" class="search-input" tabindex="-1" placeholder="Enter your search term..." /> <div id="results" class="results"></div></div> </div> <div class="page__footer"> <footer> <script type="text/javascript"> var clicky_custom = clicky_custom || {}; clicky_custom.cookies_disable = 1; </script> <script src="//static.getclicky.com/js" type="text/javascript"></script> <script type="text/javascript">try { clicky.init(101131786); } catch (e) { }</script> <noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/101131786ns.gif" /></p></noscript> <script type="text/javascript"> // This should effectively disable all cookies being set on this site // It is a bit of a crude measure, but I think it is necessary, having in mind how many seemingly innoncent // 3rd-party scripts and embeds bring in tracking cookies with themselves if (!document.__defineGetter__) { Object.defineProperty(document, 'cookie', { get: function () { return '' }, set: function () { return true }, }); } else { document.__defineGetter__("cookie", function () { return ''; }); document.__defineSetter__("cookie", function () { }); } </script> <div class="page__footer-follow"> <ul class="social-icons"> <li><strong>Follow:</strong></li> <li><a href="/feed.xml"><i class="fas fa-fw fa-rss-square" aria-hidden="true"></i> Feed</a></li> </ul> </div> <div class="page__footer-copyright">&copy; 2019 Your Name. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div> </footer> </div> <script src="/assets/js/main.min.js"></script> <script src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script> <script src="/assets/js/lunr/lunr.min.js"></script> <script src="/assets/js/lunr/lunr-store.js"></script> <script src="/assets/js/lunr/lunr-en.js"></script> </body> </html>
Java
--- title: "Tagging and Sample Data" --- Use the [`Appsignal.Transaction.set_sample_data`](https://hexdocs.pm/appsignal/Appsignal.Transaction.html#set_sample_data/2) function to supply extra context on errors and performance issues. This can help to add information that is not already part of the request, session or environment parameters. ```elixir Appsignal.Transaction.set_sample_data("tags", %{locale: "en"}) ``` !> **Warning**: Do not use tagging to send personal data such as names or email addresses to AppSignal. If you want to identify a person, consider using a user ID, hash or pseudonymized identifier instead. You can use [link templates](/application/link-templates.html) to link them to your own system. ## Tags Using tags you can easily add more information to errors and performance issues tracked by AppSignal. There are a few limitations on tagging though. - The tag key must be a `String` or `Atom`. - The tagged value must be a `String`, `Atom` or `Integer`. Tags that do not meet these limitations are dropped without warning. `set_sample_data` can be called multiple times, but only the last value will be retained: ```elixir Appsignal.Transaction.set_sample_data("tags", %{locale: "en"}) Appsignal.Transaction.set_sample_data("tags", %{user: "bob"}) Appsignal.Transaction.set_sample_data("tags", %{locale: "de"}) ``` will result in the following data: ```elixir %{ locale: "de" } ``` ### Link templates Tags can also be used to create link templates. Read more about link templates in our [link templates guide](/application/link-templates.html). ## Sample Data Besides tags you can add more metadata to a transaction (or override default metadata from integrations such as Phoenix), below is a list of valid keys that can be given to `set_sample_data` and the format of the value. ### `session_data` Filled with session/cookie data by default, but can be overridden with the following call: ``` Appsignal.Transaction.set_sample_data("session_data", %{_csrf_token: "Z11CWRVG+I2egpmiZzuIx/qbFb/60FZssui5eGA8a3g="}) ``` This key accepts nested objects that will be rendered as JSON on a Incident Sample page for both Exception and Performance samples. ![session_data](/assets/images/screenshots/sample_data/session_data.png) ### `params` Filled with framework (such as Phoenix) parameters by default, but can be overridden or filled with the following call: ``` Appsignal.Transaction.set_sample_data("params", %{action: "show", controller: "homepage"}) ``` This key accepts nested objects and will show up as follows on a Incident Sample page for both Exception and Performance samples, formatted as JSON. ![params](/assets/images/screenshots/sample_data/params.png) ### `environment` Environment variables from a request/background job, filled by the Phoenix integration, but can be filled/overriden with the following call: ``` Appsignal.Transaction.set_sample_data("environment", %{CONTENT_LENGTH: "0"}) ``` This call only accepts a one-level key/value object, nested values will be ignored. This will result the following block on a Incident Sample page for both Exception and Performance samples. ![environment](/assets/images/screenshots/sample_data/environment.png) ### `custom_data` Custom data is not set by default, but can be used to add additional debugging data to solve a performance issue or exception. ``` Appsignal.Transaction.set_sample_data("custom_data", %{foo: "bar"}) ``` This key accepts nested objects and will result in the following block on a Incident Sample page for both Exception and Performance samples formatted as JSON. ![custom_data](/assets/images/screenshots/sample_data/custom_data.png)
Java
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. */ package com.microsoft.azure.management.network.v2020_04_01; import com.fasterxml.jackson.annotation.JsonProperty; /** * Contains SKU in an ExpressRouteCircuit. */ public class ExpressRouteCircuitSku { /** * The name of the SKU. */ @JsonProperty(value = "name") private String name; /** * The tier of the SKU. Possible values include: 'Standard', 'Premium', * 'Basic', 'Local'. */ @JsonProperty(value = "tier") private ExpressRouteCircuitSkuTier tier; /** * The family of the SKU. Possible values include: 'UnlimitedData', * 'MeteredData'. */ @JsonProperty(value = "family") private ExpressRouteCircuitSkuFamily family; /** * Get the name of the SKU. * * @return the name value */ public String name() { return this.name; } /** * Set the name of the SKU. * * @param name the name value to set * @return the ExpressRouteCircuitSku object itself. */ public ExpressRouteCircuitSku withName(String name) { this.name = name; return this; } /** * Get the tier of the SKU. Possible values include: 'Standard', 'Premium', 'Basic', 'Local'. * * @return the tier value */ public ExpressRouteCircuitSkuTier tier() { return this.tier; } /** * Set the tier of the SKU. Possible values include: 'Standard', 'Premium', 'Basic', 'Local'. * * @param tier the tier value to set * @return the ExpressRouteCircuitSku object itself. */ public ExpressRouteCircuitSku withTier(ExpressRouteCircuitSkuTier tier) { this.tier = tier; return this; } /** * Get the family of the SKU. Possible values include: 'UnlimitedData', 'MeteredData'. * * @return the family value */ public ExpressRouteCircuitSkuFamily family() { return this.family; } /** * Set the family of the SKU. Possible values include: 'UnlimitedData', 'MeteredData'. * * @param family the family value to set * @return the ExpressRouteCircuitSku object itself. */ public ExpressRouteCircuitSku withFamily(ExpressRouteCircuitSkuFamily family) { this.family = family; return this; } }
Java
class JudgePolicy < ApplicationPolicy def create_scores? record.competition.unlocked? && (user_match? || director?(record.event) || super_admin?) end def view_scores? (user_match? || director?(record.event) || super_admin?) end def index? director?(record.event) || super_admin? end def toggle_status? director?(record.event) || super_admin? end def create? update? end def update? record.scores.count.zero? && record.competition.unlocked? && (director?(record.event) || super_admin?) end def destroy? update? end def can_judge? record.competition.unlocked? && (user_match? || director?(record.event) || super_admin?) end private def user_match? record.user == user end class Scope < Scope def resolve scope.none end end end
Java
const path = require('path'); const webpack = require('webpack'); const webpackMerge = require('webpack-merge'); const commonConfig = require('./webpack.common.config.js'); module.exports = function () { return webpackMerge(commonConfig, { watch: true, devtool: 'cheap-module-source-map', // plugins: [ // new webpack.optimize.CommonsChunkPlugin({ // name: "common", // }) // ], devServer: { contentBase: __dirname + "/public/", port: 8080, watchContentBase: true } }) };
Java
<!DOCTYPE html> <html xmlns:msxsl="urn:schemas-microsoft-com:xslt"> <head> <meta content="en-us" http-equiv="Content-Language" /> <meta content="text/html; charset=utf-16" http-equiv="Content-Type" /> <title _locid="PortabilityAnalysis0">.NET Portability Report</title> <style> /* Body style, for the entire document */ body { background: #F3F3F4; color: #1E1E1F; font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; padding: 0; margin: 0; } /* Header1 style, used for the main title */ h1 { padding: 10px 0px 10px 10px; font-size: 21pt; background-color: #E2E2E2; border-bottom: 1px #C1C1C2 solid; color: #201F20; margin: 0; font-weight: normal; } /* Header2 style, used for "Overview" and other sections */ h2 { font-size: 18pt; font-weight: normal; padding: 15px 0 5px 0; margin: 0; } /* Header3 style, used for sub-sections, such as project name */ h3 { font-weight: normal; font-size: 15pt; margin: 0; padding: 15px 0 5px 0; background-color: transparent; } h4 { font-weight: normal; font-size: 12pt; margin: 0; padding: 0 0 0 0; background-color: transparent; } /* Color all hyperlinks one color */ a { color: #1382CE; } /* Paragraph text (for longer informational messages) */ p { font-size: 10pt; } /* Table styles */ table { border-spacing: 0 0; border-collapse: collapse; font-size: 10pt; } table th { background: #E7E7E8; text-align: left; text-decoration: none; font-weight: normal; padding: 3px 6px 3px 6px; } table td { vertical-align: top; padding: 3px 6px 5px 5px; margin: 0px; border: 1px solid #E7E7E8; background: #F7F7F8; } .NoBreakingChanges { color: darkgreen; font-weight:bold; } .FewBreakingChanges { color: orange; font-weight:bold; } .ManyBreakingChanges { color: red; font-weight:bold; } .BreakDetails { margin-left: 30px; } .CompatMessage { font-style: italic; font-size: 10pt; } .GoodMessage { color: darkgreen; } /* Local link is a style for hyperlinks that link to file:/// content, there are lots so color them as 'normal' text until the user mouse overs */ .localLink { color: #1E1E1F; background: #EEEEED; text-decoration: none; } .localLink:hover { color: #1382CE; background: #FFFF99; text-decoration: none; } /* Center text, used in the over views cells that contain message level counts */ .textCentered { text-align: center; } /* The message cells in message tables should take up all avaliable space */ .messageCell { width: 100%; } /* Padding around the content after the h1 */ #content { padding: 0px 12px 12px 12px; } /* The overview table expands to width, with a max width of 97% */ #overview table { width: auto; max-width: 75%; } /* The messages tables are always 97% width */ #messages table { width: 97%; } /* All Icons */ .IconSuccessEncoded, .IconInfoEncoded, .IconWarningEncoded, .IconErrorEncoded { min-width: 18px; min-height: 18px; background-repeat: no-repeat; background-position: center; } /* Success icon encoded */ .IconSuccessEncoded { /* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */ /* [---XsltValidateInternal-Base64EncodedImage:IconSuccess#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABPElEQVR4Xp1Tv0vDUBi8FqeA4NpBcBLcWnQSApncOnTo4FSnjP0DsnXpH5CxiwbHDg4Zuj4oOEXiJgiC4FDcCkLWmIMc1Pfw+eMgQ77v3Xf3Pe51YKGqqisAEwCR1TIAsiAIblSo6xrdHeJR85Xle3mdmCQKb0PsfqyxxzM8K15HZADl/H5+sHpZwYfxyRjTs+kWwKBx8yoHd2mRiuzF8mkJniWH/13u3Fjrs/EdhsdDFHGB/DLXEJBDLh1MWPAhPo1BLB4WX5yQywHR+m3tVe/t97D52CB/ziG0nIgD/qDuYg8WuCcVZ2YGwlJ3YDugkpR/VNcAEx6GEKhERSr71FuO4YCM4XBdwKvecjIlkSnsO0Hyp/GxSeJAdzBKzpOtnPwyyiPdAZhpZptT04tU+zk7s8czeges//s5C5+CwqrR4/gw+AAAAABJRU5ErkJggg==); } /* Information icon encoded */ .IconInfoEncoded { /* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */ /* [---XsltValidateInternal-Base64EncodedImage:IconInformation#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABHElEQVR4Xs2TsUoDQRRF7wwoziokjZUKadInhdhukR9YP8DMX1hYW+QvdsXa/QHBbcXC7W0CamWTQnclFutceIQJwwaWNLlwm5k5d94M76mmaeCrrmsLYOocY12FcxZFUeozCqKqqgYA8uevv1H6VuPxcwlfk5N92KHBxfFeCSAxxswlYAW/Xr989x/mv9gkhtyMDhcAxgzRsp7flj8B/HF1RsMXq+NZMkopaHe7lbKxQUEIGbKsYNoGn969060hZBkQex/W8oRQwsQaW2o3Ago2SVcJUzAgY3N0lTCZZm+zPS8HB51gMmS1DEYyOz9acKO1D8JWTlafKIMxdhvlfdyT94Vv5h7P8Ky7nQzACmhvKq3zk3PjW9asz9D/1oigecsioooAAAAASUVORK5CYII=); } /* Warning icon encoded */ .IconWarningEncoded { /* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */ /* [---XsltValidateInternal-Base64EncodedImage:IconWarning#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAx0lEQVR4XpWSMQ7CMAxFf4xAyBMLCxMrO8dhaBcuwdCJS3RJBw7SA/QGTCxdWJgiQYWKXJWKIXHIlyw5lqr34tQgEOdcBsCOx5yZK3hCCKdYXneQkh4pEfqzLfu+wVDSyyzFoJjfz9NB+pAF+eizx2Vruts0k15mPgvS6GYvpVtQhB61IB/dk6AF6fS4Ben0uIX5odtFe8Q/eW1KvFeH4e8khT6+gm5B+t3juyDt7n0jpe+CANTd+oTUjN/U3yVaABnSUjFz/gFq44JaVSCXeQAAAABJRU5ErkJggg==); } /* Error icon encoded */ .IconErrorEncoded { /* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */ /* [---XsltValidateInternal-Base64EncodedImage:IconError#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABQElEQVR4XqWTvUoEQRCE6wYPZUA80AfwAQz23uCMjA7MDRQEIzPBVEyNTQUFIw00vcQTTMzuAh/AxEQQT8HF/3G/oGGnEUGuoNnd6qoZuqltyKEsyzVJq5I6rnUp6SjGeGhESikzzlc1eL7opfuVbrqbU1Zw9NCgtQMaZpY0eNnaaL2fHusvTK5vKu7sjSS1Y4y3QUA6K3e3Mau5UFDyMP7tYF9o8cAHZv68vipoIJg971PZIZ5HiwdvYGGvFVFHmGmZ2MxwmQYPXubPl9Up0tfoMQGetXd6mRbvhBw+boZ6WF7Mbv1+GsHRk0fQmPAH1GfmZirbCfDJ61tw3Px8/8pZsPAG4jlVhcPgZ7adwNWBB68lkRQWFiTgFlbnLY3DGGM7izIJIyT/jjIvEJw6fdJTc6krDzh6aMwMP9bvDH4ADSsa9uSWVJkAAAAASUVORK5CYII=); } </style> </head> <body> <h1 _locid="PortabilityReport">.NET Portability Report</h1> <div id="content"> <div id="submissionId" style="font-size:8pt;"> <p> <i> Submission Id&nbsp; b6ccbef0-e4a6-409b-a471-81834341cdb9 </i> </p> </div> <h2 _locid="SummaryTitle"> <a name="Portability Summary"></a>Portability Summary </h2> <div id="summary"> <table> <tbody> <tr> <th>Assembly</th> <th>ASP.NET 5,Version=v1.0</th> <th>Windows,Version=v8.1</th> <th>.NET Framework,Version=v4.6</th> <th>Windows Phone,Version=v8.1</th> </tr> <tr> <td><strong><a href="#Bytescout.BarCode.WPF">Bytescout.BarCode.WPF</a></strong></td> <td class="text-center">59.96 %</td> <td class="text-center">55.97 %</td> <td class="text-center">100.00 %</td> <td class="text-center">55.97 %</td> </tr> </tbody> </table> </div> <div id="details"> <a name="Bytescout.BarCode.WPF"><h3>Bytescout.BarCode.WPF</h3></a> <table> <tbody> <tr> <th>Target type</th> <th>ASP.NET 5,Version=v1.0</th> <th>Windows,Version=v8.1</th> <th>.NET Framework,Version=v4.6</th> <th>Windows Phone,Version=v8.1</th> <th>Recommended changes</th> </tr> <tr> <td>System.AppDomain</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Remove usage</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Collections.Hashtable</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.ComponentModel.BrowsableAttribute</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Remove usage. This is a deprecated attribute from Windows Forms for design-time property window support</td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Boolean)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Remove usage. This is a deprecated attribute from Winforms for design-time property window support</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.ComponentModel.CategoryAttribute</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.String)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.ComponentModel.DescriptionAttribute</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.String)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.ComponentModel.DesignerProperties</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">GetIsInDesignMode(System.Windows.DependencyObject)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.ComponentModel.ToolboxItemAttribute</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Boolean)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.ComponentModel.Win32Exception</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Configuration.ApplicationSettingsBase</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Configuration.SettingsBase</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">Synchronized(System.Configuration.SettingsBase)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Diagnostics.StackFrame</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Consider removing dependency on this API.</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Diagnostics.StackTrace</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Currently there is no workaround, but we are working on it. Please check back.</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Drawing.Bitmap</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Drawing.Image)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Int32,System.Int32)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">GetHbitmap</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Drawing.Brush</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Drawing.Color</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">FromArgb(System.Int32,System.Int32,System.Int32,System.Int32)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_A</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_B</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Beige</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_G</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_R</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">op_Inequality(System.Drawing.Color,System.Drawing.Color)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Drawing.Drawing2D.SmoothingMode</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Drawing.Font</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.String,System.Single,System.Drawing.GraphicsUnit)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_FontFamily</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Size</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Style</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Drawing.FontFamily</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Name</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Drawing.FontStyle</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Drawing.Graphics</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">FillRectangle(System.Drawing.Brush,System.Int32,System.Int32,System.Int32,System.Int32)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">FromImage(System.Drawing.Image)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Drawing.GraphicsUnit</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Drawing.Image</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">Dispose</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Height</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Width</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">Save(System.IO.Stream,System.Drawing.Imaging.ImageFormat)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Drawing.Imaging.ImageFormat</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Bmp</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Emf</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Exif</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Gif</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Icon</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Jpeg</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_MemoryBmp</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Png</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Tiff</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Wmf</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Drawing.Point</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Int32,System.Int32)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Drawing.Size</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">Empty</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Int32,System.Int32)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Height</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Width</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">set_Height(System.Int32)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">set_Width(System.Int32)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Drawing.SizeF</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Drawing.SolidBrush</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Drawing.Color)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Drawing.Text.TextRenderingHint</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.Assembly</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>typeof(CurrentType).GetTypeInfo().Assembly</td> </tr> <tr> <td style="padding-left:2em">GetExecutingAssembly</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>typeof(CurrentType).GetTypeInfo().Assembly</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.Binder</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Use an overload that does not take a Binder.</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.BindingFlags</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.Emit.AssemblyBuilder</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.Emit.AssemblyBuilderAccess</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.Emit.ILGenerator</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.Emit.Label</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.Emit.LocalBuilder</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.Emit.MethodBuilder</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.Emit.ModuleBuilder</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.Emit.ParameterBuilder</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.Emit.TypeBuilder</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.ObfuscationAttribute</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.ParameterModifier</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Use an overload that does not take a ParameterModifier array.</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Runtime.CompilerServices.SuppressIldasmAttribute</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Security.Cryptography.CryptoStream</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Security.Cryptography.CryptoStreamMode</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Security.Cryptography.DESCryptoServiceProvider</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Security.Cryptography.ICryptoTransform</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Security.Cryptography.SymmetricAlgorithm</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.String</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">Intern(System.String)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Type</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>.GetTypeInfo().Assembly</td> </tr> <tr> <td style="padding-left:2em">get_Assembly</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>.GetTypeInfo().Assembly</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Application</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Current</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_MainWindow</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Controls.Canvas</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.DependencyObject</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.DependencyProperty</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">OverrideMetadata(System.Type,System.Windows.PropertyMetadata)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">Register(System.String,System.Type,System.Type,System.Windows.PropertyMetadata)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.FontStretch</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">op_Equality(System.Windows.FontStretch,System.Windows.FontStretch)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.FontStretches</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Condensed</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Expanded</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_ExtraCondensed</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_ExtraExpanded</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Medium</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Normal</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_SemiCondensed</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_SemiExpanded</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_UltraCondensed</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_UltraExpanded</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.FontStyle</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.FontStyles</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Italic</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Normal</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.FontWeight</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.FontWeights</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Black</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Bold</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_DemiBold</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_ExtraBlack</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_ExtraBold</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_ExtraLight</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Heavy</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Light</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Medium</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Normal</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Thin</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.FrameworkElement</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">DefaultStyleKeyProperty</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">OnRenderSizeChanged(System.Windows.SizeChangedInfo)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.FrameworkPropertyMetadata</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Object)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Freezable</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">Freeze</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Int32Rect</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Int32,System.Int32,System.Int32,System.Int32)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Interop.Imaging</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">CreateBitmapSourceFromHBitmap(System.IntPtr,System.IntPtr,System.Windows.Int32Rect,System.Windows.Media.Imaging.BitmapSizeOptions)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Media.Color</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">FromArgb(System.Byte,System.Byte,System.Byte,System.Byte)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_A</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_B</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_G</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_R</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Media.CompositionTarget</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_TransformToDevice</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Media.DrawingContext</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">DrawImage(System.Windows.Media.ImageSource,System.Windows.Rect)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Media.FontFamily</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.String)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Source</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Media.ImageSource</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Media.Imaging.BitmapCacheOption</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Media.Imaging.BitmapCreateOptions</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Media.Imaging.BitmapDecoder</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">Create(System.IO.Stream,System.Windows.Media.Imaging.BitmapCreateOptions,System.Windows.Media.Imaging.BitmapCacheOption)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Frames</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Media.Imaging.BitmapFrame</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Media.Imaging.BitmapSizeOptions</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">FromWidthAndHeight(System.Int32,System.Int32)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Media.Imaging.BitmapSource</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Media.Imaging.WriteableBitmap</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Windows.Media.Imaging.BitmapSource)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Media.Matrix</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_M11</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_M22</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Media.Visual</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.PresentationSource</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">FromVisual(System.Windows.Media.Visual)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_CompositionTarget</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.PropertyMetadata</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Object)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Rect</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Double,System.Double,System.Double,System.Double)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.ResourceDictionaryLocation</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Size</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Empty</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Height</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Width</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">op_Equality(System.Windows.Size,System.Windows.Size)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">op_Inequality(System.Windows.Size,System.Windows.Size)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">set_Height(System.Double)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">set_Width(System.Double)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.SizeChangedInfo</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.ThemeInfoAttribute</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Windows.ResourceDictionaryLocation,System.Windows.ResourceDictionaryLocation)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.UIElement</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_RenderSize</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">InvalidateVisual</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Windows.Window</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </tbody> </table> <p> <a href="#Portability Summary">Back to Summary</a> </p> </div> </div> </body> </html>
Java
--- layout: page title: "James Kates" comments: true description: "blanks" keywords: "James Kates,CU,Boulder" --- <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script src="https://dl.dropboxusercontent.com/s/pc42nxpaw1ea4o9/highcharts.js?dl=0"></script> <!-- <script src="../assets/js/highcharts.js"></script> --> <style type="text/css">@font-face { font-family: "Bebas Neue"; src: url(https://www.filehosting.org/file/details/544349/BebasNeue Regular.otf) format("opentype"); } h1.Bebas { font-family: "Bebas Neue", Verdana, Tahoma; } </style> </head> #### TEACHING INFORMATION **College**: College of Arts and Sciences **Classes taught**: SLHS 5674, SLHS 6000 #### SLHS 5674: Signals and Systems in Audiology **Terms taught**: Fall 2008, Fall 2010, Fall 2012, Fall 2014 **Instructor rating**: 4.16 **Standard deviation in instructor rating**: 0.69 **Average grade** (4.0 scale): 3.48 **Standard deviation in grades** (4.0 scale): 0.1 **Average workload** (raw): 2.94 **Standard deviation in workload** (raw): 0.29 #### SLHS 6000: TPC-DIGTL SIGNL PRCESSNG **Terms taught**: Spring 2009 **Instructor rating**: 4.71 **Standard deviation in instructor rating**: 0.0 **Average grade** (4.0 scale): 3.48 **Standard deviation in grades** (4.0 scale): 0.0 **Average workload** (raw): 2.17 **Standard deviation in workload** (raw): 0.0
Java
const Nodelist = artifacts.require("./Nodelist.sol"); const BiathlonNode = artifacts.require("./BiathlonNode.sol"); const SecondNode = artifacts.require("./SecondNode.sol"); const BiathlonToken = artifacts.require("./BiathlonToken.sol"); const Ownable = artifacts.require('../contracts/ownership/Ownable.sol'); // const MintableToken = artifacts.require('MintableToken.sol'); const SecondBiathlonToken = artifacts.require("./SecondBiathlonToken.sol"); let nl; let bn; let bt; let sn; let st; contract('BiathlonToken', function(accounts) { beforeEach(async function() { bn = await BiathlonNode.deployed(); nl = await Nodelist.deployed(); bt = await BiathlonToken.deployed(); st = await SecondBiathlonToken.deployed(); sn = await SecondNode.deployed(); }); it('should have an owner', async function() { let owner = await bt.owner(); assert.isTrue(owner !== 0); }); it('should belong to the correct node', async function() { let node = await bt.node_address(); let bna = await bn.address; assert.equal(node, bna, "Token was not initialised to correct node"); }); it('should have a storage contract that is separate', async function() { let storage_address = await bt.storage_address(); assert.notEqual(storage_address, bt.address); }); it("should be able to register itself with the Node list of tokens", async function() { let registration = await bt.register_with_node(); let node_token_count = await bn.count_tokens(); assert.equal(node_token_count, 1, "Node array of tokens doesn't have deployed BiathlonToken"); }); it('should mint a given amount of tokens to a given address', async function() { const result = await bt.mint(accounts[0], 100, { from: accounts[0] }); assert.equal(result.logs[0].event, 'Mint'); assert.equal(result.logs[0].args.to.valueOf(), accounts[0]); assert.equal(result.logs[0].args.amount.valueOf(), 100); assert.equal(result.logs[1].event, 'Transfer'); assert.equal(result.logs[1].args.from.valueOf(), 0x0); let balance0 = await bt.balanceOf(accounts[0]); assert(balance0 == 100); let totalSupply = await bt.totalSupply(); assert.equal(totalSupply, 100); }) it('should allow owner to mint 50 to account #2', async function() { let result = await bt.mint(accounts[2], 50); assert.equal(result.logs[0].event, 'Mint'); assert.equal(result.logs[0].args.to.valueOf(), accounts[2]); assert.equal(result.logs[0].args.amount.valueOf(), 50); assert.equal(result.logs[1].event, 'Transfer'); assert.equal(result.logs[1].args.from.valueOf(), 0x0); let new_balance = await bt.balanceOf(accounts[2]); assert.equal(new_balance, 50, 'Owner could not mint 50 to account #2'); }); it('should have account #2 on registry after first token minting', async function() { let check_user = await nl.users(accounts[2]); assert.equal(check_user, bn.address); }); it('should spend 25 of the tokens minted to account #2', async function() { let result = await bt.spend(accounts[2], 25); assert.equal(result.logs[0].event, 'Burn'); let new_balance = await bt.balanceOf(accounts[2]); assert.equal(new_balance, 25); }); it('should have total supply changed by these minting and spending operations', async function() { let result = await bt.totalSupply(); assert.equal(result, 125); }); it('should not allow non-onwers to spend', async function() { try { let spendtask = await bt.spend(accounts[0], 1, {from: accounts[2]}) } catch (error) { const invalidJump = error.message.search('invalid opcode') >= 0; assert(invalidJump, "Expected throw, got '" + error + "' instead"); return; } assert.fail("Expected to reject spending from non-owner"); }); it('should not allow non-owners to mint', async function() { try { let minttask = await bt.mint(accounts[2], 50, {from: accounts[1]}); } catch (error) { const invalidJump = error.message.search('invalid opcode') >= 0; assert(invalidJump, "Expected throw, got '" + error + "' instead"); return; } assert.fail("Expected to reject minting from non-owner"); }); it('should not be able to spend more than it has', async function() { try { let spendtask = await bt.spend(accounts[2], 66) } catch (error) { const invalidJump = error.message.search('invalid opcode') >= 0; assert(invalidJump, "Expected throw, got '" + error + "' instead"); return; } assert.fail("Expected to reject spending more than limit"); }); it('second deployed token should belong to the correct node', async function() { let node = await st.node_address(); let bna = await bn.address; assert.equal(node, bna, "Token was not initialised to correct node"); }); it('second token should be able to upgrade the token with the node', async function() { let name = await st.name(); const upgraded = await bn.upgrade_token(bt.address, st.address, name); assert.equal(upgraded.logs[0].event, 'UpgradeToken'); let count_of_tokens = await bn.count_tokens(); assert.equal(count_of_tokens, 1, 'Should only be one token in tokenlist still'); }); it('should deactivate original token after upgrade', async function () { let tia = await bn.tokens.call(bt.address); assert.isNotTrue(tia[1]); let newtoken = await bn.tokens.call(st.address); assert.isTrue(newtoken[1]); }); it('should carry over the previous balances since storage contract is fixed', async function() { let get_balance = await st.balanceOf(accounts[2]); assert.equal(get_balance, 25); }); it('should not allow the deactivated contract to mint', async function() { try { let newmint = await bt.mint(accounts[2], 10); } catch(error) { const invalidJump = error.message.search('invalid opcode') >= 0; assert(invalidJump, "Expected throw, got '" + error + "' instead"); return; } assert.fail("Expected to reject spending more than limit"); }); it('should allow minting more tokens to accounts', async function() { let newmint = await st.mint(accounts[2], 3); let getbalance = await st.balanceOf(accounts[2]); let totalsupply = await st.totalSupply(); assert.equal(totalsupply, 128); assert.equal(getbalance, 28); }); it('should be able to transfer as contract owner from one account to another', async function() { let thetransfer = await st.biathlon_transfer(accounts[2], accounts[3], 2); let getbalance2 = await st.balanceOf(accounts[2]); let getbalance3 = await st.balanceOf(accounts[3]); assert.equal(getbalance2, 26); assert.equal(getbalance3, 2); }); it('should not be able to transfer as non-owner from one account to another', async function() { try { let thetransfer = await st.biathlon_transfer(accounts[3], accounts[4], 1, {from: accounts[1]}); } catch(error) { const invalidJump = error.message.search('invalid opcode') >= 0; assert(invalidJump, "Expected throw, got '" + error + "' instead"); return; } assert.fail("Expected to reject transfering from non-owner"); }) });
Java
package classfile import "encoding/binary" type ClassReader struct { data []byte } func (self *ClassReader) readUint8() uint8 { val := self.data[0] self.data = self.data[1:] return val } func (self *ClassReader) readUint16() uint16 { val := binary.BigEndian.Uint16(self.data) self.data = self.data[2:] return val } func (self *ClassReader) readUint32() uint32 { val := binary.BigEndian.Uint32(self.data) self.data = self.data[4:] return val } func (self *ClassReader) readUint64() uint64 { val := binary.BigEndian.Uint64(self.data) self.data = self.data[8:] return val } func (self *ClassReader) readUint16s() []uint16 { n := self.readUint16() s := make([]uint16, n) for i := range s { s[i] = self.readUint16() } return s } func (self *ClassReader) readBytes(n uint32) []byte { bytes := self.data[:n] self.data = self.data[n:] return bytes }
Java
import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.util.HashMap; import java.util.LinkedList; //this code contains the output assembly code that the program outputs. //will have at least three functions: //add(string, string, string, string) <- adds an assembly code line //optimise(int) <- optimises the output code, wherever possible //write(string) <- writes the code to the desired filename public class ASMCode { LinkedList<String> lines = new LinkedList<String>(); LinkedList<String> data = new LinkedList<String>(); HashMap<String, String> stringMap = new HashMap<String, String>(); LinkedList<lineWrapper> functionLines = new LinkedList<lineWrapper>(); boolean hasFCall; private interface lineWrapper { String compile(int stacksize, boolean funcCall); } private class stdLineWrapper implements lineWrapper { private String line; @Override public String compile(int stacksize, boolean funcCall) { return line; } public stdLineWrapper(String s) { line = s; } } private class functionReturnWrapper implements lineWrapper { @Override public String compile(int stacksize, boolean funcCall) { StringBuilder s = new StringBuilder(); if(stacksize != 0) { s.append("\tmov\tsp, fp"); s.append(System.getProperty("line.separator"));//system independent newline s.append("\tpop\tfp"); s.append(System.getProperty("line.separator")); } if(hasFCall) { s.append("\tpop\tra"); s.append(System.getProperty("line.separator")); } s.append("\tjmpr\tra"); return s.toString(); } } public void add(String inst, String reg1, String reg2, String reg3) { if(deadCode) return; String newInst = "\t"+inst; if(reg1 != null) { newInst = newInst + "\t" + reg1; if(reg2 != null) { newInst = newInst + ", " + reg2; if(reg3 != null) { newInst = newInst + ", " + reg3; } } } functionLines.addLast(new stdLineWrapper(newInst)); } public void add(String inst, String reg1, String reg2) { add(inst, reg1, reg2, null); } public void add(String inst, String reg1) { add(inst, reg1, null, null); } public void add(String inst) { add(inst, null, null, null); } int labIndex = 0; public String addString(String s) { //makes sure we don't have duplicate strings in memory if(stringMap.containsKey(s)) return stringMap.get(s); //generate a label String label = "string" + labIndex++; data.addLast(label+":"); data.addLast("#string " +s); stringMap.put(s, label); return label; } public void addGlobal(String data, String label) { //generate a label this.data.addLast(label+":"); this.data.addLast(data); } public void put(String s) { if(!deadCode) functionLines.addLast(new stdLineWrapper(s)); } private String fname; public void beginFunction(String name) { functionLines = new LinkedList<lineWrapper>(); fname = name; hasFCall = false; } public void endFunction(int varCount) { lines.addLast("#global " + fname); lines.addLast(fname+":"); if(hasFCall) { lines.addLast("\tpush\tra"); } if(varCount != 0) { lines.addLast("\tpush\tfp"); lines.addLast("\tmov\tfp, sp"); lines.addLast("\taddi\tsp, sp, " + varCount); } for(lineWrapper w : functionLines) { lines.addLast(w.compile(varCount, hasFCall)); } } public void setHasFCall() { if(deadCode) return; hasFCall = true; } public void functionReturn() { if(deadCode) return; functionLines.addLast(new functionReturnWrapper()); } public void write(String filename) { //System.out.println(".text"); //for(String s : lines) { // System.out.println(s); //} //System.out.println(".data"); //for(String s : data) { // System.out.println(s); //} System.out.println("Compilation successful!"); System.out.println("Writing..."); try { PrintWriter out = new PrintWriter(new FileWriter(filename+".asm")); out.println(".text"); for(String s : lines) { out.println(s); } out.println(".data"); for(String s : data) { out.println(s); } out.close(); } catch(IOException e) { System.out.println("Writing failed"); return; } System.out.println("Program created!"); } boolean deadCode; public void deadCode(boolean codeIsDead) { deadCode = codeIsDead; } }
Java
import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core'; import { Filter, FilterType } from 'lib/filter'; @Component({ selector: 'iw-filter-input', templateUrl: './filter-input.component.html', styleUrls: ['./filter-input.component.css'] }) export class FilterInputComponent implements OnInit { @Input() filter: Filter; @Output() change = new EventEmitter<Filter>(); constructor() { } ngOnInit() { } get FilterType() { return FilterType; } applyFilter(filter: Filter, value: string) { filter.value = value; this.change.emit(filter); } itemsForField(filter: Filter) { if (filter.options) { return filter.options; } // put to initialization // if (!this.rows) { return []; } // const items = []; // this.rows.forEach((r) => { // if (items.indexOf(r[filter.key]) < 0) { // items.push(r[filter.key]); // } // }); // return items; } } /* filterData(key: string, value: any) { let filter: Filter = this.filters .find((f) => f.key === key); if (!filter) { filter = { type: FilterType.String, key, value }; this.filters.push(filter); } else { // overwritte previous value filter.value = value; } this.filterChange.emit(); } } */
Java
var express = require('express'); var bodyParser = require('body-parser'); var fs = require('fs') var app = express(); var lostStolen = require('mastercard-lost-stolen'); var MasterCardAPI = lostStolen.MasterCardAPI; var dummyData = []; var dummyDataFiles = ['www/data/menu.json', 'www/data/account-number.json']; dummyDataFiles.forEach(function(file) { fs.readFile(file, 'utf8', function(err, data) { if (err) { return console.log(err); } dummyData[file] = JSON.parse(data); }); }); var config = { p12file: process.env.KEY_FILE || null, p12pwd: process.env.KEY_FILE_PWD || 'keystorepassword', p12alias: process.env.KEY_FILE_ALIAS || 'keyalias', apiKey: process.env.API_KEY || null, sandbox: process.env.SANDBOX || 'true', } var useDummyData = null == config.p12file; if (useDummyData) { console.log('p12 file info missing, using dummy data') } else { console.log('has p12 file info, using MasterCardAPI') var authentication = new MasterCardAPI.OAuth(config.apiKey, config.p12file, config.p12alias, config.p12pwd); MasterCardAPI.init({ sandbox: 'true' === config.sandbox, authentication: authentication }); } app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); app.use(express.static('www')); app.post('/menu', function(req, res) { res.json(dummyData[dummyDataFiles[0]]); }); app.post('/orders', function(req, res) { res.json({}); }); app.post('/confirm', function(req, res) { res.json({}); }); app.post('/checkAccountNumber', function(req, res) { if (useDummyData) { if (null == dummyData[dummyDataFiles[1]][req.body.accountNumber]) { res.json(dummyData[dummyDataFiles[1]].default); } else { res.json(dummyData[dummyDataFiles[1]][req.body.accountNumber]); } } else { var requestData = { "AccountInquiry": { "AccountNumber": req.body.accountNumber } }; lostStolen.AccountInquiry.update(requestData, function(error, data) { if (error) { res.json({ "type": "APIError", "message": "Error executing API call", "status": 400, "data": { "Errors": { "Error": { "Source": "Unknown", "ReasonCode": "UNKNOWN", "Description": "Unknown error", "Recoverable": "false" } } } }); } else { res.json(data); } }); } }); app.listen(3000, function() { console.log('Example app listening on port 3000!'); });
Java
var express = require('express'); var router = express.Router(); /* GET home page. */ router.get('/', function(req, res, next) { res.render('index', { title: 'Express' }); }); router.get('/about', function(req, res, next) { res.render('about', { title: 'About' }); }); module.exports = router;
Java
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("10. Advanced Retake Exam - 22 August 2016")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("10. Advanced Retake Exam - 22 August 2016")] [assembly: AssemblyCopyright("Copyright © 2017")] [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("8171b56b-59dc-4347-98ad-21d0c4690715")] // 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")]
Java
<!-- Copyright 2005-2008 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://stlab.adobe.com/licenses.html) Some files are held under additional license. Please see "http://stlab.adobe.com/licenses.html" for more information. --> <!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" lang="en" xml:lang="en"> <head> <TITLE>Adobe Software Technology Lab: Member List</TITLE> <META HTTP-EQUIV="content-type" CONTENT="text/html;charset=ISO-8859-1"/> <LINK TYPE="text/css" REL="stylesheet" HREF="adobe_source.css"/> <LINK REL="alternate" TITLE="stlab.adobe.com RSS" HREF="http://sourceforge.net/export/rss2_projnews.php?group_id=132417&amp;rss_fulltext=1" TYPE="application/rss+xml"/> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script> </head> <body> <div id='content'> <table><tr> <td colspan='5'> <div id='opensource_banner'> <table style='width: 100%; padding: 5px;'><tr> <td align='left'> <a href='index.html' style='border: none'><img src='stlab2007.jpg' alt="stlab.adobe.com"/></a> </td> <td align='right'> <a href='http://www.adobe.com' style='border: none'><img src='adobe_hlogo.gif' alt="Adobe Systems Incorporated"/></a> </td> </tr></table> </div> </td></tr><tr> <td valign="top"> <div id='navtable' height='100%'> <div style='margin: 5px'> <h4>Documentation</h4> <a href="group__asl__overview.html">Overview</a><br/> <a href="asl_readme.html">Building ASL</a><br/> <a href="asl_toc.html">Documentation</a><br/> <a href="http://stlab.adobe.com/wiki/index.php/Supplementary_ASL_Documentation">Library Wiki Docs</a><br/> <a href="asl_indices.html">Indices</a><br/> <a href="http://stlab.adobe.com/perforce/">Browse Perforce</a><br/> <h4>More Info</h4> <a href="asl_release_notes.html">Release Notes</a><br/> <a href="http://stlab.adobe.com/wiki/">Wiki</a><br/> <a href="asl_search.html">Site Search</a><br/> <a href="licenses.html">License</a><br/> <a href="success_stories.html">Success Stories</a><br/> <a href="asl_contributors.html">Contributors</a><br/> <h4>Media</h4> <a href="http://sourceforge.net/project/showfiles.php?group_id=132417&amp;package_id=145420">Download</a><br/> <a href="asl_download_perforce.html">Perforce Depots</a><br/> <h4>Support</h4> <a href="http://sourceforge.net/projects/adobe-source/">ASL SourceForge Home</a><br/> <a href="http://sourceforge.net/mail/?group_id=132417">Mailing Lists</a><br/> <a href="http://sourceforge.net/forum/?group_id=132417">Discussion Forums</a><br/> <a href="http://sourceforge.net/tracker/?atid=724218&amp;group_id=132417&amp;func=browse">Report Bugs</a><br/> <a href="http://sourceforge.net/tracker/?atid=724221&amp;group_id=132417&amp;func=browse">Suggest Features</a><br/> <a href="asl_contributing.html">Contribute to ASL</a><br/> <h4>RSS</h4> <a href="http://sourceforge.net/export/rss2_projnews.php?group_id=132417">Short-text news</a><br/> <a href="http://sourceforge.net/export/rss2_projnews.php?group_id=132417&amp;rss_fulltext=1">Full-text news</a><br/> <a href="http://sourceforge.net/export/rss2_projfiles.php?group_id=132417">File releases</a><br/> <h4>Other Adobe Projects</h4> <a href="http://sourceforge.net/adobe/">Open @ Adobe</a><br/> <a href="http://opensource.adobe.com/">Adobe Open Source</a><br/> <a href="http://labs.adobe.com/">Adobe Labs</a><br/> <a href="http://stlab.adobe.com/amg/">Adobe Media Gallery</a><br/> <a href="http://stlab.adobe.com/performance/">C++ Benchmarks</a><br/> <h4>Other Resources</h4> <a href="http://boost.org">Boost</a><br/> <a href="http://www.riaforge.com/">RIAForge</a><br/> <a href="http://www.sgi.com/tech/stl">SGI STL</a><br/> </div> </div> </td> <td id='maintable' width="100%" valign="top"> <!-- End Header --> <!-- Generated by Doxygen 1.7.2 --> <div class="header"> <div class="headertitle"> <h1>unary_compose&lt; F, G &gt; Member List</h1> </div> </div> <div class="contents"> This is the complete list of members for <a class="el" href="structadobe_1_1unary__compose.html">unary_compose&lt; F, G &gt;</a>, including all inherited members.<table> <tr class="memlist"><td><a class="el" href="structadobe_1_1unary__compose.html#ae8e3eb881d7aa88edb168fe626cca8f0">operator()</a>(const U &amp;x) const </td><td><a class="el" href="structadobe_1_1unary__compose.html">unary_compose&lt; F, G &gt;</a></td><td></td></tr> <tr class="memlist"><td><a class="el" href="structadobe_1_1unary__compose.html#afd30a06f605c1dbd8aea1206cb6fcd6f">operator()</a>(U &amp;x) const </td><td><a class="el" href="structadobe_1_1unary__compose.html">unary_compose&lt; F, G &gt;</a></td><td></td></tr> <tr class="memlist"><td><a class="el" href="structadobe_1_1unary__compose.html#a4cf2df542e3bed6ef93ff54d61aa8844">result_type</a> typedef</td><td><a class="el" href="structadobe_1_1unary__compose.html">unary_compose&lt; F, G &gt;</a></td><td></td></tr> <tr class="memlist"><td><a class="el" href="structadobe_1_1unary__compose.html#ae6c9f90e50c0c070cc48371950b81071">unary_compose</a>()</td><td><a class="el" href="structadobe_1_1unary__compose.html">unary_compose&lt; F, G &gt;</a></td><td></td></tr> <tr class="memlist"><td><a class="el" href="structadobe_1_1unary__compose.html#a3fd198d939304e15f7fc66ca74ef2556">unary_compose</a>(F f, G g)</td><td><a class="el" href="structadobe_1_1unary__compose.html">unary_compose&lt; F, G &gt;</a></td><td></td></tr> </table></div> <!-- Begin Footer --> </td></tr> </table> </div> <!-- content --> <div class='footerdiv'> <div id='footersub'> <ul> <li><a href="http://www.adobe.com/go/gftray_foot_aboutadobe">Company</a>&nbsp;|&nbsp;</li> <li><a href="http://www.adobe.com/go/gftray_foot_privacy_security">Online Privacy Policy</a>&nbsp;|&nbsp;</li> <li><a href="http://www.adobe.com/go/gftray_foot_terms">Terms of Use</a>&nbsp;|&nbsp;</li> <li><a href="http://www.adobe.com/go/gftray_foot_contact_adobe">Contact Us</a>&nbsp;|&nbsp;</li> <li><a href="http://www.adobe.com/go/gftray_foot_accessibility">Accessibility</a>&nbsp;|&nbsp;</li> <li><a href="http://www.adobe.com/go/gftray_foot_report_piracy">Report Piracy</a>&nbsp;|&nbsp;</li> <li><a href="http://www.adobe.com/go/gftray_foot_permissions_trademarks">Permissions &amp; Trademarks</a>&nbsp;|&nbsp;</li> <li><a href="http://www.adobe.com/go/gftray_foot_product_license_agreements">Product License Agreements</a>&nbsp;|&nbsp;</li> <li><a href="http://www.adobe.com/go/gftray_foot_feedback">Send Feedback</a></li> </ul> <div> <p>Copyright &#169; 2006-2007 Adobe Systems Incorporated.</p> <p>Use of this website signifies your agreement to the <a href="http://www.adobe.com/go/gftray_foot_terms">Terms of Use</a> and <a href="http://www.adobe.com/go/gftray_foot_privacy_security">Online Privacy Policy</a>.</p> <p>Search powered by <a href="http://www.google.com/" target="new">Google</a></p> </div> </div> </div> <script type="text/javascript"> _uacct = "UA-396569-1"; urchinTracker(); </script> </body> </html>
Java
# Stomp example ## How to use ### Using `create-next-app` Execute [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app) with [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) or [npx](https://github.com/zkat/npx#readme) to bootstrap the example: ```bash npx create-next-app --example with-stomp with-stomp-app # or yarn create next-app --example with-stomp with-stomp-app ``` ### Download manually Download the example: ```bash curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-stomp cd with-stomp ``` Install it and run: ```bash npm install STOMP_SERVER=wss://some.stomp.server npm run dev # or yarn STOMP_SERVER=wss://some.stomp.server yarn dev ``` You'll need to provide the STOMP url of your server in `STOMP_SERVER` > If you're on Windows you may want to use [cross-env](https://www.npmjs.com/package/cross-env) ## The idea behind the example This example show how to use [STOMP](http://stomp.github.io/) inside a Next.js application. STOMP is a simple text-orientated messaging protocol. It defines an interoperable wire format so that any of the available STOMP clients can communicate with any STOMP message broker. Read more about [STOMP](http://jmesnil.net/stomp-websocket/doc/) protocol.
Java
// <auto-generated /> namespace Surplus.Migrations { using System.CodeDom.Compiler; using System.Data.Entity.Migrations; using System.Data.Entity.Migrations.Infrastructure; using System.Resources; [GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")] public sealed partial class EstValueMaxMin : IMigrationMetadata { private readonly ResourceManager Resources = new ResourceManager(typeof(EstValueMaxMin)); string IMigrationMetadata.Id { get { return "201504291914587_EstValueMaxMin"; } } string IMigrationMetadata.Source { get { return null; } } string IMigrationMetadata.Target { get { return Resources.GetString("Target"); } } } }
Java
''' salt.utils ~~~~~~~~~~ ''' class lazy_property(object): ''' meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself. http://stackoverflow.com/a/6849299/564003 ''' def __init__(self, fget): self.fget = fget self.func_name = fget.__name__ def __get__(self, obj, cls): if obj is None: return None value = self.fget(obj) setattr(obj, self.func_name, value) return value
Java
/* File: Reachability.h Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. Version: 2.1 Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this Apple software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in this original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the Apple Software, with or without modifications, in source and/or binary forms; provided that if you redistribute the Apple Software in its entirety and without modifications, you must retain this notice and the following text and disclaimers in all such redistributions of the Apple Software. Neither the name, trademarks, service marks or logos of Apple Inc. may be used to endorse or promote products derived from the Apple Software without specific prior written permission from Apple. Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by Apple herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Copyright (C) 2010 Apple Inc. All Rights Reserved. */ #import <Foundation/Foundation.h> #import <SystemConfiguration/SystemConfiguration.h> typedef enum { NotReachable = 0, ReachableViaWiFi, ReachableViaWWAN } NetworkStatus; #define kReachabilityChangedNotification @"kNetworkReachabilityChangedNotification" @interface Reachability: NSObject { BOOL localWiFiRef; SCNetworkReachabilityRef reachabilityRef; } //reachabilityWithHostName- Use to check the reachability of a particular host name. + (Reachability*) reachabilityWithHostName: (NSString*) hostName; //reachabilityWithAddress- Use to check the reachability of a particular IP address. + (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress; //reachabilityForInternetConnection- checks whether the default route is available. // Should be used by applications that do not connect to a particular host + (Reachability*) reachabilityForInternetConnection; //reachabilityForLocalWiFi- checks whether a local wifi connection is available. + (Reachability*) reachabilityForLocalWiFi; //Start listening for reachability notifications on the current run loop - (BOOL) startNotifier; - (void) stopNotifier; - (NetworkStatus) currentReachabilityStatus; //WWAN may be available, but not active until a connection has been established. //WiFi may require a connection for VPN on Demand. - (BOOL) connectionRequired; @end
Java
require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module FlashFinalProject class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. # config.time_zone = 'Central Time (US & Canada)' # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.default_locale = :de # Do not swallow errors in after_commit/after_rollback callbacks. config.active_record.raise_in_transactional_callbacks = true end end
Java
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Leap; namespace LeapMIDI { class LeapStuff { private Controller controller = new Controller(); public float posX { get; private set; } public float posY { get; private set; } public float posZ { get; private set; } public float velX { get; private set; } public float velY { get; private set; } public float velZ { get; private set; } public float pinch { get; private set; } public string info { get; private set; } public LeapStuff() { //controller.EnableGesture(Gesture.GestureType.; controller.SetPolicy(Controller.PolicyFlag.POLICY_BACKGROUND_FRAMES); } internal void Update() { Frame frame = controller.Frame(); info = "Connected: " + controller.IsConnected + "\n" + "Frame ID: " + frame.Id + "\n" + "Hands: " + frame.Hands.Count + "\n" + "Fingers: " + frame.Fingers.Count + "\n\n"; if (frame.Hands.Count == 1) { info += "Hand #1 Position X:" + frame.Hands[0].PalmPosition.x + "\n"; info += "Hand #1 Position Y:" + frame.Hands[0].PalmPosition.y + "\n"; info += "Hand #1 Position Z:" + frame.Hands[0].PalmPosition.z + "\n\n"; info += "Hand #1 Velocity X:" + frame.Hands[0].PalmVelocity.x + "\n"; info += "Hand #1 Velocity Y:" + frame.Hands[0].PalmVelocity.y + "\n"; info += "Hand #1 Velocity Z:" + frame.Hands[0].PalmVelocity.z + "\n"; info += "Hand #1 Pinch:" + frame.Hands[0].PinchStrength + "\n"; posX = frame.Hands[0].PalmPosition.x; posY = frame.Hands[0].PalmPosition.y; posZ = frame.Hands[0].PalmPosition.z; velX = frame.Hands[0].PalmVelocity.x; velY = frame.Hands[0].PalmVelocity.y; velZ = frame.Hands[0].PalmVelocity.z; pinch = frame.Hands[0].PinchStrength; } else { velX = 0; velY = 0; velZ = 0; pinch = 0; } } } }
Java
// // Created by Aman LaChapelle on 5/26/17. // // pytorch_inference // Copyright (c) 2017 Aman LaChapelle // Full license at pytorch_inference/LICENSE.txt // #include "../include/layers.hpp" #include "utils.hpp" int main(){ std::vector<pytorch::tensor> tests = test_setup({1, 1, 1}, {2, 2, 2}, {45, 45, 45}, {50, 50, 50}, {1}, {2}, {45}, {50}, {"test_prod1.dat", "test_prod2.dat", "test_prod3.dat"}, "test_prod"); // tests has {input1, input2, input3, pytorch_output} pytorch::Product p(pytorch::k, 3); af::timer::start(); pytorch::tensor prod; for (int j = 49; j >= 0; j--){ prod = p({tests[0], tests[1], tests[2]})[0]; prod.eval(); } af::sync(); std::cout << "arrayfire forward took (s): " << af::timer::stop()/50 << "(avg)" << std::endl; assert(almost_equal(prod, tests[3])); }
Java
package com.github.weeniearms.graffiti; import com.github.weeniearms.graffiti.config.CacheConfiguration; import com.github.weeniearms.graffiti.generator.GraphGenerator; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import java.io.IOException; import java.util.Arrays; @Service public class GraphService { private final GraphGenerator[] generators; @Autowired public GraphService(GraphGenerator[] generators) { this.generators = generators; } @Cacheable(CacheConfiguration.GRAPH) public byte[] generateGraph(String source, GraphGenerator.OutputFormat format) throws IOException { GraphGenerator generator = Arrays.stream(generators) .filter(g -> g.isSourceSupported(source)) .findFirst() .orElseThrow(() -> new IllegalArgumentException("No matching generator found for source")); return generator.generateGraph(source, format); } }
Java
//this source code was auto-generated by tolua#, do not modify it using System; using LuaInterface; public class UnityEngine_SkinnedMeshRendererWrap { public static void Register(LuaState L) { L.BeginClass(typeof(UnityEngine.SkinnedMeshRenderer), typeof(UnityEngine.Renderer)); L.RegFunction("BakeMesh", BakeMesh); L.RegFunction("GetBlendShapeWeight", GetBlendShapeWeight); L.RegFunction("SetBlendShapeWeight", SetBlendShapeWeight); L.RegFunction("New", _CreateUnityEngine_SkinnedMeshRenderer); L.RegFunction("__eq", op_Equality); L.RegFunction("__tostring", ToLua.op_ToString); L.RegVar("bones", get_bones, set_bones); L.RegVar("rootBone", get_rootBone, set_rootBone); L.RegVar("quality", get_quality, set_quality); L.RegVar("sharedMesh", get_sharedMesh, set_sharedMesh); L.RegVar("updateWhenOffscreen", get_updateWhenOffscreen, set_updateWhenOffscreen); L.RegVar("skinnedMotionVectors", get_skinnedMotionVectors, set_skinnedMotionVectors); L.RegVar("localBounds", get_localBounds, set_localBounds); L.EndClass(); } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _CreateUnityEngine_SkinnedMeshRenderer(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 0) { UnityEngine.SkinnedMeshRenderer obj = new UnityEngine.SkinnedMeshRenderer(); ToLua.Push(L, obj); return 1; } else { return LuaDLL.luaL_throw(L, "invalid arguments to ctor method: UnityEngine.SkinnedMeshRenderer.New"); } } catch(Exception e) { return LuaDLL.toluaL_exception(L, e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int BakeMesh(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UnityEngine.SkinnedMeshRenderer obj = (UnityEngine.SkinnedMeshRenderer)ToLua.CheckObject(L, 1, typeof(UnityEngine.SkinnedMeshRenderer)); UnityEngine.Mesh arg0 = (UnityEngine.Mesh)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.Mesh)); obj.BakeMesh(arg0); return 0; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int GetBlendShapeWeight(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UnityEngine.SkinnedMeshRenderer obj = (UnityEngine.SkinnedMeshRenderer)ToLua.CheckObject(L, 1, typeof(UnityEngine.SkinnedMeshRenderer)); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); float o = obj.GetBlendShapeWeight(arg0); LuaDLL.lua_pushnumber(L, o); return 1; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int SetBlendShapeWeight(IntPtr L) { try { ToLua.CheckArgsCount(L, 3); UnityEngine.SkinnedMeshRenderer obj = (UnityEngine.SkinnedMeshRenderer)ToLua.CheckObject(L, 1, typeof(UnityEngine.SkinnedMeshRenderer)); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); float arg1 = (float)LuaDLL.luaL_checknumber(L, 3); obj.SetBlendShapeWeight(arg0, arg1); return 0; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int op_Equality(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UnityEngine.Object arg0 = (UnityEngine.Object)ToLua.ToObject(L, 1); UnityEngine.Object arg1 = (UnityEngine.Object)ToLua.ToObject(L, 2); bool o = arg0 == arg1; LuaDLL.lua_pushboolean(L, o); return 1; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int get_bones(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.SkinnedMeshRenderer obj = (UnityEngine.SkinnedMeshRenderer)o; UnityEngine.Transform[] ret = obj.bones; ToLua.Push(L, ret); return 1; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index bones on a nil value" : e.Message); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int get_rootBone(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.SkinnedMeshRenderer obj = (UnityEngine.SkinnedMeshRenderer)o; UnityEngine.Transform ret = obj.rootBone; ToLua.Push(L, ret); return 1; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index rootBone on a nil value" : e.Message); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int get_quality(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.SkinnedMeshRenderer obj = (UnityEngine.SkinnedMeshRenderer)o; UnityEngine.SkinQuality ret = obj.quality; ToLua.Push(L, ret); return 1; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index quality on a nil value" : e.Message); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int get_sharedMesh(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.SkinnedMeshRenderer obj = (UnityEngine.SkinnedMeshRenderer)o; UnityEngine.Mesh ret = obj.sharedMesh; ToLua.Push(L, ret); return 1; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index sharedMesh on a nil value" : e.Message); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int get_updateWhenOffscreen(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.SkinnedMeshRenderer obj = (UnityEngine.SkinnedMeshRenderer)o; bool ret = obj.updateWhenOffscreen; LuaDLL.lua_pushboolean(L, ret); return 1; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index updateWhenOffscreen on a nil value" : e.Message); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int get_skinnedMotionVectors(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.SkinnedMeshRenderer obj = (UnityEngine.SkinnedMeshRenderer)o; bool ret = obj.skinnedMotionVectors; LuaDLL.lua_pushboolean(L, ret); return 1; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index skinnedMotionVectors on a nil value" : e.Message); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int get_localBounds(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.SkinnedMeshRenderer obj = (UnityEngine.SkinnedMeshRenderer)o; UnityEngine.Bounds ret = obj.localBounds; ToLua.Push(L, ret); return 1; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index localBounds on a nil value" : e.Message); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int set_bones(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.SkinnedMeshRenderer obj = (UnityEngine.SkinnedMeshRenderer)o; UnityEngine.Transform[] arg0 = ToLua.CheckObjectArray<UnityEngine.Transform>(L, 2); obj.bones = arg0; return 0; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index bones on a nil value" : e.Message); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int set_rootBone(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.SkinnedMeshRenderer obj = (UnityEngine.SkinnedMeshRenderer)o; UnityEngine.Transform arg0 = (UnityEngine.Transform)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.Transform)); obj.rootBone = arg0; return 0; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index rootBone on a nil value" : e.Message); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int set_quality(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.SkinnedMeshRenderer obj = (UnityEngine.SkinnedMeshRenderer)o; UnityEngine.SkinQuality arg0 = (UnityEngine.SkinQuality)ToLua.CheckObject(L, 2, typeof(UnityEngine.SkinQuality)); obj.quality = arg0; return 0; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index quality on a nil value" : e.Message); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int set_sharedMesh(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.SkinnedMeshRenderer obj = (UnityEngine.SkinnedMeshRenderer)o; UnityEngine.Mesh arg0 = (UnityEngine.Mesh)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.Mesh)); obj.sharedMesh = arg0; return 0; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index sharedMesh on a nil value" : e.Message); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int set_updateWhenOffscreen(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.SkinnedMeshRenderer obj = (UnityEngine.SkinnedMeshRenderer)o; bool arg0 = LuaDLL.luaL_checkboolean(L, 2); obj.updateWhenOffscreen = arg0; return 0; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index updateWhenOffscreen on a nil value" : e.Message); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int set_skinnedMotionVectors(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.SkinnedMeshRenderer obj = (UnityEngine.SkinnedMeshRenderer)o; bool arg0 = LuaDLL.luaL_checkboolean(L, 2); obj.skinnedMotionVectors = arg0; return 0; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index skinnedMotionVectors on a nil value" : e.Message); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int set_localBounds(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.SkinnedMeshRenderer obj = (UnityEngine.SkinnedMeshRenderer)o; UnityEngine.Bounds arg0 = ToLua.ToBounds(L, 2); obj.localBounds = arg0; return 0; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index localBounds on a nil value" : e.Message); } } }
Java
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>modelY() \ Language (API) \ Processing 2+</title> <link rel="icon" href="/favicon.ico" type="image/x-icon" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="Author" content="Processing Foundation" /> <meta name="Publisher" content="Processing Foundation" /> <meta name="Keywords" content="Processing, Sketchbook, Programming, Coding, Code, Art, Design" /> <meta name="Description" content="Processing is a flexible software sketchbook and a language for learning how to code within the context of the visual arts. Since 2001, Processing has promoted software literacy within the visual arts and visual literacy within technology." /> <meta name="Copyright" content="All contents copyright the Processing Foundation, Ben Fry, Casey Reas, and the MIT Media Laboratory" /> <script src="javascript/modernizr-2.6.2.touch.js" type="text/javascript"></script> <link href="css/style.css" rel="stylesheet" type="text/css" /> </head> <body id="Langauge-en" onload="" > <!-- ==================================== PAGE ============================ --> <div id="container"> <!-- ==================================== HEADER ============================ --> <div id="ribbon"> <ul class="left"> <li class="highlight"><a href="http://processing.org/">Processing</a></li> <li><a href="http://p5js.org/">p5.js</a></li> <li><a href="http://py.processing.org/">Processing.py</a></li> <li><a href="http://android.processing.org/">Processing for Android</a></li> </ul> <ul class="right"> <li><a href="https://processingfoundation.org/">Processing Foundation</a></li> </ul> <div class="clear"></div> </div> <div id="header"> <a href="/" title="Back to the Processing cover."><div class="processing-logo no-cover" alt="Processing cover"></div></a> <form name="search" method="get" action="//www.google.com/search"> <p><input type="hidden" name="as_sitesearch" value="processing.org" /> <input type="text" name="as_q" value="" size="20" class="text" /> <input type="submit" value=" " /></p> </form> </div> <a id="TOP" name="TOP"></a> <div id="navigation"> <div class="navBar" id="mainnav"> <a href="index.html" class='active'>Language</a><br> <a href="libraries/index.html" >Libraries</a><br> <a href="tools/index.html">Tools</a><br> <a href="environment/index.html">Environment</a><br> </div> <script> document.querySelectorAll(".processing-logo")[0].className = "processing-logo"; </script> </div> <!-- ==================================== CONTENT - Headers ============================ --> <div class="content"> <p class="ref-notice">This reference is for Processing 3.0+. If you have a previous version, use the reference included with your software in the Help menu. If you see any errors or have suggestions, <a href="https://github.com/processing/processing-docs/issues?state=open">please let us know</a>. If you prefer a more technical reference, visit the <a href="http://processing.github.io/processing-javadocs/core/">Processing Core Javadoc</a> and <a href="http://processing.github.io/processing-javadocs/libraries/">Libraries Javadoc</a>.</p> <table cellpadding="0" cellspacing="0" border="0" class="ref-item"> <tr class="name-row"> <th scope="row">Name</th> <td><h3>modelY()</h3></td> </tr> <tr class=""> <tr class=""><th scope="row">Examples</th><td><div class="example"><pre > void setup() { size(500, 500, P3D); noFill(); } void draw() { background(0); pushMatrix(); // start at the middle of the screen translate(width/2, height/2, -200); // some random rotation to make things interesting rotateY(1.0); //yrot); rotateZ(2.0); //zrot); // rotate in X a little more each frame rotateX(frameCount / 100.0); // offset from center translate(0, 150, 0); // draw a white box outline at (0, 0, 0) stroke(255); box(50); // the box was drawn at (0, 0, 0), store that location float x = modelX(0, 0, 0); float y = modelY(0, 0, 0); float z = modelZ(0, 0, 0); // clear out all the transformations popMatrix(); // draw another box at the same (x, y, z) coordinate as the other pushMatrix(); translate(x, y, z); stroke(255, 0, 0); box(50); popMatrix(); } </pre></div> </td></tr> <tr class=""> <th scope="row">Description</th> <td> Returns the three-dimensional X, Y, Z position in model space. This returns the Y value for a given coordinate based on the current set of transformations (scale, rotate, translate, etc.) The Y value can be used to place an object in space relative to the location of the original point once the transformations are no longer in use.<br /> <br /> In the example, the <b>modelX()</b>, <b>modelY()</b>, and <b>modelZ()</b> functions record the location of a box in space after being placed using a series of translate and rotate commands. After popMatrix() is called, those transformations no longer apply, but the (x, y, z) coordinate returned by the model functions is used to place another box in the same location. </td> </tr> <tr class=""><th scope="row">Syntax</th><td><pre>modelY(<kbd>x</kbd>, <kbd>y</kbd>, <kbd>z</kbd>)</pre></td></tr> <tr class=""> <th scope="row">Parameters</th><td><table cellpadding="0" cellspacing="0" border="0"><tr class=""> <th scope="row" class="code">x</th> <td>float: 3D x-coordinate to be mapped</td> </tr> <tr class=""> <th scope="row" class="code">y</th> <td>float: 3D y-coordinate to be mapped</td> </tr> <tr class=""> <th scope="row" class="code">z</th> <td>float: 3D z-coordinate to be mapped</td> </tr></table></td> </tr> <tr class=""><th scope="row">Returns</th><td class="code">float</td></tr> <tr class=""><th scope="row">Related</th><td><a class="code" href="modelX_.html">modelX()</a><br /> <a class="code" href="modelZ_.html">modelZ()</a><br /></td></tr> </table> Updated on July 30, 2016 04:31:58am EDT<br /><br /> <!-- Creative Commons License --> <div class="license"> <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border: none" src="http://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" /></a> </div> <!-- <?xpacket begin='' id=''?> <x:xmpmeta xmlns:x='adobe:ns:meta/'> <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'> <rdf:Description rdf:about='' xmlns:xapRights='http://ns.adobe.com/xap/1.0/rights/'> <xapRights:Marked>True</xapRights:Marked> </rdf:Description> <rdf:Description rdf:about='' xmlns:xapRights='http://ns.adobe.com/xap/1.0/rights/' > <xapRights:UsageTerms> <rdf:Alt> <rdf:li xml:lang='x-default' >This work is licensed under a &lt;a rel=&#34;license&#34; href=&#34;http://creativecommons.org/licenses/by-nc-sa/4.0/&#34;&gt;Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License&lt;/a&gt;.</rdf:li> <rdf:li xml:lang='en' >This work is licensed under a &lt;a rel=&#34;license&#34; href=&#34;http://creativecommons.org/licenses/by-nc-sa/4.0/&#34;&gt;Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License&lt;/a&gt;.</rdf:li> </rdf:Alt> </xapRights:UsageTerms> </rdf:Description> <rdf:Description rdf:about='' xmlns:cc='http://creativecommons.org/ns#'> <cc:license rdf:resource='http://creativecommons.org/licenses/by-nc-sa/4.0/'/> </rdf:Description> </rdf:RDF> </x:xmpmeta> <?xpacket end='r'?> --> </div> <!-- ==================================== FOOTER ============================ --> <div id="footer"> <div id="copyright">Processing is an open project intiated by <a href="http://benfry.com/">Ben Fry</a> and <a href="http://reas.com">Casey Reas</a>. It is developed by a <a href="http://processing.org/about/people/">team of volunteers</a>.</div> <div id="colophon"> <a href="copyright.html">&copy; Info</a> </div> </div> </div> <script src="javascript/jquery-1.9.1.min.js"></script> <script src="javascript/site.js" type="text/javascript"></script> </body> </html>
Java
<?php /** * This file is part of the [n]core framework * * Copyright (c) 2014 Sascha Seewald / novael.de * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace nCore\Core\Router\Exception; use nCore\Core\Exception\DefaultException; /** * Class RouterException * @package nCore\Core\Router\Exception */ class RouterException extends DefaultException { /** * @inheritdoc */ public function dispatchException() { $this->httpCode = 500; } }
Java
<?php namespace App\Test\Fixture; use Cake\TestSuite\Fixture\TestFixture; /** * ParametersFixture * */ class ParametersFixture extends TestFixture { /** * Fields * * @var array */ // @codingStandardsIgnoreStart public $fields = [ 'id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null], 'name' => ['type' => 'string', 'length' => 50, 'null' => false, 'default' => null, 'collate' => 'latin1_spanish_ci', 'comment' => '', 'precision' => null, 'fixed' => null], 'value' => ['type' => 'text', 'length' => null, 'null' => false, 'default' => null, 'collate' => 'latin1_spanish_ci', 'comment' => '', 'precision' => null], '_constraints' => [ 'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []], ], '_options' => [ 'engine' => 'InnoDB', 'collation' => 'latin1_spanish_ci' ], ]; // @codingStandardsIgnoreEnd /** * Records * * @var array */ public $records = [ [ 'id' => 1, 'name' => 'Lorem ipsum dolor sit amet', 'value' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.' ], ]; }
Java
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </meta> <meta content="width=device-width, initial-scale=1" name="viewport"> </meta> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"> </link> <link href="../../resources/stof-style.css" rel="stylesheet"> </link> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"> </script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"> </script> <script src="../../resources/search.js"> </script> <script src="../../resources/analytics.js"> </script> </head> <body> <nav class="navbar navbar-default"> <div class="container-fluid"> <div class="navbar-header"> <button aria-expanded="false" class="navbar-toggle collapsed" data-target="#bs-example-navbar-collapse-1" data-toggle="collapse" type="button"> <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="../../index.html"> Bob Dylan Lyrics </a> </div> <div aria-expanded="false" class="navbar-collapse collapse" id="bs-example-navbar-collapse-1" style="height: 1px"> <ul class="nav navbar-nav"> <li> <a href="../../full_lyrics_file_dumps/downloads.html"> Downloads </a> </li> <li> <a href="../../songs/song_index/song_index.html"> All Songs </a> </li> <li> <a href="../../albums/album_index/album_index.html"> All Albums </a> </li> <li class="dropdown"> <a aria-expanded="false" aria-haspopup="true" class="dropdown-toggle" data-toggle="dropdown" href="#" role="button"> 1960s <span class="caret"> </span> </a> <ul class="dropdown-menu"> <li> <a class="album" href="../../albums/bob_dylan.html"> Bob Dylan (1962) </a> </li> <li> <a class="album" href="../../albums/the_freewheelin_bob_dylan.html"> The Freewheelin' Bob Dylan (1963) </a> </li> <li> <a class="album" href="../../albums/the_times_they_are_a-changin.html"> The Times They Are A-Changin' (1964) </a> </li> <li> <a class="album" href="../../albums/another_side_of_bob_dylan.html"> Another Side of Bob Dylan (1964) </a> </li> <li> <a class="album" href="../../albums/bringing_it_all_back_home.html"> Bringing It All Back Home (1965) </a> </li> <li> <a class="album" href="../../albums/highway_61_revisited.html"> Highway 61 Revisited (1965) </a> </li> <li> <a class="album" href="../../albums/blonde_on_blonde.html"> Blonde on Blonde (1966)) </a> </li> <li> <a class="album" href="../../albums/bob_dylans_greatest_hits.html"> Bob Dylan's Greatest Hits (1967) </a> </li> <li> <a class="album" href="../../albums/john_wesley_harding.html"> John Wesley Harding (1967) </a> </li> <li> <a class="album" href="../../albums/nashville_skyline.html"> Nashville Skyline (1969) </a> </li> </ul> </li> <li class="dropdown"> <a aria-expanded="false" aria-haspopup="true" class="dropdown-toggle" data-toggle="dropdown" href="#" role="button"> 1970s <span class="caret"> </span> </a> <ul class="dropdown-menu"> <li> <a class="album" href="../../albums/self_portrait.html"> Self Portrait (1970) </a> </li> <li> <a class="album" href="../../albums/new_morning.html"> New Morning (1970) </a> </li> <li> <a class="album" href="../../albums/bob_dylans_greatest_hits_vol_ii.html"> Bob Dylan's Greatest Hits, Vol. II (1971) </a> </li> <li> <a class="album" href="../../albums/pat_garrett_and_billy_the_kid.html"> Pat Garrett &amp; Billy the Kid (1973) </a> </li> <li> <a class="album" href="../../albums/dylan.html"> Dylan (1973) </a> </li> <li> <a class="album" href="../../albums/planet_waves.html"> Planet Waves (1974) </a> </li> <li> <a class="album" href="../../albums/before_the_flood.html"> Before the Flood (1974) </a> </li> <li> <a class="album" href="../../albums/blood_on_the_tracks.html"> Blood on the Tracks (1975) </a> </li> <li> <a class="album" href="../../albums/the_basement_tapes.html"> The Basement Tapes (1975) </a> </li> <li> <a class="album" href="../../albums/desire.html"> Desire (1976) </a> </li> <li> <a class="album" href="../../albums/hard_rain.html"> Hard Rain (1976) </a> </li> <li> <a class="album" href="../../albums/street_legal.html"> Street-Legal (1978) </a> </li> <li> <a class="album" href="../../albums/bob_dylan_at_budokan.html"> Bob Dylan at Budokan (1979) </a> </li> <li> <a class="album" href="../../albums/slow_train_coming.html"> Slow Train Coming (1979) </a> </li> </ul> </li> <li class="dropdown"> <a aria-expanded="false" aria-haspopup="true" class="dropdown-toggle" data-toggle="dropdown" href="#" role="button"> 1980s <span class="caret"> </span> </a> <ul class="dropdown-menu"> <li> <a class="album" href="../../albums/saved.html"> Saved (1980) </a> </li> <li> <a class="album" href="../../albums/shot_of_love.html"> Shot of Love (1981) </a> </li> <li> <a class="album" href="../../albums/infidels.html"> Infidels (1983) </a> </li> <li> <a class="album" href="../../albums/real_live_1.html"> Real Live (1984) </a> </li> <li> <a class="album" href="../../albums/empire_burlesque.html"> Empire Burlesque (1985) </a> </li> <li> <a class="album" href="../../albums/biograph.html"> Biograph (1985) </a> </li> <li> <a class="album" href="../../albums/knocked_out_loaded.html"> Knocked Out Loaded (1986) </a> </li> <li> <a class="album" href="../../albums/down_in_the_groove.html"> Down in the Groove (1988) </a> </li> <li> <a class="album" href="../../albums/dylan_and_the_dead.html"> Dylan &amp; the Dead (1989) </a> </li> <li> <a class="album" href="../../albums/oh_mercy.html"> Oh Mercy (1989) </a> </li> </ul> </li> <li class="dropdown"> <a aria-expanded="false" aria-haspopup="true" class="dropdown-toggle" data-toggle="dropdown" href="#" role="button"> 1990s <span class="caret"> </span> </a> <ul class="dropdown-menu"> <li> <a class="album" href="../../albums/under_the_red_sky.html"> Under the Red Sky (1990) </a> </li> <li> <a class="album" href="../../albums/the_bootleg_series_volumes_1-3_rare_and_unreleased_1961-1991.html"> The Bootleg Series Volumes 1-3 (Rare &amp; Unreleased) 1961-1991 (1991) </a> </li> <li> <a class="album" href="../../albums/good_as_i_been_to_you.html"> Good As I Been to You (1992) </a> </li> <li> <a class="album" href="../../albums/world_gone_wrong.html"> World Gone Wrong (1993) </a> </li> <li> <a class="album" href="../../albums/bob_dylans_greatest_hits_volume_3.html"> Bob Dylan's Greatest Hits Volume 3 (1994) </a> </li> <li> <a class="album" href="../../albums/mtv_unplugged.html"> MTV Unplugged (1995) </a> </li> <li> <a class="album" href="../../albums/time_out_of_mind.html"> Time Out of Mind (1997) </a> </li> <li> <a class="album" href="../../albums/the_bootleg_series_vol_4_bob_dylan_live_1966.html"> The Bootleg Series Vol. 4: Bob Dylan Live 1966, The "Royal Albert Hall" Concert (1998) </a> </li> </ul> </li> <li class="dropdown"> <a aria-expanded="false" aria-haspopup="true" class="dropdown-toggle" data-toggle="dropdown" href="#" role="button"> 2000s <span class="caret"> </span> </a> <ul class="dropdown-menu"> <li> <a class="album" href="../../albums/the_essential_bob_dylan.html"> The Essential Bob Dylan (2000) </a> </li> <li> <a class="album" href="../../albums/love_and_theft.html"> Love and Theft (2001) </a> </li> <li> <a class="album" href="../../albums/the_bootleg_series_vol_5_bob_dylan_live_1975_the_rolling_thunder_revue.html"> The Bootleg Series Vol. 5: Bob Dylan Live 1975, The Rolling Thunder Revue (2002) </a> </li> <li> <a class="album" href="../../albums/the_bootleg_series_vol_6_bob_dylan_live_1964_concert_at_philharmonic_hall.html"> The Bootleg Series Vol. 6: Bob Dylan Live 1964, Concert at Philharmonic Hall (2004) </a> </li> <li> <a class="album" href="../../albums/the_best_of_bob_dylan.html"> The Best of Bob Dylan (2005) </a> </li> <li> <a class="album" href="../../albums/modern_times.html"> Modern Times (2006) </a> </li> <li> <a class="album" href="../../albums/together_through_life.html"> Together through Life (2009) </a> </li> </ul> </li> <li class="dropdown"> <a aria-expanded="false" aria-haspopup="true" class="dropdown-toggle" data-toggle="dropdown" href="#" role="button"> 2010s <span class="caret"> </span> </a> <ul class="dropdown-menu"> <li> <a class="album" href="../../albums/tempest.html"> Tempest (2012) </a> </li> </ul> </li> </ul> <div class="col-md-3" style="border:0px solid;width:30%;height:auto;"> <gcse:search> <form class="navbar-form navbar-right" role="search"> </form> </gcse:search> </div> </div> </div> </nav> <div class="container"> <div class="row"> <div class="col-md-12"> <h1> Lay Lady Lay </h1> </div> </div> <div class="row"> <div class="col-md-12"> <p> <div> Lay<a href="#1"><sup>1</sup></a>, lady, lay, lay across my big brass bed, </div> <div> Lay, lady, lay, lay across my big brass bed. </div> <div> Whatever colors you have in your mind, </div> <div> I'll show them to you and you'll see them shine. </div> </p> <p> <div> Lay, lady, lay, lay across my big brass bed, </div> <div> Forget this dance, let's go upstairs. </div> <div> Let's take a chance – who really cares? </div> <div> Why don't you know you got nothing to prove? </div> <div> It's all in your eyes and the way that you move. </div> </p> <p> <div> Forget this dance, let's go upstairs. </div> <div> Why wait any longer for no need to complain?<a href="#2"><sup>2</sup></a> </div> <div> You can have love, but you might lose it. </div> <div> Why run any longer when you're running in vain? </div> <div> You can have the truth, but you got to choose it. </div> </p> <p> <div> Stay, lady, stay, stay with your man awhile, </div> <div> Till the break of day let me see you make him smile. </div> <div> I long to see you in the morning light, </div> <div> I long to hold you in the night – </div> <div> Stay, lady, stay, stay with your man awhile. </div> </p> <p> <div> Lay, lady, lay, lay across my big brass bed. </div> </p> <p> <div> <a name="1"> <sup> 1 </sup> </a> <small> The correct verb to use would technically be "lie" (she lies, she lay, she has lain), not "lay", which is the transitive form of "lie". However, the distinction between the two forms has been increasingly disappearing in English due at least partially to the fact that the base form of the verb <i>lay</i> looks and sounds exactly the same as the simple past form of <i>lay</i>. But just because the use of <i>lay</i> in this song is technically incorrect doesn't mean that it was not intentional: it would not sound right to hear "lie, lady, lie, lie across my big brass bed" (because of the assonance) and, besides, this is how real people talk every day and there's nothing wrong with it. </small> </div> <div> <a name="2"> <sup> 2 </sup> </a> <small> Here it's almost as though Dylan begins to sing the line from the original album version, "Why wait any longer for the world to begin?", before improvising about halfway through, which might explain why the line sounds sort of meaningless and inane. </small> </div> </p> </div> </div> </div> </body> </html>
Java
mod message_set; use std; use std::fmt; use linked_hash_map::{Iter, LinkedHashMap}; use uuid::Uuid; pub mod message; #[derive(Debug, PartialEq)] pub struct Message { properties: Map, body: Option<Value>, } impl Message { pub fn new() -> MessageBuilder { MessageBuilder::new() } pub fn with_property<K, V>(key: K, value: V) -> MessageBuilder where K: Into<String>, V: Into<Value>, { MessageBuilder::new().with_property(key.into(), value.into()) } pub fn with_body<V>(value: V) -> MessageBuilder where V: Into<Value>, { MessageBuilder::new().with_body(value.into()) } pub fn properties(&self) -> &Map { &self.properties } pub fn body(&self) -> Option<&Value> { match self.body { Some(ref value) => Some(value), None => None, } } } pub struct MessageBuilder { map: LinkedHashMap<String, Value>, body: Option<Value>, } impl MessageBuilder { pub fn new() -> MessageBuilder { MessageBuilder { map: LinkedHashMap::new(), body: None, } } pub fn with_property<K, V>(mut self, key: K, value: V) -> MessageBuilder where K: Into<String>, V: Into<Value>, { self.map.insert(key.into(), value.into()); self } pub fn with_body<V>(mut self, value: V) -> MessageBuilder where V: Into<Value>, { self.body = Some(value.into()); self } pub fn build(self) -> Message { Message { properties: Map { map: self.map }, body: self.body, } } } #[derive(PartialEq, Clone)] pub struct Map { map: LinkedHashMap<String, Value>, } impl Map { pub fn new() -> MapBuilder { MapBuilder { map: LinkedHashMap::new(), } } pub fn get(&self, key: &str) -> Option<&Value> { self.map.get(key) } pub fn iter(&self) -> Iter<String, Value> { self.map.iter() } pub fn len(&self) -> usize { self.map.len() } } impl fmt::Debug for Map { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.map.fmt(f) } } pub struct MapBuilder { map: LinkedHashMap<String, Value>, } impl MapBuilder { pub fn insert<K, V>(mut self, key: K, value: V) -> MapBuilder where K: Into<String>, V: Into<Value>, { self.map.insert(key.into(), value.into()); self } pub fn build(self) -> Map { Map { map: self.map } } } #[derive(Clone, PartialEq)] pub struct List { list: Vec<Value>, } impl List { pub fn new() -> ListBuilder { ListBuilder { list: Vec::new() } } pub fn iter(&self) -> std::slice::Iter<Value> { self.list.iter() } pub fn len(&self) -> usize { self.list.len() } } impl std::ops::Index<usize> for List { type Output = Value; fn index(&self, index: usize) -> &Self::Output { &self.list[index] } } impl fmt::Debug for List { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.list.fmt(f) } } pub struct ListBuilder { list: Vec<Value>, } impl ListBuilder { pub fn append<V>(mut self, value: V) -> ListBuilder where V: Into<Value>, { self.list.push(value.into()); self } pub fn build(self) -> List { List { list: self.list } } } #[derive(Debug, PartialEq, Clone)] pub enum Value { Null, String(String), Int64(i64), Int32(i32), Float32(f32), Float64(f64), Boolean(bool), Bytes(Vec<u8>), List(List), Map(Map), Uuid(Uuid), } impl From<String> for Value { fn from(value: String) -> Self { Value::String(value) } } impl<'a> From<&'a str> for Value { fn from(value: &'a str) -> Self { Value::String(value.to_string()) } } impl From<i64> for Value { fn from(value: i64) -> Self { Value::Int64(value) } } impl From<i32> for Value { fn from(value: i32) -> Self { Value::Int32(value) } } impl From<f64> for Value { fn from(value: f64) -> Self { Value::Float64(value) } } impl From<bool> for Value { fn from(value: bool) -> Self { Value::Boolean(value) } } impl From<Vec<u8>> for Value { fn from(value: Vec<u8>) -> Self { Value::Bytes(value) } } impl From<List> for Value { fn from(value: List) -> Self { Value::List(value) } } impl From<Map> for Value { fn from(value: Map) -> Self { Value::Map(value) } } impl From<Uuid> for Value { fn from(value: Uuid) -> Self { Value::Uuid(value) } } pub trait MessageVisitor { type Output; fn visit_message(&self, value: &Message, buffer: &mut Self::Output); fn visit_map(&self, value: &Map, buffer: &mut Self::Output); fn visit_list(&self, value: &List, buffer: &mut Self::Output); fn visit_value(&self, value: &Value, buffer: &mut Self::Output); fn visit_bytes(&self, value: &Vec<u8>, buffer: &mut Self::Output); fn visit_int32(&self, value: i32, buffer: &mut Self::Output); fn visit_int64(&self, value: i64, buffer: &mut Self::Output); fn visit_float32(&self, value: f32, buffer: &mut Self::Output); fn visit_float64(&self, value: f64, buffer: &mut Self::Output); fn visit_boolean(&self, _value: bool, _buffer: &mut Self::Output); fn visit_string(&self, _value: &String, _buffer: &mut Self::Output); fn visit_uuid(&self, value: &Uuid, buffer: &mut Self::Output); fn visit_null(&self, _buffer: &mut Self::Output); } pub struct BinaryFormatSizeCalculator {} impl MessageVisitor for BinaryFormatSizeCalculator { type Output = usize; fn visit_message(&self, message: &Message, buffer: &mut Self::Output) { *buffer += 4; for (key, value) in message.properties().iter() { self.visit_string(key, buffer); self.visit_value(value, buffer); } if let Some(value) = message.body() { self.visit_value(value, buffer); } } fn visit_map(&self, map: &Map, buffer: &mut Self::Output) { *buffer += map.len(); for (key, value) in map.iter() { self.visit_string(key, buffer); self.visit_value(value, buffer); } } fn visit_list(&self, list: &List, buffer: &mut Self::Output) { *buffer += list.len(); for value in list.iter() { self.visit_value(value, buffer); } } fn visit_value(&self, value: &Value, buffer: &mut Self::Output) { *buffer += 1; match value { &Value::Null => self.visit_null(buffer), &Value::String(ref value) => { self.visit_string(value, buffer); } &Value::Int32(value) => { self.visit_int32(value, buffer); } &Value::Int64(value) => { self.visit_int64(value, buffer); } &Value::Float32(value) => { self.visit_float32(value, buffer); } &Value::Float64(value) => { self.visit_float64(value, buffer); } &Value::Boolean(value) => { self.visit_boolean(value, buffer); } &Value::Bytes(ref value) => { self.visit_bytes(value, buffer); } &Value::Map(ref value) => { self.visit_map(value, buffer); } &Value::List(ref value) => { self.visit_list(value, buffer); } &Value::Uuid(ref value) => { self.visit_uuid(value, buffer); } } } fn visit_bytes(&self, value: &Vec<u8>, buffer: &mut Self::Output) { *buffer += 4 + value.len() } fn visit_int32(&self, _value: i32, buffer: &mut Self::Output) { *buffer += 4; } fn visit_int64(&self, _value: i64, buffer: &mut Self::Output) { *buffer += 8; } fn visit_float32(&self, _value: f32, buffer: &mut Self::Output) { *buffer += 4; } fn visit_float64(&self, _value: f64, buffer: &mut Self::Output) { *buffer += 8; } fn visit_boolean(&self, _value: bool, buffer: &mut Self::Output) { *buffer += 1; } fn visit_string(&self, value: &String, buffer: &mut Self::Output) { *buffer += 4 + value.len() } fn visit_uuid(&self, _value: &Uuid, buffer: &mut Self::Output) { *buffer += 16 } fn visit_null(&self, _buffer: &mut Self::Output) {} } #[cfg(test)] mod tests { use super::*; #[test] fn it_works() { let message = Message::new() .with_body("Hello") .with_property( "vehicles", List::new().append("Aprilia").append("Infiniti").build(), ) .with_property( "address", Map::new() .insert("street", "400 Beale ST") .insert("city", "San Francisco") .insert("state", "CA") .insert("zip", "94105") .build(), ) .build(); println!("message = {:?}", message); let message = Message::new() .with_body("Wicked!!") .with_property("Hello", "World!") .with_property("age", 42) .with_property("weight", 175.5) .with_property("address", "400 Beale ST APT 1403") .with_property("city", "San Francisco") .with_property("state", "CA") .with_property("zip", "94105") .with_property("married", false) .build(); println!("message = {:?}", &message); } #[test] fn get_property_value() { let m = Message::with_property("msg", "World!").build(); assert_eq!(m.properties().get("msg"), Some(&Value::from("World!"))); assert_eq!(m.properties().get("missing"), None); if let Some(&Value::String(ref value)) = m.properties().get("msg") { println!("value = {:?}", value); } assert_eq!(m.body(), None); } #[test] fn map_as_body() { let m = Message::with_body( Map::new() .insert("fname", "Jimmie") .insert("lname", "Fulton") .build(), ).build(); println!("message = {:?}", &m); match m.body() { Some(&Value::Map(ref map)) => { assert_eq!(map.get("fname"), Some(&Value::from("Jimmie"))); assert_eq!(map.get("lname"), Some(&Value::from("Fulton"))); } _ => panic!("Map expected!"), } } #[test] fn list_index() { let l = List::new() .append("one") .append("two") .append("three") .build(); assert_eq!(l[0], Value::from("one")); } #[test] fn map_iterator() { let map = Map::new() .insert("key1", "value1") .insert("key2", "value2") .build(); let mut counter = 0; for (_key, _value) in map.iter() { counter += 1; } assert_eq!(counter, 2); eprintln!("message = {:?}", map); } #[test] pub fn examples() {} #[test] fn binary_size_calulator() { let calculator = BinaryFormatSizeCalculator {}; let message = Message::with_body("Hello").build(); let mut size = 0; calculator.visit_message(&message, &mut size); assert_eq!(size, 14); } #[test] fn binary_size_calcuator_2() { let calculator = BinaryFormatSizeCalculator {}; let message = example(); let mut size = 0; calculator.visit_message(&message, &mut size); eprintln!("size = {:?}", size); } fn example() -> Message { Message::new() .with_property("fname", "Jimmie") .with_property("lname", "Fulton") .with_property("age", 42) .with_property("temp", 98.6) .with_property( "vehicles", List::new().append("Aprilia").append("Infiniti").build(), ) .with_property( "siblings", Map::new() .insert("brothers", List::new().append("Jason").build()) .insert( "sisters", List::new().append("Laura").append("Sariah").build(), ) .build(), ) .build() } }
Java
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Typeset.Domain.Configuration { public interface IConfigurationRepository { IConfiguration Read(string path); } }
Java
'use strict'; // Projects controller angular.module('about').controller('AboutUsController', ['$scope', '$stateParams', '$state', '$location', 'Authentication', function($scope, $stateParams, $state, $location, Authentication) { $scope.authentication = Authentication; } ]);
Java
<?php /** * AbstractField class file */ namespace Graviton\DocumentBundle\DependencyInjection\Compiler\Utils; /** * Base document field * * @author List of contributors <https://github.com/libgraviton/graviton/graphs/contributors> * @license https://opensource.org/licenses/MIT MIT License * @link http://swisscom.ch */ class AbstractField { /** * @var string */ private $fieldName; /** * @var string */ private $exposedName; /** * @var bool */ private $readOnly; /** * @var bool */ private $required; /** * @var bool */ private $searchable; /** * @var bool */ private $recordOriginException; /** * Constructor * * @param string $fieldName Field name * @param string $exposedName Exposed name * @param bool $readOnly Read only * @param bool $required Is required * @param bool $searchable Is searchable * @param bool $recordOriginException Is an exception to record origin */ public function __construct( $fieldName, $exposedName, $readOnly, $required, $searchable, $recordOriginException ) { $this->fieldName = $fieldName; $this->exposedName = $exposedName; $this->readOnly = $readOnly; $this->required = $required; $this->searchable = $searchable; $this->recordOriginException = $recordOriginException; } /** * Get field name * * @return string */ public function getFieldName() { return $this->fieldName; } /** * Get exposed name * * @return string */ public function getExposedName() { return $this->exposedName; } /** * Is read only * * @return bool */ public function isReadOnly() { return $this->readOnly; } /** * Is required * * @return bool */ public function isRequired() { return $this->required; } /** * Is searchable * * @return boolean */ public function isSearchable() { return $this->searchable; } /** * @param boolean $searchable Is searchable * * @return void */ public function setSearchable($searchable) { $this->searchable = $searchable; } /** * get RecordOriginException * * @return boolean RecordOriginException */ public function isRecordOriginException() { return $this->recordOriginException; } /** * set RecordOriginException * * @param boolean $recordOriginException recordOriginException * * @return void */ public function setRecordOriginException($recordOriginException) { $this->recordOriginException = $recordOriginException; } }
Java
-- MySQL dump 10.13 Distrib 5.5.49, for debian-linux-gnu (x86_64) -- -- Host: localhost Database: warmup -- ------------------------------------------------------ -- Server version 5.5.49-0ubuntu0.14.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `add_member` -- DROP TABLE IF EXISTS `add_member`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `add_member` ( `POWON_id` int(11) NOT NULL, `group_id` int(11) NOT NULL, PRIMARY KEY (`POWON_id`,`group_id`), KEY `group_id_idx` (`group_id`), CONSTRAINT `group_id` FOREIGN KEY (`group_id`) REFERENCES `group` (`group_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `POWON_id` FOREIGN KEY (`POWON_id`) REFERENCES `member` (`POWON_id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `add_member` -- LOCK TABLES `add_member` WRITE; /*!40000 ALTER TABLE `add_member` DISABLE KEYS */; /*!40000 ALTER TABLE `add_member` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `group` -- DROP TABLE IF EXISTS `group`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `group` ( `group_id` int(11) NOT NULL AUTO_INCREMENT, `group_name` varchar(45) NOT NULL, `POWON_id` int(11) NOT NULL, PRIMARY KEY (`group_id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `group` -- LOCK TABLES `group` WRITE; /*!40000 ALTER TABLE `group` DISABLE KEYS */; /*!40000 ALTER TABLE `group` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `interest` -- DROP TABLE IF EXISTS `interest`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `interest` ( `interest_id` int(11) NOT NULL AUTO_INCREMENT, `interest_name` varchar(45) NOT NULL, PRIMARY KEY (`interest_id`) ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `interest` -- LOCK TABLES `interest` WRITE; /*!40000 ALTER TABLE `interest` DISABLE KEYS */; /*!40000 ALTER TABLE `interest` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `member` -- DROP TABLE IF EXISTS `member`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `member` ( `POWON_id` int(11) NOT NULL AUTO_INCREMENT, `firstname` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `lastname` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `password` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `user_name` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `address` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `dob` year(4) NOT NULL, `city` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `email` varchar(30) COLLATE utf8_unicode_ci NOT NULL, `member_status` tinyint(1) DEFAULT '0', `fee_membership` tinyint(1) DEFAULT '0', PRIMARY KEY (`POWON_id`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `member` -- LOCK TABLES `member` WRITE; /*!40000 ALTER TABLE `member` DISABLE KEYS */; /*!40000 ALTER TABLE `member` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `member_interest` -- DROP TABLE IF EXISTS `member_interest`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `member_interest` ( `POWON_id` int(11) NOT NULL, `interest_id` int(11) NOT NULL, PRIMARY KEY (`POWON_id`,`interest_id`), KEY `interest_id_idx` (`interest_id`), CONSTRAINT `member_interest_ibfk_1` FOREIGN KEY (`POWON_id`) REFERENCES `member` (`POWON_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `member_interest_ibfk_2` FOREIGN KEY (`interest_id`) REFERENCES `interest` (`interest_id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `member_interest` -- LOCK TABLES `member_interest` WRITE; /*!40000 ALTER TABLE `member_interest` DISABLE KEYS */; /*!40000 ALTER TABLE `member_interest` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `name` -- DROP TABLE IF EXISTS `name`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `name` ( `id` int(6) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `name` -- LOCK TABLES `name` WRITE; /*!40000 ALTER TABLE `name` DISABLE KEYS */; /*!40000 ALTER TABLE `name` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2016-07-13 22:32:20
Java
<?php namespace Abe\FileUploadBundle\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Abe\FileUploadBundle\Entity\Document; use Abe\FileUploadBundle\Form\DocumentType; /** * user2 controller. * * @Route("/main/upload") */ class UploadController extends Controller { /** * creates the form to uplaod a file with the Documetn entity entities. * * @Route("/new", name="main_upload_file") * @Method("GET") * @Template() */ public function uploadAction() { $entity = new Document(); $form = $this->createUploadForm($entity); return array( 'entity' => $entity, 'form' => $form->createView(), ); } /** * @Template() * @Route("/", name="main_upload") * @Method("POST") */ public function uploadFileAction(Request $request) { return $this->redirect($this->generateUrl('homepage')); $document = new Document(); $form = $this->createUploadForm($document); $form->handleRequest($request); $test = $form->getErrors(); //if ($this->getRequest()->getMethod() === 'POST') { // $form->bindRequest($this->getRequest()); if ($form->isSubmitted()) { $fileinfomation = $form->getData(); exit(\Doctrine\Common\Util\Debug::dump($test)); $em = $this->getDoctrine()->getEntityManager(); $document->upload(); $em->persist($document); $em->flush(); return $this->redirect($this->generateUrl('homepage')); } //} return array( 'form' => $form->createView(), 'entity' =>$document, ); } /** * Creates a form to create a Document entity. * * @param Document $entity The entity * * @return \Symfony\Component\Form\Form The form */ private function createUploadForm(Document $entity) { $form = $this->createForm(new DocumentType(), $entity, array( 'action' => $this->generateUrl('document_create'), 'method' => 'POST', )); $form->add('submit', 'button', array('label' => 'Upload')); return $form; } public function upload() { // the file property can be empty if the field is not required if (null === $this->getFile()) { return; } // use the original file name here but you should // sanitize it at least to avoid any security issues // move takes the target directory and then the // target filename to move to $this->getFile()->move( $this->getUploadRootDir(), $this->getFile()->getClientOriginalName() ); // set the path property to the filename where you've saved the file $this->path = $this->getFile()->getClientOriginalName(); // clean up the file property as you won't need it anymore $this->file = null; } /** * @Template() * @Route("/", name="main_uploadfile") * @Method("POST") */ public function uploadFileAction2(Request $request) { $document = new Document(); $test = $form->getErrors(); if(2) { $fileinfomation = $form->getData(); $em = $this->getDoctrine()->getEntityManager(); $document->upload(); $em->persist($document); $em->flush(); return $this->redirect($this->generateUrl('homepage')); } } }
Java
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- 選舉資料查詢 --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>中選會選舉資料庫網站</title> <link rel="stylesheet" type="text/css" href="http://db.cec.gov.tw/votehist.css"> <script type="text/javascript"> function AddToFaves_hp() { var is_4up = parseInt(navigator.appVersion); var is_mac = navigator.userAgent.toLowerCase().indexOf("mac")!=-1; var is_ie = navigator.userAgent.toLowerCase().indexOf("msie")!=-1; var thePage = location.href; if (thePage.lastIndexOf('#')!=-1) thePage = thePage.substring(0,thePage.lastIndexOf('#')); if (is_ie && is_4up && !is_mac) window.external.AddFavorite(thePage,document.title); else if (is_ie || document.images) booker_hp = window.open(thePage,'booker_','menubar,width=325,height=100,left=140,top=60'); //booker_hp.focus(); } </script> </head> <body class="frame"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- 標題:選舉資料庫網站 --> <div style="width: 100%; height: 56px; margin: 0px 0px 0px 0px; border-style: solid; border-width: 0px 0px 1px 0px; border-color: black;"> <div style="float: left;"> <img src="http://db.cec.gov.tw/images/main_title.gif" /> </div> <div style="width: 100%; height: 48px;"> <div style="text-align: center;"> <img src="http://db.cec.gov.tw/images/small_ghost.gif" /> <span style="height: 30px; font-size: 20px;"> <a href="http://www.cec.gov.tw" style="text-decoration: none;">回中選會網站</a> </span> </div> </div> <div style="width: 100%; height: 8px; background-color: #fde501;"> </div> </div> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- 頁籤 --> <div style="width: 100%; height: 29px; background-image: url('http://db.cec.gov.tw/images/tab_background.gif'); background-repeat: repeat-x;"> <div style="text-align: center;"> <a href="histMain.jsp"><img border="0" src="http://db.cec.gov.tw/images/tab_01.gif" /></a> <a href="histCand.jsp"><img border="0" src="http://db.cec.gov.tw/images/tab_02.gif" /></a> <!-- <a href=""><img border="0" src="images/tab_03.gif" /></a> --> <!-- <a href=""><img border="0" src="images/tab_04.gif" /></a> --> <a href="histQuery.jsp?voteCode=20120101T1A2&amp;qryType=ctks&amp;prvCode=05&amp;cityCode=000&amp;areaCode=06&amp;deptCode=032&amp;liCode=0587#"><img border="0" src="http://db.cec.gov.tw/images/tab_05.gif" onClick="AddToFaves_hp()" /></a> <a href="mailto:info@cec.gov.tw;ytlin@cec.gov.tw"><img border="0" src="http://db.cec.gov.tw/images/tab_06.gif" /></a> </div> </div> <div style="width: 100%; height: 22px; background-image: url('http://db.cec.gov.tw/images/tab_separator.gif'); background-repeat: repeat-x;"> </div> <div class="query"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- 子頁面:查詢候選人得票數 --> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- 標題 --> <div class="titlebox"> <div class="title"> <div class="head">第 08 屆 立法委員選舉(區域)&nbsp;候選人得票數</div> <div class="date">投票日期:中華民國101年01月14日</div> <div class="separator"></div> </div> </div> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- 查詢:候選人得票數,縣市多選區,如區域立委 --> <link rel="stylesheet" type="text/css" href="http://db.cec.gov.tw/qryCtks.css" /> <!-- 投開票所表頭 --> <table class="ctks" width="950" height="22" border=1 cellpadding="0" cellspacing="0" > <tr class="title"> <td nowrap align="center">地區</td> <td nowrap align="center">姓名</td> <td nowrap align="center">號次</td> <td nowrap align="center">得票數</td> <td nowrap align="center">得票率</td> </tr> <!-- 投開票所內容 --> <tr class="data"> <td nowrap rowspan=2 align=center>高雄市第06選區三民區灣勝里第1156投開票所</td> <td nowrap align="center">侯彩鳳</td> <td nowrap align="center">1</td> <td nowrap align="right">301</td> <td nowrap align="right"> 40.95%</td> </tr> <!-- 投開票所內容 --> <tr class="data"> <td nowrap align="center">李昆澤</td> <td nowrap align="center">2</td> <td nowrap align="right">434</td> <td nowrap align="right"> 59.04%</td> </tr> <!-- 投開票所內容 --> <tr class="data"> <td nowrap rowspan=2 align=center>高雄市第06選區三民區灣勝里第1157投開票所</td> <td nowrap align="center">侯彩鳳</td> <td nowrap align="center">1</td> <td nowrap align="right">277</td> <td nowrap align="right"> 36.83%</td> </tr> <!-- 投開票所內容 --> <tr class="data"> <td nowrap align="center">李昆澤</td> <td nowrap align="center">2</td> <td nowrap align="right">475</td> <td nowrap align="right"> 63.16%</td> </tr> </table> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <div style="width: 100%; height: 20px; margin: 30px 0px 0px 0px; text-align: center; "> <span> <img src="http://db.cec.gov.tw/images/leave_arrow_left.gif" /> </span> <span style="margin: 0px 10px 0px 10px; "> <a style="text-decoration: none; font-size: 15px; " href="histPrint">下載</a> </span> <span> <img src="http://db.cec.gov.tw/images/leave_arrow_right.gif" /> </span> <span style="margin-right: 100px;">&nbsp;</span> <span> <img src="http://db.cec.gov.tw/images/leave_arrow_left.gif" /> </span> <span style="margin: 0px 10px 0px 10px; "> <a style="text-decoration: none; font-size: 15px; " href="histMain.jsp">離開</a> </span> <span> <img src="http://db.cec.gov.tw/images/leave_arrow_right.gif" /> </span> </div> </div> </body> </html>
Java
import { Dimensions, PixelRatio } from 'react-native'; const Utils = { ratio: PixelRatio.get(), pixel: 1 / PixelRatio.get(), size: { width: Dimensions.get('window').width, height: Dimensions.get('window').height, }, post(url, data, callback) { const fetchOptions = { method: 'POST', headers: { Accept: 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify(data), }; fetch(url, fetchOptions) .then(response => { response.json(); }) .then(responseData => { callback(responseData); }); }, }; export default Utils;
Java
import re from setuptools import setup def find_version(filename): _version_re = re.compile(r"__version__ = '(.*)'") for line in open(filename): version_match = _version_re.match(line) if version_match: return version_match.group(1) __version__ = find_version('librdflib/__init__.py') with open('README.md', 'rt') as f: long_description = f.read() tests_require = ['pytest'] setup( name='librdflib', version=__version__, description='librdf parser for rdflib', long_description=long_description, long_description_content_type='text/markdown', url='https://github.com/tgbugs/pyontutils/tree/master/librdflib', author='Tom Gillespie', author_email='tgbugs@gmail.com', license='MIT', classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3', ], keywords='rdflib librdf rdf parser parsing ttl rdfxml', packages=['librdflib'], python_requires='>=3', tests_require=tests_require, install_requires=[ 'rdflib', # really 5.0.0 if my changes go in but dev < 5 ], extras_require={'dev': ['pytest-cov', 'wheel'], 'test': tests_require, }, entry_points={ 'rdf.plugins.parser': [ 'librdfxml = librdflib:libRdfxmlParser', 'libttl = librdflib:libTurtleParser', ], }, )
Java
--- --- <!doctype html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>Photo - A History of UCSF</title> <link href='https://fonts.googleapis.com/css?family=Gilda+Display%7CPT+Sans+Narrow:300' rel='stylesheet' type='text/css'> <link href="ucsf_history.css" rel="stylesheet" type="text/css" media="all" /> {% include google_analytics.html %} </head> <body> <div id="mainbody"> {% include ucsf_banner.html %} <div class="banner"><h1><a href="/">A History of UCSF</a></h1></div> <div id="insidebody"> <div id="photocopy"> <div id="photocopy_text"><h2 class="title"><span class="title-primary">Photos</span></h2><br /> <div id="subhead">Robert A. “Bob” Derzon </div> <br /> <img src="images/pictures/derzon.jpg"/><br/> <br/><br/> </div> </div> <div id="sidebar"> <div id="sidenav_inside">{% include search_include.html %}<br /> <div id="sidenavtype"> <a href="story.html" class="sidenavtype"><strong>THE STORY</strong></a><br/> <br/> <a href="special_topics.html" class="sidenavtype"><strong>SPECIAL TOPICS</strong></a><br/><br/> <a href="people.html" class="sidenavtype"><strong>PEOPLE</strong></a><br/> <br/> <div id="sidenav_subnav_header"><strong><a href="photos.html" class="sidenav_subnav_type_visited">PHOTOS</a></strong></div> <br/> <a href="buildings.html" class="sidenavtype"><strong>BUILDINGS</strong></a><br/> <br/> <a href="index.html" class="sidenavtype"><strong>HOME</strong></a><br/> </div> </div> </div> </div> {% include footer.html %} </div> {% include bottom_js.html %} </body> </html>
Java
using Humanizer.Localisation; using Xunit; using Xunit.Extensions; namespace Humanizer.Tests.Localisation.ptBR { public class DateHumanizeTests : AmbientCulture { public DateHumanizeTests() : base("pt-BR") { } [Theory] [InlineData(-2, "2 segundos atrás")] [InlineData(-1, "um segundo atrás")] public void SecondsAgo(int seconds, string expected) { DateHumanize.Verify(expected, seconds, TimeUnit.Second, Tense.Past); } [Theory] [InlineData(1, "em um segundo")] [InlineData(2, "em 2 segundos")] public void SecondsFromNow(int seconds, string expected) { DateHumanize.Verify(expected, seconds, TimeUnit.Second, Tense.Future); } [Theory] [InlineData(-2, "2 minutos atrás")] [InlineData(-1, "um minuto atrás")] public void MinutesAgo(int minutes, string expected) { DateHumanize.Verify(expected, minutes, TimeUnit.Minute, Tense.Past); } [Theory] [InlineData(1, "em um minuto")] [InlineData(2, "em 2 minutos")] public void MinutesFromNow(int minutes, string expected) { DateHumanize.Verify(expected, minutes, TimeUnit.Minute, Tense.Future); } [Theory] [InlineData(-2, "2 horas atrás")] [InlineData(-1, "uma hora atrás")] public void HoursAgo(int hours, string expected) { DateHumanize.Verify(expected, hours, TimeUnit.Hour, Tense.Past); } [Theory] [InlineData(1, "em uma hora")] [InlineData(2, "em 2 horas")] public void HoursFromNow(int hours, string expected) { DateHumanize.Verify(expected, hours, TimeUnit.Hour, Tense.Future); } [Theory] [InlineData(-2, "2 dias atrás")] [InlineData(-1, "ontem")] public void DaysAgo(int days, string expected) { DateHumanize.Verify(expected, days, TimeUnit.Day, Tense.Past); } [Theory] [InlineData(1, "amanhã")] [InlineData(2, "em 2 dias")] public void DaysFromNow(int days, string expected) { DateHumanize.Verify(expected, days, TimeUnit.Day, Tense.Future); } [Theory] [InlineData(-2, "2 meses atrás")] [InlineData(-1, "um mês atrás")] public void MonthsAgo(int months, string expected) { DateHumanize.Verify(expected, months, TimeUnit.Month, Tense.Past); } [Theory] [InlineData(1, "em um mês")] [InlineData(2, "em 2 meses")] public void MonthsFromNow(int months, string expected) { DateHumanize.Verify(expected, months, TimeUnit.Month, Tense.Future); } [Theory] [InlineData(-2, "2 anos atrás")] [InlineData(-1, "um ano atrás")] public void YearsAgo(int years, string expected) { DateHumanize.Verify(expected, years, TimeUnit.Year, Tense.Past); } [Theory] [InlineData(1, "em um ano")] [InlineData(2, "em 2 anos")] public void YearsFromNow(int years, string expected) { DateHumanize.Verify(expected, years, TimeUnit.Year, Tense.Future); } [Fact] public void Now() { DateHumanize.Verify("agora", 0, TimeUnit.Day, Tense.Future); } } }
Java
package com.github.aselab.activerecord import scala.language.experimental.macros import scala.reflect.macros._ trait Deprecations { def unsupportedInTransaction[A](c: Context)(a: c.Expr[A]): c.Expr[A] = { import c.universe._ c.error(c.enclosingPosition, "dsl#inTransaction is deprecated. use ActiveRecordCompanion#inTransaction instead.") reify(a.splice) } }
Java
<div class="form main-form" ng-controller="AuthCtrl" ng-class="($state.is('auth.register')) ? 'register-form' : ''"> <div class="row login-form__left" ui-view></div> </div>
Java
"""This module contains examples of the op() function where: op(f,x) returns a stream where x is a stream, and f is an operator on lists, i.e., f is a function from a list to a list. These lists are of lists of arbitrary objects other than streams and agents. Function f must be stateless, i.e., for any lists u, v: f(u.extend(v)) = f(u).extend(f(v)) (Stateful functions are given in OpStateful.py with examples in ExamplesOpWithState.py.) Let f be a stateless operator on lists and let x be a stream. If at some point, the value of stream x is a list u then at that point, the value of stream op(f,x) is the list f(u). If at a later point, the value of stream x is the list: u.extend(v) then, at that point the value of stream op(f,x) is f(u).extend(f(v)). As a specific example, consider the following f(): def f(lst): return [w * w for w in lst] If at some point in time, the value of x is [3, 7], then at that point the value of op(f,x) is f([3, 7]) or [9, 49]. If at a later point, the value of x is [3, 7, 0, 11, 5] then the value of op(f,x) at that point is f([3, 7, 0, 11, 5]) or [9, 49, 0, 121, 25]. """ if __name__ == '__main__': if __package__ is None: import sys from os import path sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) ) from Agent import * from ListOperators import * from PrintFunctions import print_streams_recent def example_1(): print "example_1" print "op(f, x): f is a function from a list to a list" print "x is a stream \n" # FUNCTIONS FROM LIST TO LIST # This example uses the following list operators: # functions from a list to a list. # f, g, h, r # Example A: function using list comprehension def f(lst): return [w*w for w in lst] # Example B: function using filter threshold = 6 def predicate(w): return w > threshold def g(lst): return filter(predicate, lst) # Example C: function using map # Raise each element of the list to the n-th power. n = 3 def power(w): return w**n def h(lst): return map(power, lst) # Example D: function using another list comprehension # Discard any element of x that is not a # multiple of a parameter n, and divide the # elements that are multiples of n by n. n = 3 def r(lst): result = [] for w in lst: if w%n == 0: result.append(w/n) return result # EXAMPLES OF OPERATIONS ON STREAMS # The input stream for these examples x = Stream('x') print 'x is the input stream.' print 'a is a stream consisting of the squares of the input' print 'b is the stream consisting of values that exceed 6' print 'c is the stream consisting of the third powers of the input' print 'd is the stream consisting of values that are multiples of 3 divided by 3' print 'newa is the same as a. It is defined in a more succinct fashion.' print 'newb has squares that exceed 6.' print '' # The output streams a, b, c, d obtained by # applying the list operators f, g, h, r to # stream x. a = op(f, x) b = op(g, x) c = op(h, x) d = op(r, x) # You can also define a function only on streams. # You can do this using functools in Python or # by simple encapsulation as shown below. def F(x): return op(f,x) def G(x): return op(g,x) newa = F(x) newb = G(F(x)) # The advantage is that F is a function only # of streams. So, function composition looks cleaner # as in G(F(x)) # Name the output streams to label the output # so that reading the output is easier. a.set_name('a') newa.set_name('newa') b.set_name('b') newb.set_name('newb') c.set_name('c') d.set_name('d') # At this point x is the empty stream: # its value is [] x.extend([3, 7]) # Now the value of x is [3, 7] print "FIRST STEP" print_streams_recent([x, a, b, c, d, newa, newb]) print "" x.extend([0, 11, 15]) # Now the value of x is [3, 7, 0, 11, 15] print "SECOND STEP" print_streams_recent([x, a, b, c, d, newa, newb]) def main(): example_1() if __name__ == '__main__': main()
Java