PowerPoint is huge on a second monitor

If you are running Windows 10 and you have a high-DPI monitor such as in a Surface Pro 3, and connect to a second monitor using a Mini-DisplayPort adapter, then open PowerPoint, its very likely that you will find this:

PowerPoint DPI problems Surface Pro 3, Windows 10, Office 365

If you haven’t seem the problem personally, it might be difficult to guess from the picture what is going on. The problem is that PowerPoint’s Ribbon is huge given that it is running in a 21″ monitor and not in a tablet anymore.

The problem doesn’t seem to occur with Word or Excel when they are transposed from the Surface screen to the external monitor. It seems to be exclusively related to PowerPoint.

Hopefully, there is a solution for this problem. If you have Office 365, open the file

C:Program FilesMicrosoft Office 15rootoffice15powerpnt.exe.manifest

Using a text editor. Then, look for word True/PM in the following block:

And change it to:

Now save and open PowerPoint. PowerPoint should not auto-scale properly when you transpose its window from the Surface Pro 3 screen and to external monitor, and vice-versa:

PowerPoint Windows 10 Surface Pro 3 - normal DPI

 

How to fix blurry Windows Forms Windows in high-dpi settings

If you have just opened one of your previous applications in your brand new computer with a very high-dpi monitor, perhaps you will find out that your interface that previously worked perfectly is now utterly broken and/or blurry.

This might be the case, for example, if you just tried to open an old Windows.Forms application in your brand new Surface Pro computer.

winforms-dpi-off
Windows.Forms (WinForms) application in a high-dpi display. If you have your DPI set to 150%, your form might now look like this.

 

winforms-dpi-on
Same WinForms application after applying the fix detailed here.

 

How to fix it

  1. Go the the Forms designer, then select your Form (by clicking at its title bar)
  2. Press F4 to open the Properties window, then locate the AutoScaleMode property
  3. Change it from Font (default) to Dpi.

winforms-dpi-turning

Now, go to Program.cs (or the file where your Main method is located) and change it to look like

Save and compile. Now your form should look crispy again.

I encountered this problem while opening and editing Accord.NET sample applications in Visual Studio in a Surface 3 Pro.

Related resources

OxyPlot.Axes.LinearAxis is obsolete

Warning 461 ‘OxyPlot.Axes.LinearAxis.LinearAxis(OxyPlot.Axes.AxisPosition, double, double, string)’ is obsolete

If you try to use OxyPlot.Axes.LinearAxis‘ constructor with parameters, the compiler will complain telling you the method has been deprecated and shouldn’t be used. I couldn’t find on the web which was the alternative solution to resolve this issue, but then it occurred to me that, what really is being deprecated, is the passage of arguments through the constructor’s parameters.

As such, the solution is simply to rewrite your code and call the axis’ default constructor instead, using C# object initialization syntax to configure your object:

Hope it can be of help if you were getting those warnings like me.

Cleaning Cached Blog Entries in Google Reader – Or: How to Remove Unwanted Posts from Google Reader

While I was working on my next article using Windows Live Writer, I’ve hit the “publish” button too soon and ended up with a published draft in my blog. I just went and re-drafted the entry, thinking everything was going to be fine. Unfortunately, I did not realize that Google Reader automatically caches everything it finds, and do not delete entries even if them have been deleted from their original blog.

After some researching, I’ve found out that if I published a new post with the same GUID as the unwanted entry, it would be automatically updated in Reader. So here are the steps to remove an unwanted blog post from Google Reader:

Removing an unwanted blog post from Google Reader

Step 1: Consulting Reader’s cache

Type the following address in your address bar, substituting yourblogname by your actual blog name:

http://www.google.com/reader/atom/feed/http://yourblogname.blogspot.com/feeds/posts/default?r=n&n=100

Go to the page, then right click its content and select “View page source” or equivalent.

Step 2: Find the offending post

Find the string “blogger.googleusercontent.com/tracker/” and notice the two numbers that come after it:

https://blogger.googleusercontent.com/tracker/88422212108117265282876694319097447217?l=yourblog.blogspot.com

Those are your blog ID and post ID, respectively.

Step 3: Resurrection!

Copy and paste these two numbers in the placeholders of the following URL:

http://draft.blogger.com/post-edit.g?blogID=yourblogid&postID=yourpostid

Finally, open this URL and watch your once deleted (?) blog post be resurrected from the dead. Update it or just leave it blank, set the post date to the future and publish it again. Voilà!

 

Update: Unfortunately, the original post title will remain as the URL for the entry. As you can see, this was going to be a post about Partial Least Squares Analysis. However, I’ll leave it as is to prove this procedure really works. Cheers!

Update 2: I made a simple application to browse and edit deleted blogger posts that have been cached by Google Reader. The program, together with the C# source code can be found here. The program uses the Google Reader API developed by Matt Berseth.

Onde encontrar cabo de força para fonte de alimentação de notebooks

cabo-2_thumb-5B5-5D

Geralmente, ao comprar uma fonte nova, principalmente pela internet, o que chega é somente a fonte, sem o cabo de alimentação que a conecta na tomada. Neste caso, é preciso adquiri-lo separadamente. O que não chega a ser importuno desde que na sua cidade alguem saiba onde encontrar este bendito cabo, o que não é o caso de Valinhos, por exemplo, em que me disseram que eu nunca o acharia.

Bom, se você mora em São Carlos, a boa notícia é que ele pode ser encontrado na:

Eletrônica Gaspar

Av. São Carlos, 2615, São Carlos-SP
Fone: (16) 3371-4014 / 3371-3412

 

É a segunda vez que anuncio o endereço da Gaspar neste blog. Um detalhe interessante é que na Gaspar você encontra dois tipos de cabos, o de dois pinos e o de três pinos.

cabo-2

O cabo de dois pinos, comumente usado em aparelhos de som, custa R$7,00, mas não encaixa perfeitamente na fonte. Contudo, com alguma força (ou com algum entalhamento no conector de plástico) é possível fazê-lo entrar. Vale a pena se você, por exemplo, não tiver uma fiação terra em sua casa e já estiver usando um adaptador de três pinos para poder carregar seu notebook. É uma opção também caso não consiga encontrar o cabo de três pinos em sua cidade, já que este deve estar disponível em qualquer assistência ou loja de eletrônica.

cabo-3

Já o cabo de três pinos encaixa perfeitamente porém custava R$21,00. Estes preços são referentes ao mês de fevereiro de 2010 na Gaspar, mas não creio que mudem muito de loja para loja nem ao decorrer dos anos.

 

No meu caso, resolvi comprar o de dois pinos para evitar ter de andar sempre carregando um adaptador na mala para os (quase todos) casos em que não há uma conexão terra disponível nos lugares onde vou. Após algum trabalho para fazê-lo entrar, funciona perfeitamente na minha fonte HP importada do DealExtreme.

Windows Vista falha ao retornar do modo sleep ou da hibernação – Como resolver?

Este é um problema muito comum. Já observei várias máquinas, incluindo absolutamente todas as máquinas do laboratório da UFSCar que tinham o Vista instalado em 2008 enfrentando dificuldades em retornar da hibernação ou do sleep. O problema é bem característico:

O Problema

Passos:

  • Deixe seu computador entrar em sleep ou hibernar.
  • Tente voltar do modo de espera.

Resultado:

  • A máquina liga, mas sem vídeo (a tela permanece apagada) e sem nenhum recurso USB (como mouse e teclado) respondendo a seu comando.

Sendo que a única maneira de recuperar é forçando um shutdown segurando o botão de power.

A Solução

Apesar da Microsoft alegar que este problema não existe, a solução é relativamente simples. O problema ocorre pois um dos dispositivos USB falha ao ser suspenso. Para verificar se é este mesmo o problema, siga estes passos:

  1. Abra um prompt de comando com privilégios de administrador.

  2. Digite powercfg -energy

Isto fará com que seja criado um arquivo HTML indicando quaisquer erros relacionados com o sistema de energia. O arquivo será criado em C:Windowssystem32energy-report.html

Abra o arquivo. Provavelmente haverá uma linha indicando “USB Suspend:USB Device not Entering Suspend” ou algo similar em português. Neste caso,

  1. Vá até o Painel de Controle->Opções de Energia->(seu plano de energia)->Modificar configurações do plano->Modificar Configurações Avançadas->Configurações USB->Suspensão USB Seletiva e desabilite esta configuração.

  2. Clique OK.

  3. Problema resolvido.

Impressão de Painéis em São Carlos para Apresentações em Congressos Científicos

Alguns meses atrás precisei encontrar um local que fabricasse painéis para apresentações em congressos e conferências, como para a IX International Conference on Machine Learning and Applications. Buscando informações, um dos locais em São Carlos a que fui recomendado foi a Disque Cópias Xerox e Plotagem.

Disque Copias Xerox e Plotagem


View Larger Map

Rua Sete de Setembro, 2152
Fone: 3372-9545

Painel 90cm x 120cm (gloss paper)

  • Apenas impressão: R$42,00
  • Impressão com acabamento (suportes): R$47,00

O tempo para secagem do painel é de aproximadamente 5 dias. O painel pode ser fornecido no formato PDF ou PowerPoint. E a qualidade é bastante satisfatória. O mesmo serviço em Campinas chega a custar R$80,00.

C# is now a better language than Java…

… but I really feel like I need to try Scala.

After some chatting and hearing wonders about this language I decided to try something new. I decided to try Scala.

Here is a list of cool references, not only for Scala, but about programming in general, kindly given by an experienced programmer I met some weeks ago.

 

Books

Programming in Scala: A comprehensive step-by-step guide

~ Martin Odersky, Lex Spoon, and Bill Venners

This book is the authoritative tutorial on the Scala programming language, co-written by the language’s designer, Martin Odersky.

Clean Code: A Handbook of Agile Software Craftsmanship

~ Robert C. “Uncle Bob” Martin

Even bad code can function. But if code isn’t clean, it can bring a development organization to its knees. Every year, countless hours and significant resources are lost because of poorly written code. But it doesn’t have to be that way.

Refactoring: Improving the Design of Existing Code

~ Martin Fowler, Kent Beck, John Brant, William Opdyke, Don Roberts

Refactoring is a controlled technique for improving the design of an existing code base. Its essence is applying a series of small behavior-preserving transformations, each of which “too small to be worth doing”. However the cumulative effect of each of these transformations is quite significant. By doing them in small steps you reduce the risk of introducing errors. You also avoid having the system broken while you are carrying out the restructuring – which allows you to gradually refactor a system over an extended period of time.

Implementation Patterns

~ Kent Beck

Great code doesn’t just function: it clearly and consistently communicates your intentions, allowing other programmers to understand your code, rely on it, and modify it with confidence. But great code doesn’t just happen. It is the outcome of hundreds of small but critical decisions programmers make every single day. Now, legendary software innovator Kent Beck–known worldwide for creating Extreme Programming and pioneering software patterns and test-driven development–focuses on these critical decisions, unearthing powerful “implementation patterns” for writing programs that are simpler, clearer, better organized, and more cost effective.

Code Complete: A Practical Handbook of Software Construction

~ Steve McConnell

For more than a decade, Steve McConnell, one of the premier authors and voices in the software community, has helped change the way developers write code–and produce better software. Now his classic book, CODE COMPLETE, has been fully updated and revised with best practices in the art and science of constructing software. Whether you’re a new developer seeking a sound introduction to the practice of software development or a veteran exploring strategic new approaches to problem solving, you’ll find a wealth of practical suggestions and methods for strengthening your skills. Topics include design, applying good techniques to construction, eliminating errors, planning, managing construction activities, and relating personal character to superior software. This new edition features fully updated information on programming techniques, including the emergence of Web-style programming, and integrated coverage of object-oriented design. You’ll also find new code examples–both good and bad–in C++, Microsoft(r) Visual Basic(r), C#, and Java, though the focus is squarely on techniques and practices.

Amazon Editorial Review

The Mythical Man-Month: Essays on Software Engineering, Anniversary Edition (2nd Edition)

~ Frederick P. Brooks

The classic book on the human elements of software engineering. Software tools and development environments may have changed in the 21 years since the first edition of this book, but the peculiarly nonlinear economies of scale in collaborative work and the nature of individuals and groups has not changed an epsilon. If you write code or depend upon those who do, get this book as soon as possible — from Amazon.com Books, your library, or anyone else. You (and/or your colleagues) will be forever grateful. Very Highest Recommendation.

 

Blogs & Online Resources

Joel on Software

A weblog by Joel Spolsky, a programmer working in New York City, about software and software companies.

The Artima Developer Community

Artima.com is a collection of resources about Java, Jini, the JVM, and object oriented design.

Mark’s Blog

Mark Russinovich’s technical blog covering topics such as Windows troubleshooting, technologies and security. Among other feats, Russinovich was the man behind the discovery of the Sony rootkit in Sony DRM products in 2005.

Object Mentor’s Blog

A team of consultants who mentor their clients in C++, Java, OOP, Patterns, UML, Agile Methodologies, and Extreme Programming.

 

People to follow

@unclebobmartin

Known colloquially as “Uncle Bob”, Robert Cecil Martin has been a software professional since 1970 and an international software consultant since 1990. In 2001, he led the group that created Agile software development from Extreme programming techniques. He is also a leading member of the Software Craftsmanship movement.

He is founder and president of Object Mentor Inc., a team of consultants who mentor their clients in C++, Java, OOP, Patterns, UML, Agile Methodologies, and Extreme Programming.

@KentBeck

Kent Beck is an American software engineer and the creator of Extreme Programming and Test Driven Development. Beck was one of the 17 original signatories of the Agile Manifesto in 2001.

A word on Neural Network learning

micro_tanks

Some time ago, while doing random research, I came across this funny but important note about neural networks, and thought it was worth sharing.

The choice of the dimensionality and domain of the input set is crucial to the success of any connectionist model. A common example of a poor choice of input set and test data is the Pentagon’s foray into the field of object recognition. This story is probably apocryphal and many different versions exist on-line, but the story describes a true difficulty with neural nets.

As the story goes, a network was set up with the input being the pixels in a picture, and the output was a single bit, yes or no, for the existence of an enemy tank hidden somewhere in the picture. When the training was complete, the network performed beautifully, but when applied to new data, it failed miserably. The problem was that in the test data, all of the pictures that had tanks in them were taken on cloudy days, and all of the pictures without tanks were taken on sunny days. The neural net was identifying the existence or non-existence of sunshine, not tanks.

– David Gerhard; Pitch Extraction and Fundamental Frequency: History and Current Techniques, Technical Report TR-CS 2003-06, 2003.

 

🙂