Posts

Showing posts from January, 2006

Can I Remove A RAR File's (known) Password Without Recompressing The Archive?

Answer : Out of the box, no, you can not. Version 3 of the RAR file format (implemented first in WinRAR 2.9) encrypts the actual data itself, as well as the file headers (if requested) using AES-128 encryption. With just WinRAR, it is impossible to simply "remove" the password from an archive, since the data itself is encrypted with the password. You could make a quick batchfile implementing a "remove password" feature, which could simply unrar the archive, and then re-compress the files without a password. Technically , the data is compressed before being encrypted. This indicates that, given enough knowledge of the RAR file format itself, one could create a tool to AES-decrypt the datastream of the compressed files, and then save it into a new RAR archive. It should be noted, however, that this requires extensive knowledge of the file format itself. Given the number of open-source tools that support password-protected RAR files (e.g. unar), one c

Checkout Jenkins Pipeline Git SCM With Credentials?

Answer : You can use the following in a pipeline: git branch: 'master', credentialsId: '12345-1234-4696-af25-123455', url: 'ssh://git@bitbucket.org:company/repo.git' If you're using the ssh url then your credentials must be username + private key. If you're using the https clone url instead of the ssh one, then your credentials should be username + password. To explicitly checkout using a specific credentials stage('Checkout external proj') { steps { git branch: 'my_specific_branch', credentialsId: 'my_cred_id', url: 'ssh://git@test.com/proj/test_proj.git' sh "ls -lat" } } To checkout based on the configred credentials in the current Jenkins Job stage('Checkout code') { steps { checkout scm } } You can use both of the stages within a single Jenkins file. If you want

Git Revert All Changes Code Example

Example 1: git discard local changes # Discarding local changes ( permanently ) to a file : git checkout -- < file > # Discard all local changes to all files permanently : git reset -- hard Example 2: git undo all changes git reset -- hard Example 3: how to remove file changes in git git clean - df git checkout -- . Example 4: undo unstaged changes git git checkout -- . Example 5: git reset one file git checkout HEAD -- my - file . txt Example 6: git discard staged changes git reset HEAD git checkout .

Async/await In Angular `ngOnInit`

Answer : It is no different than what you had before. ngOnInit will return a Promise and the caller will ignore that promise. This means that the caller will not wait for everything in your method to finish before it proceeds. In this specific case it means the view will finish being configured and the view may be launched before this.data is set. That is the same situation you had before. The caller would not wait for your subscriptions to finish and would possibly launch the app before this.data had been populated. If your view is relying on data then you likely have some kind of ngIf setup to prevent you from accessing it. I personally don't see it as awkward or a bad practice as long as you're aware of the implications. However, the ngIf can be tedious (they would be needed in either way). I have personally moved to using route resolvers where it makes sense so I can avoid this situation. The data is loaded before the route finishes navigating and I can

Alt-Gr Key Is Not Working In Ubuntu 13.10

Image
Answer : This answer has screenshots for Gnome-Shell (Ubuntu Gnome 13.10). I suppose it will be similar for standard Unity, but if not, please chime in. First of all (and this is the most common problem), to have AltGr working you need a keyboard layout which uses it . For example, this is my keyboard layout (Settings -> Region and Language): English (US, international with dead keys) has AltGr. English (US) has NO AltGr. English (international AltGr dead keys) has AltGr. (My preferred layout is the third one, really). If the layout does not map AltGr+Key to anything, like for example the default "English (US)", AltGr will not work even if it's activated in the Keyboard -> Shortcuts panel. This is normally sufficient. To change the position of the AltGr you go to Settings -> Keyboard and set the "Alternative Characters Key": For example, my keyboard has no physical AltGr key, so I mapped it to the Right Alt key. Now with the t

CodeIgniter 404 Page Not Found, But Why?

Answer : The cause of the problem was that the server was running PHP using FastCGI. After changing the config.php to $config['uri_protocol'] = "REQUEST_URI"; everything worked. You could try one of two things or a combination of both. Be sure that your controller's name starts with a capital letter. eg "Mycontroller.php" If you have not made any changes to your route, for some strange reason, you might have to include capital letters in your url. e.g if your controller is 'Mycontroller.php' with a function named 'testfunc' inside it, then your url will look like this: "http://www.yourdomain/index.php/Mycontroller/testfunc". Note the capital letter. (I'm assuming you haven't added the htaccess file to remove the 'index.php' part. If you have, just remove it from the url.) I hope this helps someone Leaving this answer here for others who ran into my situation. My codeigniter app was working fin

Youtube To Mp3 Convert Online Y2mate Code Example

Example: youtube mp3 converter You can use WebTools , it's an addon that gather the most useful and basic tools such as a synonym dictionary , a dictionary , a translator , a youtube convertor , a speedtest and many others ( there are ten of them ) . You can access them in two clics , without having to open a new tab and without having to search for them ! - Chrome Link : https : //chrome.google.com/webstore/detail/webtools/ejnboneedfadhjddmbckhflmpnlcomge/ Firefox link : https : //addons.mozilla.org/fr/firefox/addon/webtools/

Millis() Arduino What Is Code Example

Example 1: arduino millis() /*Description Returns the number of milliseconds passed since the Arduino board began running the current program. This number will overflow (go back to zero), after approximately 50 days. Syntax */ time = millis ( ) ; Example 2: arduino millis /*Description Returns the number of milliseconds passed since the Arduino board began running the current program. This number will overflow (go back to zero), after approximately 50 days. Syntax */ time = millis ( ) /* Returns Number of milliseconds passed since the program started. Return Data type: unsigned long. */

Best Clothes Early In Fallout 4

Answer : The Vault Suit is the correct choice. My first character was still wearing the vault suit at level 20, despite trying a number of alternatives. This is mainly due to the suit's radiation resistance. Other undergarments are somewhat useful due to bonuses to SPECIAL attributes, but as soon as you run into some radiation you get toasted, whereas that same radiation would have barely registered with the vault suit on. Still, these other undergarments have situational uses. Undergarments that add to CHA can be a huge help when bartering or persuading. Undergarments that add to INT are good to put on before turning in quests. The BOS Uniform grants 5 rad resist, so that might be a possibility as well. However, you can't upgrade the BOS Uniform. This means that it is quickly outclassed by the vault suit, which can be upgraded multiple times. You could also consider wearing headgear that has rad resists, like an Assault Gas Mask, but then you miss out on the attribute

Bootstrap Card Codepen Code Example

Example 1: boostrap card < div class = " card " style = " width : 18 rem ; " > < div class = " card-body " > < h5 class = " card-title " > Card title </ h5 > < h6 class = " card-subtitle mb-2 text-muted " > Card subtitle </ h6 > < p class = " card-text " > Some quick example text to build on the card title and make up the bulk of the card's content. </ p > < a href = " # " class = " card-link " > Card link </ a > < a href = " # " class = " card-link " > Another link </ a > </ div > </ div > Example 2: bootsrap card < div class = " card " style = " width : 18 rem ; " > < img src = " ... " class = " card-img-top " alt = " ... " > < div class = " card-body " > &

C Int To Char Code Example

Example 1: char to int c++ int x = (int)character - 48; Example 2: integer to char c++ // for example you have such integer int i = 3; // and you want to convert it to a char so that char c = '3'; what you need to do is, by adding i to '0'. The reason why it works is because '0' actually means an integer value of 48. '1'..'9' means 49..57. This is a simple addition to find out corresponding character for an single decimal digit integer: i.e. char c = '0' + i; If you know how to convert a single decimal digit int to char, whats left is how you can extract individual digit from a more-than-one-decimal-digit integer it is simply a simple math by making use of / and % int i = 123 % 10; // give u last digit, which is 3 int j = 123 / 10; // give remove the last digit, which is 12 The logic left is the homework you need to do then. Example 3: C++ int to char* std::string s = std::to_string(number); char const *pchar = s.c_str();

Alpine Linux Package Manager Code Example

Example: apk add apk-tools 2.8.2, compiled for x86_64. usage: apk COMMAND [-h|--help] [-p|--root DIR] [-X|--repository REPO] [-q|--quiet] [-v|--verbose] [-i|--interactive] [-V|--version] [-f|--force] [--force-binary-stdout] [--force-broken-world] [--force-non-repository] [--force-old-apk] [--force-overwrite] [--force-refresh] [-U|--update-cache] [--progress] [--progress-fd FD] [--no-progress] [--purge] [--allow-untrusted] [--wait TIME] [--keys-dir KEYSDIR] [--repositories-file REPOFILE] [--no-network] [--no-cache] [--cache-dir CACHEDIR] [--arch ARCH] [--print-arch] [ARGS]... The following commands are available: add Add PACKAGEs to 'world' and install (or upgrade) them, while ensuring that all dependencies are met del Remove PACKAGEs from 'world' and uninstall them fix Repair package or upgrade it without modifying main dependencies update Update repository indexes from all remote repositories info

Increase Circle Avatar Size Flutter Code Example

Example: how to make an image contained in circle avatar in flutter CircleAvatar ( radius : 30.0 , backgroundImage : NetworkImage ( "${snapshot.data.hitsList[index].previewUrl}" ) , backgroundColor : Colors . transparent , )

Can VLC Crop Black Borders On The Fly?

Answer : If you press C it will toggle through the crop ratios and may help you with eliminating the black bars. Well, I should have checked VLC's Video menu as I did while posting this question... There's the crop to 16:9 option I was looking for... Anyway, if you find an automatic cropping estimation method, the bounty will still be there. Simply go to VLC Player preferences > Video (you must be in "All" mode, not "Simple" mode). On the right-hand side, scroll down to "Video cropping" and type in either "16:10", "16:9", or "4:3", depending on what your screen's aspect ratio is. Press the Save button at the bottom. If black lines remain, then they are actually part of the video as opposed to just an empty section of the screen. In this case, adjusting manually is the only logical option left.

Add Latex Href Code Example

Example 1: url in latex \usepackage{hyperref} %Use \href{URL}{DESCRIPTION} to add a link with description. %Use \url{URL} to add a link without a description. Example 2: include link in latex \documentclass{article} % or any other documentclass %... \usepackage{hyperref} %... \begin{document} %... \end{document}

CakePHP Log\Engine (namespace)

Classes summary ArrayLog Array logger. ConsoleLog Console logging. Writes logs to console output. BaseLog Base log engine class. SyslogLog Syslog stream for Logging. Writes logs to the system logger FileLog File Storage stream for Logging. Writes logs to different files based on the level of log it is.

Android Mkdir Not Making Folder

Answer : Does the /mnt/sdcard/tallgrass/ directory exist? (I'm guessing not, but you never know.) The File.mkdirs() method will create all needed directories; mkdir() will only create the last directory in the pathname.

Alias Meaning In English Code Example

Example: Alias meaning Alias synonym is AKA (also known as) :D

Can I Install An Alternative Window Manager On Mac OS X?

Answer : Is there an alternative window manager for OS X (…)? It depends on what you define as window manager. If you mean the entire framework that draws the windows, then no. This has always been the Window Server in conjunction with Quartz. If you mean apps that enhance some of the window switching and layouting behavior, there are plenty of those, but none of them really replaces anything. Have a look at the following projects or tools if you want to tweak the window behavior, mostly with respect to resizing automatically: xnomad, a keyboard based open-source tiling window manager Slate, based on xnomad Spectacle, keyboard-controlled window moving and resizing TylerWM, like Spectacle SizeUp, same as Spectacle, but costs something Cinch, Windows-like Aero Snap resizing BetterTouchTool, mostly for mouse and trackpad gestures, but has window snapping Optimal Layout, Mizage, Moom, Window Magnet, etc. Can I move the "stoplight" icons from the left to

Can A Printer Print White Color?

Answer : You will not get anything on the paper with a basic CMYK inkjet or laser printer. The CMYK color mixing is subtractive , meaning that it requires the base that is being colored to have all colors (i.e., White ) So that it can create color variation through subtraction: White - Cyan - Yellow = Green White - Yellow - Magenta = Red White - Cyan - Magenta = Blue White is represented as 0 cyan, 0 yellow, 0 magenta, and 0 black - effectively, 0 ink for a printer that simply has those four cartridges. This works great when you have white media, as "printing no ink" simply leaves the white exposed, but as you can imagine, this doesn't work for non-white media. If you don't have a base color to subtract from (i.e., Black ), then it doesn't matter what you subtract from it, you still have the color Black. As others are pointing out, there are special printers which can operate in the CMYW color space, or otherwise have a white ink or toner. These can

Android PreferenceActivity Dialog With Number Picker

Answer : Subclass DialogPreference to build your own NumberPickerPreference . I have implemented one below for you. It works perfectly fine, but is not feature complete. For example the minimum and maximum values are hard-coded constants. These should really be attributes on the preference xml declaration. To get that to work you would need to add an attrs.xml file specifying your custom attributes. For the full implementation of the NumberPicker preference widget that supports custom xml attributes in a library project and a demo app showing how to use it, see GitHub: https://github.com/Alobar/AndroidPreferenceTest You would use the widget as any other preference widget, except you have to fully qualify the name: preferences.xml <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <com.example.preference.NumberPickerPreference android:key="key_number" android:title="Give me a number"

What Is Volatile Variable In C Code Example

Example 1: declaring a volatile in c //volatile keyword usage in C # include <stdio.h> int main ( ) { //different methods of declaring and initializing volatile variables //method 1 - volatile int int volatile number1 = 10 ; //method 2 - volatile int volatile int number2 ; number2 = 20 ; //method 3 - volatile pointer int volatile * p1 ; p1 = & number1 ; //method 4 - volatile double pointer volatile int * * p2 ; p2 = & p1 ; printf ( "%d %d %d %d" , number1 , number2 , * p1 , * * p2 ) ; return 0 ; } Example 2: volatile keyword in c C's volatile keyword is a qualifier that is applied to a variable when it is declared . It tells the compiler that the value of the variable may change at any time -- without any action being taken by the code the compiler finds nearby .

Bfs Algorithm Using Geeksforgeeks Code Example

Example: BFS in c++ # include <iostream> # include <list> using namespace std ; class Graph { int V ; list < int > * adj ; public : Graph ( int V ) ; void addEdge ( int v , int w ) ; void BFS ( int s ) ; } ; Graph :: Graph ( int V ) { this -> V = V ; adj = new list < int > [ V ] ; } void Graph :: addEdge ( int v , int w ) { adj [ v ] . push_back ( w ) ; } void Graph :: BFS ( int s ) { bool * visited = new bool [ V ] ; for ( int i = 0 ; i < V ; i ++ ) visited [ i ] = false ; list < int > queue ; visited [ s ] = true ; queue . push_back ( s ) ; list < int > :: iterator i ; while ( ! queue . empty ( ) ) { s = queue . front ( ) ; cout << s << " " ; queue . pop_front ( ) ;

Array.contains Php Code Example

Example 1: php in array $colors = array("red", "blue", "green"); if (in_array("red", $colors)) { echo "found red in array"; } Example 2: in_array php <?php $os = array("Apple", "Banana", "Lemon"); if (in_array("Apple", $os)) { echo "Yeah. Exist Apple"; } if (!in_array("Buleberry", $os)) { echo "Oh, Don't Exist Blueberry!!!"; } ?> Example 3: php array has value $myArr = [38, 18, 10, 7, "15"]; echo in_array(10, $myArr); // TRUE echo in_array(19, $myArr); // TRUE // Without strict check echo in_array("18", $myArr); // TRUE // With strict check echo in_array("18", $myArr, true); // FALSE Example 4: in_array in php in_array ( mixed $needle , array $haystack [, bool $strict = FALSE ] ) : bool // Without strict check echo in_array("18", $myArr); // TRUE // With strict check echo in_array("18&

Check If A File Exists C Code Example

Example 1: c check if file exists if ( access ( fname , F_OK ) == 0 ) { // file exists } else { // file doesn't exist } Example 2: c check if file was created int canCreateFile ( char * path ) { FILE * file = fopen ( path , "w" ) ; if ( file ) { fclose ( file ) ; return 1 ; } return 0 ; }

Apply Class On Condition In Angular 6 Code Example

Example 1: ngclass condition [ngClass]="(step=='step1')?'my-class1':'my-class2'" Example 2: if condition in class angular 8 < i [class] = " user.login_status == 1 ? ' fas fa-circle user_active ' : ' fas fa-circle user_inactive ' " aria-hidden = " true " > </ i > Example 3: conditionally assign a css class angular 9 < div [ngClass] = " { ' message ' : info.priority < 10, ' warn ' : info.priority > 10 && info.priority < 20, ' error ' : info.priority > 30} " > {{info.text}} </ div > Example 4: conditional classes angular < div [className] = " isActive ? ' active ' : ' inactive ' " > </ div > Example 5: ngclass condition [ngClass]="{'my-class': step === 'step1', 'my-class2':step === 'step2' }"