w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Adapter Proxy for Restful APIs
https://github.com/nodejitsu/node-http-proxy is looking useful - although I don't yet know if it can stream process for transcoding.

Categories : Rest

Best way to restrict access Java EE RESTFul APIs
There are several. In order of simplicity they are: Block access in the firewall. HTTP-BASIC authentication. API-key (shared secret) authentication. CAS OAuth. It kind of depends on what kind of additional requirements you have. But from your brief description, I would think a simple firewall is the best solution in your case.

Categories : Java

How to Submit Deeply Nested Resource using Restful APIs (HATEOAS)
Hope I understood your question correctly. Let me know if I missed the point and can always come back with something new. So if all the “sub-resources” are already created from step-1 to step-5. In each of the step, there should be a returned ID to confirm the successful creation of the resource. Like, POST /Application Return: {appid: “/Application/id”} Thus, as soon as the step-5 POST returns, the last resource is created. Then the next step is to start the application ‘processing’. “Application Processing” could be thought as a resource, and the business actions are: “create the processing” resource and “Check for processing results” They can be modeled using POST and GET respectively on the 'Processing' resource. To create the processing resource POST

Categories : C#

How to Design a Restful API for Bulk Inserts and Updates?
The most "standards compliant" way for batch operations in RESTful Web services is to use one of the various 'collection' approaches (i.e. DELETE /mail?&id=0&id=1&id=2) or you could use a batching handler to simply the process. Honestly, I use the exact same pattern as you do except for the fact that I use POST for object creation and PUT for updates only (which is the standard way of doing it). Also POST should return 201 - Created along with the created object and PUT should return 204 - No Content with no data, if the operation succeeds. Of course, as you're doing bulk creation, you may opt not to return the array of newly created objects with POST. To summarize it: POST api/products | |---> Success: 201 [NewObject1, NewObject2, ...] |---> Failure: Relevant er

Categories : C#

Controlling security on model updates in RESTful Spring MVC / HATEOS
Two possibilities comes to my mind: validation (@Valid) binder configuration (@InitBinder) You can validate the incoming object and check for such changes. Or you can set-up WebDataBinder#setAllowedFields within your @InitBinder method based on user authorities. The latter one would be probably the easiest way. However instead of returning validation error your application will ignore the fields completely.

Categories : Java

Is there anybody who knows how I can replace these APIs from fftw by Kiss-fft APIs?
For the first case (2D real-to-complex FFT) you need to use the API in tools/kiss_fftndr.h: kiss_fftndr_cfg kiss_fftndr_alloc(const int *dims,int ndims,int inverse_fft,void*mem,size_t*lenmem); void kiss_fftndr( kiss_fftndr_cfg cfg, const kiss_fft_scalar *timedata, kiss_fft_cpx *freqdata); void kiss_fftndri( kiss_fftndr_cfg cfg, const kiss_fft_cpx *freqdata, kiss_fft_scalar *timedata); For the second case (1D complex-to-real FFT) you need to use the API in tools/kiss_fftr.h: kiss_fftr_cfg kiss_fftr_alloc(int nfft,int inverse_fft,void * mem, size_t * lenmem); void kiss_fftr(kiss_fftr_cfg cfg,const kiss_fft_scalar *timedata,kiss_fft_cpx *freqdata); void kiss_fftri(kiss_fftr_cfg cfg,const kiss_fft_cpx *freqdata,kiss_fft_scalar *timedata);

Categories : C

RestFul PhoneGap and RestFul webservices
Try this sample $.ajax({ url: Your_webservice_url, type: "GET", data: { ModifiedSince: modifiedSince }, dataType: "json", success: function(data) { console.log("The server returned " + data.length); //Play with the received json data. }, error: function(model, response) { alert("Web service error: " + response.responseText); } });

Categories : Spring

as3 var not listening to x--
I think what you actually want to do is get the decrement reflected in boost[i]. What is the type of 'boost[i]'. I believe it's int and that's why changing tempBoostN isn't changing boost[i]. There are 2 ways around it: (1) You put Number in boost[i], so tempBoostN = boost[i] is a assignment by reference as against a value copy being done in case of int (2) re-assign boost[i] = tempBoostN at the end of loop.

Categories : Actionscript

Listening to JTable changes
You should think in refactoring your AbstractTableModel implementation.It is the Subject and his own Observer has no much sense. You should separate responsabilities (Single Responsability Principle). In your code, when you edit a cell setValueAt(Object value,int row,int col) is called. @Override public void setValueAt(Object aValue, int row, int col) { //your default code here and then you should call fireTableRowsUpdated(row,row); // if you change the row OR fireTableCellUpdated(row,col); // if you change the cell OR fireTableDataChanged(); // if you change all the model } I have a similar issue here,

Categories : Java

VB.NET Listening Server is using max CPU
Wow. You're opening and closing connections in a forever loop? Make a socket listener, then handle stream events. This is c# but i'm sure you've gotten used to back-dating to VBNet by now. public void portSocketListener() { Socket listenSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); IPAddress hostIP = (Dns.Resolve(IPAddress.Any.ToString())).AddressList[0]; IPEndPoint ep = new IPEndPoint(hostIP, 28961); listenSocket.Bind(ep); listenSocket.Listen(1); }

Categories : Dotnet

Socket.io not listening
Currently your on('add') code on the client side is within the on('connect') event which is not correct... You need to take it ouside there, so it becomes: socket.on('connect', function () { $('#button').click(function() { var addtext = $('#text').val(); socket.emit('Text', addtext); }); }); socket.on('add', function(data) { socket.emit('AAA'); }); EDIT: I also just noticed you had socket.broadcast.emit() in your client side code. As far as I know there's no concept of broadcasting from the client. If you want to broadcast something then the client should send it to the server then the server broadcasts to the other clients.

Categories : Javascript

Listening to waveforms
Check out sound and soundsc functions.

Categories : Matlab

Listening on port being used
You can do that with scapy see http://www.secdev.org/projects/scapy/doc/usage.html#sniffing to use it in your own python program, you'd have to import the sniff command from scapy.all import sniff a=sniff("tcp and port 1337") sniff has various options (callback functions, timeout, number of packets etc)

Categories : Python

Listening to a store event
First of all good question! Let me try to give you a opinionated answer. Is there such an event? As far as I know there is lamentably no such event on the store to listen to. Where are store events defined? I do not see documentation about it (this is the only documentation I know about the store) Since ember-data is not yet production ready, the only real truth is in the source code and the inline comments there. But generally when persisting changes to the backend and depending to your setup the involved classes are, the Store, the RESTAdapter and the JSONSerializer, have a look there, you can extend all of those classes to make them work as you want. Is there a better way to delete all records than to delete each one of them in a loop? Yes and no, by defining bulkCommi

Categories : Ember Js

There was no endpoint listening at https://
Can you connect to the service on port 443 from the client machine? Can you negotiate SSL with it? Try openssl s_client -connect domain.com:443 -showcerts < /dev/null from the client machine.

Categories : C#

Check if Postgresql is listening
You can use, for example, nmap tool: =$ sudo nmap -v -p 5930 127.0.0.1 Starting Nmap 6.00 ( http://nmap.org ) at 2013-06-25 19:28 CEST Initiating SYN Stealth Scan at 19:28 Scanning localhost (127.0.0.1) [1 port] Discovered open port 5930/tcp on 127.0.0.1 Completed SYN Stealth Scan at 19:28, 0.03s elapsed (1 total ports) Nmap scan report for localhost (127.0.0.1) Host is up (0.000045s latency). PORT STATE SERVICE 5930/tcp open unknown Read data files from: /usr/bin/../share/nmap Nmap done: 1 IP address (1 host up) scanned in 0.08 seconds Raw packets sent: 1 (44B) | Rcvd: 2 (88B) Alternatively you can just "SELECT 1" with psql, and check output: =$ psql -h 127.0.0.1 -p 5930 -c "select 1" ?column? ---------- 1 (1 row) =$ psql -h 127.0.0.1 -p 5940 -c "select 1"

Categories : Database

WCF error - There was no endpoint listening at
You do not define a binding in your service's config, so you are getting the default values for wsHttpBinding, and the default value for securityMode ransport for that binding is Message. Try copying your binding configuration from the client's config to your service config and assign that binding to the endpoint via the bindingConfiguration attribute: <bindings> <wsHttpBinding> <binding name="ota2010AEndpoint" .......> <readerQuotas maxDepth="32" ... /> <reliableSession ordered="true" .... /> <security mode="Transport"> <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> <message clientCredentialType="Windows" negotiateServiceC

Categories : C#

Listening on SSL with node.js on AWS Beanstalk
I managed to fix this by following advice over at the AWS forums: https://forums.aws.amazon.com/thread.jspa?messageID=463043 I needed to change the security group that the load balancer uses (the one that is automatically created and has the description ELB created security group used when no security group is specified during ELB creation - modifications could impact traffic to future ELBs). The load balancer should already be allowing HTTP traffic on port 80 from source 0.0.0.0/0 and you have to add HTTPS traffic on port 443, also from 0.0.0.0/0, to allow HTTPS traffic. This can be done in the Security Groups section of the EC2 Management Console. Then listen to port 8080 in your Node.js app, and your content can be accessed over both HTTP and HTTPS.

Categories : Node Js

Listening if cookie has changed
'use strict'; app.controller('MainCtrl', function ($scope, $log, $cookies, $timeout) { $scope.$watch(function() { return $cookies.test; }, function(newValue) { $log.log('Cookie string: ' + $cookies.test) }); $cookies.test = 'first value'; $timeout(function () { $cookies.test = 'second value'; }, 1000); });

Categories : Angularjs

Java Listener- not listening
You need to implement the actionPerformed method. You seem to have implemented it as ationPerformed thus, you need to fix that spelling. Because you have not correctly implemented the interface, you cannot use the class as an ActionListener. As to the serializable issue - this is to do with the fact that JFrame implements the Serializable interface, which requires a serialVersionUID. You can compile without one, but the IDE will complain. [For more info, see here] As a side note, generally you don't want to extend JFrame, instead use an instance in your class.

Categories : Java

DIV listening to rotate once then nothing jQuery
So once you click, it runs your changetop function, which sets it to be rotated to 360 degrees. When you click it again, it runs the function again and sets it to be rotated to 360 degrees... but it's already rotated to 360 degrees! So it won't actually move anywhere. You'll need to reset it back to 0 degrees after it's spun. Or you could use CSS keyframing to describe a 360 degree rotation animation.

Categories : Javascript

Java listening on port
The java server socket is created but no incoming connections are received from the device. So either there is a firewall in the way or the device isn't trying to connect to that port. The java server socket is receiving connections from telnet command. So the Java application is listening to that port. The data format which is used by the device and the other native application may be different, but at least it has to be connected from java server socket. is it correct? Yes. how to receive the data which is transmitted to port 7777. First you have to accept the connection. On the evidence here the device isn't connecting to port 7777 at all. I suggest some network sniffing is in order to see what it really is doing.

Categories : Java

Luasocket TCP stops listening after
Have You tried filling socket.receive() pattern argument? [1] Not sure which one is default, but You might consider using socket.receive('*a') and parsing those new lines later. [1] http://w3.impa.br/~diego/software/luasocket/tcp.html#receive

Categories : Lua

angularjs listening to dom events
If you really don't want to use ng-click, you could use a directive and add a simple attribute to you DOM elements Check this fiddle : http://jsfiddle.net/DotDotDot/ZYdEf/5/ I simply created a directive which bind a click event on the element, then log the click : directive('clickable', function(){ return function(scope, elt, attr){ elt.bind('click', function(e){ console.log('hello from',elt) }) }) Then, in your HTML it's really easy : <a href="#" id="test" clickable>Click</a> <a href="#" id="login" clickable>Log</a> Have fun

Categories : Javascript

Listening to changes in MongoDB in Express
You declare the watcher in the file that you want to respond its events. From looking at the source code, it seems collName is the only required argument, so there should be no need to include the others.

Categories : Javascript

Node.js Cluster not listening
I fixed the issue by running the file directly. Previously, I ran server.js which was a one liner: server.js require("./server/app.js"); server/app.js (code snippet in the question) By running node app.js instead of node server.js the cluster started listening. Not sure why this made a difference.

Categories : Node Js

Send Action to button who is listening for it
Use doClick() method of JButton: btn_.doClick() Within keyPressed as following: spn_.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if(e.getKeyCode() == KeyEvent.VK_ENTER) { btn_.doClick() } } }); The doClick() method as specified in oracle doc: Programmatically perform a "click". This does the same thing as if the user had pressed and released the button.

Categories : Java

How is Git listening for changes from the editor during a merge conflict?
An excellent script that utilises vimdiff to prompt the user to resolve merge conflicts is available here. Going through the source of the script should help you understand how its done.

Categories : GIT

Stop listening for more listener events
You can remove the OnGlobalLayoutListener using the following code. There will still be a strikethrough on removeGlobalOnLayoutListener(), which has been deprecated. But, the lint warning will be taken care of by using the annotations. @SuppressWarnings("deprecation") @SuppressLint("NewApi") searchWebView.getViewTreeObserver().addOnGlobalLayoutListener( new OnGlobalLayoutListener() { @Override public void onGlobalLayout() { if (Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) { searchWebView.getViewTreeObserver().removeOnGlobalLayoutListener(this); } else { searchWebView.getViewTreeObserver().removeGlobalOnLayoutListener(this); } } });

Categories : Android

odd behavior in express for listening on request
You need to res.end('') in your /search handler. You are not ending the response when handling /search. Thus there are 6 concurrent requests open from your browser at the point where you hit '6', and jQuery will send no more. It then waits for 3 minutes, until those requests time out (with an error, which you don't see), and then it will send the remaining 4.

Categories : Node Js

Why is it not sleeping for 3 seconds before it starts listening?
it must be within the run() body public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // TODO Auto-generated method stub item = (String) parent.getItemAtPosition(position); tts.speak(item, TextToSpeech.QUEUE_FLUSH, null); Thread thread = new Thread() { public void run() { try { sleep(3000); } catch (InterruptedException e) { e.printStackTrace(); } sr.startListening(srIntent); } }; thread.start(); }

Categories : Android

How can I test that a service is listening on TCP with Node.js?
Use net.connect(): var net = require('net'); var client = net.connect({port: 8124}, function() { //'connect' listener console.log('client connected'); client.end(); }); Node.JS documentation on net module

Categories : Node Js

JFrame listening for KeyEvent while Iconified
If you're trying to create a key-logger program with Java, don't. It's not a good tool for creating this since it by design is isolated from the OS, in other words it's "OS-agnostic". You will need to use a different tool for your allegedly nefarious plans such as C or C++ since these languages allow you to get closer to the "metal".

Categories : Java

Listening for downloads when application is minimized
Just declare the broadcast receiver in manifest. More about the differences between the dynamically register and statically register, please see BroadcastReceiver

Categories : Java

node.js 8080 port isn't listening
The tutorial may be using an incorrect or deprecated method. Replace response.sendHeader(200, {"Content-Type": "text/html"}); with response.writeHead(200, {"Content-Type": "text/html"}); and response.close(); with response.end();

Categories : Node Js

REST listening tool for testing
You can have fiddler generate a response but I guess that can become a mess quickly You will be looking for the AutoResponder feature together with the Import and Export If the url's you need to test is large you can have a set of response files per url to keep things manageable. Those files go with your testset in a sourcecontrol system.

Categories : Rest

Listening for key strokes in a nested panel
see Oracle tutorial How to use KeyBindings you miss there set focus to JPanel panel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(...)

Categories : Java

Android - constantly listening to UDP socket
This is an old thread, but since I've stumbled upon it while looking answers to my own questions: You haven't specified what you were doing inside your infinite loop. In principle, simply calling DatagramSocket.receive() should be an efficient waiting on the socket. As long as the socket does not have any data in its incoming buffer the method should block without wasting any resources. Is this what you did? Can you post some code?

Categories : Android

Entity Framework listening to SQL Server changes
I had a similar requirement and I solved it using the EF function: [context].Database.CompatibleWithModel(throwIfNoMetadata: true) It will return if your model matches the underlying database structure using the metadata table. Note that I was using a Code First approach. The msdn definition is below: http://msdn.microsoft.com/en-us/library/system.data.entity.database.compatiblewithmodel(v=vs.103).aspx Edit: Just found an amazing article with a demonstration: http://blog.oneunicorn.com/2011/04/08/code-first-what-is-that-edmmetadata-table/

Categories : Asp Net

Multithreading and Listening Serial Port
You misunderstand what is going on. SerialPort.ReadLine() does not use a thread. It is your DataReceived event handler that runs on another thread. Necessary so that the SerialPort can notify your code about received data as quickly as possible without having to wait for your UI thread to go idle. Which does indeed mean that you cannot directly update your UI from your event handler, you'll get an InvalidOperationException when you try anyway. The DataReceived event is certainly there to help you avoid freezing your UI. There are too few hints in your question to know what your real problem might be. One issue could be using Control.BeginInvoke() too often, flooding the UI thread with invoke requests so it doesn't get around to doing its regular duties. Like responding to input and

Categories : C#



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