list manipulation – How to convert Symbol to Number?

Question

I have a variable x which is associated with the number 1 : x= 1

In the program, I faced with the data type problem that x is evaluated as a Symbol but not a Number(integer ,double, etc).
(The detail of the problem is written in Background -> My trial section below.)

Not being familiar with the specification of Wolfram language, I’m naively thinking of solving this by converting the Symbol to Number using some standard function of Mathematica. However, I cannot find it.

Is it possible?

Any information would be appreciated.

Background

I want to make a function for fetching a value from some array by designating the entry(index) in mathematical style.

For example, I want to have a function fetchValue like this:

field1 = {{5,34,7},{9,77,11}}; (**)
field2 = {2,3,8,8,4,20,7,0,3}

fetchValue({1,2},field1) (* expected return: 34 *)
fetchValue({5},field2) (* expected return: 4 *)
fetchValue({55,1},field1) (* expected return: "Reference error. Check out the range of the array." *)
fetchValue({3,1,5,4},field1)(* expected return: "Reference error. Check out the dimension of the array." *)

My trial

Let me say we have the following two arrays:

  • the array field whose dimension is unknown(say d) and the size is n^d
  • the array position whose dimension is 1 and the size is d (the same with dimension of field)

Now, we want a function named fetchValue which takes

  • argument1 position : size d array (if d = 2, position = {2,5},{12,6},…)
  • argument2 field: size n^d array
fetchValue(position_, field_) := (
    width = Length(field);height = Length(field);
    dimension = Depth(field);
    index = 1;
    
    ret = field;
  
  While(level <= dimension,
   index = position((level));
 
   IF(1 <= index <= Length(ret), 
      ret = ret((index)), Return("Range is wrong")
    );
 
   level++;
 )

    Return (ret);
   );

This exactly returns the target entry of the field, but the data type of it is somehow a Symbol, not a Number, meaning I have to look for the way to convert Symbol to Number.

Further background

I’m in a project of calculating some fields on a discrete lattice and trying to use Mathematica.

The fields are not given as a analytical function, but all formed by computer calculation.

The fields are managed by array(list). So, if we want value of lattice point (1,2,5), we get the value by field((1))((2))((5)).

What I want is to make it easy to get access to the value of field on a certain lattice point like
field({1,2,5}).

custom – Currency conversion from 3 character code (USD) to their symbol as output ($) in magento 2?

Does magento 2 is having something inbuilt function for currency symbol getting ?
What I want is – Input will be 3 characters currency code as USD, INR, JPY, EUR etc. corresponsing to that output should be $ , ₹ , ¥ etc…

All the solutions are appreciated even if its inbuilt in magento 2 or custom function or some API.

Thanks
Vibhore

plotting – How to thick the border of the open symbol in Frame Plot

You could create markers with Graphics instead:

xaxisb2 = {0.1, 0.2, 0.25, 0.3, 0.5, 0.7, 0.75, 0.8, 0.9};
yaxisbc2 = {1617, 1631, 1637, 1644, 1685, 1774, 1808, 1849, 1955};
 yaxisbs2 = {1696, 1714, 1723, 1732, 1781.261406069227`, 1877, 1913, 
    1955, 2065};
ystnew = Reverse(yaxisbs2);
 ychnew = Reverse(yaxisbc2);
 Datachb2 = Transpose@{1 - xaxisb2, yaxisbc2};
  Datastb2 = Transpose@{1 - xaxisb2, yaxisbs2};
  ListPlot({Datachb2, Datastb2}, Frame -> True, 
  FrameLabel -> {" h", 
      "!(*OverscriptBox(SubscriptBox((T), (c)), (_)))"}, 
    FrameStyle -> AbsoluteThickness(2), FrameTicks -> Automatic, 
    LabelStyle -> Directive(Black, Bold, Medium), 
   PlotRange -> {{0, 1}, {1500, 2200}}, 
    PlotMarkers -> {
   {Graphics({EdgeForm({Thick, Darker(Green)}), FaceForm(None), Rotate(RegularPolygon(4), 45 Degree)}), 14},
    {Graphics({Blue, Disk()}), 8}})

plot with markers

macos – OS not starting up, prohibitory symbol

I have a Mid-2012 MacBook Pro with Bootcamp, and it supports only up to MacOS Catalina, and not Big Sur. This frustrated me and I decided to go off the rules a bit & installed MacOS Big Sur (using patched Sur). This was all working fine, until a few days ago, I reseted the PRAM as I was having some issues with the CD-ROM.

The problem started here. After I reseted the PRAM, the MacBook started showing the prohibitory symbol. It scared me a lot since it had a lot of data (class notes, reference books for exams, etc.), and for the past 3 days, I’ve been searching the internet for its fix.
So, by now I’ve come to know that this sign comes when the Hard-Drive contains a MacOS, but it’s not supported on the Mac. Obviously, it contained Big Sur, which was not supported by this model.

On doing Internet recovery, it gave an option of reinstalling MacOS Snow Leopard, but when selecting a disk to reinstall the OS, it shows only the Bootcamp partition of the Hard Drive and shows the message that it’s locked.

So, I wanted to ask if there is any method of reinstalling MacOS (and obviously this time I’m not going back to Big Sur, only upto Catalina. This experience was enough) without losing any of my data, both from bootcamp and MacOS? If not, then is there a way I could back up files of MacOS partition from Bootcamp partition?
Also, is there a simpler way to bypass this check, like the bypass created by Patched Sur, as that’ll mean I’ll not have to go back to Snow Leopard and reinstall OS updates to go back to catalina?

Also, I wanted to know what exactly happened when I reseted the PRAM, that this bypass stopped working? This needn’t include in the answers, but info on how this happened will help in expanding my knowledge.

plotting – Getting error while introducing star symbol

I am interested in creating a star symbol in Mathematica. But I am getting some error saying Nonatomic expression expected at position 1 in First. How to over come this error. I am using Mathematica 12.2 version in ubuntu 18.

star = First[
  First[ImportString[
    ExportString[Style["✶", FontSize -> 16], "PDF"], 
    "PDF", "TextMode" -> "Outlines"]]]
emptyhex = 
 Graphics[{EdgeForm[{Thickness[.1], Black}], White, star}, 
  ImageSize -> 30]
filledhex = Graphics[{EdgeForm[], Black, star}, ImageSize -> 30]

ux field – Why use “chevron right/left” icon instead “greater or less than” symbol

There is a considerable amount of ambiguity as to what a right-pointing chevron means, and the same applies to a right-pointing equilateral triangle ▶. It can mean PLAY, GO TO PAGE, and more. The right-pointing chevron can mean OPEN MENU, BREADCRUMB, and more. You also need to be careful with the double chevron », which generally means FAST-FORWARD.

If you used a simple greater than > symbol, you are potentially adding a further level of ambiguity.

The reason may also be that the right-pointing chevron is more aesthetically pleasing and less pixelly, depending on the font. That is certainly true of the font-awesome offering.

It’s also a really good idea to add text to icons, or at least a tooltip, so that users know what the icon will do, as otherwise it reduces comprehension.

Also, in case you’re interested, I find this site really useful for discovering unicode characters: &what;