By going ever 6-bits through the binary representation, and getting the character that represents that number. (The standard Base64 alphabet is: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.)
So, the character at index 19 is T, 22 is W, 5 is F, and 46 is u.
Because there are 64 possible character translations.
You could cut them up into 8-bit groups, but that would require use of the entire ASCII character set, which would also mean all the invalid characters.
So if you try to encode a group of bytes in Base64 that is not a multiple of three, you won't get four values out. So, to make the number of values out a multiple of 4, you add = to the end until it is.
This might be a good question for the Code Review stack exchange, since the code works as intended but you just want to know if there's anything to be improved. codereview.stackexchange.com — Thriggle53 secs ago
If it works, then it's valid. I would say that the way you build the HTML in newNotification could generate invalid HTML if you aren't careful, but it's not wrong. Agree this lives better on Code Review tho. — Rhumborl44 secs ago
If you're going to post to the Code Review site, you can just click the "delete" link below your post here to mark it as such. One word of advice though, on Code Review you will want to write a title that describe what your code does, as "best practices" are implied on all posts there. — Phrancis51 secs ago
down vote
favorite
This is not ordinary question but it's also not opinion-based, it's more about the standards and the right way of writing JS code. I admit, I'm a total noob in JavaScript, I do not have experience with this language but since it is necessary for the project I'm working on - I ...
I am trying to add the value of addInterest() onto the value of getBalance() in order to produce a monthly balance print out can anyone help below is the segment of code I am using for my loop
for (int i=0; i<13; i++)
{
System.out.printf("%5s%10s%8.2f\n", i, investor1.getAccount(), investor1....
public class Traveler {
static Towns[] map = {
new Towns("A", "B", 100),
new Towns("A", "C", 60),
new Towns("A", "D", 300),
new Towns("B", "D", 250),
new Towns("B", "C", 80),
new Towns("C", "D", 350)
};
public static void main(String[] args) {
}
}
and the Towns class ...
Second warning, please do not change the code in your question after some answers have been posted, so as to not invalidate them. — TheCoffeeCup1 min ago
I have a very simple question because codacy marks this as a problem and suggesting handling default case, In scala, I use Either like this
val someEither = Either[A,B]
someEither match {
case Left(a) =>
case Right(b) =>
}
Should I do this instead and why? I don't even think that def...
I am not sure, I am asking for a review on a code and I am also asking for an alternative, but ofcourse if coummunity says same I will move — Hüseyin Zengin2 mins ago
Write a program that takes a positive integer, and prints “Product of my divisors” if the product of all its prime factors (excluding 1 and the number itself) is equal to its value otherwise print “Not the product of my divisors”.
public static void main(String[] args)
{
Scanner scan = new ...
@TomV I found that at my old job when I had to search for a client whose name was O'Donnell and the app fired an ODBC incorrect syntax near "Donnell" error... ;D
He said due to the dynamic nature of the query string that was being built from the search screen, it likely would have been stopped at some other point
My code takes input from the user and creates a receipt with the information the program receives from the user.
import easygui
items = []
prices = []
amount = []
amounts = 0
finished = False
total_price = 0.00
list_num = -1
def take_item():
global list_num, amounts, finished
item = e...
This would be a good candidate for Code Review, if @HarrisR wish to post it there instead of StackOverflow. — Phrancis52 secs ago
@Jongware While this question is indeed suitable for Code Review and would be better asked there, you need to provide a valid reason why it is actually off-topic for Stack Overflow, as being suitable elsewhere is not sufficient justification for closing a question. "Too broad" would be a valid closure reason. — 200_success32 secs ago
I have taught some SQL to others before, and I thought of making a script that has these attributes, for the purposes of teaching:
Fully functional to run on local DB instance with no fuss
Easy to follow along
Representative examples of real-life types of operations
Documented
The example fir...
I'm just starting out with ES6, and fairly new to OOP in general (what little I've done has been with C#, which you can probably guess based on the code style). Wondering how this stacks up in terms of appropriate use of the language and its abilities.
/server/api/mail/index.js
(routes for the ...
@200_success: But the code does not contain errors. (Well, according to OP at least.) Being Off-Topic because it asks for a code review is a reason in itself. — Jongware23 secs ago
@Jongware Please familiarize yourself with the rules in the help center. Nowhere does it say that Stack Overflow only allows questions about code with errors. (Again, I'm not disagreeing that this question belongs on Code Review. It's just that you need to pick valid reasons for closure on Stack Overflow instead of making them up.) — 200_success40 secs ago
@ anyone - if I wanted to start playing around with some .NET/C# for a SQL database, assuming I have VS and everything else I need, where should I start as far as writing the code is concerned?
Look what I can do analytically:
$$f(w) = \int_w^{\infty}\frac{1}{u^2}du = -\frac{1}{u}\biggl|_w^{\infty} = -\frac{1}{\infty} + \frac{1}{w} \approx \frac{1}{w}$$
I integrated by x, but got function of f(w). Now I want to do it numerically and plot the result. I know that if the function is inte...
> Error 1 A new expression requires (), [], or {} after type c:\users\francisv\documents\visual studio 2013\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs 29 79 ConsoleApplication1 Error 2 'Main': member names cannot be the same as their enclosing type c:\users\francisv\documents\visual studio 2013\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs 27 21 ConsoleApplication1
@Steven I want to use IoC for my client applications because there will be few similar applications (games) for each UI (operating system). Card games to be exact. So, only for WinForms, there will be 3 different card games. Very similar, so I want to share as much code as possible. So there will be project named "Domain.CardGame", as a core game (shared code - interfaces + default implementations) and additional project (CardGame.Game1) which I will inject. I'm not sure I explained it well. I will post my idea in code review soon — Todd Englewood54 secs ago
Error 1 The namespace 'SqlAdventureWorks' already contains a definition for 'SqlAdventureWorksConnection' c:\users\francisv\documents\visual studio 2013\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs 25 11 ConsoleApplication1
ls is a great resource to use, but it's limited on what it can actually do. I'm trying to write a program to find those files which have an 'a' in the second letter of the name, like "lame.c" or a 'b' in the third position (like library.c).
Ideally, I'd like to use popen and invoke ls with it. Ca...
@happytime Watch it with the superfluous edits. If you make such, see if there's more to improve. If there is and you aren't handling it, that's a valid reason to reject your edit.
I have to agree with Corbin, while I would be annoyed if my email address got leaked, I would not be overly concerned. Spam filters are pretty decent now, and without a password all they can do is spam me. Or, if I have a gmail account, WoW hackers can find more loopholes that allows them to spam...
um this may or may not work, not sure how to tell :D
> A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll The thread 0x32c has exited with code 259 (0x103). The thread 0x152c has exited with code 259 (0x103). The program '[7156] ConsoleApplication1.vshost.exe' has exited with code 0 (0x0).
I just started using the debugger and ran into this. In my research, I found the MSDN blog post What is a First Chance Exception? that cleared it up for me.
The big takeaways from the blog post for me are that it refers to notification to the debugger, and not something my code would necessarily...
@happytime I noticed you suggested minor edits to several closed, poor quality questions. Something you might not be aware of is that when a closed question is edited, it triggers the question entering the review queue. When the question is poor quality, this is not desirable, as it generates unnecessary work for reviewers of the queue. Please don't edit poor quality questions that are closed.
Would you be so kind to help me with some regex and Python code? I have recently received a lot of help for a Python script to go through some firewall logs. I am almost there, but still need a little help.
Here some log output from a firewall:
Nov 11 00:00:09 firewall %ASA-3-710003: TCP access...
After researching for a while and trying and adding another while, I could not figure out how to implement the Play again section...
The instructions are to create a guessing the number game with 6 attempts and a Want to play again? option.
Here's my code so far...
int main(void) {
int rand...