PostId int64 13 11.8M | PostCreationDate stringlengths 19 19 | OwnerUserId int64 3 1.57M | OwnerCreationDate stringlengths 10 19 | ReputationAtPostCreation int64 -33 210k | OwnerUndeletedAnswerCountAtPostTime int64 0 5.77k | Title stringlengths 10 250 | BodyMarkdown stringlengths 12 30k | Tag1 stringlengths 1 25 ⌀ | Tag2 stringlengths 1 25 ⌀ | Tag3 stringlengths 1 25 ⌀ | Tag4 stringlengths 1 25 ⌀ | Tag5 stringlengths 1 25 ⌀ | PostClosedDate stringlengths 19 19 ⌀ | OpenStatus stringclasses 5 values | unified_texts stringlengths 47 30.1k | OpenStatus_id int64 0 4 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,679,313 | 10/06/2011 19:16:56 | 469,106 | 10/07/2010 13:01:30 | 2,228 | 158 | Delete Temporary File with FileStreamResult | I am using MVC3 to return a temporary file that is created in code. Then, I use `FileStreamResult` to stream this file back to the client. However, as this is a temporary file that I no longer need, I would like to clean up the file. I don't know how to do this since I am already hitting the return statement while streaming. Thanks.
public FileStreamResult Download()
{
string filename = Path.GetTempFileName();
using (FileStream stream = new FileStream(filename, FileMode.OpenOrCreate))
{
CreateFile(this.DataContext, stream);
}
using (FileStream outputStream = new FileStream(filename, FileMode.Open))
{
HttpContext.Response.AddHeader("content-disposition", "attachment; filename=MyFile.xlsx");
return new FileStreamResult(outputStream,MimeTypeUtil.GetMimeType("xlsx"));
}
} | asp.net | asp.net-mvc | asp.net-mvc-3 | mvc | download | null | open | Delete Temporary File with FileStreamResult
===
I am using MVC3 to return a temporary file that is created in code. Then, I use `FileStreamResult` to stream this file back to the client. However, as this is a temporary file that I no longer need, I would like to clean up the file. I don't know how to do this since I am already hitting the return statement while streaming. Thanks.
public FileStreamResult Download()
{
string filename = Path.GetTempFileName();
using (FileStream stream = new FileStream(filename, FileMode.OpenOrCreate))
{
CreateFile(this.DataContext, stream);
}
using (FileStream outputStream = new FileStream(filename, FileMode.Open))
{
HttpContext.Response.AddHeader("content-disposition", "attachment; filename=MyFile.xlsx");
return new FileStreamResult(outputStream,MimeTypeUtil.GetMimeType("xlsx"));
}
} | 0 |
11,240,414 | 06/28/2012 08:01:54 | 1,436,526 | 06/05/2012 04:45:06 | 29 | 0 | execute javascript on ajax response | <html>
<body>
<div id="div1">
</div>
<div id="div2">
<input type="button" value="Go!" onclick="go()" />
</div>
<script type="text/javascript">
window.onload=function(){
var newsc = "<script id='sc1' type='text/javascript'>function go() { alert('GO!') }<\/script>";
var e = document.getElementById('div1');
e.innerHTML = newsc;
eval(document.getElementById('div1').innerHTML);
}
</script>
</body>
</html>
This is my html page.when page loads `alert('Go')` is fired but this not what i am want to do. I would like to do is that when we click on **Go** button then `go` function should be called | javascript | ajax | jquery-ajax | null | null | 06/28/2012 08:29:27 | not a real question | execute javascript on ajax response
===
<html>
<body>
<div id="div1">
</div>
<div id="div2">
<input type="button" value="Go!" onclick="go()" />
</div>
<script type="text/javascript">
window.onload=function(){
var newsc = "<script id='sc1' type='text/javascript'>function go() { alert('GO!') }<\/script>";
var e = document.getElementById('div1');
e.innerHTML = newsc;
eval(document.getElementById('div1').innerHTML);
}
</script>
</body>
</html>
This is my html page.when page loads `alert('Go')` is fired but this not what i am want to do. I would like to do is that when we click on **Go** button then `go` function should be called | 1 |
2,014,364 | 01/06/2010 16:21:05 | 244,863 | 01/06/2010 16:21:04 | 1 | 0 | foreach limit items | I have the following code
foreach (var rssItem in rss.Channel.Items)
{
}
But only want 6 items not all items, how can i do it in c#?
Thanks | c# | loops | foreach | null | null | null | open | foreach limit items
===
I have the following code
foreach (var rssItem in rss.Channel.Items)
{
}
But only want 6 items not all items, how can i do it in c#?
Thanks | 0 |
1,135,672 | 07/16/2009 06:05:05 | 123,234 | 06/15/2009 17:08:29 | 2,190 | 126 | javaScript to detect mime type of text/xml | is it possible to detect the mime type of a document - particularly if it is text/xml in JavaScript. this needs to work in Chrome.
thanks,
Josh | google-chrome | javascript | mime-types | null | null | null | open | javaScript to detect mime type of text/xml
===
is it possible to detect the mime type of a document - particularly if it is text/xml in JavaScript. this needs to work in Chrome.
thanks,
Josh | 0 |
3,956,655 | 10/18/2010 04:45:32 | 471,927 | 10/11/2010 04:36:04 | 63 | 0 | scjp exam preparation tips | I am going to appear for scjp1.6 in the mid november. Please tell me which book should i refer? Which part should i give more weigthage? How much time shoud i spend on each topic? My friends are also going to write. I will share the tips with them. We would be grateful if any of you help us. | java | scjp | null | null | null | 10/18/2010 05:07:24 | off topic | scjp exam preparation tips
===
I am going to appear for scjp1.6 in the mid november. Please tell me which book should i refer? Which part should i give more weigthage? How much time shoud i spend on each topic? My friends are also going to write. I will share the tips with them. We would be grateful if any of you help us. | 2 |
4,048,532 | 10/29/2010 02:24:23 | 297,092 | 03/19/2010 04:56:07 | 59 | 1 | What is the best cross-platform language for desktop applications? (Java, Adobe Air, Flex, Silverlight??, Anything Else) | My business partner needs a desktop application programmed, and it needs to be cross-platform as he wants Mac owners (OS X) to be able to run it as well. This, of course, is a bit of a problem for me as I program in PHP for my web projects and exclusively in C# (formerly used Visual Basic) for my desktop apps. I've been using (and love) NetBeans for my PHP stuff, and love Visual Studio just as much; they're both excellent IDEs.
**With this in mind, I'd like to find a language and IDE that's as similar to Visual Studio as possible** (or at least something that makes development as easy as it does) for my cross-platform application development. In fact, if there is a language I can use with VS I'd be extremely happy. I realize that NetBeans has a Java Desktop App IDE, but have been having problems with it (my question in regards to that issue is [here][1]. I am also not sure that I really want to learn and use Java if there is a better, easier option out there.
Obviously, the first language that came to mind that I can use cross-platform was Java, but I've also heard of people using Adobe Air, as well as Flex being used. I've never programmed in any of those languages, and as such have no frame of reference from which I can decide which would be best for me. I'm also not sure what other options there may be for me; perhaps there's another language I can use that'd be better than the three options I've already provided. (Can you make desktop apps with Silverlight? If so, did MS make an interpreter that will get them to work on OS X?)
I like the syntax of C# quite a bit, and the Visual Studio IDE makes it extremely easy to make my apps with. As such, I'd like to find something that'll work as well for me with the cross-platform shatner as C# and its IDE does with my Windows apps.
Thanks in advance for your help/opinions!
[1]: http://stackoverflow.com/questions/4048392/netbeans-6-9-1-java-application-wont-compile-run | java | flex | cross-platform | air | desktop-application | null | open | What is the best cross-platform language for desktop applications? (Java, Adobe Air, Flex, Silverlight??, Anything Else)
===
My business partner needs a desktop application programmed, and it needs to be cross-platform as he wants Mac owners (OS X) to be able to run it as well. This, of course, is a bit of a problem for me as I program in PHP for my web projects and exclusively in C# (formerly used Visual Basic) for my desktop apps. I've been using (and love) NetBeans for my PHP stuff, and love Visual Studio just as much; they're both excellent IDEs.
**With this in mind, I'd like to find a language and IDE that's as similar to Visual Studio as possible** (or at least something that makes development as easy as it does) for my cross-platform application development. In fact, if there is a language I can use with VS I'd be extremely happy. I realize that NetBeans has a Java Desktop App IDE, but have been having problems with it (my question in regards to that issue is [here][1]. I am also not sure that I really want to learn and use Java if there is a better, easier option out there.
Obviously, the first language that came to mind that I can use cross-platform was Java, but I've also heard of people using Adobe Air, as well as Flex being used. I've never programmed in any of those languages, and as such have no frame of reference from which I can decide which would be best for me. I'm also not sure what other options there may be for me; perhaps there's another language I can use that'd be better than the three options I've already provided. (Can you make desktop apps with Silverlight? If so, did MS make an interpreter that will get them to work on OS X?)
I like the syntax of C# quite a bit, and the Visual Studio IDE makes it extremely easy to make my apps with. As such, I'd like to find something that'll work as well for me with the cross-platform shatner as C# and its IDE does with my Windows apps.
Thanks in advance for your help/opinions!
[1]: http://stackoverflow.com/questions/4048392/netbeans-6-9-1-java-application-wont-compile-run | 0 |
4,525,684 | 12/24/2010 10:19:35 | 534,994 | 12/08/2010 12:52:30 | 46 | 1 | Should Vector be deprecated? | When we don't need synchronization ArrayList is faster than Vector. And when we do need a synchronized collection we're better off using Synchronization wrappers (correct me if I'm wrong), or synchronizing the code only when there are calls on that collection. Are there cases where using Vector is the best option? | java | vector | synchronization | null | null | 12/25/2010 03:16:56 | not constructive | Should Vector be deprecated?
===
When we don't need synchronization ArrayList is faster than Vector. And when we do need a synchronized collection we're better off using Synchronization wrappers (correct me if I'm wrong), or synchronizing the code only when there are calls on that collection. Are there cases where using Vector is the best option? | 4 |
1,000,204 | 06/16/2009 08:34:29 | 120,917 | 06/10/2009 21:48:35 | 265 | 17 | Best practice to join nhibernate and ASP.NET membership/role/profile services | I've got a generic ASP.NET (MVC) application, that uses NHibernate as the model persistence layer, and ASP.NET Membership/role/profile services as the user management layer.
The question is what can be considered as the best practice to create linkings between the domain data and the users. (For example is I want to create a forum system I want to link each topics/posts to a specific user, and want to display the user at each request).
These are the posiibilites I've been thinking of:
1. Store the user ID in NHibernate and use GetUser each time you need the namne of the user (which might result in n+1 queries)
2. Use the same database, and create a read-only NHibernate maintaned domain object User, that maps to the same data as the M/R/P services do.
3. Forget about M/R/P and create a separate user management service based on NHibernate
4. Forget about both and use J2EE/RoR/merb/DJango/etc. (please don't pick this option :) )
5. other... | asp.net | nhibernate | asp.net-membership | persistence | null | null | open | Best practice to join nhibernate and ASP.NET membership/role/profile services
===
I've got a generic ASP.NET (MVC) application, that uses NHibernate as the model persistence layer, and ASP.NET Membership/role/profile services as the user management layer.
The question is what can be considered as the best practice to create linkings between the domain data and the users. (For example is I want to create a forum system I want to link each topics/posts to a specific user, and want to display the user at each request).
These are the posiibilites I've been thinking of:
1. Store the user ID in NHibernate and use GetUser each time you need the namne of the user (which might result in n+1 queries)
2. Use the same database, and create a read-only NHibernate maintaned domain object User, that maps to the same data as the M/R/P services do.
3. Forget about M/R/P and create a separate user management service based on NHibernate
4. Forget about both and use J2EE/RoR/merb/DJango/etc. (please don't pick this option :) )
5. other... | 0 |
9,697,886 | 03/14/2012 07:58:55 | 1,198,882 | 02/09/2012 05:32:28 | 61 | 5 | Udev rules for two identical devices to name as "device1", "device2"? | I have two identical devices (same vendorId, productId) connected to USB hub. and I am writing UDev rules to rename the device as "device1", "device2".
`SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="0801", ATTRS{idProduct}=="0013", MODE="666", NAME="cardReader%n"`
I have two devices connected to the bus and now in `\dev` folder I found 3 devices as follows,
sankaran@sankaran-RV509:/etc/udev/rules.d$ ll /dev | grep card
crw-rw-rw- 1 root root 180, 97 2012-03-14 11:42 cardReader1
crw-rw-rw- 1 root root 180, 98 2012-03-14 11:42 cardReader2
crw-rw-rw- 1 root root 251, 3 2012-03-14 11:42 cardReader3
and it is not sticking to 3 devices too keep on changing. Am I missing anything on the rules? or how to get only connected devices?
Thanks... | linux | dbus | udev | null | null | 03/14/2012 12:16:16 | off topic | Udev rules for two identical devices to name as "device1", "device2"?
===
I have two identical devices (same vendorId, productId) connected to USB hub. and I am writing UDev rules to rename the device as "device1", "device2".
`SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="0801", ATTRS{idProduct}=="0013", MODE="666", NAME="cardReader%n"`
I have two devices connected to the bus and now in `\dev` folder I found 3 devices as follows,
sankaran@sankaran-RV509:/etc/udev/rules.d$ ll /dev | grep card
crw-rw-rw- 1 root root 180, 97 2012-03-14 11:42 cardReader1
crw-rw-rw- 1 root root 180, 98 2012-03-14 11:42 cardReader2
crw-rw-rw- 1 root root 251, 3 2012-03-14 11:42 cardReader3
and it is not sticking to 3 devices too keep on changing. Am I missing anything on the rules? or how to get only connected devices?
Thanks... | 2 |
2,761,325 | 05/03/2010 21:23:34 | 171,632 | 09/10/2009 18:52:20 | 180 | 9 | How can I include .pdf files when I publish but not in a search and replace in visual studio? | More specifically my problem is if I include a pdf in my project and set its build action to content so it gets copied to the server when I publish, is there a way to exclude it from visual studios search and replace feature. Would a post build action be a solution to this? I just don't want anybody to do a global search and replace in my project and mess up the pdfs...
I know I just said a mouth full so let me know if you need clarification. Thanks!!! | visual-studio | null | null | null | null | null | open | How can I include .pdf files when I publish but not in a search and replace in visual studio?
===
More specifically my problem is if I include a pdf in my project and set its build action to content so it gets copied to the server when I publish, is there a way to exclude it from visual studios search and replace feature. Would a post build action be a solution to this? I just don't want anybody to do a global search and replace in my project and mess up the pdfs...
I know I just said a mouth full so let me know if you need clarification. Thanks!!! | 0 |
254,958 | 10/31/2008 21:03:47 | 13,009 | 09/16/2008 16:37:56 | 442 | 18 | How can I Forward an Email to FogBugz and Have it Make it into a Bug? | I didn't see it in the help but I figure it's possible. Also how do I find out what email address to use? | fogbugz | email | null | null | null | null | open | How can I Forward an Email to FogBugz and Have it Make it into a Bug?
===
I didn't see it in the help but I figure it's possible. Also how do I find out what email address to use? | 0 |
9,532,956 | 03/02/2012 12:01:36 | 1,082,956 | 12/06/2011 06:26:48 | 16 | 0 | Binding ObservableCollection to Grid Inside a Listbox | Right now I have a listbox inside which a scrollviewer and a stackpanel is placed with the data binding to the observablecollection of imagelist.
I am having a photolist class which holds the image and path of it and binding it to the listbox.
<Style TargetType="{x:Type ListBox}">
<Setter Property="Foreground" Value="White" />
<Setter Property="Margin" Value="100"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBox}" >
<ScrollViewer>
<StackPanel IsItemsHost="True" Orientation="Horizontal" HorizontalAlignment="Center"/>
</ScrollViewer>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
The above code works fine showing the listbox with a scroller and stackpanel hosting the multiple images.
Now I would like to modify the listbox to have scrollviewer and a grid instead of stackpanel, so that the images are positioned like the matrix form.
Please provide me a code snippet to bind the photolist to the grid(inside a scrollviewer which is inside a listbox).
Any help would be highly appreciated. | c# | wpf | null | null | null | null | open | Binding ObservableCollection to Grid Inside a Listbox
===
Right now I have a listbox inside which a scrollviewer and a stackpanel is placed with the data binding to the observablecollection of imagelist.
I am having a photolist class which holds the image and path of it and binding it to the listbox.
<Style TargetType="{x:Type ListBox}">
<Setter Property="Foreground" Value="White" />
<Setter Property="Margin" Value="100"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBox}" >
<ScrollViewer>
<StackPanel IsItemsHost="True" Orientation="Horizontal" HorizontalAlignment="Center"/>
</ScrollViewer>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
The above code works fine showing the listbox with a scroller and stackpanel hosting the multiple images.
Now I would like to modify the listbox to have scrollviewer and a grid instead of stackpanel, so that the images are positioned like the matrix form.
Please provide me a code snippet to bind the photolist to the grid(inside a scrollviewer which is inside a listbox).
Any help would be highly appreciated. | 0 |
6,992,692 | 08/09/2011 07:21:22 | 885,416 | 08/09/2011 07:21:22 | 1 | 0 | com.db4o.ext.DatabaseClosedException | I'm working with db4o embedded for Java (JSE6) running a Servlet app under Tomcat.
Lately I started getting those weird exceptions: When trying to save a new object to the DB I get com.db4o.ext.DatabaseClosedException. The stack is huge and looking at it seems like the db4o engine runs into an endless loop causing it to crash.
Part of the stack is missing bug it repeats itself...
Some help will be much appreciated. Thanks!
com.db4o.ext.DatabaseClosedException
at com.db4o.internal.ObjectContainerBase.checkClosed(ObjectContainerBase.java:303)
at com.db4o.internal.ObjectContainerBase.checkTransaction(ObjectContainerBase.java:331)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:412)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:266)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.checkStillToSet(ObjectContainerBase.java:1646)
at com.db4o.internal.ObjectContainerBase.handleStackLimitPendings(ObjectContainerBase.java:1874)
at com.db4o.internal.ObjectContainerBase.decStackDepth(ObjectContainerBase.java:1865)
at com.db4o.internal.ObjectContainerBase.endTopLevelCall(ObjectContainerBase.java:1966)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:436)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:266)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.stillToSet(ObjectContainerBase.java:1902)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1698)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:266)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.stillToSet(ObjectContainerBase.java:1902)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1698)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:266)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.stillToSet(ObjectContainerBase.java:1902)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1698)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:266)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.stillToSet(ObjectContainerBase.java:1902)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1698)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:266)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.stillToSet(ObjectContainerBase.java:1902)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1698)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.OpenTypeHandler.writeObject(OpenTypeHandler.java:264)
at com.db4o.internal.OpenTypeHandler.write(OpenTypeHandler.java:249)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:272)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:260)
at com.db4o.typehandlers.CollectionTypeHandler.writeElements(CollectionTypeHandler.java:56)
at com.db4o.typehandlers.CollectionTypeHandler.write(CollectionTypeHandler.java:35)
at com.db4o.internal.TypeHandlerAspect.marshall(TypeHandlerAspect.java:85)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.stillToSet(ObjectContainerBase.java:1902)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1698)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:266)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.stillToSet(ObjectContainerBase.java:1902)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1698)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:266)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.stillToSet(ObjectContainerBase.java:1902)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1698)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.OpenTypeHandler.writeObject(OpenTypeHandler.java:264)
at com.db4o.internal.OpenTypeHandler.write(OpenTypeHandler.java:249)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:272)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.stillToSet(ObjectContainerBase.java:1902)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1698)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:266)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:260)
at com.db4o.internal.handlers.array.ArrayHandler.writeElements(ArrayHandler.java:422)
at com.db4o.internal.handlers.array.ArrayHandler.write(ArrayHandler.java:407)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:272)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.stillToSet(ObjectContainerBase.java:1902)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1698)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.OpenTypeHandler.writeObject(OpenTypeHandler.java:264)
at com.db4o.internal.OpenTypeHandler.write(OpenTypeHandler.java:249)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:272)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:260)
at com.db4o.typehandlers.CollectionTypeHandler.writeElements(CollectionTypeHandler.java:56)
at com.db4o.typehandlers.CollectionTypeHandler.write(CollectionTypeHandler.java:35)
at com.db4o.internal.TypeHandlerAspect.marshall(TypeHandlerAspect.java:85)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.writeUpdate(ObjectReference.java:453)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1712)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:266)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.writeUpdate(ObjectReference.java:453)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1712)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.store(ObjectContainerBase.java:1584)
at com.db4o.internal.ExternalObjectContainer.store(ExternalObjectContainer.java:129)
at com.vocwom.db.db4o.DB4oAdaptor.addAccount(DB4oAdaptor.java:149)
at com.vocwom.server.VOCWOMServer.addAccount(VOCWOMServer.java:102)
| java | db4o | null | null | null | 08/09/2011 08:36:35 | not a real question | com.db4o.ext.DatabaseClosedException
===
I'm working with db4o embedded for Java (JSE6) running a Servlet app under Tomcat.
Lately I started getting those weird exceptions: When trying to save a new object to the DB I get com.db4o.ext.DatabaseClosedException. The stack is huge and looking at it seems like the db4o engine runs into an endless loop causing it to crash.
Part of the stack is missing bug it repeats itself...
Some help will be much appreciated. Thanks!
com.db4o.ext.DatabaseClosedException
at com.db4o.internal.ObjectContainerBase.checkClosed(ObjectContainerBase.java:303)
at com.db4o.internal.ObjectContainerBase.checkTransaction(ObjectContainerBase.java:331)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:412)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:266)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.checkStillToSet(ObjectContainerBase.java:1646)
at com.db4o.internal.ObjectContainerBase.handleStackLimitPendings(ObjectContainerBase.java:1874)
at com.db4o.internal.ObjectContainerBase.decStackDepth(ObjectContainerBase.java:1865)
at com.db4o.internal.ObjectContainerBase.endTopLevelCall(ObjectContainerBase.java:1966)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:436)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:266)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.stillToSet(ObjectContainerBase.java:1902)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1698)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:266)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.stillToSet(ObjectContainerBase.java:1902)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1698)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:266)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.stillToSet(ObjectContainerBase.java:1902)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1698)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:266)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.stillToSet(ObjectContainerBase.java:1902)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1698)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:266)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.stillToSet(ObjectContainerBase.java:1902)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1698)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.OpenTypeHandler.writeObject(OpenTypeHandler.java:264)
at com.db4o.internal.OpenTypeHandler.write(OpenTypeHandler.java:249)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:272)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:260)
at com.db4o.typehandlers.CollectionTypeHandler.writeElements(CollectionTypeHandler.java:56)
at com.db4o.typehandlers.CollectionTypeHandler.write(CollectionTypeHandler.java:35)
at com.db4o.internal.TypeHandlerAspect.marshall(TypeHandlerAspect.java:85)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.stillToSet(ObjectContainerBase.java:1902)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1698)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:266)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.stillToSet(ObjectContainerBase.java:1902)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1698)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:266)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.stillToSet(ObjectContainerBase.java:1902)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1698)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.OpenTypeHandler.writeObject(OpenTypeHandler.java:264)
at com.db4o.internal.OpenTypeHandler.write(OpenTypeHandler.java:249)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:272)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.stillToSet(ObjectContainerBase.java:1902)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1698)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:266)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:260)
at com.db4o.internal.handlers.array.ArrayHandler.writeElements(ArrayHandler.java:422)
at com.db4o.internal.handlers.array.ArrayHandler.write(ArrayHandler.java:407)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:272)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.continueSet(ObjectReference.java:171)
at com.db4o.internal.ObjectContainerBase.stillToSet(ObjectContainerBase.java:1902)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1698)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.OpenTypeHandler.writeObject(OpenTypeHandler.java:264)
at com.db4o.internal.OpenTypeHandler.write(OpenTypeHandler.java:249)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:272)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:260)
at com.db4o.typehandlers.CollectionTypeHandler.writeElements(CollectionTypeHandler.java:56)
at com.db4o.typehandlers.CollectionTypeHandler.write(CollectionTypeHandler.java:35)
at com.db4o.internal.TypeHandlerAspect.marshall(TypeHandlerAspect.java:85)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.writeUpdate(ObjectReference.java:453)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1712)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.marshall.MarshallingContext.writeObject(MarshallingContext.java:252)
at com.db4o.internal.marshall.MarshallingContext.writeObjectWithCurrentState(MarshallingContext.java:266)
at com.db4o.internal.FieldMetadata.marshall(FieldMetadata.java:766)
at com.db4o.internal.handlers.StandardReferenceTypeHandler$4.processAspect(StandardReferenceTypeHandler.java:154)
at com.db4o.internal.metadata.MarshallingInfoTraverseAspectCommand.processAspect(MarshallingInfoTraverseAspectCommand.java:52)
at com.db4o.internal.metadata.StandardAspectTraversalStrategy.traverseAllAspects(StandardAspectTraversalStrategy.java:24)
at com.db4o.internal.ClassMetadata.traverseAllAspects(ClassMetadata.java:2078)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.traverseAllAspects(StandardReferenceTypeHandler.java:257)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.marshallAspects(StandardReferenceTypeHandler.java:162)
at com.db4o.internal.handlers.StandardReferenceTypeHandler.write(StandardReferenceTypeHandler.java:122)
at com.db4o.internal.Handlers4.write(Handlers4.java:305)
at com.db4o.internal.ObjectReference.writeUpdate(ObjectReference.java:453)
at com.db4o.internal.ObjectContainerBase.store2(ObjectContainerBase.java:1712)
at com.db4o.internal.ObjectContainerBase.storeAfterReplication(ObjectContainerBase.java:1618)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1604)
at com.db4o.internal.ObjectContainerBase$10.apply(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.asTopLevelCall(ObjectContainerBase.java:427)
at com.db4o.internal.ObjectContainerBase.asTopLevelStore(ObjectContainerBase.java:413)
at com.db4o.internal.ObjectContainerBase.storeInternal(ObjectContainerBase.java:1602)
at com.db4o.internal.ObjectContainerBase.store(ObjectContainerBase.java:1584)
at com.db4o.internal.ExternalObjectContainer.store(ExternalObjectContainer.java:129)
at com.vocwom.db.db4o.DB4oAdaptor.addAccount(DB4oAdaptor.java:149)
at com.vocwom.server.VOCWOMServer.addAccount(VOCWOMServer.java:102)
| 1 |
6,800,370 | 07/23/2011 12:33:19 | 488,792 | 10/27/2010 12:20:11 | 321 | 0 | Tutorial on Autocorrelation? | Ive recently been considering using Autocorrelation for Pitch Detection. However, I am finding it difficult on finding good sources of where to learn autocorrelation, by this I mean sources that make it easy to understand autocorrelation step-by-step.
Im not that very good a programmer yet and also not really big on formulas so the sources that I find are really difficult to understand.
Basically, what I know now is the concept of autocorrelation is like a compare-and-contrast method of a signal? But I would really appreciate it if I can have more understanding of the autocorrelation algorithm.
Thank you very much! | algorithm | correlation | null | null | null | null | open | Tutorial on Autocorrelation?
===
Ive recently been considering using Autocorrelation for Pitch Detection. However, I am finding it difficult on finding good sources of where to learn autocorrelation, by this I mean sources that make it easy to understand autocorrelation step-by-step.
Im not that very good a programmer yet and also not really big on formulas so the sources that I find are really difficult to understand.
Basically, what I know now is the concept of autocorrelation is like a compare-and-contrast method of a signal? But I would really appreciate it if I can have more understanding of the autocorrelation algorithm.
Thank you very much! | 0 |
1,744,511 | 11/16/2009 20:01:20 | 168,527 | 09/04/2009 13:25:07 | 13 | 1 | Free/Open Source Outgoing traffic monitor/logger that isn't a firewall? | I've been tasked with finding a way to log every outgoing request from one of our servers. It cannot be a proxy or firewall of any kind. It simply needs to sit in memory and watch the outgoing traffic and log what it sees. I'm going to be building metrics on this later and it needs to be free/open source.
I've done some googling and checked all my traditional sources for cool little apps and haven't come up with anything.
Does anyone here know of something that might fit what I need? | open-source | web-traffic | monitoring | logging | null | 02/22/2012 14:33:05 | off topic | Free/Open Source Outgoing traffic monitor/logger that isn't a firewall?
===
I've been tasked with finding a way to log every outgoing request from one of our servers. It cannot be a proxy or firewall of any kind. It simply needs to sit in memory and watch the outgoing traffic and log what it sees. I'm going to be building metrics on this later and it needs to be free/open source.
I've done some googling and checked all my traditional sources for cool little apps and haven't come up with anything.
Does anyone here know of something that might fit what I need? | 2 |
10,461,959 | 05/05/2012 12:44:21 | 1,376,785 | 05/05/2012 12:39:32 | 1 | 0 | facebook resources | I'm always curious about facebook on how they build things (messenger, news feed, timeline, etc..) or scaling the site to more than 900m users but have only found very few of their resources talking about them. Any recommendations ? Thanks | facebook | resources | null | null | null | 05/06/2012 12:59:37 | not a real question | facebook resources
===
I'm always curious about facebook on how they build things (messenger, news feed, timeline, etc..) or scaling the site to more than 900m users but have only found very few of their resources talking about them. Any recommendations ? Thanks | 1 |
5,688,778 | 04/16/2011 18:54:01 | 392,063 | 07/14/2010 21:00:57 | 3 | 1 | Saving file to remote domain | I'd like to host an uploading script on one server but have it store the uploaded files to a remote server.
Currently I have a script that saves to a writable folder on my server. This works fine, but when I change it to the absolute link (ie. "http://www.somedomain.com/uploads/" instead of "/uploads/") it says the folder is not writable. The permissions on the folder are 0777. Am I doing something wrong?
Eventually I would like to save the uploads to a remote server (ie. "http://www.someotherdomain.com/uploads/"). Any insights? How could I do this with password permissions to eliminate the potential for anybody to upload files to this folder?
Thanks in advance! | php | file-upload | file-permissions | remote-server | null | null | open | Saving file to remote domain
===
I'd like to host an uploading script on one server but have it store the uploaded files to a remote server.
Currently I have a script that saves to a writable folder on my server. This works fine, but when I change it to the absolute link (ie. "http://www.somedomain.com/uploads/" instead of "/uploads/") it says the folder is not writable. The permissions on the folder are 0777. Am I doing something wrong?
Eventually I would like to save the uploads to a remote server (ie. "http://www.someotherdomain.com/uploads/"). Any insights? How could I do this with password permissions to eliminate the potential for anybody to upload files to this folder?
Thanks in advance! | 0 |
7,113,035 | 08/18/2011 19:31:11 | 357,320 | 06/03/2010 10:01:13 | 176 | 11 | iPhone app supports Retina only. Will Apple accept the app? | I just ported an iPad app to the iPhone and due to graphical and programming reasons it doesn't work on the low res displays (3G and 3GS). The starts on the low res devices but the graphics are garbled.
Is it possible to submit the app like that if the description specifically states that it is for iPhone 4 and iPod Touch 4g only?
| iphone | ios | app-store | display | null | 08/19/2011 16:11:31 | not constructive | iPhone app supports Retina only. Will Apple accept the app?
===
I just ported an iPad app to the iPhone and due to graphical and programming reasons it doesn't work on the low res displays (3G and 3GS). The starts on the low res devices but the graphics are garbled.
Is it possible to submit the app like that if the description specifically states that it is for iPhone 4 and iPod Touch 4g only?
| 4 |
3,063,663 | 06/17/2010 16:40:56 | 254,873 | 01/20/2010 12:28:35 | 15 | 0 | many-to-many join table discriminator? | I'm trying to link a Communication object I've created that has 2 properties "SuccessRecipientList" and "FailRecipientList" to a Users object, via joining table "Communication_Recipients". I'd like to do this using a discriminator on the joining table instead of creating an actual domain object for it (Using the HasFailed Bit column on the join table) Does anyone know if this can be done?
Communication HBM:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="DataLogic" namespace="DataLogic.Domain">
<class name="DataLogic.Domain.Communication, DataLogic" table="Communications" >
<id name="Id" column="Id" type="Int32" unsaved-value="0">
<generator class="identity"></generator>
</id>
...
<set name="SuccessRecipientList" table="Communication_Recipients" lazy="true">
<key column="Communication_ID"></key>
<many-to-many class="MilkroundOnline.OnlineApplications.DataLogic.Domain.User, MilkroundOnline.OnlineApplications.DataLogic" column="User_ID"></many-to-many>
</set>
<set name="FailedRecipientList" table="Communication_Recipients" lazy="true" where="" >
<key column="Communication_ID"></key>
<many-to-many class="MilkroundOnline.OnlineApplications.DataLogic.Domain.User, MilkroundOnline.OnlineApplications.DataLogic" column="User_ID"></many-to-many>
</set>
</class>
</hibernate-mapping>
The DB looks like:
Communication Table
-------------------
ID,
Subject,
Body
User Table
----------
ID,
Firstname,
Lastname
CommunicationUser Table
-----------------------
CommunicationId,
UserId,
HasFailed(Bit)
Thanks in advance for any help!
Rob | nhibernate | mapping | many-to-many | null | null | null | open | many-to-many join table discriminator?
===
I'm trying to link a Communication object I've created that has 2 properties "SuccessRecipientList" and "FailRecipientList" to a Users object, via joining table "Communication_Recipients". I'd like to do this using a discriminator on the joining table instead of creating an actual domain object for it (Using the HasFailed Bit column on the join table) Does anyone know if this can be done?
Communication HBM:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="DataLogic" namespace="DataLogic.Domain">
<class name="DataLogic.Domain.Communication, DataLogic" table="Communications" >
<id name="Id" column="Id" type="Int32" unsaved-value="0">
<generator class="identity"></generator>
</id>
...
<set name="SuccessRecipientList" table="Communication_Recipients" lazy="true">
<key column="Communication_ID"></key>
<many-to-many class="MilkroundOnline.OnlineApplications.DataLogic.Domain.User, MilkroundOnline.OnlineApplications.DataLogic" column="User_ID"></many-to-many>
</set>
<set name="FailedRecipientList" table="Communication_Recipients" lazy="true" where="" >
<key column="Communication_ID"></key>
<many-to-many class="MilkroundOnline.OnlineApplications.DataLogic.Domain.User, MilkroundOnline.OnlineApplications.DataLogic" column="User_ID"></many-to-many>
</set>
</class>
</hibernate-mapping>
The DB looks like:
Communication Table
-------------------
ID,
Subject,
Body
User Table
----------
ID,
Firstname,
Lastname
CommunicationUser Table
-----------------------
CommunicationId,
UserId,
HasFailed(Bit)
Thanks in advance for any help!
Rob | 0 |
11,010,125 | 06/13/2012 07:31:51 | 62,838 | 02/05/2009 10:23:53 | 390 | 6 | Is "static class imports" actually an announced or hinted at future feature of C#? | Starting from [this edit][1], the [Wikipedia article on C#][2] mentions "static class imports" as a future feature of C#, alongside "Compiler-as-a-service ("Roslyn")".
Has this feature actually been announced or hinted at by a member of the compiler team or is this just wild speculation?
[1]: http://en.wikipedia.org/w/index.php?title=C_Sharp_%28programming_language%29&diff=490179471&oldid=489980512
[2]: http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 | c# | static-import | null | null | null | 06/14/2012 12:43:16 | off topic | Is "static class imports" actually an announced or hinted at future feature of C#?
===
Starting from [this edit][1], the [Wikipedia article on C#][2] mentions "static class imports" as a future feature of C#, alongside "Compiler-as-a-service ("Roslyn")".
Has this feature actually been announced or hinted at by a member of the compiler team or is this just wild speculation?
[1]: http://en.wikipedia.org/w/index.php?title=C_Sharp_%28programming_language%29&diff=490179471&oldid=489980512
[2]: http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29 | 2 |
6,279,158 | 06/08/2011 13:07:01 | 752,801 | 05/13/2011 17:44:11 | 21 | 0 | Add Shapes/Controls in a loop VB.NET | I've to show some PowerPacks.RectangleShape in a PowerPacks.ShapeContainer. A loop in my code add shapes to the container (objshapecontainer.shapes.add(objshape), but at the end of the loop, only the last shape is displayed, in fact objshapecontainer.shapes.count doesn't exceed 1 | vb.net | null | null | null | null | null | open | Add Shapes/Controls in a loop VB.NET
===
I've to show some PowerPacks.RectangleShape in a PowerPacks.ShapeContainer. A loop in my code add shapes to the container (objshapecontainer.shapes.add(objshape), but at the end of the loop, only the last shape is displayed, in fact objshapecontainer.shapes.count doesn't exceed 1 | 0 |
11,589,242 | 07/21/2012 03:38:24 | 1,542,122 | 07/21/2012 03:26:01 | 1 | 0 | create table IF NOT EXISTS NoticeInfo (ID text,CP_ID text,title text,time text,mark text),is right? | "create table IF NOT EXISTS NoticeInfo (ID text,CP_ID text,title text,time text,mark text)",is right? | android | null | null | null | null | 07/21/2012 03:57:18 | not a real question | create table IF NOT EXISTS NoticeInfo (ID text,CP_ID text,title text,time text,mark text),is right?
===
"create table IF NOT EXISTS NoticeInfo (ID text,CP_ID text,title text,time text,mark text)",is right? | 1 |
9,218,380 | 02/09/2012 20:36:58 | 431,060 | 08/25/2010 18:16:12 | 32 | 1 | Web page won't load from WAMP server; connectoin error | Sometime last year, I installed the wamp stack on a local server. Everything has been running smoothly. I have phpmyadmin and a local web site running off of it with no problems. I want to try playing around with building a dynamic web site, so I'm trying to run a tutorial from a book which will help me learn how a mysql database can connect to a web page using Dreamweaver.
I have downloaded the tutorial file folder and placed it on the root folder of the web server. (This is where my local web site's home page loads from with no problems.) That file folder, entitled "cosmo_shop", has an index.php within it. In the book, it says if type http://10.100.136.26/cosmo_shop/ in the web browser that the index page should open up (subbed in my server for localhost). Makes sense, but I get the below error message instead. Does anyone have clues as to why my other site works just fine, but the index file of this tutorial won't load?
Thanks!
Warning: mysql_pconnect(): [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://10.100.136.29:3306) in C:\wamp\www\cosmo_shop\Connections\connCosmo.php on line 9 Call Stack: 0.0019 414400 1. {main}() C:\wamp\www\cosmo_shop\index.php:0 0.0031 418120 2. require_once('C:\wamp\www\cosmo_shop\Connections\connCosmo.php') C:\wamp\www\cosmo_shop\index.php:1 0.0031 418616 3. mysql_pconnect() C:\wamp\www\cosmo_shop\Connections\connCosmo.php:9 Warning: mysql_pconnect(): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\wamp\www\cosmo_shop\Connections\connCosmo.php on line 9 Call Stack: 0.0019 414400 1. {main}() C:\wamp\www\cosmo_shop\index.php:0 0.0031 418120 2. require_once('C:\wamp\www\cosmo_shop\Connections\connCosmo.php') C:\wamp\www\cosmo_shop\index.php:1 0.0031 418616 3. mysql_pconnect() C:\wamp\www\cosmo_shop\Connections\connCosmo.php:9 Fatal error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\wamp\www\cosmo_shop\Connections\connCosmo.php on line 9 Call Stack: 0.0019 414400 1. {main}() C:\wamp\www\cosmo_shop\index.php:0 0.0031 418120 2. require_once('C:\wamp\www\cosmo_shop\Connections\connCosmo.php') C:\wamp\www\cosmo_shop\index.php:1 20.9967 419168 3. trigger_error() C:\wamp\www\cosmo_shop\Connections\connCosmo.php:9 | php | mysql | apache | wamp | wampserver | 02/12/2012 08:09:41 | too localized | Web page won't load from WAMP server; connectoin error
===
Sometime last year, I installed the wamp stack on a local server. Everything has been running smoothly. I have phpmyadmin and a local web site running off of it with no problems. I want to try playing around with building a dynamic web site, so I'm trying to run a tutorial from a book which will help me learn how a mysql database can connect to a web page using Dreamweaver.
I have downloaded the tutorial file folder and placed it on the root folder of the web server. (This is where my local web site's home page loads from with no problems.) That file folder, entitled "cosmo_shop", has an index.php within it. In the book, it says if type http://10.100.136.26/cosmo_shop/ in the web browser that the index page should open up (subbed in my server for localhost). Makes sense, but I get the below error message instead. Does anyone have clues as to why my other site works just fine, but the index file of this tutorial won't load?
Thanks!
Warning: mysql_pconnect(): [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://10.100.136.29:3306) in C:\wamp\www\cosmo_shop\Connections\connCosmo.php on line 9 Call Stack: 0.0019 414400 1. {main}() C:\wamp\www\cosmo_shop\index.php:0 0.0031 418120 2. require_once('C:\wamp\www\cosmo_shop\Connections\connCosmo.php') C:\wamp\www\cosmo_shop\index.php:1 0.0031 418616 3. mysql_pconnect() C:\wamp\www\cosmo_shop\Connections\connCosmo.php:9 Warning: mysql_pconnect(): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\wamp\www\cosmo_shop\Connections\connCosmo.php on line 9 Call Stack: 0.0019 414400 1. {main}() C:\wamp\www\cosmo_shop\index.php:0 0.0031 418120 2. require_once('C:\wamp\www\cosmo_shop\Connections\connCosmo.php') C:\wamp\www\cosmo_shop\index.php:1 0.0031 418616 3. mysql_pconnect() C:\wamp\www\cosmo_shop\Connections\connCosmo.php:9 Fatal error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\wamp\www\cosmo_shop\Connections\connCosmo.php on line 9 Call Stack: 0.0019 414400 1. {main}() C:\wamp\www\cosmo_shop\index.php:0 0.0031 418120 2. require_once('C:\wamp\www\cosmo_shop\Connections\connCosmo.php') C:\wamp\www\cosmo_shop\index.php:1 20.9967 419168 3. trigger_error() C:\wamp\www\cosmo_shop\Connections\connCosmo.php:9 | 3 |
6,007,230 | 05/15/2011 08:02:24 | 750,074 | 05/12/2011 07:07:15 | 1 | 0 | How to retain my own objects and properties | I'm not sure I understood how alloc and retain work.
Recently I discovered that the NSString properties were not retained and I had to add [myString copy] when I set them. Which makes me wonder if I misunderstood the whole way of using retain/alloc
Please, may someone tell me if I'm doing it correctly? I read a lot and had a look on open source projects, this let me thing that I may have been wrong since the beginning.
Here is my way of doing it:
/**** VIEW.h *****/
#import "MyClass.h"
@interface MyViewController : UIViewController {
//Is the following line really necessary?
MyClass *myObject;
}
@property (nonatomic, retain) MyClass *myObject;
- (void)defineObject;
@end
.
/**** VIEW.m *****/
#import "VIEW.h"
@implementation MyViewController
@dynamic myObject;
- (void)viewDidLoad
{
[super viewDidLoad];
[self defineObject];
NSLog(@"My object's name is: %@", myObject.name);
}
- (void)defineObject
{
//Here particularly, Why doesn't it work without both alloc and init
//shouldn't "@property (nonatomic, retain) MyClass *myObject;" have done that already?
myObject = [[MyClass alloc] initPersonalised];
[myObject setName:@"my name"];
}
.
/**** MyClass.h *****/
@interface MyClass : NSObject {
//not sure if this line is still necessary
NSString *name;
}
@property (nonatomic, retain) NSString *name;
- (id)initPersonalised;
- (void)setName:(NSString *)name;
- (NSString *)name;
@end
.
/**** MyClass.m *****/
#import "MyClass.h"
@implementation MyClass
@dynamic name;
(id)initPersonalised{
self = [super init];
name = @"Undefined";
}
- (void)setName:(NSString *)name{
self.name = [name copy];
}
- (NSString *)name{
return [self.name copy];
}
@end
I hope you can bring a bit of light, after months of programming this way, I'm less and less sure of doing it well.
| objective-c | ios | null | null | null | null | open | How to retain my own objects and properties
===
I'm not sure I understood how alloc and retain work.
Recently I discovered that the NSString properties were not retained and I had to add [myString copy] when I set them. Which makes me wonder if I misunderstood the whole way of using retain/alloc
Please, may someone tell me if I'm doing it correctly? I read a lot and had a look on open source projects, this let me thing that I may have been wrong since the beginning.
Here is my way of doing it:
/**** VIEW.h *****/
#import "MyClass.h"
@interface MyViewController : UIViewController {
//Is the following line really necessary?
MyClass *myObject;
}
@property (nonatomic, retain) MyClass *myObject;
- (void)defineObject;
@end
.
/**** VIEW.m *****/
#import "VIEW.h"
@implementation MyViewController
@dynamic myObject;
- (void)viewDidLoad
{
[super viewDidLoad];
[self defineObject];
NSLog(@"My object's name is: %@", myObject.name);
}
- (void)defineObject
{
//Here particularly, Why doesn't it work without both alloc and init
//shouldn't "@property (nonatomic, retain) MyClass *myObject;" have done that already?
myObject = [[MyClass alloc] initPersonalised];
[myObject setName:@"my name"];
}
.
/**** MyClass.h *****/
@interface MyClass : NSObject {
//not sure if this line is still necessary
NSString *name;
}
@property (nonatomic, retain) NSString *name;
- (id)initPersonalised;
- (void)setName:(NSString *)name;
- (NSString *)name;
@end
.
/**** MyClass.m *****/
#import "MyClass.h"
@implementation MyClass
@dynamic name;
(id)initPersonalised{
self = [super init];
name = @"Undefined";
}
- (void)setName:(NSString *)name{
self.name = [name copy];
}
- (NSString *)name{
return [self.name copy];
}
@end
I hope you can bring a bit of light, after months of programming this way, I'm less and less sure of doing it well.
| 0 |
8,903,401 | 01/18/2012 00:00:41 | 1,155,077 | 01/17/2012 23:43:13 | 1 | 0 | Dummies guide to bit shifting? | I'm currently in C class and we are working on bitshifting to pack a date. I understand the concept of shifting but I am at a loss for the rudimentary stuff like how many places to shift and how to formulate the mask, so I can pull them back out. Any direction or recommended reading would be great.
I've got this far :-(
#define DAY_MASK 0x???
#define DAY_OFFSET ?
#define MONTH_MASK 0x???
#define MONTH_OFFSET ?
#define YEAR_MASK 0x???
#define YEAR_OFFSET ?
Thanks | c | bitwise | ansi | null | null | 01/18/2012 00:19:20 | not a real question | Dummies guide to bit shifting?
===
I'm currently in C class and we are working on bitshifting to pack a date. I understand the concept of shifting but I am at a loss for the rudimentary stuff like how many places to shift and how to formulate the mask, so I can pull them back out. Any direction or recommended reading would be great.
I've got this far :-(
#define DAY_MASK 0x???
#define DAY_OFFSET ?
#define MONTH_MASK 0x???
#define MONTH_OFFSET ?
#define YEAR_MASK 0x???
#define YEAR_OFFSET ?
Thanks | 1 |
8,245,135 | 11/23/2011 15:51:36 | 256,793 | 01/22/2010 14:24:27 | 10,256 | 463 | Python Decorate all methods of subclass, and provide means to override | I am working on finding a way to reduce boilerplate decorators. We have a lot of classes that use a @decorate. For example:
class MyClass(Base):
@decorate
def fun1(self):
pass
@decorate
def fun2(self):
pass
def fun3(self):
pass
I want to make it so by default the decorator is there, unless someone specifies otherwise.
---
I use this code to do the autowrap
from functools import wraps
def myDecorator(func):
@wraps(func)
def decorator(self, *args, **kwargs):
try:
print 'enter'
ret = func(self, *args, **kwargs)
print 'leave'
except:
print 'exception'
ret = None
return ret
return decorator
class TestDecorateAllMeta(type):
def __new__(cls, name, bases, local):
for attr in local:
value = local[attr]
if callable(value):
local[attr] = myDecorator(value)
return type.__new__(cls, name, bases, local)
class TestClass(object):
__metaclass__ = TestDecorateAllMeta
def test_print2(self, val):
print val
def test_print(self, val):
print val
c = TestClass()
c.test_print1("print 1")
c.test_print2("print 2")
My question are:
1. Is there a better way to accompish auto-decorating?
2. How can I go about overriding?
Ideally my end solution would be something like:
class TestClass(object):
__metaclass__ = TestDecorateAllMeta
def autowrap(self):
print("Auto wrap")
@dont_decorate
def test_dont_decorate(self, val):
print val
| python | python-2.5 | null | null | null | null | open | Python Decorate all methods of subclass, and provide means to override
===
I am working on finding a way to reduce boilerplate decorators. We have a lot of classes that use a @decorate. For example:
class MyClass(Base):
@decorate
def fun1(self):
pass
@decorate
def fun2(self):
pass
def fun3(self):
pass
I want to make it so by default the decorator is there, unless someone specifies otherwise.
---
I use this code to do the autowrap
from functools import wraps
def myDecorator(func):
@wraps(func)
def decorator(self, *args, **kwargs):
try:
print 'enter'
ret = func(self, *args, **kwargs)
print 'leave'
except:
print 'exception'
ret = None
return ret
return decorator
class TestDecorateAllMeta(type):
def __new__(cls, name, bases, local):
for attr in local:
value = local[attr]
if callable(value):
local[attr] = myDecorator(value)
return type.__new__(cls, name, bases, local)
class TestClass(object):
__metaclass__ = TestDecorateAllMeta
def test_print2(self, val):
print val
def test_print(self, val):
print val
c = TestClass()
c.test_print1("print 1")
c.test_print2("print 2")
My question are:
1. Is there a better way to accompish auto-decorating?
2. How can I go about overriding?
Ideally my end solution would be something like:
class TestClass(object):
__metaclass__ = TestDecorateAllMeta
def autowrap(self):
print("Auto wrap")
@dont_decorate
def test_dont_decorate(self, val):
print val
| 0 |
8,830,679 | 01/12/2012 05:47:24 | 482,473 | 10/21/2010 02:30:33 | 410 | 0 | understand of PreferenceActivity | public class SettingsActivity extends PreferenceActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/* Some initializations */
LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
ListView listView = new ListView(this);
listView.setId(android.R.id.list);
listView.setLayoutParams(new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.FILL_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT, 1));
layout.addView(listView);
this.setContentView(layout);
/* Preferences time! (we build the preferences) */
Preference version = getPreference("My School Manager", "Version 2.0",
null);
Preference author = getPreference("Author", "Simone Casagranda", null);
Preference marketLink = getPreference("Android market",
"View all my apps :)",
new Intent(Intent.ACTION_VIEW, Uri
.parse("http://market.android.com/details?id="
+ "it.trento.alchemiasoft.casagranda.simone")));
CheckBoxPreference check = new CheckBoxPreference(this);
check.setTitle("Checkbox");
check.setSummary("Example of checkbox");
DialogPreference license = new MyDialogPreference(this, "License",
"This is the license for...bla bla");
/* Now we add the preferences to the preference screen */
PreferenceScreen preferenceScreen = this.getPreferenceManager()
.createPreferenceScreen(this);
addPreferenceCategory(preferenceScreen, "Preferences Tutorial",
version, author, marketLink, check, license);
this.setPreferenceScreen(preferenceScreen);
}
private boolean addPreferenceCategory(PreferenceScreen preferenceScreen,
String titleCategory, Preference... preferences) {
boolean addPreference = false;
for (Preference preference : preferences) {
if (preference != null)
addPreference = true;
}
if (addPreference) {
PreferenceCategory preferenceCategory = new PreferenceCategory(this);
preferenceCategory.setTitle(titleCategory);
preferenceScreen.addPreference(preferenceCategory);
for (Preference preference : preferences) {
if (preference != null)
preferenceCategory.addPreference(preference);
}
return true;
} else
return false;
}
private Preference getPreference(String title, String summary, Intent intent) {
Preference pref = new Preference(this);
pref.setTitle(title);
pref.setSummary(summary);
if (intent != null)
pref.setIntent(intent);
return pref;
}
public class MyDialogPreference extends DialogPreference {
public MyDialogPreference(Context context, String title, String text) {
super(context, null);
this.setTitle(title);
this.setDialogMessage(text);
}
}
}
In this piece of code, the preference are listed in the listview. Doesn't it needs a adapter? I don't see the data is being fed into the listview. What about this Preference screen? Is it necessary for preference setting? | android | preference | null | null | null | null | open | understand of PreferenceActivity
===
public class SettingsActivity extends PreferenceActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/* Some initializations */
LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
ListView listView = new ListView(this);
listView.setId(android.R.id.list);
listView.setLayoutParams(new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.FILL_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT, 1));
layout.addView(listView);
this.setContentView(layout);
/* Preferences time! (we build the preferences) */
Preference version = getPreference("My School Manager", "Version 2.0",
null);
Preference author = getPreference("Author", "Simone Casagranda", null);
Preference marketLink = getPreference("Android market",
"View all my apps :)",
new Intent(Intent.ACTION_VIEW, Uri
.parse("http://market.android.com/details?id="
+ "it.trento.alchemiasoft.casagranda.simone")));
CheckBoxPreference check = new CheckBoxPreference(this);
check.setTitle("Checkbox");
check.setSummary("Example of checkbox");
DialogPreference license = new MyDialogPreference(this, "License",
"This is the license for...bla bla");
/* Now we add the preferences to the preference screen */
PreferenceScreen preferenceScreen = this.getPreferenceManager()
.createPreferenceScreen(this);
addPreferenceCategory(preferenceScreen, "Preferences Tutorial",
version, author, marketLink, check, license);
this.setPreferenceScreen(preferenceScreen);
}
private boolean addPreferenceCategory(PreferenceScreen preferenceScreen,
String titleCategory, Preference... preferences) {
boolean addPreference = false;
for (Preference preference : preferences) {
if (preference != null)
addPreference = true;
}
if (addPreference) {
PreferenceCategory preferenceCategory = new PreferenceCategory(this);
preferenceCategory.setTitle(titleCategory);
preferenceScreen.addPreference(preferenceCategory);
for (Preference preference : preferences) {
if (preference != null)
preferenceCategory.addPreference(preference);
}
return true;
} else
return false;
}
private Preference getPreference(String title, String summary, Intent intent) {
Preference pref = new Preference(this);
pref.setTitle(title);
pref.setSummary(summary);
if (intent != null)
pref.setIntent(intent);
return pref;
}
public class MyDialogPreference extends DialogPreference {
public MyDialogPreference(Context context, String title, String text) {
super(context, null);
this.setTitle(title);
this.setDialogMessage(text);
}
}
}
In this piece of code, the preference are listed in the listview. Doesn't it needs a adapter? I don't see the data is being fed into the listview. What about this Preference screen? Is it necessary for preference setting? | 0 |
9,052,347 | 01/29/2012 10:04:44 | 84,539 | 03/30/2009 09:34:26 | 3,678 | 78 | Refactoring Legacy Code for Unit Testing - Please Critique | I'm trying to refactor some code for Unit Testing and was hoping you could critique it.
This is the original method.
public class MyNonRefactoredClass
{
public List<MyClass> DoSomething()
{
List<MyClass> data = GetData();
if (data.Count == 0)
return new List<MyClass>();
data = GetFormattedData(data);
if (data.Count == 0)
return new List<MyClass>();
//Do some more stuff
return data;
}
public List<MyClass> GetData()
{
//Do db query and return data
}
public List<MyClass> GetFormattedData(List<MyClass> Data)
{
//Do some logic on Data variable. Might return empty if data is not what I like
}
}
Here is my new approach. I have done it like this as I believe I need an entry point to try and access methods that I want to test.
public class MyRefactoredClass
{
public List<MyClass> DoSomething()
{
//Dependency Injection needs to work somehow here
MySeparateClass newClass = new MySeperateClass(new DataProvider());
List<MyClass> dbData = newClass.GetData();
if (db.Data.Count == 0)
return new List<MyClass>();
dbData = newClass.GetFormattedData();
if (db.Data.Count == 0)
return new List<MyClass>();
//Continue method doing other things...
}
}
public class MySeparateClass
{
private IDataProvider dbProvider;
public MySeparateClass(IDataProvider DataProvider)
{
dbProvider = DataProvider;
}
public List<MyClass> GetData()
{
//Do DB stuff
return dbProvider.GetData();
}
public List<MyClass> GetFormattedData(List<MyClass> Data)
{
//Format
}
}
[Test]
public DoSomething_DBReturnsNoData_ReturnEmptyList()
{
//Setup mock of IDataProvider
//Tell mock to not return data from GetData
//Assert that result.count == 0
}
[Test]
public DoSomething_FormattedReturnsNoData_ReturnsEmptyList()
{
//Setup mock of IDataProvider
//Tell mock to return some data from GetData
//Setup mock of MySeparateClass
//Tell mock to return no data from GetFormattedData
//Assert that result.Count == 0
} | c# | .net | unit-testing | refactoring | tdd | 01/29/2012 13:39:29 | off topic | Refactoring Legacy Code for Unit Testing - Please Critique
===
I'm trying to refactor some code for Unit Testing and was hoping you could critique it.
This is the original method.
public class MyNonRefactoredClass
{
public List<MyClass> DoSomething()
{
List<MyClass> data = GetData();
if (data.Count == 0)
return new List<MyClass>();
data = GetFormattedData(data);
if (data.Count == 0)
return new List<MyClass>();
//Do some more stuff
return data;
}
public List<MyClass> GetData()
{
//Do db query and return data
}
public List<MyClass> GetFormattedData(List<MyClass> Data)
{
//Do some logic on Data variable. Might return empty if data is not what I like
}
}
Here is my new approach. I have done it like this as I believe I need an entry point to try and access methods that I want to test.
public class MyRefactoredClass
{
public List<MyClass> DoSomething()
{
//Dependency Injection needs to work somehow here
MySeparateClass newClass = new MySeperateClass(new DataProvider());
List<MyClass> dbData = newClass.GetData();
if (db.Data.Count == 0)
return new List<MyClass>();
dbData = newClass.GetFormattedData();
if (db.Data.Count == 0)
return new List<MyClass>();
//Continue method doing other things...
}
}
public class MySeparateClass
{
private IDataProvider dbProvider;
public MySeparateClass(IDataProvider DataProvider)
{
dbProvider = DataProvider;
}
public List<MyClass> GetData()
{
//Do DB stuff
return dbProvider.GetData();
}
public List<MyClass> GetFormattedData(List<MyClass> Data)
{
//Format
}
}
[Test]
public DoSomething_DBReturnsNoData_ReturnEmptyList()
{
//Setup mock of IDataProvider
//Tell mock to not return data from GetData
//Assert that result.count == 0
}
[Test]
public DoSomething_FormattedReturnsNoData_ReturnsEmptyList()
{
//Setup mock of IDataProvider
//Tell mock to return some data from GetData
//Setup mock of MySeparateClass
//Tell mock to return no data from GetFormattedData
//Assert that result.Count == 0
} | 2 |
7,940 | 08/11/2008 16:46:28 | 428,190 | 08/09/2008 23:23:13 | 1 | 2 | How important is W3C XHTML/CSS validation when finalizing work? | Even though I always strive for complete validation these days, I often wonder if it's a waste of time. If the code runs and it looks the same in all browsers (I use browsershots.org to verify) then do I need to take it any further or am I just being overly anal?
What level do you hold your code to when you create it for:
a) yourself
b) your clients
P.S. Jeff and company, why doesn't stack overflow validate? :) | xhtml | css | w3c | validation | validate | null | open | How important is W3C XHTML/CSS validation when finalizing work?
===
Even though I always strive for complete validation these days, I often wonder if it's a waste of time. If the code runs and it looks the same in all browsers (I use browsershots.org to verify) then do I need to take it any further or am I just being overly anal?
What level do you hold your code to when you create it for:
a) yourself
b) your clients
P.S. Jeff and company, why doesn't stack overflow validate? :) | 0 |
7,302,494 | 09/04/2011 22:21:48 | 410,560 | 08/04/2010 09:04:35 | 235 | 5 | Distribute dll with only some cpp files | I have several DLL projects in a solution that I would give away to some users. One of these projects includes some cpp files that I use as implementations for some classes that I use inside the same project. Now, I need to inhrerit from one of that classes in another project to make my own implementation that won't be distributed to the users. Is this possibile? If so, how? I tried to split the cpp/h files of the base classes in another project but when I try to use them visual studio gives me an error about "not found origin file". | c++ | dll | null | null | null | 09/05/2011 00:08:37 | not a real question | Distribute dll with only some cpp files
===
I have several DLL projects in a solution that I would give away to some users. One of these projects includes some cpp files that I use as implementations for some classes that I use inside the same project. Now, I need to inhrerit from one of that classes in another project to make my own implementation that won't be distributed to the users. Is this possibile? If so, how? I tried to split the cpp/h files of the base classes in another project but when I try to use them visual studio gives me an error about "not found origin file". | 1 |
8,683,193 | 12/30/2011 19:25:02 | 130,964 | 06/30/2009 09:53:17 | 6,944 | 335 | Classloader.getResources() in maven project returns an empty Enumeration | I have some code which gets resources as follows:
public static final String CONVERTER_FILE = "META-INF/jumbo-converters";
static {
ClassLoader ldr = Thread.currentThread().getContextClassLoader();
Enumeration<URL> e = ldr.getResources(CONVERTER_FILE);
but when I run this in a JUnit test (Java 6) the enumeration is empty. There are a number of subprojects in the project which have the following file:
myProject/mySubProject/src/main/resources/META-INF/jumbo-converters
and I believe that it has worked in the past. What does `getResources` do? and how can I debug its current failure?
| java | maven | classloader | null | null | null | open | Classloader.getResources() in maven project returns an empty Enumeration
===
I have some code which gets resources as follows:
public static final String CONVERTER_FILE = "META-INF/jumbo-converters";
static {
ClassLoader ldr = Thread.currentThread().getContextClassLoader();
Enumeration<URL> e = ldr.getResources(CONVERTER_FILE);
but when I run this in a JUnit test (Java 6) the enumeration is empty. There are a number of subprojects in the project which have the following file:
myProject/mySubProject/src/main/resources/META-INF/jumbo-converters
and I believe that it has worked in the past. What does `getResources` do? and how can I debug its current failure?
| 0 |
11,332,496 | 07/04/2012 16:08:42 | 1,496,478 | 07/02/2012 15:29:46 | 1 | 0 | How can I connect my database to my C# form? | DB information:
$mysql_host = "mysql8.000webhost.com";
$mysql_database = "a6642574_asdasd";
$mysql_user = "a6642574_asdasd";
$mysql_password = "asdasd123";
SQL query:
CREATE TABLE names
(
id int,
name nchar(35),
lastname nchar(35),
CONSTRAINT pk_Id Primary Key (id)
)
Form code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace WindowsFormsApplication4
{
public partial class sqlTest : Form
{
public sqlTest()
{
InitializeComponent();
}
private void btnRegistrar_Click(object sender, EventArgs e)
{
}
}
}
Form only has two textboxes and a register button (the event shown in the previous code)
Should I use SqlConnection system class? or SqlConnectionStringBuilder system class?
How are these classes used to connect to a database?
Credentials are just dummy data.
Thanks in advance.
| c# | sql | null | null | null | 07/04/2012 19:51:51 | not a real question | How can I connect my database to my C# form?
===
DB information:
$mysql_host = "mysql8.000webhost.com";
$mysql_database = "a6642574_asdasd";
$mysql_user = "a6642574_asdasd";
$mysql_password = "asdasd123";
SQL query:
CREATE TABLE names
(
id int,
name nchar(35),
lastname nchar(35),
CONSTRAINT pk_Id Primary Key (id)
)
Form code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace WindowsFormsApplication4
{
public partial class sqlTest : Form
{
public sqlTest()
{
InitializeComponent();
}
private void btnRegistrar_Click(object sender, EventArgs e)
{
}
}
}
Form only has two textboxes and a register button (the event shown in the previous code)
Should I use SqlConnection system class? or SqlConnectionStringBuilder system class?
How are these classes used to connect to a database?
Credentials are just dummy data.
Thanks in advance.
| 1 |
2,631,015 | 04/13/2010 15:49:04 | 198,927 | 10/29/2009 14:01:04 | 591 | 12 | Display action-specific authorisation message for [Authorize] attribute | Is there a way to display an action-specific authorisation message for when an `[Authorize]` or `[Authorize(Roles="Administrator")]` attribute redirects the user to the sign-in page?
Ideally,
--
[Authorize(Roles="Administrator", Message="I'm sorry Dave. I'm afraid I can't let you do that.")]
public ActionResult SomeAdminFunction()
{
// do admin stuff
return View();
}
As I understand it, attributes are not meant to add functionality, but this seems purely informational. One could do this inside the action, but it seems inelegant compared to the use of an attribute.
Alternatively,
--
if (!Request.IsAuthenticated)
{
if (!User.IsInRole("Administrator"))
SetMessage("You need to be an administrator to destroy worlds."); // write message to session stack
return RedirectToAction("SignIn", "Account");
}
Is there an existing way to do this or do I need to override the [Authorize] attribute? | asp.net-mvc | authorize-attribute | authorization | null | null | null | open | Display action-specific authorisation message for [Authorize] attribute
===
Is there a way to display an action-specific authorisation message for when an `[Authorize]` or `[Authorize(Roles="Administrator")]` attribute redirects the user to the sign-in page?
Ideally,
--
[Authorize(Roles="Administrator", Message="I'm sorry Dave. I'm afraid I can't let you do that.")]
public ActionResult SomeAdminFunction()
{
// do admin stuff
return View();
}
As I understand it, attributes are not meant to add functionality, but this seems purely informational. One could do this inside the action, but it seems inelegant compared to the use of an attribute.
Alternatively,
--
if (!Request.IsAuthenticated)
{
if (!User.IsInRole("Administrator"))
SetMessage("You need to be an administrator to destroy worlds."); // write message to session stack
return RedirectToAction("SignIn", "Account");
}
Is there an existing way to do this or do I need to override the [Authorize] attribute? | 0 |
9,561,845 | 03/05/2012 04:59:48 | 571,806 | 01/11/2011 19:48:04 | 53 | 1 | How can i select the all attribute original and new original together by dont use the specify column obj? | i want to Use LINQ like this "
Select * , 'Yoyo' From abc " in LINQ
by didnt use
Select a,b,c,'Yoyo' From abc ?
Thank's ^^ | linq | null | null | null | null | 07/18/2012 12:42:32 | not a real question | How can i select the all attribute original and new original together by dont use the specify column obj?
===
i want to Use LINQ like this "
Select * , 'Yoyo' From abc " in LINQ
by didnt use
Select a,b,c,'Yoyo' From abc ?
Thank's ^^ | 1 |
5,054,994 | 02/20/2011 03:12:25 | 705,300 | 02/20/2011 02:51:50 | 1 | 0 | question about sample tech | I am working on a ray tracer.
It's on
[tls.googlecode.com][1]
I can find much noise in the first image when I look close.
My question is: is it the normal behaviour for jittered sampler?
some info:The first image is rendered in 1024 samples/pixel (ambient occlusion), Jittered Sampler. And, there is not much difference when I rendered it in 256 samples/pixel.
the source code is in the sampler.h/sampler.cc, which is short.
and any comments on other part of this ray tracer are welcome.
Thanks!
[1]: http://tls.googlecode.com | raytracing | null | null | null | null | null | open | question about sample tech
===
I am working on a ray tracer.
It's on
[tls.googlecode.com][1]
I can find much noise in the first image when I look close.
My question is: is it the normal behaviour for jittered sampler?
some info:The first image is rendered in 1024 samples/pixel (ambient occlusion), Jittered Sampler. And, there is not much difference when I rendered it in 256 samples/pixel.
the source code is in the sampler.h/sampler.cc, which is short.
and any comments on other part of this ray tracer are welcome.
Thanks!
[1]: http://tls.googlecode.com | 0 |
8,277,523 | 11/26/2011 09:36:53 | 988,680 | 10/11/2011 01:57:47 | 13 | 0 | Archlinux auto-start after I shutdown my computer | every one. I'm in a big trouble. My computer (HP ProBook 4230s) has two OS----Archlinux and Win 7.
When I use Archlinux, after halt my computer, it will start up after a while without press power. And there is an other thing. My computer's clock will be wrong. Many times I change it in bios, but it wrong again.
If I turn off the computer from Win 7, it will never start up untill pressing power bottom. And the clock will be right.
I also used ubuntu\debian\mageia, and both of them are find with my notebook. Is there some configure is wrong with my ArchLinux?
Thanks for your reading.
| linux | hardware | power | autostart | archlinux | 11/26/2011 10:15:34 | off topic | Archlinux auto-start after I shutdown my computer
===
every one. I'm in a big trouble. My computer (HP ProBook 4230s) has two OS----Archlinux and Win 7.
When I use Archlinux, after halt my computer, it will start up after a while without press power. And there is an other thing. My computer's clock will be wrong. Many times I change it in bios, but it wrong again.
If I turn off the computer from Win 7, it will never start up untill pressing power bottom. And the clock will be right.
I also used ubuntu\debian\mageia, and both of them are find with my notebook. Is there some configure is wrong with my ArchLinux?
Thanks for your reading.
| 2 |
8,636,688 | 12/26/2011 14:37:25 | 48,062 | 12/20/2008 23:15:39 | 1,452 | 32 | Adding entries to a properties file before maven compile phase | We are using [maven filtering][1] for properties file, in which we inject the build number and time from out Jenkins server.
It would be cool if we could add there properties to our app.local.properties file dynamically, thus not forcing each project maintainer to add them (one time operation, but annoying never the less).
I would like to
- Add params to a properties file, before the filter plugin kicks in.
- If the destination properties file does not exist -> create it and then add.
- I need to edit the properties file in the target directory (the src/main/resources dir should remain untouched).
Nice to have:
- Add configuration settings only if they aren't already defined in the file (to avoid duplicating entries added manually)
Is there some maven plugin / hook that I can tap into to do this?
[1]: http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html | maven | build | properties | automation | jenkins | null | open | Adding entries to a properties file before maven compile phase
===
We are using [maven filtering][1] for properties file, in which we inject the build number and time from out Jenkins server.
It would be cool if we could add there properties to our app.local.properties file dynamically, thus not forcing each project maintainer to add them (one time operation, but annoying never the less).
I would like to
- Add params to a properties file, before the filter plugin kicks in.
- If the destination properties file does not exist -> create it and then add.
- I need to edit the properties file in the target directory (the src/main/resources dir should remain untouched).
Nice to have:
- Add configuration settings only if they aren't already defined in the file (to avoid duplicating entries added manually)
Is there some maven plugin / hook that I can tap into to do this?
[1]: http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html | 0 |
5,978,187 | 05/12/2011 12:45:04 | 685,528 | 03/31/2011 10:27:23 | 13 | 1 | Titanium for android and iPhone SDK | We are developing an iPhone and Android app using Titanium latets SDK. Please let me know if we need to be careful in any of the things. The app is a big one with its own database and webservices to connect to the server. The app keeps on talking to the webservcer for many functionality. | iphone | android | titanium | null | null | 05/13/2011 05:18:32 | not a real question | Titanium for android and iPhone SDK
===
We are developing an iPhone and Android app using Titanium latets SDK. Please let me know if we need to be careful in any of the things. The app is a big one with its own database and webservices to connect to the server. The app keeps on talking to the webservcer for many functionality. | 1 |
1,992,428 | 01/02/2010 18:50:38 | 165,309 | 08/29/2009 09:52:13 | 45 | 4 | What to do if null exception occur in C#? | See ,I have drop down control and i have keep the LIST<string> as datasource. But if list is null Then it throw null exception. So what is the standard way to handle this situation? | handle | exception | null | null | null | null | open | What to do if null exception occur in C#?
===
See ,I have drop down control and i have keep the LIST<string> as datasource. But if list is null Then it throw null exception. So what is the standard way to handle this situation? | 0 |
7,906,832 | 10/26/2011 18:01:02 | 996,060 | 10/14/2011 19:31:55 | 21 | 0 | Good c++ learning books | I am training for Programmer Olympiad, and I would love to know which books are really good, from which I can learn c++ very good. I know I can find everything on internet, but I preffer reading and learning from books. Please give me just name of a book, and not a link, cause I will find many books there, and I won't know which one to buy! Right now I'm waiting from Amazon "Introduction to Algorithms 3rd edition", but I would love to buy one just for C++ learning. | c++ | books | null | null | null | 10/26/2011 18:02:23 | not constructive | Good c++ learning books
===
I am training for Programmer Olympiad, and I would love to know which books are really good, from which I can learn c++ very good. I know I can find everything on internet, but I preffer reading and learning from books. Please give me just name of a book, and not a link, cause I will find many books there, and I won't know which one to buy! Right now I'm waiting from Amazon "Introduction to Algorithms 3rd edition", but I would love to buy one just for C++ learning. | 4 |
7,610,221 | 09/30/2011 12:16:57 | 286,286 | 03/04/2010 13:36:56 | 492 | 22 | What can you do in FQL that you cannot with the Graph API | I'm trying to figure out what are the cases where FQL has features which the Graph API doesn't.
I tried to find the answer in the docs, but as many others have pointed out, they aren't the clearest or the most complete. To make things more difficult, a lot of the blogs commenting on the Developer platform are now dated too.
So, what can FQL do that the Graph API can't? | facebook | facebook-graph-api | facebook-fql | null | null | 10/01/2011 01:32:16 | not a real question | What can you do in FQL that you cannot with the Graph API
===
I'm trying to figure out what are the cases where FQL has features which the Graph API doesn't.
I tried to find the answer in the docs, but as many others have pointed out, they aren't the clearest or the most complete. To make things more difficult, a lot of the blogs commenting on the Developer platform are now dated too.
So, what can FQL do that the Graph API can't? | 1 |
10,632,160 | 05/17/2012 08:23:31 | 1,345,928 | 04/20/2012 07:37:56 | 1 | 0 | Refresh an <option> item text with javascript | I have an option list like this written by javascript,
<option selected value="test">+10:00+"--"+"--"+seats</option>.
I want to refresh every 10 seconds the seats part of the option text without refreshing the page. The seats variable gets its value from a php script on the page loading.The php script loads it from a database. Can i make i query in my database using javascript? Welcomed any solution. | php | javascript | null | null | null | 05/17/2012 09:00:05 | not a real question | Refresh an <option> item text with javascript
===
I have an option list like this written by javascript,
<option selected value="test">+10:00+"--"+"--"+seats</option>.
I want to refresh every 10 seconds the seats part of the option text without refreshing the page. The seats variable gets its value from a php script on the page loading.The php script loads it from a database. Can i make i query in my database using javascript? Welcomed any solution. | 1 |
10,556,047 | 05/11/2012 17:33:36 | 1,337,110 | 04/16/2012 19:31:38 | 36 | 0 | Improving performance of page curl | Im using a class written by someone which uses a dynamic page curl without opengl (I think) It seems to be working well but its a little bit laggy. Any help to speed it up would be great becasue i dont really know what i need to change :) (Thank
public class PageCurlView extends View {
private final static String TAG = "PageCurlView";
// Debug text paint stuff
private Paint mTextPaint;
private TextPaint mTextPaintShadow;
private int mCurlSpeed;
/** Fixed update time used to create a smooth curl animation */
private int mUpdateRate;
/** The initial offset for x and y axis movements */
private int mInitialEdgeOffset;
private int mCurlMode;
/** Simple curl mode. Curl target will move only in one axis. */
public static final int CURLMODE_SIMPLE = 0;
/** Dynamic curl mode. Curl target will move on both X and Y axis. */
public static final int CURLMODE_DYNAMIC = 1;
/** Enable/Disable debug mode */
private boolean bEnableDebugMode = false;
/** The context which owns us */
private WeakReference<Context> mContext;
/** Handler used to auto flip time based */
private FlipAnimationHandler mAnimationHandler;
/** Maximum radius a page can be flipped, by default it's the width of the view */
private float mFlipRadius;
/** Point used to move */
private Vector2D mMovement;
/** The finger position */
private Vector2D mFinger;
/** Movement point form the last frame */
private Vector2D mOldMovement;
private Paint mCurlEdgePaint;
/** Our points used to define the current clipping paths in our draw call */
private Vector2D mA, mB, mC, mD, mE, mF, mOldF, mOrigin;
/** Left and top offset to be applied when drawing */
private int mCurrentLeft, mCurrentTop;
private boolean bViewDrawn;
/** Defines the flip direction that is currently considered */
private boolean bFlipRight;
/** If TRUE we are currently auto-flipping */
private boolean bFlipping;
/** TRUE if the user moves the pages */
private boolean bUserMoves;
/** Used to control touch input blocking */
private boolean bBlockTouchInput = false;
/** Enable input after the next draw event */
private boolean bEnableInputAfterDraw = false;
/** LAGACY The current foreground */
private Bitmap mForeground;
/** LAGACY The current background */
private Bitmap mBackground;
/** LAGACY List of pages, this is just temporal */
private ArrayList<Bitmap> mPages;
/** LAGACY Current selected page */
private int mIndex = 0;
/**
* Inner class used to represent a 2D point.
*/
private class Vector2D
{
public float x,y;
public Vector2D(float x, float y)
{
this.x = x;
this.y = y;
}
@Override
public String toString() {
// TODO Auto-generated method stub
return "("+this.x+","+this.y+")";
}
public float length() {
return (float) Math.sqrt(x * x + y * y);
}
public float lengthSquared() {
return (x * x) + (y * y);
}
public boolean equals(Object o) {
if (o instanceof Vector2D) {
Vector2D p = (Vector2D) o;
return p.x == x && p.y == y;
}
return false;
}
public Vector2D reverse() {
return new Vector2D(-x,-y);
}
public Vector2D sum(Vector2D b) {
return new Vector2D(x+b.x,y+b.y);
}
public Vector2D sub(Vector2D b) {
return new Vector2D(x-b.x,y-b.y);
}
public float dot(Vector2D vec) {
return (x * vec.x) + (y * vec.y);
}
public float cross(Vector2D a, Vector2D b) {
return a.cross(b);
}
public float cross(Vector2D vec) {
return x * vec.y - y * vec.x;
}
public float distanceSquared(Vector2D other) {
float dx = other.x - x;
float dy = other.y - y;
return (dx * dx) + (dy * dy);
}
public float distance(Vector2D other) {
return (float) Math.sqrt(distanceSquared(other));
}
public float dotProduct(Vector2D other) {
return other.x * x + other.y * y;
}
public Vector2D normalize() {
float magnitude = (float) Math.sqrt(dotProduct(this));
return new Vector2D(x / magnitude, y / magnitude);
}
public Vector2D mult(float scalar) {
return new Vector2D(x*scalar,y*scalar);
}
}
/**
* Inner class used to make a fixed timed animation of the curl effect.
*/
class FlipAnimationHandler extends Handler {
@Override
public void handleMessage(Message msg) {
PageCurlView.this.FlipAnimationStep();
}
public void sleep(long millis) {
this.removeMessages(0);
sendMessageDelayed(obtainMessage(0), millis);
}
}
public PageCurlView(Context context) {
super(context);
init(context);
ResetClipEdge();
}
public PageCurlView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
// Get the data from the XML AttributeSet
{
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.PageCurlView);
// Get data
bEnableDebugMode = a.getBoolean(R.styleable.PageCurlView_enableDebugMode, bEnableDebugMode);
mCurlSpeed = a.getInt(R.styleable.PageCurlView_curlSpeed, mCurlSpeed);
mUpdateRate = a.getInt(R.styleable.PageCurlView_updateRate, mUpdateRate);
mInitialEdgeOffset = a.getInt(R.styleable.PageCurlView_initialEdgeOffset, mInitialEdgeOffset);
mCurlMode = a.getInt(R.styleable.PageCurlView_curlMode, mCurlMode);
Log.i(TAG, "mCurlSpeed: " + mCurlSpeed);
Log.i(TAG, "mUpdateRate: " + mUpdateRate);
Log.i(TAG, "mInitialEdgeOffset: " + mInitialEdgeOffset);
Log.i(TAG, "mCurlMode: " + mCurlMode);
// recycle object (so it can be used by others)
a.recycle();
}
ResetClipEdge();
}
/**
* Initialize the view
*/
private final void init(Context context) {
// Foreground text paint
mTextPaint = new Paint();
mTextPaint.setAntiAlias(true);
mTextPaint.setTextSize(16);
mTextPaint.setColor(0xFF000000);
// The shadow
mTextPaintShadow = new TextPaint();
mTextPaintShadow.setAntiAlias(true);
mTextPaintShadow.setTextSize(16);
mTextPaintShadow.setColor(0x00000000);
// Cache the context
mContext = new WeakReference<Context>(context);
// Base padding
setPadding(3, 3, 3, 3);
// The focus flags are needed
setFocusable(true);
setFocusableInTouchMode(true);
mMovement = new Vector2D(0,0);
mFinger = new Vector2D(0,0);
mOldMovement = new Vector2D(0,0);
// Create our curl animation handler
mAnimationHandler = new FlipAnimationHandler();
// Create our edge paint
mCurlEdgePaint = new Paint();
mCurlEdgePaint.setColor(Color.WHITE);
mCurlEdgePaint.setAntiAlias(true);
mCurlEdgePaint.setStyle(Paint.Style.FILL);
mCurlEdgePaint.setShadowLayer(10, -5, 5, 0x99000000);
// Set the default props, those come from an XML :D
mCurlSpeed = 125;
mUpdateRate = 50;
mInitialEdgeOffset = 20;
mCurlMode = 1;
BitmapFactory.Options opt = new BitmapFactory.Options();
opt.inPreferredConfig = Config.RGB_565;
// LEGACY PAGE HANDLING!
// Create pages
mPages = new ArrayList<Bitmap>();
System.gc();
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.front, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page0b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page2b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page3b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page4b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page5b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page6b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page7b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page8b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page9b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page10b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page12b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page13b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page14b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page15b1, opt));
System.gc();
// Create some sample images
mForeground = mPages.get(0);
mBackground = mPages.get(1);
System.gc();
}
public void ResetClipEdge()
{
// Set our base movement
mMovement.x = mInitialEdgeOffset;
mMovement.y = mInitialEdgeOffset;
mOldMovement.x = 0;
mOldMovement.y = 0;
// Now set the points
// TODO: OK, those points MUST come from our measures and
// the actual bounds of the view!
mA = new Vector2D(mInitialEdgeOffset, 0);
mB = new Vector2D(this.getWidth(), this.getHeight());
mC = new Vector2D(this.getWidth(), 0);
mD = new Vector2D(0, 0);
mE = new Vector2D(0, 0);
mF = new Vector2D(0, 0);
mOldF = new Vector2D(0, 0);
// The movement origin point
mOrigin = new Vector2D(this.getWidth(), 0);
}
/**
* Return the context which created use. Can return null if the
* context has been erased.
*/
private Context GetContext() {
return mContext.get();
}
/**
* See if the current curl mode is dynamic
* @return TRUE if the mode is CURLMODE_DYNAMIC, FALSE otherwise
*/
public boolean IsCurlModeDynamic()
{
return mCurlMode == CURLMODE_DYNAMIC;
}
/**
* Set the curl speed.
* @param curlSpeed - New speed in px/frame
* @throws IllegalArgumentException if curlspeed < 1
*/
public void SetCurlSpeed(int curlSpeed)
{
if ( curlSpeed < 1 )
throw new IllegalArgumentException("curlSpeed must be greated than 0");
mCurlSpeed = curlSpeed;
}
/**
* Get the current curl speed
* @return int - Curl speed in px/frame
*/
public int GetCurlSpeed()
{
return mCurlSpeed;
}
/**
* Set the update rate for the curl animation
* @param updateRate - Fixed animation update rate in fps
* @throws IllegalArgumentException if updateRate < 1
*/
public void SetUpdateRate(int updateRate)
{
if ( updateRate < 1 )
throw new IllegalArgumentException("updateRate must be greated than 0");
mUpdateRate = updateRate;
}
/**
* Get the current animation update rate
* @return int - Fixed animation update rate in fps
*/
public int GetUpdateRate()
{
return mUpdateRate;
}
/**
* Set the initial pixel offset for the curl edge
* @param initialEdgeOffset - px offset for curl edge
* @throws IllegalArgumentException if initialEdgeOffset < 0
*/
public void SetInitialEdgeOffset(int initialEdgeOffset)
{
if ( initialEdgeOffset < 0 )
throw new IllegalArgumentException("initialEdgeOffset can not negative");
mInitialEdgeOffset = initialEdgeOffset;
}
/**
* Get the initial pixel offset for the curl edge
* @return int - px
*/
public int GetInitialEdgeOffset()
{
return mInitialEdgeOffset;
}
/**
* Set the curl mode.
* <p>Can be one of the following values:</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Value</th><th>Description</th></tr>
* <tr><td><code>{@link #CURLMODE_SIMPLE com.dcg.pagecurl:CURLMODE_SIMPLE}</code></td><td>Curl target will move only in one axis.</td></tr>
* <tr><td><code>{@link #CURLMODE_DYNAMIC com.dcg.pagecurl:CURLMODE_DYNAMIC}</code></td><td>Curl target will move on both X and Y axis.</td></tr>
* </table>
* @see #CURLMODE_SIMPLE
* @see #CURLMODE_DYNAMIC
* @param curlMode
* @throws IllegalArgumentException if curlMode is invalid
*/
public void SetCurlMode(int curlMode)
{
if ( curlMode != CURLMODE_SIMPLE &&
curlMode != CURLMODE_DYNAMIC )
throw new IllegalArgumentException("Invalid curlMode");
mCurlMode = curlMode;
}
public int GetCurlMode()
{
return mCurlMode;
}
public void SetEnableDebugMode(boolean bFlag)
{
bEnableDebugMode = bFlag;
}
/**
* Check if we are currently in debug mode.
* @return boolean - If TRUE debug mode is on, FALSE otherwise.
*/
public boolean IsDebugModeEnabled()
{
return bEnableDebugMode;
}
/**
* @see android.view.View#measure(int, int)
*/
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int finalWidth, finalHeight;
finalWidth = measureWidth(widthMeasureSpec);
finalHeight = measureHeight(heightMeasureSpec);
setMeasuredDimension(finalWidth, finalHeight);
}
private int measureWidth(int measureSpec) {
int result = 0;
int specMode = MeasureSpec.getMode(measureSpec);
int specSize = MeasureSpec.getSize(measureSpec);
if (specMode == MeasureSpec.EXACTLY) {
// We were told how big to be
result = specSize;
} else {
// Measure the text
result = specSize;
}
return result;
}
/**
* Determines the height of this view
* @param measureSpec A measureSpec packed into an int
* @return The height of the view, honoring constraints from measureSpec
*/
private int measureHeight(int measureSpec) {
int result = 0;
int specMode = MeasureSpec.getMode(measureSpec);
int specSize = MeasureSpec.getSize(measureSpec);
if (specMode == MeasureSpec.EXACTLY) {
// We were told how big to be
result = specSize;
} else {
// Measure the text (beware: ascent is a negative number)
result = specSize;
}
return result;
}
/**
* Render the text
*
* @see android.view.View#onDraw(android.graphics.Canvas)
*/
//@Override
//protected void onDraw(Canvas canvas) {
// super.onDraw(canvas);
// canvas.drawText(mText, getPaddingLeft(), getPaddingTop() - mAscent, mTextPaint);
//}
@Override
public boolean onTouchEvent(MotionEvent event) {
if (!bBlockTouchInput) {
// Get our finger position
mFinger.x = event.getX();
mFinger.y = event.getY();
int width = getWidth();
// Depending on the action do what we need to
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
mOldMovement.x = mFinger.x;
mOldMovement.y = mFinger.y;
// If we moved over the half of the display flip to next
if (mOldMovement.x > (width >> 1)) {
mMovement.x = mInitialEdgeOffset;
mMovement.y = mInitialEdgeOffset;
// Set the right movement flag
bFlipRight = true;
} else {
// Set the left movement flag
bFlipRight = false;
// go to next previous page
previousView();
// Set new movement
mMovement.x = IsCurlModeDynamic()?width<<1:width;
mMovement.y = mInitialEdgeOffset;
}
break;
case MotionEvent.ACTION_UP:
bUserMoves=false;
bFlipping=true;
FlipAnimationStep();
break;
case MotionEvent.ACTION_MOVE:
bUserMoves=true;
// Get movement
mMovement.x -= mFinger.x - mOldMovement.x;
mMovement.y -= mFinger.y - mOldMovement.y;
mMovement = CapMovement(mMovement, true);
// Make sure the y value get's locked at a nice level
if ( mMovement.y <= 1 )
mMovement.y = 1;
// Get movement direction
if (mFinger.x < mOldMovement.x ) {
bFlipRight = true;
} else {
bFlipRight = false;
}
// Save old movement values
mOldMovement.x = mFinger.x;
mOldMovement.y = mFinger.y;
// Force a new draw call
DoPageCurl();
this.invalidate();
break;
}
}
// TODO: Only consume event if we need to.
return true;
}
/**
* Make sure we never move too much, and make sure that if we
* move too much to add a displacement so that the movement will
* be still in our radius.
*/
private Vector2D CapMovement(Vector2D point, boolean bMaintainMoveDir)
{
// Make sure we never ever move too much
if (point.distance(mOrigin) > mFlipRadius)
{
if ( bMaintainMoveDir )
{
// Maintain the direction
point = mOrigin.sum(point.sub(mOrigin).normalize().mult(mFlipRadius));
}
else
{
// Change direction
if ( point.x > (mOrigin.x+mFlipRadius))
point.x = (mOrigin.x+mFlipRadius);
else if ( point.x < (mOrigin.x-mFlipRadius) )
point.x = (mOrigin.x-mFlipRadius);
point.y = (float) (Math.sin(Math.acos(Math.abs(point.x-mOrigin.x)/mFlipRadius))*mFlipRadius);
}
}
return point;
}
/**
* Execute a step of the flip animation
*/
public void FlipAnimationStep() {
if ( !bFlipping )
return;
int width = getWidth();
// No input when flipping
bBlockTouchInput = true;
// Handle speed
float curlSpeed = mCurlSpeed;
if ( !bFlipRight )
curlSpeed *= -1;
// Move us
mMovement.x += curlSpeed;
mMovement = CapMovement(mMovement, false);
// Create values
DoPageCurl();
// Check for endings :D
if (mA.x < 1 || mA.x > width - 1) {
bFlipping = false;
if (bFlipRight) {
//SwapViews();
nextView();
}
ResetClipEdge();
// Create values
DoPageCurl();
// Enable touch input after the next draw event
bEnableInputAfterDraw = true;
}
else
{
mAnimationHandler.sleep(mUpdateRate);
}
// Force a new draw call
this.invalidate();
}
/**
* Do the page curl depending on the methods we are using
*/
private void DoPageCurl()
{
if(bFlipping){
if ( IsCurlModeDynamic() )
doDynamicCurl();
else
doSimpleCurl();
} else {
if ( IsCurlModeDynamic() )
doDynamicCurl();
else
doSimpleCurl();
}
}
/**
* Do a simple page curl effect
*/
private void doSimpleCurl() {
int width = getWidth();
int height = getHeight();
// Calculate point A
mA.x = width - mMovement.x;
mA.y = height;
// Calculate point D
mD.x = 0;
mD.y = 0;
if (mA.x > width / 2) {
mD.x = width;
mD.y = height - (width - mA.x) * height / mA.x;
} else {
mD.x = 2 * mA.x;
mD.y = 0;
}
// Now calculate E and F taking into account that the line
// AD is perpendicular to FB and EC. B and C are fixed points.
double angle = Math.atan((height - mD.y) / (mD.x + mMovement.x - width));
double _cos = Math.cos(2 * angle);
double _sin = Math.sin(2 * angle);
// And get F
mF.x = (float) (width - mMovement.x + _cos * mMovement.x);
mF.y = (float) (height - _sin * mMovement.x);
// If the x position of A is above half of the page we are still not
// folding the upper-right edge and so E and D are equal.
if (mA.x > width / 2) {
mE.x = mD.x;
mE.y = mD.y;
}
else
{
// So get E
mE.x = (float) (mD.x + _cos * (width - mD.x));
mE.y = (float) -(_sin * (width - mD.x));
}
}
/**
* Calculate the dynamic effect, that one that follows the users finger
*/
private void doDynamicCurl() {
int width = getWidth();
int height = getHeight();
// F will follow the finger, we add a small displacement
// So that we can see the edge
mF.x = width - mMovement.x+0.1f;
mF.y = height - mMovement.y+0.1f;
// Set min points
if(mA.x==0) {
mF.x= Math.min(mF.x, mOldF.x);
mF.y= Math.max(mF.y, mOldF.y);
}
// Get diffs
float deltaX = width-mF.x;
float deltaY = height-mF.y;
float BH = (float) (Math.sqrt(deltaX * deltaX + deltaY * deltaY) / 2);
double tangAlpha = deltaY / deltaX;
double alpha = Math.atan(deltaY / deltaX);
double _cos = Math.cos(alpha);
double _sin = Math.sin(alpha);
mA.x = (float) (width - (BH / _cos));
mA.y = height;
mD.y = (float) (height - (BH / _sin));
mD.x = width;
mA.x = Math.max(0,mA.x);
if(mA.x==0) {
mOldF.x = mF.x;
mOldF.y = mF.y;
}
// Get W
mE.x = mD.x;
mE.y = mD.y;
// Correct
if (mD.y < 0) {
mD.x = width + (float) (tangAlpha * mD.y);
mE.y = 0;
mE.x = width + (float) (Math.tan(2 * alpha) * mD.y);
}
}
/**
* Swap between the fore and back-ground.
*/
@Deprecated
private void SwapViews() {
Bitmap temp = mForeground;
mForeground = mBackground;
mBackground = temp;
}
/**
* Swap to next view
*/
private void nextView() {
int foreIndex = mIndex + 1;
if(foreIndex >= mPages.size()) {
foreIndex = 0;
}
int backIndex = foreIndex + 1;
if(backIndex >= mPages.size()) {
backIndex = 0;
}
mIndex = foreIndex;
setViews(foreIndex, backIndex);
}
/**
* Swap to previous view
*/
private void previousView() {
int backIndex = mIndex;
int foreIndex = backIndex - 1;
if(foreIndex < 0) {
foreIndex = mPages.size()-1;
}
mIndex = foreIndex;
setViews(foreIndex, backIndex);
}
/**
* Set current fore and background
* @param foreground - Foreground view index
* @param background - Background view index
*/
private void setViews(int foreground, int background) {
mForeground = mPages.get(foreground);
mBackground = mPages.get(background);
}
@Override
protected void onDraw(Canvas canvas) {
// Always refresh offsets
mCurrentLeft = getLeft();
mCurrentTop = getTop();
// Translate the whole canvas
//canvas.translate(mCurrentLeft, mCurrentTop);
// We need to initialize all size data when we first draw the view
if ( !bViewDrawn ) {
bViewDrawn = true;
onFirstDrawEvent(canvas);
}
canvas.drawColor(Color.WHITE);
// Curl pages
//DoPageCurl();
// TODO: This just scales the views to the current
// width and height. We should add some logic for:
// 1) Maintain aspect ratio
// 2) Uniform scale
// 3) ...
Rect rect = new Rect();
rect.left = 0;
rect.top = 0;
rect.bottom = getHeight();
rect.right = getWidth();
// First Page render
Paint paint = new Paint();
// Draw our elements
drawForeground(canvas, rect, paint);
drawBackground(canvas, rect, paint);
drawCurlEdge(canvas);
// Draw any debug info once we are done
if ( bEnableDebugMode )
drawDebug(canvas);
// Check if we can re-enable input
if ( bEnableInputAfterDraw )
{
bBlockTouchInput = false;
bEnableInputAfterDraw = false;
}
// Restore canvas
//canvas.restore();
}
/**
* Called on the first draw event of the view
* @param canvas
*/
protected void onFirstDrawEvent(Canvas canvas) {
mFlipRadius = getWidth();
ResetClipEdge();
DoPageCurl();
}
/**
* Draw the foreground
* @param canvas
* @param rect
* @param paint
*/
private void drawForeground( Canvas canvas, Rect rect, Paint paint ) {
canvas.drawBitmap(mForeground, null, rect, paint);
// Draw the page number (first page is 1 in real life :D
// there is no page number 0 hehe)
drawPageNum(canvas, mIndex);
}
/**
* Create a Path used as a mask to draw the background page
* @return
*/
private Path createBackgroundPath() {
Path path = new Path();
path.moveTo(mA.x, mA.y);
path.lineTo(mB.x, mB.y);
path.lineTo(mC.x, mC.y);
path.lineTo(mD.x, mD.y);
path.lineTo(mA.x, mA.y);
return path;
}
/**
* Draw the background image.
* @param canvas
* @param rect
* @param paint
*/
private void drawBackground( Canvas canvas, Rect rect, Paint paint ) {
Path mask = createBackgroundPath();
// Save current canvas so we do not mess it up
canvas.save();
canvas.clipPath(mask);
canvas.drawBitmap(mBackground, null, rect, paint);
// Draw the page number (first page is 1 in real life :D
// there is no page number 0 hehe)
drawPageNum(canvas, mIndex);
canvas.restore();
}
/**
* Creates a path used to draw the curl edge in.
* @return
*/
private Path createCurlEdgePath() {
Path path = new Path();
path.moveTo(mA.x, mA.y);
path.lineTo(mD.x, mD.y);
path.lineTo(mE.x, mE.y);
path.lineTo(mF.x, mF.y);
path.lineTo(mA.x, mA.y);
return path;
}
/**
* Draw the curl page edge
* @param canvas
*/
private void drawCurlEdge( Canvas canvas )
{
Path path = createCurlEdgePath();
canvas.drawPath(path, mCurlEdgePaint);
}
/**
* Draw page num (let this be a bit more custom)
* @param canvas
* @param pageNum
*/
private void drawPageNum(Canvas canvas, int pageNum)
{
mTextPaint.setColor(Color.WHITE);
String pageNumText = "- "+pageNum+" -";
drawCentered(canvas, pageNumText,canvas.getHeight()-mTextPaint.getTextSize()-5,mTextPaint,mTextPaintShadow);
}
public static void drawTextShadowed(Canvas canvas, String text, float x, float y, Paint textPain, Paint shadowPaint) {
canvas.drawText(text, x-1, y, shadowPaint);
canvas.drawText(text, x, y+1, shadowPaint);
canvas.drawText(text, x+1, y, shadowPaint);
canvas.drawText(text, x, y-1, shadowPaint);
canvas.drawText(text, x, y, textPain);
}
/**
* Draw a text with a nice shadow centered in the X axis
* @param canvas
* @param text
* @param y
* @param textPain
* @param shadowPaint
*/
public static void drawCentered(Canvas canvas, String text, float y, Paint textPain, Paint shadowPaint)
{
float posx = (canvas.getWidth() - textPain.measureText(text))/2;
drawTextShadowed(canvas, text, posx, y, textPain, shadowPaint);
}
/**
* Draw debug info
* @param canvas
*/
private void drawDebug(Canvas canvas)
{
float posX = 10;
float posY = 20;
Paint paint = new Paint();
paint.setStrokeWidth(5);
paint.setStyle(Style.STROKE);
paint.setColor(Color.BLACK);
canvas.drawCircle(mOrigin.x, mOrigin.y, getWidth(), paint);
paint.setStrokeWidth(3);
paint.setColor(Color.RED);
canvas.drawCircle(mOrigin.x, mOrigin.y, getWidth(), paint);
paint.setStrokeWidth(5);
paint.setColor(Color.BLACK);
canvas.drawLine(mOrigin.x, mOrigin.y, mMovement.x, mMovement.y, paint);
paint.setStrokeWidth(3);
paint.setColor(Color.RED);
canvas.drawLine(mOrigin.x, mOrigin.y, mMovement.x, mMovement.y, paint);
posY = debugDrawPoint(canvas,"A",mA,Color.RED,posX,posY);
posY = debugDrawPoint(canvas,"B",mB,Color.GREEN,posX,posY);
posY = debugDrawPoint(canvas,"C",mC,Color.BLUE,posX,posY);
posY = debugDrawPoint(canvas,"D",mD,Color.CYAN,posX,posY);
posY = debugDrawPoint(canvas,"E",mE,Color.YELLOW,posX,posY);
posY = debugDrawPoint(canvas,"F",mF,Color.LTGRAY,posX,posY);
posY = debugDrawPoint(canvas,"Mov",mMovement,Color.DKGRAY,posX,posY);
posY = debugDrawPoint(canvas,"Origin",mOrigin,Color.MAGENTA,posX,posY);
posY = debugDrawPoint(canvas,"Finger",mFinger,Color.GREEN,posX,posY);
// Draw some curl stuff (Just some test)
/*
canvas.save();
Vector2D center = new Vector2D(getWidth()/2,getHeight()/2);
//canvas.rotate(315,center.x,center.y);
// Test each lines
//float radius = mA.distance(mD)/2.f;
//float radius = mA.distance(mE)/2.f;
float radius = mA.distance(mF)/2.f;
//float radius = 10;
float reduction = 4.f;
RectF oval = new RectF();
oval.top = center.y-radius/reduction;
oval.bottom = center.y+radius/reduction;
oval.left = center.x-radius;
oval.right = center.x+radius;
canvas.drawArc(oval, 0, 360, false, paint);
canvas.restore();
/**/
}
private float debugDrawPoint(Canvas canvas, String name, Vector2D point, int color, float posX, float posY) {
return debugDrawPoint(canvas,name+" "+point.toString(),point.x, point.y, color, posX, posY);
}
private float debugDrawPoint(Canvas canvas, String name, float X, float Y, int color, float posX, float posY) {
mTextPaint.setColor(color);
drawTextShadowed(canvas,name,posX , posY, mTextPaint,mTextPaintShadow);
Paint paint = new Paint();
paint.setStrokeWidth(5);
paint.setColor(color);
canvas.drawPoint(X, Y, paint);
return posY+15;
}
}
| android | performance | null | null | null | 05/11/2012 18:49:13 | off topic | Improving performance of page curl
===
Im using a class written by someone which uses a dynamic page curl without opengl (I think) It seems to be working well but its a little bit laggy. Any help to speed it up would be great becasue i dont really know what i need to change :) (Thank
public class PageCurlView extends View {
private final static String TAG = "PageCurlView";
// Debug text paint stuff
private Paint mTextPaint;
private TextPaint mTextPaintShadow;
private int mCurlSpeed;
/** Fixed update time used to create a smooth curl animation */
private int mUpdateRate;
/** The initial offset for x and y axis movements */
private int mInitialEdgeOffset;
private int mCurlMode;
/** Simple curl mode. Curl target will move only in one axis. */
public static final int CURLMODE_SIMPLE = 0;
/** Dynamic curl mode. Curl target will move on both X and Y axis. */
public static final int CURLMODE_DYNAMIC = 1;
/** Enable/Disable debug mode */
private boolean bEnableDebugMode = false;
/** The context which owns us */
private WeakReference<Context> mContext;
/** Handler used to auto flip time based */
private FlipAnimationHandler mAnimationHandler;
/** Maximum radius a page can be flipped, by default it's the width of the view */
private float mFlipRadius;
/** Point used to move */
private Vector2D mMovement;
/** The finger position */
private Vector2D mFinger;
/** Movement point form the last frame */
private Vector2D mOldMovement;
private Paint mCurlEdgePaint;
/** Our points used to define the current clipping paths in our draw call */
private Vector2D mA, mB, mC, mD, mE, mF, mOldF, mOrigin;
/** Left and top offset to be applied when drawing */
private int mCurrentLeft, mCurrentTop;
private boolean bViewDrawn;
/** Defines the flip direction that is currently considered */
private boolean bFlipRight;
/** If TRUE we are currently auto-flipping */
private boolean bFlipping;
/** TRUE if the user moves the pages */
private boolean bUserMoves;
/** Used to control touch input blocking */
private boolean bBlockTouchInput = false;
/** Enable input after the next draw event */
private boolean bEnableInputAfterDraw = false;
/** LAGACY The current foreground */
private Bitmap mForeground;
/** LAGACY The current background */
private Bitmap mBackground;
/** LAGACY List of pages, this is just temporal */
private ArrayList<Bitmap> mPages;
/** LAGACY Current selected page */
private int mIndex = 0;
/**
* Inner class used to represent a 2D point.
*/
private class Vector2D
{
public float x,y;
public Vector2D(float x, float y)
{
this.x = x;
this.y = y;
}
@Override
public String toString() {
// TODO Auto-generated method stub
return "("+this.x+","+this.y+")";
}
public float length() {
return (float) Math.sqrt(x * x + y * y);
}
public float lengthSquared() {
return (x * x) + (y * y);
}
public boolean equals(Object o) {
if (o instanceof Vector2D) {
Vector2D p = (Vector2D) o;
return p.x == x && p.y == y;
}
return false;
}
public Vector2D reverse() {
return new Vector2D(-x,-y);
}
public Vector2D sum(Vector2D b) {
return new Vector2D(x+b.x,y+b.y);
}
public Vector2D sub(Vector2D b) {
return new Vector2D(x-b.x,y-b.y);
}
public float dot(Vector2D vec) {
return (x * vec.x) + (y * vec.y);
}
public float cross(Vector2D a, Vector2D b) {
return a.cross(b);
}
public float cross(Vector2D vec) {
return x * vec.y - y * vec.x;
}
public float distanceSquared(Vector2D other) {
float dx = other.x - x;
float dy = other.y - y;
return (dx * dx) + (dy * dy);
}
public float distance(Vector2D other) {
return (float) Math.sqrt(distanceSquared(other));
}
public float dotProduct(Vector2D other) {
return other.x * x + other.y * y;
}
public Vector2D normalize() {
float magnitude = (float) Math.sqrt(dotProduct(this));
return new Vector2D(x / magnitude, y / magnitude);
}
public Vector2D mult(float scalar) {
return new Vector2D(x*scalar,y*scalar);
}
}
/**
* Inner class used to make a fixed timed animation of the curl effect.
*/
class FlipAnimationHandler extends Handler {
@Override
public void handleMessage(Message msg) {
PageCurlView.this.FlipAnimationStep();
}
public void sleep(long millis) {
this.removeMessages(0);
sendMessageDelayed(obtainMessage(0), millis);
}
}
public PageCurlView(Context context) {
super(context);
init(context);
ResetClipEdge();
}
public PageCurlView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
// Get the data from the XML AttributeSet
{
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.PageCurlView);
// Get data
bEnableDebugMode = a.getBoolean(R.styleable.PageCurlView_enableDebugMode, bEnableDebugMode);
mCurlSpeed = a.getInt(R.styleable.PageCurlView_curlSpeed, mCurlSpeed);
mUpdateRate = a.getInt(R.styleable.PageCurlView_updateRate, mUpdateRate);
mInitialEdgeOffset = a.getInt(R.styleable.PageCurlView_initialEdgeOffset, mInitialEdgeOffset);
mCurlMode = a.getInt(R.styleable.PageCurlView_curlMode, mCurlMode);
Log.i(TAG, "mCurlSpeed: " + mCurlSpeed);
Log.i(TAG, "mUpdateRate: " + mUpdateRate);
Log.i(TAG, "mInitialEdgeOffset: " + mInitialEdgeOffset);
Log.i(TAG, "mCurlMode: " + mCurlMode);
// recycle object (so it can be used by others)
a.recycle();
}
ResetClipEdge();
}
/**
* Initialize the view
*/
private final void init(Context context) {
// Foreground text paint
mTextPaint = new Paint();
mTextPaint.setAntiAlias(true);
mTextPaint.setTextSize(16);
mTextPaint.setColor(0xFF000000);
// The shadow
mTextPaintShadow = new TextPaint();
mTextPaintShadow.setAntiAlias(true);
mTextPaintShadow.setTextSize(16);
mTextPaintShadow.setColor(0x00000000);
// Cache the context
mContext = new WeakReference<Context>(context);
// Base padding
setPadding(3, 3, 3, 3);
// The focus flags are needed
setFocusable(true);
setFocusableInTouchMode(true);
mMovement = new Vector2D(0,0);
mFinger = new Vector2D(0,0);
mOldMovement = new Vector2D(0,0);
// Create our curl animation handler
mAnimationHandler = new FlipAnimationHandler();
// Create our edge paint
mCurlEdgePaint = new Paint();
mCurlEdgePaint.setColor(Color.WHITE);
mCurlEdgePaint.setAntiAlias(true);
mCurlEdgePaint.setStyle(Paint.Style.FILL);
mCurlEdgePaint.setShadowLayer(10, -5, 5, 0x99000000);
// Set the default props, those come from an XML :D
mCurlSpeed = 125;
mUpdateRate = 50;
mInitialEdgeOffset = 20;
mCurlMode = 1;
BitmapFactory.Options opt = new BitmapFactory.Options();
opt.inPreferredConfig = Config.RGB_565;
// LEGACY PAGE HANDLING!
// Create pages
mPages = new ArrayList<Bitmap>();
System.gc();
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.front, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page0b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page2b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page3b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page4b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page5b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page6b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page7b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page8b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page9b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page10b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page12b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page13b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page14b1, opt));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page15b1, opt));
System.gc();
// Create some sample images
mForeground = mPages.get(0);
mBackground = mPages.get(1);
System.gc();
}
public void ResetClipEdge()
{
// Set our base movement
mMovement.x = mInitialEdgeOffset;
mMovement.y = mInitialEdgeOffset;
mOldMovement.x = 0;
mOldMovement.y = 0;
// Now set the points
// TODO: OK, those points MUST come from our measures and
// the actual bounds of the view!
mA = new Vector2D(mInitialEdgeOffset, 0);
mB = new Vector2D(this.getWidth(), this.getHeight());
mC = new Vector2D(this.getWidth(), 0);
mD = new Vector2D(0, 0);
mE = new Vector2D(0, 0);
mF = new Vector2D(0, 0);
mOldF = new Vector2D(0, 0);
// The movement origin point
mOrigin = new Vector2D(this.getWidth(), 0);
}
/**
* Return the context which created use. Can return null if the
* context has been erased.
*/
private Context GetContext() {
return mContext.get();
}
/**
* See if the current curl mode is dynamic
* @return TRUE if the mode is CURLMODE_DYNAMIC, FALSE otherwise
*/
public boolean IsCurlModeDynamic()
{
return mCurlMode == CURLMODE_DYNAMIC;
}
/**
* Set the curl speed.
* @param curlSpeed - New speed in px/frame
* @throws IllegalArgumentException if curlspeed < 1
*/
public void SetCurlSpeed(int curlSpeed)
{
if ( curlSpeed < 1 )
throw new IllegalArgumentException("curlSpeed must be greated than 0");
mCurlSpeed = curlSpeed;
}
/**
* Get the current curl speed
* @return int - Curl speed in px/frame
*/
public int GetCurlSpeed()
{
return mCurlSpeed;
}
/**
* Set the update rate for the curl animation
* @param updateRate - Fixed animation update rate in fps
* @throws IllegalArgumentException if updateRate < 1
*/
public void SetUpdateRate(int updateRate)
{
if ( updateRate < 1 )
throw new IllegalArgumentException("updateRate must be greated than 0");
mUpdateRate = updateRate;
}
/**
* Get the current animation update rate
* @return int - Fixed animation update rate in fps
*/
public int GetUpdateRate()
{
return mUpdateRate;
}
/**
* Set the initial pixel offset for the curl edge
* @param initialEdgeOffset - px offset for curl edge
* @throws IllegalArgumentException if initialEdgeOffset < 0
*/
public void SetInitialEdgeOffset(int initialEdgeOffset)
{
if ( initialEdgeOffset < 0 )
throw new IllegalArgumentException("initialEdgeOffset can not negative");
mInitialEdgeOffset = initialEdgeOffset;
}
/**
* Get the initial pixel offset for the curl edge
* @return int - px
*/
public int GetInitialEdgeOffset()
{
return mInitialEdgeOffset;
}
/**
* Set the curl mode.
* <p>Can be one of the following values:</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Value</th><th>Description</th></tr>
* <tr><td><code>{@link #CURLMODE_SIMPLE com.dcg.pagecurl:CURLMODE_SIMPLE}</code></td><td>Curl target will move only in one axis.</td></tr>
* <tr><td><code>{@link #CURLMODE_DYNAMIC com.dcg.pagecurl:CURLMODE_DYNAMIC}</code></td><td>Curl target will move on both X and Y axis.</td></tr>
* </table>
* @see #CURLMODE_SIMPLE
* @see #CURLMODE_DYNAMIC
* @param curlMode
* @throws IllegalArgumentException if curlMode is invalid
*/
public void SetCurlMode(int curlMode)
{
if ( curlMode != CURLMODE_SIMPLE &&
curlMode != CURLMODE_DYNAMIC )
throw new IllegalArgumentException("Invalid curlMode");
mCurlMode = curlMode;
}
public int GetCurlMode()
{
return mCurlMode;
}
public void SetEnableDebugMode(boolean bFlag)
{
bEnableDebugMode = bFlag;
}
/**
* Check if we are currently in debug mode.
* @return boolean - If TRUE debug mode is on, FALSE otherwise.
*/
public boolean IsDebugModeEnabled()
{
return bEnableDebugMode;
}
/**
* @see android.view.View#measure(int, int)
*/
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int finalWidth, finalHeight;
finalWidth = measureWidth(widthMeasureSpec);
finalHeight = measureHeight(heightMeasureSpec);
setMeasuredDimension(finalWidth, finalHeight);
}
private int measureWidth(int measureSpec) {
int result = 0;
int specMode = MeasureSpec.getMode(measureSpec);
int specSize = MeasureSpec.getSize(measureSpec);
if (specMode == MeasureSpec.EXACTLY) {
// We were told how big to be
result = specSize;
} else {
// Measure the text
result = specSize;
}
return result;
}
/**
* Determines the height of this view
* @param measureSpec A measureSpec packed into an int
* @return The height of the view, honoring constraints from measureSpec
*/
private int measureHeight(int measureSpec) {
int result = 0;
int specMode = MeasureSpec.getMode(measureSpec);
int specSize = MeasureSpec.getSize(measureSpec);
if (specMode == MeasureSpec.EXACTLY) {
// We were told how big to be
result = specSize;
} else {
// Measure the text (beware: ascent is a negative number)
result = specSize;
}
return result;
}
/**
* Render the text
*
* @see android.view.View#onDraw(android.graphics.Canvas)
*/
//@Override
//protected void onDraw(Canvas canvas) {
// super.onDraw(canvas);
// canvas.drawText(mText, getPaddingLeft(), getPaddingTop() - mAscent, mTextPaint);
//}
@Override
public boolean onTouchEvent(MotionEvent event) {
if (!bBlockTouchInput) {
// Get our finger position
mFinger.x = event.getX();
mFinger.y = event.getY();
int width = getWidth();
// Depending on the action do what we need to
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
mOldMovement.x = mFinger.x;
mOldMovement.y = mFinger.y;
// If we moved over the half of the display flip to next
if (mOldMovement.x > (width >> 1)) {
mMovement.x = mInitialEdgeOffset;
mMovement.y = mInitialEdgeOffset;
// Set the right movement flag
bFlipRight = true;
} else {
// Set the left movement flag
bFlipRight = false;
// go to next previous page
previousView();
// Set new movement
mMovement.x = IsCurlModeDynamic()?width<<1:width;
mMovement.y = mInitialEdgeOffset;
}
break;
case MotionEvent.ACTION_UP:
bUserMoves=false;
bFlipping=true;
FlipAnimationStep();
break;
case MotionEvent.ACTION_MOVE:
bUserMoves=true;
// Get movement
mMovement.x -= mFinger.x - mOldMovement.x;
mMovement.y -= mFinger.y - mOldMovement.y;
mMovement = CapMovement(mMovement, true);
// Make sure the y value get's locked at a nice level
if ( mMovement.y <= 1 )
mMovement.y = 1;
// Get movement direction
if (mFinger.x < mOldMovement.x ) {
bFlipRight = true;
} else {
bFlipRight = false;
}
// Save old movement values
mOldMovement.x = mFinger.x;
mOldMovement.y = mFinger.y;
// Force a new draw call
DoPageCurl();
this.invalidate();
break;
}
}
// TODO: Only consume event if we need to.
return true;
}
/**
* Make sure we never move too much, and make sure that if we
* move too much to add a displacement so that the movement will
* be still in our radius.
*/
private Vector2D CapMovement(Vector2D point, boolean bMaintainMoveDir)
{
// Make sure we never ever move too much
if (point.distance(mOrigin) > mFlipRadius)
{
if ( bMaintainMoveDir )
{
// Maintain the direction
point = mOrigin.sum(point.sub(mOrigin).normalize().mult(mFlipRadius));
}
else
{
// Change direction
if ( point.x > (mOrigin.x+mFlipRadius))
point.x = (mOrigin.x+mFlipRadius);
else if ( point.x < (mOrigin.x-mFlipRadius) )
point.x = (mOrigin.x-mFlipRadius);
point.y = (float) (Math.sin(Math.acos(Math.abs(point.x-mOrigin.x)/mFlipRadius))*mFlipRadius);
}
}
return point;
}
/**
* Execute a step of the flip animation
*/
public void FlipAnimationStep() {
if ( !bFlipping )
return;
int width = getWidth();
// No input when flipping
bBlockTouchInput = true;
// Handle speed
float curlSpeed = mCurlSpeed;
if ( !bFlipRight )
curlSpeed *= -1;
// Move us
mMovement.x += curlSpeed;
mMovement = CapMovement(mMovement, false);
// Create values
DoPageCurl();
// Check for endings :D
if (mA.x < 1 || mA.x > width - 1) {
bFlipping = false;
if (bFlipRight) {
//SwapViews();
nextView();
}
ResetClipEdge();
// Create values
DoPageCurl();
// Enable touch input after the next draw event
bEnableInputAfterDraw = true;
}
else
{
mAnimationHandler.sleep(mUpdateRate);
}
// Force a new draw call
this.invalidate();
}
/**
* Do the page curl depending on the methods we are using
*/
private void DoPageCurl()
{
if(bFlipping){
if ( IsCurlModeDynamic() )
doDynamicCurl();
else
doSimpleCurl();
} else {
if ( IsCurlModeDynamic() )
doDynamicCurl();
else
doSimpleCurl();
}
}
/**
* Do a simple page curl effect
*/
private void doSimpleCurl() {
int width = getWidth();
int height = getHeight();
// Calculate point A
mA.x = width - mMovement.x;
mA.y = height;
// Calculate point D
mD.x = 0;
mD.y = 0;
if (mA.x > width / 2) {
mD.x = width;
mD.y = height - (width - mA.x) * height / mA.x;
} else {
mD.x = 2 * mA.x;
mD.y = 0;
}
// Now calculate E and F taking into account that the line
// AD is perpendicular to FB and EC. B and C are fixed points.
double angle = Math.atan((height - mD.y) / (mD.x + mMovement.x - width));
double _cos = Math.cos(2 * angle);
double _sin = Math.sin(2 * angle);
// And get F
mF.x = (float) (width - mMovement.x + _cos * mMovement.x);
mF.y = (float) (height - _sin * mMovement.x);
// If the x position of A is above half of the page we are still not
// folding the upper-right edge and so E and D are equal.
if (mA.x > width / 2) {
mE.x = mD.x;
mE.y = mD.y;
}
else
{
// So get E
mE.x = (float) (mD.x + _cos * (width - mD.x));
mE.y = (float) -(_sin * (width - mD.x));
}
}
/**
* Calculate the dynamic effect, that one that follows the users finger
*/
private void doDynamicCurl() {
int width = getWidth();
int height = getHeight();
// F will follow the finger, we add a small displacement
// So that we can see the edge
mF.x = width - mMovement.x+0.1f;
mF.y = height - mMovement.y+0.1f;
// Set min points
if(mA.x==0) {
mF.x= Math.min(mF.x, mOldF.x);
mF.y= Math.max(mF.y, mOldF.y);
}
// Get diffs
float deltaX = width-mF.x;
float deltaY = height-mF.y;
float BH = (float) (Math.sqrt(deltaX * deltaX + deltaY * deltaY) / 2);
double tangAlpha = deltaY / deltaX;
double alpha = Math.atan(deltaY / deltaX);
double _cos = Math.cos(alpha);
double _sin = Math.sin(alpha);
mA.x = (float) (width - (BH / _cos));
mA.y = height;
mD.y = (float) (height - (BH / _sin));
mD.x = width;
mA.x = Math.max(0,mA.x);
if(mA.x==0) {
mOldF.x = mF.x;
mOldF.y = mF.y;
}
// Get W
mE.x = mD.x;
mE.y = mD.y;
// Correct
if (mD.y < 0) {
mD.x = width + (float) (tangAlpha * mD.y);
mE.y = 0;
mE.x = width + (float) (Math.tan(2 * alpha) * mD.y);
}
}
/**
* Swap between the fore and back-ground.
*/
@Deprecated
private void SwapViews() {
Bitmap temp = mForeground;
mForeground = mBackground;
mBackground = temp;
}
/**
* Swap to next view
*/
private void nextView() {
int foreIndex = mIndex + 1;
if(foreIndex >= mPages.size()) {
foreIndex = 0;
}
int backIndex = foreIndex + 1;
if(backIndex >= mPages.size()) {
backIndex = 0;
}
mIndex = foreIndex;
setViews(foreIndex, backIndex);
}
/**
* Swap to previous view
*/
private void previousView() {
int backIndex = mIndex;
int foreIndex = backIndex - 1;
if(foreIndex < 0) {
foreIndex = mPages.size()-1;
}
mIndex = foreIndex;
setViews(foreIndex, backIndex);
}
/**
* Set current fore and background
* @param foreground - Foreground view index
* @param background - Background view index
*/
private void setViews(int foreground, int background) {
mForeground = mPages.get(foreground);
mBackground = mPages.get(background);
}
@Override
protected void onDraw(Canvas canvas) {
// Always refresh offsets
mCurrentLeft = getLeft();
mCurrentTop = getTop();
// Translate the whole canvas
//canvas.translate(mCurrentLeft, mCurrentTop);
// We need to initialize all size data when we first draw the view
if ( !bViewDrawn ) {
bViewDrawn = true;
onFirstDrawEvent(canvas);
}
canvas.drawColor(Color.WHITE);
// Curl pages
//DoPageCurl();
// TODO: This just scales the views to the current
// width and height. We should add some logic for:
// 1) Maintain aspect ratio
// 2) Uniform scale
// 3) ...
Rect rect = new Rect();
rect.left = 0;
rect.top = 0;
rect.bottom = getHeight();
rect.right = getWidth();
// First Page render
Paint paint = new Paint();
// Draw our elements
drawForeground(canvas, rect, paint);
drawBackground(canvas, rect, paint);
drawCurlEdge(canvas);
// Draw any debug info once we are done
if ( bEnableDebugMode )
drawDebug(canvas);
// Check if we can re-enable input
if ( bEnableInputAfterDraw )
{
bBlockTouchInput = false;
bEnableInputAfterDraw = false;
}
// Restore canvas
//canvas.restore();
}
/**
* Called on the first draw event of the view
* @param canvas
*/
protected void onFirstDrawEvent(Canvas canvas) {
mFlipRadius = getWidth();
ResetClipEdge();
DoPageCurl();
}
/**
* Draw the foreground
* @param canvas
* @param rect
* @param paint
*/
private void drawForeground( Canvas canvas, Rect rect, Paint paint ) {
canvas.drawBitmap(mForeground, null, rect, paint);
// Draw the page number (first page is 1 in real life :D
// there is no page number 0 hehe)
drawPageNum(canvas, mIndex);
}
/**
* Create a Path used as a mask to draw the background page
* @return
*/
private Path createBackgroundPath() {
Path path = new Path();
path.moveTo(mA.x, mA.y);
path.lineTo(mB.x, mB.y);
path.lineTo(mC.x, mC.y);
path.lineTo(mD.x, mD.y);
path.lineTo(mA.x, mA.y);
return path;
}
/**
* Draw the background image.
* @param canvas
* @param rect
* @param paint
*/
private void drawBackground( Canvas canvas, Rect rect, Paint paint ) {
Path mask = createBackgroundPath();
// Save current canvas so we do not mess it up
canvas.save();
canvas.clipPath(mask);
canvas.drawBitmap(mBackground, null, rect, paint);
// Draw the page number (first page is 1 in real life :D
// there is no page number 0 hehe)
drawPageNum(canvas, mIndex);
canvas.restore();
}
/**
* Creates a path used to draw the curl edge in.
* @return
*/
private Path createCurlEdgePath() {
Path path = new Path();
path.moveTo(mA.x, mA.y);
path.lineTo(mD.x, mD.y);
path.lineTo(mE.x, mE.y);
path.lineTo(mF.x, mF.y);
path.lineTo(mA.x, mA.y);
return path;
}
/**
* Draw the curl page edge
* @param canvas
*/
private void drawCurlEdge( Canvas canvas )
{
Path path = createCurlEdgePath();
canvas.drawPath(path, mCurlEdgePaint);
}
/**
* Draw page num (let this be a bit more custom)
* @param canvas
* @param pageNum
*/
private void drawPageNum(Canvas canvas, int pageNum)
{
mTextPaint.setColor(Color.WHITE);
String pageNumText = "- "+pageNum+" -";
drawCentered(canvas, pageNumText,canvas.getHeight()-mTextPaint.getTextSize()-5,mTextPaint,mTextPaintShadow);
}
public static void drawTextShadowed(Canvas canvas, String text, float x, float y, Paint textPain, Paint shadowPaint) {
canvas.drawText(text, x-1, y, shadowPaint);
canvas.drawText(text, x, y+1, shadowPaint);
canvas.drawText(text, x+1, y, shadowPaint);
canvas.drawText(text, x, y-1, shadowPaint);
canvas.drawText(text, x, y, textPain);
}
/**
* Draw a text with a nice shadow centered in the X axis
* @param canvas
* @param text
* @param y
* @param textPain
* @param shadowPaint
*/
public static void drawCentered(Canvas canvas, String text, float y, Paint textPain, Paint shadowPaint)
{
float posx = (canvas.getWidth() - textPain.measureText(text))/2;
drawTextShadowed(canvas, text, posx, y, textPain, shadowPaint);
}
/**
* Draw debug info
* @param canvas
*/
private void drawDebug(Canvas canvas)
{
float posX = 10;
float posY = 20;
Paint paint = new Paint();
paint.setStrokeWidth(5);
paint.setStyle(Style.STROKE);
paint.setColor(Color.BLACK);
canvas.drawCircle(mOrigin.x, mOrigin.y, getWidth(), paint);
paint.setStrokeWidth(3);
paint.setColor(Color.RED);
canvas.drawCircle(mOrigin.x, mOrigin.y, getWidth(), paint);
paint.setStrokeWidth(5);
paint.setColor(Color.BLACK);
canvas.drawLine(mOrigin.x, mOrigin.y, mMovement.x, mMovement.y, paint);
paint.setStrokeWidth(3);
paint.setColor(Color.RED);
canvas.drawLine(mOrigin.x, mOrigin.y, mMovement.x, mMovement.y, paint);
posY = debugDrawPoint(canvas,"A",mA,Color.RED,posX,posY);
posY = debugDrawPoint(canvas,"B",mB,Color.GREEN,posX,posY);
posY = debugDrawPoint(canvas,"C",mC,Color.BLUE,posX,posY);
posY = debugDrawPoint(canvas,"D",mD,Color.CYAN,posX,posY);
posY = debugDrawPoint(canvas,"E",mE,Color.YELLOW,posX,posY);
posY = debugDrawPoint(canvas,"F",mF,Color.LTGRAY,posX,posY);
posY = debugDrawPoint(canvas,"Mov",mMovement,Color.DKGRAY,posX,posY);
posY = debugDrawPoint(canvas,"Origin",mOrigin,Color.MAGENTA,posX,posY);
posY = debugDrawPoint(canvas,"Finger",mFinger,Color.GREEN,posX,posY);
// Draw some curl stuff (Just some test)
/*
canvas.save();
Vector2D center = new Vector2D(getWidth()/2,getHeight()/2);
//canvas.rotate(315,center.x,center.y);
// Test each lines
//float radius = mA.distance(mD)/2.f;
//float radius = mA.distance(mE)/2.f;
float radius = mA.distance(mF)/2.f;
//float radius = 10;
float reduction = 4.f;
RectF oval = new RectF();
oval.top = center.y-radius/reduction;
oval.bottom = center.y+radius/reduction;
oval.left = center.x-radius;
oval.right = center.x+radius;
canvas.drawArc(oval, 0, 360, false, paint);
canvas.restore();
/**/
}
private float debugDrawPoint(Canvas canvas, String name, Vector2D point, int color, float posX, float posY) {
return debugDrawPoint(canvas,name+" "+point.toString(),point.x, point.y, color, posX, posY);
}
private float debugDrawPoint(Canvas canvas, String name, float X, float Y, int color, float posX, float posY) {
mTextPaint.setColor(color);
drawTextShadowed(canvas,name,posX , posY, mTextPaint,mTextPaintShadow);
Paint paint = new Paint();
paint.setStrokeWidth(5);
paint.setColor(color);
canvas.drawPoint(X, Y, paint);
return posY+15;
}
}
| 2 |
8,120,971 | 11/14/2011 11:35:16 | 822,085 | 06/29/2011 23:09:47 | 104 | 13 | This AD Gallery slider doesnt work on Firefox | I'm using this gallery slider, very old, but it just fit all my requirements. Everything seems works very well so far, but when I checked it on Firefox, it doesnt work. The demo website doesnt work either.
http://coffeescripter.com/code/ad-gallery/
Any idea with this problem?
Thank you! | jquery | css | slider | gallery | null | 11/14/2011 21:24:29 | too localized | This AD Gallery slider doesnt work on Firefox
===
I'm using this gallery slider, very old, but it just fit all my requirements. Everything seems works very well so far, but when I checked it on Firefox, it doesnt work. The demo website doesnt work either.
http://coffeescripter.com/code/ad-gallery/
Any idea with this problem?
Thank you! | 3 |
11,519,486 | 07/17/2012 09:18:50 | 1,406,441 | 05/20/2012 15:52:50 | 3 | 0 | There is a possible way to create reference in C? | I am creating decompiler from IL. (Compiled C#\VB code)
There is a possible way to create reference in C?
Thanks. | c | reference | null | null | null | null | open | There is a possible way to create reference in C?
===
I am creating decompiler from IL. (Compiled C#\VB code)
There is a possible way to create reference in C?
Thanks. | 0 |
5,704,445 | 04/18/2011 14:32:32 | 425,481 | 12/28/2009 16:31:50 | 456 | 9 | handling task factory exceptions | I have set up a process to create new tasks to handle file processing. A problem arised where I received and unhandled exception error and just clicking on the continue button, the main process continued to run. Now I also found that within the child task I was having a file conflict error and as the tasks run as separate .exe i was under the impression that everything would have been thread safe. So for the first issue here is the task creation in the main process..
dim factory as new taskfactory
factory.startne(address of parser.main)
try
task.waitall()
catch ae as aggregateexception
for each ex in ae.innerexceptions
logs.insert(ex.message.tostring)
next
finally
parser.ctsources.cancel()
end try
now I got the aggregateexception thing from msdn and not sure how to implement it but basically what i want to is cancel the task that caused the exception and contiue running all other tasks and capture the file that the cancelled task was working on and save the name to my logs or if possible restart that task with the file it was working on..
Now for the second issue I have a xmlwriter being created when a class is accessed by the task which should create its own instance of it so not sure why there is a clash but if it does happen, does the task / thread just cancel or does it wait to access the file.
....
public class filecleaner
private xmlfile as string = directoryPath & filename
private xwriter as xmltextwriter = new xmltextwriter(xmlfile,nothing)
....
| vb.net | task-parallel-library | taskfactory | null | null | null | open | handling task factory exceptions
===
I have set up a process to create new tasks to handle file processing. A problem arised where I received and unhandled exception error and just clicking on the continue button, the main process continued to run. Now I also found that within the child task I was having a file conflict error and as the tasks run as separate .exe i was under the impression that everything would have been thread safe. So for the first issue here is the task creation in the main process..
dim factory as new taskfactory
factory.startne(address of parser.main)
try
task.waitall()
catch ae as aggregateexception
for each ex in ae.innerexceptions
logs.insert(ex.message.tostring)
next
finally
parser.ctsources.cancel()
end try
now I got the aggregateexception thing from msdn and not sure how to implement it but basically what i want to is cancel the task that caused the exception and contiue running all other tasks and capture the file that the cancelled task was working on and save the name to my logs or if possible restart that task with the file it was working on..
Now for the second issue I have a xmlwriter being created when a class is accessed by the task which should create its own instance of it so not sure why there is a clash but if it does happen, does the task / thread just cancel or does it wait to access the file.
....
public class filecleaner
private xmlfile as string = directoryPath & filename
private xwriter as xmltextwriter = new xmltextwriter(xmlfile,nothing)
....
| 0 |
10,277,105 | 04/23/2012 08:21:17 | 1,349,222 | 04/22/2012 07:07:52 | 19 | 0 | Twitter Search Limitation in PHP | While searching on Twitter using PHP after searching 2 or 3 I got error of you have been rate limited.enhance your calm in PHP
function twitter_class()
$this->realNamePattern = '/\((.*?)\)/';
$this->intervalNames = array('second', 'minute', 'hour', 'day', 'week', 'month', 'year');
$this->intervalSeconds = array( 1, 60, 3600, 86400, 604800, 2630880, 31570560);
$this->badWords = array('somebadword', 'anotherbadword');
function searchURL($language, $query) {
$func_args=func_get_args();
$vars = array_map('urlencode', $func_args + array('', ''));
return vsprintf('http://search.twitter.com/search.atom?lang=%s&q=%s', $vars);
function getTweets($q,$lang, $limit=15)
$output = '';
// get the seach result
$ch = curl_init($this->searchURL($lang, $q));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
$response = curl_exec($ch);
if ($response !== FALSE)
{
$xml = simplexml_load_string($response);
As soon as I search same thing I get the error of you have been rate is there any way for cache for search Whatever I search it just make a cache of it or streaming API as this API I can't understand clearly
| php | php5 | null | null | null | 05/01/2012 23:01:56 | not a real question | Twitter Search Limitation in PHP
===
While searching on Twitter using PHP after searching 2 or 3 I got error of you have been rate limited.enhance your calm in PHP
function twitter_class()
$this->realNamePattern = '/\((.*?)\)/';
$this->intervalNames = array('second', 'minute', 'hour', 'day', 'week', 'month', 'year');
$this->intervalSeconds = array( 1, 60, 3600, 86400, 604800, 2630880, 31570560);
$this->badWords = array('somebadword', 'anotherbadword');
function searchURL($language, $query) {
$func_args=func_get_args();
$vars = array_map('urlencode', $func_args + array('', ''));
return vsprintf('http://search.twitter.com/search.atom?lang=%s&q=%s', $vars);
function getTweets($q,$lang, $limit=15)
$output = '';
// get the seach result
$ch = curl_init($this->searchURL($lang, $q));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
$response = curl_exec($ch);
if ($response !== FALSE)
{
$xml = simplexml_load_string($response);
As soon as I search same thing I get the error of you have been rate is there any way for cache for search Whatever I search it just make a cache of it or streaming API as this API I can't understand clearly
| 1 |
6,378,829 | 06/16/2011 21:26:34 | 237,882 | 12/23/2009 20:18:33 | 433 | 35 | iOS Install SDK | I have a little problem with the new Xcode build for Mac OS X Lion. Here's the situation:
- I run Lion on a separate partition.
Upgraded Xcode to the most recent,
iOS 5 compatible version which
removed my iOS 4 SDK from Lion. I
didn't ask it to do that, but well,
it did.
- I still have the iOS 4 SDK on my
MacBook's built in HD, but dragging
it into the appropriate folder in
Lion does not make Xcode recognize
it.
I need this to run on Mac OS X Lion, but it's not letting me add the iOS 4 SDK again, as I need both iOS 4 and iOS 5 to test on, but am stuck on iOS 5 only.
Has anyone accomplished this yet? Talking nicely to Xcode doesn't seem to help it detect the SDK :( :P
Thank you! | iphone | xcode | sdk | null | null | 06/17/2011 02:07:11 | too localized | iOS Install SDK
===
I have a little problem with the new Xcode build for Mac OS X Lion. Here's the situation:
- I run Lion on a separate partition.
Upgraded Xcode to the most recent,
iOS 5 compatible version which
removed my iOS 4 SDK from Lion. I
didn't ask it to do that, but well,
it did.
- I still have the iOS 4 SDK on my
MacBook's built in HD, but dragging
it into the appropriate folder in
Lion does not make Xcode recognize
it.
I need this to run on Mac OS X Lion, but it's not letting me add the iOS 4 SDK again, as I need both iOS 4 and iOS 5 to test on, but am stuck on iOS 5 only.
Has anyone accomplished this yet? Talking nicely to Xcode doesn't seem to help it detect the SDK :( :P
Thank you! | 3 |
10,428,970 | 05/03/2012 09:51:19 | 1,372,099 | 05/03/2012 09:37:44 | 1 | 0 | Intercepting Processor State on Segfault | I am working on a program which analyzes PowerPC code and generates LLVM code for it. As my analysis of branch points/subroutine adresses the code may be incomplete (for example, if the code does something very weird with function pointers) I plan to have a fallback mechanism set up like so:
1. Generated subroutine attempts to branch to address from original program, which will be an unmapped/unexecutable page (depending on host architecture capabilities).
2. A segmentation fault results.
3. Segmentation fault handler identifies what happens, saves the address for full analysis the next time the program is started, then performs a quick and dirty analysis and uses LLVM's JIT capacity to generate executable code for the new branch target.
4. Processor state at the time of the branch is restored, except directed towards the newly generated code.
The problem is I cannot figure out how to obtain the processor state at the segmentation fault. I'm fairly certain there is a way, as GDB does this all the time.
Although the code is cross-platform, I'm focusing on implementing it on x86 OSX/Posix right now. | c++ | debugging | x86 | segmentation-fault | jit | null | open | Intercepting Processor State on Segfault
===
I am working on a program which analyzes PowerPC code and generates LLVM code for it. As my analysis of branch points/subroutine adresses the code may be incomplete (for example, if the code does something very weird with function pointers) I plan to have a fallback mechanism set up like so:
1. Generated subroutine attempts to branch to address from original program, which will be an unmapped/unexecutable page (depending on host architecture capabilities).
2. A segmentation fault results.
3. Segmentation fault handler identifies what happens, saves the address for full analysis the next time the program is started, then performs a quick and dirty analysis and uses LLVM's JIT capacity to generate executable code for the new branch target.
4. Processor state at the time of the branch is restored, except directed towards the newly generated code.
The problem is I cannot figure out how to obtain the processor state at the segmentation fault. I'm fairly certain there is a way, as GDB does this all the time.
Although the code is cross-platform, I'm focusing on implementing it on x86 OSX/Posix right now. | 0 |
5,788,067 | 04/26/2011 08:54:55 | 475,850 | 10/14/2010 13:59:00 | 557 | 8 | How to access attribute of object as an variable? | I have two objects:
object1={
type: 'obj1',
nName: 'nName'
}
object2={
type: 'obj2',
pName: 'pName'
}
In my js code, I have:
object=GET_OBJECT();
The `GET_OBJECT()` method returns either **object1** or **object2**, then, I would like to access the object's **name** attribute which is either **nName** or **pName**.
I have one method which will get the name (pName or nName) of the returned object:
function getName(Object, name){
return object.name;
}
where I would like the `name` to be an variable, so that I can access the `pName` or `nName` in this way:
object=GET_OBJECT();
var name='';
if(object.type=='obj1')
name='nName';
else
name='pName';
var finalName=getName(object, name);
But seems it won't work since in:
function getName(Object, name){
return object.name;
}
`name` is an variable. **In JS, is there any way to access attribute as an variable?** | javascript | javascript-events | javascript-library | javascript-framework | null | null | open | How to access attribute of object as an variable?
===
I have two objects:
object1={
type: 'obj1',
nName: 'nName'
}
object2={
type: 'obj2',
pName: 'pName'
}
In my js code, I have:
object=GET_OBJECT();
The `GET_OBJECT()` method returns either **object1** or **object2**, then, I would like to access the object's **name** attribute which is either **nName** or **pName**.
I have one method which will get the name (pName or nName) of the returned object:
function getName(Object, name){
return object.name;
}
where I would like the `name` to be an variable, so that I can access the `pName` or `nName` in this way:
object=GET_OBJECT();
var name='';
if(object.type=='obj1')
name='nName';
else
name='pName';
var finalName=getName(object, name);
But seems it won't work since in:
function getName(Object, name){
return object.name;
}
`name` is an variable. **In JS, is there any way to access attribute as an variable?** | 0 |
9,994,594 | 04/03/2012 13:45:15 | 1,230,497 | 02/24/2012 10:11:04 | 161 | 30 | C++ style guide | Hi I have a C++ project with several executable and lots of code.
Each executable is equivalent to a single brick in my algorithms chain but common parameters are needed by different executables. I would like to store these params but how to do this properly.
Thanks. | c++ | coding-style | null | null | null | 04/03/2012 13:57:58 | not constructive | C++ style guide
===
Hi I have a C++ project with several executable and lots of code.
Each executable is equivalent to a single brick in my algorithms chain but common parameters are needed by different executables. I would like to store these params but how to do this properly.
Thanks. | 4 |
10,520,852 | 05/09/2012 17:10:26 | 886,545 | 08/09/2011 18:27:37 | 300 | 6 | scrollViewDidEndScrollingAnimation not being called? | For some reason, my scrollview is not calling scrollViewDidEndScrollingAnimation. I am advancing the scrollview in viewDidScroll. Just to help explain the code below, I have two scrollviews in my view: smallScrollView and bigScrollView. when the user moves bigScrollView, I have written some code that advances the smallScrollView programmatically (I left that code out since it works just fine and I didn't think it was relevant).
-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
....
[smallScrollView setContentOffset: CGPointMake(curLoc+kScrollObjWidthSmall, 0) animated:YES];
}
-(void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView{
NSLog(@"scrollview did end animation");
NSLog(@"%i", scrollView.tag);
}
the scrollViewDidEndScrollingAnimation method does not log anything, despite the contentOffset working appropriately, and the animated:Yes being flagged. Any help as to why scrollViewDidEndScrollingAnimation isn't being called would be much appreciated. | objective-c | ios | uiscrollview | null | null | null | open | scrollViewDidEndScrollingAnimation not being called?
===
For some reason, my scrollview is not calling scrollViewDidEndScrollingAnimation. I am advancing the scrollview in viewDidScroll. Just to help explain the code below, I have two scrollviews in my view: smallScrollView and bigScrollView. when the user moves bigScrollView, I have written some code that advances the smallScrollView programmatically (I left that code out since it works just fine and I didn't think it was relevant).
-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
....
[smallScrollView setContentOffset: CGPointMake(curLoc+kScrollObjWidthSmall, 0) animated:YES];
}
-(void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView{
NSLog(@"scrollview did end animation");
NSLog(@"%i", scrollView.tag);
}
the scrollViewDidEndScrollingAnimation method does not log anything, despite the contentOffset working appropriately, and the animated:Yes being flagged. Any help as to why scrollViewDidEndScrollingAnimation isn't being called would be much appreciated. | 0 |
6,995,285 | 08/09/2011 11:15:49 | 790,922 | 03/24/2011 06:35:55 | 53 | 0 | how to access my formcollection in action method asp.net mvc | I have form collection accessed in action method ,but how to get the value of it .I tried like this
string value = collection[1];
but I am not getting the value .How can I access the value in action method.
thanks,
michaled
| asp.net-mvc | null | null | null | null | null | open | how to access my formcollection in action method asp.net mvc
===
I have form collection accessed in action method ,but how to get the value of it .I tried like this
string value = collection[1];
but I am not getting the value .How can I access the value in action method.
thanks,
michaled
| 0 |
3,474,627 | 08/13/2010 07:04:52 | 419,269 | 08/13/2010 07:01:23 | 1 | 0 | JUnit TestCase Failure | Iam running my JunitTest and it gives the following error.. not failure.
Error creating bean with name 'reportDAO' defined in class path resource [LT.xml]:
Cannot resolve reference to bean 'hibernateTemplate' while setting bean property 'hibernateTemplate';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'hibernateTemplate' defined in class path resource [LT.xml]:
Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'sessionFactory' defined in class path resource [LT.xml]:
Invocation of init method failed; nested exception is org.hibernate.MappingException:
Association references unmapped class: dfi.fin.dcm.syn.loantrading.model.engine.result.BDTSTest
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1210)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:978)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:462)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:404)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:375)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:263)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:170)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:260)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:184)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:163)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:430)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
at org.springframework.test.AbstractSingleSpringContextTests.createApplicationContext(AbstractSingleSpringContextTests.java:199)
at org.springframework.test.AbstractSingleSpringContextTests.loadContextLocations(AbstractSingleSpringContextTests.java:179)
at org.springframework.test.AbstractSingleSpringContextTests.loadContext(AbstractSingleSpringContextTests.java:158)
at org.springframework.test.AbstractSpringContextTests.getContext(AbstractSpringContextTests.java:105)
at org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:87)
at junit.framework.TestCase.runBare(TestCase.java:128)
at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
I checked my respective xml files all references are present in those xml files..i couldnt find where is the problem..can any1 plz give me solution? | junit | null | null | null | null | null | open | JUnit TestCase Failure
===
Iam running my JunitTest and it gives the following error.. not failure.
Error creating bean with name 'reportDAO' defined in class path resource [LT.xml]:
Cannot resolve reference to bean 'hibernateTemplate' while setting bean property 'hibernateTemplate';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'hibernateTemplate' defined in class path resource [LT.xml]:
Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'sessionFactory' defined in class path resource [LT.xml]:
Invocation of init method failed; nested exception is org.hibernate.MappingException:
Association references unmapped class: dfi.fin.dcm.syn.loantrading.model.engine.result.BDTSTest
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1210)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:978)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:462)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:404)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:375)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:263)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:170)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:260)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:184)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:163)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:430)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
at org.springframework.test.AbstractSingleSpringContextTests.createApplicationContext(AbstractSingleSpringContextTests.java:199)
at org.springframework.test.AbstractSingleSpringContextTests.loadContextLocations(AbstractSingleSpringContextTests.java:179)
at org.springframework.test.AbstractSingleSpringContextTests.loadContext(AbstractSingleSpringContextTests.java:158)
at org.springframework.test.AbstractSpringContextTests.getContext(AbstractSpringContextTests.java:105)
at org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:87)
at junit.framework.TestCase.runBare(TestCase.java:128)
at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
I checked my respective xml files all references are present in those xml files..i couldnt find where is the problem..can any1 plz give me solution? | 0 |
3,628,820 | 09/02/2010 15:51:38 | 377,920 | 06/28/2010 09:58:12 | 285 | 7 | How to make my programming designs better? | I'm currently stuck how I should make designing skills as a programmer better. I've seen over a dozen questions about programming challenges. This is my strong part. Defining and verifying a good design isn't as trivial.
I have made several projects that have many components. I do see problems with my designs, but there's only so much one can introspect himself. Even though I can usually say what's wrong.. I'm not nearly as sure how should I fix it.
I'm aware of the most common design patterns. I understand principles like loosely coupled, DRY, KISS, etc. on a general level. I always go "yeah, that makes perfect sense", but they don't necessarily make that much sense and/or aren't trivially applicable in a concrete context.
Probably the biggest thing I struggle with is separation of concerns. I usually think in terms of snippets of functionality that do something. I struggle understanding who is responsible for that piece of functionality and how should I make that functionality "glued" together with other components in the system. There was this principle which said to use only the bare minimum as input, but I'm not so sure if this is really the best practice always. And most importantly, I have difficulties seeing the logical and complete design. My intuition says there probably should be A, B and C but what kind of intermediate objects should there be in between and which snippet of functionality goes where is problematic for me to perceive.
Lately, I've started doing some testing and it has really helped me cover some of the issues, especially making my designs more loosely coupled. Oh, and it covers some bugs. I can warmly suggest to start testing, if someone is in a similar spot. | design-patterns | language-agnostic | oop | design-principles | design-decisions | 10/18/2011 09:02:34 | not constructive | How to make my programming designs better?
===
I'm currently stuck how I should make designing skills as a programmer better. I've seen over a dozen questions about programming challenges. This is my strong part. Defining and verifying a good design isn't as trivial.
I have made several projects that have many components. I do see problems with my designs, but there's only so much one can introspect himself. Even though I can usually say what's wrong.. I'm not nearly as sure how should I fix it.
I'm aware of the most common design patterns. I understand principles like loosely coupled, DRY, KISS, etc. on a general level. I always go "yeah, that makes perfect sense", but they don't necessarily make that much sense and/or aren't trivially applicable in a concrete context.
Probably the biggest thing I struggle with is separation of concerns. I usually think in terms of snippets of functionality that do something. I struggle understanding who is responsible for that piece of functionality and how should I make that functionality "glued" together with other components in the system. There was this principle which said to use only the bare minimum as input, but I'm not so sure if this is really the best practice always. And most importantly, I have difficulties seeing the logical and complete design. My intuition says there probably should be A, B and C but what kind of intermediate objects should there be in between and which snippet of functionality goes where is problematic for me to perceive.
Lately, I've started doing some testing and it has really helped me cover some of the issues, especially making my designs more loosely coupled. Oh, and it covers some bugs. I can warmly suggest to start testing, if someone is in a similar spot. | 4 |
8,882,673 | 01/16/2012 16:02:57 | 1,008,248 | 10/22/2011 06:53:05 | 11 | 0 | Unable to refer to a Textview in overlay class | I have been trying to update a TextView field, when i Tap on the screen. I have implemented the Overlay class successfully, but I am unable to get a reference to the TextView field from the overlay class. I have passed 'context' from my activity class to overlay class.
What are the ways to get reference to the Textview in the overlay class ?
| android | textview | overlay | null | null | 01/17/2012 06:13:35 | not a real question | Unable to refer to a Textview in overlay class
===
I have been trying to update a TextView field, when i Tap on the screen. I have implemented the Overlay class successfully, but I am unable to get a reference to the TextView field from the overlay class. I have passed 'context' from my activity class to overlay class.
What are the ways to get reference to the Textview in the overlay class ?
| 1 |
3,113,757 | 06/24/2010 20:48:37 | 348,173 | 05/23/2010 07:48:37 | 18 | 0 | how to block websites? | How to block websites, not write to file hosts? (C#) | c# | block | website | null | null | 06/24/2010 20:53:16 | not a real question | how to block websites?
===
How to block websites, not write to file hosts? (C#) | 1 |
11,583,035 | 07/20/2012 16:05:38 | 1,021,984 | 10/31/2011 12:51:20 | 61 | 0 | BT headset with google voice | I have app that work with google speech recognition. But it's doesn't receive speech from Bluetooh headset. Any ideas how to fix it in my application? | android | bluetooth | headset | null | null | 07/20/2012 23:18:31 | not a real question | BT headset with google voice
===
I have app that work with google speech recognition. But it's doesn't receive speech from Bluetooh headset. Any ideas how to fix it in my application? | 1 |
6,848,250 | 07/27/2011 16:56:49 | 669,636 | 03/21/2011 15:03:18 | 51 | 6 | flex 4 load module | Can anybody give me an example how to load the module? For example if I have module `Login.mxml` in Modules.user package, how to load it? I want both mxml and actionscript methods. | flex | actionscript | module | load | null | 03/29/2012 12:31:05 | not a real question | flex 4 load module
===
Can anybody give me an example how to load the module? For example if I have module `Login.mxml` in Modules.user package, how to load it? I want both mxml and actionscript methods. | 1 |
7,927,910 | 10/28/2011 10:12:18 | 30,453 | 10/22/2008 17:35:03 | 6,568 | 155 | automatic testing for CSS? | Is there any tool that allows you to automatically test page under different browser and make sure CSS looks good?
P.S. I know it sounds impossible, but maybe there are some solutions (like taking screenshots and comparing them) | html | css | testing | cross-browser | automated-tests | null | open | automatic testing for CSS?
===
Is there any tool that allows you to automatically test page under different browser and make sure CSS looks good?
P.S. I know it sounds impossible, but maybe there are some solutions (like taking screenshots and comparing them) | 0 |
6,350,686 | 06/14/2011 22:05:15 | 798,589 | 06/14/2011 22:05:15 | 1 | 0 | Android ListView Faded Edge | By default, the faded edge at the top of a ListView only shows up once you start scrolling through the list. Is there any way to have that top faded edge shading show up even when you haven't scrolled down at all?
Thanks! | android | listview | null | null | null | null | open | Android ListView Faded Edge
===
By default, the faded edge at the top of a ListView only shows up once you start scrolling through the list. Is there any way to have that top faded edge shading show up even when you haven't scrolled down at all?
Thanks! | 0 |
2,727,667 | 04/28/2010 07:56:41 | 42,434 | 12/02/2008 13:23:01 | 673 | 49 | Can I have an internal webservice running in Azure | I would like to know if , with Azure, it supports the ability to have webservice running on a specific port which is accessible only by a Site running in Azure. E.g. I want to create a Website hosted on azure but I want some of the services to come from a webservice which I dont want consumer facing.
Is this possible with Azure , if so do I need multiple instances or can this be achieved with one? | azure | null | null | null | null | null | open | Can I have an internal webservice running in Azure
===
I would like to know if , with Azure, it supports the ability to have webservice running on a specific port which is accessible only by a Site running in Azure. E.g. I want to create a Website hosted on azure but I want some of the services to come from a webservice which I dont want consumer facing.
Is this possible with Azure , if so do I need multiple instances or can this be achieved with one? | 0 |
9,900,284 | 03/28/2012 02:16:45 | 1,296,956 | 03/28/2012 01:40:31 | 1 | 0 | Converting an IP address to binary values (Java) | I'm trying to write a program in Java that will take an IP address and convert to binary. I'm also new with highlighting my code.
Here is what I have so far.
`import java.util.Scanner;`
`public class IpConverter{`
`public static void main (String[]args)`
`{`
int result;
String data_in;
int data_out;
Scanner scan = new Scanner(System.in);
try
{
System.out.print("Enter an IP address: ");
data_in = scan.next();
data_out = Integer.parseInt(data_in, 10);
System.out.println (data_in + "is equivalent to" + data_out);
}
catch (NumberFormatException nfe){
System.out.println("Wrong data type!");
`}`
`}`
`}` | java | binary | null | null | null | null | open | Converting an IP address to binary values (Java)
===
I'm trying to write a program in Java that will take an IP address and convert to binary. I'm also new with highlighting my code.
Here is what I have so far.
`import java.util.Scanner;`
`public class IpConverter{`
`public static void main (String[]args)`
`{`
int result;
String data_in;
int data_out;
Scanner scan = new Scanner(System.in);
try
{
System.out.print("Enter an IP address: ");
data_in = scan.next();
data_out = Integer.parseInt(data_in, 10);
System.out.println (data_in + "is equivalent to" + data_out);
}
catch (NumberFormatException nfe){
System.out.println("Wrong data type!");
`}`
`}`
`}` | 0 |
10,203,185 | 04/18/2012 05:13:56 | 28,351 | 10/15/2008 19:16:13 | 458 | 24 | How to install LDAP.so on RedHat 6.2 | I've just created a brand new RedHat 6.2 server, which I am going to migrate some LAMP applications from an older RedHat 5 server.
On my old server, in the /usr/lib/php/modules directory I had the ldap.so module which I need.
In my new RedHat 6 server, in the /usr/lib64/php/modules/ directory there is no ldap.so
How do I add ldap.so ? I'm looking for a simple solution like using yum perhaps.
| php | ldap | lamp | redhat | sysadmin | null | open | How to install LDAP.so on RedHat 6.2
===
I've just created a brand new RedHat 6.2 server, which I am going to migrate some LAMP applications from an older RedHat 5 server.
On my old server, in the /usr/lib/php/modules directory I had the ldap.so module which I need.
In my new RedHat 6 server, in the /usr/lib64/php/modules/ directory there is no ldap.so
How do I add ldap.so ? I'm looking for a simple solution like using yum perhaps.
| 0 |
312,549 | 11/23/2008 14:09:24 | 7,965 | 09/15/2008 14:47:24 | 16 | 6 | No Module named django.core | I have updated to latest Django version 1.0.2 after uninstalling my old Django version.But now when I run django-admin.py I get the following error. How can I resolve this?
Traceback (most recent call last):
File "C:\Python25\Lib\site-packages\django\bin\django-admin.py", line 2, in <module>
from django.core import management
ImportError: No module named django.core
| django | null | null | null | null | null | open | No Module named django.core
===
I have updated to latest Django version 1.0.2 after uninstalling my old Django version.But now when I run django-admin.py I get the following error. How can I resolve this?
Traceback (most recent call last):
File "C:\Python25\Lib\site-packages\django\bin\django-admin.py", line 2, in <module>
from django.core import management
ImportError: No module named django.core
| 0 |
8,570,696 | 12/20/2011 04:09:34 | 1,057,040 | 11/21/2011 02:17:20 | 11 | 0 | Android ADB commands in Ubuntu 11.10 | can someone tell me how can i debug and use adb shell commands in Ubuntu 11.10 terminal? i just know how to use it in Windows. | android | ubuntu | null | null | null | 05/27/2012 14:36:13 | not a real question | Android ADB commands in Ubuntu 11.10
===
can someone tell me how can i debug and use adb shell commands in Ubuntu 11.10 terminal? i just know how to use it in Windows. | 1 |
1,541,894 | 10/09/2009 05:04:18 | 77,265 | 03/12/2009 14:55:49 | 6 | 0 | Test Automation | We are moving to TSF 2008 and I am wondering if there is something in TFS 2008 that will automate test cases. I was looking into Test Automation FX for recording tests from our in-house built UI that we want to test. Any other recommendations? Thanks. | tfs | 2008 | test | automation | null | null | open | Test Automation
===
We are moving to TSF 2008 and I am wondering if there is something in TFS 2008 that will automate test cases. I was looking into Test Automation FX for recording tests from our in-house built UI that we want to test. Any other recommendations? Thanks. | 0 |
7,073,250 | 08/16/2011 03:11:43 | 895,921 | 08/16/2011 03:07:22 | 1 | 0 | Why can not get HTML code of this url? | I used file_get_contents, curl, simple html dom but can not get HTML from this url:
http://www.zing.vn/news/xa-hoi/choang-voi-clip-cu-ba-cao-tuoi-nhay-boc-nhu-vu-cong/a124040.html
I don't know why, but the result is haphazard characters, not HTML code.
Help me, please! | html | get | null | null | null | null | open | Why can not get HTML code of this url?
===
I used file_get_contents, curl, simple html dom but can not get HTML from this url:
http://www.zing.vn/news/xa-hoi/choang-voi-clip-cu-ba-cao-tuoi-nhay-boc-nhu-vu-cong/a124040.html
I don't know why, but the result is haphazard characters, not HTML code.
Help me, please! | 0 |
4,686,726 | 01/14/2011 00:02:21 | 283,445 | 03/01/2010 07:45:02 | 40 | 2 | SQL Server, using a table as a queue | I'm using an SQL Server 2008 R2 as a queuing mechanism. I add items to the table, and an external service reads and processes these items. This works great, but is missing one thing - I need mechanism whereby I can attempt to select a single row from the table and, if there isn't one, block until there is (preferably for a specific period of time).
Can anyone advise on how I might achieve this? | sql | queue | null | null | null | null | open | SQL Server, using a table as a queue
===
I'm using an SQL Server 2008 R2 as a queuing mechanism. I add items to the table, and an external service reads and processes these items. This works great, but is missing one thing - I need mechanism whereby I can attempt to select a single row from the table and, if there isn't one, block until there is (preferably for a specific period of time).
Can anyone advise on how I might achieve this? | 0 |
4,407,916 | 12/10/2010 10:32:01 | 521,070 | 10/23/2010 15:30:48 | 207 | 1 | Implementation question about classic n-Queens in Java | This is a homework question. I am writing a solution for a classic `n-Queens` problem in Java. It looks like [here][1] but my program returns a collection of all legal queens placements instead of printing them out. I represent queens placement as `int[]` and the returned collection as `Set<int[]>` using `HashSet<int[]>` as it's implementation. (I think `Set` is appropriate here since the order of the legal placements is not important).
The problem is that Java arrays do not override the `hashCode` method of Object and different array instances with the same values have the same hash code.
I can write a wrapper class `QueensPlacements`, which holds the array as a field and overrides `hashCode` with `Arrays.deepHashCode` utility function, and return `Set<QueensPlacement>`. However it seems verbose and inelegant. Can anybody suggest any better solution?
[1]: http://www.cs.princeton.edu/introcs/23recursion/Queens.java.html | java | homework | n-queens | null | null | null | open | Implementation question about classic n-Queens in Java
===
This is a homework question. I am writing a solution for a classic `n-Queens` problem in Java. It looks like [here][1] but my program returns a collection of all legal queens placements instead of printing them out. I represent queens placement as `int[]` and the returned collection as `Set<int[]>` using `HashSet<int[]>` as it's implementation. (I think `Set` is appropriate here since the order of the legal placements is not important).
The problem is that Java arrays do not override the `hashCode` method of Object and different array instances with the same values have the same hash code.
I can write a wrapper class `QueensPlacements`, which holds the array as a field and overrides `hashCode` with `Arrays.deepHashCode` utility function, and return `Set<QueensPlacement>`. However it seems verbose and inelegant. Can anybody suggest any better solution?
[1]: http://www.cs.princeton.edu/introcs/23recursion/Queens.java.html | 0 |
10,837,292 | 05/31/2012 16:09:24 | 681,159 | 03/29/2011 00:14:30 | 325 | 7 | converting bmp to jpg in java | How do you convert bmp to jpg in Java? I know how to use the `ImageIO` way but is there a much faster or better way of doing it?
This is the ImageIO way of doing that I found on the web.
`//Create file for the source
File input = new File("c:/temp/image.bmp");
//Read the file to a BufferedImage
BufferedImage image = ImageIO.read(input);`
//Create a file for the output
File output = new File("c:/temp/image.jpg");
//Write the image to the destination as a JPG
ImageIO.write(image, "jpg", output);
If I use this way will I lose quality?
Thanks | java | jpg | convert | bmp | null | null | open | converting bmp to jpg in java
===
How do you convert bmp to jpg in Java? I know how to use the `ImageIO` way but is there a much faster or better way of doing it?
This is the ImageIO way of doing that I found on the web.
`//Create file for the source
File input = new File("c:/temp/image.bmp");
//Read the file to a BufferedImage
BufferedImage image = ImageIO.read(input);`
//Create a file for the output
File output = new File("c:/temp/image.jpg");
//Write the image to the destination as a JPG
ImageIO.write(image, "jpg", output);
If I use this way will I lose quality?
Thanks | 0 |
4,748,249 | 01/20/2011 14:22:35 | 521,525 | 11/26/2010 15:27:55 | 94 | 8 | PHP: I have an associative array (int => object), want to sort it. | class DownTime {
public $total, $longest, $count;
}
I have an associative array (key is an id, value is DownTime object).
I want to sort it according to $total
I've read [PHP: Sorting Arrays][1] and some other questions on stackoverflow.
I understand `uasort` will do the job fine. However, as an OOP approach, I would prefer define a special function (like defining `operator<()` in C++, or implementing `Comparable.compareTo()` in Java) inside the DownTime class, rather than passing a function when calling some sort function.
[1]: http://www.php.net/manual/en/array.sorting.php | php | oop | sorting | null | null | null | open | PHP: I have an associative array (int => object), want to sort it.
===
class DownTime {
public $total, $longest, $count;
}
I have an associative array (key is an id, value is DownTime object).
I want to sort it according to $total
I've read [PHP: Sorting Arrays][1] and some other questions on stackoverflow.
I understand `uasort` will do the job fine. However, as an OOP approach, I would prefer define a special function (like defining `operator<()` in C++, or implementing `Comparable.compareTo()` in Java) inside the DownTime class, rather than passing a function when calling some sort function.
[1]: http://www.php.net/manual/en/array.sorting.php | 0 |
7,643,197 | 10/04/2011 04:09:18 | 977,504 | 10/03/2011 22:08:21 | 3 | 0 | iOS 4.3 or later will not be available to Verizon iPhone users? | Right after I upload my binary over to Apple in iTunesConnect, it appears this message,
"The binary uploaded for the latest version of this app indicates that iOS 4.3 or later is required. Apps that require iOS 4.3 or later will not be available to Verizon iPhone users. If this app could be compatible with earlier iOS versions, you may want to reject the binary and upload a new one that indicates the earliest compatible iOS."
What to do so that I can have my app reach as many as customers possible?
Thank you. | xcode | null | null | null | null | 12/09/2011 18:45:03 | off topic | iOS 4.3 or later will not be available to Verizon iPhone users?
===
Right after I upload my binary over to Apple in iTunesConnect, it appears this message,
"The binary uploaded for the latest version of this app indicates that iOS 4.3 or later is required. Apps that require iOS 4.3 or later will not be available to Verizon iPhone users. If this app could be compatible with earlier iOS versions, you may want to reject the binary and upload a new one that indicates the earliest compatible iOS."
What to do so that I can have my app reach as many as customers possible?
Thank you. | 2 |
2,863,468 | 05/19/2010 07:02:33 | 326,890 | 04/27/2010 13:24:31 | 1 | 0 | we are getting .txt file but not getting proper alignment | [we are getting the following texfile_screenshot1.JPG when we are exporting data to .txt file][1]
[we need output which is shown in texfile_screenshot2.JPG][2]
[1]: http://eminosoft.com/test/texfile_screenshot1.JPG
following is the code
$myFile = "user_password.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
$newline ="\r\n";
fwrite ($fh,$newline);
$stringData1 = $_POST['uname1']." "." "." " ;
fwrite($fh, $stringData1);
$stringData1 =$_POST['password1']." "." "." ";
fwrite($fh,$stringData1);
$stringData1 = $_POST['email1']." "." "." ";
fwrite($fh, $stringData1);
fclose($fh); | alignment | text-files | import | php | null | null | open | we are getting .txt file but not getting proper alignment
===
[we are getting the following texfile_screenshot1.JPG when we are exporting data to .txt file][1]
[we need output which is shown in texfile_screenshot2.JPG][2]
[1]: http://eminosoft.com/test/texfile_screenshot1.JPG
following is the code
$myFile = "user_password.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
$newline ="\r\n";
fwrite ($fh,$newline);
$stringData1 = $_POST['uname1']." "." "." " ;
fwrite($fh, $stringData1);
$stringData1 =$_POST['password1']." "." "." ";
fwrite($fh,$stringData1);
$stringData1 = $_POST['email1']." "." "." ";
fwrite($fh, $stringData1);
fclose($fh); | 0 |
11,367,844 | 07/06/2012 18:36:55 | 1,507,545 | 07/06/2012 18:23:00 | 1 | 0 | Can any finite bit string be found in pi within a reasonable amount of time? | So, a while back I read a joke that went something like this:
"Never compute pi in binary - because it is goes on infinitely and is random, it theoretically contains every finite bit string. So, you will then possess all copyrighted material in existence and be liable for some serious fines."
This is obviously meant to be humorous, but it got me thinking. If every finite bit string exists in a binary representation of pi, would it be possible to use this as a method of transmitting data?
For example, let's say I wanted to transmit a bit string that could be interpreted as an jpeg image. Instead of sending the information directly, I would find its location within the digits of pi, and simply send the location of the first bit within the digits of pi, as well as the lengths of the string.
This seems pretty straightforward to me, but the obvious hurtle here is that the probability of finding this string within even the first several trillion digits is remarkably small. So, it could end up taking an immense amount of time to find.
My thinking is that several machines could be dedicated to searching for large files within pi, and then creating an index of all of their start locations. So, each computation would only need to occur once and then that information could be transmitted extremely quickly from then on.
So, what do you think? Is this at all feasible, or would these computations take far too much time?
Thanks for reading! I apologize if I have overlooked any posting guidelines, this if my first question in this forum.
Cheers! | algorithm | data | communication | complexity | pi | 07/10/2012 14:15:39 | not constructive | Can any finite bit string be found in pi within a reasonable amount of time?
===
So, a while back I read a joke that went something like this:
"Never compute pi in binary - because it is goes on infinitely and is random, it theoretically contains every finite bit string. So, you will then possess all copyrighted material in existence and be liable for some serious fines."
This is obviously meant to be humorous, but it got me thinking. If every finite bit string exists in a binary representation of pi, would it be possible to use this as a method of transmitting data?
For example, let's say I wanted to transmit a bit string that could be interpreted as an jpeg image. Instead of sending the information directly, I would find its location within the digits of pi, and simply send the location of the first bit within the digits of pi, as well as the lengths of the string.
This seems pretty straightforward to me, but the obvious hurtle here is that the probability of finding this string within even the first several trillion digits is remarkably small. So, it could end up taking an immense amount of time to find.
My thinking is that several machines could be dedicated to searching for large files within pi, and then creating an index of all of their start locations. So, each computation would only need to occur once and then that information could be transmitted extremely quickly from then on.
So, what do you think? Is this at all feasible, or would these computations take far too much time?
Thanks for reading! I apologize if I have overlooked any posting guidelines, this if my first question in this forum.
Cheers! | 4 |
3,877,514 | 10/06/2010 22:59:30 | 192,936 | 10/20/2009 08:44:27 | 296 | 2 | Difference between QShared and QSharedData Pointers | What is the difference between these two types of pointers? As far as I can read, QShared can handle situation well, so what is the need for QSharedData?
| c++ | qt | pointers | null | null | null | open | Difference between QShared and QSharedData Pointers
===
What is the difference between these two types of pointers? As far as I can read, QShared can handle situation well, so what is the need for QSharedData?
| 0 |
7,442,885 | 09/16/2011 09:48:05 | 911,814 | 08/25/2011 10:21:39 | 15 | 0 | cakephp dropdown list select and submit not working? | I'm using cakephp1.3 and i want to display a dropdown in a view.
<?php echo $this->Form->create('Ledger');?>
<?php $userNames = $this->requestAction('users/getUsers'); ?>
<fieldset>
<legend><h2><?php __('Lend'); ?></h2></legend>
<?php echo $this->Form->input('burID'); ?> <br>
<?php echo $this->Form->input('displayname', array('type'=>'select','options'=>$userNames,'label'=>"Borrower",'empty'=>'Select name....')); ?><br>
<?php echo $this->Form->input('amount');?> <br>
<?php echo $userNames;?> <br>
</fieldset>
<?php echo $this->Form->end(__('Submit', true));
?>
it basically get users from Users database and display in a dropdown.Now i want to catch that selected name in the controller.but when i catch that from the controller it gives me the "displayname"(this is my fieldname which i imported to the drop down).How can i solve this? | php | cakephp | controller | drop-down-menu | submit | null | open | cakephp dropdown list select and submit not working?
===
I'm using cakephp1.3 and i want to display a dropdown in a view.
<?php echo $this->Form->create('Ledger');?>
<?php $userNames = $this->requestAction('users/getUsers'); ?>
<fieldset>
<legend><h2><?php __('Lend'); ?></h2></legend>
<?php echo $this->Form->input('burID'); ?> <br>
<?php echo $this->Form->input('displayname', array('type'=>'select','options'=>$userNames,'label'=>"Borrower",'empty'=>'Select name....')); ?><br>
<?php echo $this->Form->input('amount');?> <br>
<?php echo $userNames;?> <br>
</fieldset>
<?php echo $this->Form->end(__('Submit', true));
?>
it basically get users from Users database and display in a dropdown.Now i want to catch that selected name in the controller.but when i catch that from the controller it gives me the "displayname"(this is my fieldname which i imported to the drop down).How can i solve this? | 0 |
7,609,074 | 09/30/2011 10:27:17 | 303,456 | 03/28/2010 05:37:44 | 102 | 11 | can't send the postString to json | i'm using json Framework for sending the jsonstring. my json post string is
> {"firstName":"string1","lastName":"string2","contactSource":"Leter","permanentAddress":{},"deliveryAddress":{},"preferredContactTimes":[]}
here the permanentAddress and deliveryAddress also a sub json string adn preferredContactTimes is array
i got the json failed error
>JSONValue failed. Error trace is: (
"Error Domain=org.brautaset.JSON.ErrorDomain Code=11 \"Unexpected end of string\" UserInfo=0x4c8d820 {NSLocalizedDescription=Unexpected end of string}"
)
please give me the solution
| iphone | objective-c | json | null | null | null | open | can't send the postString to json
===
i'm using json Framework for sending the jsonstring. my json post string is
> {"firstName":"string1","lastName":"string2","contactSource":"Leter","permanentAddress":{},"deliveryAddress":{},"preferredContactTimes":[]}
here the permanentAddress and deliveryAddress also a sub json string adn preferredContactTimes is array
i got the json failed error
>JSONValue failed. Error trace is: (
"Error Domain=org.brautaset.JSON.ErrorDomain Code=11 \"Unexpected end of string\" UserInfo=0x4c8d820 {NSLocalizedDescription=Unexpected end of string}"
)
please give me the solution
| 0 |
6,347,116 | 06/14/2011 16:50:34 | 568,121 | 01/08/2011 15:22:17 | 51 | 2 | IronPython & Windows.Forms' Control type | I cannot get this working...
for CBControl in self._tabPage2.Controls:
if CBControl.GetType == System.Windows.Forms.CheckBox().GetType:
....
It is not working...
I need to identify the controls in the tab by tehir type and do something only on chcekboxes...
Help!
M | .net | winforms | ironpython | null | null | null | open | IronPython & Windows.Forms' Control type
===
I cannot get this working...
for CBControl in self._tabPage2.Controls:
if CBControl.GetType == System.Windows.Forms.CheckBox().GetType:
....
It is not working...
I need to identify the controls in the tab by tehir type and do something only on chcekboxes...
Help!
M | 0 |
8,591,602 | 12/21/2011 14:43:37 | 559,611 | 01/01/2011 03:30:12 | 171 | 0 | deploying a python web application | hi every one I was wondering how to go about deploying a small time python database web application. Is buying some cheap hardware and installing a server good on it a good route to go? | python | application | web | null | null | 12/22/2011 07:58:28 | not a real question | deploying a python web application
===
hi every one I was wondering how to go about deploying a small time python database web application. Is buying some cheap hardware and installing a server good on it a good route to go? | 1 |
8,261,753 | 11/24/2011 19:34:25 | 1,064,545 | 11/24/2011 19:15:53 | 1 | 0 | Tutorial on Java Servlet development | I'm looking for a good tutorial that details the following:
- How to set up an IDE and other required stuff for servlet development (be it Eclipse, JCreator using Tomcat, Jetty or whatever)
- How to create a new Hello World servlet
- How to start under the debugger, break on the Hello world's doGet method
- How to use Hotswap, that is modifying the servlet's java code and have the server automatically reload the class without restarting the whole web server.
Please don't point on general documentations, I've spend hours on various documentations that are either outdated, or deep. I don't want to read 1000 pages to have a simple hello world servlet. I'm used to ASP.NET where this works out of the box and self explanatory, and kind of surprised how much more complicated this seems under Java.
Thanks
| java | servlets | ide | hotswap | null | 11/24/2011 19:52:19 | not constructive | Tutorial on Java Servlet development
===
I'm looking for a good tutorial that details the following:
- How to set up an IDE and other required stuff for servlet development (be it Eclipse, JCreator using Tomcat, Jetty or whatever)
- How to create a new Hello World servlet
- How to start under the debugger, break on the Hello world's doGet method
- How to use Hotswap, that is modifying the servlet's java code and have the server automatically reload the class without restarting the whole web server.
Please don't point on general documentations, I've spend hours on various documentations that are either outdated, or deep. I don't want to read 1000 pages to have a simple hello world servlet. I'm used to ASP.NET where this works out of the box and self explanatory, and kind of surprised how much more complicated this seems under Java.
Thanks
| 4 |
11,073,952 | 06/17/2012 18:54:05 | 1,275,386 | 03/17/2012 06:04:12 | 28 | 3 | C++ Libraries for portability | What C++ libraries are there that stay within the STL confines usage and attempt to maintain portable code as much as possible?
I ask this question because I would like to maintain portable code much as possible. I am not looking for a particular type of library function just for libraries built as described in the question. I understand there are few libraries that try and stay close to this goal like [POCO][1] not like [Wt][2]. I emphasize STL usage because if or when other libraries become included they in most cases do not have high degree of portability. This isn't about independent programming but more about useful libraries that help programmers minimize the changes needed to port code.
[1]: http://pocoproject.org
[2]: http://www.webtoolkit.eu/wt | c++ | stl | portability | suggestions | null | 06/17/2012 19:14:15 | not constructive | C++ Libraries for portability
===
What C++ libraries are there that stay within the STL confines usage and attempt to maintain portable code as much as possible?
I ask this question because I would like to maintain portable code much as possible. I am not looking for a particular type of library function just for libraries built as described in the question. I understand there are few libraries that try and stay close to this goal like [POCO][1] not like [Wt][2]. I emphasize STL usage because if or when other libraries become included they in most cases do not have high degree of portability. This isn't about independent programming but more about useful libraries that help programmers minimize the changes needed to port code.
[1]: http://pocoproject.org
[2]: http://www.webtoolkit.eu/wt | 4 |
9,620,959 | 03/08/2012 16:16:32 | 1,257,422 | 03/08/2012 15:59:23 | 1 | 0 | Using Count To Split A Checklist Into 2 Columns in X++ Fetch Method | Here is what I have so far, this is returning two columns, but each counter is stopping and then duplicating the same value over and over...
if(lLogisticsControlTable.APMJobTypeId)
select count (RecID) from jobTypeCheck where jobTypeCheck.APMJobTypeId == lLogisticsControlTable.APMJobTypeId;
{
counter = jobTypeCheck.RecId;
}
while select jobTypeCheck where jobTypeCheck.APMJobTypeId == lLogisticsControlTable.APMJobTypeId
{
counter1 = counter / 2;
halfCount1 = counter - counter1;
if(halfcount <= counter1)
{
halfCount++;
jobListCheck1 = jobTypeCheck.Name;
}
if (halfCount1 > halfCount)
{
halfCount1++;
jobListCheck2 = jobTypeCheck.Name;
}
element.execute(2);
}
} | count | fetch | x++ | null | null | null | open | Using Count To Split A Checklist Into 2 Columns in X++ Fetch Method
===
Here is what I have so far, this is returning two columns, but each counter is stopping and then duplicating the same value over and over...
if(lLogisticsControlTable.APMJobTypeId)
select count (RecID) from jobTypeCheck where jobTypeCheck.APMJobTypeId == lLogisticsControlTable.APMJobTypeId;
{
counter = jobTypeCheck.RecId;
}
while select jobTypeCheck where jobTypeCheck.APMJobTypeId == lLogisticsControlTable.APMJobTypeId
{
counter1 = counter / 2;
halfCount1 = counter - counter1;
if(halfcount <= counter1)
{
halfCount++;
jobListCheck1 = jobTypeCheck.Name;
}
if (halfCount1 > halfCount)
{
halfCount1++;
jobListCheck2 = jobTypeCheck.Name;
}
element.execute(2);
}
} | 0 |
1,461,029 | 09/22/2009 16:08:00 | 41,543 | 11/28/2008 08:04:07 | 1,125 | 30 | Possible to add a XSLT Stylesheet to a serialized XML document? | I have code that serializes a complex object to XML and saves it as a file, is there a quick way to include a style sheet in the xml during the serialization?
Using C# and .net framework v2. | c# | xml | null | null | null | null | open | Possible to add a XSLT Stylesheet to a serialized XML document?
===
I have code that serializes a complex object to XML and saves it as a file, is there a quick way to include a style sheet in the xml during the serialization?
Using C# and .net framework v2. | 0 |
10,675,801 | 05/20/2012 17:59:11 | 1,338,976 | 04/17/2012 14:00:27 | 1 | 0 | Google Maps, Count buildings inside area polygon? | Is there a way to count buildings, homes etc inside a polygon? I am distributing flyers for my business and would like to count the homes in an area. I am doing it one at a time and its taking forever.
I have tried using commercial real-estate sites like Trulia, Zillow to draw boundaries, but they only return homes for sale.
I am looking for all homes in an area.
Thank you,
Steve | api | count | maps | polygon | counter | 05/21/2012 19:06:10 | off topic | Google Maps, Count buildings inside area polygon?
===
Is there a way to count buildings, homes etc inside a polygon? I am distributing flyers for my business and would like to count the homes in an area. I am doing it one at a time and its taking forever.
I have tried using commercial real-estate sites like Trulia, Zillow to draw boundaries, but they only return homes for sale.
I am looking for all homes in an area.
Thank you,
Steve | 2 |
2,731,552 | 04/28/2010 16:59:27 | 267,339 | 02/05/2010 19:06:52 | 20 | 0 | MySQL Student database beginner SQL employment expectations | Background, Student pursuing BSIT degree, employer expectations, entry level. I would like to solicit opinions from this forum as to what your professional expectations are as regards an entry level position in working in the database realm... I see many job opportunities that require a minimum of 2 or more years experience, how does one go about obtaining this experience (I have tried very hard to maintain a minimum 3.70+ GPA) but have ZERO work experience in this field... I spend non school time working in VB and SQL to try and increase my proficiency. I have considered postponing my job search until I obtain certifications from brainbench etc... Any criticism and or advise is welcomed... Again I have no experience in database other than undergrad work in class.
Thank you for your time
sammysmall | homework | employment | mysql | vb.net | null | 05/03/2012 12:43:21 | off topic | MySQL Student database beginner SQL employment expectations
===
Background, Student pursuing BSIT degree, employer expectations, entry level. I would like to solicit opinions from this forum as to what your professional expectations are as regards an entry level position in working in the database realm... I see many job opportunities that require a minimum of 2 or more years experience, how does one go about obtaining this experience (I have tried very hard to maintain a minimum 3.70+ GPA) but have ZERO work experience in this field... I spend non school time working in VB and SQL to try and increase my proficiency. I have considered postponing my job search until I obtain certifications from brainbench etc... Any criticism and or advise is welcomed... Again I have no experience in database other than undergrad work in class.
Thank you for your time
sammysmall | 2 |
2,942,054 | 05/31/2010 07:38:33 | 354,381 | 05/31/2010 07:38:33 | 1 | 0 | Which is faster for small web projects - MySQL or Oracle? | Which is generally faster for small web projects - MySQL or Oracle?
Please provide some proof (benchmarks or any other) of your opinion. | mysql | oracle | performance | null | null | 06/01/2010 02:19:25 | not constructive | Which is faster for small web projects - MySQL or Oracle?
===
Which is generally faster for small web projects - MySQL or Oracle?
Please provide some proof (benchmarks or any other) of your opinion. | 4 |
8,939,776 | 01/20/2012 10:13:42 | 1,158,603 | 11/23/2011 12:42:45 | 1 | 1 | group characters into string in php | I'm a newbie, regretted.
Is it possible to group some x characters *(taken from output of raw html file)* into an array string in php
| php | arrays | string | character | null | 01/20/2012 18:06:09 | too localized | group characters into string in php
===
I'm a newbie, regretted.
Is it possible to group some x characters *(taken from output of raw html file)* into an array string in php
| 3 |
7,801,113 | 10/18/2011 00:19:13 | 998,475 | 10/17/2011 03:33:29 | 1 | 0 | A List is a wrapped array in C#, but not in other languages? | I program mostly in C# (well I suppose my question isn't so much about C#, but the data structures in the System.Collections namespace), so I'm familiar with a List being a generic type wrapping an array (that's why random access is so good, right? Because indexing the List is just indexing the underlying array). But my friend, who knows Java and C++ quite well, tells me a List is generally what I consider to be a single linked list (a bunch of nodes with references to the next node).
So I did a bit of research and that's how it seems...
http://www.cplusplus.com/reference/stl/list/
http://download.oracle.com/javase/1.4.2/docs/api/java/util/List.html
Why the inconsistency? I'm doing a subject at uni next year on data structures and everything is going to be different?
When generics was introduced to C#, why didn't Microsoft just make a generic version of ArrayList? | c# | .net | list | generics | collections | 10/18/2011 00:27:42 | not constructive | A List is a wrapped array in C#, but not in other languages?
===
I program mostly in C# (well I suppose my question isn't so much about C#, but the data structures in the System.Collections namespace), so I'm familiar with a List being a generic type wrapping an array (that's why random access is so good, right? Because indexing the List is just indexing the underlying array). But my friend, who knows Java and C++ quite well, tells me a List is generally what I consider to be a single linked list (a bunch of nodes with references to the next node).
So I did a bit of research and that's how it seems...
http://www.cplusplus.com/reference/stl/list/
http://download.oracle.com/javase/1.4.2/docs/api/java/util/List.html
Why the inconsistency? I'm doing a subject at uni next year on data structures and everything is going to be different?
When generics was introduced to C#, why didn't Microsoft just make a generic version of ArrayList? | 4 |
4,801,685 | 01/26/2011 05:39:39 | 144,864 | 07/25/2009 04:18:18 | 174 | 32 | C#, best way to communicate bewteen two process ? | use net remoting or others ??
I want sample way, I think that no socket or other would be more easy to deploy ...
anyway ,help please , thanks. | c# | null | null | null | null | 12/26/2011 22:55:40 | not constructive | C#, best way to communicate bewteen two process ?
===
use net remoting or others ??
I want sample way, I think that no socket or other would be more easy to deploy ...
anyway ,help please , thanks. | 4 |
1,327,745 | 08/25/2009 11:43:30 | 104,849 | 05/11/2009 14:59:01 | 459 | 43 | Session Problem? | I have an MVC application that times out the session after 20 minutes. I store some values for a dropdown in a Session variable. If a user allows a page to timeout and then refreshes the page, I have no values in the dropdown.
What is the best way to deal with this? | asp.net-mvc | null | null | null | null | null | open | Session Problem?
===
I have an MVC application that times out the session after 20 minutes. I store some values for a dropdown in a Session variable. If a user allows a page to timeout and then refreshes the page, I have no values in the dropdown.
What is the best way to deal with this? | 0 |
6,943,750 | 08/04/2011 15:02:15 | 878,862 | 08/04/2011 15:02:15 | 1 | 0 | Identify paragraphs using java in text files [java] | I am trying to implement a program in Java that will find the name of a chapter, and then read and store its content. The initial documents to be parsed are in txt files.
The problem is how to identify the beginning of the next chapter so as to stop, and store it. That is because the format of the documents is not the same.
Thank you for your answers in advance! | java | null | null | null | null | 02/08/2012 14:25:50 | not a real question | Identify paragraphs using java in text files [java]
===
I am trying to implement a program in Java that will find the name of a chapter, and then read and store its content. The initial documents to be parsed are in txt files.
The problem is how to identify the beginning of the next chapter so as to stop, and store it. That is because the format of the documents is not the same.
Thank you for your answers in advance! | 1 |
8,805,317 | 01/10/2012 14:58:53 | 1,140,948 | 01/10/2012 13:37:04 | 1 | 0 | C# how to change a COM port to an specified one | I need to change the port number of a USB serial adapter, i have the following rotine to finding it, now I need to change its portName / COM Number to COM11 for example.
I need exactly this, but by C# code:
My Computer -> Manage -> Device Manager -> Ports -> Communications Port -> Port Settings -> Advanced -> COM Port Number
----------
try
{
ManagementObjectSearcher searcher =
new ManagementObjectSearcher("root\\WMI",
"SELECT * FROM MSSerial_PortName");
foreach (ManagementObject queryObj in searcher.Get())
{
//If the serial port's instance name contains USB
//it must be a USB to serial device
if (queryObj["InstanceName"].ToString().Contains("USB"))
{
Console.WriteLine("-----------------------------------");
Console.WriteLine("MSSerial_PortName instance");
Console.WriteLine("-----------------------------------");
Console.WriteLine("InstanceName: {0}", queryObj["InstanceName"]);
Console.WriteLine(queryObj["PortName"] + "is a USB to SERIAL adapter/converter");
string port = queryObj["PortName"].ToString();
SerialPort p = new SerialPort(port);
//p.PortName = "COM11";
return port ;
}
}
throw new Exception(Messages.PINPAD_NOT_FOUND);
} | c# | com | serial-port | wmi | adapter | null | open | C# how to change a COM port to an specified one
===
I need to change the port number of a USB serial adapter, i have the following rotine to finding it, now I need to change its portName / COM Number to COM11 for example.
I need exactly this, but by C# code:
My Computer -> Manage -> Device Manager -> Ports -> Communications Port -> Port Settings -> Advanced -> COM Port Number
----------
try
{
ManagementObjectSearcher searcher =
new ManagementObjectSearcher("root\\WMI",
"SELECT * FROM MSSerial_PortName");
foreach (ManagementObject queryObj in searcher.Get())
{
//If the serial port's instance name contains USB
//it must be a USB to serial device
if (queryObj["InstanceName"].ToString().Contains("USB"))
{
Console.WriteLine("-----------------------------------");
Console.WriteLine("MSSerial_PortName instance");
Console.WriteLine("-----------------------------------");
Console.WriteLine("InstanceName: {0}", queryObj["InstanceName"]);
Console.WriteLine(queryObj["PortName"] + "is a USB to SERIAL adapter/converter");
string port = queryObj["PortName"].ToString();
SerialPort p = new SerialPort(port);
//p.PortName = "COM11";
return port ;
}
}
throw new Exception(Messages.PINPAD_NOT_FOUND);
} | 0 |
8,567,541 | 12/19/2011 21:03:21 | 1,131,779 | 12/19/2011 20:59:42 | 1 | 0 | Wrong timestamp in Android Notification | In the bottom right corner of my standard Android notification I will not see time (eg 12:00) rather than a pattern like that: 11/1/16. Always 3 numbers diveded by "/". Anybody know the problem? | android | notifications | timestamp | null | null | null | open | Wrong timestamp in Android Notification
===
In the bottom right corner of my standard Android notification I will not see time (eg 12:00) rather than a pattern like that: 11/1/16. Always 3 numbers diveded by "/". Anybody know the problem? | 0 |
9,416,840 | 02/23/2012 16:15:17 | 1,004,278 | 10/20/2011 00:53:10 | 531 | 5 | Anyone know of a good (easy to use, feature-rich) Android, or multi-platform device simulator for Mac? | I know there is the Google emulator and other tools like XCode simulator for iOS, but I am looking for a simple to use (no CLI calls or Eclipse) standalone Android simulator? Something that I can open, select an .apk file and run it. Would be nice if it provided a simulated G-Sensor...akin to Visual Studio and WP7.
Anyone know of anything good? | android | ios | android-emulator | simulator | null | 02/24/2012 18:15:47 | not constructive | Anyone know of a good (easy to use, feature-rich) Android, or multi-platform device simulator for Mac?
===
I know there is the Google emulator and other tools like XCode simulator for iOS, but I am looking for a simple to use (no CLI calls or Eclipse) standalone Android simulator? Something that I can open, select an .apk file and run it. Would be nice if it provided a simulated G-Sensor...akin to Visual Studio and WP7.
Anyone know of anything good? | 4 |
11,220,169 | 06/27/2012 05:51:32 | 1,436,683 | 06/05/2012 06:45:23 | 26 | 0 | Lat -long to x-y | I have 2 columns that have latitude and longitude data in degrees, what simple formula that takes into account the curvature of the Earth can I use to convert them into x and y coordinates in meters using Excel? | excel | coordinates | latitude-longitude | null | null | 06/27/2012 13:10:49 | off topic | Lat -long to x-y
===
I have 2 columns that have latitude and longitude data in degrees, what simple formula that takes into account the curvature of the Earth can I use to convert them into x and y coordinates in meters using Excel? | 2 |
9,472,457 | 02/27/2012 21:20:22 | 1,236,526 | 02/27/2012 21:10:49 | 1 | 0 | How to combine multiple SUM in one Query? | I have query like this:
**SELECT *, SUM(ss.rank) as group_sum FROM Standard s, s.SubStandard ss GROUPBY s.id**
the problem is I want to have **SUM(s.rank) as total_rank** in this query, how is possible? | mysql | query | sum | combine | null | null | open | How to combine multiple SUM in one Query?
===
I have query like this:
**SELECT *, SUM(ss.rank) as group_sum FROM Standard s, s.SubStandard ss GROUPBY s.id**
the problem is I want to have **SUM(s.rank) as total_rank** in this query, how is possible? | 0 |
8,322,212 | 11/30/2011 06:55:24 | 148,978 | 08/01/2009 14:17:54 | 1,425 | 3 | Why Apple don't make the Button init like another UI Element? | Just about the design of the iPhone Framework, most of the view is work like something:
XXXView = [[XXXView alloc] initWithFrame:frame];
But the UIButton is very different, it works like this:
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
I think there should have some results for that. But why use this approach for the UIButton only? Any hints? Thanks. | iphone | objective-c | ios | null | null | 11/30/2011 07:09:09 | not constructive | Why Apple don't make the Button init like another UI Element?
===
Just about the design of the iPhone Framework, most of the view is work like something:
XXXView = [[XXXView alloc] initWithFrame:frame];
But the UIButton is very different, it works like this:
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
I think there should have some results for that. But why use this approach for the UIButton only? Any hints? Thanks. | 4 |
7,283,095 | 09/02/2011 12:00:34 | 458,975 | 09/26/2010 22:01:37 | 7 | 0 | i can't access to phpmyadmin | I use Xampp and i remove the all users in phpmyadmin and now i can't access to phpmyadmin again. I try to unistall and install the xampp again but the problem not solved and still get this error:
Error
MySQL said:
#1130 - Host 'localhost' is not allowed to connect to this MySQL server
Connection for controluser as defined in your configuration failed.
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
Please help me,
Thanks | mysql | passwords | phpmyadmin | xampp | null | 09/03/2011 01:59:38 | off topic | i can't access to phpmyadmin
===
I use Xampp and i remove the all users in phpmyadmin and now i can't access to phpmyadmin again. I try to unistall and install the xampp again but the problem not solved and still get this error:
Error
MySQL said:
#1130 - Host 'localhost' is not allowed to connect to this MySQL server
Connection for controluser as defined in your configuration failed.
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
Please help me,
Thanks | 2 |
8,376,304 | 12/04/2011 15:27:49 | 1,080,181 | 12/04/2011 15:24:15 | 1 | 0 | How to have game center integration and use php with phonegap? | If I make a game using html5, css3 and javascript with phonegap, can I make sql databases and use php. And how do I get game center included with my app? | php | javascript | html5 | phonegap | null | 12/05/2011 06:29:09 | not a real question | How to have game center integration and use php with phonegap?
===
If I make a game using html5, css3 and javascript with phonegap, can I make sql databases and use php. And how do I get game center included with my app? | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.