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 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 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!
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?
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
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 $)
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?
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...
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 ..
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!
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.
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?
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.
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,
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?
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 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#
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.
I have to find recursively if there is any repeated element in an integer array v.
The method must have the following signature:
boolean hasRepeatedElements(int[] v)
I can't see any way of doing that recursively without having to define another method or at least another overload to this method (one that takes for example the element to go after or something). At first I thought about checking for the current v if there is some element equal to the first element, then creating a new array with L-1 elements etc but that seems rather inefficient. Is it the only way?
Am I missing here something?
I have something like this:
<form>
<input id='roles' name='roles' type='checkbox' value='1' />
<input id='roles' name='roles' type='checkbox' value='2' />
<input id='roles' name='roles' type='checkbox' value='3' />
<input id='roles' name='roles' type='checkbox' value='4' />
<input id='roles' name='roles' type='checkbox' value='5' />
<input type='submit' value='submit' />
<form>
I would like to validate that at least one checkbox (roles) should be checked, is it possible with jquery.validate ?
Since upgrading to VS2010 I'm getting some very strange behavior with the 'is' keyword.
The program below (test.cs) outputs True when compiled in debug mode (for x86) and False when compiled with optimizations on (for x86). Compiling all combinations in x64 or AnyCPU gives the expected result, True.
All combinations of compiling under .NET 3.5 give the expected result, True.
I'm using the batch file below (runtest.bat) to compile and test the code using various combinations of compiler .NET framework.
Has anyone else seen these kind of problems under .NET 4.0?
Does everyone else see the same behavior as me on their computer when running runtests.bat?
#@$@#$??
Is there a fix for this?
test.cs
using System;
public class Program
{
public static bool IsGuid(object item)
{
return item is Guid;
}
public static void Main()
{
Console.Write(IsGuid(Guid.NewGuid()));
}
}
runtest.bat
@echo off
rem Usage:
rem runtest -- runs with csc.exe x86 .NET 4.0
rem runtest 64 -- runs with csc.exe x64 .NET 4.0
rem runtest v3.5 -- runs with csc.exe x86 .NET 3.5
rem runtest v3.5 64 -- runs with csc.exe x64 .NET 3.5
set version=v4.0.30319
set platform=Framework
for %%a in (%*) do (
if "%%a" == "64" (set platform=Framework64)
if "%%a" == "v3.5" (set version=v3.5)
)
echo Compiler: %platform%\%version%\csc.exe
set csc="C:\Windows\Microsoft.NET\%platform%\%version%\csc.exe"
set make=%csc% /nologo /nowarn:1607 test.cs
rem CS1607: Referenced assembly targets a different processor
rem This happens if you compile for x64 using csc32, or x86 using csc64
%make% /platform:x86
test.exe
echo =^> x86
%make% /platform:x86 /optimize
test.exe
echo =^> x86 (Optimized)
%make% /platform:x86 /debug
test.exe
echo =^> x86 (Debug)
%make% /platform:x86 /debug /optimize
test.exe
echo =^> x86 (Debug + Optimized)
%make% /platform:x64
test.exe
echo =^> x64
%make% /platform:x64 /optimize
test.exe
echo =^> x64 (Optimized)
%make% /platform:x64 /debug
test.exe
echo =^> x64 (Debug)
%make% /platform:x64 /debug /optimize
test.exe
echo =^> x64 (Debug + Optimized)
%make% /platform:AnyCPU
test.exe
echo =^> AnyCPU
%make% /platform:AnyCPU /optimize
test.exe
echo =^> AnyCPU (Optimized)
%make% /platform:AnyCPU /debug
test.exe
echo =^> AnyCPU (Debug)
%make% /platform:AnyCPU /debug /optimize
test.exe
echo =^> AnyCPU (Debug + Optimized)
Test Results
When running the runtest.bat I get the following results on my Win7 x64 install.
> runtest 32 v4.0
Compiler: Framework\v4.0.30319\csc.exe
False => x86
False => x86 (Optimized)
True => x86 (Debug)
False => x86 (Debug + Optimized)
True => x64
True => x64 (Optimized)
True => x64 (Debug)
True => x64 (Debug + Optimized)
True => AnyCPU
True => AnyCPU (Optimized)
True => AnyCPU (Debug)
True => AnyCPU (Debug + Optimized)
> runtest 64 v4.0
Compiler: Framework64\v4.0.30319\csc.exe
False => x86
False => x86 (Optimized)
True => x86 (Debug)
False => x86 (Debug + Optimized)
True => x64
True => x64 (Optimized)
True => x64 (Debug)
True => x64 (Debug + Optimized)
True => AnyCPU
True => AnyCPU (Optimized)
True => AnyCPU (Debug)
True => AnyCPU (Debug + Optimized)
> runtest 32 v3.5
Compiler: Framework\v3.5\csc.exe
True => x86
True => x86 (Optimized)
True => x86 (Debug)
True => x86 (Debug + Optimized)
True => x64
True => x64 (Optimized)
True => x64 (Debug)
True => x64 (Debug + Optimized)
True => AnyCPU
True => AnyCPU (Optimized)
True => AnyCPU (Debug)
True => AnyCPU (Debug + Optimized)
> runtest 64 v3.5
Compiler: Framework64\v3.5\csc.exe
True => x86
True => x86 (Optimized)
True => x86 (Debug)
True => x86 (Debug + Optimized)
True => x64
True => x64 (Optimized)
True => x64 (Debug)
True => x64 (Debug + Optimized)
True => AnyCPU
True => AnyCPU (Optimized)
True => AnyCPU (Debug)
True => AnyCPU (Debug + Optimized)
tl;dr