Troubleshooting: Silverlight installation on MacOS-X
One of our ClipFlair Studio users reported on having some issue trying to install Silverlight on MacOS-X, so I gathered some related info below:
First of all, at the Silverlight installation webpage, at the System Requirements tab, you can find the following requirements:
- Macintosh (Intel-based) Intel Core Duo 1.83-gigahertz (GHz) or higher processor with 512-MB of RAM
- Macintosh OS 10.5.7+ (Intel-based)
- Firefox 3.6+ or Safari 4+ web browser (note that Safari isn’t supported on Windows since it doesn’t support plugins I think)
- So, if you use Chrome, checkout https://support.google.com/chrome/answer/2445334?hl=en, although those instructions applied to Silverlight 4. With Silverlight 5 which doesn’t officially support Google Chrome on MacOS-X (supports it only on Windows), there is a serious issue with text input.
- Also I’d suggest using Mozilla Firefox instead of Safari.
If the Mac User already has Silverlight installed but has problems using the Silverlight component take the following steps in Removing Silverlight plugins on Macintosh:
- Double-click the hard drive icon on your desktop
- Find the plugin by Navigating to your Internet Plug-Ins directory: /Library/Internet Plug-Ins/
Remove the plugin by Dragging any of the following into your trash bin:
- Silverlight.plugin
- WPFe.plugin
The Mac OS X 10.7 (Lion) and higher versions of Mac Operating Systems seem to have the feature called "Resume" which ensures that the Mac system will recall the state of applications and files just before you quit which would allow you to open them up again, and just pick up from where you left off.
However, the "Resume" feature may be a stumbling block when it comes to installing Silverlight.
Therefore, it might be a good idea if we turn off the "Resume" feature temporarily in order to install Silverlight.
If you have a Mac OS X 10.7 (Lion) or higher version then:
- Go to System Preferences.
- Go to "General" Tab.
- Make sure "Restore windows when quitting and re-opening apps" is unchecked.
After successful Silverlight installation you can go back and select that option again.
Ensure that you quit all browsers on the Mac before the installation of Silverlight.
- From the top menu bar use Quit action to exit the browser. Do the same for all open browsers (e.g. Safari or Mozilla Firefox). Else see above how to set your system to not restore applications after reboot.
- Shutdown your Mac, and then start up your Mac again.
- Make sure all browser applications have been quited (don’t just close their open windows, you need to select the Quit menu action to close the browser process).
After following the above steps, to install Silverlight do the following:
- Navigate to the folder where your browser places downloaded files.
- Click on the Silverlight installation file (should be a file with the extension .pkg or it might be file with extension .dmg which contains a file with extension .pkg)
- Run the installation (the .pkg file)
Vita: ενεργειακά βραχιολάκια και χάντρες για τους ιθαγενείς
Πρόσφατα η Γενική Γραμματεία Καταναλωτή (http://www.efpolis.gr) είχε καταδικάσει τις εταιρείες με τα ενεργειακά (τάχα μου) βραχιολάκια όπως διαβάζει κανείς στο παρακάτω:
http://www.ethnos.gr/article.asp?catid=22768&subid=2&pubid=63733163
Πρόστιμα συνολικού ύψους 350.000 ευρώ σε πέντε εταιρείες για προώθηση και διάθεση προς πώληση ενεργειακών βραχιολιών με αναληθείς ισχυρισμούς, επέβαλε η Γενική Γραμματεία Καταναλωτή.
Πρόκειται για βραχιόλια με διάφορες εμπορικές επωνυμίες (Power Balance, Bios Balance, Trymax, ENERGY BALANCE PERFORMANCE TECHNOLOGY, SB Super Balance κ.λπ.), τα οποία, σύμφωνα με τους ισχυρισμούς των εταιρειών, είναι προϊόντα ειδικής τεχνολογίας που χαρίζουν ισορροπία, ενέργεια, δύναμη, βοηθούν στην υγεία, αθλητικά προϊόντα τεχνολογίας για καλύτερες επιδόσεις, βελτιώνουν την ισορροπία, τη δύναμη και την ευελιξία του σώματος και βοηθούν στην καθημερινή, καλύτερη λειτουργία και απόδοση του οργανισμού του ανθρώπου.
Οι ισχυρισμοί αυτοί κρίθηκαν αναληθείς, επειδή οι εταιρείες δεν προσκόμισαν αποδεικτικά στοιχεία για την επαρκή επιστημονική τεκμηρίωσή τους. Επιπλέον, δεν διέθεταν αποδεικτικά στοιχεία βασισμένα σε μελέτες, σχετικά με βελτίωση των αθλητικών επιδόσεων από τη χρήση των προϊόντων αυτών.
Παραπλανητική, επίσης, κρίθηκε και η προώθηση ορισμένων από τα προϊόντα αυτά, σε περιοδικά και στις σχετικές ιστοσελίδες ηλεκτρονικών καταστημάτων πώλησής τους, μέσω δηλώσεων γνωστών αθλητών, που παροτρύνουν τους καταναλωτές να αγοράσουν προϊόντα, τα οφέλη των οποίων στερούνται επιστημονικής τεκμηρίωσης.
Η Γενική Γραμματεία Καταναλωτή, επίσης, απέστειλε επιστολή στον Πανελλήνιο Φαρμακευτικό Σύλλογο, προκειμένου να ενημερωθούν τα φαρμακεία όλης της χώρας για τα συγκεκριμένα προϊόντα και να προχωρήσουν άμεσα στην απομάκρυνση του προωθητικού υλικού με τους παραπλανητικούς ισχυρισμούς.
Όμως φαίνεται μας θεωρούν ιθαγενείς αυτοί οι απατεώνες και έχουν συνηθίσει το κράτος να είναι ανύπαρκτο. Βλέπετε τι να τους κάνουν τα πρόστιμα όταν αυτοί έχουν θησαυρίσει εν τω μεταξύ; (έφταιγε μετά ο Κατής στη γνωστή τηλεοπτική σειρά Σουλεϊμάν ο Μεγαλοπρεπής που κάρφωνε από τ’αυτιά στη θύρα τους όσους εμπόρους εξαπατούσαν τους πελάτες τους;)
Θαυμάστε διαφήμιση λοιπόν της bios balance στο τεύχος Απριλίου του Vita, όπου έδινε και βραχιολάκι της μαζί. Οπότε ένα γερό πρόστιμο αξίζει και στο Vita που προσπάθησε να πουλήσει περισσότερα αντίτυπα προωθώντας αυτό το "προϊόν" και βγάζοντας χρήματα και από τη διαφήμιση του ενώ θα έπρεπε να γνωρίζει το ιστορικό (πιθανώς επειδή ακριβώς το γνώριζε να πήρε και κάτι παραπάνω για να βάλει τη διαφήμιση εξαπατώντας τους αναγνώστες του που απευθύνονται σε αυτό για υγεινή διατροφή κλπ.). Ακριβώς δηλαδή όπως εξαπατούσαν και τα αφαρμακεία τους πελάτες τους (μέχρι και επίδειξη τους έκαναν με το πείραμα-απάτη για να σε πείσουν πως ισορροπείς καλύτερα) και οι φαρμακευτικοί σύλλογοι που είχαν τέτοιες διαφημίσεις στα περιοδικά τους (δεν είναι τυχαίο που η ΓΓ Καταναλωτή είχε ζητήσει να φύγουν τα βραχιολάκια από τα φαρμακεία).
Και τι άλλο μας λέει η διαφήμιση στο κάτω μέρος; “Ζητήστε από το φαρμακοποιό σας να σας κάνει τα test Bios Balance”. Σαν να μην πέρασε μια μέρα δηλαδή! Για ποιά test μιλούν; Πήγαινες στο φαρμακείο και ο φαρμακοποιός που προφανώς έπαιρνε καλή προμήθεια αφού σου έλεγε πως και ο τότε πρωθυπουργός ο Γ. Παπαδρέου φόραγε φραχιολάκι όταν έτρεχε (επιφυλάσομαι αν ήταν κάποιο “ενεργειακό”) σου έλεγε να κλείσεις τα μάτια και ν’ανοίξεις τα χέρια. Σου πίεζε το ένα χέρι κάτω και φυσικά εμφάνιζες αστάθεια. Μετά σου έβαζε το βραχιολάκια και ξανακάνατε το πείραμα. Γιατί άραγε δεν έκανε πρώτα τη δοκιμή με το βραχιολάκι και μετά να το βγάλεις; Γιατί φυσικά τη 2η φορά ήξερες τι θα κάνει και αφού ήσουν προετοιμασμένος δεν εμφάνιζες αστάθεια και αν ήσουν αδαής πειθώσουν που σε βοήθησε το βραχιολάκι με το μοναδικό “ενεργειακό ολόγραμμα που έχει διαμορφωθεί σύμφωνα με συχνότητες που λειτουργούν σε αρμονία με το φυσικό ενεργειακό πεδίο του σώματος” (όπως γράφει η παρακάτω διαφήμιση) και κουραφέξαλα (για όσους δεν ξέρουν τον ορισμό του ολογραμματος).
Μάλιστα βλέπουμε και τη κυρία Πηγή Δεβεντζή να φιγουράρει εκεί προωθώντας προϊόν που ως αθλήτρια θα έπρεπε να γνωρίζει πως είναι απάτη (και δεν είναι η πρώτη φορά που το κάνει αφού και παλαιότερα – πριν τα πρόστιμα από τη ΓΓ Καταναλωτή – ήταν στις διαφημίσεις της bios balance στο περιοδικό μεγάλου φαρμακευτικού συλλόγου).
Αλλά απορώ πως εμφανίζεται ακόμη η κυρία Δεβεντζή με τις δάφνες της Ολυμπιονίκη ως υπόδειγμα αθλήτριας όταν στο http://www.skai.gr/news/sports/article/165344/dietis-apokleismos-gia-tin-pigi-devetzi/ διαβάζουμε:
ο ΣΕΓΑΣ ενημερώθηκε από τη διεθνή ομοσπονδία στίβου πως η πρωταθλήτρια του τριπλούν τιμωρείται με διετή ποινή αποκλεισμού.
Το παράπτωμα που βαρύνει την Δεβετζή- το όνομά της είναι ήδη στη λίστα των τιμωρημένων αθλητών στην ιστοσελίδα της IAAF- είναι της «αποτυχίας να δώσει δείγμα» σε αιφνίδιο έλεγχο που έγινε στις 23 Μαϊου του 2009 στην Γιάλτα. Ηταν η εποχή που η άλτρια συνεργαζόταν με έναν προπονητή στην Ουκρανία.
Πότε θα τους μαζέψουν όλους αυτούς τους κυρίους και τα σκουπίδια τους; Η σχετική ευρωπαϊκή οδηγία υπάρχει από χρόνια:
Η οδηγία2005/29/EΚ για τις αθέμιτες εμπορικές πρακτικές, που εγκρίθηκε το 2005, προβλέπει εναρμονισμένους κανόνες για την αντιμετώπιση των αθέμιτων εμπορικών πρακτικών. Εξασφαλίζει ότι οι καταναλωτές δεν παραπλανούνται ούτε εκτίθενται σε επιθετικές μεθόδους μάρκετινγκ και ότι οποιοσδήποτε ισχυρισμός από πλευράς των εμπορευόμενων στην Ευρωπαϊκή Ένωση είναι σαφής, ακριβής και αιτιολογημένη, παρέχοντας τη δυνατότητα στους καταναλωτές να προβαίνουν σε ενημερωμένες και εύλογες επιλογές. Η οδηγία στοχεύει επίσης να εξασφαλίσει, να προωθήσει και να προστατεύσει τον θεμιτό ανταγωνισμό στον τομέα των εμπορικών πρακτικών. Έχει ευρύ πεδίο εφαρμογής και ισχύει σε όλους τους οικονομικούς τομείς.
.NET String extension methods to check for array of prefixes or suffixes
Seems StartsWith and EndsWith methods of String class in .NET are missing a version that accepts multiple (as an array) prefixes or suffixes respectively when testing the string. To achieve this I just added the following extension methods to StringExtensions class (of Utils.Extensions namespace) under Utils.Silverlight project at the ClipFlair source code.
public static bool StartsWith(
this string s,
string[] suffixes,
StringComparison comparisonType = StringComparison.CurrentCulture) { foreach (string suffix in suffixes) if (s.StartsWith(suffix, comparisonType)) return true; return false; } public static bool EndsWith(
this string s,
string[] suffixes,
StringComparison comparisonType = StringComparison.CurrentCulture) { foreach (string suffix in suffixes) if (s.EndsWith(suffix, comparisonType)) return true; return false; }
To use them, you add a reference to Utils.Silverlight project to your own one and then add a using clause for the namespace that hosts a static class with these extension methods (e.g. “using Utils.Extensions;”) and then you can use them on any String at the respective source file. Can even use them on literal strings, since most .NET compilers support Boxing of literals into respective types.
I’m using a default value for the comparisonType method argument to make it optional. I use StringComparison.CurrentCulture as the default value for it (performing a word case-sensitive and culture-sensitive comparison using the current culture), as Microsoft is doing at “String.StartsWith(String)” method. However, do note the following text from that method’s documentation:
Notes to Callers
As explained in Best Practices for Using Strings in the .NET Framework, we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To determine whether a string begins with a particular substring by using the string comparison rules of the current culture, call the StartsWith(String, StringComparison) method overload with a value of StringComparison.CurrentCulture for its comparisonType parameter.
.NET String class extensions to replace prefix or suffix
Just added the following extension methods to StringExtensions class (of Utils.Extensions namespace) under Utils.Silverlight project at the ClipFlair source code.
public static string ReplacePrefix(
this string s,
string fromPrefix,
string toPrefix,
StringComparison comparisonType = StringComparison.CurrentCulture) { return (s.StartsWith(fromPrefix, comparisonType)) ?
toPrefix + s.Substring(fromPrefix.Length) : s; } public static string ReplacePrefix(
this string s,
string[] fromPrefix,
string toPrefix,
StringComparison comparisonType = StringComparison.CurrentCulture) { foreach (string prefix in fromPrefix) if (s.StartsWith(prefix, comparisonType)) return toPrefix + s.Substring(prefix.Length); return s; } public static string ReplaceSuffix(
this string s,
string fromSuffix,
string toSuffix,
StringComparison comparisonType = StringComparison.CurrentCulture) { return (s.EndsWith(fromSuffix, comparisonType)) ?
s.Substring(0, s.Length - fromSuffix.Length) + toSuffix : s; } public static string ReplaceSuffix(
this string s,
string[] fromSuffix,
string toSuffix,
StringComparison comparisonType = StringComparison.CurrentCulture) { foreach (string suffix in fromSuffix) if (s.EndsWith(suffix, comparisonType)) return s.Substring(0, s.Length - suffix.Length) + toSuffix; return s; }
To use them, you add a reference to Utils.Silverlight project to your own one and then add a using clause for the namespace that hosts a static class with these extension methods (e.g. “using Utils.Extensions;”) and then you can use them on any String at the respective source file. Can even use them on literal strings, since most .NET compilers support Boxing of literals into respective types.
e.g.
s = s.ReplacePrefix("https://", "http://", StringComparison.OrdinalIgnoreCase);
//– converts https:// prefix to http:// ignoring character case
or
s = s.ReplacePrefix(new String[]{"https://", "http://"}, "", StringComparison.OrdinalIgnoreCase);
//– removes https:// or http:// prefix ignoring character case
Update:
I added a default value for the comparisonType method argument to make it optional. I use StringComparison.CurrentCulture as the default value for it (performing a word case-sensitive and culture-sensitive comparison using the current culture), as Microsoft is doing at “String.StartsWith(String)” method. However, do note the following text from that method’s documentation:
Notes to Callers
As explained in Best Practices for Using Strings in the .NET Framework, we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To determine whether a string begins with a particular substring by using the string comparison rules of the current culture, call the StartsWith(String, StringComparison) method overload with a value of StringComparison.CurrentCulture for its comparisonType parameter.
Fix: remove ‘optimized for Bing and MSN’ from IE titlebar
Seems some Microsoft software (probably Bing bar) version is changing Internet Explorer title bar to write “optimized for Bing and MSN”.
To remove this:
- Use Start/Run or Start/Find and type there regedit then press ENTER to launch the Registry Editor.
- At the tree on the left navigate to HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
- At the right handside of the window right click the value “WindowTitle” and select “Delete” to restore the default “- Windows Internet Explorer” suffix on the IE titlebar
IIS FTP login fails after Windows platform update for Server 2008 R2
I had recently enabled FTP access to the ClipFlair Gallery to easy its maintenance during development and after the Windows Server 2008 R2 platform update last night (together with release for Internet Explorer 10), the FTP login stopped working.
To fix it, from a command prompt with administrator rights (Start/Find, type Command and right click the Command Prompt item found to open as administrator), give the command:
netsh advfirewall set global StatefulFtp disable
It’s easy to copy-paste it from here and right-click on the command prompt title bar, then select Edit>Paste (no shortcut key for that unfortunately), then press the ENTER key and it should reply “Ok”.
Had done this before, but seems the platform update re-enabled filtering for Stateful FTP (also note that at http://www.iis.net/learn/publish/using-the-ftp-service/configuring-ftp-firewall-settings-in-iis-7 it seems to erroneously say that you need to use “enble” instead of “disable” when not using SSL).
HowTo: format XML output of DataContractSerializer
based on the other samples posted at StackOverflow on how to format XML created by DataContractSerializer, that use XmlWriter, here’s a version (from ClipFlair source code) that works with streams (and Ionic.Zip library in specific).
It also shows how the code is when you don’t apply formatting (using conditional compilation). Just comment out the #define (prefix it with //) to make it write unformatted XML.
#define WRITE_FORMATTED_XML
using System.Xml;
namespace ClipFlair.Windows
{
public partial class BaseWindow : FloatingWindow
{
//...
#if WRITE_FORMATTED_XML
private static XmlWriterSettings XML_WRITER_SETTINGS =
new XmlWriterSettings() { Indent=true, IndentChars=" "};
#endif
//...
public virtual void SaveOptions(ZipFile zip, string zipFolder = "")
//THIS IS THE CORE SAVING LOGIC
{
if (SavingOptions != null) SavingOptions(this, null); //notify any listeners
View.Busy = true;
try
{
ZipEntry optionsXML =
zip.AddEntry(zipFolder + "/" + View.GetType().FullName + ".options.xml",
new WriteDelegate((entryName, stream) =>
{
DataContractSerializer serializer =
new DataContractSerializer(View.GetType());
//assuming current View isn't null
#if WRITE_FORMATTED_XML
using (XmlWriter writer = XmlWriter.Create(stream, XML_WRITER_SETTINGS))
serializer.WriteObject(writer, View);
#else
serializer.WriteObject(stream, View);
#endif
}));
}
catch (Exception e)
{
MessageBox.Show("ClipFlair options save failed: " + e.Message);
}
finally
{
View.Busy = false; //in any case (error or not) clear the Busy flag
}
if (SavedOptions != null) SavedOptions(this, null); //notify any listeners
}
//...
}
}