Skip to content

Instantly share code, notes, and snippets.

View vrySantosh's full-sized avatar
🎯
Focus is an art!

Santosh Guruju vrySantosh

🎯
Focus is an art!
View GitHub Profile
import UIKit
// External closure declaration
// Closure with arguments
let sampleClosure :(String) -> (String) = { value in
print(value)
return "sample closure return value"
}
StringBuilder errorMessages = new StringBuilder();
catch (SqlException ex)
{
for (int i = 0; i < ex.Errors.Count; i++)
{
errorMessages.Append("Index #" + i + "\n" +
"Message: " + ex.Errors[i].Message + "\n" +
"LineNumber: " + ex.Errors[i].LineNumber + "\n" +
"Source: " + ex.Errors[i].Source + "\n" +
"Procedure: " + ex.Errors[i].Procedure + "\n");
SELECT o.OrderID,
o.CustomerID,
o.ProductID,
o.Status,
c.Name as CName,
p.Name as PName,
p.PRICE
FROM Orders o
INNER JOIN Customers c
on o.CustomerID = c.CustomerID
--CREATE SCHEMA AllYouNeed;
--CREATE TABLE Customers(
-- CustomerID INT IDENTITY(1,1),
-- Name VARCHAR(50) NOT NULL,
-- Email VARCHAR(50) NOT NULL,
-- CONSTRAINT PK_Customer PRIMARY KEY (CustomerID)
-- );
--CREATE TABLE Products(
<table id="dsTable">
<tbody>
<tr>
<td>Relationship Type</td>
<td>Date of Birth</td>
<td>Gender</td>
</tr>
<tr>
<td>Spouse</td>
sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer
It is a syntax sugar for faster query writing. Its implementation in pseudocode:
def filter_by(self, **kwargs):
return self.filter(sql.and_(**kwargs))
For AND you can simply write:
Users.query.filter_by(name='Joe', surname='Dodson')
btw
db.users.filter(or_(db.users.name=='Ryan', db.users.country=='England'))
from flask import Flask, abort, request, jsonify
from models import Event
app = Flask(__name__)
@app.route('/api/v2/events/page')
def view():
return jsonify(get_paginated_list(
Event,
'/api/v2/events/page',