I have discovered some differences between WPF 3.0 and WPF 3.5.
As a result, I need to know if an assembly was compiled against 3.0 or 3.5.
Is there a API for this?
var r = /\d/g;
var a = r.test("1"); // will be true
var b = r.test("1"); // will be false
console.log(a == b); // will be false
Please explain to me why the result of r.test("1") alternates with each call?
I was able to work around the issue I was having by removing the g modifier. However I would still like to understand why this happens.
I need to calculate the size of hundreds of folders, some will be 10MB some maybe 10GB, I need a super fast way of getting the size of each folder using C#.
My end result will hopefully be:
Folder1 10.5GB
Folder2 230MB
Folder3 1.2GB
...
I'm looking for a way to get all appenders attached to one logger instance.
I tried:
Hierarchy hierarchy = LogManager.GetRepository() as Hierarchy;
hierarchy.GetAppenders()
as per documentation this returns all appenders for all loggers currently configured.
When I try this:
LogManager.GetLogger("MyLoggerName").Logger.Repository.GetAppenders();
I get the same result.
I would like to retrieve only appenders attached to one logger ("MyLoggerName" in this case)
Were am i wrong?
Thank you.
I have to fetch all the files from a folder and i am using the function GetFiles() like
string[] dirImages = Directory.GetFiles(strPathYearImages + intYear , "*.png");
where strPathYearImages="Images\Holiday\2010\"
but when i write the whole path like
string[] dirImages = Directory.GetFiles(@"E:\IWP\Images\Holiday\"+ intYear , "*.png");
i get the required result.
How to solve this problem? I dont want to use the whole path.
Help me out.
Regards,
Jigar <3
A multi-line string, e.g.
abc 123
456 def
wanted result (ordinal + 2):
cde 345
678 fgh
if I use:
text = "abc 123\n456 def"
add2=''.join(chr(ord(c)+2) for c in text)
print text
print add2
the space and \r \n will also be replaced, how can I add the exception of not including space, \r or \n in the 2nd line of code.
p.s. it's follow up to this question.
My file is:
DIVIDER
Sometext_string
many
lines
of random
text
DIVIDER
Another_Sometext_string
many
many
lines
DIVIDER
Third_sometext_string
....
How change lines following DIVIDER pattern
Result must be:
DIVIDER
[begin]Sometext_string[end]
many
lines
of random
text
DIVIDER
[begin]Another_Sometext_string[end]
many
many
lines
DIVIDER
[begin]Third_sometext_string[end]
....
this is the first controler which is calling my applciation I am getting all my studentinfo for updating studnet
can i call this et in updateresult Action result?
thanks
public ActionResult getresult(StduentInfo et)
{
return PartialView("Student", et);
}
public ActionResult updateresult(Stdentinfo et)
{
return PartialView(et);
}
I have been searching a lot and could not get anything closer (all sliders use same witdh images as nivo slider and etc)
This is the gallery I want to do on a website: http://loscarpinteros.net/#exhibition?i=22
As you can see it load images with different width (on same height) and it has a numeration like 1/5 pics. Do you know any plugin that does this kind of gallery or any script that I can us to get a similar result?
I thought that in GO language, slices are passed by reference. But why the following code doesn't change the content of slice c? Am I missing something? Thank you.
package main
import (
"fmt"
)
func call(c []int) {
c = append(c, 1)
fmt.Println(c)
}
func main() {
c := make([]int, 1, 5)
fmt.Println(c)
call(c)
fmt.Println(c)
}
The result printed is:
[0]
[0 1]
[0]
while I was expecting
[0]
[0 1]
[0 1]
Is there a preferred (not ugly) way of outputting a list length as a string? Currently I am nesting function calls like so:
print "Length: %s" % str(len(self.listOfThings))
This seems like a hack solution, is there a more graceful way of achieving the same result?
The following is my DB data, how can I sorting it by sid and prev_sid with php/mysql!?
sid prev_sid type
000 197 app_home
197 198 page_teach
198 218 page_teach
199 211 page_step
211 207 link
218 559 page_step
559 199 page_step
Result:
sid prev_sid type
000 197 app_home
197 198 page_teach
198 218 page_teach
218 559 page_step
559 199 page_step
199 211 page_step
211 207 link
000 197 198 218 559 199 199 211 207
The whole question is pretty much in the title. For each row of the table I'd like to select the maximum of a subset of columns.
For example, from this table
name m1 m2 m3 m4
A 1 2 3 4
B 6 3 4 5
C 1 5 2 1
the result would be
name max
A 4
B 6
C 5
The query must be compatible oracle 8i.
Thanks.
Hi,
To enable a go back function with an ajax div i have create these simple functions and i was wondering how much data a .js global variable can hold??
var dataAfterSearch; //global variable which holds our search results
function goBackAfterSearch() {
/**
* function which displays the previous state
*
**/
$.ajaxSetup ({
cache: false
});
//alert("Previous Search" +dataAfterSearch);
$('#result').html(dataAfterSearch);
paginateIt();
}
function setDataAfterSearch(data)
{
/**
* function to set the global dataAfterSearch
*
**/
dataAfterSearch = data;
}
kind regards
I'm looking to compare two varchars in SQL, one would be something like Cafe and the other Café is there a way in SQL that will allow the two values to be compared. For instance:
SELECT *
FROM Venue
WHERE Name Like '%cafe%'
So if there is a venue with the name Big Bobs Café Extraordinaire it would be included in the result set?
The following Spotlight query, correctly returns all archive and ISO files on my system:
kind:iso OR kind:archive
However, Spotlight treats .bin files as archives too and returns .bin files in the results as well.
How can I modify the above query and exclude files that end in bin from the result? I tried the following query but it is not working:
(kind:iso OR kind:archive) AND NOT name:*bin
Thanks in advance.
How can I do a multi-level parent-child sort using Linq if I have a table structure like the one below:
[Table: Sections]
Id Seq Name ParentSectionId
1 1 TOP NULL
2 1 AAAA 1
3 2 SSSS 1
4 3 DDDD 1
5 1 SectionA1 2
6 2 SectionA2 2
7 1 SectionS1 3
8 3 ASummary 2
Expected sort result:
TOP
AAAA
SectionA1
SectionA2
ASummary
SSSS
SectionS1
DDDD
Tried to find the answer, but still couldn't.. The table is as follows:
id, keyword, value
1 display 15.6
1 harddrive 320
1 ram 3
So what i need is something like this.. Select an id from this table where (keyword="display" and value="15.6") AND (keyword="harddrive" and value="320")
There's also a possibility that there will be 3 or 4 such keyword conditions which should result into returning one id (one row)
It seems there's something to deal with UNION but i didn't use it before so i can't figure it out
Thanks in advance
I have embedded Lua in a C/C+= application. I want to be able to set a timeout value to prevent getting trapped with badly written scripts that can result in infinite loops (or even string searches that take an infinite time to complete).
Basically, I want to be able to set a time interval and if the script fails to complete running at the end of that time interval, I want to be able to kill the Lua script engine (gracefully, if possible).
Anyone knows of best practise way to do this?
Seems like it would be better if you did commit followed by merge. I'm a little surprised update'ing is even allowed when your working copy has changes. Is this to avoid having commits that have two parents, which result from a merge?
I ve connected my mobile phone to my PC and used this,
string[] lPorts = System.IO.Ports.SerialPort.GetPortNames();
and the result was an array of port names
"COM4"
"COM3"
"COM1"
"COM7"
"COM6"
Now,How to find which serial port is currently used/to which port my mobile phone is connected in c#?
Hey folks,
I have a variable holding values separated by a comma (Implode), I'm trying to get the total count of the values in that variable however, count() is just returning 1.
I've tried converting the comma separated values to a properly formatted array which still spits out1.
So heres the quick snippet where the sarray session equals to value1,value2,value3:
$schools = $_SESSION['sarray'];
$result = count($schools);
Any help would be appreciated.
I have a procedure in asp.net web site that gives strange result sometimes, I’m thinking to add some code to track it. My question is, in the production environment, is there any way that I can get the calling stacks like the one in the exceptions?
thanks.