How to refer to figure I clicked to change its properties and move it?
I have a figure in canvas in WPF application. This figure is generated by
program (I click a button and then a figure appears). How to order the
Figure_MouseLeftButtonDown function to change some properties of THIS
figure? Also I want to move this figure by dragging. Now I have something
like this: var ell = new Ellipse() { Name = "FirstEllipse", Width = 150,
Height = 100, Margin = new Thickness(200, 150, 0, 0), Fill = Brushes.Red
}; ell.MouseLeftButtonDown += Ellipse_MouseLeftButtonDown;
canvas.Children.Add(ell); private void Figure_MouseLeftButtonDown(object
sender, MouseButtonEventArgs e) { sender.SetValue(Ellipse.FillProperty,
Brushes.Aquamarine);}
Thursday, 3 October 2013
Wednesday, 2 October 2013
needed to remove image extension using htaccess
needed to remove image extension using htaccess
I need to change or redirect the "example.com/photos/logo.jpg" to
"example.com/photos/logo" when user comes from google image search.
Therefore I've used RewriteCond %{REQUEST_URI}
photos/.*.(gif|jpg|jpeg|png)$ [NC] RewriteCond %{HTTP_REFERER}
^http://www.google.[a-z]{2,4}(.[a-z]{2,4})?/url\?.*$ [NC,OR] RewriteCond
%{HTTP_REFERER} ^http://www.bing.com/images/search?q=\?.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} !^http://example.com/.*$ [NC] RewriteCond
%{HTTP_USER_AGENT} !(.bot.|slurp) [NC] RewriteRule ^gallery/(.*) /$1
[L,R=301]
Thank you.
I need to change or redirect the "example.com/photos/logo.jpg" to
"example.com/photos/logo" when user comes from google image search.
Therefore I've used RewriteCond %{REQUEST_URI}
photos/.*.(gif|jpg|jpeg|png)$ [NC] RewriteCond %{HTTP_REFERER}
^http://www.google.[a-z]{2,4}(.[a-z]{2,4})?/url\?.*$ [NC,OR] RewriteCond
%{HTTP_REFERER} ^http://www.bing.com/images/search?q=\?.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} !^http://example.com/.*$ [NC] RewriteCond
%{HTTP_USER_AGENT} !(.bot.|slurp) [NC] RewriteRule ^gallery/(.*) /$1
[L,R=301]
Thank you.
Approach while learning Algorithms
Approach while learning Algorithms
I am learning algorithms and came to this Hanoi Tower. I know how to do
that practically. But I am unable to code it. I haven't read the given
code yet. I am trying it first myself. What should be my approach-keep
trying or read the given code or something else?
Should this approach be followed with all the algorithms?
I am learning algorithms and came to this Hanoi Tower. I know how to do
that practically. But I am unable to code it. I haven't read the given
code yet. I am trying it first myself. What should be my approach-keep
trying or read the given code or something else?
Should this approach be followed with all the algorithms?
FFmpeg on Android - Unable to find a suitable output format
FFmpeg on Android - Unable to find a suitable output format
I want to reduce the resolution of a video before edit it, so I´m using
ffmpeg on android. I´m using the executable/binary file of ffmpeg and I´m
calling my ffmpeg commands like that:
./ffmpeg -i /sdcard/dcim/video.mp4 -s 320x240 -r 10 -y /sdcard/output.mp4
But when I try this command I get this error:
Unable to find a suitable output format for /sdcard/output.mp4
This is the output when I use the adb shell:
The only action I have been able to do is to extract the audio of a video
and save it as a mp3 using this command:
./ffmpeg -i /sdcard/dcim/video.mp4 -y /sdcard/output.mp3
That works well but this is the only action I can do... Any idea of why I
can´t convert a video? (I can´t copy it too) Thanks!!
I want to reduce the resolution of a video before edit it, so I´m using
ffmpeg on android. I´m using the executable/binary file of ffmpeg and I´m
calling my ffmpeg commands like that:
./ffmpeg -i /sdcard/dcim/video.mp4 -s 320x240 -r 10 -y /sdcard/output.mp4
But when I try this command I get this error:
Unable to find a suitable output format for /sdcard/output.mp4
This is the output when I use the adb shell:
The only action I have been able to do is to extract the audio of a video
and save it as a mp3 using this command:
./ffmpeg -i /sdcard/dcim/video.mp4 -y /sdcard/output.mp3
That works well but this is the only action I can do... Any idea of why I
can´t convert a video? (I can´t copy it too) Thanks!!
Collect a specific text string from a very large text string in SQL Server
Collect a specific text string from a very large text string in SQL Server
I have a very large text string in a column (column name: path) of a table
(table name: KYC_Path). The table basically contains very large text
string of image paths from which I need to extract a specific number (file
number). The text strings look like this:
F:\Original\15561 done\sohan1
15561\output_after_name_mapping\01710043429(1).jpg
T:\ALL BACKUP\BACK UP 1TB(SERVER)\ALL SCANNED FILES(sohan)\01832876657
(1).JPG
T:\ALL BACKUP\form 2TB passport HDD\All backup\Afren\24313\24313
Nupur_1box 651\output_after_name_mapping\01918082763(1).jpg
T:\ALL BACKUP\zaman all scan\16830 noboni1
box548\output_after_name_mapping\01823152145(1).jpg
I need to collect just following numbers (file name with out the (1).jpg
part), so that my new column will look like this:
01710043429
01832876657
01918082763
01823152145
I have already devised a method where use following formula:
select (right ([path],18)) as 'wallet_path', [path] into KYCPathNew
from [dbo].[KYCPath]
select (left ([wallet_path],11)) as 'wallet_path_new', [path] into
KYCPathNew2
from [dbo].[KYCPathNew]
However that gives some issues to some rows where file name do not come
correctly due to spaces between numbers (01823152145) and file extension
((1).jpg). And misses one or two characters from the file name.
Is there any other way so that I can collect all the file names more
efficiently? Can I make SQL Server find the last back slash and then take
11 digits from there? How?
I have a very large text string in a column (column name: path) of a table
(table name: KYC_Path). The table basically contains very large text
string of image paths from which I need to extract a specific number (file
number). The text strings look like this:
F:\Original\15561 done\sohan1
15561\output_after_name_mapping\01710043429(1).jpg
T:\ALL BACKUP\BACK UP 1TB(SERVER)\ALL SCANNED FILES(sohan)\01832876657
(1).JPG
T:\ALL BACKUP\form 2TB passport HDD\All backup\Afren\24313\24313
Nupur_1box 651\output_after_name_mapping\01918082763(1).jpg
T:\ALL BACKUP\zaman all scan\16830 noboni1
box548\output_after_name_mapping\01823152145(1).jpg
I need to collect just following numbers (file name with out the (1).jpg
part), so that my new column will look like this:
01710043429
01832876657
01918082763
01823152145
I have already devised a method where use following formula:
select (right ([path],18)) as 'wallet_path', [path] into KYCPathNew
from [dbo].[KYCPath]
select (left ([wallet_path],11)) as 'wallet_path_new', [path] into
KYCPathNew2
from [dbo].[KYCPathNew]
However that gives some issues to some rows where file name do not come
correctly due to spaces between numbers (01823152145) and file extension
((1).jpg). And misses one or two characters from the file name.
Is there any other way so that I can collect all the file names more
efficiently? Can I make SQL Server find the last back slash and then take
11 digits from there? How?
Tuesday, 1 October 2013
About SQL SERVER LEFT JOIN and Group by
About SQL SERVER LEFT JOIN and Group by
I have two tables,Blog table has a FK BlogTagID column point to BlogTag
table:
Blog table:
BlogID BlogTagID BlogTitle
1 2 test1
2 1 test2
3 2 test3
BlogTag table:
BlogTagID BlogTagName
1 JAVA
2 .NET
3 PHP
I would like to get the result:
BlogTagName count
JAVA 1
.NET 2
PHP 0
How to get this?Thank you very much!
I have two tables,Blog table has a FK BlogTagID column point to BlogTag
table:
Blog table:
BlogID BlogTagID BlogTitle
1 2 test1
2 1 test2
3 2 test3
BlogTag table:
BlogTagID BlogTagName
1 JAVA
2 .NET
3 PHP
I would like to get the result:
BlogTagName count
JAVA 1
.NET 2
PHP 0
How to get this?Thank you very much!
Hide/unhide table row given the row index and table ID
Hide/unhide table row given the row index and table ID
Currently I have this code to delete a table row:
var remove = document.getElementById(rid);
if(remove!=null){
var v = remove.parentNode.parentNode.rowIndex;
document.getElementById(tid).deleteRow(v);
}
However, instead of delete it, I'd just like to hide it. What's a good way
to do this?
Also, in the future, I'm going to want to 'unhide' it at user request, so
how can I check if it has been hidden? The if(remove!=null) is what
checked if a row was already removed, so I'd need something similar. If
the row is hidden, I would unhide it.
Thank you for your time.
Currently I have this code to delete a table row:
var remove = document.getElementById(rid);
if(remove!=null){
var v = remove.parentNode.parentNode.rowIndex;
document.getElementById(tid).deleteRow(v);
}
However, instead of delete it, I'd just like to hide it. What's a good way
to do this?
Also, in the future, I'm going to want to 'unhide' it at user request, so
how can I check if it has been hidden? The if(remove!=null) is what
checked if a row was already removed, so I'd need something similar. If
the row is hidden, I would unhide it.
Thank you for your time.
PS6000 showing packet errors but no errors appear on the switch
PS6000 showing packet errors but no errors appear on the switch
We have a loaned PS6000E SAN that we are using to relocate our iSCSI LUNs
off our current PS4000E SAN to upgrade it from Seagate Moose drives under
a proactive replacement plan by Dell. We've connected it up to our stack
of Dell PowerConnect 6248 switches that make up our client stack (because
our Cisco stack is currently full - another is on order so we can extend
it and give our server network room to grow) and while it connects to our
existing stack and we've successfully moved a LUN across, there are
numerous errors on the Ethernet connectors that are giving us cause for
concern.
Our other two SANs are connected to our Cisco stack and show no errors at
all. They connect to the Dell stack via a fibre link which does not have
jumbo frames turned on.
We are not particularly keen on moving across the remainder of the LUNs
until we resolve this issue. Is there something on the switch we need to
configure that I'm missing? Should I not be using the PC6248s for this and
should I wait for our new Cisco switch to arrive? Am I getting myself into
a fuss over nothing?
EDIT: I noticed spanning tree was turned on for the ports and turned off
for the SAN ports on the Cisco switch. Turning it off has done nothing to
stem the errors coming from this thing. I ensured that the MTU was 9000
across the board and it hasn't made a difference. All cables are CAT6.
Turning off LLDP made no difference. Someone requested a diagram, which is
below.
We have a loaned PS6000E SAN that we are using to relocate our iSCSI LUNs
off our current PS4000E SAN to upgrade it from Seagate Moose drives under
a proactive replacement plan by Dell. We've connected it up to our stack
of Dell PowerConnect 6248 switches that make up our client stack (because
our Cisco stack is currently full - another is on order so we can extend
it and give our server network room to grow) and while it connects to our
existing stack and we've successfully moved a LUN across, there are
numerous errors on the Ethernet connectors that are giving us cause for
concern.
Our other two SANs are connected to our Cisco stack and show no errors at
all. They connect to the Dell stack via a fibre link which does not have
jumbo frames turned on.
We are not particularly keen on moving across the remainder of the LUNs
until we resolve this issue. Is there something on the switch we need to
configure that I'm missing? Should I not be using the PC6248s for this and
should I wait for our new Cisco switch to arrive? Am I getting myself into
a fuss over nothing?
EDIT: I noticed spanning tree was turned on for the ports and turned off
for the SAN ports on the Cisco switch. Turning it off has done nothing to
stem the errors coming from this thing. I ensured that the MTU was 9000
across the board and it hasn't made a difference. All cables are CAT6.
Turning off LLDP made no difference. Someone requested a diagram, which is
below.
What does the second index mean in probability distribution in finite events space definition math.stackexchange.com
What does the second index mean in probability distribution in finite
events space definition – math.stackexchange.com
In one of the books I have found such definition: Let $\Omega$ be
countable space $$\Omega=\{ \omega_1, \omega_2,... \}$$ For single element
events function P is defined as follows: $$ P(\{ ...
events space definition – math.stackexchange.com
In one of the books I have found such definition: Let $\Omega$ be
countable space $$\Omega=\{ \omega_1, \omega_2,... \}$$ For single element
events function P is defined as follows: $$ P(\{ ...
Subscribe to:
Comments (Atom)