Tag Archives: connaisseur

Blank Screen après Hibernate ou sommeil?

Bien, la réponse courte, augmenter votre mémoire virtuelle pour plus de la taille de votre mémoire physique.

Version longue maintenant. Récemment, Je ai eu ce problème avec mon PC qu'il ne serait pas réveiller de mode hibernation ou dormir correctement. Le PC lui-même serait le barattage et, mais l'écran serait passer à mode économie d'énergie, rester vierge. La seule chose à faire à ce point serait de redémarrer l'ordinateur.

Comme le bon internaute que je suis, Je chalutage l'Internet pour une solution. Mais n'a pas trouvé de. Certains ont suggéré la mise à niveau du BIOS, le remplacement de la carte graphique, etc.. Puis je ai vu ce mentionné dans un groupe Linux, dire que la taille du fichier d'échange devrait être plus que la mémoire physique, et a décidé de l'essayer sur ma machine Windows XP. Et il a résolu le problème!

Donc, la solution à ce problème d'écran vide après le réveil est de définir la taille de la mémoire virtuelle à quelque chose de plus grand que la mémoire de votre système. Si vous avez besoin de plus amples informations, voici comment, sous forme, étape par étape. Ces instructions se appliquent à une machine Windows XP.

  1. Faites un clic droit sur “Poste de travail” et appuyez “Propriétés.”
  2. Jetez un oeil à la taille de la RAM, et cliquez sur le “Avancé” languette.
  3. Cliquez sur le “Réglage” bouton sous le “Performance” zone de groupe.
  4. Dans l' “Options de performances” fenêtre qui apparaît, sélectionnez le “Avancé” languette.
  5. Dans l' “Mémoire virtuelle” zone de groupe près du fond, cliquez sur le “Changement” bouton.
  6. Dans l' “Mémoire virtuelle” fenêtre qui se ouvre, régler la “Taille personnalisée” à quelque chose de plus que votre taille de la RAM (que vous avez vu dans l'étape 2). Vous pouvez le mettre sur ne importe quel disque partition de disque que vous avez, mais si vous allez à travers toutes ces instructions, les chances sont que vous avez seulement “C:”. Dans mon cas,, Je ai choisi de mettre sur “M:”.

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. Encore, 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? Peut-être. Après tout, la “objectin object oriented programming is already an abstract paradigm, having nothing to do withThat Obscure Object of Desire,” par exemple.

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 (dire, 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, en fait, 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 “pureté,” is the basic design goal of most functional languages, although their architects will concede that most of them are not strictlypure.


Paradigms All the Way

Paradigms permeate almost all aspects of computing. Some of these paradigms are natural. Par exemple, 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 “télécharger” ou “upload.The World Wide Web, au fait, 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. Mais, 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 (plus ou moins) 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. En d'autres termes, 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 mois) is that each advance seems to fuel further advances, generating an explosive growth. The first compiler, par exemple, 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.


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 (oui, 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. If you don’t believe me, 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?


Comment enregistrer une chaîne dans un fichier local en PHP?

Cet article est le deuxième de ma série de geek.

Pendant la programmation de mon thème Tweaker, Je suis tombé sur ce problème. J'ai eu une chaîne sur mon serveur dans mon programme php (la feuille de style tordu, en fait), et je voulais donner à l'utilisateur la possibilité d'enregistrer dans un fichier de son ordinateur. J'aurais pensé que c'était un problème commun, et tous les problèmes peuvent être résolus par googler. Mais, lo et voici, Je n'arrivais pas à trouver une solution satisfaisante. J'ai trouvé ma propre, et pensais que je voudrais partager ici, pour le bénéfice de tous les futurs Googlers encore d'aller et venir.

Avant d'entrer dans la solution, essayons de comprendre quel est le problème. Le problème est dans la division du travail entre deux ordinateurs — l'une est le serveur, où votre WordPress et PHP sont en cours d'exécution; l'autre est l'ordinateur du client lorsque l'observation se déroule. La chaîne dont nous parlons est sur le serveur. Nous voulons l'enregistrer dans un fichier sur l'ordinateur du client. La seule façon de le faire est de servir la chaîne comme une réponse html.

À première vue, cela ne ressemble pas à un problème majeur. Après tout, serveurs envoient régulièrement des cordes et des données aux clients — c'est ainsi que nous voyons quelque chose sur le navigateur, y compris ce que vous lisez. Si c'était juste un programme PHP qui veut sauver la chaîne, il ne serait pas un problème. Vous pouvez tout simplement jeter la chaîne dans un fichier sur le serveur et servir le fichier.

Mais que faites-vous si vous ne voulez pas donner au monde entier un moyen de dumping chaînes de fichiers sur votre serveur? Bien, vous pourriez faire quelque chose comme ça:

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

Si, il suffit de mettre ce code dans votre foo.php qui calcule la stylestr chaîne $ et vous avez terminé. Mais notre problème est que nous travaillons dans le cadre de plugin pour WordPress, et ne peuvent pas utiliser l'en-tête() appels. Lorsque vous essayez de le faire, vous obtiendrez le message d'erreur disant que la tête est déjà fait mec. Pour ce problème, J'ai trouvé la solution ingénieuse dans l'un des plugins que j'utilise. Mot de laquelle on, mais je suppose que c'est une technique courante. La solution consiste à définir un iFrame vide et mis sa source à ce que la fonction PHP écrirait. Depuis iFrame s'attend à une source HTML complet, vous êtes autorisé (en fait, obligé) à envoyer l'en-tête() directives. L'extrait de code ressemble:

<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 .'"' ;

Maintenant, la question est, ce qui devrait être la source? En d'autres termes, ce qui est $ styleUrl? Clairement, il ne va pas être un fichier statique sur votre serveur. Et le but de ce post est de montrer qu'il n'a pas besoin d'être un fichier sur le serveur du tout. Il est une réponse en deux parties. Vous devez vous rappeler que vous travaillez dans le cadre WordPress, et vous ne pouvez pas faire des fichiers php autonomes. La seule chose que vous pouvez faire est d'ajouter des arguments pour les fichiers php existants, ou les plugins que vous avez créé. Donc, vous devez d'abord faire un bouton de soumission comme suit:

<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" />

Notez que l'attribut name de la touche est “saveCSS.” Maintenant, dans la partie du code qui gère soumet, vous faites quelque chose comme:

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


C'est le $ styleUrl que vous donneriez comme la source de votre iFrame, avant. Notez qu'il est le même que votre pluging URL de la page, sauf que vous avez réussi à ajouter “?sauver” à la fin de celui-ci. Le prochain tour est de capturer cet argument et gérer. Pour que, vous utilisez la fonction de l'API WordPress, add_action comme:

if (isset($_GET['save'] ))
add_action('init', array(&$thmTwk, 'saveCSS'));
remove_action('init', array(&$thmTwk, 'saveCSS'));

Cela ajoute une fonction saveCSS à la partie d'initialisation de votre plugin. Maintenant, vous devez définir cette fonction:

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() ;

Maintenant, nous sommes presque à la maison gratuitement. La seule chose à comprendre est que vous la besoin la filière(). Si votre fonction ne meurt pas, il vomira le reste du WordPress trucs généré dans votre fichier de sauvegarde, ajoutant à votre chaîne $ stylestr.

Il peut sembler compliqué. Bien, Je suppose que cela est un peu compliqué, mais une fois que vous le mettre en œuvre et faire fonctionner, vous pouvez (et faire) oublier. Au moins, Je fais. C'est pourquoi je l'ai posté ici, de sorte que la prochaine fois que j'ai besoin de le faire, Je peux regarder vers le haut.


I have been doing a bit of geeky stuff latelywriting Plugins WordPress. Bien, it is because I’m suffering from a terrible writer’s block.

Vous voyez, I’m supposed to be working on my next book. I foolishly promised a couple of chapters of Les principes du développement quantitatif to my commissioning editor at John Wiley & Sons within a month; now I find myself writing everything other than those darned chapters! Including plugins. Venir à penser, writing those chapters wouldn’t be any less geeky, ne serait-il?

That made me wonderWe all started off as geeks, didn’t we? No use denying it. Remember how our teachers loved us, and the sexy cheerleaders, bien, didn’t? Later in life, due to exigencies of circumstances, we may have tried to lose our techie halo and simulate a managerial posture. Mais, in our moments of panic, we go back to our geek roots. Au moins, Je fais.

You think you don’t? Bien, 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, “Needs a context, 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, “Oui, 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? Regardez, 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-timeis 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 atHello 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:


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%

Si, 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.

Réunion bingo

This one is a hilarious piece I found on the Web. If you really like it, vous devez vous demander — 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)