Search Results

Search found 443 results on 18 pages for 'andrei andre'.

Page 16/18 | < Previous Page | 12 13 14 15 16 17 18  | Next Page >

  • Exceptions over remote methods

    - by Andrei Vajna II
    What are the best practices for exceptions over remote methods? I'm sure that you need to handle all exceptions at the level of a remote method implementation, because you need to log it on the server side. But what should you do afterwards? Should you wrap the exception in a RemoteException (java) and throw it to the client? This would mean that the client would have to import all exceptions that could be thrown. Would it be better to throw a new custom exception with fewer details? Because the client won't need to know all the details of what went wrong. What should you log on the client? I've even heard of using return codes(for efficiency maybe?) to tell the caller about what happened. The important thing to keep in mind, is that the client must be informed of what went wrong. A generic answer of "Something failed" or no notification at all is unacceptable. And what about runtime (unchecked) exceptions?

    Read the article

  • Is it possible to make a script/plugin for Finder to toggle hidden files without relaunching?

    - by Andrei
    There are several ways how to toggle hidden files in Finder - via a shell command, or AppleScript, or Automator action, or even a Dashboard widget. All of them are doing the same thing and unfortunately require to close and reopen Finder windows, which is quite annoying. On the other hand, for the Open File dialog one can easily toggle hidden files by pressing Command+Shift+Period. Is it possible to make a script or plugin for Finder to toggle hidden files w/o relaunching? How would you make it?

    Read the article

  • Get the size in 'px' instead of percents.

    - by Andrei Ciobanu
    Hello, I have to write a javascript function that is returning the current size (in px) of a div. Unfortunately the div has its weight specified in % instead of px. The style of the div: position: absolute; width: 100%; height: 100%; And my width returning function: function getTableWidth(tableId){ var tabWidth = document.getElementById('pt1::tabb').children[0].children[0].style.width; return tabWidth; } tabWidth is '100%'. Is it possible to return the px width instead of the % width ? NOTE: I don't have access to any html/css , as the page I am working on is generated through a complex framework. I can only embed javascript.

    Read the article

  • Multi-line code in PHP interactive shell

    - by Andrei
    I'm learning to use the PHP interactive shell, but I'm having trouble with multi-line code. Using backslashes like in the UNIX shells doesn't seem to work. What am I doing wrong ? php > function test(){\ php { echo "test";\ php { }\ php > test(); PHP Parse error: syntax error, unexpected T_ECHO, expecting T_STRING in php shell code on line 2

    Read the article

  • Creating parameterized type object using annonymous class

    - by Andrei Fierbinteanu
    This might be a stupid question, but I just saw a question asking how to create a Type variable for a generic type. The consensus seemed to be that you should have a dummy method returning that type, and then use reflection to get it (in this case he wanted Map<String, String>). Something like this : public Map<String, String> dummy() { throw new Error(); } Type mapStringString = Class.forName("ThisClass").getMethod("dummy").getGenericReturnType(); My question is, not having used reflection that much, couldn't you just do something like: Type mapStringString = new ParameterizedType() { public Type getRawType() { return Map.class; } public Type getOwnerType() { return null; } public Type[] getActualTypeArguments() { return new Type[] { String.class, String.class }; } }; Would this work? If not, why not? And what are some of the dangers/problems if it does (besides being able to return some Type like Integer<String> which is obviously not possible.

    Read the article

  • PHP Sessions Error

    - by Andrei Korchagin
    I'm new to PHP sessions and I've come across the following error: Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at somefile:someline). As well as this one: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent by (output started at somefile:someline). The session_start(); is the very first thing in all of my code. I'm not sure what the problem is. It gave me line numbers but all I do on those lines is start the session. Also - I have a portion of code whose POST action is another PHP page. How can I set a $_SESSION variable pertaining to this page within that action page?

    Read the article

  • What's a good way to do testing a plug-in on multiple Windows and Outlook versions?

    - by Andrei
    Hello, We're building a plug-in for Outlook that should work on multiple Windows versions (XP, Vista, 7) and also with different Outlook versions (2003, 2007, 2010). The testing problem I am facing right now, is that I can't figure out a good/convenient/thorough way to test the application on multiple Windows and Outlook versions. At the moment, I have a VirtualBox which runs many virtual machines, with different Windows versions and Outlook versions. So I would have a virtual machine with Windows 7 testing Outlook 2010, and another one with Windows 7 testing Outlook 2007, Windows Vista with Outlook 2010 and so on, going through some of the possible combinations. It kind of gets the job done, although it is cumbersome and takes a long time to test. Some of the testing included in the application is unit testing, but this is also rather tied in with the machine I test it on (windows 7 with outlook 2010). For example, I was using ManagementObject recently, which worked fine on my system (and thus passed the unit test for that method), however, using that object threw an exception in another person's system, which crashed the application. I work on Visual Studio 2010 Ultimate. The questions: Is there a more elegant way to make the testing process more streamline and more efficient? Any other testing methods you recommend? How would you deal with this problem? Thanks! Looking forward to your replies.

    Read the article

  • Faster code with another compiler

    - by Andrei
    I'm using the standard gcc compiler in math software development with C-language. I don't know that much about compilers or compiler options, and I was just wondering, is it possible to make faster executables using another compiler or choosing better options? The default Makefile sets options -ffast-math and -O3 and I think both of them have some impact in the overall calculation time. My software is using memory quite extensively, so I imagine some options related to memory management might do the trick? Any ideas?

    Read the article

  • How to replace href using javascript regex in Firefox?

    - by Andrei
    I try to change some links on a webpage using the following code for jQuery on Rails $(function () { $('#lesson a').live('click', function () { $.getScript(this.href.replace(/^(http...[^\/]+)?\/+(.*)$/,'/ajax/\\$2')); return false; }); }) This trick works for Chrome and Safari, but fails (nothing happens on click) for Firefox and Opera. What can be wrong with the code? EDIT1: The webpage contains: <div id="lesson"> <a href="/subj1">Subject 1</a> ... </div> On click, a browser (i.e. Firefox and Opera) should make an ajax-request of /ajax/subj1.

    Read the article

  • How can I send an array of strings from one ASP.NET page to another?

    - by Andrei
    Hello. I now have two asp.net pages. When I click on a link on page A, I open the other one (let's call it page B). When I do this, I want to send some information from Page A to Page B in the form of an array of strings. This array is different depending on what link I follow on Page A. I know I could send this information via the URL with the ?string1=bla1&string2=bla2 etc., but I don't want it that way, as it can get complicated if there are too many strings in the array. I think there is something similar, like a POST in PHP, but how would that be in ASP? Any help would be appreciated. Thanks. Cheers!

    Read the article

  • TableView on Tab Bar Application ? Application is crashing.

    - by Andrei
    Steps to reproduce: 1. Create a Tab Bar Application called "TestApp" 2. Add new file, a UIViewController subclass with a XIB user interface called "Table" 3. Open up MainWindows.xib, click on the Second tab bar item and in Inspector change the NIB Name from "SecondView" to "Table". Save and close. 4. Open up Table.xib and drag a TableView on top of the view. Now link the dataSource and delegate outlets of the TableView to the Table.xib File's Owner. 5. Add the following code to Table.m: - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { NSLog(@"Returning num sections"); return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { NSLog(@"Returning num rows"); return 1; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSLog(@"Trying to return cell"); static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; } cell.text = @"Hello"; NSLog(@"Returning cell"); return cell; } 6.Run the application and select the Second tab bar item. If I start with a View-based application, add a TableView to it, link the outlets to the File's owner and add that piece of code it all works just fine. What am I doing wrong ? Why is the application crashing ?

    Read the article

  • MACRO Question: Returning pointer to a certain value

    - by Andrei Ciobanu
    Is it possible to write a MACRO that has a type and a value as its input parameters (MACRO(type,value)), and returns a valid pointer to a location that holds the submitted value. This macro should perform like the following function, but in a more generic manner: int *val_to_ptr(int val){ int *r = NULL; r = nm_malloc(sizeof(*r)); *r = val; return r; } Where nm_malloc() is a failsafe malloc. The Macro usage should be compatible with this usage: printf("%d",*MACRO(int,5)); Is it possible to achieve that ?

    Read the article

  • Data access layer using Linq to SQL

    - by Andrei Tanasescu
    I am building a c# - linq - sql server winforms/asp.net application, accessing a database. I would like my business logic layer to be easily testable, and that means not littering it with Linq database queries everywhere. What design patterns/ best practices are available for the following use cases - inserting/updating a new object - searching for an object - loading a bunch of related data into a sort of "presentation" object that could be displayed by various views ?

    Read the article

  • C macro issue: redefinition of functions / structure

    - by Andrei Ciobanu
    Given the following code (it's a macro that generates code for a list data structure, based on the contained type). list.h #ifndef _LIST_H #define _LIST_H #ifdef __cplusplus extern "C" { #endif #define LIST_TEMPLATE_INIT(type) \ typedef struct __list_s_##type { \ struct __list_s_##type *next; \ type value; \ } __list_##type; \ \ __list_##type * __list_##type##_malloc(type value){ \ __list_##type * list = NULL; \ list = malloc(sizeof(*list)); \ list->value = value; \ return list; \ }\ \ void __list_##type##_free(__list_##type *list){\ __list_##type * back = list;\ while(list=list->next){\ free(back);\ back = list;\ }\ } #define LIST_TYPE(type) __list_##type #define LIST_MALLOC(type,value) __list_##type##_malloc(value) #define LIST_FREE(type,list) __list_##type##_free(list) #define LIST_DATA(list) (list->value) #ifdef __cplusplus } #endif #endif /* _LIST_H */ And here is how the above code works: #include <stdio.h> #include <stdlib.h> #include "list.h" /* * */ LIST_TEMPLATE_INIT(int) int main(int argc, char** argv) { LIST_TYPE(int)* list = NULL; list = LIST_MALLOC(int, 5); printf("%d",LIST_DATA(list)); LIST_FREE(int,list); return (0); } My question, is it possible to somehow be able to call : LIST_TEMPLATE_INIT(int), as many times as I want, in a decentralized fashion ? The current issue with this right now is that calling LIST_TEMPLATE_INIT(int) in another file raise compilation errors (because of function redefinition): Example of error: error: redefinition of ‘struct __list_s_int’

    Read the article

  • Reduce text length to fit cell width in a smart manner

    - by Andrei Ciobanu
    Hello, I am in project where we are building a simple web calendar using Java EE technologies. We define a table where every row is an employee, and every column represents an hour interval. The table width and column widths are adjustable. In every cell we have a text retrieved from a database, indicating what the employee is doing / should do in that time interval. The problem is that sometimes the text in cells is getting bigger than the actual cell. My task is to make the text more "readable" by reducing it's length in a "smart way" so that it can fit in the cell more "gracefully". For example if initially in a cell I have: "Writing documents", after the resize I should retrieve: "Wrtng. dcmnts" or "Writ. docum." so that the text can fit well. Is there a smart way to do it ? Or removing vocals / split the string in two is enough ?

    Read the article

  • jQuery + ajax livesearch

    - by andrei
    I am doing a mysql database search and retrieving some results via ajax livesearch using the example on w3schools and i want to manipulate those results (drag and drop them) but im having a problem because the script loads before you enter the search and get the results so it does absolutely nothing no the search results. Any thoughts on this matter ?

    Read the article

  • Bug in variadic function template specialization with MSVC?

    - by Andrei Tita
    Using the Visual Studio Nov 2012 CTP, which supports variadic templates (among other things). The following code: template<int, typename... Args> void myfunc(Args... args) { } template<> void myfunc<1, float>(float) { } produces the following errors: error C2785: 'void myfunc(Args...)' and 'void myfunc(float)' have different return types error C2912: explicit specialization 'void myfunc(float)' is not a specialization of a function template (yeah, the first one is pretty funny) So my questions are: 1) Am I writing legal C++11 here? 2) If yes, is there a way to find out if this is a known bug in MSVC before submitting it?

    Read the article

  • Help with jquery animate()

    - by andrei
    I'm using this code to change opacity when user is on and off a picture unfortunately when the user clicks the image the opacity does not stay at 1. Anyone has an answer ? $(document).ready(function(){ $('img#slide').animate({"opacity" : .7}) $('img#slide').hover(function(){ $(this).stop().animate({"opacity" : 1}) }, function(){ $(this).stop().animate({"opacity" : .7}) }); $('img#slide').click(function(){ $(this).animate({"opacity" : 1}); }); });

    Read the article

  • Why does jquery behave like this

    - by andrei
    $('.box').click(function(){ $(this).find('p').toggle( function () { $(this).css({"color" : "red"}); }, function () { $(this).css({"color" : "black"}); } ); }); if i execute this script the 'p' color will change if i click on the 'p' not on the .box class why ? And how to i make it so that 'p' color changes when i click on the .box div

    Read the article

  • How do I get a list of all languages that my Windows Forms application has been localized to?

    - by Andrei B
    I have localized localized a Form into two language by setting the Localizable property to True and setting the Language from (Default) to (Dutch(Netherlands)), and I changed the control texts. Visual Studio generated the resource files and compiles them into the application. I need to get a simple list of all the languages that my form has been localized into. Currently it would be just two English and Dutch, but more may come. I need to programatically get a list of "what languages my application is localized into". Do I look into the resource files or use ResourceManager or what? Thanks!

    Read the article

  • How do you store accented characters coming from a web service into a database?

    - by Thierry Lam
    I have the following word that I fetch via a web service: André From Python, the value looks like: "Andr\u00c3\u00a9". The input is then decoded using json.loads: >>> import json >>> json.loads('{"name":"Andr\\u00c3\\u00a9"}') >>> {u'name': u'Andr\xc3\xa9'} When I store the above in a utf8 MySQL database, the data is stored like the following using Django: SomeObject.objects.create(name=u'Andr\xc3\xa9') Querying the name column from a mysql shell or displaying it in a web page gives: André The web page displays in utf8: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> My database is configured in utf8: mysql> SHOW VARIABLES LIKE 'collation%'; +----------------------+-----------------+ | Variable_name | Value | +----------------------+-----------------+ | collation_connection | utf8_general_ci | | collation_database | utf8_unicode_ci | | collation_server | utf8_unicode_ci | +----------------------+-----------------+ 3 rows in set (0.00 sec) mysql> SHOW VARIABLES LIKE 'character_set%'; +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+ 8 rows in set (0.00 sec) How can I retrieve the word André from a web service, store it properly in a database with no data loss and display it on a web page in its original form?

    Read the article

< Previous Page | 12 13 14 15 16 17 18  | Next Page >