structs

search for more blogs here

 

"[ZF-2090] More efficient differentiation between structs and arrays" posted by ~Ray
Posted on 2008-11-13 12:21:28

Instead of iterating over each key array_keys() in combination with range() is much faster to determine wheither it is an array or a struct. Instead of iterating over each key array_keys() in combination with range() is much faster to determine wheither it is an array or a struct. I'm sorry but you change made it even worse. I attached a benchmark between our two strategies to differentiate. - 03/Dec/07 06:43 PM I'm sorry but you change made it even worse. I attached a benchmark between our two strategies to differentiate. This patch highlights a huge issue with array/struct detection. With the patch applied we now have a situation where passing an empty array to a field expecting an array now results in an invalid argument exception – because the empty array is incorrectly detected as a struct. Before the patch was applied we had the opposite siutation: passing an empty array to a field expecting a struct resulted in an invalid argument exception because the empty array was detected as an array. I'm re-opening the ticket as we need to do some detection in the client for empty arrays and cast them to the appropriate types. - 17/Mar/08 01:17 PM This patch highlights a huge issue with array/struct detection. With the patch applied we now have a situation where passing an empty array to a field expecting an array now results in an invalid argument exception – because the empty array is incorrectly detected as a struct. Before the patch was applied we had the opposite siutation: passing an empty array to a field expecting a struct resulted in an invalid argument exception because the empty array was detected as an array. I'm re-opening the ticket as we need to do some detection in the client for empty arrays and cast them to the appropriate types. Fix committed in trunk in r8953 and in release-1.5 branch in r 8954. This should resolve all issues at this point. - 21/Mar/08 11:24 AM Fix committed in trunk in r8953 and in release-1.5 branch in r 8954. This should resolve all issues at this point.

Forex Groups - Tips on Trading

Related article:
http://framework.zend.com/issues/browse/ZF-2090

comments | Add comment | Report as Spam


"Why, oh why? Parameter passing with arrays of structs." posted by ~Ray
Posted on 2008-03-12 23:13:18

I recently posted a thread on parameter passing by reference. analyse Thanks to you guys. I managed to undergo it work in all of my functions except one. That's the function which accepts an array of struct. Here's a simplified example of the code: #include <stdio h>#include <conio h>struct Test{ int a; int b; }; int main(){ struct Test myStructs[5]; InitStructs(&myStructs); return 0;} void InitStructs(struct Test * myStructs[5]){ int i = 0; for (i=0; i<=5; i++) { myStructs[i]->a = 10; myStructs[i]->b = 50; }} This time it compiles. But crashes as soon as I run the example. Am I doing anything do by?I'm at the very end of my project. Just a few lines of code are missing and I want to do it the right way When you leave off the parentheses the effect is the same as the former. However in your inspect you're looking for the latter. So something like this should work: "Simplicity does not lie complexity but follows it." -- Alan Perlis"Testing can only prove the presence of bugs not their absence." -- Edsger Dijkstra"The only real identify is the one from which we learn nothing." -- John PowellMy website: Other programming communicate boards: . Recent projects: [new project: ]The unofficial CBoard Wiki FAQ: int (*array)[5]; /* this is a pointer to an array */int *array[5]; /* this is an array of pointers */int *(arrange[5]); /* this is also an array of pointers */ To d3m105: Your code as posted is not correct. You're calling InitStructs() before you give the prototype; don't do that because prototypes allow your compiler to do type-checking on function calls. If you do this: struct Test { int a; };void InitStructs(struct Test * myStructs[5]); /* this is a prototype */int main(void){ struct Test myStructs[5]; InitStructs(&myStructs); go 0;}void InitStructs(struct evaluate * myStructs[5]) {} Your compiler should tell you that you're passing the wrong write. Always always use prototypes for your functions. To get this working use something desire this: struct Test { int a; };void InitStructs(struct evaluate myStructs[]);int main(cancel){ struct Test myStructs[5]; InitStructs(myStructs); return 0;}void InitStructs(struct evaluate myStructs[]) {} If you really want to go a pointer to the array by using &myStructs (which you almost surely don't except as an academic exercise) it's slightly more complex. I'd rather not type yet another block unless you have a real arouse in seeing how pointers to arrays bring home the bacon. The method I showed you above is about as change state to transparent pass by reference you'll find in C. It's really not pass by reference but inside your InitStructs() function you can treat myStructs like an array of struct for the most part.

Forex Groups - Tips on Trading

Related article:
http://cboard.cprogramming.com/showthread.php?t=95242

comments | Add comment | Report as Spam


"Why, oh why? Parameter passing with arrays of structs." posted by ~Ray
Posted on 2008-03-12 23:13:17

I recently posted a thread on parameter passing by compose. Check Thanks to you guys. I managed to have it work in all of my functions except one. That's the function which accepts an array of struct. Here's a simplified example of the label: #consider <stdio h>#consider <conio h>struct evaluate{ int a; int b; }; int main(){ struct evaluate myStructs[5]; InitStructs(&myStructs); return 0;} void InitStructs(struct Test * myStructs[5]){ int i = 0; for (i=0; i<=5; i++) { myStructs[i]->a = 10; myStructs[i]->b = 50; }} This time it compiles. But crashes as soon as I run the example. Am I doing anything wrong?I'm at the very end of my communicate. Just a few lines of code are missing and I want to do it the right way When you leave off the parentheses the effect is the same as the former. However in your case you're looking for the latter. So something desire this should work: "Simplicity does not precede complexity but follows it." -- Alan Perlis"Testing can only be the presence of bugs not their absence." -- Edsger Dijkstra"The only real identify is the one from which we learn nothing." -- John PowellMy website: Other programming message boards: . Recent projects: [new project: ]The unofficial CBoard Wiki FAQ: int (*array)[5]; /* this is a pointer to an arrange */int *arrange[5]; /* this is an array of pointers */int *(array[5]); /* this is also an array of pointers */ To d3m105: Your code as posted is not correct. You're calling InitStructs() before you give the prototype; don't do that because prototypes allow your compiler to do type-checking on function calls. If you do this: struct Test { int a; };void InitStructs(struct evaluate * myStructs[5]); /* this is a prototype */int main(void){ struct Test myStructs[5]; InitStructs(&myStructs); return 0;}void InitStructs(struct evaluate * myStructs[5]) {} Your compiler should express you that you're passing the wrong write. Always always use prototypes for your functions. To get this working use something like this: struct evaluate { int a; };cancel InitStructs(struct Test myStructs[]);int main(void){ struct Test myStructs[5]; InitStructs(myStructs); return 0;}void InitStructs(struct Test myStructs[]) {} If you really want to pass a pointer to the array by using &myStructs (which you almost surely don't except as an academic apply) it's slightly more complex. I'd rather not type yet another block unless you have a real interest in seeing how pointers to arrays bring home the bacon. The method I showed you above is about as close to transparent pass by reference you'll sight in C. It's really not go by reference but inside your InitStructs() function you can treat myStructs like an array of struct for the most part.

Forex Groups - Tips on Trading

Related article:
http://cboard.cprogramming.com/showthread.php?t=95242

comments | Add comment | Report as Spam


"typedef for structs" posted by ~Ray
Posted on 2008-01-01 21:17:26

I have seen typdef used with structs and wondered why since one coulduse tags. Is there any acquire other than it just a shorter way todeclare a new copy?thanks,gtb. .. I have seen typdef used with structs and wondered why since one could.. use tags. ... Is there any benefit other than it just a shorter way to... (microsoft public vc language) .. PPS: It's advisable not to use the short tags. ... But while it's shorter,it's comfort NOT advisable to use the shorter... I believe short tags is/was/maybe slated for removalcompletely in PHP... (php general) . the 32 'earn' length should therefore ignore the B and I tags and interact the &.. resulting string should undergo all the open html tags properly closed. .. clutch256 characters -- The string. ... If The string is shorter. ... (php general) .. It's advisable not to use the short tags use <?php instead of <? .. least it's shorter. ... (php general)

Forex Groups - Tips on Trading

Related article:
http://www.tech-archive.net/Archive/VC/microsoft.public.vc.language/2007-11/msg00065.html

comments | Add comment | Report as Spam


"?? new and protected Modifiers on Structs ??" posted by ~Ray
Posted on 2007-12-15 15:06:52

Hi everyone,Has anyone looked at section 18.1.1 of the C# spec? It indicates 'new' and 'protected' are valid modifiers on struct declarations. First how can 'protected' be valid on a struct since structs cannot be inherited? The compiler gives an error (as I evaluate it should) if you try this: protected struct MyStruct {}so I'm wondering if the spec is wrong when it says 'protected' is a valid struct-modifier. The second inform about section 18.1.1 is that it indicates 'new' is an allowable modifier on a struct. Actually. 18.1.1 indicates. "The modifiers of a struct declaration undergo the same meaning as those of a class declaration" referring the reader to section 17.1.1 on categorise declaration modifiers. I looked at section 17.1.1 and sure enough it says:"The new modifier is permitted on nested classes. It specifies that the categorise hides an inherited memberby the same name as described in section 17.2.2. Itis a compile-time error for the new modifier to appearon a class declaration that is not a nested class declaration."My testing indicates 'new' is not allowed on class nor struct declarations (nested or not). It seems this is how 'new' should be used as a class modifier according to the spec (sec. 17.1.1): class MyClass { public virtual int M() { return 1; } } class Outer { new categorise Inner : MyClass { // ERROR on 'new' modifier public new int M() { go 2; } } }The above code gives a warning on the declaration of Inner. So am I way off locate here? Is there something do by with sections 18.1.1 and 17.1.1?Thanks--Tom Baxter. .. It indicates 'new' and 'protected' are valid modifiers on struct declarations. ... The back up point about section 18.1.1 is that it indicates 'new' is an allowable modifier on astruct. ... Actually. 18.1.1 indicates. "The modifiers of a struct declaration have thesame meaning as those of a categorise declaration" referring the reader to section 17.1.1 on class declarationmodifiers. .. public virtual int M... (microsoft public dotnet languages csharp) . write an expression evaluating to your struct -- the name of a variable.. you haven't declared a type "struct entry". .. about how this declaration is handled,.. on which compiler you're using but any decent compiler ordain print... (comp lang c)

Forex Groups - Tips on Trading

Related article:
http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.languages.csharp/2007-10/msg04119.html

comments | Add comment | Report as Spam


"Re: Advice with maintaining state / data structs" posted by ~Ray
Posted on 2007-12-09 13:39:48

Hello! Newbie to Max here. So I'm implementing a patch that's meant to evaluate a dominate arrange via a message analyse the arguments and then send a series of messages to a play~ object. For example the sign message might look something like "snare 100 200 127 255 3" meaning the 'snare' buffer~ should be played for 200 ms starting at 100 ms into the buffer starting at half volume (127) and ending at full volume (255) and this should loop 3 times. Actually. I've already managed to get that type of thing working but what I'm implementing involves a lot more variables and dynamics. This is comfort the basis however. The point is that I undergo a lot of looping changing variables math operations and order-important evaluation going on in my current method (which is some byzantine mess of cords) and it's increasingly difficult to understand modify et c. My challenge is: is there a conventional way to maintain express and variables in Max? My background is in textual programming languages and I can't help but to think in terms of for loops while loops conditionals statements small math operations all of which I have been able to emulate in Max individually but when I go to apply these seemingly simple algorithms. I end up with these giant confusing cord orgies totally inelegant constantly worrying about what is going to get evaluated first and I'm often unable to figure out what I even did the previous day. Is there any sort of object that I can use to get set compare and manipulate variables via messages? This post is getting lengthy and tangential but I envision something that I can send a message to desire "x = 5" to appoint a determine to x or "x = x + 1" or any other math operation or "get x" which would send the value of x through its outlet or "clear" which would alter the symbol table et c. Does anything like that exist? Are there any other methods commonly used?Any tips are much appreciated. Thank you in go! Take a be at the determine pv and pvar objects. Value functions similar to a global variable so it might give a familiar way of working for you. Re: patch readability. I often use a hit inlet to a subpatch followed by a route object. For your example you could have a [route consume offset volume_begin volume_end repeat] then prepend each of your values with the appropriate attribute name. (This come was recently mentioned in the oo programming for max go.. worth checking out.) say this doesn't magically solve the order-of-operation issues but it can alter it easier to understand which communicate does what.

Forex Groups - Tips on Trading

Related article:
http://www.cycling74.com/forums/index.php?t=rview&goto=118690&th=28929#msg_118690

comments | Add comment | Report as Spam


"Re: Advice with maintaining state / data structs" posted by ~Ray
Posted on 2007-12-09 13:39:48

Hello! Newbie to Max here. So I'm implementing a patch that's meant to evaluate a dominate arrange via a communicate analyse the arguments and then displace a series of messages to a compete~ disapprove. For example the initial message might be something like "snare 100 200 127 255 3" meaning the 'capture' modify~ should be played for 200 ms starting at 100 ms into the buffer starting at half volume (127) and ending at full volume (255) and this should circle 3 times. Actually. I've already managed to get that type of thing working but what I'm implementing involves a lot more variables and dynamics. This is comfort the basis however. The point is that I undergo a lot of looping changing variables math operations and order-important evaluation going on in my current method (which is some byzantine mess of cords) and it's increasingly difficult to understand change et c. My challenge is: is there a conventional way to maintain express and variables in Max? My background is in textual programming languages and I can't back up but to evaluate in terms of for loops while loops conditionals statements small math operations all of which I have been able to emulate in Max individually but when I go to apply these seemingly simple algorithms. I end up with these giant confusing heap orgies totally inelegant constantly worrying about what is going to get evaluated first and I'm often unable to figure out what I even did the previous day. Is there any choose of object that I can use to get set compare and manipulate variables via messages? This post is getting lengthy and tangential but I envision something that I can displace a message to like "x = 5" to appoint a value to x or "x = x + 1" or any other math operation or "get x" which would send the value of x through its outlet or "alter" which would clear the symbol delay et c. Does anything like that exist? Are there any other methods commonly used?Any tips are much appreciated. Thank you in advance! Take a look at the determine pv and pvar objects. Value functions similar to a global variable so it might provide a familiar way of working for you. Re: patch readability. I often use a single inlet to a subpatch followed by a despatch disapprove. For your example you could have a [route consume offset volume_begin volume_end tell] then prepend each of your values with the appropriate evaluate label. (This approach was recently mentioned in the oo programming for max thread.. worth checking out.) say this doesn't magically solve the order-of-operation issues but it can make it easier to understand which message does what.

Forex Groups - Tips on Trading

Related article:
http://www.cycling74.com/forums/index.php?t=rview&goto=118690&th=28929#msg_118690

comments | Add comment | Report as Spam


"Re: Advice with maintaining state / data structs" posted by ~Ray
Posted on 2007-12-09 13:39:36

Hello! Newbie to Max here. So I'm implementing a patch that's meant to evaluate a dominate string via a communicate parse the arguments and then send a series of messages to a play~ object. For example the initial message might look something like "capture 100 200 127 255 3" meaning the 'capture' modify~ should be played for 200 ms starting at 100 ms into the modify starting at half volume (127) and ending at full volume (255) and this should loop 3 times. Actually. I've already managed to get that type of thing working but what I'm implementing involves a lot more variables and dynamics. This is comfort the basis however. The point is that I have a lot of looping changing variables math operations and order-important evaluation going on in my current method (which is some byzantine mess of cords) and it's increasingly difficult to understand modify et c. My challenge is: is there a conventional way to maintain express and variables in Max? My accent is in textual programming languages and I can't help but to think in terms of for loops while loops conditionals statements small math operations all of which I have been able to emulate in Max individually but when I go to apply these seemingly simple algorithms. I end up with these giant confusing heap orgies totally inelegant constantly worrying about what is going to get evaluated first and I'm often unable to figure out what I even did the previous day. Is there any sort of object that I can use to get set analyse and act upon variables via messages? This post is getting lengthy and tangential but I envision something that I can displace a message to like "x = 5" to assign a value to x or "x = x + 1" or any other math operation or "get x" which would send the value of x through its outlet or "alter" which would alter the symbol table et c. Does anything desire that exist? Are there any other methods commonly used?Any tips are much appreciated. Thank you in advance! Take a look at the value pv and pvar objects. determine functions similar to a global variable so it might give a familiar way of working for you. Re: patch readability. I often use a single inlet to a subpatch followed by a route object. For your example you could have a [despatch consume offset volume_mouth volume_end tell] then prepend each of your values with the allot attribute label. (This approach was recently mentioned in the oo programming for max go.. worth checking out.) say this doesn't magically understand the order-of-operation issues but it can make it easier to understand which communicate does what.

Forex Groups - Tips on Trading

Related article:
http://www.cycling74.com/forums/index.php?t=rview&goto=118690&th=28929#msg_118690

comments | Add comment | Report as Spam


"Re: Re: Advice with maintaining state / data structs" posted by ~Ray
Posted on 2007-11-27 20:04:07

Hello! Newbie to Max here. So I'm implementing a conjoin that's meant to accept a dominate string via a communicate analyse the arguments and then send a series of messages to a play~ object. For example the initial message might be something like "snare 100 200 127 255 3" meaning the 'snare' buffer~ should be played for 200 ms starting at 100 ms into the buffer starting at half volume (127) and ending at full volume (255) and this should loop 3 times. Actually. I've already managed to get that write of thing working but what I'm implementing involves a lot more variables and dynamics. This is still the basis however. The point is that I undergo a lot of looping changing variables math operations and order-important evaluation going on in my current method (which is some byzantine eat of cords) and it's increasingly difficult to understand modify et c. My question is: is there a conventional way to maintain express and variables in Max? My background is in textual programming languages and I can't help but to evaluate in terms of for loops while loops conditionals statements small math operations all of which I have been able to emulate in Max individually but when I go to implement these seemingly simple algorithms. I end up with these giant confusing heap orgies totally inelegant constantly worrying about what is going to get evaluated first and I'm often unable to figure out what I even did the previous day. Is there any choose of object that I can use to get set compare and manipulate variables via messages? This post is getting lengthy and tangential but I envision something that I can send a message to like "x = 5" to appoint a determine to x or "x = x + 1" or any other math operation or "get x" which would send the value of x through its outlet or "clear" which would clear the symbol table et c. Does anything like that exist? Are there any other methods commonly used?Any tips are much appreciated. Thank you in advance! Take a look at the value pv and pvar objects. Value functions similar to a global variable so it might give a familiar way of working for you. Re: patch readability. I often use a single inlet to a subpatch followed by a route object. For your example you could undergo a [route consume offset volume_begin volume_end tell] then prepend each of your values with the allot evaluate name. (This approach was recently mentioned in the oo programming for max thread.. worth checking out.) Note this doesn't magically understand the order-of-operation issues but it can make it easier to understand which communicate does what.

Forex Groups - Tips on Trading

Related article:
http://www.cycling74.com/forums/index.php?t=rview&goto=118681&th=28929#msg_118681

comments | Add comment | Report as Spam


"Re: Re: Advice with maintaining state / data structs" posted by ~Ray
Posted on 2007-11-17 15:44:48

Hello! Newbie to Max here. So I'm implementing a patch that's meant to accept a command arrange via a message parse the arguments and then displace a series of messages to a play~ object. For example the initial message might look something desire "snare 100 200 127 255 3" meaning the 'capture' buffer~ should be played for 200 ms starting at 100 ms into the modify starting at half volume (127) and ending at full volume (255) and this should circle 3 times. Actually. I've already managed to get that write of thing working but what I'm implementing involves a lot more variables and dynamics. This is still the basis however. The point is that I have a lot of looping changing variables math operations and order-important evaluation going on in my current method (which is some byzantine mess of cords) and it's increasingly difficult to understand modify et c. My question is: is there a conventional way to keep express and variables in Max? My background is in textual programming languages and I can't help but to evaluate in terms of for loops while loops conditionals statements small math operations all of which I have been able to emulate in Max individually but when I go to apply these seemingly simple algorithms. I end up with these giant confusing heap orgies totally inelegant constantly worrying about what is going to get evaluated first and I'm often unable to figure out what I change surface did the previous day. Is there any choose of object that I can use to get set analyse and manipulate variables via messages? This post is getting lengthy and tangential but I envision something that I can displace a communicate to like "x = 5" to appoint a determine to x or "x = x + 1" or any other math operation or "get x" which would displace the determine of x through its outlet or "alter" which would alter the symbol table et c. Does anything desire that exist? Are there any other methods commonly used?Any tips are much appreciated. convey you in go! Take a look at the value pv and pvar objects. Value functions similar to a global variable so it might provide a familiar way of working for you. Re: patch readability. I often use a single inlet to a subpatch followed by a despatch object. For your example you could undergo a [route sample offset volume_begin volume_end repeat] then prepend each of your values with the appropriate attribute name. (This approach was recently mentioned in the oo programming for max thread.. worth checking out.) Note this doesn't magically solve the order-of-operation issues but it can make it easier to understand which communicate does what.

Forex Groups - Tips on Trading

Related article:
http://www.cycling74.com/forums/index.php?t=rview&goto=118675&th=28929#msg_118675

comments | Add comment | Report as Spam


 

 




blogs - aa blogs - air force blogs - aquarius blogs - aries blogs - army blogs - arts blogs - baby blogs - blogs 4 men - blogs 4 women - cancer blogs - capricorn blogs - career change blogs - choice blogs - christmas blogs - cigar blogs - cigarette blogs - cig blogs - coast guard blogs - coffee bean blogs - college baseball blogs - college basketball blogs - college football blogs - colleges blogs - computer blogs - create blogs - dating blogs - elvis blogs - email chat blogs - email pal blogs - enhancement blogs - fall blogs - fha blogs - freedom blogs - friendly blogs - funny blogs - gambler blogs - gemini blogs - her blog - his blog - hockey blogs - join blogs - javas blogs - kid safe blogs - leo blogs - libra blogs - apartments blogs - coffees blogs - horoscopes blogs - life advice blogs - lover blogs - marine blogs - married blogs - military blogs - misc blogs - more money blogs - mortgage blogs - move blogs - movies blogs - musical blogs - navy blogs - new in town blogs - obscure blogs - online date blogs - online game blogs - over 30 blogs - over 40 blogs - over 50 blogs - over 60 blogs - over 70 blogs - over 80 blogs - over 90 blogs - password blogs - pc blogs - mortgages blogs - peoples blogs - pictures blogs - pipe blogs - pisces blogs - poems blogs - poker blogs - police blogs - political blogs radio blogs - read blogs - recreational vehicle blogs - relocation blogs - reserve blogs - rv blogs - safe blogs - scorpio blogs - singles blogs - smokers blogs - smoker blogs - state blogs - state college blogs - taurus blogs - teen advice blogs - teenager blogs - tobacco blogs - tv blogs - vacation blogs - veteran blogs - virgo blogs - virtual blogs - weekly blogs - wingman blogs - word blogs - words blogs - writer blogs - poetry blogs - prescription blogs - sagittarius blogs - straight blogs - summer blogs - gi blogs - hooka blogs - penis enlargement blogs - vfw blogs - casinos blogs - casino blogs - web hosting blogs - hosting blogs - auto blogs - truck blogs - van blogs - suv blogs - 4 wheel blogs - harley blogs - flu blogs - diet blogs - pistols blogs - teenage blogs - lpga blogs - burnable blogs - new tunes blogs - coaching blogs - treasures blogs - trades blogs - nutty blogs - skate blogs - play 21 blogs - weather blogs - poker players - golf blogs - american blogs - football blogs - baseball blogs - hockey blogs - basketball blogs - soccer blogs - cooking blogs - recipe blogs - space blogs - 3d games blogs - barbecue blogs




the structs archives:

11 articles in 2006-01
22 articles in 2006-02
27 articles in 2006-03
36 articles in 2006-04
27 articles in 2006-05
26 articles in 2006-06
24 articles in 2006-07
18 articles in 2006-08
22 articles in 2006-09
30 articles in 2006-10
22 articles in 2006-11
22 articles in 2006-12
12 articles in 2007-01
12 articles in 2007-02
3 articles in 2007-03
7 articles in 2007-04
11 articles in 2007-05
10 articles in 2007-06
3 articles in 2007-07
1 articles in 2007-09




next page


structs