|
I have been banging my head for quite sometime over my unit test problem (MSTest VS2012). For some reason all of my test methods are grayed out with white exclamation points in front of them and they can not be selected.
When I do a Clean then Rebuild, the test methods could be selected again. However, when I click Run All, it hangs without crashing or giving me any errors. Eventually I just had to hit cancel.
Please suggest how to fix this issue, thanks.
modified 2-Jun-16 2:57am.
|
|
|
|
|
Ah, yes ... a test for the unit test.
(No, sorry; don't have one. Maybe try NUnit).
|
|
|
|
|
Hi,
I have developed a RESTful windows tray application in C#. I access the public functions of this application from javascript via ajax call to http://localhost:8888/....
In the tray application i have referenced to a vb6 dll.
Now my query...
During the application's execution process, the vb dll shows a message box. Since I am calling the process from web browser, the message box appears behind the browser. Hence, The user has to press alt+tab to see the message, which is costing lot of time.
I want this message box to show up on top of all application all the time.
There is no form element in the tray application and vb6 dll.
Please help me to solve this issue.
Regards
|
|
|
|
|
Don't cross post: you have this posted in QA , so leave it there. Duplicating it an multiple places just duplicates work and annoys people.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
My Apologies... This was my first query posted with code project... Please close this thread. Thank you
|
|
|
|
|
Hi,
I have an requirement where we have some project under Target folder.. for these corrosponding target there will be .cs file in Unittest Folder(which will be created using tool).. based on no of count i can check whether unit test is done for that target.. but I want to check whether logic is implemented or not.
Thanks,
Amit Patel
|
|
|
|
|
well, you either need to
a) parse the .cs file to see if it contains the logic/whatever you're looking for (if its 'simple' you could perhaps use Regexes) or
b) compile the .cs file and use reflection to get the method signatures and compare those to a reference list
(there may be other ways, they strike me as the most obvious)
|
|
|
|
|
Can you Please Regexes sample..
|
|
|
|
|
Also take a look at tools for calculating code coverage of tests. Though they won't tell you if your tests are useful, they will at least show you which lines of your code were reached during the execution of the tests.
|
|
|
|
|
I need to get the popup when the image was browsed using MVC
|
|
|
|
|
Is there a question in there somewhere?
|
|
|
|
|
Yes of course, We need help for cropping image before the file uploaded and after its selection and I need to get that as a popup.
|
|
|
|
|
Still not seeing a question in there. I see things you want to happen but no question as to what code you need help with, and by help I mean that you already have some code in place that isn't working that you need help with. Remember, we don't write entire sections of code for you.
This space for rent
|
|
|
|
|
on seeing all the articles I just had a thought of asking you guys for an article which crops the image before it is uploaded. You can see this example while uploading linkedin profile picture it will ask for crop before uploading. Many people will be grateful if any of you could work on it.
|
|
|
|
|
Member 12551418 wrote: Many people will be grateful if any of you could work on it. Including you because we would be doing your job for you for free. That's not the way this place works.
Now, you could always search in Google to see if anyone has already written something that does this. Bearing in mind that JCrop[^] already does most of the work for you, it doesn't seem unreasonable to expect you to put a little bit of effort into it yourself.
This space for rent
|
|
|
|
|
sorry i was just a student I have already had a search in google but I found those in PHP so I thought of asking here.
If u think it as a mistake please accept my apologies
Sorry for using CODEPROJECT
|
|
|
|
|
You can use CodeProject all you like but you have to realise that members physically couldn't cope with the number of requests for code that come in. What you need to do is break down the effect you are trying to achieve into simple steps - something like this:
1. Get the rectangle from the image that the user has selected.
2. Upload the image along with the rectangle.
3. At the server side, load the image into a temporary bitmap object
4. Apply the same rectangle and crop to it
5. Save the cropped image.
When you break things down like that, you see that things aren't quite as hard, and it shows you what areas you are going to have to research. For instance, cropping a bitmap could be accomplished using the technique here[^].
This space for rent
|
|
|
|
|
<script type="text/javascript"></script>
<script src="~/Scripts/jquery-1.10.2.min.js"></script>>
<script src="~/Scripts/jquery.Jcrop.js"></script>
<script src="~/Scripts/jquery.Jcrop.min.js"></script>
<link href="~/Content/jquery.Jcrop.min.css" rel="stylesheet" />
<form id="form1">
<input type='file' id="imgInp" />
<img id="blah" class="crop" src="#" alt="your image" />
<input type="hidden" id="x" name="x" />
<input type="hidden" id="y" name="y" />
<input type="hidden" id="w" name="w" />
<input type="hidden" id="h" name="h" />
</form>
<style>
#blah {
background-color: #FFF;
width: 500px;
height: 330px;
font-size: 24px;
display: block;
}
</style>
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#blah').attr('src', e.target.result);
$('.crop').Jcrop({
onSelect: updateCoords,
bgOpacity: .4,
setSelect: [100, 100, 50, 50],
aspectRatio: 16 / 9
});
}
reader.readAsDataURL(input.files[0]);
}
}
$("#imgInp").change(function () {
console.log(this);
readURL(this);
});
function updateCoords(c) {
console.log(c);
$('#x').val(c.x);
$('#y').val(c.y);
$('#w').val(c.w);
$('#h').val(c.h);
};
By using this i'm getting "Uncaught TypeError: $(...).Jcrop is not a function"
How could I solve this?
|
|
|
|
|
That's JavaScript and this is a C# forum.
This space for rent
|
|
|
|
|
- This is nothing to do with C#;
- You're including both
jquery.Jcrop.js and jquery.Jcrop.min.js - you only need one of those; - You can't use app-relative paths (
~/... ) in a <script> tag;
If you're using WebForms:
<script src="<%= ResolveUrl("~/Scripts/jquery-1.10.2.min.js") %>"></script>
<script src="<%= ResolveUrl("~/Scripts/jquery.Jcrop.min.js") %>"></script>
<link href="<%= ResolveUrl("~/Content/jquery.Jcrop.min.css") %>" rel="stylesheet" />
If you're using MVC:
<script src="@Url.Content("~/Scripts/jquery-1.10.2.min.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.Jcrop.min.js")"></script>
<link href="@Url.Content("~/Content/jquery.Jcrop.min.css")" rel="stylesheet" />
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
|
here is my table sql :
user----------term
John..........diligent
Jane..........new
I have a variable : termUser
and I find easily its value by Sql request when the user is saved it in the mysql table and this user see his term on the screen by (due to) the variable : termUser.
I try it by 2 way ( by if condition) and those way are correct results
string termUser = String.Empty;
string catchTerm = String.Empty;
while (dataMySqlReader.Read())
{
catchTerm = (string)dataMySqlReader["user"];
if (catchTerm != null)
{
termUser = (string)dataMySqlReader["term"];
}
else
{
termUser = "callow";
}
if (String.IsNullOrEmpty(catchTerm))
{
termUser = "callow";
}
else
{
termUser = (string)dataMySqlReader["term"];
}
}
If the user is not in the mysql table, I think that SQL return 'NULL', so in this case, I want to affect this variable (termUser) by 'callow' : It's only for to display on his monitor.
But my code can not affect my variable.
I changed also my condition but I have not success by this :
if (String.IsNullOrEmpty(catchTerm))
<pre>
if (string.IsNullOrEmpty(catchTerm) == true)
</pre>
how I can affect my variable termUser by 'callow when the user is not in my table ?
Thanks
|
|
|
|
|
A "null" value in a database is not the same an empty string; you might want to compare to <a href="https://msdn.microsoft.com/nl-nl/library/system.dbnull.value%28v=vs.110%29.aspx">DBNull.Value</a>[<a href="https://msdn.microsoft.com/nl-nl/library/system.dbnull.value%28v=vs.110%29.aspx" target="_blank" title="New Window">^</a>] .
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: A "null" value in a database is not the same an empty string You haven't ever worked with an Oracle DB, have you? 
|
|
|
|