Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by shadowayex

  1. In the normal scheme of things, if a parent UL and a nested UL would overlap, the nested one would be rendered on top of the parent one (or so I've gathered from testing and readings). I want the opposite effect; I would like parent ULs to render over child ULs in a project I've begun recently. I tried setting z-indices on all of the ULs and LIs in the structure, setting the largest z-index on the root UL and working down to the last LI in the structure, but that did not seem to affect what order the ULs were rendered on one another (although the LIs now behave as desired; the first on top, the second under the first, etc.). Is there any way to break out of the nested UL being rendered on top norm and get parent ULs to be rendered on top of their children ULs?
  2. $indexloaded = 1;That's the second line. There's no % in it.
  3. Alright, the oldest machine I own is an XP machine from 2005 with a Pentium D in it. Is that old enough?
  4. And, lets say the user had some sort of fit where he or she added like 500 things, removed the first 490 of them, then added 500 more. The array length would be 1000, but the first 490 would be empty. My system already ignores this, but is that bad on resources or anything? Should I place logic to, instead of push()-ing, check for the first null item and add at the index instead? Or would the overhead for searching for an empty one (in the case that the user only added and never removed for 500 items) counter balance any resource issues?I don't really know how JavaScript arrays work in memory and such.
  5. Well, when it's all said and done, the array is sent to the server in a JSON format and all of the items sent are removed, then the user starts over.Does splice change indices? Because if so, then this wouldn't work, as I need the indices for items in the array to remain constant, so my remove function can remove them at any time.I just tried this, and I don't seem to be getting good results. I'll have to play with it more to ensure I've got my code set up properly, though.
  6. If that's all you have and you have an infinite loop, then I would think that the issue is in the C++.By the way, I'm pretty sure that system function will wait until the C++ program exits before it returns output. So if your program take any input, or is any form of interactive, you're probably out of luck with this approach.
  7. I've made a sort of structure that works something like this:I have an array (arr) that is instantiated.I have two functions, one that adds things to arr based on user input, and one that removes things from arr, again based on user input.The first one returns the index, which is then stored to be used in the remove function, if the user so chooses to remove said item.As of right now, the adding function just tacks the new item on at the index arr.length, and the remove function sets whatever index is being passed to null. This can be done many, many times before the page is reloaded, so arr.length could get very large, although most of the indices could be null.I was considering modifying the add function to cycle through and look for the first null index and put the new item there, that way the arr.length ends up slightly reflecting the amount of items added (or at least the max at one time), rather than the number added ever.I was wondering what performance issues keeping my current design could have, as compared to my new design idea. Which one would be better? In there a better design all around that I have not thought of?I hope this is all clear. I'm open to any and all input.
  8. I'm not saying the code is unimportant, I'm just saying that we don't need reminded of it's size.Again, sorry for being nit picky, I just wanted to explain to him that he doesn't need to keep saying it. We, being the attentive crew we are, read it the first time =P Hopefully that clears it up.Anyway, I understand that the rest of the code could impact this line, that's why I'm pressing for some context.
  9. We'll just need the first bit. Copy and paste it straight in if you can.By the way, the size of the script doesn't matter. I can make one page into 8 if I changed things like this: $one = 4;$two = 6;$sum = $one + $two into /* * A class designed to add two numbers */class Adder{ /* * The two numbers that get added */ private $one; private $two; /* * Instantiate an Adder with two numbers to be added */ public function __construct($one, $two) { $this->one = $one; $this->two = $two; } /** * Returns the sum of the two numbers */ public function getSum() { return $this->one + $this->two; }}$adder = new Adder(4, 6);$sum = $adder->getSum(); That particular example may seem redundant, but the point is that more code doesn't necessarily mean anything. You seem to be constantly reminding us that it is 8 pages, but we're not going to pay any attention to that, because it's doesn't make it impressive, nor does it even pertain to your question.Sorry if I seem nit picky, it just bugs me when people point out a simple detail over and over while others have not brought any attention to it, hinting that it doesn't really matter.
  10. Setting a cookie that expires after a certain time limit and refreshing it every time the user loads a page from your site before the cookie expires would work, too.
  11. I, for one, feel that using social media as a portal for a project is a bad idea. Social media is getting rather large, and it's purpose is very broad. If your site is geared towards a certain task, hooking it up to a social media log in really just makes it so anyone with an account on said system can log in. That includes bots. Furthermore, Facebook, for example, has been known for apps hi-jacking and posting wall updates and even IMing people's friends and family via their accounts. Tying your site to a system who hasn't been able to readily secure itself from attacks like that (I know, it's tough to prevent when you allow third parties to post programs on your site) doesn't seem like a good idea to me.I (obviously) have qualms with the structure of social media in general. Serious damage can be done (such as this new "Facebook bullying" depression thing that is now being recognized medically) and everyone just throws the blame at everyone else. No one can effectively be held accountable, because of the vast amounts of participants and opinions over who should be responsible for stopping these problems. I, myself, would not want to tie my site very closely with any of that.
  12. I agree one of the two is not right. I'm hoping that by getting a wider scope, we'll be able to see a more accurate representation of the code. My theory is that he just typed it straight in here himself, and I'd rather see him copy and paste a set of lines, so we'll see it all in it's actual form.
  13. You could give all of those images a certain class and do something like $("img.theClass").click(function() { update($("span#value"), $(this).attr("id")); }); Disclaimer: I just whipped that up. Hopefully is gets the point across, but I don't know if it'll actually work for your case.
  14. If may be helpful for you to give us the first 5 lines or something, so we can see that code in context. Give us everything exactly as it is for the first 5 lines or so.
  15. Next time, wrap your code in [ code ][ /code ] (without the spaces).Anyway, you don't need the first <html> before the DOCtype, and i don't know what the purpose of the ob_start() is, but I'm unsure if it's necessary.You don't need to comment inside of style tags, that's only script tags (AFAIK).The IE conditional should of the style tag (again AFAIK).Finally, take your code to the W3C validator. It'll give you problem areas that you can either fix yourself, or come back to us with more specific places to look.
  16. Alright, so I'm using Drupal 7 with the Date, CTools, and View modules. I've created a content type that has content is to be shown between two date-times. The content type has two date-time fields and I have some testing nodes created.I've created a simple display for this, and in filter criteria, I've specified (using Date: Date) that the first date-time has to be less than or equal to now, and the second date-time has to be greater than or equal to now. This display is embedded onto other nodes via views_embed_view().The problem I'm running in to is that the constraints seem to only work up until the day. For example, let's say that on a node of my content type the first date is May 3rd, 2011 at 1:00 PM and the second is May 4th, 2011 at 8:30 AM. That node would actually be shown all day on the 3rd and 4th (starting from midnight on the third up until 11:59:59 on the fourth). It completely ignores time altogether.Does anyone know how to get it to acknowledge time when filtering date-times?
  17. I've not found a real solution to this issue, but it seems to not happen when using jQuery 1.5.2. So the dodgy solution is to just not use jQuery 1.5.
  18. I have this HTML: <div class="one"> <div class="box"><p>I am a box</p></div> <div class="box"><p>I am a box</p></div> <div class="box"><p>I am a box</p></div> <div class="box"><p>I am a box</p></div> <div class="box"><p>I am a box</p></div> <div class="box"><p>I am a box</p></div> </div> <div class="two"></div> This CSS: div.one { border: 1px solid black; float: right; min-height: 200px; width: 45%; } div.two { border: 1px solid black; float: left; min-height: 200px; width: 45%; } div.box { border: 1px solid black; float: left; height: 40px; margin: 5px; padding: 5px; width: 40px; } And this Javascript/jQuery: $(document).ready(function() { $("div.box").draggable({ appendTo: "body", helper: "clone", revert: "invalid" }); } ); When I drag a .box, the above code will always revert it, as there's no valid placement yet. When the box is reverted, however, the ui-draggable class is removed, and the box can no longer be dragged. I'm using jQuery 1.5 and jQuery UI 1.8.4, but I tried it with the Google API's jQueryUI 1.8.12 and got the same issue.Is there something I've done wrong?
  19. What do you mean by "it"? Does the compressed file contain all of that, or the file name, or what?
  20. Can you post the var_dump of $json in a case where the error would appear?Dump it before your loop.
  21. Well, the code I have looks something like so:$('#anchorToggle').toggle( function() { // Function one }, function() { // Function two }); I suppose I could scrap the toggle function altogether and write my own, something like: function one(anchor){ if (condition) { // Do something anchor.bind('click', function() { two(anchor); }); }}function two(args){ if (condition) { // Do something else anchor.bind('click', function() { one(anchor); }); }} And bind one on to begin with. I was just hoping I could use in the built in functionality, as to not reinvent the wheel and such.Thanks.
  22. This may not be quite possible, but here's what I want.I have a super class that has a static property it. I want to set a different value for that property in each sub class I make, but I want he super class to still be able to use it.Example: class Foo{ protected static a; public static getA() { return self::a; }}class BarOne extends Foo{ // Set a to "One" in here somewhere}class BarTwo extends Foo{ // Set a to "Two" in here somewhere}BarOne::getA(); // Should return "One"BarTwo::getA(); // Should return "Two" I hope that explains it well enough. If not, let me know.Is that possible?
  23. This may be hard to explain, but I'll do my best.I have two functions that are bound to an anchor via the jQuery toggle function. I want to make it so if a certain condition is true and the link is clicked, the toggle does not happen. That is, the function that would have been called is not, but will still be up to be called when the link is clicked while said condition is false.I hope that makes sense and that there is a way to obtain this functionality.
  • Create New...