w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Python cx-freeze issue
You're using wrong command: freeze.py in pip/commands directory is for pip freeze command. Use cxfreeze program. cxfreeze /home/frost/Desktop/dd.py See cxfreeze script for usage detail.

Categories : Python

NFC tag reading in python on raspberry pi
There are lots of links on google wherein you can find information on data format used in NFC. Some of them are http://learn.adafruit.com/adafruit-pn532-rfid-nfc/ndef http://developer.nokia.com/Community/Wiki/Understanding_NFC_Data_Exchange_Format_(NDEF)_messages

Categories : Python

Raspberry Pi Python PWM RuntimeError: No access to /dev/mem
The problem is with the code above is that I forgot to set RED to at output before trying to use it. The error message did not help resolve this problem. Next time, I need to remember to setup PWM pins as outputs before trying to use them.

Categories : Python

Python failure file handling freeze
Remove the blanket except. Your script is not freezing, but any error you get is being ignored in an endless loop. Because you use a blanket except: you catch all exceptions, including the keyboard interrupt exception KeyboardInterrupt. At the very least log the exception, and catch only Exception: except Exception: import logging logging.exception('Oops: error occurred') KeyboardInterrupt is a subclass of BaseException, not Exception and won't be caught by this except handler. Take a look at the shutil module for copying files, you doing way too much work: import time import shutil import os.path paths = ('28-000004d2ca5e', '28-000004d2fb20', '28-000004d30568') while True: for i, name in enumerate(paths, 1): src = os.path.join('/sys/bus/w1/devices', name, 'w1_

Categories : Python

Using Python smbus on a Raspberry Pi - confused with syntax
I'm absolutly not sure this is the problem, but according to the specs p22: MMA7660FC is read using it’s internally stored register address as address pointer, the same way the stored register address is used as address pointer for a write. The pointer generally auto-increments after each data byte is read using the same rules as for a write (Table 5). Thus, a read is initiated by first configuring the device’s register address by performing a write (Figure 11) followed by a repeated start. The master can now read 'n' consecutive bytes from it, with the first data byte being read from the register addressed by the initialized register address. As far as I understand, to "read" from a register, you have to start by writing the register address, and then blindly read a byte

Categories : Python

Raspberry PI: PHP call python script with sudo
Mm, i have try with this two simple example: /Scripts/test.py #!/usr/bin/env python print (str('hello world')) /var/www/test.php <?php echo shell_exec('/Scripts/test.py'); ?> via a browser, show me "hello world" Perhaps try this: chmod a+x your_py_file.py Hope that help..

Categories : Nginx

No video file created by OpenCV 2.3.1 with Python on Raspberry Pi
I eventually went through and tried all of the fourcc codecs and none worked. Same with the mpeg2 codec. I ended up using avconv to create and capture the video with this line: import os os.system("avconv -f video4linux2 -input_format mjpeg -i /dev/video0 output.avi") os.system() is used to run a terminal command. OpenCV can still be used to process the video files at a later time. Hope this helps someone.

Categories : Opencv

Running Python script causes Raspberry Pi to lose power
I tried your script. It locks up the rpi at this line GPIO.setup(6,GPIO.IN,pull_up_down=GPIO.PUD_DOWN) GPIO06 isn't one of the pins on the GPIO port. You'd have look at the schematic to see what it's connected to. Looks like it's LAN_RUN. What are you trying to do with it? From elinux.org GPIO06 is LAN_RUN and is available on pad 12 of the footprint for IC3 on the Model A. On Model B, it is in use for the Ethernet function. So unless you have a model A, you shouldn't be using GPIO06

Categories : Python

Twisted Python script on Raspberry Pi (Debian) to communicate with Arduino via USB
Judging from this: http://twistedmatrix.com/trac/browser/tags/releases/twisted-12.3.0/twisted/internet/_win32serialport.py#L84 you should be looking at dataReceived(self,...) method of your Protocol subclass Thus: class USBclient(Protocol): def connectionMade(self): global serServ serServ = self print 'Arduino device: ', serServ, ' is connected.' def cmdReceived(self, cmd): serServ.transport.write(cmd) print cmd, ' - sent to Arduino.' pass def dataReceived(self,data): print 'USBclient.dataReceived called with:' print str(data) try this to see if it works.

Categories : Python

Raspberry pi will not send serial data to an arduino using either minicom or python
You need to read up on the difference between arduino and raspPI 'serial' pins - in short, their voltage levels are quite different and require a conversion cable between the two of them to adjust these levels.

Categories : Python

How can I make a connection between Raspberry Pi and a Bluegiga WT11i Bluetooth Module using Python?
Got it!! pi@raspberrypi ~ $ aptitude install bluetooth pi@raspberrypi ~ $ hcitool dev Devices: hci0 00:07:80:54:CA:E2 pi@raspberrypi ~ $ hcitool scan Scanning ... 00:07:80:54:CA:E2 BGWT11i pi@raspberrypi ~ $ bluez-simple-agent hci0 00:07:80:54:CA:E2 Enter PIN Code: 1234 Now I can connect ... pi@raspberrypi ~ $ python rfcomm-client.py 00:07:80:54:CA:E2

Categories : Python

Python having trouble accessing usb microphone using Gstreamer to perform speech recognition with Pocketsphinx on a Raspberry Pi
So I finally got this guy working. Couple key things I needed to realize: 1. Even if you're using Pulseaudio on your Raspberry Pi, as long as Alsa is still installed you're still able to use it. ( This might seem like a no brainer to others, but I honestly didn't realize I could still use both of these at the same time ) Hint via (syb0rg). 2. When it comes to sending large amounts of raw audio data ( .wav format in my case ) to Pocketsphinx via Gstreamer, (queues) are your friend. After messing around with gst-launch-0.10 on the command line for a while I came across something that actually worked: gst-launch-0.10 alsasrc device=hw:1 ! queue ! audioconvert ! audioresample ! queue ! vader name=vader auto-threshold=true ! pocketsphinx lm=/home/pi/dev/scarlettPi/config/speech/lm/scarlett

Categories : Python

Porting Python Raspberry Pi application to Twisted - how to handle background threads that poll the hardware
You can use LoopingCall (howto) to schedule a repeated function call on a certain interval. This probably replaces your polling threads entirely.

Categories : Python

PHP Mail freeze
Try to debug by making php to show the error logs. You can use below code by placing it at top of your php code as: <?php error_reporting(-1); ?> Another thing i noticed in your email sending code is that it does not contain headers. Headers are necessary for an email functionality to work properly. <?php $to = "testing@example.com"; $subject = "Test mail"; $message = "This is a test email message."; $from = "testing1@example.com"; $headers = "From:" . $from; if(mail($to,$subject,$message,$headers)){ echo "Mail is Sent."; }else{ echo "Mail not sent."; } ?>

Categories : PHP

freeze top row using spreadsheetgear
After some research I found out I need to select the cell first and then set the FreezePanes property: worksheet.Cells[1,0].Select(); worksheet.WindowInfo.FreezePanes = true; Basically what happens is it freezes rows above and columns to the left of the selected cell.

Categories : C#

ACM Interactors Freeze
As a workaround, in addition to using Java 1.5, add the field to the NORTH. Also, you may want to extend GraphicsProgram. Modified SSCCE: import acm.program.*; import java.awt.event.*; import javax.swing.*; public class TextFieldExample extends GraphicsProgram { @Override public void init() { nameField = new JTextField(15); add(new JLabel("Name: "), NORTH); add(nameField, NORTH); nameField.addActionListener(this); } @Override public void actionPerformed(ActionEvent e) { if (e.getSource() == nameField) { println("Hello, " + nameField.getText()); } } private JTextField nameField; }

Categories : Java

c# WPF UI freeze after using MemoryStream
It is a little bit late, but I would like to add some more information. The problem is that you are using a synchronous call which uses the UI thread, unlike all other synchronous calls, this call takes some time, and therefore, your application is frozen until the call will finish. You need to use an asynchronous call, so that your UI thread will be free, so the UI will not be frozen. There are many ways to make an asynchronous calls, such as opening a new task, thread, or my preferable way, is to use the async await, which is very great - you can write a synchronous code, and to add async and await in the right places, and woops - it is an asynchronous code! To read more about async await click here.

Categories : C#

pip freeze for Node and npm
You can create a package.json out of the currently installed package using npm init. Then you can easily move the package.json and simply do npm install to install the packages wherever you want.

Categories : Node Js

How can an App freeze Android OS
Where is your code sample above located? It should be be on a UI thread, potentially blocking user interaction. Are you also getting ANR messages before the freeze? thread.join(); will block indefinitely. See Thread.join() documentation. Also, the following looks like a busy loop to me. What are you doing at the comment? If nothing, then the loop will spin like crazy (think while (true) { }). while(thread.getState() != Thread.State.TERMINATED){ // wait until thread finishes }

Categories : Android

How to Freeze JSF Radio Buttons
Try this: <h:selectOneRadio value="#{ref.arrive.boardingInformation}" disabled="true"> <f:selectItems value="#{newMessage.boardingInformationSelectItemList}" /> </h:selectOneRadio> Here are the available properties: http://www.tutorialspoint.com/jsf/jsf_selectoneradio_tag.htm

Categories : JSF

.each() makes the page Freeze
The following will solve the issue by adding all the html at once, this will be faster than the other method...it will still lock the DOM at the end when it adds the html variable to the html of the parent element. var html = ''; $('.calling-div').each(function() { var fetch_id=$(this).attr('data-id'); $.ajax( { type: "POST", url: "page-url", data: {var1: fetch_id}, dataType:"html", success: function(data) { html += "<div class='calling-div' id='calling-div-" + fetch_id + "'>" + data + "</div>" } }); // Ajax }); // Each function $('.caller-div-holder').html(html); Special Note I highly recommend using the following to solve this problem: jQuery append() for multiple elements after for loop without flattening to H

Categories : PHP

All JFrame freeze while do JavaMail
When you do heavy task you should run them in another threads rather in the same as gui. If you run in Event Dispatch Thread then the gui is gonna freeze until finish. You can use SwingWorker here is an example i really like Swing Worker Example Example: class Worker extends SwingWorker<String, Object> { @Override     protected String doInBackground() throws Exception { //here you send the mail return "DONE";     }     @Override     protected void done() {         super.done();         //this is executed in the EDT JOptionPane.showMessageDialog(null, "Message sent", "Success", JOptionPane.INFORMATION_MESSAGE);     } }

Categories : Java

UIAlertView animation freeze
Often this type of thing is caused by showing the alertView in the action method of some control. If this is your case, use a dispatch block that shows the UIAlert (which you can prepare in the action routine), and dispatch it async to the main queue.

Categories : IOS

CSS Table Column Freeze
try using .headcol {max-width: 10em} also note that using .headcol {position: absolute} makes the cell not to align relatively to the document; that´s why it looks like that

Categories : HTML

JS Causing browsers to freeze
You are running a multitude of setInterval() calls, so the event queue gets crowded with your function. I think, what you mean is more like setTimeout() at the end of your function. function countdownProcedure(){ // all your logic setTimeout(countdownProcedure,interval); }; The difference is, that setInterval() will run your code every x seconds, until you tell it to stop. setTimeout() on the other hand, just runs your code once after x seconds.

Categories : Javascript

How to freeze a HashMap to prevent further changes?
The best you can do with standard JDK libraries is Collections.unmodifiableMap(). Note that you must drop the original map reference, because that reference can still be accessed and changed normally. If you passed the old reference to any other objects, they still will be able to change your map. Best practice: map = Collections.unmodifiableMap(map); and make sure you didn't share the original map reference.

Categories : Java

UIActivityViewController freeze in first time
I don't really understand the problem - you alloc/init a UIActivityViewController and then you present it with presentViewController:animated:completion, correct? Make sure to call the presentViewController... on the main thread. Sometimes UI stuff called on the wrong thread takes seconds to get executed. But it might also just be iOS - UIActivityViewController takes some time to check for available services and stuff, that might be the thing that's slowing it down too.

Categories : Iphone

Why does this graphics loop freeze my gui?
The problem is that it's infinite. Your condition: canvasY < mapHeight + offsetY && canvasX < mapWidth + offsetX Will always be false, since none of those values ever change. What I believe you want to do is to call these after the draw call. canvasY = offsetY + y; canvasX = offsetX + x;

Categories : Java

C# lock leads to freeze
Delegates are just callbacks, they don't make any guarantees about threading. You may want to check out the ConcurrentBag class, which is already thread-safe, so you can avoid worrying as much about the locking with respect to the collection.

Categories : C#

SSL error on Raspberry Pi
I encountered this problem yesterday. First thing to try is to change the account from which you want to send an email to some other provider: try gmail, for instance. In my case it started working instantly. If it's also the case for you (Microsoft's fault?), try another thing with windows live account (similar to the one suggested in the comment):openssl s_client -connect smtp.live.com:587 -starttls smtp -crlf -ign_eof then type: ehlo auth login In my case nothing happened. No answer, only read timeout. This time try: openssl s_client -connect smtp.live.com:587 -starttls smtp -crlf -ign_eof -no_tls1_2 Then: ehlo auth login I got an answer immediately. If it's still your case, there's a little problem. I haven't found any way to specify such a parameter (which versions of tls to preve

Categories : Python

Raspberry pi network
If your Pi is able to connect at will, then I assume it has an interface configured appropriately for your local network. Knowing this, connecting and disconnecting is as simple as the Bash command ifup and ifdown. If you're using a Bash script: # some code for taking and saving a picture (I'll leave this to you) ifup wlan0 echo "Raspberry Pi just took a pic!" | mail -s "New picture taken" you@yourdomain.com ifdown wlan0 # more code to finish out your program Of course, replace wlan0 with the relevant interface for your system (which may very well be wlan0). Happy coding! :)

Categories : Linux

C++ 11 with Raspberry Pi performances
The only thing I can come up with for performance if you use any of the following new features. http://en.wikipedia.org/wiki/C%2B%2B11#Core_language_runtime_performance_enhancements To be explicit about it, I do not see any significant performance gain you could obtain in here other than the usual differences that may occur among the compilers. However, there should be no big difference among the major ones.

Categories : C++

Bluetooth with raspberry pi
Are you sure that the Arduino side is sending a newline (" ") character? The code will hang unless it recieves a newline character. See the pySerial documentation for readline(): pySerial API Read a line which is terminated with end-of-line (eol) character ( by default) or until timeout. If you are sure the Arduino is sending a newline, post the code from the Arduino here.

Categories : Python

Raspberry Pi + PocketSphinx
You need to separate two different issues - running pocketsphinx on Windows with Python and running pocketsphinx on Raspberry Pi with Python. To run pocketsphinx on Windows with python you need to compile and install python module for Windows. You can do that with the python script python/setup_win32.py. Before running this script you need to compile pocketsphinx first according to the instructions. This script will compile and install python module into required place. For more information on this script read python distutils documentation. To use pocketsphinx python module on Raspberry Pi which is a normal Linux system you can just compile and install pocketsphinx according to the documentation with standard configure && make && make install. The python module will be

Categories : Python

JNativeHook on Raspberry Pi
You need to recompile the native library contained in the jar to ARM. It should compile without any issues on Linux, use ant compile jar to build. If you want to file a bug report I will work with you to get an arm binary supported.

Categories : Java

How to Freeze Header row in Excel using ExcelLibrary dll
I don't have experience working with Excel Library you specified but I can to suggest to migrate to EPPlus library which is free and available on the http://epplus.codeplex.com/ site. This is very easy to use library with clear API and was designed to create advanced Excel 2007/2010 spreadsheets on the server. We used it successfully on several production projects. Using it you can achieve what you need by using ExcelSheet.View.FreezePanes method. I understand that my answer not answer your question, but it can be treated as alternative solution to you problem (I really don't know if you can or not to achieve what you need with Excel Library you specified).

Categories : Asp Net

Popen freeze / PySide GUI / cmd popup
The issue is that any kind of stdout happens after the process is finished. subprocess.Popen is not displaying the STDOUT until the buffer is full. In your case, the buffer never fills, so nothing is displayed until the subprocess is completed. Might I point you to this thread with some suggested recommendations: real time subprocess.Popen via stdout and PIPE Your milage may vary as none of the solutions seemed to be the magic bullet for anyone. I personally found that instructing the subprocess.Popen to open an unbuffered Python did the trick. command = ["python", "-u", "python_file.py"] p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) for line in iter(p.stdout.readline, ''): line = line.replace(' ', '').replace(' ', '') print line s

Categories : Python

iOS app freeze during checking internet connection
When you are requesting to the server then reduce the timeoutInterval option and set it to minimum so that request should not wait for long to get the response by this way you can reduce the time of freezing the app. If you want to get rid of it completely then you should run all the process for network check in on another thread possibly in background thread.

Categories : IOS

UIViewController dismissViewControllerAnimated: completion: causes app to freeze
I think what you wanted was: [loginViewController dismissViewControllerAnimated:YES completion:nil]; instead of [splitViewController dismissViewControllerAnimated:YES completion:nil];

Categories : IOS

pip freeze does not show all installed packages
I just tried this myself: create a virtualenv in to the "env" directory: $virtualenv2.7 --distribute env New python executable in env/bin/python Installing distribute....done. Installing pip................done. next, activate the virtual environment: $source env/bin/activate the prompt changed. now install fabric: (env)$pip install fabric Downloading/unpacking fabric Downloading Fabric-1.6.1.tar.gz (216Kb): 216Kb downloaded Running setup.py egg_info for package fabric ... Successfully installed fabric paramiko pycrypto Cleaning up... And pip freeze shows the correct result: (env)$pip freeze Fabric==1.6.1 distribute==0.6.27 paramiko==1.10.1 pycrypto==2.6 wsgiref==0.1.2 Maybe you forgot to activate the virtual environment? On a *nix console type which pip to find out.

Categories : Python



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