Daily Archives

Articles indexed Monday February 21 2011

Page 10/12 | < Previous Page | 6 7 8 9 10 11 12  | Next Page >

  • Subterranean IL: Exception handler semantics

    - by Simon Cooper
    In my blog posts on fault and filter exception handlers, I said that the same behaviour could be replicated using normal catch blocks. Well, that isn't entirely true... Changing the handler semantics Consider the following: .try { .try { .try { newobj instance void [mscorlib]System.Exception::.ctor() // IL for: // e.Data.Add("DictKey", true) throw } fault { ldstr "1: Fault handler" call void [mscorlib]System.Console::WriteLine(string) endfault } } filter { ldstr "2a: Filter logic" call void [mscorlib]System.Console::WriteLine(string) // IL for: // (bool)((Exception)e).Data["DictKey"] endfilter }{ ldstr "2b: Filter handler" call void [mscorlib]System.Console::WriteLine(string) leave.s Return } } catch object { ldstr "3: Catch handler" call void [mscorlib]System.Console::WriteLine(string) leave.s Return } Return: // rest of method If the filter handler is engaged (true is inserted into the exception dictionary) then the filter handler gets engaged, and the following gets printed to the console: 2a: Filter logic 1: Fault handler 2b: Filter handler and if the filter handler isn't engaged, then the following is printed: 2a:Filter logic 1: Fault handler 3: Catch handler Filter handler execution The filter handler is executed first. Hmm, ok. Well, what happens if we replaced the fault block with the C# equivalent (with the exception dictionary value set to false)? .try { // throw exception } catch object { ldstr "1: Fault handler" call void [mscorlib]System.Console::WriteLine(string) rethrow } we get this: 1: Fault handler 2a: Filter logic 3: Catch handler The fault handler is executed first, instead of the filter block. Eh? This change in behaviour is due to the way the CLR searches for exception handlers. When an exception is thrown, the CLR stops execution of the thread, and searches up the stack for an exception handler that can handle the exception and stop it propagating further - catch or filter handlers. It checks the type clause of catch clauses, and executes the code in filter blocks to see if the filter can handle the exception. When the CLR finds a valid handler, it saves the handler's location, then goes back to where the exception was thrown and executes fault and finally blocks between there and the handler location, discarding stack frames in the process, until it reaches the handler. So? By replacing a fault with a catch, we have changed the semantics of when the filter code is executed; by using a rethrow instruction, we've split up the exception handler search into two - one search to find the first catch, then a second when the rethrow instruction is encountered. This is only really obvious when mixing C# exception handlers with fault or filter handlers, so this doesn't affect code written only in C#. However it could cause some subtle and hard-to-debug effects with object initialization and ordering when using and calling code written in a language that can compile fault and filter handlers.

    Read the article

  • How to solve conflicts with another programmer..

    - by Tio
    Hi all.. I've read this question, but I think it doesn't really applies in my case.. I started to work at new company about 2 months ago with the position of senior web developer, there was already one programmer there, my position is above his, but I'm not his boss.. I don't tell him what to do.. Since the day I started to work at the company, I managed to implement a kind of a test server which he refuses to use, implemented a project management tool which he refuses to use also, and I'm in the process of implementing version control using mercurial ( damn Mercurial that's giving me so much headaches ), which he is going to use.. He is a nice guy, but just the other day we had a big discussion about "best practices", and "coding standards".. for me it's absolutely necessary to have this two things, at the place I'm currently working... otherwise it's not going to work.. This discussion, basically revolved about using short tags and the echo shortcut, and how we shouldn't use it anymore ( because I sometimes use short tags ).. this went for about 15 minutes, until I finally dropped the subject because I had work to do.. and of course he didn't budge even a millimeter, he's continuing to use short tags, and the echo shortcut and he not even cares about what I think.. When I mentioned that we are a team, he told me: "We are not a team, you work on your projects and I work on mine".. Let's just say, that the switch in my brain flipped, I raised my voice, and I told him that he was going nuts.. this was the most improper way to deal it with, I know, but there are certain things that can't be said to me.. The question here, is how do I deal with this? I want, to implement more changes on our work workflow, and I know that it's going to be a pain, with him always complaining and saying things like this.. Our boss is going to intervene in a few days, I talked to him today, the other programmer send him an email the day we had the discussion complaining.. Just to clarify, when I talk about implementing changes, I just don't appear at work, the next day with a sheet of paper, and say: "This is our we are doing things from now on! And there is no discussion.." For example, when I was trying to implement the project management tool, I took the time to talk to everybody that was going to be involved in it, to see what they think about it.. everyone was positive except him, he responded that it was just a mean to control us even more.. Does anyone has any idea on how to deal with this? PS: Truth to be told, I didn't start the best way with him, in the 4º day of work at the company, I found a really bad piece of code on our custom CMS, one of those things that I only expect to find in code produced by a programmer that has only 1 month of training in programming, and I talked to my boss about it... he showed up at the time I saw that piece of code, he saw my face and asked about it, so I told him.. I know the worst thing that can be said to a programmer is saying that their code is awful, but I've already learned that my code isn't the best of the world, so I take criticism in a completely different way now.. maybe he doesn't..

    Read the article

  • What method is used to create the password?

    - by Gortron
    Hello, I am developing on to a Groupon clone app called Couponic on behalf of a client. Can anyone help in pinpointing how Couponic generates user passwords? I want to be able to generate new passwords in the same method Couponic uses in a separate PHP script if possible, so that users of an existing site will also be able to log in to the Couponic site without re-creating an account. Couponic is built using the YII PHP framework, I can't find anything in the YII documentation. Any help would be greatly appreciated.

    Read the article

  • Is there a good book to grok C++?

    - by Paperflyer
    This question got me thinking. I would say I am a pretty experienced C++ programmer. I use it a lot at work, I had some courses on it at the university, I can understand most C++ code I find out there without problems. Other languages you can pretty much learn by using them. But every time I use a new C++ library or check out some new C++ code by someone I did not know before, I discover a new set of idioms C++ has to offer. Basically, this has lead me to believe that there is a lot of stuff in C++ that might be worth knowing but that is not easily discoverable. So, is there a good book for a somewhat experienced C++ programmer to step up the game? You know, to kind of 'get' that language the way you can 'get' Ruby or Objective-C, where everything just suddenly makes sense and you start instinctively knowing 'that C++ way of thing'?

    Read the article

  • How to build Gantt chart from a set of Redmine tickets without filling dates in all of them?

    - by Alexander Gladysh
    Redmine 1.1.1 I've created a set of tickets for a new project. In each issue I filled Subject, Description and Estimated time fields. I also filled blocks/blocked by dependencies in Related issues. But the Gantt chart for this project is empty (that is, it contains all the tasks, but does not contain any "bars" for them). I need to get a Gantt chart (or any other visual representation) to show to other project members. I'd hate to type all that information again into OpenProj. Is there a way to get a serviceable Gantt chart from the Redmine? Update: In the answers below I read that to get working Gantt chart I have to input start date and due date manually for each issue. I believe that this information should be inferred automatically from start date of first ticket (first — depenency-wise), estimated time of each ticket, dependency graph, resource assignment and working hours calendar. Just as it happens in any minimally sane Gantt chart project management tool. To enter this information by hand and to keep it up-to-date manually as the project evolves is insane waste of time. Is there a way to generate Gantt chart from the set of Redmine tickets without filling in all this information manually? (Solutions involving data export + import in sane tool or involving existing plugins are perfectly acceptable.)

    Read the article

  • One good reason for a rewrite

    - by Supermighty
    I have a personal web project I cut my teeth on learning how to program. I wrote it in PHP and learned as I went. I eventually I re-factored it to use MVC and removed all mixing of php/html. Right now it has no users, save myself, and it makes no money. I have a strong desire to rewrite the entire app. Which really isn't that large of an app. I have a lot of reasons why I should not rewrite it. I know that I should move forward. It's a working app now and it will only set me back to rewrite it. But I can't shake this feeling that I would be better off using a different programming language in the long run. That I'd enjoy it more. That I'd feel comfortable with it. I feel like my one good reason to rewrite my app is that I have a gut feeling that I should. PHP seems like a hack thrown together. I want to use a language that feels more elegant to me. Any feedback you have would be welcome.

    Read the article

  • What are the most commonly used enterprise Java technologies, and what would you want a non technical audience to understand about them?

    - by overstood
    I have been asked to give a presentation to a non-technical audience on what Java technologies are currently being used in the enterprise world. The goal is to give this non-technical audience the background they need to understand what engineers are talking about. It's part of a broader series of talks that I'm giving. I'm primarily a .NET and C++ dev, so I thought I'd try to get some input from some Java devs. What technologies do you use? What Java related acronyms would you like to be able to use around non-coders? What would you like non-coders to understand about them?

    Read the article

  • Effective versus efficient code

    - by Todd Williamson
    TL;DR: Quick and dirty code, or "correct" (insert your definition of this term) code? There is often a tension between "efficient" and "effective" in software development. "Efficient" often means code that is "correct" from the point of view of adhering to standards, using widely-accepted patterns/approaches for structures, regardless of project size, budget, etc. "Effective" is not about being "right", but about getting things done. This often results in code that falls outside the bounds of commonly accepted "correct" standards, usage, etc. Usually the people paying for the development effort have dictated ahead of time what it is that they value more. An organization that lives in a technical space will tend towards the efficient end, others will tend towards the effective. Developers often refuse to compromise their favored approach for the other. In my own experience I have found that people with formal education in software development tend towards the Efficient camp. Those that picked up software development more or less as a tool to get things done tend towards the Effective camp. These camps don't get along very well. When managing a team of developers who are not all in one camp it is challenging. In your own experience, which camp do you land in, and do you find yourself having to justify your approach to others? To management? To other developers?

    Read the article

  • Best book for learning C++? [closed]

    - by gablin
    Possible Duplicate: Is there a good book to grok C++? I'm lacking a good book for learning C++. Although I'm not an entirely novice, I've learnt C++ mostly by trail-and-error and googling so I don't know all about best practices concerning C++. So what book or books should I get and read? Please only put 1 book per answer, for voting purposes, and maybe a short description of who it's targeted at. Hey, what happened to the community wiki option...?

    Read the article

  • Are Java's public fields just a tragic historical design flaw at this point?

    - by Avi Flax
    It seems to be Java orthodoxy at this point that one should basically never use public fields for object state. (I don't necessarily agree, but that's not relevant to my question.) Given that, would it be right to say that from where we are today, it's clear that Java's public fields were a mistake/flaw of the language design? Or is there a rational argument that they're a useful and important part of the language, even today? Thanks! Update: I know about the more elegant approaches, such as in C#, Python, Groovy, etc. I'm not directly looking for those examples. I'm really just wondering if there's still someone deep in a bunker, muttering about how wonderful public fields really are, and how the masses are all just sheep, etc. Update 2: Clearly static final public fields are the standard way to create public constants. I was referring more to using public fields for object state (even immutable state). I'm thinking that it does seem like a design flaw that one should use public fields for constants, but not for state… a language's rules should be enforced naturally, by syntax, not by guidelines.

    Read the article

  • What is the next promotion for a scrum master

    - by gnebar
    I'm currently a scrum master. I have been offered a promotion to a role that will allow me to have a wider impact. (more involved in company wide architectural decisions, possible secondment to kick start major projects, etc). The role and title of the job has yet to be decided but my company are open to guidance from me. I'm happy I can mould the role to suit me and the company but I'm unsure about the job title that fits this role. Technical Evangelist has been suggested but i'm not sure that is the correct title. I'm keen to proceed down the technical route. What would you suggest? What other roles do people take after scrum master/technical lead? EDIT: (I am aware that my current role is a mix of a technical lead and scrum master role, but that's how we do it in my company :) )

    Read the article

  • ubiquity "hangs" on first step

    - by bumbling fool
    Trying to install 11.04 daily for the last couple days but, no matter what I try (wifi connected, wifi not connected, disk blank, disk prepartitioned...), if just "hangs" at the first window (pick your language) with a non-stop hourglass after hitting next. I ran into a different issue when trying to use the alternate installer image. This is on a Stinkpad T42. Should ubiquity at least tell me whats going on?!? I tried to find a log but /var/log/installer* isn't present.

    Read the article

  • Configuring ethernet network

    - by den-javamaniac
    Hi. I've got a wired network connection and if I'm using network manager (hereafter "NM") everything works fine except for the hardware address (it doesn't change). I'm thinking of using /etc/network/interfaces. So, I added some code and it looks like this: auto lo iface lo inet loopback auto eth1 iface eth1 inet static address #corresponding value netmask #corresponding value gateway #corresponding value hwaddress #corresponding value After restarting networking I get the following message: *Reconfiguring network interfaces... #here some help code appears Failed to bring up eth1. The default interface that works with NM is eth0. Please advise on how to handle the problem.

    Read the article

  • Video Freezes Every few seconds

    - by Chandan
    Hi, I have problems playing videos on my Ubuntu 10.10 machine. The video FREEZES every 20-25 seconds, while I could still hear the audio. I use Totem Movie Player (GStreamer) & have nVidia on-board graphics card & AMD DualCore processor. After some 5-10 seconds, the videos resumes skipping the hung portion. But, I can hear the audio of that part! I've tried it with SMPlayer (GUI), VLC & Kaffeine. But, the same problem... I recently uninstalled the nVidia drivers and since then, not even for a second, no video hung! So, I thought its the problem with the proprietary nVidia drivers. But, since its uninstalled, I'm not able to get the desired desktop resolution & effects. So, is there any way I can work it out?

    Read the article

  • Record 8 separate Line IN Channels from M-Audio Delta 1010 Card

    - by Peter Hoffmann
    I want to record the 8 separate Line IN Channels from my M-Audio Delta 1010 Card. The card is recogniced nicely and a can record a single channel via arecord -d 10 -f cd -t wav -D channel1 out2.wav. I've set up the different channels in ~/.asoundrc. Now if I want to record a second channel in parallel (arecord -d 10 -f cd -t wav -D channel2 out2.wav) I get the error arecord: main:564: audio open error: Device or resource busy As I understand the delta 1010 is a single Access Card, so only one application can access it at a time. Is this correct? The next step was to configure a dual channel input in .asoundrc # envy24 channel 1+2 only pcm.test { type plug ttable.0.0 1 ttable.0.1 1 slave.pcm ice1712 } Which works ok when I do a arecord -d 10 -f cd -t wav -D test -c 2 out.wav (BTW can anyone point me to a tool to split a multi channel wav into a file per channel?) But when I want to record the channels separately with (-I option) arecord -d 10 -f cd -t wav -D test -c 2 -I channel1.wav channel2.wav I get no recordings. Did I miss something with the configuration or what are my options to record all 8 channels via arecord. I've no experience with jackd. Is it an option to install jackd and record the line ins via jackd?

    Read the article

  • Nothing happens when I connect my Iphone 3G to my laptop

    - by Allwar
    Hi, how do i connect my iphone to my laptop (ubuntu 10.04) so that i can sync music and be able to look at it as a usb stick? (this is what I want to do but there is a problem.) When i connect it to my laptop nothing happens, it doesn't show up as an ikon or as a mass storage device. My Iphone runs 4.2.1 it's an Iphone 3G and it's not jailbroken for the moment, is that a problem? My laptop is an Asus 1201n ubuntu 10.04 (64-bits) Bus 002 Device 005: ID 05ac:1292 Apple, Inc. iPhone 3G I connected my Ipod Video (30 gb) and that one doesn't appear as well So I'm kind of stuck now. The problem probably lies in the system, because the usb port is working. Bus 002 Device 006: ID 05ac:1209 Apple, Inc. iPod Video I have added this PPA, I have done all of the sudo update and upgrade. but my computer doesn't realize that my Iphone is connected, whish isn't related to libimobiledevice. The port is working fine, it's my computer it doesn't recognize that I have my Iphone plugged-in! and the phone is working (tested it on my mac). I have the latest versions of these programs: hipo, ipod, gtkpod, ifuse, libusmuxd1 and usbmxd. I try to mount my iphone with fuse but i got this error. ( I connected my iPhone in windows 7 and it worked annoyingly.) alvar@alvars-laptop:~$ ifuse /mnt/iphone/ ERROR: the mount point specified does not exist

    Read the article

  • How to play .mp4 movies?

    - by Andrew
    I have a .mp4 movie (it's an .mp4 file, and the "video codec" is Xvid, and the "audio codec" is mp3) that I want to play, but when I try to open it in MPlayer, it says "The steam is encrypted and decryption is not supported." I tried to apply the answer from this question and this wiki page, but neither worked. Any suggestions? The file came from an [apparently] less than reputable site, which I guess I can't link to. :( I've tried: sudo apt-get install ubuntu-restricted-extras sudo apt-get install libdvdread4 sudo /usr/share/doc/libdvdread4/install-css.sh sudo apt-get install gstreamer0.10-ffmpeg sudo apt-get install w64codecs sudo apt-get update

    Read the article

  • How do I correctly group albums in Banshee?

    - by Kevin
    I use Banshee to manage & play my music (most of which came from emusic and CDs). I consistently have problems getting songs from the same album to appear as one album. This is particularly a problem with compilations, i.e. multiple artists on the same album. When I transfer songs to my Android phone (Nexus S), this issue follows. How do I edit files so that Banshee correctly identifies all the songs as belonging to the same album? I am using the latest Banshee via the unstable PPA.

    Read the article

  • Redirecting a CSS file based on .htaccess rules.

    - by Anthony Hiscox
    I'm trying to hack the css files on OSTicket by replacing them with my own custom ones when a specific URL is accessed. The URL that is accessed for this example is http://osticket.cts/helpdesk/scp/css/main.css and I would like it to use the css file at http://osticket.cts/test.css why won't this .htaccess file (in web root, not /helpdesk/scp/) work? Is there an easy way to debug these rules, some way to find out what apache did when the URL was accessed and where it's failing? error.log doesn't show anything useful. RewriteEngine On RewriteCond %{HTTP_HOST} ^osticket\.cts$ [NC] RewriteRule ^(.*)main\.css$ /test.css [NC, L]

    Read the article

  • htaccess execution order and priority

    - by ChrisRamakers
    Can anyone explain to me in what order apache executes .htaccess files residing in different levels of the same path and how the rewrite rules therein are prioritized? For example, why doesn't the rewrite rule in the first .htaccess below work and is the one in /blog prioritized? .htaccess in / RewriteEngine on RewriteBase / RewriteRule ^blog offline.html [L] .htaccess in /blog RewriteEngine On RewriteBase /blog/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.php [L] Ps: i'm not simply looking for an answer but for a way to understand the apache/modrewrite internals ... why is more important to me than how to fix this :) Thanks!

    Read the article

  • Magento Checkout options

    - by graham barnes
    Hi I want to add some options to my magento, lets say i print on clothing, a customer buys some t-shirts, shirts and jackets from me, it totals to £60+ VAT on the checkout area where i signup and not before I need to add an option where I can add a text box and upload option, can i do this? I ideally then want to add some pricing options if the user has chosen to add some branding to a product or multiple products e.g. if the branding was on the top right of the shirt it will cost £5.00, if on the back it costs £7.00 etc all if possible to be done via the admincp. I also want an option so when they upload their logo for the first time they are charged a one off charge, like a setup fee but If the customer has allready sent in there logo then no charge applies. thanks Graham

    Read the article

  • Do print and bookmark links really work?

    - by Joseph Mastey
    It seems to be common on the web to provide users with some visual element on the page to either print or bookmark a page. This is all well and good (and probably doesn't hurt for the most part), but I question its effectiveness at causing the intended behavior. Is there any evidence to suggest that this causes an increase in bookmarking/printing behavior? Similarly, is there any evidence that users will use this method rather than the browser's default interface for the functions? I am really looking for user research with actual results, rather than anecdotes to answer this question. Thanks, Joseph Mastey

    Read the article

  • .htaccess: Redirect Hotlink Flash --> Site with embed Flash

    - by user5571
    Hello, I have some .php sites that embeds .swf files. These .swf files are now linked to by some other guys. And I don't want them to simply open the SWF, I want them to force being redirect to the page where the flash is embed. Data: Site: www.example.com/1 (www.example.com/2, www.example.com/3 and so on) Flash: www.example.com/flash/flash_NUMBER.swf So for www.example.com/1: Site: www.example.com/1 Flash: www.example.com/flash/flash_1.swf I now want to redirect the user who types "www.example.com/flash/flash_1.swf" into his URL to be redirect to www.example.com/1. The Problem I have that the flash needs to be still accesseable via www.example.com/1 <-- I don't get that working (the Flash is embed into that page). The tool I would like to use for this is the .htaccess & RewriteRule. I hope someone can help me out.

    Read the article

  • Need some help on tomcat URL mod_rewrite or mod_jk

    - by Redbull Fan
    I am trying to remove the context name from the url of my server. Current URL - http://www.domainname.com/MyApp/ What I need to make is to make it avaialble at - www.domainname.com/ So it is only going to host one main app and that needs to be displayed when we open www.domainname.com/ on browser. I have already tried couple of things like below - RewriteEngine On RewriteCond %{REQUEST_URI} !^/(Context/.*)$ RewriteRule ^/(.*)$ /Context/$1 [P,L] OR redirect permanent /MyApp/ abcd://domainname.com OR Using JKMount - JkMount /MyApp/* ajp13 JkMount /MyApp* ajp13 OR Deploy war file to ROOT of tomcat and make relevant chagnes in web and server.xml All of these aren't working and I keep getting a intenal error. I need a way to basically trim the tomcat URL to make short. Thanks, Andy

    Read the article

  • Virtual hosting

    - by H3llGhost
    Hello, I want to use domains like xxx.abc.domain.tld. The xxx is my folder to access. I tried it with the rewrite rules, but I can't get it working, because I don't know how to get the part xxx from the SERVER_NAME into my RewriteRule. This was my try: UseCanonicalName Off # include the IP address in the logs so they may be split LogFormat "%A %h %l %u %t \"%r\" %s %b" vcommon CustomLog /var/log/apache2/vaccess.log vcommon RewriteEngine On # a ServerName derived from a Host: header may be any case at all RewriteMap lowercase int:tolower ## deal with normal documents first: # do the magic RewriteCond ${lowercase:%{SERVER_NAME}} ^.+\.abc\.domain\.tld$ RewriteRule ^(.*)$ /var/www/abc.domain.tld/[xxx-part]/$1 [L] Perhaps there is a better solution. In generally I want to create a dynamic login system with mod_auth_mysql and for each xxx is a seperate user database. I would prefer the domain/address syntax abc.domain.tld/xxx, but I don't know how to realize it. Thanks for any advices.

    Read the article

< Previous Page | 6 7 8 9 10 11 12  | Next Page >