My progam on Game Maker Studio 2 is not showing currency signs (like £,$, etc.) - gml

I am trying to make a shop in my game, and I want my text to say, "Object - £30" or something, but when I type in the sign, when I run the game, all it says is Object - 30 even if I typed in the sign. here is the code:
draw_self();
draw_text_transformed(x + -90, y + -20, string("Shelf - £ 60") + "", 2, 2, 0);
draw_set_colour($FF000000 & $ffffff);
var l4109CEE6_0=($FF000000 >> 24);
draw_set_alpha(l4109CEE6_0 / $ff);
Does anyone know how I can solve this?

Have you tried using unicode?
\u00A3 for £ for example

Two things:
Your font of choice must contain the said glyph (you can check with FontForge)
You need to add a range for the glyph(s) in GameMaker:

Related

Why does the input (colorPicker) only support Hex?

I'm afraid I don't understand why there is no system-side option to select RGB, including transparencies? Am I making a mistake in using it, or did this feature not make it into Typo3 11 either? Thanks in advance?
My guess is that this is not a feature that's requested a lot and in most cases the current functionality is good enough. If you want it added to the TYPO3 core (12, since 11 is already in a feature freeze), add a feature request to https://forge.typo3.org/projects/typo3cms-core/issues.
You can however get the same effect now by adding 2 fields, one with a color picker to select the color and 1 to select the transparency. You'll then have to convert the hex to int and combine the values. If you're using an Extbase model, that could be something like:
list($r, $g, $b) = array_map(
"hexdec",
str_split(
$myModelObject->getColor(),
strlen( $color ) / 3
)
);
$rgb = sprintf('rgba(%s, %s, %s, %s)', $r, $g, $b, $myModelObject->getOpacity());

basic mdx question using Ms Excel OLAP tools

I will make this question and scenario as basic as possible since I have no background on programming. How do I make a script where all red will be multiplied by 5, yellow by 6 and blue by 7? The new measure will aggregate in grand total. I don't know what expressions to use. Just use [Product] for the colors and [Measure] for qty.
enter image description here
I dont understand yet the use of MEMBERS and other expressions as this is my first time to be on it. I tried
([Measure].[Quantity],[Product].&[Yellow])*6
but it will just multiply everything with 6. Maybe FILTERS? IIF? I just don't know how. The script will go a long way when I will apply it in our database. thanks!
I know you asked about doing this with excel, but if you were writing an MDX query you could do create a new measure and run the query like this:
WITH
member measures.[ColorQuantity] AS CASE WHEN [Product].[Product].currentmember.member_key = "Yellow" THEN measures.[Quantity] * 6
WHEN [Product].[Product].currentmember.member_key = "Blue" THEN measures.[Quantity] * 5
WHEN [Product].[Product].currentmember.member_key = "Red" THEN measures.[Quantity] * 2
ELSE measures.[Quantity] END
SELECT {
measures.[Quantity], measures.[ColorQuantity]
} ON 0,
Non EMPTY
{
[Product].[Product].[All].Children /// I dont know the FULL dimension AND hierarchy path you want TO use
} ON 1
FROM YourCubeName
This might help you get started.

How can I coerce generated values in a PivotTable to adopt a specific format (Aspose Cells)?

I have code to create data fields (and then give their labels user-friendly strings) like so:
pivotTable.AddFieldToArea(PivotFieldType.Data, TOTALQTY_COLUMN);
pivotTable.AddFieldToArea(PivotFieldType.Data, TOTALPRICE_COLUMN);
pivotTable.AddFieldToArea(PivotFieldType.Data, AVGPRICE_COLUMN);
pivotTable.AddFieldToArea(PivotFieldType.Data, PERCENTOFTOTAL_COLUMN);
pivotTable.DataFields[0].DisplayName = "Total Packages";
pivotTable.DataFields[1].DisplayName = "Total Purchases";
pivotTable.DataFields[2].DisplayName = "Avg Purchase";
pivotTable.DataFields[3].DisplayName = "% of Total";
With this, I end up with values like so:
I want commas added to "Total Packages" so that for any value over 999, a comma will appear ("1,000" instead of "1000")
I also want dollar signs prepended to the "Total Purchases" values (so that, for instance, "14042.56" becomes "$14,042.56")
Also, I want "Avg Purchases" values such as "33.2" to instead be "33.20" (always two and exactly two values following the decimal point)
Finally, I want a percent sign appended to the "% of Total" values, so that "0.76" becomes "0.76%"
I thought the following might work:
pivotTable.DataFields[3].DataDisplayFormat = PivotFieldDataDisplayFormat.
...but there doesn't seem to be the right type of options for that to accomplish what I want.
What code is needed to make this work?
Please follow this thread. I have provided the sample code, source and output excel files for your reference. Let us know your feedback.
Thread Link
Note: I am working as Developer Evangelist at Aspose

VB.NET Console application - Trouble using Math.Log()

I am more or less new to VB.NET and I am trying to program a simple console application for a basic finance and savings calculation program.
I am having trouble with the Math.Log() function and I hope someone can help me to point out my
mistake/mistakes.
This is the values I need to get working (the brackets shows the values ​​that actually should work but do not in my code):
Public Class basicSavingsPlaner
Private userTotalCost As Double (50,000.00)
Private userSaves As Double (3,451.47)
Private userAnnualRate As Decimal (0,08)
Private userMonths As Double (should be 10)
If I use my regular calculator (TI-82) I get the correct answer of userMonths which is 10, this is how I type it on my calculator (I switched the values from digits to the names of my Declarations):
(log(((userAnnualRate * userTotalCost)/userSaves)+1)/(log(1+userAnnual)) = 10.0029...
This is my attempt to recreate it for my VB.NET console application:
userMonths = ((Math.Log((userAnnualRate * userTotalCost) / userSaves) + 1) / (Math.Log(1 + userAnnualRate)))
In this case, userMonths's result is 14.9, which is wrong.
I would really appreciate if someone could help me, I have search here in this forum and on Google for days now.
// Televeinken
If you look closely at the statement from your TI-82 and compare it with your VB.Net code you will see that you have the statement grouped differently between the two. Try something like this(note the grouping of three brackets after the initial log statement instead of two):
userMonths = (Math.Log(((userAnnualRate * userTotalCost) / userSaves) + 1) / (Math.Log(1 + userAnnualRate)))
userMonths = 10.000008962349851
The problem is with the grouping expressions with brackets () that is you are executing different expressions with Math.Log and log.
if you change like this ((Log((userAnnualRate * userTotalCost) / userSaves) + 1) / (Log(1 + userAnnualRate)))
means it will also result in 14.9
OR you can make a change like
(Math.Log(((userAnnualRate * userTotalCost) / userSaves) + 1) / (Math.Log(1 + userAnnualRate)))
then both will result in 10.00

What would be the best way to parse this file?

I was just wondering if anyone knew of a good way that I could parse the file at the bottom of the post.
I have a database setup with the correct tables for each section eg Refferal Table,Caller Table,Location Table. Each table has the same columns that are show in the file below
I would really like something that is fairly genetic so if the file layout changes it won't mess me around to much. At the moment I am just reading the file in a line at a time and just using a case statement to check which section i'm in.
Is anyone able to help me with this?
PS. I am using VB but C# or anything else will be fine, also the x's in the document are just personal info I have blanked
Thanks,
Nathan
File:--->
DIAL BEFORE YOU DIG
Call 1100, Fax 1300 652 077
PO Box 7710 MELBOURNE, VIC 8004
Utilities are requested to respond within 2 working days and reference the Sequence number.
[REFFERAL DETAILS]
FROM= Dial Before You Dig - Web
TO= Technical Services
UTILITY ID= xxxxxx
COMPANY= {Company Name}
ENQUIRY DATE= 02/10/2008 13:53
COMMENCEMENT DATE= 06/10/2008
SEQUENCE NO= xxxxxxxxx
PLANNING= No
[CALLER DETAILS]
CUSTOMER ID= 403552
CONTACT NAME= {Name of Contact}
CONTACT HOURS= 0
COMPANY= Underground Utility Locating
ADDRESS= {Address}
SUBURB= {Suburb}
STATE= {State}
POSTCODE= 4350
TELEPHONE= xxxxxxxxxx
MOBILE= xxxxxxxxxx
FAX TYPE= Private
FAX NUMBER= xxxxxxxxxx
PUBLIC ADDRESS= xxxxxxxxxx
PUBLIC TELEPHONE=
EMAIL ADDRESS= {Email Address}
[LOCATION DETAILS]
ADDRESS= {Location Address}
SUBURB= {Location Suburb}
STATE= xxx
POSTCODE= xxx
DEPOSITED PLAN NO= 0
SECTION & HUNDRED NO= 0
PROPERTY PHONE NO=
SIDE OF STREET= B
INTERSECTION= xxxxxx
DISTANCE= 0-200m B
ACTIVITY CODE= 15
ACTIVITY DESCRIPTION= xxxxxxxxxxxxxxxxxx
MAP TYPE= StateGrid
MAP REF= Q851_63
MAP PAGE=
MAP GRID 1=
MAP GRID 2=
MAP GRID 3=
MAP GRID 4=
MAP GRID 5=
GPS X COORD=
GPS Y COORD=
PRIVATE/ROAD/BOTH= B
TRAFFIC AFFECTED= No
NOTIFICATION NO= 3082321
MESSAGE= entire intersection of Allora-Clifton rd , Hillside
rd and merivale st
MOCSMESSAGE= Digsafe generated referral
Notice: Please DO NOT REPLY TO THIS EMAIL as it has been automatically generated and replies are not monitored. Should you wish to advise Dial Before You Dig of any issues with this enquiry, please Call 1100
(See attached file: 3082321_LLGDA94.GML)
Google has the answers, once you know that the file-format is called '.ini'
Edit: That is, it's an .ini plus some extra leading/trailing gunk.
You could read each line of the file sequentially. Each line is essentially a name value pair. Place each value in a map (hash table) keyed by name. Use a map for each section. When done parsing the file you'll have maps containing all the name value pairs. Iterate over each map and populate your database tables.
I would head to Python for any type of string parsing like this. I'm not sure how much of this information you want to retain, but I would perhaps use Python's split() function to split on = to get rid of the equals sign, then strip the whitespace out of the second piece of the pie.
First, I would mask out the header/footer info I know I don't need, then do something akin to the following:
Let's take a chunk and save it in test1.txt:
ADDRESS= {Location Address}
SUBURB= {Location Suburb}
STATE= xxx
POSTCODE= xxx
DEPOSITED PLAN NO= 0
SECTION & HUNDRED NO= 0
PROPERTY PHONE NO=
Here's a small python snippet:
>>> f = open("test1.txt", "r")
>>> l = f.readlines()
>>> l = [line.split('=') for line in l]
>>> for line in l:
print line
['ADDRESS', '{Location Address}']
['SUBURB', '{Location Suburb}']
['STATE', 'xxx']
['POSTCODE', 'xxx']
['DEPOSITED PLAN NO', '0']
['SECTION & HUNDRED NO', '0']
['PROPERTY PHONE NO', '']
This would essentially give you a [Column, Value] tuple you could use to insert the data into your database (after escaping all strings, etc etc, SQL Injection warning).
This is assuming the email input and your DB will have the same column names, but if they didn't, it'd be fairly trivial to set up a column mapping using a dictionary. On the flip side, if the email and columns are in sync, you don't need to know the names of the columns to get the parsing down.
You could iterate through the pseudo-dictionary and print out each key-value pair in the right spot in your parameterized sql string.
Hope this helps!
Edit: While this is in Python, C#/VB.net should have the same/similar abilities.
Using f As StreamReader = File.OpenText("sample.txt")
Dim g As String = "undefined"
Do
Dim s As String = f.ReadLine
If s Is Nothing Then Exit Do
s = s.Replace(Chr(9), " ")
If s.StartsWith("[") And s.EndsWith("]") Then
g = s.Substring("[".Length, s.Length - "[]".Length)
Else
Dim ss() As String = s.Split(New Char() {"="c}, 2)
If ss.Length = 2 Then
Console.WriteLine("{0}.{1}={2}", g, Trim(ss(0)), Trim(ss(1)))
End If
End If
Loop
End Using