Search Results

Search found 27 results on 2 pages for 'zneak'.

Page 1/2 | 1 2  | Next Page >

  • Why do you hate Java? Is it the language or the framework? [closed]

    - by zneak
    According to you all, Java is the third most-hated language here. The two other most hated languages are PHP and VBScript. (It's quite funny how they stand together on the podium.) I'd like to make it known that the question mostly addresses people who don't like Java. I assume here a number of subjective opinions as facts because they're usually considered true among people who don't like Java, and I don't want to be convinced otherwise here. If you're a Java enthusiast, you might find this question frustrating. It's never been made clear if people hate Java itself, or if they hate it because of the framework, or if it's a mixture of the two. On a side you have the language, where you have: the "everything should be an object" philosophy, even in instances where it should obviously be something else (event handlers I'm pointing you); checked exceptions; the idea that all logic should be presented as methods and properties is a big no-no; the fact that "closures" created by anonymous types only include final variables and arguments, but will allow write access to any member of the parent class; a few more. On the other side, you have the JDK, with... its load of inconsistencies and overengineering; monolithic class hierarchies; meaningless base exceptions like IOException (though other frameworks have similar exception hierarchies); sluggish responsiveness even with Swing; a few more. My question is, do you think that, if either one (Java or the JDK) was taken alone, and the other was dropped in favor of something else, the new combination would be better? For instance, if you could use the C# syntax with the JDK (adapting get*/set* methods into properties, and interfaces with only one method into delegates), or the Java syntax with the .NET Framework (doing the inverse transformations), would things get better in your opinion?

    Read the article

  • Is it relevant to warn about truncating real constants to 32 bits?

    - by zneak
    I'm toying around with LLVM and looking at what it would take to make yet another strongly-typed language, and now that I'm around the syntax, I've noticed that it seems to be a pet peeve of strongly typed language to warn people that their constants won't fit inside a float: // both in Java and C# float foo = 3.2; // error: implicitly truncating a double into a float // or something along these lines Why doesn't this work in Java and C#? I know it's easy to add the f after the 3.2, but is it really doing anything useful? Must I really be that aware that I'm using single-precision reals instead of double-precision reals? Maybe I'm just missing something (which, basically, is why I'm asking). Note that float foo = [const] is not the same thing as float foo = [double variable], where requiring the cast seems normal to me.

    Read the article

  • Google Chrome install fails with error 0x80004002

    - by zneak
    I'm using Windows 7 64 bits and I'm trying to install Google Chrome. However, every time I do, I get this error message: Google Update installation failed with error 0x80004002. There is a Show me help for this issue link, but it does nothing. I tried the standalone installer to no avail. I also tried to delete the HKEY_CURRENT_USER\Software\Google registry key, as suggested by other answers, with no more positive effects.

    Read the article

  • FreeBSD 8.2 + Apache 2.2 + mod_auth_pam2: unable to authenticate

    - by zneak
    I've installed Apache 2.2 and mod_auth_pam2 from ports, but I can't get local UNIX authentication to work. When I access the protected part of my local website, I do get the authentication request, and with pam_permit.so, it works. However, when I change pam_permit.so to the real thing, pam_unix.so, I get this message in httpd-error.log: [error] PAM: user 'foo' - not authenticated: authentication error This is the relevant part of my Apache config, though I don't think it's the problem as it works with pam_permit.so: <Location /foo> AuthBasicAuthoritative Off AuthPAM_Enabled on AuthPAM_FallThrough off AuthType Basic AuthName "Secret place" Require valid-user </Location> This is my /etc/pam.d/httpd, though I don't think it's the problem either, since it works with pam_permit.so: auth required pam_unix.so account required pam_unix.so So what am I missing? What does it take to have pam_unix.so work for httpd under FreeBSD?

    Read the article

  • Put a task to the background with bash

    - by zneak
    Hey guy, I know that you can start a background job with Bash doing foo &. However, the best way I know to put a foreground job to the background is to do Ctrl+z to pause it then bg 1 to resume it in the background. Is there a faster way? Some Ctrl+Something key combination I'm not aware of? Thanks!

    Read the article

  • What are the benefits of using conforming certificates?

    - by zneak
    Recently, my web host started sending my mail client a self-signed root certificate with no field filled (everything says "Unknown") when connecting via SSL. I'm pretty sure this is not a good thing, but since it works, the tech support guy says it's fine. I'm not a certificate guru, so I'm turning to you people. What purpose do certificates serve? Is it really okay that the certificate has every field set to "Unknown"? I don't check certificates often, but I don't recall ever being sent a root one; what's the difference between a root certificate and, err, the other kind of certificate?

    Read the article

  • Changing the partition icon for Boot Camp

    - by zneak
    Hey guys, I've installed Windows 7 for a dual-boot setup on my new Core i7 MacBook Pro. Now, just for the looks, I'd like to change the volume icon. The partition is in NTFS format. I remember that in the past (with Leopard), you just had to add a .VolumeIcon.icns file at the root of a volume to set its icon. It seems this trick wore off with Snow Leopard. It apparently still works with CDs and DVDs, but hard drives keep that old, boring drive icon, no matter how lovely the .VolumeIcon.icns file I've put at the root. How can I change that?

    Read the article

  • How to use launchd to ensure an application is running?

    - by zneak
    Hello guys, I use Quicksilver, which is a nifty program that really speeds up my work. I've set it to launch when I log in. However, since Snow Leopard, it's become a bit less stable, and once in a while, it crashes. And obviously, it won't restart by itself. I'm pretty sure I can use launchd to ensure it's always running when I'm logged in. Is there a good guide/example of how to make sure a process restarts when it's killed/terminated/crashed with it?

    Read the article

  • Is there a clean way to tell Windows to release a volume?

    - by zneak
    Hey guys, I'm trying, under Windows 7, to run a virtual machine with VMWare Player from an OS installed on a physical partition. However, when I boot the virtual machine, VMWare Player says that it couldn't access the physical drive and has to abort there. This seems to be a generally acknowledged problem in the VMWare community, as Windows Vista introduced a compelling new security feature that makes it impossible to write to a raw drive without obtaining exclusive access to it. I have googled the issue and found a few workarounds. However, the clean ones seem to only work on whole physical disks, and not on partitions. So I would be left with the dirty solution. In short, it meddles with the MBR to erase any trace of the partitions to use, makes Windows forget about them, then restores the MBR so we can launch the VM. Is there a way to let VMWare acquire exclusive access to the partition without requiring me to nuke it away?

    Read the article

  • How do I configure DFS replication using the command line?

    - by zneak
    Hello everyone, I'm in the process of making a script to automate DFS creation and replication for an exam I have next week. So, assuming I have a namespace: dfsutil root adddom \\Foo\bar 'My namespace' And I have a link: dfsutil link add \\Foo\Bar\CoolStuff \\Server2\CoolStuff 'Neat stuff' How can I use the command line to replicate \\Server2\CoolStuff over, say, \\Server3\CoolStuff? When I use dfscmd: dfscmd /add \\Foo\Bar\CoolStuff \\Server3\CoolStuff It says it ended correctly, but opening up the MMC shows that there are no replication groups for CoolStuff. Thanks!

    Read the article

  • Is there a clean way to obtain exclusive access to a physical partition under Windows?

    - by zneak
    Hey guys, I'm trying, under Windows 7, to run a virtual machine with VMWare Player from an OS installed on a physical partition. However, when I boot the virtual machine, VMWare Player says that it couldn't access the physical drive for writing. This seems to be a generally acknowledged problem in the VMWare community, as Windows Vista introduced a compelling new security feature that makes it impossible to write to a raw drive without obtaining exclusive access to it first. I have googled the issue and found a few workarounds. However, the clean ones seem to only work on whole physical disks, and not on partitions. So I would be left with the dirty solution. In short, it meddles with the MBR to erase any trace of the partitions to use, makes Windows forget about them, then restores the MBR so we can launch the VM. I'm not sure I want to do that. Is there a way to let VMWare acquire exclusive access to the partition without requiring me to nuke it away? What I'd be looking for, I suppose, is a way to put just partitions offline instead of whole physical drives.

    Read the article

  • Can XHTML nest more XHTML?

    - by zneak
    It's legal to nest SVG documents inside XHTML documents; but is it legal to nest XHTML documents inside other XHTML documents in the same fashion? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Sup</title> </head> <body> <h1>Hello World!</h1> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Nested document</title> </head> <body> <p>This is a sample</p> </body> </html> </body> </html>

    Read the article

  • TinyMCE editor dislikes being moved around

    - by zneak
    Hello guys, On a page I have, I need to move TinyMCE editors in the DOM tree once in a while. However, for some reason, the editor doesn't like it: it clears itself completely and becomes unusable. As far as I can see, this behavior is consistent between Safari 4 and Firefox 3.6, but not Internet Explorer 7/8. Here's an example. It truly is pissing me off to do something that works in Internet Explorer but not with more appreciable browsers. Is there something I missed in the docs about never trying to move an editor in the DOM tree? Is there some kind of workaround?

    Read the article

  • Enumerate registered namespaces of a PHP DOMDocument object

    - by zneak
    Hello world, For one of my projects, I'm using the DOMDocument class to load and manipulate XML documents. I'd need to retrieve every namespace used in the document; however, I can't find how I'd do that. The DOMDocument class has methods to get the namespace prefix of an URI or the URI of a namespace prefix, but I've seen nothing to actually enumerate registered namespaces. The SimpleXML library has a getNamespaces() method for that. Is there an equivalent for DOMDocument?

    Read the article

  • Exclude first child with XSL-T

    - by zneak
    Hello, What I'm trying to do is fairly simple, but I can't find the way to. I just want to iterate over the children of a node excluding the first child. For instance, in this XML snippet, I would want all the <bar> elements, except the first one: <foo> <Bar>Example</Bar> <Bar>This is an example</Bar> <Bar>Another example</Bar> <Bar>Bar</Bar> </foo> There is no common attribute by which I can filter (like an id tag or something similar). Any suggestions?

    Read the article

  • How to open a document using an application launched via NSTask?

    - by zneak
    Hello world, I've grown tired of the built-in open Mac OS X command, mostly because it runs programs with your actual user ID instead of the effective user ID; this results in the fact sudo open Foo opens Foo with its associated application with your account instead of the root account, and it annoys me. So I decided to make some kind of replacement. So far I've been successful: I can open any program under the open -a or open -b fashion, and support optionally waiting. I'm using NSTask for that purpose. However, I'd like to be able to open documents too. As far as I can see, you need to use NSWorkspace for that, but using NSWorkspace to launch programs results in them being launched with your account's credentials instead of your command line program's credentials. Which is precisely what the default open tool does, and precisely what I don't want. So, how can I have a program request that another program opens a document without using NSWorkspace? From the NSTask object, I can have the process ID, but that's about it.

    Read the article

  • Why is it a bad practice to call System.gc?

    - by zneak
    After answering to a question about how to force-free objects in Java (the guy was clearing a 1.5GB HashMap) with System.gc(), I've been told it's a bad practice to call System.gc() manually, but the comments seemed mitigated about it. So much that no one dared to upvote it, nor downvote it. I've been told there it's a bad practice, but then I've also been told garbage collector runs don't systematically stop the world anymore, and that it could also be only seen as a hint, so I'm kind of at loss. I do understand that usually the JVM knows better than you when it needs to reclaim memory. I also understand that worrying about a few kilobytes of data is silly. And I also understand that even megabytes of data isn't what it was a few years back. But still, 1.5 gigabyte? And you know there's like 1.5 GB of data hanging around in memory; it's not like it's a shot in the dark. Is System.gc() systematically bad, or is there some point at which it becomes okay? So the question is actually double: Why is it or not a bad practice to call System.gc()? Is it really a hint under certain implementations, or is it always a full collection cycle? Are there really garbage collector implementations that can do their work without stopping the world? Please shed some light over the various assertions people have made. Where's the threshold? Is it never a good idea to call System.gc(), or are there times when it's acceptable? If any, what are those times?

    Read the article

  • i386 assembly question: why do I need to meddle with the stack pointer?

    - by zneak
    Hello everyone, I decided it would be fun to learn x86 assembly during the summer break. So I started with a very simple hello world program, borrowing on free examples gcc -S could give me. I ended up with this: HELLO: .ascii "Hello, world!\12\0" .text .globl _main _main: pushl %ebp # 1. puts the base stack address on the stack movl %esp, %ebp # 2. puts the base stack address in the stack address register subl $20, %esp # 3. ??? pushl $HELLO # 4. push HELLO's address on the stack call _puts # 5. call puts xorl %eax, %eax # 6. zero %eax, probably not necessary since we didn't do anything with it leave # 7. clean up ret # 8. return # PROFIT! It compiles and even works! And I think I understand most of it. Though, magic happens at step 3. Would I remove this line, my program would die between the call to puts and the xor from a misaligned stack error. And would I change $20 to another value, it'd crash too. So I came to the conclusion that this value is very important. Problem is, I don't know what it does and why it's needed. Can anyone explain me? (I'm on Mac OS, would it ever matter.)

    Read the article

  • Call a constructor from variable arguments with PHP

    - by zneak
    Hello guys, I have a function that takes variadic arguments, that I obtain from func_get_args(). This function needs to call a constructor with those arguments. However, I don't know how to do it. With call_user_func, you can call functions with an array of arguments, but how would you call a constructor from it? I can't just pass the array of arguments to it; it must believe I've called it "normally". Thank you!

    Read the article

  • x86_64 assembler: only one call per subroutine?

    - by zneak
    Hello everyone, I decided yesterday to start doing assembler. Most of it is okay (well, as okay as assembler can be), but I'm getting some problems with gas. It seems that I can call functions only once. After that, any subsequent call opcode with the same function name will fail. I must be doing something terribly wrong, though I can't see what. Take this small C function for instance: void path_free(path_t path) { if (path == NULL) return; free(((point_list_t*)path)->points); free(path); } I "translated" it to assembler like that: .globl _path_free _path_free: push rbp mov rbp, rsp cmp rdi, 0 jz byebye push rdi mov rdi, qword ptr [rdi] call _free pop rdi sub rsp, 8 call _free byebye: leave ret This triggers the following error for the second call _free: suffix or operands invalid for ``call''. And if I change it to something else, like free2, everything works (until link time, that is). Assembler code gcc -S gave me looks very similar to what I've done (except it's in AT&T syntax), so I'm kind of lost. I'm doing this on Mac OS X under the x86_64 architecture.

    Read the article

  • How to balance number of ratings versus the ratings themselves?

    - by zneak
    Hello guys, For a school project, we'll have to implement a ranking system. However, we figured that a dumb rank average would suck: something that one user ranked 5 stars would have a better average that something 188 users ranked 4 stars, and that's just stupid. So I'm wondering if any of you have an example algorithm of "smart" ranking. It only needs to take in account the rankings given and the number of rankings. Thanks!

    Read the article

  • COUNT(*) vs. COUNT(1) vs. COUNT(pk): which is better?

    - by zneak
    Hello guys, I often find these three variants: SELECT COUNT(*) FROM Foo; SELECT COUNT(1) FROM Foo; SELECT COUNT(PrimaryKey) FROM Foo; As far as I can see, they all do the same thing, and I find myself using the three in my codebase. However, I don't like to do the same thing different ways. To which one should I stick? Is any one of them better than the two others?

    Read the article

  • Is it possible to detect the load of an applet?

    - by zneak
    Hello guys, I'm working on a Safari extension, and I'd like to detect when <applet>s load on a page. However, there seems to be no onload event for these. How should I do it? Transform all <applet> tags to <object> tags and then intercept their onload events? Is there a better way?

    Read the article

  • Why is it bad practice to use links with the javascript: "protocol"?

    - by zneak
    Hello everyone, In the 1990s, there was a fashion to put Javascript code directly into <a> href attributes, like this: <a href="javascript:alert('Hello world!')">Press me!</a> And then suddenly I stopped to see it. They were all replaced by things like: <a href="#" onclick="alert('Hello world!')">Press me!</a> For a link whose sole purpose is to trigger Javascript code, and has no real href target, why is it encouraged to use the onclick property instead of the href property?

    Read the article

  • Is there a unified way to know if a node is visible or not?

    - by zneak
    Hello guys, I'd like to be able to know if a node is visible and rendered on screen. As far as I know, there are at least 3 standard and easy ways of making HTML nodes not visible: Setting opacity: 0; Setting display: none; Setting visibility: hidden. I could check for just these three, but I'm afraid people can get creative when it comes to ways of hiding contents: Sending the element offscreen using negative margins; Using a width or height of 0 and hiding overflow; many more I trust people to have developed. So I was wondering if there is a standard way of determining if a node is rendered to the screen. I'm pretty sure all major browsers determine it for themselves to accelerate drawing, so maybe it's somehow exposed.

    Read the article

1 2  | Next Page >