Search Results

Search found 11 results on 1 pages for 'mikkel'.

Page 1/1 | 1 

  • xmonad keyboard doesn't work

    - by Mikkel Paulson
    I'm experimenting with xmonad, which I installed from the Ubuntu Software Centre on Ubuntu 12.10. It looks cool, but when I invoke it (using xmonad --replace from the command line) my title bars disappear and my keyboard stops working. At all. The terminal stops working, the keystrokes I've seen in online "getting started" guides are ignored, and the only way for me to actually power the system off is to hit the reset button or ssh in from my phone. Ironically, my mouse still works. One guide I saw suggested replacing the default window environment with xmonad, but I'm afraid of rendering my system completely inoperable if I do that. Any suggestions?

    Read the article

  • Use jQuery to find and add an image tooltip

    - by lund.mikkel
    Hey people Okay, what I'm trying to accomplish is a simple tool tip that, when you hover over the name of a color, shows a little image of that color. The html markup looks like this: <label class="colorPicker"> <input type="radio" checked="" id="20" value="20" name="id[2]"> <img width="16" height="16" title=" DinoBlack Mat " alt="DinoBlack Mat" src="images/attributes/color/dinoblack_mat.jpg">DinoBlack Mat </label> <label class="colorPicker"> <input type="radio" id="874" value="874" name="id[2]"> <img width="16" height="16" title="XrayBlue shiny" alt="XrayBlue shiny" src="images/attributes/color/xrayblue_shiny.jpg">XrayBlue shiny </label> I'm using the jQuery plugin "Tooltip" and I've added following to my main js-file: $('.colorPicker').tooltip({ track: true, delay: 0, showURL: false, fade: 250, bodyHandler: function() { return $("<img/>").attr("src", [THE SOURCE FOR THE IMAGE]); } }); The idea is simply that the image should be hidden by default. But when you hover over the text the little thumbnail shows up and makes it easy to recognize the color. The problem is I haven't got a clue how to get the src for the thumbnail. I don't know how to extract the src from the img inside the selected element. I've tried various combinations using the this keyword, but nothing seemed to work. I've also tried to add the src path as a rel attribute to the label, but also without any success. Should be needless to say I also control the PHP-output... I really hope you can help me. I've search the web for days without any luck. I'm getting desperate :D /Mikkel Lund

    Read the article

  • Advanced SQL query with lots of joins

    - by lund.mikkel
    Hey fellow programmers Okay, first let me say that this is a hard one. I know the presentation may be a little long. But I how you'll bare with me and help me through anyway :D So I'm developing on an advanced search for bicycles. I've got a lot of tables I need to join to find all, let's say, red and brown bikes. One bike may come in more then one color! I've made this query for now: SELECT DISTINCT p.products_id, #simple product id products_name, #product name products_attributes_id, #color id pov.products_options_values_name #color name FROM products p LEFT JOIN products_description pd ON p.products_id = pd.products_id INNER JOIN products_attributes pa ON pa.products_id = p.products_id LEFT JOIN products_options_values pov ON pov.products_options_values_id = pa.options_values_id LEFT JOIN products_options_search pos ON pov.products_options_values_id = pos.products_options_values_id WHERE pos.products_options_search_id = 4 #code for red OR pos.products_options_search_id = 5 #code for brown My first concern is the many joins. The Products table mainly holds product id and it's image and the Products Description table holds more descriptive info such as name (and product ID of course). I then have the Products Options Values table which holds all the colors and their IDs. Products Options Search is containing the color IDs along with a color group ID (products_options_search_id). Red has the color group code 4 (brown is 5). The products and colors have a many-to-many relationship managed inside Products Attributes. So my question is first of all: Is it okay to make so many joins? Is i hurting the performance? Second: If a bike comes in both red and brown, it'll show up twice even though I use SELECT DISTINCT. Think this is because of the INNER JOIN. Is this possible to avoid and do I have to remove the doubles in my PHP code? Third: Bikes can be double colored (i.e. black and blue). This means that there are two rows for that bike. One where it says the color is black and one where is says its blue. (See second question). But if I replace the OR in the WHERE clause it removes both rows, because none of them fulfill the conditions - only the product. What is the workaround for that? I really hope you will and can help me. I'm a little desperate right now :D Regards Mikkel Lund

    Read the article

  • curl http_code of 000

    - by Mikkel Paulson
    I have a shell script that I use to monitor loading times and response codes on my live server cluster. It runs a total of 250 iterations every 5 minutes, distributed across 10 servers and 6 sites. It uses curl with the -w flag to return pertinent information which is then parsed by my shell script: curl -svw 'monitor_load_times %{time_total} %{http_code}' -b 'server=$server' -m 15 -o /dev/null $url 2>&1 This information is then parsed by a graphing script that can display a number of different responses. However, curl will occasionally return a response code of "000". When this happens, it seems to happen multiple times at once despite being distributed over many iterations: What I'm trying to work out is if this is a client-side issue that's skewing my results or if it's actually indicative of a server-side problem affecting my entire cluster. Does 000 mean that the connection was dropped? Database entries corresponding to curl iterations with that response code return "0.000" for the time_total value. All of the search results I've found for curl returning a code of 000 are related to HTTPS being unsupported, but all of my test URLs are HTTP. (The spike in 500 errors is a completely unrelated issue that affected my servers last night.)

    Read the article

  • Wildcard subdomain to file htaccess

    - by Mikkel Larson
    I've have a problem with a htaccess wildcard redirect My base configuration is set to work with: www.domain.com and domain.com this is governed by 2 .htaccess files: 1: /home/DOMAIN/public_html/.htaccess AddDefaultCharset utf-8 RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?festen.dk$ RewriteCond %{REQUEST_URI} !^/public/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /public/$1 RewriteCond %{HTTP_HOST} ^(www.)?festen.dk$ RewriteRule ^(/)?$ public/index.php [L] 2: /home/DOMAIN/public_html/public/.htaccess AddDefaultCharset utf-8 <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine On </IfModule> <IfModule mod_rewrite.c> RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> Now i want to redirect: www.[SUBDOMAIN].domain.com/[PATH] and [SUBDOMAIN].domain.com/[PATH] to public/index.php/subdomaincontroller/realsubdomain/[PATH] My solution so far: Added following to 2: /home/DOMAIN/public_html/public/.htaccess <IfModule mod_rewrite.c> RewriteCond %{HTTP_HOST} !www.domain.com$ [NC] RewriteCond %{HTTP_HOST} ^(www.)?([a-z0-9-]+)domain.com [NC] RewriteRule (.*) subdomaincontroller/realsubdomain/%2/$1 [L] </IfModule> Sadly this dows not work. Can anyone help me please?

    Read the article

  • btrfs won't run from cron

    - by Mikkel
    I'm trying to set up a cron job to create a btrfs subvolume snapshot of my root partition. The command works perfectly if I run it from the command line, but nothing happens at the scheduled cron time. I've tried piping to logger and redirecting stdout/stderr to file, and not only is there no content, the file I'm logging to isn't even created. The cron command I have is as follows: 0 0 * * * /sbin/btrfs subvolume snapshot / "/snapshots/$(date +%Y-%m-%d)" I've tried prefixing it with /bin/bash, but that makes no difference. What am I missing?

    Read the article

  • Exclude a file in a filematch

    - by lund.mikkel
    Hey folks I'm trying to prepend a gzip script at the beginning of every file using php_value auto_prepend_file gzip_start.php in my .htaccess. The problem is that I've already got a document called combine.php that gzips it contents. What I need to know is, how I can exclude combine.php from the files who get the gzip prepended. I thought about using filesmatch, but can only figure out how to do it on just that one file, and not the exact opposite. Any ideas?

    Read the article

  • how to make Xcode indentation from beginning of previous line?

    - by Mikkel
    ok, possibly insanely n00b question or something i have overlooked in Xcode prefs: On pressing return, in stead of Xcode's syntax-aware indentation doing smart indent from whatever brackets i've used on the previous line, how can I make it so Xcode indents just from the beginning of the previous line? From the picture below, first block of code is what i got, second block of code is what I want. Visual representation:

    Read the article

  • logging in continouous loop

    - by Mikkel Jans
    What would be a good way to create logs (with python logging module) inside a constant running loop, without producing a large amount of useless log-files? An example would be a loop that constant list a folder, and does some action when it sees a file of a specific type. I want to log that no files were found, or files were found but of a wrong type, without logging that same line constantly for each folder check, as it might run many times a second.

    Read the article

  • OSX: Howto start VirtualBox VM on startup?

    - by snies
    The Question How do i start this Wiki VM at the startup of the OSX Server? I am running OSX Server 10.6.8 and VirtualBox 4.1.8 r75467 and a Debian Linux VM (called "wiki"). . What I tried so far Following this article: http://mikkel.hoegh.org/blog/2010/12/23/run-virtualbox-boot-mac-os-x/, i have wrote this plist and placed it in /Library/LaunchDaemons/bar.foo.WikiVirtualBox.plist: <plist version="1.0"> <dict> <key>Label</key> <string>bar.foo.WikiVirtualBox</string> <key>ProgramArguments</key> <array> <string>/usr/bin/VBoxHeadless</string> <string>-s</string> <string>wiki</string> </array> <key>RunAtLoad</key> <true></true> <key>UserName</key> <string>root</string> <key>WorkingDirectory</key> <string>/var/root</string> <key>StandardErrorPath</key> <string>/var/log/bar.foo.WikiVirtualBox.stderr.log</string> <key>StandardOutPath</key> <string>/var/log/bar.foo.WikiVirtualBox.stdout.log</string> </dict> </plist> and told launchd to start it: sudo launchctl load -w /Library/LaunchDaemons/bar.foo.WikiVirtualBox.plist . The Logfile But the VM doesn't start. A Look at tail -f /var/log/system.log shows: sudo[1909]: administrator : TTY=ttys000 ; PWD=/Users/administrator ; USER=root ; COMMAND=/bin/launchctl load -w /Library/LaunchDaemons/bar.foo.WikiVirtualBox.plist VBoxSVC[1914]: 3891612: (connectAndCheck) Untrusted apps are not allowed to connect to or launch Window Server before login. VBoxSVC[1914]: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged. com.apple.launchd[1] (bar.foo.WikiVirtualBox[1910]): Exited with exit code: 1 When i log into the server via ssh (so no login window opened) i can run: /usr/bin/VBoxHeadless -s wiki and it works. So i don't understand the error above.

    Read the article

  • VS 2012 Code Review &ndash; Before Check In OR After Check In?

    - by Tarun Arora
    “Is Code Review Important and Effective?” There is a consensus across the industry that code review is an effective and practical way to collar code inconsistency and possible defects early in the software development life cycle. Among others some of the advantages of code reviews are, Bugs are found faster Forces developers to write readable code (code that can be read without explanation or introduction!) Optimization methods/tricks/productive programs spread faster Programmers as specialists "evolve" faster It's fun “Code review is systematic examination (often known as peer review) of computer source code. It is intended to find and fix mistakes overlooked in the initial development phase, improving both the overall quality of software and the developers' skills. Reviews are done in various forms such as pair programming, informal walkthroughs, and formal inspections.” Wikipedia No where does the definition mention whether its better to review code before the code has been committed to version control or after the commit has been performed. No matter which side you favour, Visual Studio 2012 allows you to request for a code review both before check in and also request for a review after check in. Let’s weigh the pros and cons of the approaches independently. Code Review Before Check In or Code Review After Check In? Approach 1 – Code Review before Check in Developer completes the code and feels the code quality is appropriate for check in to TFS. The developer raises a code review request to have a second pair of eyes validate if the code abides to the recommended best practices, will not result in any defects due to common coding mistakes and whether any optimizations can be made to improve the code quality.                                             Image 1 – code review before check in Pros Everything that gets committed to source control is reviewed. Minimizes the chances of smelly code making its way into the code base. Decreases the cost of fixing bugs, remember, the earlier you find them, the lesser the pain in fixing them. Cons Development Code Freeze – Since the changes aren’t in the source control yet. Further development can only be done off-line. The changes have not been through a CI build, hard to say whether the code abides to all build quality standards. Inconsistent! Cumbersome to track the actual code review process.  Not every change to the code base is worth reviewing, a lot of effort is invested for very little gain. Approach 2 – Code Review after Check in Developer checks in, random code reviews are performed on the checked in code.                                                      Image 2 – Code review after check in Pros The code has already passed the CI build and run through any code analysis plug ins you may have running on the build server. Instruct the developer to ensure ZERO fx cop, style cop and static code analysis before check in. Code is cleaner and smell free even before the code review. No Offline development, developers can continue to develop against the source control. Cons Bad code can easily make its way into the code base. Since the review take place much later in the cycle, the cost of fixing issues can prove to be much higher. Approach 3 – Hybrid Approach The community advocates a more hybrid approach, a blend of tooling and human accountability quotient.                                                               Image 3 – Hybrid Approach 1. Code review high impact check ins. It is not possible to review everything, by setting up code review check in policies you can end up slowing your team. More over, the code that you are reviewing before check in hasn't even been through a green CI build either. 2. Tooling. Let the tooling work for you. By running static analysis, fx cop, style cop and other plug ins on the build agent, you can identify the real issues that in my opinion can't possibly be identified using human reviews. Configure the tooling to report back top 10 issues every day. Mandate the manual code review of individuals who keep making it to this list of shame more often. 3. During Merge. I would prefer eliminating some of the other code issues during merge from Main branch to the release branch. In a scrum project this is still easier because cheery picking the merges is a possibility and the size of code being reviewed is still limited. Let the tooling work for you, if some one breaks the CI build often, put them on a gated check in build course until you see improvement. If some one appears on the top 10 list of shame generated via the build then ensure that all their code is reviewed till you see improvement. At the end of the day, the goal is to ensure that the code being delivered is top quality. By enforcing a code review before any check in, you force the developer to work offline or stay put till the review is complete. What do the experts say? So I asked a few expects what they thought of “Code Review quality gate before Checking in code?" Terje Sandstrom | Microsoft ALM MVP You mean a review quality gate BEFORE checking in code????? That would mean a lot of code staying either local or in shelvesets, and not even been through a CI build, and a green CI build being the main criteria for going further, f.e. to the review state. I would not like code laying around with no checkin’s. Having a requirement that code is checked in small pieces, 4-8 hours work max, and AT LEAST daily checkins, a manual code review comes second down the lane. I would expect review quality gates to happen before merging back to main, or before merging to release.  But that would all be on checked-in code.  Branching is absolutely one way to ease the pain.   Another way we are using is automatic quality builds, running metrics, coverage, static code analysis.  Unfortunately it takes some time, would be great to be on CI’s – but…., so it’s done scheduled every night. Based on this we get, among other stuff,  top 10 lists of suspicious code, which is then subjected to reviews.  If a person seems to be very popular on these top 10 lists, we subject every check in from that person to a review for a period. That normally helps.   None of the clients I have can afford to have every checkin reviewed, so we need to find ways around it. I don’t disagree with the nicety of having all the code reviewed, but I find it hard to find those resources in today’s enterprises. David V. Corbin | Visual Studio ALM Ranger I tend to agree with both sides. I hate having code that is not checked in, but at the same time hate having “bad” code in the repository. I have found that branching is one approach to solving this dilemma. Code is checked into the private/feature branch before the review, but is not merged over to the “official” branch until after the review. I advocate both, depending on circumstance (especially team dynamics)   - The “pre-checkin” is usually for elements that may impact the project as a whole. Think of it as another “gate” along with passing unit tests. - The “post-checkin” may very well not be at the changeset level, but correlates to a review at the “user story” level.   Again, this depends on team dynamics in play…. Robert MacLean | Microsoft ALM MVP I do not think there is no right answer for the industry as a whole. In short the question is why do you do reviews? Your question implies risk mitigation, so in low risk areas you can get away with it after check in while in high risk you need to do it before check in. An example is those new to a team or juniors need it much earlier (maybe that is before checkin, maybe that is soon after) than seniors who have shipped twenty sprints on the team. Abhimanyu Singhal | Visual Studio ALM Ranger Depends on per scenario basis. We recommend post check-in reviews when: 1. We don't want to block other checks and processes on manual code reviews. Manual reviews take time, and some pieces may not require manual reviews at all. 2. We need to trace all changes and track history. 3. We have a code promotion strategy/process in place. For risk mitigation, post checkin code can be promoted to Accepted branches. Or can be rejected. Pre Checkin Reviews are used when 1. There is a high risk factor associated 2. Reviewers are generally (most of times) have immediate availability. 3. Team does not have strict tracking needs. Simply speaking, no single process fits all scenarios. You need to select what works best for your team/project. Thomas Schissler | Visual Studio ALM Ranger This is an interesting discussion, I’m right now discussing details about executing code reviews with my teams. I see and understand the aspects you brought in, but there is another side as well, I’d like to point out. 1.) If you do reviews per check in this is not very practical as a hard rule because this will disturb the flow of the team very often or it will lead to reduce the checkin frequency of the devs which I would not accept. 2.) If you do later reviews, for example if you review PBIs, it is not easy to find out which code you should review. Either you review all changesets associate with the PBI, but then you might review code which has been changed with a later checkin and the dev maybe has already fixed the issue. Or you review the diff of the latest changeset of the PBI with the first but then you might also review changes of other PBIs. Jakob Leander | Sr. Director, Avanade In my experience, manual code review: 1. Does not get done and at the very least does not get redone after changes (regardless of intentions at start of project) 2. When a project actually do it, they often do not do it right away = errors pile up 3. Requires a lot of time discussing/defining the standard and for the team to learn it However code review is very important since e.g. even small memory leaks in a high volume web solution have big consequences In the last years I have advocated following approach for code review - Architects up front do “at least one best practice example” of each type of component and tell the team. Copy from this one. This should include error handling, logging, security etc. - Dev lead on project continuously browse code to validate that the best practices are used. Especially that patterns etc. are not broken. You can do this formally after each sprint/iteration if you want. Once this is validated it is unlikely to “go bad” even during later code changes Agree with customer to rely on static code analysis from Visual Studio as the one and only coding standard. This has HUUGE benefits - You can easily tweak to reach the level you desire together with customer - It is easy to measure for both developers/management - It is 100% consistent across code base - It gets validated all the time so you never end up getting hammered by a customer review in the end - It is easy to tell the developer that you do not want code back unless it has zero errors = minimize communication You need to track this at least during nightly builds and make sure team sees total # issues. Do not allow #issues it to grow uncontrolled. On the project I run I require code analysis to have run on code before checkin (checkin rule). This means -  You have to have clean compile (or CA wont run) so this is extra benefit = very few broken builds - You can change a few of the rules to compile as errors instead of warnings. I often do this for “missing dispose” issues which you REALLY do not want in your app Tip: Place your custom CA rules files as part of solution. That  way it works when you do branching etc. (path to CA file is relative in VS) Some may argue that CA is not as good as manual inspection. But since manual inspection in reality suffers from the 3 issues in start it is IMO a MUCH better (and much cheaper) approach from helicopter perspective Tirthankar Dutta | Director, Avanade I think code review should be run both before and after check ins. There are some code metrics that are meant to be run on the entire codebase … Also, especially on multi-site projects, one should strive to architect in a way that lets men manage the framework while boys write the repetitive code… scales very well with the need to review less by containment and imposing architectural restrictions to emphasise the design. Bruno Capuano | Microsoft ALM MVP For code reviews (means peer reviews) in distributed team I use http://www.vsanywhere.com/default.aspx  David Jobling | Global Sr. Director, Avanade Peer review is the only way to scale and its a great practice for all in the team to learn to perform and accept. In my experience you soon learn who's code to watch more than others and tune the attention. Mikkel Toudal Kristiansen | Manager, Avanade If you have several branches in your code base, you will need to merge often. This requires manual merging, when a file has been changed in both branches. It offers a good opportunity to actually review to changed code. So my advice is: Merging between branches should be done as often as possible, it should be done by a senior developer, and he/she should perform a full code review of the code being merged. As for detecting architectural smells and code smells creeping into the code base, one really good third party tools exist: Ndepend (http://www.ndepend.com/, for static code analysis of the current state of the code base). You could also consider adding StyleCop to the solution. Jesse Houwing | Visual Studio ALM Ranger I gave a presentation on this subject on the TechDays conference in NL last year. See my presentation and slides here (talk in Dutch, but English presentation): http://blog.jessehouwing.nl/2012/03/did-you-miss-my-techdaysnl-talk-on-code.html  I’d like to add a few more points: - Before/After checking is mostly a trust issue. If you have a team that does diligent peer reviews and regularly talk/sit together or peer review, there’s no need to enforce a before-checkin policy. The peer peer-programming and regular feedback during development can take care of most of the review requirements as long as the team isn’t under stress. - Under stress, enforce pre-checkin reviews, it might sound strange, if you’re already under time or budgetary constraints, but it is under such conditions most real issues start to be created or pile up. - Use tools to catch most common errors, Code Analysis/FxCop was already mentioned. HP Fortify, Resharper, Coderush etc can help you there. There are also a lot of 3rd party rules you can add to Code Analysis. I’ve written a few myself (http://fccopcontrib.codeplex.com) and various teams from Microsoft have added their own rules (MSOCAF for SharePoint, WSSF for WCF). For common errors that keep cropping up, see if you can define a rule. It’s much easier. But more importantly make sure you have a good help page explaining *WHY* it's wrong. If you have small feature or developer branches/shelvesets, you might want to review pre-merge. It’s still better to do peer reviews and peer programming, but the most important thing is that bad quality code doesn’t make it into the important branch. So my philosophy: - Use tooling as much as possible. - Make sure the team understands the tooling and the importance of the things it flags. It’s too easy to just click suppress all to ignore the warnings. - Under stress, tighten process, it’s under stress that the problems of late reviews will really surface - Most importantly if you do reviews do them as early as possible, but never later than needed. In other words, pre-checkin/post checking doesn’t really matter, as long as the review is done before the code is released. It’ll just be much more expensive to fix any review outcomes the later you find them. --- I would love to hear what you think!

    Read the article

1