标记档案: 怪胎

休眠或睡眠后黑屏?

好, 简单的答案, 增加虚拟内存超过物理内存的大小.

现在长版. 最近, 我有这个问题,我的电脑,它不会从休眠或睡眠模式中唤醒正常. PC本身将是对与翻腾, 但屏幕会切换到省电模式, 留空白. 唯一要做的事情,在这一点上是重新启动计算机.

就像网友好,我是, í拖网互联网解决方案. 但没有发现任何. 有些人建议升级BIOS, 更换显卡等. 然后,我看到了在Linux这个小组所提, 话说,交换文件的大小应大于物理内存, 并决定尝试在我的Windows XP机器. 它解决了这个问题!

所以起床后解决这个问题黑屏的是虚拟内存的大小设置为你的系统的东西比内存大. 如果您需要了解更多信息, 这里是如何, 在步骤一步的形式. 这些说明适用于Windows XP机器.

  1. 用鼠标右键单击 “我的电脑” 和打 “属性。”
  2. 看看RAM大小的, 并点击 “高级” 标签.
  3. 点击 “设定” 下按钮 “性能” 组框.
  4. 在 “性能选项” 窗口,来了, 选择 “高级” 标签.
  5. 在 “虚拟内存” 底部附近的组框, 点击 “更改” 按钮.
  6. 在 “虚拟内存” 窗口弹出, 设置 “自定义尺寸” 比你的内存大小的东西更多 (您在步骤见 2). 您可以在您有任何硬盘分区设置, 但如果你正在经历这一切说明, 没准你只有 “ç:”. 在我的情况, 我选择把它放在 “M:”.
如果您发现了这篇文章有用, 你可能还会喜欢:

  1. 如何找回在iPhoto中失踪的事件和照片?
  2. 如何避免重复的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, overloading — all of them normal (or near-normal) everyday words, but signifying notions and concepts quite far from their literal meaning. 然而,, 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? 也许. 毕竟, 该 “object” in object oriented programming is already an abstract paradigm, having nothing to do with “That Obscure Object of Desire,” 例如.

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 (说, 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, 事实上, 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 object — by 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 what “state” means 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 “纯度,” is the basic design goal of most functional languages, although their architects will concede that most of them are not strictly “pure.”

部分

Paradigms All the Way

Paradigms permeate almost all aspects of computing. Some of these paradigms are natural. 例如, 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 “下载” 或 “upload.” The World Wide Web, 顺便说说, 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. 但, 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 (或多或少) made up of a small group of transistors. 一 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 function — add the contents of another array of gates (called a register) to itself. 换句话说, it can only “accumulate.”

In writing this last sentence, I have already started a process of abstraction. I wrote “contents,” 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 个月) is that each advance seems to fuel further advances, generating an explosive growth. The first compiler, 例如, 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 part — it 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 (yes, 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. 如果你不相信我, 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?

部分

如何将字符串保存到一个PHP本地文件?

这篇文章是第二个在我的怪胎系列.

虽然我的节目主题调教, 我碰到这个问题,. 我在我的PHP程序有我的服务器上的字符串 (在调整了样式表, 事实上), 我想给用户保存到一个文件中他的计算机的选项. 我一直认为这是一个常见的​​问题, 和所有常见的问题都可以通过谷歌搜索来解决. 但, 你瞧, 我只是找不到一个满意的解决方案. 我发现我自己, 并以为我会在这里分享, 所有未来谷歌的利益还没有来去.

在我们进入解决方案, 让我们明白问题是什么. 问题是在劳动两台计算机之间的分工 — 一个是服务器, 在那里你的WordPress和PHP运行; 另一种是在客户的计算机,其中所述的观看正在发生. 我们正在谈论的字符串是在服务器上. 我们希望将其保存在一个文件中的客户端的计算机上. 做到这一点的唯一方法是通过服务的字符串作为HTML回复.

乍一看, 这看起来并不像一个大问题. 毕竟, 服务器定期发送的字符串和数据客户 — 这就是我们看到的在任何浏览器, 包括你正在阅读. 如果这只是任何PHP程序,要保存字符串, 这将不会是一个问题. 你可以只转储字符串到服务器上的文件和服务文件.

但是,你会怎么做,如果你不想让整个世界倾倒字符串的文件服务器上的方式? 好, 你可以做这样的事情:

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

所以, 只是把这个代码在您foo.php,计算字符串$ stylestr和你做. 但我们的问题是,我们正在努力在WordPress的插件框架, 而不能使用的标头() 电话. 当您尝试这样做,, 你会得到错误信息说,头已经完成花花公子. 针对此问题, 我找到了巧妙的解决方案,我用的插件之一. 忘记了哪一个, 但我想这是一种常见的技术. 该解决方案是定义一个空的iFrame并设置其源PHP函数会写什么. 由于预计的iFrame一个完整的HTML源代码, 你被允许 (事实上, 有责任) 以得到标题() 指令. 该代码片段看起来像:

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

现在的问题是, 又该源是? 换句话说, 什么是$ styleurl? 明确地, 它不会是你的服务器上的静态文件. 与这个主题的目的是要表明,它不必须是在服务器上的文件中,在所有. 它是由两部分组成的答案. 你要记住,你是WordPress的框架内工作, 你不能让独立的PHP文件. 你能做的唯一一件事就是参数添加到现有的PHP文件, 或者您所创建的插件. 所以,你首先做一个提交按钮如下:

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

请注意,按钮的名称属性 “saveCSS。” 现在, 在代码的部分,处理的顺服, 你做这样的事情:

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

?>

这是$ styleurl,你会给你的iframe的源, 前锋. 请注意,这是一样的你pluging页面网址, 除非你设法添加 “?保存” 在它的结束. 接下来的关键是要抓住这样的说法和处理它. 对于, 使用WordPress的API函数, add_action作为:

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

这增加了一个功能,saveCSS到你的插件的初始化部分. 现在,你必须定义这个功能:

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

现在,我们几乎无家. 要了解的唯一的事情就是你 需要模具(). 如果你的函数不会死, 它会喷涌出来的WordPress的东西产生,其余为你保存文件, 其追加到您的字符串$ stylestr.

它可能看起来复杂. 好, 我想这是一个有点复杂, 但一旦你实现它,并让它运行, 您可以 (做) 忘掉它. 至少, 我做的. 这就是为什么我张贴在这里, 因此,在未来的时间,我需要做的, 我可以看看它.

Geeks

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

你看, I’m supposed to be working on my next book. I foolishly promised a couple of chapters of 定量发展的原则 to my commissioning editor at John Wiley & Sons within a month; now I find myself writing everything other than those darned chapters! Including plugins. 未来想起来, writing those chapters wouldn’t be any less geeky, 它会?

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, 好, didn’t? Later in life, due to exigencies of circumstances, we may have tried to lose our techie halo and simulate a managerial posture. 但, in our moments of panic, we go back to our geek roots. 至少, 我做的.

You think you don’t? 好, 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, “别, 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, “是的, 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? 看, 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:

如果:

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%

所以, 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.

会议宾果游戏,,en,在“悉达多的想法由赫曼·黑塞,,en,这篇文章包含了许多梵文词,,en,这可就麻烦了我的一些非印度读者,,en,如果你觉得你需要一个词汇表,,en,请在这里发表评论,,en,我将发布一个,,en,研讨会,,en,书评嘉年华日版,,en,巴里·斯特普,,en,我已经重新读这本书很多次,每次都让我带走不同的东西,,en,谢谢你的职位,,en

This one is a hilarious piece I found on the Web. If you really like it, you have to wonder — 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 电子邮件漂流 page at Mike’s World)