Sciencemadness Discussion Board
Not logged in [Login - Register]
Go To Bottom

Printable Version  
 Pages:  1  2
Author: Subject: Two FREE tools you probably didn't even know you had!
Diachrynic
Hazard to Others
***




Posts: 126
Registered: 23-9-2017
Location: Germany
Member Is Offline

Mood: zenosyne

[*] posted on 1-10-2017 at 02:54
Make chemistry equations look different with Unicode


I made a small program (23 KB) to make chemical equations somewhat look better.

It turns this:

2MnO4 - + SO3 2- + 2OH- --> 2MnO4 2- + SO4 2- + H2O

into this:

2MnO₄⁻ + SO₃²⁻ + 2OH⁻ → 2MnO₄²⁻ + SO₄²⁻ + H₂O

by using a bunch of RegEx and Unicode. (Had to increase size a bit 'cause it was kind of small.)

If anyone wants to try it out, here is a download link: http://www.mediafire.com/file/aesa60r6c2w4e41/ChemistryInlin... (Just in case if the upload here does not work.)

If anyone wants to extend it, here is the important part of the source code (language is VB):

Code:
Private Sub Convert() Dim Str1 As String = TextBox1.Text Str1 = " " + Str1.TrimEnd(" ") Str1 = Regex.Replace(Str1, "[<]+[-‒–—―=]*[>]+", "↔") Str1 = Regex.Replace(Str1, "[-‒–—―=]*[>]+", "→") Str1 = Regex.Replace(Str1, "(?<!\s\d*)0(?!\d*[+-]+)", "₀") Str1 = Regex.Replace(Str1, "(?<!\s\d*)1(?!\d*[+-]+)", "₁") Str1 = Regex.Replace(Str1, "(?<!\s\d*)2(?!\d*[+-]+)", "₂") Str1 = Regex.Replace(Str1, "(?<!\s\d*)3(?!\d*[+-]+)", "₃") Str1 = Regex.Replace(Str1, "(?<!\s\d*)4(?!\d*[+-]+)", "₄") Str1 = Regex.Replace(Str1, "(?<!\s\d*)5(?!\d*[+-]+)", "₅") Str1 = Regex.Replace(Str1, "(?<!\s\d*)6(?!\d*[+-]+)", "₆") Str1 = Regex.Replace(Str1, "(?<!\s\d*)7(?!\d*[+-]+)", "₇") Str1 = Regex.Replace(Str1, "(?<!\s\d*)8(?!\d*[+-]+)", "₈") Str1 = Regex.Replace(Str1, "(?<!\s\d*)9(?!\d*[+-]+)", "₉") Str1 = Regex.Replace(Str1, "((?<=\s\d+)[+]|(?<=\s)[+](?=\s*[+-]+)|(?<=\s+)[+]$|(?<=[A-Za-z])[+])", "⁺") Str1 = Regex.Replace(Str1, "((?<=\s\d+)[-]|(?<=\s)[-](?=\s*[+-]+)|(?<=\s+)[-]$|(?<=[A-Za-z])[-])", "⁻") Str1 = Regex.Replace(Str1, "\s+0(?=[⁺⁻]+)", "⁰") Str1 = Regex.Replace(Str1, "\s+1(?=[⁺⁻]+)", "¹") Str1 = Regex.Replace(Str1, "\s+2(?=[⁺⁻]+)", "²") Str1 = Regex.Replace(Str1, "\s+3(?=[⁺⁻]+)", "³") Str1 = Regex.Replace(Str1, "\s+4(?=[⁺⁻]+)", "⁴") Str1 = Regex.Replace(Str1, "\s+5(?=[⁺⁻]+)", "⁵") Str1 = Regex.Replace(Str1, "\s+6(?=[⁺⁻]+)", "⁶") Str1 = Regex.Replace(Str1, "\s+7(?=[⁺⁻]+)", "⁷") Str1 = Regex.Replace(Str1, "\s+8(?=[⁺⁻]+)", "⁸") Str1 = Regex.Replace(Str1, "\s+9(?=[⁺⁻]+)", "⁹") Str1 = Regex.Replace(Str1, "\s+(?=[₀₁₂₃₄₅₆₇₈₉]*[⁺⁻])", "") TextBox2.Text = Str1.TrimStart(" ") End Sub


To anyone better in programming this probably looks horrible ;)

Have fun!

Cheers

Attachment: ChemistryInlineFormula.exe (23kB)
This file has been downloaded 280 times




Just killing time until the world ends. - Furude Rika, HNNKN
View user's profile View All Posts By User
VSEPR_VOID
International Hazard
*****




Posts: 593
Registered: 1-9-2017
Member Is Offline

Mood: Fullerenes

[*] posted on 17-5-2018 at 09:44


$$2 \ \text{C}_6\text{H}_{12}\text{O}_6$$
test

[Edited on 17-5-2018 by VSEPR_VOID]




Of all the so-called natural human rights that have ever been invented, liberty is least likely to be cheap and is never free of cost

If a good person can be singled out for a love of chemistry, we are all just waiting for our turn on the chopping block of national security.
View user's profile View All Posts By User
MJ101
Hazard to Self
**




Posts: 82
Registered: 14-6-2018
Member Is Offline

Mood: Always Sunny

[*] posted on 14-6-2018 at 14:41


Hi,
I found this, which may also be of some use.

https://chemapps.stolaf.edu/jmol/jmol.php

I hope it's of some use to everyone. :)

https://chemapps.stolaf.edu/jmol/jmol.php?model=2595-97-3&am...
View user's profile View All Posts By User
fusso
International Hazard
*****




Posts: 745
Registered: 23-6-2017
Location: Toaru city, Toaru nation, Asia, Earth, ∥ universe
Member Is Offline

Mood: 700

[*] posted on 14-6-2018 at 14:58


Quote: Originally posted by j_sum1  
Quote: Originally posted by chemrox  
chemsketch requires registration and the word "mandatory" is anathema to moi. It just seems to me that limit notation is part of the history and theory and is itself limited as has been mentioned. I guess I'm prejudiced because I use mostly partials. And rarely do physics. But I have explained calculus using the concept of limits and have reminded myself how it all works by writing out the ideas with limit notation.

A bit nonsequential, chemrox. It seems like you are answering several threads at once.

I downloaded and use chemsketch. No registration was required. This might be a recent change. Avogadro is similar but not as powerful.

Limit notation in calculus, or more accurately, analysis -- seems an ok way to write the concept. Or, more to the point, if you understand the concept, the notation is pretty efficient. Beginning with the notation and then trying to insert the concept is a way to introduce confusions, but that is a pedagogical issue and not unique to limits at all.

Liebniz notation does have advantages over function notation but I think I sumarised the position in the other thread.
The registration screen do occur to me

2018-06-14 23_56_25-Program Manager.png - 213kB




List of materials made by ScienceMadness.org users:
https://docs.google.com/document/u/1/d/1AoI2VA5L4bmFw2HwXS2O...
It's not crime if no one finds out -- Nyaruko
View user's profile View All Posts By User
j_sum1
Super Moderator
*******




Posts: 4142
Registered: 4-10-2014
Location: Oz
Member Is Offline

Mood: Metastable, and that's good enough.

[*] posted on 10-10-2018 at 00:06


Thread is currently getting repeated spam appended to it. I am closing it temporarily. Medsage me or another mod if it does not get reopened quickly.
View user's profile View All Posts By User
j_sum1
Super Moderator
Thread Closed
10-10-2018 at 00:07
j_sum1
Super Moderator
Thread Opened
10-10-2018 at 03:52
 Pages:  1  2

  Go To Top