GET MAX(ID) FOR ALL TABLES SQL SERVER
I am trying to select Max(ID) for all tables in my database. I tried the
below query but there is no AUTO-INCREMENT column available. Is there
something else that I can try?
SELECT TABLE_NAME, AUTO_INCREMENT
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = 'mydb'
Monday, 9 September 2013
Using TableFilter, how do you alter the text in the dropdown?
Using TableFilter, how do you alter the text in the dropdown?
I'm using tablefilter.js to generate dropdowns at the top of an HTML
table. In a couple of the table rows, I have a span that serves as a
tooltip on hover, so it doesn't show unless a mouse is hovering over it.
<td>
<a class="tooltip" href="#" id="color">Red
<span>
<strong>Favorite Color</strong><br />
If this is not your favorite color,
please make changes on this page.
</span>
</a>
</td>
The problem is that the dropdown text at the top of the column is
including the span, so when a user clicks on the dropdown, it says "Red
Favorite Color If this is not ..." instead of simply "Red."
Is there any way to prevent the tablefilter plugin from grabbing anything
after the initial anchor that says "Red?"
Here's the CSS for the tooltip:
a.tooltip {
outline:none;
text-decoration:none;
}
a.tooltip strong {
line-height:30px;
}
a.tooltip span {
display:none;
line-height:16px;
margin-left:28px;
margin-top:-30px;
padding:14px 20px;
width:240px;
z-index:10;
}
a.tooltip:hover span {
border:1px solid #DCA;
background:#fffAF0;
color:#111;
display:block;
position:absolute;
}
.callout {
border:0;
left:-12px;
position:absolute;
top:30px;
z-index:20;
}
a.tooltip span
{
border-radius:4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
-moz-box-shadow: 5px 5px 8px #CCC;
-webkit-box-shadow: 5px 5px 8px #CCC;
box-shadow: 5px 5px 8px #CCC;
}
I'm using tablefilter.js to generate dropdowns at the top of an HTML
table. In a couple of the table rows, I have a span that serves as a
tooltip on hover, so it doesn't show unless a mouse is hovering over it.
<td>
<a class="tooltip" href="#" id="color">Red
<span>
<strong>Favorite Color</strong><br />
If this is not your favorite color,
please make changes on this page.
</span>
</a>
</td>
The problem is that the dropdown text at the top of the column is
including the span, so when a user clicks on the dropdown, it says "Red
Favorite Color If this is not ..." instead of simply "Red."
Is there any way to prevent the tablefilter plugin from grabbing anything
after the initial anchor that says "Red?"
Here's the CSS for the tooltip:
a.tooltip {
outline:none;
text-decoration:none;
}
a.tooltip strong {
line-height:30px;
}
a.tooltip span {
display:none;
line-height:16px;
margin-left:28px;
margin-top:-30px;
padding:14px 20px;
width:240px;
z-index:10;
}
a.tooltip:hover span {
border:1px solid #DCA;
background:#fffAF0;
color:#111;
display:block;
position:absolute;
}
.callout {
border:0;
left:-12px;
position:absolute;
top:30px;
z-index:20;
}
a.tooltip span
{
border-radius:4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
-moz-box-shadow: 5px 5px 8px #CCC;
-webkit-box-shadow: 5px 5px 8px #CCC;
box-shadow: 5px 5px 8px #CCC;
}
Page wont load and server crashes during PHP while loop
Page wont load and server crashes during PHP while loop
I am trying to run a php script that says basically, whilst two cells in
my MySQL database are empty (t_trailerarrival and t_endsort), do
something.
My code is as follows:
<?php
// Start Session, include authentication and dBConnection script
session_start();
include 'dbcon.php';
include 'sql_actuals.php';
$current_time = date("G");
while($query9_row['a_trailerarrival'] == NULL && $query10_row['a_endsort']
== NULL) {
echo "Trailer Arrival";
}
The $queryx_row['abc'] are all in the sql_actuals script that is included
into this script.
For some reason, every time i run this script - my browser wont load the
result (just loads for ever) and then my website at windows azure seems to
crash and take a few minutes to restart.
Could someone please advise if there is a massively obvious error with my
script? or point me at what the possible issue could be.
Many thanks in advance.
FYI, i have tried adding a line sleep(1); so that it gave the server it
runs off a delay before having to run the program again but no luck.
I am trying to run a php script that says basically, whilst two cells in
my MySQL database are empty (t_trailerarrival and t_endsort), do
something.
My code is as follows:
<?php
// Start Session, include authentication and dBConnection script
session_start();
include 'dbcon.php';
include 'sql_actuals.php';
$current_time = date("G");
while($query9_row['a_trailerarrival'] == NULL && $query10_row['a_endsort']
== NULL) {
echo "Trailer Arrival";
}
The $queryx_row['abc'] are all in the sql_actuals script that is included
into this script.
For some reason, every time i run this script - my browser wont load the
result (just loads for ever) and then my website at windows azure seems to
crash and take a few minutes to restart.
Could someone please advise if there is a massively obvious error with my
script? or point me at what the possible issue could be.
Many thanks in advance.
FYI, i have tried adding a line sleep(1); so that it gave the server it
runs off a delay before having to run the program again but no luck.
Parsing stack-trace of a crash
Parsing stack-trace of a crash
In one of my apps I have a very common crash. I have this report in
bugsense : *** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for
empty array
And this stack trace after symbolication:
0 CoreFoundation 0x3796b2a3 + 162
1 libobjc.A.dylib 0x3546b97f objc_exception_throw + 30
2 CoreFoundation 0x378b6b75 + 164
3 CoreData 0x357d9c93 + 1202
4 CoreData 0x357da863 + 1858
5 CoreFoundation 0x378bc037 _CFXNotificationPost + 1426
6 Foundation 0x39992d91 + 72
7 CoreData 0x35768307 + 78
8 CoreData 0x35767867 + 298
9 CoreData 0x356e9c0b + 2698
10 CoreData 0x356e910f + 270
11 CoreFoundation 0x379406cd + 20
12 CoreFoundation 0x3793e9c1 + 276
13 CoreFoundation 0x3793ed17 + 742
14 CoreFoundation 0x378b1ebd CFRunLoopRunSpecific + 356
15 CoreFoundation 0x378b1d49 CFRunLoopRunInMode + 104
16 GraphicsServices 0x355672eb GSEventRunModal + 74
17 UIKit 0x37329301 UIApplicationMain + 1120
18 HiBye 0x000c579d main + 244
19 libdyld.dylib 0x36207b20 + 0
I understand that the problem is in an empty NSMutableArray but I can not
locate the place or at least a potential place in the code. I know that
this trace does not say to much but I will appreciate any idea or
direction that you can get from it that I might not be aware of.
Thanks Shani
In one of my apps I have a very common crash. I have this report in
bugsense : *** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for
empty array
And this stack trace after symbolication:
0 CoreFoundation 0x3796b2a3 + 162
1 libobjc.A.dylib 0x3546b97f objc_exception_throw + 30
2 CoreFoundation 0x378b6b75 + 164
3 CoreData 0x357d9c93 + 1202
4 CoreData 0x357da863 + 1858
5 CoreFoundation 0x378bc037 _CFXNotificationPost + 1426
6 Foundation 0x39992d91 + 72
7 CoreData 0x35768307 + 78
8 CoreData 0x35767867 + 298
9 CoreData 0x356e9c0b + 2698
10 CoreData 0x356e910f + 270
11 CoreFoundation 0x379406cd + 20
12 CoreFoundation 0x3793e9c1 + 276
13 CoreFoundation 0x3793ed17 + 742
14 CoreFoundation 0x378b1ebd CFRunLoopRunSpecific + 356
15 CoreFoundation 0x378b1d49 CFRunLoopRunInMode + 104
16 GraphicsServices 0x355672eb GSEventRunModal + 74
17 UIKit 0x37329301 UIApplicationMain + 1120
18 HiBye 0x000c579d main + 244
19 libdyld.dylib 0x36207b20 + 0
I understand that the problem is in an empty NSMutableArray but I can not
locate the place or at least a potential place in the code. I know that
this trace does not say to much but I will appreciate any idea or
direction that you can get from it that I might not be aware of.
Thanks Shani
Sunday, 8 September 2013
image overlay in RoR
image overlay in RoR
I want to overlay one image on top of another in RoR.
Doing so in plain html is easy (from
http://stackoverflow.com/a/1997397/1760830):
<div style="position: relative; left: 0; top: 0;">
<img src="a.jpg" style="position: relative; top: 0; left: 0;"/>
<img src="b.jpg" style="position: absolute; top: 30; left: 70;"/>
</div>
This code works for me when I put it in a separate file.html. Then in
Rails I do:
<div style="position: relative; left: 0; top: 0">
<%= image_tag "a.jpg", :style => "position:relative; top:0; left:0;" %>
<%= image_tag "b.jpg", :style => "position:absolute; top:30; left:70;
border:thick solid blue;" %>
</div>
but the second image is displayed next to the first one, without any
offset. The second image border is added to the code to check that the
style is actually passed on.
Any ideas why the Rails version doesn't work?
ruby 1.9.3, rails 3.2
I want to overlay one image on top of another in RoR.
Doing so in plain html is easy (from
http://stackoverflow.com/a/1997397/1760830):
<div style="position: relative; left: 0; top: 0;">
<img src="a.jpg" style="position: relative; top: 0; left: 0;"/>
<img src="b.jpg" style="position: absolute; top: 30; left: 70;"/>
</div>
This code works for me when I put it in a separate file.html. Then in
Rails I do:
<div style="position: relative; left: 0; top: 0">
<%= image_tag "a.jpg", :style => "position:relative; top:0; left:0;" %>
<%= image_tag "b.jpg", :style => "position:absolute; top:30; left:70;
border:thick solid blue;" %>
</div>
but the second image is displayed next to the first one, without any
offset. The second image border is added to the code to check that the
style is actually passed on.
Any ideas why the Rails version doesn't work?
ruby 1.9.3, rails 3.2
Ruby on Rails: Saving multiple values in a single database cell
Ruby on Rails: Saving multiple values in a single database cell
How do I save multiple values in a single cell record in Ruby on Rails
applications?
If I have a table named Exp with columns named: Education, Experience, and
Skill, what is the best practice if I want users to store multiple values
such as: education institutions or skills in a single row?
I'd like to have users use multiple text fields, but should go into same
cell record.
For instance if user has multiple skills, those skills should be in one
cell? Would this be best or would it be better if I created a new table
for just skills?
Please advise,
Thanks
How do I save multiple values in a single cell record in Ruby on Rails
applications?
If I have a table named Exp with columns named: Education, Experience, and
Skill, what is the best practice if I want users to store multiple values
such as: education institutions or skills in a single row?
I'd like to have users use multiple text fields, but should go into same
cell record.
For instance if user has multiple skills, those skills should be in one
cell? Would this be best or would it be better if I created a new table
for just skills?
Please advise,
Thanks
AdMob .setTesting(true) at launch
AdMob .setTesting(true) at launch
I've just published an Android app to Google Play. The app displays AdMob
banners. I just realized that I left request.setTesting set to (true). I
know very little about the Java code used to integrate AdMob (it's a
PhoneGap app). Have I left the ads in some kind of test mode? Will they
not run/generate revenue? When I manually install the .apk onto my
devices, the ads run just fine, but the app has yet to show up in the Play
Store.
Code:
adView = new AdView(this, AdSize.BANNER, AdMob_Ad_Unit);
LinearLayout layout = super.root;
layout.addView(adView);
AdRequest request = new AdRequest();
request.setTesting(true);
adView.loadAd(request);
Should I change the value to false? Sorry for the beginner-ish confusion,
but I'm not a Java genius, and this is my first time using AdMob.
I've just published an Android app to Google Play. The app displays AdMob
banners. I just realized that I left request.setTesting set to (true). I
know very little about the Java code used to integrate AdMob (it's a
PhoneGap app). Have I left the ads in some kind of test mode? Will they
not run/generate revenue? When I manually install the .apk onto my
devices, the ads run just fine, but the app has yet to show up in the Play
Store.
Code:
adView = new AdView(this, AdSize.BANNER, AdMob_Ad_Unit);
LinearLayout layout = super.root;
layout.addView(adView);
AdRequest request = new AdRequest();
request.setTesting(true);
adView.loadAd(request);
Should I change the value to false? Sorry for the beginner-ish confusion,
but I'm not a Java genius, and this is my first time using AdMob.
Subscribe to:
Posts (Atom)