Search Results

Search found 19688 results on 788 pages for 'con current'.

Page 51/788 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • Run init.d script in the context of the current user session.

    - by akellehe
    I'd like to run a script in init.d (on Fedora) in the context of the user session I'm logging in as. I have a script called keyboard_deadkeys I wrote to set some deadkeys on my keyboard. The script is very simple: #!/bin/bash /usr/bin/xmodmap /home/julie/keymappings I put it in the directory /etc/init.d so it will run at boot time. It is also in /etc/rc.d/init.d I changed the permissions to a+rwx for good measure. When I boot; the deadkeys aren't set in the user's session. When I then run the script manually; the keys are set. How can I rectify this?

    Read the article

  • Múltiples clientes en el mismo Oracle UCM

    - by [email protected]
    Estamos muy activos con la implantación de plataformas ECM que den servicio a múltiples clientes. Consiguiendo 2 objetivos muy importantes:El cliente final puede pagar al proveedor por una plataformas ECM como servicio (SaaS). Y, lógicamente, se ahorra en complejidad y gastos de infraestructura, administración, formación, almacenamiento, etc...Hemos estado explicando estos días el modelo Master-Proxy de Oracle UCM con el que podemos implantar este tipo de plataformas. No siempre será la solución más adecuada porque a veces vamos a querer disponer de plataformas compartidas, pero con clientes completamente aislados. Siempre, la consola de migración nos permite exportar e importar componentes, metadatos, contenidos, workflows, etc... para que elijamos el modelo más adecuado para cada caso.Pero, ¿Cómo funciona?. Podéis ver en la imágen que se basa en la instalación de varias instancias de UCM y configurarlas de forma que varias de ellas se comporten como "Master" (digo varias para conseguir alta disponibilidad), y el resto se comporten como "Proxy" (también varias instancias de UCM pueden comportarse como un mismo "Proxy" permitiendo balancear la carga en función de que cada cliente requiera más o menos rendimiento). Esta configuración (que vemos en la imágen adjunta), nos permite:Delegar la gestión de usuarios de cada cliente. Los usuarios del Master podrán acceder a todos los Proxies, pero los usuarios de cada proxy sólo acceden a su repositorio.Delegar funcionalidad y componentes. Es posible configurar diferentes funcionalidades en cada proxy de forma que algunos servidores estén especializados en Web Content Management, otros en Document Management (por ejemplo).Diferentes modelos de metadatos. Podemos modelar unos tipos documentales generales para toda la plataforma y otros particulares diferentes en cada UCM "Proxy".Conseguir una centralización de búsquedas y acceso a repositorios de documentación con diferentes juegos de caracteres. Un UCM Master puede centralizar la búsqueda en UCM's proxy que alberguen documentación en diferentes juegos de caracteres (por ejemplo un UCM para documentación de idiomas "Western European" (inglés, español, francés, alemán,...) y otro UCM proxy bajo juego de caracteres "Asian" (japones, coreano, chino,...).Fuentes:Toda la información detallada se encuentra en la documentación de Oracle UCM, aquí:http://download.oracle.com/docs/cd/E10316_01/ouc.htmY en concreto, lo relativo a plataformas, en el documento "Planning and Implementation Guide", aquí:plan_implement_guide_10en.pdf

    Read the article

  • Entity Framework v1 &ndash; tips and Tricks Part 3

    - by Rohit Gupta
    General Tips on Entity Framework v1 & Linq to Entities: ToTraceString() If you need to know the underlying SQL that the EF generates for a Linq To Entities query, then use the ToTraceString() method of the ObjectQuery class. (or use LINQPAD) Note that you need to cast the LINQToEntities query to ObjectQuery before calling TotraceString() as follows: 1: string efSQL = ((ObjectQuery)from c in ctx.Contact 2: where c.Address.Any(a => a.CountryRegion == "US") 3: select c.ContactID).ToTraceString(); ================================================================================ MARS or MultipleActiveResultSet When you create a EDM Model (EDMX file) from the database using Visual Studio, it generates a connection string with the same name as the name of the EntityContainer in CSDL. In the ConnectionString so generated it sets the MultipleActiveResultSet attribute to true by default. So if you are running the following query then it streams multiple readers over the same connection: 1: using (BAEntities context = new BAEntities()) 2: { 3: var cons = 4: from con in context.Contacts 5: where con.FirstName == "Jose" 6: select con; 7: foreach (var c in cons) 8: { 9: if (c.AddDate < new System.DateTime(2007, 1, 1)) 10: { 11: c.Addresses.Load(); 12: } 13: } 14: } ================================================================================= Explicitly opening and closing EntityConnection When you call ToList() or foreach on a LINQToEntities query the EF automatically closes the connection after all the records from the query have been consumed. Thus if you need to run many LINQToEntities queries over the same connection then explicitly open and close the connection as follows: 1: using (BAEntities context = new BAEntities()) 2: { 3: context.Connection.Open(); 4: var cons = from con in context.Contacts where con.FirstName == "Jose" 5: select con; 6: var conList = cons.ToList(); 7: var allCustomers = from con in context.Contacts.OfType<Customer>() 8: select con; 9: var allcustList = allCustomers.ToList(); 10: context.Connection.Close(); 11: } ====================================================================== Dispose ObjectContext only if required After you retrieve entities using the ObjectContext and you are not explicitly disposing the ObjectContext then insure that your code does consume all the records from the LinqToEntities query by calling .ToList() or foreach statement, otherwise the the database connection will remain open and will be closed by the garbage collector when it gets to dispose the ObjectContext. Secondly if you are making updates to the entities retrieved using LinqToEntities then insure that you dont inadverdently dispose of the ObjectContext after the entities are retrieved and before calling .SaveChanges() since you need the SAME ObjectContext to keep track of changes made to the Entities (by using ObjectStateEntry objects). So if you do need to explicitly dispose of the ObjectContext do so only after calling SaveChanges() and only if you dont need to change track the entities retrieved any further. ======================================================================= SQL InjectionAttacks under control with EFv1 LinqToEntities and LinqToSQL queries are parameterized before they are sent to the DB hence they are not vulnerable to SQL Injection attacks. EntitySQL may be slightly vulnerable to attacks since it does not use parameterized queries. However since the EntitySQL demands that the query be valid Entity SQL syntax and valid native SQL syntax at the same time. So the only way one can do a SQLInjection Attack is by knowing the SSDL of the EDM Model and be able to write the correct EntitySQL (note one cannot append regular SQL since then the query wont be a valid EntitySQL syntax) and append it to a parameter. ====================================================================== Improving Performance You can convert the EntitySets and AssociationSets in a EDM Model into precompiled Views using the edmgen utility. for e.g. the Customer Entity can be converted into a precompiled view using edmgen and all LinqToEntities query against the contaxt.Customer EntitySet will use the precompiled View instead of the EntitySet itself (the same being true for relationships (EntityReference & EntityCollections of a Entity)). The advantage being that when using precompiled views the performance will be much better. The syntax for generating precompiled views for a existing EF project is : edmgen /mode:ViewGeneration /inssdl:BAModel.ssdl /incsdl:BAModel.csdl /inmsl:BAModel.msl /p:Chap14.csproj Note that this will only generate precompiled views for EntitySets and Associations and not for existing LinqToEntities queries in the project.(for that use CompiledQuery.Compile<>) Secondly if you have a LinqToEntities query that you need to run multiple times, then one should precompile the query using CompiledQuery.Compile method. The CompiledQuery.Compile<> method accepts a lamda expression as a parameter, which denotes the LinqToEntities query  that you need to precompile. The following is a example of a lamda that we can pass into the CompiledQuery.Compile() method 1: Expression<Func<BAEntities, string, IQueryable<Customer>>> expr = (BAEntities ctx1, string loc) => 2: from c in ctx1.Contacts.OfType<Customer>() 3: where c.Reservations.Any(r => r.Trip.Destination.DestinationName == loc) 4: select c; Then we call the Compile Query as follows: 1: var query = CompiledQuery.Compile<BAEntities, string, IQueryable<Customer>>(expr); 2:  3: using (BAEntities ctx = new BAEntities()) 4: { 5: var loc = "Malta"; 6: IQueryable<Customer> custs = query.Invoke(ctx, loc); 7: var custlist = custs.ToList(); 8: foreach (var item in custlist) 9: { 10: Console.WriteLine(item.FullName); 11: } 12: } Note that if you created a ObjectQuery or a Enitity SQL query instead of the LINQToEntities query, you dont need precompilation for e.g. 1: An Example of EntitySQL query : 2: string esql = "SELECT VALUE c from Contacts AS c where c is of(BAGA.Customer) and c.LastName = 'Gupta'"; 3: ObjectQuery<Customer> custs = CreateQuery<Customer>(esql); 1: An Example of ObjectQuery built using ObjectBuilder methods: 2: from c in Contacts.OfType<Customer>().Where("it.LastName == 'Gupta'") 3: select c This is since the Query plan is cached and thus the performance improves a bit, however since the ObjectQuery or EntitySQL query still needs to materialize the results into Entities hence it will take the same amount of performance hit as with LinqToEntities. However note that not ALL EntitySQL based or QueryBuilder based ObjectQuery plans are cached. So if you are in doubt always create a LinqToEntities compiled query and use that instead ============================================================ GetObjectStateEntry Versus GetObjectByKey We can get to the Entity being referenced by the ObjectStateEntry via its Entity property and there are helper methods in the ObjectStateManager (osm.TryGetObjectStateEntry) to get the ObjectStateEntry for a entity (for which we know the EntityKey). Similarly The ObjectContext has helper methods to get an Entity i.e. TryGetObjectByKey(). TryGetObjectByKey() uses GetObjectStateEntry method under the covers to find the object, however One important difference between these 2 methods is that TryGetObjectByKey queries the database if it is unable to find the object in the context, whereas TryGetObjectStateEntry only looks in the context for existing entries. It will not make a trip to the database ============================================================= POCO objects with EFv1: To create POCO objects that can be used with EFv1. We need to implement 3 key interfaces: IEntityWithKey IEntityWithRelationships IEntityWithChangeTracker Implementing IEntityWithKey is not mandatory, but if you dont then we need to explicitly provide values for the EntityKey for various functions (for e.g. the functions needed to implement IEntityWithChangeTracker and IEntityWithRelationships). Implementation of IEntityWithKey involves exposing a property named EntityKey which returns a EntityKey object. Implementation of IEntityWithChangeTracker involves implementing a method named SetChangeTracker since there can be multiple changetrackers (Object Contexts) existing in memory at the same time. 1: public void SetChangeTracker(IEntityChangeTracker changeTracker) 2: { 3: _changeTracker = changeTracker; 4: } Additionally each property in the POCO object needs to notify the changetracker (objContext) that it is updating itself by calling the EntityMemberChanged and EntityMemberChanging methods on the changeTracker. for e.g.: 1: public EntityKey EntityKey 2: { 3: get { return _entityKey; } 4: set 5: { 6: if (_changeTracker != null) 7: { 8: _changeTracker.EntityMemberChanging("EntityKey"); 9: _entityKey = value; 10: _changeTracker.EntityMemberChanged("EntityKey"); 11: } 12: else 13: _entityKey = value; 14: } 15: } 16: ===================== Custom Property ==================================== 17:  18: [EdmScalarPropertyAttribute(IsNullable = false)] 19: public System.DateTime OrderDate 20: { 21: get { return _orderDate; } 22: set 23: { 24: if (_changeTracker != null) 25: { 26: _changeTracker.EntityMemberChanging("OrderDate"); 27: _orderDate = value; 28: _changeTracker.EntityMemberChanged("OrderDate"); 29: } 30: else 31: _orderDate = value; 32: } 33: } Finally you also need to create the EntityState property as follows: 1: public EntityState EntityState 2: { 3: get { return _changeTracker.EntityState; } 4: } The IEntityWithRelationships involves creating a property that returns RelationshipManager object: 1: public RelationshipManager RelationshipManager 2: { 3: get 4: { 5: if (_relManager == null) 6: _relManager = RelationshipManager.Create(this); 7: return _relManager; 8: } 9: } ============================================================ Tip : ProviderManifestToken – change EDMX File to use SQL 2008 instead of SQL 2005 To use with SQL Server 2008, edit the EDMX file (the raw XML) changing the ProviderManifestToken in the SSDL attributes from "2005" to "2008" ============================================================= With EFv1 we cannot use Structs to replace a anonymous Type while doing projections in a LINQ to Entities query. While the same is supported with LINQToSQL, it is not with LinqToEntities. For e.g. the following is not supported with LinqToEntities since only parameterless constructors and initializers are supported in LINQ to Entities. (the same works with LINQToSQL) 1: public struct CompanyInfo 2: { 3: public int ID { get; set; } 4: public string Name { get; set; } 5: } 6: var companies = (from c in dc.Companies 7: where c.CompanyIcon == null 8: select new CompanyInfo { Name = c.CompanyName, ID = c.CompanyId }).ToList(); ;

    Read the article

  • Edit in desktop application with DataGridView

    - by SAMIR BHOGAYTA
    private void DataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 0) { string s = DataGridView.Rows[e.RowIndex].Cells[1].FormattedValue.ToString(); srno = Convert.ToInt16(s); FormName objFrm = new FormName(s); objFrm.MdiParent = this.MdiParent; objFrm.Show(); } } //Into the New Form public FormName(string id) { uid = id; i = Convert.ToInt16(id); InitializeComponent(); } //Get Detail As per id public void GetDetail() { string detail = "SELECT fieldname1,fieldname2 FROM TableName where PrimaryKeyField = "+id+""; DataSet ds = new DataSet(); ds = (DataSet)prm.RetriveData(detail); } //RetriveData Function public object RetriveData(string query) { // If you have sql connection use SqlConnection OleDbConnection con = new OleDbConnection(constr); OleDbDataAdapter drap = new OleDbDataAdapter(query, con); con.Open(); DataSet ds = new DataSet(); drap.Fill(ds); con.Close(); return ds; }

    Read the article

  • Come integrare in modo smart processi di vendita e produzione?

    - by Claudia Caramelli-Oracle
    L’innovazione tecnologica ha trasformato il modo in cui i clienti interagiscono con le aziende. Inoltre, gli attuali scenari di mercato richiedono attenzione ed efficacia nella vendita per mantenere massima competitività. Per ottenere le migliori performance di vendita è necessario accelerare e automatizzare i processi di scambio informazioni tra i dipartimenti commerciali e produttivi, minimizzando tempi di attesa per ottenere dati tecnici e autorizzazioni alla fattibilità, riducendo i colli di bottiglia e i possibili errori umani attraverso un processo di controllo e omologazione dell’offerta.Gli sponsor dell’evento ti attendono l'11 giugno presso la prestigiosa sede dell’Unione Industriale di Torino per scoprire come: Ridurre il ciclo di vendita, facendo efficienza sull’intero processo di vendita Minimizzare gli impatti da turnover del personale di vendita Migliorare il value to promise Ottenere una migliore fidelizzazione e soddisfazione dei propri clienti, riducendone lo switching Assistere dal vivo ad una dimostrazione pratica di Oracle, leader mondiale nell’ambito delle soluzioni di CPQ (Configure, Price and Quoting) nell’utilizzo di uno strumento veloce, facile da utilizzare, che permetta una gestione smart della configurazione commerciale dell’offerta B2B anche con l’ausilio di accesso mobile e cruscotti direzionali. Scoprire come altre aziende abbiano adottato con successo queste soluzioni di business. La partecipazione all'evento è gratuita ma con capienza limitata, iscriviti subito per assicurarti la partecipazione: CLICCA QUI per registrarti. Se hai bisogno di maggiori informazioni scrivi a Silvia Valgoi.

    Read the article

  • Program received signal: “0”. warning: check_safe_call: could not restore current frame

    - by Kaushik
    Require urgent help!:( i m developing a game and i m dealing with around 20 images at the same time. As per my knowledge, i m allocating and deallocating the images at right places. Game runs for around 15 min fine but quits with an error message: "Program received signal: “0”. warning: check_safe_call: could not restore current frame" i also tried debugging with memory leak tools provided in Xcode but could not find any issue with memory management or any increase in memory size on simulator it works fine but not on the device. i m confused wht can be the issue. Any help is appreciated. Thanx in advance

    Read the article

  • "Upgrade current target for ipad" is grayed out (disabled)?

    - by Eric
    I'm trying to create a universal iPhone/iPad app using this method: http://www.enscand.com/roller/enscand/entry/ready_for_ipad which is also described all over the web. My problem is that the "Upgrade current target for iPad" line is grayed out and doesn't appear at all when I right click the target. I'm working on an app that I inherited from someone, and have tried this with an app that I wrote entirely myself (no problems on that one). And yes, I'm sure that I'm selecting the target. Just wondering if anyone has any insight into what checks are being run that would cause this option to be unavailable.

    Read the article

  • How do I zoom an MKMapView to the users current location without CLLocationManager?

    - by Danny Tuppeny
    With the MKMapView there's an option called "Show users current location" which will automatically show a users location on the map. I'd like to zoom into this location without adding a CLLocationManager (this seems silly if the map is already taking care of this). The problem is, I can't find a nice event that fires when the map has figured out the users location, so I don't know where to put the code that will zoom/scroll. I tried using the viewForAnnotation method like this: - (MKAnnotationView *) mapView:(MKMapView *)map viewForAnnotation:(id <MKAnnotation>)annotation { if ([annotation class] == [MKUserLocation class] ) { NSLog(@"UserLocation annotation"); return [map viewForAnnotation:annotation]; } return nil; } However it doesn't fire if the users location is off the screen. Is there a way to be notified when an MKMapView has got the user location so I can zoom in to it, or do I just have to add a CLLocationManager for this?

    Read the article

  • How can I add GET variables to the end of the current page url using a form with php?

    - by zeckdude
    I have some database information that is being shown on a page. I am using a pagination class that uses the $_GET['page'] variable in the url. When you click on a different pagination anchor tag, it changes $_GET['page'] to a new number in the url and shows the corresponding results. I have sort and search features which uses the $_GET['searchby'] and $_GET['search_input'] variables. The user enters their search or sort criteria on a form that is using GET. The variables are then put into the url allowing for the correct results to be shown. The problem I am having is that whenever I click on a pagination link, it adds that to end of the url and erases the search or sort GET variables. The same thing happens when I submit the search/sort form. How can I add GET variables to the end of the current page url using the anchor tag and search/sort form?

    Read the article

  • How to avoid "The name 'ConfigurationManager' does not exist in the current context" error?

    - by 5YrsLaterDBA
    I am using VS2008. I have a project connect with a database and the connection string is read from App.config via ConfigurationManager. We are using L2E. Now I added a helper project, AndeDataViewer, to have a simple UI to display data from the database for testing/verification purpose. I don't want to create another set of Entity Data Model in the helper project. I just added all related files as a link in the new helper project. When I compile, I got the following error: Error 15 The name 'ConfigurationManager' does not exist in the current context C:\workspace\SystemSoftware\SystemSoftware\src\systeminfo\RuntimeInfo.cs 24 40 AndeDataViewer I think I may need to add another project setting/config related file's link to the helper project from the main project? There is no App.config file in the new helper project. But it looks I cannot add that file's link to the helper project. Any ideas?

    Read the article

  • Read and write from a byte stream if the endianess of the data is different from that of the current

    - by Sam Holder
    I have a stream of bytes which contains a flag which identifies the endianness of the data in the header. I want to read the doubles from the stream, which will presumably need to be different if the endianness of the data in the header is different? I am currently using a BinaryReader and calling ReadDouble to read the data from the stream, but if the endianness flag indicates that the data stream has a different endianness than the machine architecture then presumably this will not work? How should this be handled? Should I check the endianness of my data against that of the current machine then when I want to read a double instead read the bytes raw into a byte array and do array.Reverse to reverse the data before using BitConverter.ToDouble () with the reversed data and a zero offset? I could just test this but I do not have a source of data for both endianness so am a bit concerned about creating test data to test the parsing and this being different from what 'real' data might look like.

    Read the article

  • How can I use jQuery to match a string inside the current URL of the window I am in?

    - by Jannis
    Hi, I have used the excellent gskinner.com/RegExr/ tool to test my string matching regex but I cannot figure out how to implement this into my jQuery file to return true or false. The code I have is as follows: ^(http:)\/\/(.+\.)?(stackoverflow)\. on a url such as http://stackoverflow.com/questions/ask this would match (according to RegExr) http://stackoverflow. So this is great because I want to try matching the current window.location to that string, but the issue I am having is that this jQuery/js script does not work: var url = window.location; if ( url.match( /^(http:)\/\/(.+\.)?(stackoverflow)\./ ) ) { alert('this works'); }; Any ideas on what I am doing wrong here? Thanks for reading. Jannis

    Read the article

  • How do I specify table data only for the current user's ID (VWD asp.net 3.5) ?

    - by Greg McNulty
    I'm using the Details View control of VWD asp.net 2008 I have a users database table and one of the columns contain the "unique" user's profile ID, created by VWD from the automatic profiles table. From my table, I would like to select only the data pertaining to the logged in user. How do I get the current unique user profileID and then have that used for the query? What I have so far: In the configure data source option of the control I select the columns I would like to display, select the check box for "Return Only Unique IDs" and the WHERE option. In this new window I select the Column to the profile userID ... "=" and then assumed I should select Source: "Profile". Now what should the parameter properties or value be to select only the logged userID specific data of the table? Any help is appreciated. Thank You!

    Read the article

  • Could the UIHint attribute accept a property of the current class ?

    - by user252160
    I found the follwing code in MSDN . How can I change this "UnitsInStock" with a value that my Product class has. For instance, Product has a FieldType property which has a string property called Name. I'd like to use that FieldType.Name property instead of hardcoding with a string. However, I cannot specify "this", or the current instance as an argument of the UIHint attribute . Please, help using System; using System.Web.DynamicData; using System.ComponentModel.DataAnnotations; [MetadataType(typeof(ProductMetadata))] public partial class Product { } public partial class ProductMetadata { [UIHint("UnitsInStock")] [Range(100, 10000, ErrorMessage = "Units in stock should be between {1} and {2}.")] public object UnitsInStock; }

    Read the article

  • How do I get the current color of a fragment?

    - by Mason Wheeler
    I'm trying to wrap my head around shaders in GLSL, and I've found some useful resources and tutorials, but I keep running into a wall for something that ought to be fundamental and trivial: how does my fragment shader retrieve the color of the current fragment? You set the final color by saying gl_FragColor = whatever, but apparently that's an output-only value. How do you get the original color of the input so you can perform calculations on it? That's got to be in a variable somewhere, but if anyone out there knows its name, they don't seem to have recorded it in any tutorial or documentation that I've run across so far, and it's driving me up the wall.

    Read the article

  • How to preserve whitespace indentation of text enclosed in HTML <pre> tags excluding the current indentation level of the <pre> tag in the document?

    - by Michael Barton
    I'm trying to display my code on a website but I'm having problems preserving the whitespace indentation correctly. For instance given the following snippet: <html> <body> Here is my code: <pre> def some_funtion return 'Hello, World!' end </pre> <body> </html> This is displayed in the browser as: Here is my code: def some_funtion return 'Hello, World!' end When I would like it displayed as: Here is my code: def some_funtion return 'Hello, World!' end The difference is that that current indentation level of the HTML pre tag is being added to the indentation of the code. I'm using nanoc as a static website generator and I'm using google prettify to also add syntax highlighting. Can anyone offer any suggestions?

    Read the article

  • How do I run a vim script that alters the current buffer?

    - by Dan
    I'm trying to write a beautify.vim script that makes C-like code adhere to a standard that I can easily read. My file contains only substitution commands that all begin with %s/... However, when I try to run the script with my file open, in the manner :source beautify.vim, or :runtime beautify.vim, it runs but all the substitute commands state that their pattern wasn't found (patterns were tested by entering them manually and should work). Is there some way to make vim run the commands in the context of the current buffer? beautify.vim: " add spaces before open braces sil! :%s/\%>1c>\s\@<!{/ {/g " beautify for sil! :%s/for *( *\([^;]*\) *; *\([^;]*\) *; *\([^;]*\) *)/for (\1; \2; \3)/ " add spaces after commas sil! :%s/,\s\@!/, /g In my tests the first :s command should match (it matches when applied manually).

    Read the article

  • Quick Question: How can I make sure the current directory is not changed because of OpenFileDialog?

    - by pecker
    say my application is installed in C:\programfiles\xyz\ I've some setting & other data files (*.dat files) in this directory too. My application uses OpenFileDialog to open an image. Problem is that when ever user browses to some directory (say MyPictures) for an image. The current working directory of the application becomes that directory (MyPictures in this case). After user inputs the image. I do some processing over it and save some values to imagedata.dat which will be located in the path where original application is installed.(C:\programfiles\xyz here ) In my code I'm just using FileStream("imagedata.dat",...,...) without any path prefix before the filename. Problem here is that application is crashing because it is searching for imagedata.dat in 'MyPictures\imagedata.dat'. How can I avoid this?

    Read the article

  • HTML5: dragover(), drop(): how get current x,y coordinates?

    - by Pete Alvin
    How does one determine the (x,y) coordinates while dragging "dragover" and after the drop ("drop") in HTML5 DnD? I found a webpage that describes x,y for dragover (look at e.offsetX and e.layerX to see if set for various browsers but for the life of me they ARE NOT set). What do you use for the drop(e) function to find out WHERE in the current drop target it was actually dropped? I'm writing an online circuit design app and my drop target is large. Do I need to drop down to mouse-level to find out x,y or does HTML5 provided a higher level abstraction?

    Read the article

  • How to ask database server for current datetime using entity framework?

    - by Levelbit
    I don't want for my current ModifeidDateTime to be machine time already server time. Every time I want to update or add a person to my datebase on SQL Server 2008 I want to fill ModifiedDateTime filed. It's not like I can change update query as with data adapter command when I work with dataset and to define for my ModifiedDateTime filed to be =GetDate(). I created stored function to retutn me a value of GetDate() method, but I have a problem to import procedure which returns values as int, string ... or no value at all, already just entity values as Person for example in my case. Why is that? Anyway, It would be of great help if you can provide me any solution that works to retrieve DateTime value from server.

    Read the article

  • How to get current byte position of the parser in Antlr with c# target?

    - by Aftershock
    Hi, I am interested in the current byte position in the stream when parsing something using Antlr 3. I have seen there is a similar question but there was no real answer there. That is why I am trying again. I am not interested in token index, byte position in a line etc... Could you someone tell me that? It is obvious that some code has to be written/overridden. Does someone have specific code to write? I use C#.

    Read the article

  • Is there a technical way to speed up a general program above current PC speed limit?

    - by Maksee
    Let's imagine I developed a Windows console application implementing some algorithm calculating something. Let's say it doesn't use any threads, just straightforward linear approach with ifs, loops and so on. Is there any technical way to make if run it 100x times faster than on the most advanced current PC? For example one of the way would be to run it on a super computer that emulates i386 faster than any of the existing PCs. But in this case the question what computer and does it really have ability to emulate Windows. In other words, is there real examples of such approach? Although in general it looks useless, but if there is a way, one could develop some program on his general home computer and pay for running it much faster on some other hardware. I suppose that this question could be asked on superuser.com, but since there are possible specific with such things as assembler instructions or threads, I thought that stackoverflow.com is better

    Read the article

  • Unable to edit a database row from JSF

    - by user1924104
    Hi guys i have a data table in JSF which displays all of the contents of my database table, it displays it fine, i also have a delete function that can successfully delete from the database fine and updates the data table fine however when i try to update the database i get the error java.lang.IllegalArgumentException: Cannot convert richard.test.User@129d62a7 of type class richard.test.User to long below is the code that i have been using to delete the rows in the database that is working fine : public void delete(long userID) { PreparedStatement ps = null; Connection con = null; if (userID != 0) { try { Class.forName("com.mysql.jdbc.Driver"); con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root"); String sql = "DELETE FROM user1 WHERE userId=" + userID; ps = con.prepareStatement(sql); int i = ps.executeUpdate(); if (i > 0) { System.out.println("Row deleted successfully"); } } catch (Exception e) { e.printStackTrace(); } finally { try { con.close(); ps.close(); } catch (Exception e) { e.printStackTrace(); } } } } i simply wanted to edit the above code so it would update the records instead of deleting them so i edited it to look like : public void editData(long userID) { PreparedStatement ps = null; Connection con = null; if (userID != 0) { try { Class.forName("com.mysql.jdbc.Driver"); con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root"); String sql = "UPDATE user1 set name = '"+name+"', email = '"+ email +"', address = '"+address+"' WHERE userId=" + userID; ps = con.prepareStatement(sql); int i = ps.executeUpdate(); if (i > 0) { System.out.println("Row updated successfully"); } } catch (Exception e) { e.printStackTrace(); } finally { try { con.close(); ps.close(); } catch (Exception e) { e.printStackTrace(); } } } } and the xhmtl is : <p:dataTable id="dataTable" var="u" value="#{userBean.getUserList()}" paginator="true" rows="10" editable="true" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="5,10,15"> <p:column> <f:facet name="header"> User ID </f:facet> #{u.userID} </p:column> <p:column> <f:facet name="header"> Name </f:facet> #{u.name} </p:column> <p:column> <f:facet name="header"> Email </f:facet> #{u.email} </p:column> <p:column> <f:facet name="header"> Address </f:facet> #{u.address} </p:column> <p:column> <f:facet name="header"> Created Date </f:facet> #{u.created_date} </p:column> <p:column> <f:facet name="header"> Delete </f:facet> <h:commandButton value="Delete" action="#{user.delete(u.userID)}" /> </p:column> <p:column> <f:facet name="header"> Delete </f:facet> <h:commandButton value="Edit" action="#{user.editData(u)}" /> </p:column> currently when you press the edit button it will only update it with the same values as i haven't yet managed to get the datatable to be editable with the database, i have seen a few examples with an array list where the data table gets its values from but never a database so if you have any advice on this too it would be great thanks

    Read the article

  • How do I redirect to the current page in Servlet Filter?

    - by JeffJak
    I have a page say: /myapp/test.jsp?queryString=Y. The filter needs to redirect to current page. It should go to /myapp/test.jsp (without the query string). The below seems to bring it to to the context root: /myapp. I am running in WAS6.1. public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { HttpServletRequest httpReq = (HttpServletRequest) req; HttpServletResponse httpResp = (HttpServletResponse) resp; { boolean blnNeedToRedirect = true; if (blnNeedToRedirect) { httpResp.sendRedirect("."); return; } chain.doFilter(req, resp); }

    Read the article

  • How to query_posts after the current timestamp and sort reverse chronologically?

    - by Jody Heavener
    I am using the following code in Wordpress to query events (custom post type) and order them by date chronologically.. query_posts( array( 'post_type' => 'events', 'showposts' => 10, 'orderby' => 'meta_value_num','meta_key' => '_ecmb_datetime' ) ); Where the meta key _ecmb_datetime is, this is the timestamp of the event. I don't want to show events that have already happened, so my question is how do I only show events happening after my current time, and how do I sort reverse chronologically? Any help is greatly appreciated

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >