Search Results

Search found 3177 results on 128 pages for 'david murrant'.

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

  • Convert C++Builder AnsiString to std::string via boost::lexical_cast

    - by David Klein
    For a school assignment I have to implement a project in C++ using Borland C++ Builder. As the VCL uses AnsiString for all GUI Components I have to convert all of my std::strings to AnsiString for the sake of displaying. std::string inp = "Hello world!"; AnsiString outp(inp.c_str()); works of course but is a bit tedious to write and code duplication I want to avoid. As we use Boost in other contexts I decided to provide some helper functions go get boost::lexical_cast to work with AnsiString. Here is my implementation so far: std::istream& operator>>(std::istream& istr, AnsiString& str) { istr.exceptions(std::ios::badbit | std::ios::failbit | std::ios::eofbit); std::string s; std::getline(istr,s); str = AnsiString(s.c_str()); return istr; } In the beginning I got Access Violation after Access Violation but since I added the .exceptions() stuff the picture gets clearer. When the conversion is performed I get the following Exception: ios_base::eofbit set [Runtime Error/std::ios_base::failure] Does anyone have an idea how to fix it and can explain why the error occurs? My C++ experience is very limited. The conversion routine the other way round would be: std::ostream& operator<<(std::ostream& ostr,const AnsiString& str) { ostr << (str.c_str()); return ostr; } Maybe someone will spot an error here too :) With best regards! Edit: At the moment I'm using the edited version of Jem, it works in the beginning. After a while of using the programm the Borland Codeguard mentions some pointer arithmetic in already freed regions. Any ideas how this could be related? The Codeguard log (I'm using the german version, translations marked with stars): ------------------------------------------ Fehler 00080. 0x104230 (r) (Thread 0x07A4): Zeigerarithmetik in freigegebenem Speicher: 0x0241A238-0x0241A258. **(pointer arithmetic in freed region)** | d:\program files\borland\bds\4.0\include\dinkumware\sstream Zeile 126: | { // not first growth, adjust pointers | _Seekhigh = _Seekhigh - _Mysb::eback() + _Ptr; |> _Mysb::setp(_Mysb::pbase() - _Mysb::eback() + _Ptr, | _Mysb::pptr() - _Mysb::eback() + _Ptr, _Ptr + _Newsize); | if (_Mystate & _Noread) Aufrufhierarchie: **(stack-trace)** 0x00411731(=FOSChampion.exe:0x01:010731) d:\program files\borland\bds\4.0\include\dinkumware\sstream#126 0x00411183(=FOSChampion.exe:0x01:010183) d:\program files\borland\bds\4.0\include\dinkumware\streambuf#465 0x0040933D(=FOSChampion.exe:0x01:00833D) d:\program files\borland\bds\4.0\include\dinkumware\streambuf#151 0x00405988(=FOSChampion.exe:0x01:004988) d:\program files\borland\bds\4.0\include\dinkumware\ostream#679 0x00405759(=FOSChampion.exe:0x01:004759) D:\Projekte\Schule\foschamp\src\Server\Ansistringkonverter.h#31 0x004080C9(=FOSChampion.exe:0x01:0070C9) D:\Projekte\Schule\foschamp\lib\boost_1_34_1\boost/lexical_cast.hpp#151 Objekt (0x0241A238) [Größe: 32 Byte] war erstellt mit new **(Object was created with new)** | d:\program files\borland\bds\4.0\include\dinkumware\xmemory Zeile 28: | _Ty _FARQ *_Allocate(_SIZT _Count, _Ty _FARQ *) | { // allocate storage for _Count elements of type _Ty |> return ((_Ty _FARQ *)::operator new(_Count * sizeof (_Ty))); | } | Aufrufhierarchie: **(stack-trace)** 0x0040ED90(=FOSChampion.exe:0x01:00DD90) d:\program files\borland\bds\4.0\include\dinkumware\xmemory#28 0x0040E194(=FOSChampion.exe:0x01:00D194) d:\program files\borland\bds\4.0\include\dinkumware\xmemory#143 0x004115CF(=FOSChampion.exe:0x01:0105CF) d:\program files\borland\bds\4.0\include\dinkumware\sstream#105 0x00411183(=FOSChampion.exe:0x01:010183) d:\program files\borland\bds\4.0\include\dinkumware\streambuf#465 0x0040933D(=FOSChampion.exe:0x01:00833D) d:\program files\borland\bds\4.0\include\dinkumware\streambuf#151 0x00405988(=FOSChampion.exe:0x01:004988) d:\program files\borland\bds\4.0\include\dinkumware\ostream#679 Objekt (0x0241A238) war Gelöscht mit delete **(Object was deleted with delete)** | d:\program files\borland\bds\4.0\include\dinkumware\xmemory Zeile 138: | void deallocate(pointer _Ptr, size_type) | { // deallocate object at _Ptr, ignore size |> ::operator delete(_Ptr); | } | Aufrufhierarchie: **(stack-trace)** 0x004044C6(=FOSChampion.exe:0x01:0034C6) d:\program files\borland\bds\4.0\include\dinkumware\xmemory#138 0x00411628(=FOSChampion.exe:0x01:010628) d:\program files\borland\bds\4.0\include\dinkumware\sstream#111 0x00411183(=FOSChampion.exe:0x01:010183) d:\program files\borland\bds\4.0\include\dinkumware\streambuf#465 0x0040933D(=FOSChampion.exe:0x01:00833D) d:\program files\borland\bds\4.0\include\dinkumware\streambuf#151 0x00405988(=FOSChampion.exe:0x01:004988) d:\program files\borland\bds\4.0\include\dinkumware\ostream#679 0x00405759(=FOSChampion.exe:0x01:004759) D:\Projekte\Schule\foschamp\src\Server\Ansistringkonverter.h#31 ------------------------------------------ Ansistringkonverter.h is the file with the posted operators and line 31 is: std::ostream& operator<<(std::ostream& ostr,const AnsiString& str) { ostr << (str.c_str()); **(31)** return ostr; } Thanks for your help :)

    Read the article

  • Lightweight development web server with support for PHP v2

    - by David
    In line with this question: http://stackoverflow.com/questions/171655/lightweight-web-app-server-for-php The above question has been asked numerous times and answered exactly the same in all the cases I've found using google. My question is similar to a degree but with a different desired goal: On demand development instances. I have come up with a somewhat questionable solution to host arbitrary directories in my user account for the purpose of development testing. I am not interested in custom vhosts but looking to emulate the behaviour I get when using paster or mongrel for Python & Ruby respectively. Ubuntu 9.10 TOXIC@~/ APACHE_RUN_USER=$USER APACHE_RUN_GROUP=www-data apache2 -d ~/Desktop/ -c "Listen 2990" Is there a better solution, could I do something similar with nginix or lighttpd? Note: The above won't work correctly for stock environments without a copied & altered httpd.conf. Update: The ideal goal is to mimic Paster, Webbrick, and Mongrel for rapid local development hosting. For those light weight servers, it takes less then a minute to get a working instance running ( not factoring any DB support ). Apache2 vhost is great but I've been using Apache2 for over ten years and it would be some sort of abomination hack to setup a new entry in /etc/hosts unless you have your own DNS, in which case a wildcard subdomain setup would probably work great. EXCEPT one more problem, it's pretty easy for me to know what is being hosted ( ex. by paster or mongeral ) just doing a sudo netstat -tulpn while there would be a good possibility of confusion in figure out which vhost is what.

    Read the article

  • What is the life cycle of the XNA GraphicsDevice on the Xbox 360?

    - by David Brown
    I'm working on an XNA project that doesn't use the built-in Game class, mostly for learning purposes (so I can mess with different game loop types, etc). It's only designed for the Xbox 360, because the hardware is consistent and I don't have to worry about compatibility among different PC hardware configurations. So far, it's working well and I can clear the screen to a color, but I'd like to make sure I handle the GraphicsDevice correctly before moving on. What exactly is the life cycle for the GraphicsDevice on the Xbox 360? Is it ever lost or reset automatically? I know that on Windows, it's lost when the window loses focus, but the Xbox obviously doesn't manage focus. It appears to even keep the graphics device when the Guide pops up, which is the closest thing I can find to "losing focus" on the Xbox. I'd like to think it's simply a matter of "fire and forget," which would make a lot of other things much easier (only needing to load content once, for instance). But I want to make sure.

    Read the article

  • Jquery AJAX and figuring out how NOT to nest callbacks for multiple reloads.

    - by David H
    I have a site with a few containers that need to load content dynamically via AJAX. Most of the links inside of the containers actually load new data in that same container. I.E: $("#navmenu_item1").click(function() { $("#navmenu").load(blah); }); When I click on a link, lets say "logout," and the menu reloads with the updated login status, none of the links now work because I would need to add a new .click into the callback code. Now with repeated clicks and AJAX requests I am not sure how to move forward from here, as I am sure nested callbacks are not optimal. What would be the best way to do this? Do I include the .click event inside the actual AJAX file being pulled from the server, instead of within index.php? Or can I somehow reload the DOM? Thanks for the help!

    Read the article

  • Hiding Table Rows

    - by David Stein
    I have a table that I'm using to show details from the line items of a quote. I want to hide a particular row depending on the value of the field in it. The expression I've tried is to set the row visibility to: =IIF(isnothing(First(Fields!NEW_PRICEBREAKS.Value, "QuoteDetail")),true,false) When I run the query from the dataset "Null" returns for NEW_PRICEBREAKS for most of the records. Also, when I expanded the row with another column with this expression: =IIF(isnothing(First(Fields!NEW_PRICEBREAKS.Value, "QuoteDetail")),"is nothing","not nothing") I see "not nothing" repeated over and over again. I've attempted to use TRIM inside of the isnothing to remove spaces and it still doesn't work. Also, the sql data type for NEW_PRICEBREAKS is nvarchar(MAX). Any ideas how I can suppress this row correctly?

    Read the article

  • Calling ADODB inside a function?

    - by David
    Hi, I'm wondering why when i put an sql ADODB query in side a function it produces the following error: Fatal error: Call to a member function Execute() on a non-object in -path to script- My function is something like: $dsn = 'mysql://user:pass@localhost/db'; $db = ADONewConnection($dsn); function getem($q){ $r=$db->Execute($q); return $r->RecordCount(); } echo getem("select * from table"); Any ideas how to fix that?

    Read the article

  • Telephone Number to Geolocation UK

    - by David Toy
    Is there a service that provides latitude and longitude for UK phone numbers? For example: Query: 0141 574 xxx, Returns: (55.8659829, -4.2602205) [Glasgow City Centre] Allow me to stress that I am not looking for a reverse-directory-enquires. I am more interested in 'local area' for things like weather by phone or "Where's my nearest Pizza Shop?" If this service doesn't exist your suggestions on how to implement it or where to get data from would also be incredibly useful. I am aware that Ofcom provides a list of area codes with a place name [1] suitable for geolocation, but I have my concerns about resolution. I see this as a particular problem in smaller towns and rural areas where an area code will cover a large geographical area. Second Example: Area Code: 01555, Ofcom: Lanark However: 01555 860xxx is Crossford (4 miles W of Lanark) 01555 77xxxx is Carluke (5 miles NW) 01555 89xxxx is Lesmahagow (5 miles SW) 01555 840xxx is Carnwath (7 miles NE) Therefore 01555 covers about ~80 sq miles. That's not particularly local. [1] Ofcom Area Code Tool: http://www.ofcom.org.uk/consumer/2009/09/telephone-area-codes-tool/

    Read the article

  • Log4Net in App object?

    - by David Veeneman
    I am getting started with Logging in a WPF desktop app, using Log4Net as the logging component. Here is my question: In a simple desktop app, is there any reason not to instantiate my logger as a property ov the App class (App.xaml.cs), like this? public partial class App : Application { private static readonly ILog p_Logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public ILog Logger { get { return p_Logger; } } #endregion } } That would allow me to invoke the logger

    Read the article

  • MVC view engine that can render classic ASP?

    - by David Lively
    I'm about to start integrating ASP.NET MVC into an existing 200k+ line classic ASP application. Rewriting the existing code (which runs an entire business, not just the public-facing website) is not an option. The existing ASP 3.0 pages are quite nicely structured (given what was available when this model was put into place nearly 15 years ago), like so: <!--#include virtual="/_lib/user.asp"--> <!--#include virtual="/_lib/db.asp"--> <!--#include virtual="/_lib/stats.asp"--> <!-- #include virtual="/_template/topbar.asp"--> <!-- #include virtual="/_template/lftbar.asp"--> <h1>page name</h1> <p>some content goes here</p> <p>some content goes here</p> <p>.....</p> <h2>Today's Top Forum Posts</h2> <%=forum_top_posts(1)%> <!--#include virtual="/_template/footer.asp"--> ... or somesuch. Some pages will include function and sub definitions, but for the most part these exist in include files. I'm wondering how difficult it would be to write an MVC view engine that could render classic ASP, preferably using the existing ASP.DLL. In that case, I could replace <!--#include virtual="/_lib/user.asp"--> with <%= Html.RenderPartial("lib/user"); %> as I gradually move existing pages from ASP to ASP.NET. Since the existing formatting and library includes are used very extensively, they must be maintained. I'd like to avoid having to maintain two separate versions. I know the ideal way to go about this would be to simply start a new app and say to hell with the ASP code, however, that simply ain't gonna happen. Ideas?

    Read the article

  • browser ctrl-f find and non-visible text

    - by David Pilling
    Can the browser feature of contrl+F to find text be integrated with text in popup windows. I'd like to have some scientific reference information given when someone hovers over a species name in a web page. Generating the popup, tooltip style text is no problem, the problem is that anyone using Ctrl+F won't be able to find it, or if I position the text out of view when not required, it will be found but be invisible. The same sort of effect applies to "accordion" style expanding text areas. I'm looking for some sort of event generated when find is highlighting a result.

    Read the article

  • Graphics library used by Windows Vista Freecell and Solitaire

    - by David Grayson
    Does anyone know what graphics library is used to create the graphics in the Solitaire and Freecell games included with Windows Vista (e.g. XNA, GDI, WPF)? A good answer would include the name of the library and evidence. I looked at solitaire.exe with dependency walker and it shows many calls to gdi32.dll and gdiplus.dll, but also a call to Direct3DCreate9 in d3d9.dll.

    Read the article

  • Calculate Percentage help

    - by DAVID
    Hi this code gives me employee salaries and manager salaries. SELECT E.EMP_FNAME AS MANAGER, E.EMP_SALARY, D.DEPT_NO, A.EMP_FNAME AS EMPLOYEE, A.EMP_SALARY FROM EMPLOYEE E, EMPLOYEE A, DEPARTMENT D WHERE E.EMP_NIN = A.EMP_MANAGER AND A.EMP_MANAGER = D.EMP_MANAGER; How can i only show the employees that have a salary within 10% of their manager salary?

    Read the article

  • UINavigationController navigation stack problems in Landscape Mode

    - by David F
    I have a iPhone application that I am currently converting to a Universal Binary to work with the iPad. I have successfully implemented everything I need in terms of layout so that full landscape functionality is now supported in my app (previously I primarily used portrait mode to display content). But, I have one strange problem, and it ONLY occurs in landscape mode: when I push a view controller onto the stack, it takes two taps on the back button to return to the previous view controller!!! The first tap shows a blank view, but with the same name on the left-side back navigation button, the second tap takes the controller back to previous view like it should. I don't have an iPad to test, so I am relying on the simulator. The problem does not show up on the iPhone and doesn't show up if you rotate back to portrait mode. My app consists of a tabbarcontroller with navigation controllers loaded for its vc's: //application delegate - (void)applicationDidFinishLaunching:(UIApplication *)application //.... WebHelpViewController *vc8 = [[WebHelpViewController alloc] init]; UINavigationController *nv8 = [[UINavigationController alloc] initWithRootViewController:vc8]; [self.tabBarController setViewControllers:[NSArray arrayWithObjects:nv1,nv2,nv3,nv4,nv5,nv6,nv7,nv8,nil]]; To implement landscape capability, the UITabBarController is overridden to autorotate when required: //CustomTabBarController.m - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return [[(UINavigationController *)self.selectedViewController topViewController] shouldAutorotateToInterfaceOrientation:interfaceOrientation]; } ... works fine. I navigate into new views using this method SomeViewController *vc = [[SomeViewController alloc] init]; [self.navigationController pushViewController:vc animated:YES]; [vc release]; Has anyone encountered this problem, and do they know if it's only a simulation error?

    Read the article

  • Using local classes with STL algorithms

    - by David Rodríguez - dribeas
    I have always wondered why you cannot use locally defined classes as predicates to STL algorithms. In the question: Approaching STL algorithms, lambda, local classes and other approaches, BubbaT mentions says that 'Since the C++ standard forbids local types to be used as arguments' Example code: int main() { int array[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; std::vector<int> v( array, array+10 ); struct pair : public std::unary_function<int,bool> { bool operator()( int x ) { return !( x % 2 ); } }; std::remove_if( v.begin(), v.end(), pair() ); // error } Does anyone know where in the standard is the restriction? What is the rationale for disallowing local types?

    Read the article

  • System.Security.Permissions.SecurityPermission and Reflection on Godaddy

    - by David Murdoch
    I have the following method: public static UserControl LoadControl(string UserControlPath, params object[] constructorParameters) { var p = new Page(); var ctl = p.LoadControl(UserControlPath) as UserControl; // Find the relevant constructor if (ctl != null) { ConstructorInfo constructor = ctl.GetType().BaseType.GetConstructor(constructorParameters.Select(constParam => constParam == null ? "".GetType() : constParam.GetType()).ToArray()); //And then call the relevant constructor if (constructor == null) { throw new MemberAccessException("The requested constructor was not found on : " + ctl.GetType().BaseType.ToString()); } constructor.Invoke(ctl, constructorParameters); } // Finally return the fully initialized UC return ctl; } Which when executed on a Godaddy shared host gives me System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    Read the article

  • Audio in xCode4.x is producing console warnings

    - by David DelMonte
    While the app works, I am seeing pages of console log warnings when I'm running my app on the simulator. Even Apple's "LoadPresetDemo" sample app produces the same warning messages. I don't want to reproduce them all here (about 500 lines), but here are few. I would appreciate any insight into what's going on... Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2011-11-30 17:43:00.098 appname[4175:16c03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security ... Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2011-11-30 17:43:00.245 appname[4175:16c03] Cannot find function pointer NewPlugIn for factory C5A4CE5B-0BB8-11D8-9D75-0003939615B6 in CFBundle/CFPlugIn 0x7b6b0780 (bundle, not loaded) 2011-11-30 17:43:00.255 appname[4175:16c03] Error loading /Library/Audio/Plug-Ins/HAL/iSightAudio.plugin/Contents/MacOS/iSightAudio: dlopen(/Library/Audio/Plug-Ins/HAL/iSightAudio.plugin/Contents/MacOS/iSightAudio, 262): Symbol not found: ___CFObjCIsCollectable

    Read the article

  • Variable naming for arrays/lists/collections - C#

    - by David Neale
    What should I call a variable instantiated with some type of array? Is it okay to simply use a pluralised form of the type being held? IList<Person> people = new List<Person>(); or should I append something like 'List' to the name? IList<Person> personList = new List<Person>(); Is it generally acceptable to have loops like this? foreach(string item in items) { //Do something }

    Read the article

  • Using TagLib as a framework in XCode: C++ header <string> not found

    - by david
    I have build TagLib as a framework using this: https://github.com/rahvin/TagLib.framework. I dragged the produced framework into my XCode Project and now it says: "String: No such file or directory" on including <TagLib/TagLib.h>. I've never done this before. It seems as XCode does not include the c++ headers by default ?! (Or is string not a c++ default header?!) Note: The taglib headers are included right. <string> is the problem

    Read the article

  • ClickOnce Deployment online questions

    - by David Archer
    Hi all, Bit of a strange question, but how do ClickOnce deployments work from a web site? I seem to be having some problems with this. Basically, the setup file will download when you click the "install" button, but then some files are missing. Do you need to be on a Microsoft server to run ClickOnce deployments? I usually do deployments over a local server with UNC, and as this is the first time I've done one online I'm struggling a bit. Any newbie tutorials you can point me to would be great, and if I do need a special host for it, could you please recommend some? Cheers!

    Read the article

  • GDI+ double buffering in C++

    - by David Titarenco
    I haven't written anything with GDI for a while now (and never with GDI+), and I'm just working on a fun project, but for the life of me, I can't figure out how to double buffer GDI+ void DrawStuff(HWND hWnd) { HDC hdc; HDC hdcBuffer; PAINTSTRUCT ps; hdc = BeginPaint(hWnd, &ps); hdcBuffer = CreateCompatibleDC(hdc); Graphics graphics(hdc); graphics.Clear(Color::Black); // drawing stuff, i.e. bunnies: Image bunny(L"bunny.gif"); graphics.DrawImage(&bunny, 0, 0, bunny.GetWidth(), bunny.GetHeight()); BitBlt(hdc, 0,0, WIDTH , HEIGHT, hdcBuffer, 0,0, SRCCOPY); EndPaint(hWnd, &ps); } The above works (everything renders perfectly), but it flickers. If I change Graphics graphics(hdc); to Graphics graphics(hdcBuffer);, I see nothing (although I should be bitblt'ing the buffer-hWnd hdc at the bottom). My message pipeline is set up properly (WM_PAINT calls DrawStuff), and I'm forcing a WM_PAINT message every program loop by calling RedrawWindow(window, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_UPDATENOW); I'm probably going about the wrong way to do this, any ideas? The MSDN documentation is cryptic at best.

    Read the article

  • OpenLayers: Raise event when map is zoomed or moved by user

    - by David Pfeffer
    I'm using OpenLayers to display OpenStreetMap maps. (Though, I'd assume this should be general enough to work for any map product...) I'm displaying some very sophisticated vector overlays, and the amount and resolution of the features I'm returning from the server via GeoJSON to overlay has proven too much for many computers. What I'd like to do now instead is to only send data befitting the resolution of the current zoom, and fitting the current view port. This should be relatively easy to do using the GetResolution and CalculateBounds methods on the Map object. However, I don't know when to call these methods because I can't find a way to register a function to be called when the user pans the map (changing the view port) or zooms the map (changing the resolution and view port). How can I get a callback when the user pans or zooms the map?

    Read the article

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