w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Installation of ubuntu 12.04: win7 not detected, partitions not detected
You need to run the Ubuntu GRUB bootloader, follow the instructions on the Ubuntu website https://help.ubuntu.com/community/Grub2/Installing#Reinstalling_GRUB_2 When I installed ubuntu, I lost my partitions on the drive, in the end I reverted to having two drives one with Windows 7 and the other with Ubuntu, I had to recover the drive with partition recovery software (TestDisk). Skipping the quick scan saves time as you will probably want to do a full scan. http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step

Categories : Ubuntu

Is there a way to tell if LocalBroadcastManager broadcasts were received?
Is there a way to tell if LocalBroadcastManager broadcasts were received? Or are being listened to? sendBroadcast() returns true if there was 1+ receivers, false otherwise. That's not documented, but that is based on the current implementation. I filed an issue to get that documented. Hence, your IntentService could use sendBroadcast() to try to send a message to your running Service, if it exists. If it does, sendBroadcast() should return true, and the IntentService knows that the message should be handled there. If sendBroadcast() returns false, you can raise the Notification.

Categories : Android

Socket.io broadcasts everything to everybody in node/express app
While it is not clear how to help you I can tell what's going on in your code: app.post('/api/users', function (req, res) { // some code io.sockets.on('connection', function (socket) { // some code }); }); Whenever a user POSTs something to /api/users a new handler is attached to io.sockets (that's what .on does). But these handlers are never removed, so each time a new connection is established all attached handlers fire. That's where your broadcasting comes from. You have to separate app.post(...) from io.sockets.on('connection',...) (they should be independent, both defined at module level, not nested). I'm sure it won't be easy (you will probably have to authenticate a user twice for example) but that's the only reasonable way.

Categories : Node Js

Tidudpclient broadcasts wrong data
You are sending binary data as a String. In XE4, Strings are Unicode, and Indy's default encoding is ASCII. Your String data contains characters that are outside of the ASCII range. Don't use String for binary data. That is not what it is meant for. You can get away with that in Delphi 2007 an earlier, but not in Delphi 2009 and later. You can either: continue using Send(), but tell it to use Indy's 8bit encoding instead of Indy's default encoding: IdUDPClient1.Send(#$7e#$b8#$c7#$81#$10#$8d#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$9d#$02#$0d, Indy8BitEncoding); switch to SendBuffer() instead (which you should do, even in your Indy 8 code): var Buf: TIdBytes; begin SetLength(Buf, 34); FillBytes(Buf, 34, $00); Buf

Categories : Delphi

Wildcards for listening scope broadcasts with $on on AngularJs
In the angular js source code, $on is defined as follows: $on: function(name, listener) { var namedListeners = this.$$listeners[name]; if (!namedListeners) { this.$$listeners[name] = namedListeners = []; } namedListeners.push(listener); return function() { namedListeners[indexOf(namedListeners, listener)] = null; }; }, since this.$$listeners is an associative array, and associative arrays in javascript do not take regexs as keys, this suggests that the short answer is "no you can not".

Categories : Angularjs

How custom permissions are used to restrict sending and receiving the broadcasts within a single app?
There is nothing in the code of the receiver part that tells that the BroadcastReceiver will be invoked only if the sender has saleh.yamba.RECEIVE_TIMELINE_NOTIFICATIONSpermission. Yes, there is. You passed in saleh.yamba.RECEIVE_TIMELINE_NOTIFICATIONS to registerReceiver(). Specifically, you are using the four-parameter version of registerReceiver(), where the third parameter is a "String naming a permissions that a broadcaster must hold in order to send an Intent to you. If null, no permission is required."

Categories : Android

Receiving broadcasts and calling controller functions from isolated scope/directive in AngularJS?
The controller executes before the link function, so your broadcast is being sent out too soon. You can delay this using $timeout: $timeout(function() { $scope.$broadcast("onSomething", ""); }); To call a controller method from a directive with an isolate scope, you need to specify the method as an argument: <component ng-repeat='c in components' id="c.id" my-width="{{c.width}}" my-height="{{c.height}}" callbk="doSomething(data)"> and you need to use the & syntax in the directive: scope: { width: '@myWidth', height: '@myHeight', emitSomething: '&callbk' }, To pass parameters to that callback/controller function, you need to use the proper syntax: scope.localDirectiveName({arg1: ..., arg2: ...}). In the fiddle, I only used one argument, and passed

Categories : Angularjs

The Tab key isn't being detected in Java on Mac
Use setFocusTraversalKeysEnabled(false) on the control that you listen on (JTextField?). EDIT: The Tab key is usually used to switch input focus between UI controls, for easier keyboard input without the need for a mouse. When a UI control receives a key press event it first tries to "consume" it on its own, and if the key is a special key (Tab, Shift-Tab, etc.) then the control consumes the event and doesn't propagate it further. On the other hand, if the key is not a "special" key it propagates the event to attached listeners (if any). Calling setFocusTraversalKeysEnabled(false) disables this built-in behavior for the control (but in this case just for FocusTraversal, i.e. Tab and Shift+Tab), so that event gets propagated to listeners.

Categories : Java

KeyPress not being detected
Here you have a sample code showing you how to hook when a key is being pressed: Imports System.Runtime.InteropServices Public Class Form1 Private Const WM_HOTKEY As Integer = &H312 Private Const MOD_ALT As Integer = &H1 Private Const MOD_CONTROL As Integer = &H2 Private Const MOD_SHIFT As Integer = &H4 Private Declare Function RegisterHotKey Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal id As Integer, ByVal fsModifier As Integer, ByVal vk As Integer) As Integer Private Declare Function UnregisterHotKey Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal id As Integer) As Boolean Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) If (m.Msg = WM_HOTKEY AndAlso m.WParam = CType(0, IntPtr)) Then If (m.LParam

Categories : Dotnet

JAR libraries not being detected
Android Studio currently does not automatically sync your Gradle build files with your Android Studio (.iml) files. However, version 0.1.3 added a new sync button to the toolbar that will do this manually. It's mentioned in the second bullet point of this blog post. There were a lot of fixes in the Gradle project import and build areas. There is now a "sync" button in the toolbar which will reimport the Gradle project state into your Android Studio project. Use this after editing your Gradle files, for example to add a library. In the future we will more automatically handle state syncing, but for now this is the simplest way to keep the IDE up to date with project structure changes made to the Gradle files.

Categories : Java

IE8 javascript detected as IE7
I assume that you got this solution from here? If you read through the comments for the chunk of code you're using (on the link above) you'll see that someone else had the same issue you're having. The code itself is sound (although you'll find a few people who don't feel that browser-sniffing in this fashion is good practice). The reason Internet Explorer 8 is getting caught and redirected is either: The user has their browser in IE7 compatibility mode (which is possible from the Tools menu, or the little browser icon in the URL bar - IE8 was intended to be intelligent enough to detect and switched to IE7 mode automatically. This is usually caused by invalid markup); The website itself is forcing their browser into IE7-mode using X-UA-Compatible or similar. To get to the bottom of

Categories : Javascript

Error in AJAX post when running from local web server but not local file system
Note to anyone who runs into this. It took me about a day to figure it out. First off Blender was right about the POST requests, I changed them to GET requests. Secondly the issue, as I found out lied not within my code, but with IIS 7.5. It does not come with json as a predefined MIME type. Here are the steps in order to solve this. 1)Make sure you are running IIS 7.5. 2)Open the IIS Services Manager. 3)Open up MIME Types 4)Add a new MIME type 5) There are two fields to fill out. File Name Extension: JSON MIME Type: application/json After that it should work.

Categories : Jquery

Sharing local user's profile picture with others in WinRT in local network game
You could directly read the IStorageFile returned by GetAccountPicture: var file = UserInformation.GetAccountPicture(AccountPictureKind.LargeImage); var buffer = await FileIO.ReadBufferAsync(file); var bytes = buffer.ToArray();

Categories : C#

Is it possible to secure local database data when selling an offline (local installation) web app?
You cannot stop that user from stealing the data but it should be possible to encrypt the local data with JS in case the laptop is stolen etc. To do this you would need to prompt the user for the encryption key or use some other method... It should obviously not be stored in the local database itself

Categories : Database

Setting up local ip over wireless network to create a local server on Ubuntu
Just add this to your normal runserver command: python manage.py runserver 0.0.0.0:8000 Then others on your local network can access it through: http://192.168.1.18:8000

Categories : Django

Android sdk not detected in eclipse
The best way is to download this bundle: http://developer.android.com/sdk/index.html Everything you need to develop Android app is included here. You do not need to do anything. Cheers,

Categories : Android

How to tell if android device detected by ADB?
By using ddmlib.jar, which is also used by Eclipse plugins, you can monitor the device connect/disconnect event. The ddmlib is usually found in the tools/lib directory in Android SDK. But there is no the official documents about how to use it. Below is the code example. You have to include the ddmlib.jar and change the adb location according to your environment. import java.io.IOException; import com.android.ddmlib.AndroidDebugBridge; import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener; import com.android.ddmlib.IDevice; public class Main { public static void main(String[] args) throws IOException { AndroidDebugBridge.init(false); AndroidDebugBridge debugBridge = AndroidDebugBridge.createBridge("D:\android-sdk\platform-tools\adb.exe", true);

Categories : Java

Flash light not detected
I think you aren't setting your params again: I used this to check if there is a flashlight: public static Boolean hasFlashLight(Context context){ return context.getApplicationContext().getPackageManager() .hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH); } and to turn it off and on: Parameters params = mCamera.getParameters(); if (!isFlashlightOn) { params.setFlashMode(Parameters.FLASH_MODE_OFF); } else { params.setFlashMode(Parameters.FLASH_MODE_TORCH); } mCamera.setParameters(params); Let me know if it works for you too.

Categories : Java

class not getting applied though detected
Try $("ul.nav li").click(function(e) { var $this = $(this), clazz = $this.attr("class"), newclass, oldclass; var type = clazz.substr(clazz.length - 1); if (type == "1") { newclass = clazz; oldclass = clazz.slice(0,-1); } else { newclass = clazz + "1"; oldclass = clazz; } $this.removeClass(oldclass).addClass(newclass); $this.siblings('[class$="1"]').attr('class', function(idx, clazz){ return clazz.substring(0, clazz.length - 1) }); return false; }); Demo: Fiddle Another version var regex = /1$/ $("ul.nav li").on('click', function(e) { var $this = $(this), clazz = $this.attr("class"); e.preventDefault(); if(!regex.test(clazz)){ $this.removeClass(clazz).addClass(clazz + 1);

Categories : Jquery

multiple Lua VMs detected in Xcode
You should not link the second dynamic library with Lua. Leave it as a dependency. I'm not sure how to express this in Xcode. Also, as far as I know, there is no need to use -Wl,-E in Mac OS X.

Categories : Xcode

Input not detected in jQuery
check this sample. I just removed the "fast" parameter from your .show() call. http://jsfiddle.net/juaning/PsvS7/ From those to calls, let me know if that fix your problem. $('#checkuser').show(fast);alert('hsdi'); $('#checkuser').show(fast);

Categories : PHP

Detected WordPress url different to what was created
It seems that somewhere on your website the wrong URL is appearing. Check the HTML source code in the browser to find the occurrence, and fix the problem there. Otherwise just somebody entered the URL manually in their address bar.

Categories : Wordpress

Child object not detected
It looks like you are not instantiating m88 or m99 anywhere. Since you don't have any breakcommands in your switch statement it falls through and executes every case even if mode is only 2. I'm assuming you meant to do something like this: switch (mode) { case 2: this.setChildIndex(m22,this.numChildren - 1); break; case 3: this.setChildIndex(m33,this.numChildren - 1); break; // etc... }

Categories : Actionscript

Heap Corruption Detected in C++
matrix = new int*[cols]; for(int i = 0; i <= cols; i++) { matrix[i] = new int[rows]; } For an array with cols elements, the index is from 0 to cols - 1 inclusively. The heap corruption will be detected when delete [] matrix; Since matrix[cols] write a position out of array bound. UPDATE As @DanielKO (thank you buddy :p) pointed out in the comment there is a mismatch, the "Populate the matrix..." loop makes "i" iterate over "rows" when it should be iterating over "cols".

Categories : C++

My custom httpModule is not being detected with MVC
You are correct, it is your namespace that is missing from the type. The following worked for me: <modules runAllManagedModulesForAllRequests="true"> <add name="CustomServerHeader" type="KittenFarm.ServerModules.CustomServerHeaderModule" /> </modules>

Categories : Asp Net

“A cycle was detected in the set of changes” with Linq to SQL
You can break the insertion into two parts ans still have one transaction if you wrap your code in a TransactionScope. Using trans As New TransactionScope() 'Code that generates a new ID in the database dc.SubmitChanges() 'Code that uses the new ID value. dc.SubmitChanges() trans.Complete() End Using This is the only way to avoid the exception. If this is impossible because of architectural decisions ("my submit button is bound to a XAML Command") you need to change the architecture. I think a UI command should never be so close to the data access layer anyway. You better call a service method from XAML.

Categories : Vb.Net

Why are my @components not detected by spring?
There could be many reason, one common reason is you created your @Component class under wrong package. As your context scanning config set the Class has to be under this package <context:component-scan base-package="ne.projl.*" />

Categories : Spring

testflight the app token for this app was not detected
Check you token from testflight app Add device identifier for test flight // In application:didFinishLaunchingWithOptions [TestFlight setDeviceIdentifier:[[UIDevice currentDevice] uniqueIdentifier]]; [TestFlight takeOff:@"9e5f8b26-358f-4a0e-b9c2-186d932b1187"];

Categories : Iphone

Linux: Move log files from a mounted dir to a local dir recursively while maintaining directory structure in local direcoty
How about something like rsync -azrR --include='*.log' -f 'hide,! */' /media/primary /backup If you use man rsync and type 2343g it should take you to the line where it explains this filter. Basically it will hide everything that's not a directory (every file) from the pattern matching; however, since I've used the --include='*.log' flag as well it will override that and the pattern will match only .log files. You can also use the -nv flag to do a dry run and see what would happen.

Categories : PHP

libevent with non blocking sockets: If the remote peer sends RST *while* send on local is executed, will local get EV_READ also
Scenario A : Application is waiting for an event. It gets a FIN from remote, EV_READ event is >generated, application does a read(or recv) and gets 0 Yes - that's right. Scenario B: Application is sending data. It gets a FIN from remote while the send is being >executed. Will the application get an EPIPE (I think so). Will there also be an EV_READ event >generated for the same FIN for which the application gets an EPIPE Yes, there will be an EV_READ event generated. (ofcourse provided you didn't close() the socket in the mean time). However you're not getting an error on write in this very particular case. When you get a FIN from the peer end, the TCP connection is only half closed. The incoming FIN simply means "I've nothing more to send". But you can send it more data. Or yo

Categories : Sockets

global var becomes local --UnboundLocalError: local variable referenced before assignment
You should declare rate as global: import os, sys rate=30 def foo(): global rate # <---- print('#########rate:', rate) if False: rate=int(sys.argv[2]) foo() If there is assignment to a varaint (without global declaration), it is treated as local variable.

Categories : Python

Hosting local maven repository on Local Area Network
Unfortunately just an apache web server is not sufficient to make your repository available over HTTP. You need additional software, a "repository manager". There is a list of them here: http://maven.apache.org/repository-management.html You can make a repository on the local network available over SSH. Here is how to do that. (1) In the build section of your pom: <!-- Make SSH wagon available.--> <extensions> <extension> <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-ssh-external</artifactId> </extension> </extensions> (2) In your ${USER_HOME}/.m2/settings.xml (or wherever you configure repository URLs): <repositories> <repository>

Categories : Maven

In Spring MVC 3 local is not getting changed when clicking local changing link
<mvc:annotation-driven/> is registering its own handler mapping (RequestMappingHandlerMapping) and your interceptor configuration is not applied to that. Define your interceptor like this: <mvc:interceptors> <bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor"> <property name="paramName" value="lang" /> </bean> </mvc:interceptors>

Categories : Spring

stack smashing error detected
From the Linux man page (and POSIX): The vfork() function has the same effect as fork(2), except that the behavior is undefined if the process created by vfork() either modifies any data other than a variable of type pid_t used to store the return value from vfork(), or returns from the function in which vfork() was called, or calls any other function before successfully calling _exit(2) or one of the exec(3) family of functions. You're modifying data and returning from the function in which vfork was invoked - both of these lead to undefined behavior. vfork is not equivalent to fork, the number of things you can do in a vforkd child are very, very limited. It should only be used in very specific circumstances, essentially when the only thing you need to do in the child is ex

Categories : C

Installing Theano on EPD (Windows x64), g++ not detected
The problem was that I installed Enthought Canopy and it does not contain mingw. The issue can be solved by installing Enthought Python Distribution. Following CUDA linking error - Visual Express 2008 I created vcvars64.bat in c:Program Files (x86)Microsoft Visual Studio 10.0VCinamd64 to avoid nvcc fatal : Visual Studio configuration file '(null)' error. But now I get this exception: c:program files (x86)microsoft visual studio 10.0vcincludecodeanalysissourceannotations.h(29): error: invalid redeclaration of type name "size_t"

Categories : Python

Canny: Lot of unwanted edges are detected
You have threshold1==0. If you set it to 10, and set the blur sigma to 4, most of those spurious lines will disappear. (at least they do for me). With my webcam these setting get a reasonable output: cv::GaussianBlur(image,blur,Size(0,0), 4); cv::Canny(blur,canny,25,30,3); However the lines detected are still a bit noisy. EDIT: The following doesn't help: Another thing you could do is average two consecutive frames, that would reduce the noise to 70%. (Or buy a better camera)

Categories : C++

glibc detected; memory corruption
Sometimes output gets stuck in the write buffer and never actually gets written to the console if the program exits prematurely. Calling fflush(stdout); will help you determine if this is the case. Or else use fprintf(stderr, ...) for debug output, since stderr is unbuffered. More likely, however, is that your program actually does crash inside the one major task that takes place between printing "realizing" and "blur initial"... the Image<uint8_t> copy constructor. Why you're passing by value and causing a copy is beyond me, I would prefer a const reference there to avoid copying a large object. Still, if you have a bug in your copy constructor it's definitely worth finding and fixing that first.

Categories : C++

After using git clean, I have deleted files being detected as changes?
git clean -fd skips over files that match any of the entries in your .gitignore, which I am assuming is the case. So make sure there is no regex matching foo/bar/whatever.txt in any of your .gitignores. On more thing make sure that the foo/bar/whatever.txt is not locked, which could be preventing the cleaning.

Categories : GIT

deadlock detected while waiting for resource
This approach isn't going to work. Here's what's happening to cause the deadlock: When you update a row in project_tbl, your transaction will obtain a row lock and apply the changes Your trigger arch_proj_trigger is then firing after the update and is inserting a row into the table proj_archive_tbl The insert into the proj_archive_tbl table causes the trigger mark_proj_deleted to fire - this cannot update the row in project_tbl because the original transaction is still holding its row lock from when you updated the status The first trigger cannot complete until the second one completes - but the second one will never complete because the originating update statement is blocking it. I'm generally not an advocate of having this kind of application logic in triggers - for the reason illus

Categories : SQL

How are double frees detected in glibc?
For each allocation, memory manager keeps some 'header' (most likely tree node or linked list). When you passed to free something that doesn't contain valid header - well, it couldn't correctly be freed. As for where this information is being kept - it's up to implementation, but usually it placed right before address you got from malloc - however, size and structure is very likely to be unknown, but at least it gives an idea how easily this header could be broken/corrupted/overwritten/etc.

Categories : C



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