What is the VB Equivalent of the following C# boolean expression?
data.GetType() == typeof(System.Data.DataView)
Note: The variable data is declared as IEnumerable.
I'm developing a frameword for handle Actions from Java Swing components;
I would like to know if there is a way of checking if a given method name (that will be accessed by reflections) exists in compile time, and show a compiler error if not?
Hi,
i have XML schema:
<xsd:complexType name="contactsType">
<xsd:sequence>
<xsd:element name="contact" type="contactType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="visible" type="xsd:boolean" default="true"/>
</xsd:complexType>
and i want to find all contacts which have @visible=true,
//contacts[@visible='true']
but this expression doesn' t return nodes without set @visible like this:
<contacts />
so i want to know if there is any function in XPath which returns also default values of attributes
Thanks
Jan
I have a controller which adds as subviews a custom UIView class called Circle. Let's call a particular instance of Circle, "circle".
I have a method in Circle, animateExpand, which expands the circle by animating the view.
In the following code (which lives in the controller) I want to alloc and init a circle, add it to a NSMutableArray circleArray, animate the expansion, and at the end of the expansion, i want to remove the object from the array. My attempt:
Circle *circle = [[Circle alloc] init];
[circleArray addObject:circle];
[circle animateExpand];
[circleArray removeObjectIdenticalTo:circle];
[circle release];
The problem is [circleArray removeObjectIdenticalTo:circle]; gets called before the animation finishes. Presumbly because the animation is done on a seperate thread. I cant implement the deletion in completion:^(BOOL finished){ }, because the Circle class does not know about a circleArray.
Any solutions would be helpful, thanks!
Hi,
I wrote a python module. Running python filename.py, only checks for syntax errors. Is there a tool, which checks for runtime errors also, like concatenating int with string etc..
Thank you
Bala
HTML:
<ul class="clients">
<li>
<div class="over left">Description</div>
<div class="inner">Image</div>
</li>
</ul>
CSS:
.clients { margin-right: -20px; }
.clients li {
float: left;
width: 128px;
height: 120px;
margin: 0 20px 20px 0;
border: 1px solid #c2c2c2;
}
.clients .over {
display: none;
position: absolute;
width: 250px;
font-size: 11px;
line-height: 16px;
background: #ecf5fb;
margin: 3px 0 0 3px;
padding: 18px;
z-index: 25;
}
.clients .right { margin: 3px 0 0 -161px; }
.clients .inner { width: 128px; height: 120px; overflow: hidden; }
So, we have a list of floated squares and a popup blocks in each, which have absolute position.
JS:
jQuery(function($) {
$('input[title!=""]').hint();
$(".clients li").bind('mouseover mouseout',function(){$(this).find("div.over").toggle()});
});
If over - show, else - hide. Quite ok, but it must be more advanced, we should catch an offset and give a class to .over block:
if offset from right (corner of browser window) less than 150px, then add class "right" for a .over block.
if offset from right more than 150px - add class "left" for a .over block.
How can we do it?
I'm trying to use the Vectorlight spell checker for Silverlight. The demo code comes with the en-US.dic file, but I'm trying to find a compatible one for British English.
I have found one here but it doesn't work. The format seems similar to the en-US one, but it just doesn't work (i.e. it doesn't suggest any words).
I'm using the following code to display a 'previous posts' link on my Wordpress blog.
<nav>
<ul>
<li><?php previous_posts_link('Newer Entries »') ?></li>
</ul
</nav>
Problem is, when there ARN'T any previous posts, while the link doesn't display, I still get
<nav>
<ul>
<li><</li>
</ul
</nav>
Printed out. Is there an if() statement I could wrap around it all so it checks if there are any previous posts, and only prints it out if there are?
I need to be able to select multiple options on a web form, but those options are hierarchical. For example:
Option 1
Option 1 a
Option 1 b
Option 2
The user should be able to select Option 1, or Option 1a, etc. Selecting Option 1 a should automatically select Option 1.
Any controls/solutions out there that fit the bill? (I'm not looking to spend $)
The authlogic rails gem is doing a LOWER in the sql query.
SELECT * FROM `users` WHERE (LOWER(`users`.email) = '[email protected]') LIMIT 1
I want to get rid of the LOWER part since it seems to be slowing down the query by quite a bit.
I'd prefer to just lower the case in the code since this query seems to be expensive.
I'm not sure where to change this behavior in authlogic.
Thanks!
I'm kinda newbie to perl and looking for a script that will handle file moving.
#!/usr/bin/perl -w
$filename = 'DUMBFILE';
$destination = '/some/location/';
if (-e $destination + $filename) {
print "File Exists ! Renaming ..";
move ('/tmp/' + $filename, $destination + $filename + '.1');
} else {
move ('/tmp/' + $filename, $destination + $filename);
}
I'm able to rename it to 1, but i want to be renamed incrementally, like if file.1 exists, rename to .2, and .3 if .2 exists.
That should be easy to do, but i'm kinda lost ..
Hi
I have a table like this:
UID(int) NUMBERS(blob)
----------------------
1 1,13,15,20
2 3,10,15,20
3 3,15
And I would like to test if 3 and 15 are in the blob called NUMBERS. And can see the LIKE %% cannot be used
Only row with ID 2 and three scoulb be selected...
This is my new post regardence of prevoious post with update html code..
http://stackoverflow.com/questions/2994538/jquery-chebox-selection-not-working-in-ie-this-is-working-in-firefox
This is my selectall button code..on clicking this i am selecting all checkboxes..
$('#PbtnSelectAll').click(function() {
$('#PricingEditExceptions input[type=checkbox]').attr('checked', 'checked');
$('#PbtnSubmit').show();
$('#PbtnCancel').show();
$('fieldset').find("input:not(:checkbox),select,textarea").attr('disabled',true);
$('#genericfieldset').find("input,select,textarea").removeAttr('disabled');
});
This code working in Firefox not in IE can anybody help me out why its doing like this?
thanks
I've done a good amount of research on this and found a bunch of reported problems and solutions but the general consensus seems that all change problems in IE6 were fixed in jQuery 1.4.2.
I'm having an issue where a change event is not firing in jQuery 1.4.2, but it did fire successfully in jQuery 1.3.2. This is in IE6.
I'm about to submit a bug for this, but for my sanity I wanted to post it here first to see if there's something dumb I'm missing. I don't understand why this is working this way...
<HTML>
<HEAD>
<TITLE>jQuery 1.4.2 Problem </TITLE>
<script src="jquery-1.4.2.min.js" type="text/javascript"></script>
<script>
$(document).ready( function() {
$("#firstBox").change(function() {
alert("CHANGE");
});
// ONLOAD of document autofocus into the first element...
$("form").find(":input:visible:first").focus()
});
</script>
</HEAD>
<BODY>
<form>
<select id="firstBox">
<option value="" selected="selected">--</option>
<option value="1">One</option>
<option value="2">Two</option>
</select>
<br><br>
<input size="10" id="secondBox">
</form>
</BODY>
</HTML>
Simple enough, right? Onload of the page, give the first element focus. Onchange of the first element, alert.
If you use the mouse, it works as expected. The page loads, the focus is in the drop down, you change the option, you get the alert.
The problem is if you use the keyboard. The page loads, the focus is in the drop down, you press the down arrow. The option changes. Tab off the field, no alert. Weird. To make it even weirder, if you tab back into the field and change it again (all using the keyboard), the change event DOES fire after tab out this time.
Any ideas?
We have large amount of data partitioned on year value using range partition in oracle. We have used range partition but each partition contains data only for one year. When we write a query targeting a specific year, oracle fetches the information from that partition but still checks if the year is what we have specified. Since this year column is not part of the index it fetches the year from table and compares it. We have seen that any time the query goes to fetch table data it is getting too slow.
Can we somehow avoid oracle comparing the year values since we for sure know that the partition contains information for only one year.
I am trying to make a macro in Outlook that will scan the To: list for a certain text string, and spit out a message if all but one (or two, etc) addresses have it. Is there a simple way to do this?
Essentially, I am trying to write something that'll avoid being able to send a restricted message to a bunch of people with the string 'xyz' in the address, if one or more do not have it. AutoComplete makes this difficult, without checking through one-by-one.
Hi All,
I'm working in xmldataprovider and we have configuration value "source" this value may be local file or url
like
c:\data\test.xml --absolute
data\test.xml --relative
or url
http:\mysite\test.xml
how I can determine all this cases in code
I'm working c#
this linq query
var users = from u in context.Users
where u.UserEMailAdresses.Any(e1 => e1.EMailAddress == userEMail) && u.UserPasswords.Any(e2 => e2.PasswordSaltedHash == passwordSaltedHash)
select u;
return users.Count();
returns: 1 even when there is nothing in password table.
how come?
what i am trying to do is get the values of email and passwordHash from two separate tables (UserEMailAddresses and UserPasswords) linked via foreign keys to the third table (Users).
it should be simple - checking if email and password mach from form to database. but it is not working for me.
i get 1 (for count) even when there are NO entries in the UserPasswords table.
is the linq query above completely wrong, or...?
Hello,
I have a link inside a label. The problem is, when user clicks 'back' after having read the terms, the checkbox is unchecked, because when they clicked on the link they also unchecked the box at the same time, since the link is inside a label.
<input type="checkbox" id="terms" name="terms" checked="checked" />
<label for="terms">I agree to be bound by the <a href="/terms">Terms</a></label>
How can I prevent the checkbox from being checked when link is clicked? Tried doing event.preventDefault() on label click, but that doesn't prevent checkbox from being checked/unchecked.
I could just take out the link from inside a label (which means more CSS styling). But now I'm curious whether the above is possible.
Hi all,
for a project we will be doing webbased certificate enrollment, in Vista / Win7 combination with IE this gives some problems if the user does not import the root certificate first and then changes a lot of default IE settings (Enable ActiveX not marked safe for scripting etc....). I was wondering if any of you ever created a test VB or Javascript to test that all the settings are OK. So it can be used by the user before he starts the enrollment process....
greetings,
Tim
Hi,
Given a filename in C, I want to determine whether this file exists and has execute permission on it. All I've got currently is:
if( access( filename, X_OK) != 0 ) {
But this wont search the PATH for files and will also match directories (which I don't want). Could anyone please help?
I am using eclipse with android sdk 3.2
I have some problems to make my broadcast receiver working when the connection is lost.
first I have checked the type of network to make sure I understand well :
ConnectivityManager manager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
boolean is3g = manager.getNetworkInfo(
ConnectivityManager.TYPE_MOBILE)
.isConnectedOrConnecting();
boolean isWifi = manager.getNetworkInfo(
ConnectivityManager.TYPE_WIFI)
.isConnectedOrConnecting();
NetworkInfo info = manager.getActiveNetworkInfo();
if (info != null)
Toast.makeText(getApplicationContext(), info.getTypeName(),
Toast.LENGTH_LONG).show();
else
Toast.makeText(getApplicationContext(), "Pas de connexion",
Toast.LENGTH_LONG).show();
if (!is3g)
Log.i("Network Listener", "DISCONNECTED");
else
Log.i("Network Listener", "CONNECTED");
== this is a mobile network, I'm connected
Then I press F8 or I make :
telnet localhost 5554
gsm data off
to stop the connection
Here is my dynamic broadcast receiver in an activity :
public class ActivityA extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.query);
this.registerReceiver(this.networkStateReceiver, new IntentFilter(
ConnectivityManager.CONNECTIVITY_ACTION));
}
BroadcastReceiver networkStateReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
ConnectivityManager connMgr = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
//i have tried several things : State networkState = networkInfo.getState();
// if (networkState.compareTo(State.DISCONNECTED) == 0) ...
if (networkInfo != null && networkInfo.isConnected()) {
Toast.makeText(getApplicationContext(), "CONNECTED",
Toast.LENGTH_LONG).show();
Log.i("Network Listener", "Connected");
} else {
Toast.makeText(getApplicationContext(), "DISCONNECTED",
Toast.LENGTH_LONG).show();
Log.i("Network Listener", "Network Type Changed");
Intent offline = new Intent(AccountInfoActivity.this,
OfflineWorkService.class);
startService(offline);
}
};
My manifest :
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
The problem is : when the activityA is launched, my broadcast receive something and it displays "Connected"(Log) and my toast. When I turn off the connection manually, nothing happend. My service is not started, log message are not displayed, only toast messages work ...
And even better, when I turn on the connection again (by pressing F8), I test again the type of connection, Toast messages are shown but this time Log messages don't work.
Problems happend when I press F8. Anyway, I think I miss something with broadcast receivers, it's not totally clear.
Please help me.