Search Results

Search found 14828 results on 594 pages for 'settings py'.

Page 23/594 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • Saving Proxy Settings from different networks

    - by elcool
    I go to different clients and they all have their networks with different proxy settings. So I'm always having to change the proxy settings and saving the info in a notebook, and it becomes a pain after a while. So, any good way to save all those proxies and have them recognize the network I'm on and load up? Currently I maintain two: one in IE for clients, and none in Firefox for when I'm at home. And I think the last network I was on asked me to save the proxy and I think it went to system settings. But I don't know much about networking.

    Read the article

  • Monitor Settings

    - by user171625
    I'm having some viewing issues when I plug my projector in to view video. At first, the video didn't appear through the projector, only the computer screen. The projector just showed the desktop. I restarted and tried again, and it worked at first, but then the picture from the streaming video would freeze (the audio continued working) and I could do nothing. I had to manually shut down the computer. This happened a few more times before I gave up. Is there anything I can do about this?

    Read the article

  • How to maintain different settings files in TFS

    - by aggietech
    I'm currently working on integrating the TFS source control system at my work ... I run into one small problem ... I need different version of web.config (among other config files) for different branches (due to the environment that we're releasing the web application to). (for example - i don't want to merge the web.config file all the time even though there are differences ...) Is there a good way to keep track of that (instead of manually diff-ing the files)? thanks!

    Read the article

  • Android launches system settings instead of my app

    - by jsundin
    Hi, For some reason whenever I (try to) start my app the phone decides to launch system settings instead of my "main activity". And yes, I am referring to the "Android system settings", and not something from my app. This only happens on my phone, and I suppose it probably could be related to the fact that my app had just opened system settings when I decided to re-launch with a new version from Eclipse. It is possible to start the app from within Eclipse, but when I navigate back from the app it returns to the system settings rather than the home screen, as if the settings activity was started first and then my activity. If I then start the app from the phone all I get is system settings yet again. The app is listening to the VIEW-action for a specific URL substring, and when I start the app using a matching URL I get the same result as when I start it from Eclipse, app starts, but when I return I return to settings. I have tried googling for this problem, and all I could find was something about Android saving state when an app gets killed, but without any information on how to reset this state. I have tried uninstalling the app, killing system settings, rebooting the phone, reinstalling, clearing application data.. no luck.. For what it's worth, here's the definition of my main activity from the manifest, <activity android:name=".HomeActivity" android:label="@string/app_name" android:screenOrientation="portrait" android:clearTaskOnLaunch="true" android:launchMode="singleTop"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"></action> <category android:name="android.intent.category.DEFAULT"></category> <category android:name="android.intent.category.BROWSABLE"></category> <data android:pathPrefix="/isak-web-mobile/smart/" android:scheme="http" android:host="*"></data> </intent-filter> </activity> And here is the logcat-line from when I try to start my app, nothing about any settings anywhere. I/ActivityManager( 1301): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=se.opencare.isak/.HomeActivity } When I launch from Eclipse I also get this line (as one would expect), I/ActivityManager( 1301): Start proc se.opencare.isak for activity se.opencare.isak/.HomeActivity: pid=23068 uid=10163 gids={3003, 1007, 1015} If it matters the phone is a HTC Desire Z running 2.2.1. Currently, this is my HomeActivity, public class HomeActivity extends Activity { public static final String TAG = "HomeActivity"; @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { Log.d(TAG, "onActivityResult(" + requestCode + ", " + resultCode + ", " + data + ")"); super.onActivityResult(requestCode, resultCode, data); } @Override protected void onCreate(Bundle savedInstanceState) { Log.d(TAG, "onCreate(" + savedInstanceState + ")"); super.onCreate(savedInstanceState); } @Override protected void onDestroy() { Log.d(TAG, "onDestroy()"); super.onDestroy(); } @Override protected void onPause() { Log.d(TAG, "onPause()"); super.onPause(); } @Override protected void onPostCreate(Bundle savedInstanceState) { Log.d(TAG, "onPostCreate(" + savedInstanceState + ")"); super.onPostCreate(savedInstanceState); } @Override protected void onPostResume() { Log.d(TAG, "onPostResume()"); super.onPostResume(); } @Override protected void onRestart() { Log.d(TAG, "onRestart()"); super.onRestart(); } @Override protected void onRestoreInstanceState(Bundle savedInstanceState) { Log.d(TAG, "onRestoreInstanceState(" + savedInstanceState + ")"); super.onRestoreInstanceState(savedInstanceState); } @Override protected void onResume() { Log.d(TAG, "onResume()"); super.onResume(); } @Override protected void onStart() { Log.d(TAG, "onStart()"); super.onStart(); } @Override protected void onStop() { Log.d(TAG, "onStop()"); super.onStop(); } @Override protected void onUserLeaveHint() { Log.d(TAG, "onUserLeaveHint()"); super.onUserLeaveHint(); } } Nothing (of the above) is written to the log.

    Read the article

  • Need help with yum,python and php in CentOS. (I made a complete mess!)

    - by pek
    Hello, a while back I wanted to install some plugins for Trac but it required python 2.5 I tried installing it (I don't remember how) and the only thing I managed was to have two versions of python (2.4 and 2.5). Trac still uses the old version but the console uses 2.5 (python -V = Python 2.5.2). Anyway, the problem is not python, the problem is yum (which uses python). I am trying to upgrade my PHP version from 5.1.x to 5.2.x. I tried following this tutorial but when I reach the step with yum I get this error: [root@XXX]# yum update Loading "installonlyn" plugin Setting up Update Process Setting up repositories Reading repository metadata in from local files Traceback (most recent call last): File "/usr/bin/yum", line 29, in ? yummain.main(sys.argv[1:]) File "/usr/share/yum-cli/yummain.py", line 94, in main result, resultmsgs = base.doCommands() File "/usr/share/yum-cli/cli.py", line 381, in doCommands return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds) File "/usr/share/yum-cli/yumcommands.py", line 150, in doCommand return base.updatePkgs(extcmds) File "/usr/share/yum-cli/cli.py", line 672, in updatePkgs self.doRepoSetup() File "/usr/share/yum-cli/cli.py", line 109, in doRepoSetup self.doSackSetup(thisrepo=thisrepo) File "/usr/lib/python2.4/site-packages/yum/init.py", line 338, in doSackSetup self.repos.populateSack(which=repos) File "/usr/lib/python2.4/site-packages/yum/repos.py", line 200, in populateSack sack.populate(repo, with, callback, cacheonly) File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 91, in populate dobj = repo.cacheHandler.getPrimary(xml, csum) File "/usr/lib/python2.4/site-packages/yum/sqlitecache.py", line 100, in getPrimary return self._getbase(location, checksum, 'primary') File "/usr/lib/python2.4/site-packages/yum/sqlitecache.py", line 86, in _getbase (db, dbchecksum) = self.getDatabase(location, metadatatype) File "/usr/lib/python2.4/site-packages/yum/sqlitecache.py", line 82, in getDatabase db = self.makeSqliteCacheFile(filename,cachetype) File "/usr/lib/python2.4/site-packages/yum/sqlitecache.py", line 245, in makeSqliteCacheFile self.createTablesPrimary(db) File "/usr/lib/python2.4/site-packages/yum/sqlitecache.py", line 165, in createTablesPrimary cur.execute(q) File "/usr/lib/python2.4/site-packages/sqlite/main.py", line 244, in execute self.rs = self.con.db.execute(SQL) _sqlite.DatabaseError: near "release": syntax error Any help? Thank you.

    Read the article

  • django: error while migrating from 1.1 to 1.2

    - by gruszczy
    I am trying to migrate our django project from 1.1 to 1.2, but I get following error: Traceback (most recent call last): File "./manage.py", line 11, in <module> execute_manager(settings) File "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", line 438, in execute_manager utility.execute() File "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 191, in run_from_argv self.execute(*args, **options.__dict__) File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 209, in execute translation.activate('en-us') File "/usr/local/lib/python2.6/dist-packages/django/utils/translation/__init__.py", line 66, in activate return real_activate(language) File "/usr/local/lib/python2.6/dist-packages/django/utils/functional.py", line 55, in _curried return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs)) File "/usr/local/lib/python2.6/dist-packages/django/utils/translation/__init__.py", line 36, in delayed_loader return getattr(trans, real_name)(*args, **kwargs) File "/usr/local/lib/python2.6/dist-packages/django/utils/translation/trans_real.py", line 193, in activate _active[currentThread()] = translation(language) File "/usr/local/lib/python2.6/dist-packages/django/utils/translation/trans_real.py", line 176, in translation default_translation = _fetch(settings.LANGUAGE_CODE) File "/usr/local/lib/python2.6/dist-packages/django/utils/translation/trans_real.py", line 159, in _fetch app = import_module(appname) File "/usr/local/lib/python2.6/dist-packages/django/utils/importlib.py", line 35, in import_module __import__(name) File "/home/gruszczy/Programy/bozorth/../bozorth/notifications/__init__.py", line 2, in <module> from django.db.models.signals import post_save File "/usr/local/lib/python2.6/dist-packages/django/db/__init__.py", line 75, in <module> connection = connections[DEFAULT_DB_ALIAS] File "/usr/local/lib/python2.6/dist-packages/django/db/utils.py", line 92, in __getitem__ conn = backend.DatabaseWrapper(db, alias) File "/usr/local/lib/python2.6/dist-packages/django/db/backends/sqlite3/base.py", line 154, in __init__ super(DatabaseWrapper, self).__init__(*args, **kwargs) TypeError: __init__() takes exactly 2 arguments (3 given) Anyone encountered this problem and know, how to solve?

    Read the article

  • Migration for creating and deleting model in South

    - by Almad
    I've created a model and created initial migration for it: db.create_table('tvguide_tvguide', ( ('id', models.AutoField(primary_key=True)), ('date', models.DateField(_('Date'), auto_now=True, db_index=True)), )) db.send_create_signal('tvguide', ['TVGuide']) models = { 'tvguide.tvguide': { 'channels': ('models.ManyToManyField', ["orm['tvguide.Channel']"], {'through': "'ChannelInTVGuide'"}), 'date': ('models.DateField', ["_('Date')"], {'auto_now': 'True', 'db_index': 'True'}), 'id': ('models.AutoField', [], {'primary_key': 'True'}) } } complete_apps = ['tvguide'] Now, I'd like to drop it: db.drop_table('tvguide_tvguide') However, I have also deleted corresponding model. South (at least 0.6.2) is however trying to access it: (venv)[almad@eva-03 project]$ ./manage.py migrate tvguide Running migrations for tvguide: - Migrating forwards to 0002_removemodels. > tvguide: 0001_initial Traceback (most recent call last): File "./manage.py", line 27, in <module> execute_from_command_line() File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line utility.execute() File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 303, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line 195, in run_from_argv self.execute(*args, **options.__dict__) File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line 222, in execute output = self.handle(*args, **options) File "/home/almad/projects/mypage-all/lib/python2.6/site-packages/south/management/commands/migrate.py", line 91, in handle skip = skip, File "/home/almad/projects/mypage-all/lib/python2.6/site-packages/south/migration.py", line 581, in migrate_app result = run_forwards(mapp, [mname], fake=fake, db_dry_run=db_dry_run, verbosity=verbosity) File "/home/almad/projects/mypage-all/lib/python2.6/site-packages/south/migration.py", line 388, in run_forwards verbosity = verbosity, File "/home/almad/projects/mypage-all/lib/python2.6/site-packages/south/migration.py", line 287, in run_migrations orm = klass.orm File "/home/almad/projects/mypage-all/lib/python2.6/site-packages/south/orm.py", line 62, in __get__ self.orm = FakeORM(*self._args) File "/home/almad/projects/mypage-all/lib/python2.6/site-packages/south/orm.py", line 45, in FakeORM _orm_cache[args] = _FakeORM(*args) File "/home/almad/projects/mypage-all/lib/python2.6/site-packages/south/orm.py", line 106, in __init__ self.models[name] = self.make_model(app_name, model_name, data) File "/home/almad/projects/mypage-all/lib/python2.6/site-packages/south/orm.py", line 307, in make_model tuple(map(ask_for_it_by_name, bases)), File "/home/almad/projects/mypage-all/lib/python2.6/site-packages/south/utils.py", line 23, in ask_for_it_by_name ask_for_it_by_name.cache[name] = _ask_for_it_by_name(name) File "/home/almad/projects/mypage-all/lib/python2.6/site-packages/south/utils.py", line 17, in _ask_for_it_by_name return getattr(module, bits[-1]) AttributeError: 'module' object has no attribute 'TVGuide' Is there a way around?

    Read the article

  • c# Unit Test: Writing to Settings in unit test does not save values in user.config

    - by HorstWalter
    I am running a c# unit test (VS 2008). Within the test I do write to the settings, which should result in saving the data to the user.config. Settings.Default.X = "History"; // X is string Settings.Default.Save(); But this simply does not create the file (I have crosschecked under "C:\Documents and Settings\HW\Local Settings\Application Data"). If I create the same stuff as a Console application, there is no problem persisting the data (same code). Is there something special I need to consider doing this in a UnitTest?

    Read the article

  • Change My.Settings ConnectionString in runtime?

    - by Sultanen
    I have a ClickOnce deployment where i have a INI-settings file on the network file with "global" settings that is supposed to affect the program on all client computers. The problem i have is that i whant to have the Database connectionString stored in this INI file and have it read and stored in the My.Settings ConnectionString at program startup. How do i do this? The ConnectionString setting is Application scoped and therefore Read-Only, if i try to set it by My.Settings("ConnectionString") = "Source=server;Initial Catalog=database;Integrated Security=True" I get a runtime error: An error occurred creating the form. See Exception.InnerException for details. The error is: The type initializer for 'DB_lib.DB_LINQ' threw an exception. [EDIT] I got rid of the error by using the My.Settings("ConnectionString") = "Source=server;Initial Catalog=database;Integrated Security=True" in another place then the the eventtriggerd settingsLoaded method i created.. The problem is that even though the connectionstring semes to be the right, the program still connects to the "default" database that is typed in to the app.config file??

    Read the article

  • Using file-path to images stored within the Application Settings

    - by Bill
    I am trying to develop an application that uses a number of images that are stored in a seperate remote file location. The file-paths to the UI elements are stored within the Application Settings. Although I understand how to access and use the file-path from Settings in C# (Properties.Settings.Default.pathToGridImages + "OK.png"), I am at a loss to figure out how to utilize the Settings paths in WPF, and can only seem to access the file if I include the file-path, such as: <Grid.Background> <ImageBrush ImageSource="C:\Skins\bottomfill.png" TileMode="Tile" /> </Grid.Background> I would have thought that concatenating "Properties.Settings.Default.pathToGridImages" with "bottomfill.png" in WPF could be done much like it can be done in C#. Can anyone please point me in the right direction?

    Read the article

  • Properties.Settings.Default.Default.Save() does not work

    - by Akshay
    I have created code in WPF to let the window remember its last location like this: private void Window_Loaded(object sender, RoutedEventArgs e) { try { Rect storedLoc = Properties.Settings.Default.WindowSavedLocation; this.Top = storedLoc.Top; this.Left = storedLoc.Left; } catch { MessageBox.Show("No settings stored !"); } } private void Window_Closed(object sender, EventArgs e) { Properties.Settings.Default.WindowSavedLocation = RestoreBounds; Properties.Settings.Default.Save(); } When I build the application I can see that the app.exe.config file has the setting WindowSavedLocation but it just does not save and throws no exception. Everytime I run the application, it says "No settings stored !". It's scope is user.

    Read the article

  • How to return settings from an object

    - by Rockbot
    i have done something like this: myProject = settings: duration: 500 value: 'aValue' aFunction: -> myElement.fadeOut myProject.settings.duration This is just a sample but my project is like that. A lot of times i have to reference to the settings to get a certain value, and i always have to write myProject.settings.value, and it doesn´t look good. My question is, can I call a function that returns the wanted value? Something like this? aFunction -> myElement.fadeOut getSetting(duration) I tried with getSetting: (param) -> myProject.settings.param but failed? Why is that? Thank you!

    Read the article

  • Runtime unhandled exception while executing facedetect.py in opencv

    - by Rupesh Chavan
    When i tried to execute facedetect.py python script from opencv sample example i got the following runtime exception. Can someone please give me some pointer or some clue about the exception and why it is encountering? Here is the stack trace : 'python.exe': Loaded 'C:\Python26\python.exe' 'python.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\python26.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\user32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\shell32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll' 'python.exe': Loaded 'C:\WINDOWS\WinSxS \x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_6f74963e\msvcr90.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\imm32.dll' 'python.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03\comctl32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\comctl32.dll' 'python.exe': Loaded 'C:\Python26\Lib\site-packages\opencv_cv.pyd', Binary was not built with debug information. 'python.exe': Loaded 'C:\OpenCV2.0\bin\libcv200.dll', Binary was not built with debug information. 'python.exe': Loaded 'C:\OpenCV2.0\bin\libcxcore200.dll', Binary was not built with debug information. 'python.exe': Loaded 'C:\Python26\Lib\site-packages\opencv_ml.pyd', Binary was not built with debug information. 'python.exe': Loaded 'C:\OpenCV2.0\bin\libml200.dll', Binary was not built with debug information. 'python.exe': Loaded 'C:\Python26\Lib\site-packages\opencv_highgui.pyd', Binary was not built with debug information. 'python.exe': Loaded 'C:\OpenCV2.0\bin\libhighgui200.dll', Binary was not built with debug information. 'python.exe': Loaded 'C:\WINDOWS\system32\ole32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\oleaut32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\avicap32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\winmm.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\version.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\msvfw32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\avifil32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\msacm32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\msctf.dll' 'python.exe': Loaded 'C:\OpenCV2.0\bin\libopencv_ffmpeg200.dll', Binary was not built with debug information. 'python.exe': Loaded 'C:\WINDOWS\system32\wsock32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\ws2_32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\ws2help.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\MSCTFIME.IME' Unhandled exception at 0x00e7e4e4 in python.exe: 0xC0000005: Access violation reading location 0xffffffff. Thanks a lot in advance, Rupesh Chavan

    Read the article

  • Binary data instead of actual image in C#

    - by acadia
    Hello, I am using the below mentioned library to create a barcode which is storing in a specified location as shown below: My question is, is there a way instead of saving it to a png file I get byte data? thanks Code39 code = new Code39("10090"); code.Paint().Save("c:/NewBARCODE.png", ImageFormat.Png); using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; using System.Diagnostics; namespace BarCode39 { public class Code39Settings { private int height = 60; public int BarCodeHeight { get { return height; } set { height = value; } } private bool drawText = true; public bool DrawText { get { return drawText; } set { drawText = value; } } private int leftMargin = 10; public int LeftMargin { get { return leftMargin; } set { leftMargin = value; } } private int rightMargin = 10; public int RightMargin { get { return rightMargin; } set { rightMargin = value; } } private int topMargin = 10; public int TopMargin { get { return topMargin; } set { topMargin = value; } } private int bottomMargin = 10; public int BottomMargin { get { return bottomMargin; } set { bottomMargin = value; } } private int interCharacterGap = 2; public int InterCharacterGap { get { return interCharacterGap; } set { interCharacterGap = value; } } private int wideWidth = 2; public int WideWidth { get { return wideWidth; } set { wideWidth = value; } } private int narrowWidth = 1; public int NarrowWidth { get { return narrowWidth; } set { narrowWidth = value; } } private Font font = new Font(FontFamily.GenericSansSerif, 12); public Font Font { get { return font; } set { font = value; } } private int codeToTextGapHeight = 10; public int BarCodeToTextGapHeight { get { return codeToTextGapHeight; } set { codeToTextGapHeight = value; } } } public class Code39 { #region Static initialization static Dictionary<char, Pattern> codes; static Code39() { object[][] chars = new object[][] { new object[] {'0', "n n n w w n w n n"}, new object[] {'1', "w n n w n n n n w"}, new object[] {'2', "n n w w n n n n w"}, new object[] {'3', "w n w w n n n n n"}, new object[] {'4', "n n n w w n n n w"}, new object[] {'5', "w n n w w n n n n"}, new object[] {'6', "n n w w w n n n n"}, new object[] {'7', "n n n w n n w n w"}, new object[] {'8', "w n n w n n w n n"}, new object[] {'9', "n n w w n n w n n"}, new object[] {'A', "w n n n n w n n w"}, new object[] {'B', "n n w n n w n n w"}, new object[] {'C', "w n w n n w n n n"}, new object[] {'D', "n n n n w w n n w"}, new object[] {'E', "w n n n w w n n n"}, new object[] {'F', "n n w n w w n n n"}, new object[] {'G', "n n n n n w w n w"}, new object[] {'H', "w n n n n w w n n"}, new object[] {'I', "n n w n n w w n n"}, new object[] {'J', "n n n n w w w n n"}, new object[] {'K', "w n n n n n n w w"}, new object[] {'L', "n n w n n n n w w"}, new object[] {'M', "w n w n n n n w n"}, new object[] {'N', "n n n n w n n w w"}, new object[] {'O', "w n n n w n n w n"}, new object[] {'P', "n n w n w n n w n"}, new object[] {'Q', "n n n n n n w w w"}, new object[] {'R', "w n n n n n w w n"}, new object[] {'S', "n n w n n n w w n"}, new object[] {'T', "n n n n w n w w n"}, new object[] {'U', "w w n n n n n n w"}, new object[] {'V', "n w w n n n n n w"}, new object[] {'W', "w w w n n n n n n"}, new object[] {'X', "n w n n w n n n w"}, new object[] {'Y', "w w n n w n n n n"}, new object[] {'Z', "n w w n w n n n n"}, new object[] {'-', "n w n n n n w n w"}, new object[] {'.', "w w n n n n w n n"}, new object[] {' ', "n w w n n n w n n"}, new object[] {'*', "n w n n w n w n n"}, new object[] {'$', "n w n w n w n n n"}, new object[] {'/', "n w n w n n n w n"}, new object[] {'+', "n w n n n w n w n"}, new object[] {'%', "n n n w n w n w n"} }; codes = new Dictionary<char, Pattern>(); foreach (object[] c in chars) codes.Add((char)c[0], Pattern.Parse((string)c[1])); } #endregion private static Pen pen = new Pen(Color.Black); private static Brush brush = Brushes.Black; private string code; private Code39Settings settings; public Code39(string code) : this(code, new Code39Settings()) { } public Code39(string code, Code39Settings settings) { foreach (char c in code) if (!codes.ContainsKey(c)) throw new ArgumentException("Invalid character encountered in specified code."); if (!code.StartsWith("*")) code = "*" + code; if (!code.EndsWith("*")) code = code + "*"; this.code = code; this.settings = settings; } public Bitmap Paint() { string code = this.code.Trim('*'); SizeF sizeCodeText = Graphics.FromImage(new Bitmap(1, 1)).MeasureString(code, settings.Font); int w = settings.LeftMargin + settings.RightMargin; foreach (char c in this.code) w += codes[c].GetWidth(settings) + settings.InterCharacterGap; w -= settings.InterCharacterGap; int h = settings.TopMargin + settings.BottomMargin + settings.BarCodeHeight; if (settings.DrawText) h += settings.BarCodeToTextGapHeight + (int)sizeCodeText.Height; Bitmap bmp = new Bitmap(w, h, PixelFormat.Format32bppArgb); Graphics g = Graphics.FromImage(bmp); int left = settings.LeftMargin; foreach (char c in this.code) left += codes[c].Paint(settings, g, left) + settings.InterCharacterGap; if (settings.DrawText) { int tX = settings.LeftMargin + (w - settings.LeftMargin - settings.RightMargin - (int)sizeCodeText.Width) / 2; if (tX < 0) tX = 0; int tY = settings.TopMargin + settings.BarCodeHeight + settings.BarCodeToTextGapHeight; g.DrawString(code, settings.Font, brush, tX, tY); } return bmp; } private class Pattern { private bool[] nw = new bool[9]; public static Pattern Parse(string s) { Debug.Assert(s != null); s = s.Replace(" ", "").ToLower(); Debug.Assert(s.Length == 9); Debug.Assert(s.Replace("n", "").Replace("w", "").Length == 0); Pattern p = new Pattern(); int i = 0; foreach (char c in s) p.nw[i++] = c == 'w'; return p; } public int GetWidth(Code39Settings settings) { int width = 0; for (int i = 0; i < 9; i++) width += (nw[i] ? settings.WideWidth : settings.NarrowWidth); return width; } public int Paint(Code39Settings settings, Graphics g, int left) { #if DEBUG Rectangle gray = new Rectangle(left, 0, GetWidth(settings), settings.BarCodeHeight + settings.TopMargin + settings.BottomMargin); g.FillRectangle(Brushes.Gray, gray); #endif int x = left; int w = 0; for (int i = 0; i < 9; i++) { int width = (nw[i] ? settings.WideWidth : settings.NarrowWidth); if (i % 2 == 0) { Rectangle r = new Rectangle(x, settings.TopMargin, width, settings.BarCodeHeight); g.FillRectangle(brush, r); } x += width; w += width; } return w; } } } }

    Read the article

  • Create a custom shortcut that types clipboard contents

    - by briankb
    I want to paste my clipboard contents to a remote session such as VNC, IPMI, or Raritan. To accomplish this, I installed xdotool and clip. Then I wrote a simple command that types the clipboard contents: xdotool type "$(xclip -o)" This works if I stay in a terminal window, and type that command myself. It types back my clipboard contents when I run the command. Of course now I want to make this into a hotkey that works in any window. However, if I create a custom shortcut using Keyboard settings, it doesn't work. If I assign a hotkey Alt+K to the shortcut, nothing happens when I press it. If I use Ctrl+K, unexpected behavior occurs to whatever window has focus. e.g. my terminal window size shrinks (it's somewhat amusing, actually). Similar results occur if I save it as a script and call the script, or if I encapsulate the command with sh -c. How can I make practical use of the powerful xdotool type command?

    Read the article

  • Option Button in Keyboard Layout > Input Sources is not pressable

    - by user98647
    I would like to set the Caps-lock key as a Compose key, which you do, as far as I remember, by pressing the Options Button in Keyboard Layout Input Sources and then enabling the appropriate option there. That Button is not pressable though since I switched to 12.10. It did work in previous releases of Ubuntu. gnome-control-center puts out these errors, when I click on Keyboard Layout: (gnome-control-center:3645): common-cc-panel-WARNING **: Could not find current language '?\u0003C!\u007f' in the treeview (gnome-control-center:3645): common-cc-panel-WARNING **: locale '"en_US.UTF-8"' isn't valid I'm not sure if the errors are related though, maybe they are related to the "interface switching to chinese bug" which seems surprisingly widespread: Language changed to Chinese, how do I change it back? Language Support has an unwanted Chinese language option Nautilus Folders Turned Chinese Desktop 12.04 gnome/cairo suddenly in Chinese Unwanted Chinese language got set in system settings I cannot set my system back to English from Chinese Language Gnome-classic language turned into Chinese, how do I change it back to English? Strange display language in gnome shell I'm not sure they are related to this bug, but I just wanted to mention it, maybe it helps!

    Read the article

  • Creating Array of settings names and values using ADO.NET Entities

    - by jordan.baucke
    I'm using an ADO.NET Entities (.edmx) data-model along with MVC2 to build an application. I have a DB table where I want to store settings for method that run elsewhere. MVC2 allows me to create a view, editor, etc. to update this table which is great, but now when I want to do simple assignments based on column titles I'm a bit confused. For example, I would like to easily build an array that I could offset into the record's value based on it's "Title" Column: var entities = new ManagerEntities(); Setting[] settings = entities.settings.ToArray(); This returns something like: Settings[0].[SettingTitle][SettingValue] However, I would like to more easily index into the value than having to loop through all the returned settings, when they're already index. string URL_ID_NEED = [NeededUrl][http://www.url.com] Am I missing something relatively simple? Thanks! ========================= *Update* ========================= Ok, I think I've got a solution, but I'm wondering why this would be so complicated, and if I'm just not thinking of the right context for ADO.NET objects, here's what I did: public string GetSetting(string SettingName) { var entities = new LabelManagerEntities(); IEnumerable<KeyValuePair<string, object>> entityKeyValues = new KeyValuePair<string, object>[] { new KeyValuePair<string, object>("SettingTitle", SettingName) }; EntityKey key = new EntityKey("LabelManagerEntities.Settings", entityKeyValues); // Get the object from the context or the persisted store by its key. Setting settingvalue = (Setting)entities.GetObjectByKey(key); return settingvalue.SettingValue.ToString(); } This method handles the job of querying the Entities by "Key" to get back the correct value as a returned string (which I can than strip out the " ", or or cast to an integer, etc. etc.,) Am I just duplicating functionality that already exists in ADO.NET's design patterns (I'm pretty new to it) -- or is this a reasonable solution?

    Read the article

  • windows xp mode for windows 7 - save text input language settings

    - by Gero
    When I change the 'default language' in 'text services and input languages' in windows xp mode from EN-US to DE-DE the settings are reverted with the next logoff / reboot - EN-US is the default language again. Is there a way around this behaviour? I'm using the default 'XPMUser' in windows xp mode. I also checked 'turn off advanced text services' and disabled the language bar and windows xp remembers these settings - just not the default language..

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >