Hi All,
I am using the following code to disable the anchor tag.Can anyone tell me how to enable it using jquery.
Code:
$("#rightt").attr("disabled", "disabled");
Geetha
Can a VB.NET For loop be constructed that mimics this C# code?
TimeSpan oneDay = TimeSpan.FromDays(1.0);
for (DateTime d = startDate; d < endDate; d += oneDay) {
// some code
}
Obviously you could do it without a For loop (i.e., with a While); I'm just curious if there's a certain syntax to construct a VB.NET For loop with a non-integer increment that I'm not aware of.
I noticed that the following JQuery code doesn't run on the page load, but instead, it only runs after the page loads and I change the size of my browser window.
$(window).resize(function() {
... // dynamically set the height of some div based on the browser viewpoint height
});
Question: How do I get the code above to also run when the page loads?
I am using the GPC Polygon Clipping lib (http://www.cs.man.ac.uk/~toby/alan/software) and want to create a polygon programatically. I only see code for how to create one from a file. How can I do the initialization in my code?
Hi,
I'm new to Java Annotation. I know how to create custom annotation but I don't know how to process that Annotation to generate the dynamic code just like ejb 3.0 and hibernate does.
I read some articles based on APT but no one gives the details about how to process the Annotation.
Are there any tutorials with sample code for processing custom Annotations?
Thanks
how to get varchar as byte[] data using DataReader in Ado.Net? We have tried the following code.
if (!objDataReader.IsDBNull(i))
{
long len = objDataReader.GetBytes(i, 0, null, 0, 0);
byte[] buffer = new byte[len];
objDataReader.GetBytes(i, 0, buffer, 0, (int)len);
}
But the above code gives the error ("Unable to cast object of type 'System.String' to type 'System.Byte[]'.")
I found a nice article:
http://911-need-code-help.blogspot.com/2012/07/youtube-iframe-embeds-video-playlist-and-html5.html
I am using the last option (Custom Playlist). But how to edit the embed code:
<iframe width="560" height="315" src="http://www.youtube.com/embed/T0Jqdjbed40?playlist=SyoA4LXQco4,6l6PPvUhR4c" frameborder="0" allowfullscreen></iframe>
in order to show my playlist name above thumbinails?
i tried to add listname="name", name="name", list="name" but it don't work
I was using xampp to develop locally and then I installed the PHP from the direct installer. Now in some of my PHP code, only PHP code that starts with "<?php" is correctly parsed. Anything that starts with "<?" or "<?=" is completely ignored and just left as is.
How can I adjust the configuration to parse either tokens?
Hiya.
I'm trying to configure that my facebook application will be resizeable.
The docs at http://wiki.developers.facebook.com/index.php/Resizable_IFrame
talk about facebook connect cross-domain receiver URL.
and in the JS code i need to enter the 'site relative url to xd_receiver.htm'.
what's that?
what code should be in that HTML file ?
thanks
JID jid = new JID("[email protected]"); //success with code
SUCCESS
JID jid = new JID("mycomponent.host.domain.com"); //send fail with
code INVALID_ID ,but when i try send from gmail OR jabber to
mycomponent.host.domain.com . it was a success.
Is this a but in google xmpp api?
Hi, I'm looking for examples (code) of applications that uses Flash (NOT Flex) and Remoting classes for ActionScript 3 (NetConnection). Once there was ARP, a repository of code of this kind, but it seems there is not anymore. I'm trying to figure out how to build an applications that makes heavy use of calls to WebORB and responders. I need an architect point of view, NOT a sample of communication between parts, but a real world scenario.
Hi all,
I want to use Flurry to collect some statistics, so I registered and created an app in Flurry. Then, I put the following code in my appDidFinishLaunching:
[FlurryAPI startSession:@"code here"];
Afterwards, I installed the app on my iPhone and ran it - but I don't see any data online. Am I missing something?
And is data also collected from the simulator?
Thanks a lot,
Stefan
I know that dot net dlls and exe contain their assemblies with them so every body can extract code from it. so to tell me how can i create my own dotnet obfuscator and tell me if their exist any other way to protect my application to deassemble. and plez dont give me link of any paid obfuscator. i would prefer code sample in c# or vb.net
Hi all
I need an interface that can be run firstly when the application start.
We can write some code in Application_Start of global.ascx.
Is there any other method to finish it after some configurations in web.config,i don't wanna write any code in global.ascx
You know,we can implement the Interface 'IHttpModule' to diy each request.
But the interface is not fix to application start.
which one is i wanna?
Thanks
How to comment the code in jspx page? I have tried several methods,
<%-- --, but it doesn't not work!
So I have to:
code,
it is really urgly, Is there any other ways?
Any help is appreciated!
Recently, apache2 started using 100% of CPU power:
top gives me
From other, similar threads, I took the tip to use mod_status. Aside from HUGE amounts of NULL requests, it gives:
CPU Usage: u2.16 s1.32 cu0 cs0 - .0835% CPU load
1.2 requests/sec - 17.6 kB/second - 14.6 kB/request
8 requests currently being processed, 42 idle workers
The access and error logs do not show anything surprising or intriguing at all.
Note the .8% CPU usage. Another tip was to use strace:
root@server:~# strace -p 1956
Process 1956 attached - interrupt to quit
restart_syscall(<... resuming interrupted call ...>
And remains like this for at least half an hour, without producing any additional output.
Restarting apache fixed the problem for less than a second
The server runs a few custom python scripts aswell as a django-powered website on apache2 (up-to-date), but even turning the scripts off (or not having them active in the first place) did not change anything.
After I stopped apache and powered my server off, powered it on a few minutes afterwards and restarted all my services, the CPU usage remained low for several hours, just in order to pop up again randomly (?)
The DigitalOcean CPU stats on my server are:
You can see how the CPU usage was super high for almost half a day until I restarted the bot - just to remain stable for several hours and then pop up again.
I am completely at a loss of words and don't know what I could do to find out what piece of my code is giving me these problems or if apache itself is the cause...
Therefore I would greatly appreciate any hints to the questions: What else can I try to do? Which things might I not have checked? Is this definitely in my own code? How do you find what part of python code crashes an app via a infinite loop or similar?
Hi community,
We are currently evaluating options for migrating from hand-written persistence layer to ORM.
We have a bunch of legacy persistent objects (~200), that implement simple interface like this:
interface JDBC {
public long getId();
public void setId(long id);
public void retrieve();
public void setDataSource(DataSource ds);
}
When retrieve() is called, object populates itself by issuing handwritten SQL queries to the connection provided using the ID it received in the setter (this usually is the only parameter to the query). It manages its statements, result sets, etc itself. Some of the objects have special flavors of retrive() method, like retrieveByName(), in this case a different SQL is issued.
Queries could be quite complex, we often join several tables to populate the sets representing relations to other objects, sometimes join queries are issued on-demand in the specific getter (lazy loading). So basically, we have implemented most of the ORM's functionality manually.
The reason for that was performance. We have very strong requirements for speed, and back in 2005 (when this code was written) performance tests has shown that none of mainstream ORMs were that fast as hand-written SQL.
The problems we are facing now that make us think of ORM are:
Most of the paths in this code are well-tested and are stable. However, some rarely-used code is prone to result set and connection leaks that are very hard to detect
We are currently squeezing some additional performance by adding caching to our persistence layer and it's a huge pain to maintain the cached objects manually in this setup
Support of this code when DB schema changes is a big problem.
I am looking for an advice on what could be the best alternative for us. As far as I know, ORMs has advanced in last 5 years, so it might be that now there's one that offers an acceptable performance. As I see this issue, we need to address those points:
Find some way to reuse at least some of the written SQL to express mappings
Have the possibility to issue native SQL queries without the necessity to manually decompose their results (i.e. avoid manual rs.getInt(42) as they are very sensitive to schema changes)
Add a non-intrusive caching layer
Keep the performance figures.
Is there any ORM framework you could recommend with regards to that?
I've been looking over various internet postings and a lot of the code I've seen looks similar to this:
def mactobinar(mac):
addr = ''
temp = mac.replace(':', '')
for i in range(0, len(temp), 2):
addr = ''.join([addr, struct.pack('B', int(temp[i: i + 2], 16)))])
return addr
Can someone explain how this code works?
I am trying to install VisualSVN to manage my code with other users. In the middle of the installation I have a window saying "Change if necessary installation path and initial VisualSVN Server setting". And after that (in the same window) I have two fields: "Location" and "Repositories". What these two parameters mean?
I know URL where the common code is stored. Should I specify this URL in the "repositories" field?
I need to create environment to run potentially untrusted code. Program allowed to connect to preconfigured address:port and nothing else (even read the system time). I have compiled the class whitelist. I'd searched similar questions, but found only template that based on SecurityManager which AFAIK is deprecated.
Can anybody give me a simple sample how to run code in sandbox based on security policies and AccessController?
I am getting a timeout with the following code at readUTF. Any idea why?
hc = (HttpConnection) Connector.open("http://twitter.com/statuses/user_timeline/" + username + ".json");
int rc = hc.getResponseCode();
if (rc != HttpConnection.HTTP_OK) {
throw new IOException("HTTP response code: " + rc);
}
DataInputStream dataInputStream = hc.openDataInputStream();
String list = dataInputStream.readUTF();
Is it possible to have Python save the .pyc files to a separate folder location that is in sys.path?
/code
foo.py
foo.pyc
bar.py
bar.pyc
To:
/code
foo.py
bar.py
/code_compiled
foo.pyc
bar.pyc
I would like this because I feel it'd be more organized. Thanks for any help you can give me.
Can anybody explain why this code does not generate a compiler error?
class Foo
{
public:
int _x;
};
Foo getFoo()
{
Foo myfoo;
myfoo._x = 10;
return myfoo;
}
int _tmain()
{
// should this line of code not be a compiler error?
Foo& badfoo = getFoo();
return 0;
}
this is my view code
<%=collection_check_boxes(nil, :admin_ids, Admin.all, :id, :name )%>
but when i try get the value in the controller i get always an empty value if the user doesnt check any item
and the length is always more than zero
when i write this code
arr = params[:admin_ids] ||= []
puts arr.length
ther arr.length is 1 even if the user doesnt select any of the items
how can i get an array of selected items only with no empty values
I want to load a javascript file at the end of jquery.ready so that the code in my ready handler doesn't have to wait to execute until this large javascript file is loaded.
My jquery.ready code doesn't rely on this javascript file at all.
Would this be a good way to do that?
$(function(){
...
...
$('head').append('<script type="text/javascript" src="/largejs.js"></script>');
});