Daily Archives

Articles indexed Friday October 12 2012

Page 11/17 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Naming conventions for newtype deconstructors (destructors?)

    - by Petr Pudlák
    Looking into Haskell's standard library we can see: newtype StateT s m a = StateT { runStateT :: s -> m (a, s) } newtype WrappedMonad m a = WrapMonad { unwrapMonad :: m a } newtype Sum a = Sum { getSum :: a } Apparently, there (at least) 3 different prefixes used to unwrap a value inside a newtype: un-, run- and get-. (Moreover run- and get- capitalizes the next letter while un- doesn't.) This seems confusing. Are there any reasons for that, or is that just a historical thing? If I design my own newtype, what prefix should I use and why?

    Read the article

  • What does the python Codecs module do?

    - by Aerovistae
    I just read through the documentation on the Codecs module, but I guess my knowledge/experience of comp sci doesn't run deep enough yet for me to comprehend it. It's for dealing with encoding/decoding, especially Unicode, and while to many of you that's a complete and perfect explanation, to me that's really vague. I don't really understand what it means at all. Text is text is text in a .txt file? Or so this amateur thought. Can anyone explain?

    Read the article

  • Understanding the levels of computing

    - by RParadox
    Sorry, for my confused question. I'm looking for some pointers. Up to now I have been working mostly with Java and Python on the application layer and I have only a vague understanding of operating systems and hardware. I want to understand much more about the lower levels of computing, but it gets really overwhelming somehow. At university I took a class about microprogramming, i.e. how processors get hard-wired to implement the ASM codes. Up to now I always thought I wouldn't get more done if learned more about the "low level". One question I have is: how is it even possible that hardware gets hidden almost completely from the developer? Is it accurate to say that the operating system is a software layer for the hardware? One small example: in programming I have never come across the need to understand what L2 or L3 Cache is. For the typical business application environment one almost never needs to understand assembler and the lower levels of computing, because nowadays there is a technology stack for almost anything. I guess the whole point of these lower levels is to provide an interface to higher levels. On the other hand I wonder how much influence the lower levels can have, for example this whole graphics computing thing. So, on the other hand, there is this theoretical computer science branch, which works on abstract computing models. However, I also rarely encountered situations, where I found it helpful thinking in the categories of complexity models, proof verification, etc. I sort of know, that there is a complexity class called NP, and that they are kind of impossible to solve for a big number of N. What I'm missing is a reference for a framework to think about these things. It seems to me, that there all kinds of different camps, who rarely interact. The last few weeks I have been reading about security issues. Here somehow, much of the different layers come together. Attacks and exploits almost always occur on the lower level, so in this case it is necessary to learn about the details of the OSI layers, the inner workings of an OS, etc.

    Read the article

  • What is the justification for Python's power operator associating to the right?

    - by Pieter Müller
    I am writing code to parse mathematical expression strings, and noticed that the order in which chained power operators are evaluated in Python differs from the order in Excel. From http://docs.python.org/reference/expressions.html: "Thus, in an unparenthesized sequence of power and unary operators, the operators are evaluated from right to left (this does not constrain the evaluation order for the operands): -1*2 results in -1."* This means that, in Python: 2**2**3 is evaluated as 2**(2**3) = 2**8 = 256 In Excel, it works the other way around: 2^2^3 is evaluated as (2^2)^3 = 4^3 = 64 I now have to choose an implementation for my own parser. The Excel order is easier to implement, as it mirrors the evaluation order of multiplication. I asked some people around the office what their gut feel was for the evaluation of 2^2^3 and got mixed responses. Does anybody know of any good reasons or conciderations in favour of the Python implementation? And if you don't have an answer, please comment with the result you get from gut feel - 64 or 256?

    Read the article

  • How important are unit tests in software development?

    - by Lo Wai Lun
    We are doing software testing by testing a lot of I/O cases, so developers and system analysts can open reviews and test for their committed code within a given time period (e.g. 1 week). But when it come across with extracting information from a database, how to consider the cases and the corresponding methodology to start with? Although that is more likely to be a case studies because the unit-testing depends on the project we have involved which is too specific and particular most of the time. What is the general overview of the steps and precautions for unit-testing?

    Read the article

  • Can't install Ubuntu 12.04 64-bit on a dual-drive MacBook Pro 8,2

    - by kizdp
    Good afternoon, this is the first time I participate here as I'm new to Linux. I've been trying to solve the following problem for over a week without any sign of success so I hope there's a much more knowledgeable person here that can give me a solution. I have an early 2011 MacBook Pro (8,2) with Mac OS X running in a SSD. Then, instead of the Optical bay, I have a HDD in where I would like to install Ubuntu to run it natively. I've tried to do the normal installation process, with or without rEFIt, but it seems the problem resides on the communication between the device containing the Ubuntu .iso file and the laptop. It doesn't allow communication with the boot CD or USB drive. It usually says: “Loading bootlogo...” after I click on the “boot from CD, Linux Icon”. After trying several things, I would like to know if I could install Ubuntu on the HDD as an external HDD (using a friend's Window's system) and then simply put it back into my laptop so as to become an Internal HDD again. I guess, I would have to reinstall many drivers and so on, but would this approach work? Thanks in advance and sorry for this huge block of text

    Read the article

  • Ubuntu Workstation

    - by John Smith
    I bought a dell inspiron n5110 hoping that i'll be able to use it fine with Linux; however i couldn't install the video card drivers and in 8 months the motherboard burned because the power management wasn't right and it was overheating. I want to buy a workstation pc that works with ubuntu. Does anyone have any suggestions? I'd like to have the videocard and all other hardware to be used properly Thank you

    Read the article

  • Can't find openjdk's jre?

    - by Patryk
    I have recently installed openjdk just to try out writing some java application $ dpkg -l | grep jdk ii openjdk-7-jdk 7u7-2.3.2a-0ubuntu0.12.04.1 OpenJDK Development Kit (JDK) ii openjdk-7-jre 7u7-2.3.2a-0ubuntu0.12.04.1 OpenJDK Java runtime, using Hotspot JIT ii openjdk-7-jre-headless 7u7-2.3.2a-0ubuntu0.12.04.1 OpenJDK Java runtime, using Hotspot JIT (headless) ii openjdk-7-jre-lib 7u7-2.3.2a-0ubuntu0.12.04.1 OpenJDK Java runtime (architecture independent libraries) That's what I have on my system. Although I have all this installed when in Chrome I go to a website which needs jre it can't find it. How can I fix it ?

    Read the article

  • Additional Drivers error installing in Ubuntu 12.04 (wireless internet and software modem)

    - by gabiro
    I've already search for similar problems but they are so different from mine. these are the drivers http://db.tt/qFZlD5JD I'm having problem with this Additional Drivers once I click the Activate button it will start in downloading and installing but after that it will say Installation failed. Then the "Enable Wireless" will not be available. With the Software Modem issue is the same problem with the Broadcom. These drivers are working on Ubuntu 9 and 11 if I'm not mistaken. Only on 12.04 is not working. One more thing these drivers will enable the Huawei E165g E220. I've already tried other solution for the Huawei to activate but all didn't work. After a restart Enable wireless becomes okay, though. To all Ubuntu experts and masters please I'm begging for help. A million Thank You!.

    Read the article

  • How can I modify the knetworkmanager icon in my kde taskbar?

    - by Joe
    I am using kubuntu 12.04 Precise 64 on my notebook. Almost everything works fine. I would like to modify the colors of the icon(s) used by knetworkmanager to indicate wifi online. Right now, I am using the (default?) Oxygen theme. What I want is to make the online icons some color other than gray - probably black, so the contrast is greater and they're easier for me to see (I use reading glasses.) I found an old article on how to do this, but when I added the icons it mentioned, they were ignored. Where are these icons stored? Can I just edit them with something like gimp to change the colors, etc.? TIA

    Read the article

  • grub does not display activity during boot

    - by Dale E. Moore
    Prior to Ubuntu 11.04 I could configure grub so that after the menu is displayed and the system is booting detail of the boot activity appears. Now there's just a blank screen between the menu and gdm login. How do I coax Ubuntu 11.04 to display the boot activity? Dale E. Moore Oh yeah; I asked the same question here http://ubuntuforums.org/showthread.php?t=1760753 and they didn't know the answer. This question was asked here https://answers.launchpad.net/ubuntu/+source/grub2/+question/160511 too, with no new insight.

    Read the article

  • Ralink RT3060 wireless device configuration on ubuntu 12.04

    - by Stephan
    concerning How do I get a Ralink RT3060 wireless card working? I'm running Ubuntu 12.04 with a 'LWPX07 Edimax EW-7711In 150M 1T1R WL PCI Card' which has a rt3060 chip. Out of the box the card is recognized as rt2800sta. I tried solution one, that didn't work. Still the card connects to the wireless network, but it seems to slow to load any pages. Then I tried solution 2, but then the network-manager doesn't see any wireless device. $ iwconfig lo no wireless extensions. ra0 Ralink STA Link Quality:0 Signal level:0 Noise level:0 Rx invalid nwid:0 invalid crypt:0 invalid misc:0 eth0 no wireless extensions. $ lsmod Module Size Used by rt3562sta 882296 0 $ lspci -v 05:02.0 Network controller: Ralink corp. RT3060 Wireless 802.11n 1T/1R Subsystem: Edimax Computer Co. Device 7711 Flags: bus master, slow devsel, latency 64, IRQ 23 Memory at ff9f0000 (32-bit, non-prefetchable) [size=64K] Capabilities: <access denied> Kernel driver in use: rt2860 Kernel modules: rt3562sta, rt2800pci Am I missing a configuration step? How do I tell the network card which driver to use? Thanks in advance Stephan I found the problem. As described in stevens blog http://steveswinsburg.wordpress.com/2011/03/12/how-to-install-a-d-link-dwa-525-wireless-network-card-in-ubuntu-10-04/ sudo su make && make install "You need to use ‘sudo su’ and not just ‘sudo’ so it creates the directories properly." That is the problem with the solution describe above.

    Read the article

  • How do I get my folders back on my desktop?

    - by Christopher Allen
    Using the 12.04 version. This morning the Update Manager popped up, I clicked it and it said some items will be un-installed and some will be upgraded and new ones will be installed. I did it and restarted. On restart, I entered my password about 5 times and it said it was incorrect. I changed the shell from Gnome to Ubuntu and logged on then changed it back to Gnome and I was able to log on. However, all my folders on the screen are gone but they appear under Desktop in the Home folder. How do I get then back on the screen?

    Read the article

  • DSL modem problem in 11.10

    - by Misterious
    Earlier I used Windows 7 and the modem used to work absolutely fine. Even when it got disconnected it used to reconnect automatically without any trouble. But then I installed Ubuntu 11.10 on dual-boot and set up the modem connection properly but the modem now disconnects much more frequently (earlier it disconnected once in 5 hours or so and after Ubuntu in 5 minutes!). Also once disconnected, it does not reconnect even when I have checked the "Connect Automatically" button. I have to restart the system to reconnect it. I the clean installed Windows and modem works perfectly fine again. What is the reason for this and how can I solve this? I really want to use Ubuntu but due to this problem I can't.

    Read the article

  • playonlinux is unable to find 32bits / 64bits OpenGL library

    - by footy
    When I open a fresh instalation of playonlinux, it gives 2 dialog box as mentioned in title: playonlinux is unable to find 32bits OpenGL library playonlinux is unable to find 64bits OpenGL library I am using Ubuntu 12.04 (and new to it) and would like to know how to solve this problem EDIT TERMINAL OUTPUT ~$ playonlinux [main] Message: PlayOnLinux (4.1.8) is starting [clean_tmp] Message: Cleaning temp directory Xlib: extension "GLX" missing on display ":0". Xlib: extension "GLX" missing on display ":0". [Check_OpenGL] Warning: Xlib: extension "GLX" missing on display ":0". Xlib: extension "GLX" missing on display ":0". [Check_OpenGL] Warning: [main] Message: Filesystem is compatible [install_plugins] Message: Checking plugin: Capture... [maj_check] Message: Web version : 1349866727 [maj_check] Message: Current local version : 1349563245 [maj_check] Message: Updating list [install_plugins] Message: Checking plugin: ScreenCap... [install_plugins] Message: Checking plugin: PlayOnLinux Vault... /usr/share/playonlinux/bash/startup_after_server: line 38: [: : integer expression expected /usr/share/playonlinux/bash/startup_after_server: line 38: [: : integer expression expected [POL_Config_Write] Message: Config write: LAST_TIMESTAMP 1349866727

    Read the article

  • Ubuntu Live USB: best practices for secure net traffic

    - by Och
    I want to to set up a live USB with Ubuntu, in the most secure way. So I want to have the persistent data on a second USB, something that its not that much problematic. How to configure a very safe Internet surfing (throughout a VPN?) Which are the best practices that could be implemented to have the Ubuntu live in a USB, the persistent data in other, and with the Internet access to a VPN (the Ubuntu privacy remix gives most of this, except the VPN config), Any ideas of how to combine the best of Ubuntu privacy remix, and Internet access to a VPN?

    Read the article

  • Recommendation for Regex editor?

    - by Tim
    I asked for recommendations for Regex editors on stackoverflow a while ago. Following is one of the replies: What is "good" depends on what is most useful to you. For me, though, these are the key features for a good regex editor (besides the ability to test and create regular expressions, of course, which is a prerequisite to be called a "regex editor" :-) : Displays matches hierarchically with captured groups. Explains/analyzes an entered regex in plain English, showing a hierarchical tree. Translates your regex into code for a language of your choice. RegexBuddy, as @Max mentioned, does all these but there is also a free alternative, Expresso that also does them very well. These two utilities are the only ones I have found with the crucial ability to explain a regex. The features sound very attractive to me. But later I found the two are for Windows. I tried to install Expresso, the free one, via Wine, but met some trouble, about which I asked in another post. So I was wondering if in Ubuntu there are some applications comparable to RegexBuddy and Expresso? If it is required to install .NET Framework in order to install Expresso, is it still worth to install Expresso on Ubuntu? Thanks and regards!

    Read the article

  • Stuck in logon loop

    - by MJeffryes
    Here's the deal. I set up a computer with Ubuntu 10.04 for my grandmother. Everything worked fine. I connected it to the internet at her house today. After rebooting the computer I found that the computer would kick you back to the logon screen if you attempted to logon to her account. It worked fine logging on to my admin account, and also in Gnome's safe mode. I thought it had resolved itself, but turns out it hadn't, and now I don't have physical access to the computer, plus the remote connection I'd hoped to use only works intermittently. I need some suggestions for troubleshooting for when I'm at her house at some point next week. Ask for any more details, but I'm afraid I won't be able to provide many more until I've checked it out in person, since she is basically unable to use a computer beyond web browsing. Thanks in advance!

    Read the article

  • Can you add doubleclick macros to exisiting ads

    - by picus
    Setup: A few weeks back I made some very simple html5 "ads" to run on a few of our partner sites. They weren't paid ads as we also manage these sites, however there are a few of them, so I made a modular solution that is hosted on one of our web servers and included on each page via javascript which outputs an iframe. Each search (ad has a search box) or click appends a url param that we track using custom vars in Google Analytics. In essence, the ad is a HTML page served in an iframe via javscript. Problem: We have an opportunity to run these ads on a third party site, I had sent them a brief how-to for inserting them and they came back saying that: The creative code doesn't contain the %u macro. We can’t substitute the default click-through URL without it. I am somewhat familiar with doubleclick from a web developer's POV, i have inserted DC dart tags before and even have implemented the ad tool for publishers. I have not, however, actually ever created an ad for the doubleclick network before. I assume the publisher needs these tags to track clicks and hence charge us. However, they have not responded to me in regards to these questions. Are macros something I can just add to or replace the existing links with, or do I need to completely setup the ad with doubleclcik - a big issue in the short term given we do not have a advertiser's account set up with them. Thanks in advance

    Read the article

  • Repeated calls with random Javascript append to the URL

    - by cjk
    I keep getting calls to my server where there is random Javascript appended on the end of lots of the calls, e.g.: /UI/Includes/JavaScript/).length)&&e.error( /UI/Includes/JavaScript/,C,!1),a.addEventListener( /UI/Includes/JavaScript/),l=b.createDocumentFragment(),m=b.documentElement,n=m.firstChild,o=b.createElement( /UI/Includes/JavaScript/&&a.getAttributeNode( /UI/Includes/JavaScript/&&a.firstChild.getAttribute( /UI/Includes/JavaScript/).replace(bd, /UI/Includes/JavaScript/)),a.getElementsByTagName( The user agent is always this: Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.NET+CLR+2.0.50727) I have jQuery, Modernizr and other JS and originally thought that some browser was messing up it's JS calls, however this particular IP address hasn't requested any images so I'm wondering if it is some kind of attack. Is this a common occurence?

    Read the article

  • Game Asset Management

    - by user964123
    I am making my first small mobile game in C# XNA. Lets say I have 3 screens, the main menu, options and game screen. A single game session usually lasts for 1 min, so the user will alternate frequently between the main menu and game screen. Therefore, once I load the textures for either screen, I want to keep them in memory to avoid frequent reloading. Both screens share some assets like their background textures, but differ in others. The first solution I came up with is making 2 texture factory classes, MainScreenAssetFactory and GameScreenAssetFactory, each with their own content manager, and ill store them in a globally accessible point so that they persist after either screen is destroyed. There is also a OptionsScreenAssetFactory, but that I dont want to cache it since the options screen is rarely visited. A typical Factory would look something like this public class MainScreenAssetFactory { private readonly ContentManager contentManager; public MainScreenAssetFactory(IServiceProvider serviceProvider, string rootDirectory) { contentManager = new ContentManager(serviceProvider) { RootDirectory = rootDirectory }; } public Texture2D ListElementBackground { get { return return contentManager.Load<Texture2D>("UserTab"); } } public Texture2D ListElementBulletPoint { get { return return contentManager.Load<Texture2D>("TabIcon"); } } public Texture2D LoggedOutUser { get { return return contentManager.Load<Texture2D>("LoggedOutUser"); } } } Since both Main, Options and Game Screen share some common resources, instead of loading them more than once, I created another class CommonAssetTexFactory which holds the common stuff and stays in-memory during the app lifetime. For example, this class gets passed to the options screen when it is created. However, given my small game with its few assets, I am already finding this solution cumbersome and inflexible. Changing anything would require looking to see if its already in the common factory, and if not, modifying existing factories and so on. And this is just considering textures currently, i didnt add sound files yet. I cant imagine bigger games with thousands of resources using this approach. A better idea must exist. Would someone please enlighten me?

    Read the article

  • Is there a simple isometric graphical game engine (using vectors?) that could be used for a (multiplayer) crafting/farming game? [closed]

    - by Renier Wijnen
    Possible Duplicate: Good, free isometric game engine? With little game development experience (albeit having graphical skills and some programming knowledge) a group currently working on a game used to explain permaculture through interaction would like to create a simple concept game. Is there a specific engine or set of tools we could used to achieve this? Being able to make it an (online) multiplayer game would be much preferred. Thank you in advance for your input.

    Read the article

  • Are there specific benefits to using XNA for 2D development if you don't plan on releasing on xbox/windows phone?

    - by ssb
    I've been using XNA for a while to tinker with 2D game development, but I can't help but feel constrained by the content pipeline when targeting PC only. Things like no vector fonts or direct use of graphics files make it a pain while other frameworks do these things with no problem. I like XNA because it's robust and has a lot of support, but what are the specific benefits that I'd get developing exclusively for PC, if there are any at all?

    Read the article

  • How should I generate and store the boundries of a cave?

    - by Bob Roberts
    I am making a small cave copter game (seriously, where did this type of game come from anyway) and I am trying to figure out how to make and store the procedural generated walls. I am thinking about creating the walls by randomly picking two points away from the center of the screen. They will be no closer than the height of helicopter and no further than the edge of the screen, weighted to prefer to go in the same direction as the point prior so I end up with stalactites and stalagmites and not just noise, at set intervals of distance. To store, perhaps parallel arrays/lists, one for distance from center to top screen and one for distance from center to bottom. Am I way off base with my thinking? I just want the cave to be varied and challenging, I just have never worked with generating data like this. Edit: Woah, I just realized that my idea would lead to a player being able to stay in the middle of the screen and win. That isn't right at all. So the very basis of how I was going to generate is wrong. Edit 2: I also realized I left out a very crucial point. Part of the mechanics of the game will let the player go backwards therefor the data structure should be continuous.

    Read the article

  • Wrong faces culled in OpenGL when drawing a rectangular prism

    - by BadSniper
    I'm trying to learn opengl. I did some code for building a rectangular prism. I don't want to draw back faces so I used glCullFace(GL_BACK), glEnable(GL_CULL_FACE);. But I keep getting back faces also when viewing from front and also sometimes when rotating sides are vanishing. Can someone point me in right direction? glPolygonMode(GL_FRONT,GL_LINE); // draw wireframe polygons glColor3f(0,1,0); // set color green glCullFace(GL_BACK); // don't draw back faces glEnable(GL_CULL_FACE); // don't draw back faces glTranslatef(-10, 1, 0); // position glBegin(GL_QUADS); // face 1 glVertex3f(0,-1,0); glVertex3f(0,-1,2); glVertex3f(2,-1,2); glVertex3f(2,-1,0); // face 2 glVertex3f(2,-1,2); glVertex3f(2,-1,0); glVertex3f(2,5,0); glVertex3f(2,5,2); // face 3 glVertex3f(0,5,0); glVertex3f(0,5,2); glVertex3f(2,5,2); glVertex3f(2,5,0); // face 4 glVertex3f(0,-1,2); glVertex3f(2,-1,2); glVertex3f(2,5,2); glVertex3f(0,5,2); // face 5 glVertex3f(0,-1,2); glVertex3f(0,-1,0); glVertex3f(0,5,0); glVertex3f(0,5,2); // face 6 glVertex3f(0,-1,0); glVertex3f(2,-1,0); glVertex3f(2,5,0); glVertex3f(0,5,0); glEnd();

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17  | Next Page >