#springFormInput Sytex problem - spring-mvc

#springFormInput("userForm.password" 'type="password"') is not working;
is it correct?

Use #springFormPasswordInput("userForm.password" "")
(list of all macros)

Related

Using audio_play_sound() in a if statement GameMaker

I am trying to use the command:
audio_play_sound()
I am trying to insert it into this piece of code, so that when the player jumps, a sound plays.
if (key_jump) && (jumps > 0)
{
jumps -=1;
vsp = -jumpspeed;
}
Code that causes problem:
if (key_jump) && (jumps > 0)
{
jumps -=1;
vsp = -jumpspeed;
audio_play_sound(snd_jump)
}
Simply inserting the line into the if statement does not work, and gives the error WRONG NUMBER OF ARGUMENTS IN FUNCTION. This is rather confusing, perhaps I am using the wrong command? Thanks in advance
The problem is stated in the error, you're providing the wrong number of arguments to the audo_play_sound function.
from the docs
audio_play_sound(index, priority, loop);
As the person above states your answer is audio_play_sound(snd_jump, 1, false).

How to make all the attributions in the css selector into one line with vim?

Here is my css part of css file.
body{
width:1100px;
height:800px;
}
div.main{
margin:20px auto 0 auto;
background-color:#f7f7f7;
}
I want to rewrite it as below.
body{width:1100px;height:800px;}
div.main{margin:20px auto 0 auto;background-color:#f7f7f7;}
All attritutions and values rewritten as only one line,is there a smarty vim command to do the job?
One option would be
g/{/,/}/j
which breaks down as
g start a global command
{ search for {
,/}/ for each match, set a range up until the }
j join the range
Note that this might be to naïve as-is. This doesn't take into account nested brackets. You might first want to set a visual range to the textblock you like to change.
You could use the J or gJ (alternative that doesn't add spaces) commands. They can be run in visual mode to join all selected lines, or take a count.
Alternatively, the splitjoin.vim plugin provides specific support for css rules as you are asking. With the cursor over the first line of the css block, type gJ to join the whole block into a single line.
Either way, you may want/need to run a replace to remove leading spaces before joining - :s/^\s\+// before joining the lines.
EDIT: I guess a 'smarty' way to do this, and without using plugins, would be the following macro: vf}:s/^\s\+/^MgvgJ (the ^M means pressing the enter key - you may have to enter the macro manually to get this). Use it by putting the cursor at the beginning of the line at the top of the css rule you want to rewrite.
As #romainl said, you should use a minifier. However I am going to assume what you really want is a way to glance at your css rules quickly. If that is the case then I suggest you look into folding. #Luc Hermitte gave a great answer on this subject on the post: Using vi, how can I make CSS rules into one liners?
Below is a variant of #Luc Hermitte answer. Put the following in ~/.vim/ftplugin/css_fold.vim:
let b:width = 25
" Use the following mappings to adjust the foldtext "columns"
nnoremap <silent> <buffer> >s :<c-u>let b:width+=v:count1<cr><c-l>
nnoremap <silent> <buffer> <s :<c-u>let b:width-=v:count1<cr><c-l>
if !exists('*s:CssFoldText')
function! s:CssFoldText()
let line = printf("% *s {", -1*b:width, substitute(getline(v:foldstart), "{\s*$", "", ""))
let nnum = nextnonblank(v:foldstart + 1)
let lst = []
while nnum <= v:foldend
let line = line . " " . substitute(getline(nnum), "^\s*", "", "")
let nnum += 1
endwhile
return line
endfunction
map <SID>xx <SID>xx
let s:sid = substitute(maparg("<SID>xx"),'xx$','', '')
unmap <SID>xx
endif
exe "setlocal foldtext=" . s:sid . "CssFoldText()"
setlocal foldmethod=syntax
Now you can use folding commands like zM to close all folds, zR to open all folds, and za to toggle the current fold. Vimcasts has a nice screencast on this topic, How to fold.
For more information see:
:h folds
:h 'foldtext'
:h 'foldmethod'
:h za
:h zR
:h zM

How to do a if else statement in classic asp

I'm new to classic asp and I'm trying to figure out this simple if else statement.
For some reason it's just recognizing person 2 and not even trying person 1?
Any idea on how to fix? Thanks
This is my code:
<%
Dim GetPath
GetPath = request.ServerVariables("URL") & query_string
Dim page
page = "/products/dowlex/index.htm"
if GetPath = page then
varrecipient = "email1#email.com"
Response.Write("*Path = " & GetPath)
Response.Write("Person 1")
else
varrecipient = "email2#email.com"
Response.Write("*Path = " & GetPath)
Response.Write("Person 2")
end if
varFormName = "Contact"
varRHBusinessUnit = "businessname"
varLanguage = "ENGLISH"
varCourtesyResponse = "Y"
varRedirect = "#noredir?formRun=true"
varSubject = "Ask an Expert Form"
%>
I would compare the two strings based on the same case...
if UCase(GetPath) = UCase(page) then
And of course, if query_string ever has a value, then the 1st case will never be true.
The formatting of your statement is fine. If... Then... Else... End if.
I would do a Response.Write("GetPath") to see if you are getting back, what you think you should be.
I have a couple thoughts.
1) Can you use Response.Write to display what's in "GetPath" before the if statement? That might help you see what's going wrong!
2) Try changing the variable names. The editor is making "GetPath" blue, as though it's a reserved word. That might be messing things up.
I'm sorry guys, I messed up a small code and thats why it wasn't working.
I forgot to complete the full path of the site. Thanks for all your help and suggestions!
*Path = /plasticpipes/eu/products/dowlex/index.htm
*Page = /products/dowlex/index.htm

NodeSet as character

I want to get a NodeSet, with the getNodeSet function from the XML package, and write it as text in a file.
For example :
> getNodeSet(htmlParse("http://www.google.fr/"), "//div[#id='hplogo']")[[1]]
<div title="Google" align="left" id="hplogo" onload="window.lol&&lol()" style="height:110px;width:276px;background:url(/images/srpr/logo9w.png) no-repeat">
<div nowrap="" style="color:#777;font-size:16px;font-weight:bold;position:relative;top:70px;left:218px">France</div>
</div>
I want to save all this node unchanged in a file.
The problem is we can't write the object directly with :
write.lines(getNodeSet(...), file)
And as.character(getNodeSet(...)) returns a C pointer.
How can I do this ? Thank you.
To save an XML object to a file, use saveXML, e.g.,
url = "http://www.google.fr/"
nodes = getNodeSet(htmlParse(url), "//div[#id='hplogo']")[[1]]
fl <- saveXML(nodes, tempfile())
readLines(fl)
There has to be a better way, until then you can capture what the print method for a XMLNode outputs:
nodes <- getNodeSet(...)
sapply(nodes, function(x)paste(capture.output(print(x)), collapse = ""))
I know it might be a bit outdated but i got into the same problem and wanted to leave it for future reference, after searching and struggling the answer is as simple as:
htmlnodes <- toString(nodes)
write.lines(htmlnodes, file)

Is enough-url function deleted in hunchentoot-1.2.3?

If so, how can i change the following code:
(script-path (tbnl::enough-url (ppcre:regex-replace-all "\\\\" script-name "/") uri-prefix))
thanks!
Maybe you are looking for this?
CL-USER> (puri:render-uri
(puri:enough-uri "http://foo.bar.com/baz/blub"
"http://foo.bar.com/")
nil)
"/baz/blub"

Resources