Wednesday, 4 September 2013

SQL Server Matching Records over a Range of Valid Times

SQL Server Matching Records over a Range of Valid Times

I have a trip table which contains information of individual cars
traveling in different parts of a city (start time, end time, start
location, end location, etc). I also a table with the weather conditions
(temp, precipitation, etc.) of said city measured semi-regularly (every 15
to 30 minutes).
Trip Table
| TripID | StartTime | EndTime | ....
| 1 | 2012-01-10 03:50:00.163 | 2012-01-15 04:15:40.163 |
| 2 | 2012-01-10 03:59:00.113 | 2012-01-15 04:44:25.025 |
| 3 | 2012-01-10 04:10:00.127 | 2012-01-15 04:35:36.064 |
Weather Table
| WeatherID | ReadingTime | ....
| 1 | 2012-01-10 03:45:00 |
| 2 | 2012-01-10 04:02:05 |
| 3 | 2012-01-10 04:30:34 |
| 4 | 2012-01-10 04:45:23 |
These weather readings are discrete so to make it (more) continuous I
assume the ids valid over a range with the reading time as the midpoint.
For example:
WeatherID 1 condition is valid over 3:45 to 3:53:525
WeatherID 2 condition is valid over 3:53:525 to 3:16:195
etc
I want to add a foreign key to the trip table which associates each trip
to the weather what was present for the MAJORITY of the trip. For example
TripID 2 takes 42 minutes to complete which occurs over two weather
readings (WeatherID 2 and 3). So WeatherID 3 will be assigned to the
tripID 2 record because more of the trip happens under weatherID 3 rather
than weatherID 2.
I understand this is a bit complicated but is it possible to solve using
SQL? Any help is appreciated. Thank.

I got error in creating dynamic link using grid view in .net?

I got error in creating dynamic link using grid view in .net?

if (GridView1.Rows.Count!=0) { Label l =
(Label)GridView1.Rows[0].FindControl("Label"); Label2.Text = l.Text; }

Origami fold effect for UIView and NavigationController Bar

Origami fold effect for UIView and NavigationController Bar

I need to implement the functionality that this library provides: enter
link description here. The main issue, is I must implement it to fold on
the center view when the left view is revealed rather fold the side views.
Unfortunately, this has become quite a task (and I'm currently looking at
manipulating the library below to do so). The left tray should be just a
tray with a width of 100 to 200. When it comes out, the center view should
have a cringle origami effect and fold until the tray is hidden again. Is
anyone aware of a library that does this or a way to accomplish this
effect.

fgetcsv dies on live server on dev not -- where to look

fgetcsv dies on live server on dev not -- where to look

I have identical live and dev instances on the same server
(seperated by fastcgi with an identical php.ini)
i run in a script the command
while (($data = fgetcsv($handle, 10000, ";")) !== FALSE) {
on the dev instance the command runs without problems
44000 lines, uses up to 200MB of memory (of 512MB given)
on the live instance it runs up to line 28700
and crashes the script without output
with 133MB of memory used
i put the command in a "try" but no error is thrown
where could i look next?

Using manual registration in a gerrit plugin

Using manual registration in a gerrit plugin

When writing gerrit plugins you have the choice to either use
AutoRegistration (using the @Listen and @Export annotations) or to use
manual registration by defining <GerritModule>, <Gerrit-SshModule> and/or
<Gerrit-HttpModule> in the pom.xml.
Auto-Registration is shown in this slide set, but documentation on how to
use manual registration is sparse. So how is it done?

Tuesday, 3 September 2013

use laptop as wifi hotspot windows 8

use laptop as wifi hotspot windows 8

I want to use my laptop as a wifi hotspot for this i am using this steps:
1) netsh wlan show drivers
2) netsh wlan set hostednetwork mode=allow ssid=csdd12 key=123456789
3) netsh wlan start hostednetwork
but the problem is the shewing me error:
(The hosted network could't be started.
The group or resource is not in the correct state to preform the
requested operation.)
please help me.

Write result image using jmagick

Write result image using jmagick

I want to crop part of the image and then write the result to another
image file. My code looks like this
ImageInfo imageInfo = new ImageInfo("file path");
MagickImage image = new MagickImage(imageInfo );
Rectangle cropInfo = new Rectangle();
cropInfo.x = 20;
cropInfo.y = 20;
cropInfo.width = 300;
cropInfo.height = 300;
MagickImage result = image.cropImage(cropInfo);
result.setFileName("path to result file");
boolean s = result.writeImage(imageInfo);
The above code just works but why writeImage using the old ImageInfo? and
the MagickImage.setFileName don't make sense to me. I think we should
create a new ImageInfo object and then write to that ImageInfo. The
following code make more sense but don't work as expected.
MagickImage result = image.cropImage(cropInfo);
ImageInfo resulInfo = new ImageInfo("path to new file");
boolean s = result.writeImage(imageInfo);
Does anyone experience with this ?