Hallo,
I need to send a request to a page (POST) and then, I will read the XML and take the logical action.
How can I best send from my PHP request and then read the response.
Thnkas.
I have created installation package for my project, but before or after installation is complete i need to install some drivers and copy some files to target machine, before my software can run.
Is it possible for me to do all this action in the MSI installer setup project of visual studio 2005. One option i have explored is using autoITscript, is there a better approach than that? i feel able to do the whole thing in visual studio would be an ideal way? any suggestions?
Thanks
The end goal is to have some form of a data structure that stores a hierarchal structure of a directory to be stored in a txt file.
I'm using the following code and so far, and I'm struggling with combining dirs, subdirs, and files.
/// <summary>
/// code based on http://msdn.microsoft.com/en-us/library/bb513869.aspx
/// </summary>
/// <param name="strFolder"></param>
public static void TraverseTree ( string strFolder )
{
// Data structure to hold names of subfolders to be
// examined for files.
Stack<string> dirs = new Stack<string>( 20 );
if ( !System.IO.Directory.Exists( strFolder ) )
{
throw new ArgumentException();
}
dirs.Push( strFolder );
while ( dirs.Count > 0 )
{
string currentDir = dirs.Pop();
string[] subDirs;
try
{
subDirs = System.IO.Directory.GetDirectories( currentDir );
}
catch ( UnauthorizedAccessException e )
{
MessageBox.Show( "Error: " + e.Message );
continue;
}
catch ( System.IO.DirectoryNotFoundException e )
{
MessageBox.Show( "Error: " + e.Message );
continue;
}
string[] files = null;
try
{
files = System.IO.Directory.GetFiles( currentDir );
}
catch ( UnauthorizedAccessException e )
{
MessageBox.Show( "Error: " + e.Message );
continue;
}
catch ( System.IO.DirectoryNotFoundException e )
{
MessageBox.Show( "Error: " + e.Message );
continue;
}
// Perform the required action on each file here.
// Modify this block to perform your required task.
/*
foreach ( string file in files )
{
try
{
// Perform whatever action is required in your scenario.
System.IO.FileInfo fi = new System.IO.FileInfo( file );
Console.WriteLine( "{0}: {1}, {2}", fi.Name, fi.Length, fi.CreationTime );
}
catch ( System.IO.FileNotFoundException e )
{
// If file was deleted by a separate application
// or thread since the call to TraverseTree()
// then just continue.
MessageBox.Show( "Error: " + e.Message );
continue;
}
}
*/
// Push the subdirectories onto the stack for traversal.
// This could also be done before handing the files.
foreach ( string str in subDirs )
dirs.Push( str );
foreach ( string str in files )
MessageBox.Show( str );
}
I have a flex application and have embedded a flash (SWF) file into it using <mx:SWFLoader>. There is an "Exit" button on the Flash file. I want to be able to handle the button click event on the flex application.
So when that button in the flash file is clicked, I want to perform an action in the parent flex application. How can I do this? Thanks!
I have a UISearchBar and UISearchDisplayController, everything works great but my scope selector displays beside the text field instead of below it. I know that this is the expected action when the device is in landscape, but since I have the UISearchBar in the master view of a UISplitViewController it ends up looking like this http://cl.ly/BN9
Is there any way to force the scope bar to display below the text field in all interface orientations (I know that this works nicely in Mail.app on the iPad, so its possibly, but who knows if Apple decided to hide the option to do so)
Hi ,
Trying to grab the params after ?. I need them to add to the Zend_Paginator.
ex: http://www.example.com/test/show?name=xxx&age=20&sex=m
Building a paginator for search results.
Is there any solution for that ?
$router = new Zend_Controller_Router_Route_Regex(
'test/show\?(.*)',
array(
'controller' = 'test',
'action' = 'show',
'module' = 'user'
),
array(
1 = 'q'
),
'test/show%s'
);
$router_prev->addRoute('view',$router);
Hi
iam developing a module in Drupal, which needs to have a locking machanism, When one user operating on form submission other should nt take action,
How do i can achieve this in php/drupal
iam using mysql database with MyISAM/INNODB
Please help me
Thanks in advance
Kamal
I was looking at what the guys in the Mario AI Competition have been doing and some of them have built some pretty neat Mario bots utilizing the A* (A-Star) Pathing Algorithm.
(Video of Mario A* Bot In Action)
My question is, how does A-Star compare with Dijkstra? Looking over them, they seem similar.
Why would someone use one over the other? Especially in the context of pathing in games?
I have a html tag.
I used ((HasClickHandlers)RootPanel.get("test").getWidget(0)).addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { Window.alert('sss'); } }
I executed but no action.
Given action result ...
public ActionResult Create( // ... )
{
}
with HTML
<ul>
<li id="1">Some Item</li>
<li id="2">Some Other Item</li>
</ul>
Is there any way I can post the li items back to the controller? The list is populated by a jQuery UI "Sortable" listbox.
greetings all
i have an app that will send emails from different emails
emails are in the form [email protected]
and i need to make a listener on the server
to listen to each incoming email to each different email then do some action
i don't have any idea where to start, if someone can give me a simple overview of what I need to do or where to look up some examples how this would be done it would be very useful
thank you.
Hi,
is there a way to have roman numbers for the pages at the end of the article - like \bibliography{...}, \listoffigures and acronym-lists?
Currently they show up without any numbers :(
Cheers,..
Argh sorry - I was kind of incorrect I'm not looking for a way to change the page-numbers - I'm looking for a way to change the actual action-numbers...
So Index looks like:
1 Section
2 Section
2.1 SubSection
2.2 SubSection
3 Section
References
Figures
But I'm looking for:
1 Section
2 Section
2.1 SubSection
2.2 SubSection
3 Section
I References
II Figures
How to configure routing in asp.net web api, to that I can code for the following actions in my ApiController inherited class?
|======================================================================================|
|Http Verb| Path | Action | Used for |
|======================================================================================|
| GET | /photos | index | display a list of all photos |
| GET | /photos/new | new | return an HTML form for creating a new photo |
| POST | /photos/ | create | create a new photo |
| GET | /photos/:id | show | display a specific photo |
| GET | /photos/:id/edit | edit | return an HTML form for editing a photo |
| PUT | /photos/:id | update | update a specific photo |
| DELETE | /photos/:id | destroy | delete a specific photo |
I'm using webBrowser.Navigate(url) control to display page.
I noticed this action steals focus from current control (grid) and than I have problem to focus grid back (tired myGrid.Focus, .Select etc...)
This is really annoying behaviour of browser...
Does anyone knows how to prevent focus stealing by Browser or (if not) hot to force to focus control back ?
EDIT:
I've also tried webBrowser.DocumentCompleted event to focus back to grid
I use Authlogic with the Authlogic-openid addon (I gem installed ruby-
openid and script/plugin install git://github.com/rails/open_id_authentication.git)
and get two errors.
First when running functional test, I get an undefined method
openid_identifier? message on a line in my new.html.erb file when
running the UsersControllerTest. The line is:
<% if @user.openid_identifier? %>
When running script/console I can access this method without any
problem.
Second when testing the openid functionality and registering a new
user to my application using openid and using my blogspot account for
that I get the following in my log file:
Generated checkid_setup request to http://www.blogger.com/openid-server.g
with assocication ...
Redirected to http://www.blogger.com/openid-server.g?openid.assoc_handle=...
NoMethodError (You have a nil object when you didn't expect it!
The error occurred while evaluating nil.call):
app/controllers/users_controller.rb:44:in `create'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
The code in the users_controller is straight forward:
def create
respond_to do |format|
@user.save do |result|
if result
flash[:notice] = t('Thanks for signing up!')
format.html { redirect_to :action => 'index' }
format.xml { render :xml => @user, :status => :created, :location => @user }
else
format.html { render :action => "new" }
format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
end
end
end
end
The line giving the error being @user.save do |result|...
I feel I'm missing something pretty basic but I have been staring at
this for too long because I can't find what it is. I checked with the
code on Railscasts episodes 160 and 170 and the bones GitHub project
but found nothing.
Thanks for your help, usr
I need to see the queries submitted to a PostgreSQL server. Normally I would use SQL Server profiler to perform this action in SQL Server land, but I'm yet to find how to do this in PostgreSQL. There appears to be quite a few pay-for tools, I am hoping there is a open source variant.
i used to create a tutorial video with camtasia studio, but curious to know if opensource have application that provide abilities like camtasia studio have
such as
- keep track action happen during recording. can produce video that zoom to part i want.
- Display the text of screencast as an overlay or below the video.
- With just one click, video is on its way to YouTube .
Hi,
I have created an MSI package which when finishes runs an exe.
<Package InstallerVersion="200" Compressed="yes" />
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="Installer Example">
<Component Id="VSTOR30.EXE" Guid="4fb0aee7-ec5b-4179-8938-a2be4df8ca0e">
<File Id="VSTOR30.EXE" Source="C:\Projects\InstallationTarget\ExampleInstaller\VSTOR30.EXE" KeyPath="yes" Checksum="yes" />
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id="ProductFeature" Title="Installation Target" Level="1">
<ComponentRef Id="VSTOR30.EXE" />
</Feature>
<InstallExecuteSequence>
<Custom Action="RunEXE" After="InstallFinalize">NOT Installed</Custom>
</InstallExecuteSequence>
<CustomAction Id="RunEXE" FileKey="VSTOR30.EXE"
ExeCommand="[#VSTOR30.EXE]"
Execute="immediate"
Return="asyncNoWait">
</CustomAction>
<UI />
The MSI installs but the EXE is not run. I am calling it after Install Finalize and checking the install sequence in ORCA shows that it is being called at the correct time. I need deploy this through group policy software installation which uses a silent install without inputs. If i use a custom UI and run the EXE in the exit dialog
<UI>
<UIRef Id="WixUI_Minimal" />
<Publish Dialog="ExitDialog"
Control="Finish"
Event="DoAction"
Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="RunEXE" />
<!-- Step 3: Include the custom action -->
<Property Id="WixShellExecTarget" Value="[#VSTOR30.exe]" />
<CustomAction Id="RunEXE"
BinaryKey="WixCA"
DllEntry="WixShellExec"
Impersonate="yes" />
Then i can install the software after the msi has finished running, however when putting this group policy the EXE doesn't install.
Is there anything i am missing?
Chris
Multiple NSURLConnections being started (in a single UIViewController) to gather different kinds of data. When they return (-connectionDidFinishLoading) I wanna do stuff with the data, depending on the type of data that has arrived. But one prob, HOW DO I KNOW WHICH NSURLConnection returned? I need to know so I can take action specific to the type of data that came. (Eg. display a twitter update if it was the twitter xml data)(Eg. display an image if it was a photo)
How do people usually solve this?
I'm trying to setup a simple EAV pattern in my web app using Java/Spring MVC and Hibernate. I can't seem to figure out the magic behind the hibernate XML setup for this scenario.
My database table "SETUP" has three columns:
user_id (FK)
setup_item
setup_value
The database composite key is made up of user_id | setup_item
Here's the Setup.java class:
public class Setup implements CommonFormElements, Serializable {
private Map data = new HashMap();
private String saveAction;
private Integer speciesNamingList;
private User user;
Logger log = LoggerFactory.getLogger(Setup.class);
public String getSaveAction() {
return saveAction;
}
public void setSaveAction(String action) {
this.saveAction = action;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public Integer getSpeciesNamingList() {
return speciesNamingList;
}
public void setSpeciesNamingList(Integer speciesNamingList) {
this.speciesNamingList = speciesNamingList;
}
public Map getData() {
return data;
}
public void setData(Map data) {
this.data = data;
}
}
My problem with the Hibernate setup, is that I can't seem to figure out how to map out the fact that a foreign key and the key of a map will construct the composite key of the table... this is due to a lack of experience using Hibernate. Here's my initial attempt at getting this to work:
<composite-id>
<key-many-to-one foreign-key="id" name="user" column="user_id" class="Business.User">
<meta attribute="use-in-equals">true</meta>
</key-many-to-one>
</composite-id>
<map lazy="false" name="data" table="setup">
<key column="user_id" property-ref="user"/>
<composite-map-key class="Command.Setup">
<key-property name="data" column="setup_item" type="string"/>
</composite-map-key>
<element column="setup_value" not-null="true" type="string"/>
</map>
Any insight into how to properly map this common scenario would be most appreciated!
I have a web application using Spring 2.5.6 and Spring Security 2.0.4. I have implemented a working login page, which authenticates the user against a web service. The authentication is done by defining a custom authentincation manager, like this:
<beans:bean id="customizedFormLoginFilter"
class="org.springframework.security.ui.webapp.AuthenticationProcessingFilter">
<custom-filter position="AUTHENTICATION_PROCESSING_FILTER" />
<beans:property name="defaultTargetUrl" value="/index.do" />
<beans:property name="authenticationFailureUrl" value="/login.do?error=true" />
<beans:property name="authenticationManager" ref="customAuthenticationManager" />
<beans:property name="allowSessionCreation" value="true" />
</beans:bean>
<beans:bean id="customAuthenticationManager"
class="com.sevenp.mobile.samplemgmt.web.security.CustomAuthenticationManager">
<beans:property name="authenticateUrlWs" value="${WS_ENDPOINT_ADDRESS}" />
</beans:bean>
The authentication manager class:
public class CustomAuthenticationManager implements AuthenticationManager, ApplicationContextAware {
@Transactional
@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
//authentication logic
return new UsernamePasswordAuthenticationToken(principal, authentication.getCredentials(),
grantedAuthorityArray);
}
The essential part of the login jsp looks like this:
<c:url value="/j_spring_security_check" var="formUrlSecurityCheck"/>
<form method="post" action="${formUrlSecurityCheck}">
<div id="errorArea" class="errorBox">
<c:if test="${not empty param.error}">
${sessionScope["SPRING_SECURITY_LAST_EXCEPTION"].message}
</c:if>
</div>
<label for="loginName">
Username:
<input style="width:125px;" tabindex="1" id="login" name="j_username" />
</label>
<label for="password">
Password:
<input style="width:125px;" tabindex="2" id="password" name="j_password" type="password" />
</label>
<input type="submit" tabindex="3" name="login" class="formButton" value="Login" />
</form>
Now the problem is that the application should use Spring Web Flow. After the application was configured to use Spring Web Flow, the login does not work anymore - the form action to "/j_spring_security_check" results in a blank page without error message. What is the best way to adapt the existing login process so that it works with Spring Web Flow?
Given an action like:
public ActionResult DoStuff([CustomAttribute("foo")]string value) {
// ...
}
Is there any way to resolve the instance of value's CustomAttribute within a ModelBinder? I was looking at the MVC sources and chances are I'm just doing it wrong, but when I tried to replicate their code which retrieves the BindAttribute for a complex model, calling GetAttributes() did not return the attribute I am looking for.
DefaultModelBinder
GetTypeDescriptor(controllerContext, bindingContext).GetAttributes();
Hello, in my frontend application I'm using my own login form (just email and password fields) and in the login action I'm trying to check whether the user was logged in successfuly or not.
My question is: If the user wasn't logged in successfuly is there a simple way how can I add an error message to my login form?
Do I have to write my own validator?
What would be a performance impact if I wrapped every call to an action link (ex. <%=Html.ActionLink(....)) inside a partial view. So in other words instead of calling html extension method for actionlink I would call a html extension method for rendering partial view, and my partialview (user control) would execute the Html.ActionLink(...) method?
I am trying to detect double taps on a view, but when the double tap comes, the first tap triggers an action on TouchesBegan, so, before detecting a double tap a single tap is always detected first.
How can I make this in a way that just detects the double tap?
I cannot use OS 3.x gestures, because I have to make it compatible with old OS versions.
thanks