MSDN.WhiteKnight - Stack Overflow answers
Ответ на "How to get whether a speaker plugged or unplugged"
Answer 46503072
It can be done with Device Topology API.
IKsJackDescription
interface can be used to getKSJACK_DESCRIPTION
structure, which hasIsConnected
member. However, not every device supports cable presence detection, in case it doesn't the API will always report it's connected.COM objects declarations
Imports System Imports System.Collections.Generic Imports System.Text Imports System.Runtime.InteropServices Imports System.IO Imports System.Runtime.CompilerServices Namespace com_test Class Native <DllImport("ole32.Dll")> _ Public Shared Function CoCreateInstance(ByRef clsid As Guid, <MarshalAs(UnmanagedType.IUnknown)> inner As Object, context As UInteger, ByRef uuid As Guid, <MarshalAs(UnmanagedType.IUnknown)> ByRef rReturnedComObject As Object) As UInteger End Function '************************************************************************ <DllImport("ole32.dll")> _ Private Shared Function PropVariantClear(ByRef pvar As PropVariant) As Integer End Function Public Const DEVICE_STATE_ACTIVE As Integer = &H1 Public Const DEVICE_STATE_DISABLE As Integer = &H2 Public Const DEVICE_STATE_NOTPRESENT As Integer = &H4 Public Const DEVICE_STATE_UNPLUGGED As Integer = &H8 Public Const DEVICE_STATEMASK_ALL As Integer = &Hf Public Shared PKEY_Device_FriendlyName As New PROPERTYKEY(&Ha45c254eUI, &Hdf1c, &H4efd, &H80, &H20, &H67, _ &Hd1, &H46, &Ha8, &H50, &He0, 14) Public Shared PKEY_AudioEndpoint_FormFactor As New PROPERTYKEY(&H1da5d803, &Hd492, &H4edd, &H8c, &H23, &He0, _ &Hc0, &Hff, &Hee, &H7f, &He, 0) End Class Enum EndpointFormFactor RemoteNetworkDevice = 0 Speakers = (RemoteNetworkDevice + 1) LineLevel = (Speakers + 1) Headphones = (LineLevel + 1) Microphone = (Headphones + 1) Headset = (Microphone + 1) Handset = (Headset + 1) UnknownDigitalPassthrough = (Handset + 1) SPDIF = (UnknownDigitalPassthrough + 1) DigitalAudioDisplayDevice = (SPDIF + 1) UnknownFormFactor = (DigitalAudioDisplayDevice + 1) EndpointFormFactor_enum_count = (UnknownFormFactor + 1) End Enum Enum EPcxConnectionType eConnTypeUnknown = 0 eConnType3Point5mm eConnTypeQuarter eConnTypeAtapiInternal eConnTypeRCA eConnTypeOptical eConnTypeOtherDigital eConnTypeOtherAnalog eConnTypeMultichannelAnalogDIN eConnTypeXlrProfessional eConnTypeRJ11Modem eConnTypeCombination End Enum Enum EPcxGeoLocation eGeoLocRear = &H1 eGeoLocFront eGeoLocLeft eGeoLocRight eGeoLocTop eGeoLocBottom eGeoLocRearPanel eGeoLocRiser eGeoLocInsideMobileLid eGeoLocDrivebay eGeoLocHDMI eGeoLocOutsideMobileLid eGeoLocATAPI eGeoLocNotApplicable eGeoLocReserved6 EPcxGeoLocation_enum_count End Enum Public Enum EDataFlow eRender eCapture eAll EDataFlow_enum_count End Enum Public Enum ERole eConsole eMultimedia eCommunications ERole_enum_count End Enum Public Enum CLSCTX CLSCTX_INPROC_SERVER = &H1 CLSCTX_INPROC_HANDLER = &H2 CLSCTX_LOCAL_SERVER = &H4 CLSCTX_REMOTE_SERVER = &H10 CLSCTX_SERVER = (CLSCTX_INPROC_SERVER Or CLSCTX_LOCAL_SERVER Or CLSCTX_REMOTE_SERVER) CLSCTX_ALL = (CLSCTX_INPROC_HANDLER Or CLSCTX_SERVER) End Enum 'Windows Core Audio API declarations 'http://www.java2s.com/Code/CSharp/Windows/SoundUtils.htm <Guid("0BD7A1BE-7A1A-44DB-8397-CC5392387B5E"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _ Public Interface IMMDeviceCollection Function GetCount(ByRef pcDevices As UInteger) As Integer Function Item(nDevice As UInteger, <Out, MarshalAs(UnmanagedType.[Interface])> ByRef ppDevice As Object) As Integer End Interface <Guid("D666063F-1587-4E43-81F1-B948E807363F"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _ Public Interface IMMDevice Function Activate(ByRef iid As Guid, dwClsCtx As UInteger, pActivationParams As IntPtr, <Out, MarshalAs(UnmanagedType.[Interface])> ByRef ppInterface As Object) As Integer Function OpenPropertyStore(stgmAccess As Integer, <Out, MarshalAs(UnmanagedType.[Interface])> ByRef ppProperties As Object) As Integer Function GetId(ByRef ppstrId As StringBuilder) As Integer Function GetState(ByRef pdwState As Integer) As Integer End Interface <ComImport, Guid("BCDE0395-E52F-467C-8E3D-C4579291692E")> _ Class MMDeviceEnumerator End Class <Guid("A95664D2-9614-4F35-A746-DE8DB63617E6"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _ Public Interface IMMDeviceEnumerator Function EnumAudioEndpoints(dataFlow As EDataFlow, dwStateMask As Integer, <Out, MarshalAs(UnmanagedType.[Interface])> ByRef ppDevices As Object) As Integer Function GetDefaultAudioEndpoint(dataFlow As EDataFlow, role As ERole, <Out, MarshalAs(UnmanagedType.[Interface])> ByRef ppEndpoint As Object) As Integer Function GetDevice(pwstrId As String, ByRef ppDevice As IntPtr) As Integer Function RegisterEndpointNotificationCallback(pClient As IntPtr) As Integer Function UnregisterEndpointNotificationCallback(pClient As IntPtr) As Integer End Interface '*********** Property store ***************************** ' https://blogs.msdn.microsoft.com/adamroot/2008/04/11/interop-with-propvariants-in-net/ <ComImport, Guid("886D8EEB-8CF2-4446-8D02-CDBA1DBDCF99"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _ Interface IPropertyStore <MethodImpl(MethodImplOptions.InternalCall, MethodCodeType := MethodCodeType.Runtime)> _ Sub GetCount(<Out> ByRef cProps As UInteger) <MethodImpl(MethodImplOptions.InternalCall, MethodCodeType := MethodCodeType.Runtime)> _ Sub GetAt(<[In]> iProp As UInteger, ByRef pkey As PROPERTYKEY) <MethodImpl(MethodImplOptions.InternalCall, MethodCodeType := MethodCodeType.Runtime)> _ Function GetValue(<[In]> ByRef key As PROPERTYKEY, ByRef pv As PropVariant) As Integer <MethodImpl(MethodImplOptions.InternalCall, MethodCodeType := MethodCodeType.Runtime)> _ Sub SetValue(<[In]> ByRef key As PROPERTYKEY, <[In]> ByRef pv As Object) <MethodImpl(MethodImplOptions.InternalCall, MethodCodeType := MethodCodeType.Runtime)> _ Sub Commit() End Interface <StructLayout(LayoutKind.Sequential, Pack := 4)> _ Structure PROPERTYKEY Public fmtid As Guid Public pid As UInteger Public Sub New(guid As Guid, propertyId As Integer) Me.fmtid = guid Me.pid = CUInt(propertyId) End Sub Public Sub New(formatId As String, propertyId As Integer) Me.New(New Guid(formatId), propertyId) End Sub Public Sub New(a As UInteger, b As UInteger, c As UInteger, d As UInteger, e As UInteger, f As UInteger, _ g As UInteger, h As UInteger, i As UInteger, j As UInteger, k As UInteger, propertyId As Integer) Me.New(New Guid(CUInt(a), CUShort(b), CUShort(c), CByte(d), CByte(e), CByte(f), _ CByte(g), CByte(h), CByte(i), CByte(j), CByte(k)), propertyId) End Sub End Structure <StructLayout(LayoutKind.Sequential)> _ Public Structure PropVariant Private vt As UShort Private wReserved1 As UShort Private wReserved2 As UShort Private wReserved3 As UShort Private p As IntPtr Private p2 As Integer Private Function GetDataBytes() As Byte() Dim ret As Byte() = New Byte(IntPtr.Size + (4 - 1)) {} If IntPtr.Size = 4 Then BitConverter.GetBytes(p.ToInt32()).CopyTo(ret, 0) ElseIf IntPtr.Size = 8 Then BitConverter.GetBytes(p.ToInt64()).CopyTo(ret, 0) End If BitConverter.GetBytes(p2).CopyTo(ret, IntPtr.Size) Return ret End Function Private ReadOnly Property cVal() As SByte ' CHAR cVal; Get Return CSByte(GetDataBytes()(0)) End Get End Property Private ReadOnly Property iVal() As Short ' SHORT iVal; Get Return BitConverter.ToInt16(GetDataBytes(), 0) End Get End Property Private ReadOnly Property lVal() As Integer ' LONG lVal; Get Return BitConverter.ToInt32(GetDataBytes(), 0) End Get End Property Private ReadOnly Property hVal() As Long ' LARGE_INTEGER hVal; Get Return BitConverter.ToInt64(GetDataBytes(), 0) End Get End Property Private ReadOnly Property fltVal() As Single ' FLOAT fltVal; Get Return BitConverter.ToSingle(GetDataBytes(), 0) End Get End Property Public ReadOnly Property Value() As Object Get Select Case CType(vt, VarEnum) Case VarEnum.VT_I1 Return cVal Case VarEnum.VT_I2 Return iVal Case VarEnum.VT_I4, VarEnum.VT_INT Return lVal Case VarEnum.VT_UI4, VarEnum.VT_I8 Return hVal Case VarEnum.VT_R4 Return fltVal Case VarEnum.VT_FILETIME Return DateTime.FromFileTime(hVal) Case VarEnum.VT_BSTR Return Marshal.PtrToStringBSTR(p) Case VarEnum.VT_BLOB Dim blobData As Byte() = New Byte(lVal - 1) {} Dim pBlobData As IntPtr If IntPtr.Size = 4 Then pBlobData = New IntPtr(p2) ElseIf IntPtr.Size = 8 Then pBlobData = New IntPtr(BitConverter.ToInt64(GetDataBytes(), 4)) Else Throw New NotSupportedException() End If Marshal.Copy(pBlobData, blobData, 0, lVal) Return blobData Case VarEnum.VT_LPSTR Return Marshal.PtrToStringAnsi(p) Case VarEnum.VT_LPWSTR Return Marshal.PtrToStringUni(p) Case VarEnum.VT_UNKNOWN Return Marshal.GetObjectForIUnknown(p) Case VarEnum.VT_DISPATCH Return p Case Else Throw New NotSupportedException("0x" + vt.ToString("X4") + " type not supported") End Select End Get End Property End Structure '***************************************************** 'Device Topology declarations <Guid("2A07407E-6497-4A18-9787-32F79BD0D98F"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _ Public Interface IDeviceTopology Function GetConnectorCount(<Out> ByRef pConnectorCount As Integer) As Integer Function GetConnector(nIndex As Integer, ByRef ppConnector As IConnector) As Integer Function GetSubunitCount(<Out> ByRef pCount As Integer) As Integer 'ISubunit Function GetSubunit(nIndex As Integer, ByRef ppSubunit As Object) As Integer Function GetPartById(nId As Integer, ByRef ppPart As IPart) As Integer Function GetDeviceId(<Out, MarshalAs(UnmanagedType.LPWStr)> ByRef ppwstrDeviceId As String) As Integer 'IPartsList Function GetSignalPath(pIPartFrom As IPart, pIPartTo As IPart, bRejectMixedPaths As Boolean, ppParts As Object) As Integer End Interface <InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("9c2c4058-23f5-41de-877a-df3af236a09e")> _ Public Interface IConnector Function [GetType](ByRef pType As Integer) As Integer Function GetDataFlow(ByRef dataFlow As EDataFlow) As Integer Function ConnectTo(<[In]> connector As IConnector) As Integer Function Disconnect() As Integer Function IsConnected(ByRef pbConnected As Boolean) As Integer Function GetConnectedTo(<MarshalAs(UnmanagedType.[Interface])> ByRef ppConTo As Object) As Integer Function GetConnectorIdConnectedTo(ByRef ppwstrConnectorId As String) As Integer Function GetDeviceIdConnectedTo(ByRef ppwstrDeviceId As String) As Integer End Interface <Guid("AE2DE0E4-5BCA-4F2D-AA46-5D13F8FDB3A9"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _ Public Interface IPart Function GetName(ByRef ppwstrName As StringBuilder) As Integer Function GetLocalId(ByRef pnId As Integer) As Integer Function GetGlobalId(ByRef ppwstrGlobalId As StringBuilder) As Integer Function GetPartType(ByRef pPartType As Integer) As Integer Function GetSubType(ByRef pSubType As Guid) As Integer Function GetControlInterfaceCount(ByRef pCount As UInteger) As Integer 'IControlInterface Function GetControlInterface(nIndex As Integer, ByRef ppFunction As Object) As Integer 'IPartsList[] Function EnumPartsIncoming(ByRef ppParts As Object) As Integer 'IPartsList[] Function EnumPartsOutgoing(ByRef ppParts As Object) As Integer Function GetTopologyObject(<Out, MarshalAs(UnmanagedType.[Interface])> ByRef ppTopology As Object) As Integer Function Activate(dwClsContext As UInteger, ByRef refiid As Guid, <MarshalAs(UnmanagedType.[Interface])> ByRef interfacePointer As Object) As Integer 'IControlChangeNotify Function RegisterControlChangeCallback(ByRef riid As Guid, pNofity As Object) As Integer 'IControlChangeNotify Function UnregisterControlChangeCallback(pNotify As Object) As Integer End Interface <ComVisible(False)> _ <ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("4509F757-2D46-4637-8E62-CE7DB944F57B")> _ Public Interface IKsJackDescription Function GetJackCount(ByRef jacks As UInteger) As Integer Function GetJackDescription(jack As UInteger, ByRef pDescription As KSJACK_DESCRIPTION) As Integer End Interface <StructLayout(LayoutKind.Sequential)> _ Public Structure KSJACK_DESCRIPTION Public ChannelMapping As UInteger Public Color As UInteger Public ConnectionType As UInteger Public GeoLocation As UInteger Public GenLocation As UInteger Public PortConnection As UInteger Public IsConnected As UInteger End Structure End Namespace
Example how to get info about current default device's jack information
Imports System Imports System.Collections.Generic Imports System.Data Imports System.Text Imports System.Windows.Forms Imports System.Runtime.InteropServices Imports System.ComponentModel Namespace com_test Public Partial Class Form1 Inherits Form 'displays device Private Function PrintDevice(dev As IMMDevice) As String Dim propertyStore As IPropertyStore = Nothing Dim pDeviceTopology As IDeviceTopology = Nothing Dim pConnFrom As IConnector = Nothing Dim pConnTo As IConnector = Nothing Dim pPart As IPart = Nothing Dim pJackDesc As IKsJackDescription = Nothing Dim desc As New KSJACK_DESCRIPTION() Dim res As New StringBuilder(300) Dim o As Object = Nothing Dim state As Integer = 0 Dim con_count As UInteger = 0 Try 'device name 'STGM_READ dev.OpenPropertyStore(0, o) propertyStore = TryCast(o, IPropertyStore) Dim friendlyName As New PropVariant() propertyStore.GetValue(Native.PKEY_Device_FriendlyName, friendlyName) res.AppendLine(friendlyName.Value.ToString()) 'form factor Dim FormFactor As New PropVariant() propertyStore.GetValue(Native.PKEY_AudioEndpoint_FormFactor, FormFactor) Dim f As EndpointFormFactor = EndpointFormFactor.UnknownFormFactor [Enum].TryParse(Of EndpointFormFactor)(FormFactor.Value.ToString(), f) res.AppendLine("Form factor: " + f.ToString()) dev.GetState(state) Dim str As String = "" Select Case state Case Native.DEVICE_STATE_DISABLE str = ("Disabled") Exit Select Case Native.DEVICE_STATE_NOTPRESENT str = ("Not present") Exit Select Case Native.DEVICE_STATE_UNPLUGGED str = ("Unplugged") Exit Select End Select If str <> "" Then res.AppendLine(str) End If ' DEVICE TOPOLOGY Dim iidDeviceTopology As New Guid("2A07407E-6497-4A18-9787-32F79BD0D98F") dev.Activate(iidDeviceTopology, CUInt(CLSCTX.CLSCTX_ALL), IntPtr.Zero, o) pDeviceTopology = TryCast(o, IDeviceTopology) pDeviceTopology.GetConnector(0, pConnFrom) Try o = Nothing pConnFrom.GetConnectedTo(o) pConnTo = TryCast(o, IConnector) pPart = CType(pConnTo, IPart) 'QueryInterface Dim iidKsJackDescription As New Guid("4509F757-2D46-4637-8E62-CE7DB944F57B") pPart.Activate(CUInt(CLSCTX.CLSCTX_INPROC_SERVER), iidKsJackDescription, o) pJackDesc = CType(o, IKsJackDescription) If pJackDesc IsNot Nothing Then con_count = 0 pJackDesc.GetJackCount(con_count) If con_count > 0 Then Dim sb As StringBuilder 'display jacks For i As UInteger = 0 To con_count - 1 pJackDesc.GetJackDescription(i, desc) sb = New StringBuilder(100) Dim con_type As EPcxConnectionType = CType(desc.ConnectionType, EPcxConnectionType) Dim loc As EPcxGeoLocation = CType(desc.GeoLocation, EPcxGeoLocation) res.Append("* ") Select Case con_type Case EPcxConnectionType.eConnType3Point5mm sb.Append("Jack 3.5 mm ") Exit Select Case EPcxConnectionType.eConnTypeAtapiInternal sb.Append("ATAPI jack") Exit Select Case EPcxConnectionType.eConnTypeRCA sb.Append("RCA jack") Exit Select Case EPcxConnectionType.eConnTypeQuarter sb.Append("1/2 in. jack ") Exit Select Case EPcxConnectionType.eConnTypeOtherAnalog sb.Append("Analog jack ") Exit Select Case EPcxConnectionType.eConnTypeOtherDigital sb.Append("Digital jack ") Exit Select Case Else sb.Append(con_type.ToString() + " ") Exit Select End Select sb.Append("- " + loc.ToString()) 'jack location res.Append(sb.ToString()) If desc.IsConnected = 0 Then res.AppendLine(": Disconnected") Else res.AppendLine(": Connected") End If 'end for Next Else res.AppendLine("* No jacks") End If Else res.AppendLine("* Unable to get jacks") End If Catch ex As COMException If CUInt(ex.HResult) = &H80070490UI Then 'E_NOTFOUND res.AppendLine("Disconnected") Else res.AppendLine("COM error while getting jacks: " + ex.Message) End If Catch ex As Exception res.AppendLine("Error while getting jacks: " + ex.Message) End Try Finally 'clean up resources If dev IsNot Nothing Then Marshal.ReleaseComObject(dev) End If If propertyStore IsNot Nothing Then Marshal.ReleaseComObject(propertyStore) End If If pDeviceTopology IsNot Nothing Then Marshal.ReleaseComObject(pDeviceTopology) pDeviceTopology = Nothing End If If pConnFrom IsNot Nothing Then Marshal.ReleaseComObject(pConnFrom) pConnFrom = Nothing End If If pConnTo IsNot Nothing Then Marshal.ReleaseComObject(pConnTo) pConnTo = Nothing End If If pPart IsNot Nothing Then Marshal.ReleaseComObject(pPart) pPart = Nothing End If If pJackDesc IsNot Nothing Then Marshal.ReleaseComObject(pJackDesc) pJackDesc = Nothing End If End Try Return res.ToString() End Function Public Sub New() InitializeComponent() End Sub Private Sub button_Click(sender As Object, e As EventArgs) Dim devenum As New MMDeviceEnumerator() 'Create enumerator Dim deviceEnumerator As IMMDeviceEnumerator = CType(devenum, IMMDeviceEnumerator) Dim defDevice As IMMDevice = Nothing Dim propertyStore As IPropertyStore = Nothing Try Dim o As Object = Nothing ' * get default device * deviceEnumerator.GetDefaultAudioEndpoint(EDataFlow.eRender, ERole.eConsole, o) defDevice = TryCast(o, IMMDevice) textBox1.Text = "Default sound device: " + Environment.NewLine + Environment.NewLine textBox1.Text += PrintDevice(defDevice) Catch ex As Exception MessageBox.Show(ex.ToString()) Finally 'clean up resources If devenum IsNot Nothing Then Marshal.ReleaseComObject(devenum) End If If deviceEnumerator IsNot Nothing Then Marshal.ReleaseComObject(deviceEnumerator) End If If defDevice IsNot Nothing Then Marshal.ReleaseComObject(defDevice) End If If propertyStore IsNot Nothing Then Marshal.ReleaseComObject(propertyStore) End If End Try End Sub End Class End Namespace
Content is retrieved from StackExchange API.
Auto-generated by ruso-archive tools.


Waffle is a cross-platform C library that allows one to defer selection of an OpenGL API and window system until runtime. For example, on Linux, Waffle enables an application to select X11/EGL with an OpenGL 3.3 core profile, Wayland with OpenGL ES2, and other window system / API combinations.
Waffle's immediate goal is to enable Piglit, Mesa's OpenGL test suite, to test multiple OpenGL flavors in a cross-platform way. However, Waffle's design does not preclude it from being useful to other projects.
At the 2012 X Developer's Conference in Nürnberg, Chad Versace gave a 30 minute presentation on Waffle, which includes a demo of Doom3. Demo begins at 9:15. Q&A session begins at 15:30.
To read the presentation's text, the video needs to be fullscreen.


Example headline.
Note: If you're viewing this page via a file://
URL, the "next" and "previous" Glyphicon buttons on the left and right might not load/display properly due to web browser security rules.
Sign up today
Another example headline.
Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.
Learn more
One more for good measure.
Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.
Browse gallery
Previous
Next
This is a AB repeater, and you can follow the instruction as below:
A: Tag start position
B: Tag end position
C: Clear start and end position


A RESTful (Representational State Transfer) API is an increasingly popular software architecture that enables scalable, maintainable, and performant web services. A RESTful API exposes its underlying data model the same way your browser makes a request to a server to receive a web page, through the HTTP protocol. What this means is that, 1. You don't have to incorporate any additional technology to process your requests, and 2. It's a lot easier! Additionally, RESTful API allows the client to interact with it in the form of standard data objects and markup (XML, JSON, HTML), which are conceptually different than the representations of the data stored on the server. This means you don't have to worry about dealing with advanced data manipulation or conversions to send and receive data, so you can focus on building applications.
There are a few key factors that make a RESTful API "RESTful",
Every RESTful API Request has a few key components that are required to successfully make a request to the server to retreive the information you are looking for. First, every request has a Method. A method is what tells the server what kind of action you are trying to make, whether it be Creating, Retrieving, Updating, or Deleting an object (commonly referred to as CRUD operations). We'll go into more depth down below about how the OrderCloud 3.0 RESTful API uses Methods to accomplish CRUD operations.
The second component of a RESTful API Request is a URL. The URL is what your API Request will use to understand where it should be sending itself to fulfill its obligations. Every URL request has as base URL and a routing URL, where the base URL informs the request of the location of the server it is targeting, and the routing URL will tell the server what the request is targeting, so the server knows how to handle it. The OrderCloud 3.0 base url is,
https:/api.ordercloud.io
An example of an OrderCloud 3.0 Routing URL is,
/v1/buyers/{buyerID}/users
where 'v1' is the version of the API, 'buyers' is telling the API that it's going to be targeting the buyers peice of the API, '{buyerID}' is the specific buyer it is targeting, and 'users' is telling the server that it is targeting users underneath the buyer specified before it. Notice how the routing URL accepts a parameter for 'buyerID'. We'll get deeper into how parameters are included down below, but keep in mind that a parameter can be included in the routing URL.
The third component of a RESTful API Request is Headers. Headers are synonymous with 'Meta Information', meaning they provide additional descriptive but necessary information about the request that the server will need to process the request. Two Headers that you will send in every request you make to the OrderCloud 3.0 RESTful API are 'Content-Type' and 'Authorization'. 'Content-Type' tells the server what type of object-format you are sending and what kind of object-format you want back. 'Authorization' will include a token that let's the server know that whoever is sending the request to the server is authenticated and should be trusted. In these tutorials, we will be using a 'Content-Type' of 'application/json'. You will learn more about your 'Authorization' token in the next class.
The fourth component of a RESTful API Request is Parameters. Parameters are not necessarily a part of every request, because not every request requires a parameter. An easy example of this in OrderCloud 3.0 is when you want to GET a list of all buyers under your distributor. The Request would be,
GET https://api.ordercloud.io/v1/buyers
which would also be sent with the 'Content-Type' and 'Authorization' Headers. You'll learn a lot about what you need to include for each request in the docs, as well as these tutorials.
Parameters can be included in a request in two ways. The first is in the routing URL as suggested above. The second is to append a list of parameters to the end of the routing url starting with '/?', each split up by '&', using a key/value format of 'key=value', like so,
{baseURL}/{routingURL}/?key=value&key2=value2
It is a common best-practice when working with parameters in your application request to create a parameters object, and then append that object to the URL when the request is processed. You will find that many frameworks such as AngularJS will handle this for you.
The final component of a RESTful API Request is a request object. A request object, much like params, is required in some calls, while unnecessary in others. You will be dealing with request object primarily when creating or updating an object on the server, while the exact opposite is true when dealing with retrieving or deleting an object. In OrderCloud 3.0, all request objects are sent in JSON Object Notation. On the flip side, all return objects will be sent back to the client in the same format. You will find that this is one of the greatest attributes of the OrderCloud 3.0 API and RESTful API's in general. The data is really easy to use!
Every RESTful API has a standard set of Methods that allow you to interact with the data model. They all serve a different purpose, but together offer an exhaustive tool-set to interact with the server. The Methods used on OrderCloud 3.0 are,
GET
POST
PUT
PATCH
DELETE
GET
is one of the most commonly used Methods, and allows you to do exactly as the name
suggests. GET
is what you will use to access any data objects that are already stored on the
server. This Method is read-only, meaning you will only be able to access information stored on the
server, never manipulate it.
POST
is also a very commonly used Method in OrderCloud 3.0, and allows you to send new
objects to be created and stored on the server. With a POST
Method call, you must also send an object
as part of the request, like so,
which is where the content of the object you are creating will be located.
PUT
is a utility method in RESTful API's. It allows you to create OR update an object stored on
the server. With a PUT
method call, you must also send an object in the request. If the ID of
the object is not found on the server, a new object will be created with that ID. If the ID of the object
is found, a PUT
method will update the object with the new object you send in the request.
Note that if you are using PUT
to update a pre-existing object, you must send a full object
in your request. This means you cannot send it an object with only the updates you wish to make.
PATCH
is similar to a PUT
in that it updates a pre-existing object already stored
on the server. The difference is that with a PATCH
method call, you only have to send the changes
in the request object vs. the entire object. This works great for when you are only updating a small piece of
the object you are targeting.
DELETE
will remove an entire object from server. You will not have to send an object with a
DELETE
method call, as the information of the target object you are attempting to delete
will be in the parameters.
To the right, you will see three different containers. The large container on the left is the OrderCloud 3.0 Console. This is a fully function HTTP protocol-based console for you to send real API requests, much like you would in Google's PostMan or Fiddler. We have set this console up with some additional functionality specific to OrderCloud 3.0 to make working with our API easier.
In the bottom right corner, you will see your response console. This is where any response data from your API request will end up. It will also be the first place you'll want to look if you run into any errors, as the API has robust error messaging functionality.
And finally, in the upper right hand corner, we have provided you with a console log. This log will show you all of your previous calls, and if you select on the eye icon, your console will populate with everything you filled in to make that call, including the response.
The console is currently disabled, because there are not yet any API Calls you can make without being
authenticated. However, we have pre-populated the console to give you a taste of what a successful call will
look like in a GET
User call. Once you move on from this class, The OrderCloud 3.0 Console
will be available to you in every class you take. You have the option to pre-fill the method, url, and
parameters in every course (change the settings in the upper right hand corner of the console). You will be able
to make any request you want, in any course, at any time. Additionally, the OrderCloud 3.0 Console is available
outside of the tutorials in the Dev Center. Feel free to make your way over and play around,
along with our other helpful Dev Tools.


Celebrity Dating!
Celebrities exist! You can date them maybe!
Go away kid, you're bothering me.
Pick a gender:
Male
Female
Other
You gotta pick one
Describe your ideal first date:
You gotta fill it in
What religion are you?
Hindu
Other
You gotta pick one
Submit Answers!
Reset Quiz
Congratulations, it's Nicolas Cage!
He's everybody's perfect match!


Under supervision, Instructional Student Assistants perform teaching, grading or tutoring duties for the majority of work hours in a given appointment in a given academic department or equivalent administrative unit over the course of an academic term.
Served as Teaching Associate during the Winter-2018 semester on a contractual basis.


Class AV.ACL
An ACL, or Access Control List can be added to any
AV.Object
to restrict access to only a subset of users
of your application.
Defined in: av.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
AV.ACL(arg1)
Creates a new ACL.
|
| Method Attributes | Method Name and Description |
|---|---|
|
Get whether the public is allowed to read this object.
|
|
|
Get whether the public is allowed to write this object.
|
|
|
getReadAccess(userId)
Get whether the given user id is *explicitly* allowed to read this object.
|
|
|
getRoleReadAccess(role)
Get whether users belonging to the given role are allowed
to read this object.
|
|
|
getRoleWriteAccess(role)
Get whether users belonging to the given role are allowed
to write this object.
|
|
|
getWriteAccess(userId)
Get whether the given user id is *explicitly* allowed to write this object.
|
|
|
setPublicReadAccess(allowed)
Set whether the public is allowed to read this object.
|
|
|
setPublicWriteAccess(allowed)
Set whether the public is allowed to write this object.
|
|
|
setReadAccess(userId, allowed)
Set whether the given user is allowed to read this object.
|
|
|
setRoleReadAccess(role, allowed)
Set whether users belonging to the given role are allowed
to read this object.
|
|
|
setRoleWriteAccess(role, allowed)
Set whether users belonging to the given role are allowed
to write this object.
|
|
|
setWriteAccess(userId, allowed)
Set whether the given user id is allowed to write this object.
|
|
|
toJSON()
Returns a JSON-encoded version of the ACL.
|
Class Detail
AV.ACL(arg1)
Creates a new ACL.
If no argument is given, the ACL has no permissions for anyone.
If the argument is a AV.User, the ACL will have read and write
permission for only that user.
If the argument is any other JSON object, that object will be interpretted
as a serialized ACL created with toJSON().
- Parameters:
- arg1
- See:
- AV.Object#setACL
Method Detail
{Boolean}
getPublicReadAccess()
Get whether the public is allowed to read this object.
- Returns:
- {Boolean}
{Boolean}
getPublicWriteAccess()
Get whether the public is allowed to write this object.
- Returns:
- {Boolean}
{Boolean}
getReadAccess(userId)
Get whether the given user id is *explicitly* allowed to read this object.
Even if this returns false, the user may still be able to access it if
getPublicReadAccess returns true or a role that the user belongs to has
write access.
- Parameters:
- userId
- An instance of AV.User or its objectId, or a AV.Role.
- Returns:
- {Boolean}
{Boolean}
getRoleReadAccess(role)
Get whether users belonging to the given role are allowed
to read this object. Even if this returns false, the role may
still be able to write it if a parent role has read access.
- Parameters:
- role
- The name of the role, or a AV.Role object.
- Throws:
- {String}
- If role is neither a AV.Role nor a String.
- Returns:
- {Boolean} true if the role has read access. false otherwise.
{Boolean}
getRoleWriteAccess(role)
Get whether users belonging to the given role are allowed
to write this object. Even if this returns false, the role may
still be able to write it if a parent role has write access.
- Parameters:
- role
- The name of the role, or a AV.Role object.
- Throws:
- {String}
- If role is neither a AV.Role nor a String.
- Returns:
- {Boolean} true if the role has write access. false otherwise.
{Boolean}
getWriteAccess(userId)
Get whether the given user id is *explicitly* allowed to write this object.
Even if this returns false, the user may still be able to write it if
getPublicWriteAccess returns true or a role that the user belongs to has
write access.
- Parameters:
- userId
- An instance of AV.User or its objectId, or a AV.Role.
- Returns:
- {Boolean}
setPublicReadAccess(allowed)
Set whether the public is allowed to read this object.
- Parameters:
- {Boolean} allowed
setPublicWriteAccess(allowed)
Set whether the public is allowed to write this object.
- Parameters:
- {Boolean} allowed
setReadAccess(userId, allowed)
Set whether the given user is allowed to read this object.
- Parameters:
- userId
- An instance of AV.User or its objectId.
- {Boolean} allowed
- Whether that user should have read access.
setRoleReadAccess(role, allowed)
Set whether users belonging to the given role are allowed
to read this object.
- Parameters:
- role
- The name of the role, or a AV.Role object.
- {Boolean} allowed
- Whether the given role can read this object.
- Throws:
- {String}
- If role is neither a AV.Role nor a String.
setRoleWriteAccess(role, allowed)
Set whether users belonging to the given role are allowed
to write this object.
- Parameters:
- role
- The name of the role, or a AV.Role object.
- {Boolean} allowed
- Whether the given role can write this object.
- Throws:
- {String}
- If role is neither a AV.Role nor a String.
setWriteAccess(userId, allowed)
Set whether the given user id is allowed to write this object.
- Parameters:
- userId
- An instance of AV.User or its objectId, or a AV.Role..
- {Boolean} allowed
- Whether that user should have write access.
{Object}
toJSON()
Returns a JSON-encoded version of the ACL.
- Returns:
- {Object}


Different Kernel Functions
There are many different types of Kernel. Here are a few of common ones.
The Linear Kernel
The Linear kernel is the kernel we used in the first example.
It is linear because there is no projection into a higher dimension and the SVM is found in the initial dimension.
It is extremely quick to calculate in comparison to non linear kernels.
The Polynomial Kernel
For degree-\(d\) polynomials, the polynomial kernel is defined as:
\[
K(x,y) = \left( x^{\top}y+C \right)^d
\]
- \(x\) and \(y\) are vectors in the input space.
- \(c \ge 0\) is a free parameter trading off the influence of higher-order versus lower-order terms in the polynomial.
The polynomial kernel is the one that we used in the projection example earlier.
The polynomial kernel is useful in natural language processing although in most other applications, the Radial Basis Function is used instead.
The Radial Basis Function
The RBF is defined as:
\[
\begin{align}
(\mathbf{x}\cdot \mathbf{x}')
&= \exp{\left( -\gamma ||\mathbf{x}-\mathbf{x}'||^2 \right)}
\end{align}
\]
An example of a very useful kernel fucntion is the Radial Basis Function. Here is an example of an RBF Support Vector Machine:
The radial basis function is very useful because it allows for us to represent an infinite dimension projection. Since a dot product is just a summation, we can use an approach similar to
infiite series to find an approximation of this dot product.
How the RBF represents an infinite dimension projection
Remembering the definition of the kernel function:
\[
k(\mathbf{x}_i,\mathbf{x}') = \langle\varphi(\mathbf{x}),\varphi(\mathbf{x}')\rangle_{\mathcal{V}}
\]
We can prove that \( \varphi_{RBF}:\mathbb{R}^n \rightarrow \mathbb{R}^{\infty} \).
(We choose \(\gamma = -\frac{1}{2}\) to avoid loss of generality.)
\[
\begin{align}
K_{RBF}(\mathbf{x},\mathbf{x}')
&= \exp{\left[ -\frac{1}{2} || \mathbf{x}^2 - \mathbf{x'}||^2 \right]} \\
&= \exp{\left[ -\frac{1}{2} \langle \mathbf{x} - \mathbf{x'}, \mathbf{x} - \mathbf{x'} \rangle \right]} \\
&= \exp{\left[ -\frac{1}{2} \left( \langle \mathbf{x} , \mathbf{x} - \mathbf{x'}\rangle - \langle \mathbf{x'}, \mathbf{x} - \mathbf{x'} \rangle \right) \right]} \\
&= \exp{\left[ -\frac{1}{2} \left( \langle \mathbf{x},\mathbf{x} \rangle - \langle \mathbf{x},\mathbf{x'} \rangle - \langle \mathbf{x'},\mathbf{x} \rangle + \langle \mathbf{x'},\mathbf{x'} \rangle \right) \right]} \\
&= \exp{\left[ -\frac{1}{2}\left(||\mathbf{x}||^2 + ||\mathbf{x'}||^2-2\langle \mathbf{x}, \mathbf{x'}\rangle\right)\right]} \\
&= \exp{\left[ -\frac{1}{2}||\mathbf{x}||^2-\frac{1}{2}||\mathbf{x'}||^2 \right]}\exp{\left[ -\frac{1}{2}-2\langle \mathbf{x}, \mathbf{x'} \rangle \right]} \\
\end{align}
\]
Since
\[
\exp{ \left[ -\frac{1}{2} || \mathbf{x}^2 - \mathbf{x'}^2 || \right]} = C \quad \text{(constant)}
\]
We can use the taylor expansion of \(e^x\) to show:
\[
\begin{align}
&\exp{\left[ -\frac{1}{2}||\mathbf{x}||^2-\frac{1}{2}||\mathbf{x'}||^2 \right]}\exp{\left[ -\frac{1}{2}-2\langle \mathbf{x}, \mathbf{x'} \rangle \right]} \\
&= C \exp{\left[ -\frac{1}{2}-2\langle \mathbf{x}, \mathbf{x'} \rangle \right]} \\
&= C e^{\langle \mathbf{x}, \mathbf{x}' \rangle} \\
&= C\sum_{n=0}^{\infty}\frac{{\langle \mathbf{x}, \mathbf{x}' \rangle}^n}{n!} \\
&= C\sum_{n=0}^{\infty}\frac{K_{poly(n)} (\mathbf{x}, \mathbf{x}' )}{n!} \\
\end{align}
\]
Therefore we see that the RBF kernel is formed by taking an infinite sum over polynomial kernels.
The Fisher Kernel
This kernel combines Support Vector machines with generative models such as hidden Markov models to combine the performance of SVMs with the ability of process data that has a variable length.
It uses the Fisher score:
\[
U_X=\nabla_{\theta}\log{P(X|\theta)}
\]
It is defined as:
\[
K(X_i, X_j) = U_{X_i}^{T}\mathcal{I}^{-1}U_{X_j}
\]
Where \(\mathcal{I}\) is the Fisher information matrix.
The fisher Kernel can be applied to image representation for classification and retrieval. It can take problems with sparsity and high dimensionality and produce a result that is compact and dense.
This is very desirable in image representation problems.


| plot_covid19_stripes {tidycovid19} | R Documentation |
Provides a flexible visualization of the country-level Covid-19 spread, plotted by colored daily lines to generate a stripes display. Uses data from the Johns Hopkins University CSSE team (https://github.com/CSSEGISandData/COVID-19) and the World Bank (https://data.worldbank.org).
plot_covid19_stripes( data = download_merged_data(cached = TRUE, silent = TRUE), type = "deaths", min_cases = ifelse(per_capita, ifelse(type == "deaths", 5, 50), ifelse(type == "deaths", 1000, 10000)), cumulative = FALSE, change_ave = 7, per_capita = FALSE, population_cutoff = 0, diverging_color_scale = FALSE, countries = NULL, sort_countries = NULL, data_date_str = format(lubridate::as_date(data$timestamp[1]), "%B %d, %Y") )
data |
The data frame to base the plot on. Should be a merged data
frame obtained by download_merged_data and defaults to
|
type |
The statistic that you want to plot. Needs to be either "confirmed", "deaths", "recovered" or "active", defined as the difference of "confirmed", "deaths" and "recovered". |
min_cases |
Only countries that have a maximum of |
cumulative |
If |
change_ave |
Number of days to average over when you plot daily changes. |
per_capita |
If |
population_cutoff |
Do you want to restrict the plot to countries that exceed a certain population cutoff? Takes a value in millions and defaults to 0. Useful for per capita displays. |
diverging_color_scale |
Should be set to |
countries |
A character vector of ISO3c (ISO 3166-1 alpha-3) codes that you want to include. Note that including many countries can lead to long plotting times and might cause the plot to fail rendering when the display is to small. |
sort_countries |
By default, countries are sorted alphabetically by
ISO3c code. "start" will sort countries by when they first exceeded
|
data_date_str |
A date string to include in the annotation of the plot giving the time when the data was pulled. Defaults to the timestamp of the data. Note that you might run into issues with the default when running this in a non-english locale. Consider setting it by hand then. |
A ggplot2
oobject.
plot_covid19_stripes() merged <- download_merged_data(cached = TRUE, silent = TRUE) plot_covid19_stripes(merged, per_capita = TRUE, population_cutoff = 10) plot_covid19_stripes(merged, countries = c("ITA", "ESP", "FRA", "DEU", "USA"), sort_countries = "countries" ) sortdf <- dplyr::tibble( iso3c = unique(merged$iso3c), continent = countrycode::countrycode(iso3c, "iso3c", "continent") ) %>% dplyr::arrange(continent, iso3c) df <- merged df$iso3c <- factor(merged$iso3c, sortdf$iso3c) plot_covid19_stripes(df, type = "confirmed")


{% extends 'base.html' %} {% block head %}
Mark the dog interest in samples.
{{i}}
No
Interested
Maybe
Yes


Directions
Press any dinosaur on the screen. Press each dinosaur until you match the generated score. If your total score is greater than the number to match, you lose.
Number to Match:
Total score:
Wins:
Losses:
Having fun?


MGS4 Now Fully Playable in RPCS3 on PC
by Peter DonnellA few months ago, we finally saw that PlayStation 3 emulator had crossed one of its biggest hurdles. Getting Metal Gear Solid 4 to run on the emulator has been a huge task. Mostly due to the nature of how the game used a special overlay technique, as it was an undocumented and complex feature of the PlayStation 3 hardware and pretty much the only game that used it too.
The development was a big job, but once it was cracked, it opened up the flood gates. Since then, we saw a glitchy version running, then within just a WEEK we saw damn near all of those graphics issues resolved. However, it now seems that work is fully completed and all major issues are resolved. We can finally play Metal Gear Solid 4 from start to finish in RPCS3 on our PCs!
What’s amazing is that the only “big” issue is that the frame rate will occasionally drop below 60 FPS. That’s hardly a kick in the teeth given then game ran at 30 FPS on the PlayStation 3!
You can download the emulator and fill your boots here. Just erm, don’t ask us where to get a copy of the game.


Patchy
softashell/patchy
Now playing
for
0
listeners
ゆるやかに
by
Kikuo
from
きくおミク4
2:48
/
2:48
Queue
Browse
Search
Upload
Nothing to see here yet
Title
Artist
Album
File
Search
Nothing to see here yet


1Time 2Guests 3Guests Info
1
Time
2
Guests
3
Guests Info
No free places left!
Available times:
Please choose the number of guests:
Name:
Email Address:
Loading...
Your booking was successful!
Close Window


{% extends "base_generic.html" %} {% block pagetitle %}{{ finding.title }} Details{% endblock %} {% block content %}
{{ finding.severity.severity }}
{% elif finding.severity.severity == "High" %}{{ finding.severity.severity }}
{% elif finding.severity.severity == "Medium" %}{{ finding.severity.severity }}
{% elif finding.severity.severity == "Low" %}{{ finding.severity.severity }}
{% else %}{{ finding.severity.severity }}
{% endif %}{{ finding.description|linebreaksbr }}
{% else %}Description write-up is needed.
{% endif %}{{ finding.impact|linebreaksbr }}
{% else %}Impact write-up is needed.
{% endif %}{{ finding.mitigation|linebreaksbr }}
{% else %}Recommendations are needed.
{% endif %} {% if finding.host_detection_techniques %}{{ finding.host_detection_techniques|linebreaksbr }}
{% endif %} {% if finding.network_detection_techniques %}{{ finding.network_detection_techniques|linebreaksbr }}
{% endif %}{{ finding.replication_steps|linebreaksbr }}
{% else %}Replication steps are needed.
{% endif %}{{ finding.references|linebreaksbr }}
{% else %}References are needed.
{% endif %} {% if finding.finding_guidance %}{{ finding.finding_guidance }}
{% endif %}


I was born in the month of October of the year 1993, in Bogotá, Colombia
This year I finished my primary school studies at the CIEDI school outside of Bogotá
This year I finished my middle school studies at the Gimnasio Del Norte in Bogotá
I started working as a logistic support in the company Agroservicios Especiales Ltda
I finished my high school studies at an IB school
I stopped working with Agroservicios Especiales Ltda at the end of the year
I worked for a few months at the Central Bernard company in Montreal, Canada
I finished gastronomy at the hotel school Bilbao Colombia
Enter the Systems and Computer Engineering program at Universidad de los Andes
Logistical Support | January 2012 to December 2013
Bogotá, Colombia
Provide logistic support for the routes taken by the company's
vehicles and coordinate deliveries, dispatches and transfers
Machinery Operator | November 2014 to January 2015
Montreal, Canada
Machine handling, loading and unloading of merchandise
Teacher's Assistant | January 2017 to December 2017
Bogotá, Colombia
Solve student doubts, support during the partials, qualify course
work


Injury Update For Kansas City Chiefs RB Damien Williams
by Matt HladikIf you’re a fantasy football player who needed a big performance out of Kansas City Chiefs running back Damien Williams, you’re probably not very happy right now.
Williams went down late in the first half of tonight’s game against the Los Angeles Chargers when he took a big hit on a running play. Williams stayed down on the ground for a while.
It looked like the veteran running back injured his chest. Sure enough, Kansas City announced Williams is dealing with a rib injury.
He is officially questionable to return.
With Williams out of commission, LeSean McCoy and Darrell Williams have carried the load to start the second half. Each player has a touchdown in the game.
Currently, the Chiefs lead the Chargers 17-9 in the third quarter after Darrell Williams scored on a goal-line run.
You can watch the action on ESPN.


The ezmodelR
package provides a collection of functions that make it easier to extract information from various models for the purpose of comparing them. The package is meant to be used in conjunction with the caret
package and offers new scoring methods, the ability to view the results of regularization, and the ability to quickly and easily compare training and test error of a model while varying a parameter.
The regularization_plot
function allows the user to view a plot comparing coefficient magnitude and regularization strength for:
model='ridge'
)model='lasso'
)model='logistic'
)The function takes arguments specifying the type of model, the regularization strength lambda
(which can be a vector of different values), a dataframe x
for the features, and a dataframe y
for the response. An optional tolerance argument tol
can be specified.
There are two main types of plots that can be created. If lambda
is a vector of length 1, then the plot will display the magnitude of the coefficients of the model.
regularization_plot('lasso', lambda=2, x=X, y=Y)
If lambda
has a length larger than 1, then the plot will display the number of nonzero coefficients of the models produces vs. the regularization strength.
regularization_plot('ridge', 'lambda=2^c(-1,0,1), x=X, y=y)
The optional tolerance argument can be useful if you want to treat all coefficients with a magnitude smaller than some number as 0. By default, tol=1e-7
, so any coefficient with a magnitude less than that will be treated as 0 for plotting purposed.
The function will return a ggplot2
plot of the object, which is convenient as the data plotted (e.g. coefficient values) can then be extracted from it.
The train_test_plot
function allows the user to view a plot comparing training and test error while iterating across a specified hyperparameter for the following models:
model='decision_tree'
)model='ridge'
)model='lasso'
)model='logistic'
)Note: ‘ridge’, ‘lasso’, and ‘logistic’ regression are not yet implemented.
The function takes arguments specifying the type of model, the type of score plotted score_type
, dataframe containing features x
, a dataframe containing the response variable y
, The hyperparameter
to iterate over, the parameter range that defines the iteration param_range
, as well as a random seed that standardizes the split of training and test data random_seed
.
The function will return a plot showing training and test error across the defined range of the hyperparameter. Depending on the output the user can get an idea which value of the hyperparameter lead to under or overfitting and adjust the model accoringly.
Here’s an example of the syntax to call the function for a decision tree model:
train_test_plot(model = "decision_tree", score_type = "accuracy", x = Y,
y = Y, hyperparameter = "cp", param_range = range(...), random_seed= ...)
The function will return a ggplot2
plot of the object, which is convenient as the data plotted (e.g. coefficient values) can then be extracted from it.
The score()
function allows the user to compute various scoring metrics for a specified model trained in caret
. Currently, the following metrics are supported:
score_type=mse
score_type=accuracy
score_type=specificity
score_type=sensitivity
score_type=r2
score_type=adj_r2
This function takes in arguments specifying the type of caret model to train, the score type to return a function for, and global settings for the caret model to be trained.
It then returns a function that takes two arguments: features: x
and response y
. Calling this function will return the score, as a double, for the previously provided model, and the data provided to this function. x
and y
must both be dataframes
Here is an example of how to call score()
in order to get a function for sensitivity for a random forest model:
rf_score <- score('rf', 'sensitivity')
The above code block will return a function that will compute the sensitivity for a random forest trained on the data you provide it.
If you don’t want a function back, or only have one set of data you are testing score on; you could simply provide the x and y data in the original function call as follows:
rf_score <- score('rf', 'sensitivity')(x, y)
This second code block will return a double.


Near-field Communication or NFC is a standard defined by the NFC Forum . NFC Data Exchange Format (NDEF) defines a common data format between NFC-compliant devices and tags. This demo application shows how to read a NDEF Tags using using Android 2.3 SDK APIs. The NFC Tags consist of data encoded in NDEF Message format specified by NFC Forum Type 2 Specification. Each NDEF message consists of one or more NDEF Records. You need a NFC compliant device and a NFC compliant Tag to use this sample app. Or else, you could use the FakeTagsActivity displayed at launch of this sample app, to generate fake Tag broadcasts from the emulator.
The application includes:
TagViewer
— an
Activity
that handles a broadcast of a new tag that the device
just discovered, parses it, and displays its record contents in a
ListActivity
NdefMessageParser
— parses the record type of records within the NDEF message.
ParsedNdefRecord
— an interface implemented by all parsed NdefRecord types.
SmartPoster
— a representation of an NFC Forum Smart Poster Record Type.
TextRecord
— a representation of an NFC Forum Text Record Type.
UriRecord
— a representation of an NFC Forum Uri Record Type.
FakeTagsActivity
— A activity that launches tags as if they had been scanned.
This is useful if you don't have access to NFC enabled device or tag.
MockNdefMessages
— this class provides a list of fake NFC Ndef format Tags.
If you are developing an application that uses the NFC API, remember that the feature is supported only on Android 2.3 (API level 9) and higher versions of the platform. Also, among devices running Android 2.3 (API level 9) or higher, not all devices will offer NFC support. To ensure that your application can only be installed on devices that are capable of supporting NFC, remember to add the following to the application's manifest before publishing to Google Play:
<uses-sdk android:minSdkVersion="9" />
,
which indicates to Google Play and the platform that your application requires
Android 2.3 or higher. For more information, see
API Levels
and the documentation for the
<uses-sdk>
element.
To control how Google Play filters your application from devices that do not support NFC, remember to add the following to the application's manifest
<uses-feature android:name="android.hardware.nfc" />
,
which tells Google Play that your application uses the NFC API. The declaration
should include an
android:required
attribute that indicates whether you want
Google Play to filter the application from devices that do not offer NFC support. Other
<uses-feature>
declarations may also be needed, depending on your
implementation. For more information, see the documentation for the
<uses-feature>
element.
For more information about using the NFC API, see the
android.nfc
documentation.


US indicts Air Peace boss for over $20 million bank fraud, falsification of documents
by Lukman ABOLADEAdvertisement
THE Chairman and Founder, Air Peace, Allen Onyeama and one other has been charged with bank fraud and money laundering for moving more than $20 million from Nigeria through United States bank accounts in a scheme involving false documents on purchase of aeroplanes.
Onyeama who was recommended by the Nigeria House of Representatives for a National Award for ensuring the evacuation of Nigerians in South Africa following the Xenophobic attacks on Citizens of Nigeria and other African Nationals has been accused of bank fraud by the United States Department of Justice.
In a Press Statement, the US Department of Justice said along with Onyeama, the airline’s Chief of Administration and Finance, Ejiroghene Eghagha, has also been charged with bank fraud and committing aggravated identity theft in connection with the scheme.
According to the statement, United States Attorney of Georgia Northern District, Byung J. Pak said Onyema allegedly leveraged his status as a prominent business leader and airline executive while using falsified documents to commit fraud and that the US will diligently protect the integrity its banking system from being corrupted by criminals, even when they disguise themselves in a cloak of international business.
“Allen Ifechukwu Athan Onyema, 56, of Lagos, Nigeria, and Ejiroghene Eghagha, 37, of Lagos, Nigeria, were indicted on November 19, 2019, on one count of conspiracy to commit bank fraud, three counts of bank fraud, one count of conspiracy to commit credit application fraud, and three counts of credit application fraud. Additionally, Onyema was charged with 27 counts of money laundering and Eghagha was charged with one count of aggravated identity theft,” the statement read
Advertisement
Pak said that in 2010, Onyema began travelling frequently to Atlanta, where he opened several personal and business bank accounts. Between 2010 and 2018, over $44.9 million was allegedly transferred into his Atlanta-based accounts from foreign sources.
He added that Onyema after establishing in years following the founding of Air Peace, he travelled to the United States and purchased multiple aeroplanes for the airline.
He noted that over $3 million of the funds used to purchase the aircraft allegedly came from bank accounts for Foundation for Ethnic Harmony, International Centre for Non-Violence and Peace Development, All-Time Peace Media Communications Limited, and Every Child Limited.
Pak said beginning in approximately May 2016, Onyema, together with Eghagha, allegedly used a series of export letters of credit to cause banks to transfer more than $20 million into Atlanta-based bank accounts controlled by Onyema.
“The letters of credit were purportedly to fund the purchase of five separate Boeing 737 passenger planes by Air Peace. The letters were supported by documents such as purchase agreements, bills of sale, and appraisals proving that Air Peace was purchasing the aircraft from Springfield Aviation Company LLC, a business registered in Georgia,” the statement read.
The US Department of justice, however, added that members of the public are reminded that the indictment only contains charges. The defendants are presumed innocent of the charges and it will be the government’s burden to prove the defendant’s guilt beyond a reasonable doubt at trial.


Canvas vs. DOM Sprites: An actual experience.
Some may ask, whether I should use Canvas or DOM to create a game running on modern browsers? There are a few articles out there, However, I would like to share a bit of my experience of both technologies.
DOM Sprites - Tilt Blocks
Tilt Blocks, a puzzle game, is entirely written in DOM Sprites.
Basically, each scene, the game board, controls, and down to each element are a hirerachy of

elements, as you can find in the code. Some divs are empty, as they are to be populated by Javascript. While some others, mostly elements which do not change due the entire session, has elements pre-placed in it.
Why?
To be frank, it is because I am not ready to learn a new technology at that time, while I was fairly familiar with DOM (really,

s) manuipulation by JQuery, used extensively to manipulate the DOM. However, as the code grows, there are a few benefits of doing this:
- The level editor becomes surprisingly easy to code. More on that later.
- No need to handle where is the mouse and determine what is clicked - just do
$('#elem').click(function(){...});
- Moving blocks around is easy, just do
$('.elem').animate({...});
. Don't forget to change internal state too (also required in canvas.) - Old browsers (namely, the hated IE8) support - even though this is not my requirement, it is definitely a plus. (Tried this, IE8 looks quite good, and even IE7 is playable (though there are layout issues)).
Level Editor?
If I were to use canvas to implement the game as well as the level editor, not just I have to deal with clicks by hand, the scrollpane (palette of elements) would also have to be implemented by hand, and this already sounds tricky, and I even need to capture clicks inside... (Anyone wants to do this may want to look at this question over StackOverflow, though.)
However, with DOM, this become trivial. With help of a plugin familiar to me (jScrollPane), I can easily create the scrollpane. And the editor was done in just one or two days.
Gotchas?
Sure. At first, I populated the entire board with divs (i.e. even empty block has a div in it). However, when I move it, problem arises - divs of empty element and actual blocks moved overlaps. This breaks the entire thing of one block occupies one space. Of course I can move empty blocks around, but as many blocks in a row can be moved at once, quite a number of empty divs can be displaced, complicate things, and causes slow down. Moreover, it appears that the performance isn't that good.
So, I decided to let empty space be no div there. Less divs mean better performance.
Another gotcha is, remember to associate the div with the corresponding entity in the game state. Only this can leverage the DOM easily and simply. Few CSS classes would do. Specification varies from game to game really. In Tilt Blocks, it is specified by its location, in format r2c3. This way, we can easily pick up an element on a specified position, and then move it.
However, this way only works if there is only one (movable) element in any position at any time. In Tilt Blocks, I have used another class specifiying its type (red, arrows, etc...), and as only a few type of blocks can move around, I can just use $('.r1c1').not('.classes')
to filter out immovable things. This works because all movable blocks will never overlap.
Canvas - Sq
Sq, a Geometry war clone, was mostly implemented in Canvas instead. However, the minimal UI that you see in the front page as well as highscore page still uses DOM. (Not sprites really, I would call it a DOM-based layout like ordinary websites.)
At first, I also tried to use DOM Sprites in this project. And you guessed it, each square enemy, circle player, circle bullets, and the texts are all a single div
. And, rotation can be done with CSS Translations. (No particle effects have been implemented at that time.)
However, when there is a hundred divs. (Which is typical especially at later stages), it is very slow... It's like, at most 10 FPS I think - totally unacceptable (Note: there was no serious measurement). My machine is not slow at all (a 4 years old entry-level laptop), and should handle 2D games pretty easily...
This was not a problem in Tilt Blocks, because that game is pretty static and see, there isn't even a game loop! Tilt blocks was entirely event-driven, but Sq is not.
More importantly, there is no need capture mouse click on a certain element (Except the UI part), and there is no need to retrieve the status from drawn elements (because all those are kept track by Box2D.) That said, the big advantage of DOM Sprite cannot be leveraged.
As a side note, indeed, even if I have to determine where the mouse is, in terms of game element, it is not difficult thanks to Box2D built-in functions.
Hence, I switched to canvas.
And with canvas, hundreds, even thousands of elements can be drawn without too much delay. Even with particles the game rarely lags. For even more elements, it could slow down, but the burden is actually on the internals (mainly, collision detection of Box2D), rather than rendering.
Gotchas?
As I have said, the entire game is actually a hybrid approach. The UI and scene switch is ordinary DOM while the main game is canvas. This way I can leverage the efficiency of canvas in the main game, while making the relatively static main page and highscore page easy to implement (because there is no need to determine mouse position and button position when clicking).
Canvas vs. DOM Sprites
As usual, it really depends on what you want to do. They are just two different tools. You can see their performance may vary depends on how you use it. After all, they have different advantages. From this experience, we can see:
For DOM Sprites, you have
- Remove the burden of finding out where the mouse is, in terms of which element it is on.
- More established, ready-to-use solutions (such as scroll pane, simple animations).
- Works with IE <=8.
For HTML5 Canvas, you have
- Better performance in modern browser and good machine, because of less overhead of keeping track of each
div
element. - Supports WebGL, better support for Box2D and such


EDCON
Welcome,
admin
Home
Dashboard
Registration
Tickets
Early Bird Ticket
Student Ticket
{{newStudentNum}}
Standard Ticket
Developer Ticket
{{newDevNum}}
Free Ticket
Pay Fail Ticket
{{newPayFailNum}}
Speaker
{{newSpeakerNum}}
Sponsor
{{newSponsorNum}}
Media
{{newMediaNum}}
Community
{{newCommunityNum}}
Superdemo
{{newSuperdemoNum}}
签到
Check In
Setting
Emails
admin
Change Password
Log Out
Edit Email
pass
reject
free
reject community
reject media
fail pay
Subject
Save
×
Change Password
Old Password
New Password


My Work
I design responsive, accessible, performant, resilient and beautiful websites. I have depth understanding in web standard technologies, and got much experience to design and deliver quality and professional products that function and respond to anything that access the web.
I also help organizations leverage digital platforms to establish online presence in the areas of Digital Marketing, Social Media Management, Content Writing & Site Administration, Search Engine Optimization and Google Map Integration.
Got a project in mind? Interested in having a cool website? Or just wanna hear about the work I do? I would love to hear from you.


---
layout: archive
title: Lean Prover Zulip Chat Archive
permalink: 113489newmembers/63737LearningalgebraicgeometryhowcanIcontribute.html
---
The archive URL format has changed. Please find this page at:
https://leanprover-community.github.io/archive/stream/113489-new-members/topic/Learning.20algebraic.20geometry.3B.20how.20can.20I.20contribute.3F.html


Learn to code by
playing games
Codepip is the platform for your favorite web
development games. Gain an edge in your
next interview or project.
Create a free account to enjoy these features
CHECKPOINTS |
ACHIEVEMENTS |
NEW RELEASES |
Save your progress and access it from anywhere. |
Track and share your in-game achievements. |
Discover games that teach the latest coding topics. |
|
我有，但我不想給你 |
我先走了，我對智障過敏 |
你說話前請先掛號 |
| Free | Pro Monthly |
Pro Lifetime |
|
| Free Games | ✔ | ✔ | ✔ |
| Pro Saving | ✔ | ✔ | ✔ |
| Pro Saving | ✔ | ✔ | |
| No Ads | ✔ | ||
| Pricing |
$ 0 |
$ 6 /month |
$ 99 |


Migrants threw oranges out of refrigerated lorry to attract attention
Eight migrants were rescued from a refrigerated lorry after they alerted people by throwing out fruit.
Police on their way to a crash noticed oranges bouncing onto the road from a small hole in the vehicle when it stopped during a traffic jam in Cambridgeshire.
They raided the lorry yesterday, and found suspected illegal immigrants inside.
Emergency services including an air ambulance rushed to the scene on the A14 in Huntingdon, and three of the eight people found in the lorry were taken to hospital.
A man has since been arrested on suspicion of assisting unlawful immigration.
The air ambulance was called to the scene shortly before 12.30pm after receiving reports that one individual was seriously unwell.
All eight people were assessed at the roadside and three people were taken to Hinchingbrooke Hospital for further investigation.
Advertisement Advertisement
No one sustained life-threatening injuries.
A spokeswoman for Cambridgeshire Constabulary said: ‘We were called at just after noon on November 19 to reports of concerns for eight people travelling in a lorry on the A14.
‘Officers stopped the vehicle near Brampton Hut.
‘The air ambulance attended the scene and the road has been closed while emergency services deal.
‘Three people are being taken to hospital but no one is believed to be seriously injured.
‘A man has been arrested in suspicion of assisting unlawful immigration.
‘Immigration services have been notified.
‘Enquiries continue.’
East Anglian Ambulance Service, a hazardous area response team also attended the scene.
The news comes after the bodies of 39 people were found inside a lorry container in Grays, Essex last month.
This week, 25 migrants were found in a refrigerated container on a ferry that was heading to Felixstowe from the Netherlands.
[metro-fact-box id=”8027376″ title=”Got a story for Metro.co.uk?” icon=”exclamation” /


A digital platform that enables both investors and property owners to view their readily availableresidential units, which can be booked smoothlyin an innovative manner via the application as options that meet the needs of travelers from around the globe motivating them to use this platform.


Because the best way to catch the bus is to be there.
Welcome to the RadBus API Web Client! It's purpose is to demonstrate how to use the RadBus API, which enables apps to easily access Twin Cities Metro Transit departure data against a user's personalized schedule stored in the cloud. Check out the web client source on GitHub.
Just a moment. Going to space...
Getting departures...
It looks like you haven't set up your bus schedule yet.
It looks like you've got no upcoming departures.


Pig Dice
Rules:
- If the player rolls a 1, they score nothing and it becomes the next player's turn.
- If the player rolls any other number, it is added to their turn total and the player's turn continues.
- If a player chooses to "hold", their turn total is added to their score, and it becomes the next player's turn.
Player 1
Score:
0
Your Turn
Possible Points: 0
Player 2
Score:
0
Your Turn


Using our conveinient web service you'll get access to all the delicious options without having to cal it in. Easy service form the comfort of you home. 24/7
You’ve never seen delivery this quick.
Our prices won’t distract you form the mouth watering food you are about to devour. With daily sales you won’t have to shop around, if you’re in the mood for a juicy burger, we’ve got it, and its on SALE!


About
I'm a Seattle-area native with a passion for building user-centric technology experiences and tools. I have six years of experience on technology teams in leadership and design roles, which has led me to coding. Currently, I'm a student at Code Fellows, where I'm learning front-end technologies and computer science principles at a blisteringly fast pace.
Skills and certifications
Development
- JavaScript
- HTML5, CSS3
- Version control systems, incl. Git and GitHub
- Requirements gathering
- Documentation authoring
Leadership
- Agile process development
- Project planning
- Stakeholder relationship management
User Centered Design
- Wireframing
- User research and testing
- Stakeholder relationship management
Education
- Certificate of Software Development, Code Fellows (in progress)
- Certificate, User-Centered Design (University of Washington)
- B.A, Scripps College
Projects
GitHub repos
Included are repos from Code Fellows projects and class assignments.


Sign Up
Name
Email
Such user is already registered
Password
Password should contain be at least 8 chars long
Sign Up
Terms
|
Privacy


Login to your account
Enter your email
Enter your password
For demo use<EMAIL_ADDRESS>and password:foobar
Remember my decision
Login


For the next 18 weeks I will be submerging myself in the world of web development.
brief description of blog ventures here.
brief description of projects here
say something here


用户编号：data['uid'];?>
用户姓名：data['uname'];?>
用户邮箱：data['uemail'];?>
用户列表：
data['ulist'];
foreach($ulist as $uitem){
echo "用户编号：".$uitem['id']." 姓名：".$uitem['name']."
";
}
?>
Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.
Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown.  Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.
For basic stylinglight padding and only horizontal add the base class .table
to any <table>
.
| # | First Name | Last Name | Username |
|---|---|---|---|
| 1 | Mark | Otto | @mdo |
| 2 | Jacob | Thornton | @fat |
| 3 | Larry | the Bird |
Add any of the following classes to the .table
base class.
Adds zebra-striping to any table row within the <tbody>
via the :nth-child
CSS selector (not available in IE7-8).
| # | First Name | Last Name | Username |
|---|---|---|---|
| 1 | Mark | Otto | @mdo |
| 2 | Jacob | Thornton | @fat |
| 3 | Larry | the Bird |
Add borders and rounded corners to the table.
| # | First Name | Last Name | Username |
|---|---|---|---|
| 1 | Mark | Otto | @mdo |
| Mark | Otto | @getbootstrap | |
| 2 | Jacob | Thornton | @fat |
| 3 | Larry the Bird |
Enable a hover state on table rows within a <tbody>
.
| # | First Name | Last Name | Username |
|---|---|---|---|
| 1 | Mark | Otto | @mdo |
| 2 | Jacob | Thornton | @fat |
| 3 | Larry the Bird |


/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Equatable } from './misc';
import * as objUtil from './obj';
type Entry<K, V> = [K, V];
/**
* A map implementation that uses objects as keys. Objects must implement the
* Equatable interface and must be immutable. Entries in the map are stored
* together with the key being produced from the mapKeyFn. This map
* automatically handles collisions of keys.
*/
export class ObjectMap<KeyType extends Equatable<KeyType>, ValueType> {
/**
* The inner map for a key -> value pair. Due to the possibility of
* collisions we keep a list of entries that we do a linear search through
* to find an actual match. Note that collisions should be rare, so we still
* expect near constant time lookups in practice.
*/
private inner: {
[canonicalId: string]: Array<Entry<KeyType, ValueType>>;
} = {};
constructor(private mapKeyFn: (key: KeyType) => string) {}
/** Get a value for this key, or undefined if it does not exist. */
get(key: KeyType): ValueType | undefined {
const id = this.mapKeyFn(key);
const matches = this.inner[id];
if (matches === undefined) {
return undefined;
}
for (const [otherKey, value] of matches) {
if (otherKey.isEqual(key)) {
return value;
}
}
return undefined;
}
has(key: KeyType): boolean {
return this.get(key) !== undefined;
}
/** Put this key and value in the map. */
set(key: KeyType, value: ValueType): void {
const id = this.mapKeyFn(key);
const matches = this.inner[id];
if (matches === undefined) {
this.inner[id] = [[key, value]];
return;
}
for (let i = 0; i < matches.length; i++) {
if (matches[i][0].isEqual(key)) {
matches[i] = [key, value];
return;
}
}
matches.push([key, value]);
}
/**
* Remove this key from the map. Returns a boolean if anything was deleted.
*/
delete(key: KeyType): boolean {
const id = this.mapKeyFn(key);
const matches = this.inner[id];
if (matches === undefined) {
return false;
}
for (let i = 0; i < matches.length; i++) {
if (matches[i][0].isEqual(key)) {
if (matches.length === 1) {
delete this.inner[id];
} else {
matches.splice(i, 1);
}
return true;
}
}
return false;
}
forEach(fn: (key: KeyType, val: ValueType) => void): void {
objUtil.forEach(this.inner, (_, entries) => {
for (const [k, v] of entries) {
fn(k, v);
}
});
}
isEmpty(): boolean {
return objUtil.isEmpty(this.inner);
}
}
|


@* * Copyright 2023 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @this(mainTemplate: MainTemplate, govukBreadcrumbs: GovukBreadcrumbs, govukBackLink: GovukBackLink) @(user: models.User, serviceInfoContent: Html, clientName: Option[String], mandationStatus: String)( implicit request: Request[_], messages: Messages, appConfig: config.AppConfig) @breadcrumbs = { @govukBreadcrumbs(Breadcrumbs( items = Seq( BreadcrumbsItem( content = Text(messages("breadcrumbs.bta")), href = Some(appConfig.btaHomeUrl) ), BreadcrumbsItem( content = Text(messages("vatDetails.title")), href = Some(controllers.routes.VatDetailsController.details.url) ) ) )) } @backLink = { @govukBackLink(BackLink( href = appConfig.agentClientLookupHubUrl, content = Text(messages("base.back")) )) } @mainTemplate( title = if(user.isAgent) messages("whatYouOwe.agentTitle") else messages("whatYouOwe.title"), appConfig = appConfig, serviceInfoContent = serviceInfoContent, user = Some(user), navLinkContent = if(user.isAgent) Some(backLink) else Some(breadcrumbs)) {
@if(user.isAgent) {@messages("noPayments.twentyFourHoursAgent")} else {@messages("noPayments.twentyFourHours")} @if(!user.isAgent) { @messages("payment.stillMake") @messages("payment.stillMakeLink")@messages("common.fullStop") }


An introduction of Map Basics for Noob
“GIS refers to any system dealing with the recording, analysis, or display of data that is related to a location.”
http://www.esri.com/what-is-gis
http://www.uwyo.edu/smtc/edparc/_docs/_arcview_tips/basicgisconcepts.pdf
“Projections refer to the method used for representing a three-dimensional object like the Earth on a two-dimensional surface like a sheet of paper or a computer screen.”
https://github.com/mbostock/d3/wiki/Geo-Projections
http://en.wikipedia.org/wiki/Map_projection
http://www.jasondavies.com/maps/transition/
“A transverse Mercator projection is mathematically the same as a standard Mercator, but oriented around a different axis.”
“adopted by National Geographic Magazine in 1988 but abandoned by them in about 1997 for the Winkel Tripel.”
Projections refer to the method used for representing a three-dimensional object like the Earth on a two-dimensional surface like a sheet of paper or a computer screen.
“A zoom level is a predefined scale at which a map is rendered. OpenStreetMap, Google Maps, and most other online maps zoom levels are scaled such that the entire world fills a 256x256 pixel tile at zoom level 0, and doubles in width & height at each subsequent zoom level.”
“Data on different themes are stored in separate “layers”. As each layer is geo-referenced layers from different sources can easily be integrated using location. Layer can be used to build up complex models of the real world from widely disparate sources.”
“A spatial database is a database that is optimized to store and query data that is related to objects in space, including points, lines and polygons.”
http://en.wikipedia.org/wiki/Spatial_database
http://www.spatial.cs.umn.edu/Book/slides/ch1revised.ppt


The original video could be found at
The reason to do IDP
- Create a plan now to move on after your training
- Improve productivity and satisfaction
- Increase confidence in post-trainig career goals
- Increase self-efficacy: Belief that you can achieve it
Self-assessment
You can found resources in IDP
Value Clarification Exercise / Disconnects Discussion
- What is one value that you ranked as most important?
- Based on your stated career from the beginning of this workshop, what is one values-based disconnect you will encounter in that career?
- What is one challenge you will face in this career path due to that value?
- What is one potential solution to that challenge? (Ask partner for another solution)
Skills assessment
- What science career-related tasks am I good at doing?
- What tasks am I not good at doing?
- What tasks are important for success in my future career?
- How do I raise my skill level in important task areas?
Skills vs Interests
- Remember to break a career path down to specific tasks.
- What common tasks involve skills you need to improve in order to be successful? (skill disconnect)
- How can you improve?
- What common tasks involve skills you are good at but not enjoy? (interest disconnect)
- What’s a potential solution?
IDP process
- Develop a finite sets of career paths
- Explore career options with focus on your SIV results.
- Narrow options through structured process of elimination
Career exploration
MyIDP has a My Career Path Match
after you did the Self-assessment. You can use this as a start. Read about careers
- Read about careers
- LinkedIn
- Search for Job Title that you are interested in
- How long does one stay in industry research jobs before moving to leadership?
- What transitional experience do I need?
- LinkedIn
- Attend career events
- Talk to people
- Most helpful: talk to professional in the career path
- Informational interviews
- Deeper information on career choices
- Appointment in advance
- List of specific questions
- Thank you notes
- value questions
- IDP website has a list
- Get experience
- InterSECT
- interview
Assignment
- Invest time in career exploration reading
- articles on careers of interest
- LinkedIn searches
- read 20-30 job postings of interest, identify themes
- Populate your LinkedIn PTO(People, Title, Organizations) list with at 6-10 people who are in the same career area as your Plan A or Plan B. Synthesize useful info by looking for themes:
- Did they complete transitional training after PhD? If so, what?
- What job titles tended to be in between PhD and current?
- What organizations or groups are they following?
- What skills or qualifications are you missing that they all have?
The next part would be set goals:
- PTO list/map
- Complete a list of skills development goals for next year


{% extends 'registration/auth/base.html' %} {% block content %}
Your password has been set. You may go ahead and log in now.


Everything in a JIC stylesheet revolves around the use of a very special pair of brackets that look like this ${}
. They open with a ${
, and close with a }
. In a JIC stylesheet everything outside these brackets is CSS, and everything inside these brackets is JavaScript.
You might think of it as a CSS stylesheet that functions like a JavaScript template string, because in the end that's how it will be interpreted.
When you combine CSS and JavaScript this way, you are able to leverage the 100% of the features of CSS, and add 100% of the features of JavaScript to it. There are many ways CSS and JavaScript can communicate, using a JIC-formatted stylesheet is one of the most flexible and succinct syntaxes for expressing your styles. And makes it very easy to extend the features of CSS by writing simple JavaScript functions called called 'JIC mixins'.
To show you what this idea is all, about let's look at a small example. Here is a JIC stylesheet that displays the browser's viewport dimensions as CSS content for a pseudo-element on the HTML element.
html:before {
content: '${innerWidth} x ${innerHeight}';
}
When this JIC stylesheet is interpreted, the content being displayed will be the values of whatever the inner width and height of the browser are at that exact moment.
There are a few ways expressing JavaScript and CSS together can be helpful, let's look at four main ways to use JavaScript to your advantage when writing a JIC stylesheet.
/* Inline Values */
.username:before { content: '${firstName}'; }
/* JavaScript One-liners */
body { background: ${Math.random() > .5 ? 'red' : 'orange'}; }
/* Nested Stylesheets */
${someValue ? `
/* I'm also a JIC stylesheet */
` : ''}
/* Calling Functions */
${helper('.example')}
Let's look at a few ways these different types of interactions can be useful.
When you use the special brackets in a JIC stylesheet you are able to replace any variable name the browser is aware of and have its value output in the resulting CSS. While the example above used the brackets inside of what becomes a CSS property value, you can use the brackets anywhere in a JIC stylesheet. It's just as easy for you to replace part of a property name, selector, or even inside of media query.
/* As a property name */
.example {
${prefix}appearance: none;
}
/* Inside a selector */
.${teamName}.avatar {
border: 5px solid red;
}
/* Inside of a media query */
@media (min-width: ${desktop}) {
.sidebar {
display: block;
}
}
If using JavaScript variables anywhere inside CSS stylesheets is exciting, it's just as easy to use JavaScript expressions in your stylesheets as well. This allows you to use any values JavaScript is aware of (or can measure) anywhere in your styles.
/* Reading properties from the DOM */
#demoVideo {
width: 100%;
height: calc(${demoVideo.offsetWidth}px / (16/9));
}
/* Random numbers */
body {
background: hsl(${Math.random() * 360}, 75%, 50%)
}
One really useful feature of JavaScript template strings is that they can contain other JS template strings inside of the special brackets. Something like this would be invisible to our final CSS and just behave like we had only written html { background: lime; }
.
${ ` html { background: lime; } ` }
This becomes a very easy place for us to add a bit of JavaScript logic to toggle whether we should include a part of a stylesheet inside of a larger stylesheet. The following two examples are equivalent:
${(true) ? `/* JIC stylesheet */` : ''}
${(true) && `/* JIC stylesheet */` || ''}
If the first expression is true
, the nested stylesheet will be included in the original JIC stylesheet, otherwise nothing will be added.
Another helpful way to use CSS and JavaScript together is to use a JavaScript function as a helper, either for reducing the amount of CSS you need to write, for simplifying your stylesheets, re-using similar logic in multiple places or stylesheets, or just to work with a nicer interface when you're writing styles. It's so easy to create JavaScript functions for almost anything, so being able to use them anywhere in JIC stylesheets means there's no end to the possibilities of how and where helper functions can be used. Here's an example of a helper function that clamps a scalable value between a minimum and maximum value, called a 'number clamp':
function clamp(min, mid, max) {
return Math.min(Math.max(min, mid), max)
}
This would let us write a value in our JIC stylesheet like this:
h1 {
font-size: ${clamp(20, header.offsetWidth/20, 75)}px;
}
A 'JIC Mixin' is a JavaScript function that usually takes a CSS selector, and optionally a CSS rule or CSS stylesheet to process.
mixin(selector [, …any other arguments here])
ruleMixin(selector, […any other arguments here,] rule)
stylesheetMixin(selector, […any other arguments here,] stylesheet)
The smallest type of mixin is a function that usually takes a CSS selector, plus any additional arguments the function needs.
${aspectRatio('iframe', 16/9)}
There's no rule or stylesheet being passed in, but in this case the aspectRatio()
function is able to query the document for all iframe tags that match the selector, and based on their current width, assign a height value using the ratio supplied to the function in the second argument.
This type of mixin returns one or more CSS rules to the original JIC stylesheet.
A rule-level mixin usually takes a CSS selector, plus a CSS rule to apply to elements matching that selector, plus any additional arguments the function needs.
${closest('.target', '.ancestor', `
background: lime;
`)}
In this case we're using a JavaScript function inside our special brackets, and containing more CSS inside of it. It doesn't take up much more space than a CSS selector would in our CSS stylesheet, it's just expressed in a different language.
Our example here will look for all elements in the document with a class of "target", and looks at the elements containing it. If it finds an ancestor element with a class of "ancestor", it will apply the CSS rule given as the last argument which will make the background of that element green.
A rule mixin returns one or more CSS rules to the original JIC stylesheet, usually formatted like this.
${selector} { ${rule} }
A stylesheet-level mixin usually takes a CSS selector, plus a stylesheet (often with $this
used as a placeholder for each matching element), plus any additional arguments the function needs.
You can think of both the rule-level mixins and the stylesheet-level mixins kind of like the 'Nested Stylesheet' example above, where the JS logic required to toggle the stylesheet is too long to write in the JIC stylesheet itself (or where you want to re-use the same functionality).
${containerQuery('div', el => el.offsetWidth > 500, `
$this {
background: lime;
}
$this .button {
font-size: 20pt;
}
`)}
In this example we have a container query plugin that is looking for every DIV element in the document. The second argument is a JavaScript function in arrow notation. It's equivalent to the following function
function(el) { return el.offsetWidth > 500 }
When we give a function like this an element to test, it will either return true
or false
, which with this mixin is like a switch to determine whether a copy of the contained CSS stylesheet should be output for that DIV element.
A stylesheet mixin returns a CSS stylesheet to the original JIC stylesheet
If you're wondering how this approach makes extending CSS flexible, consider what it would take to invent support for a new CSS feature. Let's say we wanted a custom at-rule that would toggle different styles on different days of the week. There's nothing like this currently in CSS, so let's imagine it with a syntax like this:
@time (day: friday) {
body {
background: lime;
}
}
In order for your website to be pink on Fridays with other approaches you'd either have to write some JavaScript and CSS separately (maybe using JavaScript to check the date and apply a class to the BODY element on Fridays and then add a rule in your CSS stylesheet for the BODY element when it has your special Friday class. Maybe you could use CSS variables and have JavaScript set the value differently on Fridays.
Another approach might be to use a CSS preprocessor, where you'd have to teach the preprocessor how to parse CSS, how to parse your custom CSS and extract the information from our @time (unit: value)
syntax, we'd have to write a JavaScript plugin to do the transformation, and finally output CSS.
But consider how flexible our JIC stylesheet is. We can express the same functionality as CSS media queries like this:
@media (min-width: 500px) {
body {
background: lime;
}
}
${innerWidth >= 500 ? `
body {
background: lime;
}
` : ''}
So if we want to add support for our custom @time (day: friday)
logic, in JavaScript we only need to test new Date().getDay() === 5
to tell true
or false
if it's Friday.
/* Doesn't work */
@time (day: friday) {
body {
background: lime;
}
}
/* Does work! */
${new Date().getDay() === 5 ? `
body {
background: lime;
}
` : ''}
And if you'd rather make a simple helper function instead of repeating this kind of logic throughout out stylesheet we can easily create a helper function like this to return true
or false
, and make what we have write as simple as day(5)
.
function day(number) {
return new Date().getDay() === number
}
Now we can call that from our JIC stylesheet instead.
${day(5) ? `
body {
background: lime;
}
` : ''}
If you want to take it further and make it into a JIC mixin rather that include these styles as a Nested Stylesheet, we can make it even cleaner in our JIC stylesheet my writing a function like this:
function time(option, stylesheet) {
var day = ['sunday',
'monday',
'tuesday',
'wednesday',
'thursday',
'friday',
'saturday']
return option.day === day[new Date().getDay()] ? stylesheet : ''
}
It's a pretty simple function, we've created a nice interface to use where we can give it an object like {day: 'monday'}
as an argument and it will test that name against the current day, returning the stylesheet if it's true
. This function allows us to express our custom @time
at-rule logic in our JIC stylesheet in a pretty way as:
${time ({day: 'friday'}, `
body {
background: lime;
}
`)}
It's not quite as simple as @time (day:) {}
, but it's kind of amazing how simply we can invent ${time ({day:},``)}
out of nothing, make it work with only a few lines of standard CSS and standard JavaScript. No new syntax needs to be invented or parsed, and no new features need to be added to either language to make a new abstraction like this work for us in our stylesheet.
You can play around with a running demo of this here, be sure to update the day of the week to today: Custom At-Rule with JIC Stylesheet
If you wanted to take it in a different direction, another way you might expose the logic in your stylesheets might be by creating true
/false
helper functions. Suppose we wanted to add special styles only on Christmas day (December 25th). We could create two helper functions, month()
and date()
, and chain them together with $$
to write logic for a nested stylesheet in a nice readable way:
function month(name) {
return ['january',
'february',
'march',
'april',
'may',
'june',
'july',
'august',
'september',
'october',
'november',
'december'].indexOf(name) === new Date().getMonth()
}
function date(number) {
return number === new Date().getDate()
}
Then use these in our JIC stylesheet like this:
${month('december') && date(25) ? `
html {
color: green;
background: red;
}
`:''}
When both month('december')
and date(25)
are true
, the nested stylesheet will apply. If you had a number of simple true
/false
functions, you could string them together in infinite ways, allowing you to express precisely what you're trying to target in a succinct way. Without having to define these functions for you, can you imagine what the following stylesheets might do:
${browser('safari') && os('ios') ? ` … `:''}
Or how about:
${officeHours(false) && user('frank') ? `
.support-desk form {
display: none;
}
`:''}
The flexibility of JS-in-CSS lets you express yourself in a natural way, and allows you to easily create the abstractions and interfaces you want to work with when you're approaching design. Most importantly, JIS stylesheets let you harness and benefit from all of the CSS and JavaScript knowledge you already have, and lets you put them to work for styling.


Setting up your project for Linux Development
With this workload you can author C++ code for Linux servers, desktops and devices. You can manage your connections to these machines from within VS. VS will automatically copy and remotely build your sources and can launch your application with the debugger. Our project system supports targeting specific architectures, including ARM.
Connecting to Linux
Prerequisites
Today we only support building remotely on the Linux target machine. We are not limited by specific Linux distros but we do have dependencies on the presence of some tools. Specifically, we need openssh-server, g++, gdb and gdbserver. Use your favorite package manager to install them, e.g. on Debian based systems: sudo apt-get install openssh-server g++ gdb gdbserver
First connection
The first time you target a Linux machine you will be prompted for connection information. This is triggered by building the project.
Adding and removing connections
To add a new connection, go to Tools > Options and search for Connection, Connection Manager will be under Cross Platform. From here you can add and remove connections.
To change which connection a project is using go to the project properties general settings and update the Remote Build Machine option.
Project Properties
All of the options necessary to control C++ compilation are exposed on the project properies pages. We'll cover a few specific to how things work for Linux. First under general settings, you will see the remote root is set to ~/projects/ by default and that we are setting the remote project directory to match our project name in that location.
Looking at the General settings for the project, you can see how our output and intermediate directories were configured. Additionally, you’ll see that this project was configured as an application – thus our executable is under bin/x64/Debug/ as ConsoleApplication1.out. Notice that for configuration types we also support static and dynamic libraries.
Add additional library dependencies on the Linker > Input property page.
You can pass additional pre launch commands to the debugger to do things like launch graphical apps on the remote linux machine.
You can also send post build events to control remote behavior, as in this example that exports a gpio pin for use without requiring the executable run as super user.
Resources
Check out the VC++ for Linux Development page where we will keep updates posted and provider more in depth details on usage.
Give us feedback
Use the send feedback function in Visual Studio or contact us through Developer Community


Chorley close gap at the bottom with win over Torquay
Marcus Carver scored the only goal of the game.
Bottom club Chorley made it back-to-back Vanarama National League victories with a 1-0 win over Torquay.
The Magpies scored the only goal of the game in the 24th minute when Matt Challoner intercepted a pass and played the ball to Mark Ross, whose cross was headed past the goalkeeper by Marcus Carver.
The hosts were given the chance to double their advantage from the penalty spot when Charles Vernam was brought down after 52 minutes.
Vernam stepped up to take the spot-kick but Gulls goalkeeper Shaun MacDonald saved.
Torquay dominated possession as time ticked away at Victory Park, but they were unable to find an equaliser that would have prevented a second successive defeat.


Three dead in Oklahoma Walmart shooting, including gunman
WASHINGTON, Nov 19 — Three people were killed in a shooting early yesterday outside a Walmart store in Oklahoma, including the assailant, police said — the latest in a string of deadly gun attacks at the popular supermarket chain.
Danny Ford, the police chief in the town of Duncan, said the shooting — an apparent domestic dispute — took place shortly before 10am (1600 GMT) in a parking lot in front of the store.
“We have three individuals that are deceased. We have two white males and a white female. Two of the victims are inside the vehicle, one is outside the vehicle,” said Ford.
A handgun was also found at the scene, police said.
Witnesses told local news channels that the shooter approached his victims while they were inside the vehicle, opening fire on them.
He then turned his weapon on himself when a fourth man reportedly pulled out a firearm and challenged the shooter, they said.
Family members at the scene said the shooting was a domestic dispute between a husband and his wife, a local Fox news affiliate reported.
A Walmart spokeswoman told Fox that no staff members were involved in the incident in Duncan, a town of 22,000 inhabitants some 120 kilometres south of Oklahoma City, the state capital.
Schools in the area had been placed on lockdown temporarily before being given an “all clear” by local police, the local school district said in a statement.
At the start of this month, a new permitless carry law came into effect in the central US state, allowing anyone over 21 and without a felony conviction to carry a gun without a permit or a licence.
A gunman killed 22 people in a Walmart store in August in El Paso, Texas, while another Walmart store in Mississippi was the scene of a shooting in late July, when a disgruntled employee killed two co-workers and wounded a police officer.
In the El Paso shooting, the 21-year-old gunman said he had launched the deadly attack in response to what he called a “Hispanic invasion” of Texas.
Walmart said in the wake of the two shootings inside its stores within a week of each other that it would limit sales of guns and ammunition. — AFP