Jump to content

dzhax

Members
  • Content Count

    363
  • Joined

  • Last visited

Everything posted by dzhax

  1. Thanks Ingolme that is working much better. didn't know you can call a function like that. speaking about the handleResponse call.
  2. I have a process that runs every 30 seconds and i want my script to check if it is finished. this way my user doesn't have to wait an arbitrary 30 seconds if the request is submitted closer to the 30 second mark (5 seconds to process instead of the max 30). I tried a while loop and sending $.post within it but from my console logging it doesn't appear to process the while loop as intended var iii = 1; while(iii < 30){ console.log("Checking rcon queue for " + characterID + " (" + iii + ")"); //Code to wait 1 second before continuing. var start = new Date().getTime(); var
  3. Ok bare with me because I have no idea what this is actually called. If someone knows I will update the title. I am working on a site that will act as an out-of-game marketplace for in-game items. I want to ensure that the player is within the zone of the market in-game so I need an easy way to generate an array of valid coordinates the player could be within to access the market. Ideally i would like to run a function with a parameter specifying the radius of a square and another of the player's current geoID. Basic geometry would help if the geoID's were, in my mind, easier to predict.
  4. Ok I got it working. after changing tmpJSON to response. and parsing the JSON outside of the filter var destringify = JSON.parse(staticJSON); $.each(destringify, function(i, v) { rather than $(JSON.parse(staticJSON)).filter(function (i, n){ Not sure why this was a thing but it works and that's all that matters right now.
  5. i am destringifying it tmpJson = $(JSON.parse(staticJSON)).filter(function (i, n){
  6. I think I am getting somewhere but the filter is not actually working var tmp, tmpJSON, response; var staticJSON = JSON.stringify( [{ "id": 35, "commentText": "Hello World.", "createdBy": "Lou", "isImportant": false, "createdAt": "2016-07-29T18:36:39.044Z", "updatedAt": "2016-07-29T18:36:39.044Z" }, { "id": 36, "commentText": "This is all starting to come together", "createdBy": "Mark", "isImportant": false, "createdAt": "2016-07-29T19:13:54.538Z", "updatedAt": "2016-07-29T19:13:54.538Z" }, { "id": 37, "commentText": "I'm pretending to be Lou", "createdBy": "Lou", "isImport
  7. What I want to do is rebuild the jsonSample filtering out the isImportant false. So what is returned is: [ { "id":1, "commentText":"Hello World", "createdBy":"User2", "isImportant":true }, { "id":3, "commentText":"This is another one", "createdBy":"User2", "isImportant":true }, { "id":4, "commentText":"Hello World!", "createdBy":"User2", "isImportant":true } ]
  8. Hello All, I am stuck trying to filter results of a json response. I have a sample json response: [ { "id":0, "commentText":"Test", "createdBy":"User1", "isImportant":false }, { "id":1, "commentText":"Hello World", "createdBy":"User2", "isImportant":true }, { "id":2, "commentText":"Testing", "createdBy":"User2", "isImportant":false }, { "id":3, "commentText":"This is another one", "createdBy":"User2", "isImportant":true }, { "id":4, "commentText":"Hello World!", "createdBy":"User2", "isI
  9. that's what i figured. but the error log begs to differ.
  10. Hello All,I am working on a new project and getting an error that is driving me nuts.Error:PHP Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /../example.php on Line 215Here is my code around that line count. require '../SourceQuery/SourceQuery.class.php'; define('SQ_SERVER_ADDR', 'localhost');define('SQ_SERVER_PORT', 27015);define('SQ_TIMEOUT', 3);define('SQ_ENGINE', SourceQuery :: SOURCE); $ServerQuery = new SourceQuery(); $ServerInfo = Array(); try{ $ServerQuery->Connect(SQ_SER
  11. Update: I have been playing around in chrome with different css on elements I have added .navbar{ min-height:150px;}.navbar-brand{ vertical-align:bottom;}.navbar-brand>img{ display:inline-block;} I am not keen on defining the height of the navbar manually but it works for now. So now the navbar is taller than my image, the title is on the same line, and the title is bottom aligned. I am still unable to get the navbar links to move down. If anyone knows a dynamic way to set the height of the navbar, and if anyone knows how to move the right navbar links to the bottom of the re-
  12. you can also display: inline-block; to make them print on the same line.
  13. dzhax

    Rule @face font

    @font-face{ font-family:"Avenir-n; src: url('fonts/AEBL.ttf');}@font-face{ font-family:"Avenir;src: url('fonts/AEM.ttf');} That should work assuming your font files are not messed up. To be safe with browser compatibility, I normally use a service such as FontSquirrel to convert my fonts. Then I use css like Tezzo's first post and I have never had issues with it.
  14. #wrapper{ position:relative; max-width: 800px; min-width: 400px; margin-left: auto; margin-right: auto;} #top{ positon:absolute; top:0px; left:0px; right:0px; height:100px; background-color: green; line-height: 100px; text-align: center;} #left{ position:absolute; top:100px; left:0px; width: 150px; background-color: red; height: 800px;} #right{ position:absolute; top:100px; left:150px; right:0px; background-color: blue; height: 800px;} This works for me.
  15. Can you post some of the HTML that makes up the form so we can better assist with a CSS Solution?
  16. I am using the Modern Business Theme, I am trying to add an image to the Brand (top left) section of the page. The image is 128px tall. My problem is the navigation bar stays the same height as it is now and the image bleeds into the carousel below. Also the text from the title shows up below the image. I was hoping to have the image and the title on the same line, the title be aligned to the bottom of the nav, and the rest of the navigation links (menus and links on the right) also be bottom aligned. The Following is my Navigation HTML: <!-- Navigation --> <nav class="navbar
  17. took a different approach at this. Letting the database handle the duplicate instead of php. added ON DUPLICATE KEY UPDATE to the INSERT INTO query. thanks for looking into it :Happy:
  18. ok i will give it a shot but it still doesn't explain why the error log is telling me the string is wrong when it was commented out.
  19. for the record line 72 and 73 were originally not commented out and it was still producing the same error log.
  20. OK so i am working on this click to tweet script and I am basically checking the database to make sure it doesn't already exist before inserting it into the database. I am getting the following error_log [29-Jun-2014 18:55:07] PHP Parse error: syntax error, unexpected T_STRING in /.../c2t/tweet.html on line 72 Here is the relative code: <? if(isset($_GET['tweet'])){ $string = urlencode($_GET['tweet']); $crc32 = crc32($string); $con = mysqli_connect("localhost","USER","PASSWORD","DATABASE"); if(!$con){ die('Database Unavailable');
  21. oh i think i got it. I didn't realize it was looking for an array (not sure why i didn't think of that) I added var json = jQuery.parseJSON(data); the changed data.channels to json.channels. now it seems to work.
  22. data is the json that gets returned.
  23. Hello All! It's been a while. Trying to parse a json string and running into some issues. <script type="text/javascript"> $().ready(function(){ var $_GET = {}; document.location.search.replace(/??(?[^=]+)=([^&]*)&?)/g, function () { function decode(s) { return decodeURIComponent(s.split("+").join(" ")); } $_GET[decode(arguments[1])] = decode(arguments[2]); }); //console.log($_GET["t"]); $.get("assets/php/all_channels.php?t="+$_GET["t"],function(data){/* START TROUBLE CODE*/ $.each(data.channels, function(i,object){
  24. dzhax

    Finding the min value

    yes for the sake of an example $perCost = 0.016 $minPurchase = 0.2 Although both of these variable may change. I need to determine how many full units must be purchased in order to meet the minPurchase limit.
×
×
  • Create New...