The purpose of this code is to offer an alternative mechanism for encrypting database connection string data using the Windows Data Protection API (DPAPI) in .NET source code.
This implementation makes use of the DPAPI user key as opposed to the machine key. This means that the connection string will not be accessible by other applications running under different service accounts. This adds additional protection against a rogue application (such as a virus or Trojan) compromising connection string data but could pose problems where sharing between multiple applications running under different accounts is required.
The following example demonstrates the use of the registry to store a cleartext database connection string.
// Database connection string
string connStr =
"Initial Catalog=snippets;Data Source=vm-win2003\\sqlexpress;Integrated Security=SSPI;";
// Store connection string in the registry
RegistryKey key = Registry.CurrentUser.CreateSubKey("PlaintextConnectionString");
key.SetValue("ConnStr", connStr);
Cleartext connection string details can be viewed by any user with access to the registry.
In a mixed-mode authentication scenario, credentials would be viewable by any user with access to the registry.
Lack of registry ACL's allows all systems users read access to this registry key. Test Case
The following classes must be included in any project making use of the sample code provided above:
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Security.AccessControl;
using System.Text;using Microsoft.Win32;
The following test case methods store and retrieve encrypted registry data and output the results to the console.
public static string RetrieveConnectionString(string keyName, string valueName){
// Read the encrypted connection string value from the registry
RegistryKey key = Registry.CurrentUser.OpenSubKey(keyName);
byte[] encryptedConnStrBytes = key.GetValue(valueName) as byte[];
// Decrypt the encrypted bytes using DPAPI, convert to string and return
byte[] decryptedConnStrBytes = ProtectedData.Unprotect(
encryptedConnStrBytes,
null,
DataProtectionScope.CurrentUser);
return(UnicodeEncoding.ASCII.GetString(decryptedConnStrBytes));
}
static void Main(string[] args){
// A sample connection string we might want to store
string stored =
"Initial Catalog=snippets;Data Source=vm-win2003\\sqlexpress;Integrated Security=SSPI;";
Console.WriteLine("Stored String: " + stored);
// Create an instance of our class and pass the string we want to encrypt
StoreConnectionString("EncryptedConnectionString", "CipherText", stored);
// Retrieve from the registry and print to make sure it worked.
// You can also fire up regedit and browse to HKEY_CURRENT_USER\EncryptedConnectionString
// to see the encrypted bytes.
string retrieved = RetrieveConnectionString("EncryptedConnectionString", "CipherText");
Console.WriteLine("Retrieved String: " + retrieved);
}
public static void StoreConnectionString(string keyName, string valueName, string connectionString){
// Convert the connection string to a byte array
// and encrypt the data by using the DPAPI ProtectedData class.
byte[] encryptedConnStrBytes = ProtectedData.Protect(
UnicodeEncoding.ASCII.GetBytes(connectionString),
null,
DataProtectionScope.CurrentUser);
// Create a security context for a new key that we will use to store our encrypted connection string.
// The security context will restrict access to only our user.
string user = Environment.UserDomainName + "\\" + Environment.UserName;
RegistrySecurity security = new RegistrySecurity();
RegistryAccessRule rule = new RegistryAccessRule(user,
RegistryRights.FullControl,
InheritanceFlags.ContainerInherit,
PropagationFlags.None,
AccessControlType.Allow);
security.AddAccessRule(rule);
// Actually create the new registry key and apply the security context we just came up with.
RegistryKey key = Registry.CurrentUser.CreateSubKey(keyName,
RegistryKeyPermissionCheck.ReadWriteSubTree,
security);
// Write the encrypted connection string into the registry
key.SetValue(valueName, encryptedConnStrBytes);
}
Adapted from Microsoft patterns & practices guidance.


| ONERDO'S COFFEE |
Onerdo’s coffee first discovered by Dominic Onerdo In 1957 while experimenting with new flavors. Before that Mr.Onerdo kept on failing in his objective to create the best coffee in the world until one night he added a little bit of cocoa beans from the Ivory Coast .With a little bit of thinking Voila He made the best coffee in the world.After the successful discovery of his Coffee he started a little coffee shop in Malibu,California.As word got out,Onerdo’s Coffee Gained more popularity and turned into what now is a long chain of Coffee Shops. Through the years the executives at Onerdo’s have come with best and the most innovative recipes to make your taste buds twerk in your mouth.We here at Onerdo’s provide the best service to our Customers as well our employees.With restaurant quality service and a 5 star rating from Health and Sanitization organization for all our coffee shops,Onerdo’s is the place to be.


Wed Aug 26, 2020
Well, I’ve been in isolation and working at home for six months now, and it isn’t feeling like a temporary thing anymore. Also, a second wave of covid is starting to build - just in case, you know, anybody thought it was over.
When I first started working from home, I missed my dual screens, my co-workers, and the free coffee. Now I’m like “you can’t chain me to the office, man”.
I’ve also started dreaming more about travelling - probably because, let’s be honest, people always want what they can’t have. Sure, the “dreaming” is more like clicking through YouTube videos on top ten terrifying swimming pools and twelve hidden secrets in Central Park, but please don’t judge.
From Krasnoyarsk, Siberia to Fukuoka,Japan - I’ve become easily fascinated by the mesmerizing drone footage that can make anywhere but here look amazing.
 Our lives become smaller when concerns become hyperlocal.
I have, for example, been disturbingly obsessed with random small things like how all apples just taste bad right now. Where’s ‘dem sweet apples? Before now, I’ve never even thought about there being a bad apple season. Is Fall a better time for apples?
So, this last month - in lieu of actual travel - I’ve time travelled back to the year 2000. Twenty years ago, I backpacked alone through Zimbabwe for a couple of weeks. It was a trip I’ll never forget. But what’s even better is that I took two rolls of film (kids, I’d love to explain all about analog life before digital photography, but I don’t have the patience) and a dog-eared journal with me.
To bring this content into the digital fold, I painstakingly transcribed the journal entries and scanned the pictures. These transcribed entries have now become the oldest entries in this blog.
Ha, you thought I was being hyperbolic with that “painstakingly”, didn’t you? Well, you try removing twenty-year old photographs out of a photo album when they seem to have melded with the cheap plastic cover sheets. And if you love transcribing pages of handwriting, well, good for you - just be sure to invest in an ergonomic workstation.
Regardless, the real joy of the process was in accompanying the younger me through the trip of a lifetime.
Too bad I was such a whiner.
But it makes sense - this diary was never meant for the public eye. It was more of a cathartic thing. Besides from some salty language and mild references to alcohol and marijuana, there’s nothing in there that will get me fired one day. I think. Weed is legal now in British Columbia anyway.
So, if you’re going to read these entries - be warned. Not about the PG stuff. I’m warning you about the writing. It’s truly terrible.
I’m not blowing my own horn here, but my writing has almost certainly improved in the last twenty years. That’s a fair amount of extra practice, so there’s nothing to brag about, but still. Try look past the many run-on sentences, comma splices, and overuse of ellipses. Bear in mind that these journal entries were all handwritten and were completely unedited - I only crossed out a phrase once the whole time. Think of these entries as more of a stream-of-consciousness type deal.
Also, language has evolved somewhat in the last two decades. In particular, the concept of hooking up with someone has a vastly different connotation these days. So, when you read about me hooking up with all these guys, it’s not what you think. The phrase used to literally mean “hanging out” or “meeting up with”. For authenticity, I’ve left all archaic phrasing in there.
Along those lines, please don’t be offended by the politically-incorrect thoughts and opinions of my younger self. I’d like to think I’m a more mature and better person now.
So, can you trust “the narrator” or did I bend the narrative to present an idealistic picture of my trip through Zimbabwe? From what I can recall of my travels, it is fairly accurate. Although I did leave out some things. I remember feeling quite ill at some point, curled up in bed, and a fellow traveller gave me some charcoal pills. Odd that I never mentioned this even once in my journal. I don’t remember where or when this time of illness happened, but there is a huge chunk of missing time in Masvingo with no journal entries for three days. I’m guessing I was down for the count during this time with little memory of what occurred. Weird.
None of my meals were particularly memorable, but I have a fleeting impression of sitting in a hostel dining area alone eating some sort of preserved meat out of a can.
And I never really admitted to myself that I’d been mugged as soon as I got there, or at least, couldn’t even write the word “mugged” - I think I placed most of the blame on myself. I just spent most of the rest of the trip complaining about a lack of funds. I didn’t have a credit card back then.
I also complained a lot about the rain, despite knowing full well it was the rainy season. My whining was somewhat justified, however, by the arrival of Cyclone Eline, the longest-lived Indian Ocean tropical cyclone on record. It caused a lot of flooding and homelessness with the Limpopo River reaching its highest level in 15 years. Epic timing for my trip.
Despite all this, I was hellbent on completing my mecca to Great Zimbabwe, an archaeological site that I had previously written a paper on. I was still determined to become an archaeologist at that point in my life and seeing the ruins firsthand was truly inspiring. I never did become the next Indiana Jones, but twenty years ago, I was living the dream.
For your convenience, here are links to the journal entries:
Zimbabwe trip, Day 1: On my way to Zimbabwe
Zimbabwe trip, Day 2: Bulawayo - City of Kings
Zimbabwe trip, Day 3: Art, photographs, and butterfly wings
Zimbabwe trip, Day 4 and 5: Splashing out in Masvingo
Zimbabwe trip, Day 6, 7, and 8: From the ruins to the highlands
Zimbabwe trip, Day 9: I am not the Rain King
Zimbabwe trip, Day 10: A cracking good day in Chimanimani
Zimbabwe trip, Day 11: Amber and Andy
Zimbabwe trip, Day 12: Heading to Victoria Falls
Zimbabwe trip, Day 13: The quintessential African wonder
Zimbabwe trip, Day 14: Sorrow of the Nyama Nyama
Zimbabwe trip, Day 15: Hello my friend
Zimbabwe trip, Day 16 and 17: All is well that ends well
Now, excuse me, I’ve got some YouTube videos on the Devil’s Pool to watch.


Strategy Analytics: Q3 2019 tablet PC market fell by 4% - Gizchina.com
by Efe UdinRate this post
No doubt, the tablet PC market is not as lucrative as it used to be. In fact, it appears that every year, there is a decline in the sales of tablet PCs. Many major manufacturers are either inactive or passive in the tablet PC market. The continuous decline of tablet PCs shipment is related to the impact of large-screen smartphones. With the preponderance of 6-inch+ smartphones, it appears that we now have more display and there is really no need for more. According to Strategy Analytics latest report, the global tablet PC market in Q3 2019 fell by 4% year-on-year. The global market only managed 38.2 million units in the quarter.
According to the report, in the third quarter of 2019, Amazon’s tablet sales increased by 141% year-on-year. It has a market share of 14%, thanks to its strong ecosystem and low retail prices. In addition, it also has an updated product portfolio and a Prime Day promotion in July. This means that it is now the world’s second-largest tablet PC manufacturer, at least for Q3 2019. If you are thinking about the top position, there is little or no competition for that spot. Apple has a strong grip on the global tablet PC market and has been top for a long time.
According to Strategy Analytics, the top five global tablet manufacturers by market share are Apple (26.5%), Amazon (13.9%), Samsung (13.2%), Huawei (8.1%), and Lenovo (6.6%).


Pickem 2017
Week 1
Week 2
Week 3
Week 4
Week 5
Week 6
Week 7
Week 8
Week 9
Week 10
Week 11
Week 12
Week 13
Week 14
Week 15
Week 16
Week 17
Username:
Send Picks
Send it!


--- title: "Secondary Colors" type: colors scss: _assets/stylesheets/_variables.scss usage: "Additional colors commonly used for buttons, notices, and badges." ---
$primary-color
$success-color
$warning-color
$danger-color
$info-color


 KEEP OUT OF REACH OF CHILDREN.
STORE IN A COOL, DRY PLACE. IF SEAL IS BROKEN, DO NOT USE.
MEDI-FLEXX
GLUCOSAMINE / CHONDROITIN & MSM
JOINT SUPPORT FORMULA
500/400/200 MG
DIETARY SUPPLEMENT
AMOUNT PER SERVING
GLUCOSAMINE SULFATE 500 MG
CHNDROITIN SULFATE 400 MG
METHYL SULFONYL METHANE 200 MG
AS A DIETARY SUPPLEMENT, TAKE 1 TO 3 TABLETS PER DAY AFTER A MEAL OR AS PER PHYSICIANS DIRECTIONS.


Use one hash symbol followed by a space for a heading, for example:
# This is a heading
To add a subheading, use 2 hash symbols:
## This is a subheading
Copy this example to add bullet points:
Introduce bullet points with a lead-in line ending in a colon:
* leave one empty line space after the lead-in line
* use an asterisk or a dash followed by a space to add an item
* start each item with a lowercase letter, do not end with a full stop
* leave one empty line space after the last item
To create sub-items, add an indent of 2 spaces before the asterisk or dash.
Copy this example to add numbered steps:
1. Leave one empty line space before starting your list.
2. Enter a number followed by a full stop and a space to add an item.
3. Start each item with a capital letter and end it with a full stop.
4. Leave one empty line space after the last item.
To create sub-items, add an indent of 2 spaces before the number.
To add inset text, use a caret. For example:
^ You must tell us if your circumstances change.
To add a horizontal line between 2 paragraphs, use 3 dashes. Leave one empty line space after the first paragraph. For example:
First paragraph
---
Second paragraph


When you build your endpoint, each ressource can be paginated. Pagination is enabled in the controller argument of an application. See Controllers for more information about controller configuration.
When you want to enable pagination on a ressource, you should use a Pagination class. You can directly use rest_api_framework.pagination.Pagination or create your own pagination mechanism inheriting from this class
Pagination should define some attributs:
Those attributs are not mandatory, you can create a Pagination based on a token for exemple. (see below). But here how the base pagination mechanism work.
The base Pagination class enable the choice of those attributs when instanciated. For example:
controller = {
"list_verbs": ["GET", "POST"],
"unique_verbs": ["GET", "PUT", "DElETE"],
"options": {"pagination": Pagination(20,
offset_key="start",
count_key="limit")}
}
Define like this, one should get the 20th to 30th results of the ressource “dogs” like this:
curl -i "http://<domain>.<ext>/dogs/?start=20&limit=10"
A paginate method take the request as argument and should return :
As pagination take some kwargs from the request to calculate offset and count, it is possible to remove those keyword arguments from the orignal request arguments. In the above example, the filter method of the datastore will only receive an empty dict to filter the dogs ressources.
One should need to give a pagination based on a token instead of offset and count. But as datastore will always paginate using start and offset, the paginate method should be able to calculate those values from the token. It’s up to you to create this method. This should not be a problem because you have the whole request to work on.


Hello World
This project contains
RESTfull API code template use spring boot
swagger2
uniform exception process


Take the quiz below to learn what type of programming language is best for you.
(0 = None, 5 = Moderate, 10 = Expert at at least one topic)
Value:
(0 = None, 5 = I will use some of my free time, 10 = I will put all of my time into learning a new language)


3 SAA Minority Unions Win Right To Take Part In Retrenchment Talks
by SG EditorTrade unions that are not recognised at South African Airways (SAA) on Wednesday clinched a major victory at the Commission for Conciliation, Mediation and Arbitration (CCMA), which allowed them to take part in retrenchment talks.
The South African Transport and Allied Workers Union (Satawu), Solidarity, and the Aviation Union of Southern Africa (AUSA) – which represent workers only in some divisions at SAA – were not consulted about the planned restructuring that could result in the loss of hundreds of jobs.
Members of the National Union of Metalworkers of South Africa and the South African Cabin Crew Association have been on strike for six days now over wages and those possible retrenchments.
Satawu, Solidarity, and AUSA, which are in a coalition at SAA Technical, lodged a dispute at the CCMA two weeks ago after the national carrier failed to issue them notice over the looming retrenchments.
Consultative talks between SAA and trade unions representing some of its over 5,000 workers were scheduled for Monday.
Satawu spokesperson Zanele Sabela said: “We complained bitterly when SAA came out to the media to say it was planning to retrench 944 workers because they hadn’t consulted us.”
The CCMA found that the scope of Section 189 consultations should also include non-organised workers.


Google antitrust probe to expand into Android: report
The several dozen attorneys general investigating advertising practices at Google are planning to expand their antitrust probe into the unit’s flagship Android business, CNBC reported on Thursday, citing people familiar with the matter.
The investigation, led by the Texas attorney general’s office, is known to have focused on Google’s search and digital advertising businesses since it began in September.
Google has said it is cooperating with the probe by US states and territories and noted that previous investigations in several have considered similar issues without charging the company with wrongdoing. It did not have further comment on Thursday.
The Alphabet unit also faces two other major inquiries — a US Justice Department investigation and a probe by the House of Representatives Judiciary Committee — both of which have broad reviews of the big internet companies underway.
Last year, Google was fined 4.34 billion euros by the European Commission, which said the tech giant gave itself an unfair advantage by pre-installing its Chrome browser and Google search app on Android smartphones and notebooks. Reuters
– Contact us at<EMAIL_ADDRESS>RC


Olbrich Botanical Gardens preparing to show off new learning center, greenhouses
by Stephen CohnMADISON, Wis. - Olbrich Botanical Gardens is preparing to show off its new learning center and greenhouses.
The $12 million project will allow the gardens to have a dedicated education space for the first time.
The space has several sustainable features, including a cistern to capture and reuse rainwater and solar panels that reduce energy use by about 35%.
Officials said the old greenhouse was outdated and on the metric system but the new one supports outdoor gardens, the conservatory and education programs.
They said the planning and fundraising for the new center have been in the works since 2010.
The public is invited to tour the space as construction continues, starting Fridays and Saturdays through Dec. 20.


The OESjs simulator can generate a simulation log, which allows to inspect the evolving states of a simulation run. Inspecting the simulation log can help to understand the dynamics of a model, or it can be used for finding logical flaws in it.
The contents of the simulation log can be controlled by defining short labels for those objects and object properties as
well as event types that we want to see in the log, using the shortLabel
attribute. For instance, in the case of the service desk model, defining the short labels "sd1" for the service desk object, "qLen" for the
queueLength
property, "Arr" for the Arrival
event type and "Dep" for the Departure
event type leads to the
following simulation log:
| Simulation Log | ||
|---|---|---|
| Time | System State | Future Events |
| 0 | sd1{ qLen: 0} | Arr@1 |
| 1 | sd1{ qLen: 1} | Arr@4, Dep@4 |
| 4 | sd1{ qLen: 1} | Arr@5, Dep@8 |
| 5 | sd1{ qLen: 2} | Dep@8, Arr@10 |
| 8 | sd1{ qLen: 1} | Arr@10, Dep@12 |
| 10 | sd1{ qLen: 2} | Dep@12, Arr@12 |
| 12 | sd1{ qLen: 2} | Arr@15, Dep@16 |
| 15 | sd1{ qLen: 3} | Dep@16, Arr@21 |
| 16 | sd1{ qLen: 2} | Dep@18, Arr@21 |
| 18 | sd1{ qLen: 1} | Dep@20, Arr@21 |
| 20 | sd1{ qLen: 0} | Arr@21 |
In , we have shown how to create initial objects for the initial state of a simulation scenario using the
map sim.scenario.initialState.objects
. Whenever the initial state has to be populated with a larger set of objects, we can define a
set-up procedure sim.scenario.setupInitialState
, as in the following example where we create 100 ServiceDesk
objects, each
with an associated Arrival
event:
sim.scenario.setupInitialState = function () { var i=1; for (i=1; i <= 100; i++) { sim.addObject( new ServiceDesk({ id: i, typeName: "ServiceDesk", queueLength: 0 })); sim.scheduleEvent( new Arrival( { occTime: 1, serviceDesk: i })); } };
The objects defined in the initial state, or created during a simulation run, can be
accessed either by their ID number or by their name, if they have one. For instance, the object {typeName:"ServiceDesk", id: 1, name:"serviceDesk1",
queueLength: 0} defined above, has the ID number 1 and the name "serviceDesk1". It can be retrieved by ID from the simulator map
sim.objects
in the following way:
var object1 = sim.objects["1"];
It can also be retrieved by name from the simulator
map sim.namedObjects
in the following way:
var object1 = sim.namedObjects["serviceDesk1"];
For looping over all
simulation objects, we can loop over the simulator map sim.objects
in the following way:
Object.keys( sim.objects).forEach( function (objIdStr) { var obj = sim.objects[objIdStr]; ... // do something with obj });
We can loop over all simulation objects of a specific type, say ServiceDesk
, in the following way:
Object.keys( cLASS["ServiceDesk"].instances).forEach( function (objIdStr) { var obj = cLASS["ServiceDesk"].instances[objIdStr]; ... // do something with obj });
If a simulation has to deal with a large number of objects, using a for
loop may be faster than a forEach
loop.
There are use cases which require to
construct a history of the changing values of a certain attribute for a specific object and evaluate or simply display this history. For example, we
may define a history for the attribute queueLength
of service desks using the historySize
parameter:
var ServiceDesk = new cLASS({ Name: "ServiceDesk", supertypeName: "oBJECT", properties: { "queueLength": { range: "NonNegativeInteger", historySize: 7, label: "Queue length", shortLabel: "qlen"} } }); In such
In such a case, the OESjs simulator automatically constructs a history buffer of the specified size, which can, for instance, be converted to a string with the expression
sim.namedObjects["serviceDesk1"].history.queueLength.toString()
A history buffer
is a ring buffer, having a limited size and an add
operation for adding new items to the buffer as in:
sim.namedObjects["serviceDesk1"].history.queueLength.add( this.queueLength);
Notice that the oldest item may get lost when a (fixed-size) buffer is already full and a new item is added.
Object.keys( cLASS["ServiceDesk"].instances).forEach( function (objIdStr) { var obj = cLASS["ServiceDesk"].instances[objIdStr]; ... // do something with obj });
If a simulation has to deal with a large number of objects, using a for
loop may be faster than a forEach
loop.


Faculty Coordinator
Dr. Wasim Arif
Samir Kumar Borgohain
Student Advisor
Ankan Kishore Pathak
Anirban Roy
Convenor
Nishank Das
Abhinav Asthana
Chief Coordinator
Harsh Agarwal
Mrinmay Mukherjee
Monish Revuri
Technical Head
Rohit Upadhya
Puberun Boruah
Creative Head
Anshuman Roy
Mridupawan Deka
Executive Head
Darpan Jyoti Bora
Bhargav Doley
PR Head
Disha Mohanty
Hirak Jyoti Dutta
Publicity Head
Ritik Singh
Priyanuj Misra
Web developer
Polashi Bordoloi
Abdullah Khilji
Design
Tushar Agarwal


Rights Profiles Demo:
Grants:
You may copy the work
You may modify the licensed material and
share your modified
version.
You may make the material accessible to
others in digital form.
You may sell your smart license
“as is” to someone else.
Restrictions:
Patent and trademark rights
are not licensed under this smart
license.
You may not use the material for
commercial purposes.
Obligations:
Indicate Adaptions (IA)
If you share your own adaption you must
reference the original licensed
material.
Attribution (AT)
If the licensed material contains
references to the creator or publisher
or copyright notices you must not remove them.


Preparation time
1-2 hours
Cooking time
30 mins to 1 hour
Serves
Makes 4
For the dough, place the flour, salt and sugar into a large bowl and stir to combine.
Crumble the yeast into a small bowl and add four tablespoons of the water. Whisk to combine and set aside for one minute.
Pour the yeast mixture into the centre of the flour mixture, and add the remaining the water. Mix well to form a soft dough.
Tip the dough out onto a floured work surface and knead until smooth and elastic.
Place the dough into a lightly greased bowl, cover with cling film and leave to rise for one hour.
Remove the dough from the bowl and knead for a minute on a floured work surface, then divide into four pieces and roll into circles, 0.5cm/¼in thick.
For the topping, heat a frying pan until hot, then add the oil, onions and garlic and fry for 3-4 minutes.
Add the tomatoes, sugar and the chopped basil and bring to the boil. Reduce the heat and simmer for 20 minutes, until the sauce has thickened. Season, to taste, with salt and freshly ground black pepper and leave to cool.
Preheat the oven to 220C/425F/Gas 7. Place a heavy baking tray or a pizza stone into the oven to preheat.
Place the pizza bases onto an upturned, floured baking tray. Spoon the cooled tomato sauce thinly over the pizza.
Sprinkle over the artichokes, mozzarella, parmesan, goats' cheese and Parma ham and season with salt and freshly ground black pepper.
Carefully transfer the pizzas into the oven, pushing the pizzas from the floured tray onto the hot tray pizza stone. Cook for 15 minutes, or until the base is crisp and the topping is cooked through.
Remove from the oven and sprinkle with the basil leaves. Serve immediately.


Create a Github Repository
By far, the easiest and error-free method of using a Github Repository, is by starting with a new repository on github.com itself. Of course, you need a github account first.
Clone the Github Repository to Local
To clone a Github repository, use the following command:
git clone https://github.com/catch22eu/project-directory.git
This wil create a new directory project-directory, and copy all the repository content on Github to this directory. Besides, it will also create a .git directory containing the administrative files needed to keep track of your changes.
Add files or edit the Local Repository
cd into the directory that has just been created, and edit or add files to your preference. In order to update the changes to the local repository database, use the command
git add .
This will synchronise the new or added files (to what is called the staging area).
Committing updates to the Local Repository
By now, the local repository is aware of the changes, but they need committing by you as a user to make the system also aware of different versions:
git commit -m "Info of the changes and / or versioning here"
Beware, that prior to this, you'll have to use two commands to define your "global" user name and email address if you did not do this before:
git config -global user.name "your name"
git config -global user.email you@email-address
Pushing the changes to Github
Simply use:
git push
This will push the changes to the github server. The command will ask for your Github username and password before sending the files. A look at the github.com will then show your changes or additions as well.
Updating the Local Repository with a newer version from Github
First, archive any changes made on the local repository (if there are no changes, it will say so as well):
git stash
Then pull the newer version from Github and update the local repository:
git pull
Conclusion
That's all there is. For more information, and other options, see github.com.


singleton | --admin_panel
Located in File: Program_Root/admin_panel/admin_panel.class.php
User
public
| Class Variable Summary |
$application
Reference to application that uses this instance. Default Value:
|
$highlight
Positions and colors of records to highlight. Default Value:
|
$no_update
Don't generate a form in next open_source. Default Value:
|
$raw_views
Array of event handlers that open a document header or footer on their own. Default Value:
|
$record_cache
Cached cursor values. Default Value:
|
$v
Reference to current context object. Default Value:
|
$widgets
Reference to widget set. Default Value:
|
$_anchor
Use anchors in links when set to 'true'. Default Value:
|
$_anchors
Number of set anchors. Default Value:
|
$_form_index
Index of last form. Default Value:
|
$_opencells
Number of open cells. Default Value:
|
$_openform
Number of opened forms. Default Value:
|
$_openrow
Number of open rows. Default Value:
|
$_opentable
Number of open tables. Default Value:
|
$_viewstack
Context stack. Default Value:
|
| Inherited Class Variable Summary |
| Inherited Method Summary | ||||||
Inherited From Class singleton
|
| Variable Detail |
public
The array contains HTML colors keyed by context cursor id.
cursor::id()
public
public
The handler names are stores in the keys - the values can contain anything (preferably a boolean).
public
The array contains the keyed by context cursor id.
val()
public
public
The first form has index 1.
| Method Detail |
void constructor admin_panel ( &$app, [$widgets = 0] )
Initialise everything.- object $app: application
- object $widgets: widget_set
public
void checkbox ( $field, [$event = 0] )
Print a checkbox.Posting a checkbox will result in value 0 or 1 for the field.
- string $field:
- object $event: event This is probably unused...
public
void clear_record_cache ( )
Clear the record cache.public
void close ( )
Finish HTML document and exit.public
void close_cell ( )
Close an opened cell.This function dies if there's no opened cell.
public
void close_context ( )
Return to former context.public
void close_form ( )
Close an opened form.This function dies if there's no opened form.
public
void close_row ( )
Close an opened row.This function dies if there's no opened row.
public
void close_table ( )
Close an opened table.This function dies if there's no opened table.
public
void close_widget ( )
Close opened call and row.The field name for highlighting is reset.
public
void confirm ( $msg, $option_yes, $event_yes, $option_no, $event_no, [$color = 0] )
Print confirmation box.- string $msg: Question to the user.
- string $option_yes: Label for confirming option.
- object $event_yes: event Event to trigger for confirming option.
- string $option_no: Label for non-confirming option.
- object $event_no: event Event to trigger for non-confirming option.
- string $color: Color for question in HTML attribute format.
public
void fileform ( $field, [$typefield = ''], [$filenamefield = ''] )
Print file upload widget.- string $field:
- string $typefield: Name of field that will contain the uploaded file's MIME type.
- string $filenamefield: Name of field that will contain the uploaded file's original
file name.
public
void fileurl ( $source, $field, $key, $mime_type, [$data = 0] )
- string $source: Source/table name of the file.
- string $field: Field where the file is stored.
- string $type: MIME type of the file.
- string $key: Primary key of the record.
public
void &get_cursor ( )
Get the cursor used in the current context.object cursor
public
void header ( $header, [$comp = ''] )
Print document header.- string $title:
- string $comp: Copyright and/or version info.
public
void headline ( $text )
Print a headline.- string $text:
public
void image ( $label, $src )
Print an image.- string $label: A text for the link.
- string $src: URL to the image.
public
void image_link ( $label, $src, $event )
Print an image link.- string $label: A text for the link.
- string $src: URL to the image.
- object $event: event
The event that is triggered when the link is invoked.
public
void inputline ( $field, $maxlen )
Print an input line.- string $field:
- integer $maxlen: Width of line in number of characters.
public
void &instance ( )
Overrides: singleton::instance()
Get reference to the one and only instance of this class.object admin_panel
public
void label ( $text )
Print label.This function prints a text which looks different to that generated by print_text() amd should have a descriptive character.
- string $text:
public
void link ( $label, $event, [$fakename = ''] )
Print a link.- string $label: A text for the link.
- object $event: event
The event that is triggered when the link is invoked.
- string $fakename: A fake filename for file downloads.
public
void msgbox ( $message, [$color = 0] )
Print an informal message box.- string $message:
- string $color: Color in HTML attribute format.
public
void new_formfield ( $field, [$event = 0], [$f = 0] )
Create form name for a field in a particular record.- string $field:
- object $event: event
Event to trigger if widget is a submit button.
- object $f: _form_element For internal use.
public
void no_anchor ( )
Switch off use of anchors.public
void open_cell ( [$attrs = 0] )
Open a cell.public
void open_context ( &$cursor )
Open a new context.- object $cursor: cursor
public
void open_form ( [$default_event = 0] )
Open form that is posted to form parser form_parser().- object $default_event: event
Default form event used when form is posted without submit
button.
public
void open_row ( [$attrs = 0] )
Open a row.public
void open_table ( [$attrs = 0] )
Open a table.public
void open_widget ( [$field = ''], [$attrs = ''0''] )
Open a row and cell for a widget and set the current field.The field name is used for highlighting.
- string $field: Currently accessed field.
- array $attr: HTML attributes for the opened cell, keyed by attribute name.
public
void panic ( $message )
Print error message and die.- string $message:
public
void paragraph ( [$html = ''] )
Print a paragraph.A paragraph reopens a table so one can start with a new number of columns. Outside tables a paragraph is printed.
public
void password ( $field, $maxlen, [$label = ''] )
Print a password line.The content of the line is never shown.
- string $field:
- integer $maxlen: Width of line in number of characters.
public
void print_text ( $text )
Print text.Instead of php's echo function print_text() should be used so the widget set can control the layout.
- string $text:
public
void radiobox ( $field, $label_true, $label_false, [$value_true = 1], [$value_false = 0] )
Print boolean radio box.- string $field:
- string $label_true: Label text for 'true' option.
- string $label_false: Label text for 'false' option.
- mixed $value_true: Data for 'true' option.
- mixed $value_false: Data for 'false' option.
public
void reset_button ( [$label = 'reset'] )
Print a reset button.- string $label: Label for the button.
public
void select_id ( $field, $source, $column, $id, [$where = ''] )
Select an entry in a foureign table and store its primary key.- string $field:
- string $source: Name of foureign table.
- string $column: Name of column in foureign table that is printed.
- string $id: Name of the primary key column.
- string $where: WHERE clause to use to select the records from the foureign
table (without WHERE keyword).
public
void select_string ( $field, $optionlist, [$use_stringkey = true] )
Select a string- string $field:
- array $optionlist: Strings to select from.
- booleanean $use_stringkey: If this is true, the array key of the selected option is
stored in the field.
public
void set_default_formevent ( $event )
Set default form event for current context.- object $event: event
public
void set_value ( $field, $val )
Set a field in the record cache.- string $field: Field name.
- mixed $val: New value to set.
public
void show ( $field )
Print contents of a record's field.- string $field: Field name.
public
void show_mime_image ( $field, $type )
Print image.- string $field: Current record's field that contains the image.
- string $type: MIME type of the image.
public
void show_ref ( $field, $source, $column )
Create cell with contents of row in a referenced table.- string $field: Name of field that references the source.
- string $source: Name of table that is references.
- string $column: Name of the column in referenced table that is printed.
public
void submit_button ( $label, [$view = 0] )
Print a submit button.- string $label: Label for the button.
- object $event: event Event to use for the submit button.
public
void submit_image ( $label, $image, [$view = 0] )
Print a submit image.- string $label: Label for the button.
- string $image: URL to image.
- object $event: event Event to use for the submit button.
public
void submit_name ( [$event = 0] )
Get name for a submit button.- object $event: event Event to use for the submit button.
string Form element name.
public
void table_headers ( $titles, [$attrs = 0] )
Create table header from array of strings.- array $titles: Column titles.
public
void textarea ( $field, $width, $height )
Print textarea.- string $field:
- integer $width: Number of columns.
- integer $height: Number of rows.
public
void url ( &$event )
Create URL from event object.This function must be used instead of the application class functions.
- object $event: event Event to trigger if URL is invoked.
public
void use_anchor ( )
Switch on use of anchors.If a link points to the current event handler, an anchor is used to scroll to the position of the triggered link.
public
void value ( $field_name )
Get a field from a record the current context points to.If there's a value stored in the record cache it is returned instead.
- string $field_name:
public
void _add_context ( &$element )
Add context info to event.- object $event: event
void _inputline ( $type, $field, $maxlen )
void _looselink ( $label, $view, [$fakename = ''] )
void _new_formtoken ( $view, $element )
Create new name for a form element.This function creates a name containing a token
- object $view: event XXX &$view would crash.
- object $element: _form_element


Data Returns – guidance
Symbols
This data standard presents approved symbols we may need in our work. Use of this data standard results in more consistent use of Symbols, improving clarity and decreasing ambiguity. These are the approved symbols to be used in our work:
| Symbol | Definition | Status |
|---|---|---|
| % | Percent, a number expressed as a fraction of 100 | Valid |
| ‰ | Percentage per mille, a number expressed as a fraction of 1000 | Valid |
| = | Equal to | Valid |
| ≠ | Not equal to | Valid |
| < | Less than | Valid |
| <= | Less than or equal to | Valid |
| > | Greater than | Valid |
| >= | Greater than or equal to | Valid |
| ~ | Approximately equal to | Valid |
| + | Positive number (assume a number is positive if "+" symbol is not provided) | Valid |
| - | Negative number | Valid |
| ± | Plus or minus, an indication of the error range associated with a value | Valid |
| ∞ | Infinity | Valid |
| * | Asterisk or wildcard character | Valid |
| *.* | Star-Dot-Star (used as a search criterion for everything containing a "." symbol) | Valid |
| .B~K | Backup (file name extension) | Valid |
| | | Pipe symbol (can be used to represent OR in a web search) | Valid |
| ° | Degree | Valid |
| 2, 3 | Squared or Cubed | Valid |
| µ | Micro | Valid |
| © | Copyright | Valid |
| ® | Registered trade mark | Valid |
| ™ | Trade mark | Valid |


Welcome
Projects
Contact
Ray Ockenfels
Web Developer
Projects
Tribute Page
Survey Form
Product Landing Page
Technical Document
Get in Touch:
freeCodeCamp
Codepen
GitHub
Email


You can download the binaries from here.
You can play this game in your browser here.
More info and feedback at Ludum-Dare page.


Overview of Today's Class
Homework Notes
GeoJSONs
Similar to shapefiles, GeoJSON is a format for storing geographic features & their non-spatial attributes
Based on JSON (JavaScript Object Notation)
Can be used in ArcGIS Online & Desktop, QGIS, etc…
Let's talk about some practical GeoJSON things before we get into the nitty gritty.
Convert Shapefiles (& other geoformats) to GeoJSON
ArcGIS Online
QGIS
It is a bit more complicated with ArcGIS Map/Pro, but instructions are linked in the course page.
How to add GeoJSON data to your leaflet map?
Last week we manually wrote features to add to the map
This week, we will link to a GeoJSON file.
First: we need to add jQuery (javacript library) & ajax (data retrieval tool for javascript). Copy & paste the following headings into your html heading:
I won't make you hunt it down this time :)
Next, under your Leaflet map, use jQuery & leaflet methods to add the geoJSON data to your map.
$ = jQuery method (similar to “L” for leaflet)
That's it! You've added the GeoJSON features to your map
The annoying thing:
Similar to embedding an AGOL map, there’s a security quirk (well, a very useful feature) that does not allow you to view the geojson data locally. The data will load on upload to Github. Give yourself time to upload & test as you work on the project.
So this is not useful to look at. Let's break down GeoJSON's so we can style them.
GeoJSON Syntax
GeoJSONs are composed of at least one object
These can be types, which contain the geometry of the object and nothing more.
Note: Multi-types represent a single object that has multiple parts.
For example, Michigan is one object composed of two separate polygons (the upper and lower peninsula)
Types can be combined with properties to create a Feature object.
Multiple features can be combined into a Feature Collection
Don't stress when you open your GeoJSON and it looks like this
So how do we make this look reasonable?
The default style for GeoJSON points are the default blue Leaflet markers
Change Default Icon to Circles
Step 1: Add an object within the L.geojson data parameter.
(add a comma then curly { } brackets after "data")
Step 2: Add a property.
Inside the curly brackets, add a built-in geojson function called “pointToLayer”
pointToLayer has two parameters: feature, latlng. Leave these. (latlng returns the point coordinates)
Step 3: Inside pointToLayer function, call (return) a “new” L.CircleMarker
In the parameters of the leaflet function CircleMarker, you’re adding the latlng points of your geojson, and then the style elements.
Check-in
What is going on between all these parentheses, brackets, and commas?
Add a pop-up to your point
After our pointToLayer function, we will add another function: the onEachFeature function
As implied by the name, the onEachFeature function will go through each feature in our geojson and do whatever we tell it to do
After the pointToLayer function, add another function "onEachFeature" with the parameters (feature, Layer)
What is this function going to do onEachFeature? Tell it!
layer.bindPopup()
Pop-up what? In the parentheses of bindPopup, use the name of the property you want to call
feature.properties.Property You want to Add
Add additional info to popup
Add more info & Style
What if we want to change the style depending on the property?
For example:
Or
JavaScript if/else statements
Example 1
Step 1
Before your function with your style properties, create two variables:
Note: agesColor & ageServed can be named anything.
A quick look at the data before we continue:
The data is stored as a string with the values "true", "false", or Null(no value)
Step 2
Add the conditions to your agesServed variable
The syntax is saying:
If the property in agesServed is equal to “true”, then the variable agesColor value is blue.
If the property is anything but “true”, then agesColor value is red.
Notice the == versus =, I will cover in a couple of slides
Step 3
Change the style fillColor to your variable agesColor
The syntax is saying:
fillColor is whatever the value of agesColor is.
The value of agesColor will change depending on the property of agesServed.
So what's up with = versus == ?
Single = is the assignment operator
var example = “I assigned the variable example to this string”
Double == asks JavaScript to compare two values
Does this features value for Ages_0_3 equal “true” ?
Comparison Operators
| == |
Equal to |
|---|---|
| != |
Not equal to |
| < |
Greater than |
| > |
Less than |
| <= |
Greater than or equal to |
| > |
Less than or equal to |
Logical Operators
If the daycare serves children under 3 && costs less than $200/month, then the circle should be blue
| && |
And |
|---|---|
| || |
Or |
| ! |
not |
Note that these operators are asking true or false questions
Does this feature’s value for Ages_0_3 equal “true” ?
Does the daycare serve children under three AND cost less than $200/month?
Example 2
Using polygon geojson – Chicago Neighborhood Hardship Index
Step 1
Add the GeoJSON to HTML File
Annoying thing: Ajax has weird callback rules with data ordering. It reads vector layers with equal weight – meaning when you upload your HTML it will randomly order layers.
Easy fix: .bringToBack() method
Steps 2 & 3
Step 2: Add Style Function
Step 3: Add variables
Steps 4: Add Conditions
I know from the data that the neighborhoods are ranked from 1-100 (100 with the highest hardship), so I have decided to create 6 groups and use the greater than ( > ) operator to split them up
Steps 4: Add Conditions, continued
Add the conditions to your object, and return the style for the layer
Steps 5:
Add an onEachFeature function to add pop-ups
Questions?


My Favorite Places
These are a few of my favorite places. Get excited.
Barcelona
Why?
- It's got the beach AND the city
- The people are super friendly
- The food is divine
London
Why?
- The accents are regal and delicious
- It's super easy to get around
- There's always something to do (West End, night life, etc)
Sites to get you started on your journey:
Thanks for reading! Now go wander!


Used only on create to add the work type to all agreement and agreement type exclusion lists
Metadata of the entity
Generated using TypeDoc
Used only on create to add the work type to all agreement and agreement type exclusion lists


Welcome Administrator
Overview
Applications
Upload Servlet
Cluster-Wide Overview
Cluster Controls
Please select an action:
Shutdown Entire Cluster
Real-time Cluster Stats
Server response:
Cluster Status
Uptime -
Number of nodes -


Class: user
user
()
a test user class with properties populated using faker
Constructor
new user
()
Deprecated:
(See
User
)
Source:
Models/userClass.js
,
line 9
Classes
user
Documentation
Classes
User
user
Global
addTestUsers
auth0
auth0CreateUsers
body
checkLocalToken
deleteTestUsers
getAllUsers
searchUsers
setupUsers
storeLocalToken
superagent
teardownUsers


module SimpleCov::CommandGuesser
Attributes
original_run_command[RW]
Storage for the original command line call that invoked the test suite. This has got to be stored as early as possible because i.e. rake and test/unit 2 have a habit of tampering with ARGV, which makes i.e. the automatic distinction between rails unit/functional/integration tests impossible without this cached item.
Public Class Methods
guess()
click to toggle source
# File lib/simplecov/command_guesser.rb, line 14 def guess from_env || from_command_line_options || from_defined_constants end
Private Class Methods
from_command_line_options()
click to toggle source
# File lib/simplecov/command_guesser.rb, line 28 def from_command_line_options case original_run_command when /test\/functional\//, /test\/\{.*functional.*\}\// "Functional Tests" when /test\/integration\// "Integration Tests" when /test\// "Unit Tests" when /spec/ "RSpec" when /cucumber/, /features/ "Cucumber Features" end end
from_defined_constants()
click to toggle source
# File lib/simplecov/command_guesser.rb, line 43 def from_defined_constants # If the command regexps fail, let's try checking defined constants. if defined?(RSpec) "RSpec" elsif defined?(Test::Unit) "Unit Tests" elsif defined?(MiniTest) "MiniTest" else # TODO: Provide link to docs/wiki article warn "SimpleCov failed to recognize the test framework and/or suite used. Please specify manually using SimpleCov.command_name 'Unit Tests'." "Unknown Test Framework" end end
from_env()
click to toggle source
# File lib/simplecov/command_guesser.rb, line 20 def from_env # If being run from inside parallel_tests set the command name according to the process number return unless ENV["PARALLEL_TEST_GROUPS"] && ENV["TEST_ENV_NUMBER"] number = ENV["TEST_ENV_NUMBER"] number = "1" if number.empty? "(#{number}/#{ENV['PARALLEL_TEST_GROUPS']})" end


Hi!
Because many users ask and report a bug where BBLog is NOT loading several times or never, i say it here in a fresh global thread.
Also, BBLog will NOT load on...
* https protocol - Security reason
* On the new
http://battlelog.medalofhonor.com
domain
* On any MOH:W Page or on any
http://battlelog.battlefield.com/all/*
page
BBLog v3 will come on 21. Nov. 2012 and will fix this problems.


Codepen: Page Slides with Progress bar built-in
For today’s project I decided to not use any library…unless you want to count Font Awesome’s library for the arrow icons. Today’s project was centered around thinking about how UX and UI meld together. We want to give users a nice experience and we want them to have a good experience. I once read somewhere that good design is when the user isn’t aware that it’s good. It means that the ease of use is built into the experience. So for this, I worked with css animations for the arrows and some anchor links for the sections, each of which is covers the window size automatically. The elements for the example were centered with arrows on the same place on each side. The animations were included to give the user further aid as to what the elements do. One of things that I’ve been recently considering from a user perspective is giving aid to the use of certain aspects of the website by adding small things like animations to move users towards certain actions that add to the ease of the experience and thereby giving them a better experience with the website. This is also why I thought it would be good to include a progress bar. One frustrating part of the modern web experience is not knowing where you are in the content. This is a great and yet simple way to measure progress for things like blog pages. Overall I think it was pretty good for a small project. We’ll see how tomorrow’s goes. See ya then!


Strategic Planning Manager, Senior VP, Innovation R&D, Wells Fargo Bank, USA
Sr. Analytics Scientist, Global Data Insight & Analytics, Ford Motor Company, USA
Intel Fellow, Datacenter Group, Intel Corporation, USA
Program Co-Chairs
Joseph Barr, Trust Science, Canada (Business)
Daniela D'Auria, University of Naples Federico II, Italy (Science & Engineering)
Craig Dietrich, Occidental College, USA (Humanities)
Cristiane Chaves Gattaz, UT Austin, USA and Wesley Mendes-Da-Silva, FGV/EAESP, Brazil (Agriculture)
Gary Glesener, Virginia Tech, USA (K12 and High Education)
Masahiro Hayakawa, NEC Solution Innovators, Japan (IT)
Joanne Luciano, Indiana University, USA (Biomedicine)
Sheida Malekpour, Ford, USA (Manufacturing)
Adam Sulzdorf-Liszkiewicz, RUST, USA (Entertainment)
Program Committee
Panel Chair
Fabio Persia, Free University of Bolzano, Italy
Demo Co-Chairs
Srividya Bansal, Arizona State University, USA
Mliad Nezhad, Ford, USA
Luigi Paraboschi, Expert System, Italy
Mustafa Sert, Başkent University, Turkey
Xiangrui Zeng, Ford, USA
Publicity Co-Chairs
Biswanath Dutta, Indian Statistical Institute, India
Feroz Farazi, University of Cambridge, UK
David Gonzalez-Aguirre, Intel, USA
Ahrar Husain, Jamia Millia Islamia, India
Ryutaro Ichise, NII, Japan
Yang Lei, HP Labs, USA
Robert Mertens, HSW University of Applied Sciences, Hamelin, Germany
Ichiro Ide, Nogoya University, Japan
Salim Perchy, INRIA, France
Heiko Schuldt, University of Basel, Switzerland
Guigang Zhang, Chinese Academy of Sciences, China
Tong Zhang, Intel, USA
Xiaoqing Zhu, Cisco, USA
Finance and Local Arrangement Chair
George Wang, CSUN, USA
Publication and Registration Chair
Bryan Chou, University of California, Irvine, USA
Kyle Li, University of California, Irvine, USA
Jimmy Shih, University of California, Irvine, USA


Introduction to ROBLOX Markup Language (RoML)
What is RoML?
RoML is a domain-specific language and library to aid you in creating and updating ROBLOX objects dynamically during the game. RoML tries to to cut down on the amount of code you have to right in order to increase your production. RoML also mimics existing languages so those who already know those languages will feel comfortable.
Getting Started with RoML
To start, you should download the ROLBOX Studio plugin. This can be done by either installing the plugin from the ROBLOX website, or by downloading the file from the Git repository and adding it to your plugins folder. It can be found by clicking on Plugins > Plugins Folder within ROBLOX Studio.
Installing the Library
Once the plugin is installed, you may then install the library on any of your places. There is a button in the plugin (Plugins > ROBLOX Markup Language > Install). Click on this and it will copy the required ModuleScripts into the ServerScriptService of your place. You will have to do this for every place you want to use RoML in.
Compiling RoML and RoSS Scripts
After you've added a few RoML and RoSS scripts to your place you must then compile them into Lua scripts. To do this, click the compile button (Plugins > ROBLOX Markup Language > Compile). In the Gui window that pops up, you can then add a source folder by clicking the "Add a Source Folder" button. In the window that pops up you have two text fields, one for the source and one for the output folder (the output is optional). Enter these values, then click the "Add" button.
Both should be in the format with a Service name first, followed by children objects separated by a period. Consider our project has the following structure:
game
|
+-- ServerScriptService
|
+-- src (Folder)
|
+-- roml (Folder)
|
+-- TestRoML1.roml (ModuleScript)
|
+-- TestRoML2.roml (ModuleScript)
We have a couple of RoML scripts inside of the roml folder inside the src folder inside the ServerScriptService.
So our source folder would be: _ServerScriptService.src.roml
_.
We could then set our output folder as _ServerScriptService.lib.roml
_, for example.
If you don't include an output folder, the compile ModuleScripts will be placed in the same location as the source ModuleScripts.
After you have a source folder added, you can then click the "Compile" button back on the main compiler window. The library will then attempt to parse and compile your RoML scripts into Lua scripts. If there are any problems, the message will appear in ROBLOX Studio's output. Once we've successfully compiled, our example project will look like this:
game
|
+-- ServerScriptService
|
+-- lib (Folder)
| |
| +-- roml (Folder)
| |
| +-- TestRoML1 (ModuleScript)
| |
| +-- TestRoML2 (ModuleScript)
|
+-- src (Folder)
|
+-- roml (Folder)
|
+-- TestRoML1.roml (ModuleScript)
|
+-- TestRoML2.roml (ModuleScript)


All Classes
Action
AddNewCompanyAction
AddNewShareholderAction
AddSharesToCompanyAction
AdministrationOfCompaniesActions
AdministrationOfCompaniesMenu
AdministrationOfShareHoldersActions
AdministrationOfShareHoldersMenu
AdministrationOfStocksAction
AdministrationOfStocksMenu
BuyandSellAction
Company
DMComponent
ExitAction
FileOps
IOComponent
MainMenu
MainProgramExecution
Menu
Option
RemoveCompanyAction
RemoveShareholderAction
Shareholder
Shares
ShowCompanyPortfolioAction
ShowReportAction
ShowShareholderPortfolioAction
SplitStockAction
UpdateStockValueAction


This page tracks the new paper links made to our list of ICCP 2015 papers.
Page maintained by Ke-Sen Huang.
If you have additions or changes, send an e-mail.
August 29, 2015
- Predicting Range of Acceptable Photographic Tonal Adjustment
- A Dictionary-based Approach for Estimating Shape and Spatially-Varying Reflectance
- LiSens ¡X A Scalable Architecture for Video Compressive Sensing
- Single-Shot Reflectance Measurement from Polarized Color Gradient Illumination
- Self-Calibrating Imaging Polarimetry
- What Makes It a Good Day for Outdoor Photometric Stereo?
- Contrast Use Metrics for Tone Mapping Images
- High Resolution Photography with an RGB-Infrared Camera
- Towards Self-Powered Cameras
- MC3D: Motion Contrast 3D Scanning
- Robust Radiometric Calibration for Dynamic Scenes in the Wild
March 15, 2015
- Directional Super-Resolution by means of Coded Sampling and Guided Upsampling
- Unbounded High Dynamic Range Imaging with a Modulo Camera
- Performance Characterization of Reactive Visual Systems
- Linking Past to Present: Discovering Style in Two Centuries of Architecture
kesen.huang@gmail.com


黒の手番です。11 はどう動かしますか？


|
QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.30
|
exchange rate between two currencies More...
#include <ql/exchangerate.hpp>
Public Types | |
| enum | Type { Direct , Derived } |
Public Member Functions | |
Constructors | |
| ExchangeRate () | |
| ExchangeRate (Currency source, Currency target, Decimal rate) | |
Inspectors | |
| const Currency & | source () const |
| the source currency. More... | |
| const Currency & | target () const |
| the target currency. More... | |
| Type | type () const |
| the type More... | |
| Decimal | rate () const |
| the exchange rate (when available) More... | |
Utility methods | |
| Currency | source_ |
| Currency | target_ |
| Decimal | rate_ |
| Type | type_ |
| std::pair< ext::shared_ptr< ExchangeRate >, ext::shared_ptr< ExchangeRate > > | rateChain_ |
| Money | exchange (const Money &amount) const |
| apply the exchange rate to a cash amount More... | |
| static ExchangeRate | chain (const ExchangeRate &r1, const ExchangeRate &r2) |
| chain two exchange rates More... | |
exchange rate between two currencies
Definition at line 38 of file exchangerate.hpp.
| enum Type |
| Enumerator | |
|---|---|
| Direct | given directly by the user |
| Derived | derived from exchange rates between other currencies |
Definition at line 40 of file exchangerate.hpp.
| ExchangeRate | ( | ) |
Definition at line 84 of file exchangerate.hpp.
| ExchangeRate | ( | Currency | source, |
| Currency | target, | ||
| Decimal | rate | ||
| ) |
the rate \( r \) is given with the convention that a unit of the source is worth \( r \) units of the target.
Definition at line 86 of file exchangerate.hpp.
| const Currency & source | ( | ) | const |
the source currency.
Definition at line 89 of file exchangerate.hpp.
| const Currency & target | ( | ) | const |
the target currency.
Definition at line 93 of file exchangerate.hpp.
| ExchangeRate::Type type | ( | ) | const |
the type
Definition at line 97 of file exchangerate.hpp.
| Decimal rate | ( | ) | const |
the exchange rate (when available)
Definition at line 101 of file exchangerate.hpp.
apply the exchange rate to a cash amount
Definition at line 25 of file exchangerate.cpp.
|
static |
chain two exchange rates
Definition at line 50 of file exchangerate.cpp.
|
private |
Definition at line 74 of file exchangerate.hpp.
|
private |
Definition at line 74 of file exchangerate.hpp.
|
private |
Definition at line 75 of file exchangerate.hpp.
|
private |
Definition at line 76 of file exchangerate.hpp.
|
private |
Definition at line 78 of file exchangerate.hpp.


AMERICA'S SWEETHEARTS (2001). 3 1/2 stars out of 4. Starring Julia Roberts, Catherine Zeta-Jones, John Cusack, Billy Crystal, Stanley Tucci, Hank Azaria, Christopher Walken, Alan Arkin and Seth Green. Written by Crystal and Peter Tolan. Music by James Newton Howard. Directed by Joe Roth. Approx. 110 minutes. Rated PG-13.
With an all-star cast and a script that keeps the laughs coming almost continuously, Americaí's Sweethearts is a delight.
This Joe Roth-directed comedy mixes farce, satire, physical humor and romance to create a winning feature that will keep you chuckling.
The story is simple: An estranged movie-star couple must come together for a press junket weekend to promote their 10th and final film pairing. Along the way, they bring their emotional baggage, resentments and hostilities.
Oh, and one of them falls in love.
America's Sweethearts has an old-fashioned quality despite some raunchy humor. It's a distant cousin to the screwball comedies of the 1930s and '40s. Some of the more outrageous moments are reminiscent of those zany Preston Sturges movies from the early '40s such as Sullivan's Travels.
Sweethearts has a sweetheart of a cast, headed by Julia Roberts and featuring Catherine Zeta-Jones, John Cusack, Billy Crystal (who also co-wrote the script and produced the film), Hank Azaria, Stanley Tucci, Alan Arkin and Christopher Walken.
The movie is filled with little gems, from Tucci's maniacally frustrated studio head describing to veteran press agent Lee Phillips (Crystal) why Senor Wences was the only true show biz genius, to Cusack's Eddie Thomas and Phillips taking a bow above the junketís press corps after Eddie nearly falls from the hotel roof in what the press perceives as a suicide attempt.
Some nice one-liners also abound. When Eddie shows up alone at the hotel, he is asked about the whereabouts of his entourage. I'm a paranoid schizophrenic. "I'm my own entourage," he responds.
Performances sparkle throughout America's Sweethearts. Zeta-Jones is cruelly funny as the pampered, spoiled, self-centered movie star who treats every minor inconvenience as a cataclysmic disaster.
Cusack's Eddie, while more grounded in reality, practices some New Age mumbo-jumbo to help remain centered. But he also flashes his movie star ego at times, worrying about grosses and the trajectory of his career.
Roberts is the comedy's heart. She plays Kiki, Gwen's sister and assistant.  She uses love and sisterly devotion to wheedle Kiki into catering to her every whim.
And it seems she has been doing this her entire life. Kiki reminds her that in high school when Gwen wanted to break up with a boyfriend, she'd send Kiki to break the bad news. "I wound up being the most hated girl in school," Kiki tells her oblivious sibling.
To make matters more complicated, Kiki is in love with Eddie and believes Gwen treated him badly.
Crystal is connivingly convincing as the always-thinking press agent who sees every misstep or accident as an opportunity as a movie promotion.
Walken, looking like a Woodstock burn-out case, is hilariously weird as the director who brings his singular vision to the movie he was supposed to have shot.
Veteran Arkin turns in a sly appearance as Eddie's therapist who spouts Eastern bromides that sound sage, but really make no sense at all.
The movie's only major misstep is in Azaria's portrayal of Hector, Gwen's Spanish lover.
America's Sweethearts is a honey or a comedy, a movie you'd want to cuddle up with. It's warm and cute as well as satirical and sharp.
Plus, you get to see Julia Roberts in a fat suit. Who could ask for anything more!
Bob Bloom is the film critic at the Journal and Courier in Lafayette, IN. He can be reached by e-mail at<EMAIL_ADDRESS>or at<EMAIL_ADDRESS>Bloom's reviews also can be found at www.jconline.com by clicking on golafayette
Bloom's reviews also appear on the Web at the Internet Movie Database site: http://www.imdb.com/M/reviews_by?Bob+Bloom
========== X-RAMR-ID: 28863 X-Language: en X-RT-ReviewID: 236656 X-RT-TitleID: 1108688 X-RT-SourceID: 872 X-RT-AuthorID: 1363 X-RT-RatingText: 3.5
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


<EMAIL_ADDRESS>Born 1938 in England. Married, with two children.
Degrees:
BA (University of Wales), MA (University of Cambridge), MA (University of Oxford), B. Litt. (University of Oxford), DD (Cambridge), DD (Oxford).
Posts held
Lecturer in Logic, University of Glasgow, 1964-69.
Lecturer in Philosophy, University St. Andrews, 1969-71.
Lecturer in Philosophy of Religion, University of London (King’s College) 1971-76.
Fellow, Dean and Director of Studies in Philosophy and in Theology, Trinity Hall, Cambridge, and University Lecturer in Divinity, 1976-83.
F. D. Maurice Professor of Moral and Social Theology, University of London, 1983-1986.
Professor and Head of the Department of the History and Philosophy of Religion, University of London, 1986-1991.
Regius Professor of Divinity, University of Oxford, 1991- 2003.
Now Emeritus Student (i.e. Life Fellow) of Christ Church, Oxford.
Gresham Professor of Divinity, Gresham College, London, 2004 – 2008.
Professorial Research Fellow, Heythrop College, London, 2009 – 2019
Professor of Philosophy of Religion, Roehampton University, 2019 – 2021
Ordained priest in the Church of England. 1972.
Canon of Christ Church, Oxford, 1991 –.
Fellow of the British Academy 2000 –
Honorary Doctorate, Free University of Amsterdam, 2000.
Honorary Doctorate, University of Glasgow, 2007.
Honorary Doctorate, Virginia Theological Seminary, 2019
Honorary Fellow of Trinity Hall, Cambridge, and an Honorary Fellow of the University of Cardiff.
Former Member of Executive Council, Royal Institute of Philosophy.
Former Joint Editor of Religious Studies, Member of Editorial Boards of: Religious Studies,Journal of Contemporary Religion; Studies in Inter-Religious Dialogue; World Faiths Encounter.
Former President, World Congress of Faiths
I have been a visiting professor at Drake University, Iowa, at Claremont Graduate School, California, at the University of Tulsa, Oklahoma, at Cornell College, Iowa, at Hartford Seminary, and Virginia Theological Seminary.
Lectures
The Teape Lectures in Delhi, Bangalore and Calcutta, 1989.
The Edward Cadbury Lectures at the University of Birmingham, 1980.
The Selwyn Lectures in Auckland and Wellington, New Zealand, 1993.
The Gifford Lectures at the University of Glasgow, 1993-4.
I was Overseas Research Fellow of the South African Centre for Science Development, 1998.
Witherspoon Lecturer at Princeton, 2000.
Frank Woods fellow, University of Melbourne, 2003
John Albert Hall lecturer, University of Victoria, British Columbia, 2006
Hensley Henson lectures, University of Oxford, 2008
Senior Research Fellow, Metanexus Institute, Philadelphia, 2007-8
Sarum lectures, Salisbury, England, 2008
Robert Boyle lecture and medal, London, 2009
James Gregory lecture and medal, St. Andrews, 2009
Residential Fellow, Rockefeller Foundation, Bellagio, 2009
Fellow, Istituto Veneto di Science, Lettere ed Arti, 2010
Invited key-note speaker at:
Al Jazeera conference on science and faith, Doha, 2009
Irish Theological Society, Dublin, 2009
Rene Clavel Stiftung, Basel, on comparative theology, 2009
Virginia Theological Seminary and the National Cathedral Washington, 2009
Research Institute for Muslim Sciences, Istanbul, 2009
University of Western Australia and Perth Cathedral, 2009
Sigtuna Stiftelsen, Sweden, 2009
Istituto Veneto di Science, Lettere ed Arti, (Venice) May, 2010
Virginia Theological Seminary, Visiting Professor, Fall, 2010


# coding:utf-8
#
# PROGRAM/MODULE: firebird-driver
# FILE: firebird/driver/types.py
# DESCRIPTION: Types for Firebird driver
# CREATED: 4.3.2020
#
# The contents of this file are subject to the MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# Copyright (c) 2020 Firebird Project (www.firebirdsql.org)
# All Rights Reserved.
#
# Contributor(s): Pavel Císař (original code)
# ______________________________________
"""firebird-driver - Types for Firebird driver
"""
from __future__ import annotations
from typing import Tuple, List, Callable, Protocol, Union
import time
import datetime
import decimal
from pathlib import Path
from dataclasses import dataclass, field
from enum import Enum, IntEnum, IntFlag
from dateutil import tz
from firebird.base.types import Error
# Exceptions required by Python Database API 2.0
[docs]class InterfaceError(Error):
"""Exception raised for errors that are reported by the driver rather than
the Firebird itself.
"""
[docs]class DatabaseError(Error):
"""Exception raised for all errors reported by Firebird.
"""
#: Returned SQLSTATE or None
sqlstate: str = None
#: Returned SQLCODE or None
sqlcode: int = None
#: Tuple with all returned GDS error codes
gds_codes: Tuple[int] = ()
[docs]class DataError(DatabaseError):
"""Exception raised for errors that are due to problems with the processed
data like division by zero, numeric value out of range, etc.
Important:
This exceptions is never directly thrown by Firebird driver.
"""
[docs]class OperationalError(DatabaseError):
"""Exception raised for errors that are related to the database's operation
and not necessarily under the control of the programmer, e.g. an unexpected
disconnect occurs, the data source name is not found, a transaction could not
be processed, a memory allocation error occurred during processing, etc.
Important:
This exceptions is never directly thrown by Firebird driver.
"""
[docs]class IntegrityError(DatabaseError):
"""Exception raised when the relational integrity of the database is affected,
e.g. a foreign key check fails.
Important:
This exceptions is never directly thrown by Firebird driver.
"""
[docs]class InternalError(DatabaseError):
"""Exception raised when the database encounters an internal error, e.g. the
cursor is not valid anymore, the transaction is out of sync, etc.
Important:
This exceptions is never directly thrown by Firebird driver.
"""
[docs]class ProgrammingError(DatabaseError):
"""Exception raised for programming errors, e.g. table not found or already
exists, syntax error in the SQL statement, wrong number of parameters specified,
etc.
Important:
This exceptions is never directly thrown by Firebird driver.
"""
[docs]class NotSupportedError(DatabaseError):
"""Exception raised in case a method or database API was used which is not
supported by the database.
"""
# Firebird engine warning via Python Warning mechanism
[docs]class FirebirdWarning(UserWarning):
"""Warning from Firebird engine.
The important difference from `Warning` class is that `FirebirdWarning` accepts keyword
arguments, that are stored into instance attributes with the same name.
Important:
Attribute lookup on this class never fails, as all attributes that are not actually
set, have `None` value.
Example::
try:
if condition:
raise FirebirdWarning("Error message", err_code=1)
else:
raise FirebirdWarning("Unknown error")
except FirebirdWarning as e:
if e.err_code is None:
...
elif e.err_code == 1:
...
"""
def __init__(self, *args, **kwargs):
super().__init__(*args)
for name, value in kwargs.items():
setattr(self, name, value)
def __getattr__(self, name):
return None
# Enums
[docs]class NetProtocol(IntEnum):
"""Network protocol options available for connection.
"""
XNET = 1
INET = 2
INET4 = 3
WNET = 4
[docs]class DirectoryCode(IntEnum):
"""IConfigManager directory codes.
"""
DIR_BIN = 0
DIR_SBIN = 1
DIR_CONF = 2
DIR_LIB = 3
DIR_INC = 4
DIR_DOC = 5
DIR_UDF = 6
DIR_SAMPLE = 7
DIR_SAMPLEDB = 8
DIR_HELP = 9
DIR_INTL = 10
DIR_MISC = 11
DIR_SECDB = 12
DIR_MSG = 13
DIR_LOG = 14
DIR_GUARD = 15
DIR_PLUGINS = 16
DIR_TZDATA = 17 # >>> Firebird 4
[docs]class XpbKind(IntEnum):
"""Xpb builder kinds.
"""
DPB = 1
SPB_ATTACH = 2
SPB_START = 3
TPB = 4
# Firebird 4 amd 3.5.6+
BATCH = 5
BPB = 6
SPB_SEND = 7
SPB_RECEIVE = 8
SPB_RESPONSE = 9
[docs]class StateResult(IntEnum):
"""IState result codes.
"""
ERROR = -1
OK = 0
NO_DATA = 1
SEGMENT = 2
[docs]class PageSize(IntEnum):
"""Supported database page sizes.
"""
PAGE_4K = 4096
PAGE_8K = 8192
PAGE_16K = 16384
PAGE_32K = 32768 # Firebird 4
[docs]class DBKeyScope(IntEnum):
"""Scope of DBKey context.
"""
TRANSACTION = 0
ATTACHMENT = 1
[docs]class InfoItemType(IntEnum):
"""Data type of information item.
"""
BYTE = 1
INTEGER = 2
BIGINT = 3
BYTES = 4
RAW_BYTES = 5
STRING = 6
[docs]class SrvInfoCode(IntEnum):
"""Service information (isc_info_svc_*) codes.
"""
SRV_DB_INFO = 50
GET_CONFIG = 53
VERSION = 54
SERVER_VERSION = 55
IMPLEMENTATION = 56
CAPABILITIES = 57
USER_DBPATH = 58
GET_ENV = 59
GET_ENV_LOCK = 60
GET_ENV_MSG = 61
LINE = 62
TO_EOF = 63
TIMEOUT = 64
LIMBO_TRANS = 66
RUNNING = 67
GET_USERS = 68
AUTH_BLOCK = 69
STDIN = 78
[docs]class BlobInfoCode(IntEnum):
"""BLOB information (isc_info_blob_*) codes.
"""
NUM_SEGMENTS = 4
MAX_SEGMENT = 5
TOTAL_LENGTH = 6
TYPE = 7
[docs]class DbInfoCode(IntEnum):
"""Database information (isc_info_*) codes.
"""
DB_ID = 4
READS = 5
WRITES = 6
FETCHES = 7
MARKS = 8
IMPLEMENTATION_OLD = 11
VERSION = 12
BASE_LEVEL = 13
PAGE_SIZE = 14
NUM_BUFFERS = 15
LIMBO = 16
CURRENT_MEMORY = 17
MAX_MEMORY = 18
# Obsolete 19-20
ALLOCATION = 21
ATTACHMENT_ID = 22
READ_SEQ_COUNT = 23
READ_IDX_COUNT = 24
INSERT_COUNT = 25
UPDATE_COUNT = 26
DELETE_COUNT = 27
BACKOUT_COUNT = 28
PURGE_COUNT = 29
EXPUNGE_COUNT = 30
SWEEP_INTERVAL = 31
ODS_VERSION = 32
ODS_MINOR_VERSION = 33
NO_RESERVE = 34
# Obsolete 35-51
FORCED_WRITES = 52
USER_NAMES = 53
PAGE_ERRORS = 54
RECORD_ERRORS = 55
BPAGE_ERRORS = 56
DPAGE_ERRORS = 57
IPAGE_ERRORS = 58
PPAGE_ERRORS = 59
TPAGE_ERRORS = 60
SET_PAGE_BUFFERS = 61
DB_SQL_DIALECT = 62
DB_READ_ONLY = 63
DB_SIZE_IN_PAGES = 64
# Values 65 -100 unused to avoid conflict with InterBase
ATT_CHARSET = 101
DB_CLASS = 102
FIREBIRD_VERSION = 103
OLDEST_TRANSACTION = 104
OLDEST_ACTIVE = 105
OLDEST_SNAPSHOT = 106
NEXT_TRANSACTION = 107
DB_PROVIDER = 108
ACTIVE_TRANSACTIONS = 109
ACTIVE_TRAN_COUNT = 110
CREATION_DATE = 111
DB_FILE_SIZE = 112
PAGE_CONTENTS = 113
IMPLEMENTATION = 114
PAGE_WARNS = 115
RECORD_WARNS = 116
BPAGE_WARNS = 117
DPAGE_WARNS = 118
IPAGE_WARNS = 119
PPAGE_WARNS = 120
TPAGE_WARNS = 121
PIP_ERRORS = 122
PIP_WARNS = 123
PAGES_USED = 124
PAGES_FREE = 125
SES_IDLE_TIMEOUT_DB = 129 # Firebird 4
SES_IDLE_TIMEOUT_ATT = 130 # Firebird 4
SES_IDLE_TIMEOUT_RUN = 131 # Firebird 4
CONN_FLAGS = 132
CRYPT_KEY = 133
CRYPT_STATE = 134
# Firebird 4
STMT_TIMEOUT_DB = 135
STMT_TIMEOUT_ATT = 136
PROTOCOL_VERSION = 137
CRYPT_PLUGIN = 138
CREATION_TIMESTAMP_TZ = 139
WIRE_CRYPT = 140
FEATURES = 141
NEXT_ATTACHMENT = 142
NEXT_STATEMENT = 143
DB_GUID = 144
DB_FILE_ID = 145
REPLICA_MODE = 146
USER_NAME = 147
SQL_ROLE = 148
[docs]class Features(IntEnum):
"""Firebird features (Response to DbInfoCode.FEATURES).
"""
MULTI_STATEMENTS = 1 # Multiple prepared statements in single attachment
MULTI_TRANSACTIONS = 2 # Multiple concurrent transaction in single attachment
NAMED_PARAMETERS = 3 # Query parameters can be named
SESSION_RESET = 4 # ALTER SESSION RESET is supported
READ_CONSISTENCY = 5 # Read consistency TIL is supported
STATEMENT_TIMEOUT = 6 # Statement timeout is supported
STATEMENT_LONG_LIFE = 7 # Prepared statements are not dropped on transaction end
[docs]class ReplicaMode(IntEnum):
"""Replica modes. Response to DbInfoCode.REPLICA_MODE or as value for
DPBItem.SET_DB_REPLICA.
"""
NONE = 0
READ_ONLY = 1
READ_WRITE = 2
[docs]class StmtInfoCode(IntEnum):
"""Statement information (isc_info_sql_*) codes.
"""
SELECT = 4
BIND = 5
NUM_VARIABLES = 6
DESCRIBE_VARS = 7
DESCRIBE_END = 8
SQLDA_SEQ = 9
MESSAGE_SEQ = 10
TYPE = 11
SUB_TYPE = 12
SCALE = 13
LENGTH = 14
NULL_IND = 15
FIELD = 16
RELATION = 17
OWNER = 18
ALIAS = 19
SQLDA_START = 20
STMT_TYPE = 21
GET_PLAN = 22
RECORDS = 23
BATCH_FETCH = 24
RELATION_ALIAS = 25
EXPLAIN_PLAN = 26
FLAGS = 27
# Firebird 4
TIMEOUT_USER = 28
TIMEOUT_RUN = 29
BLOB_ALIGN = 30
# Firebird 5
EXEC_PATH_BLR_BYTES = 31
EXEC_PATH_BLR_TEXT = 32
class ResultSetInfoCode(IntEnum):
"""Result set information codes.
"""
RECORD_COUNT = 10
[docs]class TraInfoCode(IntEnum):
"""Transaction information (isc_info_tra_*) codes.
"""
ID = 4
OLDEST_INTERESTING = 5
OLDEST_SNAPSHOT = 6
OLDEST_ACTIVE = 7
ISOLATION = 8
ACCESS = 9
LOCK_TIMEOUT = 10
DBPATH = 11
SNAPSHOT_NUMBER = 12
[docs]class TraInfoIsolation(IntEnum):
"""Transaction isolation response.
"""
CONSISTENCY = 1
CONCURRENCY = 2
READ_COMMITTED = 3
[docs]class TraInfoReadCommitted(IntEnum):
"""Transaction isolation Read Committed response.
"""
NO_RECORD_VERSION = 0
RECORD_VERSION = 1
READ_CONSISTENCY = 2 # Firebird 4
[docs]class TraInfoAccess(IntEnum):
"""Transaction isolation access mode response.
"""
READ_ONLY = 0
READ_WRITE = 1
[docs]class TraAccessMode(IntEnum):
"""Transaction Access Mode TPB parameters.
"""
READ = 8
WRITE = 9
[docs]class TraIsolation(IntEnum):
"""Transaction Isolation TPB paremeters.
"""
CONSISTENCY = 1
CONCURRENCY = 2
READ_COMMITTED = 15
[docs]class TraReadCommitted(IntEnum):
"""Read Committed Isolation TPB paremeters.
"""
RECORD_VERSION = 17
NO_RECORD_VERSION = 18
[docs]class Isolation(IntEnum):
"""Transaction Isolation TPB parameters.
"""
READ_COMMITTED = -1
SERIALIZABLE = 1
SNAPSHOT = 2
READ_COMMITTED_NO_RECORD_VERSION = 3
READ_COMMITTED_RECORD_VERSION = 4
READ_COMMITTED_READ_CONSISTENCY = 5 # Firebird 4
# Aliases
REPEATABLE_READ = SNAPSHOT
CONCURRENCY = SNAPSHOT
CONSISTENCY = SERIALIZABLE
[docs]class TraLockResolution(IntEnum):
"""Transaction Lock resolution TPB parameters.
"""
WAIT = 6
NO_WAIT = 7
[docs]class TableShareMode(IntEnum):
"""Transaction table share mode TPB parameters.
"""
SHARED = 3
PROTECTED = 4
EXCLUSIVE = 5
[docs]class TableAccessMode(IntEnum):
"""Transaction Access Mode TPB parameters.
"""
LOCK_READ = 10
LOCK_WRITE = 11
[docs]class DefaultAction(IntEnum):
"""Default action when transaction is ended automatically.
"""
COMMIT = 1
ROLLBACK = 2
[docs]class StatementType(IntEnum):
"""Statement type.
"""
SELECT = 1
INSERT = 2
UPDATE = 3
DELETE = 4
DDL = 5
GET_SEGMENT = 6
PUT_SEGMENT = 7
EXEC_PROCEDURE = 8
START_TRANS = 9
COMMIT = 10
ROLLBACK = 11
SELECT_FOR_UPD = 12
SET_GENERATOR = 13
SAVEPOINT = 14
[docs]class SQLDataType(IntEnum):
"""SQL data type.
"""
TEXT = 452
VARYING = 448
SHORT = 500
LONG = 496
FLOAT = 482
DOUBLE = 480
D_FLOAT = 530
TIMESTAMP = 510
BLOB = 520
ARRAY = 540
QUAD = 550
TIME = 560
DATE = 570
INT64 = 580
TIMESTAMP_TZ_EX = 32748 # Firebird 4
TIME_TZ_EX = 32750 # Firebird 4
INT128 = 32752 # Firebird 4
TIMESTAMP_TZ = 32754 # Firebird 4
TIME_TZ = 32756 # Firebird 4
DEC16 = 32760 # Firebird 4
DEC34 = 32762 # Firebird 4
BOOLEAN = 32764
NULL = 32766
[docs]class DPBItem(IntEnum):
"""isc_dpb_* items (VERSION2).
"""
PAGE_SIZE = 4
NUM_BUFFERS = 5
DBKEY_SCOPE = 13
NO_GARBAGE_COLLECT = 16
SWEEP_INTERVAL = 22
FORCE_WRITE = 24
NO_RESERVE = 27
USER_NAME = 28
PASSWORD = 29
LC_CTYPE = 48
RESERVED = 53
OVERWRITE = 54
CONNECT_TIMEOUT = 57
DUMMY_PACKET_INTERVAL = 58
SQL_ROLE_NAME = 60
SET_PAGE_BUFFERS = 61
WORKING_DIRECTORY = 62
SQL_DIALECT = 63
SET_DB_READONLY = 64
SET_DB_SQL_DIALECT = 65
SET_DB_CHARSET = 68
ADDRESS_PATH = 70
PROCESS_ID = 71
NO_DB_TRIGGERS = 72
TRUSTED_AUTH = 73
PROCESS_NAME = 74
TRUSTED_ROLE = 75
ORG_FILENAME = 76
UTF8_FILENAME = 77
EXT_CALL_DEPTH = 78
AUTH_BLOCK = 79
CLIENT_VERSION = 80
REMOTE_PROTOCOL = 81
HOST_NAME = 82
OS_USER = 83
SPECIFIC_AUTH_DATA = 84
AUTH_PLUGIN_LIST = 85
AUTH_PLUGIN_NAME = 86
CONFIG = 87
NOLINGER = 88
RESET_ICU = 89
MAP_ATTACH = 90
# Firebird 4
SESSION_TIME_ZONE = 91
SET_DB_REPLICA = 92
SET_BIND = 93
DECFLOAT_ROUND = 94
DECFLOAT_TRAPS = 95
CLEAR_MAP = 96
# Firebird 5
UPGRADE_DB = 97
PARALLEL_WORKERS = 100
WORKER_ATTACH = 101
[docs]class TPBItem(IntEnum):
"""isc_tpb_* items.
"""
VERSION3 = 3
IGNORE_LIMBO = 14
AUTOCOMMIT = 16
NO_AUTO_UNDO = 20
LOCK_TIMEOUT = 21
# Firebird 4
READ_CONSISTENCY = 22
AT_SNAPSHOT_NUMBER = 23
[docs]class SPBItem(IntEnum):
"""isc_spb_* items.
"""
USER_NAME = 28
PASSWORD = 29
CONNECT_TIMEOUT = 57
DUMMY_PACKET_INTERVAL = 58
SQL_ROLE_NAME = 60
COMMAND_LINE = 105
DBNAME = 106
VERBOSE = 107
OPTIONS = 108
TRUSTED_AUTH = 111
TRUSTED_ROLE = 113
VERBINT = 114
AUTH_BLOCK = 115
AUTH_PLUGIN_NAME = 116
AUTH_PLUGIN_LIST = 117
UTF8_FILENAME = 118
CONFIG = 123
EXPECTED_DB = 124
[docs]class BPBItem(IntEnum):
"""isc_bpb_* items.
"""
SOURCE_TYPE = 1
TARGET_TYPE = 2
TYPE = 3
SOURCE_INTERP = 4
TARGET_INTERP = 5
FILTER_PARAMETER = 6
STORAGE = 7
[docs]class BlobType(IntEnum):
"""Blob type.
"""
SEGMENTED = 0x0
STREAM = 0x1
[docs]class BlobStorage(IntEnum):
"""Blob storage.
"""
MAIN = 0x0
TEMP = 0x2
[docs]class ServerAction(IntEnum):
"""isc_action_svc_* items.
"""
BACKUP = 1
RESTORE = 2
REPAIR = 3
ADD_USER = 4
DELETE_USER = 5
MODIFY_USER = 6
DISPLAY_USER = 7
PROPERTIES = 8
DB_STATS = 11
GET_FB_LOG = 12
NBAK = 20
NREST = 21
TRACE_START = 22
TRACE_STOP = 23
TRACE_SUSPEND = 24
TRACE_RESUME = 25
TRACE_LIST = 26
SET_MAPPING = 27
DROP_MAPPING = 28
DISPLAY_USER_ADM = 29
VALIDATE = 30
NFIX = 31 # Firebird 4
[docs]class SrvDbInfoOption(IntEnum):
"""Parameters for SvcInfoCode.SRV_DB_INFO.
"""
ATT = 5
DB = 6
[docs]class SrvRepairOption(IntEnum):
"""Parameters for ServerAction.REPAIR.
"""
COMMIT_TRANS = 15
ROLLBACK_TRANS = 34
RECOVER_TWO_PHASE = 17
TRA_ID = 18
SINGLE_TRA_ID = 19
MULTI_TRA_ID = 20
TRA_STATE = 21
TRA_STATE_LIMBO = 22
TRA_STATE_COMMIT = 23
TRA_STATE_ROLLBACK = 24
TRA_STATE_UNKNOWN = 25
TRA_HOST_SITE = 26
TRA_REMOTE_SITE = 27
TRA_DB_PATH = 28
TRA_ADVISE = 29
TRA_ADVISE_COMMIT = 30
TRA_ADVISE_ROLLBACK = 31
TRA_ADVISE_UNKNOWN = 33
TRA_ID_64 = 46
SINGLE_TRA_ID_64 = 47
MULTI_TRA_ID_64 = 48
COMMIT_TRANS_64 = 49
ROLLBACK_TRANS_64 = 50
RECOVER_TWO_PHASE_64 = 51
PARALLEL_WORKERS = 52 # Firebird 5
[docs]class SrvBackupOption(IntEnum):
"""Parameters for ServerAction.BACKUP.
"""
FILE = 5
FACTOR = 6
LENGTH = 7
SKIP_DATA = 8
STAT = 15
# Firebird 4
KEYHOLDER = 16
KEYNAME = 17
CRYPT = 18
INCLUDE_DATA = 19
PARALLEL_WORKERS = 21 # Firebird 5
[docs]class SrvRestoreOption(IntEnum):
"""Parameters for ServerAction.RESTORE.
"""
FILE = 5
SKIP_DATA = 8
BUFFERS = 9
PAGE_SIZE = 10
LENGTH = 11
ACCESS_MODE = 12
FIX_FSS_DATA = 13
FIX_FSS_METADATA = 14
STAT = 15
# Firebird 4
KEYHOLDER = 16
KEYNAME = 17
CRYPT = 18
INCLUDE_DATA = 19
REPLICA_MODE = 20
PARALLEL_WORKERS = 21 # Firebird 5
[docs]class SrvNBackupOption(IntEnum):
"""Parameters for ServerAction.NBAK.
"""
LEVEL = 5
FILE = 6
DIRECT = 7
GUID = 8 # Firebird 4
# Firebird 5
CLEAN_HISTORY = 9
KEEP_DAYS = 10
KEEP_ROWS = 11
[docs]class SrvTraceOption(IntEnum):
"""Parameters for ServerAction.TRACE_*.
"""
ID = 1
NAME = 2
CONFIG = 3
[docs]class SrvPropertiesOption(IntEnum):
"""Parameters for ServerAction.PROPERTIES.
"""
PAGE_BUFFERS = 5
SWEEP_INTERVAL = 6
SHUTDOWN_DB = 7
DENY_NEW_ATTACHMENTS = 9
DENY_NEW_TRANSACTIONS = 10
RESERVE_SPACE = 11
WRITE_MODE = 12
ACCESS_MODE = 13
SET_SQL_DIALECT = 14
FORCE_SHUTDOWN = 41
ATTACHMENTS_SHUTDOWN = 42
TRANSACTIONS_SHUTDOWN = 43
SHUTDOWN_MODE = 44
ONLINE_MODE = 45
REPLICA_MODE = 46 # Firebird 4
[docs]class SrvValidateOption(IntEnum):
"""Parameters for ServerAction.VALIDATE.
"""
INCLUDE_TABLE = 1
EXCLUDE_TABLE = 2
INCLUDE_INDEX = 3
EXCLUDE_INDEX = 4
LOCK_TIMEOUT = 5
[docs]class SrvUserOption(IntEnum):
"""Parameters for ServerAction.ADD_USER|DELETE_USER|MODIFY_USER|DISPLAY_USER.
"""
USER_ID = 5
GROUP_ID = 6
USER_NAME = 7
PASSWORD = 8
GROUP_NAME = 9
FIRST_NAME = 10
MIDDLE_NAME = 11
LAST_NAME = 12
ADMIN = 13
[docs]class DbAccessMode(IntEnum):
"""Values for isc_spb_prp_access_mode.
"""
READ_ONLY = 39
READ_WRITE = 40
[docs]class DbSpaceReservation(IntEnum):
"""Values for isc_spb_prp_reserve_space.
"""
USE_FULL = 35
RESERVE = 36
[docs]class DbWriteMode(IntEnum):
"""Values for isc_spb_prp_write_mode.
"""
ASYNC = 37
SYNC = 38
[docs]class ShutdownMode(IntEnum):
"""Values for isc_spb_prp_shutdown_mode.
"""
NORMAL = 0
MULTI = 1
SINGLE = 2
FULL = 3
[docs]class OnlineMode(IntEnum):
"""Values for isc_spb_prp_online_mode.
"""
NORMAL = 0
MULTI = 1
SINGLE = 2
[docs]class ShutdownMethod(IntEnum):
"""Database shutdown method options.
"""
FORCED = 41
DENY_ATTACHMENTS = 42
DENY_TRANSACTIONS = 43
[docs]class TransactionState(IntEnum):
"""Transaction state.
"""
UNKNOWN = 0
COMMIT = 1
ROLLBACK = 2
LIMBO = 3
[docs]class DbProvider(IntEnum):
"""Database Providers.
"""
RDB_ELN = 1
RDB_VMS = 2
INTERBASE = 3
FIREBIRD = 4
[docs]class DbClass(IntEnum):
"""Database Classes.
"""
UNKNOWN = 0
ACCESS = 1
Y_VALVE = 2
REM_INT = 3
REM_SRVR = 4
PIPE_INT = 7
PIPE_SRVR = 8
SAM_INT = 9
SAM_SRVR = 10
GATEWAY = 11
CACHE = 12
CLASSIC_ACCESS = 13
SERVER_ACCESS = 14
[docs]class Implementation(IntEnum):
"""Implementation - Legacy format.
"""
RDB_VMS = 1
RDB_ELN = 2
RDB_ELN_DEV = 3
RDB_VMS_Y = 4
RDB_ELN_Y = 5
JRI = 6
JSV = 7
ISC_APL_68K = 25
ISC_VAX_ULTR = 26
ISC_VMS = 27
ISC_SUN_68K = 28
ISC_OS2 = 29
ISC_SUN4 = 30
ISC_HP_UX = 31
ISC_SUN_386I = 32
ISC_VMS_ORCL = 33
ISC_MAC_AUX = 34
ISC_RT_AIX = 35
ISC_MIPS_ULT = 36
ISC_XENIX = 37
ISC_DG = 38
ISC_HP_MPEXL = 39
ISC_HP_UX68K = 40
ISC_SGI = 41
ISC_SCO_UNIX = 42
ISC_CRAY = 43
ISC_IMP = 44
ISC_DELTA = 45
ISC_NEXT = 46
ISC_DOS = 47
M88K = 48
UNIXWARE = 49
ISC_WINNT_X86 = 50
ISC_EPSON = 51
ALPHA_OSF = 52
ALPHA_VMS = 53
NETWARE_386 = 54
WIN_ONLY = 55
NCR_3000 = 56
WINNT_PPC = 57
DG_X86 = 58
SCO_EV = 59
I386 = 60
FREEBSD = 61
NETBSD = 62
DARWIN_PPC = 63
SINIXZ = 64
LINUX_SPARC = 65
LINUX_AMD64 = 66
FREEBSD_AMD64 = 67
WINNT_AMD64 = 68
LINUX_PPC = 69
DARWIN_X86 = 70
LINUX_MIPSEL = 71
LINUX_MIPS = 72
DARWIN_X64 = 73
SUN_AMD64 = 74
LINUX_ARM = 75
LINUX_IA64 = 76
DARWIN_PPC64 = 77
LINUX_S390X = 78
LINUX_S390 = 79
LINUX_SH = 80
LINUX_SHEB = 81
LINUX_HPPA = 82
LINUX_ALPHA = 83
LINUX_ARM64 = 84
LINUX_PPC64EL = 85
LINUX_PPC64 = 86
LINUX_M68K = 87
LINUX_RISCV64 = 88
FREEBSD_PPC64EL = 89
LINUX_MIPS64EL = 90
FREEBSD_PPC64 = 91
FREEBSD_PPC = 92
[docs]class ImpCPU(IntEnum):
"""Implementation - CPU.
"""
INTEL386 = 0
AMD_INTEL_X64 = 1
ULTRA_SPARC = 2
POWER_PC = 3
POWER_PC64 = 4
MIPSEL = 5
MIPS = 6
ARM = 7
IA64 = 8
S390 = 9
S390X = 10
SH = 11
SHEB = 12
HPPA = 13
ALPHA = 14
ARM64 = 15
POWER_PC64EL = 16
M68K = 17
[docs]class ImpOS(IntEnum):
"""Implementation - CPU.
"""
WINDOWS = 0
LINUX = 1
DARWIN = 2
SOLARIS = 3
HPUX = 4
AIX = 5
MMS = 6
FREE_BSD = 7
NET_BSD = 8
[docs]class ImpCompiler(IntEnum):
"""Implementation - Compiler.
"""
MSVC = 0
GCC = 1
XLC = 2
ACC = 3
SUN_STUDIO = 4
ICC = 5
[docs]class CancelType(IntEnum):
"""Cancel types for `Connection.cancel_operation()`
"""
DISABLE = 1
ENABLE = 2
RAISE = 3
ABORT = 4
[docs]class DecfloatRound(Enum):
"""DECFLOAT ROUND options.
"""
CEILING = 'CEILING'
UP = 'UP'
HALF_UP = 'HALF_UP'
HALF_EVEN = 'HALF_EVEN'
HALF_DOWN = 'HALF_DOWN'
DOWN = 'DOWN'
FLOOR = 'FLOOR'
REROUND = 'REROUND'
[docs]class DecfloatTraps(Enum):
"""DECFLOAT TRAPS options.
"""
DIVISION_BY_ZERO = 'Division_by_zero'
INEXACT = 'Inexact'
INVALID_OPERATION = 'Invalid_operation'
OVERFLOW = 'Overflow'
UNDERFLOW = 'Underflow'
# Flags
[docs]class StateFlag(IntFlag):
"""IState flags.
"""
NONE = 0
WARNINGS = 1
ERRORS = 2
[docs]class PreparePrefetchFlag(IntFlag):
"""Flags for Statement Prefetch.
"""
NONE = 0
TYPE = 1
INPUT_PARAMETERS = 2
OUTPUT_PARAMETERS = 4
LEGACY_PLAN = 8
DETAILED_PLAN = 16
AFFECTED_RECORDS = 32
FLAGS = 64
METADATA = TYPE | FLAGS | INPUT_PARAMETERS | OUTPUT_PARAMETERS
ALL = METADATA | LEGACY_PLAN | DETAILED_PLAN | AFFECTED_RECORDS
[docs]class StatementFlag(IntFlag):
"""Statement flags.
"""
NONE = 0
HAS_CURSOR = 1
REPEAT_EXECUTE = 2
[docs]class CursorFlag(IntFlag):
"""Cursor flags.
"""
NONE = 0
SCROLLABLE = 1
[docs]class ConnectionFlag(IntFlag):
"""Flags returned for DbInfoCode.CONN_FLAGS.
"""
NONE = 0
COMPRESSED = 0x01
ENCRYPTED = 0x02
[docs]class EncryptionFlag(IntFlag):
"""Crypto status (Response to DbInfoCode.CRYPT_STATE).
"""
ENCRYPTED = 0x01
PROCESS = 0x02
[docs]class ServerCapability(IntFlag):
"""Server capabilities (returned by isc_info_svc_capabilities).
"""
NONE = 0
WAL = 0b00000000001
MULTI_CLIENT = 0b00000000010
REMOTE_HOP = 0b00000000100
NO_SRV_STATS = 0b00000001000
NO_DB_STATS = 0b00000010000
LOCAL_ENGINE = 0b00000100000
NO_FORCED_WRITE = 0b00001000000
NO_SHUTDOWN = 0b00010000000
NO_SERVER_SHUTDOWN = 0b00100000000
SERVER_CONFIG = 0b01000000000
QUOTED_FILENAME = 0b10000000000
[docs]class SrvRepairFlag(IntFlag):
"""isc_spb_rpr_* flags for ServerAction.REPAIR.
"""
VALIDATE_DB = 0x01
SWEEP_DB = 0x02
MEND_DB = 0x04
LIST_LIMBO_TRANS = 0x08
CHECK_DB = 0x10
IGNORE_CHECKSUM = 0x20
KILL_SHADOWS = 0x40
FULL = 0x80
ICU = 0x0800
UPGRADE_DB = 0x1000 # Firebird 5
#
CORRUPTION_CHECK = VALIDATE_DB | CHECK_DB | FULL | IGNORE_CHECKSUM
REPAIR = MEND_DB | FULL | IGNORE_CHECKSUM
[docs]class SrvStatFlag(IntFlag):
"""isc_spb_sts_* flags for ServerAction.DB_STATS.
"""
NONE = 0
DATA_PAGES = 0x01
DB_LOG = 0x02
HDR_PAGES = 0x04
IDX_PAGES = 0x08
SYS_RELATIONS = 0x10
RECORD_VERSIONS = 0x20
NOCREATION = 0x80
ENCRYPTION = 0x100
DEFAULT = DATA_PAGES | IDX_PAGES
[docs]class SrvBackupFlag(IntFlag):
"""isc_spb_bkp_* flags for ServerAction.BACKUP.
"""
NONE = 0
IGNORE_CHECKSUMS = 0x01
IGNORE_LIMBO = 0x02
METADATA_ONLY = 0x04
NO_GARBAGE_COLLECT = 0x08
OLD_DESCRIPTIONS = 0x10
NON_TRANSPORTABLE = 0x20
CONVERT = 0x40
EXPAND = 0x80
NO_TRIGGERS = 0x8000
ZIP = 0x010000 # Firebird 4
DIRECT_IO = 0x020000 # Firebird 5
[docs]class SrvRestoreFlag(IntFlag):
"""isc_spb_res_* flags for ServerAction.RESTORE.
"""
METADATA_ONLY = 0x04
DEACTIVATE_IDX = 0x0100
NO_SHADOW = 0x0200
NO_VALIDITY = 0x0400
ONE_AT_A_TIME = 0x0800
REPLACE = 0x1000
CREATE = 0x2000
USE_ALL_SPACE = 0x4000
NO_TRIGGERS = 0x8000
DIRECT_IO = 0x020000 # Firebird 5
[docs]class SrvNBackupFlag(IntFlag):
"""isc_spb_nbk_* flags for ServerAction.NBAK.
"""
NONE = 0
NO_TRIGGERS = 0x01
# Firebird 4
IN_PLACE = 0x02
SEQUENCE = 0x04
[docs]class SrvPropertiesFlag(IntFlag):
"""isc_spb_prp_* flags for ServerAction.PROPERTIES.
"""
ACTIVATE = 0x0100
DB_ONLINE = 0x0200
NOLINGER = 0x0400
[docs]class ImpFlags(IntFlag):
"""Implementation - Endianness.
"""
LITTLE_ENDIAN = 0
BIG_ENDIAN = 1
# Dataclasses
[docs]@dataclass
class TableAccessStats:
"""Table access statistics.
Data structure returned by `.Connection.get_table_access_stats()`.
Attributes:
table_id (int): Relation ID
sequential (int): Number of sequential table scans (row reads)
indexed (int): Number of reads done via an index
inserts (int): Number of inserts
updates (int): Number of updates
deletes (int): Number of deleted
backouts (int): Number of removals of a version of a record
purges (int): Number of removals of old versions of fully mature records (records that
are committed, so that older ancestor versions are no longer needed)
expunges (int): Number of removals of a record and all of its ancestors, for records
whose deletions have been committed
"""
table_id: int
sequential: int = None
indexed: int = None
inserts: int = None
updates: int = None
deletes: int = None
backouts: int = None
purges: int = None
expunges: int = None
[docs]@dataclass
class UserInfo:
"""Information about Firebird user.
Data structure returned by `.Service.get_user()` and `.Service.get_users()`.
Attributes:
user_name (str): User (login) name
password (str): User password
first_name (str): First name
middle_name (str): Middle name
last_name (str): Last name
user_id (int): User ID
group_id (int): User Group ID
group_name (str): Group name
admin (bool): True is user has admin priviledges
"""
user_name: str
password: str = None
first_name: str = None
middle_name: str = None
last_name: str = None
user_id: int = None
group_id: int = None
group_name: str = None
admin: bool = None
[docs]@dataclass
class BCD:
"""BCD number.
Attributes:
sign (int): Sign
number (bytes): Number
exp (int): Exponent
"""
sign: int
number: bytes
exp: int
[docs]@dataclass
class TraceSession:
"""Information about active trace session.
Attributes:
id (int): Session ID number
user (str): User name
timestamp (datetime.datetime): Session start timestamp
name (str): Session name (if defined)
flags (list): List with session flag names
"""
id: int
user: str
timestamp: datetime.datetime
name: str = ''
flags: List = field(default_factory=list)
# Constants required by Python DB API 2.0 specification
#: String constant stating the supported DB API level.
apilevel: str = '2.0'
#: Integer constant stating the level of thread safety the interface supports.
#: Curretly `1` = Threads may share the module, but not connections.
threadsafety: int = 1
#: String constant stating the type of parameter marker formatting expected by
#: the interface. `'qmark'` = Question mark style, e.g. '...WHERE name=?'
paramstyle: str = 'qmark'
# Named positional constants to be used as indices into the description
# attribute of a cursor.
DESCRIPTION_NAME = 0
DESCRIPTION_TYPE_CODE = 1
DESCRIPTION_DISPLAY_SIZE = 2
DESCRIPTION_INTERNAL_SIZE = 3
DESCRIPTION_PRECISION = 4
DESCRIPTION_SCALE = 5
DESCRIPTION_NULL_OK = 6
# Types Required by Python DB-API 2.0
#: This callable constructs an object holding a date value.
Date = datetime.date
#: This callable constructs an object holding a time value.
Time = datetime.time
#: This callable constructs an object holding a time stamp value.
Timestamp = datetime.datetime
[docs]def DateFromTicks(ticks: float) -> Date: # pragma: no cover
"""Constructs an object holding a date value from the given ticks value
(number of seconds since the epoch).
"""
return Date(time.localtime(ticks)[:3])
[docs]def TimeFromTicks(ticks: float) -> Time: # pragma: no cover
"""Constructs an object holding a time value from the given ticks value
(number of seconds since the epoch).
"""
return Time(time.localtime(ticks)[3:6])
[docs]def TimestampFromTicks(ticks: float) -> Timestamp: # pragma: no cover
"""Constructs an object holding a time stamp value from the given ticks value
(number of seconds since the epoch).
"""
return Timestamp(time.localtime(ticks)[:6])
#: This callable constructs an object capable of holding a binary (long) string value.
Binary = memoryview
class DBAPITypeObject:
"""Python DB API 2.0 - type support.
"""
def __init__(self, *values):
self.values = values
def __cmp__(self, other): # pragma: no cover
if other in self.values:
return 0
if other < self.values:
return 1
return -1
#: This type object is used to describe columns in a database that are string-based (e.g. CHAR).
STRING = DBAPITypeObject(str)
#: This type object is used to describe (long) binary columns in a database (e.g. LONG, RAW, BLOBs).
BINARY = DBAPITypeObject(bytes, bytearray)
#: This type object is used to describe numeric columns in a database.
NUMBER = DBAPITypeObject(int, float, decimal.Decimal)
#: This type object is used to describe date/time columns in a database.
DATETIME = DBAPITypeObject(datetime.datetime, datetime.date, datetime.time)
#: This type object is used to describe the "Row ID" column in a database.
ROWID = DBAPITypeObject()
# Types for type hints
#: DB API 2.0 Cursor DESCRIPTION
DESCRIPTION = Tuple[str, type, int, int, int, int, bool]
#: Callback that accepts line of text output
CB_OUTPUT_LINE = Callable[[str], None]
#: File name (incl. path) specification
FILESPEC = Union[str, Path]
[docs]class Transactional(Protocol): # pragma: no cover
"""Protocol type for object that supports transactional processing."""
[docs] def begin(self, tpb: bytes = None) -> None:
"""Begin transaction.
"""
[docs] def commit(self, *, retaining: bool = False) -> None:
"""Commit transaction.
"""
[docs] def rollback(self, *, retaining: bool = False, savepoint: str = None) -> None:
"""Rollback transaction.
"""
[docs] def is_active(self) -> bool:
"""Returns True if transaction is active.
"""
# timezone
[docs]def get_timezone(timezone: str=None) -> datetime.tzinfo:
"""Returns `datetime.tzinfo` for specified time zone.
This is preferred method to obtain timezone information for construction of timezone-aware
`datetime.datetime` and `datetime.time` objects. Current implementation uses `dateutil.tz`
for timezone tzinfo objects, but adds metadata neccessary to store timezone regions into
database instead zoned time, and to handle offset-based timezones in format required by
Firebird.
"""
if timezone[0] in ('+', '-'):
timezone = 'UTC' + timezone
result = tz.gettz(timezone)
if result is not None and not hasattr(result, '_timezone_'):
setattr(result, '_timezone_', timezone[3:] if timezone.startswith('UTC') and len(timezone) > 3 else timezone)
return result