in wordpress ,
i set a variable in header.php
<?php
$var= 'anything'
?>
but in footer.php when I echo it
<?php
echo $var;
?>
I got no thing printed ... why !
this is my function (with other lines ive tried/abandoned)...
function DoClicked(eNumber) {
//obj.style = 'bgcolor: maroon';
var eid = 'cat' + eNumber;
//$get(obj).style.backgroundColor = 'maroon';
//var nObj = $get(obj);
var nObj = document.getElementById(eid)
//alert(nObj.getAttribute("style"));
nObj.style.backgroundColor = 'Maroon';
alert(nObj.style.backgroundColor);
//nObj.setAttribute("style", "backgroundcolor: Maroon");
};
This error keeps getting returned even after the last line in the function runs:
Microsoft JScript runtime error: Sys.ArgumentUndefinedException: Value cannot be undefined.
Parameter name: method
this function is called with an "OnSuccess" set in my Ajax.ActionLink call (ASP.NET MVC)... anyone any ideas on this? i have these referenced... even when i remove the 'debug' versions for normal versions, i still get an error but the error just has much less information and says 'b' is undefined (probably a ms js library internal variable)...
<script src="../../Scripts/MicrosoftAjax.debug.js" type="text/javascript"></script>
<script src="../../Scripts/MicrosoftMvcValidation.debug.js" type="text/javascript"></script>
<script src="../../Scripts/MicrosoftMvcAjax.debug.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
also, this is how i am calling the actionlink method:
Ajax.ActionLink(item.CategoryName, "SubCategoryList", "Home", New With {.CategoryID = item.CategoryID},
New AjaxOptions With {.UpdateTargetId = "SubCat", .HttpMethod = "Post", .OnSuccess = "DoClicked(" & item.CategoryID.ToString & ")"},
New With {.id = "cat" & item.CategoryID.ToString})
Hello,
My goal is to make a wide map using only one square image.
Using actionscript 3 the solution is to simply make new Bitmap from the Loader:
var loader:Loader = new Loader();
loader.load(new URLRequest("xyz.png"));
this.addChild(loader);
var duplicationBitmap:Bitmap = new Bitmap(Bitmap(loader.content).bitmapData);
Unluckily, Haxe API doesn't allow to do that. I can't get bitmapData from loader content…
Anyone has a clue? Thanks.
My goal is to move a shape in the virtual world in such a way so that it ends up where the mouse pointer is on the canvas.
What i have:
-mouse position (x,y) on a Canvas3D object
-Point3d object of where a pick ray starting from the Canvas3D viewport intersects with the first scene object. (point in 3D space of where i want to start the drag)
What i want:
-Some way to translate the Point3d's coordinates so that the initial point of intersection (the Point3d object) is always overlapping the the mouse position on the canvas (same as when i used the pick ray to determine what the user clicked on from the Canvas3D object).
Thanks!
hey.
im writing a multithreaded winsock application and im having some issues with closing the sockets.
first of all, is there a limit for a number of simultaneously open sockets? lets say like 32 sockets all in once.
i establish a connection on one of the sockets, and passing information and it all goes right.
problem is when i disconnect the socket and then reconnect to the same destination, i get a RST from the server after my SYN.
i dont have the code for the server app so i cant debug it.
when i used SO_LINGER and it sent a RST flag at the end of each session - it worked.
but i dont want to end my connections this way.
when not using SO_LINGER a FIN flag was sent but it seems the connection was not really closed.
any help?
thanks
Why not using array of errors instead of throwing errors and check if it's not empty later in the code.... Exception handling is very confusing to me , I can not understand it's purpose ... can anybody enlighten me !?
they compare it with die() as better not to stop the execution of the code , why would I stop the execution of code if I don't want to !? ofcourse I do
I'm a beginner programmer , it might be confusing to you as well , or because i'm not very experienced in this ugly thing.
Please in the context of PHP only.
hi,
I'm trying to deserialize the following XML node (RDF actually) into a class.
<rdf:Description rdf:about="http://d.opencalais.com/genericHasher-1/dae360d4-25f1-34a7-9c70-d5f7e4cfe175">
<rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Country"/>
<c:name>Egypt</c:name>
</rdf:Description>
[Serializable]
[XmlRoot(Namespace = "http://www.w3.org/1999/02/22-rdf-syntax-ns#", ElementName = "Description")]
public class BasicEntity
{
[XmlElement(Namespace = "http://s.opencalais.com/1/pred/", ElementName = "name")]
public string Name { get; set; }
[XmlAttribute("about", Namespace = "http://www.w3.org/1999/02/22-rdf-syntax-ns#")]
public string Uri { get; set; }
}
The name element is parsed correctly but the about attribute isn't. What am I doing wrong?
I found these questions, but a couple of them were a little old:
http://stackoverflow.com/questions/191556/should-i-pursue-asp-net-webforms-or-asp-net-mvc
http://stackoverflow.com/questions/88787/do-you-think-asp-net-mvc-will-compete-with-asp-net-webforms
http://stackoverflow.com/questions/722637/asp-net-mvc-asp-net-webforms-why
I do not believe these are duplicates and might be old enough that new light can be shed. If not please close this.
I know that no one framework or language is necessarily the only tool for every job. But, do you see MVC eclipsing webforms or webforms going lower on the priority list for Microsoft? They will have to keep webforms for a long time because so many have invested in it, but they don't have to keep adding new functionality for it.
I don't know if this is a good example, but it reminds me of web parts. I never saw much improvement in it from Microsoft. It works and I thought it was great until I started to really try and get a lot out of it. Then from what I could see it just wasn't being pursued by Microsoft that much, though it stayed in Visual Studio. Maybe that's a bad example; just what I remembered.
EDIT: Also, if anyone has any statements from Microsoft on this subject it is appreciated. No offense to anyone. I was only hoping for something official.
If you've used Ruby on Rails, I'm thinking of the feature where the user types
'rails console'
and instantly gets a Ruby console with rails and the current app already loaded.
I want to make something like this for a python program I'm working on, does anyone know how I would get to type say,
'python myPythonConsole.py'
and open up a regular python interpreter but with my program and all its dependencies loaded?
On Java side, we have a servlet filter that handles authentication. We don't have to change all other servlet or JSPs to add authentication to the page, unless the page needs customized content.
How can we achieve the same on PHP? We don't use any frameworks on PHP.
I have run into a strange problem using SQL Server 2000 and two linked server. For two years now our solution has run without a hitch, but suddenly yesterday a query synchronizing data from one of the databases to the other started timing out.
I connect to a server in the production network, which is linked to a server containing orders I need data from.
The query contains a few joins, but basically this summarizes what is done:
INSERT INTO ProductionDataCache
(column1, column2, ...)
SELECT tab1.column1, tab1.column2, tab2.column1, tab3.column1 ...
FROM linkedserver.database.dbo.Table1 AS tab1
JOIN linkedserver.database.dbo.Table2 AS tab2 ON (...)
JOIN linkedserver.database.dbo.Tabl32 AS tab3 ON (...)
...
WHERE tab1.productionOrderId = @id
ORDER BY ...
Obviously my first attempt to fix the problem was to increase the timeout limit from the original 5 minutes. But when I arrived at 30 minutes and still got a timeout, I started to suspect something else was going on. A query just does not go from executing in less than 5 minutes to over 30 minutes over night.
I outputted the SQL query (which was originally in the C# code) to my logs, and decided to execute the query in the Query Analyzer directly on the database server. To my big surprise, the query executed correctly in less than 10 seconds.
So I isolated the SQL execution in a simple test program, and observed the same query time out both on the server originally running this solution AND when running it locally on the database server. Also I have tried to create a Stored Procedure and execute this from the program, but this also times out. Running it in Query Analyzer works fine in less than a few seconds.
It seems that the problem only occurs when I execute this query from the C# program. Has anyone seen such behavior before, and found a solution for it?
UPDATE:
I have now used SQL Profiler on the server. The obvious difference is that when executing the query from the .NET program, it shows up in the log as "exec sp_executesql N'INSERT INTO ...'", but when executing from Query Analyzer it occurs as a normal query in the log.
Further I tried to connect the SQL Query Analyzer using the same SQL user as the program, and this triggered the problem in Query Analyzer as well. So it seems the problem only occurs when connecting via TCP/IP using a sql user.
Hi, I have an MVC view that contains a number of partial views. These partial views are populated using partial requests so the controller for the view itself doesn't pass any data to them. Is it possible to reload the data in one of those partial views if an action was triggered in another? For example, one partial view has a jqGrid and I want to refresh the data in another partial view when a user selects a new row in this grid.
Is there a code example for this scenario (in C#) that I can look at to see what am I doing wrong? I am using ajax calls to trigger a new request but non of the partial views are refreshed so I am not sure if the issue is with the routing, the controller, or if this even possible at all!
Thanks!
i have my auto-generated linq to sql classes, and i extend this class using partial classing (instead of using inheritance), and i have properties that that i've put in later which are not part of the database model and should not be. these are things like "FinalPrice" and "DisplayFinalPrice" - in the dbase, there is only RetailPrice and WholesalePrice so FinalPrice etc are more like extensions of the dbase fields.
when i submit the form with nothing filled in, "FinalPrice" gets called (the 'get' of the property) even tho i never ask for it to be, and even tho it is not needed. this happens before validation, so i don't even get the validation errors i would get.
i've tried using and on the FinalPrice and FinalPriceDisplay properties - no go! why does this happen and how can i stop it from happening? is the modelstate just trying to validate everything so therefore it calls every item no matter what?
for those interested, here is all the code...
Partial Public Class tProduct
'Inherits tProduct
Private Const CommissionMultiplier As Decimal = CDec(1.18)
Private _FinalPrice As Decimal?
Private _DisplayFinalPrice As String
Private _DisplayNormalPrice As String
Public Property CategoryComplete As Short
<ScaffoldColumn(False)>
Public ReadOnly Property FinalPrice As Decimal
Get
'If RetailPrice IsNot Nothing OrElse WholesalePrice IsNot Nothing Then
If _FinalPrice Is Nothing Then
If RetailPrice IsNot Nothing Then
_FinalPrice = RetailPrice
Else
_FinalPrice = WholesalePrice * CommissionMultiplier ' TODO: this should be rounded to the nearest 5th cent so prices don't look weird.
End If
Dim NormalPart = Decimal.Floor(_FinalPrice.Value)
Dim DecimalPart = _FinalPrice.Value - NormalPart
If DecimalPart = 0 OrElse DecimalPart = 0.5 Then
Return _FinalPrice
ElseIf DecimalPart > 0 AndAlso DecimalPart < 0.5 Then
DecimalPart = 0.5 ' always rounded up to the nearest 50 cents.
ElseIf DecimalPart > 0.5 AndAlso DecimalPart < 1 Then
' Only in this case round down if its about to be rounded up to a valeu like 20, 30 or 50 etc as we want most prices to end in 9.
If NormalPart.ToString.LastChr.ToInt = 9 Then
DecimalPart = 0.5
Else
DecimalPart = 1
End If
End If
_FinalPrice = NormalPart + DecimalPart
End If
Return _FinalPrice
'End If
End Get
End Property
<ScaffoldColumn(False)>
Public ReadOnly Property DisplayFinalPrice As String
Get
If _DisplayFinalPrice.IsNullOrEmpty Then
_DisplayFinalPrice = FormatCurrency(FinalPrice, 2, TriState.True)
End If
Return _DisplayFinalPrice
End Get
End Property
Public ReadOnly Property DisplayNormalPrice As String
Get
If _DisplayNormalPrice.IsNullOrEmpty Then
_DisplayNormalPrice = FormatCurrency(NormalPrice, 2, TriState.True)
End If
Return _DisplayNormalPrice
End Get
End Property
Public ReadOnly Property DivID As String
Get
Return "pdiv" & ProductID
End Get
End Property
End Class
more...
i get busted here, with a null reference exception telling me it should contain a value...
Dim NormalPart = Decimal.Floor(_FinalPrice.Value)
Hi guys I'm using this wonderful class here to do a bit of code embed filtering: http://simplehtmldom.sourceforge.net/. It extends the PHP DOM document class.
Pretty much what I am doing is parsing a string through this class that contains embed code, i grab the unique bits of information eg id, width, height send through a handler function which inserts the id, width, height etc into my predefined "safe" template and reinsert my safe template in the place of the embed code the user has put in. May seem a backward way of doing it but it's the way it has to be done :)
All of that works fine. Problem is when there is more than just embed code contained in the string, as I can't just replace the embed code i can only replace the entire string which wipes the rest of the tags etc string. For example if there were a p tag that would be wiped.
So my question is how using this class can i just replace the certain part of the string? Spent the last few days trying to work this out and need some more input. It appears the class can do this so i'm stumped.
Here's a basic version of what i have so far :)
// load the class
$html = new simple_html_dom();
// load the entire string containing everything user entered here
$return = $html->load($string);
// check for embed tags
if($html->find('embed') == true
{
foreach($html->find('embed') as $element)
{
// send it off to the function which returns a new safe embed code
$element = create_new_embed($parameters);
// this is where i somehow i need to save the changes and send it back to $return
}
}
Any input would be gratefully appreciated. If i have explained my problem well enough please let me know :)
I'll let users register their [email protected] ,,, they enter their members area where they can :
1- send emails ( easy to do)
2- receive emails ..
for receiving emails , I'll use a catch all email account , read the email and figure to whom it's sent (username), and then I save it on the database with userid of the username who has registerd !
Do I miss something here ... is it really this simple (if I don't have an email server) ?
I have a small office, and I currently use a Visual Foxpro Application that I wrote to handle all the data.
It is time to buy a new server. It seems that there are problems with VFP and 64 bit operating system. Should I make the move to 64 bit and try to deal with the problems that arise, or buy a new server running the older 32 bit acrhitecture?
The latter would of course require that I use Exchange 2003 instead of 2007 or 2008. Probably no big deal?
I am working on a solution that needs to decrypt PKCS#7 encrypted data, preferably in C#. As far as I can see, the .NET api has support for this through the System.Security.Cryptography.Pkcs namespace. However it seems that the implementation can only work on byte arrays. So what do I do when I have a large encrypted file that does not fit into the memory?
Am I missing something here, or is there another way to do this on a Stream level instead of using bytearrays?
I am making a photo slideshow in flash and would like to be able to load images dynamically from a folder. So that whenever i have a new photo i can just stick it in a folder and have my swf file read from that folder and update the slideshow. Is this doable in actionscript 3.0? if so any pointers would be helpful.
thanks!
The following piece of code can be written in two ways. I would like to know what are the pros and cons of each. If possible I would like to stick with the one liner.
1)
UIColor *background = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"Background.png"]];
self.view.backgroundColor = background;
[background release];
2)
self.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"Background.png"]];
Any issues with releasing memory etc. with #2? I'm new to Objective-C and would like to follow the best approach.
I am not sure how to put the correct title.
but here is the brief explanation.
With Microsoft .NET, i created a server side custom control using C# to be used in ASP.NET pages. I distribute the DLL generated as a component. developers will include that and use in their ASP.NET project.
Likewise, how can i do for Java based web components for to use with JSP or JSF or any other java web frameworks?
Basically, what the title says. I have several properties that combine together to really make one logical answer, and i would like to run a server-side validation code (that i write) which take these multiple fields into account and hook up to only one validation output/error message that users see on the webpage.
I looked at scott guthries method of extending an attribute and using it in yoru dataannotations declarations, but, as i can see, there is no way to declare a dataannotations-style attribute on multiple properties, and you can only place the declarations (such as [Email], [Range], [Required]) over one property :(.
i have looked at the PropertiesMustMatchAttribute in the default mvc 2.0 project that appears when you start a new project, this example is as useful as using a pair of pins to check your motor oil - useless!
i have tried this method, however, creating a class level attribute, and have no idea how to display the error from this in my aspx page. i have tried html.ValidationMessage("ClassNameWhereAttributeIsAdded") and a variety of other thing, and it has not worked. and i should mention, there is NOT ONE blog post on doing validation at this level - despite this being a common need in any project or business logic scenario!
can anyone help me in having my message displayed in my aspx page, and also if possible a proper document or reference explaining validation at this level?
I'm trying to access yahoo mail IMAP server with a php script. I read that yahoo requires a specific IMAP command “ID ("GUID" "1")”. How do I send this command ?