Tutorial by Examples

To enable Cross-Origin Resource Sharing (CORS) in Apache you'll need to set at least one HTTP header which changes it (the default behaviour is to block CORS). In the following example, we're going to be setting this HTTP header inside .htaccess, but it can also be set in your site your-site.conf fi...
#include <string.h> #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <unistd.h> #include <dirent.h> #include <ctype.h> int main(int argc, char **argv) { const char *dname = (argc > 1 ? argv[1] : "."); DI...
#define _XOPEN_SOURCE 500 #include <stdlib.h> /* for exit() */ #include <stdio.h> /* for remove() */ #include <ftw.h> /* for nftw() */ int unlink_cb( const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf) { return remove(fpath); } in...
Open Android Studio Open Your Project Click on Gradle (From Right Side Panel, you will see Gradle Bar) Click on Refresh (Click on Refresh from Gradle Bar, you will see List Gradle scripts of your Project) Click on Your Project (Your Project Name form List (root)) Click on Tasks Click on andr...
You can customize your Layout of Views by click-dragging the Tab of any View to one of several locations. Dropping a Tab in the Tab Area of an existing window will add the Tab beside any existing Tabs. Alternatively, dropping a Tab in any Dock Zone will add the View in a new window. Tabs can also...
menu.xml - (res -> menu) <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context=".HomeActivity"> <item...
TextViewPlus.java: public class TextViewPlus extends TextView { private static final String TAG = "TextView"; public TextViewPlus(Context context) { super(context); } public TextViewPlus(Context context, AttributeSet attrs) { super(context, attrs)...
CustomProgressBarActivity.java: public class CustomProgressBarActivity extends AppCompatActivity { private TextView txtProgress; private ProgressBar progressBar; private int pStatus = 0; private Handler handler = new Handler(); @Override protected void onCreate(Bun...
Get Compressed Bitmap from Singleton class: ImageView imageView = (ImageView)findViewById(R.id.imageView); Bitmap bitmap = ImageUtils.getInstant().getCompressedBitmap("Your_Image_Path_Here"); imageView.setImageBitmap(bitmap); ImageUtils.java: public class ImageUtils { public ...
There is a signal WINCH ( WINdowCHange), which is fired when one resizes a terminal window. declare -x rows cols update_size(){ rows=$(tput lines) # get actual lines of term cols=$(tput cols) # get actual columns of term echo DEBUG terminal window has no $rows lines and is $cols chara...
Using a pipe makes the output of a command be the input of the next one. ls -1 | grep -c ".conf" In this case the ouput of the ls command is used as the input of the grep command. The result will be the number of files that include ".conf" in their name. This can be used to ...
MainActivity.java: public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } } activity_main.xml: <?xml version="1...
Due to the stucture of SAS, there are three main ways to create "Hello World!" examples: Within a data step to put a message into the SAS log (_null_ denotes that no output dataset should be created): data _null_; put "Hell" "o World!"; run; Within a da...
tf.exe get /all /recursive /force /overwrite $/ Gets all files and directories, and will replace any files that are not currently checked out in the workspace (including files that have been edited).
Upload a file to server is also a post. You can easily upload a file through WWW, like the below: Upload A Zip File To Server string mainUrl = "http://server/upload/"; string saveLocation; void Start() { saveLocation = "ftp:///home/xxx/x.zip"; // The file path. ...
Union operation combines the results of two or more queries into a single result set that includes all the rows that belong to all queries in the union and will ignore any duplicates that exist. Union all also does the same thing but include even the duplicate values. The concept of union operation ...
This will get all the orders for all customers: SELECT c.CustomerName, o.OrderID FROM Customers AS c INNER JOIN Orders AS o ON c.CustomerID = o.CustomerID ORDER BY c.CustomerName, o.OrderID; This will count the number of orders for each customer: SELECT c.CustomerName, C...
6 const iterable = [0, 1, 2]; for (let i of iterable) { console.log(i); } Expected output: 0 1 2 The advantages from the for...of loop are: This is the most concise, direct syntax yet for looping through array elements It avoids all the pitfalls of for...in Unlike forEach(), ...
Warning for...in is intended for iterating over object keys, not array indexes. Using it to loop through an array is generally discouraged. It also includes properties from the prototype, so it may be necessary to check if the key is within the object using hasOwnProperty. If any attributes in th...
Detailed instructions on getting ssrs-2008-r2 set up or installed.

Page 780 of 1336