Search Results

Search found 366 results on 15 pages for 'sorin adrian carbunaru'.

Page 6/15 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • How to disable WinMain entry point for a MFC application?

    - by Sorin Sbarnea
    I understand that is not possible to have applications with multiple entry points under Windows. I have a MFC application and I added code for making it running as a service (main() entry point and other required stuff) but it looks that Windows will always run the WinMain() from MFC instead of my main. The question is how can I disable the WinMain() from MFC in order to be able to run my own main(). Probably the same problem would apply if you want to run the same application as a console application. What do I have to change in project properties in order to build it as a console application (main instead of WinMain)? Is commenting my CWinApp the only solution?

    Read the article

  • How can I decode the boost library naming?

    - by Sorin Sbarnea
    I tried to find out that gd means in boost library name and I only found two other people looking for the same thing. I suppose it should be a place where this is clearly documented and I would like to find it. So far I found: mt - multitheaded, get it with threading=multi gd - ??? s - ??? sgd - ???

    Read the article

  • If you have an application localized in pt-br and pt-pt, what language you should choose if the syst

    - by Sorin Sbarnea
    If you have an application localized in pt-br and pt-pt, what language you should choose if the system is reporting only pt code (generic Portuguese)? This question is independent of the nature of the application, desktop, mobile or browser based. Let's assume you are not able to get region information from another source and you have to choose one language as the default one. The question does apply as well for more case including: * pt-pt and pt-br * en-us and en-gb * fr-fr and fr-CA * zh-cn, zh-tw, .... - in fact in this case I know that zh can be used as predominant language for Simplified Chinese where full code is zh-hans. For zh-tw, zh-hant-tw, zh-hk, zh-mo the proper code (canonical) should be zh-hant. In fact the question can be extended to: How to I determine the predominant languages for a specified meta-language? I need a solution that will include at least Portuguese, English and French.

    Read the article

  • How do I properly implement Unicode passwords?

    - by Sorin Sbarnea
    Adding support for Unicode passwords it an important feature that should not be ignored by the developpers. Still adding support for Unicode in the passwords it's a tricky job because the same text can be encoded in different ways in Unicode and this is not something you may want to prevent people from logging in due to this. Let's say that you'll store the passwords os UTF-8. Now the question is how you should normalize the Unicode data? You had to be sure that you'll be able to compare it. You need to be sure that when the next Unicode standard will be released it will not invalidate your password verification. Note: still there are some places where Unicode passwords are probably never be used, but this question is not about why or when to use Unicode passwords, is about how to implement them the proper way.

    Read the article

  • What is proper way to detect all available serial ports on Windows?

    - by Sorin Sbarnea
    There are several ways to list serial ports under Windows but I'm not sure what is the proper way: the way that does detect all serial ports that are available. One good code example is http://www.naughter.com/enumser.html - where there at 9 (nine!) ways of enumerating serial devices. The question is: what is the optimal way of doing it. Requirements: * to not open ports in order to check if they are available. * to be able to detect ports with different names than COMx.

    Read the article

  • How to remove the "button" effect for a menu item (WPF)

    - by Sorin Comanescu
    Hi, When the mouse is over a menu item (first level) it displays a 3D button effect. How can this be removed? Thanks. EDIT: Tried <Style TargetType="MenuItem"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="BorderBrush" Value="Transparent"> <Setter Property="BorderThickness" Value="0"> </Trigger> </Style.Triggers> </Style> with no effect. The menu XAML: <Window x:Class="UCWPF.Window3" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:conv="clr-namespace:UCWPF.Converters" Title="Window3" Height="600" Width="600" Background="{StaticResource WindowBackgroundBrush}" > <StackPanel Style="{StaticResource WindowContainerStyle}"> <Menu> <MenuItem Header="New" Icon="{StaticResource ImageExport}" /> <MenuItem Header="Open" Icon="{StaticResource ImageOpen}" /> <MenuItem Header="Save" Icon="{StaticResource ImageSave}" /> <MenuItem Header="Export" Icon="{StaticResource ImageExport}" /> </Menu> ... And here's the screenshot:

    Read the article

  • How to make distributed builds using XCode 3.2 on OS X 10.6

    - by Sorin Sbarnea
    After I upgraded using a clean install from OS X 10.5 to 10.6.2 and upgraded the XCode to 3.2.1 I wasn't able to use distributed builds feature anymore. There are several issues that I detected: In most cases Bonjour is not detecting the other computers even they are on the same switch. I added a custom 'set' where I added manually the IP addreses of each computer. Even so I still get status: "unreachable" on them.BTW, ping does work without problems. Both share my computer for shared workgroup builds (distcc) and distribute builds via shared workgroup builds options are checked.

    Read the article

  • How can you print a string using raw_unicode_escape encoding in python 3?

    - by Sorin Sbarnea
    The following code with fail in Python 3.x with TypeError: must be str, not bytes because now encode() returns bytes and print() expects only str. #!/usr/bin/python from __future__ import print_function str2 = "some unicode text" print(str2.encode('raw_unicode_escape')) How can you print a Unicode string escaped representation using print()? I'm looking for a solution that will work with Python 2.6 or newer, including 3.x

    Read the article

  • How to deal with Unicode strings in C/C++ in a cross-platform friendly way?

    - by Sorin Sbarnea
    On platforms different than Windows you could easily use char * strings and treat them as UTF-8. The problem is that on Windows you are required to accept and send messages using wchar* strings (W). If you'll use the ANSI functions (A) you will not support Unicode. So if you want to write truly portable application you need to compile it as Unicode on Windows. Now, In order to keep the code clean I would like to see what is the recommended way of dealing with strings, a way that minimize ugliness in the code. Type of strings you may need: std::string, std::wstring, std::tstring,char *,wchat_t *, TCHAR*, CString (ATL one). Issues you may encounter: cout/cerr/cin and their Unicode variants wcout,wcerr,wcin all renamed wide string functions and their TCHAR macros - like strcmp, wcscmp and _tcscmp. constant strings inside code, with TCHAR you will have to fill your code with _T() macros. What approach do you see as being best? (examples are welcome) Personally I would go for a std::tstring approach but I would like to see how would do to the conversions where they are necessary.

    Read the article

  • How do I force git to use LF instead of CR+LF under windows?

    - by Sorin Sbarnea
    I want to force git to checkout files under Windows using just LF not CR+LF. I checked the two configuration options but I was not able to find the right combination of settings. I want it to convert all files to LF and keep the LF on the files. Remark: I used autocrlf = input but this just repairs the files when you commit them. I want to force it to get them using LF. Probably I wasn't so clear: the repository is already using LF but the files checked out using msysgit are using CR+LF and I want to forge msysgit to get them with LF: forcing Unix line endings.

    Read the article

  • Necessary rights to be able to add a column with ALTER TABLE ADD column_name

    - by Sorin Comanescu
    Hi, Could somebody point out the necessary rights to do something like ALTER TABLE myTable ADD myColumn int NOT NULL CONSTRAINT [Constraint_name] DEFAULT ((0)) ? I assumed grant alter on myTable to [user] was enough but I'm getting the error message The UPDATE permission was denied on the object 'myTable', database 'x', schema 'dbo'. Could UPDATE rights be needed because of the DEFAULT constraint? Thanks.

    Read the article

  • Reading from txt ruins formatting

    - by Sorin Grecu
    I'm saving some values to a txt file and after that i want to be able to show it in a dialog.All good,done that but though the values in the txt file are formated nicely,like this : Aaaaaaaa 0.55 1 Bbbbb 1 2.2 CCCCCCCCC 3 0.22 When reading and setting them to a textview they get all messy like this : Aaaaaaaa 0.55 1 Bbbbb 1 2.2 CCCCCCCCC 3 0.22 My writting method : FileOutputStream f = new FileOutputStream(file); PrintWriter pw = new PrintWriter(f); for (int n = 0; n < allpret.size() - 1; n++) { if (cant[n] != Float.toString(0) && pret[n] != Float.toString(0)) { String myFormat = "%-20s %-5s %-5s%n"; pw.println(String.format(myFormat, prod[n], cant[n], pret[n])); My reading method : StringBuilder text = new StringBuilder(); try { BufferedReader br = new BufferedReader(new FileReader(file)); String line; while ((line = br.readLine()) != null) { text.append(line); text.append('\n'); } } catch (IOException e) { } Why does it ruin the amount of spaces and how can i fix this ? Thanks and have a good night !

    Read the article

  • Enclosing service execution in try-catch

    - by Sorin Comanescu
    Hi, Below is the usual Program.cs content for a windows service program: static class Program { /// <summary> /// The main entry point for the application. /// </summary> static void Main() { ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new MyService() }; ServiceBase.Run(ServicesToRun); } } Is it a bad practice to enclose the ServiceBase.Run(...) in a try-catch block? Thanks.

    Read the article

  • How to enable nullptr from C++0x in the Visual C++ 2010?

    - by Sorin Sbarnea
    I wonder how can I enable the nullptr in the just released Visual Studio 2010. (C++ project, not managed). This is one of the new features but it is not available by default and looking inside the documentation at http://msdn.microsoft.com/en-us/library/4ex65770(VS.100).aspx it seams that it is enabled by /clr but this is managed! Is this a feature added only for .NET?

    Read the article

  • How to do both ways integrations across different perfoce depots?

    - by Sorin Sbarnea
    I would like to know how we are supposed to do integration between different perforce servers/depots. I'm looking for a solution that would allow us to do both-ways integrations. Currently I found some information on Using Remote Depots article where they say how to map the remote depot as read only. Is there the only solution to do mappings on both servers? - this means that I could not use a single branch spec to do both ways integrations.

    Read the article

  • Java - Robot keyPress issue

    - by Trimbitas Sorin
    I'm trying to send keystrokes (like a virtual keyboard) from my Java code, but I encounter some issues. It works perfectly on normal applications (for example, Notepad, browsers, etc.), but not on games (fullscreen or windowed mode). This is the stripped code I'm using: import java.awt.Robot; import java.awt.AWTException; import java.awt.event.InputEvent; Robot robot; robot.keyPress(KeyEvent.VK_A); robot.keyRelease(KeyEvent.VK_A); How can this problem be fixed?

    Read the article

  • How do I get the path of the current executed file in python?

    - by Sorin Sbarnea
    This may seam a newbie question but it is not. It looks that common approaches are not always working: Currently I know only two options but none of them looks to work an all cases. sys.argv[0] This means using path = os.path.abspath(os.path.dirname(sys.argv[0])) but this does not work if you are running from another python script from another directory, and this can really happen in real life. __file__ this means that path = os.path.abspath(os.path.dirname(__file__)) but I found that this doesn't work: py2exe that doesn't have a __file__ attribute but there is an workaround. when you run from IDLE with execute() there is no __file__ attribute OS X 10.6 where I get NameError: global name '__file__' is not defined Related questions with incomplete answers: http://stackoverflow.com/questions/1296501/python-find-path-to-file-being-run http://stackoverflow.com/questions/1483827/python-path-to-current-file-depends-on-how-i-execute-the-program http://stackoverflow.com/questions/2259503/how-to-know-the-path-of-the-running-script-in-python http://stackoverflow.com/questions/509742/python-chdir-to-dir-the-py-script-is-in

    Read the article

  • How to communicate between service controller and a service/daemon?

    - by Sorin Sbarnea
    It is easy to display the status of a Windows service or to control it (start/stop) from a GUI application but the question if how about receiving/sending notifications from the service? Like: service telling to the user monitoring it that it needs attention. Please consider that you can have several controllers started at any time in a multi-user environment. Do you know an example(open source) for this kind of communication? Extra points for a platform independent solution :)

    Read the article

  • NullPointerException when setting adapter

    - by Sorin Grecu
    I'm trying to get the filenames in a folder inside a listview(that listview is inside a layout of a ViewPager) but i'm getting a NullPointerException and i can't figure what's wrong. public void citire() { ListView lv1 = (ListView) findViewById(R.id.lv1); myList = new ArrayList<String>(); File directory = Environment.getExternalStorageDirectory(); file = new File(directory + "/InterSRL"); File list[] = file.listFiles(); for (int i = 0; i < list.length; i++) { myList.add(list[i].getName()); } ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, android.R.id.text1, myList); lv1.setAdapter(adapter); } I'm getting the error at lv1.setAdapter(adapter); 06-28 13:10:57.987: E/AndroidRuntime(30450): Caused by: java.lang.NullPointerException 06-28 13:10:57.987: E/AndroidRuntime(30450): at com.example.testlayout.Gestionare.citire(Gestionare.java:169) 06-28 13:10:57.987: E/AndroidRuntime(30450): at com.example.testlayout.Gestionare.onCreate(Gestionare.java:33) 06-28 13:10:57.987: E/AndroidRuntime(30450): at android.app.Activity.performCreate(Activity.java:5104) 06-28 13:10:57.987: E/AndroidRuntime(30450): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080) 06-28 13:10:57.987: E/AndroidRuntime(30450): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)

    Read the article

  • How to write a Python 2.6+ script that does gracefully fail with older pyhton?

    - by Sorin Sbarnea
    I'm using the new print from Python 3.x and I observed that the following code does not compile due to the end=' '. from __future__ import print_function import sys if sys.hexversion < 0x02060000: raise Exception("py too old") ... print("x",end=" ") # fails to compile with py24 How can I continue using the new syntax but make the script fails nicely? Is it mandatory to call another script and use only safe syntax in this one?

    Read the article

  • SQL query showing element more than once.

    - by Sorin Cioban
    Hi guys, I have the following SQL query but it doesn't entirely work because it shows each element more than once. select c.name, c.director, c.title, count(c.title) as numfilms from casting c join casting c1 on c1.name = c.name Group by c.name, c.director, c.title Having count (c.title) > 1 order by numfilms So what it does it shows which actors have made more than 1 film. But unfortunately, this query shows each actor as many times as the number of movies he made. Using distinct doesn't work as actor may have been in different movie with same title and different director.

    Read the article

  • How do I override file.write() under Python 3?

    - by Sorin Sbarnea
    Below works on Python 2.6 but on Python 3.x it doesn't: old_file_write = file.write class file(): def write(self, d): if isinstance(d, types.bytes): self.buffer.write(d) else: old_file_write(d) # ... do something like f = open("x") f.write("...") The problems is that with Python 3.x the first like will generate an error: NameError: name 'file' is not defined How can I make this work on Python 3.x? PS. In fact I'm looking for a solution that will work on both versions.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >