Category Archives: Computers and Internet

A Guide to Lodash’s Different String Transformation Functions

Transforming text into various capitalization styles is a common task in programming. Whether for readability, consistency, or adhering to coding conventions, Lodash, a popular JavaScript library, provides a comprehensive set of functions to achieve these transformations. Let’s delve into these functions and understand their distinct purposes:

  • startCase: This function converts a string to start case, where the first letter of each word is capitalized, and the rest are lowercase. It’s ideal for converting delimited strings (kebab-case, snake_case) into a more readable format, resembling sentence case.
  • upperFirst: As the name suggests, this function capitalizes only the first letter of the string, leaving the remaining characters unchanged. It’s useful when you want to emphasize the first letter but maintain lowercase for the rest.
  • capitalize: It behaves similarly to upperFirst, capitalizing the first letter and converting the rest to lowercase. This provides a convenient way to achieve consistent capitalization at the beginning of a string.
  • kebabCase: This function converts a string into kebab-case, where words are separated by hyphens (-). It’s commonly used for filenames, CSS class names, or URLs to enhance readability.
  • camelCase: Converts a string to camelCase, where the first letter of each word (except the first) is capitalized, and separators are removed. This is a popular choice for variable or property names in JavaScript.
  • snakeCase: This function transforms a string into snake_case, where words are separated by underscores (_). This convention is often used for variable names or database column names.
  • lowerCase: Converts the entire string to lowercase.
  • upperCase: Conversely, this function converts the entire string to UPPERCASE.

Here’s a table summarizing the key differences:

FunctionDescriptionExample
upperFirstCapitalizes the first letter of the string“hello-world” -> “Hello-world”
capitalize Capitalizes the first letter and converts rest to lowercase“hello-World” -> “Hello-world”
startCaseConverts string to start case (first letter of each word capitalized)“this-is-a-string” -> “This Is A String”
kebabCase Converts string to kebab-case (words separated by hyphens)“ThisIsAString” -> “this-is-a-string”
camelCaseConverts string to camelCase (capitalized words)“this-is-a-string” -> “thisIsAString”
snakeCaseConverts string to snake_case (words separated by underscores)“thisIsAString” -> “this_is_a_string”
lowerCaseConverts entire string to lowercase“HELLO WORLD” -> “hello world”
upperCaseConverts entire string to uppercase“hello world” -> “HELLO WORLD”

Choosing the right transformation function depends on your specific context. Here’s a quick guide:

  • Use startCase for converting delimited strings to readable text.
  • Apply upperFirst or capitalize to emphasize the first letter.
  • For filenames, CSS classes, or URLs, prefer kebabCase.
  • Use camelCase for variable or property names in JavaScript.
  • When dealing with variable or database column names, snake_case is a common choice.
  • Utilize lowerCase or upperCase for complete lowercase or uppercase conversion, respectively.

By mastering these string transformation functions in Lodash, you can effectively manipulate text in your code, ensuring consistent formatting and improved readability for both you and your collaborators.

Taming YouTube Music – How to have restricted Mode on for YouTube Music and Off for YouTube

If you’re like me, you’ve been a fan of Google Play Music for a long time. I signed up for the service when it first came out. In fact, I was so early to the party, that I receive a discount of $2/month.

However, times have changed. Google Play Music is no longer a thing, and in it’s place, we have been given YouTube Music. While many would say that YouTube Music is an awful replacement for GPM, I have found it quite alright.

Yet there is one setting that YouTube Music lacks that Google Play Music had. It was called “Block Explicit Songs in Radio.” And it did just that. It blocks songs with foul language; songs which I would rather not hear.

YouTube Music’s replacement, though, is something called Restricted Mode. While this certainly does it’s job, it does it too well. It also applies the setting to YouTube proper, which isn’t what I want. If you’ve ever tried to browse YouTube with Restricted Mode on, it’s essentially like a baby filter. Everything is kid friendly. I often find myself turning off Restricted Mode on YouTube, only to be upset when YouTube Music is playing an explicit song again, resulting in me having to turn on Restricted Mode again. Round and round it goes, until …

Firefox – Multi-Account Containers

I’m a fan of Firefox. It’s an alternative web browser to Google Chrome. It’s focus is privacy. No large corporation taking your data. No manipulating you into sharing your data. Just a simple program for browsing the web.

But how does Firefox solve my problem?

Firefox has an extension called multi-account containers. It has the ability to open tabs in different sessions. This means I can be logged into one account in one tab, and into a completely different account in another, or into the same account, twice. To the web site, it looks like I am logged in in two different places.

Firefox’s Multi-Account Container Extension

Because YouTube’s Restricted Mode only applies per device, container tabs makes it look like two different devices. I simple created a container for YouTube Music, and have Restricted Mode turned on for that container. When I visit YouTube Music, it automatically opens in that container, and Restricted Mode is on. 🙂

Then when I visit YouTube, it just opens under a regular tab. Because it is separate from the YouTube Music container, I can have Restricted Mode off, and I can freely browse YouTube, without constantly seeing “Restricted Mode is On” for every second video I want to watch.

Android 11 – 11 New Features

Android 11 has been released. Here are 11 new features you may not otherwise know about. Some of these are exclusive to the Pixel range of devices.

#1. Conversations

The latest version of Android has added a new section in notifications. This one is labelled Conversations. This puts chat and text messages first, so it’s easy to see and reply to them. Conversations can also be marked as priority, giving them special preference over other conversations, allowing them to appear at the top of the list, and override Do Not Disturb when necessary.

#2. A Redesigned App Switcher

Long time users of Android will notice the app switcher has changed again. The recent app icons were removed in favour of two new buttons: Screenshot and Select. Select is an quick way to highlight text from any app, even apps that may not support it otherwise. Tapping Select scans the image with Google Lens to find text, and make those regions easy to select and copy. Screenshot does what you expect, and also shows a dialog that allows quick and easy editing of the shot afterwards, such as cropping and markup.

# 3. Redesigned Media Controls

Media controls have a new home. Instead of having to find the notification in an ever growing list of all the apps vying for attention these days, media controls have been moved into the quick actions toolbar, along with all other other buttons such as WiFi, Bluetooth, etc. Media Controls allows access to all devices playing media, even those on connected devices such as smart speakers and Bluetooth headsets.

# 4. A Power Menu for Power Users

Once again, the power menu has been redesigned. Smart home controls have been added directly to the power menu, making it easy to control smart home devices. Turning off lights is as easy as long pressing the power button and tapping the appropriate icon.

# 5. A Smarter Launcher

With the removal of the suggested apps from the recent apps screen, these suggestions have moved to the bottom row of the launcher. If any free spaces are available in the dock, a suggested app will appear depending on the time of day and the habits recognized by the device. Take the bus every day at 8 am (or perhaps did before a global pandemic)? The launcher should suggest the app used to get transit directions to work.

# 6. Nearby Share

While not exclusive to Android 11, this new feature allows users in close proximity to one another easily share files with one another. This comes after the removal on Android Bean, the previous way for sharing files between devices, was removed in Android 10. Users simply have to be in close proximity to one another, open the Files app, and click send or receive from the Share offline in the side menu.

# 7. Chat Bubbles

Along with Conversations above, Android has introducted a Bubbles feature that apps can use to show conversations in a floating bubble, similar to Facebook’s chat heads that have been around for years on Android. These allow any app to easily add a Bubble for their conversation, and for users to manage all their different conversations across different apps all in one place!

# 8. Built in Screen Recording

That’s right. While I like to argue that you could always record your screen by going into Google Play Games, and then picking a game, and then clicking Record, and then just switching away from the game…. I digress. Android 11 finally has a way to record the screen, without the need for a third-party app. It can be found in the quick-tiles section. Users even have the option to record both device audio, the microphone, or both. Fancy

# 9. Live View

Live View builds upon Google Maps use of AR tech to show directions over top of a view of your surroundings. Live View allows you to share your location with nearby friends so they can easily track down where you are. Users can share locations with one another, and use their camera’s to point them in the right direction.

# 10. Smart Folder Naming

The number of apps on a modern smartphone seems to grow more and more every year. Now, the Pixel Launcher helps you do this by automatically suggesting a name when creating folders, based on the types of apps. Put two web browsers in the same folder? The folder will automatically be labelled Browsers. Nice!

# 11. Easter Egg

The new Android volume control

As with every version of Android, a new Easter egg has been added to the version screen. Clicking the version number multiple times will show a volume nob with 10 notches. Turning the nob gives some nice haptic feedback between the notches. Of course, you can turn it up to 11.

#RIPTwitter

An update from Jack:

Original Article:

Big news in the social media world today. BuzzFeed reports that Twitter plans to implement an algorithim for its news feed next week. This is similar to what Facebook is already doing. Instead of displaying tweets in chronological order, as Twitter does presently, Twitter would display tweets based on what it wants you to see.

Many users are upset about the change. They have voiced their opinion with the hashtag #RIPTwitter.

The algorithm is an attempt to make Twitter more popular again. They have less and less users these days. The theory is that if Twitter were to show more interesting content, people would come back more often. However, the unique set of features that Twitter offers is what draws its current user base. Removing these features would seem to drive many of the current users mad. Twitter has long been a source for instance news and information. Removing the “instant” factor of Twitter makes it much less interesting.

Our mission: To give everyone the power to create and share ideas and information instantly, without barriers.

– Twitter

Will the algorithm be a new barrier?

 

Windows 10 – How to get your free upgrade

If you have been watching your task bar lately, you may have seen this logo in the taskbar.

windows10logo

Clicking on this logo opens a new window with an option to reserve your FREE upgrade.
windows10iscomingPersonally, I have been using the Windows Technical Preview for a while, and Windows 10 brings in many useful features. Multiple desktops and a redesigned start menu are new in this version.

winodws2

More snap features are now available. If you haven’t heard of snap, this was a feature that allows you to drag a window to the edge of a screen, and it will snap to that half of the screen, automatically resizing the window to fit. Now windows can be snapped in quarter sections, and Windows will automatically suggest a second window to snap after snapping a first.

windows3

Windows 10 also comes with Cortana, Microsoft’s version of voice recognition software that helps you get tasks done quickly. Unfortunately, I have not been able to try it out, as the beta version of it is not available in Canada, because apparently we speak a different English than the Americans…. 🙁

Clicking the register button simply asks for your email address to get a confirmation message. Windows has set the release date for July 29th. Once it is released, Windows 10 will automatically be downloaded to your computer and installed.

Windows 10 is a free upgrade for Windows 7 and 8.1 users.

Windows 10 is coming

Windows is currently working on it’s next-generation operating system, Windows 10. What happened to Windows 9 you ask? Well I don’t know. They just decided to go all the way to ten.

Windows 10 brings back a start menu that the desktop users are used to, blending the metro tile look of Windows 8, and the start menu of Windows 7. Windows 10 also brings multiple desktops to Windows, something Mac and Linux users have had for quite a while. Metro Apps, which are apps downloaded from the Windows Store, can now be ran in Windowed mode, rather than full-screen all the time.

Windows is working on a voice-recognition system dubbed ‘Cortana.’ Videos show users being able to use their voice to do common tasks, like searching the web, checking the weather, setting reminders, and calling people on Skype.

Though a release date has not been set yet, Microsoft has an event for January 21, 2015, where more details about its next operating system are expected to be announced. Windows 10 is currently available as a free preview until mid-April. You can download your copy from the Microsoft website. I would recommend that you would not install it on the main computer you use, as it is still in development, could fail, and you could lose all your data.

There are ways, of course, to install the Windows 10 preview alongside your current operating system, so that you don’t have to replace your current system with Windows 10 if you just want to try it out. I shrunk the partition on my hard drive and made a second partition onto which I installed Windows 10. One could also create a virtual drive in Disk Manager and then mount it during the install process, allowing them to install a copy to a virtual drive in your computer. However you choose to do it, back up your data first. You wouldn’t want to lose that.

Hopefully, Windows 10 will encourage users to upgrade from Windows 8, 7, or even XP. Adoption of Windows 8 has been hesitant, as many users do not like the new start screen. Users of Windows 7 should consider upgrading, as mainstream support just ended last week (January 13, 2015), though extended support for Windows 7 will still be available for another 5 years. Users of XP should definitely considering upgrading as no updates have been issued for the operating system since last April!

That’s all for now…

How To Not Lose Your Phone Contacts

Have you ever lost or broken your phone, bought a new phone, and then didn’t have any contacts? Not fun. However, there are a number of ways that your contacts can be backed up so that you can retrieve them later. It’s easy and takes minutes to set up. Here are a number of different methods to keep your contacts safe.

sync contacts private1. Use Google Contacts.

If you have an Android phone and you are logged in to your Google account, you can sync your contacts to your Google account. When you are in your Contacts/People app, you’ll have to go into the settings and choose “Merge with Google.” This will upload all your phone’s contacts to Google’s servers, and new contacts will automatically be synced with your Gmail address book. If you lose or break your phone, when you log into your Google account on a new Android device, your contacts will be there as well.

 

 

 

2. Transfer contacts to a new phone via Bluetooth.

Sometimes you’ll get a new phone and need to transfer contacts from an old phone that doesn’t have a method to sync contacts to the Internet. In this case, Bluetooth can be used to transfer contacts between phones. First, pair the phones with Bluetooth. You can do this from your Bluetooth settings menu. Then, in your contacts application on your old phone, look for a setting to send contacts via Bluetooth. Select all your contacts, and press send. On your new phone, you should see a notification to accept the new contacts. Once that is done, you should have all your contacts on your new phone.

3. Sync to iCloud (Apple)

If you have an Apple device, you can sync your contacts to the Internet with iCloud. Look for an enable this option in your settings. Contacts will be backed up to your iCloud account.

Back up your photos too!

Options also exist to back up other things on your devices, such as Photos. On your Android device, open the Google+ Photos app and go to settings and turn on “Google+ Auto Backup”. This will automatically backup all photos on your device, though you can choose certain folders to be backed up if you so desire. Photos backed up online are only visible to you.

On your Apple device, iCloud can be used to back up your photos. Photos backed up are only visible to you.

Windows 10 Technical Preview – What’s New?

So I’ve been trying out Windows Technical Preview for the past few weeks. The technical preview became available on October 1st. As with its last few operating systems, Microsoft has released an early beta testing version, allowing users to send feedback to Microsoft about the new operating system. This next version will be released sometime in 2015.

The next version of Windows seeks to introduce a number of new features. First, the start menu is back. The start menu of Windows 7 is blended with the start screen of Windows 8. Users can quickly search for an app, or click on a search suggestion to bring up the Search app.

Windows apps now run in a windowed mode, rather than just full screen, allowing keyboard and mouse users to use the apps more effectively.

Another recent addition that I enjoy is the recent files menu being included in Explorer’s main page. I can find files I just saved/downloaded, without having to navigate to the specific folder they are in.

Windows now supports the addition of multiple desktops. For example, I could have one desktop with a word document open, and another with a web browser open, and then switch between desktops, rather than having to find the app I want in the myriad of windows open on just the one screen.

On the technical related side, it seems Windows 10 will be built similarly to Windows Phone 10 and the next version for Xbox One. This will allow develops to easily make an app for all devices. Rather than having to start from scratch for each app, some of the same code will work between each platform.

Who Called Me From (760) 705-8888? – Google Introduces Voice Calling to Hangouts

Google has finally updated its Hangouts app to include voice calling. You’ll have to download the Hangouts Dialer app first if you have an Android phone.This app will allow you to call people in the US/Canada for FREE! If you have a Google Voice account, you can add funds and also make very cheap international calls as well. Once you download the app, just open it and click on the dialpad icon and place your call.

Hangouts is Google’s chat app. Hangouts users can chat, voice call or video call each other. You can choose to integrate your phone’s SMS with it, and Google uses it as the standard messaging app in it’s latest version of Android (KitKat). 

Facebook’s Forced Messenger Update – Is It Spying on Me?

Some people are concerned about Facebook’s Messenger app, and how it is now required that people use it to view their messages. Rather than having the capability to read messages in the Facebook app, the company has now  made a standalone app for sending and receiving messages . Many are concerned over the apps permissions, which allow the app to utilize certain parts of the phone. Many are concerned that permissions like recording audio and taking pictures means that the app is spying on them. However, many are misinformed about how app permissions work.

Now for myself, I have only had the experience on an Android device, but the permissions are set up by Android. When an app wants to have access to certain parts of the phone, it must declare the permissions it needs to run. These are the same permissions you see when you download the app. The problem comes from the wording of the permissions. It’s a default wording set by the makers of the Android system. They seem very general, such as “take pictures” and “record audio.”

Now once someone starts using the app, they will begin to see why these permissions are necessary. The Messenger app can be used to record audio clips, pictures, and videos, and send them to a friend. Rather than having to open a separate app to take a photo, or record audio, you can do it right from within the Facebook app.

Other’s are concerned with Facebook’s permission to read text messages. Facebook uses this as an auto verify service when you are verifying your phone number. Usually, when a service wants to verify your phone number, they’ll send you a text with a verification code for you to type in. Facebook uses this permission to read your that one text message automatically, so you don’t have to type in the verification code. Again, Facebook isn’t able to make the wording say “read text messages from Facebook.” The only way in is to request permission to your whole contacts list,  because that’s the way that Android currently works.

Overall, people need not be concerned. Facebook is not secretly recording your conversations or anything like that. The permissions are just vague, and need to be explained.For future details, you can visit Facebook’s help site here.