I have some useful wpf buttons to test some functionality. It would be good not to show them in release but in debug indeed.
Doing it from code is easy. But I'd prefer a declarative solution.
I was wondering if there is easy solution to this or I'm stuck with following:
When updating DB:
dti.Pass = Crypter.Encrypt(dti.Pass);
_db.SubmitChanges();
When selecting from DB:
Data.DbTableItem dti = _db.Single(a=a.Id == id);
dti.Pass = Crypter.Decrypt(dti.Pass);
Meaning - I am not really into writing repetitive code and this seems like logical thing to be supported by LINQ; so I'm wondering if it is.
Hi, i need to check the type of a variable in javascript, i know 3 ways to do it:
instanceof operator: if(a instanceof Function)
typeof operator: if(typeof a=="function"
toString method (jQuery uses this): Object.prototype.toString.call(a) == "[object Function]"
Which is the most accurate way to do type checking beetween these solutions? and why? Please don't tell me that the last solution is better only because jQuery uses that.
Hi,
Print Range (From Page: x To Page: y) doesn't work, the printer always print all pages!
Any workaround or solution will be appreciated.
Thanks in advance.
Given a string
'1.2.3.4.5'
I would like to get this output
'1.2345'
I wrote this
function process( input ) {
var index = input.indexOf( '.' );
if ( index ) {
input = input.substr( 0, index + 1 ) +
input.slice( index ).replace( /\./g, '' );
}
return input;
}
Live demo: http://jsfiddle.net/EDTNK/
It works but I was hoping for a slightly more elegant solution...
Hello,
I am trying to run an application outside Joomla (not as a plugin) and I would like to access the logged in user's information (userid). I am wondering how should I go about doing that? Is there a file which I can include? I tried using $_SESSION but it shows empty.
Is there a simple solution to my problem? Thank you for your time.
Not that I would want to use this practically (for many reasons) but out of strict curiousity I would like to know if there is a way to reverse order a string using LINQ and/or LAMBDA expressions in one line of code, without utilising any framework "Reverse" methods.
e.g.
string value = "reverse me";
string reversedValue = (....);
and reversedValue will result in "em esrever"
EDIT
Clearly an impractical problem/solution I know this, so don't worry it's strictly a curiosity question around the LINQ/LAMBDA construct.
We are currently building a WPF solution in Blend 3 and Intellisense is extremely slow.
Visual Studio 2008 and 2010 beta 2 do not have any problems, Blend 2 did not have any issues either.
How would it be possible to disable Intellisense in the XAML editor.
Many Thanks,
KShaban
Hello,
if you have a function "test a b" which returns true if a and b are connected directly and if you have a given unordered list of things, what would be an elegant and fast solution to filter all connected things from given list?
Example:
let test a b = let diff = a - b in diff == 0 ;;
let lst = [4;1;7;3;8;9;2;0] ;;
filter_connected 2 lst ;;
- [4;1;3;2;0]
Any hints?
I am trying to reach methods and properties of ObjectFrame through vb.net.
But when I declared this as
Dim objOLEObject As ObjectFrame
and then trying to instantiate it as
ObjOLEObject = New ObjectFrame
it shows error like:
"429: Retriveing the COM class factory for component with CLSID {3806e95d-e47c-11-cd-8701-00aa003f0f7} failed due to the following error: 80040154"
To resolve this we re-installed both MS-Office 2003 and VS-2005, but could not get the solution.
Could anyone suggest me how to declare and use this in vb.net?
Thanks.
hello Dear
i just need to auto generate id like abc101,abc102,abc103,....abc10n
and it should be store in DB table. and also it should be show in any textbox at runtime .
Please give a proper solution....
Special Thanks in advance :)
Regards.
Pradeep Kodley
Hi
I have been tasked to either find an off the shelf solution or to build inhouse some software that can maintain a list of all of the applications within our business, assign them to the different business areas that use them and list all the servers, documents, knowledge base etc that relate to the app in question.
Does anyone know of any existing software that can do this ?
Regards
I used the mapping solution from this question to have a joined component. But it make hibernate trigger join query to obtain the component event i use fetch="select" in <join>
Please tell me how can i make the joined component lazy init.
Thank you
Hi,
I'm looking for a tool to enumerate all methods and properties on an activeX binary.
Right now, my solution consists in adding the activeX as a reference in a VB6 project, then use the object explorer (F2).
Is there anything quicker than that?
Ms ActiveX Control Pad isn't an option, as it's far less usable than the VB IDE.
Thanks
Hi guys,
In my application I use SoftReference to cache images, it is working fine with active internet connection. And now I need to cache images, so I could use it in offline mode.
What is the best way to implement it?
Use complex solution with SoftReference and database? or maybe SoftReference and local storage (sdcard)?
I would appreciate your advices. Thanks.
I am on OSX Snow Leopard (10.6.2) I can install anything I need to. I would preferably like a Python or Java solution. I have searched on Google and found lots of information on writing my own program to do this, but this is a just a quick and dirty experiment so I don't want to invest a lot of time on writing a bunch of code to do this, I am sure someone else has done this already.
Hi All,
I have ear deployed in jboss 5.0.1, on windows 2008 which is 64 bit machine and we are using 64jvm, with this combination our VFS temp size increases a lot eventually all our physical hard drive space is used by replicating files.
but if we change our JVm from 64 to 32 every thing looks ok.
does any one one what is reason ?and possible solution as we want ot use 64bit jvm.
Thanks
Hello,
I have a Makefile.am file right now that looks like this:
lib_LIBRARIES = foo.a
foo_a_SOURCES = bar.F90 baz.F90
When compiled, bar.F90 gives bar.o. However, bar.F90 depends on several other Fortran files (cat.F90, dog.F90, pig.F90). I want to set up Automake to rebuild bar.o if the source of one of these dependencies change.
I've been reading the GNU manuals for automake/autoconf and was unable to find a solution to this. Thanks for reading.
Lets say I have a integer result and an array of integers, lets say [a,b,c] (not a fixed length). I need to detect if result=a*i +b*j + c*k, with i,j,k=0.
I prefer a solution in C/C# if it is possible.
PS The problem is from a reservation system, a trip can be sold if its durations is a combination of given durations.
Thanks!
My code that give long month name instead short name:
var monthShortName=$.datepicker.formatDate('MM d, yy', new Date(),{ monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun','Jul','Aug','Sep','Okt','Nov','Dec'] });
alert(monthShortNam); // "March" and not like i want "Mar"
Thanks
(I use JQuery 1.7.1 + jQuery UI 1.8.2)
Edit - Eliasson Solution('M' and not 'MM'):
$.datepicker.formatDate('M d, yy', new Date());
In ruby you can throw a rescue at the end of an assignment to catch any errors that might come up. I have a function (below: a_function_that_may_fail) where it's convenient to let it throw an error if certain conditions aren't met. The following code works well
post = {}
# Other Hash stuff
post['Caption'] = a_function_that_may_fail rescue nil
However I'd like to have post['Caption'] not even set if the function fails.
I know I can do:
begin
post['Caption'] = a_function_that_may_fail
recsue
end
but that feels a little excessive - is there a simpler solution?
How do guys suggest to share a constants file between PHP and JavaScript, in order not to repeat code? XML file? I am assuming mixing up javascipt inside PHP would not be the right solution!? Thanks
Hi Everyone:
I am wondering if there is some way to change a css attribute for the last li in a list using CSS. I have looked into using :last-child, but this seems really buggy and I can't get it to work for me. I will use Javascript to do this if necessary, but I want to know if anyone can think up a solution in CSS.
Thanks for any help!
I need to script the conversion of some WMV files to a DVD-Video ISO file suitable for burning and viewing on a Windows system - does anyone have a simple solution that doesn't involve chaining together calls to ffmpeg and pegging my system CPU?