I have a <div> element which has a background image. On top of that I have some text that is hidden but when the user hovers over the <div> element that text will show and the <div> opacity will lower. My problem is when you hover over the div all elements inside that change opacity as well. I have looked through stackoverflow to see if anyone has the same problem but all i found were answers that had RGBA using background colors (not images).
Here is my css:
.pic{
background-image:url(http://www.granitesportsinstitute.com/wp-content/uploads/2014/06/Green-Sea-Turtle-150x150.jpg);
-webkit-transition: all .3s ease-in-out;
-moz-transition: all .3s ease-in-out;
-o-transition: all .3s ease-in-out;
transition: all .3s ease-in-out;
}
.textstuff{
visibility:hidden;
}
.pic:hover .textstuff{
visibility:visible;
color:black;
}
.pic:hover{
filter: alpha(opacity=30);
-moz-opacity: 0.3;
-khtml-opacity: 0.3;
opacity: 0.3;
}
HTML HERE:
<div class="pic" style="height:150px;width:150px;">
<div class="textstuff">this is text</div>
</div>
rowsUpdated is an int32 to count how many rows are updated
rowsToUpdate = dataset.ParentTable.Select("", "", dataviewRowState.Added)
if rowsToUpdate isNot Nothing then
for each row as datarow in RowsToUpdate
changes the rowstate:
rowsUpdated = rowsUpdated + ParentTableAdapter.update(row)
Next row
End if
I'm sure it's something I'm over looking but I just can't see it.
Thanks in advance,
Joel
Hi, i've got stuck with substring.
On input i've got a string that looks like Sometext (123456). Those digits at the end are random. I need to get only text from that string.
I've got an app that's working pretty flawlessly in Chrome and FF, however, when I view it in IE, all is well until I click on a header element to activate it (jQuery accordion).
What happens then is that I see a brief flash where the content is there, then suddenly the entire left column disappears. This column is generated by a floated label element with a class of ".left" as seen below...
<ul class="menu collapsible">
<li class='expand sectionTitle'><a href='#'>General Settings</a>
<ul class='acitem'>
<li class="section">
<label class="left">This item if floated left with a defined width of 190px via css. This is the item that's disappearing after a brief display</label>
<input class="input" value="input element here" />
<label class="description">This element has a margin-left:212px; set via css in order to be positioned to the right of the label element as if in an adjacent table cell. When I add a max-width property to this element, it disappears in IE too!</label>
</li>
</ul>
</li>
</ul>
As you can see from the comments in the code above (for the two label elements) the description label disappears once I set a max-width on it. It shows up fine otherwise.
I would like to use the EmailField in a form. However, instead of only storing
[email protected]
I want to store
"ACME Support" <[email protected]>
The reason is, that when I send email, I would like a "friendly name" to appear.
Can this be done?
How do I programmatically get the current linked value on a subForm in access. The documented string property subForm.LinkMasterFields throws an error when I try to reference it.
hi guys.
so i have this form and on it is a combo box populated from a database via a SQL method.
and i have another form which allows us to maintain the database table etc.
so i make a new instance of the second form doing:
Form1 frm = new Form2;
frm.show();
once i have done what ever i wanted to do on the second form and i close it, i need to somehow trigger an event or something which will refresh the combo box and the code behind it.
i was thinking of some onchange or focus event for the whole form, the problem is i have 5 of these combo boxes and running all the SQL again.
i also thought of passing somesort of variable thro but then i would still need an event for that.
any ideals would be awesome
I'm working on the BLOG functionality in MVC. I need to be able to create 'blog comments'. So each comment may have a parent comment etc.
Given table "Comments":
CommentId - int - identity autoincrement
PostId - int
ParentId - int
Comment - string
Is there a way to get a list of comments for a given article ordered by CreateDate and ParentId?
Or maybe there is a better table design you may suggest. What is the best design when inserting Post comments like this?
I'm using Entity framework.
thanks
I'm trying to have a templated class (here C) that inherits from another templated class (here A) and perform static member specialization (of int var here), but I cant get the right syntax to do so (if it's possible
#include <iostream>
template<typename derived>
class A
{
public:
static int var;
};
//This one works fine
class B
:public A<B>
{
public:
B()
{
std::cout << var << std::endl;
}
};
template<>
int A<B>::var = 9;
//This one doesn't works
template<typename type>
class C
:public A<C<type> >
{
public:
C()
{
std::cout << var << std::endl;
}
};
//template<>
template<typename type>
int A<C<type> >::a = 10;
int main()
{
B b;
C<int> c;
return 0;
}
I put an example that works with a non templated class (here B) and i can get the static member specialization of var, but for C that just doesn't work.
Here is what gcc tells me :
test.cpp: In constructor ‘C<type>::C()’:
test.cpp:29:26: error: ‘var’ was not declared in this scope
test.cpp: At global scope:
test.cpp:34:18: error: template definition of non-template ‘int A<C<type> >::a’
I'm using gcc version 4.6.3, thanks for any help
My ideal workflow would consist of the following steps
edit the code
compile
git commit -a -m "commit message"
start running the new binaries, tests, etc. (may take 10+ minutes)
start new changes, while the binaries are still running
when step # 4 is finished, edit the commit message from step # 3, without committing the changes introduced in step # 5, by adding, say, "test FOO failed"
I cannot use git commit -a --amend -m "new commit message", because this commits the new changes as well. I'm not sure that I want to bother with staging or branching. I wish I could just edit the commit message without committing any new changes. Is it possible?
I'm a bit confused:
If I have a base class A, and a class B which extends A, can a variable of the type A hold a value of the type B and vice versa?
If yes, why? Aren't they completely different even if B is derived from A? How about type-safety?
If this is possible, what things do I have to mind when taking use of this? How would this work out in terms of performance?
Note: Sorry if I asked too many questions, just ignore them and just look out for those "marked" with the list decoration dot :)
Also, this is not my homework. I'm a hobby programmer and have skills in scripting languages with OOP, yet I'm relatively new to OOP typing in C++.
Hi,
This is the output of my 'git log'. But when I do a 'git pull' , the top commit causes conflict. So I did a 'git rebase -abort'
commit 7826b25db424b95bae9105027edb7dcbf94d6e65
commit 5d1970105e8fd2c7b30c232661b93f1bcd00bc96
But my question is Can I 'save' my commit to a patch and then do a git pull?
Just like I want to emulate
* I did not do a git commit, but I did a 'git stash' instead
* Do a git pull so that I should not get any merge error
So I need to somehow 'turn back the clock'. Is that possible in git?
so i have this form and on it is a combo box populated from a database via a SQL method.
and i have another form which allows us to maintain the database table etc.
so i make a new instance of the second form doing:
Form1 frm = new Form2;
frm.show();
once i have done what ever i wanted to do on the second form and i close it, i need to somehow trigger an event or something which will refresh the combo box and the code behind it.
i was thinking of some onchange or focus event for the whole form, the problem is i have 5 of these combo boxes and running all the SQL again.
i also thought of passing somesort of variable thro but then i would still need an event for that.
any ideals would be awesome
Hi I have a field in mySql table called jobnumber which auto increments with each new entry. What I want to do is when a user views my form, get the value of the next 'jobnumber' . But I want to do this before any entry is made to the table. IE so when a user looks at a form it will display something like 'this is job number 6954'
I have tried $rr = mysql_insert_id() but this only work after I have made an entry
Can anyone help please
thanks
I know how to launch a process with Admin privileges from a process using:
proc.StartInfo.UseShellExecute = true;
proc.StartInfo.Verb = "runas";
where proc is a System.Diagnostics.Process. But how does one do the opposite?
If the process you're in is already elevated, how do you launch the new process without admin privileges? More accurately, we need to launch the new process with the same permission level as Windows Explorer, so no change if UAC is diabled, but if UAC is enabled, but our process is running elevated, we need to perform a certain operation un-elevated because we're creating a virtual drive and if it's created with elevated permissions and Windows explorer is running unelevated it won't show up.
Feel free to change the title to something better, I couldn't come up with a good description
I'm a bit confused by the proper frame sizing of a table view to fit within my screen.
Here's my setup of view controllers within view controllers:
UITabBarController
UINavigationController as one of the tab bar viewcontrollers; title bar hidden
ViewController - a container view controller because I need the option to place some controls beneath the UITableView, sometimes (but not in the current scenario)
UITableViewController
Now, my question is what the proper frame dimensions of the UITableview should be. Here's what I've got in the ViewController viewDidLoad method. I used subtracted 49.0 (the size of the tab bar) from 480.0. However, this leaves a black bar at the bottom. 20.0 appears to do it (coincidentally?) the size of the status bar, but I don't understand why that would be. Wouldn't the true pixel dimensions of the tableview be 480-49?
// MessageTableViewController is my subclass of UITableViewController
MessagesTableViewController *vcMessagesTable = [[MessagesTableViewController alloc] init];
CGRect tableViewFrame = CGRectMake(0, 0, 320.0, 480.0 - 49.0);
[[vcMessagesTable view] setFrame:tableViewFrame];
self.tableViewController = vcMessagesTable;
[self addChildViewController:vcMessagesTable];
[[self view] addSubview:vcMessagesTable.view];
Here's how it looks:
I'm trying to download a lot of files after downloading a sql statement must insert a record.
I'm using System.Net.Client to download each file synchronously, still it could be done asynchronous. There's no relation or dependency between each download.
At first I just tried to use WebClient.DownloadFileAsync but that shutted the program down and killed all the download processes/threads. Second I tried to create a wait routine something like this;
while (processedFiles < totalFiles)
Thread.Sleep(1000)
This freezed everything. So could someone tell me which aproach to take to implement this Async?
I've got a model with a few tiers in it - something along the lines of ...
Company Employees Phone numbers
So I've got a ListBox showing all the companys in the model. Each ListBoxItem then contains two comboboxes ... one for employees, one for phone numbers.
I can successfully get the employee combo to bind correctly and show the right people, but I'd like the phone combo to show the numbers for the selected employee.
I'm just setting the DataContext of the ListBox to the model above and using the following data template for each item
<DataTemplate x:Key="CompanyBody">
<StackPanel Orientation="Horizontal">
<Label Content="{Binding Path=CompanyName}"></Label>
<ComboBox Name="EmployeesCombo" ItemsSource="{Binding Path=Company.Employees}"></ComboBox>
<!-- What goes here -->
<ComboBox DataContext="???" ItemsSource="??" ></ComboBox>
</StackPanel>
</DataTemplate>
I've tried (naively)
<ComboBox ItemsSource="{Binding Path=Company.Employees.PhoneNumbers}" ></ComboBox>
and
<ComboBox DataContext="EmployeesCombo.SelectedValue" ItemsSource="{Binding Path=PhoneNumbers}" ></ComboBox>
and all other manner of combinations ...
I am writing a custom session handler and for the life of me I cannot get a cookie to set in it. I'm not outputting anything to the browser before I set the cookie but it still doesn't work. Its killing me.
The cookie will set if I set it in the script I define and call on the session handler with. If necessary I will post code. Any ideas people?
<?php
/* require the needed classes comment out what is not needed */
require_once("classes/sessionmanager.php");
require_once("classes/template.php");
require_once("classes/database.php");
$title=" "; //titlebar of the web browser
$description=" ";
$keywords=" "; //meta keywords
$menutype="default"; //default or customer, customer is elevated
$pagetitle="dflsfsf "; //title of the webpage
$pagebody=" "; //body of the webpage
$template=template::def_instance();
$database=database::def_instance();
$session=sessionmanager::def_instance();
$session->sessions();
session_start();
?>
and this is the one that actually sets the cookie for the session
function write($session_id,$session_data)
{
$session_id = mysql_real_escape_string($session_id);
$session_data = mysql_real_escape_string(serialize($session_data));
$expires = time() + 3600;
$user_ip = $_SERVER['REMOTE_ADDR'];
$bol = FALSE;
$time = time();
$newsession = FALSE;
$auth = FALSE;
$query = "SELECT * FROM 'sessions' WHERE 'expires' > '$time'";
$sessions_result = $this->query($query);
$newsession = $this->newsession_check($session_id,$sessions_result);
while($sessions_array = mysql_fetch_array($sessions_result) AND $auth = FALSE)
{
$session_array = $this->strip($session_array);
$auth = $this->auth_check($session_array,$session_id);
}
/* this is an authentic session. build queries and update it */
if($auth = TRUE AND $newsession = FALSE)
{
$session_data = mysql_real_escape_string($session_data);
$update_query1 = "UPDATE 'sessions' SET 'user_ip' = '$user_ip' WHERE 'session_id' = '$session_id'";
$update_query2 = "UPDATE 'sessions' SET 'data' = '$session_data' WHERE 'session_id = '$session_id'";
$update_query3 = "UPDATE 'sessions' SET 'expires' = '$expires' WHERE 'session_id' = '$session_id'";
$this->query($update_query1);
$this->query($update_query2);
$this->query($update_query3);
$bol = TRUE;
}
elseif($newsession = TRUE)
{
/* this is a new session, build and create it */
$random_number = $this->obtain_random();
$cookieval = hash("sha512",$random_number);
setcookie("rndn",$cookieval);
$query = "INSERT INTO sessions VALUES('$session_id','0','$user_ip','$random_number','$session_data','$expires')";
$this->query($query);
//echo $cookieval."this is the cookie <<";
$bol = TRUE;
}
return $bol;
}
For simplicity,
class Parent {}
class Child1 : Parent {}
class Child2 : Parent {}
Elsewhere, I created instances of Child1 and Child2 and store it in same vector under Parent:
// . . . in .h file, for example
vector<Parent> vector_of_parent;
// . . . in one particular method
Child1 c1();
Child2 c2();
vector_of_parent.push_back(c1);
vector_of_parent.push_back(c2);
// . . .
Then in another method which has access to vector_of_parent, I tried
void doSomething(Parent& some_child) {
// wrapped in a try block somehow...
Child1& c = dynamic_cast<Child1&> some_child;
// do something if the cast is successful
}
void otherMethod() {
doSomething(vector_of_parent.at(0)); // vector_of_parent.at(0) is a Child1
}
Why is there a std:bad_cast when I call otherMethod()?
I'm having a problem that when my frame is shown (after a login dialog) the buttons are not on correct position, then in some miliseconds they go to the right position (the center of the panel with border layout).
When I make a SSCCE, it works correct, but when I run my whole code I have this fast-miliseconds delay to the buttons to go to the correct place.
Unfortunately, I can't post the whole code, but the method that shows the frame is:
public void login(JComponent userView) {
centerPanel.removeAll();
centerPanel.add(userView);
centerPanel.revalidate();
centerPanel.repaint();
frame.setVisible(true);
}
What would cause this delay to the panel layout? (I'm running everything in the EDT)
-- update
In my machine, this SSCCE shows the layout problem in 2 of 10 times I run it:
import java.awt.BorderLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
public class TEST {
public static void main(String[] args) throws Exception {
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
System.out.println("Debug test...");
JPanel btnPnl = new JPanel();
btnPnl.add(new JButton("TEST"));
JFrame f = new JFrame("TEST");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().setLayout(new BorderLayout());
f.getContentPane().add(btnPnl);
f.pack();
f.setSize(800, 600);
f.setVisible(true);
System.out.println("End debug test!");
}
});
}
}
The button first appers in the up-left, and then it goes to the center.
Please, note that I'm understand, not just correct. Is it a java bug?
--update
OK, so the SSCCE don't show the problem with you that tried till now.
Maybe it's my computer performance problem. But this don't answer the question, I still think Java Swing is creating new threads for make the layout behind the scenes.
I am populating a list using
List<Country> countries = new List<Country>
{
new Country()
{
CountryID = "US",
City = new List<City> {
new City()
{
CountryID = "US", CityName="dfdsf", sqkm = 2803
}
}
};
and so on
How to access sqkm in the following query?
var countryQuery = countries
.Select(c => new { Id = c.CountryId, Area = c.City.sqkm???});
c.city.sqkm gives compilation error...how to modify query