Search Results

Search found 23 results on 1 pages for 'pedalpete'.

Page 1/1 | 1 

  • setting up synergy (multi-computer shared input devices) new to mac

    - by pedalpete
    I've just gotten a mac and the first thing I'm trying to do in setting it up for dev is to set-up synergy. I've run into countless issues, and am making progress, but that 'mac's just work' theory is getting tired really fast. I'd prefer running the mac as the server, as it's a desktop. why use my pc(laptop) as the server. So i downloaded synergy, and tried to edit the 'synergy.conf' file. First with textmate, then with apple script. Neither of these applications will open the file. Even after changing textmate to use plain text format and switching off a few other things to make it into a plain text editor. No good. Uh, isn't that what these script/text editors are for? Then I found SyneryKM which is a package to run synergy on osx. Took LOTS of fiddling, but I think I finally kinda got it figured out. I've got my pc & mac both running synergy. However, my pc will only connect to synergy using the ip address. No problem, however, my mac won't connect to itself as a synergy server using the IP address. If I use the ip address as a screen in the 'server configuration file', i get a 'Error: unknown screen name mymac'. I know this shouldn't be super complicated, and possibly not the place to find answers about synergy, but I couldn't find a better place, and there has been some talk of synergy here. Any chance somebody can help with this?

    Read the article

  • first time setting up ssl, running into a strange problem, tutorials haven't been too helpful

    - by pedalpete
    This is my first time trying to set-up an ssl for one a site, and I'm running it on a server that has 3 other sites already hosted. I'm running apache2.?? and the install came with an ssl.conf page. The ssl.conf has the following settings LoadModule ssl_module modules/mod_ssl.so Listen 443 AddType application/x-x509-ca-cert .crt AddType application/x-pkcs7-crl .crl <VirtualHost *:443> ServerAdmin [email protected] DocumentRoot /var/www/html/securesite ServerName securesite.com ErrorLog logs/securesite-error_log CustomLog logs/securesite-access_log common SSLEngine on SSLCertificateFile /etc/httpd/ssl.crt/securesite.com.crt SSLCertificateKeyFile /etc/httpd/ssl.key/server.key SSLCertificateChainFile /etc/httpd/ssl.crt/gd_bundle.crt </VirtualHost> When I run 'apachectl configtest', I don't get any errors, but running 'apachectl -k restart', I get 'httpd not running, trying to start'. I have two questions 1) Is there an error in the way I'm defining my virtualhost for 443?? the rest of my entries point to <VirtualHost *:80. When I comment out the above entry, apache runs fine. 2) do I need to set-up a redirect from port 80 for secure site? Because most users are going to go to http: or www. , and I need to send them to https: does apache do this automatically? or do i need to create an entry with a redirect?

    Read the article

  • Apache VirtualHost, multiple sites. 1 ssl with redirect and 1 regular http

    - by pedalpete
    I've got a server with one site which I am redirecting to https via <VirtualHost *:80> DocumentRoot /var/www/html/secure ServerName secure.com Redirect / https://secure.com </VirtualHost> That works no problem. Now I'm trying to add another non-secure site <VirtualHost *:80> DocumentRoot /var/www/html/notsecure ServerName notsecure.com </VirtualHost> of course, because the redirect is on '/', all sites are getting redicted. I've tried changing the Redirect to the full document root, but no luck.

    Read the article

  • mysql - moving to a lower performance server, how small can I go?

    - by pedalpete
    I've been running a site for a few years now which really isn't growing in traffic, and I want to save some money on hosting, but keep it going for the loyal users of the site and api. The database has one a nearly 4 million row table, and on a 4gb dual xeon 5320 server. When I check server stats on this server with ps -aux, i get returns of mysql running at about 11% capacity, so no serious load. The main query against mysql runs in about 0.45 seconds. I popped over to linode.com to see what kind of performance I could get out of one of their tiny boxes, and their 360mb ram XEN vps returns the same query in 20 seconds. Clearly not good enough. I've looked at the mysql variables, and they are both very similar (I've included the show variables output below, if anybody is interested). Is there a good way to decide on what size server is needed based on what I'm coming from? Is it RAM that is likely making the difference with the large table size? Is there a way for me to figure out how much ram would be ideal?? Here's the output of the show variables (though I'm not sure it is important). +---------------------------------+------------------------------------------------------------+ | Variable_name | Value | +---------------------------------+------------------------------------------------------------+ | auto_increment_increment | 1 | | auto_increment_offset | 1 | | automatic_sp_privileges | ON | | back_log | 50 | | basedir | /usr/ | | bdb_cache_size | 8384512 | | bdb_home | /var/lib/mysql/ | | bdb_log_buffer_size | 262144 | | bdb_logdir | | | bdb_max_lock | 10000 | | bdb_shared_data | OFF | | bdb_tmpdir | /tmp/ | | binlog_cache_size | 32768 | | bulk_insert_buffer_size | 8388608 | | character_set_client | latin1 | | character_set_connection | latin1 | | character_set_database | latin1 | | character_set_filesystem | binary | | character_set_results | latin1 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | | collation_connection | latin1_swedish_ci | | collation_database | latin1_swedish_ci | | collation_server | latin1_swedish_ci | | completion_type | 0 | | concurrent_insert | 1 | | connect_timeout | 10 | | datadir | /var/lib/mysql/ | | date_format | %Y-%m-%d | | datetime_format | %Y-%m-%d %H:%i:%s | | default_week_format | 0 | | delay_key_write | ON | | delayed_insert_limit | 100 | | delayed_insert_timeout | 300 | | delayed_queue_size | 1000 | | div_precision_increment | 4 | | keep_files_on_create | OFF | | engine_condition_pushdown | OFF | | expire_logs_days | 0 | | flush | OFF | | flush_time | 0 | | ft_boolean_syntax | + - For some reason, that table formats properly in the preview, but apparently not when viewing the question. Hopefully it isn't needed anyway.

    Read the article

  • user generated / user specific functions

    - by pedalpete
    I'm looking for the most elegant and secure method to do the following. I have a calendar, and groups of users. Users can add events to specific days on the calendar, and specify how long each event lasts for. I've had a few requests from users to add the ability for them to define that events of a specific length include a break, of a certain amount of time, or require that a specific amount of time be left between events. For example, if event is 2 hours, include a 20min break. for each event, require 30 minutes before start of next event. The same group that has asked for an event of 2 hours to include a 20 min break, could also require that an event 3 hours include a 30 minute break. In the end, what the users are trying to get is an elapsed time excluding breaks calculated for them. Currently I provide them a total elapsed time, but they are looking for a running time. However, each of these requests is different for each group. Where one group may want a 30 minute break during a 2 hour event, and another may want only 10 minutes for each 3 hour event. I was kinda thinking I could write the functions into a php file per group, and then include that file and do the calculations via php and then return a calculated total to the user, but something about that doesn't sit right with me. Another option is to output the groups functions to javascript, and have it run client-side, as I'm already returning the duration of the event, but where the user is part of more than one group with different rules, this seems like it could get rather messy. I currently store the start and end time in the database, but no 'durations', and I don't think I should be storing the calculated totals in the db, because if a group decides to change their calculations, I'd need to change it throughout the db. Is there a better way of doing this? I would just store the variables in mysql, but I don't see how I can then say to mysql to calculate based on those variables. I'm REALLY lost here. Any suggestions? I'm hoping somebody has done something similar and can provide some insight into the best direction. If it helps, my table contains eventid, user, group, startDate, startTime, endDate, endTime, type The json for the event which I return to the user is {"eventid":"'.$eventId.'", "user":"'.$userId.'","group":"'.$groupId.'","type":"'.$type.'","startDate":".$startDate.'","startTime":"'.$startTime.'","endDate":"'.$endDate.'","endTime":"'.$endTime.'","durationLength":"'.$duration.'", "durationHrs":"'.$durationHrs.'"} where for example, duration length is 2.5 and duration hours is 2:30.

    Read the article

  • how would you debug this javascript problem?

    - by pedalpete
    I've been travelling and developing for the past few weeks. The site I'm developing was running well. Then, the other day, i connected to a network and the page 'looked' fine, but it turns out the javascript wasn't running. I checked firebug, and there were no errors, as I was suspecting that maybe a script didn't load (I'm using the google api for jQuery and jQuery UI, as well as loading google maps api and fbconnect). I would suspect that if the issue was with one of these pages not loading I would get an error, and yet there was nothing. Thinking maybe i didn't connect properly or something, i reconnected to the network and even restarted my computer, as well as trying to run the local version. I got nothing. The local version not running also hinted to me that it was the loading of an external javascript which caused the problem. I let it pass as something strange with that one network. Unfortunately now I'm 100s of miles away. Today my brother sent me an e-mail that the network he was on at the airport wouldn't load my page. Same issue. Everything is laid out properly, and part of the layout is set in Javascript, so clearly javascript is running. he too got no errors. Of course, he got on his plane, and now he is no longer at the airport. Now the site works on his computer (and i haven't changed anything). How on earth would you go about figuring out what happened in this situation? That is two of maybe 12 or so networks. But I have no idea how i would find a network that doesn't work (and living in a small town, it could be difficult for me to find a network that doesn't work). Any ideas? The site is still in Dev, so I'd rather not post a link just yet (but could in a few days). What I can see not working is the javascript functions which are called on load, and on click. So i do think it is a javascript issue, but no errors. This wouldn't be as HUGE an issue if I could find and sit on one of these networks, but I can't. So what would you do? EDIT ---------------------------------------------------------- the first function(s - their linked) that doesn't get called is below. I've cut the code of at the .ajax call as the call wasn't being made. function getResultsFromForm(){ jQuery('form#filterList input.button').hide(); var searchAddress=jQuery('form#filterList input#searchTxt').val(); if(searchAddress=='' || searchAddress=='<?php echo $searchLocation; ?>'){ mapShow(20, -40, 0, 'areaMap', 2); jQuery('form#filterList input.button').show(); return; } if (GBrowserIsCompatible()) { var geo = new GClientGeocoder(); geo.setBaseCountryCode(cl.address.country); geo.getLocations(searchAddress, function (result) { if(!result.Placemark && searchAddress!='<?php echo $searchLocation; ?>'){ jQuery('span#addressNotFound').text('<?php echo $addressNotFound; ?>').slideDown('slow'); jQuery('form#filterList input.button').show(); } else { jQuery('span#addressNotFound').slideUp('slow').empty(); jQuery('span#headerLocal').text(searchAddress); var date = new Date(); date.setTime(date.getTime() + (8 * 24 * 60 * 60 * 1000)); jQuery.cookie('address', searchAddress, { expires: date}); var accuracy= result.Placemark[0].AddressDetails.Accuracy; var lat = result.Placemark[0].Point.coordinates[1]; var long = result.Placemark[0].Point.coordinates[0]; lat=parseFloat(lat); long=parseFloat(long); var getTab=jQuery('div#tabs div#active').attr('class'); jQuery('div#tabs').show(); loadForecast(lat, long, getTab, 'true', 0); var zoom=zoomLevel(); mapShow(lat, long, accuracy, 'areaMap', zoom ); } }); } } function zoomLevel(){ var zoomarray= new Array(); zoomarray=jQuery('span.viewDist').attr('id'); zoomarray=zoomarray.split("-"); var zoom=zoomarray[1]; if(zoom==''){ zoom=5; } zoom=parseFloat(zoom); return(zoom); } function loadForecast(lat, long, type, loadForecast, page){ jQuery('div#holdForecast').empty(); var date = new Date(); var d = date.getDate(); var day = (d < 10) ? '0' + d : d; var m = date.getMonth() + 1; var month = (m < 10) ? '0' + m : m; var year='2009'; toDate=year+'-'+month+'-'+day; var genre=jQuery('span.genreblock span#updateGenre').html(); var numDays=''; var numResults=''; var range=jQuery('span.viewDist').attr('id'); var dateRange = jQuery('.updateDate').attr('id'); jQuery('div#holdShows ul.showList').html('<li class="show"><div class="showData"><center><img src="../hwImages/loading.gif"/></center></div></li>'); jQuery('div#holdShows ul.'+type+'List').livequery(function(){ jQuery.ajax({ type: "GET", url: "processes/formatShows.php", data: "output=&genre="+genre+"&numResults="+numResults+"&date="+toDate+"&dateRange="+dateRange+"&range="+range+"&lat="+lat+"&long="+long+'&page='+page, success: function(response){ EDIT 2 ----------------------------------------------------------------------------- Please keep in mind that the problem is not that I can't load the site, the site works fine on most connections, but there are times when the site doesn't work, and no errors are thrown, and nothing changes. My brother couldn't run it earlier today while I had no problems, so it was something to do with his location/network. HOWEVER, the page loads, he had a connection, it was his first time visiting the site, so nothing could have been cashed. Same with when I had the issue a few days before. I didn't change anything, and I got to a different network and everything worked fine.

    Read the article

  • jQuery dialog breaking after closing - I'm using dialog destroy

    - by pedalpete
    I've got a few demo videos I've been making as tutorials, and I'm using a link to open a dialog box and put the demo video in that box. I use the same div to show other notes on the page when a user selects to view a complete note. The code I use to show the notes is jQuery('span.Notes').live('click', function(){ var note=jQuery(this).data('note'); jQuery('div#showNote').text(note); jQuery('div#showNote').append(''); jQuery('div#showNote').dialog({ modal: true, close: function(){ jQuery('div#showNote').dialog('destroy').empty(); } }); }); The code I use for the demo videos is VERY similar. jQuery('a.demoVid').click(function(){ var videoUrl=jQuery(this).attr('href'); jQuery('div#showNote').dialog({ modal: true, height: 400, width: 480, close: function(){ jQuery('div#showNote').dialog('destroy').empty(); } }); swfobject.embedSWF(videoUrl,'showNote','480','390','8.0.0'); return false; }); I can click on as many notes as I want, and the dialog opens up and shows the note. However, when I click the demoVid, the dialog opens, but then closing the dialog kills any other 'showNote' dialogs on the page, so I can't open any more notes, or demo videos.

    Read the article

  • remove json attribute where attribute is a variable

    - by pedalpete
    I have a news feed where items in the feed are created from JSON returned from a server. When the user takes an action on an item, I want to remove it from the object via javascript. The feed looks like this: {"newsFeed":[{"feedId":"1", "title":"item1 title", "desc":"description of the item"}, {"feedId":"2", "title":"item2 title", "desc":"description of the item"}]} I'm trying to remove a JSON attribute or entry where the feedId is passed in via a variable using jQuery. I'm not sure exactly where I'm going wrong here, but when I alert the feed before and after the removal of the object, I'm getting the same response: function removeFromFeed(feedId){ var newsFeed=jQuery('div#newsFeed').data('newsFeed'); alert(newsFeed.toSource()); delete newsFeed.feedId[feedId] jQuery('div#newsFeed').data('newsFeed',newsFeed); alert(newsFeed.toSource()); }

    Read the article

  • jQuery inconsistent .remove by class on element with multiple classes

    - by pedalpete
    I've got a page where messages and associated elements (responses, forwards, etc) all share a class based on the database id of the parent. For example this is a message this is another message this is a comment this is another comment tim posted a new message sara forwarded a message to john at times I need to remove all elements with the same id, so I originally had jQuery('div#'+id).remove(); but that would sometimes not remove all the ids because ids are supposed to be unique. So I added the id as a class. now I use jQuery('div.'+id).remove(); but this seems to be about 80% effective, and sometimes the divs aren't being removed. I'm not sure if the issue is because the div has more than one class, but I need the classes because that is how I refer to the elements when somebody clicks. For instance, jQuery('div.message').click(function(){ get the id, send it to the server and get the message }); is there something wrong I'm doing here? or is there a better way to do this?

    Read the article

  • Memcache won't flush or clear memory

    - by pedalpete
    I've been trying to clear my memcache as I'm noticing the storage taking up almost 30% of server memory when using ps -aux. So I ran the following php code. $memcache = new Memcache; $memcache-connect("localhost",11211); $memcache-flush(); print_r($memcache-getStats()); This results in the output of ( [pid] = 4936 [uptime] = 27318915 [time] = 1255318611 [version] = 1.2.2 [pointer_size] = 64 [rusage_user] = 9.659531 [rusage_system] = 49.770433 [curr_items] = 57864 [total_items] = 128246 [bytes] = 1931734247 [curr_connections] = 1 [total_connections] = 128488 [connection_structures] = 17 [cmd_get] = 170288 [cmd_set] = 128246 [get_hits] = 45464 [get_misses] = 124824 [evictions] = 1009 [bytes_read] = 5607431213 [bytes_written] = 1806543589 [limit_maxbytes] = 2147483648 [threads] = 1 ) This should be fairly basic, but clearly, I'm missing something.

    Read the article

  • Merging sql queries to get different results by date

    - by pedalpete
    I am trying to build a 'recent events' feed and can't seem to get either my query correct, or figure out how to possible merge the results from two queries to sort them by date. One table holds games/, and another table holds the actions of these games/. I am trying to get the recent events to show users 1) the actions taken on games that are publicly visible (published) 2) when a new game is created and published. So, my actions table has actionId, gameid, userid, actiontype, lastupdate My games table has gameid, startDate, createdby, published, lastupdate I currently have a query like this (simplified for easy understanding I hope). SELECT actionId, actions.gameid, userid, actiontype, actions.lastupdate FROM actions JOIN ( SELECT games.gameid, startDate, createdby, published, games.lastupdate FROM games WHERE published=1 AND lastupdate>today-2 ) publishedGames on actions.gameid=games.gameid WHERE actions.type IN (0,4,5,6,7) AND actions.lastupdate>games.lastupdate and published=1 OR games.lastupdate>today-2 AND published=1 This query is looking for actions from published games where the action took place after the game was published. That pretty much takes care of the first thing that needs to be shown. However, I also need to get the results of the SELECT games.gameid, startDate, createdby, published, games.lastupdate FROM games WHERE published=1 AND startDate>today-2 so I can include in the actions list, when a new game has been published. When I run the query as I've got it written, I get all the actionids, and their gameids, but I don't get a row which shows the gameid when it was published. I understand that it may be possible that I need to run two seperate queries, and then somehow merge the results afterword with php, but I'm completely lost on where to start with that as well.

    Read the article

  • how to prevent divs from overlapping when using no-wrap across table cells

    - by pedalpete
    I'm trying to create an events calendar which has a somewhat 'gantt' chart like bar representing the times of an event, along with the time listed. I've uploaded a page showing the problem As you can see, the problem is that in the 3rd cell, the event div is being overlapped by the previous event div which goes outside the boundary of the cell. The event from the 2nd cell SHOULD expand beyond the cell border, but what I'm trying to get to happen is that WHEN the event from the 2nd cell expands into the 3rd cell, the event on the 3rd cell starts a new line. I believe the problem exists because of the nowrap on the time, but I want the time and in some cases the bar to cross the cell boundary when the time goes from one day to another. All that works now, but I'm having a problem with events overlapping when an event goes from one day to another. I've tried all sorts of :even cells having a different padding, etc. but all these solutions seem to bring up more problems. Is there a way get the no-wrap to force a new long when it crosses into the next cell? or any other solution to this issue?

    Read the article

  • javascript pausing consistently. How do I find what is causing it to pause?

    - by pedalpete
    I've got a fairly ajax heavy site and I'm trying to tune the performance. I have a function that runs between 20 & 200 times, depending on the user. I'm outputting the time the function takes to execute via console.time in firefox. The function takes about 4-6ms to complete. The strange thing is that on my larger test with 200 or runs through that function, it runs through the first 31, then seems to pause for almost a second before completing the last 170 or so. However, that 'pause' doesn't show up in the console.time logs, and I'm not running any other functions, and the object that gets passed to the function looks the same as all other objects that get passed in. The function is called like this for (var s in thisGroup.events){ showEvent(thisGroup.events[s]) } so, I don't see how or why it would suddenly pause near the beginning. but only pause once and then continue through. The pause ALWAYS happens on the 31st time through the function. I've taken a close look at the 'thisGroup.events[s]' that it is being run through, and it looks like this for #31 "eventId":"5106", "sid":"68", "gid":"29", "uid":"70","type":"event", "startDate":"2010-03-22","startTime":"6:00 PM","endDate":"2010-03-22","endTime":"11:00 PM","durationLength":"5", "durationTime":"5:00", "note":"", "desc":"event" The event immediately after the pause, #32 looks like this "eventId":"5111", "sid":"68", "gid":"29", "uid":"71","type":"event", "startDate":"2010-03-22","startTime":"6:00 PM","endDate":"2010-03-22","endTime":"11:00 PM","durationLength":"5", "durationTime":"5:00", "note":"", "desc":"event" another event that runs through no problem looks like this "eventId":"5113", "sid":"68", "gid":"29", "uid":"72","type":"event", "startDate":"2010-03-22","startTime":"4:30 PM","endDate":"2010-03-22","endTime":"11:00 PM","durationLength":"6.5", "durationTime":"6:30", "note":"", "desc":"event" From the console outputs, it doesn't appear as there is anything hanging or taking up time in the function itself, as the console.time for each event including #31,32 is 4ms. Another strange thing here is that the total time running the for loop across the entire object is coming out as 1014ms which is right for 200 events at 4-6ms each. Any suggestions on how to find this 'pause'? I find it very interesting that it is consistently happening between #31 & #32 only!

    Read the article

  • jQuery .html not writing span on page load, rights the span on ajax response

    - by pedalpete
    I've got a bit of a calendar I'm building with events that go beyond the boundary of one day. I've got a graph which shows how many events are running concurrently. In order to graph out the events which go into another day, I look for hours24, and run an extra bit of code. jQuery('li#hour'+placeGroup+'_'+schedDay2+'_'+thisHour,nextDay).data('count', numStaff).html(''+printHour+''+numEvents+' scheduled').css('height',numEvents*5+'px'); The code is working, the li items are being found, proper height is the css is being applied, data is set, which I've checked by running alert(jQuery('li#hour'+placeGroup+'_'+schedDay2+'_'+thisHour,nextDay).data('count')); right after the pervious bit of code. The only thing that isn't being done is the .html(add span) stuff. I run this code in two places. Once when the page loads, and once when an action is taken which changes the number of events via an ajax response. The li DOM object I'm writting to is created before the script is run, and the height is being applied, but not the span, and only on page load. Any ideas on this one? I'm stumped.

    Read the article

  • should jQuery data be chainable?

    - by pedalpete
    I'm trying to add multiple jQuery data entries to a single element. I suspected that the following would work jQuery('td.person#a'+personId).data('email',thisPerson.email).data('phone',thisPerson.phone); However, I am getting nothing but errors when I do this. jQuery('td.person#a'+personId).data('email',thisPerson.email); jQuery('td.person#a'+personId).data('phone',thisPerson.phone); is there another way to get more than one data entry on an element? Hopefully chained?

    Read the article

  • ajax html vs xml/json responses - perfomance or other reasons

    - by pedalpete
    I've got a fairly ajax heavy site and some 3k html formatted pages are inserted into the DOM from ajax requests. What I have been doing is taking the html responses and just inserting the whole thing using jQuery. My other option is to output in xml (or possibly json) and then parse the document and insert it into the page. I've noticed it seems that most larger site do things the json/xml way. Google Mail returns xml rather than formatted html. Is this due to performance? or is there another reason to use xml/json vs just retrieving html? From a javascript standpoint, it would seem injecting direct html is simplest. In jQuery I just do this jQuery.ajax({ type: "POST", url: "getpage.php", data: requestData, success: function(response){ jQuery('div#putItHear').html(response); } with an xml/json response I would have to do jQuery.ajax({ type: "POST", url: "getpage.php", data: requestData, success: function(xml){ $("message",xml).each(function(id) { message = $("message",xml).get(id); $("#messagewindow").prepend(""+$("author",message).text()+ ": "+$("text",message).text()+ ""); }); } }); clearly not as efficient from a code standpoint, and I can't expect that it is better browser performance, so why do things the second way?

    Read the article

  • Ruby (on Rails) && PHP - two great things that work great together???

    - by pedalpete
    I've done very little work with Ruby, and have an app I've written in PHP. I would like to add some functionality which is available in open sourced Ruby code. I could either try to translate the Ruby to PHP, or try mixing the two. Though I think the mixing part would be somewhat silly. I believe my options are to either mix ruby with php, or translate the ruby code into php. Anybody have any suggestions on this, or other ideas? I am not really interested in converting my entire app into Ruby just so I can get this feature (I saw Derek Sivers post about that which convinced me. http://www.oreillynet.com/ruby/blog/2007/09/7%5Freasons%5Fi%5Fswitched%5Fback%5Fto%5Fp%5F1.html)

    Read the article

  • Check for a unique value within a count, but get all results

    - by pedalpete
    I'm trying to create a single query which, similar to stack overflow, will give me the number of votes, but also make sure that the currently viewing user can't upvote again if they've already upvoted. my query currently looks like SELECT cid, text, COUNT(votes.parentid) FROM comments LEFT JOIN votes ON comments.cid=votes.parentid AND votes.type=3 WHERE comments.type=0 AND comments.parentid='$commentParentid' GROUP BY comments.cid But I'm completely stumpted on how to add the check to see if the userid is in the votes table. The other option is to add a seperate query where SELECT COUNT(*) FROM votes WHERE userid='$userid' AND parentid='$commentParentid' AND type=3 I'm just realizing I'm so lost with this that I don't even really know what tags to provide.

    Read the article

  • Canvas scroll animation not working correctly

    - by pedalpete
    I'm building a gantt chart style timeline using html canvas element. I am currently attempting to add the functionality which allows the user to click a next/prev button to have the gantt chart scroll to display earlier or later times. The way I am doing this is to have a span.adjustTime where the id holds a value in seconds for the time to be adjusted (eg 86400 for one day). I am trying to animate the scrolling so it looks like a scroll, rather than jumping ahead by one day. I have a small problem in my timing calculation, but the script below is not animating, but rather jumping directly to the final time. I do have the draw function running on a separate setInterval which updates every second, so I'm hoping it isn't an issue of conflicting timers on the same function on the same element and data. jQuery('span.adjustTime').click(function() { var adjustBy = parseInt(jQuery(this).attr('id').replace('a', '')); var data = jQuery('img#logo').data(); for(var m = 1; m >= 30; m++) { gantt.startUnixTime = gantt.startUnixTime + (adjustBy * (m * 0.001)); var moveTimer = setTimeout(function() { draw(document.getElementById('gantt'), data, gantt); }, 1000); if (m == 30) { clearTimeout(moveTimer); } } });

    Read the article

  • manipulate variable made up of html before adding it to the dom (new in jQuery 1.4???)

    - by pedalpete
    I thought I had seen this in the first announcement of jQuery 1.4, but can't seem to find anything now. I have a calendar table which is built dynamically from a json ajax response. The table is built in a variable called putHtml. Currently, once the table is added to the DOM, I run a showEvents function which takes each event and adds it to the appropriate cell in the table. Unfortunately, when I have 100 events, that means I am updating the DOM 100 seperate times. Which is getting rather slow. I use the showEvents function to add events dynamically, so it would be really nice if I could just use the same function, and specify to look in the DOM for the cell to add the event to, or look in the variable (assuming I've got it right, and you can actually do this with jQuery). The code I use currenlty is this jQuery('div#calendars').append('putHtml.join('')); for(var e in thisCal.events){ showEvent(thisCal.events[e]); } What I had attempted to do instead was for(var e in thisCal.events){ showEvent(thisCal.events[e],putHtml); } jQuery('div#calendars').append('putHtml.join('')); the showEvents function looks like this function showEvents(event){ var eventDate=event.date; var eventTime=event.time; var eventGroup=event.group; var eventName=event.name; var eventType=event.type; var whereEvent=jQuery('div.a'+eventDate, 'table.'+eventGroup); var putEvent='<div class="event" id="a+'eventDate+'_'+eventTime+'">'+eventName+'</div>' jQuery(whereEvent, 'div#calendar').append(putEvent); if(eventType2){ jQuery(whereEvent, 'div#listings').append(putEvent); } } when attempting to manipulate the variable putHtml before adding to the dom, I was passing putHtml into the showEvent function, so instead of '(whereEvent, 'div#calendar'), I had (whereEvent, putHtml), but that didn't work. of course, the other method to accomplish this would be that when I make each cell, I iterate over the events json, and apply the appropriate html to the cell at the time, but that means repetitively running over the entire json in order to get the event to put in the cell. Is there another/better way to do something like this?

    Read the article

  • Time diff calculations where date and time are in seperate columns

    - by pedalpete
    I've got a query where I'm trying to get the hours in duration (eg 6.5 hours) between two different times. In my database, time and date are held in different fields so I can efficiently query on just a startDate, or endDate as I never query specifically on time. My query looks like this SELECT COUNT(*), IFNULL(SUM(TIMEDIFF(endTime,startTime)),0) FROM events WHERE user=18 Sometimes an event will go overnight, so the difference between times needs to take into account the differences between the dates as well. I've been trying SELECT COUNT(*), IFNULL(SUM(TIMEDIFF(CONCAT(endDate,' ',endTime),CONCAT(startDate,' ',startTime))),0) FROM events WHERE user=18 Unfortunately I only get errors when I do this, and I can't seem to combine the two fields into a single timestamp.

    Read the article

  • client-side data storage and retrieval with html and javascript

    - by pedalpete
    I'm building what I am hoping to be a fairly simple, quick and dirty demo app. So far, I've managed to build a bunch of components using only html and javascript. I know that eventually I'll hook-up a db, but at this point I'm just trying to show off some functionality. In the page, a user can select a bunch of other users (like friends). Then they go to a separate html page and there is some sorting info based on the selected users. So my first attempt was to put the selected users object into a cookie, and retrieve the cookie on the second page. Unfortunately, if the user changed their selection, the cookie wasn't getting updated, and my searches on StackOverflow seemed to say that deleting and updating cookies is unreliable. I tried function updateCookie(updatedUserList){ jQuery.cookie('userList',null); jQuery.cookie('userList',updatedUserList); } but though it set the cookie to null, it wouldn't update it on the second value. So I decided to put the selected users object into a form. Unfortunately, it looks like I can't retrieve the contents from the form on the client-side, only on the server-side. Is there another way to do this? I've worked in PHP and Rails, but I'm trying to do this quickly and simply before building it out into something larger and am trying to avoid any server-side processing for now, which I have managed to do up to this point.

    Read the article

  • Inconsistent Session data from IE - cached sessions???

    - by pedalpete
    I'm trying to prevent some basic click-fraud on my site, and am building links based on session time data. Everything works in FF, but in IE the information I'm storing in the session is somehow being changed. When I load up the main page, I set my session variables like this session_start(); $_SESSION['time']=$time(); I'm out putting the session value into the page, so I get something like 1275512393. When the user clicks on a link, I send an ajax request, and that page is returning the session which I am putting into an alert. session_start(); echo $_SESSION['time']; die(); The alert is returning 1275512422. Only in IE is the $_SESSION['time'] being returned different from the original $_SESSION['time'] It doesn't appear that this is a caching issue, as the times are always VERY near each other, and the second one is always after the first, but I'm not positive.

    Read the article

1