Search Results

Search found 76 results on 4 pages for 'cristian voina'.

Page 2/4 | < Previous Page | 1 2 3 4  | Next Page >

  • page loads twice in Google chrome

    - by Cristian Boariu
    Hi guys, Does anyone have any problems with Page_Load being executed twice in Google Chrome? It's a short question, i do not know what else to explain... I have a simple asp.net page and in Firefox and IE all it's working fine. But in Chrome the Page_Load is fired twice... Anyone has any ideas why? Later EDIT: - what is strange is that i have 4 repeaters... binded with random values. The random methods are twice fired (because of page loaded twice) but the repeaters takes the INITIALLY values...so, the 2nd post back is somehow raised after the rendering step. 3rd edit: It happens ONLY at the refresh!

    Read the article

  • How to draw an overlay on a SurfaceView used by Camera on Android?

    - by Cristian Castiblanco
    I have a simple program that draws the preview of the Camera into a SurfaceView. What I'm trying to do is using the onPreviewFrame method, which is invoked each time a new frame is drawn into the SurfaceView, in order to execute the invalidate method which is supposed to invoke the onDraw method. In fact, the onDraw method is being invoked, but nothing there is being printed (I guess the camera preview is overwriting the text I'm trying to draw). This is a simplify version of the SurfaceView subclass I have: public class Superficie extends SurfaceView implements SurfaceHolder.Callback { SurfaceHolder mHolder; public Camera camera; Superficie(Context context) { super(context); mHolder = getHolder(); mHolder.addCallback(this); mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); } public void surfaceCreated(final SurfaceHolder holder) { camera = Camera.open(); try { camera.setPreviewDisplay(holder); camera.setPreviewCallback(new PreviewCallback() { public void onPreviewFrame(byte[] data, Camera arg1) { invalidar(); } }); } catch (IOException e) {} } public void invalidar(){ invalidate(); } public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { Camera.Parameters parameters = camera.getParameters(); parameters.setPreviewSize(w, h); camera.setParameters(parameters); camera.startPreview(); } @Override public void draw(Canvas canvas) { super.draw(canvas); // nothing gets drawn :( Paint p = new Paint(Color.RED); canvas.drawText("PREVIEW", canvas.getWidth() / 2, canvas.getHeight() / 2, p); } }

    Read the article

  • JAVA Calendar - How to check if it's Saturday/Sunday ?

    - by Cristian
    What this code does is print the dates of the current week from Monday to Friday. It works fine, but I want to ask something else: If today is Saturday or Sunday I want it to show the next week... how do I do that? Here's my working code so far (thanks to StackOverflow!!): // Get calendar set to current date and time Calendar c = Calendar.getInstance(); // Set the calendar to monday of the current week c.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY); // Print dates of the current week starting on Monday to Friday DateFormat df = new SimpleDateFormat("EEE dd/MM/yyyy"); for (int i = 0; i <= 4; i++) { System.out.println(df.format(c.getTime())); c.add(Calendar.DATE, 1); Thanks a lot! I really appreciate it as I've been searching for the solution for hours...

    Read the article

  • Binding DataGridComboBoxColumn to a one to many entity framework relation

    - by Cristian
    I have two tables in the model, one table contains entries related to the other table in a one to many relations, for example: Table User ID Name Table Comments ID UserID Title Text I want to show a datagrid in a WPF window with two columns, one text column with the User name and another column with a combobox showing all the comments made by the user. The datagrid definition is like this: <DataGrid AutoGenerateColumns="False" [layout options...] Name="dataGrid1" ItemsSource="{Binding}"> <DataGrid.Columns> <DataGridTextColumn Header="Name" Binding="{Binding Path=Name}"/> <DataGridComboBoxColumn Header="Comments" SelectedValueBinding="{Binding Path=UserID}" SelectedValuePath="ID" DisplayMemberPath="Title" ItemsSource="{Binding Path=Comments}" /> </DataGrid.Columns> </DataGrid> in the code I assign the DataContext like this: dataGrid1.DataContext = entities.Users; The entity User has a property named Comments that leads to all the comments made by the user. The queries are returning data and the user names are shown but the combobox is not being filled. May be the approach is totally wrong or I'm just missing a very simple point here, I'm opened to learn better methods to do this. Thanks

    Read the article

  • Unrecognized configuration section rewriter

    - by Cristian Boariu
    Hi guyrs, I'm trying to implement Approach 3 from this Url Rewriting article. I've added all the required configuration (in web.config for the UrlRewriter module) but when i try to add this in web.config: <rewriter> <rewrite url="~/products/(.+)" to="~/products.aspx?category=$1" /> </rewriter> </configuration> it gives me: Unrecognized configuration section rewriter... Please let me know me WHY it tells me that i put in the wrong place that rewriter xml node? Thanks...

    Read the article

  • How to Create a Temporary Function in Emacs Lisp

    - by Cristian
    I'm making some tedious calls to a bunch of functions, but the parameters will be determined at runtime. I wrote a simple function to keep my code DRY but giving it a name is unnecessary. I don't use this function anywhere else. I'm trying to do it the way I would in Scheme, but I get a void-function error: (let ((do-work (lambda (x y z) (do-x x) (do-y y) ;; etc ))) (cond (test-1 (do-work 'a 'b 'c)) (test-2 (do-work 'i 'j 'k)))) I could stick it all into an apply (e.g., (apply (lambda ...) (cond ...))) but that isn't very readable. Is there a better way?

    Read the article

  • Best Open Source Project Hosting Site

    - by Cristian
    I want to start an open source project, but the rise in hosting sites leaves me a little paralyzed with choice. I know a little about several: I never really liked SourceForge's UI but it still feels like the site I think of when I think "open source project hosting". Google Code Project Hosting looks clean and useful but doesn't seem as feature complete as SourceForge. I've heard good things about Launchpad but don't know much about it nor do I know Bazaar (though I'd be interested in learning it). I know almost nothing about GitHub and, like Bazaar, I don't know Git. Does anyone have any experience with these sites or some other cool code host? Any recommendations? Recommended Sites: BitBucket Codeplex Assembla DevjaVu Savannah

    Read the article

  • How to catch a division by zero?

    - by Cristian Castiblanco
    I have a large mathematical expression that has to be created dinamically. So, for example, once I have parsed "something" the result will be a string like: "$foo+$bar/$baz";. So, for calculating the result of that expression I'm using the eval function... something like this: eval("\$result = $expresion;"); echo "The result is: $result"; The problem here is that sometimes I get errors that says there was a division by zero, and I don't know how to catch that Exception. I have tried things like: eval("try{\$result = $expresion;}catch(Exception \$e){\$result = 0;}"); echo "The result is: $result"; Or: try{ eval("\$result = $expresion;"); } catch(Exception $e){ $result = 0; } echo "The result is: $result"; But it does not work. So, how can I avoid that my application crashes when there is a division by zero?

    Read the article

  • Testing devise with shoulda

    - by cristian
    Hello, I'm having some difficulties in testing devise with shoulda: 2) Error: test: handle :index logged as admin should redirect to Daily page. (Admin::DailyClosesControllerTest): NoMethodError: undefined method `env' for nil:NilClass devise (1.0.6) [v] lib/devise/test_helpers.rb:52:in `setup_controller_for_warden' I have this in my test_helper: include Devise::TestHelpers Thoughts ? Thanks in advance, Cristi

    Read the article

  • itext - pdf to html

    - by Cristian Boariu
    Hi guys, I have spent about 20 hours of coding to produce invoices using iText in c#. Now, i want to use the same code to transform some of the tables to html. Do you know if i can do this? For instance i have this: PdfPTable table = new PdfPTable(3); table.DefaultCell.Border = 0; table.DefaultCell.Padding = 3; table.WidthPercentage = 100; int[] widths = { 100, 200, 100}; table.SetWidths(widths); List listOfCompanyData = (List)getCompanyData(); List listOfCumparatorDreaptaData = (List)getCumparatorDreaptaData(proformaInvoice.getCumparatorDreapta()); table.AddCell((Phrase)listOfCompanyData.Items[0]); table.AddCell(""); table.AddCell((Phrase)listOfCumparatorDreaptaData.Items[0]); and i want to transform this table into html... Is it possible?

    Read the article

  • replace characters which do not matches the ones in a regex

    - by Cristian Boariu
    Hi, I have this regex: private static final String SPACE_PATH_REGEX ="[a-z|A-Z|0-9|\\/|\\-|\\_|\\+]+"; I check if my string matches these regex and IF NOT, i want to replace all characters which are not here, with "_". I;ve tried like: private static final String SPACE_PATH_REGEX_EXCLUDE ="[~a-z|A-Z|0-9|\\/|\\-|\\_|\\+]+"; if (myCompanyName.matches(SPACE_PATH_REGEX)) { myNewCompanySpaceName = myCompanyName; } else{ myNewCompanySpaceName = myCompanyName.replaceAll(SPACE_PATH_REGEX_EXCLUDE, "_"); } but does not work..., so in the 2nd regex "~" seems to not omit the following chars. Any ideea?

    Read the article

  • replace characters which do not match with the ones in a regex

    - by Cristian Boariu
    Hi, I have this regex: private static final String SPACE_PATH_REGEX ="[a-z|A-Z|0-9|\\/|\\-|\\_|\\+]+"; I check if my string matches this regex and IF NOT, i want to replace all characters which are not here, with "_". I've tried like: private static final String SPACE_PATH_REGEX_EXCLUDE = "[~a-z|A-Z|0-9|\\/|\\-|\\_|\\+]+"; if (myCompanyName.matches(SPACE_PATH_REGEX)) { myNewCompanySpaceName = myCompanyName; } else{ myNewCompanySpaceName = myCompanyName.replaceAll( SPACE_PATH_REGEX_EXCLUDE, "_"); } but it does not work..., so in the 2nd regex "~" seems to not omit the following chars. Any idea?

    Read the article

  • unable to find a MessageBodyReader

    - by Cristian Boariu
    Hi guys, I have this interface: @Path("inbox") public interface InboxQueryResourceTest { @POST @Path("{membershipExternalId}/query") @Consumes(MediaType.APPLICATION_XML) @Produces("multipart/mixed") public MultipartOutput query(@PathParam("membershipExternalId") final String membershipExternalId, @QueryParam("page") @DefaultValue("0") final int page, @QueryParam("pageSize") @DefaultValue("10") final int pageSize, @QueryParam("sortProperty") final List<String> sortPropertyList, @QueryParam("sortReversed") final List<Boolean> sortReversed, @QueryParam("sortType") final List<String> sortTypeString, final InstanceQuery instanceQuery) throws IOException; } I have implemented the method to return a MultipartOutput. I am posting an xml query from Fiddler and i receive the result without any problem. BUT i have done an integration test for the same interface, i send the same objects and i put the response like: final MultipartOutput multiPartOutput = getClient().query(getUserRestAuth(), 0, 25, null, null, null, instanceQuery); But here, so from integration tests, i receive a strange error: Unable to find a MessageBodyReader of content-type multipart/mixed;boundary="74c5b6b4-e820-452d-abea-4c56ffb514bb" and type class org.jboss.resteasy.plugins.providers.multipart.MultipartOutput Anyone has any ideea why only in integration tests i receive this error? PS: Some of you will say that i do not send application/xml as ContentType but multipart, which of course is false because the objects are annotated with the required @XmlRootElement etc, otherways neither the POST from Fiddler would work.

    Read the article

  • NHibernate - Retrieve specific columns and count using criteria querie

    - by Cristian Sapino
    This is my mapping file: This is the other with joined-subclass class name="CRMStradCommon.Entities.ContactoEntity,CRMStradCommon" table="contacto" dynamic-update="true" Haw can I make this query with Criteria? SELECT contacto.id, contacto.nombre, persona.apellido, COUNT(*) AS Cant FROM contacto INNER JOIN oportunidad ON contacto.id = oportunidad.dueno LEFT OUTER JOIN persona ON contacto.id = persona.id LEFT OUTER JOIN empresa ON contacto.id = empresa.id GROUP BY contacto.id, contacto.nombre, persona.apellido ORDER BY contacto.nombre, persona.apellido Thanks a lot!

    Read the article

  • rich suggestions - why input is null? (seam framework)

    - by Cristian Boariu
    Hi, I'm trying to build a rich suggestions and i do not understand WHY the input value is null... I mean, why inputText value is not taken when i enter something. The .xhtml code: <h:inputText value="#{suggestion.input}" id="text"> </h:inputText> <rich:suggestionbox id="suggestionBoxId" for="text" tokens=",[]" suggestionAction="#{suggestion.getSimilarSpacePaths()}" var="result" fetchValue="#{result.path}" first="0" minChars="2" nothingLabel="No similar space paths found" columnClasses="center" > <h:column> <h:outputText value="#{result.path}" style="font-style:italic"/> </h:column> </rich:suggestionbox> and action class: @Name("suggestion") @Scope(ScopeType.CONVERSATION) public class Suggestion { @In protected EntityManager entityManager; private String input; public String getInput() { return input; } public void setInput(final String input) { this.input = input; } public List<Space> getSimilarSpacePaths() { List<Space> suggestionsList = new ArrayList<Space>(); if (!StringUtils.isEmpty(input) && !input.equals("/")) { final Query query = entityManager.createNamedQuery("SpaceByPathLike"); query.setParameter("path", input + '%'); suggestionsList = (List<Space>) query.getResultList(); } return suggestionsList; } } So, input beeing null, suggestionList is always empty... Why input's value is not posted?

    Read the article

  • Access Database connect C# local director

    - by Bomboe Cristian
    I want my connection to the database to be available all the time, so if i move the folder with the project, to an other computer, the connection to be made automaticaly. So, how can i change this connection: this.oleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"C:\\Documents and Settings\\Cristi\\Do" + "cuments\\Visual Studio 2008\\Projects\\WindowsApplication3\\bd1.mdb\""; ??? It should read the project directory or something. I don't know. Any ideas? Thank You!

    Read the article

  • jQuery properties - problem

    - by Cristian Boariu
    Hi, I use this plugin: jQuery.i18n.properties I put this code: /* Do stuff when the DOM is ready */ jQuery(document).ready(loadMessage); /* * Add elements behaviours. */ function loadMessage() { jQuery("#customMessage").html("test"); jQuery.i18n.properties({ name:'up_mail_messages', path:'https://static.unifiedpost.com/apps/myup/customer/upmail/upmail_messages/', mode:'both', language:'en', callback: function() { var messageKey = 'up.mail.test'; //alert(eval(messageKey)); jQuery('#customMessage').html(jQuery.i18n.prop(messageKey)); } }); } I do not understand why, in the customeMessage div it prints out: [up.mail.test] instead of the value of it: up.mail.test=messages loaded from en Can anybody show me where i am wrong? I;ve spent about two hours on it without finding any clue... Many Thanks. Ps: here is the message file: https://static.unifiedpost.com/apps/myup/customer/upmail/upmail_messages/up_mail_messages_en.properties

    Read the article

  • nested repeaters - how to sort

    - by Cristian Boariu
    Hi guys, I have a table: Category with some sort of categories category1 category2 category3 I have another table Subcategory which has a fk to Category. So, each category1 can have subcategoryB, subcategoryA, subcategoryZ. Well... i've made two repeaters. The first one is binded to a linq data source which takes the categories from the parent table. The children repeater is binded to that foreign key like: DataSource='<%# Eval("Subcategories_1s") %' So the result is: category1 subcategoryB subcategoryA subcategoryZ category2 etc. Well, the strange question is: how can i order the subcategories alphabetically? If i'd have binded the children repeater to a linq it would be easy. But in this case...?

    Read the article

  • jaxb entity print out as xml

    - by Cristian Boariu
    Hi, I have a class, let's say User adnotated with @XmlRootElement, with some properties (name, surname etc). I use this class for REST operations, as application/xml. The client will POST User class so i want to keep the values in the log. Is there any method in jax-ws to prints out this object as xml? For instance: log.info("Customers sent a USER"+user.whichMethod()); Customer sent a User <user> <name>cristi</name> <surname>kevin</surname> </user> Thanks.

    Read the article

  • c# const in jQuery?

    - by Cristian Boariu
    Hi guys, I have this piece of code in javascript: var catId = $.getURLParam("category"); In my asp.net and c# code for "category" query string i use a public const: public const string CATEGORY = "category"; so if i want to change the query string parameter to be "categoryTest" i only change this const and all the code is updated. Now the question is: how can i do something similar for the javascript i have in the same application (so i want to use the same constant)? I mean i want something like this: var catId = $.getURLParam(CQueryStringParameters.CATEGORY); but because there are none asp.net tags, my const is not interpreted... Any workaround?

    Read the article

  • js works inside the page but not in code behind

    - by Cristian Boariu
    Hi guys, I have this function put in a MasterPage, which shows up an mp3 player: <script type="text/javascript"> $(document).ready(function() { var stageW = 500; var stageH = 216; var cacheBuster = Date.parse(new Date()); var flashvars = {}; var params = {}; params.bgcolor = '#F6F6F6'; params.allowfullscreen = 'true'; flashvars.stageW = stageW; flashvars.stageH = stageH; flashvars.pathToFiles = ''; flashvars.settingsPath = '../mp3player/mp3player_settings.xml'; flashvars.xmlPath = '<%# getRestXmlPlayerUrl() %>'; flashvars.keepSelected = 't'; flashvars.selectedWindow = '4'; flashvars.slideshow = 't'; flashvars.imageWidth = '130'; flashvars.imageHeight = '130'; swfobject.embedSWF('swf/preview.swf?t=' + cacheBuster, 'myContent', stageW, stageH, '9.0.124', 'swf/expressInstall.swf', flashvars, params); }); </script> All works great. But, because i have some ajax on the page with update panel, the flash in not rendered when ajax requests occurs so i need to register this function and i've tried something like this: protected void Page_PreRender(object sender, EventArgs e) { Type cstype = this.GetType(); String csnameForPlayer = "applyStyleToMp3Player"; if (!Page.ClientScript.IsClientScriptBlockRegistered(cstype, csnameForPlayer)) { StringBuilder cstextForPlayer = new StringBuilder(); cstextForPlayer.Append(" $(document).ready(function() { " + " var stageW = 500;" + " var stageH = 216;" + " var cacheBuster = Date.parse(new Date());" + " var flashvars = {};" + " var params = {};" + " params.bgcolor = '#F6F6F6';" + " params.allowfullscreen = 'true';" + " flashvars.stageW = stageW;" + " flashvars.stageH = stageH;" + " flashvars.pathToFiles = '';" + " flashvars.settingsPath = '../mp3player/mp3player_settings.xml';" + " flashvars.xmlPath = '<%# getRestXmlPlayerUrl() %>';" + " flashvars.keepSelected = 't';" + " flashvars.selectedWindow = '4';" + " flashvars.slideshow = 't';" + " flashvars.imageWidth = '130';" + " flashvars.imageHeight = '130';" + " swfobject.embedSWF('swf/preview.swf?t=' + cacheBuster, 'myContent', stageW, stageH, '9.0.124', 'swf/expressInstall.swf', flashvars, params);" + "}); "); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), csnameForPlayer, cstextForPlayer.ToString(), true); } } Well, this does not work. The flash player does not appear any more, so, i assume that is something wrong in the cstextForPlayer. I've spent over one hour to figure it out but i've failed. Does anyone see the problem? Thanks in advance.

    Read the article

  • Is java.util.Scanner that slow?

    - by Cristian Vrabie
    Hi guys, In a Android application I want to use Scanner class to read a list of floats from a text file (it's a list of vertex coordinates for OpenGL). Exact code is: Scanner in = new Scanner(new BufferedInputStream(getAssets().open("vertexes.off"))); final float[] vertexes = new float[nrVertexes]; for(int i=0;i<nrVertexFloats;i++){ vertexes[i] = in.nextFloat(); } It seems however that this is incredibly slow (it took 30 minutes to read 10,000 floats!) - as tested on the 2.1 emulator. What's going on? I don't remember Scanner to be that slow when I used it on the PC (truth be told I never read more than 100 values before). Or is it something else, like reading from an asset input stream? Thanks for the help!

    Read the article

  • Re-binding an ajaxForm after content re-loads with ajax (jQuery 1.4.2)

    - by Cristian
    I'm trying to figure out why this is a problem when using jQuery 1.4.2 and not 1.3.2. This is my function: function prepare_logo_upload() { $("#logo-upload-form").ajaxForm({ //alert(responseText); success: function(responseText) { //alert(responseText); $('#profile .wrapper').html(responseText); prepare_logo_upload(); } }); } Every other live event works but can't use the .live() method because ajaxForm is a plugin. I have noticed this also for other types of binding (clicks) using the old form (re-binding after callback) Can you tell me if it is a way of solving this? This is a similar question, but due to my newbie reputation here, can't comment or ask a question there, so I'll ask a new one here. - http://stackoverflow.com/questions/2208880/jquery-bind-ajaxform-to-a-form-on-a-page-loaded-via-load Thank you!

    Read the article

  • diff between two days, in hours

    - by Cristian Boariu
    Hi, I do not uderstand why the result of: (DateTime.Now.Subtract(user.created_time.Value.Date)).Hours is 23. where: DateTime.Now is:{3/30/2010 12:00:00 AM} and user.created_time.Value.Date is : {3/24/2010 12:00:00 AM} Does it make sense for anybody? ps: I want to select all users created in last 72 hours so i suppose that is the way i should do...

    Read the article

  • Why is Lisp used for AI?

    - by Cristián Romo
    I've been learning Lisp to expand my horizons because I have heard that it is used in AI programming. After doing some exploring, I have yet to find AI examples or anything in the language that would make it more inclined towards it. Was Lisp used in the past because it was available, or is there something that I'm just missing?

    Read the article

< Previous Page | 1 2 3 4  | Next Page >