FAQ Database Discussion Community


Amount of local memory per CUDA thread

memory,cuda,limit,local
I read in NVIDIA documentation (http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#features-and-technical-specifications, table #12) that the amount of local memory per thread is 512 Ko for my GPU (GTX 580, compute capability 2.0). I tried unsuccessfully to check this limit on Linux with CUDA 6.5. Here is the code I used (its only purpose is to...

How can I limit a generic data structure to allow only elements of a specific interface?

java,generics,interface,limit
Say I want to create a generic class for storing objects, but it shall only store objects that implement a specific interface. The interface goes something like this: interface GenericSortedList<E> extends Iterable { void add(E e); E get(String key); } Instances of GenericSortedList shall only be allowed to contain objects...

Max number of open files per process in Linux

linux,pipe,limit,ulimit
I using the command: ulimit -n and i take the number 1024, which is the max number of open files per process in my system. But with the following programm i take the number 510...? What is wrong #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <errno.h> int main(...

How do I limit the amount of letters in a string

python,string,variables,limit
I have a program that asks a the user to input a question, the program then answers it. What I want to know is how do I limit the amount of letters a user can input into a variable.

How to optimize order by and limit?

mysql,optimization,limit
I have a client who wishes for me to make a back-end for his website. He requires a table displaying all files with pagination. CREATE TABLE `content_files` ( `id` varchar(16) NOT NULL, `owner` varchar(16) DEFAULT NULL, `location` varchar(16) NOT NULL, `parent` varchar(16) DEFAULT NULL, `date` int(11) NOT NULL, `filename` varchar(256)...

Getting LIMIT syntax error on MySQL [duplicate]

mysql,sql,oracle,limit
This question already has an answer here: How do I limit the number of rows returned by an Oracle query after ordering? 12 answers I just want to get the first result of this query but whenever I write down LIMIT. Oracle SQL Developer throws me this error *ORA-00933:...

PHP SQL Server Alternative for TOP and LIMIT of MYSQL

php,sql,limit
I'm trying to figure out on how can i translate the codes I've created in php mysql to php sqlsrv. Basically, I used LIMIT in MySQL to limit the pagination. However, this is not supported in SQL Server and I'm really having a hard time like 3 months already to...

Limit the max number of rows in column MySQL

mysql,table,phpmyadmin,limit,rows
I have searched for a while now how to limit the number max number of rows in a table I have made a registration system in phpmyadmin and when I come up to 60 users then no one can register anymore. Hope this information helps, and I hope that you...

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...

Maximum value on JTextField

java,swing,limit,jtextfield
I want to have a JTextField in which you can only type numbers (integers and decimals), and you can only type numbers below 12345 and above 0. How would I do this? What I have right now: JTextField tf = new JTextField(); final PlainDocument doc = new PlainDocument(); doc.setDocumentFilter(new DocumentFilter()...

Wordpress posts_per_page not working

php,wordpress,loops,limit
So, I tried all the "add_filter" things on the whole web to get this right but it doesn't work! It always shows me more than 1 post. What's wrong with my code? Latest WP-Version 4.1.1 and no plugins installed. Here is the code: <?php $sticky = get_option('sticky_posts'); if ( !empty($sticky)...

Is there an equivalent MYSQL “LIMIT” Clause in SQL Server? [duplicate]

sql,sql-server,limit
This question already has an answer here: MySQL LIMIT clause equivalent for SQL SERVER 5 answers My pagination code in MySQL returns the query with a LIMIT (SELECT * FROM tableTest LIMIT $start, $display) to display the current rows. Is there a way to have this logic in SQL...

Limit CPU & Memory for *nix Process

unix,limit,quote
Is it possible to limit CPU & Memory for the *nix Process? The CPU limit may look like "use no more than 10% of one core". The memory limit may look like "use no more than 100Mb", the OS may limit it or kill the process if it try to...

Run a query with a LIMIT/OFFSET and also get the total number of rows

sql,postgresql,count,pagination,limit
For pagination purposes, I need a run a query with the LIMIT and OFFSET clauses. But I also need a count of the number of rows that would be returned by that query without the LIMIT and OFFSET clauses. I want to run: SELECT * FROM table WHERE /* whatever...

How to merge two sql queries into one with variable limit

php,mysql,limit
I have two tables: user_favourites -> id, user_id, product_id product -> id, title, bought I need to display 9 results -> user favourites plus other products if user has less than 9 favourites. So on my page there should be 9 products displayed. If user has selected 9 favourite product...

Mathematica 2D limit computation

wolfram-mathematica,limit,wolframalpha
Wolfram Alpha and Mathematica (on my laptop) give zero for the limit shown in the image below. This is okay if x and y approach the origin along the path y = x. But what happens if x and y approach the origin along the path y = x^3? I...

overcome 32k limit when inserting oracle clob IN parameter using spring StoredProcedure

spring,oracle,stored-procedures,limit,clob
Environment: oracle 11g, spring-jdbc-3.2.2-RELEASE.jar, JDK 1.7, Oracle UCP driver. I have a stored procedure which insert record to a table with CLOB column. The SP has a CLOB input argument among other IN and OUT arguments. My Java code uses Spring StoredProcedure to call the stored procedure: public class MyClass...

Efficient way to get N rows order by complex expression in MySQL

mysql,performance,sorting,sql-order-by,limit
I have a table line_item { id: int, price: decimal, quantity: int, [other:...] }. This table is very huge, approx. 28 million rows. Now I want to get top 1000 rows order by f(price, quantity, [other...]), f is a arbitrary function. What is the best way to do that? I...

Python selection limiter

python,select,filter,boolean,limit
I am working on a project where I must ask the user to make a selection, I must limit their answers between 1-4 and have the program inform them when they have made a unacceptable selection. My issue comes when I try to modify the limiter to not crash when...

Size limit of a script for SQL Server on a Squirrel client

sql,sql-server,sql-server-2008,limit,squirrel-sql
I have a SQL script of 300 000 lines to execute. My only access to the distant SQL Server 2008 DB is on Squirrel on my computer. Of course I can't execute such a big script like that. This SQL script is composed of about 2 500 "Begin End GO"...

PayPal API call daily limit

api,paypal,limit
Does anyone know how many API calls PayPal allow each day? I'm using GetRecurringPaymentsProfileDetails to check if payment has been successfully made and I might be doing the API call a lot of times each day. They have the error code on their docs but didn't specify the rate limit....

Maths Concept: Draw line to follow mouse, with a radius limit

math,line,limit,conceptual,radius
This is not a question specific to one programming language, more of a mathematically conceptual, though just in case, I'm using C++ on Visual Studio. Basically, my current code draws a line, that starts at the centre (of the window), and ends at my mouse position at any time, every...

JTextArea show last X lines

java,line,limit,jtextarea
I want to use jTextArea as log of events for my application. I know I can redirect system.out and system.in but I want to use multiple jTextArea logs for different parts of my code. For example I want to do TCPServer log and display log for it in jTextArea. For...

Limit length of ListField in mongoengine

python,mongodb,limit,mongoengine,listfield
Could I limit the length of a ListField data in mongoengie without if condition? I need something like this: list = db.ListField(IntField(), max_length = 24) in my document. Or I have to check the length of my list when it's going to be update and don't update it if the...

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...

calculating the function limit interatively

matlab,limit,formula
How to calculate the limit of a function interatively in Matlab, by closer to the given limit value? The accuracy of closing is 10^(-7) I suppose that that the taylor formula should be used, but don't know how to apply it there. The function itself is : The limit is...

Limit a set of processes' CPU and memory usage

linux,osx,process,resources,limit
Browsing the web has low priority for me, and so I would like all the processes that deal with it to be low priority, too. Is this approach a valid one? Open a console window with the nice command. Launch the browser from this console. Will the program launched from...

Limit number of characters in input

javascript,html,input,limit,onkeypress
How do I limit the number of characters in my input? In the following code I want max 14 characters. <script language='JavaScript'> function SomenteNumero(e){ var tecla=(window.event)?event.keyCode:e.which; if((tecla>47 && tecla<58)) return true; else{ if (tecla==8 || tecla==0) return true; else return false; } } </script> <input type='text' size='10' value='' onkeypress='return SomenteNumero(event)'>...

C - Find all amicable numbers between limits

c,range,limit
First a definition: An amicable pair of numbers consists of two different integers where the sum of the divisors of the first integer is equal to the second integer, and the sum of the divisors of the second integer is equal to the first integer. A perfect number is a...

How to limit an array size in MongoDB?

arrays,mongodb,limit
is there a way I can limit the number of elements that can be added to a MongoDB Array? I have a Tables collection with an Attendees array that should only contain 10 elements seats). Thank you!...

Limit the amount of times font size can be increased and decreased

javascript,jquery,ruby-on-rails,limit,font-size
In my ruby on rails application I am using the following javascript in the application.js to increase and decrease the text size: function resizeText(multiplier) { var elem = document.getElementById("sizeable"); var currentSize = elem.style.fontSize || 1; elem.style.fontSize = ( parseFloat(currentSize) + (multiplier * 0.2)) + "em"; } And this is called...

How to limit the choice in django

python,django,forms,limit
I want to create a form in which I will add only one country team. I want to create a button "Add team of Russia." It needs a limited form of a check box for one country. models.py RUSSIA = 'RUS' USA = 'USA' GERMANY = 'GER' COUNTRY = (...

using sql LIMIT 1 on specific queries

php,mysql,sql,pdo,limit
I was wondering if is more memory-efficient to include LIMIT 1 on queries when we expect 1 result at all times. So for example I have the following query select * from clients where client_id = x I don't have extensive db management skills but I'm assuming that select...

Check if SELECT statement with LIMIT returned all rows

mysql,select,limit,rows
Is there a way to check if a SELECT statement with a LIMIT returned all possible rows for example i have LIMIT 50 but i have 64 rows it should add false and if i have 28 rows it should add true. I think i can achieve this with php...

MySQL: WHERE IN() limited to one row peer argument

mysql,sql,limit,where-in
I've a MySQL table like this: id | reference_id | name And I wish to get rows WHERE reference_id is IN a certain list of values: SELECT * FROM TABLE WHERE reference_id IN(2,3); The problem is that the table will contain data like: id | reference_id | name 1 |...

PHP-MySQL: Limit data with a specific characters

php,mysql,data,character,limit
I researched the forum but could not find a solution. I have a date in my DB and date format is not like Y-m-d H:i. And the table is not set as date. I need to fetch the date from db but I just need Y-m-d. My date format like:...

What is counting on rate limit of soundcloud?

limit,soundcloud,rate
In my application I have a search list of musics and an embedded player. I need refactor some functions, but I can't understand what is the specific count event. What is counting in rate limit by SoundCloud? Search for list song is measured? Play calls? In SoundCloud doc text we...

randomInt function that can uniformly handle the full range of MIN and MAX_SAFE_INTEGER

javascript,algorithm,random,integer,limit
Requirements and background I want a generic randomInt function that can handle a range of values upto and including Number.MIN_SAFE_INTEGER to Number.MAX_SAFE_INTEGER and that the values returned are uniformly distributed. So, I started at MDN and looked at the Math.random page. They give an example, which appears to be uniformly...

mysql query select limit when insert date column less than 10

mysql,sql,select,limit
I need a MYSQL query to select only latest 10 records order by insertDate, but I can't fix limit 10 because maybe some record have had same date and I want all column data in latest 10 distinct insertDate rows.

Set a limit in the results (no mysql)

php,limit,result
Can I put a limit to show in a list of images extracted from a folder? I should point out that I do not mean with mysql but simple php. Practically from a folder I extract all the images, here, I would like to set a limit. is it possible?...

MYSQL LIMIT on COUNT of DISTINCT row

mysql,subquery,limit
Is there a way to set a LIMIT equal to the COUNT of DISTINCT entries in a row? I have below query and it all work but the LIMIT. My table will have a varying ammount of DISTINCT seriesID and I want the last Episode of the Last Season in...

Update long SQL query with TOP clause

sql,sql-server,limit,clause
I'm not familiar with sql servers. I've very long query which took from other tech guy. I need update this query with top clause for filter first 10 results. I added TOP 10 after first SELECT, but not working as expected. SELECT SalesTranHeader.id, CustID, OrgName, BillNo, TranDate, TranDesc, db =...