Mixture of multiple choice (30-35), free response (1-3) and VSCode (10-15) problems.
Free response just requires enough detail to answer the question, 1-3 sentences. As long as you are able to explain the concept and answer all aspects that it asks, you are good.
Coding problems come in two varieties:
Some will have specs to run (npm test) and check your work against (the AJAX project from Tuesday is good practice)
Some will have an HTML file with specific instructions for CSS rules to apply to achieve the desired styling, as well as some pictures to compare to (the practice assessment is a good example)
Standard assessment procedures
You will be in an individual breakout room
Use a single monitor and share your screen
Only have open those resources needed to complete the assessment:
Zoom
VSCode
Browser with AAO and Progress Tracker (to ask questions)
The first selector is more specific and any conflicting styles would have these styles take precedence.
Both selectors have one ID, so we continue evaluating. Since the first selector has more classes, it is considered more specific.
Describe and apply element, id, and class selectors
In order to target elements to apply styles in our css, we can utilize the element tag, id, or class selectors to make our selection as general or as specific as we'd like.
Element: To select an element by tag name, we can simply use that name before our style:
Using ul > li will apply styles to the li with "First" and "Second", but not the nested lis.
Using ul li will apply styles to all four lis because it will target all descendents, not just direct children.
Multiple items selection: comma deliniated selectors. We can apply the same styles to multiple elements by separating our selectors with commas.
body, div, p, span, ul, li
Explain and apply pseudo selectors for specific elements in specific states (i.e. :hover)
Pseudo selectors allow us to provide styling rules conditionally, based on the state of an element.
The :hover selector, for example, will apply the styles if the user's cursor is on top of the element.
In the below example, by hovering over the link, the color and font changes on the text and a border is applied. When the user moves their cursor off of the link, the :hover styles are no longer applied and it goes back to the styling associated with the standard a tag.
Some general font families: [ sans-serif, serif, cursive ]
Text transformation and alignment
text-transform : text casing
text-decoration : underlining
text-align : text justification (left, right, etc.)
Colors expresssed as names, hexadecimal RGB values, and decimal RGB values
The color css property changes the color of the text.
The background-color css property does just what it says
We can use some keyword color names as values (blue, green, aqua, rebeccapurple, etc.)
We can also use hexadecimal values such as #FFFFFF (white). The hexadecimal values are the rgb values with each group of two digits representing the 0-255 range for red, green, and blue.
rgb() - takes in 3 integer values denoting levels of red, green and blue, with ranges of 0-255 each.
rgba() - Same as above but with additional argument (the 'a', or 'alpha' value) which represents how transparent the color will be (on a scale of 0-1, with 0 being completely transparent and 1 being opaque).
Everything about borders
The border property takes in three arguments:
thickness: typically in pixels, how wide should the border be?
line style: possible values include 'solid', 'dotted', 'dashed', etc.
line color: what color the line should be, using any of the notations above
Shadows
Can be of two types, text or box.
The first two required arguments are the horizontal and vertical offset
An optional 'blur' argument to specify a radius for fading the shadow
An optional 'spread' argument (for box shadows) for adjusting the size of the shadow (positive makes the shadow larger, negative makes it smaller)
An optional 'color' argument for changing the color
An optional flag to make the shadow 'inset' instead of the default outset
Opacity (transparency)
Changes the overall transparency of an element.
Just like with rgba when defining a color, opacity takes an alpha value from 0 to 1, with 0 being completely transparent (not visible) and 1 (the default) being opaque.
Covering an element with a background image
We can use the background-image property, setting it's value to the url of a desired image.
We can point the url to an absolute path, such as an outside resource, or a relative location within our application
The background-size property will help us tell the browser how we want to scale/crop the image to fill the space.
contain will scale the image to the bounds of the container, potentially leaving some whitespace either vertically or horizontally so that the full image is seen
cover will scale the image but will completely fill the container, potentially cropping some portion of the image so that there is no whitespace
We can also specify percentages or units such as pixels that we would like the image to take up.
MDN has great examples of all of these options: https://developer.mozilla.org/en-US/docs/Web/CSS/background-size
Explain the generic font names "serif", "sans-serif", and "monospace" and correctly identify examples of each
These generic font names tell the browser and OS what generic category of font should be use without being as specific as one particular font. This can help to ensure that the basic style of the site is maintained across different platforms if we don't need to specify an exact font that we want to use.
"Serif" fonts have the widenings at the end of the letters. A classic example is Times New Roman.
"Sans-serif" fonts do not have serifs. The ends of the letters end with straight edges. This could be desirable in computing because small details like serifs could potentially be lost or display differently based on different screen sizes. Helvetica is an example of a sans-serif font.
"Monospace" fonts have all characters taking up the exact same width. Sometimes referred to as typewriter fonts because each character stamped with a typewriter had to line up exactly (since the page moved a set amount for each character). Courier is an example of a monospaced font.
Explain why using Web fonts helps with consistent experience across viewing devices:
Using web fonts is great because it allows for browser compatibility.
By downloading the font from an external resource and importing it into the styling, you are not relying on the browser to either have or not have the font available.
Explain absolute and relative length units in CSS
There are a very large number of units that we can use in CSS.
Absolute units are measurements independent of the user's window, other elements, etc. They are based off of real-world measurements.
Relative units are based off of other objects, like the window (vh or vw), line height (lh), root element (rem), etc.
An exhaustive list: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Values_and_Units
Some commonly used examples:
Relative :
rem - relative to root
em - relative to parent
vh - viewport height
vw - viewport width
Absolute Measure :
px pixel
pt point
cm centimeter
Demonstrate how to link a stylesheet into an HTML page
We can link to outside resources such as CSS stylesheets using the HTML link tag.
The link element has to have the rel (relationship) and href (hypertext reference) attributes configured to indicate that this resource is a stylesheet and where it is coming from (a relative or absolute reference):
Be able to calculate the specificity of CSS rules and determine which rule override the properties of another
See LO #2: Explain how CSS rules are applied based on their order and specificity
In general, specificity is determined by comparing the number of selectors associated with each category left to right until no tie exists: IDs, classes, element tags
If there is still a tie, the last defined rule (lower in the file) is considered the most specific
Specificity is used to determine which styles take presedence if there is a conflict. If there is no conflict, both styles are applied.
Use the content CSS property to define the content of an element
See LO #6: Explain and apply the ::before and ::after pseudo elements, & Use the content CSS property to define the content of an element
content lets us inject content into those pseudo elements, but if we wanted to adjust the content of an element that already exists within the HTML, we would want to use JavaScript, such as by changing its innerHTML property.
AJAX (Asynchronous JavaScript and XML) (W09D2) - Learning Objectives
AJAX
Explain what an AJAX request is
An AJAX request is an asynchronous request that we send in order to get a response in the form of data from a server.
Typically this response is in JSON, but previously was common to work with XML.
The main difference between this approach and a traditional request is that the server is no longer responsible for updating the HTML and sending the whole page back; it sends the new/requested data and the JavaScript on the front end can change the HTML displayed directly within the browser.
We shift a lot of the processing on to the individual user.
Identifying the advantages of using an AJAX request.
We don't have to refresh the entire HTML page.
It's a smaller amount of data that needs to be transferred.
We can push the processing and recreation of HTML elements on to the user.
This may not have been desired at the beginning of the internet with slow personal machines, but not even smaller connected machines like tablets and phones have plenty of processing power to do these tasks and alleviates the load on the servers.
Identify what the acronym AJAX means and how it relates to modern Web programming
Asynchronous JavaScript and XML
Asynchronous: We don't lock up the page when we are waiting on a response. We are still able to interact and the response's data will be handled whenever it returns.
JavaScript: The engine behind AJAX. We use JavaScript to make the request to the server, then we also use it to process the response and make any updates to the DOM that are needed based on this new data.
XML: The original format of the data that was sent back on the response. Nowadays we will almost always be using JSON as the format.
Describe the different steps in an AJAX request/response cycle
An event listener is set up to wait for an specific action that will trigger a request to our server. Clicking on a button or submitting a form would be a popular example.
When the event is triggered, we use JavaScript to formulate an appropriate request to a server. In our project we used fetch in order to send a request to a specific route on our server, along with an options object to indicate the methods, headers, etc., that differ from the default values, a body with necessary data, etc..
The request is sent asynchronously to the server. The user is still able to interact with our application since the request is not blocking the call stack.
The server receives the request and does whatever it needs to do on its end to create/read/update/destroy data related to the request. After it performs the requested action, it creates a response and sends it back to the client. This is almost always going to be in a JSON format.
The client receives the response and is able to parse the data and do any updates that it needs to do to the DOM. In our project, we used a .then on our call to fetch, which allowed us to then convert the response's JSON into a usable POJO when the response came back. The data inside of this object is then accessible and used to manipulate the DOM.
Fully use the fetch API to make dynamic Web pages without refreshing the page
Look over the AJAX project Catstagram. Be comfortable with creating many different request types, such as GET, PATCH, POST, and DELETE.
Be comfortable with using both the .then promise chains that we used in the project as well as how we could convert them into an async/await format:
Media Queries, Positioning, and Layouts (W09D3) - Learning Objectives
Media Queries
Identify the different types of media that a media query can target:
all - we are not distinguishing between the following (this is default)
print - i.e. anytime a document is set to print mode, with intention of printing.
screen - phones, tablets, computers, smart devices, etc.
speech - for use with speech synthesizers
Explain how the media features (and prefixed subfeatures) of "aspect ratio", "height", "orientation", and "width" are applied
We can specify the media features that we want to trigger our styles being applied. They can be thought of as conditionals that, if true, will apply additional styles (or overwrite previously applied styles).
To indicate a media feature that we would like to specify, we place it in parentheses after our @media keyword. We can combine multiple features and even include the media type by using the and operator:
aspect-ratio: The ratio of width-to-height of the user's viewport (for example, a window that is 1600 pixels wide and 800 pixels tall will have an aspect ratio of 2). We will most often use this with a min- or max- prefix instead of setting one specific value.
height: the height of the viewport, typically in pixels. Most often used with a min- or max- prefix to set a bounds instead of a specific value.
width: the width of the viewport, typically in pixels. Most often used with a min- or max- prefix to set a bounds instead of a specific value.
orientation: An indicator of whether our viewport is wider than it is tall (landscape) or taller than it is wide (portrait). Since we are just using these exact values, we do not use any prefixes.
Use media queries to change the styles of content in an HTML page to achieve a desired effect
Be able to set conditions for bounds on your device that will trigger a different style. For example, if our viewport shrinks below a certain height we could remove a menu by setting its display property to none, or if we have a color background we can change it to white for print media, etc.
A code example: Given the following CSS rule, write a media query that would change the product-index container so the items appear in a verticle fashion for a viewport width less than or equal to 300px:
I like to think of padding, borders, margins as a puffy jacket. The content is just me, but when I put on a puffy jacket, I'm adding some space between me and my borders (the outside of my jacket). If the outside of my jacket is the border, the margin is then how far away do I want to be from anything else. Margin is my social distancing :)
padding - the innermost part of the box model – creating space around an element's content before its border.
margin - the space between one html element and another html element
One thing to note is that margins will collapse. If I'm comfortable with being 10 pixels away from my neighbor but my neighbor wants to be 15 pixels away from everyone, overall we are going to be 15 pixels away. I don't need an extra 10 pixels for myself, 15 pixels satisfy both of our requests.
The box-sizing property will also affect how these values are calculated.
With a value of content-box, setting a width or height on an element is only considering the content itself. Any padding and border that we add on is going to be in addition to this specification.
A 100px wide div with padding of 10px and a 5px border means the content will still be 100px wide, 10px padding on each side, and a 5px border on each side, totaling 130px before our margin starts. Increasing padding or border will expand outward instead of eating into the content.
With a value of border-box, setting a width or height on an element is going to consider the content, padding, and border as part of that width or height calculation.
A 100px wide div with padding of 10px and a 5px border means the content will end up being 70px wide, 10px padding on each side, and a 5px border on each side. Increasing padding or border will eat into the content instead of expanding outward.
the browser positions a fixed positioned element
position: fixed - always relative to the document, not any particular parent, and are unaffected by scrolling. It will always show up at that exact location on the screen, no matter where the user is scrolled to.
the browser positions a relatively positioned element
position: relative - positioned relative to where it would normally be located; i.e. the element is still in the flow of the document, but now left/right/top/bottom/z-index will affect how it is actually displayed.
the browser positions absolutely positioned elements with and without a relatively positioned parent element
position: absolute - the element is removed from the flow of the document and other elements will behave as if it's not even there. If its positioning is affected by a left/right/top/bottom property, it will use its closest position: relative parent as the starting point. If no parent is positioned relatively it will use the document in general as its reference.
the browser positions a static positioned element
position: static - this is the default positioning, so you won't see it written out that often. Elements are in their normal page flow, one after the other. The positioning properties left/right/top/bottom/z-index do not affect statically positioned elements. If we want to use these properties we would need to change the positioning to one of the previously mentioned values.
Identify elements rendered with specific padding and margin settings
Recognize that padding is the area between content and borders.
When box-sizing is set to content-box, this will extend our overall width/height. When it is set to border-box, this will eat into our content area.
Stylings such as background-color that affect our content area will generally also apply to our padding.
Recognize that margin is the area between elements' borders.
Margins collapse, meaning if two neighboring elements each have a margin set, the smallest value that will satisfy both constraints will be used.
If Element A has a margin of 10px and Element B, its neighbor, has a margin of 15px, the space between these elements will be 15px. The 15px space accomodates both the 10px requirement from Element A and the 15px requirement from Element B.
Apply padding and margins to HTML elements to achieve a desired layout
When adding padding and margins we can specify each edge of our box separately, or use some shorthand.
To define them separately, we can use the -left, -right, -top, and -bottom suffixes on padding and margin to specify that specific side.
margin-right: 5px will add a 5px margin ONLY to the right side.
To define them together we can use some shorthand:
Providing one value will assign that amount to all four sides
margin: 5px will add a 5px margin on all sides
Providing two values will assign the first value as the top and bottom and the second value as the right and left
margin: 5px 10px will add a 5px top and bottom margin and a 10px right and left margin.
Providing four values will assign them in clockwise order, starting from the top
margin: 5px 10px 15px 10px will add a 5px top margin, 10px right margin, 15px bottom margin, and 10px left margin.
Apply positioning settings to HTML elements (fixed, relative, and absolute) to achieve a desired layout. (Sticky positioning is not supported on some older but still used browsers, so it will not be assessed, but can useful.)
This is an application of LO #1 from this category.
Some example knowledge:
If we want an element to always show up in the top right corner of the page, know that we should use position: fixed with a specific value for top and right properties to set it in that corner.
If we want an element to be 20 pixels to the right of its parent, outside the normal page flow, we should make the parent position: relative and have the child position: absolute with a right: 20px property in order to set it positioned to that relative parent.
Identify which HTML elements have a default "inline" display value
Common elements that default to inline include span, a, input, button, img tags, etc.
An exhaustive list: https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements
inline display values will result in the element being displayed next to each other in a single line until it fills up the available space.
The width and height properties do not affect how the element is displayed.
padding, margin, and border can still be used, but will not affect other inline elements. For example, setting a margin of 100px will still have the other inline elements display directly next to it, but the block element that comes later on in the document on its own line will still be pushed down.
Identify which HTML elements have a default "block" display value
Common elements that default to block include div, p, headers like h1, ul, li tags, etc.
An exhaustive list: https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements
block display values will result in elements being displayed on a new line.
The width and height properties are respected.
Describe and use z-index positioning of elements
The z-index can be useful in setting an element on different layers of the page, its third dimension. These different layers are purely visual, they do not affect the layout and positioning of other elements.
A positive z-index means we want that element on top. We can think of it as the line coming straight out of the screen. We want that element closer to the user.
A negative z-index means we want the element behind other elements, pushed away from the user.
Flexible Box Layout
Explain how flexible box layout lays out elements
Flex box allows for easy responsive design by displaying items in a flexible container, where a container's height/width will adjust to the viewport.
Flex box is an easy way for us to tell our browser that we want all of the elements in our container laid out in a row or column, and how those elements should be positioned, grow/shrink, and wrap across that axis.
Use the flex property to specify grow, shrink, and basis values.
The flex property is a combination of three different properties: flex-grow, flex-shrink, and flex-basis.
flex-grow:
Determines how much of the extra space within the container the element will take up.
The default value is 0, meaning it will not grow at all.
Setting a flex-grow property to different values for elements within the same container sets up a ratio for how much of the extra space should be alotted to the different elements to grow into.
flex-shrink :
Similar to flex-grow, this property determines what factor the element should shrink by when the container is not large enough to fit all elements.
The default value is 1. A value of 0 means it will not shrink at all.
If all elements have the same flex-shrink value, they will all shrink at the same rate. Larger values will shrink at a faster rate than smaller values.
flex-basis :
The initial main size of the element.
The default value is 'auto', meaning it will use the width of the element.
We can specify specific absolute lengths, like 20px, percentages, like 25%, or use automatic sizing keywords like content to assign the size required to fit all of the element's content.
Use the flex-direction property to direct the layout of the content
We can specify if we would like our container to display our content in a row or a column using flex-direction.
The default for flex box containers is row, but we can use column to display our content vertically.
Use the flex-wrap property to affect the wrap of content layout within an element using flexible box layout
Instead of trying to fit all items on one line by shrinking them, we can also wrap elements to a new line by setting flex-wrap: wrap.
nowrap is the default value
wrap-reverse will stack our rows or columns in the reverse order (our second row will display on top or our second column will display to the left, for example)
Use align-self, justify-content, and align-items to change the way that children elements are laid out in a flexible box layout
These properties affect how an individual element is laid out across the main axis of a flex-box layout.
justify-content is always concerned with positioning ALONG the main axis.
If we are displaying our content in a row, justify-content will determine how the elements are positioned horizontally along that row.
If we are displaying our content in a column, justify-content will determine how the elements are positioned vertically along that column.
align-items is always concerned with positioning ACROSS the main axis.
If we are displaying our content in a row, align-items will determine how the elements are positioned vertically across that row.
If we are displaying our content in a column, align-items will determine how the elements are positioned horizontally across that column.
align-self allows us to selectively tell an element that we want it to align itself differently compared to the standard align-items rule.
If we have all of our items centered vertically along our row but we want one item to be at the top of the container instead, we can apply an align-self: flex-start, for example, which would keep all of the other elements in line and just bump this element up to the top of the row.
Use the order property to change the order in which elements will appear in a flexible box layout
order can be used to rearrange individual elements
The default value is 0. Higher numbers will push the element to be later in the ordering.
If we want a specific element to be at the very beginning, we could assign it an order: -1. If all of the other elements are left to default (0), it will be the lowest value and be shown first.
This only affects the visual display of the elements, not how the HTML is constructed, tab orders, speech, etc.
Grid Layout
Explain how grid layout lays out elements
The grid layout style divides your document into smaller sections that can be organized and customised via the css grid layout properties. The number of rows and columns, and their respective dimensions can be set.
Use the grid-template-columns, grid-template-rows, and grid-template properties to specify the layout of the grid using relative and absolute measures
grid-template-columns allows us to take in any number of arguments to signify the dimensions for the corresponding column. Passing two values means we are creating two columns for our grid, for example.
grid-template-rows allows us to take in any number of arguments to signify the dimensions for the corresponding row. Passing two values means we are creating two rows for our grid, for example.
grid-template is shorthand to allow us to define rows and columns at once. We do so by providing our row values, then a / then the column values, such as grid-template: 100px 1fr / 50px 200px 50px. We can also provide additional arguments to for area names, with many additional optional syntaxes. Personally I think these can get confusing to parse, but if you're curious, take a look at the MDN docs: https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template
Use grid-template-areas to label areas of a grid and grid-area to assign an element to the area
Areas are a great way for us to lump multiple sections of our grid together into one space.
With our column and row dimensions defined, we can assign section names using the grid-template-areas property on the container.
Use column-gap, row-gap, and gap (previously grid-column-gap, grid-row-gap, and grid-gap) to set the "gutter" areas between elements in a grid layout
The gap properties can be used to define space that we want to maintain between our rows and columns.
By default, our rows and columns are all directly next to each other, but giving these properties values creates a "gutter" between the sections.
Use grid-column-start/grid-column-end and grid-row-start/grid-row-end to create spans across multiple columns and rows with positive integers, negative integers, and in conjunction with the "span" operator
When we are assigning an item to be placed in the grid, we can indicate in our CSS what row/column we want the element to stretch across.
The -start values are the grid lines that we want our element to begin at. The left-most and top-most grid lines (outside borders) begin at 1 and count upwards as we move right and down the grid.
Similarly, the -end values are where the element will stretch to.
Negative numbers can also be used to indicate counting from bottom/right instead of top/left.
Instead of providing a specific row/column number, we can use span to indicate we want to continue across a certain number of rows/columns. For example, grid-column-end: span 2 will go across two columns instead of specifying a specific column number.
Explain and use the shorthand versions of grid-column and grid-row to define how an element will span a grid layout
grid-column is a combination of grid-column-start and grid-column-end, allowing us to provide both values in one line, separated by /.
grid-column: 1 / 3; will assign this element to stretch from column 1 to 3 (the first two columns of the graph.)
grid-row is a combination of grid-row-start and grid-row-end, allowing us to provide both values in one line, separated by /.
grid-row: 4 / span 4; will assign this element to stretch from row 4, spanning the next four rows.
Use the order property to change the default order in which items are laid out
Similar to the order used in flex box, we can assign a specific order for elements when they are assigned to a row or column section.
Look at LO #6 of Flex Box for more specifics, but generally a higher order value will come later in the visual placement.
Explain and use the "fr" unit of measure
fr indicates the fraction of available space
It can be very useful when combined with other measurements. For example, if we have three rows and want our first row to be 50px high, then split the remaining area between two parts to the second row and one part to the third row, we can say grid-template-rows: 50px 2fr 1fr. This will always take 50px for the first row, then divide up the rest based on the fractions.
Use justify-items, align-items, justify-content and align-content to layout items in each grid area
justify-items and align-items will position items within the respective section of the grid.
justify-items will position the items horizontally within the box
align-items will position the items vertically within the box
We can think of these similarly to justifying and aligning with a flex-box that has the default row direction.
justify-content and align-content will position the grid itself within the container, assuming it does not fill the full container.
This can come up when we define specific absolute values for columns/rows that don't add up to the whole container size.
Interactivity and BEM (W09D4) - Learning Objectives
Interactivity
Use the "hover" pseudo-class to be able to make changes to elements when the device pointer is over an element
The browser will automatically add the :hover pseudo-class to an element when the user's pointer is on it.
This can be useful to provide visual clues that the element is interactable like a button or link or even for providing functionality, like changing the display value of a child from none to block to make a drop-down menu appear.
Describe and use the transition property to show animated changes due to class and pseudo-class CSS rule application
transition-property
The name or names of properties to which transitions should apply
Default value: all, meaning every difference in style will be affected by these transition rules.
transition-duration
The duration over which transition occurs
Default value: 0s, meanine the transition will occur instantly. This may be useful if you only want a delay and then the changes to all happen at once.
transition-timing-function
Determines how the intermediate values for a transition are calculated.
Default value: ease, which shows a slow transition at the beginning, speeds up in the middle, then slows down at the end.
Other popular values are linear, ease-in, and ease-out. These can become more complicated if you use a custom function with cubic-bezier or steps.
transition-delay
How long to wait between when the property's assigned value has changed (either through CSS like a :hover or JavaScript) and when the transition begins
transition is shorthand for transition-property, transition-duration, transition-timing-function, and transition-delay
If any of the properties are omitted, their default values will be used.
We can define transitions on multiple properties by separating their definitions with commas. In the following example we define a transition on background-color with a duration of 2s and a transition on color with a duration of 1s and delay of 1s:
Describe and use the overflow, overflow-x, and overflow-y properties to effect clipping and scrolling on elements
The overflow property will account for any extended content, horizontal or vertical. If we'd like to distinguish, we can use overflow-x and overflow-y.
overflow: auto - hides any content that exceeds the container size, adding a scroll bar if needed to show that content.
overflow: scroll - always adds a scroll bar, even if it would not be needed with the content.
overflow: hidden - clips any content that exceeds the container size. No scroll is added, so the user will not to see anything that extends beyond the container.
overflow: visible - the content is allowed to extend beyond the container without clipping or scrolling, potentially spilling into other elements.
Block, Element, Modifier (BEM)
Describe what Block means in BEM.
"A standalone entity that is meaningful on its own."
Typically this means a group of elements that form some sort of unit/feature together, but could also be applied to a single element if it has enough significance and stand-alone meaning.
Describe what Element means in BEM.
"Part of a block and has no standalone meaning."
If a component wouldn't mean anything or its meaning would be lost/changed if it was moved to another location, it generally means that it is an element of some larger block.
Describe what Modifier means in BEM.
"A flag on blocks or elements. Use them to change appearance, behavior or state."
These classes are typically added in our JavaScript in order to modify the standard styling.
If the user clicks on a "Dark Mode" button and we want to change the background color of an element, we could have a .block__elem--dark-mode class that is added in response to that click that alters the color.
If we are only allowed to have eight elements in our bag, we can have a .bag__add-btn--disabled class that gets added to our button on the eighth addition that sets our cursor property to not-allowed, helping the user understand they should not click the button any more.
Identify CSS class names that follow the BEM principle.
In general, each section of the BEM naming convention should only use letters, numbers, dashes, or underscores.
For longer/more complicated names, we typically replace spaces that we would use in English with a dash.
We use two underscores to separate the block from the element name and two dashes to separate the modifier from the block or element that it is modifying.
It's important to note that we are creating whole new classes when we are talking about these modifiers. .nav__list-container--shadow is all one class that we created in order to make styles specifically for adding a shadow on the list container.


A channel to discuss trading. For useful links and more info click the pinned messages to the right.
100 messages
Before 05-Dec-19 12:00 AM
FundazuSafu05-Sep-18 03:47 PM
he'll bounce back better than ever
Hollowman900005-Sep-18 03:47 PM
Just my guess mind you
FundazuSafu05-Sep-18 03:47 PM
im guessing he went back to slanging medical appliances and equipment
Hollowman900005-Sep-18 03:48 PM
I wouldn’t bother to know someone who was that big of a trainwreck in real life
FundazuSafu05-Sep-18 03:48 PM
lol
Hollowman900005-Sep-18 03:49 PM
“Ca.. c.. can you fake a learning disability so I can get more adderall? Th.. they cut me off teethchatter”
2
FundazuSafu05-Sep-18 03:50 PM
i like to know a guy like that because they are usually good guinea pigs for stuff. reminds me of a buddy from high school who would take any pill you handed him.

Hollowman900005-Sep-18 03:53 PM
Maybe they’d get lightheaded due to extreme low BP
who knows
FundazuSafu05-Sep-18 03:53 PM
got me
seems like a good way to faint and hit your head
Hollowman900005-Sep-18 03:54 PM
Don’t think that kid would’ve lost much tbh
What’s crypto doin
Off to blockfolio
Ok not looking at that again today
Chuckleheads
FundazuSafu05-Sep-18 03:56 PM
what goes up...
Hollowman900005-Sep-18 04:05 PM
Top 25 addresses have like 40% of the KMD coin supply
Not really that surprising the binance “whale” got crushed
snowdamn05-Sep-18 04:09 PM
BTC barely below $7k and ETH dumps even lower, ideal plan still in effect!!!
all on scalability test
Cryptoon05-Sep-18 04:30 PM
I really dont get the fuss over a 300$ drop in btc
"Music video by ""Weird Al"" Yankovic performing Whatever You Like (Parody of ""Whatever You Like"" by T.I.). (C) 2011 Volcano Entertainment III, LLC, a unit...
jl777c05-Sep-18 05:01 PM
goldman is delaying their crypto services? I guess that's the death of BTC, cant live without goldman
2
1
1
7
1
shak3nbak305-Sep-18 05:30 PM
At least my fiat is on the way to buy a little bit of the dip
LocoMB05-Sep-18 06:19 PM
seems Goldman Sacks experts haven't been able yet to figure out Komodo code they are trying to replicate..
Cryptoon05-Sep-18 09:40 PM
Small dumpage
#talk-trading activity in discord down 77%
polycryptoblog05-Sep-18 09:43 PM
1
Need to find a happy one for pumps
Cryptoon05-Sep-18 09:50 PM
bishop05-Sep-18 10:52 PM
Anyone in the US looking for a server workstation for KMD?
jspook1605-Sep-18 10:54 PM
what does that mean? like hardware?
bishop05-Sep-18 11:02 PM
yep
HP Z820 Specs: 2 x Xeon E5-2670v1 2.6GHz CPUs, 96GB DDR3 (Samsung), Quadro 4000 GPU. Has trays, most likely wouldn't include hdds although might consider
Heavier than all hell
jspook1605-Sep-18 11:10 PM
does it come with power supplie(s)?
bishop05-Sep-18 11:10 PM
Yep, would be turnkey w/ hdds
No problems with one of the notaries/team escrowing the funds to anyone interested should you wish too
Oh, ram is 10600R speed, 8GB x 12 sticks leaving 4 slots open
Thinking 625 KMD shipped CONUS
blackjok3r05-Sep-18 11:38 PM
what country or no matter?
2.6Ghz is a bit piss poor, but thats CHEAP! and much much faster than what I am using now...
bishop05-Sep-18 11:43 PM
US only, shipping would be prohibitively expensive anything other than the lower 48
blackjok3r05-Sep-18 11:43 PM
damn
bishop05-Sep-18 11:43 PM
sorry aussie
blackjok3r05-Sep-18 11:44 PM
lol all good dude
bishop05-Sep-18 11:45 PM
One sec, I can check the meter
blackjok3r05-Sep-18 11:46 PM
lol I missread even what CPUs those were... I doubt thats much better than the server I have, only this in it could actually miner verus.
bishop05-Sep-18 11:48 PM
460w maxing out 32 threads
Depending on the colo, yes, it could, but the size would be 1/8 rack
~5U of space
blackjok3r05-Sep-18 11:51 PM
that would not be worth it
bishop05-Sep-18 11:51 PM
depends entirely on location. It's going to be more than a standard 2U
or 1U server
just figured I would throw it out there. Not entirely sure I want to part it yet but I did get a firesale upgrade so naturally having a second doesn't make a ton of sense for me personally
not really trading talk (well, kinda from a hardware for KMD standpoint), but if anyone is interested, DM me.
The people that gave it to him and still selling will be pissed(edited)
jspook1606-Sep-18 02:53 AM
We don't want whale feeders 'round here..
1
1
ryman11206-Sep-18 03:32 AM
I think ETH DEed. In all seriousness we saw the bottom of the cloud but maybe didn't see the ground.
Bowdo06-Sep-18 03:42 AM
Ouch. Pretty rough out there.
ryman11206-Sep-18 03:48 AM
Im growin older faster than I should watching this nonsense....yet I find solice in the way it makes me feel. Maybe I have hope maybe I have none. It gets to you mentally in a strong way but I was raised by a strong ass mother and I will always stay by what I believe in and if it runs into the ground like so many things I have seen before then so be it. It will be the status quo. Sorry for the rant but I see things as an average and I am very logical about decisions. The older I get the more I realize how ignorant the people really are. Im done now.


The goal of learylib is to easily manage a few personal functions I find useful. A secondary goal is to explore package development in R, using pkgdown, usethis, & devtools to practice fully building out a package.
You can install the latest version of learylib from my Github repo with the devtools package. Given the limited scope & use of learylib, it will always live on Github.
install.packages("devtools") devtools::install_github("mleary/learylib")
Using theme_leary
with the mtcars
dataset.
library(learylib) library(ggplot2) ## basic example code ggplot(mtcars, aes(wt, mpg)) + geom_point() + labs(title = "A basic example plot", subtitle = "A little more detail in subtitle?") + theme_leary()
Using see_pkg_funcs
to see all the functions within a package.
library(learylib) see_pkg_funcs(learylib) #> [1] "copy_to_clipboard" "not_in" "not_na" #> [4] "rprofile_clear" "rprofile_update" "search_last_error" #> [7] "see_lib_paths" "see_pkg_funcs" "theme_leary"
I can’t imagine why anyone would contribute to this, but hey it would be cool if you did! Feel free to submit a pull request or contact me if you want to add something.


airflow.contrib.operators.gcp_container_operator
¶
Module Contents¶
-
class
airflow.contrib.operators.gcp_container_operator.
GKEClusterDeleteOperator
(project_id, name, location, gcp_conn_id='google_cloud_default', api_version='v2', *args, **kwargs)[source]¶ Bases:
airflow.models.BaseOperator
Deletes the cluster, including the Kubernetes endpoint and all worker nodes.
To delete a certain cluster, you must specify the
project_id
, thename
of the cluster, thelocation
that the cluster is in, and thetask_id
.Operator Creation:
operator = GKEClusterDeleteOperator( task_id='cluster_delete', project_id='my-project', location='cluster-location' name='cluster-name')
See also
For more detail about deleting clusters have a look at the reference: https://google-cloud-python.readthedocs.io/en/latest/container/gapic/v1/api.html#google.cloud.container_v1.ClusterManagerClient.delete_cluster
- Parameters
project_id (str) – The Google Developers Console [project ID or project number]
name (str) – The name of the resource to delete, in this case cluster name
location (str) – The name of the Google Compute Engine zone in which the cluster resides.
gcp_conn_id (str) – The connection ID to use connecting to Google Cloud Platform.
api_version (str) – The api version to use
-
class
airflow.contrib.operators.gcp_container_operator.
GKEClusterCreateOperator
(project_id, location, body=None, gcp_conn_id='google_cloud_default', api_version='v2', *args, **kwargs)[source]¶ Bases:
airflow.models.BaseOperator
Create a Google Kubernetes Engine Cluster of specified dimensions The operator will wait until the cluster is created.
The minimum required to define a cluster to create is:
dict()
::- cluster_def = {‘name’: ‘my-cluster-name’,
‘initial_node_count’: 1}
or
Cluster
proto ::from google.cloud.container_v1.types import Cluster
cluster_def = Cluster(name=’my-cluster-name’, initial_node_count=1)
Operator Creation:
operator = GKEClusterCreateOperator( task_id='cluster_create', project_id='my-project', location='my-location' body=cluster_def)
See also
For more detail on about creating clusters have a look at the reference:
google.cloud.container_v1.types.Cluster
- Parameters
project_id (str) – The Google Developers Console [project ID or project number]
location (str) – The name of the Google Compute Engine zone in which the cluster resides.
body (dict or google.cloud.container_v1.types.Cluster) – The Cluster definition to create, can be protobuf or python dict, if dict it must match protobuf message Cluster
gcp_conn_id (str) – The connection ID to use connecting to Google Cloud Platform.
api_version (str) – The api version to use
-
airflow.contrib.operators.gcp_container_operator.
G_APP_CRED
= GOOGLE_APPLICATION_CREDENTIALS[source]¶
-
class
airflow.contrib.operators.gcp_container_operator.
GKEPodOperator
(project_id, location, cluster_name, gcp_conn_id='google_cloud_default', *args, **kwargs)[source]¶ Bases:
airflow.contrib.operators.kubernetes_pod_operator.KubernetesPodOperator
Executes a task in a Kubernetes pod in the specified Google Kubernetes Engine cluster
This Operator assumes that the system has gcloud installed and either has working default application credentials or has configured a connection id with a service account.
The minimum required to define a cluster to create are the variables
task_id
,project_id
,location
,cluster_name
,name
,namespace
, andimage
Operator Creation:
operator = GKEPodOperator(task_id='pod_op', project_id='my-project', location='us-central1-a', cluster_name='my-cluster-name', name='task-name', namespace='default', image='perl')
See also
For more detail about application authentication have a look at the reference: https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application
- Parameters
project_id (str) – The Google Developers Console project id
location (str) – The name of the Google Kubernetes Engine zone in which the cluster resides, e.g. ‘us-central1-a’
cluster_name (str) – The name of the Google Kubernetes Engine cluster the pod should be spawned in
gcp_conn_id (str) – The google cloud connection id to use. This allows for users to specify a service account.
-
_set_env_from_extras
(self, extras)[source]¶ Sets the environment variable GOOGLE_APPLICATION_CREDENTIALS with either:
The path to the keyfile from the specified connection id
- A generated file’s path if the user specified JSON in the connection id. The
file is assumed to be deleted after the process dies due to how mkstemp() works.
The environment variable is used inside the gcloud command to determine correct service account to use.
-
_get_field
(self, extras, field, default=None)[source]¶ Fetches a field from extras, and returns it. This is some Airflow magic. The google_cloud_platform hook type adds custom UI elements to the hook page, which allow admins to specify service_account, key_path, etc. They get formatted as shown below.


aroma.apd: A Probe-Level Data File Format Used by 'aroma.affymetrix'
[deprecated]
DEPRECATED. Do not start building new projects based on this package. (The (in-house) APD file format was initially developed to store Affymetrix probe-level data, e.g. normalized CEL intensities. Chip types can be added to APD file and similar to methods in the affxparser package, this package provides methods to read APDs organized by units (probesets). In addition, the probe elements can be arranged optimally such that the elements are guaranteed to be read in order when, for instance, data is read unit by unit. This speeds up the read substantially. This package is supporting the Aroma framework and should not be used elsewhere.)
Downloads:
Reverse dependencies:
Linking:
Please use the canonical form
https://CRAN.R-project.org/package=aroma.apd
to link to this page.


This server is made to test forms. The form data get logged to the console. The Files get saved in /uploads/ . New files with the same name override the old ones.
Sometimes servers have problemes and this should get tested.
The formdata gets logged on all routes equaly.
Make a npm install && node app.js and put a POST request to localhost:4000 .
Cors is enabled so you could post from every origin.
<form action="http://localhost:4000/" method="POST" enctype="multipart/form-data">
<input type="file" name="file" />
<button type="submit">submit to localhost:4000/</button>
</form>


WITNESS LIST Criminal Justice Committee (Subcommittee on Subcommittee on SB204) February 27, 1997-10:00A SB 204 On: West, John C. (TX Dept Public Safety), Austin


Contract No
{{trans.contractNumber}}
Program
{{trans.programName}}
Surplus Amount: {{surplus_amount | currency}}
Remaining Amount: {{remaining_amount | currency}}
| Actual Expenditures | |||||
|---|---|---|---|---|---|
| Program Delivery Expenditure | Allocated Amount | Q1 | Q2 | Q3 | Q4 |
| {{line.expense_name}} | |||||
| Total | {{total_allocated_amount | currency}} | {{q1_total | currency}} | {{q2_total | currency}} | {{q3_total | currency}} | {{q4_total | currency}} |


Overview
FileDb is a simple database designed as a simple local database solution for Xamarin Cross-Platform phone (Android, IOS, WinPhone) or any .NET application. FileDb is a No-SQL database meant for use as a local data store for applications. Here are some important points about FileDb:
FileDb was specifically designed to use only native .NET data types so there would no need to translate between database storage and the CLR data types. So you can just as easily read/write a String[] field as you would an Int field. Another feature is that a database file created on any .NET platform will work on any other. So you can create a database file on your Windows machine and it can be used in a Silverlight or Windows Phone app.
LINQ + FileDb gives you full relational database capability
Even though FileDb is a "flat-file" database, using LINQ it becomes fully relational! LINQ to Objects allows you to join Tables together just as you would do in SQL. All of the power of LINQ is available to you: Joins, Grouping, Sum - the lot. (See the examples below.)
FileDb also has a built-in query filter parser so you can write SQL-like filter expressions to make filtering data easy, like this:
string filter = "FirstName IN ('Cindy', 'John') AND Age > 32"
Use FileDb in your .NET and mobile applications where you need a searchable, updatable local database.
Use FileDb with Xamarin cross-platform app development
Most phone apps only require a simple database. By purchasing a source code license you can compile FileDb into your IOS, Android and Windows Phone projects and use the same exact data layer code for them all. This is much easier than using Sqlite wrappers. With FileDb's built in encryption you can have everything you need to have a secure data layer.
FileDb Database Overview
FileDb is a simple database designed for use on any .NET platform such as Windows Phone and Silverlight, but its also great for any .NET app where simple local database storage is needed. For example, instead of using XML config files you could use a FileDb database to store and retrieve application data much more efficiently. FileDb allows only a single table per database file, so when we talk about a FileDb database we really mean a single table with an index. The index is stored in the file with the data, and allows an optional Primary Key.
FileDb is NOT a relational database - it is NO-SLQ, meaning you can't directly issue SQL commands for querying, adding or updating. However, you CAN use LINQ with FileDb to get full relational query capabilities. And FileDb does include an Expression Parser which parses SQL-like filter expressions, which makes searching, updating and deleting very easy - see below for an example.
And FileDb supports using powerful Regular Expressions for filtering.
FileDb supports AES encryption at the record level. This means the database schema is not encrypted (field names, etc.), but each record is entirely encrypted. Encryption is "all or nothing", meaning it expects that either all records are encrypted or all records are not encrypted. You turn encryption on by passing an encryption key when opening the database.
FileDb is thread-safe for multithreading environments, so it can be accessed from multiple threads at the same time without worrying about database corruption.
FileDb databases can only be opened by a single
application. Any attempt to open the file when already open will fail.
This makes sense since its meant for use by a single application at a time
(FileDb is not meant as a multi-user database, such as SQL Server Express).
FileDb Classes
The main FileDb classes are: FileDb, Table, Field and Record.
Database Fields
Fields (or Columns) can be of several common types: String, Int, UInt, Bool, Byte, Float, Double and DateTime, or can also be an array of any of these types.
Int Fields can be AutoIncrementing, and you can optionally specify one field to be Primary Key (it must be of type Int or String).
FileDb doesn't support the notion of NULL fields for the non-array type. Only array type fields can have NULL values. The non-array field values will always have a value, either zero or empty.
FileDb Records
FileDb supports two methods of data retrieval. You can say the "default" way is with the built-in Record and Records classes. Think of Record as the .NET DataRow class, and think of Table as a DataTable. Table is a list of Records, and a Record holds the actual values. You access Field values using indexing just as you would a DataRow, like this:
FileDb employeesDb = new FileDb();
employeesDb.Open( Employees.fdb" );
Table employees = employeesDb.SelectAllRecords();
Record record = employees[0];
int id = (int) record["EmployeeId"];
// or
id = (int) record[0];
To use a Table with LINQ, you do this:
var recs = from e in employees
where (string) e["FirstName"] == "John"
select e;
Notice we have to cast the record value to a string. This is because, just like with the DataRow, Record values are all type object.
Records and Custom Objects
Records are great because they require no additional programming and they work with LINQ, albeit with some casting. But you can use your own custom classes if you want because FileDb has template (generic) overloads for each of the SelectRecords methods. You only need to create a class with public properties which match the names of the fields you want to use. Here's an example using the Employees table.
public class Employee
{
public int EmployeeID { get; set; }
public string LastName { get; set; }
public string FirstName { get; set; }
public string Title { get; set; }
public string TitleOfCourtesy { get; set; }
public DateTime BirthDate { get; set; }
public DateTime HireDate { get; set; }
public string Address { get; set; }
public string City { get; set; }
public string Region { get; set; }
public string PostalCode { get; set; }
public string Country { get; set; }
public string HomePhone { get; set; }
public string Extension { get; set; }
public Byte[] Photo { get; set; }
public string Notes { get; set; }
public int ReportsTo { get; set; }
}
The templated SelectRecords versions return a IList<T> where T is your custom type.
IList<Employee> employees = employeesDb.SelectAllRecords<Employee>();
Employee employee = employees[0];
int id = Employee.EmployeeId;
var emps = from e in employees
where e.FirstName == "John"
select e;
As you can see, this is much cleaner code. And its actually more efficient since the Record class has more overhead because its not as simple.
Searching and Filtering
FileDb uses FilterExpressions and FilterExpressionGroups to filter records in queries and updates. We use FilterExpressions for simple queries which consist of a single field comparison (field = 'value') and we use FilterExpressionGroups for compound expressions, where multiple expressions and grouping are required. You can add either FilterExpressions or FilterExpressionGroups to a FilterExpressionGroup, thus creating complex expresssions (FileDb processes FilterExpressionGroups recursively).
You can either create your own manually in code or use the built-in Expression Parser to create them for you. The Expression Parser recognizes standard SQL comparison operators. You can see it used in the examples below. It also recognizes REGEX, which uses Regular Expressions, and CONTAINS which uses String.Contains. See the section on Regular Expressions below for more info. Field names prefixed with ~ specifies no-case comparison (for strings only).
Each time you use () around an expression, a new FilterExpressionGroup will be created. The inner-most expressions are evaluated first, just as in SQL.
Example 1: Create a FilterExpression
// build an expression manually
FilterExpression searchExp = new FilterExpression( "LastName", "Peacock", Equality.Equal );
// build the same expression using the parser
searchExp = FilterExpression.Parse( "LastName = 'Peacock'" );
Table table = employeesDb.SelectRecords( searchExp, new string[] { "ID", "LastName" } );
// Or you can simply pass the string filter directly - a FilterExpression will be created in the same way as above
table = employeesDb.SelectRecords( "LastName = 'Peacock'", new string[] { "ID", "LastName" } );
foreach( Record record in table )
{
foreach( object value in record )
{
Debug.WriteLine( value );
}
}
Example 2: Create a FilterExpressionGroup
This example creates two identical FilterExpressionGroups, one using the Expression Parser and the other with code.
// For string fields there are 2 ways to specify no-case comparisons: you can prefix fieldnames with ~ or you can use ~= as demonstrated below
// The first form is needed when using the IN operator, eg.
FilterExpressionGroup filterExpGrp = FilterExpressionGroup.Parse( "(FirstName ~= 'andrew' OR ~FirstName = 'nancy') AND LastName = 'Fuller'" );
Table table = employeesDb.SelectRecords( filterExpGrp );
// equivalent building it manually
var fname1Exp = new FilterExpression( "FirstName", "andrew", Equality.Equal, MatchType.IgnoreCase );
var fname2Exp = new FilterExpression( "FirstName", "nancy", Equality.Equal, MatchType.IgnoreCase );
var lnameExp = new FilterExpression( "LastName", "Fuller", Equality.Equal ); // this constructor defaults to MatchType.UseCase
var fnamesGrp = new FilterExpressionGroup();
fnamesGrp.Add( BoolOp.Or, fname1Exp );
fnamesGrp.Add( BoolOp.Or, fname2Exp );
var allNamesGrp = new FilterExpressionGroup();
allNamesGrp.Add( BoolOp.And, lnameExp );
allNamesGrp.Add( BoolOp.And, fnamesGrp );
table = employeesDb.SelectRecords( allNamesGrp );
// or just pass the filter string directly
table = employeesDb.SelectRecords( "(FirstName ~= 'andrew' OR ~FirstName = 'nancy') AND LastName = 'Fuller'" );
FileDb supports these comparison operators:
= Equality ~= No-case equality - strings only <> Not Equal != Not Equal (same as <>) >= Greater than or Equal <= Less than or Equal REGEX Use Regular Expression CONTAINS Use the .NET String's Contains method IN Creates a HashSet of values to use like SQL IN operator NOT Logical Negation, e.g NOT CONTAINS
REGEX - Regular Expressions in searches and filtering
FileDb supports using Regular Expressions. You can use any RegEx supported by .NET. The Expression Parser supports MatchType.RegEx using the REGEX operator. Internally, FileDb uses FilterExpressions to evaluate fields. You don't need to use them because you can pass in filter strings and they'll be parsed into FilterExpressions/FilterExpressionGroups for you. This is just to show you how can create them manually if you want to. In the example below, both FilterExpressionGroups are identical.
// Using the Expression Parser
// You can use brackets around fieldnames if there are spaces in the name
FilterExpressionGroup filterExpGrp = FilterExpressionGroup.Parse( "(~FirstName = 'steven' OR [FirstName] REGEX 'NANCY') AND LastName = 'Fuller'" );
Table table = employeesDb.SelectRecords( filterExpGrp );
// we can manually build the same FilterExpressionGroup
var fname1Exp = FilterExpression.Parse( "~FirstName = steven" );
var fname2Exp = new FilterExpression( "FirstName", "NANCY", Equality.Regex );
var lnameExp = new FilterExpression( "LastName", "Fuller", Equality.Equal );
var fnamesGrp = new FilterExpressionGroup();
fnamesGrp.Add( BoolOp.Or, fname1Exp );
fnamesGrp.Add( BoolOp.Or, fname2Exp );
var allNamesGrp = new FilterExpressionGroup();
allNamesGrp.Add( BoolOp.And, lnameExp );
allNamesGrp.Add( BoolOp.And, fnamesGrp );
table = employeesDb.SelectRecords( allNamesGrp );
Using CONTAINS in searches and filtering
FileDb supports using Regular Expressions. You can use any RegEx supported by .NET. The Expression Parser supports MatchType.RegEx using the REGEX operator. Internally, FileDb uses FilterExpressions to evaluate fields. You don't need to use them because you can pass in filter strings and they'll be parsed into FilterExpressions/FilterExpressionGroups for you. This is just to show you how can create them manually if you want to. In the example below, both FilterExpressionGroups are identical.
// You can use brackets around fieldnames if there are spaces in the name
FilterExpressionGroup filterExpGrp = FilterExpressionGroup.Parse( "(~FirstName = 'steven' OR [FirstName] CONTAINS 'NANC') AND LastName = 'Fuller'" );
Table table = employeesDb.SelectRecords( filterExpGrp );
// we can manually build the same FilterExpressionGroup
var fname1Exp = FilterExpression.Parse( "~FirstName = steven" );
var fname2Exp = new FilterExpression( "FirstName", "NANCY", Equality.Contains );
var lnameExp = new FilterExpression( "LastName", "Fuller", Equality.Equal );
var fnamesGrp = new FilterExpressionGroup();
fnamesGrp.Add( BoolOp.Or, fname1Exp );
fnamesGrp.Add( BoolOp.Or, fname2Exp );
var allNamesGrp = new FilterExpressionGroup();
allNamesGrp.Add( BoolOp.And, lnameExp );
allNamesGrp.Add( BoolOp.And, fnamesGrp );
table = employeesDb.SelectRecords( allNamesGrp );
Sort Ordering
Query methods allow for sorting the results by fields. To get a reverse sort, prefix the sort field list with !. To get a no-case sort, prefix with ~. To get both reverse and no-case sort, use both ! and ~.
Example:
Table table = employeesDb.SelectAllRecords( new string[] { "ID", "Firstname", "LastName", "Age" }, false, new string[] { "~LastName", "~FirstName", "!Age" } );
Selecting a Table from a Table
Another very powerful feature of FileDb is the ability to select a Table from another Table. This would allow you to be able to select data from a Table after the database file has been closed, for example.
Example:
customersDb.Open( path + "Customers.fdb" );
// select all fields and records from the database table
Table customers = customersDb.SelectAllRecords();
Table subCusts = customers.SelectRecords( "CustomerID <> 'ALFKI'",
new string[] { "CustomerID", "CompanyName", "City" }, new string[] { "~City", "~CompanyName" } );
Encryption
Using encryption with FileDb is simple. You only need to specify a string key when you open the database. After that everything is automatic. The only caveat is you must set a key before you add any records. Once a single record has been added without a key set you cannot later add records with a key. Its all or nothing. Likewise, you cannot add records with encryption and later add records without. You must set the encryption key each time you add any records.
Persisting Tables
You can easily save a Table as a new database using Table.SaveToDb. This method creates a new database file using the Fields in the Table then populates it using the Records in the Table. For example, you can select subsets of your data, save it as a new database and send it over the Internet.
Table table = employeesDb.SelectAllRecords( new string[] { "ID", "Firstname", "LastName" } );
table.SaveToDb( "Names.fdb" );
You can also save a Table to a database from the
FileDb Explorer. Just right-click on the Grid to show
the context menu and select the "Create database from
Table..." menu item.
Using LINQ to Objects with FileDb
Microsoft has done an amazing job with LINQ. They have invested a huge amount of time, effort and $ in this technology which allows you to query just about any kind of data in a SQL-like way. We use LINQ with FileDb to join Tables as we would using SQL. The difference is that instead of doing it all in a single step with SQL, we must do it in two steps. First we select the data Tables from the database files then we use LINQ to join them together.
LINQ to Objects produces a list of anonymous types as its result set. This is good because we get strongly typed data objects which we can easily use in WPF/Silverlight apps.
Here is an example of doing a simple select using LINQ:
// Using the IN operator. Notice the ~ prefix on the LastName field. This is how
// you can specify case insensitive searches
Table employees = employeesDb.SelectRecords( "~LastName IN ('Fuller', 'Peacock')" );
var query = from record in employees
select new
{
ID = record["EmployeeId"],
Name = record["FirstName"] + " " + record["LastName"],
Title = record["Title"]
};
foreach( var rec in query )
{
Debug.WriteLine( rec.ToString() );
}The only thing LINQ did for us in this example was gave us a typed list of anonymous objects. Here's the same thing but with custom objects:
IList<Employee> employees = employeesDb.SelectRecords<Employee>( "~LastName IN ('Fuller', 'Peacock')" );
var query =
from e in employees
select e;
foreach( var emp in query )
{
Debug.WriteLine( emp.ToString() );
}
Now lets tap into LINQ's real power to join tables together like a SQL inner join. Notice in the following example we use the FilterExpression.CreateInExpressionFromTable method. We do this to get only the records we are going to need with LINQ. So using FileDb with LINQ is a two step process. You first select the records you will need then use them in the LINQ query. If your database files are large, you can filter the records like this. Otherwise you can just select all records.
FileDb customersDb = new FileDb(),
ordersDb = new FileDb(),
orderDetailsDb = new FileDb(),
productsDb = new FileDb();
customersDb.Open( "Customers.fdb" );
ordersDb.Open( "Orders.fdb" );
orderDetailsDb.Open( "OrderDetails.fdb" );
productsDb.Open( "Products.fdb" );
// get our target Customer records
// Note that we should select only fields we need from each table, but to keep the code
// simple for this example we just pass in null for the field list
FilterExpression filterExp = FilterExpression.Parse( "CustomerID IN( 'ALFKI', 'BONAP' )" );
FileDbNs.Table customers = customersDb.SelectRecords( filterExp );
// now get only Order records for the target Customer records
// CreateInExpressionFromTable will create an IN FilterExpression, which uses a HashSet
// for high efficiency when filtering records
filterExp = FilterExpression.CreateInExpressionFromTable( "CustomerID", customers, "CustomerID" );
FileDbNs.Table orders = ordersDb.SelectRecords( filterExp );
// now get only OrderDetails records for the target Order records
filterExp = FilterExpression.CreateInExpressionFromTable( "OrderID", orders, "OrderID" );
FileDbNs.Table orderDetails = orderDetailsDb.SelectRecords( filterExp );
// now get only Product records for the target OrderDetails records
filterExp = FilterExpression.CreateInExpressionFromTable( "ProductID", orderDetails, "ProductID" );
FileDbNs.Table products = productsDb.SelectRecords( filterExp );
// now we're ready to do the join
var query =
from custRec in customers
join orderRec in orders on custRec["CustomerID"] equals orderRec["CustomerID"]
join orderDetailRec in orderDetails on orderRec["OrderID"] equals orderDetailRec["OrderID"]
join productRec in products on orderDetailRec["ProductID"] equals productRec["ProductID"]
select new
{
ID = custRec["CustomerID"],
CompanyName = custRec["CompanyName"],
OrderID = orderRec["OrderID"],
OrderDate = orderRec["OrderDate"],
ProductName = productRec["ProductName"],
UnitPrice = orderDetailRec["UnitPrice"],
Quantity = orderDetailRec["Quantity"]
};
foreach( var rec in query )
{
Debug.WriteLine( rec.ToString() );
}Here's the same thing again using custom objects:
// get our target Customer records
FilterExpression filterExp = FilterExpression.Parse( "CustomerID IN( 'ALFKI', 'BONAP' )" );
IList<Customer> customers = customersDb.SelectRecords<Customer>( filterExp );
filterExp = FilterExpression.CreateInExpressionFromTable<Customer>( "CustomerID", customers, "CustomerID" );
IList<Order> orders = ordersDb.SelectRecords<Order>( filterExp );
// now get only OrderDetails records for the target Order records
filterExp = FilterExpression.CreateInExpressionFromTable<Order>( "OrderID", orders, "OrderID" );
IList<OrderDetail> orderDetails = orderDetailsDb.SelectRecords<OrderDetail>( filterExp );
// now get only Product records for the target OrderDetails records
filterExp = FilterExpression.CreateInExpressionFromTable<OrderDetail>( "ProductID", orderDetails, "ProductID" );
IList<Product> products = productsDb.SelectRecords<Product>(( filterExp );
// now we're ready to do the join
var query =
from custRec in customers
join orderRec in orders on custRec.CustomerID equals orderRec.CustomerID
join orderDetailRec in orderDetails on orderRec.OrderID equals orderDetailRec.OrderID
join productRec in products on orderDetailRec.ProductID equals productRec.ProductID
select new
{
ID = custRec.CustomerID,
CompanyName = custRec.CompanyName,
OrderID = orderRec.OrderID,
OrderDate = orderRec.OrderDate,
ProductName = productRec.ProductName,
UnitPrice = orderDetailRec.UnitPrice,
Quantity = orderDetailRec.Quantity
};
foreach( var rec in query )
{
Debug.WriteLine( rec.ToString() );
}
Creating a Database
You create your database programmatically by defining Fields and adding them to an array then calling FileDb.Create, similar to below. Notice we set the ID field to be AutoIncrementing and PrimaryKey. This code creates a database with every type of field.
Field field;
var fieldLst = new List<Field>( 20 );
field = new Field( "ID", DataType.Int );
field.AutoIncStart = 0;
field.IsPrimaryKey = true;
fields.Add( field );
field = new Field( "FirstName", DataType.String );
fields.Add( field );
field = new Field( "LastName", DataType.String );
fields.Add( field );
field = new Field( "BirthDate", DataType.DateTime );
fields.Add( field );
field = new Field( "IsCitizen", DataType.Bool );
fields.Add( field );
field = new Field( "DoubleField", DataType.Double );
fields.Add( field );
field = new Field( "ByteField", DataType.Byte );
fields.Add( field );
// array types
field = new Field( "StringArrayField", DataType.String );
field.IsArray = true;
fields.Add( field );
field = new Field( "ByteArrayField", DataType.Byte );
field.IsArray = true;
fields.Add( field );
field = new Field( "IntArrayField", DataType.Int );
field.IsArray = true;
fields.Add( field );
field = new Field( "DoubleArrayField", DataType.Double );
field.IsArray = true;
fields.Add( field );
field = new Field( "DateTimeArrayField", DataType.DateTime );
field.IsArray = true;
fields.Add( field );
field = new Field( "BoolArray", DataType.Bool );
field.IsArray = true;
fields.Add( field );
var myDb = new FileDb();
myDb.Create( "MyDatabase.fdb", fieldLst.ToArray() );
Adding Records
You add records to a database by creating a FieldValues object and adding field values. You do not need to represent every field of the database. Fields that are missing will be initialized to the default value (zero for numeric types, DateTime.MinValue, empty for String and NULL for array types).
var record = new FieldValues();
record.Add( "FirstName", "Nancy" );
record.Add( "LastName", "Davolio" );
record.Add( "BirthDate", new DateTime( 1968, 12, 8 ) );
record.Add( "IsCitizen", true );
record.Add( "Double", 1.23 );
record.Add( "Byte", 1 );
record.Add( "StringArray", new string[] { "s1", "s2", "s3" } );
record.Add( "ByteArray", new Byte[] { 1, 2, 3, 4 } );
record.Add( "IntArray", new int[] { 100, 200, 300, 400 } );
record.Add( "DoubleArray", new double[] { 1.2, 2.4, 3.6, 4.8 } );
record.Add( "DateTimeArray", new DateTime[] { DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now } );
record.Add( "BoolArray", new bool[] { true, false, true, false } );
myDb.AddRecord( record );


|
NOTE:
This Install procedure is primarily written for podbot, but many other metamod plugins work the same so can be used similarly.
plugin.dll should be of the form "plugin_mm.dll" and resides normally in directory as follows.
- Assuming
We assume:
You already have Steam or CS1.5 installed;
You have bought and ran Counter-Strike at least once;
You are not installing PODBot mm from All-In-One package
You have basic computer knowledge (if not - go ask for help at the forums,
but use "search function).
You know what is the listenserver (the PC when You create a game,
You are playing from it and Your friends are able to join the game on Your PC)
and the dedicated server (the PC-box You start the game and You can see
only the console of it, but You are not playing from this PC).
- Retrieving
Download the latest Metamod.
Choose one of the Metamod Binaries according to the operating system You have.
Most likely :
a) for windows metamod-1.19-win.zip
b) for linux32 metamod-1.19-tar.gz
c) for linux amd64 metamod-1.19-amd64.tar.gz
You may save it anywhere.
Download the lastest fullpack of PODBot mm.
You may save it anywhere.
- Arranging
Extract the files from the archives.
Use something like 7-Zip.
Find the cstrike or czero folder (according to
the game You have (CS1.5, CS1.6-Steam, CZERO-Steam supported).
On CS1.5 most likely
C:\Program Files\Sierra\Counter-Strike\cstrike
On CS1.6 listensever most likely
C:\Program Files\Steam\steamapps\your@email\Counter-Strike\cstrike
On CS1.6 dedicated server most likely
C:\Program Files\Steam\steamapps\your@email\dedicated server\cstrike
On CZERO listensever most likely
C:\Program Files\Steam\steamapps\your@email\Counter-Strike\czero
On CZERO dedicated server most likely
C:\Program Files\Steam\steamapps\your@email\dedicated server\czero
Once You know where is Your the most important folder (cstrike or czero) Yoy can go ahead with installing.
Create a folder called addons in the above folder.
Create a folder called metamod in the addons
folder.
Create a folder called dlls in the metamod folder.
Move the file called - if You have:
a) windows - metamod.dll
b) linux - metamod_i386.so
c) linux amd64 - metamod_amd64.so
into the dlls folder.
Move the folder called podbot extracted from
podbot_full_V3_BXY.zip to the addons folder.
NOTE:
If You had already installed some older than podbot 2.6 mm version (some podbot_mm.dll created after 26.04.2004),
we advise you to delete any previous .pxp files (bots experience files). You can find them inside
addons\podbot\wptdefaut folder.
Since the bot now supports the new CS 1.6 weapons, you MUST use the included botweapons.cfg file which takes them into account.
If you attempt to use an older weapon configuration file from POD-bot 2.5 or 2.6 (but not 2.6mm) or some old ".pxp"
files the bot will crash!!!
Podbot mm requires all new config files (included in the fullpack) to the correct work.
- Setting
Set Metamod to load PODBot mm
Run Notepad.
Type:
a) windows: win32 addons/podbot/podbot_mm.dll
b) linux: linux addons/podbot/podbot_mm_i386.so
c) linux amd64: linux addons/podbot/podbot_mm_amd64.so
into the textarea exactly as-is.
 Check if there is a file called
plugins.ini.
If you already have metamod installed (and the above file is there), You only need to add one of these
above lines to metamod's plugins.ini file.
If no - You need to save Your file You created by Notepad as plugins.ini in the correct folder. To do this -
Push Ctrl and S at the same time.
Change Save as type: to All files
Browse to your addons/metamod folder.
Type plugins.ini into the textbox labeled
File name: exactly as-is. Left click Save.
At this moment You have prepared metamod to load podbot mm.
Set Counter-Strike to launch Metamod
Inside the cstrike (or czero) folder You need to find the file called liblist.gam .
Make a copy of it and rename the copy to liblist.old
Open by Notepad the file liblist.gam, find the line gamedll "dlls\mp.dll"
and change it to:
a) windows users: gamedll "addons\metamod\dlls\metamod.dll"
b) linux users: gamedll_linux "addons/metamod/dlls/metamod_i386.so"
c) linux amd64 bit users: gamedll_linux "addons/metamod/dlls/metamod_amd64.so"
then save it.
If You have CS1.6 or CZERO - Run Steam. Login to your account. Right click on Counter-Strike.
Left click on Properties. Left click on Set launch options... Make sure that textbox is empty or at least it calls metamod
with on such command lines:
a) for windows - -dll addons/metamod/dlls/metamod.dll
b) for linux 32 - -dll addons/metamod/dlls/metamod_i386.so
b) for linux amd64 - -dll addons/metamod/dlls/metamod_amd64.so
Left click OK. Left click Close.
That command line here and the liblist.gam calls for metamod they are equivalent, but the higher pririty to call the game dll
is the command line from launch priporeties.
At this moment You have prepared Counter-Strike to load metamod.
- Uninstalling
If You want to uninstall podbot mm only, but Yo still want to use metamod (because of using other mm plugins like AMX MOD X,
AMX etc.) all You need is just remove the line from addons\metamod\plugins\ini file:
a) windows: win32 addons/podbot/podbot_mm.dll
b) linux: linux addons/podbot/podbot_mm_i386.so
c) linux amd64: win32 addons/podbot/podbot_mm_amd64.so
save the file and remove the whole podbot folder if You don't wish to use it anymore.
If You want to uninstall everything (metamod and podbot mm) You need to either rename the file 'liblist.old' (You should've
to create it before from the original 'liblist.gam' file - see above) to 'liblist.gam' in your cstrike (or czero) folder or
You need to edit Your liblist.gam and replace the line:
a) windows users: gamedll "addons\metamod\dlls\metamod.dll"
b) linux users: gamedll_linux "addons/metamod/dlls/metamod_i386.so"
c) linux amd64 bit users: gamedll_linux "addons/metamod/dlls/metamod_amd64.so"
by the line gamedll "dlls\mp.dll", then remove the whole metamod folder
if You don't wish to use it anymore.
|
|


Mushrooms (P. semilanceata)
(see also
Mushrooms & Cluster Headaches)
It was that time of year again. Had started waking up in the night with sore head. Felt blocked up all day and had some background pain. First couple of 1/2 hour long #1s arrived and I new it had come back...... so I dug out my supply of Liberty Cap (preserved in Honey) and boiled up a batch of 12 for 10 minutes. Drank solution slowly over 1/2 hour period and on full stomach.
Less side effects than usual, no feeling of uneasiness this time (must have been the full stomach). Head suddenly cleared 2 hours later (well behind schedule, must have been that full stomach). Didn't realise how bad my head had been till it got better.
Felt pretty good. Stayed up quite late and watched some TV. Next day felt slightly detached from reality, but nothing serious - was in good spirits.
Cluster completely terminated there and then (am Writing this 3 weeks later).
From past experience that single dose is all the treatment I'll need for the next 12 months.
 Wish my doctor would take an interest - perhaps then he could help some other poor bastard!
Nov 8, 1999:
When I was younger and still using Pot I found that it made the headaches worse. As did drinking and smoking. I avoided taking hallucinogentics during episodes because I was scared that combined with CH they might kill me! The strange thing was that I didn't suffer from an CH episodes at all the years I took LSD. That's what initially made me suspect there may be a link.
LSD is the sister drug to both Ergotamin and Methysergide. LSD also contains an Indole ring structure. According to Dogsbody IMITREX is a substituted indole - a sulphonated form of the well known hallucogen DMT, di-methyl triptamine. Now the substance Psilocybin that is found in some magic mushrooms (not Fly Agaric, although it may contain other similar chemicals) is also based around an Indole Ring. Psilocybin is metabolised into Psilocilin, and that substance is almost identical to Serotonin in structure.
The effective dose of Psilocybin is 10Mg. The effective dose of LSD is 0.1Mg. Both substances appear to work equally well, although your mind can tolerate the higher dose of Psilocybin (LSD gives you more bang for your gram).
There are a lot of similarities between Psilocybin, LSD and those drugs used conventionally to treat CH. The only difference is that Psilocybin and LSD are much more effective (and probably safer in such a small and infrequent dose).
November 08, 1999
I think what we need to do here is to gather up to date stats on the both the effectivenss and risks of using Psilocybin/Psilocilin to prevent CH.
So far I have only spoken to one acute sufferer other than myself who has used the treatment. In my case I have been using it (or LSD) for 8 1/2 years and it has been 100% sucessful in preventing CH. The other person has only used it once (recently) and again it was 100% sucessful.
In the guestbook there is a guy called ROB who used LSD for 14 years. He reckons it was 100% successful when he was episodic, but doesn't paint a complete picture of the duration of relief it brings now he is chronic.
Getting info on the risks should be easier. As far as I am aware the risks are extremely small for this magnitude and frequency of dose. The stats on deaths from LSD and mushrooms should be fairly easy to track down.
October 01, 1999
Liberty Cap mushrooms contain a strong hallucinogen called psilocybin. This substance is effective against CH and possibly migraine. Liberty Cap mushrooms are currently in season in the UK.
I strongly recomend consulting a pictorial reference book before seeking out these mushrooms. There are only a handful of fataly toxic mushrooms in the UK and none of them resemble Liberty Cap, but it is better to be safe than sorry.
It is illegal in the UK to be in pocession of processed (including dired) Liberty Cap mushrooms. The law can be circumvented by preserving the fresh mushrooms in honey.
The mushrooms can be ingested raw but this may cause stomach pain and flatulance. The preferred method is to boil the muchrooms for 10-15mins then strain them out and drink the water.
The effective dose is around 10-12 mushrooms (around 1/4 the recreational dose). Ingest slowly over a 30 minute period to avoid unwelcome side effects.
A single dose can provide protection against cluster episodes for 6-12 months. I don't know how well it works on chronic sufferers.
The dose may be taken at any time including outside cluster episodes.
Psilocybin is chemically similar to LSD. LSD is an extract of ergot as are ergotamine and methysergide.
February 21, 2000
I haven't visited for a while, now that my CH is under control there is less incentive for me to check the board on a regular basis.
So I guess the consensus is that we're on to something. Now we have to find a way to take it forward... people with MS have been battling for the last 20 years to have cannaboids prescribed to them.
I've noticed that those who have used the treatment or those that take it seriously don't make any jokes about it. Now I'm all for a little humour but I think in this case it may undermine out credibility. In order to keep the discussion serious I suggest we refer to the active ingredient by it's real name - Psilocilin, as opposed to using the 'S' word. Remember that Psilocybin is metabolised into Psilocilin and it is this compound that is closest to Serotonin.
Another problem we face is that making people aware of this is likely to end with someone getting hurt. There are scores (pardon the pun) of fungi that contain Psilocybin and Psilocin, some of them are stronger than others. Some deadly fungi (especially in North America) look way too similar.
I have always concentrated on Liberty Cap because it is easiest to identify, and nothing looks too similar to it. However the picker must be objective about this - if someone is desperate to locate a particular species they may end up picking something that looks 'close enough', and that is too close for comfort!
Anyway, for the record, this is what I know. In condensed form.
Around 48 Liberty Cap is of similar strength to a street dose of Acid. Liberty Cap is a weak fungus. To treat my episodic CH (2 episodes a year before I started treating it) requires a single dose of 10-12 Liberty Cap. Please remember that it can take 3-4 days for the body to metabolise all the Psilocybin into Psilocin. Liberty Cap contains no Psilocin.
Eating the mushrooms raw is dangerous, they can contain parasite eggs that may damage the liver.  I recommend boiling for 15 mintutes then straining out the mushrooms.
The mushrooms can be stored by preserving them raw in honey. This way they stay potent for longer.
At this dosage there should be little or no psychoactive effects, other than a slight feeling of unease or dread. To get around this I ingest the solution over a 30 min period.
Don't use this to treat individual headaches, it is a preventative! Taking during a headache will put it away, but there may still be shadows or even mild headaches for the next 48 hours. After that everything should clear up.
The active ingredients are ineffective if the treatment is taken more than once in the same 5 day period. In my case the single dose will prevent CH for over a year.
A serious problem is that this is illegal.
 You know the type of thing 'When you're high you never, ever wanna come down' and so forth. This wont to the cause any good.
We also need some good hard stats. I don't think this treatment works for everyone.
This charge of $30K for research study isn't a huge amount of money. I personally could pledge $1000.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Note the report analyses sections at a maximal depth of 3.
Also show sections which don't have requirements.
Show detailed coverage data.
Sort by: spec short namerec track status
Assume % of tests awaiting review will pass review.
Assume a factor of for the test requirements (normative and algo-based tests) of ref-test based specs (*).


Train Schedule
Come check the time or you will miss your ride
Current Train Schedule
Train Name
Destination
Frequency
Next Arrival
Minutes Away
Add Trains
Train Name:
Destination:
First Train Time (HH:mm - military time):
Frequency (min):
Submit


Task Name:
Task Description:
Task Deadline:
Task Priority:
Task Difficulty:
Task Time Consuming Rating:
Task Category:


Former UK PM Blair: Don't hold your breath for UK-U.S. trade deal
LONDON (Reuters) - Former British Prime Minister Tony Blair said on Monday that a UK-U.S. trade deal would be very difficult to agree, saying protectionist sentiment worldwide was making trade agreements harder to negotiate.
“I wouldn’t hold your breath on a United States-UK trade deal, I think it is going to be very difficult,” Blair told a Reuters Newsmaker event.
“In today’s world they (trade deals) are even more difficult because there is a lot of protectionist sentiment.”


RabbitMQ informations - This step will not create any
resources
RabbitMQ cluster name{{ project.code.toLowerCase() }}-The RabbitMQ cluster nameYou can't change it after RabbitMQ
creation.DescriptionRabbitMQ network
{{ projectNetwork }}
RabbitMQ will be added to project Network by defaultRabbitMQ network subnet
{{ projectNetworkSubnet }}
RabbitMQ will be added to project Subnet by defaultRabbitMQ instances keypair
{{ projectKeypair }}
This Keypair will be added to all instances crated 0; else loading_nodes_image"
formControlName="_cluster_cloud_image" label="Select RabbitMQ node image to use" [cloudImages]="cloudImages">


{%extends 'base.html' %} {% block head %} Restricted {% endblock %} {% block content %}
You need to be logged in to use this feature.


C/C++ Projects¶
Read time: 3 minutes (858 words)
My recommended structure for C/C++ projects puts most code in a lib
subdirectory. In order to separate major project components, you can create
subdirectories under lib
. However, doing so introduces a problem if we want
make
to find source files automatically. To solve this problem, I use
another simple Python script to search for code files.
This script recursively searched under the named directory for all files ending with a specified extension:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | import os
import sys
dir = sys.argv[1]
ext = sys.argv[2]
result = []
for root, dirs, files in os.walk(dir):
for name in files:
if name.endswith(ext):
result.append(os.path.join(root,name))
print(" ".join(result));
|
Here is the Makefile` component that uses this script:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | HDRS := $(shell python mk/pyfind.py include .h)
USRCS := $(wildcard src/*.cpp)
LSRCS := $(shell python mk/pyfind.py lib .cpp)
TSRCS := $(wildcard tests/*.cpp)
SRCS := $(USRCS) $(LSRCS) $(TSRCS)
UOBJS := $(USRCS:.cpp=.o)
LOBJS := $(LSRCS:.cpp=.o)
TOBJS := $(TSRCS:.cpp=.o)
OBJS := $(UOBJS) $(LOBJS) $(TOBJS)
ifeq ($(PLATFORM), Windows)
DOBJS = $(subst /,\,$(OBJS))
else
DOBJS = OBJS
endif
CXXFLAGS := -std=c++11 -Iinclude
.PHONY: all
all: $(TARGET) ## build application (default)
$(TARGET): $(UOBJS) $(LOBJS)
$(CXX) -o $@ $^ $(LFLAGS)
%.o: %.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS)
.PHONY: clean ## remove all build artifacts
$(DEL) $(DOBJS)
|
This script searches all subdirectories under the named directory for files
ending with the indicated extension. It then builds another list of object
files. There is one trick that gets a list of object files using the standard
Windows backslah path separater. This is needed so the del
command will
work properly when we set up a clean
target on a PC.


SQLShare is an easier way to store and share your data.
Dataset {{dataset_name}} - Accept
You will be required to log in using a Google Account or your UW NetID.


Hover over the graph of co-authors and venues to see papers. Click to freeze or unfreeze. Reload to change layout. Data from DBLP; Javascript from d3js; Style from Bootstrap; All original authorgraph.js code is under MIT licence © George Danezis (2014).