Search Results

Search found 58 results on 3 pages for 'argh'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • How do I fix incorrect inline Javascript indentation in Vim?

    - by Charles Roper
    I can't seem to get inline Javascript indenting properly in Vim. Consider the following: $(document).ready(function() { // Closing brace correctly indented $("input").focus(function() { $(this).closest("li").addClass("cur-focus"); }); // <-- I had to manually unindent this // Closing brace incorrectly indented $("input").blur(function() { $(this).closest("li").removeClass("cur-focus"); }); // <-- This is what it does by default. Argh! }); Vim seems to insist on automatically indenting the closing brace shown in the second case there. It does the same if I re-indent the whole file. How do I get it to automatically indent using the more standard JS indenting style seen in the first case?

    Read the article

  • Liquid templates - accessing members by name

    - by egarcia
    I'm using Jekyll to create a new blog. It uses Liquid underneath. Jekyll defines certain "variables": site, content, page, post and paginator. These "variables" have several "members". For instance, post.date will return the date of a post, while post.url will return its url. My question is: can I access a variable's member using another variable as the member name? See the following example: {% if my_condition %} {% assign name = 'date' %} {% else %} {% assign name = 'url' %} {% endif %} I have a variable called name which is either 'date' or 'url'. How can I make the liquid equivalent of post[name] in ruby? The only way I've found is using a for loop to iterate over all the pairs (key-value) of post. Beware! It is quite horrible: {% for property in post %} {% if property[0] == name %} {{ property[1] }} {% endif %} {% endfor %} Argh! I hope there is a better way. Thanks.

    Read the article

  • How to determine OS Platform with WMI?

    - by cary.wagner
    I am trying to figure out if there is a location in WMI that will return the OS Architecture (i.e. 32-bit or 64-bit) that will work across "all" versions of Windows. I thought I had figured it out looking at my Win2k8 system when I found the following: Win32_OperatingSystem / OSArchitecture I was wrong. It doesn't appear that this field exists on Win2k3 systems. Argh! So, is anyone aware of another field in WMI that "is" the same across server versions? If not, what about a registry key that is the same? I am using a tool that only allows me to configure simple field queries, so I cannot use a complex script to perform. Any help would be greatly appreciated! Cheers... Cary

    Read the article

  • Include Problem with Objective-C++ and OpenGL

    - by Stephen Furlani
    Hello, I feel silly asking this but I've searched for 'include problems' and have only come up with basic stuff. I'm working with an API that includes/imports in their header files (ARGH! HATE ANGER DESTRUCTION). One of these Obj-C files #import "OpenGL/CGLMacros.h" which #define's things like glMatrixMode(...); In my code I need the glMatrixMode(...); from #include "OpenGL/gl.h" but it won't access it! I can't edit the headers from the (poorly) coded API to put the includes in their definition files. What can I do? If the CGLMacros.h file starts out like /* Copyright: (c) 1999 by Apple Computer, Inc., all rights reserved. */ #ifndef _CGLMACRO_H #define _CGLMACRO_H Can I put a #define _CGLMACRO_H before I include the offending API header file? -Stephen

    Read the article

  • How to limit a google calendar xml / rss feed by date range (not working!!)

    - by Phil
    For the life of me I cannot get my google calendar xml feed to only display events within a certain date range. I know that start-min and start-max are supposed to limit the output (according to these posts: (links to posts deleted because I am a newbie and can only post one hyperlink argh) BUT I CAN'T GET IT TO WORK. It keeps showing lot of things outside the range. I created a sample calendar and made it public. It is some events the first week of april. Can anyone show me how to construct a request that only returns those three events from the first week in april? I'll GLADLY and GRATEFULLY paypal $10 to anyone who helps me break through on this. Here is the calendar's public feed: http://www.google.com/calendar/feeds/66m31c36sj9u5k8kekrvt2lpr8%40group.calendar.google.com/public/basic

    Read the article

  • Eclipse: How to add an existing source folder?

    - by evilfred
    ARGH Eclipse is SO frustrating I have a directory called c:\RemoteSrc . Under this there are 3 directories which are currently source folders (I think? the icon is an open folder with a little orange grid in it) in my Eclipse project. I have dropped a new directory under c:\RemoteSrc which I also want to add to my project. BUT If I right click on my project and go "Build Path..." - "Link Source" and try to add it it tells me "Folder already exists with a different case". Yes i KNOW that the folder already exists THATS WHY IM TRYING TO ADD IT.

    Read the article

  • Extract a regular expression match in R version 2.10

    - by tovare
    Hi, I'm trying to extract a number from a string. And do something like this [0-9]+ on this string "aaaa12xxxx" and get "12". I thought it would be something like: > grep("[0-9]+","aaa12xxx", value=TRUE) [1] "aaa12xxx" And then I figured... > sub("[0-9]+", "\\1", "aaa12xxxx") [1] "aaa12xxx" But I got some form of response doing: > sub("[0-9]+", "ARGH!", "aaa12xxxx") [1] "aaaARGH!xxx" There's a small detail I'm missing Please advice :-) I'm using R version 2.10.1 (2009-12-14) Thanks ! Comments on the solution The best solution is to ignore the standard functions and install Hadley Wickham's stringr package to get something that actually makes sense. Kudos to Marek for figuring out how the standard library worked.

    Read the article

  • Forward, redirect, forward!! How do I check parameters being sent?

    - by Arjun
    There's this form that I'm placing on a site. This form submits some parameters to a site which then sends some parameters using "GET" to another site, which then opens the third site. Now the first 2 sites pass so quickly that I can not see what parameters were passed using the URL. I just need a simple tool or hint or firefox addon or ANYTHING ELSE on how to track what parameters were sent to url1, url2 etc. There's got to be some tool for this, only I can't seem to find it! Argh!

    Read the article

  • Batch deletion of smaller files from group of files via unix command line

    - by artlung
    I have a large number (more than 400) of directories full of photos. What I want to do is to keep the larger sizes of these photos. Each directory has 31 to 66 files in it. Each directory has thumbnails, and larger versions, plus a file called example.jpg I dispatched the example.jpg file easily with: rm */example.jpg I initially thought that it would be easy to delete the thumbnails, but the problem is they are not consistently named. The typical pattern was photo1.jpg and photo1s.jpg. I did rm */photo*s.jpg but it ended up some of the files named photoXs.jpg were actually larger and not smaller. Argh. So what I want to do is scan each directory for filesize and delete (or move) the thumbnails. I initially thought I'd just ls -R every file and extract the size of each file and save those under a threshold. The problem? In one directory the large will be 1.1 MB and the thumb is 200k. In another the large is 200k and the small 30k. Even worse, the files really are mostly named photo1.jpg - so simply putting them all in the same folder, sorting by size, and deleting in groups would not work without renaming already, and if it's possible I'd prefer to keep them in their folders. I was almost resolved to just doing this all manually, but then thought I'd ask here. How would you do this task?

    Read the article

  • Problems with synaptic touchpad

    - by penlite
    The "enhanced" features of the synaptics touchpad (ie scroll, pinch zoom) on my windows 7 64 bit dell studio 17 only work intermittently. This was an issue with the original OEM driver and also with the new driver from synaptics - please do not suggest that i update, reinstall, install as administrator, check or jiggle the driver - if i hear that one more time i will freak out. I have researched this for days and appears to be a common problem without a solution (many suggestions to update the driver though -argh). Dell and synaptics have not been helpful. I have checked that syntpehn.exe and syntphelper.exe are running (sometimes the UAC seems to block syntpehn.exe from running at startup). When the touchpad fails i can still use it to control the pointer and access the synaptics settings although some of the options are disabled (greyed out or simply unresponsive). It is the only pointing device i have installed - i had a logitech trackball attached but have uninstalled all software and drivers (including hidden devices) as per synaptic. It is also the only device using IRQ 12. Any help would be greatly appreciated except "update the driver".

    Read the article

  • Win7 Credential manager and accessing SQL Server from outside of the domain

    - by David Lively
    My SQL Server is set to use windows authentication. If I am connected to the domain directly from my Win7 Ultimate x64 machine, SQL Management Studio (SSMS) will let me authenticate with Windows authentication. However, if I am connected via the VPN (from a different machine that is not joined to the domain), it won't. If I start SSMS with the following command line: C:\Windows\system32>runas /netonly /user:domainname\username "C:\Program Files (x86)\Microsoft SQL...\ssms.exe" then connecting to the SQL Server (which is in the domain) with Windows Authentication works fine. I'd like to save these credentials so that I don't have to launch SSMS from the command line, or modify the shortcut. I know I can use the SysInternals ShellRunAs extension to do this, but I again have to enter my domain username and password each time, and shift+right-click to see that menu option. The Windows Credential Manager seems designed to solve this problem, and works for network shares. However, it doesn't seem to work for SSMS. Any suggestions? I've tried using the /savecred option with runas to create the necessary credentials, but that appears to be incompatible with the /netonly option. Running the above command line with the addition of /savecred just displays the runas help screen. Grrr. Argh.

    Read the article

  • First Impressions of a MacBook (from a PC guy)

    - by dgreen
    Disclaimer: I've been a PC guy my entire working career. I'd probably characterize myself as a power user. Never afraid to bust out the console line. But working with a Mac is totally foreign to me. So for those Mac guys who are curious, this is how your world appears from the outside to a computer literate person :)My Macbook Air has arrived! And it's a thing of beauty:First, the specs: 13" MacBook Air, 2.0GHz Core i7 processor. Upgraded to 8GB of RAM for an additional $100, SSD flash storage  = 256GB. The plan is ultimately to use this baby for some iOS development but also some decent lifting in Windows with Visual Studio. Done a lot of reading  and between VMWare Fusion, Parallels and Bootcamp...I'm going to go with VMWare Fusion for $49.99And now my impressions (please re-read disclaimer before proceeding!):I open the box and am trying to understand exactly how the magsafe connector works (and how to disconnect it).  Why does it have two socket outlet plugs? Who knows.  I feel like Hansel in Zoolander. The files are "in" the computer.Stuck in my external hard drive (usb). So how do I get to the files? To the Googles!Argh...it can't read my external NTFS drive. Fat32 can't support field over 4GB…problematic since some of my existing VMWare image files are much larger than 4GB. Didn't see this coming.Three year old loves iPhoto. Super easy to use. Don't even know what I'm doing but I've already (accidentally) discovered the image filtering options. Fun stuff.First thing I downloaded ever => Chrome. I need something to ground me, something familiar. My token, if you will (sorry, gratuitous Inception joke).Ok, I get it… Finder == windows explorer. But where is my hierarchical structure? I miss the tree :(On that note, yeah…how do I see what "path" my files reside in? I'm afraid to know the answer. You know what scares more though…this notion of a smart folder. Feel like the godfather - just get the job done, I don't care how you handle it, I don't want to know...just get it done. What the hell is AirDrop?Mail…just worked. Still in shock that they have a free client for yahoo mail (please no yahoo jokes).mail -> deleting a message takes 5 seconds. Have they heard of async?"Command" key instead of "Control" ok, then what the $%&^! is the control key for then"aliases" == shortcuts I thinkI don't see the file system. And I'm scared. All these things I'm downloading…these .dmg files (bad name) where are they going? Can't seem to delete when they're doneUgh...realized need to buy a mini-to-vga adaptor if I want to use my external monitor ($13 on ebay, $39 in apple store).Windows docking is trickiest for me…this notion of detached windows with a menu bar at the top. I don't like this paradigm, it's confusing. But maybe because I've been using Windows for too long.Evernote, Dropbox desktop clients seem almost identical…few quirks here and there I need to get used to.iTunes is still a bit gross. In a weird way it's actually worse on a Mac if thats possible. This is not the MacBook's fault…this is a software design issue. Overall: UI will take some getting used to. Can't decide if this represents the future and I'm stuck in the past…or this is the past and I've been spoiled by the future (which would be Windows…don't be hating I happen to be very productive in Win7)  So there you go - my 90 minute first impression of the MacBook universe.

    Read the article

  • Company wants to write custom project management tool, rather then use third party product.

    - by Jason Evans
    At the company I work, we are really wanting to get into the agile methodology for developing software. One thing that I'm not excited about is the fact that management wants us to build a custom project management feature inside the company's Intranet. I think this is a total waste of time. There are many great third party tools available (e.g. Axosoft OnTime) that can do everything we need, and more. For how much development time it would cost us to build our own project management module, we could buy numerous licences for a third party product. One concern is that, whilst we are writing code for a client, and using our custom Intranet project management module, we find bugs in the module that need fixing ASAP. That means having to stop work on the client code to fix the Intranet. That just puts shivers down my spine. Another worry I have is lack of functionality. This custom module is going to be so basic, that it will just feel really crap to use. That might sound a bit snooty, but for goodness sake, many third party tools are so feature rich, that the idea of having to write our own tool makes feel very uneasy. In fact, I can't be bothered. What do you guys think? I'm going to raise this issue with my boss, since I feel it's such an important topic to talk about. EDIT: Thanks for the great responses, much appreciated. To summarize some of them: Money Naturally my boss does want to save money, by not forking out a few hundred £'s for licences. However, for us to write a custom tool, it will take x number of days, multiplied by approx £500, which is our costs. I don't see the business value in this. Management have mentioned that they want to sell the Intranet as a product in the future, but it's so custom to our needs (and downright basic), that in order to give it to another client, I can see us having to fork a version of the code and rebuild the majority of it anyway. So it's not like we're gaining anything there in reuse. Features Having our own custom module means not feature bloat - only the functionality we require will be in the product. My issue is that there are plenty of free, open-source project management tools out there with minimal features already. So even if cost is an issue, we could look into open-source. Again it all boils down to the fact that I don't see the point in writing a project management tool in this day and age. It's a bit like writing your own web browser - why?, what's the point? Although management are asking for this tool, just because they are, it does not mean I'm going to please them and do it just because they asked for it. If something does not make sense, then I will raise it as a concern. At the end of the day, it's the developers who write the code, it's the developers who make money for a business. Thus, as far I'm concerned, the devs have a very big role in deciding how a company should manage projects and what tools are used. "I am Spartan, argh!" :) Hmm, I've not been able to make this question a wiki for some reason, thus I'm going to have to pick an answer to accept. Cheers. Jas.

    Read the article

  • Styling specific columns and rows

    - by hattenn
    I'm trying to style some specific parts of a 5x4 table that I create. It should be like this: Every even numbered row and every odd numbered row should get a different color. Text in the second, third, and fourth columns should be centered. I have this table: <table> <caption>Some caption</caption> <colgroup> <col> <col class="value"> <col class="value"> <col class="value"> </colgroup> <thead> <tr> <th id="year">Year</th> <th>1999</th> <th>2000</th> <th>2001</th> </tr> </thead> <tbody> <tr class="oddLine"> <td>Berlin</td> <td>3,3</td> <td>1,9</td> <td>2,3</td> </tr> <tr class="evenLine"> <td>Hamburg</td> <td>1,5</td> <td>1,3</td> <td>2,0</td> </tr> <tr class="oddLine"> <td>München</td> <td>0,6</td> <td>1,1</td> <td>1,0</td> </tr> <tr class="evenLine"> <td>Frankfurt</td> <td>1,3</td> <td>1,6</td> <td>1,9</td> </tr> </tbody> <tfoot> <tr class="oddLine"> <td>Total</td> <td>6,7</td> <td>5,9</td> <td>7,2</td> </tr> </tfoot> </table> And I have this CSS file: table, th, td { border: 1px solid black; border-collapse: collapse; padding: 0px 5px; } #year { text-align: left; } .oddLine { background-color: #DDDDDD; } .evenLine { background-color: #BBBBBB; } .value { text-align: center; } And this doesn't work. The text in the columns are not centered. What is the problem here? And is there a way to solve it (other than changing the class of all the cells that I want centered)? P.S.: I think there's some interference with .evenLine and .oddLine classes. Because when I put "background: black" in the class "value", it changes the background color of the columns in the first row. The thing is, if I delete those two classes, text-align still doesn't work, but background attribute works perfectly. Argh...

    Read the article

  • IE History Tracking, IFRAMES, and Cross Domain error...

    - by peiklk
    So here's the deal. We have a Flash application that is running within an HTML file. For one page we call a legacy reporting system in ASP.NET that is within an IFRAME. This page then communicates back to the Flash application using cross-domain scripting (document.domain = "domain" is set in both pages. THIS ALL WORKS. Now the kicker. Flash has history tracking enabled. This loads the history.js file that created a div tag to store page changes so the back and forward buttons work in the browser. Which works for Firefox and Chrome as they create a div tag. HOWEVER In Internet Explorer, history.js creates another IFRAME (instead of a DIV) called ie_historyFrame. When the ScriptResource.axd code attempts to access this with: var frameDoc = this._historyFrame.contentWindow.document; we get an "Access is Denied" error message. ARGH! We've tried getting a handle to this IFRAME and inserting the document.domain code. FAIL. We've tried editing the historytemplate.html file that flex also uses to include document.domain... FAIL. I've tried to edit the underlying ASP.NET page to disable history tracking in the ScriptManager control. FAIL. At my wit's end on this one. We have users who need to use IE to access this site. They are big clients who we cannot tell to just use Firefox. Any suggestions would be greatly appreciated.

    Read the article

  • What might make "Xclients" be executed twice when boot system?

    - by ablmf
    For some special purpose, I modified /etc/X11/xinit/Xclients to start firefox instead of start Desktop Environment. # Argh! Nothing good is installed. Fall back to twm { # gosh, neither fvwm95 nor fvwm2 is available; # fall back to failsafe settings [ -x /usr/bin/xsetroot ] && /usr/bin/xsetroot -solid '#222E45' # if [ -x /usr/bin/xclock ] ; then # /usr/bin/xclock -geometry 100x100-5+5 & # elif [ -x /usr/bin/xclock ] ; then # /usr/bin/xclock -geometry 100x100-5+5 & # fi # if [ -x /usr/bin/xterm ] ; then # /usr/bin/xterm -geometry 80x50-50+150 & # fi if [ -x /usr/bin/firefox ]; then /usr/bin/firefox -chrome http://127.0.0.1/ -width 1280 -height 768 fi # if [ -x /usr/bin/twm ] ; then # exec /usr/bin/twm # fi This used to work fine until today I tested it on another computer. Firefox reports that there's another running instance of firefox which stops responding. Thus, firefox could not autostart as I expected. I connected the computer with SSH and I found there are 2 firefox processes: [root@my113 xinit]# ps -ef | grep firefox root 4479 4371 0 17:34 ? 00:00:00 /bin/sh /usr/lib/firefox-3.0b5/run-mozilla.sh /usr/lib/firefox-3.0b5/firefox -chrome http://127.0.0.1/ -width 1280 -height 768 root 4600 4479 0 17:34 ? 00:00:01 /usr/lib/firefox-3.0b5/firefox -chrome http://127.0.0.1/ -width 1280 -height 768 root 4940 4906 0 17:35 ? 00:00:00 /bin/sh /usr/lib/firefox-3.0b5/run-mozilla.sh /usr/lib/firefox-3.0b5/firefox -chrome http://127.0.0.1/ -width 1280 -height 768 root 4963 4940 0 17:35 ? 00:00:00 /usr/lib/firefox-3.0b5/firefox -chrome http://127.0.0.1/ -width 1280 -height 768 root 5717 5345 0 17:51 pts/2 00:00:00 grep firefox I guess, for some reason, "Xclients" is executed twice. But I really knows very little about XWindows, so if anyone here could give me some clues, I will appreciate!

    Read the article

  • MVC 2 Data annotations problem

    - by Louzzzzzz
    Hi. Going mad now. I have a MVC solution that i've upgraded from MVC 1 to 2. It all works fine.... except the Validation! Here's some code: In the controller: using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Security.Principal; using System.Web; using System.Web.Mvc; using System.Web.Security; using System.Web.UI; using MF.Services.Authentication; using System.ComponentModel; using System.ComponentModel.DataAnnotations; namespace MF.Controllers { //basic viewmodel public class LogOnViewData { [Required] public string UserName { get; set; } [Required] public string Password { get; set; } } [HandleError] public class AccountController : Controller { [HttpPost] public ActionResult LogOn(LogOnViewData lvd, string returnUrl) { if (ModelState.IsValid) { //do stuff - IsValid is always true } } } } The ModelState is always valid. The model is being populated correctly however. Therefore, if I leave both username and password blank, and post the form the model state is still valid. Argh! Extra info: using structure map for IoD. Previously, before upgrading to MVC 2 was using the MS data annotation library so had this in my global.asax.cs: ModelBinders.Binders.DefaultBinder = new Microsoft.Web.Mvc.DataAnnotations.DataAnnotationsModelBinder(); Have removed that now. I'm sure i'm doing something really basic and wrong. If someone could point it out that would be marvellous. Cheers

    Read the article

  • Forms/AD Authentication with Sharepoint

    - by David Lively
    All, I'm configuring Sharepoint to use forms authentication with LDAP/Active Directory. I'm new to Sharepoint, so if this is obvious, please point me in the right direction. Whenever I attempt to log in with a bad account or password, I get the very friendly (and correct) error message, The server could not sign you in. Make sure your user name and password are correct, and then try again. ... which implies that Sharepoint is able to communicate with AD. If I log in with a valid account, I get a page that says: (I added the grey bar to cover up the login name) Any suggestions? The account I'm logging in with is an administrator and has been granted full control in central administration. Also, interesting note: If I click the "sign in as a different user" link, and attempt to sign in using with the same credentials I just used, the site just redirects back to the login page, with no error or status message. If I then manually enter the site url, it again shows the "Error: Access Denied" page. Argh.

    Read the article

  • cgi.FieldStorage always empty - never returns POSTed form Data

    - by Dan Carlson
    This problem is probably embarrassingly simple. I'm trying to give python a spin. I thought a good way to start doing that would be to create a simple cgi script to process some form data and do some magic. My python script is executed properly by apache using mod_python, and will print out whatever I want it to print out. My only problem is that cgi.FieldStorage() is always empty. I've tried using both POST and GET. Each trial I fill out both form fields. <form action="pythonScript.py" method="POST" name="ARGH"> <input name="TaskName" type="text" /> <input name="TaskNumber" type="text" /> <input type="submit" /> </form> If I change the form to point to a perl script it reports the form data properly. The python page always gives me the same result: number of keys: 0 #!/usr/bin/python import cgi def index(req): pageContent = """<html><head><title>A page from""" pageContent += """Python</title></head><body>""" form = cgi.FieldStorage() keys = form.keys() keys.sort() pageContent += "<br />number of keys: "+str(len(keys)) for key in keys: pageContent += fieldStorage[ key ].value pageContent += """</body></html>""" return pageContent I'm using Python 2.5.2 and Apache/2.2.3. This is what's in my apache conf file (and my script is in /var/www/python): <Directory /var/www/python/> Options FollowSymLinks +ExecCGI Order allow,deny allow from all AddHandler mod_python .py PythonHandler mod_python.publisher </Directory>

    Read the article

  • Center a TextBox over the top of a ScrollViewer in WPF.

    - by Eric
    I have a MainView that contains a navigation bar which selects one of many XAML pages to be displayed in the page view pane. The MainView contains a ScrollViewer around the pages. This allows the pages to be whatever size they need to be and the MainView's ScrollViewer scrolls them. This all works great. On one of the pages, I need to (sometimes) center a TextBox in the middle of the page view pane (over the top of the page content). This was easily done by placing both the page content and the TextBox overlapping each other in a Grid (and I hide the TextBox as necessary). This all seems to work great. However, if the page content grows to be larger than the pane, the TextBox is centered not on the pane, but on the full page content. Thus, it moves from center screen down and/or to the right (and eventually off the screen). Bummer. Options: Remove the ScrollViewer from the MainView. This would require placing one on every page! Argh. Do option #1, and create a ScrolledPage base class. This is a lot of work, and I'm worried about tools issues (Blend issues). It also requires changing every page (to subclass this page). Somehow override the ScrollViewer on just this page. Then, place another ScrollViewer on the page content to Scroll it. Option 3 seems preferable, because it contains the issue to just modifying this page (instead of changing the rest of the pages). However, I can't figure out how to do it. Ideas? Thanks in advance! Eric

    Read the article

  • Const_cast on a this pointer - would I get told off by other C++ coders for doing this?

    - by BeeBand
    I have a class Game e.g. class Game { public: InitObjects(); ... }; And I have another class Grid, that needs to be initialised with a non-const reference to that Game object. ( A Grid object needs to call functions that can update a Game object ). class Grid { public: Grid(Game & g): game(g){} ... private: Game & game; ... }; The Game object is responsible for initialising the Grid. I did this: void Game::InitObjects() { grid = new Grid(*(const_cast<Game*>(this)) ); } grid is not a member of a Game - it's a global ( argh - i know... I don't mind making it a member, but I have the same problem right? ). Can some seasoned C++ folk tell me if this odd looking const_cast is acceptable?

    Read the article

  • Why do I have to specify pure virtual functions in the declaration of a derived class in Visual C++?

    - by neuviemeporte
    Given the base class A and the derived class B: class A { public: virtual void f() = 0; }; class B : public A { public: void g(); }; void B::g() { cout << "Yay!"; } void B::f() { cout << "Argh!"; } I get errors saying that f() is not declared in B while trying do define void B::f(). Do I have to declare f() explicitly in B? I think that if the interface changes I shouldn't have to correct the declarations in every single class deriving from it. Is there no way for B to get all the virtual functions' declarations from A automatically? EDIT: I found an article that says the inheritance of pure virtual functions is dependent on the compiler: http://www.objectmentor.com/resources/articles/abcpvf.pdf I'm using VC++2008, wonder if there's an option for this.

    Read the article

  • WPF app startup problems

    - by Dave
    My brain is all over the map trying to fully understand Unity right now. So I decided to just dive in and start adding it in a branch to see where it takes me. Surprisingly enough (or maybe not), I am stuck just getting my darn Application to load properly. It seems like the right way to do this is to override OnStartup in App.cs. I've removed my StartupUri from App.xaml so it doesn't create my GUI XAML. My App.cs now looks something like this: public partial class App : Application { private IUnityContainer container { get; set; } protected override void OnStartup(StartupEventArgs e) { container = new UnityContainer(); GUI gui = new GUI(); gui.Show(); } protected override void OnExit(ExitEventArgs e) { container.Dispose(); base.OnExit(e); } } The problem is that nothing happens when I start the app! I put a breakpoint at the container assignment, and it never gets hit. What am I missing? App.xaml is currently set to ApplicationDefinition, but I'd expect this to work because some sample Unity + WPF code I'm looking at (from Codeplex) does the exact same thing, except that it works! I've also started the app by single-stepping, and it eventually hits the first line in App.xaml. When I step into this line, that's when the app just starts "running", but I don't see anything (and my breakpoint isn't hit). If I do the exact same thing in the sample application, stepping into App.xaml puts me right into OnStartup, which is what I'd expect to happen. Argh! Is it a Bad Thing to just put the Unity construction in my GUI's Window_Loaded event handler? Does it really need to be at the App level?

    Read the article

  • Dynamic change .click value Jquery IE issue.

    - by user326100
    Hello guys.. it's i first time i'm asking here. Sorry if the answer is available already. I have a very small jQuery script that canges the paramether for onclick attr on a DIV. IT works like as right and left arrows for some content in the middle. BAsically i set the onclick="foo(1)" then when get clicked sld change the value 1 to 2, and keep changing everytime i click. on jQuery functio i'm using: $("#v_arrow_r").attr('onclick','').unbind().click(newclick_next); it works like a charm on FF and Chrome, but does not work on IE !!!! Argh... here the the code: if (start == 24) { var a = 0; var b = 0; } else { var a = start-6; var b = start+6; } next = "home_featured_videos(" + b + ");"; newclick_next = eval("(function(){"+next+"});"); prev = "home_featured_videos(" + a + ");"; newclick_prev = eval("(function(){"+prev+"});"); $('#video-module').css('background',''); $('#video-module').html(response); $("#v_arrow_l").attr('onclick','').unbind().click(newclick_prev); $("#v_arrow_r").attr('onclick','').unbind().click(newclick_next); The html: //CONTENT So like i said.. i define the attr onclick when page open. It work well on IE. but when i click the arrow and call the function the oncli is set to null and i add the function to .click. IE stop working. the click is dead. If anybody have idea why this is happening. Thanx in advance. Kind Regards Varois

    Read the article

  • WPF Databinding With A Collection Object

    - by Randster
    Argh, although I've been googling, I really would appreciate it if someone could break my problem down as all the code examples online are confusing me more than assisting (perhaps it's just late)... I have a simple class as defined below: public class Person { int _id; string _name; public Person() { } public int ID { get { return _id; } set { _id = value; } } public string Name { get { return _name; } set { _name = value; } } } that is stored in a database, and thru a bit more code I put it into an ObservableCollection object to attempt to databind in WPF later on: public class People : ObservableCollection<Person> { public People() : base() { } public void Add(List<Person> pListOfPeople) { foreach (Person p in pListOfPeople) this.Add(p); } } In XAML, I have myself a ListView that I would like to populate a ListViewItem (consisting of a textblock) for each item in the "People" object as it gets updated from the database. I would also like that textblock to bind to the "Name" property of the Person object. I thought at first that I could do this: lstPeople.DataContext = objPeople; where lstPeople is my ListView control in my XAML, but that of course does nothing. I've found TONS of examples online where people through XAML create an object and then bind to it through their XAML; but not one where we bind to an instantiated object and re-draw accordingly. Could someone please give me a few pointers on: A) How to bind a ListView control to my instantiated "People" collection object? B) How might I apply a template to my ListView to format it for the objects in the collection? Even links to a decent example (not one operating on an object declared in XAML please) would be appreciated. Thanks for your time.

    Read the article

< Previous Page | 1 2 3  | Next Page >