Hi,
How do we do safe JSON parsing with GWT? It looks like the json parser GWT offers uses eval() - is there a different option which uses the native implementations when available?
Thanks
Is anyone out there working with SOAP on Ruby 1.9? Rackspace has email addresses for $2/month and an api to programmatically create/destroy accounts which looks like the best I've found.
Fusemail has $2 addresses too but you need a minimum of 80 to get access to the api.
So, I either need to find a solution to working with Rackspace or a different email host.
Hi there,
I'm looking to calculate the total size of all shared folders (except admin shares) on a number of different servers (consolidating all accessed files to a NAS box for easier backup / restore) but am having a bit of trouble finding a solution.
I'm certain this could be done in powershell but I just can't find the right information to get me going, I can currently spit out a list of all shares on the servers but am not sure where to go from here:
$servers =@(
"server1",
"server2")
foreach($server in $servers)
{
get-WmiObject Win32_Share -computerName $server -filter "Type = 0"
}
Im going through the different options of creating a custom UINavigationBar and since my app is iOS 5+, i am using this code:
// Set the background image all UINavigationBars
[[UINavigationBar appearance] setBackgroundImage:NavigationPortraitBackground
forBarMetrics:UIBarMetricsDefault];
Now i want a custom image button on the very right side and am a bit lost. Should I go another way, subclass UINavigationBar and add a button to it or would there be an easier way?
Is it good to add line-height in body{line-height:1.5} or it would be better if i add separately for tag by tag like p{ line height:1em} etc.
Edit:
body {line-height:in em} create problem with if we put image with float inside
Edit: 24 April 2010:
If i have to add different line heights to elements
like
p { 1.4}
h1 {1.6}
h2 { 1.2}
ul li { 1.1}
then shouldn't i use line height in body { 1.4}
if body { 1.4} and h1 {1.6} then what would be line height for h1?
I use CALayers and I`ve override this delegate
-(void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context
{
//draw some rectangle depends on some custom parameters
}
Then I want to add to this layer another rectangle. And when I call
[layer setNeedsDisplay]
I expect to see 2 different rectangles in layer but I see only last added rectangle.
So please advice me how can I do what I want.
Thank you in advance.
I've got a dropdown box with some items in it that are more popular than others, and I'd like those to have a different background colour (say, Color.AliceBlue) when the combobox is expanded. I see BackColor but is there a way to apply background colour to just a single item?
There are many applications for Windows these days that don't use native windows controls, don't have standard window frames and generally look different. What are some recommended techniques for creating such interfaces?
Hi, I want to use email for signing in, and to allow users to have similar names. One way to do this is to rename login/username field to something different. However, I want to do it just by setting up authlogic. I tried the following
acts_as_authentic do |c|
c.login_field :email
c.validate_login_field false
c.validate_email_field true
end
but it still complains that the login already exists. What must be done to avoid username validation without renaming the field?
I am a bit confused as to why a synchronous call is different to an asynchronous call, as there is never an "immediate" response, it still takes some nano or milliseconds?
After using Git from the command line for a while, I am ready for the convenience a GUI plugin (for Eclipse) can offer.
However, I prefer a Git plugin similar to to MS Visual Studio's Git Source Control Provider which is only a wrapper around the already installed msysgit. I really don't want two different Git implementations accessing the same repository.
EGit sounds perfect - if it can use the already installed msysgit in my PC.
But can it?
I was using the Fiddler core .Net library as a local proxy to record the user activity in web. However I ended up with a problem which seems dirty to solve. I have a web browser say Google Chrome, and the user opened like 10 different tabs each with different web URLs. The problem is that the proxy records all the HTTP session initiated by each pages separately, causing me to figure out using my intelligence the tab which the corresponding HTTP session belonged to. I understand that this is because of the stateless nature of HTTP protocol. However I am just wondering is there an easy way to do this? I ended up with below c# code for that in Fiddler. Still its not a reliable solution due to the heuristics.
This is a modification of the sample project bundled with Fiddler core for .NET 4. Basically what it does is filtering HTTP sessions initiated in last few seconds to find the first request or switching to another page made by the same tab in browser. It almost works, but not seems to be a universal solution.
Fiddler.FiddlerApplication.AfterSessionComplete += delegate(Fiddler.Session oS)
{
//exclude other HTTP methods
if (oS.oRequest.headers.HTTPMethod == "GET" || oS.oRequest.headers.HTTPMethod == "POST")
//exclude other HTTP Status codes
if (oS.oResponse.headers.HTTPResponseStatus == "200 OK" || oS.oResponse.headers.HTTPResponseStatus == "304 Not Modified")
{
//exclude other MIME responses (allow only text/html)
var accept = oS.oRequest.headers.FindAll("Accept");
if (accept != null)
{
if(accept.Count>0)
if (accept[0].Value.Contains("text/html"))
{
//exclude AJAX
if (!oS.oRequest.headers.Exists("X-Requested-With"))
{
//find the referer for this request
var referer = oS.oRequest.headers.FindAll("Referer");
//if no referer then assume this as a new request and display the same
if(referer!=null)
{
//if no referer then assume this as a new request and display the same
if (referer.Count > 0)
{
//lock the sessions
Monitor.Enter(oAllSessions);
//filter further using the response
if (oS.oResponse.MIMEType == string.Empty || oS.oResponse.MIMEType == "text/html")
//get all previous sessions with the same process ID this session request
if(oAllSessions.FindAll(a=>a.LocalProcessID == oS.LocalProcessID)
//get all previous sessions within last second (assuming the new tab opened initiated multiple sessions other than parent)
.FindAll(z => (z.Timers.ClientBeginRequest > oS.Timers.ClientBeginRequest.AddSeconds(-1)))
//get all previous sessions that belongs to the same port of the current session
.FindAll(b=>b.port == oS.port ).FindAll(c=>c.clientIP ==oS.clientIP)
//get all previus sessions with the same referrer URL of the current session
.FindAll(y => referer[0].Value.Equals(y.fullUrl))
//get all previous sessions with the same host name of the current session
.FindAll(m=>m.hostname==oS.hostname).Count==0 ) //if count ==0 that means this is the parent request
Console.WriteLine(oS.fullUrl);
//unlock sessions
Monitor.Exit(oAllSessions);
}
else
Console.WriteLine(oS.fullUrl);
}
else
Console.WriteLine(oS.fullUrl);
Console.WriteLine();
}
}
}
}
};
We are using VB.NET and ASPx for our project. we would like to separate the aspx pages and put them on the IIS server (web server) on one m/c and the business logic and DAL layer on another IIS server (application server) on a different m/c .The database is on another m/c. Is such a configuration possible ? If so how can it be implemented?
I am very bad at regular expressions, but I have a regular expression that is working okay, except for one issue:
/\/(.*?).php/
I only need this regular expression to find things like:
/this-a-valid-page.php {some words here} /anotherpage.php { some words here} http://www.google.com
but do not find URLs the problem i am having is that it find this parts of full URLS i want it to avoid these all together. http://www.google.com/page.php because i have another function that does something different than the filename reg exp.
Hello all,
I'm doing some small projects which involve having different syntaxis for something, however sometimes these syntaxis are so easy that using a parser generator might be overkill.
Now, when should I use a own-made parser, and when should I use a parser generator?
Thanks,
William van Doorn
How to determine whether asp.net (mvc2) application is running under IIS (7) or VS internal web-server?
Clarification why I need this: I'm composing different dependency graph for IoC-container (ninject) that depends on the workaround (develop - when local VS, and production - when IIS)
Or may be another great solution so I can simply differ 3 workarounds: local (VS), test server (IIS) or production server (IIS). How in this case to differ the server? By PC name?
The definition can be seen here.
The candidate answer may be tcp and dst port 80,but can tcp and dst port 80 guarantee it's HTTP traffic and includes all HTTP traffic?
It seems not,because some site can be visited by specifying a different port other than 80 this way:
http://domain.name:8080
So my question is: what's the exact BPF for HTTP?
This is a similar question to one posted earlier, but slightly different. I'm interested in what your favorite Open Source app is. I don't care if it's well coded or if it isn't active anymore, I just am interesteed in apps that work and do something useful. The internet is a big place, so with a few suggestions some of us may find a new favorite app.
When looking beyond the RAD (drag-drop and configure) way of building User Interfaces that many tools encourage you are likely to come across 2 design patterns called Model-View-Controller and Model-View-Presenter. My question has two parts to it:
What issues do these patterns address?
How are they similar?
How are they different?
I'm trying to run several similar services via ServiceBase.Run(ServiceBase[] ) but it's only running the first one. MSDN doesn't explicitly deny this; does this excerpt mean that they all must be different types? (the bold is by me, not MSDN)
Call this overload in the main() function of the service executable to load an array of associated services.
Is there any way to send a key press to a DirectX application using Windows API without activating its window?
I know there is a solution for simple applications, but DirectX handles this quite different...
The solution is preferred in C++, and libraries are OK.
Thanks!
I'm trying to translate a small block of text using Django's build in i18n. I don't know why but the following won't show up in different language:
{% if store.rating_count %}
{% blocktrans with store.rating_count as count %}
{{ count }} review
{% plural %}
{{ count }} reviews
{% endblocktrans %}
{% else %}
{% trans "No reviews" %}
{% endif %}
And a snipplet from my django.po (created with makemessages):
#: templates/reviews/category.html:65
#, python-format
msgid "%(count)s review"
msgid_plural "%(count)s reviews"
msgstr[0] "%(count)s arvostelu"
msgstr[1] "%(count)s arvostelua"
Other strings translate fine from the same template. I have rerun compilemessages few times.
What url encoding a web browser uses while submitting data to server?
with my application i use HttpUtility.UrlEncode(string data)
but do not get result as i get with web browser.
My application submit some text data to forum.
When i am submitting data with web browser (Google Chrome) the exact text i can see submitted to server but when i am submitting using my application it showing some character different.
So is this necessary to submit any data to server must be url encoded?
I am fetching my data from google analytics core api. I came to know that we can fetch only 7 dimensions using api, But here I need to fetch more than 7 dimensions with correct metrics. Is there anyway (other than using paid google analytics) to fetch more than 7 dmensions with correct metrics from google analytics.
If not, then is there any mathematical formula through which we can find intersection of dimensions fetched using 2 different dimensions having one dimension in common.
Thanks