Posts

Showing posts from July, 2001

ActiveMQ Vs Apollo Vs Kafka

Answer : Apache ActiveMQ is a great workhorse full of features and nice stuff. It's not the fastest MQ software around but fast enough for most use cases. Among features are flexible clustring, fail-over, integrations with different application servers, security etc. Apache Apollo is an attempt to write a new core for ActiveMQ to cope with a large amount of clients and messages. It does not have all nice and convenient feature of ActiveMQ but scales a lot better. Apache Apollo is a really fast MQ implementation when you give it a large multi-core server and thousands of concurrent connections. It has a nice, simple UI, but is not a "one-size-fits-all" solution. It seems that there is an attempt ongoing to merge a number of ActiveMQ features with HornetQ under the name ActiveMQ Artemis. HornetQ has JMS2.0 support, so my humble guess is that it's likely to appear in ActiveMQ 6.x. JIRA, Github Kafka is a different beast. It's a very simple message broker i

Are There Alternatives To Software Center?

Image
Answer : Yes, there is an alternative to the Ubuntu Software Center named appgrid . It's a very lightweight application center for Ubuntu and it will let you purchase applications too. You can install it in Ubuntu with these following commands: sudo add-apt-repository ppa:appgrid/stable sudo apt-get update sudo apt-get install appgrid It was only a 100KB download for me. Comparison between appgrid and Ubuntu Software Center: Feature | appgrid | Ubuntu Software Center -------------------------------------------------------+----------+----------------------- Programming language | Python 3 | Python 2 Warm start to home screen | 2.7s | 20s Warm start to details screen (eg opening an apt: link) | 2.3s | 30s Full database build | 58s | 6min24 Initial database size | 36.7MB | 96.5MB Me

Background Linear-gradient Generator Code Example

Example 1: css gradient generator /* 5 Best CSS Gradient Generator Links */ https://cssgradient.io/ https://www.colorzilla.com/gradient-editor/ https://www.css-gradient.com/ https://mycolor.space/gradient https://uigradients.com/#Orca Example 2: css gradient generator /*CSS Gradient Generator*/ https://cssgradient.io/ /*Example*/ .My-Class { background: linear-gradient(to right, blue/*Color1*/, dodgerblue/*Color1*/); } Example 3: color gradient generator /* "element" bieng the target class item to style */ .element{ background: rgb(2,0,36) !important; background: linear-gradient(331deg, rgba(2,0,36,1) 0%, rgba(139,88,94,1) 0%, rgba(53,101,125,1) 14%, rgba(40,127,156,1) 29%, rgba(0,212,255,1) 100%) !important; padding-bottom: 4%; } Example 4: css gradient generator background: linear-gradient(Direction (keyword or degrees), color1 10% (10% width), color2 width (it's not neccessary), ...); Example 5: Gradient Color Code Generator background-image

Change Column Name In R Data Frame Code Example

Example 1: r rename columns # Rename column by name : change "beta" to "two" names ( d ) [ names ( d ) == "beta" ] < - "two" d # > alpha two gamma # > 1 1 4 7 # > 2 2 5 8 # > 3 3 6 9 # You can also rename by position , but this is a bit dangerous if your data # can change in the future . If there is a change in the number or positions of # columns , then this can result in wrong data . # Rename by index in names vector : change third item , "gamma" , to "three" names ( d ) [ 3 ] < - "three" d # > alpha two three # > 1 1 4 7 # > 2 2 5 8 # > 3 3 6 9 Example 2: how to change column names in r colnames ( dataset ) < - c ( 'name1' , 'name2' , . . ) Example 3: rename column in r my_data % > % rename ( sepal_length = Sepal . Length

Can't Run Firebase Test Lab Tests Using Gcloud And Service Account: 403, Does Not Have Storage.objects.create

Answer : You should be able to use a service account created in the Google Cloud Console. Did your service account have the required project Editor role? (as noted in this doc: https://firebase.google.com/docs/test-lab/continuous) After lots of clicking through the Firebase console and the Google Cloud Console, reading SO, asking for help on Slack, and more trial and error than I care to admit, I discovered that the Firebase console has a service account page: https://console.firebase.google.com/u/0/project/project-name-12345/settings/serviceaccounts/adminsdk That is different from the service accounts page in the Google Cloud Console https://console.cloud.google.com/iam-admin/serviceaccounts/project?project-name-12345 It turns out you want the Firebase service account, you can not create one via the cloud console. Super, super annoying. This is the list of the roles that I put in to my service account : Firebase - Firebase admin ( I think this is overkill. I might upd

1 Million Pound In Indian Rupees Code Example

Example: 1 pound in rupees x lies from 121 < X >1331, x^2+1 when divided by 11 what will not be the remainder?

Background Image Reactjs Code Example

Example 1: how to add background image in react css import React from 'react' ; import car from './images/car .png ' function App ( ) { return ( <div styles= { { backgroundImage : ` url ( ${car} ) ` } } > <h1>This is red car</h1> </div> ) ; } export default App ; Example 2: react background image style= { { backgroundImage : "url(" + "https://images.pexels.com/photos/34153/pexels-photo.jpg?auto=compress&cs=tinysrgb&h=350" + ")" , backgroundPosition : 'center' , backgroundSize : 'cover' , backgroundRepeat : 'no-repeat' } } Example 3: background image css .selector { background-image : url ( image.png ) ; }

String Length C++ Stl Code Example

Example 1: length of string c++ // string::length # include <iostream> # include <string> int main ( ) { std :: string str ( "Test string" ) ; std :: cout << "The size of str is " << str . length ( ) << " bytes.\n" ; return 0 ; } Example 2: length of string in c++ str . length ( ) ; Example 3: create a string of length c++ # include <string> # include <iostream> int main ( ) { std :: string s ( 21 , '*' ) ; std :: cout << s << std :: endl ; return 0 ; }

Badges In Bootstrap 4.5 Code Example

Example 1: bootstrap 4 badge <span class= "badge badge-primary" >Primary</span> <span class= "badge badge-secondary" >Secondary</span> <span class= "badge badge-success" >Success</span> <span class= "badge badge-danger" >Danger</span> <span class= "badge badge-warning" >Warning</span> <span class= "badge badge-info" >Info</span> <span class= "badge badge-light" >Light</span> <span class= "badge badge-dark" >Dark</span> Example 2: bootstrap Badges Badges scale to match the size of the immediate parent element by using relative font sizing and em units. <h1>Example heading <span class= "badge badge-secondary" >New</span></h1> <h2>Example heading <span class= "badge badge-secondary" >New</span></h2> <h3>Example heading <span class= &

Cannot Shrink C: Partition: Not Enough Space

Image
Answer : I got this error when trying to shrink by 150GB, but shrinking three times by 50GB worked fine. Try launching the Event Viewer to see which individual files are blocking the partition shrink. Once again, attempt to shrink the partition. You should get the "There is not enough space" error. Launch Windows' Event Viewer application. In Event Viewer, go to Windows Logs > Application. Find and Click a recent log of type Warning. It should have the message, "Error: during volume shrink initiated on volume Windows (C:) we failed to move a movable file extent." The Diagnostic details will give you the name of the "last unmovable file" Delete this file (Simply send to recycle bin. I did not need a hard delete). Try shrinking your volume again. Repeat steps 2-7 until you successfully shrink your partition. (In my case, I had to do this 3 times, as I had 3 pdf files in my local Google Drive that were for some reason stuck as 'unmovab

9am Cst To India Time Code Example

Example: 1pm cst to ist 12.30 AM in India

1 20 Minute Timer Code Example

Example 1: 20 minute timer for good eyesight every 20 minutes look out the window at something 20 feet away for 20 seconds Example 2: 20 minute timer For the 20/20/20 rule you can also close your eyes for 20 seconds and get the same results because it relaxes the mucles in your eyes.

Clear Console R Studio Code Example

Example: r clear console cat("\014")

Bypass Popup Blocker On Window.open When JQuery Event.preventDefault() Is Set

Answer : Popup blockers will typically only allow window.open if used during the processing of a user event (like a click). In your case, you're calling window.open later , not during the event, because $.getJSON is asynchronous. You have two options: Do something else, rather than window.open . Make the ajax call synchronous, which is something you should normally avoid like the plague as it locks up the UI of the browser. $.getJSON is equivalent to: $.ajax({ url: url, dataType: 'json', data: data, success: callback }); ...and so you can make your $.getJSON call synchronous by mapping your params to the above and adding async: false : $.ajax({ url: "redirect/" + pageId, async: false, dataType: "json", data: {}, success: function(status) { if (status == null) { alert("Error in verifying the status."); } else if(!status) { $("#agreement&quo

Raspberry Pi Default Password Not Working Code Example

Example: default password raspberry pi User management in Raspberry Pi OS is done on the command line . The default user is pi , and the password is raspberry .

C++: What Is The Difference Between Ostream And Ostringstream?

Image
Answer : Put succinctly: ostringstream provides a streambuf , ostream requires the user to provide one. To understand the implications, it's necessary to understand a little how streams work, and I'm not sure that there's a good explanation of this on the Web. The basic abstraction of ostream is formatting textual output. You give it an int or a double (or a user defined type—more on that later), and it convert it into a stream of characters, of type char . What it does with that stream depends on the streambuf which is attached to it; this is an example of the strategy pattern, where streambuf is an abstract base class of the strategy[1]. The standard provides two implementations of streambuf , filebuf and stringbuf ; in practice, in all but the most trivial applications, you'll probably have some that you implement yourself. When outputting, you always use ostream ; it's the class over which the << operators are defined. You're form

Available Actions For OnUpdate / OnDelete In Laravel 5.x

Answer : You can do all the options mentioned in phpmyadmin this way: $table->...->onDelete('CASCADE'); $table->...->onDelete('SET NULL'); $table->...->onDelete('RESTRICT'); // do not call the onDelete() method if you want the RESTRICT option. You have to make sure you set the foreign key field as nullable: $table->...->unsigned()->nullable(); Referring to the source code: `vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/Grammar.php` in the function compileForeign() It just appends whatever you pass in to the table query. if (! is_null($command->onDelete)) { $sql .= " on delete {$command->onDelete}"; } if (! is_null($command->onUpdate)) { $sql .= " on update {$command->onUpdate}"; } So, make sure you pass one of the following: "cascade", "no action", "restrict", or "set null" NOTE: Do NOT use

101 Rx Examples

Image
Answer : I actually had similar thoughts a couple days ago. We started our own "101 Rx Samples" as a post in the Rx MSDN forum, but we have since moved it to a Wiki format. Please feel free to come over and add your own samples! 101 Rx Samples on the Rx wiki To start with - Here is a simple drawing application, so that when the user drags, we draw a red line from the initial mouse down position to the current location, and also a blue spot at the current location. This is the result of my last week's hack on Rx And here is the source code. //A draw on drag method to perform the draw void DrawOnDrag(Canvas e) { //Get the initial position and dragged points using LINQ to Events var mouseDragPoints = from md in e.GetMouseDown() let startpos=md.EventArgs.GetPosition(e) from mm in e.GetMouseMove().Until(e.GetMouseUp()) select new

How To Convert Int To String C] Code Example

Example: c int to string # include <stdio.h> int main ( ) { char number_str [ 10 ] ; int number = 25 ; sprintf ( number_str , "%d" , number ) ; printf ( "Converted to string : %s\n" , number_str ) ; return 0 ; }

Android - Can't Install Previously Installed Apps From Google Play

Image
Answer : The issue here is that the uninstall process wasn't registered at Google Play Store. Without the uninstall process registered, Google Play Store still reports the app as installed on the device that's associated with your Google account. To overcome this, you need to manually trigger the uninstall from the Google Play Store, within the "MY ANDROID APPS" list: Step by Step I have a couple of apps that I've uninstalled from my device and the uninstall process wasn't registered at Google Play Store. I'll use one as a guide: Access "MY ANDROID APPS" list, search for the desired app and click the recycle bin icon to trigger the uninstall: After confirming, the app will get marked as "removed": Now you can access the application at Google Play Store, and install it like you mentioned that you prefer to do: Error message still appearing If you've signed in to your device's Google Play Store app, d