Search Results

Search found 724 results on 29 pages for 'constants'.

Page 13/29 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • little oh notation as the limit of n goes to infinity

    - by Tony
    Hi all, I'm just trying to understand how in little o notation this is true: f(n)/g(n) as n goes to infinity = infinity? Can someone explain that to me? I do get the idea that f(n) = o(g(n)) means that f(n) grows no faster then cg(n) for all constants c 0. I just don't get the bit in bold above.

    Read the article

  • Compilation errors for a c api

    - by sam
    What would be the reason for the following errors though the syntax was right and I have included the coreservices framework in which some data type and constants are declared. " c.c:22: error: syntax error before ‘CFFileDescriptorRef’ c.c:22: warning: no semicolon at end of struct or union c.c:24: error: syntax error before ‘}’ token c.c:24: warning: data definition has no type or storage class lipo: can't figure out the architecture type of: /var/folders/fF/fFgga6+-E48RL+iXKLFmAE+++TI/-Tmp-//ccFzQIAj.out "

    Read the article

  • Using Window Handle to disable Mouse clicks using c#

    - by srk
    I need to disable the Mouse Clicks, Mouse movement for a specific windows for a Kiosk application. Is it Feasible in C# ? I have removed the menu bar and title bar of a specific window, will that be a starting point to achieve the above requirement ? How can i achieve this requirement. The code for removing the menu bar and title bar using window handle : #region Constants //Finds a window by class name [DllImport("USER32.DLL")] public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); //Sets a window to be a child window of another window [DllImport("USER32.DLL")] public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent); //Sets window attributes [DllImport("USER32.DLL")] public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); //Gets window attributes [DllImport("USER32.DLL")] public static extern int GetWindowLong(IntPtr hWnd, int nIndex); [DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)] static extern IntPtr FindWindowByCaption(IntPtr ZeroOnly, string lpWindowName); [DllImport("user32.dll")] static extern IntPtr GetMenu(IntPtr hWnd); [DllImport("user32.dll")] static extern int GetMenuItemCount(IntPtr hMenu); [DllImport("user32.dll")] static extern bool DrawMenuBar(IntPtr hWnd); [DllImport("user32.dll")] static extern bool RemoveMenu(IntPtr hMenu, uint uPosition, uint uFlags); //assorted constants needed public static uint MF_BYPOSITION = 0x400; public static uint MF_REMOVE = 0x1000; public static int GWL_STYLE = -16; public static int WS_CHILD = 0x40000000; //child window public static int WS_BORDER = 0x00800000; //window with border public static int WS_DLGFRAME = 0x00400000; //window with double border but no title public static int WS_CAPTION = WS_BORDER | WS_DLGFRAME; //window with a title bar public static int WS_SYSMENU = 0x00080000; //window menu #endregion public static void WindowsReStyle() { Process[] Procs = Process.GetProcesses(); foreach (Process proc in Procs) { if (proc.ProcessName.StartsWith("notepad")) { IntPtr pFoundWindow = proc.MainWindowHandle; int style = GetWindowLong(pFoundWindow, GWL_STYLE); //get menu IntPtr HMENU = GetMenu(proc.MainWindowHandle); //get item count int count = GetMenuItemCount(HMENU); //loop & remove for (int i = 0; i < count; i++) RemoveMenu(HMENU, 0, (MF_BYPOSITION | MF_REMOVE)); //force a redraw DrawMenuBar(proc.MainWindowHandle); SetWindowLong(pFoundWindow, GWL_STYLE, (style & ~WS_SYSMENU)); SetWindowLong(pFoundWindow, GWL_STYLE, (style & ~WS_CAPTION)); } } }

    Read the article

  • Android: What is a difference between 'orientation' and 'screenLayout'?

    - by alex2k8
    There are 2 different constants that have same description (http://developer.android.com/intl/de/reference/android/R.attr.html#configChanges) orientation 0x0080 The screen orientation has changed, that is the user has rotated the device. screenLayout 0x0100 The screen orientation has changed, that is the user has rotated the device. Many sources suggest to specify: android:configChanges="keyboardHidden|orientation" But should not it be: android:configChanges="keyboardHidden|orientation|screenLayout"

    Read the article

  • What's a good library for parsing mathematical expressions in java?

    - by CSharperWithJava
    I'm an Android Developer and as part of my next app I will need to evaluate a large variety of user created mathematical expressions and equations. I am looking for a good java library that is lightweight and can evaluate mathematical expressions using user defined variables and constants, trig and exponential functions, etc. I've looked around and Jep seems to be popular, but I would like to hear more suggestions, especially from people who have used these libraries before.

    Read the article

  • Title: Using Window Handle to disable Mouse clicks and Keyboard Inputs using Pinvoke c#

    - by srk
    I need to disable the Mouse Clicks, Mouse movement and Keyboard Inputs for a specific windows for a Kiosk application. Is it Feasible in C# ? I have removed the menu bar and title bar of a specific window, will that be a starting point to achieve the above requirement ? The code for removing the menu bar and title bar using window handle : #region Constants //Finds a window by class name [DllImport("USER32.DLL")] public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); //Sets a window to be a child window of another window [DllImport("USER32.DLL")] public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent); //Sets window attributes [DllImport("USER32.DLL")] public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); //Gets window attributes [DllImport("USER32.DLL")] public static extern int GetWindowLong(IntPtr hWnd, int nIndex); [DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)] static extern IntPtr FindWindowByCaption(IntPtr ZeroOnly, string lpWindowName); [DllImport("user32.dll")] static extern IntPtr GetMenu(IntPtr hWnd); [DllImport("user32.dll")] static extern int GetMenuItemCount(IntPtr hMenu); [DllImport("user32.dll")] static extern bool DrawMenuBar(IntPtr hWnd); [DllImport("user32.dll")] static extern bool RemoveMenu(IntPtr hMenu, uint uPosition, uint uFlags); //assorted constants needed public static uint MF_BYPOSITION = 0x400; public static uint MF_REMOVE = 0x1000; public static int GWL_STYLE = -16; public static int WS_CHILD = 0x40000000; //child window public static int WS_BORDER = 0x00800000; //window with border public static int WS_DLGFRAME = 0x00400000; //window with double border but no title public static int WS_CAPTION = WS_BORDER | WS_DLGFRAME; //window with a title bar public static int WS_SYSMENU = 0x00080000; //window menu #endregion public static void WindowsReStyle() { Process[] Procs = Process.GetProcesses(); foreach (Process proc in Procs) { if (proc.ProcessName.StartsWith("notepad")) { IntPtr pFoundWindow = proc.MainWindowHandle; int style = GetWindowLong(pFoundWindow, GWL_STYLE); //get menu IntPtr HMENU = GetMenu(proc.MainWindowHandle); //get item count int count = GetMenuItemCount(HMENU); //loop & remove for (int i = 0; i < count; i++) RemoveMenu(HMENU, 0, (MF_BYPOSITION | MF_REMOVE)); //force a redraw DrawMenuBar(proc.MainWindowHandle); SetWindowLong(pFoundWindow, GWL_STYLE, (style & ~WS_SYSMENU)); SetWindowLong(pFoundWindow, GWL_STYLE, (style & ~WS_CAPTION)); } } }

    Read the article

  • Using Window Handle to disable Mouse clicks and Keyboard Inputs using c#

    - by srk
    I need to disable the Mouse Clicks, Mouse movement and Keyboard Inputs for a specific windows for a Kiosk application. Is it Feasible in C# ? I have removed the menu bar and title bar of a specific window, will that be a starting point to achieve the above requirement ? The code for removing the menu bar and title bar using window handle : #region Constants //Finds a window by class name [DllImport("USER32.DLL")] public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); //Sets a window to be a child window of another window [DllImport("USER32.DLL")] public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent); //Sets window attributes [DllImport("USER32.DLL")] public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); //Gets window attributes [DllImport("USER32.DLL")] public static extern int GetWindowLong(IntPtr hWnd, int nIndex); [DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)] static extern IntPtr FindWindowByCaption(IntPtr ZeroOnly, string lpWindowName); [DllImport("user32.dll")] static extern IntPtr GetMenu(IntPtr hWnd); [DllImport("user32.dll")] static extern int GetMenuItemCount(IntPtr hMenu); [DllImport("user32.dll")] static extern bool DrawMenuBar(IntPtr hWnd); [DllImport("user32.dll")] static extern bool RemoveMenu(IntPtr hMenu, uint uPosition, uint uFlags); //assorted constants needed public static uint MF_BYPOSITION = 0x400; public static uint MF_REMOVE = 0x1000; public static int GWL_STYLE = -16; public static int WS_CHILD = 0x40000000; //child window public static int WS_BORDER = 0x00800000; //window with border public static int WS_DLGFRAME = 0x00400000; //window with double border but no title public static int WS_CAPTION = WS_BORDER | WS_DLGFRAME; //window with a title bar public static int WS_SYSMENU = 0x00080000; //window menu #endregion public static void WindowsReStyle() { Process[] Procs = Process.GetProcesses(); foreach (Process proc in Procs) { if (proc.ProcessName.StartsWith("notepad")) { IntPtr pFoundWindow = proc.MainWindowHandle; int style = GetWindowLong(pFoundWindow, GWL_STYLE); //get menu IntPtr HMENU = GetMenu(proc.MainWindowHandle); //get item count int count = GetMenuItemCount(HMENU); //loop & remove for (int i = 0; i < count; i++) RemoveMenu(HMENU, 0, (MF_BYPOSITION | MF_REMOVE)); //force a redraw DrawMenuBar(proc.MainWindowHandle); SetWindowLong(pFoundWindow, GWL_STYLE, (style & ~WS_SYSMENU)); SetWindowLong(pFoundWindow, GWL_STYLE, (style & ~WS_CAPTION)); } } }

    Read the article

  • What is the best way to handle this type of inclusive logic in Ruby?

    - by Steve McLelland
    Is there a better way of handling this in Ruby, while continuing to use the symbols? pos = :pos1 # can be :pos2, :pos3, etc. if pos == :pos1 || pos == :pos2 || pos == :pos3 puts 'a' end if pos == :pos1 || pos == :pos2 puts 'b' end if pos == :pos1 puts 'c' end The obvious way would be swapping out the symbols for number constants, but that's not an option. pos = 3 if pos >= 1 puts 'a' end if pos >= 2 puts 'b' end if pos >= 3 puts 'c' end Thanks.

    Read the article

  • Working with anonymous modules in Ruby

    - by Byron Park
    Suppose I make a module as follows: m = Module.new do class C end end Three questions: Other than a reference to m, is there a way I can access C and other things inside m? Can I give a name to the anonymous module after I've created it (just as if I'd typed "module ...")? How do I delete the anonymous module when I'm done with it, such that the constants it defines are no longer present?

    Read the article

  • Android: Activity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView that was originally added here

    - by David Joyce
    I am receiving the above error when launching my application in version 3.1 in my tablet It works fine from 2.1 to 2.3 on phones The code it complains about is as follows: @Override protected void onCreate() { // Other logic here // .... showDialog(Constants.INTRODUCTION_DIALOG); } What is the problem here? I see other related threads but I don't see one similar to my problem on launch. Thanks

    Read the article

  • Legacy exchange MAPI help?

    - by Zenox
    I'm working with some legacy exchange code and I am having trouble finding information about some methods/constants. A google search reveals others using similar code, but with no explanations. Does anyone have any ideas where I can find proper docs? One constant I am looking for is: SYNC_ASSOCIATED.

    Read the article

  • Coding Conventions - Naming Enums

    - by Walter White
    Hi all, Is there a document describing how to name enumerations? My preference is that an enum is a type. So, for instance, you have an enum Fruit{Apple,Orange,Banana,Pear, ... } NetworkConnectionType{LAN,Data_3g,Data_4g, ... } I am opposed to naming it: FruitEnum NetworkConnectionTypeEnum I understand it is easy to pick off which files are enums, but then you would also have: NetworkConnectionClass FruitClass Also, is there a good document describing the same for constants, where to declare them, etc.? Walter

    Read the article

  • Why does Event intent in android not return a result?

    - by dhaval
    I am creating a event using Intent intent = new Intent(Intent.ACTION_EDIT); intent.setType("vnd.android.cursor.item/event"); And invoking the intent using startActivityForResult(intent, Constants.LINK_CALENDER); There is nothing returned to call in onActivityResult(int requestCode, int resultCode, Intent data) It always returns data=null ie., returned intent result is always null. I am trying to retrieve the "Done/Revert" state of calender event just created and some identity so that i can open the event again in future from elsewhere in code.

    Read the article

  • Using Window Handle to disable Mouse clicks and Keyboard Inputs using P/Invoke

    - by srk
    I need to disable the Mouse Clicks, Mouse movement and Keyboard Inputs for a specific windows for a Kiosk application. Is it feasible using .NET ? I have removed the menu bar and title bar of a specific window, will that be a starting point to achieve the above requirement ? The code for removing the menu bar and title bar using window handle : #region Constants //Finds a window by class name [DllImport("USER32.DLL")] public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); //Sets a window to be a child window of another window [DllImport("USER32.DLL")] public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent); //Sets window attributes [DllImport("USER32.DLL")] public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); //Gets window attributes [DllImport("USER32.DLL")] public static extern int GetWindowLong(IntPtr hWnd, int nIndex); [DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)] static extern IntPtr FindWindowByCaption(IntPtr ZeroOnly, string lpWindowName); [DllImport("user32.dll")] static extern IntPtr GetMenu(IntPtr hWnd); [DllImport("user32.dll")] static extern int GetMenuItemCount(IntPtr hMenu); [DllImport("user32.dll")] static extern bool DrawMenuBar(IntPtr hWnd); [DllImport("user32.dll")] static extern bool RemoveMenu(IntPtr hMenu, uint uPosition, uint uFlags); //assorted constants needed public static uint MF_BYPOSITION = 0x400; public static uint MF_REMOVE = 0x1000; public static int GWL_STYLE = -16; public static int WS_CHILD = 0x40000000; //child window public static int WS_BORDER = 0x00800000; //window with border public static int WS_DLGFRAME = 0x00400000; //window with double border but no title public static int WS_CAPTION = WS_BORDER | WS_DLGFRAME; //window with a title bar public static int WS_SYSMENU = 0x00080000; //window menu #endregion public static void WindowsReStyle() { Process[] Procs = Process.GetProcesses(); foreach (Process proc in Procs) { if (proc.ProcessName.StartsWith("notepad")) { IntPtr pFoundWindow = proc.MainWindowHandle; int style = GetWindowLong(pFoundWindow, GWL_STYLE); //get menu IntPtr HMENU = GetMenu(proc.MainWindowHandle); //get item count int count = GetMenuItemCount(HMENU); //loop & remove for (int i = 0; i < count; i++) RemoveMenu(HMENU, 0, (MF_BYPOSITION | MF_REMOVE)); //force a redraw DrawMenuBar(proc.MainWindowHandle); SetWindowLong(pFoundWindow, GWL_STYLE, (style & ~WS_SYSMENU)); SetWindowLong(pFoundWindow, GWL_STYLE, (style & ~WS_CAPTION)); } } }

    Read the article

  • What color to use in owner-draw Windows List Control background?

    - by Mark Ransom
    I have an owner-drawn list control in my Windows program. I use CListCtrl::GetBkColor to get the background color, and for a selected item I use GetSysColor(COLOR_HIGHLIGHT). This matches what Windows uses for non owner drawn list controls, except for the case where the control doesn't have focus - then the background is replaced with gray. Does Windows use one of the GetSysColor constants for the selected but unfocused background? If so, which one?

    Read the article

  • How to access static members in a Velocity template?

    - by matt b
    I'm not sure if there is a way to do this in Velocity or not: I have a User POJO which a property named Status, which looks like an enum (but it is not, since I am stuck on Java 1.4), the definition looks something like this: public class User { // default status to User private Status status = Status.USER; public void setStatus(Status status) { this.status = status; } public Status getStatus() { return status; } And Status is a static inner class: public static final class Status { private String statusString; private Status(String statusString) { this.statusString = statusString; } public final static Status USER = new Status("user"); public final static Status ADMIN = new Status("admin"); public final static Status STATUS_X = new Status("blah"); //.equals() and .hashCode() implemented as well } With this pattern, a user status can easily be tested in a conditional such as if(User.Status.ADMIN.equals(user.getStatus())) ... ... without having to reference any constants for the status ID, any magic numbers, etc. However, I can't figure out how to test these conditionals in my Velocity template with VTL. I'd like to just print a simple string based upon the user's status, such as: Welcome <b>${user.name}</b>! <br/> <br/> #if($user.status == com.company.blah.User.Status.USER) You are a regular user #elseif($user.status == com.company.blah.User.Status.ADMIN) You are an administrator #etc... #end But this throws an Exception that looks like org.apache.velocity.exception.ParseErrorException: Encountered "User" at webpages/include/dashboard.inc[line 10, column 21] Was expecting one of: "[" ... From the VTL User Guide, there is no mention of accessing a Java class/static member directly in VTL, it appears that the right hand side (RHS) of a conditional can only be a number literal, string literal, property reference, or method reference. So is there any way that I can access static Java properties/references in a Velocity template? I'm aware that as a workaround, I could embed the status ID or some other identifier as a reference in my controller (this is a web MVC application using Velocity as the View technology), but I strongly do not want to embed any magic numbers or constants in the view layer.

    Read the article

  • Converting jiffies to milli seconds

    - by EpsilonVector
    How do I manually convert jiffies to milliseconds and vice versa in Linux? I know kernel 2.6 has a function for this, but I'm working on 2.4 (homework) and though I looked at the code it uses lots of macro constants which I have no idea if they're defined in 2.4.

    Read the article

  • Is it good practice to use std::size_t all over the place?

    - by dehmann
    I have a lot of constants in my code that are unsigned numbers, e.g. counters, frequency cutoffs, lengths, etc. I started using std::size_t for all of these, instead of int or unsigned int. Is that the right thing to do? I started it because the STL containers use it for their sizes, it's used for string position, etc.

    Read the article

  • Initialization of components with interdependencies - possible antipattern?

    - by Rosarch
    I'm writing a game that has many components. Many of these are dependent upon one another. When creating them, I often get into catch-22 situations like "WorldState's constructor requires a PathPlanner, but PathPlanner's constructor requires WorldState." Originally, this was less of a problem, because references to everything needed were kept around in GameEngine, and GameEngine was passed around to everything. But I didn't like the feel of that, because it felt like we were giving too much access to different components, making it harder to enforce boundaries. Here is the problematic code: /// <summary> /// Constructor to create a new instance of our game. /// </summary> public GameEngine() { graphics = new GraphicsDeviceManager(this); Components.Add(new GamerServicesComponent(this)); //Sets dimensions of the game window graphics.PreferredBackBufferWidth = 800; graphics.PreferredBackBufferHeight = 600; graphics.ApplyChanges(); IsMouseVisible = true; screenManager = new ScreenManager(this); //Adds ScreenManager as a component, making all of its calls done automatically Components.Add(screenManager); // Tell the program to load all files relative to the "Content" directory. Assets = new CachedContentLoader(this, "Content"); inputReader = new UserInputReader(Constants.DEFAULT_KEY_MAPPING); collisionRecorder = new CollisionRecorder(); WorldState = new WorldState(new ReadWriteXML(), Constants.CONFIG_URI, this, contactReporter); worldQueryUtils = new WorldQueryUtils(worldQuery, WorldState.PhysicsWorld); ContactReporter contactReporter = new ContactReporter(collisionRecorder, worldQuery, worldQueryUtils); gameObjectManager = new GameObjectManager(WorldState, assets, inputReader, pathPlanner); worldQuery = new DefaultWorldQueryEngine(collisionRecorder, gameObjectManager.Controllers); gameObjectManager.WorldQueryEngine = worldQuery; pathPlanner = new PathPlanner(this, worldQueryUtils, WorldQuery); gameObjectManager.PathPlanner = pathPlanner; combatEngine = new CombatEngine(worldQuery, new Random()); } Here is an excerpt of the above that's problematic: gameObjectManager = new GameObjectManager(WorldState, assets, inputReader, pathPlanner); worldQuery = new DefaultWorldQueryEngine(collisionRecorder, gameObjectManager.Controllers); gameObjectManager.WorldQueryEngine = worldQuery; I hope that no one ever forgets that setting of gameObjectManager.WorldQueryEngine, or else it will fail. Here is the problem: gameObjectManager needs a WorldQuery, and WorldQuery needs a property of gameObjectManager. What can I do about this? Have I found an anti-pattern?

    Read the article

  • Make process run on non EDT (event dispatch thread) thread from EDT

    - by Aly
    I have a method running on the EDT and within that I want to make it execute something on a new (non EDT) thread. My current code is follows: @Override public void actionPerformed(ActionEvent arg0) { //gathering parameters from GUI //below code I want to run in new Thread and then kill this thread/(close the JFrame) new GameInitializer(userName, player, Constants.BLIND_STRUCTURE_FILES.get(blindStructure), handState); }

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >