I have the following problem:
I changed the regional settings to Dutch. This means that number should have the following format: ###.###,## ,and currencies should have the following:
€###.###,##
unfortunately this doesn't seem to work (see picture/table in the background) when I do the DAX formatting it doesn't change it to the European format but to the American format.
can anyone help me understand why this doesn't effect my report? I am running the latest version but couldn't find the solution to my problem online. I've tried almost every solution given by Microsoft but non work!
The Locale for import settings only affect imports from untyped data sources e.g. text files.
The locale used for display is set when the PBIX file is created, based on the windows settings of the machine. It can't be changed through the UI, but there is this workaround you could try:
https://www.sqlbi.com/articles/changing-the-culture-of-a-power-bi-desktop-file/
I need to write a function that generates an id that is unique for a given machine running a Windows OS.
Currently, I'm using WMI to query various hardware parameters and concatenate them together and hash them to derive the unique id. My question is, what are the suggested parameters I should use?
Currently, I'm using a combination of bios\cpu\disk data to generate the unique id. And am using the first result if multiple results are there for each metric.
However, I ran into an issue where a machine that dual boots into 2 different Windows OS generates different site codes on each OS, which should ideally not happen.
For reference, these are the metrics I'm currently using:
Win32_Processor:UniqueID,ProcessorID,Name,Manufacturer,MaxClockSpeed
Win32_BIOS:Manufacturer
Win32_BIOS:SMBIOSBIOSVersion,IdentificationCode,SerialNumber,ReleaseDate,Version
Win32_DiskDrive:Model, Manufacturer, Signature, TotalHeads
Win32_BaseBoard:Model, Manufacturer, Name, SerialNumber
Win32_VideoController:DriverVersion, Name
I had the same problem and after a little research I decided the best would be to read MachineGuid in registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography, as #Agnus suggested. It is generated during OS installation and won't change unless you make another fresh OS install. Depending on the OS version it may contain the network adapter MAC address embedded (plus some other numbers, including random), or a pseudorandom number, the later for newer OS versions (after XP SP2, I believe, but not sure). If it's a pseudorandom theoretically it can be forged - if two machines have the same initial state, including real time clock. In practice, this will be rare, but be aware if you expect it to be a base for security that can be attacked by hardcore hackers.
Of course a registry entry can also be easily changed by anyone to forge a machine GUID, but what I found is that this would disrupt normal operation of so many components of Windows that in most cases no regular user would do it (again, watch out for hardcore hackers).
With our licensing tool we consider the following components
MAC Address
CPU (Not the serial number, but the actual CPU profile like stepping and model)
System Drive Serial Number (Not Volume Label)
Memory
CD-ROM model & vendor
Video Card model & vendor
IDE Controller
SCSI Controller
However, rather than just hashing the components and creating a pass/fail system, we create a comparable fingerprint that can be used to determine how different two machine profiles are. If the difference rating is above a specified tolerance then ask the user to activate again.
We've found over the last 8 years in use with hundreds of thousands of end-user installs that this combination works well to provide a reliably unique machine id - even for virtual machines and cloned OS installs.
Parse the SMBIOS yourself and hash it to an arbitrary length. See the PDF specification for all SMBIOS structures available.
To query the SMBIOS info from Windows you could use EnumSystemFirmwareEntries, EnumSystemFirmwareTables and GetSystemFirmwareTable.
IIRC, the "unique id" from the CPUID instruction is deprecated from P3 and newer.
What about just using the UniqueID of the processor?
I hate to be the guy who says, "you're just doing it wrong" (I always hate that guy ;) but...
Does it have to be repeatably generated for the unique machine? Could you just assign the identifier or do a public/private key? Maybe if you could generate and store the value, you could access it from both OS installs on the same disk?
You've probably explored these options and they doesn't work for you, but if not, it's something to consider.
If it's not a matter of user trust, you could just use MAC addresses.
You should look into using the MAC address on the network card (if it exists). Those are usually unique but can be fabricated. I've used software that generates its license file based on your network adapter MAC address, so it's considered a fairly reliable way to distinguish between computers.
For one of my applications, I either use the computer name if it is non-domain computer, or the domain machine account SID for domain computers. Mark Russinovich talks about it in this blog post, Machine SID:
The final case where SID duplication would be an issue is if a distributed application used machine SIDs to uniquely identify computers. No Microsoft software does so and using the machine SID in that way doesn’t work just for the fact that all DC’s have the same machine SID. Software that relies on unique computer identities either uses computer names or computer Domain SIDs (the SID of the computer accounts in the Domain).
You can access the domain machine account SID via LDAP or System.DirectoryServices.
In my program I first check for Terminal Server and use the WTSClientHardwareId. Else the MAC address of the local PC should be adequate.
If you really want to use the list of properties you provided leave out things like Name and DriverVersion, Clockspeed, etc. since it's possibly OS dependent. Try outputting the same info on both operating systems and leave out that which differs between.
There is a library available for getting hardware specific informations: Hardware serial number extractor (CPU, RAM, HDD, BIOS)
Maybe cheating a little, but the MAC Address of a machines Ethernet adapter rarely changes without the motherboard changing these days.
Can you pull some kind of manufacturer serial number or service tag?
Our shop is a Dell shop, so we use the service tag which is unique to each machine to identify them. I know it can be queried from the BIOS, at least in Linux, but I don't know offhand how to do it in Windows.
I had an additional constraint, I was using .net express so I couldn't use the standard hardware query mechanism. So I decided to use power shell to do the query. The full code looks like this:
Private Function GetUUID() As String
Dim GetDiskUUID As String = "get-wmiobject Win32_ComputerSystemProduct | Select-Object -ExpandProperty UUID"
Dim X As String = ""
Dim oProcess As New Process()
Dim oStartInfo As New ProcessStartInfo("powershell.exe", GetDiskUUID)
oStartInfo.UseShellExecute = False
oStartInfo.RedirectStandardInput = True
oStartInfo.RedirectStandardOutput = True
oStartInfo.CreateNoWindow = True
oProcess.StartInfo = oStartInfo
oProcess.Start()
oProcess.WaitForExit()
X = oProcess.StandardOutput.ReadToEnd
Return X.Trim()
End Function
Look up CPUID for one option. There might be some issues with multi-CPU systems.
Try this one, it gives a unique hard disk ID: Port of DiskId32 for Delphi 7-2010.
I was reading on trial products and the challenge of user forwarding time before installing the product so that it will not expire for long time. One of strategies I read is checking modified time for some files and compare to current time and see the difference if makes sense. My Question is, which are best files to use for the task in both Windows and Linux? Why do you think are the best for the task?
Since I don't remember the url of the site (was reading in a phone and I cannot reproduce url right now), I will appreciate any link on the subject or even SO answer in case I missed it!
Dynamically Embed the date and time of download with in your setup installer package.
Tell the customer to activate the trial product before 48 hours or so. (After activation he can use for entire trial period)
Then, at the time of installation, check whether system time (client machine time) is matching with date time of your installer.
If it is not matching, do not allow the installation.
EDIT:
It can be done in the following ways.
1. Using encryption:
Create an XML file with download time stamp when download button is clicked.
Create a private key using cryptography library such as OpenSSL
Extract public key from private key.
Encrypt xml file using private key, It generates signature file.
Ship EXE file, xml file, public key file and signature file to the client.
When client tries to install, your EXE verifies the signature and xml file using the public key.
If signature matches, it checks whether system time stamp is not greater by more than 48 hours. And it shouldn't be less than download time stamp.
If hack attempt is made to change XML, signature wouldn't match, there by preventing installation / subsequent usage of product.
2. Patching
Patching exe may be done although not recommended. Can a web server dynamically generate an executable on the fly?
It may be resource intensive.
I wan't to manage the different timezones of my users in my web application, but I have no idea where to start. I have to save the local time of each user in my database?, or maybe make the conversion to a UTC time, save it, and then make the conversion again to show it?, or there is another way? For example, if one of my users make an appointment in his local time, I have to convert it to UTC store it in my database, and then when he need it, convert it again to his local time an show it?? By the way, I'm using Django. Thanks.
Store date/time as UTC (Not sure what the Python command for that is)
When outputting dates, wrap them in a helper function that gets the current user's time zone preference, then adjust the time/date for the offset, then output it from the application.
http://docs.python.org/library/time.html
http://docs.python.org/library/datetime.html
Try the Django snippit UTC DateTime field. It has everything you'll need right out of the box, practically.
make the conversion to a UTC time, save it, and then make the conversion again to show it?
Yes, even if you only have one local timezone, you should generally be storing your dates as UTC timestamps in the database, and converting it to and from text in the appropriate timezone in your webapps input and output stages. When you have a per-user timezone stored it's then easy to switch out the default timezone for the customised one.
pytz is the usual solution for selecting and converting timezones. (Although personally I hacked up my own less overwhelming collection of timezones.)
Using a single "database time" timezone is, IMO, the best options because:-
It greatly simplifies routines for dealing with people in different timezones
It allows for easier conversions to other timezones
Anyone seeing the data out of context of the user's view can assume that it's UTC, and not have to guess if "12:45" for one record is "12:45" for another
Standards are good
So, yes. Store the user's timezone in the database, then store all times in a common time (Like UTC). Convert them when the user views anything including time. It's the simplest solution that doesn't just force all users to pretend to be in the same timezone.
The GetVersions() call to the Versions.asmx web service in SharePoint 2003 returns a localised date format, with no way of determining what the format is. It's the site regional setting of date format, but I can't find a way to get even that out of SharePoint 2003. Locally, it looks like SPRegionalSettings can be used (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spregionalsettings.aspx) but what about a web service version of this?
Sadly, it isn't available. However, you can specify a query option to specify that you want the values returned in UTC:
http://www.sharepointblogs.com/pm4everyone/archive/2006/10/03/sharepoint-2003-querying-with-gmt-datetime.aspx
Unfortunately, the parameter that asks for the values in UTC is not supported for this call. I've just had to look for a month greater than 12 and use that as the hint to switch date formats. It'll mess up some dates, but I can't see a way around that. The code is at http://sourceforge.net/projects/splistcp/ if anyone is interested.