Tag Archives: totó

Tela em branco após hibernação ou sono?

Ok, A resposta curta, aumentar a memória virtual para mais do que o tamanho de sua memória física.

Versão longa agora. Recentemente, Eu tive esse problema com o meu PC que não iria acordar do modo de hibernação ou dormir corretamente. O próprio PC seria ligado e agitando, mas a tela iria mudar para o modo de poupança, ficar em branco. A única coisa a fazer nesse momento seria necessário reiniciar o computador.

Como o bom internauta que eu sou, I arrastão na Internet por uma solução. Mas não havia nenhuma. Alguns sugeriram a atualização do BIOS, substituir a placa de vídeo e assim por diante. Então eu vi este mencionados em um grupo Linux, dizendo que o tamanho do ficheiro de comutação deverá ser mais do que a memória física, e decidiu experimentá-lo na minha máquina Windows XP. E ele resolveu o problema!

Portanto, a solução para este problema de tela em branco depois de acordar é para definir o tamanho da memória virtual para algo maior do que a memória do seu sistema. Se precisar de mais informações, aqui é como, em forma passo-a-passo. Estas instruções aplicam-se a uma máquina com Windows XP.

  1. Clique com o botão direito do mouse em “Meu computador” e bater “Propriedades.”
  2. Dê uma olhada no tamanho da memória RAM, e clique no “Avançado” guia.
  3. Clique na “Cenário” botão sob a “Atuação” caixa de grupo.
  4. No “Opções de desempenho” janela que surge, selecionar o “Avançado” guia.
  5. No “Memória virtual” caixa de grupo perto da parte inferior, clique no “Alterar” botão.
  6. No “Memória virtual” janela que aparece, definir o “Tamanho personalizado” para algo mais do que o seu tamanho RAM (que você viu na etapa 2). Você pode configurá-lo em qualquer partição do disco rígido que você tem, mas se você está passando por todas estas instruções, as chances são de que você só tem “C:”. No meu caso, Optei por colocá-lo em “M:”.
Se você encontrou este post útil, você também pode gostar:

  1. Como recuperar faltando eventos e fotos no iPhoto?
  2. Como Evitar Importações duplicadas no iPhoto?

Magic of Object Oriented Languages

Nowhere is the dominance of paradigms more obvious than in object oriented languages. Just take a look at the words that we use to describe some their features: polymorphism, inheritance, virtual, abstract, overloadingall of them normal (or near-normal) everyday words, but signifying notions and concepts quite far from their literal meaning. Ainda, and here is the rub, their meaning in the computing context seems exquisitely appropriate. Is it a sign that we have taken these paradigms too far? Talvez. Afinal, o “objectin object oriented programming is already an abstract paradigm, having nothing to do withThat Obscure Object of Desire,” por exemplo.

We do see the abstraction process running a bit wild in design patterns. When a pattern calls itself a visitor or a factory, it takes a geekily forgiving heart to grant the poetic license silently usurped. Design patterns, despite the liberties they take with our sensitivities, add enormous power to object oriented programming, which is already very powerful, with all the built in features like polymorphism, inheritance, overloading etc.

To someone with an exclusive background in sequential programming, all these features of object oriented languages may seem like pure magic. But most of the features are really extensions or variations on their sequential programming equivalents. A class is merely a structure, and can even be declared as such in C++. When you add a method in a class, you can imagine that the compiler is secretly adding a global function with an extra argument (the reference to the object) and a unique identifier (dizer, a hash value of the class name). Polymorphic functions also can be implemented by adding a hash value of the function signature to the function names, and putting them in the global scope.

The real value of the object oriented methodology is that it encourages good design. But good programming discipline goes beyond mere adaptation of an object oriented language, which is why my first C++ teacher said, “You can write bad Fortran in C++ if you really want. Just that you have to work a little harder to do it.

For all their magical powers, the object oriented programming languages all suffer from some common weaknesses. One of their major disadvantages is, de fato, one of the basic design features of object oriented programming. Objects are memory locations containing data as laid down by the programmer (and the computer). Memory locations remember the state of the objectby design. What state an object is in determines what it does when a method is invoked. So object oriented approach is inherently stateful, if we can agree on whatstatemeans in the object oriented context.

But in a user interface, where we do not have much control over the sequence in which various steps are executed, we might get erroneous results in stateful programming depending on what step gets executed at a what point in time. Such considerations are especially important when we work with parallel computers in complex situations. One desirable property in such cases is that the functions return a number solely based on their arguments. This property, termed “pureza,” is the basic design goal of most functional languages, although their architects will concede that most of them are not strictlypure.

Seções

Paradigms All the Way

Paradigms permeate almost all aspects of computing. Some of these paradigms are natural. Por exemplo, it is natural to talk about an image or a song when we actually mean a JPEG or an MP3 file. File is already an abstraction evolved in the file-folder paradigm popularized in Windows systems. The underlying objects or streams are again abstractions for patterns of ones and zeros, which represent voltage levels in transistors, or spin states on a magnetic disk. There is an endless hierarchy of paradigms. Like the proverbial turtles that confounded Bertrand Russell (or was it Samuel Johnson?), it is paradigms all the way down.

Some paradigms have faded into the background although the terminology evolved from them lingers. The original paradigm for computer networks (and of the Internet) was a mesh of interconnections residing in the sky above. This view is more or less replaced by the World Wide Web residing on the ground at our level. But we still use the original paradigm whenever we say “baixar” ou “upload.The World Wide Web, a propósito, is represented by the acronym WWW that figures in the name of all web sites. It is an acronym with the dubious distinction of being about the only one that takes us longer to say than what it stands for. Mas, getting back to our topic, paradigms are powerful and useful means to guide our interactions with unfamiliar systems and environments, especially in computers, which are strange and complicated beasts to begin with.

A basic computer processor is deceptively simple. It is a string of gates. A gate is a switch (mais ou menos) made up of a small group of transistors. A 32 bit processor has 32 switches in an array. Each switch can be either off representing a zero, or on (one). And a processor can do only one functionadd the contents of another array of gates (called a register) to itself. Em outras palavras, it can onlyaccumulate.

In writing this last sentence, I have already started a process of abstraction. I wrotecontents,” thinking of the register as a container holding numbers. It is the power of multiple levels of abstraction, each of which is simple and obvious, but building on whatever comes before it, that makes a computer enormously powerful.

We can see abstractions, followed by the modularization of the abstracted concept, in every aspect of computing, both hardware and software. Groups of transistors become arrays of gates, and then processors, registers, cache or memory. Accumulations (additions) become all arithmetic operations, string manipulations, user interfaces, image and video editing and so on.

Another feature of computing that aids in the seemingly endless march of the Moore’s Law (which states that computers will double in their power every 18 meses) is that each advance seems to fuel further advances, generating an explosive growth. The first compiler, por exemplo, was written in the primitive assembler level language. The second one was written using the first one and so on. Even in hardware development, one generation of computers become the tools in designing the next generation, stoking a seemingly inexorable cycle of development.

While this positive feedback in hardware and software is a good thing, the explosive nature of growth may take us in wrong directions, much like the strong grown in the credit market led to the banking collapses of 2008. Many computing experts now wonder whether the object oriented technology has been overplayed.

Seções

Zeros and Ones

Computers are notorious for their infuriatingly literal obedience. I am sure anyone who has ever worked with a computer has come across the lack of empathy on its partit follows our instructions to the dot, yet ends up accomplishing something altogether different from what we intend. We have all been bitten in the rear end by this literal adherence to logic at the expense of commonsense. We can attribute at least some of the blame to our lack of understanding (sim, literal and complete understanding) of the paradigms used in computing.

Rich in paradigms, the field of computing has a strong influence in the way we think and view the world. Se você não acredita em mim, just look at the way we learn things these days. Do we learn anything now, or do we merely learn how to access information through browsing and searching? Even our arithmetic abilities have eroded along with the advent of calculators and spreadsheets. I remember the legends of great minds like Enrico Fermi, who estimated the power output of the first nuclear blast by floating a few pieces of scrap paper, and like Richard Feynman, who beat an abacus expert by doing binomial expansion. I wonder if the Fermis and Feynmans of our age would be able to pull those stunts without pulling out their pocket calculators.

Procedural programming, through its unwarranted reuse of mathematical symbols and patterns, has shaped the way we interact with our computers. The paradigm that has evolved is distinctly unmathematical. Functional programming represents a counter attack, a campaign to win our minds back from the damaging influences of the mathematical monstrosities of procedural languages. The success of this battle may depend more on might and momentum rather than truth and beauty. In our neck of the woods, this statement translates to a simple question: Can we find enough developers who can do functional programming? Or is it cheaper and more efficient to stick to procedural and object oriented methodologies?

Seções

Como salvar uma string para um arquivo local em PHP?

Este post é a segunda em minha série nerd.

Ao programar minha Tema Tweaker, Me deparei com este problema. Eu tinha uma corda no meu servidor no meu programa php (a folha de estilo refinado, de fato), e eu queria dar ao usuário a opção de salvá-lo em um arquivo de seu computador. Eu já pensei que este era um problema comum, e todos os problemas comuns podem ser resolvidos por pesquisando. Mas, E eis, Eu simplesmente não conseguia encontrar uma solução satisfatória. Eu encontrei a minha própria, e pensei que eu iria partilhá-la aqui, para o benefício de todos os futuros Googlers ainda de ir e vir.

Antes de ir para a solução, vamos entender qual é o problema. O problema está na divisão do trabalho entre dois computadores — um é o servidor, onde o seu WordPress e PHP estão executando; o outro é o computador do cliente onde a visualização tem lugar. A seqüência de que estamos a falar é no servidor. Queremos salvá-lo em um arquivo no computador do cliente. A única maneira de fazer isso é que serve a cadeia como uma resposta html.

À primeira vista, este não parece ser um grande problema. Afinal, servidores enviam regularmente cordas e dados para clientes — é assim que vejo nada no navegador, incluindo o que você está lendo. Se fosse apenas um programa PHP que quer salvar a string, não seria um problema. Você poderia simplesmente despejar a string em um arquivo no servidor e servir o arquivo.

Mas o que fazer se você não quer dar a todo o mundo uma forma de dumping cordas para arquivos em seu servidor? Bem, você poderia fazer algo parecido com isto:

<?php
header('Content-Disposition: attachment; filename="style.css"');
header("Content-Transfer-Encoding: ascii");
header('Expires: 0');
header('Pragma: no-cache');
print $stylestr ;
?>

Assim, basta colocar este código em seu foo.php que calcula a string $ stylestr e está feito. Mas o nosso problema é que estamos a trabalhar no âmbito plugin para WordPress, e não pode usar o cabeçalho() chamadas. Quando você tenta fazer isso, você receberá a mensagem de erro dizendo que o cabeçalho já é feito cara. Para este problema, Eu encontrei a solução engenhosa em um dos plugins que eu uso. Esqueceu que um, mas eu acho que é uma técnica comum. A solução é definir um iFrame vazio e definir sua origem para que a função PHP escreveria. Desde iFrame espera uma fonte HTML completo, você está autorizado (de fato, obrigado) para dar o cabeçalho() directivas. O trecho de código é algo como:

<iframe id="saveCSS" src="about:blank" style="visibility:hidden;border:none;height:1em;width:1px;"></iframe>
<script type="text/javascript">
var fram = document.getElementById("saveCSS");
<?php echo 'fram.src = "' . $styleurl .'"' ;
?>

Agora a questão é, o que deve ser a fonte? Em outras palavras, o que é de R $ styleUrl? Claramente, não vai ser um arquivo estático em seu servidor. E o objetivo deste post é mostrar que ele não tem que ser um arquivo no servidor em tudo. É uma resposta em duas partes. Você tem que lembrar que você está trabalhando no âmbito WordPress, e você não pode fazer arquivos php autônomos. A única coisa que você pode fazer é adicionar argumentos para os arquivos php existentes, ou os plugins que você criou. Então você primeiro fazer um botão de envio da seguinte forma:

<form method="post" action="<?php echo $_SERVER["REQUEST_URI"]?>">
<div class="submit">
<input type="submit" name="saveCSS" title="Download the tweaked stylesheet to your computer" value="Download Stylesheet" />
</div>

Note-se que o atributo nome do botão é “saveCSS.” Agora, na parte do código que trata submete, você faz algo como:

<?php
if (isset($_POST['saveCSS']))
$styleurl = get_option('siteurl') . '/' . "/wp-admin/themes.php?page=theme-tweaker.php&save" ;

?>

Este é o $ styleUrl que você daria como a fonte de sua iFrame, para a frente. Note que é o mesmo que o URL da página pluging, exceto que você conseguiu adicionar “?salvar” no final da mesma. O próximo truque é capturar esse argumento e segurá-lo. Para isso, você usa a função API WordPress, add_action como:

<?php
if (isset($_GET['save'] ))
add_action('init', array(&$thmTwk, 'saveCSS'));
else
remove_action('init', array(&$thmTwk, 'saveCSS'));
?>

Isso adiciona um saveCSS função para a parte de inicialização do seu plugin. Agora você tem que definir esta função:

<?php
function saveCSS() {
header('Content-Disposition: attachment; filename="style.css"');
header("Content-Transfer-Encoding: ascii");
header('Expires: 0');
header('Pragma: no-cache');
$stylestr = "Whatever string you want to save";
ob_start() ;
print $stylestr ;
ob_end_flush() ;
die() ;
}
?>

Agora estamos quase em casa livre. A única coisa a entender é que você do precisa da matriz(). Se a sua função não morre, ele vai vomitar o resto do WordPress material gerado em seu arquivo salvar, acrescentá-lo à sua string $ stylestr.

Pode parecer complicado. Bem, Eu acho que é um pouco complicado, mas uma vez que você implementá-lo e fazê-lo funcionar, você pode (e fazer) esquecê-lo. Finalmente, Faço. É por isso que eu postei isso aqui, para que a próxima vez que eu preciso para fazê-lo, Eu posso procurá-lo.

Geeks

I have been doing a bit of geeky stuff lately — writing Plugins do WordPress. Ok, it is because I’m suffering from a terrible writer’s block.

Entende, I’m supposed to be working on my next book. I foolishly promised a couple of chapters of Os princípios do desenvolvimento quantitativo to my commissioning editor at John Wiley & Sons within a month; now I find myself writing everything other than those darned chapters! Including plugins. Vindo para pensar sobre isso, writing those chapters wouldn’t be any less geeky, seria ele?

That made me wonder… We all started off as geeks, didn’t we? No use denying it. Remember how our teachers loved us, and the sexy cheerleaders, bem, didn’t? Later in life, due to exigencies of circumstances, we may have tried to lose our techie halo and simulate a managerial posture. Mas, in our moments of panic, we go back to our geek roots. Finalmente, Faço.

You think you don’t? Bem, check out these geek jokes. If you find them funny, chances are your roots are not too different from mine.

Heisenberg was driving down the highway when he was pulled over for speeding. The officer says, “Do you know how fast you were going?” Heisenberg says, “Não, but I do know where I am!”

Two Hydrogen atoms walk into a bar. One says, “I’ve lost my electron!” The other says, “Are you sure?” The first replies, “Sim, I’m positive…”

Geek Pickup Lines:

  • Tell me of this thing you humans call [dramatic pause] love.
  • If you turn me down now, I will become more drunk than you can possibly imagine.
  • They don’t call me Bones because I’m a doctor.
  • Your name is Leslie? Olhe, I can spell your name on my calculator!
  • What’s a nice girl like you doing in a wretched hive of scum and villainy like this?
  • You must be Windows 95 because you got me so unstable.
  • My ‘up-time’ is better than BSD.
  • I can tell by your emoticons that you’re looking for some company.
  • Is that an iPod mini in your pocket or are you just happy to see me.
  • Want to see my Red Hat?
  • If you won’t let me buy you a drink, at least let me fix your laptop.
  • You had me at “Hello World.”
  • Mind if I run a sniffer to see if your ports are open?
  • You make me want to upgrade my Tivo.
  • By looking at you I can tell you’re 36-25-36, which by the way are all perfect squares.
  • Jedi Mind Trick: “This is the geek you’re looking for.” [Waves hand]
  • You can put a Trojan on my Hard Drive anytime.
  • Have you ever Googled yourself?
  • How about we do a little peer-to-peer saliva swapping?
  • With my IQ and your body we could begin a race of genetic superchildren to conquer the earth.
  • What’s a girl like you doing in a place like this when there’s a Farscape marathon on right now on the Sci Fi channel.
  • I’m attracted to you so strongly, scientists will have to develop a fifth fundamental force.

What Makes 100%?

What does it mean to give MORE than 100%? Ever wonder about those people who say they are giving more than 100%? We have all been to those meetings where someone wants you to give over 100%. How about achieving 103%? What makes up 100% in life? Here’s a little mathematical formula that might help you answer these questions:

Se:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z are represented as:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

then H-A-R-D-W-O-R-K = 8+1+18+4+23+15+18+11 = 98%

and K-N-O-W-L-E-D-G-E = 11+14+15+23+12+5+4+7+5 = 96%

but A-T-T-I-T-U-D-E = 1+20+20+9+20+21+4+5 = 100%

and B-U-L-L-S-H-I-T = 2+21+12+12+19+8+9+20 = 103%

but look how far ass kissing will take you.

A-S-S-K-I-S-S-I-N-G = 1+19+19+11+9+19+19+9+14+7 = 118%

Assim, one can conclude with mathematical certainty that While Hard work and Knowledge will get you close, and Attitude will get you there, it’s the Bullshit and Ass kissing that will put you over the top.

Meeting Bingo Game

This one is a hilarious piece I found on the Web. If you really like it, você tem que saber — am I still doing too much techie stuff and too little management?

Ever been in a mind-numbing meeting with some MBA-type spewing forth a sequence of buzzwords he read on the back of a Business Careers for Dummies book? Print this out and when you get 7 horizontal, vertical or diagonal, shout BINGO!

& Nbsp;

Synergy Offline Strategic Fit Interface Gap Analysis Best Practice The Bottom Line
Core Business Going Forward Touch Base Revisit Game Plan Learning Curve Revert Urgently
Out of the Loop Go the Extra Mile Benchmark The Big Picture Value Added Movers and Shakers Ballpark
Proactive, not Reactive Win-Win Situation Think Outside the Box Fast Track Results Driven Empowerment Define and Sign Off
Partner Led Business Case Change Management At the End of the Day Local Feedback Ticks in the Boxes Mindset
Knock-On Effect Put this to Bed Client-Focused Quality Driven Move the Goal Posts Process Improvement Bandwidth
Facilitate Knowledge Base Downsize Rocket Science Skill Set Customer Focused Ramp Up

(This joke was found at the Email Flotsam page at Mike’s World)