This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [pull_request] | |
jobs: | |
create-postgres-image: | |
permissions: | |
contents: read | |
packages: write | |
uses: christherama/create-postgres-image/.github/workflows/workflow.yaml@v0.0.1 | |
with: | |
docker-registry: ghcr.io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
status_counts_by_month = ( | |
Task.objects.filter(plan_id=plan_id, metric_type=metric_type, group_by_date__year=effective_year) | |
.annotate( | |
completed_on_time=Case( | |
When(completed_date__isnull=True, then=0), | |
When(completed_date__lte=F("due_date"), then=1), | |
default=0, | |
output_field=IntegerField(), | |
) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group 'com.example' | |
version '1.0-SNAPSHOT' | |
apply plugin: 'java' | |
apply plugin: 'application' | |
sourceCompatibility = 1.8 | |
repositories { | |
mavenCentral() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ArrayList<E> { | |
transient Object[] elementData; | |
private static final int DEFAULT_CAPACITY = 10; // (4) | |
private static final Object[] EMPTY_ELEMENTDATA = {}; | |
private int size; | |
public boolean add(E e) { | |
ensureCapacityInternal(size + 1); // (1) | |
elementData[size++] = e; // (6) | |
return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ArrayList<E> { | |
transient Object[] elementData; // (1) | |
private static final Object[] EMPTY_ELEMENTDATA = {}; // (3) | |
public ArrayList() { | |
super(); | |
this.elementData = EMPTY_ELEMENTDATA; // (2) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* List object implementation */ | |
#include "Python.h" | |
#ifdef STDC_HEADERS | |
#include <stddef.h> | |
#else | |
#include <sys/types.h> /* For size_t */ | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package java.util; | |
import java.util.function.Consumer; | |
import java.util.function.Predicate; | |
import java.util.function.UnaryOperator; | |
public class ArrayList<E> extends AbstractList<E> | |
implements List<E>, RandomAccess, Cloneable, java.io.Serializable | |
{ | |
private static final long serialVersionUID = 8683452581122892189L; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Notice the @Transient annotation on the MultipartFile field. | |
This means that the field value will NOT be persisted to the database. | |
*/ | |
package com.teamtreehouse.giflib.model; | |
import org.springframework.web.multipart.MultipartFile; | |
import javax.persistence.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' <summary> | |
''' Fetches the response from a website or server, with the provided URL | |
''' </summary> | |
Public Shared Function HttpGet(ByVal url As String) As String | |
' Create the HTTP request | |
Dim req As HttpWebRequest = HttpWebRequest.Create(url) | |
' Open a connection (stream) using the request | |
Dim stream As Stream = req.GetResponse.GetResponseStream() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' <summary> | |
''' Displays an object's properties in a well-formatted manner. | |
''' </summary> | |
''' <param name="obj">Object to display</param> | |
''' <param name="numTabs">Number of tabs to prefix the object's properties with</param> | |
Public Shared Sub DisplayObject(ByVal obj As Object, Optional ByVal numTabs As Integer = -1) | |
' Define non-special types | |
Dim types As String() = {"String", "Boolean", "DateTime", "Integer", "Double", "Long"} | |
' Get the properties of this object |
NewerOlder