w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
How to restrict user from changing the win service startup type
Using this link and with a small change I achieved my goal. I just changed the TRUSTEE and assigned required access to them. // Build the ACE. BuildExplicitAccessWithName(&ea, TEXT("ADMINISTRATORS"), SERVICE_START | DELETE, SET_ACCESS, NO_INHERITANCE); Thanks,

Categories : Windows

Execute a script on startup of SUSE reboot
chmod +x /etc/init.d/testing touch /etc/init.d/rc.d/rc3.d/S12testing Should not be 'touch', but a symbolic link (ln -s) to /etc/init.d/testing. Try cd /etc/init.d/rc.d/rc3.d ln -s ../../testing S12testing Hope this helps.

Categories : Linux

Android Reboot Simulation : Service not working
register your reciever in xml like this <receiver android:name="my.app.client.BootReceiver" > <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> </intent-filter> </receiver>

Categories : Android

Windows service performs differently after reboot
How can caught exception still crash the service (and in a way recovery actions are not performed)? The original exception may not crash the service, but if you have a second exception in your first exception handler, the service will crash. I'd check if Logger.Instance.Error() is throwing an exception by putting a try/catch around it. How can code perform differently after reboot? It goes thru exactly same sequence. While it might be the same sequence in your code, we don't know what residual state was left over on disk before the last crash. This might be the reason for the difference.

Categories : C#

"No Launcher Activity found!" while launching a service on startup
The “No Launcher Activity found!” message is not something that should throw you off, since you already know that no launcher activity is found. You can simply ignore this error. To launch your service, broadcast the intent that is needed, and your code will run. If you want, you can add a simple test activity that will test this - but really, no further action is required.

Categories : Android

Spring RmiExporter service fails after successful startup
Which web server you are using ? If it is Apache Tomcat, then add to CATALINA_OPTS variable -Djava.rmi.server.hostname=10.0.34.11 in catalina.sh file and then export CATALINA_OPTS variable.

Categories : Java

Is there a way to stop manual input in a type=number but still allow changes with the "up/down" buttons?
Is there any reason you are avoiding using a drop down select tag? This will give the user a very limited choice of numbers (set to your preference). You could even populate the <option> fields with numbers 1 through 100 (or whatever you choose) using PHP or JavaScript so you didn't have to manually type each number in the HTML code. <select> <option value='1'>1</option> <option value='2'>2</option> <option value='3'>3</option> </select>

Categories : HTML

How to force reboot Windows 7 from inside a C# Windows Service
Look at the Win32 API InitiateSystemShutdown() and/or InitiateSystemShutdownEx() function. Also refer to this MSDN article: Shutting Down.

Categories : Windows

Azure: Unable to start cloud service running vbs startup task
I am sure you must have but just for the sake of confirmation, have you checked that the InstallFonts.vbs file is exported with the package? I mean is the "Copy To Output Directory" is set to "Copy Always/Copy if newer"? This is pretty much possible that it is not able to locate your file.

Categories : Asp Net Mvc

NoClassDefFoundError: org/apache/catalina/startup/Bootstrap when running tomcat from exe/as service
Recommend using one of the "Java as a Windows Service" frameworks as they handle adding JARs to the classpath, etc. This can be done manually however via the "java -cp {set your classpath here...}" options as well.

Categories : Java

Resource based routing module used in a Node.js REST API service, or other useful modules for this type of service
RESTfull API get and post data through HTTP protocol. A more progressive approach is to use WebSocket [Wikipedia] npm link. Try to play with Sails.js framework build on Express.js that use Socket.IO for flash data transfering

Categories : Javascript

Differentiate service state
I'd use Get-Service to retrieve the services from the list and add a custom property to indicate whether a service was started by the script: $f = 'C:services.txt' $svc = Get-Content $f | Get-Service | % { $_ | Add-Member 'StartedByScript' $false $_ } Add -ErrorAction SilentlyContinue to Get-Service if you want to skip over non-existing services without an error message. With that service list you can start services in the state Stopped like this: $svc | ? { $_.Status -eq 'Stopped' } | % { $_.Start $_.StartedByScript = $true } The custom property StartedByScript indicates which service was started by the script: $svc | select DisplayName, Status, StartedByScript

Categories : Powershell

How to define a web service type in wso2 data service
You can specify the "Content-Type" HTTP Header when sending a request to a data service endpoint to access it using SOAP, JSON etc. No need to specify the type when creating a service. DSS has inbuilt support for SOAP and JSON using Axis2. Refer the following blog post for more info. http://lafernando.com/2011/11/27/json-data-services-using-wso2-dss/

Categories : Wso2

Change toggle button state from service
You can listen sharedprefs changes via OnSharedPreferenceChangeListener. So from service set boolean flag in prefs. Listen for your flag from activity and change toggle button state. You also can use LocalBroadcastManager to send message when you stop recording. Activity can give a callback to a service which it should call when recording it stopped. You can use EvenBus to communicate between app components. There are a lot different ways.

Categories : Android

C# Cancelling ServiceController Service State Change Request
In short, no - there is no way to revert or cancel a command already sent to a service. You could write code to remember the previous state, and initiate a controller request to set that state again if something goes awry or times out, but it doesn't sound particularly robust. If they're your own services, it's better to write them to properly respond to service requests.

Categories : C#

Android : Show the service state in an activity with a textView
You can use ActivityManager.getRunningServices() see http://developer.android.com/reference/android/app/ActivityManager.html#getRunningServices%28int%29

Categories : Android

Access $stateParams of new state in service called from resolve function with UI Router
You can't inject the the incoming parameters into the service itself, but you can pass them to a function in the service (or you could also assign them to a property in the service). this plunker shows how to pass them to a function, which in turns stores them to a property in the service. Using a "dummy" property shouldn't hurt, but it is a bit ugly. :) It might make more sense to pass the parameters to the controller as a resolve property and then hand them out to a service from the controller constructor... that's what I'd do.

Categories : Javascript

The original state instance has the wrong type
The (Table)derivedFromTable cast is meaningless, because the Attach() method already accepts an argument of type Table so the widening cast is implicit. That doesn't matter, however, because Linq to SQL checks the type of the passed in object dynamically, and basically it doesn't support treating derived types as if they were the base entity (also because casting does not change the actual type of the instance, it just changes its static interface). So if you want to do this, you'll need to first copy the properties of the derived instance to an instance of the base type using something like AutoMapper. Example: Table existing = context.Tables.Single(t => t.Key == derivedFromTable.Key); Table table = Mapper.Map<DerivedFromTable, Table>(derivedFromTable); context.Tables.Attach(ta

Categories : C#

Jetty Startup issue: WebAppContext:Failed startup of context o.e.j.w.WebAppContext{/,null}
It seems that your eclipse STS workspace is out of sync with the content published in the server. Try to clean the server, clean the working directory, clean all projects and Republish the project into the server. If this does not work, try these steps to regenerate your eclipse workspace: close eclipse and do a maven clean install from the command line delete all eclipse related files: .project, .classpath and .settings reopen eclipse, and configure maven to use the same maven as the command line import the project using 'Import as Maven Project' scrap your Jetty and redownload a clean one Create a new Jetty server, point it to the new Jetty and add your application to it Republish the application and start the server

Categories : Eclipse

An easy way to change the type of Parsec user state?
You can't do this as the >>= operator has the type ParsecT s u m a -> (a -> ParsecT s u m b) -> ParsecT s u m b and (<*>) as ParsecT s u m (a -> b) -> ParsecT s u m a -> ParsecT s u m b The s variable is universally quantified, but must match with both terms. Without >>= or <*> you can use no applicative or monadic functions. This means you'd have absolutely no way to combine any parsers with different states. The best way to do this is just data PotentialStates = State1 ... | State2 ... | State3 ... and then just work with those instead.

Categories : Haskell

How to maintain collection type across a web service (using Web Reference not Service Reference)
AFAIK you cannot. Web reference doesn't allow List. However if you change that to service reference you can do that by going to properties and specifying the collection type you want to use.

Categories : C#

Msg 8114, Level 16, State 5, Line 1 Error converting data type nvarchar to real
Created the following cursor to cause the query to execute one row at a time, which allowed me to identify the problem data row: SET ARITHABORT OFF SET ARITHIGNORE ON SET ANSI_WARNINGS OFF DECLARE @msg VARCHAR(4096) BEGIN TRY DECLARE @itemid AS NVARCHAR(255); DECLARE C CURSOR FAST_FORWARD FOR SELECT ItemID AS itemid FROM dbo.qryOtherFieldDataVerifySource; OPEN C; FETCH NEXT FROM C INTO @itemid; WHILE @@fetch_status = 0 BEGIN SELECT dbo.qryOtherFieldDataVerifySource.ItemID, dbo.qryOtherFieldDataVerifySource.EDGRDataID, dbo.qryOtherFieldDataVerifySource.LineItemID, dbo.qryOtherFieldDataVerifySource.ZEGCodeID, dbo.qryOtherFieldDataVerifySource.DataValue, dbo.tblBC.AcceptableValues, dbo.qryOtherFieldDataVerifySource.DataUnitID, dbo.qryOtherFi

Categories : SQL

Copy instance variable of type java.util.Random to create object in same state
I think you should store in your State class, not only starting seed but also number of calls to nextInt() you already did. This is due to the intrisic fact that Random generates pseudo-random sequence of numbers. That is: A pseudo random number generator can be started from an arbitrary starting state using a seed state. It will always produce the same sequence thereafter when initialized with that state Let me explain show you with a sample first: public static void main(String[] args){ Random r = new Random(42); Random s = new Random(42); for(int i = 0; i < 5; i++){ System.out.println("First random " +r.nextInt()); } for(int i = 0; i < 5; i++){ System.out.println("Second random " +s.nextInt()); } } which result is:

Categories : Java

Msg 8115, Level 16, State 2, Line 24 (Arithmetic overflow error converting expression to data type datetime )
I see two things that look wrong: You are converting a datetime to a numeric value, which gives you the number of days (and fractional days) since 1900-01-01. I don't see why that's necessary in your code. The columns don't line up properly in your INSERT statement. You are inserting a NUMERIC(18,2) value (due to the CONVERT) into an integer field and an int value into a DATETIME field. That's probably why you're seeing the wrong values for CreationDate in your results. I suspect you want something like: INSERT INTO #tmpCustomers SELECT customerId, [CustomerCode], [CustomerName], @left, @right, Creationdate FROM Customers WHERE CustomerID=@customerid

Categories : SQL

What is TOPIC SUBSCRIPTION STATE in Azure Service Bus Subscription?
This is referring to the ability to change the state of a service bus entity. This was new and added in April 2013. This allows you to disable a queue without deleting it, or put it into a state that allows you to keep sending to it, but won't allow anything to receive from it. Somewhat like suspending it without loosing messages, etc. Here is the Documentation for EntityStatus Enumeration which is what these settings map to. Release notes for Service Bus 2.0 (April 2013) hits on this a little, but much description. For example, you may want to use this to temporarily stop incoming messages on the queue, or temporarily allow new messages to come in, but to stop all consumers from reading from the queue.

Categories : Azure

asp.net json web service sending array error Cannot convert object of type 'System.String' to type 'System.Collections.Generic.List`1[System.String]'
You need to make your data parameter of the $.ajax call like this: JSON.stringify({'a': variables}) The JSON variable is not available in < IE8 so you'll want to include a JSON implementation like the one mentioned in the answer here Also, you had an extra } in the success function. So, in the future, if you want to add extra parameters to your data object passed to the web service, you'd construct it like so: var someArr = ['el1', 'el2']; JSON.stringify({ 'param1': 1, 'param2': 'two' 'param3': someArr // etc }); JavaScript: var variables = Array(); var i = 0; $('#Div_AdSubmition').find('.selectBox').each(function () { variables[i] = $(this).find('.selected').find(".text").html(); i++; }); $.ajax({ type: 'post', data: JSON.stringify({'a': variables}),

Categories : C#

C# DateTime type over web service with PHP & SOAP
"... I had a meeting with the developer of web services and he showed me that when he passes System.DateTime type variable to the function it works properly, but he did it locally in C# ..." The function you try to invoke in the C# web service takes a System.DateTime object as a parameter. I looked it up at MSDN and learned that it is a C# class. PHP's DateTime Class is not the same, so the service probably recognizes an instance of PHP's DateTime class as invalid data. I am not sure how communication works with C# services, but I would assume that it requires a binary representation of a C# System.DateTime object. It means that you could potentially investigate how C#'s System.DateTime object is represented in binary and manually construct and pass the binary data in PHP. This is how

Categories : C#

Consume WCF service with complex type
Your JavaScript data object is incorrectly constructed - it should be: { 'person': { 'Name': 'xxxxx' } } What's more, you can choose alternative way of building JavaScript objects. The solution (which in my opinion is less error-prone) is to build objects in more standard manner (a bit more code, but less chance to be confused and make mistake - especially if the object has high complexity): var data = new Object(); data.person = new Object(); data.person.Name = "xxxxx"; The last thing is, you missed to set up the body style of message that is sent to and from the service operation: [WebInvoke(... BodyStyle = WebMessageBodyStyle.Wrapped)]

Categories : Jquery

Returning a List of type from web service
In the "Add Service Reference" dialog, click "Advanced" and choose to use List<T> as the collection type.

Categories : C#

Web service with a generic payload XML type "Any"
Please don't do this. I've worked with these sort of "generic" web services before and they are the equivalent of having a java API where every method has the signature public Object methodName(Object o); Yes, it's all very generic, but it conveys no information on how to use it (A well designed interface conveys how it should be used, the same way the handle of a tea pot suggests that the tea pot should be picked up by the handle). When someone wants to develop an application that consumes your service, how do they figure out what to send and what they'll get back? If it's in some other document, then you've basically created your own bespoke web service description language, which won't integrate with any tooling (like Spring or Axis-2) and will require a lot of extra manual code to b

Categories : Spring

Azure Service Bus Serialization Type
According to the documentation: An application can set the body of the message by passing any serializable object to the constructor of the BrokeredMessage, and the appropriate DataContractSerializer will then be used to serialize the object. Alternatively, a System.IO.Stream can be provided. The constructor you're using has this documentation: Initializes a new instance of the BrokeredMessage class from a given object by using DataContractSerializer with a binary XmlDictionaryWriter. This fits well with messages defined as DataContracts, as explained in this article. Alternatively you could use surrogates as described in this answer. You can also provide your own serializer or a stream. An alternative would be to do your own serialization and use a byte array or s

Categories : C#

Is there a way to reboot an iOS app?
Are you familiar with the Model-View-Controller design pattern? You should have your application data stored in a model object. When the user "gets to the end", you can reset the model and update your views to start over.

Categories : IOS

mContext Type Mismatch when used with Audio Service
You will need to cast. AudioManager am = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); getSystemService() returns an Object, it is up to you to properly cast it to use the specific methods of whatever service you're attempting to use. This is the standard way to get references to system services in Android.

Categories : Java

Set input type of a rest web service to Json
Try Setting the Request Header "Accept" as "application/json" http://www.w3.org/Protocols/HTTP/HTRQ_Headers.html#z3

Categories : Java

Web Service (web method) String return type
Basically when your list is serialized it will be converted to XML although the format would be like: <Value>EmployeeId, EmployeeName</Value> The tags are not actually unneccessary and in fact they are helpful as they preserve the data and it's conctrete data type. I am not fan of returning an XML string as it is prone to error and you may always need to update the value of the string. What I suggest is to return an object containing your result set and an error description property. public class ReturnObject { public List<Employee> list {get; set;} public String ErrorDescription {get; set;} } public class Employee { public int EmployeeID {get; set;} public string EmployeeName {get; set;} } In here your web service will return a concrete type with addi

Categories : Java

Microsoft .NET raw socket type of service field
After a lot more investigation, we discovered several things. You can correctly set a TOS field in Windows 8 by making the following Registry change: [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesTcpipQoS] "Do not use NLA"="1" You can correctly set a TOS field using WinSock in XP by making the following Registry change: [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters] "DisableUserTOSSetting"=dword:00000000 You cannot change the TOS field in Windows 7 seemingly. We have tried several different variations of code and Windows 7 versions with no success. I'm not 100% sure why the above statements are true, but they are what we have discovered over about a month of testing on various different machines and OS variants.

Categories : Dotnet

get Composite Type into WSDL even though it is not in service interface
hum.. If I am understanding well, you changed the DTO to include a binary and now you are trying to handle the compression during the object instantiation before the service invoke. Am I right? The Gzip compression can be handled in message level. You could try to keep the data contract with the "real properties" (instead of the byte array) and create a custom binding with Gzip compression. There is a good WCF sample here (navigate to "WCF/Extensibility/MessageEncoder/Compression/CS").

Categories : Dotnet

Asp.Net Web Service 415 Unsupported Media Type error
I think you data request might need quotes differently than what you tried but I am not sure. I would suggest adding an alert of your data before the call to debug it. See below.. var mData = "{userName:'" + $('#usernametxtbx').val() + "',password:'" + $('#passwordtxtbx').val() + "'}"; alert(mData); $.ajax({ type: 'GET', url: 'Service/WebService.svc/Login', data:{userName:$('#usernametxtbx').val(),password:$('#passwordtxtbx').val()}, dataType: 'application/json; content=utf-8', contentType: 'json', success: function (res) { if(res.d == true) window.location.replace(ResolveUrl('Default.aspx')); else window.location.replace(ResolveUrl('Login.aspx')); } });

Categories : Asp Net

AppWidget ID changes on reboot
What happens if you try the following thing: Install app, place 2 widgets, reboot, place another widget and check its id? When you remove your widgets from home screen and uninstall the app some of the IDs get reset and that could be the cause of recurring ids. Also does this behavior affect your app performance and expected behavior? If not there is nothing to worry about. I have experienced the same thing when developing widgets, once i started the work my widgets had ids starting from 0,1.... now my widgets have ids of 100, but they always get unique ids in the session in which the app is installed. You shouldnt care if the ids repeat them selves if the user uninstalls the app and installs it again. Also keep in mind that after reboot you onEnabled() method from AppWidgetProvider

Categories : Android

I'm getting an error "Msg 8114, Level 16, State 5, Procedure sp_DRPL_MassChangeClient, Line 0 Error converting data type varchar to int."
This is what your passing EXEC sp_DRPL_MassChangeClient @DebtorsDebtID,@OldClient,@ClientID,@UserName,@DebtID the second @variable is @OldClient which is declared as varchar into @DebtorsDebtID AS uniqueidentifier, @DebtID AS int, The second variable is @DebtID declared as INT hence the error thrown

Categories : SQL



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.