How to put web service client in wait mode until execute my web service in asp.net? |
In salesforce you're on a cloud platform which you share server resources
with others. Their limits enforced so that you'll make efficient and well
performing design choices that do not heavily (ab)use resources.
If your service takes 10 minutes, I would opt for an asynchronous setup
where your ASP.net service replies to salesforce by invoking the SOAP or
REST API or a custom APEX web/restservice.
|
LINQ Dynamic Assignment Expressions |
The first one does not work, because c# compiler is not able to transform
multi-line lambda into Expression Tree (and IQueryable.Select expects
expression).
The C# and Visual Basic compilers can generate expression trees only
from expression lambdas (or single-line lambdas). It cannot parse
statement lambdas (or multi-line lambdas). For more information about
lambda expressions in C#, see Lambda Expressions (C# Programming
Guide); (...).
The second one can be done using libraries like DynamicLINQ.
|
c# Linq to Sql dynamic Data Context assignment |
You can use interfaces. Check this answer, but be sure to script the
interfaces using a .tt file with the amount of tables you have.
Edit:
If you have generated contexts which you want to use interchangeably in a
reusable method, you have the problem that the generated TableA classes are
not reusable, since they are different types (even though the names may
match, but that doesn't make them equal). Therefore you need to abstract
the actual types, and one way to do this, is to use interfaces. You build
your reusable method around an interface which abstracts the specific
context-type and table-type. The downside is that you have to implement the
interfaces on the generated contexts and tabletypes. This though is
something you can solve using a .tt script.
Pseudo code:
// Define interfa
|
AngularJS losing reference to service variable on re-assignment? |
I've forked your plunker and propose a solution:
In reset function, try to remove the objects of the array instead of
declaring as new empty array:
notificationService.notifs.splice(0, notificationService.notifs.length);
Or, like suggested by @Wizcover:
notificationService.notifs.length = 0
This will notify angular that are modifications in the original array.
|
Put dynamic OSGi service selection in its own service? |
If you need to do "dynamic" or programmatic filtering of services, you need
to use a static filter that takes in all services that may potentially be
selected. The simplest such filter is the null filter, which simply takes
in all services of the correct type.
For example to implement with Declarative Services:
@Reference(multiple = true, dynamic = true, optional = true)
public void addFooService(Foo foo, Map<String, Object> serviceProps)
{
// TODO: implement logic here to read serviceProps. Return early from
// this method if the service doesn't match your dynamic criteria.
}
public void removeFooService(Foo foo, Map<String, Object>
serviceProps) {
// Be careful here, you will get services back that you didn't care
about in the
// 'add' method.
}
Now to add
|
AIX (KSH) Dynamic Variable Assignment - Split long string into multiple lines and assign each line to variables |
You can create an array and then assign values. Something like:
$ TEXT='LINE 1 LINE 2 LINE 3 LINE 4 LINE 5'
$ echo "$TEXT" | fmt -w7 > myfile
$ while IFS=$'
' read -r line; do export msg_txt_line_$((++x))="$line"; done <myfile
$ echo "$msg_txt_line_1"
LINE 1
Update:
$ TEXT='LINE 1 LINE 2 LINE 3 LINE 4 LINE 5'
$ echo "$TEXT" | fmt -w7 > myfile
$ while IFS=$'
' read -r line; do export msg_txt_line_$((++x))="$line"; done <myfile
$ echo "$msg_txt_line_1"
LINE 1
|
dynamic sql with quotes and execute immediate |
EXEC is an SQL*Plus command. You may want to wrap the call to
DBMS_STATS.GATHER_TABLE_STATS in an anonymous block instead if you insist
on using dynamic SQL.
However, you should be able to call the procedure directly, like so:
declare
sql_stmt varchar2(500);
begin
for rec in (select table_name from test3)
loop
dbms_stats.gather_table_stats ('SCOTT',rec.table_name);
end loop;
end;
|
Service Does Not Execute Repeatedly As Expected |
Use IntentService's onHandleIntent(android.content.Intent) with a
while(true) {...} loop that does a Thread.sleep(...) in every iteration.
Having said this, I personally wouldn't install an app that polls every 15
seconds all the time. It would kill my battery. Is there no event you could
subscribe to?
Edit
Sample code based on the first hit I found on Google
(http://mobile.tutsplus.com/tutorials/android/android-fundamentals-intentservice-basics/):
public class SimpleIntentService extends IntentService {
public static final String PARAM_IN_MSG = "imsg";
public static final String PARAM_OUT_MSG = "omsg";
public SimpleIntentService() {
super("SimpleIntentService");
}
@Override
protected void onHandleIntent(Intent intent) {
String msg = intent.getStringExtr
|
How to Schedule an Event to execute every day with a Service? |
I would recommend writing this as a Console Application, then scheduling it
to run at 1:00am via Windows Task Scheduler.
This is typically far simpler than trying to build the scheduling into a
service, and provides more flexibility, as it's simple to adjust the
schedule without recompiling.
If you must run as a service, then you could use a Timer to repeat and
handle your scheduling within the Service.
|
Execute shell command from service |
If it's a windows app that requires the desktop, you're pretty much SOL. If
it's a standard console application, you need to redirect standard input,
standard output and standard error. You also need to set the
ProcessStartInfo's UseShellExecute property to false: you service can't
start the OS shell (cmd.exe) as that requires access to the desktop...and
further, you can't redirect standard input with that property set to true.
Standard input is normally wired up to the keyboard. Your service does not
have access to the keyboard. Standard out and standard error are normally
wired up to the cmd.exe console window.
Once you have standard output and standard error redirected, you'll need to
wire up handler to these Process object events:
Exited. Raised when the process ends.
OutputDataRec
|
Form dynamic query and execute in oracle |
You can't have multiple statements in one execute immediate call; you'd
need to call that inside the loop:
for C in Cursor
LOOP
ViewName := 'View_'|| C.ID;
DropViewSQL := 'DROP VIEW ' || ViewName ;
CreateViewSQL := 'CREATE VIEW ' || ViewName || ' AS SELECT * from xyz';
DBMS_OUTPUT.PUT_LINE(DropViewSQL);
DBMS_OUTPUT.PUT_LINE(CreateViewSQL);
EXECUTE IMMEDIATE DropViewSQL;
EXECUTE IMMEDIATE CreateViewSQL;
END LOOP;
Notice that the dynamic SQL statement does not have a semicolon on the end.
You also might not need to do a separate drop step; create or replace view
might be more appropriate, since that retains grants.
Without any further information about the 'Some statements to be executed
before drop and create view' part it isn't clear where those would fit in.
But that
|
How to execute stored procedures containing dynamic SQL in oracle? |
You're missing a space before your table name:
create or replace procedure abcd (tab_name in USER_TABLES.table_name%type )
is
begin
execute immediate 'select * from '||tab_name;
end abcd;
This won't work because you're trying to call it as a function, not a
procedure:
select abcd('Table') from dual ;
Your second attempt should now work:
exec abcd('Table');
... but will now get a different error. In PL/SQL you have to select into
something. In this case you probably want to open a cursor with the dynamic
string and do something with the results. Not really sure what your end
goal is though.
You should also read up about SQL injection while you learn about dynamic
SQL.
|
Execute A Dynamic SQL statement Stored in a Column of a table |
Had to look up what `lakh' was :)
As other comments mentioned this is not most optimal approach to DML,
please consider refactoring. As it is you can combine your dynamic SQL in
batches, e.g.:
DECLARE @sSQL nvarchar(max)
SET @sSQL = 'BEGIN TRAN; '
SELECT @sSQL = @sSQL + COLUMN_WITH_INSERT_STATEMENT + '; '
FROM TABLE
WHERE [limit number of rows]
SET @sSQL = @sSQL + 'COMMIT TRAN '
EXEC(@sSQL)
This way you can combine controlled number of INSERT statements into a
single transaction. You can control number of inserts by means of WHERE
statement (e.g. WHERE ID BETWEEN 1 and 100 to execute 100 INSERTs at a
time) You can loop thru this condition (yes loop, but it it will not be
looping thru individual rows, but thru conditions instead e.g.1 - 100, 101
- 200, 201 - 300 etc).
|
SQL Server-Execute dynamic boolean string as WHERE condition |
You need to build the final query composing the fixed part with the
condition stored in the table. The problem in your code is that it just
SELECTs right from the table, not composing any statement. It's entirely
possible to do what you want (even though it's widely considered a bad
practice). You need to do it in 2 steps, first retrieving the condition,
then merging it in the final query:
DECLARE @sqlCommand NVARCHAR(MAX) ;
DECLARE @cond NVARCHAR(MAX) ;
DECLARE @Id INT = 1 ; --Replace with the actual ID you want
--Get the condition string from table
SELECT @cond = Condition FROM Answer_CFG WHERE answer_ID=@Id ;
--Build the final query by concatenating the initial, fixed part with the
condition extracted
SET @SqlCommand = 'SELECT Answer_ID FROM Answer_CFG as ans1 WHERE
ans1.Quest_ID=@
|
Can Control-M execute a http service endpoint to GET job status? |
Welcome to the Control-M community :-)
You can implement 2 Control-M WebServices jobs (available with BPI –
Business Process Integration Suite), one to submit your job and get its ID,
and one to track its status.
Alternatively you can implement this in 1 Control-M OS type job using the
ctmsubmit command inside a script…
Feel free to join our Control-M online community
|
Overloading assignment operator when the object is on the right-hand side of the assignment |
Why not just provide an implicit conversion to T
operator T() { return value; }
This will cause the assignment to function because the compiler will
attempt to convert the right side of the assignment to T. The implicit
conversion will allow that to succeed
Note that this will cause other conversions to work besides assignment.
For example it will now be possible to pass Wrapper<T> instances as T
parameters. That may or may not work for your particular scenario
|
C4244 level 4 warning on compound addition assignment, but not on sum and assignment |
It looks like a bogus warning.
Warnings are supposed to warn you about code you wrote, not about
intermediate operations.
The code you wrote does not work with any int - only intermediate
operations do.
An inquiry about a case almost identical to yours in the Visual Studio
Languages Forums is answered by Jonathan Caves - MSFT. His answer ends:
"This is has been on our list of bugs to fix for quite a while -
unfortunately we always find more "important" bugs to fix so we never
get around to fixing this one - but someday we will."
|
Need to execute a ruby file from Amazon web service Data pipeline |
The default image launched by Data Pipeline does not actually have ruby on
it. You'll have to build your own image and install ruby by hand first.
Then, reference that image in your Resource by instanceId
|
SQL Server Execute update result sets from dynamic query writer |
Like this
--initialize variables
DECLARE @UpdateColumns varchar(max) = ''
DECLARE @IsNullColumns varchar(max) = ''
SELECT
@UpdateColumns = @UpdateColumns + ',[' + COLUMN_NAME + '] = ISNULL([' +
COLUMN_NAME + '],'''')',
@IsNullColumns = @IsNullColumns + ' OR [' + COLUMN_NAME + '] IS NULL'
FROM tempdb.information_schema.columns
WHERE table_name = '##tempF'
This should fill in the two variables with the following values:
@UpdateColumns = ',[claimid] = ISNULL([claimid],''''),[hdr_status] =
ISNULL([hdr_status],''''),[memid] = ISNULL([memid],'''')'
@IsNullColumns = ' OR [claimid] IS NULL OR [hdr_status] IS NULL OR [memid]
IS NULL'
Then you need to assemble it all (remember to remove the first characters
of each of the variables (the STUFF function is great for that):
DECLARE @q
|
Execute RFT script on a button click from VB.NET |
could you elaborate on the issue more ?
need to execute the RFT script on a click of a button
which button are you referring to ?
EDIT - I hope it's not too late , What I understand is that from your
application (ASP.NET based) , you want to execute an RFT script based on
the parameters of the input fields in the application .
For that depending on the type of RFT scripts you have (VB scripts or
Java Scripts)
you can use one of the following:
java -jar <BIN>
ational_ft.jar -datastore <path to the project>
-playback <scriptname without extn>
or
<BIN>
ational_ft.exe -datastore <path to the project>
-playback <scriptname without extn>
Both , rational_ft.jar and rational_ft.exe reside in the BIN directory of
RFT installation .
(Usually
|
Use button to execute code and stop when done |
You can use BackgroundWorker for it. See:
http://msdn.microsoft.com/ru-ru/library/system.componentmodel.backgroundworker.aspx
|
How do i make a button execute this method |
The signature of the method should be
public void postData(View v)
Another thing, You can not perform network operation in main UI thread. Use
AsyncTask instead
|
using an asp.net button to execute javascript code |
Does this work?
OnClientClick="return (ValidateLogin())"
That is assumint it returns true or false, if it returns 1 or 0 (1 for ok
to submit) you can try:
OnClientClick="return (ValidateLogin()===1)"
|
How to execute mysql_fetch_row() upon a button click |
I think that no one will give you the answer. Too many to write. You need
to read about ajax (this is the technology that will allow you to do some
action without page reloading).
You need to write javascript(you can use some library like jquery) function
which will open some php page with the data that you want and then update
your site.
Here you have some nice tutorial:
http://www.w3schools.com/jquery/jquery_ajax_intro.asp
|
JSF 2 Execute action on button click |
When I execute the app, and click on the button, absolutely nothing
happens
Lot of things happen behind the scenes!
It will trigget a POST request to the server that will be handled by the
Faces Servlet.
This starts the JSF lifecycle and you can debug it following this tutorial.
For the JSF lifecycle I will only explain the last two phases (the other
links explains very well the other 4 phases, specially BalusC's).
In the Invoke Application phase (5th phase) the server will execute the
generateLicenseFile method bound to the <h:commandButton> in your
<h:form>.
Since you return nothing from this phase, then in Render Response phase
(6th phase) will only retrieve the current view with the ViewState updated.
Also, since you don't do a big update to any component in the view
|
Using Javascript to execute 2 functions on button click |
Since you have used jQuery tag, why don't you use a jQuery solution
<input id="fbvalbox" type="text" placeholder="Your personal message"
/>
<input id="butval1" class="butz" type="button" name="design1"
value="Choose Design" />
<input id="design_choice" type="text" value="" />
then
function changeID(elm) {
$(elm).toggleClass('butz butzz')
}
jQuery(function($){
$('#butval1').click(function(){
$('#design_choice').val($('#fbvalbox').val())
})
})
jQuery(function($){
$('#butval1').click(function(){
changeID(this)
})
})
Demo: Fiddle
|
How do I get my asp:Button to execute code in the OnClick event? |
First off, try specifying type="text/javascript" inside of your script tag:
<script type="text/javascript">alert('hi');</script>
Assuming that doesn't work:
If I understand correctly, you are trying to link the dynamically created
button to the code in the codebehind. This can get very, very weird. I
would recommend using a "proxy function" of sorts. Create a javascript
function elsewhere on the page that gets called by the button(s)' click
event. This javascript function can then initiate a postback from there.
I'll see if I can find the example I've used elsewhere.
EDIT: I can't find my original example, but this is a good reference:
ASP.NET postback with JavaScript
Please note that the __doPostBack() function has TWO underscores, not one.
|
how to select only clicked radio button and every other radio button should not be selected in dynamic addition |
try this
$("input:radio").attr("checked", false);
<script>
$(document).ready(function () {
$('.radios').click(function() {
$("input:radio").attr("checked", false);
$(this).attr("checked",true);
});
});
</script>
|
How to make dynamic RESTful service calls? |
Take a look in:
http://docs.oracle.com/javaee/7/tutorial/doc/jaxrs-client001.htm#sthref1397
You can do as follows:
WebTarget myResource = client.target("http://example.com/webapi/read")
.path("{userName}");
Response response = myResource.queryParam("userName", "janedoe")
.request(...)
.get();
|
WCF Routing Service - Dynamic Error Handling |
WCF provides error handling
(http://msdn.microsoft.com/en-us/library/ee517422.aspx), so you could
create a function that activates on a CommunicationException
(http://msdn.microsoft.com/en-us/library/system.servicemodel.communicationexception.aspx)
and logs the error codes from the data passed to the function. You could
the go from there to a mail rooting service and whatever else you need.
|
how do you execute a sql command on a button click and then have it populate a dataset? |
You have not provided enough informations to show you more than pseudo
code. However, use the using statement to ensure that everything
implementing IDisposable gets disposed properly and the connection gets
closed (even on error).
Use sql-parameters to avoid sql injection and conversion/localization
issues.
string sql = "SELECT Columns FROM dbo.TableName WHERE Column=@ParamName";
using (var con = new SqlConnection("Connection String Here"))
using (var da = new SqlDataAdapter(sql, con))
{
da.SelectCommand.Parameters.AddWithValue("@ParamName", "Param Value");
// other parameters
DataTable table = new DataTable();
da.Fill(table);
dataGridView1.DataSource = table;
}
|
Run/Execute CasperJS script by clicking a button on webpage |
I have found solution from my post on google group
https://groups.google.com/forum/#!topic/casperjs/7Lps6TiX-78
It worked by moving CasperJS & PhantomJS executable file in the
directory server (/html)
|
c# button click pass parameter to another class and execute |
You need to create a constructor in your Listen class (listen.cs) that will
accept a string, like this:
public class Listen
{
private string _sourceIp;
public Listen(string sourceIp)
{
_sourceIp = sourceIp;
}
}
Now you can use the Source IP value in your Listen class via the _sourceIp
variable.
Note: If you need access outside your class, then you can create a
property, like this:
public string SourceIp {
get { return _sourceIp; }
set { _sourceIp = value; }
}
OR use an automatic property like this:
public string SourceIp { get; set; }
Note: An automatic property will create a private backing field by default
and will eliminate the need for your _sourceIp variable, so your class
would look like this:
public class Listen
{
public string Sour
|
how to execute a long shell with php ( by clicking button int this php page) |
This is the ideal use case for a job queue.
php job queues are covered in this question PHP Advance Job Queue
I personally recommend Gearman
|
Dynamic creation of form with button and closing this form while clicking button |
For your code (which I don't recommend to use) fix will be
createButton.Click += (s,e) => registrationForm.Close();
When you attach this lambda as event handler, you have opportunity to
capture registrationForm instance in a closure. Thus form instance will be
available when click event will happen, and you will be able to close this
form.
Better approach: instead of adding button dynamically to form, place this
button statically in designer and attach click event handler which will
close the form:
private void acceptButton_Click(object sender, EventArgs e)
{
Close();
}
Usage of registration form will be simple as:
private void registerButton_Click(object sender, EventArgs e)
{
Form registrationForm = new Form();
registrationForm.Show();
}
|
dynamic broadcast receiver in a service not receiving intent |
Please paste your complete code.
It looks like your problem is that you have an endless loop in service's
onStartCommand method. Both onStartCommand and onReceive are executed on
the same thread and only one after another. Applications main thread is a
Looper thread, which handles events in a sequential manner. Basically, if
you have an endless operation in the service, you will block the whole main
thread, which includes all the GUI, services and Broadcast receivers.
Calling Thread.sleep() won't help, because the method does not return. To
avoid this, you can use IntentService
http://developer.android.com/reference/android/app/IntentService.htmlclass,
which will handle intents on another thread.
public class HeavyService extends IntentService {
public HeavyService() {
super
|
How to execute system commands with a button press on a HTML file? |
You will have to a webserver with some kind of server-side script. There's
lots of ways you can do this. If you know PHP, that may be easiest. If you
want to use python check out uwsgi.
Here is a pretty simple project I wrote with uwsgi that might help you get
started if you go that route. I found a lot of the examples didn't help a
lot, so you might have some luck with that code.
Edit: Actually, uwsgi on the pi is a pretty old version, and it does some
weird things on ARM if you try to compile it.
I created a proof of concept for you here using gunicorn instead. Just
follow the instructions under the Installing section.
|
Submit button disable on click not calling correct method - calls execute() only |
Try this
$('#annCreateEdit').click(function(){
$('input[type=submit]').attr("disabled", "disabled");
return false;
});
If you are using Jquery 1.6 or above then you can use also as below:
$('#annCreateEdit').click(function(){
$('input[type=submit]').prop('disabled', true);
return false;
});
|
How to execute a python program by a button click on html page generated by django |
There are two basic approaches you could take to do this:
(1) Run the script as a subprocess (i.e. execute a separate program outside
of your django application) - this is documented in the Python docs on
subprocesses. Below is a brief example, you will need to go through the
docs to understand exactly how you want to call your script (i.e. to handle
return codes, output to stdout and stderr, etc)
import subprocess
subprocess.call(["python", "C:/hello.py"])
(2) If there is a specific function in this script that you could call,
then you could add the directory containing the python script to sys.path,
and then import the script and call the relevant function. This is detailed
in this stack overflow question, and would be arguably the cleaner approach
(As a sidenote, would advise moving
|
for loop creates & labels button properly, but doesnt execute proper command |
You are always calling the command with the variable 'attr', not with the
contents of attr.
The quick fix is :
pm.button(label=attr, command='createRamp("%s")' % attr)
which will make the button use the correct string. The right thing to do in
the long term is not to use strings when calling button callbacks - this
will probably run into issues if you execute it outside the listener or
from another script because it will no longer know what 'attr' means when
the callback fires.
Some related discussions:
http://tech-artists.org/forum/showthread.php?2861-Seeing-root-space-python-instances-from-another-class-instance&highlight=callback
http://tech-artists.org/forum/showthread.php?3205-why-scriptJob-doesnt-work-in-case-of-attrControlGrp&highlight=callback
http://tech-artists.
|