Posts

Showing posts from May, 2007

Are Multiple `.gitignore`s Frowned On?

Answer : I can think of at least two situations where you would want to have multiple .gitignore files in different (sub)directories. Different directories have different types of file to ignore. For example the .gitignore in the top directory of your project ignores generated programs, while Documentation/.gitignore ignores generated documentation. Ignore given files only in given (sub)directory (you can use /sub/foo in .gitignore , though). Please remember that patterns in .gitignore file apply recursively to the (sub)directory the file is in and all its subdirectories, unless pattern contains '/' (so e.g. pattern name applies to any file named name in given directory and all its subdirectories, while /name applies to file with this name only in given directory). As a tangential note, one case where the ability to have multiple .gitignore files is very useful is if you want an extra directory in your working copy that you never intend to commit. Just put

Arrow Styles In TikZ Trees

Image
Answer : There are easier ways to draw trees, but if you wish to stick to TikZ's verbosity, you can override the style with another. \documentclass[border=9pt]{standalone} \usepackage[]{tikz} \begin{document} \tikzset{ breakarrow/.style={->, dashed}, myarrow/.style={solid, -}, varnode/.style = {shape=rectangle, rounded corners, draw, align=center, top color=red!20, bottom color=white} } \begin{tikzpicture}[sibling distance=6em, every node/.style = {shape=rectangle, rounded corners, draw, align=center, top color=white, bottom color=violet!20}] \node {/} child { node {tmp/}} child { node {initrd.img}} child { node {usr/} child { node {local/}} child { node {lib/}} child { node [varnode] {$\alpha_{/usr}$} edge from parent [breakarrow]}}; \end{tikzpicture} \begin{tikzpicture}[sibling distance=6em, every node/.style = {shape=rectangle, rounded corners, draw, align=center, top color=white, bottom color=violet!20}] \node [varnode] {$\alpha_{/u

Azure AD Vs Azure AD B2C Vs Azure AD B2B

Answer : Azure AD is a directory service with the goal of serving organisations and their needs for identity management in the cloud. You develop against Azure AD, you can secure your applications with it - their users in Azure AD tenants can use it. Your application is targeted for a specific organisation or multiple organisations using Azure AD (Office 365). Azure AD B2B is just a feature of Azure AD. It allows organisations to grant access to their applications and services for users from other tenants. From your app perspective nothing changes. It is still same Azure AD app. Azure AD B2B has an API which can be used to create flows for the invitation of users from another directory but it is not changing your app design, etc. Azure AD B2C is another service built on the same technology but not the same in functionality as Azure AD. Azure AD B2C target is to build a directory for consumer applications where users can register with e-mail ID or social providers like Google,

All Compiler Errors Have To Be Fixed Before You Can Enter Playmode! Code Example

Example: all compiler errors have to be fixed before entering playmode HOW TO GET RID OF All "compiler errors have to be fixed before you can enter playmode" 1 - check in the console tab if you have some errors in a code you wrote //the ones in red are the ones that probably are bothering you 2 - if you already fixed all the errors and you didnt get rid of it, try restarting unity 3 - if it didnt work just make another project 4 - if it DIDNT work reinstall unity 5 - if it didnt work call the the tech support 6 - if it didnt work restart yourselve

Cdn Animate Css Code Example

Example: animate.css < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" / >

A Windows Equivalent Of The Unix Tail Command

Answer : If you use PowerShell then this works: Get-Content filenamehere -Wait -Tail 30 Posting Stefan's comment from below, so people don't miss it PowerShell 3 introduces a -Tail parameter to include only the last x lines I'd suggest installing something like GNU Utilities for Win32. It has most favourites, including tail. I've always used Baretail for tailing in Windows. It's free and pretty nice. Edit: for a better description of Baretail see this question

C - Freeing Structs

Answer : Simple answer : free(testPerson) is enough . Remember you can use free() only when you have allocated memory using malloc , calloc or realloc . In your case you have only malloced memory for testPerson so freeing that is sufficient. If you have used char * firstname , *last surName then in that case to store name you must have allocated the memory and that's why you had to free each member individually. Here is also a point it should be in the reverse order; that means, the memory allocated for elements is done later so free() it first then free the pointer to object. Freeing each element you can see the demo shown below: typedef struct Person { char * firstname , *last surName; }Person; Person *ptrobj =malloc(sizeof(Person)); // memory allocation for struct ptrobj->firstname = malloc(n); // memory allocation for firstname ptrobj->surName = malloc(m); // memory allocation for surName . . // do whatever you want free(ptrobj->surName); free(ptrobj-&

16cm In Inches Code Example

Example: cm to inches const cm = 1 ; console . log ( `cm : $ { cm } = in : $ { cmToIn ( cm ) } ` ) ; function cmToIn ( cm ) { var in = cm / 2.54 ; return in ; }

Best ORM SQL Library For Python

Answer : SQL libraries are used with relational databases. In a relational database, the data is stored in different tables, each containing multiple records. These tables are connected using one or more relations. Let check the best SQL libraries to work with in Python Peewee # Peewee is a simple and small ORM. It has few (but expressive) concepts, making it easy to learn and intuitive to use. a small, expressive ORM python 2.7+ and 3.4+ (developed with 3.6) supports sqlite, mysql, postgresql and cockroachdb tons of extensions To install peewee pip install peewee Basic usage: from peewee import * db = SqliteDatabase ( 'people.db' ) class Person ( Model ) : name = CharField ( ) birthday = DateField ( ) class Meta : database = db # This model uses the "people.db" database. Django ORM

Convert Youtube To Mp4 Hd Code Example

Example 1: youtube to mp4 ytmp3 . cc is the best by far Example 2: youtube to mp4 flvto . biz is great for it

Bootstrap Responsive Table Not Acting Responsive

Answer : Please re-read the docs on this feature. The table-responsive class needs to be on a wrapper div, not the table itself. <div class="table-responsive"> <table class="table"> ... </table> </div>

Apple - Apple Music: How To View The List Of All Loved Items?

Image
Answer : I’m guessing these answers didn’t solve your problem. They didn’t solve mine. Insead I went and got my data from Apple: Head to Apple’s Data and Privacy portal. Log in with the Apple ID for which you’d like to download data. Under Get a copy of your data , click Request a copy of your data . Select Apple media services information , then press Continue . Now click Complete the request . Wait a frickin’ week! Download the file they email you a link to. Inside the zip you will find another zip called apple_media_services.zip . Inside that zip you will find Apple Music Likes and Dislikes.csv . Super irritating that you have to go through such process to find this. If you are listening in iTunes you can make a smart playlist which automatically adds all loved songs to it. Note that this playlist will only contain songs that you "loved" on each respective device. I.e. if you love a song on your iPhone it will not appear in your "loved songs&qu

Best Way To Compare Dates Without Time In SQL Server

Answer : Don't use convert - that involves strings for no reason. A trick is that a datetime is actually a numeric, and the days is the integer part (time is the decimal fraction); hence the day is the FLOOR of the value: this is then just math, not strings - much faster declare @when datetime = GETUTCDATE() select @when -- date + time declare @day datetime = CAST(FLOOR(CAST(@when as float)) as datetime) select @day -- date only In your case, no need to convert back to datetime; and using a range allows the most efficent comparisons (especially if indexed): declare @when datetime = 'Feb 15 2012 7:00:00:000PM' declare @min datetime = FLOOR(CAST(@when as float)) declare @max datetime = DATEADD(day, 1, @min) select * from sampleTable where DateCreated >= @min and DateCreated < @max Simple Cast to Date will resolve the problem. DECLARE @Date datetime = '04/01/2016 12:01:31' DECLARE @Date2 datetime = '04/01/2016' SELECT CAST(@Date as date)

Bash: Telnet: Command Not Found Code Example

Example: bash: nvm: command not found source ~/.nvm/nvm.sh

Bootstrap Table Striped: How Do I Change The Stripe Background Colour?

Answer : Add the following CSS style after loading Bootstrap: .table-striped>tbody>tr:nth-child(odd)>td, .table-striped>tbody>tr:nth-child(odd)>th { background-color: red; // Choose your own color here } .table-striped > tbody > tr:nth-child(2n+1) > td, .table-striped > tbody > tr:nth-child(2n+1) > th { background-color: red; } change this line in bootstrap.css or you could use (odd) or (even) instead of (2n+1) If you are using Bootstrap 3, you can use Florin's method, or use a custom CSS file. If you use Bootstrap less source instead of processed css files, you can directly change it in bootstrap/less/variables.less . Find something like: //** Background color used for `.table-striped`. @table-bg-accent: #f9f9f9;

Strrchr Example

Defined in header <string.h> char * strrchr ( const char * str , int ch ) ; Finds the last occurrence of ch (after conversion to char as if by (char)ch ) in the null-terminated byte string pointed to by str (each character interpreted as unsigned char ). The terminating null character is considered to be a part of the string and can be found if searching for '\0' . The behavior is undefined if str is not a pointer to a null-terminated byte string. Parameters str - pointer to the null-terminated byte string to be analyzed ch - character to search for Return value Pointer to the found character in str , or null pointer if no such character is found. Example # include <string.h> # include <stdio.h> int main ( void ) { char szSomeFileName [ ] = "foo/bar/foobar.txt" ; char * pLastSlash = strrchr ( szSomeFileName , '/' ) ; char * pszBaseName = pLastSlash ? p

Add-apt-repository: Command Not Found Ubuntu 18.04 Code Example

Example 1: apt-add-repository command not found sudo apt - get install software - properties - common sudo apt - get update Example 2: Fix ‘add-apt-repository command not found’ Error on Ubuntu and Debian //Debian GNU/Linux and chromebook linux sudo apt install software - properties - common Example 3: bash: apt-add-repository: command not found apt - get install software - properties - common