Dell Released

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Wednesday, August 21, 2013

How to aggregate data without group by

Posted on 2:10 PM by Unknown
How to aggregate data without group by



I am having a little bit of a situation here.

The environment

I have a database for series here. One table for the series itself, one

for the season connected to the series table, one for the episodes

connected to the seasons table. Since there are air dates for different

countries I have another table called 'series_data` which looks like the

following:

CREATE TABLE IF NOT EXISTS `episode_data` (

`id` int(11) NOT NULL AUTO_INCREMENT,

`episode_id` int(11) NOT NULL,

`country` char(3) NOT NULL,

`title` varchar(255) NOT NULL,

`date` date NOT NULL,

`tba` tinyint(1) NOT NULL,

PRIMARY KEY (`id`),

KEY `episode_id` (`episode_id`),

KEY `date` (`date`),

KEY `country` (`country`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Now I am trying to collect the last aired episodes from each series in the

database using the following query:

SELECT

*

FROM

`episode_data` ed

WHERE

`ed`.`date` < CURDATE( ) &&

`ed`.`date` != '1970-01-01' &&

`ed`.`series_id` = 1

GROUP BY

`ed`.`country` DESC

ORDER BY

`ed`.`date` DESC

Since I have everything normalized I changed 'episode_id' with 'series_id'

to make the query less complicated.

What I am trying to accomplish

I want to have the last aired episodes for each country which are actually

announced (ed.date != '1970-01-01') as the returning result of one query.

What's the problem

I know now (searched google, found not for me working answers here), that

the ordering takes place AFTER grouping, so my "date" ordering is

completly useless.

The other problem is that the query above is working, but always takes

those entries with the lowest id matching my conditions, because those are

the first ones in the tables index.

What is the question?

How may accomplish the above. I do not know if the grouping is the right

way to do it. If there is no "one liner", I think the only way is a sub

query which I want to avoid since this is as far as I know slower than a

one liner with the right indexes set.

Hope in here is everything you need :)
Read More
Posted in | No comments

Angular $scope.$watch on (for in... ) don't work

Posted on 10:38 AM by Unknown
Angular $scope.$watch on (for in... ) don't work



in my code i have the following for watch changes in some variables

$scope.$watch('ns.namespace.watchable_value', function(newVal, oldVal){

//...

})

now i have many namespaces with a watchable_value and I wanna do

for (namespace in [...]) {

$scope.$watch('ns.' + namespace + '.watchable_value', function(newVal,

oldVal){

//...

})

}

but the callback never is called
Read More
Posted in | No comments

Using Modernizr to test browser support for css calc()

Posted on 7:06 AM by Unknown
Using Modernizr to test browser support for css calc()



How can I test if a browsers support the CSS3 calc() property using

Modernizr?

I have tried:

if (Modernizr.testProp('cssCalc')) {

console.log('CSS calc() supported');

}

but this only returns "undefined" in the console.

(I am using modernizr-2.6.2.js).

What is the right way to use Modernizr for browser feature detection?
Read More
Posted in | No comments

Content overlapping in navigation menu?

Posted on 3:34 AM by Unknown
Content overlapping in navigation menu?



I have a navigation menu on top and the content overlaps the navigation

menu. What I want is that the content must be below the navigation bar.

How to fix this? Help me please?

Here is the screenshot:

http://s1277.photobucket.com/user/fuscia_pink19/media/ss_zps888fc3e9.png.html

As you can see the aaaa letters are on the navigation bar also.

Here is my code:

<!doctype html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>Title</title>

<style>

body {

margin: 0;

padding: 0;

}

nav {

float: right;

position: absolute;

top: 28%;

right: 16%;

font-size: 20px;

}

nav li {

list-style: none;

display: inline;

}

nav li a {

text-decoration: none;

color: #a4d0dd;

padding: 11px 25px;

}

#wrap {

position: fixed;

left: 0;

top: 0;

background-color: black;

width: 100%;

height: 80px;

border-bottom: 1px solid #444444;

}

</style>

</head>

<body>

<div id="wrap">

<nav>

<ul>

<li>

<a href="#">Home</a>

</li>

<li>

<a href="#">My Profile</a>

</li>

<li>

<a href="#">Account</a>

</li>

<li>

<a href="#">Logout</a>

</li>

</ul>

</nav>

</div><!-- ENDING TOP_MENU DIV -->

<div class="content">

a<br />

a<br />

a<br />

a<br />

a<br />

a<br />

</div>

</body>

</html>
Read More
Posted in | No comments

cls file - multiple files

Posted on 12:01 AM by Unknown
cls file - multiple files



I am writing a .cls file so that I can maintain consistency across many

documents. The cls file is soooo long, and I would like to split it up

into parts, in a similar fashion that one does when writing a document.

Can I do this, the \input{...} command doesn't seem to recognize a

sub-folder of the parent .cls file in my TEXMFHOME tree structure.
Read More
Posted in | No comments

Tuesday, August 20, 2013

Differences between "fortification nouns"

Posted on 8:32 PM by Unknown
Differences between "fortification nouns"



What are the practical differences between these nouns?

Fort

Fortress

Fortification

Stronghold

Citadel

Castle

Palace

Context

In Norway we have a lot of old stone buildings, typically built for war in

the 1600s. Most of the their names are translated to English using

fortress, but, sometimes, one of the other nouns are used.

I have looked up these words in different dictionaries, but I haven't been

able to determine the differences between them. When is it appropriate to

choose one over the other?
Read More
Posted in | No comments

filtration on the cohomology of a complex

Posted on 5:03 PM by Unknown
filtration on the cohomology of a complex



Let $K^\bullet$ be a complex and let $F_I$ and $F_{II}$ be two filtrations

on it. suppose $F_I^i K^n$ intersects $F_{II}^i K^n$ trivially. It then

follows that in the induced filtration on the cohomology of the complex

$F_I^i H^n$ intersects $F_{II}^i H^n$ trivially.

However, I have encountered a situation where this doesn't seem to hold.

In order to construct the spectral sequence of a composition of functors

one makes use of a certain double complex called Cartan-Eilenberg

resolution, call it $C^{\bullet\bullet}$, and considers the spectral

sequence of a filtered complex for the total complex of it, $K^\bullet$.

There are two filtrations on $K^\bullet$, vertical and horizontal. One of

the properties of $C^{\bullet\bullet}$ is that the filtration on the

cohomology of the total complex induced by the vertical filtration is

stupid:

$F^n H^i = H^i$ if $i <n$, $F^n H^i = 0$ if $i \geq n$.

But the filtration on the cohomology induced by the horizontal filtration

can be anything, in particular horizontal $F^i_h H^n$ can intersect

non-trivially the vertical $F^j_v H^n$ even if $i+j > n$ and the

corresponding elements of the filtration on $K^\bullet$ do intersect

trivially.

What is wrong in the above reasoning?
Read More
Posted in | No comments
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • Cannot connect to SQL Server 2012
    Cannot connect to SQL Server 2012 I'm trying to connect to a SQL Server 2012 database using C#, both the server and program are on the s...
  • Mirrors Edge video settings are locked
    Mirrors Edge video settings are locked How do you change the video settings in Mirror's Edge? For me they are all grayed out and locked ...
  • Android - error opening file just created
    Android - error opening file just created I'm new to android developement and trying to do some file IO. Whenever I run this block of co...
  • candied mints storage and transporting long distance
    candied mints storage and transporting long distance I'm making mints for my nephew's wedding (containing powdered sugar, butter, wh...
  • button to generate html delete method?
    button to generate html delete method? I'm creating a little web app in flask using django and jinja2. I have a python script running on...
  • Udated Streak 7 Manual & Quick Start Guide With Honeycomb
    For those of you who bought the Streak 7 before the Honeycomb 3.2 update, you have in your possession an out of date Manual & Quick Star...
  • Trying to print a string character by character with delay between two character print
    Trying to print a string character by character with delay between two character print I've tried with code below. please guide me where...
  • Updating foreign key references on the DbContext ChangeTracker
    Updating foreign key references on the DbContext ChangeTracker I work with EF 5.0, DB first in a web project. For our service layer, we use ...
  • A div that adapts to its background
    A div that adapts to its background Is it possible to make a div adapt to the img that its in the background? Clarification: I do not mean t...
  • Receiving null messages on android, how to fix it?
    Receiving null messages on android, how to fix it? I've a galaxy s3 with android 4.1.2 For some reason I don't know why I'm cons...

Categories

  • Games
  • News
  • Streak 5
  • Streak 7
  • Tips

Blog Archive

  • ▼  2013 (124)
    • ▼  August (124)
      • Should I make multiple SQLite databases for better...
      • Difference between Nil and nil and Null in Objecti...
      • Cannot connect to SQL Server 2012
      • Android - error opening file just created
      • PHP SimpleXML doesn't output anything
      • Memory leak (igraph, watts.strogatz.game, get.all....
      • How do I position a div on top of another div
      • Updating foreign key references on the DbContext C...
      • Convert string to DateTime and format
      • call function on click outside of a particular div
      • OperationalError when inserting into sqlite 3 in P...
      • Trying to print a string character by character wi...
      • I need to make my JPanel resize dynamically as new...
      • How to retrieve images from cache memory?
      • how to add jscrollpane to jframe?
      • Query on how to Select Date before the latest Date...
      • Does archive size of tar, zip and rar effect the t...
      • How do I make a DOM object follow a circular path ...
      • how to use for loop for my issue
      • AngularJS - Pass variable from a controller & upda...
      • Windows 2012: how to make power button work in eve...
      • IN OBOUT grid, how to move from first grid to anot...
      • Am I using the form action correctly?
      • Increasing the font size of a webview conflict wit...
      • quicktags "link" button doesn't work, but all othe...
      • Cannot access local variables using systemtap
      • Remove/avoid adding target link to URL
      • Left-justified equations with left tags (so it loo...
      • [ Marriage & Divorce ] Open Question : My boyfrien...
      • livetv2pc)))WaTch (Rugby) Australia vs New Zealand...
      • The Google Visualization API Query Language: Query...
      • iOS 7 phone-number link doesn't work when webpage ...
      • Cross-browser textarea maxlength
      • candied mints storage and transporting long distance
      • how to convert objectHTML into html
      • Mellin transform definition
      • Multiple Google Calendars with one Google Cal ID
      • Dell PowerEdge 2950 PCIe Training Error -- No PCIe...
      • Reset Disk - Windows Storage Server 2012
      • Windows Phone 8 - Keeping background location trac...
      • Django forms design suggestiom
      • Magento Upgrade, getting error with tier prices fr...
      • Bouncing between "Adapter is detached" and "No wra...
      • How to create overlapping - not stacking - shapes ...
      • Enclosing capsules around list based arrays [on hold]
      • Identifying Switch case argument (Perl)
      • asp.net ModalPopupExtender not behaving properly
      • fanotify unable monitor entire system for FAN_OPEN...
      • Jquery UI datepicker inline "onclick" handler caus...
      • URL constantly results in a badbox
      • Split values over multiple rows with different del...
      • How to aggregate data without group by
      • Angular $scope.$watch on (for in... ) don't work
      • Using Modernizr to test browser support for css ca...
      • Content overlapping in navigation menu?
      • cls file - multiple files
      • Differences between "fortification nouns"
      • filtration on the cohomology of a complex
      • Problems with every aspect of facebook that involv...
      • Extract data from last line in a text file using PHP
      • How to properly provide data for ?
      • ConditionalPanel doesn't support variables with do...
      • Frequent out of memory issues
      • Undefine reference for libraries, so How could I f...
      • radio buttons checked with jquery not holding prop...
      • How to modify bash command to change permissions
      • header(Content-type: image/jpeg) not working
      • Removing smart quotes from an SQL server text column
      • Getting out of sync server response
      • thesis work" vs "thesis
      • php radio post wrong same value after submit
      • Several questions about trigonometry and functions
      • A div that adapts to its background
      • Why are there two different versions of the mean a...
      • Restore only some volumes from a multiOS system image
      • system of pde (solid mechanics)
      • Application or Object defined error - VBA Excel 2013
      • Deleting the last few revisions: SVN best practice
      • Choose blackberry 10 platform to use call logs, me...
      • Procedure or function usp_logout has too many argu...
      • how can i use combination of unix signals (like SI...
      • Basic Javascript Countdown Timer Taking Longer Tha...
      • WordPress Guest Author - How can I use custom fiel...
      • button to generate html delete method?
      • socket.io redis ECONNREFUSED
      • Can one http request call multiple css files?
      • .htaccess related codeigniter. why error 404 page ...
      • Undefined symbols error from static framework
      • XML Sitemap Generator for URL with 1.5 million pages?
      • How do I prevent Microsoft DNS from reporting vers...
      • Solve the equation for x, y and z: $\sqrt{x-y+z}=\...
      • A basic doubt on linear dependence of vectors
      • mysql charsets, can I perform the conversion in py...
      • Mirrors Edge video settings are locked
      • Receiving null messages on android, how to fix it?
      • changing an onEdit function to run onOpen
      • Handle Multiple Form tag in asp.net page?
      • Getting click event on parent page of button in frame
      • Fix column width with tabularx
      • best software to use to make a website
      • NSLog returns (null) when logging string from anot...
      • Add express middleware for param validations
      • R "object x not found error" in calling self-defin...
      • Android Application for Registration to a website
      • How to insert multiple Facebook comment boxes on o...
      • How can I group by the difference of a column betw...
      • for loop with two integers
      • Why is unsigned integer overflow defined behavior ...
      • Using multiple SELECT statements to narrow results
      • Android: Logout system and the android lifecycle
      • how to use font awesome in own css?
      • Nested Lists in Spring Expression Language
      • Live USB quit working...HELP :-)
      • Need help in drawGradientArea
      • django-ckeditor Image Browsing
      • C3P0 connection Pooling issues
      • Code keeps entering values into array backwards
      • Number of permutations with repeated objects.
      • How do I suspend a certain process when display is...
      • How to free Watch Houston Texans vs Minnesota Viki...
      • UPS Shipping required I get a new account ID and n...
      • Java concurrency - Is this efficient?
      • Are floated element really removed from normal htm...
      • How to implement Jquery Text Editor with Hindi Lan...
  • ►  2012 (6)
    • ►  February (2)
    • ►  January (4)
  • ►  2011 (10)
    • ►  December (1)
    • ►  November (2)
    • ►  October (7)
Powered by Blogger.

About Me

Unknown
View my complete profile