Daily Archives

Articles indexed Sunday May 23 2010

Page 10/78 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • RuntimeException from xmlbeans - can't find compiled schema

    - by findango
    I'm getting a RuntimeException while executing some code that depends on generated xmlbeans classes. I can't figure out if this is: me missing something during code-generation or packaging a runtime dependency missing a misleading error message, and I should be looking elsewhere. The xbean.jar version is the same in the build and execution environment. Anyone seen this before or have any ideas? Thanks. ...snip... Caused by: java.lang.RuntimeException: Could not instantiate SchemaTypeSystemImpl (java.lang.reflect.InvocationTargetException): is the version of xbean.jar correct? at schemaorg_apache_xmlbeans.system.s2B8331230CBD98F4933B0B025B6BF726.TypeSystemHolder.loadTypeSystem(Unknown Source) at schemaorg_apache_xmlbeans.system.s2B8331230CBD98F4933B0B025B6BF726.TypeSystemHolder.(Unknown Source) ... 38 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494) ... 40 more Caused by: org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS compiled schema: Could not locate compiled schema resource schemaorg_apache_xmlbeans/system/s2B8331230CBD98F4933B0B025B6BF726/index.xsb (schemaorg_apache_xmlbeans.system.s2B8331230CBD98F4933B0B025B6BF726.index) - code 0 at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.(SchemaTypeSystemImpl.java:1504) at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.initFromHeader(SchemaTypeSystemImpl.java:260) at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.(SchemaTypeSystemImpl.java:183) ... 44 more ...snip...

    Read the article

  • Windows-Mobile Directshow: Specifying bitrate/quality of a WMV video capture

    - by Landstander
    Hi- I'm stumped on this, and I'm really hoping someone could point me in the right direction. I'm currently capturing video in Windows Mobile and encoding it using the WMV 9 DMO (CLSID_CWMV9EncMediaObject). That all works well enough, but the output video's bitrate is too high, resulting in a video file that's much too large for my needs. Ultimately, my goal is to mimic the video settings that Microsoft's Camera Capture Dialog outputs in the "messaging" quality mode (64kbps) from my C++ code. Currently, my code's outputting a WMV file with a bitrate of 352kbps. The only example I could find of specifying the capture bitrate with a WMV9 DMO was this. The idea in that code was basically to use a propertybag to write a bitrate to a property of the DMO. Update: In windows mobile, the closest codec property I can find that seems to equate to the bitrate is "g_wszWMVCVBRQuality". Microsoft's documentation of this property is extremely confusing to me: It basically seems to say that a higher number equates to a higher quality, but it gives absolutely no explanation of the specifics for each number. When I attempt to set this property to value like "1" via a propertybag for the WMV9 DMO, I run into a -2147467259 (unknown) error. To summarize: What is the basic strategy to specify the bitrate/quality of a video being captured via directshow (wmv9) on a windows mobile platform? I've heard (or wondered about) the following methods: Use the propertybag to change the encoder DMO's property that corresponds to bitrate/quality (currently failing) Create your own custom transcoder/encoder to specify it. This seems unnecessary since the WMV encoder works well enough- it's just at too high a bitrate. The VIDEOINFOHEADER has a bitrate property, but I suspect that specifying new settings here will do nothing to alter the actual encoding process since I wouldn't think file attributes would come into play until after the encoding. Any suggestions? PS: I would post specific source code, but at this point it may confuse more than it helps since I'm floundering so much on how to do this. At this point, I'm just trying to validate the general strategy. THANKS!

    Read the article

  • Use gmail domain account with IMAP authentication with SAML authentication not working...

    - by mscd000
    I have a python script that interfaces gmail accounts and allows searches, etc. This works on normal emails (ending on @gmail.com) but not on domain accounts. In this case authentication is done via SAML, and IMAP is enabled on the gmail domain account... The instructions from google on how to configure IMAP only seem to work for @gmail.com accounts... I've tried authentication to IMAP using user, user@admin and using host: imap.gmail.com as well as my domain's email and authentication is not working.... is there a specific 'host' from gmail for domain accounts? other way to get imap on gmail domain accounts? Thanks, Rodolfo

    Read the article

  • How to mimic built-in .NET serialization idioms?

    - by Matt Enright
    I have a library (written in C#) for which I need to read/write representations of my objects to disk (or to any Stream) in a particular binary format (to ensure compatibility with C/Java library implementations). The format requires a fair amount of bit-packing and some DEFLATE'd bytestreams. I would like my library, however, to be as idiomatic .NET as possible, however, and so would like to provide an API as close as possible to the normal binary serialization process. I'm aware of the ability to implement the IFormatter interface, but being that I really am unable to reuse any part of the built-in serialization stack, is it worth doing this, or will it just bring unnecessary overhead. In other words: Implement IFormatter and co. OR Just provide "Serialize"/"Deserialize" methods that act on a Stream? A good point brought up below about needing the serialization semantics for any case involving Remoting. In a case where using MarshalByRef objects is feasible, I'm pretty sure that this won't be an issue, so leaving that aside are there any benefits or drawbacks to using the ISerializable/IFormatter versus a custom stack (or, is my understanding remoting incorrectly)?

    Read the article

  • How to access SQL CE 3.5 from VB6

    - by Masterfu
    We have a .NET 3.5 SP1 application written in C# that stores data in an SQL CE 3.5 Database. We also need to access (read only) this very data from a legacy VB6 application. I don't know if this is at all possible. There are several approaches to this problem that I can think of. 1) I have read about ADOCE Connections, but this seems to be an option for embedded Visual Basic only 2) I can't seem to get a connection working using ADODB.Connection Objects like so Dim MyConnObj As New ADODB.Connection ' Microsoft.SQLSERVER.CE.OLEDB.3.5 ' Microsoft.SQLSERVER.MOBILE.OLEDB.3.0 MyConnObj.ConnectionString = "Provider=SQLOLEDB;Data Source=c:\test.sdf" MyConnObj.Open Maybe this is just a bad choice of providers? I also tried the providers that appear as comments above and different connection strings, but to no avail. Both providers are not installed on my dev machine and won't be installed on my customer's machine. 3) Maybe there is a way to use a more generic approach like ODBC? But I believe this would result in setup / deployment work, right? Does anyone have any experience with this scenario? As you can see, I am really looking for some good starting points. I also accept answers like "This is drop dead simple and so are you" as long as they come with some guiding directions ;-)

    Read the article

  • c++ passing unknown type to a function and any Class type definition

    - by user259789
    I am trying to create a generic class to write and read Objects to/from file. Called it ActiveRecord class only has one method, which saves the class itself: void ActiveRecord::saveRecord(){ string fileName = "data.dat"; ofstream stream(fileName.c_str(), ios::out); if (!stream) { cerr << "Error opening file: " << fileName << endl; exit(1); } stream.write(reinterpret_cast<const char *> (this), sizeof(ActiveRecord)); stream.close(); } now I'm extending this class with User class: class User : public ActiveRecord { public: User(void); ~User(void); string name; string lastName; }; to create and save the user I would like to do something like: User user = User(); user.name = "John"; user.lastName = "Smith" user.save(); how can I get this ActiveRecord::saveRecord() method to take any object, and class definition so it writes whatever i send it: to look like: void ActiveRecord::saveRecord(foo_instance, FooClass){ string fileName = "data.dat"; ofstream stream(fileName.c_str(), ios::out); if (!stream) { cerr << "Error opening file: " << fileName << endl; exit(1); } stream.write(reinterpret_cast<const char *> (foo_instance), sizeof(FooClass)); stream.close(); } and while we're at it, what is the default Object type in c++. eg. in objective-c it's id in java it's Object in AS3 it's Object what is it in C++??

    Read the article

  • Objective C selector memory managment (does this leak memory)?

    - by James Jones
    - (IBAction) someButtonCall { if(!someCondition) { someButtonCallBack = @selector(someButtonCall); [self presentModalViewController:someController animated:YES]; } else ... } //Called from someController - (void) someControllerFinished:(BOOL) ok { [self dismissModalViewControllerAnimated:YES]; if(ok) [self performSelector:someButtonCallBack]; else ... } I'm wondering if the user keeps getting into the !someCondition clause if the selector is leaked by assigning a new selector each time (the code above is hypothetical and not what i'm doing). Any help is appreciated. Thanks, James Jones

    Read the article

  • nmake: can a batch file run as a art of a command block, affect the environment of the nmake.exe pro

    - by Cheeso
    I think in nmake if I do this: example : set value=77 echo %%value%% The result will display 77 on the console. Is there a way for me to invoke a .cmd or .bat file that will affect the environment of the nmake.exe process? Suppose I put the statement set value=77 in a file called "setvalue.cmd". Then change the makefile to this: example : setvalue echo %%value%% I get: %value% Alternatively, if there's a way to set a macro within a command block, that would also work. Or, a way to set the value of a macro from a batch file, even outside a command block.

    Read the article

  • Rails routes question. Always find by name and remove /class_name/ from route

    - by Hock
    I have a Category model and a Product model. Category has_many products and Product belongs_to Category I want my routes to be like this: /:category_type/:category_name/ opens Product#index /:category_type/ opens Category#show / opens Category#index Is there a way to achieve that with resources? I tried with path_prefix but I just can't get it done. Any help? Thanks, Nicolás Hock Isaza

    Read the article

  • Group by/count in LINQ against SQL Compact 3.5 SP2

    - by bash74
    Hello, I am using LINQ-To-Entities in C# and run queries against a SQL Compact Server 3.5 SP2. What I try to achieve is a simple group by with an additional where clause which includes a Count(). var baseIdent="expression"; var found=from o in ObservedElements where o.ObservedRoots.BaseIdent==baseIdent group o by o.ID into grouped where grouped.Count()==1 select new {key=grouped.Key, val=grouped}; foreach(var res in found){ //do something here } This query throws the famous exception "A parameter is not allowed in this location. Ensure that the '@' sign and all other parameters are in a valid location in the SQL statement." When I either omit the where clause OR directly enter the expression "expression" in the query (where o.ObservedRoots.BaseIdent=="expression") everything just works fine. Does anybody know how to solve this? Workaround would also be fine? Thanks in advance, Sebastian

    Read the article

  • Connecting to a SQL Server Compact Edition (.sdf) from an MFC application

    - by Hazerd
    Hey ! I'm building an MFC app in Visual Studio 2008 which classifies textures and I need some sort of lightweight database to hold the characteristics (just some doubles and strings) which can be: -carried around with the app on different computers; -be able to perform queries on it from the app (searches , updates ,inserts ,etc); Currently I'm looking into SQL compact edition because it was very easy to create from Visual Studio ( I also need only one table) but I having a hard time connecting and updating the db from C++. This is what I've found on msdn regarding C++ and SQLCE: public: void createSqlCeConnection(){ SqlCeConnection* myConnection = new SqlCeConnection(); myConnection->ConnectionString = "DataSource = blabla.sdf"; MessageBox::Show(String::Format( S"Connection State: {0}", __box(myConnection->State))); } Unfortunately my experience with .net apps is pretty limited. Hopefully you bright minds could tell me if I'm on the right path and what links and includes should I add for this to work with an C++ MFC projects. Thanks !

    Read the article

  • How do I corrupt a SQL CE Database?

    - by Peter Tate
    I want to be able to check for a corrupted database at startup, and then repair it programmatically. I can do that easily enough. My problem is that I want to test that things work the way I expect. Does anyone know of a way to purposefully corrupt a database so I can test my code?

    Read the article

  • How do I define functions using PLT Scheme macros?

    - by nickname
    I am trying to write a macro that defines a special class of data structure with associated functions. I know this is possible; it is done multiple times in the core language itself. As a specific example, how would I define the define-struct macro in Scheme itself. It needs to create make-struct, struct-<<field>>, etc functions. I tried doing this using define, however, this only defines the function in the macro's lexical scope. How can I actually define a function in a macro?

    Read the article

  • Are there any good resources for developing Entity Framework 4 code-first?

    - by KallDrexx
    I am trying to convert my model-first project to code-first, as I can see dealing with the models with the graphical designer will become hard. Unfortunately, with all my googling I can't find one good reference that describes how to do code-first development. Most resources are out of date (so out of date they refer to it as code-only), and the other references I can find seem to assume you understand the basics of context building and code-first (for example, they reference code to build contexts but don't describe where that code should actually go, and how it's actually run). Are there any decent resources for code-first development, that describe how to map your POCO entities into a database schema?

    Read the article

  • sqlserver 2008 and sql CE over Microsoft sync framework

    - by malik
    The server will drop the connection, because the client driver has sent multiple requests while the session is in single-user mode. This error occurs when a client sends a request to reset the connection while there are batches still running in the session, or when the client sends a request while the session is resetting a connection. Please contact the client driver vendor. Synchronisation process some time work and mostly fails. I have 5 client of sql CE that need to sync and i am using WCF IIS and sql 2008 for this process.

    Read the article

  • Visual Studio : Make files in a folder got to bin/debug and not bin/debug/folder

    - by CF_Maintainer
    Consider This: I have folder called \SQLCE35Dlls inside my solution. It has some dlls that are required for application to interact with a SQLCE database in a stand alone fashion [without sql server ce 35 install on the PC]. After a build, I want these files to go to bin/debug and not to bin/debug/SQLCE35Dlls/. Setting "Copy if Newer" creates the latter situation. I want the former. Is it possible to facilitate this or does this have to done as part of the installer script? [avoiding the solution of adding the dlls at the root level of the solution instead of inside a folder]. This is a Winforms project solution.

    Read the article

  • How can I debug an application crash in Win7 after it's happened?

    - by parsley72
    I have a Visual Basic 6 application that I've recently changed to use a couple of C++ DLLs I've written in Visual Studio 2008. The application works fine on my PC, but when we install it on one of our test PCs it tends to crash during shutdown - we see the Win 7 message "Your application has failed" or whatever it is. I know Win 7 stores data that can be used to analyse the crash. I've got the source code and .PDB files from the build so I should be able to use that, but I can't figure out where Win 7 stores the data from the crash. The Event Viewer shows the crash but doesn't have any data and the directory C:\Windows\Minidump doesn't exist. Where do the crash files get put?

    Read the article

  • Can a sub-procedure procedure lock and modify the same rows FOR UPDATE that its calling procedure al

    - by RenderIn
    Will the following code lead to a deadlock or should it work without any problem? I've got something similar and it's working but I didn't think it would. I thought the parent procedure's lock would have resulted in a deadlock for the child procedure but it doesn't seem to be. If it works, why? My guess is that the nested FOR UPDATE is not running into a deadlock because it's smart enough to realize that it is being called by the same procedure that has the current lock. Would this be a deadlock if FOO_PROC was not a nested procedure? DECLARE FOO_PROC(c_someName VARCHAR2) as cursor c1 is select * from awesome_people where person_name = c_someName FOR UPDATE; BEGIN open c1; update awesome_people set person_name = UPPER(person_name); close c1; END FOO_PROC; cursor my_cur is select * from awesome_people where person_name = 'John Doe' FOR UPDATE; BEGIN for onerow in c1 loop FOO_PROC(onerow.person_name); end loop; END;

    Read the article

  • Number of lines in csv.DictReader

    - by Alan Harris-Reid
    Hi there, I have a csv DictReader object (using Python 3.1), but I would like to know the number of lines/rows contained in the reader before I iterate through it. Something like as follows... myreader = csv.DictReader(open('myFile.csv', newline='')) totalrows = ? rowcount = 0 for row in myreader: rowcount +=1 print("Row %d/%d" % (rowcount,totalrows)) I know I could get the total by iterating through the reader, but then I couldn't run the 'for' loop. I could iterate through a copy of the reader, but I cannot find how to copy an iterator. I could also use totalrows = len(open('myFile.csv').readlines()) but that seems an unnecessary re-opening of the file. I would rather get the count from the DictReader if possible. Any help would be appreciated. Alan

    Read the article

  • ByteBuffer recycling class

    - by Chris Dennett
    Hi everyone, I'm wonder how I'd code up a ByteBuffer recycling class that can get me a ByteBuffer which is at least as big as the specified length, and which can lock up ByteBuffer objects in use to prevent their use while they are being used by my code. This would prevent re-construction of DirectByteBuffers and such over and over, instead using existing ones. Is there an existing Java library which can do this very effectively? I know Javolution can work with object recycling, but does that extend to the ByteBuffer class in this context with the requirements set out? Cheers, Chris

    Read the article

  • Richmond Code Camp 2010.1 &ndash; Developing WPF Applications using Model-View-ViewModel

    - by John Blumenauer
    The code and slides from my Developing WPF Applications using Model-View-ViewModel session at Richmond Code Camp can be found HERE. During the session, a number of the attendees had some really great questions which tells me they’re really thinking about how to start using MVVM in their own apps.  I’ll be interested to hear feedback as they start investigating and introducing MVVM in their applications.  If you experience any problems downloading the slides or code, please let me know.

    Read the article

  • Richmond Code Camp 2010.1 &ndash; A Lap Around MEF

    - by John Blumenauer
    Thanks to all the attendees who came to my Lap Around MEF session at Richmond Code Camp today.   It seems many developers are seeking ways to make their applications more dynamic and extensible.  Hopefully, I provided them with a number of ideas on to get started with MEF and utilize it to tackle this challenge.  The slides from my session can be found HERE.  If you experience any problems downloading the slides or code, please let me know.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >