FAQ Database Discussion Community


MySql offset quesy not working

mysql,sql,offset
I have MySql Workbench 6.2CE (hope this helps..) And I'm trying to an offset query like this : SELECT id FROM nameTable OFFSET 10 ROWS; But it give me a syntax error on the 10 : is not a valid input in this position. Anyone knows the problem ?Thank you!...

Undefined offset error in php?

php,android,openstreetmap,offset
Hello everyone! I am trying to parse a JSON/XML from OSM (Overpass Turbo) into php and trying to get the speedlimit value. I am able to get the value, but before that there are some errors "Undefined offset: 1 in C:\xampp\htdocs\android_connect\test-osm.php on line 44", which is this code if ($temp[1]=="maxspeed")...

jQuery to apply css to offset (crop) displayed image

jquery,css,offset
I would like to apply css to offset the image displayed by a % that is set in the element's custom data attribute. HTML: <div class="cover"> <img src="/path_to_some_image.jpg" data-offset_y="15"> <img src="/path_to_some_image.jpg" data-offset_y="18"> <img src="/path_to_some_image.jpg" data-offset_y="24"> <img src="/path_to_some_image.jpg" data-offset_y="7"> </div> jQuery: $(document).ready(function() { $(.cover img).load(function (offset_y) { var cover_w = 850;...

How to get the correct values from this Modbus address?

c#,offset,modbus,addressing,modbus-tcp
I have a MOXA Modbus TCP module (M-4210 in combination with the NA-4010 networking module that also has some other modules attached) that works as a 2-channel analog output, each with voltages from 0 to 10 Volts. In my C# application I need to get the current values of these...

Why have I diffrent timezone offset result in Oracle DB and in Java?

java,oracle,jdbc,timezone,offset
I have the following code to compare timezone offset of 'Asia/Novosibirsk' timezone in Oracle Database 11g (11.2.0.4.0) and in Java: import oracle.jdbc.pool.OracleDataSource; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZoneOffset; import java.time.ZonedDateTime; public class TZTest { public static void main(String[] args) { try {...

java filereader read at offset

java,offset,filereader
How do I use FileReader.read() to read a byte at a specific offset? FileReader fr = new FileReader(path); char[] tmp = null; fr.read(tmp, 11, 1); n = tmp.toString(); n = Integer.parseInt(n,16); This code returns nullpointerexception although the file in 'path' is valid and not empty. What I intend to do...

Hybrid program (asm+cpp): sending and receiving an array pointer

c++,pointers,assembly,offset,hybrid
(Intel x86. Turbo Assembler and BorlandC compilers, Turbo Linker.) My question will be about how to modify my f1.asm (and possibly main1.cpp) code. In main1.cpp I input integer values which I send to function in f1.asm, add them, and send back and display the result in main1.cpp. main1.cpp: #include <iostream.h>...

Undefined offset: 4 [duplicate]

php,arrays,yii,offset
This question already has an answer here: Reference - What does this error mean in PHP? 28 answers I'm new in Yii programming and i found this notice when i try to make a quiz modul. ! Undefined offset: 4 it indicates error in line **if ($data->idjawab == $jawabanku[$x])...

How to get the offset position for each element of class name?

javascript,html,class,position,offset
How can I get the top offset position for each element using classname? I need to return a value for each class named .Me (Can't use jQuery this time) This is how I am trying to do it: var list = document.querySelectorAll('.Me'); for (var i = 0; i < list.length;...

Mysql Paging With multiple ORDER BY

mysql,sql,sql-order-by,offset,sql-limit
I have some issue with mysql pager. Count all rows is 164. pro_type - can be in 3 different integer values; pro - integer value; cr_date - some date. Here is my queries: SELECT id FROM table WHERE f1='1' AND f2='0' AND uid=43 ORDER BY pro_type DESC, pro DESC, cr_date...

Update column “X” if any changes made within A:AE range, but keep the same row

excel,vba,range,offset
I am trying to create a code that would update a date value in column "X" should there be any changes in any cells within A:AE. Update function must only work for the same row. For example, I make a change to A1 and X1 is updated. Many thanks! Private...

Store an integer in a cell and use that to set the number of column gaps

excel,if-statement,excel-formula,offset,worksheet-function
I'm creating a revenue model on a simple spreadsheet. On the top, I have a variable cell (C5) that is the "number of weeks between transactions". Below that, I have a simple weekly revenue model. Problem: What I would like is to be able to tweak the fields in yellow...

How to copy information into a column corresponding to what is found in another column?

excel,vba,excel-vba,offset
I have wrote a macro that I want to copy a path location for a saved email and its attachments into column B, but only for when no .csv file is found. Here is my code below: Dim csv_ap As String Dim path_report As String Sheets("Mail Report").Activate csv_ap = Range("C65000").End(xlUp).Value...

Convert datetime to string always defaults to system time zone offset, Need to get the users timezone offset in the result

c#,timezone,offset,timezoneoffset,format-string
I have a code where the user enters the DateTime and the timezone in which the dates needs to be converted to and the format in which the end date should be. Below is the code. The code converts the DateTime perfectly to the timezone the user has entered but...

C++ Read Memory Address / Pointer & Offset

c++,pointers,memory,offset
So, I have injected a DLL into a process (a game) so that I can read from the process memory. I want to get the current game time, and I've found the static base address & offset of it using Cheat Engine : "game.exe"+0158069C Offset : 14 And this is...

Copy/Paste dynamic range

vba,excel-vba,offset,excel-2013
Starting from Sheet "DATA" range B4:Hx, where x is my last row taking by a row count. I need to copy this range and paste it as values on sheet "bat" starting at A1. Going forward I need to offset columns in 6. So my second copy will be I4:Ox...

ClEnqueueCopyBuffer with offset 1

c,opencl,offset
To optimize a kernel i need to make a copy of a cl_mem object with an offset. count_buffer3[n] = count_buffer[n+1] is the desired result Looking at the specification of ClEnqueueCopyBuffer it seems to be possible with a simple argument. cl_int clEnqueueCopyBuffer ( cl_command_queue command_queue, cl_mem src_buffer, cl_mem dst_buffer, size_t src_offset,...

All rows after first file off by one row

excel,vba,excel-vba,offset
I have a code which prints out one cell of a name in column 1 and 4 and the information corresponding to those names in column 2 and 3 which take up many rows. The first file works well but all of the subsequent ones are printing one row lower...

How to use offset in VKontakte with Python?

python,offset,checkin,vk
I am trying to build a script where I can get the check-ins for a specific location. For some reason when I specify lat, long coords VK never returns any check-ins so I have to fetch location IDs first and then request the check-ins from that list. However I am...

Is there a Byte Offset in FFmpeg for source Files?

c++,command-line,ffmpeg,offset
I am working on an C++ Application (running on Ubuntu) that opens FFmpeg for video conversion and reads the output through popen(). This works fine but now i need FFmpeg to start reading the source File at a specific Byte Offset. Is there any way to archive this? I already...

Subview content being mysteriously offset in Interface Builder?

xcode,interface-builder,uicollectionview,uitextview,offset
I'm experiencing a weird behavior in Interface Builder. I almost feel like it's a glitch, but I'm hoping that I'm just misunderstanding something, or that someone knows what weird AutoLayout behavior I'm experiencing, or something. I'll try to describe it as best I can... I've got a ViewController in Interface...

Find .offset of each element with X class

jquery,variables,offset
I'd like to know how you can get the .offset of multiple elements with variables, the idea would be something like this: var position = $(this).offset().top; $(".number").text(position); And that way, every element with the .number class would display its own particular offset, the problem is that this isn't working, it's...

How do I offset an element based on my mouse position?

jquery,css,svg,jquery-animate,offset
I've got a grid of several <rect> elements inside an SVG. I'm trying to offset the elements based on the position of my mouse. So when my mouse is within a certain range of the element, the element moves away from my mouse. Items closer to the mouse should move...

Calculating multiple elements' position in order to .offset() it

javascript,jquery,css,offset
Where I'm At I've managed to get the location of all of the headshots of politicans in index.html using jQuery's .offset() Where I'm Stuck I'm looking to get each individual image's location on the page (using their class or id) and then change the current top and left values of...

MySQL Select with Offset is Faster Than no Offset

mysql,performance,inner-join,limit,offset
I've been messing around with query performance for a system with pagination to make the data selection as fast as possible, but I've come across something I don't quite understand. To my knowledge, when a limit with an offset is used, MySQL has to iterate through each row before the...

Get position of each element

javascript,jquery,each,offset
$(function(){ var $animatedEls = $(".marked"); $(window).scroll(function(e) { var offset = 0; $.each($animatedEls, function(i, item) { offset = $(item).offset().top; console.log($(item).offset()); }); }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <h2 class="marked">This sucks.</h2> <div>...</div> <h2 class="marked">This sucks.</h2> <div>...</div> <h2 class="marked">This sucks.</h2> <div>...</div>...

jQuery Smooth Scroll to ID on same and on other page: how to set offset?

javascript,jquery,scroll,offset
Im using jQuery on my page to jump / scroll to IDs. This works from other pages with anchors like <a href="other-page.php#jump-id">Jump & Scroll to ID on other page</a> and on the same page only with anchors like <a href="#jump-id">Jump / Scroll to ID on the same page</a> Thats not...

Combining lookup and offset

excel,offset,lookup
I would like to offset the last entry in my data by one week. For example, I just created this example data: day value 1 4 2 3 3 5 4 6 5 1 6 3 7 9 8 5 To find the last entry in the dataset, I use...

C# Find offset of byte pattern, check specific byte, change byte, export part of byte array

c#,arrays,byte,bytearray,offset
This could be long one. I do have a binary file, that contains some information. What I want to do: File (Binary) is read from OpenFileDialog I'm now searching for specific bytes in this file I'm getting offset of that byte, and then I'm checking byte value of offset+2 Basic...

Manage with limit and offset in php

php,limit,offset,musicbrainz
I am currently developing a web application that will find artists and their associates titles. To do this, I decided to parse the API MusicBrainz, through this package (which documentation is here). Suppose I already have the artist mbid (unique identifier for MusicBrainz). The problem is that if I do...

Offset anchor for fixed header, but keep perma link intact

html,css,wordpress,anchor,offset
Added some code to my WordPress to make it add anchor links to all h2 headlines. Furthermore, it is showing a small chain logo in front of each headline, when it is hovered. This is how it looks like: This is my HTML markup: <h2 id="contact"> <a class="anchor" href="#contact"> <i...

How to use OFFSET and Fetch without Order by in SQL Server

sql-server,sql-server-2012,sql-order-by,fetch,offset
I want use OFFSET and Fetch in my SQL server 2012 query.But without any order by.I can not use order by.Because my sort order will be lost. How can I use OFFSET and Fetch without order by and row number and where in my query? My 2 select tables have...

jquery get .offset value of a variable(element) then animate to it

jquery,jquery-animate,offset,var
I have a simple navigation. <nav> <a href="#section1">page 1</a> <a href="#section2">page 2</a> <a href="#section3">page 3</a> </nav> When the user clicks on one of the links, I want the page to animate to the corresponding section on the page. I can't seem to get the .offset().top value from a variable though....

PHP Default Timezone (or Date) with Custom Offset Using date()

php,date,timezone,offset,overrides
In PHP I am using date_default_timezone_set to set the default timezone. Then whenever I use date('m/d/y g:i A') it gives me the correct time for that timezone regardless of location of client. However, I need to be able to set a user-defined default timezone offset when the page loads that...

Looping through an API with offsets

php,loops,offset
I am using an API which is limited to returning 100 items in a single request - they have implemented offsets which should then allow looping through multiple requests but I can't get my head around how to combine the two. At the moment I am using this which returns...

scrollto offset variable determined by window width

jquery,offset,scrollto
A window width (viewport) greater than [>=768] I have a scrollto offset variable of 125px which is my fixed header height...all good. My issue is when the window width is less than [<=767] i.e mobile device, i need the offset variable to be 54px as i have made my fixed...

onscroll event executes only once

javascript,jquery,offset,onscroll
I'm using this code to get offset of an element in the page while scrolling but the scroll function is executed only once and alerts the viewportWidth then it stops at the 'off' variable This is a simple example from the original script it's not just about setting the #menuIcon...

CSS border-image negative offset (without HTML edition)

jquery,image,css3,offset,border-image
We are looking to obtain exactly this type of border for almost all img tags inside the content area of a CMS (wordpress/joomla) site (that's why we are searching for a solution using only CSS, without accesing any parent tag): First step goes smoothly with the code form here: http://border-image.com/...