Daily Archives

Articles indexed Saturday January 8 2011

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

  • Le marché français des logiciels sort la tête de l'eau, mais reste encore trop en retrait au niveau mondial

    Le marché français des logiciels sort la tête de l'eau, mais reste encore trop en retrait au niveau mondial Mise à jour du 08.01.2011 par Katleen Une enquête conduite par Global Software Leaders vient de révéler des données intéressantes sur le marché français du logiciel qui montrent que la pire de la crise est passé. Ce qui caractérise ce secteur, c'est que ses 10 entreprises les plus importantes totalisent 60% des revenus totaux. Rien que le leader, Dassault Systèmes, représente 31% des revenus annuels du logiciel français. Mais les inégalités font rage, ainsi 59% des éditeurs de notre pays représentant 15 millions d'euros (revenus annuels) des rentrées d'argent totales des éditeurs français.

    Read the article

  • SQL SERVER – Get File Statistics Using fn_virtualfilestats

    - by pinaldave
    Quite often when I am staring at my SSMS I wonder what is going on under the hood in my SQL Server. I often want to know which database is very busy and which database is bit slow because of IO issue. Sometime, I think at the file level as well. I want to know which MDF or NDF is busiest and doing most of the work. Following query gets the same results very quickly. SELECT DB_NAME(vfs.DbId) DatabaseName, mf.name, mf.physical_name, vfs.BytesRead, vfs.BytesWritten, vfs.IoStallMS, vfs.IoStallReadMS, vfs.IoStallWriteMS, vfs.NumberReads, vfs.NumberWrites, (Size*8)/1024 Size_MB FROM ::fn_virtualfilestats(NULL,NULL) vfs INNER JOIN sys.master_files mf ON mf.database_id = vfs.DbId AND mf.FILE_ID = vfs.FileId GO When you run above query you will get many valuable information like what is the size of the file as well how many times the reads and writes are done for each file. It also displays the read/write data in bytes. Due to IO if there has been any stall (delay) in read or write, you can know that as well. I keep this handy but have not shared on blog earlier. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, PostADay, SQL, SQL Authority, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, SQL View, T SQL, Technology Tagged: Statistics

    Read the article

  • Recruiters intentionally present one good candidate for an available job

    - by Jeff O
    Maybe they do it without realizing. The recruiter's goal is to fill the job as soon as possible. I even think they feel it is in their best interest that the candidate be qualified, so I'm not trying to knock recruiters. Aren't they better off presenting 3 candidates, but one clearly stands out? The last thing they want from their client is a need to extend the interview process because they can't decide. If the client doesn't like any of them, you just bring on your next good candidate. This way they hedge their bet a little. Any experience, insight or ever heard of a head-hunter admit this? Does it make sense? There has to be a reason why the choose such unqualified people. I've seen jobs posted that clearly state they want someone with a CS degree and the recruiter doesn't take it literally. I don't have a CS degree or Java experience and still they think I'm a possible fit.

    Read the article

  • What threading pratice is good 90% of the time?

    - by acidzombie24
    Since my SO thread was closed i guess i can ask it here. What practice or practices are good 90% of the time when working with threading with multiple cores? Personally all i have done was share immutable classes and pass (copy) data to a queue to the destine thread. Note: This is for research and when i say 90% of the time i dont mean it is allowed to fail 10% of the time (thats ridiculous!) i mean 90% it is a good solution while the other 10% it is not so desirable due to implementation or efficiently reasons (or plainly another technique fits the problem domain a lot better).

    Read the article

  • Can't get Wireless RT2x00usb driver to work, and can't blacklist it

    - by TheLQ
    After a two year hiatus to Linux, I try it again out again. And then I run into to driver issues... I have an old Linksys WUSB54G v4 Wireless USB Adapter. In previous versions I had to use a combination of Ndiswrapper and Wicd to hope of getting it working. In 10.10, apparently there are built in drivers for it. Unfortunately they don't work. Fails to connect to my WPA network, fails to connect to my open unencrypted network. Wicd fails at "Obtaining IP address" or when using static IPs fails at verifying connectivity to network. Getting fed up I tried the ndiswrapper approach. Installed and configured, but still not working, even when blacklisting the rt2570 module. So for some debugging I added some lines to my /etc/modprobe.d/blacklist.conf file blacklist rt2570 blacklist prism54usb blacklist rt2x00lib blacklist rt2x00usb Restart and find this: lordquackstar@quackbeast:/etc/modprobe.d$ lsmod | grep rt2 rt2500usb 18049 0 rt2x00usb 9779 1 rt2500usb rt2x00lib 27275 2 rt2500usb,rt2x00usb led_class 2633 1 rt2x00lib mac80211 231541 2 rt2x00usb,rt2x00lib cfg80211 144470 2 rt2x00lib,mac80211 Seems to be ignored... Tried this: lordquackstar@quackbeast:/etc/modprobe.d$ sudo rmmod -f rt2x00usb ERROR: Removing 'rt2x00usb': Resource temporarily unavailable lordquackstar@quackbeast:/etc/modprobe.d$ sudo rmmod -f rt2x00lib ERROR: Removing 'rt2x00lib': Resource temporarily unavailable and couldn't connect. Restarted and was back to the same modules loading. Maybe there's something in the log: lordquackstar@quackbeast:/etc/modprobe.d$ tail -n100000 /var/log/syslog | grep rt2 Dec 13 19:01:15 quackbeast kernel: [ 23.698056] Registered led device: rt2500usb-phy0::radio Dec 13 19:01:15 quackbeast kernel: [ 23.698140] Registered led device: rt2500usb-phy0::quality Dec 13 19:01:15 quackbeast kernel: [ 23.701680] usbcore: registered new interface driver rt2500usb Dec 13 19:01:15 quackbeast NetworkManager[855]: <info> (wlan0): new 802.11 WiFi device (driver: 'rt2500usb' ifindex: 4) Dec 13 19:17:47 quackbeast kernel: [ 23.521759] Registered led device: rt2500usb-phy0::radio Dec 13 19:17:47 quackbeast kernel: [ 23.521824] Registered led device: rt2500usb-phy0::quality Dec 13 19:17:47 quackbeast kernel: [ 23.524740] usbcore: registered new interface driver rt2500usb Dec 13 19:17:47 quackbeast NetworkManager[798]: <info> (wlan0): new 802.11 WiFi device (driver: 'rt2500usb' ifindex: 4) Seems to be autoloading. So this means that even if I pull it out, remove the module, and get it working, it still won't work when its plugged in all the time. More info: lordquackstar@quackbeast:/etc/modprobe.d$ sudo lshw -C Network *SNIP* *-network description: Wireless interface physical id: 1 bus info: usb@1:2 logical name: wlan0 serial: 00:12:17:9b:f3:1e capabilities: ethernet physical wireless configuration: broadcast=yes driver=rt2500usb driverversion=2.6.35-24-generic firmware=N/A link=no multicast=yes wireless=IEEE 802.11bg USB: lordquackstar@quackbeast:/etc/modprobe.d$ lsusb | grep -i rt Bus 001 Device 003: ID 13b1:000d Linksys WUSB54G v4 802.11g Adapter [Ralink RT2500USB] Any suggestions on how to either fix the rt2x00usb driver or permanently block it from loading? Note that I already have ndiswrapper installed

    Read the article

  • Login timeout disable?

    - by Sk606
    How can I disable automatic timeout entries in the login screen? Allow me to explain. My typical experience goes something like this: I put my laptop to sleep, then wake it. When it wakes, it comes up with the login screen. I type in my password and it will usually reject it, with a message indicating the login timer has expired. I then enter my password a second time and it logs in. Not the end of the world, but annoying nonetheless. Any suggestions?

    Read the article

  • Chroot into a 32 bit version of ubuntu from a 64 bit host

    - by Leif Andersen
    I have a piece of software that only runs on 32 bit linux (Xilinx webPack 10.1, apperently it 'has' to be the old version because that's the latest one compatible with their boards), anyway, this version is only compatible with 32 bit linux. So, I head off to this page to see what I can do: https://help.ubuntu.com/community/32bit_and_64bit Of the 4 options (listed at the bottom): I already installed ia32-libs, and it's still not working I could do that one if needed (which I ended up doing). No, I don't want to be working from a vm all of next semester, that would be painful and I'd rather just reinstall my whole computer to a 32 bit os (which I don't want to do). It didn't sound like it was the best option based on what I've seen. So I went off to do #2, and set up a chroot for 32 bit ubuntu. It linked to this tutorial: https://help.ubuntu.com/community/DebootstrapChroot As I'm running ubuntu 10.10 I made the lucid and newer version changes. Which is to say I wrote: [hardy-i386] description=Ubuntu 8.04 Hardy for i386 directory=/srv/chroot/hardy-i386 personality=linux32 root-users=leif type=directory users=leif to /etc/schroot/chroot.d/hardy-i386 (Note though that I did save it once before I had the file properly formatted, I saved the correct version moments later though). I then ran: $ sudo mkdir -p /srv/chroot/hardy_i386 $ sudo debootstrap --variant=buildd --arch i386 hardy /srv/chroot/hardy_i386 http://archive.ubuntu.com/ubuntu/ Then I ran: $ schroot -l And it showed the proper chroot, but then when I ran: $ schroot -c hardy-i386 -u root I got the following error: E: 10mount: error: Directory '/srv/chroot/hardy-i386' does not exist E: 10mount: warning: Mount location /var/lib/schroot/mount/hardy-i386-80359697-2164-4b10-a05a-89b0f497c4f1 no longer exists; skipping unmount E: hardy-i386-80359697-2164-4b10-a05a-89b0f497c4f1: Chroot setup failed: stage=setup-start Can anyone help me figure out what the problem is? Oh, by the way: /srv/chroot/hardy-i386 most certainly exists. I've also tried it replacing all references with hardy to lucid, to no avail. Oh, one more thing, I did set up the chrome os environment a month back or so: http://www.chromium.org/chromium-os/developer-guide and it had me use something with chmod. So, can anyone figure out what the problem is? Thank you.

    Read the article

  • Keeping rackspace vserver alive

    - by mit
    It appears to me that rackspace somehow freezes cloud VMs after some idle time. This means the first page request to a php page takes much longer to respond than the subsequent requests. This is in some cases good, in other cases not acceptable. I am actually querying a machine with wget from a different host now to keep it "alive". But I wonder what frequency would be necessary. Does anyone know the time period after which they send a VM to "sleep"? I guess it would be some minutes. EDIT: There is absolutely no caching involved on the php site. It just recently moved from another vhost and there was never such latency on the first request.

    Read the article

  • Embeding a generic google search with autocomplete - not a custom site search

    - by picxelplay
    Most people's home page is google.com. My homepage is just a custom html page hosted on my computer. I do this because I am a web developer, and I have several projects that I work on a one time, so I like to have quick links to all of them. On that page I usually just have a Link to google.com for when I want to search. But below all of my quick links, I want to add a google search box (with Autocompletions). I first used a simple iframe to embed google.com into the page, but then my search results were confined to that iframe. I wanted to search for something, then my results would open in a new tab. I then came across this code snippet but it doesn't have Autocompletions: http://www.refactory.org/s/google_search/view/2 How can I add Autocompletions to this? Or is there a better way of doing it? Thanks in advance for any advice

    Read the article

  • Where can I find Cinema4D for game development tutorials ?

    - by George Profenza
    Hi, I started to learn Cinema 4D. I've noticed it's really easy to use for motion graphics, but I want to use it for modeling for games/realtime 3d engines. Before I used 3dsmax and it was easy to estimate how a model would look/behave in a 3d engine. The two main things I did was displaying Polygon triangles and displaying the Polygon Count. I've found the Total Polygons tick in HUD settings in Cinema 4D, but I can't find any display mode that will show triangles. Is there there a way to display triangle faces/not quads in Cinema4D ? If so how ? There is a Triangulate function, but I'd rather not Triangulate/Untriangulate all the time, especially since it's converting back and forth between the two doesn't always produce the same result. I imagine I'm asking for old school techniques, but I plan to use these to make low poly models for web(canvas/webGL) and mobile.

    Read the article

  • Saving Abstract and Sub classes to database

    - by bretddog
    Hi, I have an abstract class "StrategyBase", and a set of sub classes, StrategyA/B/C etc. The sub classes use some of the properties of the base class, and have some individual properties. My question is how to save this to a database. I'm currently using SqlCE, and Linq-To-Sql by creating entity classes automatically with SqlMetal.exe. I've seen there are three solutions shown in this question, but I'm not able to see how these solutions will work or not with SqlMetal/entity classes. Though it seems to me the "concrete table inheritance" would probably work without any manual modifying. What about the other two, would they be problematic? For "Single Table Inheritance" wouldn't all classes get all variables, even though they don't need them? And for the "Class table inheritance" solution I can't really see at all how that will map into the entity-classes for a useful purpose. I may note that I extend these partial entity classes for making the classes of my business objects. I may also consider moving to EntityFramework instead of SqlMetal/Linq2Sql, so would be nice also to know if that makes any difference to what schema is easy to implement. One likely important thing to note is that I will constantly be develop new strategies, which makes me have to modify the program code, and probably the database shcema; when adding a new strategy. Sorry the question is a bit "all over the place", but hopefully it's some clear advantages/disadvantages here that you may be able to advice. ? Cheers!

    Read the article

  • Getting the height of text to know fill height as in TCPDF

    - by sami
    I'm trying to go through the code of TCPDF to understand how it calculates the height of the text to be rendered, but it's too much for me to handle without asking. What I want to know: in the PDF from example 5 http://www.tcpdf.org/examples/example_005.pdf it gives the cell a yellow background. I'm guessing that at the basic level, it first draws a box with this fill color, then adds the text, so what method is it calling to get the height of the text to know the height of the box to fill? Anyone knows how to trace this, because doing it by hand and looking through the code isn't working at all for me.

    Read the article

  • Create Session Variable from different datasources?

    - by Szafranamn
    Currently I am developing a dynamic website using Dreamweaver cs5 with ColdFusion 9 and using Access to create my databases along with QuickBooks and QODBC to create database. I have established a login session variable stemming from the login page. This session variable is being drawn from one Datasource "Access" Table "Logininfo" Field "FullName" but I wanted to create another session variable either at this point or further into the member's page to use in a query sequence. This session variable would stem from another Datasoucre "QBs" Table "Invoice" Field "CustomerRefFullName" which is generated through Quickbooks and QODBC. I am not sure if this is possible but if it is how do I do it. I want to do this so I can query the Invoice database to upload the customer's Invoices unique to them onto their page. So it would have to be related to their login credentials. If there is another better route to take I would greatly appreciate the advice. Below is the login code if there is additional information needed let me know. This is my current thinking/plan to do what I wish to intend hence the need to create the session variable: I have another Datasource "QBs" with a Table "Invoice" when I create another webpage for the customer to see their invoice I need to create a recordset that accesses that Table. In order to do so I think the best way would some home convert the session.FullName (which came from Access Datasource, Logininfor Table) into a session.CustomerRefFullName (which would have to come from (Datasource: QBs Table: Invoice Field: CustomerRefFullName) that way I could set the query WHERE CustomerRefFullName and have each logged in user see their specific Invoices. So is there a way to turn the session variable off one datasource/table into a different sessionvariable off a new datasource/table even if it is unique just to that page??? <cfif IsDefined("FORM.username")> SELECT FullName, Username,Password,AccessLevels FROM Logininfo WHERE Username= AND Password=

    Read the article

  • PHP Multi-Domain Sessions; ini_set Not Working?

    - by SumWon
    Hello, I'm trying to set it up so if you log in to my website the session carries over to all sub-domains of my website. For example, if you go to domain.com and log in, then go to sub.domain.com, you'll already be logged in at sub.domain.com. To my understanding, you would want to use ini_set('session.cookie_domain','.domain.com') and then session_start(), then set your session variables, but this isn't working. Example of what I'm doing: Code for domain.com: <?php ini_set('session.cookie_domain','.domain.com'); session_start(); $_SESSION['variable'] = 1; ?> Code for sub.domain.com: <?php session_start(); echo $_SESSION['variable']; ?> But $_SESSION['variable'] isn't set. I've also tried using ini_set() in the sub.domain.com code, but it made no difference. I've verified that setting session.cookie_domain is working by using ini_get(). What am I doing wrong? Thanks!

    Read the article

  • JSP/Struts2/Hibernate: loop through a self-referencing table.

    - by TBW
    Hello everyone, Let's say we have a self-referencing table called PERSON, with the following columns: ID, PARENT, where PARENT is a foreign key to the ID column of another element in the PERSON table. Of course, many persons can have the same parent. I use Hibernate 3 in lazy fetching mode to deal with the database. Hibernate fetches a person element from the database, which is then put in the ValueStack by the Struts2 action, to be used on the result JSP page. Now the question is : In JSP, how can I do to display all the child (and the child's child, and so on, like a family tree) of this person element? Of course, for the n+1 children I can use the < s:iterator tag over the person.person. I can also nest another < s:iterator tag over person.person.person to get the n+2 children. But what if I want to do this in an automated manner, up to the last n+p child, displaying in the process all the children of all the n+1..n+p elements? I hope I have been clear enough. Thank you all for your time. -- TBW.

    Read the article

  • Compare output of program to correct program using bash script, without using text files

    - by Doug
    I've been trying to compare the output of a program to known correct output by using a bash script without piping the output of the program to a file and then using diff on the output file and a correct output file. I've tried setting the variables to the output and correct output and I believe it's been successful but I can't get the string comparison to work correctly. I may be wrong about the variable setting so it could be that. What I've been writing: TEST=`./convert testdata.txt < somesampledata.txt` CORRECT="some correct output" if [ "$TEST"!="$CORRECT" ]; then echo "failed" fi

    Read the article

  • How did this happen?? Git error? Some other fluke?

    - by marfarma
    Every file in this Rails project is duplicated with a -e and again with a -e-e tacked onto the end of it, like the following. It's that way in my GitHub repository too. But I can't figure out how it happened. Any clue? Google searching comes up empty. -rw-r--r--@ 1 usrname staff 959 Jan 7 02:13 Gemfile -rw-r--r-- 1 usrname staff 958 Jan 5 01:10 Gemfile-e -rw-r--r-- 1 usrname staff 958 Jan 5 01:09 Gemfile-e-e -rw-r--r-- 1 usrname staff 6650 Jan 7 02:13 Gemfile.lock -rw-r--r-- 1 usrname staff 6650 Jan 5 01:10 Gemfile.lock-e -rw-r--r-- 1 usrname staff 6650 Jan 5 01:09 Gemfile.lock-e-e lrwxr-xr-x 1 usrname staff 18 Jan 5 00:37 README.rdoc - doc/README_FOR_APP -rw-r--r-- 1 usrname staff 283 Jan 5 01:10 Rakefile -rw-r--r-- 1 usrname staff 283 Jan 5 01:10 Rakefile-e -rw-r--r-- 1 usrname staff 283 Jan 5 01:09 Rakefile-e-e drwxr-xr-x 6 usrname staff 204 Jan 5 00:37 app drwxr-xr-x 5 usrname staff 170 Jan 5 01:10 autotest drwxr-xr-x 28 usrname staff 952 Jan 5 01:15 config -rw-r--r-- 1 usrname staff 173 Jan 5 01:10 config.ru -rw-r--r-- 1 usrname staff 173 Jan 5 01:10 config.ru-e -rw-r--r-- 1 usrname staff 173 Jan 5 01:09 config.ru-e-e

    Read the article

  • imagecopyresampled to resize and crop an image - not returning the expected result

    - by David
    imagecopyresized ( resource $dst_image , resource $src_image , int $dst_x , int $dst_y , int $src_x , int $src_y , int $dst_w , int $dst_h , int $src_w , int $src_h ) This is what I want to do: I have an image that's 600x1000px in size, and I want to create a thumb that's 100x100px after resizing that image to 300x500px, the x coordinate for the top left point of the thumb square should be at 100(src x) and 120(src y). According to what I understand from the manual, the command should be $dst_image = imagecreatetruecolor(100,100); $src_image = imagecreatefromjpeg('/home/sandbox/imagetoresize.jpg'); imagecopyresized ($dst_image, $src_image, 0, 0, 100, 120, **300 , 500 , 600 , 1000** ) It is cropping the image just fine, but it isn't resizing it correctly. I never got it to match what I see in my image editor (the GIMP). What am I doing wrong? I confirmed that all the numbers are correct, but it's always shifted up or down no matter what I do. Your help would really be appreciated!

    Read the article

  • Sorted sets and comparators

    - by Jack
    Hello, I'm working with a TreeSetthat is meant to store pathfind locations used during the execution of a A* algorithm. Basically until there are "open" elements (still to be exhaustively visited) the neighbours of every open element are taken into consideration and added to a SortedSetthat keeps them ordered by their cost and heuristic cost. This means that I have a class like: public class PathTileInfo implements Comparable<PathTileInfo> { int cost; int hCost; final int x, y; @Override public int compareTo(PathTileInfo t2) { int c = cost + hCost; int c2 = t2.cost + t2.hCost; int costComp = c < c2 ? -1 : (c > c2 ? 1: 0); return costComp != 0 ? costComp : (x < t2.x || y < t2.y ? -1 : (x > t2.x || y > t2.y ? 1 : 0)); } @Override public boolean equals(Object o2) { if (o2 instanceof PathTileInfo) { PathTileInfo i = (PathTileInfo)o2; return i.cost + i.hCost == cost + hCost && x == i.x && y == i.y; } return false; } } In this way first the total cost is considered, then, since a total ordering is needed (consistency with equals) a ordering according to the x,y coordinate is taken into account. This should work but simply it doesn't, if I iterate over the TreeSet during the algorithm execution like in for (PathTileInfo t : openSet) System.out.print("("+t.x+","+t.y+","+(t.cost+t.hCost)+") "); I get results in which the right ordering is not kept, eg: (7,7,6) (7,6,7) (6,8,6) (6,6,7) (5,8,7) (5,7,7) (6,7,6) (6,6,7) (6,5,7) (5,7,7) (5,5,8) (4,7,7) (4,6,8) (4,5,8) is there something subtle I am missing? Thanks!

    Read the article

  • Latitude & longitude coordinates of Australian states/territories for database using Google Maps

    - by RMW
    Hi, We have a database which has location-based search using Google Maps API. However searching by state or territory in Australia is problematic because Google Maps locates these at the centre of the states and most population centres in Australia are on the coast. We need to hand code in the latitudes and longitudes so that when someone searches for the state 'NSW', for example, the database returns relevant results. Does anyone know where to find a list of the coordinates for the boundaries of Australian states & territories to code into the database? This will save our busy programmer a lot of time. Thanks in advance.

    Read the article

  • sql exception arithmetic overflow?

    - by MyHeadHurts
    In my program the user imports a date and it works whenever the year is in 2011 but if i try a date in 2010 i get this error which is weird [ SqlException (0x80131904): Arithmetic overflow error converting int to data type numeric.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1950890 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846875 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392 System.Data.SqlClient.SqlDataReader.HasMoreRows() +157 System.Data.SqlClient.SqlDataReader.ReadInternal(Boolean setTimeout) +197 System.Data.SqlClient.SqlDataReader.Read() +9 System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping) +78 System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) +164 System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) +282 System.Data.Common.LoadAdapter.FillFromReader(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) +19 System.Data.DataTable.Load(IDataReader reader, LoadOption loadOption, FillErrorEventHandler errorHandler) +222 System.Data.DataTable.Load(IDataReader reader) +14 ( @YearToGet int, @current datetime, @y int, @search datetime ) AS SET @YearToGet = 2006; WITH Years AS ( SELECT DATEPART(year, GETDATE()) [Year] UNION ALL SELECT [Year]-1 FROM Years WHERE [Year]>@YearToGet ), q_00 as ( select DIVISION , DYYYY , sum(PARTY) as asofPAX , sum(InsAmount) as asofSales from dbo.B101BookingsDetails INNER JOIN Years ON B101BookingsDetails.DYYYY = Years.Year where Booked <= CONVERT(int, DateAdd(year, (Years.Year - @y), @search)) and DYYYY = Years.Year group by DIVISION, DYYYY, years.year having DYYYY = years.year ), q_01 as ( select DIVISION , DYYYY , sum(PARTY) as YEPAX , sum(InsAmount) as YESales from dbo.B101BookingsDetails INNER JOIN Years ON B101BookingsDetails.DYYYY = Years.Year group by DIVISION, DYYYY , years.year having DYYYY = years.year ), q_02 as ( select DIVISION , DYYYY , sum(PARTY) as CurrentPAX , sum(InsAmount) as CurrentSales from dbo.B101BookingsDetails INNER JOIN Years ON B101BookingsDetails.DYYYY = Years.Year where Booked <= CONVERT(int,@current) and DYYYY = (year( getdate() )) group by DIVISION, DYYYY ) select a.DIVISION , a.DYYYY , asofPAX , asofSales , YEPAX , YESales , CurrentPAX , CurrentSales ,asofsales/ ISNULL(NULLIF(yesales,0),1) as percentsales, CAST((asofpax) AS DECIMAL(5,1))/yepax as percentpax from q_00 as a join q_01 as b on (b.DIVISION = a.DIVISION and b.DYYYY = a.DYYYY) join q_02 as c on (b.DIVISION = c.DIVISION) JOIN Years as d on (b.dyyyy = d.year) where A.DYYYY <> (year( getdate() )) order by a.DIVISION, a.DYYYY ;

    Read the article

  • Elegant PostgreSQL Group by for Ruby on Rails / ActiveRecord

    - by digitalfrost
    Trying to retrieve an array of ActiveRecord Objects grouped by date with PostgreSQL. More specifically I'm trying to translate the following MySQL querry: @posts = Post.all(:group => "date(date)", :conditions => ["location_id = ? and published = ?", @location.id, true], :order => "created_at DESC") I am aware that PostgreSQL interpretation of the SQL standard is stricter than MySQL and that consequently this type of query won't work...and have read a number of posts on StackOverflow and elsewhere on the subject - but none of them seem to be the definitive answer on this subject I've tried various combinations of queries with group by and distinct clauses without much joy - and for the moment I have a rather inelegant hack which although works makes me blush when I look at it. What is the proper way to make such a querry with Rails and PostgreSQL ? (Ignoring the fact that surely this should be abstracted away at the ActiveRecord Level)

    Read the article

  • How can I have centered text and right-aligned image in the same element?

    - by Ethan
    I have some th elements with text in them that should be centered and they also contain images: The up/down arrow graphic is a separate image. My question is, what is the simplest reliable way to position that image over to the right side of the th element while keeping the text centered? I'm open to using jQuery/JavaScript if there's a reasonably simple way to do it. One caveat: I need the up/down graphic to be a separate image, not part of the header background. <th> Title <img src='/images/sort_unsorted.jpg' /> </th>

    Read the article

  • Random List of millions of elements in Python Efficiently

    - by eWizardII
    Hello, I have read this answer potentially as the best way to randomize a list of strings in Python. I'm just wondering then if that's the most efficient way to do it because I have a list of about 30 million elements via the following code: import json from sets import Set from random import shuffle a = [] for i in range(0,193): json_data = open("C:/Twitter/user/user_" + str(i) + ".json") data = json.load(json_data) for j in range(0,len(data)): a.append(data[j]['su']) new = list(Set(a)) print "Cleaned length is: " + str(len(new)) ## Take Cleaned List and Randomize it for Analysis shuffle(new) If there is a more efficient way to do it, I'd greatly appreciate any advice on how to do it. Thanks,

    Read the article

  • Links sometimes not working in WebView

    - by littleFluffyKitty
    On occasion links in the WebView will not respond. The highlight press color will appear around them but nothing happens. I am also using WebViewClient's shouldOverrideUrlLoading and that function is not called when this happens. Edit: I have narrowed this issue down to the following circumstances: The webpage is the first page a WebView opens. The webpage uses meta name="viewport" attribute in the html head The WebView is using WebView.getSettings().setUseWideViewPort(true); Android 2.1 (Doesn't appear to happen in later versions, didn't test earlier) If a webpage meeting those above is opened no links will work. If another similar page is loaded, those links will not work either. It is not until you load a page without meta name="viewport" that links start to work. After a page without that meta attribute is opened and then you load a page with the meta viewport attribute, the links start working.

    Read the article

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