Search Results

Search found 5122 results on 205 pages for 'max'.

Page 2/205 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • translate stored procedure - to Linq2SQL (count, max, group, orderby)

    - by Walter
    I've two tables (1:N) CREATE TABLE master (idMaster int identity (1,1) not null, TheName varchar( 100) null, constraint pk_master primary key(idMaster) clustered) and - CREATE TABLE lnk (idSlave int not null, idMaster int not null, constraint pk_lnk_master_slave(idSlave) primary key clustered) link between Master.idMaster and lnk.idMaster I've a SQL query: select max (master.idMaster) as idMaster, master.theName, count (lnk.idSlave) as freq from lnk inner join master ON lnk.idMaster = master.idMaster Group by master.theName order by freq desc, master.theName I need to translate this T-SQL query to a Linq-to-SQL statement, preferably in C#

    Read the article

  • how to create a linq query using join and max

    - by geoff swartz
    I have 2 tables in my linq dbml. One is people with a uniqueid called peopleid and the other is a vertical with a foreign key for peopleid and a uniqueid called id. I need to create a type of linq query that does a left outer join on people and gets the latest record in the vertical table based off the max(id) column. Can anyone suggest what this should look like? Thanks.

    Read the article

  • Using max-width = 100% and max-height = 100% on an image, calculate the display width/height

    - by NatalieMac
    I am creating a slideshow for images of various sizes to display centered vertically and horizontally within a canvas area. In my CSS, I set the width and height of the image to 100% so that each image would proportionally fill the canvas. I want the canvas to auto-size itself to fit within the viewer's screensize as the original size of the images is quite large (up to 800 pixels tall). I am using jQuery 1.4, and using the height of the image to calculate the top value for absolute positioning it to the middle of the canvas. I have tried using jQuery to get the .height(), innerHeight(), and outerHeight(), but it always gets the full size of the image. I extracted the DOM element from the jQuery object and tried using .width, .offsetWidth, and .clientWidth, but that too always seems to return the full size of the image. Firebug displays the correct dimensions, so I know there's some way of calculating the actual display height of the image, I just can't figure out what it is. How do you get the actual display height of an image if you've set max-height = 100%? I didn't want to have to calculate and set the height of each image in the js, but if I have to, I will. It just seems like I should be able to set the canvas size and have the images auto-adjust.

    Read the article

  • MySQL SELECT MAX multiple tables : foreach parent return eldest son's picture

    - by Guillermo
    **Table parent** parentId | name **Table children** childId | parentId | pictureId | age **Table childrenPictures** pictureId | imgUrl no i would like to return all parent names with their eldest son's picture (only return parents that have children, and only consider children that have pictures) so i thought of something like : SELECT c.childId AS childId, p.name AS parentName, cp.imgUrl AS imgUrl, MAX(c.age) AS age FROM parent AS p RIGHT JOIN children AS c ON (p.parentId = c.parentId) RIGHT JOIN childrenPictures AS cp ON (c.pictureId = cp.pictureId)) GROUP BY p.name This query will return each parent's eldest son's age, but the childId will not correspond to the eldest sons id, so the output does not show the right sons picture. Well if anyone has a hint i'd appreciate very much Thank you very much, G

    Read the article

  • max count with joins

    - by trixet
    I have 3 tables: users: Id Login 1 John 2 Bill 3 Jim computers: Id Name 1 Computer1 2 Computer2 3 Computer3 4 Computer4 5 Computer5 sessions: UserId ComputerId Minutes 1 2 47 2 1 32 1 4 15 2 5 5 1 2 7 1 1 40 2 5 31 I would like to display this resulting table: Login Total_sess Total_min Most_freq_computer Sess_on_most_freq Min_on_most_freq John 4 109 Computer2 2 54 Bill 3 68 Computer5 2 36 Jim - - - - - Myself I can only cover first 3 columns with: SELECT Login, COUNT(sessions.UserId), SUM(Minutes) FROM users LEFT JOIN sessions ON users.Id = sessions.UserId GROUP BY users.Id And some kind of other columns with: SELECT main.* FROM (SELECT UserId, ComputerId, COUNT(*) AS cnt ,SUM(Minutes) FROM sessions GROUP BY UserId, ComputerId) AS main INNER JOIN ( SELECT ComputerId, MAX(cnt) AS maxCnt FROM ( SELECT ComputerId, UserId, COUNT(*) AS cnt FROM sessions GROUP BY ComputerId, UserId ) AS Counts GROUP BY ComputerId) AS maxes ON main.ComputerId = maxes.ComputerId AND main.cnt = maxes.maxCnt But I need to get whole resulting table in one query. I feel I'm doing something completely wrong. Need help.

    Read the article

  • Select *, max(date) works in phpMyAdmin but not in my code

    - by kdobrev
    OK, my statement executes well in phpMyAdmin, but not how I expect it in my php page. This is my statement: SELECT egid , group_name , limit , MAX( date ) FROM employee_groups GROUP BY egid ORDER BY egid DESC ; This is may table: CREATE TABLE employee_groups ( egid int(10) unsigned NOT NULL, date date NOT NULL, group_name varchar(50) NOT NULL, limit smallint(5) unsigned NOT NULL, PRIMARY KEY (egid,date) ) ENGINE=MyISAM DEFAULT CHARSET=cp1251; I want to extract the most recent list of groups, e.g. if a group has been changed I want to have only the last change. And I need it as a list (all groups).

    Read the article

  • How to get max row from table

    - by Odette
    HI I have the following code and a massive problem: WITH CALC1 AS ( SELECT OTQUOT, OTIT01 AS ITEMS, ROUND(OQCQ01 * OVRC01,2) AS COST FROM @[email protected] WHERE OTIT01 <> '' UNION ALL SELECT OTQUOT, OTIT02 AS ITEMS, ROUND(OQCQ02 * OVRC02,2) AS COST FROM @[email protected] WHERE OTIT02 <> '' UNION ALL SELECT OTQUOT, OTIT03 AS ITEMS, ROUND(OQCQ03 * OVRC03,2) AS COST FROM @[email protected] WHERE OTIT03 <> '' UNION ALL SELECT OTQUOT, OTIT04 AS ITEMS, ROUND(OQCQ04 * OVRC04,2) AS COST FROM @[email protected] WHERE OTIT04 <> '' UNION ALL SELECT OTQUOT, OTIT05 AS ITEMS, ROUND(OQCQ05 * OVRC05,2) AS COST FROM @[email protected] WHERE OTIT05 <> '' ORDER BY OTQUOT ASC ) SELECT OTQUOT, ITEMS, MAX(COST) FROM CALC1 WHERE OTQUOT = '04886471' GROUP BY OTQUOT, ITEMS result: 04886471 FEPO5050WCGA24 13.21 04886471 GFRK1650SGL 36.21 04886471 FRA7500GA 12.6 04886471 CGIFESHAZ 11.02 04886471 CGIFESHPDPR 11.79 04886471 GFRK1350DBL 68.23 04886471 RET1.63825GP 32.55 04886471 FRSA 0.12 04886471 GFRK1350SGL 55.94 04886471 GFRK1650DBL 71.89 04886471 FEPO6565WCGA24 16.6 04886471 PCAP5050GA 0.28 04886471 FEPO6565NCPAG24 0.000000 How can I get the result of the row with the Itemcode that has the highest value? In this case I need the result: 04886471 GFRK1650DBL 71.89 but i dont know how to change my code to get that - can anybody please help me?

    Read the article

  • Reasons for sticking with TEXT, NTEXT and IMAGE instead of (N)VARCHAR(max) and VARBINARY(max)

    - by John Assymptoth
    TEXT, NTEXT and IMAGE have been deprecated a long time ago and will, eventually, be removed from SQL Server. However, they are not going to be discontinued right away, not even in the next version of SQL Server, so it's not convenient for my enterprise to transform thousands of columns right away, even if it is using SQL Server 2012. What arguments can I use to postpone this migration? I know there are some advantages in using the new types. But I'm strictly looking for reasons not to migrate my data that is already functioning pretty well in the old types.

    Read the article

  • Using recursion to to trim a binary tree based on a given min and max value

    - by Justin
    As the title says, I have to trim a binary tree based on a given min and max value. Each node stores a value, and a left/right node. I may define private helper methods to solve this problem, but otherwise I may not call any other methods of the class nor create any data structures such as arrays, lists, etc. An example would look like this: overallRoot _____[50]____________________ / \ __________[38] _______________[90] / \ / _[14] [42] [54]_____ / \ \ [8] [20] [72] \ / \ [26] [61] [83] trim(52, 65); should return: overallRoot [54] \ [61] My attempted solution has three methods: public void trim(int min, int max) { rootFinder(overallRoot, min, max); } First recursive method finds the new root perfectly. private void rootFinder(IntTreeNode node, int min, int max) { if (node == null) return; if (overallRoot.data < min) { node = overallRoot = node.right; rootFinder(node, min, max); } else if (overallRoot.data > max) { node = overallRoot = node.left; rootFinder(node, min, max); } else cutter(overallRoot, min, max); } This second method should eliminate any further nodes not within the min/max, but it doesn't work as I would hope. private void cutter(IntTreeNode node, int min, int max) { if (node == null) return; if (node.data <= min) { node.left = null; } if (node.data >= max) { node.right = null; } if (node.data < min) { node = node.right; } if (node.data > max) { node = node.left; } cutter(node.left, min, max); cutter(node.right, min, max); } This returns: overallRoot [54]_____ \ [72] / [61] Any help is appreciated. Feel free to ask for further explanation as needed.

    Read the article

  • Max Value of a Multiway Tree in OCaml

    - by Trigork
    I'm an IT Student and kind of a newbie to OCaml Recently, studying for an exam I found this exercise. Given: type 'a tree = Tree of 'a * 'a tree list Define a function mtree : 'a tree -'a, that returns the greatest value of all the nodes in a multiway tree, following the usual order relation in OCaml (<=) I've come to do something like this below, which, of course, is not working. let rec mtree (Tree (r, sub)) = let max_node (Tree(a, l1)) (Tree(b, l2)) = if a >= b then (Tree(a, l1)) else (Tree(b, l2)) in List.fold_left max_node r sub;; After reading an answer to this I'm posting the fixed code. let rec mtree (Tree(r,sub)) = let max_node (Tree(a, l1)) (Tree(b, l2)) = if a >= b then a else b in List.fold_left (max_node) r (List.map mtree sub);; The idea is the same, fold the list comparing the nodes making use of my local function to do so and travel through the tree by calling the function itself over the nodes lists of the consecutive levels. Is still not working, though. Now complains about max_node in the fold_left part. Error: This expression has type 'a tree -> 'a tree -> 'a but an expression was expected of type 'a tree -> 'a tree -> 'a tree And here I'm definitely lost because I can't see why does it expects to return an 'a tree

    Read the article

  • SQL Server Max SmallInt Value

    - by Derek Dieter
    The maximum value for a smallint in SQL Server is: -32768 through 32767 And the byte size is: 2 bytes other maximum values: BigInt: -9223372036854775808 through 9223372036854775807 (8 bytes) Int: -2147483648 through 2147483647 (4 bytes) TinyInt: 0 through 255 (1 byte) Related Posts:»SQL Server Max TinyInt Value»SQL Server Max Int Value»SQL Server Bigint Max Value»Dynamic Numbers Table»Troubleshooting SQL Server Slowness

    Read the article

  • SQL Server Max TinyInt Value

    - by Derek Dieter
    The maximum value for a tinyint in SQL Server is: 0 through 255 And the byte size is: 1 byte other maximum values: BigInt: -9223372036854775808 through 9223372036854775807 (8 bytes) Int: -2147483648 through 2147483647 (4 bytes) SmallInt: -32768 through 32767 (2 bytes) Related Posts:»SQL Server Max SmallInt Value»SQL Server Max Int Value»SQL Server Bigint Max Value»Create Date Table»Dynamic Numbers Table

    Read the article

  • Creating models in 3ds max and exporting as .x for XNA

    - by Sweta Dwivedi
    I have created a few models in 3DS max which contains textures, geometry and animations . .however .fbx doesnt really support textures.. So im planning to use .x format.. I have seen a few converters in pandasoft but once i unzip the file and place the .dle file in the plugins folder of 3D max gives an error saying failed to initialize.. Is there any way to convert my .max models into .x format ? ? I dont know blender so that isnt an option. . I'm currently using 3ds max 2013 After adding the .3DS object content importer. . i get the following error:

    Read the article

  • 3DS Max 2012 OBJ file import missing polygons

    - by Vit
    I started learning OpenGL. I got to a point I want to import some "real" objects. After "Googling" I decided I will go with OBJ file for start, since it is simple to understand, and there are plenty of tutorials on how to read them properly. I have from university access to 3DS Max 2012. So I tried to create very simple model (just deformated cube) and exporting it using OBJ file, just to vertices and triangles for the moment, without textures, so I can examine its structure by myself. But if I imported it right back to 3DS from OBJ file, now it renders somewhat strange, like its smoothen, and with lightsource, even I have none in scene. But the geometry, its wireframe is intact. So I thought maybe it is problem of exporting only vertices and triangles so I downloaded Enterprise-D model from internet, exported with everything on (normals, textures everything), and again imported it. Now, some polygons are missing. So, I want to ask, am I doing something terribly wrong, or is there some incompatibility issue between .max and .obj file ? Even it is only simple textured model without any lightsources, animation etc.? Thanks. Edit: I tried objects with MeshLab, the first, deformated cube was absolutelly OK. But still bothers me that 3DS Max doesen´t render it properly. In Enterprise-D model, there are polygons missing even in MeshLab. I uploaded rar archive with .max model of Enterprise, same .obj model exported from 3DS, and obj model of deformated cube. Download here (2.5 MB, filesonic).

    Read the article

  • The dreaded Brightness issue (Fn keys + Max brightness)

    - by Adam
    I'm trying to get some control over the brightness of my Samsung QX411 (Integrated Intel and discrete Nvidia, though Ubuntu doesn't see the latter yet, I'll play around with Bumblebee later) Using the FN+up/down lowers the screen brightness from max to one peg down or back up. If I try to bring the brightness down any more, it just flickers and stays the same. I can lower the brightness in Settings, but that's delicate and gets reverted to max if I open up the brightness settings again, or log out. The closest I got was adding acpi_backlight=vendor to a line in /etc/default/grub, (source) I could consequently lower the brightness a couple of pegs down to the minimum with FN+down, but then it's as if the problem got inversed, and I'd get stuck in the bottom tier, I could only increase the brightness by one peg and back down. Rebooting would revert to max brightness. acpi_osi=, acpi_osi=Linux, acpi_osi=vendor, acpi_osi='!Windows 2012', acpi_backlight=Linux, acpi_backlight='!Windows 2012' don't do anything for me. I've also tried adding echo 2000 > /sys/class/backlight/intel_backlight/brightness to /etc/rc.local, where my max value from cat /sys/class/backlight/intel_backlight/brightness is 4648, which didn't do anything. (same result with echo 2000 > /sys/class/backlight/acpi_video0/brightness) source Samsung tools also didn't help in this regard. I've spent hours on this, it's getting quite frustrating. Any help would be greatly appreciated.

    Read the article

  • Why do Firefox and Opera ignore max-width inside of display: table-cell?

    - by brad
    The following code displays correctly in Chrome or IE (the image is 200px wide). In Firefox and Opera the max-width style is ignored completely. Why does this happen and is there a good work around? Also, which way is most standards compliant? Note One possible work around for this particular situation is to set max-width to 200px. However, this is a rather contrived example. I'm looking for a strategy for a variable width container. <!doctype html> <html> <head> <style> div { display: table-cell; padding: 15px; width: 200px; } div img { max-width: 100%; } </style> </head> <body> <div> <img src="http://farm4.static.flickr.com/3352/4644534211_b9c887b979.jpg" /> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec facilisis ante, facilisis posuere ligula feugiat ut. Fusce hendrerit vehicula congue. at ligula dolor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. leo metus, aliquam eget convallis eget, molestie at massa. </p> </div> </body> </html> [Update] As stated by mVChr below, the w3.org spec states that max-width does not apply to inline elements. I've tried using div img { max-width: 100%; display: block; }, but it does not seem to correct the issue.

    Read the article

  • FBX 3ds max export, bad vertices

    - by instancedName
    I need to import model in OpenGL via Fbx SdK, and for testing purposes I created a simple box centered in the (0, 0, 0), length 3, in 3ds max. Here's the image: But when i exported it, and imported in the OpenGL it wasn't in the center. Then I exported it in ASCII format, and opened the file in Notepad, and really Z coordinates were 0, and 3. When I converted model to editable mesh and checked every vertex in 3ds max it had expected (+-1.5, +-1.5, +-1.5) coordinates. Can anyone help me with this one? I'm really stuck. I tried to change whole bunch of parameters in 3ds max export, but every time it changes Z koordinate.

    Read the article

  • Making XNA Play Nice With 3DS Max, Boundiing Spheres

    - by Jason R. Mick
    I'm using 3DS Max 2010 with the KW x-porter plugin, which outputs a .X file (just downloaded the very latest version). Been getting some odd results: http://www.picvalley.net/u/2930/2265240220441812321333990933PAStFeSONWQslOrMQC5q.PNG Looks like the culling is screwed up. Note, that models I make in Milkshape don't seem to be having these problems. I've also tried to export an FBX file from 3DS Max 2010 and have been getting similar results. What are your suggestions in terms of exporting *.3DS models to a workable XNA form? What tools do you use?. To be clear, the model in question has none of these defects when viewed from similar angles in 3DS Max 2010. http://www.picvalley.net/u/2563/151728957814855401111333991302mSvEJ03Zv22GwHFgIhiV.PNG Any ideas on this oddity would also be appreciated! Edit 1 -- Add'l issue Forgot to mention, that the model otherwise seems alright, but that rotation seems to double -- in other words, when I scroll my camera view left to right, the model (whose draw I give the camera for the view and perspective matrices w/ BasicEffect seems to rotate twice as much as models I draw natively in XNA

    Read the article

  • Why are my 3ds Max .fbx exports huge?

    - by abracadabra1980
    I've made an animation in 3ds Max and want to export it to .fbx and import it into Unity. I've done this once without problems. But this time, my .max file is 2,8MB and my .fbx file came out a huge 630MB! There's nothing wrong with my model: I exported it from a Blender model (to .fbx) and imported it to 3ds max (converted it to an editable poly) to do my rigging and animation. As soon as I import some .bip animations, I get these huge files. Is there a safe way to get smaller file sizes? I don't mind redoing the rigging if I can solve this.

    Read the article

  • Coordinates from 3DS Max to XNA 3.5

    - by David Conde
    Hello My problem is this. I have a simple box made in 3DS Max 2009, the Box is 10x10x10. I've tried to load it on XNA and traslate the camera for 15 units, but I can seem to find the values needed to see the box properly. Can anyone point me to a good resource where I can find some good introduction to XNA coordinate system and how is a simple box made in 3DS Max imported properly Best regards, David

    Read the article

  • VFS: file-max limit 1231582 reached

    - by Rick Koshi
    I'm running a Linux 2.6.36 kernel, and I'm seeing some random errors. Things like ls: error while loading shared libraries: libpthread.so.0: cannot open shared object file: Error 23 Yes, my system can't consistently run an 'ls' command. :( I note several errors in my dmesg output: # dmesg | tail [2808967.543203] EXT4-fs (sda3): re-mounted. Opts: (null) [2837776.220605] xv[14450] general protection ip:7f20c20c6ac6 sp:7fff3641b368 error:0 in libpng14.so.14.4.0[7f20c20a9000+29000] [4931344.685302] EXT4-fs (md16): re-mounted. Opts: (null) [4982666.631444] VFS: file-max limit 1231582 reached [4982666.764240] VFS: file-max limit 1231582 reached [4982767.360574] VFS: file-max limit 1231582 reached [4982901.904628] VFS: file-max limit 1231582 reached [4982964.930556] VFS: file-max limit 1231582 reached [4982966.352170] VFS: file-max limit 1231582 reached [4982966.649195] top[31095]: segfault at 14 ip 00007fd6ace42700 sp 00007fff20746530 error 6 in libproc-3.2.8.so[7fd6ace3b000+e000] Obviously, the file-max errors look suspicious, being clustered together and recent. # cat /proc/sys/fs/file-max 1231582 # cat /proc/sys/fs/file-nr 1231712 0 1231582 That also looks a bit odd to me, but the thing is, there's no way I have 1.2 million files open on this system. I'm the only one using it, and it's not visible to anyone outside the local network. # lsof | wc 16046 148253 1882901 # ps -ef | wc 574 6104 44260 I saw some documentation saying: file-max & file-nr: The kernel allocates file handles dynamically, but as yet it doesn't free them again. The value in file-max denotes the maximum number of file- handles that the Linux kernel will allocate. When you get lots of error messages about running out of file handles, you might want to increase this limit. Historically, the three values in file-nr denoted the number of allocated file handles, the number of allocated but unused file handles, and the maximum number of file handles. Linux 2.6 always reports 0 as the number of free file handles -- this is not an error, it just means that the number of allocated file handles exactly matches the number of used file handles. Attempts to allocate more file descriptors than file-max are reported with printk, look for "VFS: file-max limit reached". My first reading of this is that the kernel basically has a built-in file descriptor leak, but I find that very hard to believe. It would imply that any system in active use needs to be rebooted every so often to free up the file descriptors. As I said, I can't believe this would be true, since it's normal to me to have Linux systems stay up for months (even years) at a time. On the other hand, I also can't believe that my nearly-idle system is holding over a million files open. Does anyone have any ideas, either for fixes or further diagnosis? I could, of course, just reboot the system, but I don't want this to be a recurring problem every few weeks. As a stopgap measure, I've quit Firefox, which was accounting for almost 2000 lines of lsof output (!) even though I only had one window open, and now I can run 'ls' again, but I doubt that will fix the problem for long. (edit: Oops, spoke too soon. By the time I finished typing out this question, the symptom was/is back) Thanks in advance for any help. And another update: My system was basically unusable, so I decided I had no option but to reboot. But before I did, I carefully quit one process at a time, checking /proc/sys/fs/file-nr after each termination. I found that, predictably, the number of open files gradually went down as I closed things down. Unfortunately, it wasn't a large effect. Yes, I was able to clear up 5000-10000 open files, but there were still over 1.2 million left. I shut down just about everything. All interactive shells, except for the one ssh I left open to finish closing down, httpd, even nfs service. Basically everything in the process table that wasn't a kernel process, and there were still an appalling number of files apparently left open. After the reboot, I found that /proc/sys/fs/file-nr showed about 2000 files open, which is much more reasonable. Starting up 2 Xvnc sessions as usual, along with the dozen or so monitoring windows I like to keep open, brought the total up to about 4000 files. I can see nothing wrong with that, of course, but I've obviously failed to identify the root cause. I'm still looking for ideas, since I definitely expect it to happen again. And another update, the next day: I watched the system carefully, and discovered that /proc/sys/fs/file-nr showed a growth of about 900 open files per hour. I shut down the system's only NFS client for the night, and the growth stopped. Mind you, it didn't free up the resources, but it did at least stop consuming more. Is this a known bug with NFS? I'll be bringing the NFS client back online today, and I'll narrow it down further. If anyone is familiar with this behavior, feel free to jump in with "Yeah, NFS4 has this problem, go back to NFS3" or something like that.

    Read the article

  • Exporting 3DS Max animated biped character into Assimp

    - by Doug Kavendek
    I've been having some trouble with MD5 meshes exported from 3DS Max into my C++ program, using Assimp to import the model and its skeletal animation. If the models were rigged manually with bones, the export and animations work perfectly, but if they were rigged as a biped character, the animation hits a "deadly import error" and all the bones appear to get smooshed together into a big pile. This seems like it might just be a limitation of the MD5 exporter (we're currently using the one found here. Our plan is to try out a different MD5 exporter (this one), and if that still has problems, then try switching from MD5 to COLLADA. Our modeler won't be able to make time to try out these other exporters for a few days, so in the meantime I wanted to see if there were any better methods out there for getting biped rigged models from 3DS Max into our app via Assimp. Out of Assimp's supported formats, I need to figure out which will support the following: Skeletal animations Exportable from 3DS Max biped rigged models Failing that, an alternative would be a way to convert a biped character to its corresponding bones before exporting. We did find one script to do that, but it only seems meant as a starting point for modeling -- it doesn't carry over any hierarchy, skinning, or animation -- so it can't be used solely during export.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >