Hi,
in my unit test, the ViewResult.ViewName property is always empty when i use the action name for the view:
return View(model);
or
return View();
Is that by design?
curl -is -F 'J:A-login=BTDT::Action::Login' -F 'J:A:F-address-login=EMAILADDRESS' -F 'J:A:F-password-login=PASSWORD' http://hiveminder.com/splash | grep -o 'JIFTY_SID_HIVEMINDER=[0-9a-f]\+'
In continuation off of this question.
how trigger the action script when browser is closed in flex
what i want is when the browser is closed ,an alert has to be show to continue or not ,later the event to stored in the databse
plz help me
How to disable the delete button using if condition in Extjs for ex;i want to disable the button if it satifies the given if condition else remain enabled.
if(validAction(entityHash.get('entity.xyz'),actionHash.get('action.delete')))
This is the grid Delete button code.
Ext.reg("gridheaderbar-inActive", Ad.GridInActiveButton,{
xtype: 'tbspacer', width: 5
});
Ad.GridCampDeleteButton = Ext.extend(Ext.Toolbar.Button, {
//text: 'Delete',
cls: 'ad-img-button',
width:61,
height:40,
iconCls: 'ad-btn-icon',
icon: '/webapp/resources/images/btn_del.png',
handler:function(){
statusChange(this.parentBar.parentGrid, 'Delete')
}
});
In "get_data" action ,there are some code like this:
def get_data
if params[:p]=='1'
raise "error 1"
elsif params[:p]=='2'
raise 'error 2'
else
return data
end
end
in view:
<script>
$.getJSON('/controller/get_data',function(){...})
</script>
so,when some error has raised,how can i get it!
Tks!
I'm trying to duplicate the drag and reorder action of the icons on the iPhone screen. I did find one page here that offers some insight... but their demo doesn't even work. So the search continues.
I'm new at jQuery, but am getting there. If I could locate a demo of this solution I could work with it.
I already this something
Here is the original code:
<script type='text/javascript'>
function delete_user( id ){
var answer = confirm('Are you sure?');
//if user clicked ok
if ( answer ){
//redirect to url with action as delete and id to the record to be deleted
window.location = 'delete.php?id=' + id;
}
}
</script>
How do I remove the old javascript confirm dialog box and replace it with bootstrap?
While learning Haskell I am wondering when an IO action will be performed. In several places I found descriptions like this:
"What’s special about I/O actions is that if they fall into the main function, they are performed."
But in the following example, 'greet' never returns and therefore nothing should be printed.
import Control.Monad
main = greet
greet = forever $ putStrLn "Hello World!"
Or maybe I should ask: what does it mean to "fall into the main function"?
I have
<form name="feedback" method="post" onsubmit="return checkform()" action="engine.php?ad=">
and I need to append a variable to
engine.php?ad=, which is
<?=$_GET['page'];?> in php (pass a URL param to the next page using this.)
How would I go about adding that?
I also have it in javascript if needed.
I have done strace on my multi-threaded c++ application running on linux
after couple hours of running, none of the threads got run, for about 12 seconds.
I have seen that the unfinished select system call which is called with a timeout was unfinished before the thread was suspended, reported after it resumed that, it took 11.x seconds for the operation to finish.
This is clear indication that the process got starved for a long time.
All threads in the process are created with default scheduling policy(SCHED_OTHER) of linux and default priority.
There are another 5 similar apps running on the same box which are also heavy I/O bound like this app due to heavy data received on the socket. But most of the time, this app is getting scheduled delay. The other apps are created with same sched policy and priority as this i.e. the defaults. why is only this process gets blocked almost all of the time?
Could it be because this process is more I/O intensive as in more busy due to may be higher rates of data? So, the linux dynamic priority adjusting in play here which pushed this process down?
In every modern day IDE and text editor, there is an action to open a file without putting your hand on the mouse. For example:
Eclipse: Cmd|Ctrl+Shift+R - Open Resource
IntellIJ: Cmd|Ctrl+Shift+N - Open File
TextMate: Cmd+T - Go to File
In Xcode, I have found no such options. Please, please tell me I just overlooked it in my growing frustration.
Is there a "Go to file" or "Open File" shortcut in Xcode?
I'm trying to load an image to a div background using the following file structure in the root.
WebContent --
|
zharaimages --
|
[ItemID] --
|
Image.jpg
This is done by jQuery and the file structure is inside the root. The ItemID folder is dynamic and I have to check whether the path exists using jQuery and if the path is not valid, I should go to a default path to fetch the default image. How can I check the path is valid using jQuery. I'm hoping to this can be done without an ajax call.
Can any one help me on a tutorial or an API I can use for this!
UPDATE
The files are on the server. The concept I have is that I have 100s of item elements & I want to load an image for each item element. The images are saved in the server ( a local host ) and the folder hierarchy is divided using the item ID as shown. What I want to do is check whether the image file exists before appending it to the background of the item element div. Is this possible. This is a web application developed using spring.
{"paging": {"pageNum":2,"action":"Next","type":"","availableCacheName":"getAllFunds","selectedCacheName":"","showFrom":101,"showTo":200,"totalRec":289,"pageSize":100},
"Data":[{"sourceCodeId":0,"radio_fund":"individua
l","availableFunds":[],"fundId":288,"searchName":[],"fundName":"Asian Equity Fund A Class Income","srcFundGrpId":"PGI","firstElement":0,"las
tElement":0,"totalElements":0,"pageList":[],"standardExtract":true}]
I have json file with above format with two fileds,one paging and one is Data array.
I able to retrieve values of paging,but i am not able to retrieve the values of data array with .each function of jquery.
Any suggestions or inputs really appreciated.
Is it possible to adapt a method like this function "F"
class C {
public void F(int i);
}
to a delegate like Action<C,int>?
I have this vague recollection that Microsoft was working on supporting this kind of adaptation. But maybe I misremembered!
I have a problem logging onto a page and then using it with cURL.
I login, get PHPSESSID and cookie, and then try to do an action but page returns 'not logged in'.
But if I manually log in and copy/paste that PHPSESSID into curl cookies .txt file, everything works fine. So why doesn't it work with PHPSESSID from cURL?
I'm setting up my website and want to have it so all subdomain requests are rewritten to the appropriate subdirectory. For example
http://projects.karimsa.net/ -> http://karimsa.net/projects/
But I want to use the Apache rewrite mod to do this so that the URL in the browser stays the same. Here is what my config looks like at the moment:
## rewrite subdomains
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.*).karimsa.net
RewriteCond %{HTTP_HOST} !^www.karimsa.net [NC]
RewriteRule ^(.*)$ http://karimsa.net/%1/$1 [R=301,L]
And my CNAME records on 'projects.karimsa.net':
Domain TTL Data Type
projects.karimsa.net 14400 karimsa.net CNAME
Theoretically, I feel this should work. But when I go to the URL, it gives me a server misconfiguration error, my provider's default webpage. What I should see is the index.php under /projects/.
What am I doing wrong? Any help would be appreciated, thanks for reading.
Addition:
I realized I forgot to mention some of the problem. The domain 'karimsa.net' is parked at 'karimsa.x10.mx'. If I set up the same configuration on 'projects.karimsa.x10.mx', the rewrite and CNAME work. But on the parked domain I still get the default webpage.
My debugger does not work when I start project in debug mode.
But when I set checkbox
Allow the source code to different from the original version.
Debugger works. But solution not wokrs properly. For example for files with build action "Content" and Copy to outputDirectory to "Copy if newer" does not copy to bin/Debug
Is anybody know the solution?
I am in search of a programming language with the below characteristics:
it has existing, large and supportive/helpful community
it has consice syntax
it's fast
it can create standalone apps with no dependencies, totally portable and compatible with windows
I can easily set event listeners of almost anything
I can easily do automatically every action possible
has as extensive as possible ready-to-use commands list
works easily with winxp, win com, firefox, etc api
for example, I want to detect that I have clicked a specific button in a webpage in firefox or in a third-party app in windows:
I want to do this easily, not with writing 100 lines of code
$('tr').click(function() {
$("#showgrid").load('/Products/List/Items/');
});
Using this I am handling click event on the row of the table.
How can I handle only on the first column? that is, giving click action to only first column not on entire row?
thanks
I have a requirement where the file should be split using a given character.
Default splitting options are CRLF and LF
In both these cases I am splitting the line by \r\n and \r respectively.
Also I have requirement where any size of file should be processed.
(Processing is basically inserting the given string in a file at given position).
For this I am reading the file in chunk of 1024 bytes.
Then I am applying the string.Split() method.
Split() method gives options for ignoring white spaces and none.
I have to add back these line break characters to the line.
for this I am using a binary writer and I am writing the byte array to the new file.
Issue:-
1) When line break is CRLF, and the split option is NONE, while spaces are also added in the splitted array. Second option is given (to ignore white spaces) CRLF works properly.
2)Bit ignoring white space option creates other problems, as I am reading the file byte by byte I can't ignore a white space.
3)When line break characters are other than default(e.g. '|', a null value is prepended to the resulting line.
Can anybody give solution to my issues?
It's kind of hard to explain, but an example of what I'm wanting to accomplish is like this:
Here is some text | image |
that is printed | |
out in a view and ---------
it is wrapped around an
image that is floating and
right aligned.
I thought about generating the layout in html and using a web view, but I need to be able to perform an action when the user clicks on the image. Does anyone have any ideas?
Thanks in advance,
groomsy
I have an ajax post and in the controller I return nothing. In case there is a failure will the error message displayed with the follwoing code?
[AcceptVerbs(HttpVerbs.Post)]
public void Edit(Model model)
{
model.Save();
}
$.ajax({
type: "POST",
url: '<%=Url.Action("Edit","test") %>',
data: JSON.stringify(data),
contentType: "application/json; charset=utf-8",
dataType: "html",
success: function() {
},
error: function(request, status, error) {
alert("Error: " & request.responseText);
}
});
Hi,
what the syntax is in Action Mailer Basics rails guide ?
class UserMailer < ActionMailer::Base
def welcome_email(user)
recipients user.email
from "My Awesome Site Notifications <[email protected]>"
subject "Welcome to My Awesome Site"
sent_on Time.now
body {:user => user, :url => "http://example.com/login"}
end
end
How should i understand the construction, like
from "Some text for this field"
Is it an assignment the value to a variable, called "from" ?
Is it possible to rewrite the URL in the URL-field on the client's browser?
So when a person clicks on a link on my page something ajax happens (eg a tab shows up) i want the url to display the action without refreshing the page.
Is this possible?