Managing multiple collision detection between objects(not necessarily circles)
Hi.
I´d like to know if there´s any good tutorial, or if somebody knows, a way, to manage a multiple collision detection with pixel level detection, for objects, not necessarily circles, irregular objects.
Any help?
Yes, and what about the speeds of each object?
I was thinking something like this:
var _currentObj1SpeedX = obj1.speedX
var _currentObj1SpeedY = obj1.speedY
obj1.speedX = obj1.speedX - obj2.speedX
obj1.speedY = obj1.speedY - obj2.speedY
obj2.speedX = obj2.speedX - _currentObj1SpeedX
obj2.speedY = obj2.speedY - _currentObj1SpeedY
Is it right?
Similar Messages
-
Relationship between Objects Not Found in PA
Dear all,
I have uploaded objects (Org Unit, Job, and Position) and the relationships between objects separately using LSMW.
When i checked the update of the relationship between objects in PA30, but the relationship between objects (Org Unit, Job, and Position) did not exist, yet exists in PP02.
I tried to upload the relationships between objects using holder (A008) in LSMW again, still I could not find the relationships in PA30, but exist in PP02.
Then I tried to run rhinte00 and rhinte30 to link the relationship between objects. I managed to get through rhinte00, but failed to run rhinte30.
Below is the report log when I tried to run rhinte30.
Report log:
Processing mode: Processing successful
Number of personnel nos. selected : 0
Personnel numbers with errors:Check the following.
1. Check if integration is active in T77S0 table PLOGI PLOGI = Your active plan version & PLOGI ORGA = X
2. Check if all your objects are created with this active plan version
3. Check the feature PLOGI to see if your PA PSA etc for the employee are integrated.
cheers
Ajay -
Managing multiple "old" AD computer objects
So we have implemented a naming convention where the techs just select a location and department during the imaging process for a machine that is about to be deployed; during that process and the computers are automagically named something like "NYC-FIN-1234567"...
with 1234567 being the dell asset tag.... pretty nifty Johan(!)
However... the problem is that once that machine gets re-imaged at the same location and deployed to another team like the marketing folks (ie."MKT")... it gets the name NYC-MKT-1234567...
the problem I am seeing is now we have multiple objects in AD with the same asset tag which is causing nightmares for licensing management... NYC-FIN-1234567 & NYC-MKT-1234567 respectively.
I am working on a PowerShell script that will trim the names down to their respective tags and then compare the list for duplicates - then check and compare the duplicates properties like "created date" and make a determination and delete
the older object...
this checking for duplicates is proving to be a little more difficult and haven't even gotten to the evaluate section yet... I am still working on my proficiency when it comes to more complex arrays.
am i going about this the right way or does anyone else have another approach to this conundrum?
scripting games '14 anyone :pall good info!
Since our AD has less than 3000 workstation objects the 'scaling' is manageable... but could make it a little faster, but alas here is what i have with a couple of tweaks
i am skimming all computer objects in our 'workstation' OU... and dropping the first two prefixes, and then checking for machines that match... we were originally using "created date" but since we have workstations that have been imaged to say
a FIN dept and then to a MKT dept and then re-re-imaged back to FIN... the created date doesn't change so i switched to Modified date, and keep the newest one...
but also as another 'layer' of protection i test-path of the workstation (we run this middle of the day) before disabling it and moving it to a "temp" ou where we can let them sit for a couple weeks in case we had a false positive (thus the ping)
we can quickly restore that object... i also can just comment out the actual "move and disable command" so it generates me a nice list of machines that would have been deleted so i can do a 'sanity check' before deleting a bunch of vip's machiens
from AD :)
#Declare Domain and OU to be Scrubbed - and $dupou is the ou we can let them 'chillout' before deleting on the next run
$domain = "domain.com"
$OU = "OU=Workstations,DC=domain,DC=com"
$CleanupList = "c:\disabled.txt"
$dupOU = "OU=Duplicates,OU=INACTIVE,DC=domain,DC=com"
if (test-path $CleanupList) {Remove-Item $CleanupList}
$delOK = "c:\DelOk.txt"
if (test-path $delOK) {Remove-Item $delOK}
#this is the TEMPORARY throttle cap... so it will stop after it finds the amount defined by $cap (so we can phase it in)
$cap = 10000
$Global:i = 0
$sdate = (Get-Date)
Write-Output "AD Duplicate 'Scrubber' Script started on: "$sdate >> $CleanupList
Write-output "These Machines were disabled and moved to the Inactive\Duplicates OU in our domain" >> $CleanupList
Write-Output "--------------------------------------------------------------------------------------------------------------">> $CleanupList
$comps = (Get-ADComputer -filter * -Server $domain -SearchBase $OU).name
ForEach ($comp in $comps) {
if ($global:i -lt $cap) {
#trim length to just asset tags (last 7 digits)
$Length = $comp.Length
$var = $Length - 7
$tag = $comp.Substring($var,7)
Write-host -ForegroundColor yellow "Testing asset tag: $tag"
$x =(Get-ADComputer -Filter "name -like '*$tag'" -Properties DistinguishedName, Modified -Server $domain -SearchBase $OU |Sort-Object -Property Modified)
if ($x.count -gt 1) {
$y = ($x.count) -1
while ($y -ge 1 ) {
$z = $y - 1
$x.name[$z] >> $CleanupList
#added a ping feature to as another level of "protection"
if (Test-Connection $x.name[$z] -Count 2 -Quiet){
Write-Output $x.name[$z]" is Online... Skipping"
$x.name[$z] >> c:\WTF.txt
}Else {
#this line below this one is the one that moves and disables... comment out if testing with a # sign or remove when testing compelete
#Get-ADComputer $x.name[$z] | Move-ADObject -TargetPath $dupOU -PassThru | Disable-ADAccount
Write-Output $x.name[$z]" is Offline... should delete"
$global:i++
$x.name[$z] >> $delOK
write-host -ForegroundColor Cyan $x.name[$z]" Moved and Disabled - $global:i"
$y--
Write-host "------------"
Write-host -foregroundcolor cyan "$i Computer objects were Disabled and Moved to $dupOU :)"
#message in the body
$msg ="Please review the attached list to see the Duplicate machines that were moved and disabled via this script"
#Recipients
$mailTo = "shad acker <[email protected]>"
Send-MailMessage -SmtpServer smtp.domain.com -Attachments $delOK -Body $msg -to $mailTo -From "DuplicateFinder<[email protected]>" -Subject "Computer Duplicates Disabled" -Cc "who ever <[email protected]>"
not the prettiest or most efficinent but it seems to be working :) -
Question: equals() for objects, not necessarily strings
My book goes over the equals(String str) method, but it does not cover other objects. For example, in the code below the equals method returns false by printing, "The objects are not equal" even though both objects contain the same numbers. I looked at the API, but it was confusing. I'm not that far along yet. Any answers to why the equals() returns a false below?
public class Exp
public static void main(String[] args)
Exp2 e = new Exp2(6, 8);
Exp2 e1 = new Exp2(6, 8);
if(e.equals(e1))
System.out.println("Objects are equal.");
else
System.out.println("Objects are not equal.");
System.out.println("");
}paulcw wrote:
If you're the author of the Exp2 class, and you think that two objects of Exp2 that have been initialized with equal values should be equal (seems reasonable), then you'd define an equals method in Exp2 to express that.Exactly, just like the String class has code to explicitly compare the two String objects' characters.
The default equals() doesn't automagically compare objects' contents. I just uses == to see if the two references are pointing to the same object. If you want other behavior, you have to provide it, like String does. -
Application Web Service Control Manager detected AWEBSVC is not responding to HTTP requests
Hi,
We are using SCCM 2012 sp1 cu5 with one primary in the datacenter and a number of local DP's which are presently servicing 200 users, but will rise to 12,000. The Application Catalogue is installed on the primary server.
Once a day we get the above error and the message id is 8101, and sometimes a user will have to click on install twice, with the first one failing (the ones that fail are normally with dependencies which are quite large in size around 250MB)
I'm just wondering if this is something I should be concerned about, especially since we will be ramping up user numbers in the next few weeks, and if it could be down to volume of traffic, although the apps are downloaded to the users local DP.
Also, does this design look suitable to service this amount of users, or should I have local application catalogues? The WAN bandwith between the datacenter and the user sites has recently been upgraded and is pretty fast.
Thanks
JazHi Torsten,
Message ID is in the SMS_AWEBSVC_CONTROL_MANAGER status log and equates to "Application Web Service Manager detected AWEBSVC is not responding to HTTP requests. The http error is 12002.
Then, about 1 hr later in the same monitoring log I get Message ID 8102 "Application Web Service Control Manger detected AWEBSVC is responding to HTTP requests.
At the moment it isn't doing this very often, just once a day at different times normally, but it has also logged this a couple of times as well. I guess it may correspond to multiple users accessing the web portal at multiple times, but wondered if
anyone else has seen this behaviour and how it was fixed.
Thanks
Jaz -
What is the best way to test for collisions between objects?
I am in the process of developing my first game, my first decent game that is. I understand how to develop the background and tileset for the game, but have yet to figure out an effective way of testing for collisions. As in you try to move the character into a wall, or another object on the level.
If I divide the level into tiles, it won't be to hard, but I am thinking I want to have the hero be able to move all over the place, not just from square to square.
Any suggestions or ideas will be greatly appreciatedIf I divide the level into tiles, it won't be to hard,
but I am thinking I want to have the hero be able to
move all over the place, not just from square to
square.Err...
So if the hero is not on a square, the hero is not on a tile and consequently is not on a visible aspect of the game world?
I suspect that you wanted the hero to be able to move in any direction, not just the standard cardinal directions.
If you're using tiles to represent the game world, then the solution is simple - check to see if there's anything "solid" already on the target tile. If there is, abort the move and report it as a collision. If there isn't, permit the move.
It's only when you have a tile-less world that you actually have to determine if the leading edge of your hero crosses the boundary of an item (or border) that he shouldn't be allowed to cross. Doing so is complicated enough that I would simply suggest that you search the forum for third party collision detection packages that you can borrow. -
ODI not able to detect primary/foreign keys from XML- user lacks privilege or object not found
Hi Guys,
Im trying to load an xml file with two entities address and employee as below. The topology reverse engineering everything works fine. Im even able to view the xml data in ODI, but when i try to load the data from these two entities joining by the schema primary keys and foreign keys which odi created on reverse engineering process for xml, im getting the below error. Im able to load data from one entity, error only occurs when i use the join odi creates internally to identify the xml components employee and address
XML File:
<?xml version="1.0" encoding="UTF-8" ?>
<EMP>
<Empsch>
<Employee>
<EmployeeID>12345</EmployeeID>
<Initials>t</Initials>
<LastName>john</LastName>
<FirstName>doe</FirstName>
</Employee>
<Address>
<WorkPhone>12345</WorkPhone>
<WorkAddress>Test 234</WorkAddress>
</Address>
</Empsch>
</EMP>
Topology: jdbc:snps:xml?f=C:/Temp/RR/Empsch.xml&s=Empsch&re=EMP&dod=true&nobu=false
Error Message:
-5501 : 42501 : java.sql.SQLException: user lacks privilege or object not found: EMPSCH.EMPSCHPK
java.sql.SQLException: user lacks privilege or object not found: EMPSCH.EMPSCHPK
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source)
at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source)
at com.sunopsis.jdbc.driver.xml.SnpsXmlConnection.prepareStatement(SnpsXmlConnection.java:1232)
at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.odi.core.datasource.dwgobject.support.OnConnectOnDisconnectDataSourceAdapter$OnDisconnectCommandExecutionHandler.invoke(OnConnectOnDisconnectDataSourceAdapter.java:200)
at $Proxy2.prepareStatement(Unknown Source)
at oracle.odi.runtime.agent.execution.sql.SQLCommand.doInitializeStatement(SQLCommand.java:83)
at oracle.odi.runtime.agent.execution.sql.SQLCommand.getStatement(SQLCommand.java:117)
at oracle.odi.runtime.agent.execution.sql.SQLCommand.getStatement(SQLCommand.java:111)
at oracle.odi.runtime.agent.execution.sql.SQLDataProvider.readData(SQLDataProvider.java:81)
at oracle.odi.runtime.agent.execution.sql.SQLDataProvider.readData(SQLDataProvider.java:1)
at oracle.odi.runtime.agent.execution.DataMovementTaskExecutionHandler.handleTask(DataMovementTaskExecutionHandler.java:70)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:577)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:468)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2128)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:366)
at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:292)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:855)
at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.hsqldb.HsqlException: user lacks privilege or object not found: EMPSCH.EMPSCHPK
at org.hsqldb.error.Error.error(Unknown Source)
at org.hsqldb.ExpressionColumn.checkColumnsResolved(Unknown Source)
at org.hsqldb.QueryExpression.resolve(Unknown Source)
at org.hsqldb.ParserDQL.compileCursorSpecification(Unknown Source)
at org.hsqldb.ParserCommand.compilePart(Unknown Source)
at org.hsqldb.ParserCommand.compileStatement(Unknown Source)
at org.hsqldb.Session.compileStatement(Unknown Source)
at org.hsqldb.StatementManager.compile(Unknown Source)
at org.hsqldb.Session.execute(Unknown Source)
... 27 more
Please advice
Thanks
RevanthThats obvious from the xml file contents you have given here. In this xml file You have four complex type. Two of them are employee and address. However the employee doesnot have any relation with address as you have not added the relationship. Thats why its failing. Its not the fault of ODI.
Also I would suggest not to use auto generated dtd by ODI as you might face problem in future. For example the address type of XML has 8 attributes and 4 of them are not mandatory. That means each of your xml file may have attributes between 4 to 8. This is where ODI auto generated DTD fails.
XML Schema complexType Element
Thanks
Bhabani -
What's the difference between a not-initialed object and a null object
hi guys, i wanna know the difference between a not-initialed object and a null object.
for eg.
Car c1;
Car c2 = null;after the 2 lines , 2 Car obj-referance have been created, but no Car obj.
1.so c2 is not refering to any object, so where do we put the null?in the heap?
2.as no c2 is not refering to any object, what's the difference between c2 and c1?
3.and where we store the difference-information?in the heap?For local variables you can't have "Car c1;" the compiler will complain.That's not true. It will only complain if you try to use it without initializing it.
You can have (never used, so compiler doesn't care):
public void doSomething()
Car c1;
System.out.println("Hello");
}or you can have (definitely initialized, so doesn't have to be initialized where declared):
public void doSomething(boolean goldClubMember)
Car c1;
if (goldClubMember)
c1 = new Car("Lexus");
else
c1 = new Car("Kia");
System.out.println("You can rent a " + c1.getMake());
} -
Hi All,
I am seeing the following error for SMS_AWEBSVC_CONTROL_MANAGER component with Message ID: 8100
Application Web Service Control Manager detected AWEBSVC is not responding to HTTP requests. The http status code and text is 400, Bad Request.
awebsctl.log file has below errors:
Call to HttpSendRequestSync failed for port 80 with status code 400, text: Bad Request
SMS_AWEBSVC_CONTROL_MANAGER 12/22/2014 3:37:55 PM
13920 (0x3660)
AWEBSVCs http check returned hr=0, bFailed=1
SMS_AWEBSVC_CONTROL_MANAGER 12/22/2014 3:37:55 PM
13920 (0x3660)
AWEBSVC's previous status was 1 (0 = Online, 1 = Failed, 4 = Undefined)
SMS_AWEBSVC_CONTROL_MANAGER 12/22/2014 3:37:55 PM
13920 (0x3660)
Health check request failed, status code is 400, 'Bad Request'.
SMS_AWEBSVC_CONTROL_MANAGER 12/22/2014 3:37:55 PM
13920 (0x3660)
Management point and Application Catalog Website Point are installed on the same Server where I am seeing the error for Application Catalog Web Service Point role. Management Point and Application Catalog Website Point are functioning properly. Application
Catalog Website is working.
Thanks & Regards, KedarHi Jason,
Application Catalog Web Service Point and Application Catalog Website Point; both are installed as per below configuration on same Server:
IIS Website: Default Web Site
Port Number: 80
with default value for Web Application Name configured.
For SMS_AWEBSVC_CONTROL_MANAGER component, I am getting below error in Component Status:
Application Web Service Control Manager detected AWEBSVC is not responding to HTTP requests. The http status code and text is 400, Bad Request.
Possible cause: Internet Information Services (IIS) isn't configured to listen on the ports over which AWEBSVC is configured to communicate.
Solution: Verify that the designated Web Site is configured to use the same ports which AWEBSVC is configured to use.
Possible cause: The designated Web Site is disabled in IIS.
Solution: Verify that the designated Web Site is enabled, and functioning properly.
For more information, refer to Microsoft Knowledge Base.
And awebsctl.log has the below error lines:
Call to HttpSendRequestSync failed for port 80 with status code 400, text: Bad Request
SMS_AWEBSVC_CONTROL_MANAGER
12/23/2014 11:04:36 AM 16388 (0x4004)
AWEBSVCs http check returned hr=0, bFailed=1
SMS_AWEBSVC_CONTROL_MANAGER
12/23/2014 11:04:36 AM 16388 (0x4004)
AWEBSVC's previous status was 1 (0 = Online, 1 = Failed, 4 = Undefined)
SMS_AWEBSVC_CONTROL_MANAGER
12/23/2014 11:04:36 AM 16388 (0x4004)
Health check request failed, status code is 400, 'Bad Request'.
SMS_AWEBSVC_CONTROL_MANAGER
12/23/2014 11:04:36 AM 16388 (0x4004)
STATMSG: ID=8100
What should I check from IIS side?
Application Catalog Website is functioning properly.
Thanks & regards,
Kedar
Thanks & Regards, Kedar -
Lync Powershell help -getting error "Management Object Not found"
Hi,
I want to reference a list of users in Lync that do not have a HostedVoicemailPolicy applied. Please can someone help me..
I have a list of users that form a txt file I am referencing called $lynctest.
User1
User2
User3
NoSuchUser1
NoSuchUser2
I have the following and its not catching the error so that I can output to another file.
try
foreach($lyncuser in $lynctest)
Get-CsUser -Identity $lyncuser | select displayname, hostedvoicemailpolicy
catch
write-host "$lyncuser user not found" > "c:\datatemp\listofusers.txt"Not super efficient, but quick and dirty. If you're talking about thousands of users, this might be too slow and we can work something else out. If you're talking about a handful, this might be fine.
foreach($lyncuser in $lynctest) {
$founduser=Get-CSUser|Where-Object {$_.samaccountname -match $lyncuser}
if ($founduser) {
"The user exists"
else {
"The user does not exist"
Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question please click "Mark As Answer".
SWC Unified Communications
This forum post is based upon my personal experience and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs. -
How to properly detect object not found in query?
Generally, we'd prefer to catch the unchecked exceptions which JDO throws in
response to database operations that go awry. That said, there's one in
particular that's bothering us:
The most important and common one of these which we'd like to know about is
when a query or getObjectByID() fails because the desired object isn't in
the DB.
Currently, an exception is thrown, which we would presumably have to catch
and parse the message text of to determine if this was a row not found, vs.
a database problem?
Please tell me there's a better way to determine if a row(s) isn't(aren't)
found!
thanks,
davidPatrick -- I believe we just see them in getObjectById(), which is what we
do most often.
The subclass of JDODataStoreException that you'll throw is great.
I'd suggest that a property setting could configure kodo to return null to
getObjectById() instead -- ONLY for the case of object not found, for those
of us who might consider this a less-than-truly-exceptional case :)
thanks much,
david
"Patrick Linskey" <[email protected]> wrote in message
news:[email protected]..
David,
Also, a query should return a collection of size zero, and not throw an
exception.
Are you seeing exceptions only when executing getObjectById(), or also
when querying?
-Patrick
On Tue, 29 Apr 2003 05:03:23 -0400, david michaels wrote:
Generally, we'd prefer to catch the unchecked exceptions which JDO
throws in response to database operations that go awry. That said,
there's one in particular that's bothering us:
The most important and common one of these which we'd like to know about
is when a query or getObjectByID() fails because the desired object
isn't in the DB.
Currently, an exception is thrown, which we would presumably have to
catch and parse the message text of to determine if this was a row not
found, vs. a database problem?
Please tell me there's a better way to determine if a row(s)
isn't(aren't) found!
thanks,
david--
Patrick Linskey
SolarMetric Inc. -
Optimizing collision detection
Hi,
in a simulation I have to check for many collisions between
multiple
objects. So what I am doing is put a detection on each
relevant
movieclip that checks a list of objects (cars). When the
number of
objects is growing the number of loops is growing the same
amount but
the loops that checks for collision are growing too. So I am
running
into a preformace problem.
I was thinking about how to optimize this performance
problem.
* first idea was to check only clips that are in a specific
area. But
this also creates an overhead on checking what area the clips
are. I
could create overlapping clips that are used to represent
this areas and
check if the clips are inside these areas.
I am not quite sure if this is a real performance
optimization or
creates too much overhead.
or
* As I am also check for distance when colliding I could
create a
timeout for two clips that are too far away from each other
and skip
checking on next frame. But I am not sure how to create the
conditions
without creating a new big overhead.
What I am using now is to exclude clips from any collision
detection
when they are moving out the scene and won't collide anyway.
Anyone seen nice concepts and theories on optimizing complex
collision
detection?
thanks for any help - if anyone understands what I was trying
to tell ;)divide your collision region into sections that have are the
size of your smallest object. assign each object to its current
section. each section needs to retrieve the objects within it. you
need a look-up table or easy way to determine adjacent sections.
assign each section an id #.
to efficiently detect pair-wise relations (like hittests)
between all object pairs, check for relations between all objects
in the section with the lowest id# and adjacent section. increment
the id# and repeat. -
This is a weird one and I'm hoping someone can reproduce this and give me some help.
We have a system that uses the EWS Managed API to send emails. Optionally an email may need to be saved out as an rfc822 (.eml) file afterwards for storing in our own database. In order to save to a file I need to load up the MimeContent of the message.
And this is where an "Object not found in store" exception can get thrown.
The really strange part is that the exception only seems to occur if the email contains an attachment and if there is too much of a delay between sending the email and trying to access the MimeContent!
My test code is something like:
// Set up the basics
_item = new EmailMessage(P7ExchangeService.Service);
_item.Subject ="Hello world";
_item.ToRecipients.Add("some name", "[email protected]");
_item.Body = new MessageBody(BodyType.HTML, @"<html><head></head><body>hello world<image src=""cid:blah""/></body></html>");
// Add attachment
FileAttachment att = _item.Attachments.AddFileAttachment("blah", "c:\temp\blah.jpg");
att.IsInline = true;
att.ContentId = "blah";
// Send and save
_item.SendAndSaveCopy();
// Wait a bit (see comments below)
Thread.Sleep(5000);
// Now try and save out
var propCollection = _item.GetLoadedPropertyDefinitions();
propCollection.Add(ItemSchema.MimeContent);
_item.Load(new PropertySet(propCollection)); // EXCEPTION!
// ... etc
On some systems it seems that the sending can take a while, hence my Thread.Sleep() call to simulate this.
Its when I try and load up the MimeContent that I will then get the exception. But ONLY if I sleep (simulating the occasional delay seen on customer sites) and ONLY if the email contains an attachment.
The mimecontent is necessary in order to save out to a file (by accessing the _item.MimeContetn property).
Can someone please explain the exception and/or provide a better way of doing this??This is normal EWS doesn't return the Id of the Item in the SentItems Folder so you need to use a workaround like
http://blogs.msdn.com/b/exchangedev/archive/2010/02/25/determining-the-id-of-a-sent-message-by-using-extended-properties-with-the-ews-managed-api.aspx .
If you want to understand the issue you can enable tracing and look at responses, the actually Id your trying to load the MimeContent from is probably the Id of the draft message. Eg to send a message via EWS with attachments multiple operations must be
used to construct it and when the messages finally gets sent the copy in the drafts folder is deleted and a copy is created in the SentItems folder. However the Id isn't returned for the SentItems copy hence you need the workaround.
Cheers
Glen -
2D Pixel Collision detection on XML tiled map
Hello,
I'm designing a game where the player can move through a city composed of 2D image tiles. Right now we have successfully got the pixel collision detection to work on a large single image consisting of an invisible mask image and a visible image that shows a cluster of buildings and objects. The mask overlays the visible buildings and blocks / allows movement based on the color of the mask. Black is a collision, white is open space, etc.
But this technique won't work for the game, since there will be many cities and vastly larger than this little testbed. I cannot create multiple huge cities into one file - the file would be several megs large, and I'm looking at dozens of cities.
My idea is to create tiled maps, which will save the coordinates for the various building/object tiles in an XML file. However, I do not know how to make the collision detection work with such a tiled map. Moreover, I don't know if constructing a mosaic city using XML coordinates is the best way to go - I'm open for suggestions. My goal is to simply be able to assemble a city from individual tiles of buildings and masks, and drive/walk my character through the city with pixel collision detection, without using the current setup of a single image and a single mask.
Any advice/suggestions offered will be GREATLY appreciated! This is our first Java project, but hopefully we can make this work.
Thank you so much!
Message was edited by:
Gateway2007 - clarifying that this is a collision detection based on pixels, not planes or other method.Sound like this might be too late of a suggestion, but have you looked at Slick at all?
http://slick.cokeandcode.com/static.php?page=features
It might help with the tiling and collision aspects. -
Creating custom mappings between objects
I currently have a db schmea that supports "soft" deletes. Example:
Client table has fields:
id - primary key (number)
name - varchar
active ("Y" or "N" where "Y" means active and "N" means "INACTIVE")
We also have a table Users:
id - primary key (number)
name - varchar
active ("Y" or "N" where "Y" means active and "N" means "INACTIVE")
When I delete a user I want to set its active field to "N" and then when
someone reads users from the client (after I have saved my changes) I want
only users whoses active field is "Y" to be returns, i.e.
Client clientA = <read client A>
Collection users = clientA.getUsers();
Is there a way to configure/customize the mapping/relationship between
objects?
Thanks!
BruceAll of the emails are really my way of getting a soft delete to work. Does
KODO support this feature or is their a standard work around to support
this feature?
Thanks!
Bruce
Alex Roytman wrote:
You could break you collection into multiple mutually exclusive
subcollections (like active/inactive) and have your object model to map them
separately (via views with mutually exclusive criterion) When changing a
collection member's status you will need to move it from active collection
to inactive. Complete collection can be dode as dybamic (delegating)
composition of the subcollections (but it will cost twice as much to fetch
it)
Try to resolve your issues on object model level. I believe altering sql
mappings to make them very fancy will cause you lots of grief in the long
run
"Bruce" <[email protected]> wrote in message
news:[email protected]...
I also want to do something similiar to support object history. I could
have a Client object which gets modified and instead of editing this
object I would copy it, inactivate the copy and then edit the original.
This allows for full history. I can always select by active (or a more
complicated status) to get the rest of the history instead of the "top".
Views here seems like a hack. I have activew fields in all of my tables so
I would nee views for each table which is a lot to manage if fields are
changing (need to change them in both places). Also this creates issues
since views are really read-only.
Isn't there a way to change the SQL used to read a relationship?
Bruce
Alex Roytman wrote:
map your classes against views with (where active = 'Y') to make sure
"soft
deleted" records do not get read and have your object model to handlesoft
deletes (like removing from collections etc) use helper methods to do"soft
deletes" masking real deletes is not good idea - you will need them atsome
point
"Stephen Kim" <[email protected]> wrote in message
news:[email protected]...
While there is nothing default that does particularly what you desire,
but from my perspective, you should not have Kodo do anything by
default
as you will probably want to delete the inactive instances at somelater
point.
Instead you should look into Query.setCandidates:
http://www.solarmetric.com/Software/Documentation/2.4.3/docs/jdo-javadoc/jav
ax/jdo/Query.html
i.e. public Collection getActiveUsers ()
PersistenceManager pm = JDOHelper.getPersistenceManager
(this);
Query q = pm.newQuery (User.class, true);
q.setFilter ("active == "N"");
q.setCandidates (users);
return q.execute ();
I haven't tested the above code and there are a lot of optimizations
you
could do such as caching the query in a transient collection but Ithink
you get the idea.
You may want to post your thoughts on our newsgroups
(news://news.solarmetric.com) and see how other people are tackling
similar probles..
Bruce wrote:
I currently have a db schmea that supports "soft" deletes. Example:
Client table has fields:
id - primary key (number)
name - varchar
active ("Y" or "N" where "Y" means active and "N" means "INACTIVE")
We also have a table Users:
id - primary key (number)
name - varchar
active ("Y" or "N" where "Y" means active and "N" means "INACTIVE")
When I delete a user I want to set its active field to "N" and then
when
someone reads users from the client (after I have saved my changes)I
want
only users whoses active field is "Y" to be returns, i.e.
Client clientA = <read client A>
Collection users = clientA.getUsers();
Is there a way to configure/customize the mapping/relationship
between
objects?
Thanks!
Bruce
Stephen Kim
[email protected]
SolarMetric, Inc.
http://www.solarmetric.com
Maybe you are looking for
-
How to change itunes account from one account holder to another
I previously set up different family members' accounts under my own itunes account. Now I'd like them to have their own accounts with their own payment information. How can I change each user's existing account information to get them off my account
-
Using iPod as encrypted disk for G4 Backup
i have created an encrypted disk image on my iPod for backing up my G4 desktop folder. works like a charm. however, OSX limits the size of this disk image to 500MB when it is created using Disk Utility. that is unfortunate since my desktop folder is
-
Renaming Time Capsule Disk?
Did a search, didn't find a definitive answer. I'm looking to rename my TC drive. In Finder, under shared, it mounts as the name I chose. However, when I click on that, inside, there is the "sharepoint" that's named "Data". That mounts on my desktop
-
How can I write and read the LPT within JAVA?
Hello! I'm new to JAVA. I made a simple JAVA application with few buttons and labels with NetBeans. I add ActionListener to button but don't know to write the handling code that should to write a byt to the DATA register in the LPT port of the PC box
-
HELP! Finder and other applications keep crashing after application install
Okay, this was probably not a good idea considering I did not read that it was only for snow leopard... but I downloaded the Metalik theme from Julien Sagot's webpage (http://juliensagot.com/). Now, when I logged out and logged back into my account,