Posts

Showing posts from May, 2014

Media Query For Tablet And Mobile Code Example

Example 1: media query for mobile view css @ media only screen and ( max - width : 600 px ) { body { background - color : lightblue ; } } Example 2: media query desktop /* Extra small devices (phones, 600px and down) */ @ media only screen and ( max - width : 600 px ) { . . . } /* Small devices (portrait tablets and large phones, 600px and up) */ @ media only screen and ( min - width : 600 px ) { . . . } /* Medium devices (landscape tablets, 768px and up) */ @ media only screen and ( min - width : 768 px ) { . . . } /* Large devices (laptops/desktops, 992px and up) */ @ media only screen and ( min - width : 992 px ) { . . . } /* Extra large devices (large laptops and desktops, 1200px and up) */ @ media only screen and ( min - width : 1200 px ) { . . . } Example 3: media querries for tablets /* ----------- iPad 1, 2, Mini and Air ----------- */ /* Portrait and Landscape */ @ media only screen and ( min - device - width : 768 px

Osstream Iterator Code Example

Example: c++ std::copy to cout //it_start and it_end are the start and end iterators of your container //(ie. vec.begin() and vec.end()) //T is the type of your container (for example, for a std::vector<int> then //T is int) //separator is a string that will be inserted between each element std :: copy ( it_start , it_end , std :: ostream_iterator < T > ( std :: cout , separator ) ) ;

Bcrypt Js Code Example

Example 1: how to hash password in node js npm i bcrypt const bcrypt = require ( 'bcrypt' ) ; async function hashIt ( password ) { const salt = await bcrypt . genSalt ( 6 ) ; const hashed = await bcrypt . hash ( password , salt ) ; } hashIt ( password ) ; // compare the password user entered with hashed pass. async function compareIt ( password ) { const validPassword = await bcrypt . compare ( password , hashedPassword ) ; } compareIt ( password ) ; Example 2: npm bcrypt npm install bcrypt Example 3: bcryptjs npm i bcryptjs # yarn yarn add bcryptjs Example 4: bcrypt >>> import bcrypt >>> password = b "super secret password" >>> # Hash a password for the first time , with a randomly - generated salt >>> hashed = bcrypt . hashpw ( password , bcrypt . gensalt ( ) ) >>> # Check that an unhashed password matches one that has previously been >>> # hashed >>&

Observables In Angular Example

Angular makes use of observables as an interface to handle a variety of common asynchronous operations. For example: You can define custom events that send observable output data from a child to a parent component. The HTTP module uses observables to handle AJAX requests and responses. The Router and Forms modules use observables to listen for and respond to user-input events. Transmitting data between components Angular provides an EventEmitter class that is used when publishing values from a component through the @Output() decorator. EventEmitter extends RxJS Subject , adding an emit() method so it can send arbitrary values. When you call emit() , it passes the emitted value to the next() method of any subscribed observer. A good example of usage can be found in the EventEmitter documentation. Here is the example component that listens for open and close events: <app-zippy (open)="onOpen($event)" (close)="onClose($event)"></app-zippy>

How To Convert Int To Char In Embedded C Code Example

Example: int to char in c c = i + '0' ;

Check Postgres Version Code Example

Example 1: check postgres version psql --version Example 2: check postgres version in ubuntu $ locate bin/postgres /usr/lib/postgresql/9.3/bin/postgres Example 3: get postgres version postgres -V // or psql --version Example 4: postgresql version command # SSH psql --version # SQL SELECT version ( ) ; Example 5: postgres version command SELECT version ( ) ;

Bootstrap Responsive Table Smaller Than Div Code Example

Example 1: bootstrap 3 table Bootstrap Basic Table A basic Bootstrap table has a light padding and only horizontal dividers. The .table class adds basic styling to a table ------------------------------------------------------------ Striped Rows The .table-striped class adds zebra-stripes to a table Bordered Table The .table-bordered class adds borders on all sides of the table and cells ------------------------------------------------------------ Hover Rows The .table-hover class adds a hover effect (grey background color) on table rows ------------------------------------------------------------ Condensed Table The .table-condensed class makes a table more compact by cutting cell padding in half ------------------------------------------------------------ Contextual Classes Contextual classes can be used to color table rows ( < tr > ) or table cells ( < td > ) The contextual classes that can be used are: Class Description .active Applies the hover color to the t

Bcrypt Typescript Code Example

Example: bcryptjs npm i bcryptjs # yarn yarn add bcryptjs

Are There Any Blatantly Evil Followers That I Can Sacrifice For Boethiah's Calling?

Answer : You get an evil follower, Eola, by completing Namira's daedric quest. This requires you to do something quite evil yourself, though. You can also get a few evil followers from the Dark Brotherhood questline, but they are not eligible to be sacrificed. I went with Marcuio (Riften) because he was really pompous. And it was him or the Whiterun guy with the ram-horned helmet that made a lewd comment to my char (female, because I'm a female). Being someone who gets tired of that in games, ....yeah. The odd thing is that I take Faendal usually because the story line really seems to get you to walk a morally gray line at least, which I have no problem with, but he keeps my char in check. SPOILER: If you go to solsthiem and do the 'unearthed' quest once it's done if you let Ralis live, use him as your follower. It's soooooo beautiful.

Chef Download And Install FAQ

[edit on GitHub] This section tracks some questions that are frequently encountered when downloading and installing the hab binary. Q: Can I just download a GitHub release of Chef Habitat? A: While we do cut releases in GitHub as part of our release process those archives are going to be a .tar point in time of our source code. As the hab cli is written in Rust, if you follow this approach you’ll need to compile the source for your platform. Q: Compile for my platform? Does that mean there aren’t any OS native packages of hab ? A: We publish compiled packages for OSX, Linux, and Windows. hab has a requirement of either a Linux kernel >= 2.6.32, OSX >= 10.9, or 64-bit Windows 10 Pro, Enterprise, or Education editions (1511 November update, build 10586 or later) with Hyper-V enabled. Q: What if I need an old version of hab ? A: We’ve got you covered! The script we provide for doing curl-bash installations will allow you to specify a -v flag to pull down a specific

Are Table Names In MySQL Case Sensitive?

Answer : In general: Database and table names are not case sensitive in Windows, and case sensitive in most varieties of Unix. In MySQL, databases correspond to directories within the data directory. Each table within a database corresponds to at least one file within the database directory. Consequently, the case sensitivity of the underlying operating system plays a part in the case sensitivity of database and table names. One can configure how tables names are stored on the disk using the system variable lower_case_table_names (in the my.cnf configuration file under [mysqld]). Read the section: 10.2.2 Identifier Case Sensitivity for more information. Database and table names are not case sensitive in Windows, and case sensitive in most varieties of Unix or Linux. To resolve the issue, set the lower_case_table_names to 1 lower_case_table_names=1 This will make all your tables lowercase, no matter how you write them. It depends upon lower_case_table_nam

Badlionclient Download Code Example

Example: badlion client download Good job, my friend! You decided to not use vanilla minecraft! So, Badlion is a featurefull launcher for minecraft, which contains many mods such as: Optifine, BetterFPS and much more! If you are in for the features, Badlion would be the best choice for you. If you want to focus more on pvp, I would reccomend Lunar or Labymod.

Aside Right Html Code Example

Example 1: html aside < aside > < h2 > Aside Header </ h2 > < p > Paragraph </ p > < p > Paragraph < a href = " url " > Inline Link </ a > </ p > </ aside > Example 2: aside html < p > Salamanders are a group of amphibians with a lizard-like appearance, including short legs and a tail in both larval and adult forms. </ p > < aside > < p > The Rough-skinned Newt defends itself with a deadly neurotoxin. </ p > </ aside >

Assign Edge Weights To A Networkx Graph Using Pandas Dataframe

Image
Answer : Let's try: import pandas as pd import numpy as np import networkx as nx import matplotlib.pyplot as plt df = pd.DataFrame({'number':['123','234','345'],'contactnumber':['234','345','123'],'callduration':[1,2,4]}) df G = nx.from_pandas_edgelist(df,'number','contactnumber', edge_attr='callduration') durations = [i['callduration'] for i in dict(G.edges).values()] labels = [i for i in dict(G.nodes).keys()] labels = {i:i for i in dict(G.nodes).keys()} fig, ax = plt.subplots(figsize=(12,5)) pos = nx.spring_layout(G) nx.draw_networkx_nodes(G, pos, ax = ax, labels=True) nx.draw_networkx_edges(G, pos, width=durations, ax=ax) _ = nx.draw_networkx_labels(G, pos, labels, ax=ax) Output: Do not agree with what has been said. In the calcul of different metrics that takes into account the weight of each edges like the pagerank or the betweeness centrality your weight would

Cherry Mx Blue Vs Red Vs Brown Code Example

Example: cherry mx blue vs gateron blue If you like concrete and less wobling, go cherry. Otherwise to save cost go gateron. For me cherry has way better typing feel.

Accolade Sentence Code Example

Example: dissuade sentence She said nothing to dissuade him.

Adding Http Headers To Window.location.href In Angular App

Answer : When you use $window.location.href the browser is making the HTTP request and not your JavaScript code. Therefore, you cannot add a custom header like Authorization with your token value. You could add a cookie via JavaScript and put your auth token there. The cookies will automatically be sent from the browser. However, you will want to review the security implications of using a cookie vs. a header. Since both are accessible via JavaScript, there is no additional attack vector there. Unless you remove the cookie after the new page loads, there may be a CSRF exploit available. This answer is NOT a safe way, as the token is exposed in the URL, which is logged in browser history, access logs, etc. Use a domain cookie instead. I'll leave the answer as it can be an easy way to debug in your local setup. I am using JWT as authentication on a Laravel PHP backend, and it works by putting ?token=... in the URL. For example, when using AngularJS with satellizer plug