Scrontch

1

votes
1

answer
112

views

C++ Boost.Serialization - Non intrusive serialization of user-defined members?

I have a class structure like class MemberClass; class ContainerClass { MemberClass special_member; int other_members; }; Following the example in http://www.boost.org/doc/libs/1_66_0/libs/serialization/doc/ i want to write an non-intrusive serialization: template void serialize(Archive & ar, Contai...
Scrontch
1

votes
1

answer
136

views

TFS 2015 can't see other user's pending changes on branch

MS Team Foundation Server 2015, with the native TFS SCM: On the main branch, every user can see pending changes from every other user. I branched off a branch from the main branch with several check-ins in the past already. I'm currently having locally modified files on that branch and see them as p...
Scrontch
1

votes
0

answer
35

views

How to prevent application's locale changing when user changes Windows date/time format (C++, Windows native app)

Our application is a Windows native 64 bit application developed in C++ (Visual Studio) with RogueWave's Stingray library, itself using MFC for the UI. In the application, dates are shown in various places (grids, dialog box controls etc.). As it is a complex business application, we handle the date...
Scrontch
1

votes
1

answer
1.1k

views

Extracting SVG from XML. Which Java XML API to choose? [closed]

I need to do the following: Parse XML document that contains SVG (Scalable Vector Graphics) as some of the elements. SVG is itself XML. But i need to extract the SVG part as a whole, not needing to parse the contents of the SVG strings. Example: ... [arbitrary svg/xml content here ...] ... I'd like...
Scrontch
1

votes
1

answer
2.5k

views

Installing Trac on Ubuntu14.04/Apache2/mod_wsgi

I'm trying to install Edgewall's Trac ticket system on an Ubuntu 14.04 Server, with Apache2 and mod_wsgi. I have followed the instructions given here: https://help.ubuntu.com/community/TracApacheModWsgi But after point 9, when i try to view the page, it says: Forbidden You don't have permission to a...
Scrontch
1

votes
0

answer
7

views

“The stub received bad data” exception in Windows RPC call

We are facing the following issue: The architecture is as follows: A c++ native client application is connected to a native c++ server application via pipe RPC based on a IDL file. I'm not particular savvy in this domain and havent coded the relevant parts but it works since a long time. Since some...
Scrontch
1

votes
1

answer
49

views

When using branches with VS2013 and TFS2015, need to modify project files for branch

We're using TFS 2015 with its native source control (non GIT) to host our VS 2013 solutions. Lately, i have created a branch. I needed to manually fix the Scc-sections in the vcxproj files, as these contained the branch name explicitly in the SccProjectName-setting. Same when i wanted to merge the b...
Scrontch
22

votes
7

answer
29.7k

views

String processing in windows batch files: How to pad value with leading zeros?

in a Windows cmd batch file (.bat), how do i pad a numeric value, so that a given value in the range 0..99 gets transformed to a string in the range '00' to '99'. I.e. I'd like to having leading zeros for values lower than 10.
Scrontch
3

votes
1

answer
1.8k

views

Lua C API: Retrieve values from Lua function returning a table in C code

Despite searching hard, i couldn't find a valid Lua C API example for calling a Lua function returning a table. I'm new to Lua and the Lua C API, so don't assume too much. However i can read and have understood the principle of loading a Lua module from C and passing values via the stack and calling...
Scrontch
12

votes
3

answer
14.3k

views

PyCharm Community Edition problems with read-only status on project files

I'm using PyCharm Community Edition 3.4.1 on Windows 7 64bit. Whenever i open my project in PyCharm, a window comes up saying 'Clear Read-Only Status': [x] Using file system. [] Using version control inegration. Pressing [OK] has no effect. Later, when i try to save the project, it says: Could not s...
Scrontch
3

votes
1

answer
166

views

Adapting C++ std/boost iostreams to provide cyclic write to memory block

Background: I'm trying to optimize a logging system so that it uses memory-mapped files. I need to provide an std::ostream-like interface so that the logging system can write to that memory. I have identified std::strstream (which is deprecated though) and boost::iostreams::basic_array_sink could fi...
Scrontch
2

votes
4

answer
13.8k

views

HTML table: Set width of column to fit floating content

i need some advice on how to set column widths in a HTML table. I have a simple table that spans the entire width of the conatining div. (Using table width='100%') Here's the rendering: What i want to achieve is that the last column 'Weight' is exactly the size of the contained elements. The contain...
Scrontch
6

votes
1

answer
1.2k

views

Python3 venv: Can env directory be renamed?

I'm using Python 3.4 on Windows. I have created a virtual environment with python c:\Python34\Tools\Scripts\pyvenv.py foo Then activated it foo\Scripts\activate.bat And installed several libraries in it. Question: Is it safe to rename the venv folder 'foo' to 'bar'? I.e. once i have renamed foo to b...
Scrontch
3

votes
1

answer
813

views

Need a PowerShell 2.0 replacement for string.replace method

I used the following PowerShell command as part of a post-build process that works well on recent versions of PowerShell: powershell.exe –command '(Get-Content VSTEST.BAT).replace('__DLL_NAME__', 'SKCltMgrTestu.dll') | Set-Content 'C:\Builds\29\nSKEP\Dev_Continue\bin\VSTEST_SKCltMgrTest.BAT' But I...
Scrontch
1

votes
1

answer
340

views

TFS: Check if local file is latest version from within script

Ref: Visual Studio Team Foundation Server 2015: How do i check from within a batch- or Powershell-script for a given file under TFS source control, if a local file is or is not equal to the latest version on the server?
Scrontch
4

votes
2

answer
2k

views

Moving a Python environment over to a new OS install

I have reinstalled my operating system (moved from windows XP to Windows 7). I have reinstalled Python 2.7. But i had a lot of packages installed in my old environment. (Django, sciPy, jinja2, matplotlib, numpy, networkx, to name just a view) I still have my old Python installation lying around on a...
Scrontch
3

votes
2

answer
1.9k

views

How use Python unittest to test a class hierarchy?

given a Python class hierarchy, say class Base: def method1 def method2 def method3 ... class Derived1(Base) class Derived2(Base) etc. and given that Base defines some common interface which is re-implemented differently in each Derived class. What would be the most straightforward way to unit test...
Scrontch
14

votes
2

answer
1.4k

views

Python: How to abruptly disconnect a socket without closing it appropriately

i have a Python test program for testing features of another software component, let's call the latter the component under test (COT). The Python test program is connected to the COT via a persistent TCP connection. The Python program is using the Python socket API for this. Now in order to simulate...
Scrontch
4

votes
1

answer
289

views

Django Models, cyclic foreign keys

How to model the following relationship: class Country(models.Model): # The capital city of this country capital = models.ForeignKey(City) ## other country stuff class City(models.Model): # The country where this city lies in country = models.ForeignKey(Country) ## other city stuff This obviously do...
Scrontch
3

votes
4

answer
348

views

C++ multiple inheritance from different abstract bases with same pure virtual method

Imagine class A { public: virtual void f() = 0; }; class B { public: virtual void f() = 0; }; class C : public A,B { public: virtual void f() { // implementation here } }; C c(); That seems to compile. (Didn't try to compile my example, but a more complex real life scenario). I'm a bit surprise it d...
Scrontch
2

votes
2

answer
2.4k

views

Java applet: How to tell the browser (Firefox) where to look for libraries (jars)

I have written a Java applet class and made a small HTML page to include it via the -tag. (This is running locally on my disk drive for the moment) This works well, that is, the applet is being loaded properly. But the applet depends on external libraries (jars). E.g. i imported org.apache.batik.swi...
Scrontch
68

votes
9

answer
83.8k

views

Python: Removing list element while iterating over list [duplicate]

This question already has an answer here: How to remove items from a list while iterating? 22 answers I'm iterating over a list of elements in Python, do some action on it, and then remove them if they meet certain criteria. for element in somelist: do_action(element) if check(element): remove_elem...
Scrontch