Search Results

Search found 1514 results on 61 pages for 'rename'.

Page 39/61 | < Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >

  • How to make Databinding type safe and support refactoring

    - by Ian Ringrose
    When I wish to bind a control to a property of my object, I have to provide the name of the property as a string. This is not very good because: If the property is removed or renamed, I don’t get a compiler warning. If a rename the property with a refactoring tool, it is likely the data binding will not be updated. I don’t get an error until runtime if the type of the property is wrong, e.g. binding an integer to a date chooser. Is there a design-paten that gets round this, but still has the ease of use of data-binding? (This is a problem in WinForm, Asp.net and WPF and most likely lots of other systems) I have now found "workarounds for nameof() operator in C#: typesafe databinding" that also has a good starting point for a solution.

    Read the article

  • Flatten a PHP array

    - by deadkarma
    Say I have a form with these fields, and cannot rename them: <input type="text" name="foo[bar]" /> <input type="text" name="foo[baz]" /> <input type="text" name="foo[bat][faz]" /> When submitted, PHP turns this into an array: Array ( [foo] => Array ( [bar] => foo bar [baz] => foo baz [bat] => Array ( [faz] => foo bat faz ) ) ) What methods are there to convert or flatten this array into a data structure such as: Array ( [foo[bar]] => foo bar [foo[baz]] => foo baz [foo[bat][faz]] => foo bat faz )

    Read the article

  • Getting 'error while loading shared libraries' when using -L to specifically find the library.

    - by e5
    I've been trying to solve this for a few hours now. I am compiling some c files using gcc. The files require libpbc, so I am using the -L flag to point gcc at the directory which contains libpbc.so.1. The code compiles without error yet when I attempt to run it I get the following error message: ./example.out: error while loading shared libraries: libpbc.so.1: cannot open shared object file: No such file or directory Looking at similar questions this error message seems to indicate that gcc can't find libpbc.so.1. I know gcc sees libpbc.so.1 because when I rename libpbc.so.1 to something else it fails to compile. I am using -L to point to the directory which contains libpbc.so.1. Not sure what next steps I can take to figure this out. Would appreciate any ideas. What does this error message mean exactly?

    Read the article

  • htaccess to change url

    - by Guo Hong Lim
    I have the following code in my .htacess but it didn't work right. Is it because mod-rewrite is no "on", if so, how can i check? Options +FollowSymlinks RewriteEngine on RewriteRule ^(.*)\$ $1.php [nc] I wanted to rename my address, example: http://www.abc.com - http://www.abc.com http://abc.com - http://www.abc.com http://www.abc.com/123.html - http://www.abc.com/123 http://www.abc.com/12-12-12.html - http://www.abc.com/12-12-12 http://subdomain.abc.com/123.html - http://subdomain.abc.com/123 Basically removing the extension and ensuring that its www is intact.

    Read the article

  • Firefox fails to detect content type set by PHP

    - by Ying
    Hi all, I want a php page to 'display' a pdf. Here is the code: <?php header("Content-type: application/pdf"); readfile('Reportage - Berlin.pdf'); //tried echo(readfile(...)) as well ?> Not very complicated I think, but somehow firefox cant detect that this is a pdf. This works in Safari but in firefox, i get a prompt to download the file, so i get like a pdftest.php file. I know im getting my file because if I rename the extension to pdf, i can open it. This seems too simple! am i missing something?

    Read the article

  • How to trace a raw (character) device stream on Unix ?

    - by Fabien
    I'm trying to trace what is transiting in a raw (character) device on an Unix system (ex: /dev/tty.baseband) for DEBUG purpose. I am thinking of creating a deamon that would: upon start rename /dev/tty.baseband to /dev/tty.baseband.old. create a raw node /dev/tty.baseband spawn two threads: Thread 1: reading /dev/tty.baseband.old writing into /dev/tty.baseband Thread 2: reading /dev/tty.baseband writing into /dev/tty.baseband.old This would work a little bit like a MITM process. I wonder if there is not a 'standard' way to do this.

    Read the article

  • Trying to execute netdom.exe from a ruby script or IRB does nothing

    - by Joraff
    I'm trying to write a script that will rename a computer and join it to a domain, and was planning to call on netdom.exe to do the dirty work. However, trying to run this utility in the script (same results in irb) does absolutely nothing. No output, no execution. I tried with backticks and with the system() method. System() returns false for everything but system("netdom") (which returns true). Backticks never return anything but an empty string. I have verified that netdom runs and works in the environment the script will be running in, and I'm calling other command-line utilities earlier in the script that work (w32tm, getmac, ping). Here's the exact line that gets executed: `netdom renamecomputer %COMPUTERNAME% /NewName:#{newname} /force` FYI, This is windows 7 x64

    Read the article

  • What's the best way to change the namespace of a highly referenced class?

    - by vanslly
    I am attempting to move a highly referenced class from one namespace to another. Simply moving the file into the new project which has a different root namespace results in over 1100 errors throughout my solution. Some references to the class involve fully qualified namescape referencing and others involve the importing of the namespace. I have tried using a refactoring tool (Refactor Pro) to rename the namespace, in the hope all references to the class would change, but this resulted in the aforementioned problem. Anyone have ideas of how to tackle this challenge without needing to drill into every file manually and changing the fully qualified namespace or importing the new one if it doesn't exist already? Thanks.

    Read the article

  • Adding file of the same name into the same list and unable to update name of the SPFile

    - by BeraCim
    Hi all: I'm having difficulties adding file of the same name in the same list and subsequently updating/changing/modifying the name of a SPFile. Basically, this is what I'm trying to do: string fileName = "something"; // obtained from a loop -- loop omitted here. SPFile file = folder.Files.Add(fileName, otherFile.OpenBinary()); The Add method will generate a runtime exception when it finds another file of the same name in the same list/folder. So I thought of changing the file name later in the process: string newGuid = Guid.NewGuid().ToString(); SPFile file = folder.Files.Add(newGuid, otherFile.OpenBinary()); // some other processing... afterwards, rename the file file.name = fileName; file.Item.Update(); A few minute of googling indicated I need to either move the file around, or update the name field by using ["Name"] instead. I was wondering are there any other better ways to get around this problem? Thanks.

    Read the article

  • How do I switch to a SQL Server Server Database that will exist after another command?

    - by Jason Young
    I can't get this script to run, because SQL management studio 2008 says the table "NewName" does not exist. However, the script's purpose is to rename an existing database, so that it does exist when it gets to that line. Ideas? Use Master; ALTER DATABASE OldName SET SINGLE_USER WITH NO_WAIT; ALTER DATABASE OldName MODIFY NAME = NewName; ALTER DATABASE NewName SET MULTI_USER; Use NewName; --THIS LINE FAILS BEFORE THE SCRIPT EVEN RUNS!

    Read the article

  • How to import org.codehaus.groovy.scriptom.* on Groovy?

    - by Mulone
    Hi guys, I'm trying to run a Groovy app to manipulate Excel files on STS (by SpringSource) 2.3.0. My Groovy version is 1.7. Class: package com.mytool import org.codehaus.groovy.scriptom.ActiveXObject /** * @author Mulone * */ class SurveyTool { static main(args) { print 'test' def wshell = new ActiveXObject('Wscript.Shell') wshell.popup("Scriptom is Groovy") } } Sadly, this is what I get: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: C:\workspace\SurveyTool\src\com\geoadapta\surveytool\SurveyTool.groovy: 6: unable to resolve class org.codehaus.groovy.scriptom.ActiveXObject @ line 6, column 1. import org.codehaus.groovy.scriptom.ActiveXObject ^ 1 error I also tried to rename ActiveXObject to ActiveXProxy with the same result. I tried to import scriptom manually from the package scriptom-all-assembly-1.6.0 but I didn't work. Any idea? Cheers

    Read the article

  • how to clone a project on heroku

    - by rails_guy
    I have a project on heroku working fine. Now I want to create same project with different url (same code) as the one I have working now. So that I can give the new url to the customer as a 'test' site. I know in heroku i can just rename the url but I want to completely separate development from test (database wise). What is the best solution? Do I start from scratch? cd into new folder on my machine...clone project from github...make new database -test ...push to heroku...etc. etc.

    Read the article

  • Using Regex groups in bash

    - by AlexeyMK
    Greetings, I've got a directory with a list of pdfs in it: file1.pdf, file2.pdf, morestuff.pdf ... etc. I want to convert these pdfs to pngs, ie file1.png, file2.png, morestuff.png ... etc. The basic command is, convert from to, But I'm having trouble getting convert to rename to the same file name. The obvious 'I wish it worked this way' is convert *.pdf *.png But clearly that doesn't work. My thought process is that I should utilize regular expression grouping here, to say somethink like convert (*).pdf %1.png but that clearly isn't the right syntax. I'm wondering what the correct syntax is, and whether there's a better approach (that doesn't require jumping into perl or python) that I'm ignoring. Thanks!

    Read the article

  • Bitmap files added in .rc not listed in resource.h

    - by ame
    I added a large number of bitmap files to my MFC project in resource view (Visual Studio). However, the resource.h file does not list any of these files. I would want them to be listed with exactly the same name as they are added in .rc bitmap list (say the name is xxx) I want it listed as #define IDB_xxx If I try to click on the bitmap in the .rc list and import it, it gets listed as IDB_BITMAP1. Owing to the large number of files it is not feasible for me to manually rename them for use in my code.

    Read the article

  • ASP.NET MVC controllers with identical names

    - by Anton Gogolev
    Hi! Here's what I'm trying to do. I have an ASP.NET MVC web application, where I'd like to have a separate "admin" area (accessible via http://example.com/admin) and a regular area, available for all users. In both these parts of the site I have a /blogs section, but when accessing http://example.com/admin/blogs I want to be presented with admin interface for blogs, whereas usual http://example.com/blogs should just list all blogs. And the problem itself is: how do I get ASP.NET MVC to instantiate appropriate controllers, provided that there are two BlogsControllers: one in Site.Admin namespace, and the other is in Site.Sitefront namespace? Granted, I could rename admin controller to BlogsAdminController, but I'd like to keep the names as they already are.

    Read the article

  • PHP4 No Error When Missing Method is Called

    - by INTPnerd
    I have come across an annoying problem while writing some PHP4 code. I renamed the method of a class but I forgot to rename it where it was being called from. The annoying part is it was hard to track down where the problem was because no error was triggered. The script simply aborted leaving the web page partially rendered. Is it normal for this not to trigger an error or is there something wacky going on here? If this is normal is there a way to force this kind of thing to cause an error?

    Read the article

  • Can you add identity to existing column in sql server 2008?

    - by bmutch
    In all my searching I see that you essentially have to copy the existing table to a new table to chance to identity column for pre-2008, does this apply to 2008 also? thanks. most concise solution I have found so far: CREATE TABLE Test ( id int identity(1,1), somecolumn varchar(10) ); INSERT INTO Test VALUES ('Hello'); INSERT INTO Test VALUES ('World'); -- copy the table. use same schema, but no identity CREATE TABLE Test2 ( id int NOT NULL, somecolumn varchar(10) ); ALTER TABLE Test SWITCH TO Test2; -- drop the original (now empty) table DROP TABLE Test; -- rename new table to old table's name EXEC sp_rename 'Test2','Test'; -- see same records SELECT * FROM Test;

    Read the article

  • In django models, how to make all table names not have the app label?

    - by Luigi
    I have a database that was already being used by other applications before i began writing a web interface with django for it. The table names follow simple naming standards, so the django model Customer should map to the table "customer" in the db. At the same time I'm adding new tables/models. Since I find it cumbersome to use app_customer every time i have to write a query (django's ORM is definitely not enough for them) in the other applications and I don't want to rename the existing tables, what is the best way to make all models in my django app use tables without applabel_, besides adding a Meta class with db_table= to each model? Is there any reason why I shouldn't do this? I have only one web app that needs to access this db, everything else doesn't use django models.

    Read the article

  • Visual Studio massive renaming of controls in WPF project

    - by Mark
    I have a scene in my WPF project with about 2000 different user controls: <local:MyControlType x:name="aaka4sn9f" /> <local:MyControlType x:name="aaks22nf_1" /> <local:MyControlType x:name="aa66s2f_2" /> and so on down the screen... Is there a way to rename all of these controls using Visual Studio (and possibly a regex) to be: <local:MyControlType x:name="myControl1" /> <local:MyControlType x:name="myControl2" /> <local:MyControlType x:name="myControl3" /> ?? Thanks a lot!

    Read the article

  • Visual Studio: What approach do you use to 'template' plumbing for similiar projects?

    - by Sosh
    When building ASP.NET projects there is a certain amount of boilerplate, or plumbing that needs to be done, which is often identical across projects. This is especially the case with MVC and ALT.NET approaches. [I'm thinking of things such as: IoC, ORM, Solution structure (projects), Session Management, User Management, I18n etc.] I would like to know what approach you find best for 'reusing' this plumbing accross projects? Have a 'master solution' which you duplicate and rename somehow? (I'm using a this to a degree at the moment, but it's fairly messy. Would be interested how people do this 'better') Mainly rely on Shared Library projects? (I find this appropriate for some things, but too restrictive for things that have to be customised) Code generation tools, such as T4? (Similar to the approach used by SharpArchitecture - have not tried this myself) Something else? Thanks for sharing your experiences!

    Read the article

  • Delete temp file during finally vs delete output file during catch

    - by Russell
    This is in Java 6. I've seen more than once that people create temp files, do something, then rename it to the output file. Everything is wrapped in a try-finally block, where the temp file is deleted in finally in case something goes wrong in between. try { //do something with tempFile //do something with tempFile //do something with tempFile tempFile.renameTo(outputFile); } finally { if (tempFile.exists()) tempFile.delete() } I was wondering what are the benefits of doing that instead of doing something to the output file directly and delete it in case of exceptions. try { //do something with outputFile //do something with outputFile //do something with outputFile } catch (Exception e) { if (outputFile.exists()) outputFile.delete(); } My guess is that deleting temp files in finally benefits me when the try block can throw many kinds of exceptions. Is my guess right? What else?

    Read the article

  • Subversion has --record-only for merges, how do I do the same in Git ?

    - by Paul Hammant
    I have a repo where 'master' is going in a certain direction, and a second branch 'foo' is going to be divergent for a couple of commits, then track all subsequent changes to 'master' after that. This is all by choice of course. In Subversion you could do a --record-only merge to mark things as "merge has happened" even though no actual changes were committed. i.e. this change the merge-tracking numbers in properties attached to directories in the target branch. I have had a play with.. git merge --no-commit master .. as something I may be able to tinker with before I do the commit, but it is making a hell of a mess of the target branch for part of the change in question (rename followed by delete). There must be an easier way.. ? Paul

    Read the article

  • Changing folder names in Visual Studio when using SVN

    - by Piers Myers
    I am using VS2008/VS2010 with Resharper 5, TortoiseSVN 1.6.8.19260-x64, and AnkhSVN 2.1.8420.8. Most operations I do in Visual Studio are reflected fine in SVN, however, renaming folders in a project can cause problems when I try to submit my changes. Also all the namespaces in the C# source files under the renamed folder need to be updated to reflect the name change. What is the best way to rename the main project folder or any sub folders and ensure there are no issues with SVN? Should it be done outside Visual Studio? What is the best way to update all the namespace changes? Is search/replace the only way? Are there any best practices regarding folder names and their contents?

    Read the article

  • [C#] Array as DataSource of a DataGrid: how to customize columns?

    - by pbean
    In my Windows Mobile .NET application I have a simple array of object with the data I want to display in my DataGrid. To do this, I simply call: myDataGrid.DataSource = myArray; This works, but I have a problem with it: it uses all properties as columns and uses the names of the properties as the column headers. I can't figure out how to customize two things: Select which subset of properties should be displayed as columns (say I have an ID, Name and Value property, I'd only want to show Name and Value); Rename the column headers to make more sense (for example if the property is called ID display a column header saying "Number"). Is this possible at all? As mentioned this is in a Windows Mobile .NET (version 2) application.

    Read the article

  • link .a and .o files in GCC

    - by David
    hi! I have two precompiled library: X.a and Y.a and a test.cpp (without main function) source code use these two libraries. I compiled the C++ using: g++ -c test.cpp and I got 'test.o'. Now how can I link these three together to generate a .a file because test.cpp use some function in X.a and Y.a and other GCC libraries? BTW, I am doing these under Windows using MinGW. Can I rename this .a file to .lib and use this .lib in VC? Thanks!

    Read the article

< Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >