w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Floating point operations 32 bit mode vs 64 bit mode
Extended is equal to Double in X64. X32 mode is using the FPU floating point unit, while X64 is using the SSE registers for floating point execution. There is also the compiler directive Floating point precision control (Delphi for x64), which by default is on and keeps intermediate single floats as doubles.

Categories : Delphi

What's the point of using "w" mode in python?
According to the docs for open(): The most commonly-used values of mode are 'r' for reading, 'w' for writing (truncating the file if it already exists), and 'a' for appending (which on some Unix systems means that all writes append to the end of the file regardless of the current seek position). If mode is omitted, it defaults to 'r'.

Categories : Python

bash variable - escaping point
It works for me. You are probably not quoting the variable when using it later: M2_1="GRANT USAGE ON *.* TO '$USER'@'%' IDENTIFIED BY PASSWORD '$MYSQL_PASSWORD';" echo "$M2_1"

Categories : Bash

text editor mode for calling bash command
See man bash: edit-and-execute-command (C-xC-e) Invoke an editor on the current command line, and execute the result as shell commands. Bash attempts to invoke $VISUAL, $EDITOR, and emacs as the editor, in that order. Per default bash is configured for emacs mode, hence the emacs like C-xC-e command. If you really like vi you can also set your bash into vi mode: set -o vi. This allows you to do normal line editing the vi way without invoking an explicit editor.

Categories : Linux

How to change mode from c++98 mode in Dev-C++ to a mode that supports C++0x (range based for)?
Go to Tools -> Compiler Options -> "Compiler" tab Check the checkbox labeled, "Add the following commands when calling the compiler" And add in the text entry box, "-std=c++11" or if that doesn't work "-std=C++0x" Should be something like that anyway, I haven't had Dev C++ installed for many years, so I had to look at some screenshots on Google to remember.

Categories : C++

Processing android mode installation error: could not move mode "Android Mode" to the sketchbook
I needed to download Android mode manually. The steps are given below: Download "Android Mode" zip file from here. Unzip the downloaded "Android Mode" in the directory "C:/ Users/User/My Documents/Processing/modes/". Restart Processing. For more information, visit here.

Categories : Android

Java - Polar Coordinates. Given a line segment AB and a point P, find the closest point on the polar line AB to point P
public static Location closest(double x1, double y1, double x2, double y2, double x3, double y3){ Location a = new Location("provider"); Location b = new Location("provider"); Location c = new Location("provider"); //I can't remember which one goes where, you may need to swap all the x/ys around //Do conversion or something here. a.setLongitude(x1); a.setLatitude(y1); b.setLongitude(x2); b.setLatitude(y2); c.setLongitude(x3); c.setLongitude(y3); return closest(a, b, c); } public static Location closest(Location a, Location b, Location c){ return a.distanceTo(c) < b.distanceTo(c) ? a : b; }

Categories : Java

Dialog not restricted to specified height
just add following css class in your css file <style type="text/css"> .ui-dialog-content { height: 450px !important; } </style> and please do let me know if you still face problem

Categories : Jquery

Restricted low-ascii character in AS3
Different operating systems use different characters to mark the end of line: Unix / Linux / OS X uses LF (line feed, ' ', 0x0A) Macs prior to OS X use CR (carriage return, ' ', 0x0D) Windows / DOS uses CR+LF (carriage return followed by line feed, ' ', 0x0D0A) In your case, ascii 13 = carriage return. It is probable that one of your air project configuration files has an embedded carriage return that is causing this error. You should try a utility such as linebreaks Less likely but not impossible, is that one of your actual file names contains a carriage return. For that you will need to try and rename the files till you find the correct one.

Categories : Actionscript

Android Distribution Restricted Certificate
You need to generate a developer private digital signing key .You can use standard tools — Keytool and Jarsigner — to generate keys and sign your application .apk files I would suggest you to read this link completely if you have not done http://developer.android.com/tools/publishing/app-signing.html

Categories : Android

Type 'string' not supported in restricted C++-AMP
The error message is correct C++ AMP does not support string or chars unfortunately. The smallest data type supported is int. There are tricks/techniques to get around this limitation they involve making the chars bigger into ints. There is a good article about how to do this here: C++ AMP: It's got character, but no char! and another here with source code String search sample with C++ AMP.

Categories : Misc

How to get unique values when restricted to select * using SQL
here is a quick solution: Use it as subquery select created_user, MAX(created_date) from ( select * from gisadmin.FORESTRY_LOCATIONLOG_vw WHERE 1=1 //append this ) Group by created_user Notice that I added 1=1 which will always be evaluated to true to handle your Where clause.

Categories : SQL

How to get a result from a restricted list of data?
You are not using your controle parameter. The query has no where clause, thus is returning all the data instead of filtering. Your query should probably look more like: public List getControle_versao(int controle) { return (List) session.getCurrentSession().createQuery( "FROM Receita WHERE controle = " + controle + " ORDER BY titulo").list(); }

Categories : Java

How to manage restricted profiles in android app?
The UI for users to control the restrictions you've built is managed by the system's Settings application. To make your app's restriction settings appear to the user, you must declare the restrictions your app provides by creating a BroadcastReceiver that receives the ACTION_GET_RESTRICTION_ENTRIES intent. The system invokes this intent to query all apps for available restrictions, then builds the UI to allow the primary user to manage restrictions for each restricted profile. For more info look at http://developer.android.com/about/versions/android-4.3.html#RestrictedProfiles

Categories : Android

Restricted Function with libsandbox and pysandbox
The RF result code was most likely due to unexpected syscalls for file operations (i.e. SYS_open(), SYS_close(), SYS_stat(), ...). It so happens when (1) the target program actually does file operations, and (or) when (2) it was dynamically linked and needs to load .so libraries in runtime. Since your target program does not invoke file operations, it belongs to the latter case. Then, to resolve the RF outcome, either, statically link the target program to avoid dependencies on shared libraries; or, extend the policy rules in the wrapper script to handle relevant SYSCALL / SYSRET events; DISCLAIMER: I am the author of libsandbox.

Categories : Python

Restricted profiles settings not being remembered
Turns out that you need to add some code when generating the RestrictionEntry Though I will update so that people don't have to hunt... In your receiver call final Bundle oldRestrictions = intent.getBundleExtra(Intent.EXTRA_RESTRICTIONS_BUNDLE); then when creating the entry reference it. e.g. RestrictionEntry myEntry = new RestrictionEntry(KEY, oldRestrictions.getBoolean(KEY, false)); myEntry.setType(RestrictionEntry.TYPE_BOOLEAN); myEntry.setTitle("KEY TITLE"); newEntries.add(myEntry);

Categories : Android

Lint restricted macro name list
The chances are that you're using a macro name such as _HEADER_FILE_H_ which is reserved to the implementation and PC Lint is telling you about this error. After removing the horizontal scroll bar, it appears that the name you are misusing is defined. The C preprocessor uses the name defined for: #if defined(SOME_MACRO) You cannot, therefore, write: #define defined(x) ((x) != 0) or anything similar. You should treat defined as a keyword, at least in pre-processor directives (and you can't treat it as a macro outside of pre-processor directives). Although you could use it as a variable name (and you could use endif and define and elif as variable names too), you'd be best off not using it and treating them as reserved words. The C11 standard (ISO/IEC 9899:2011) says: 7.1.

Categories : Misc

How to add spans to all areas of a node that isn't restricted
Match all contents of the h1 and use .not() to remove the safe from your selection. Then use .wrap() to make them "disappear". http://api.jquery.com/not/

Categories : Javascript

"com.example is restricted" when uploading APK to Play Store
The error message is telling it all. You need to use a package name of your own. The package name is the identitiy of the application. To rename the package name, In eclipse right click on the project in project explorer. Then Android Tools > rename Aplication Package name. Then enter the new package name. Also make sure that you are trying to upload a release build

Categories : Android

How to mark NULL data in Point Cloud Library (PCL) when using Iterative Closest Point (ICP)
If you are using PCL, default value of invalid data is not NULL, but is NaN. So if you want to mark a point as invalid, you should first include <limits> file and then set the positions to 'std::numeric_limits::quiet_NaN()'. It is usually done like this const float bad_point = std::numeric_limits<float>::quiet_NaN(); if( is_invalid_point ) p.x = p.y = p.z = bad_point; But anyway, configuring ICP can be a pain. You may have to do a lot more parameter tweaking depending on your data.

Categories : C++

What is the difference between fixed point and floating point processor?How float is handled in both kinds?
When floating point is not supported in hardware, the calculations are done by heavily optimised pieces of assembly code, usually from a library. One Google search away you could have found this about fixed-point. I assume you can find info about IEEE floating point yourself ;-) Good luck!

Categories : C

How can I vary the colour of a point on a scatter-graph in VBA/Excel as a function of the X, Y co-ordinates of the point itself?
Here's a simple example of how to access the x and y value for each point: Sub Tester() Dim s As Series, i As Long, x, y Set s = ActiveSheet.ChartObjects(1).Chart.SeriesCollection(1) For i = 1 To s.Points.Count x = s.XValues(i) y = s.Values(i) If x > 3 And y < 40 Then s.Points(i).MarkerBackgroundColor = vbRed End If Next i End Sub

Categories : Vba

Cocos2d - move a sprite from point A to point B in a sine wave motion
I always like to have complete control over CCNode motion. I only use CCActions to do very basic things. While your case sounds simple enough to possibly do with CCActions, I will show you how to move a CCNode according to any function over time. You can also change scale, color, opacity, rotation, and even anchor point with the same technique. @interface SomeLayer : CCLayer { CCNode *nodeToMove; float t; // time elapsed } @end @implementation SomeLayer // Assumes nodeToMove has been created somewhere else -(void)startAction { t = 0; // updateNodeProperties: gets called at the framerate // The exact time between calls is passed to the selector [self schedule:@selector(updateNodeProperties:)]; } -(void)updateNodeProperties:(ccTime)dt { t += dt; // Op

Categories : IOS

AS3 How i can get anchor point (pivot, registration point) position from Display Object
You can't. The anchors aren't exported, they exist in the *.fla file only. You can, however, implement your own anchor system (as many libraries do), but accessing the ones in the original fla is not possible.

Categories : Actionscript

which registers is changed when we move from user mode to kernel mode ?! and what is the reason to move to kernel mode?
From your questions i found that you are very poor in operating system concepts. Ok let me explain,(I am assuming you are using linux not windows). "which registers is changed when we move from user mode to kernel mode ?" For knowing answer for this question you need to learn about process management. But i can simply say, linux uses system call interface for changing from user space to kernel space. system call interface uses some registers (Based on your processor) to pass system call number and arguments for system call.

Categories : C++

__cdecl _unlock has problems with VS C++ 2010 when declare a point to pointer's point throw thread error
You should really try to heed what @stijn said. Also, regarding readability and self-documentation of code. Anyway, pertaining to your question, the problem appears to be that you allocate too many little pieces of memory on the heap in the VC++ runtime. You'd have to look into the memory allocation code to see how this error actually occurred. So, the problem is with the runtime environment you use and its implementation and not the C++ standard itself. Without understanding the underlying cause 100% you can allocate one contiguous array containing all of the elements of the multi-dimensional array instead to avoid this from happening. So, int numnode = 47092; int mm2 = 3; double ***pp=new double**[numnode]; for(int i=0;i<numnode;i++) { pp[i]=new double*[mm2]; for(int j=0;

Categories : C++

Find and copy all occurrences of a substring from point a to point b to a list
Working with the string methods IndexOf and Substring Dim original ="hello mike bye some words hello kate your nice bye and other strings" Dim startWord = "hello" Dim stopWord = "bye" Dim words = new List(Of String)() Dim pos1 = original.IndexOf(startWord, StringComparison.CurrentCultureIgnoreCase) Dim pos2 = original.IndexOf(stopWord, StringComparison.CurrentCultureIgnoreCase) while pos1 <> -1 AndAlso pos2 <> -1 words.Add(original.Substring(pos1, pos2 + stopWord.Length - pos1)) pos1 = original.IndexOf(startWord, pos1 + 1, StringComparison.CurrentCultureIgnoreCase) pos2 = original.IndexOf(stopWord, pos2 + 1, StringComparison.CurrentCultureIgnoreCase) End While for each s in words Console.WriteLine("[" + s + "]") next

Categories : Dotnet

Highchart, I want to fill between some values(point to point). in areaspline chart
You need to use two series, first spline and second with area. series: [{ data: [3, 4, 3] }, { type: 'areaspline', data: [null,null,3, 4, 3, 3, 5, 4] }] http://jsfiddle.net/7wSuT/

Categories : Javascript

what is point cut and java point in springs and where we are using in cross cutting concerns in AOP
A JoinPoint is any method in your app's code that you wrote whether you were using AOP or not. An advice is code you want to run when that JoinPoint method is being called, without adding the code directly into your app's method. An Aspect is the class that holds the advice code. Check this for more details : http://www.coderanch.com/t/465799/Spring/Joinpoint-Pointcut

Categories : Spring

How do Emacs diary-mode and calendar-mode read so many date formats? Magic?
Date::Parse handles a good number of a date formats pretty well. It's part of the TimeDate distribution which has a lot of interesting date formatting stuff.

Categories : Perl

Portrait mode and landscape mode views display adjustment with phone size
You simply create 2 different layout files. You should read the developer guides on this subject. Basically you make 2 res/layout folders: res/layout and res/layout-land Then you add a layout for landscape to the land folder and the portrait version to the other.

Categories : Android

UIImagePickerController in portrait mode inside UIPopoverController when view is locked for landscape mode
you can do this with Subclassing UIImagePickerController @interface UAImagePickerController : UIImagePickerController { } @end @implementation UAImagePickerController - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { return UIDeviceOrientationIsPortrait(toInterfaceOrientation); } @end

Categories : IOS

How to change UINavigationBar background image when iPad goes from portrait mode to landscape mode?
You must use: - (void)viewDidLoad { [super viewDidLoad]; [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:@"UIDeviceOrientationDidChangeNotification" object:nil]; } - (void) orientationChanged:(id)object { UIInterfaceOrientation interfaceOrientation = [[object object] orientation]; if(orientation == UIInterfaceOrientationPortrait) { NSLog(@"orientation is UIInterfaceOrientationPortrait"); // Assuming "self" is a view controller pushed on to a UINavigationController stack [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"portrait_

Categories : Objective C

How to access kernel mode memory in user mode application in WinCe7
I'm not sure if this will help considering you're on Win CE 7, but in Windows 7, I have a driver that maps a kernel mode address to a user mode address before returning the resulting user-mode address to my application. void *userSpaceAddr; // Allocate the MDL describing our kernel memory pmdl = IoAllocateMdl((PVOID)&my_heap_var, (ULONG)size_of_my_heap_var, FALSE, FALSE, NULL); if(!pmdl) { DbgPrintEx(DPFLTR_IHVVIDEO_ID, DPFLTR_INFO_LEVEL, "Error on IoAllocateMdl. Returning from driver early. "); return STATUS_INSUFFICIENT_RESOURCES; } MmBuildMdlForNonPagedPool(pmdl); userSpaceAddr = (void *)MmMapLockedPagesSpecifyCache(pmdl, UserMode, MmWriteCombined, NULL, FALSE, LowPagePriority); userSpa

Categories : Windows

Qt Application shows build error in Debug mode, OK in release mode
When you installed qt, did you configure it to install static debug libraries also. If not then try reconfiguring and reinstalling it. In windows, I think you installed from a preconfigured, precompiled binary that may not have static debug support. Try downloading the source and then configure and compile it according to your needs

Categories : Qt

What is difference in debugging in debug mode and release mode with disabled optimization?
There's very little magic to it. Debug and Release are simply names assigned to a set of compiler options. The most relevant option for the Debug configuration is the /Od option, it disables the optimizer so your code is easier to debug. Clearly you can always change the Release configuration options to resemble the Debug configuration options. Like disabling the optimizer. Now there's no relevant difference anymore between them and the Release configuration behaves a lot like the Debug configuration in the debugger. Other options normally used in the Debug configuration that affects your code: the _DEBUG macro is defined, asserts will fire function inlining is turned off the /RTC option is turned on, very good at catching bugs in your code the _HAS_ITERATOR_DEBUGGING macro is defi

Categories : Visual Studio

Renaming a file on HDFS works in local mode but not in cluster mode
Just curious, but how can you rename a file that officially doesn't exist (because you're still writing at that point)? The fix is to rename after the file has been completed. That is, when you invoked the close method. So your code should look like this: public void close() { String newPath = String.format("%s_dir/%s_file", date, timestamp); try { writer.close(); fileSystem.rename(new Path(hdfs_path+path), new Path(hdfs_path+newPath)); } catch (IOException e) { e.printStackTrace(); } }

Categories : Java

Acces Query runs smoothly in "select" mode, fails in "make table" mode
After some more research and trial and error, I was convinced this is a memory issue. So if anyone is having the same problem, and does not have the time or resources to upgrade to 64 bit access or create and sql server, here is a pretty simple workaround. Since the query runs in select mode, use vba to export the query result into a delimited .txt file, that you can read back into the original database, or a new database, as a table. for anyone looking, the vba code to do that is very simple: Sub exportQuery2Text() DoCmd.TransferText acExportDelim, "", "mapProducts2Bills",_ "[filepath].txt", True End Sub I hope this is helpful Cheers

Categories : SQL

What are the best practices when designing restricted areas in rails?
I would suggest you check out CanCan if you want to keep your code nice and DRY -the way you're currently doing it will lead to lots of repeated code and might become unmanageable. Once installed, CanCan will generate an 'Ability' file where you can define what users can or cannot do. in you case for example, you might have def initialize(user) user ||= User.new # guest user (not logged in) if user.admin? can :manage, :all else can :read, :all end end Then in your views, you can do a simple check to see whether or not a user has the ability to modify that object. For instance: <% if can? :create, Project %> <%= link_to "New Project", new_project_path %> <% end %> It's a super useful gem and very well documented!

Categories : Ruby On Rails

Restricted pages with client side templating
Depending upon the framework you can restrict this from the server and you would not loose any Angular goodies. The way you include templates into Angular is by either using ng-view or ng-include. ng-view template is configure during the route definition. Since these templates are loaded from server you can always control loading of these template. ng-include too can take server side templates, and the same restriction can be enforced using AngularJS. We use ASP.Net MVC so in ASP.Net you can put AuthorizeAttribute over the controller (server side) method that returns the view to controller what get's returned to client. Also keep in mind, once a template is loaded it would be cached by Angular's template cache so it would not be fetched until the page is refresh (browser navigation

Categories : Java



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