Search Results

Search found 5718 results on 229 pages for 'apply'.

Page 69/229 | < Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >

  • DRY, string, and unit testing

    - by Rodrigue
    I have a recurring question when writing unit tests for code that involves constant string values. Let's take an example of a method/function that does some processing and returns a string containing a pre-defined constant. In python, that would be something like: STRING_TEMPLATE = "/some/constant/string/with/%s/that/needs/interpolation/" def process(some_param): # We do some meaningful work that gives us a value result = _some_meaningful_action() return STRING_TEMPLATE % result If I want to unit test process, one of my tests will check the return value. This is where I wonder what the best solution is. In my unit test, I can: apply DRY and use the already defined constant repeat myself and rewrite the entire string def test_foo_should_return_correct_url(): string_result = process() # Applying DRY and using the already defined constant assert STRING_TEMPLATE % "1234" == string_result # Repeating myself, repeating myself assert "/some/constant/string/with/1234/that/needs/interpolation/" == url The advantage I see in the former is that my test will break if I put the wrong string value in my constant. The inconvenient is that I may be rewriting the same string over and over again across different unit tests.

    Read the article

  • Secure Open Source?

    - by opatachibueze
    I want to make a delicate application of mine (an antivirus actually) open source but I want to have a control on who really obtains the source or not. Preferably they should apply and I or administrators approve their applications. Is there any online platform for this? The main reason for the control/security is to possibly prevent malware makers to easily discover how to bypass the stealth checking methods it utilizes for malware detection. Edit: I am looking for advice - possibly to hear from someone who has done something similar. Thanks!

    Read the article

  • What are some ways to texture map a terrain?

    - by ApocKalipsS
    I'm working with XNA on a 3D Game, and I'm trying to have a proper and nice environnement. I actually followed a tutorial to create a terrain from a heightmap. To texture it, I just apply a grass texture on it and tile it a number of times. But what I want to do is to have a really realistic texturing, but also generate it automatically (for example if I want to use Perlin noise to generate a terrain and then texture it). I already learned about multi-texturing, loading a map file with different colors for different textures, but I don't think this is really efficient, for instance for cliffs or very steep areas it will tile a texture badly as it's a view from the top. (Also, I don't know how I'll draw roads or dirt paths with that.) I'm looking for an efficient solution to realistically texture mapping procedurally-generated terrain.

    Read the article

  • Are there Negative Impact of opensource on commercial environment?

    - by Lostsoul
    I know this is not a good fit for Stack Overflow but wasn't sure if it was good for this site also so let me know if its not and I'll delete it. I love programming for fun but my role in my company is not technical. I have always loved the hacker culture and have been trying to drive that openness within my company from day one. My company has a very broad range of products and there are a few that are not strategic to us so I wanted to open source them (so we can focus on what makes us unique and open source the products that every firm has). Our industry does not open source(we would be the first firm to try this) and the feedback I'm getting from my management team is either 1) we'll destroy the industry or 2) all competitive commercial firms will unite against us and we'll be wiped out either way. I disagreed on both points because I think transparency will only grow our industry and our firm (think of McDonalds/KFC sharing their recipe openly, people may copy you, competitors may target you, but customers also may feel more comfortable buying your product. The value add, I believe, is in the delivery and experience not in hoarding the recipe). It's a big battle in my firm right now between the IT people who have seen the positive effects of sharing and the business people who think we'll be giving up everything (they prefer we sell parts we want to opensource, but in their defense this is standard when divesting something). Our industry is very secretive and I don't want to put anyone(even my competitors employees) out of a job yet I don't want to protect inefficient people by not being open with everyone. Yet I've seen so many amazing technologies created in interesting ways just by giving people freedom to take apart code and put it back together. I'm interested in hearing people's thoughts(doesn't have to be to my specific situation, I'm looking for the general lessons). Its a very stressful decision(but one I feel I must make) because if we go the open source route then there will be no going back. So what are your thoughts? Does open sourcing apply generally or is it only really applicable to software? Is it overall good for people in the industry and outside? I'm actually more interested in the negativeness effects(although positive are welcomed as well) Update: Long story short, although code is involved this is not so much about code as it is more about the idea of open sourcing. We are a mid sized quant hedge fund. We have some unique strategies but also have the standard long/short, arbitrage, global macro, etc.. funds. We are keeping the unique funds we have but the other stuff that everyone else has we are considering open sourcing (We have put in years of work & millions of dollars into. Our funds is pretty popular and our performance is either in first or second quartile so I suspect there will be interest but I don't know to what extent). The goal is not to get a community to work for us or anything, the goal is to let anyone who wants to tinker with it do so and create anything they want (it will not be part of our product line although I may unofficially allocate some our of staff's time to assist any community that grows). Although the code base is quite large, the value in this is the industry knowledge and approaches we have acquired (there are many books on artificial intelligence and quant trading but they are often years behind what's really going on as most firms forbid their staff from discussing what they are doing). We are also considering after we move our clients out to let the software still run and output the resulting portfolios for free as well so people can at least see the results(as long as we have avail. infrastructure). I think our main choices are, we can continue to fight for market share in a products that are becoming commoditized, we can shut the funds/products down(and keep the code but no one outside of our firm will ever learn from it) or we can open source it and let people do what they want. By open sourcing it, my idea is that the talent pool in the industry will grow because right now most of our hires have the same background (CFA, MBA, similar school, same experience,etc.. because we can't spend time training people so the industry 'standardizes' most people and thus the firms themselves start to look/act similar) but this may allow us to identify talent that has never been in the industry before (if we put a GPU license then as people learn from what we did, we can learn from what they do as well and maybe apply it to other areas of our firm). I see a lot of benefits but not many negatives while my peers at the company see the opposite.

    Read the article

  • Presenting to the New England SQL Server Users Group 10 Jun 2010!

    - by andyleonard
    I am honored to present Applied SSIS Design Patterns to the New England SQL Server Users Group on 10 Jun 2010! This is a reprise of the spotlight session presented at the PASS Summit 2009. Abstract "Design Patterns" is more than a trendy buzz phrase; design patterns are a way of breaking down complex development projects into manageable tasks. They lend themselves to several development methodologies and apply to SSIS development. Chances are you're using your own design patterns now! In this spotlight...(read more)

    Read the article

  • FBO rendering different result between Galaxy S2 and S3

    - by BruceJones
    I'm working on a pong game and have recently set up FBO rendering so that I can apply some post-processing shaders. This proceeds as so: Bind texture A to framebuffer Draw balls Bind texture B to framebuffer Draw texture A using fade shader on fullscreen quad Bind screen to framebuffer Draw texture B using normal textured quad shader Neither texture A or B are cleared at any point, this way the balls leave trails on screen, see below for the fade shader. Fade Shader private final String fragmentShaderCode = "precision highp float;" + "uniform sampler2D u_Texture;" + "varying vec2 v_TexCoordinate;" + "vec4 color;" + "void main(void)" + "{" + " color = texture2D(u_Texture, v_TexCoordinate);" + " color.a *= 0.8;" + " gl_FragColor = color;" + "}"; This works fine with the Samsung Galaxy S3/ Note2, but cause a strange effect doesnt work on Galaxy S2 or Note1. See pictures: Galaxy S3/Note2 Galaxy S3/Note2 Galaxy S2/Note Galaxy S2/Note Can anyone explain the difference?

    Read the article

  • World to Pixel Transformation

    - by D00d
    My objects have a location in world coordinates (basically 1.0f is a meter). If I simply draw my objects using their world coordinates, each meter will correspond to a pixel. Obviously that's not what I want. Now, I don't want to have to apply a transformation to each and every object's position when I draw them. As I happen to be using XNA, and spritebatch allows a Matrix to be passed in as an argument in it's begin method, I was wondering if there is a way to pass the World to Pixel transformation in there. Any suggestions? So far Matrix.CreateScale(new Vector3(zoom, zoom, 1)) puts the objects in their proper spot, but it also scales up the sprites. Is there a way to transform the position without enlarging the sprite? Thanks

    Read the article

  • Windows 7 Tips and Tricks: Tweaking the Interface

    By default the look of Windows 7 is an improvement over its predecessors in the Windows operating system lineup. Windows 7 s interface not only looks better it also seems to be more user-friendly with the various features it affords its users. While you can enjoy the latest Windows OS without making any adjustments to it there are plenty of tweaks that can help you change and improve its appearance. This multi-part series will offer up some of the tweaks that you can easily apply to your own PC.... Comcast? Business Class - Official Site Sign Up For Comcast Business Class, Make Your Business a Fast Business

    Read the article

  • Windows 7 Tips and Tricks: Tweaking the Interface

    By default the look of Windows 7 is an improvement over its predecessors in the Windows operating system lineup. Windows 7 s interface not only looks better it also seems to be more user-friendly with the various features it affords its users. While you can enjoy the latest Windows OS without making any adjustments to it there are plenty of tweaks that can help you change and improve its appearance. This multi-part series will offer up some of the tweaks that you can easily apply to your own PC.... Comcast? Business Class - Official Site Sign Up For Comcast Business Class, Make Your Business a Fast Business

    Read the article

  • Xubuntu: how do I automatically mount external NTFS drive with writes allowed?

    - by user74372
    i would have thought mine was such a common question that there would be a simple solution already built in to xubuntu - but there isnt. i have 2 separate external hard disks and connect them to a usb port at different times - i would like them to be automatically mounted as read/write, but apparently the designers of gnome-volume-manager decided that shouldnt be possible and they are mounted as read-only in fact, i can write new files to them, but cannot then delete the new files i just wrote! is there a workaround? i read somewhere that etc/fstab doesn't apply to removable media, which are mounted by gnome-volume-manager and therefore cannot be unmounted by a user

    Read the article

  • How to switch language spellingcheck on the fly when changing keyboard with alt-shift?

    - by Kosmas Papagiannis
    i just recently installed ubuntu 11.04, english version that comes with libreoffice. I also installed Greek language. Is there some way to make Writer recognize my input language (English - Greek) and apply spelling check on the fly, according to my input language? For example, i type a sentence in English, then switch keyboard input (Alt-Shift) and type a sentence in Greek. Writer does no recognize the Greek sentence and underlines it red. MS Office and OO under Windows does it... As soon as you change input language (keyboard layout), the real time spelling checker changes also between languages... Thank you in advance...

    Read the article

  • How to make safe and secure forms in asp.net MVC 3

    - by anirudha
    the asp.net application need all kind of security. unsecure forms may be influence by XSS [cross site scripting] there is some way to solve these type of problem in MVC. first sollution is that use <%= Html.AntiForgeryToken() %> for make secure from cross site scripting. it’s work by machine key in MVC. well you can valid them whenever you got respond from client. you can apply by this attribute on action you give the response behalf of form submission [ValidateAntiForgeryToken] you can secondly use authorize attribute where you can make own definition of authorize attribute in asp.net mvc for more info read david’s post well I am use my own custom attribute who use a different type of authorization :- the who controller use a attribute I put their and the attribute I put their have a logic and logic check the cookie in request who make sure that request they got from user.

    Read the article

  • Knockback enemy based off of direction sprite is facing

    - by pengume
    Hey Everyone, Today I am trying to make it so if I hit the enemy then the enemy well be knocked backwards in the direction the sprite is facing. I am rotating the sprite around 360 degrees using a joystick on the screen and wanted to know the best practice or ways to accomplish this. I have come up with a few ideas but none of them make use of the sprites angle he is facing just a check to see if I hit the bottom then move him upward and so forth. I am just stumped on how to apply the sprites angle to the enemies x and y coordinate and move him accordingly. Has anyone tried this and have suggestions or things to look for? Thanks in advance.

    Read the article

  • How do you load in a .bmp file to use it as a height map in C++?

    - by user1324894
    I need to create a terrain that can be used in C++ and opengl and I am told that using a height map is the way to go. I have a .bmp file that is a greyscale image that I would like to use. However, I do not know how to load that greyscale image into the project so that it can be used as a height map or how I can apply a texture to it to create terrain nor how to compute the normals that I'm told will be required. How would I go about achieving what I would like to do?

    Read the article

  • Best container to store this information

    - by user2368481
    I'm trying to write a smallish system as a homework excercise, I don't have much experience with containers and I'm not sure the best way of storing this data would be: Incident Records object holds instants of Incident Report. Report is a superclass which has 3 subclasses, Police, Fire or Medical. Record must must record which of these types apply, and which response teams are to be involved. So Record has to keep track of the Report objects, the type of the report (Police, Fire or Medical) and the teams involved in the reports. I was initially thinking of an array but that wouldn't be sufficient to hold all the info. Record<>---------Report<|----------Police, Fire or Medical

    Read the article

  • SQL to XML open data and NIEM training video posted

    - by drrwebber
    Learn how to build a working XML query/response system with SQL database accessing and XML components from example NIEM schema and dictionary. Software development practitioners, business analysts and managers will find the materials accessible and valuable in showing the decision making processes that go into constructing a working XML exchange. The 22 minute video available online shows how to build a fully working ULEXS-SR exchange using a Vehicle license search example.  Also included are aspects of NIEM training for assembling an IEPD schema with data models. Materials are focused on practical implementers, after viewing the instruction material you can use the open source tools and apply to your own SQL to XML use cases and information exchange projects. All the SQL and XML code, editor tools, dictionary and instructions that accompany the tutorial video are also available for download so you can try everything yourself.  See http://www.youtube.com/user/TheCameditor to run the video. And the open source project web site (sponsored by Oracle) contains all the resources, downloads and supplemental materials. Enjoy.

    Read the article

  • Triple monitors on hybrid video system GeForce+Intel

    - by v_mil
    I use Lenovo Ideapad Z580A with hybrid video: GeForce+Intel with Ubuntu 12.10 x64 Ukrainian. It has internal display and two outputs: HDMI and VGA. When I connect third display to VGA all displays go black. Pressing alt+backspace and login causes output to two displays: internal and VGA. System Settings - Displays (or monitors - I have Ukrainian interface) shows three displays: two are on, one (DVI) is off. Turning DVI on and pressing apply causes an error: Can not set configuration of controller CRTC 65. BIOS setting is Optimus (two video cards). Driver for GeForce is Nouveau. With best regards. Viktor.

    Read the article

  • Is there any hard data on the (dis-)advantages of working from home?

    - by peterchen
    Is there any hard data (studies, comparisons, not-just-gut-feel analysis) on the advantages and disadvantages of working from home? My devs asked about e.g. working from home one day per week, the boss doesn't like it for various reasons, some of which I agree with but I think they don't necessarily apply in this case. We have real offices (2..3 people each), distractions are still common. IMO it would be beneficial for focus, and with 1 day / week, there wouldn't be much loss at interaction and communication. In addition it would be a great perk, and saving the commute. Related: Pros and Cons of working Remotely/from Home (interesting points, but no hard facts) [edit] Thanks for all the feedback! To clarify: it's not my decision to make, I agree that there are pro's and con's depending on circumstances, and we are pushing for "just try it". I've asked this specific question because (a) facts are a good addition to thoughts in arguing with an engineer boss, and (b) we, as developers, should build upon facts like every respectable trade.

    Read the article

  • Help with Meshes, and Shading

    - by Brian Diehr
    In a game I'm making in LibGdx, I wish to incorporate a ripple effect. I'm confused as to how I get access to the individual pixels on the screen, or any way to influence them (apart from what I can do with sprite batch). I have my suspicions that I have to do it through openGL, and it has something to do with apply a mesh? This brings me to my question, what exactly is a mesh? I've been working on my game for about half a year, and am doing great with the other aspects of the game, but I find this more advance stuff isn't as well documented. Thanks!

    Read the article

  • Do I have to release the code of a MIT licensed software running a GPL library?

    - by Belohlavek
    Lets say I'm using Node-Webkit, an MIT licensed app runtime. Now, let's say I decide to include a Javascript library which is GPL licensed: while I do not modify the downloaded JS file, I do write my own code making use of the library's functions. I plan to sell the final obfuscated executable and I'm wondering: what's the final license of the complete software? Do I only have to release the GPL library or does the GPL license apply for all the code I wrote? What happens to Node-Webkit's MIT license?

    Read the article

  • Really, Mobile Devices will Take Over the World?

    - by p.gielens
    My blog has been quiet for quite a while. My inspiration comes from crunching/exchanging information which I should do more often. Gartner analysis tells us that by 2013 mobile phones will overtake PC’s as the most common Web access device worldwide. A few years back I would have said non sense, but apparently most Web users are comfortable with less processing power. Just take a look at the increasing business in Netbooks. Wouldn’t it be great to have a mobile phone which can connect wirelessly to my home TV, monitor, car display, mouse, keyboard, etc? And to have the processing power of the current Netbook generation? Where can I buy it? Why are we making our PC devices (for instance the slate) smaller while we can make our mobile device’s functionality bigger? What about the single responsibility principle? Does it apply to physical devices as well as good object-oriented software?

    Read the article

  • What Shading/Rendering techniques are being used in this image?

    - by Rhakiras
    My previous question wasn't clear enough. From a rendering point of view what kind of techniques are used in this image as I would like to apply a similar style (I'm using OpenGL if that matters): http://alexcpeterson.com/ My specific questions are: How is that sun glare made? How does the planet look "cartoon" like? How does the space around the planet look warped/misted? How does the water look that good? I'm a beginner so any information/keywords on each question would be helpful so I can go off and learn more. Thanks

    Read the article

  • Convert Microsoft Word documents (.doc/x) into HTML files

    - by danie7L T
    Does anybody knows of a good application to get it done quickly and efficiently ? I bought Word Cleaner but the results are merely sufficient and I need go over all the generated html files to clean tons of useless injected tags like <strongH</strong<strongell</strong<strongo </strong<emWor</em<emld</em Most of the articles displayed on a website I manage are based on documents written on MS Word by people how has little idea of what are margins for or ordered/unordered lists, foot/end notes etc and I cannot make them use something else. Does anyone has a tip to help me handle those pages more efficiently than going over them to correct and apply my CSS style ? NB: Just for the record, using "Save as HTML DOC" in Word is faaar worst than Word cleaner

    Read the article

  • New and Improved Patch for FRM-40654 Errors in Purchase Orders and Requisitions

    - by user793044
    Development has modified the code in purchase orders and requisition forms to prevent error FRM-40654 when there are trailing spaces in the tables for most of the fields.  After applying the patch, the form will still display the error but a requery will allow you to save the transaction. For the scenarios not covered in the fix, the FND log will now display the specific field that causes the error.  This an example of the FND log for one document where the note_to_vendor has trailing spaces: Form note_to_vendor oldvalue Database  note_to_vendor newvalue Failed first if statement when comparing fields FRM-40654: Record has been updated. Requery block to see change. This new patch includes the fix in Patch 14204845:"In Oracle Purchasing, leading or trailing spaces in po lines data was resulting in errors".  For more information on FRM-40654 errors see the patching section of Note 1203796.1. Be proactive and apply Patch 14479586:R12.PO.B for 12.1.3 or Patch 14569747 for 11.5.10 now!

    Read the article

  • Is there an opposite for the term "Backporting"?

    - by Avian00
    As I understand, the term "Backporting" is used to describe a fix which is applied in a future version which is also ported to a previous version. Wikipedia definition is as follows: Backporting is the action of taking a certain software modification (patch) and applying it to an older version of the software than it was initially created for. It forms part of the maintenance step in a software development process... For example: A problem is discovered and fixed in V2.0. The same fix is ported and applied to V1.5. What is the term when this is done in the opposite direction? The problem is discovered and fixed in V1.5. The same fix is ported and applied to V2.0. Would the term "Backporting" still apply? Or is there a term such as "Forwardporting" (which amusingly sounds a lot like "Port Forwarding")?

    Read the article

< Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >