I have an unsigned char array that represent an image, and I want to show it in a web page.  I get the array from ActiveX Control, and I want to show it in my web page using JavaScript, so I have to convert it to "base64 string", so my question is  how to convert unsigned char array to base64 string in c++?
I have binary data in an unsigned char variable. I need to convert them to PEM base64 in c. I looked in openssl library but i could not find any function. Does any body have any idea?
I've been attempting to learn C in my spare time, and other languages (C#, Java, etc.) have the same concept (and often the same operators) ...   What I'm wondering is, at a core level, what does bit-shifting (&lt;&lt;, &gt;&gt;, &gt;&gt;&gt;) do, what problems can it help solve, and what gotchas lurk around the bend? In other words, an absolute beginner's guide to bit shifting in all its goodness. WinterBash site exhibits some strange 404 behavior I was poking around winterba.sh for secret hats and I figured there may be a secret hat linked to a URL so I decided to look at some different URLs and got plenty of 404s but, some pages throw different 404s than others. Why?  Example:  throws the classic "Page Not Found" winterbash style... but  just has the text "404"  ( used to throw just the text "404" but since that has changed)  Still happening at 2016 with . Dependency error while installing WINE Every time I try to install "WINE" VIA the Software Center on Ubuntu 12.10, I get this error:  The following packages have unmet dependencies:  wine1.4: PreDepends: dpkg (&gt;= 1.15.7.2~) but 1.16.7ubuntu6 is to be installed          Depends: libc6 (&gt;= 2.14) but 2.15-0ubuntu20 is to be installed          Depends: wine1.4-amd64 (= 1.4.1-0ubuntu1) but 1.4.1-0ubuntu1 is to be installed          Depends: wine1.4-i386 (= 1.4.1-0ubuntu1) but it is not going to be installed   When I try installing it VIA the terminal, this is what I get:  Reading package lists... Done Building dependency tree        Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  wine1.4 : Depends: wine1.4-i386 (= 1.4.1-0ubuntu1) but it is not installable            Recommends: gnome-exe-thumbnailer but it is not going to be installed or                        kde-runtime but it is not going to be installed            Recommends: ttf-droid            Recommends: ttf-mscorefonts-installer but it is not going to be installed            Recommends: ttf-umefont but it is not going to be installed            Recommends: ttf-unfonts-core but it is not going to be installed            Recommends: winbind but it is not going to be installed            Recommends: winetricks but it is not going to be installed E: Unable to correct problems, you have held broken packages.   how do I fix this? Incoming light reacts with the several types of cone cells in the eye. In humans, there are three types of cones sensitive to three different spectra, resulting in trichromatic color vision. Each individual cone contains pigments composed of opsin apoprotein, which is covalently linked to either 11-cis-hydroretinal or more rarely 11-cis-dehydroretina.  The opsins (photopigments) present in the L and M cones are encoded on the X chromosome.  A very small percentage of women may have an extra type of color receptor because they have different alleles for the gene for the L opsin on each X chromosome. X chromosome inactivation means that only one opsin is expressed in each cone cell, and some women may therefore show a degree of tetrachromatic color vision. Tetrachromacy is also demonstrated among several species of birds, fish, amphibians, reptiles and insects.  Humans cannot see ultraviolet light directly because the lens of the eye blocks most light in the wavelength range of 300–400 nm.  So, besides above mentioned exceptions, is it possible due to mutations or genetic engineering to see UV or infrared. What kind of mutations should be made or are the changes to be made in the opsines to big to create 'alien' eyes? I am trying to remember the title of a children's SF book I once read, maybe 20 to 25 odd years ago.   I don't have a great number of details (and some of what I recall may be completely wrong), but the details (such as they are):   A war between two alien groups ended, and some technology that should have been destroyed was instead imprinted into a human baby. A few years later, both groups find this out and attempt to retrieve it. The main characters are the child, and an alien that I believe was called "Yacob" (or similar) who was sent to protect the child/retrieve the technology, and the antagonists were the other group of aliens that had previously lost the war and were trying to get the technology to start it up again (again, I don't remember the exact details, but I think it was a fairly simple black &amp; white/good vs. bad scenario, being a children's book and all). There was a scene in which Yacob/the alien gives the child blue food, who complains that it's blue, and the alien states "close your eyes and it's just food". The alien had a space shuttle/some other piece of tech disguised as a van. I vaguely recall a scene in which it is under attack and it flies or something. Adding new ROLES and USERS through REST in GeoServer I use GeoServer stable version 2.14.1 and get error messages when trying to add new roles and users via REST. I suspect that the GeoServer REST documentation is buggy. When I call the REST interface of my GeoServer instance, I can see that the roles are accessible through the URI http://localhost:8080/geoserver/rest/security/roles. Users are under the URI http://localhost:8080/geoserver/rest/security/usergroup/users. I can query both resources via GET request, but adding new resources via POST or PUT will not work. A POST request to create new roles ends up with status code 405 (Method not allowed). After trying to create new users comes the status code 500 (Internal Server Error). For this, the GeoServer-REST documentation has been referencing the paths  /roles/roles/{role}  for new roles () or  /usergroup/users/  for new users () since several GeoServer versions. But when I use them, this always ends with Status code 404 (Not Found). How can I add new roles and users through REST in GeoServer? The workarround from @implssv in  does not work for me. Change the height of a function being plotted How to prove that $E[Y]=E[E[E[Y|X_1, X_2]]]$ ?  PS. I don't see how $E[E(Y|X_{1},X_{2})|X_{1}]=Y[Y|X_{1}]$ and $E[Y]=E[E(Y|X_{1})]$ can be used here. But it feels close. Please help, I'm stuck PPS. Thanks @Deep North. Let's consider the case when X1 is independent of X2 What is the maximum size of a web browser's cookie's key? What is the maximum size of a web browser's cookie's key?  I know the maximum size of a cookie is 4KB, but does the key have a limitation as well? How can I enable AHCI on a SATA drive after installing Windows? Can I enable AHCI after installing Windows 7 in a SATA drive that was on IDE mode? I own a lot of games on Steam, and I'm overall a big fan of the service.  However, one thing about it really bothers me, and I'm wondering if anything can be done about it.  Let's say I have two different online, multiplayer games, both of which I legally own.   If I bought these games normally, I could be playing one of them online, while my fiance could play the other one online on another computer.     However, with Steam, I can only be signed in on one computer at a time.  So, despite the fact that I have bought about 40 games, if I'm playing one of them, someone else in my house is not able to play any of the others.  Is there a way to get around this?  I don't think this is illegal or immoral as I own both of the games in question, and only one person is playing the game at a given time (same IP address and the same household, so it should be easy for Steam to verify that I am not sharing my games unfairly).    If I had bought simple boxed copies, this wouldn't be an issue, but since I became such a fan of Steam, I can't play any of those games at the same time as my fiance.    Is there anything that can be done? Practically speaking, how do people handle ANOVA when the data doesn't quite meet assumptions? This isn't a strictly stats question--I can read all the textbooks about ANOVA assumptions--I'm trying to figure out how actual working analysts handle data that doesn't quite meet the assumptions. I've gone through a lot of questions on this site looking for answers and I keep finding posts about when not to use ANOVA (in an abstract, idealized mathematical context) or how to do some of the things I describe below in R. I'm really trying to figure out what decisions people actually make and why.   I'm running analysis on grouped data from trees (actual trees, not statistical trees) in four groups. I've got data for about 35 attributes for each tree and I'm going through each attribute to determine if the groups differ significantly on that attribute. However, in a couple of cases, the ANOVA assumptions are slightly violated because the variances aren't equal (according to a Levene's test, using alpha=.05).   As I see it, my options are to: 1. Power transform the data and see if it changes the Levene p-val. 2. Use a non-parametric test like a Wilcoxon (if so, which one?). 3. Do some kind of correction to the ANOVA result, like a Bonferroni (I'm not actually sure if something like this exists?). I've tried the first two options and gotten slightly different results--in some cases one approach is significant and the other is not. I'm afraid of falling into the p-value fishing trap, and I'm looking for advice that will help me justify which approach to use.  I've also read some things that suggest that heteroscedasticity isn't really that big of a problem for ANOVA unless the means and variances are correlated (i.e. they both increase together), so perhaps I can just ignore the Levene's result unless I see a pattern like that? If so, is there a test for this?  Finally, I should add that I'm doing this analysis for publication in a peer-reviewed journal, so whatever approach I settle on has to pass muster with reviewers. So, if anyone can provide links to similar, published examples that would be fantastic. I know it has been discussed that it is not possible to start an application from an usb drive upon connection due to limitations of autorun (or autoplay??) in Win 7. But it is possible to create a scheduled task having an event type trigger. Surely there must be an event occurring when the drive -- or any USB device, for that matter -- is connected.    Does anybody have the slightest idea which Event ID should I use? Or at least what type of event? Where can I find the event in event viewer? Help center still has the guidance about old Favorite tags The 1st law of thermodynamics If a gas expands adiabatically will the work done be positive or negative?  I think it will be positive as $\delta W=p dV$ and we have a positive sign due to the work done by the gas is positive as it pushes to expand. But this site has the negative of the answer I obtain.   (See adiabatic processes section) How to render lightning in Cycles How can you render a lightning bolt using Cycles? Suppose $f:(a,b) \to \mathbb{R} $ satisfy $|f(x) - f(y) | \le M |x-y|^\alpha$ for some  $\alpha &gt;1$ and all $x,y \in (a,b) $. Prove that $f$ is constant on $(a,b)$.   I'm not sure which theorem should I look to prove this question. Can you guys give me a bit of hint? First of all how to prove some function $f(x)$ is constant on $(a,b)$? Just show $f'(x) = 0$? How to add border to listview and different row colors at the same time Can I use Named Credential merge fields as URL parameters on the endpoint? I have a named credential as follows:  Name   Test_Credential URL    https://www.somesite.com Identity Type    Named Principal Authentication Protocol    Password Authentication Username   foobar Password   mySomeSiteDeveloperKey Generate Authorization Header   FALSE Allow Merge Fields in HTTP Header    TRUE Allow Merge Fields in HTTP Body     TRUE   The service that I am trying to authenticate against uses URL parameters to pass in the developer key and username. Is there any way to use  to pass those in to the URL?   The Named Credential attributes seem not to get decoded until the request is actually sent, as debugging the endpoint, or headers if I set them per the linked doc, show the un-merged data. I can get the callout to go to the right place, and return the expected error because the auth information is not provided. Anybody know of a "show me my HTTP request" site that I could point to to get a better idea of how this works?  I've tried both of these:  req.setEndpoint('callout:Test_Credential/api/action?id={!$Credential.Password}&amp;account={!$Credential.UserName}');  req.setEndpoint('callout:Test_Credential/api/action' + '?id=' + '{!$Credential.Password}' + '&amp;account=' + '{!$Credential.UserName}');   (Edited to remove the part about $Credential vs. $Test_Credential as I was able to determine that it is the former, and see the merged creds by calling out to .) How to find the mime type of a file in python? Let's say you want to save a bunch of files somewhere, for instance in BLOBs. Let's say you want to dish these files out via a web page and have the client automatically open the correct application/viewer.  Assumption: The browser figures out which application/viewer to use by the mime-type (content-type?) header in the HTTP response.  Based on that assumption, in addition to the bytes of the file, you also want to save the MIME type.  How would you find the MIME type of a file? I'm currently on a Mac, but this should also work on Windows.   Does the browser add this information when posting the file to the web page?  Is there a neat python library for finding this information? A WebService or (even better) a downloadable database?