Daily Archives

Articles indexed Sunday December 26 2010

Page 9/23 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • How does Rails find models and controllers? How can I get it to load more models?

    - by David
    I'm trying to create a non-ActiveRecord model in app/models/gamestate.rb. Then inside my controller (PlayController) I should be able to do GameState.new, right? No go: NameError (uninitialized constant PlayController::GameState): app/controllers/play_controller.rb:23:in `play' (at least in the development environment) But! If I do have a model called app/models/play.rb, then it's automatically loaded and I can do Play.new. So my question is: how does Rails know which classes to load? What sort of name mangling does it do to get from play#action to PlayController to app/controllers/play_controller.rb to app/models/play.rb? It seems awfully fragile, but maybe a better understanding of how this works would help. And finally, how can I get it to load app/models/gamestate.rb?

    Read the article

  • Help with Event-Based Components

    - by Joel in Gö
    I have started to look at Event-Based Components (EBCs), a programming method currently being explored by Ralf Wesphal in Germany, in particular. This is a really interesting and promising way to architect a software solution, and gets close to the age-old idea of being able to stick software components together like Lego :) A good starting point is the Channel 9 video here, and there is a fair bit of discussion in German at the Google Group on EBCs. I am however looking for more concrete examples - while the ideas look great, I am finding it hard to translate them into real code for anything more than a trivial project. Does anyone know of any good code examples (in C# preferably), or any more good sites where EBCs are discussed?

    Read the article

  • Ant: How to force java compilation if classpath jars have changed but sources have not

    - by Ittai
    Hi, I have the following usecase: I have a java project (myProj) which uses a common.jar from a different project(common). I want the javac ant task to work even if the sources of myProj have not changed if the common.jar has changed (as the sources of myProj depend of it and might be invalid now). I have a task which copies the common.jar from a central location to the myProj lib if it has changed and I can use it to set a property whether or not to "force" compilation so that end is taken care of. I'm not sure how (or if) I can tell the javac task to try and compile anyway? I don't want to change myProj's sources (or timestamps) so that the task will start. Excerpt from the ant build.xml file: <path id="project.class.path"> <pathelement location... /> ... <fileset dir="lib" includes="**/*.jar" /> </path> <target name="copyLibs" > <copy file="${central.loc}/common.jar" todir="lib" /> ... </target> <target name="javac" > <javac srcdir="src" includes="**" excludes=... > <classpath refid="project.class.path"/> </javac> </target> Thanks in advance, Ittai

    Read the article

  • Writing complex records to file

    - by DrSobhani
    Hi I have defined some records in my project which may be consisted of other records and also dynamic arrays of normal data types and other records , it is n example of a record type Type1=record x:integer; end; Type2=record Y:array of X; str:string; end; When I tried to save one of variables of these records type to file with blockwrite function like this : var Temp1:Type2; begin setlength(temp1.y,100); blockwrite(MyFile,Temp1,sizeOf(Temp1); it just wrote as much as the size of pure record is ,but temp1 has a dynmic arrays which is resized , Could someone please tell me how I can write a complex record to a file , I mean something like what is used in VB6 . Thanks

    Read the article

  • Zend autloading different namespaces from the same directory?

    - by Sled
    Hey guys, I have a models directory in my project, and I would like to save/files classes there with different namespaces. Example: models/User.php with classname Model_User models/Table_User.php with classname Model_Table_User For the first namespace I have this in bootstrap.php $resourceLoader->addResourceTypes(array( 'model' => array( 'namespace' => 'Model', 'path' => 'models' ) )); I can't figure out how to add the second namespace so it detects files starting with Table_ Any ideas? For now I've added a second directory named 'tables' but it's getting confusing because I have each model name twice (once in the models diretory and once in the tables directory)

    Read the article

  • compilation of image stitching code in matlab

    - by chee
    i am facing lots of problems while running code for image stitching given at this link http://se.cs.ait.ac.th/cvwiki/matlab:tutorial:image_stitching_from_high-view_images_using_homography may i get help regarding this type of problems here. EDIT: Image stitching code fails with the following message: ??? Undefined function or variable 'x2'. Error in ==compute_direct_homography at 26 amplified_x2=x2.*repmat([diagonal_ratio(x1,x2) diagonal_ratio(x1,x2) 1]',1,size(x2,2)); %assumption 1degree of lat and long =110,000 meters refer wiki Error in == project at 3 compute_direct_homography;

    Read the article

  • POS Desktop Application using DB or Localfiles ? using WPF

    - by Panindra
    I am planning to build a POS Application for my shop. I have enough knowledge to build the application using DB and also using local files( system.IO - binary files ) to store and access the data for my application. But , i have no deployment experience and confused in choosing data storing option. Database using MDF may be good option ( may ease plenty of coding ) but i don't want to have SQL server on my desktop. as i am using WPF for building , my concern is that my application may get slow due to server response and design rendering of WPF. Then i tried to use only local data (binary files) to store the data and retrive using class and objects. but this coding is taking lot of time , so in the middle of the process i struck in the dilemma of going back to Database . Please help , for performance wise whic one is better . and in Practical World ,in professional applications which one is widely using .. please give suggestions ..

    Read the article

  • mysql is not using multiple cpus

    - by helpmhost
    Hi, Our MySQL server has been using a lot of CPU lately (it's reached 100% several times and stays there for a while) and I noticed that it the CPU load is all on one core of one cpu. I was hoping to spread that out to all 4 on my server. I have been tweaking the MySQL settings to use more ram and less cpu, but it still occasionally reaches very high CPU usage. It seems like everything about the topic refers to thread_concurrency (which I've read is a solaris only setting). What can I do in Linux? Thanks.

    Read the article

  • Change permission of files with the owner 'apache'

    - by Dotty
    Hay, i have some files on my server with the owner set to "apache", I'm not quite sure how this happened. Anyway, i need to change the permission of these files to 0777 so i can download/edit them. However i cannot. I'm using a 1and1 Linux server and use Plesk to administrate it. I have the ability to login via SSH. However, if i run chmod or chown i get a "permission denied" error, and if i try to sudo chmod or chown it says the command cannot be found. When i go to edit my domain details, i get this option Shell access to server with FTP user's credentials and have these options /bin/sh /bin/bash /sbin/nologin /bin/bash (chrooted) /bin/rbash Any idea's how i should go about changing the permissions or changing the owner? Thanks

    Read the article

  • XenServer 5.6.1-fp1. Can't get network working

    - by bakytn
    I have a PC where XenServer 5.6.1 fp-1 has been successfully installed. I've manually set the network settings: 192.168.1.50 255.255.255.0 192.168.1.1 but it's set to xenbr0 iface. While eth0 is empty. When I click on "Configure Management Inteface" it shows that eth0 is connected. But when I ping a default gateway (which is 100% should be accessible) it fails. I used to another shell (Alt+F3) and logged as root. I also failed to ping. with both: ping -I eth0 192.168.1.1 and ping -I xenbr0 192.168.1.1 Be assured that: Cable works Ethernet adapter is 100% functional (prev OS was Ubuntu it was working) There is no firewall rule to deny anything. (everything is allowed)

    Read the article

  • Tunneling over HTTP

    - by Morgan
    Hello, I have a network at work that is locked behind a firewall and Internet connection is available only by using a proxy server. At work, I can connect to databases that are distributed across the network. However, at home, I cannot connect to the proxy server or the databases. How can this be done? I can access my workstation via LogMeIn, so I can install anything on it. I thought of installing some kind of tunneling mechanism in my workstation. Then, at home, I could connect to this mechanism, which would in turn do the required connections. So essentially, what I'd like to do can be represented by the following diagram: Home = Workstation = Database. For example, whenever I connect to, say, 10.140.0.1:1234 at home, this would be redirected to 10.140.0.1:1234 of my Workstation, because 10.140.0.1:1234 is only available through the corporate network. NOTE: I'm using Windows XP.

    Read the article

  • DXVA and ATI.... what am I missing?

    - by Shiki
    ATI Radeon HD3650 ffdshow (the one comes with CCCP 2010-10 AND the latest from Free-codecs site) Catalyst 10.12 Latest DirectX, Windows 7 HP x64 If I try to play it simply, the player (mpc-hc) won't use the acceleration. If I disable checks, I get artifacts. Back then it worked perfectly with my Intel and ATI too (Lenovo ThinkPad T500, switchable graphics). This only appeared recently. What should I do? What am I missing? If possible, I don't really want to downgrade drivers (waaa ATI drivers s.ck ... sorry but.. honestly), because the older one got a buggy DP driver so my external display gets a totally wrong resolution. Info about the media file: Video: Format : AVC Format/Info : Advanced Video Codec Format profile : [email protected] Codec ID : V_MPEG4/ISO/AVC Writing library : x264 core 88 r1462 7fcffde Encoding settings : cabac=1 / ref=8 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=8 / psy=1 / psy_rd=0.80:0.20 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-3 / threads=3 / sliced_threads=0 / nr=0 / decimate=1 / mbaff=0 / constrained_intra=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / wpredb=1 / wpredp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=16.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00 The sample file I'm testing at the moment: [Coalgirls]_Kiddy_Girl-and_01_(1920x1080_Blu-Ray_FLAC)_[91428679].mkv (I tried many x264 files, no use.) Artifacts

    Read the article

  • bash: per-command history. How does it work?

    - by romainl
    OK. I have an old G5 running Leopard and a Dell running Ubuntu 10.04 at home and a MacPro also running Leopard at work. I use Terminal.app/bash a lot. On my home G5 it exhibits a nice feature: using ? to navigate history I get the last command starting with the few letters that I've typed. This is what I mean (| represents the caret): $ ssh user@server $ vim /some/file/just/to/populate/history $ ss| So, I've typed the two first letters of "ssh", hitting ? results in this: $ ssh user@server instead of this, which is the behaviour I get everywhere else : $ vim /some/file/just/to/populate/history If I keep on hitting ? or ?, I can navigate through the history of ssh like this: $ ssh otheruser@otherserver $ ssh user@server $ ssh yetanotheruser@yetanotherserver It works the same for any command like cat, vim or whatever. That's really cool. Except that I have no idea how to mimic this behaviour on my other machines. Here is my .profile: export PATH=/Developer/SDKs/flex_sdk_3.4/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/sw/bin:/sw/sbin:/bin:/sbin:/bin:/sbin:/usr/bin:/usr/sbin:$HOME/Applications/bin:/usr/X11R6/bin export MANPATH=/usr/local/share/man:/usr/local/man:opt/local/man:sw/share/man export INFO=/usr/local/share/info export PERL5LIB=/opt/local/lib/perl5 export PYTHONPATH=/opt/local/bin/python2.7 export EDITOR=/opt/local/bin/vim export VISUAL=/opt/local/bin/vim export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home export TERM=xterm-color export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32' export CLICOLOR=1 export LS_COLORS='no=00:fi=00:di=01;34:ln=target:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.deb=00;31:*.rpm=00;31:*.TAR=00;31:*.TGZ=00;31:*.ARJ=00;31:*.TAZ=00;31:*.LZH=00;31:*.ZIP=00;31:*.Z=00;31:*.Z=00;31:*.GZ=00;31:*.BZ2=00;31:*.DEB=00;31:*.RPM=00;31:*.jpg=00;35:*.png=00;35:*.gif=00;35:*.bmp=00;35:*.ppm=00;35:*.tga=00;35:*.xbm=00;35:*.xpm=00;35:*.tif=00;35:*.png=00;35:*.fli=00;35:*.gl=00;35:*.dl=00;35:*.psd=00;35:*.JPG=00;35:*.PNG=00;35:*.GIF=00;35:*.BMP=00;35:*.PPM=00;35:*.TGA=00;35:*.XBM=00;35:*.XPM=00;35:*.TIF=00;35:*.PNG=00;35:*.FLI=00;35:*.GL=00;35:*.DL=00;35:*.PSD=00;35:*.mpg=00;36:*.avi=00;36:*.mov=00;36:*.flv=00;36:*.divx=00;36:*.qt=00;36:*.mp4=00;36:*.m4v=00;36:*.MPG=00;36:*.AVI=00;36:*.MOV=00;36:*.FLV=00;36:*.DIVX=00;36:*.QT=00;36:*.MP4=00;36:*.M4V=00;36:*.txt=00;32:*.rtf=00;32:*.doc=00;32:*.odf=00;32:*.rtfd=00;32:*.html=00;32:*.css=00;32:*.js=00;32:*.php=00;32:*.xhtml=00;32:*.TXT=00;32:*.RTF=00;32:*.DOC=00;32:*.ODF=00;32:*.RTFD=00;32:*.HTML=00;32:*.CSS=00;32:*.JS=00;32:*.PHP=00;32:*.XHTML=00;32:' export LC_ALL=C export LANG=C stty cs8 -istrip -parenb bind 'set convert-meta off' bind 'set meta-flag on' bind 'set output-meta on' alias ip='curl http://www.whatismyip.org | pbcopy' alias ls='ls -FhLlGp' alias la='ls -AFhLlGp' alias couleurs='$HOME/Applications/bin/colors2.sh' alias td='$HOME/Applications/bin/todo.sh' alias scale='$HOME/Applications/bin/scale.sh' alias stree='$HOME/Applications/bin/tree' alias envoi='$HOME/Applications/bin/envoi.sh' alias unfoo='$HOME/Applications/bin/unfoo' alias up='cd ..' alias size='du -sh' alias lsvn='svn list -vR' alias jsc='/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc' alias asl='sudo rm -f /private/var/log/asl/*.asl' alias trace='tail -f $HOME/Library/Preferences/Macromedia/Flash\ Player/Logs/flashlog.txt' alias redis='redis-server /opt/local/etc/redis.conf' source /Users/johncoltrane/Applications/bin/git-completion.sh export GIT_PS1_SHOWUNTRACKEDFILES=1 export GIT_PS1_SHOWUPSTREAM="verbose git" export GIT_PS1_SHOWDIRTYSTATE=1 export PS1='\n\[\033[32m\]\w\[\033[0m\] $(__git_ps1 "[%s]")\n\[\033[1;31m\]\[\033[31m\]\u\[\033[0m\] $ \[\033[0m\]' mkcd () { mkdir -p "$*" cd "$*" } function cdl { cd $1 la } n() { $EDITOR ~/Dropbox/nv/"$*".txt } nls () { ls -c ~/Dropbox/nv/ | grep "$*" } copy(){ curl -s -F 'sprunge=<-' http://sprunge.us | pbcopy } if [ -f /opt/local/etc/profile.d/cdargs-bash.sh ]; then source /opt/local/etc/profile.d/cdargs-bash.sh fi if [ -f /opt/local/etc/bash_completion ]; then . /opt/local/etc/bash_completion fi Any idea?

    Read the article

  • PDF Encrypted, Hidden Watermark

    - by Dave Jarvis
    Background Using LaTeX to write a book. When a user purchases the book, the PDF will be generated automatically. Problem The PDF should have a watermark that includes the person's name and contact information. Question What software meets the following criteria: Applies encrypted, undetectable watermarks to a PDF Open Source Platform independent (Linux, Windows) Fast (marks a 200 page PDF in under 1 second) Batch processing (exclusively command-line driven) Collusion-attack resistant Non-fragile (e.g., PDF - EPS - PDF still contains the watermark) Well documented (shows example usages) Ideas & Resources Some thoughts and findings: Natural language processing (NLP) watermarks. Apply steganography on a randomly selected image. http://openstego.sourceforge.net/cmdline.html The problem with NLP is that grammatical errors can be introduced. The problem with steganography is that the images are sourced from an image cache, and so recreating that cache with watermarked images will impart a delay when generating the PDF (I could just delete one image from the cache, but that's not an elegant solution). Thank you!

    Read the article

  • Use format strings that contain %1, %2 etc. instead of %d, %s etc. - Linux, C++

    - by rursw1
    Hello, As a follow-up of this question (Message compiler replacement in Linux gcc), I have the following problem: When using MC.exe on Windows for compiling and generating messages, within the C++ code I call FormatMessage, which retrieves the message and uses the va_list *Arguments parameter to send the varied message arguments. For example: messages.mc file: MessageId=1 Severity=Error SymbolicName=MULTIPLE_MESSAGE_OCCURED Language=English message %1 occured %2 times. . C++ code: void GetMsg(unsigned int errCode, wstring& message,unsigned int paramNumber, ...) { HLOCAL msg; DWORD ret; LANGID lang = GetUserDefaultLangID(); try { va_list argList; va_start( argList, paramNumber ); const TCHAR* dll = L"MyDll.dll"; _hModule = GetModuleHandle(dll); ret =::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_HMODULE|FORMAT_MESSAGE_IGNORE_INSERTS, _hModule, errCode, lang, (LPTSTR) &msg, 0, &argList ); if ( 0 != ret ) { unsigned int count = 0 ; message = msg; if (paramNumber>0) { wstring::const_iterator iter; for (iter = message.begin();iter!=message.end();iter++) { wchar_t xx = *iter; if (xx ==L'%') count++; } } if ((count == paramNumber) && (count >0)) { ::LocalFree( msg ); ret =::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_HMODULE, _hModule, errCode, GetUserDefaultLangID(), (LPTSTR) &msg, 0, &argList ); } else if (count != paramNumber) { wstringstream tmp; wstring messNumber; tmp << (errCode & 0xFFFF); tmp >> messNumber; message = message +L"("+ messNumber + L"). Bad Format String. "; } } ::LocalFree( msg ); } catch (...) { message << L"last error: " << GetLastError(); } va_end( argList ); } Caller code: wstring message; GetMsg(MULTIPLE_MESSAGE_OCCURED, message,2, "Error message", 5); Now, I wrote a simple script to generate a .msg file from the .mc file, and then I use gencat to generate a catalog from it. But is there a way to use the formatted strings as they contain %1, %2, etc. and NOT the general (%d, %s...) format? Please note, that the solution has to be generic enough for each possible message with each posible types\ arguments order... Is it possible at all? Thank you.

    Read the article

  • Paypal Error - IPN Validation Failed.

    - by user504178
    Hello , I am getting below error. [12/26/2010 5:48 AM] - FAIL: IPN Validation Failed. IPN POST Vars from Paypal: auth=A76zglTH7sCSLAVjZISTEp38SYXWAoNlO1uurxDvnlFy40uy-mlrvqkp_S5q3bFhVBbO2GwpJRvdYDvfQuM0581EYkEITS1SnDzfWV-ju60OZm_VzHsc8o2Q8K7mmZuDs9ANFwW9iIP2Ig8fGPSwZN8APK2PtCMIda28rBnNMJ2FWaeNKgmzTCuG5HnpzLD7ZtTCElp4MC05kyx9Ro-9ggqzVx7OU1zleJ_c1W, form_charset=UTF-8, IPN Response from Paypal Server: HTTP/1.1 200 OK Date: Sun, 26 Dec 2010 10:48:50 GMT Server: Apache Set-Cookie: c9MWDuvPtT9GIMyPc3jwol1VSlO=Ejohjh-kFgFpKAeNiYlgG8LwsLOi5Sir4Ut7tXINWaRmWM2eNXfFkJRQmO09WqBbXWIpXd0ydzrS7JMWO0sHZMg0Wfdd4gt6UcpSswiiUl2EfiP_ykxKJOFOzcjMrn_6xzc8GG%7c5mvwkJOzeFg-vpKR1fovKAVDyvmzI5sFbPatUC6gbf9Wk4Llel4btOJa7uQbYSLhuprHVG%7c537g5xvn4Hns8l-HE1pnyQ2GUAxcSINm-oVJENMuU6yS_bYa4IAw4QlGP-0zq80pjZa5j0%7c1293360531; domain=.paypal.com; path=/ Set-Cookie: cookie_check=yes; expires=Wed, 23-Dec-2020 10:48:51 GMT; domain=.paypal.com; path=/ Set-Cookie: navcmd=_notify-validate; domain=.paypal.com; path=/ Set-Cookie: navlns=0.0; expires=Sat, 21-Dec-2030 10:48:51 GMT; domain=.paypal.com; path=/ Set-Cookie: Apache=10.191.196.11.222161293360530699; path=/; expires=Sat, 12-Nov-04 04:20:34 GMT Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=UTF-8 7 INVALID 0 Can anyone please let me know whats wrong over here. Regards, Atul

    Read the article

  • WPF Treeview: How to display rounded border around the selected item?

    - by chikak
    I am trying to set the rounded border around the selected item of the treeview (like the one in the windows explorer on Vista). The problem is that the trigger in the following code doesn't seem to be working. It looks like the IsSelected property is always false. <TreeView x:Name="m_treeView" BorderThickness="0" d:LayoutOverrides="Width, Height"> <TreeView.Resources> <Style TargetType="TreeViewItem"> <Style.Resources> <Brush x:Key="{x:Static SystemColors.HighlightBrushKey}">Transparent</Brush> </Style.Resources> </Style> </TreeView.Resources> <TreeView.ItemTemplate> <HierarchicalDataTemplate DataType="{x:Type local:DirectoryPresentationBase}" ItemsSource="{Binding Children}"> <TreeViewItem> <TreeViewItem.Header> <Border Name="SelectedBorder" CornerRadius="3" Background="#EFF8FD" BorderBrush="#99DEFD" BorderThickness="1" > <StackPanel Orientation="Horizontal"> <interactivity:Interaction.Behaviors> <local:TreeViewExpandBehavior AssociatedTreeView="{Binding ElementName=m_treeView}"/> </interactivity:Interaction.Behaviors> <Image x:Name="img" Width="24" Height="16" Stretch="None" Source="{Binding SmallIcon}"/> <TextBlock Text="{Binding Name}" Margin="5,0" /> </StackPanel> </Border> </TreeViewItem.Header> </TreeViewItem> <HierarchicalDataTemplate.Triggers> <Trigger Property="TreeViewItem.IsSelected" Value="True"> <Setter Property="Background" TargetName="SelectedBorder" Value="Red"/> <Setter Property="BorderBrush" TargetName="SelectedBorder" Value="Green"/> </Trigger> <Trigger Property="TreeViewItem.IsSelected" Value="False"> <Setter Property="Background" TargetName="SelectedBorder" Value="Transparent"/> <Setter Property="BorderBrush" TargetName="SelectedBorder" Value="Transparent"/> </Trigger> </HierarchicalDataTemplate.Triggers> </HierarchicalDataTemplate> </TreeView.ItemTemplate> </TreeView>

    Read the article

  • should I put the jar dependancies on the sahred repo or just the source files ?

    - by ashy_32bit
    We have a Scala project with few source files (in Scala and Java) and quite some dependencies in various binary formats (jar and DLL). I'm wondering what should go into our shared git repo. Only the source files (developers have to download or somehow resolve the dependencies themselves) or the both the source files and the dependencies? I may add that dependencies are all third parties and available for download for free.

    Read the article

  • Updating label in another form (C#)

    - by cthulhu
    I want to update label of Form1 from Form2. So here's what I have: // Form1 public string Label1 { get { return this.label1.Text; } set { this.label1.Text = value; } } // Form2 private void button1_Click(object sender, EventArgs e) { Form1 frm1 = new Form1(); frm1.Label1 = this.textBox1.Text; this.Close(); } So the above code doesn't work. However, when I add the following: frm1.Show(); after this.Close(); in Form2 code, the Form1 is being opened again (two windows). But I want it to update in the same window so I suggest this.Close() is unnecessary.

    Read the article

  • Storing member function pointers of derived classes in map

    - by Kiran Mohan
    Hello, I am trying to implement a factory for two classes Circle, Square both of which inherits from Shape. class Shape { public: virtual static Shape * getInstance() = 0; }; class Circle : public Shape { public: static const std::string type; Shape * getInstance() { return new Circle; } }; const std::string Circle::type = "Circle"; class Square : public Shape { public: static const std::string type; Shape * getInstance() { return new Square; } }; const std::string Square::type = "Square"; I want to now create a map with key as shape type (string) and value as a function pointer to getInstance() of the corresponding derived class. Is it possible? Thanks, Kiran

    Read the article

  • Users being forced to re-login randomly, before session and auth ticket timeout values are reached

    - by Don
    I'm having reports and complaints from my user that they will be using a screen and get kicked back to the login screen immediately on their next request. It doesn't happen all the time but randomly. After looking at the Web server the error that shows up in the application event log is: Event code: 4005 Event message: Forms authentication failed for the request. Reason: The ticket supplied has expired. Everything that I read starts out with people asking about web gardens or load balancing. We are not using either of those. We're a single Windows 2003 (32-bit OS, 64-bit hardware) Server with IIS6. This is the only website on this server too. This behavior does not generate any application exceptions or visible issues to the user. They just get booted back to the login screen and are forced to login. As you can imagine this is extremely annoying and counter-productive for our users. Here's what I have set in my web.config for the application in the root: <authentication mode="Forms"> <forms name=".TcaNet" protection="All" timeout="40" loginUrl="~/Login.aspx" defaultUrl="~/MyHome.aspx" path="/" slidingExpiration="true" requireSSL="false" /> </authentication> I have also read that if you have some locations setup that no longer exist or are bogus you could have issues. My path attributes are all valid directories so that shouldn't be the problem: <location path="js"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location> <location path="images"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location> <location path="anon"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location> <location path="App_Themes"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location> <location path="NonSSL"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location> The only thing I'm not clear on is if my timeout value in the forms property for the auth ticket has to be the same as my session timeout value (defined in the app's configuration in IIS). I've read some things that say you should have the authentication timeout shorter (40) than the session timeout (45) to avoid possible complications. Either way we have users that get kicked to the login screen a minute or two after their last action. So the session definitely should not be expiring. Update 2/23/09: I've since set the session timeout and authentication ticket timeout values to both be 45 and the problem still seems to be happening. The only other web.config in the application is in 1 virtual directory that hosts Community Server. That web.config's authentication settings are as follows: <authentication mode="Forms"> <forms name=".TcaNet" protection="All" timeout="40" loginUrl="~/Login.aspx" defaultUrl="~/MyHome.aspx" path="/" slidingExpiration="true" requireSSL="true" /> </authentication> And while I don't believe it applies unless you're in a web garden, I have both of the machine key values set in both web.config files to be the same (removed for convenience): <machineKey validationKey="<MYVALIDATIONKEYHERE>" decryptionKey="<MYDECRYPTIONKEYHERE>" validation="SHA1" /> <machineKey validationKey="<MYVALIDATIONKEYHERE>" decryptionKey="<MYDECRYPTIONKEYHERE>" validation="SHA1"/> Any help with this would be greatly appreciated. This seems to be one of those problems that yields a ton of Google results, none of which seem to be fitting into my situation so far.

    Read the article

  • ZeroMQ Java Installation Problem

    - by Ivan
    Hi everyone, I'm trying to install ZeroMQ's Java library but I've been having problem. First error was ./configure complained about JAVA_HOME which everything seemed to be fine but I couldn't manage to solve it but I've found a particular solution in ZeroMQ's chat logs. The suggested solution was; JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Home" ./configure However it doesn't work for me. The error message I've been receiving is checking for jni.h in /Library/Java/Home/include... configure: error: cannot find jni.h in /Library/Java/Home/include. I've tried JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Home" ./configure and JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home" ./configure as well but still no luck. I'd like to hear StackOverflowers' thoughts about how I can solve this. Thanks.

    Read the article

  • Merging branches in tortoiseHg does not seem to work

    - by Spock
    In a project, I have a default branch and another named branch. After a merging both branches and committing it, the graph in TortoiseHg shows that both branches have been merged. However, pushing to a remote repository (which is at the stage before branching, it only has the default branch), I get the message "abort: push creates new remote branches". If I'm not mistaken, I'm left with one branch after merging, so why this error message? Note: the graph still shows that I have 2 heads, is it in anyway related to this?

    Read the article

  • Linking Mapkit with Core Data, Search and user location. Converting annotations from a database in a tableview with search to display in a mapview?

    - by Jon
    Xcode is quite new to me so explanations are appreciated. I am looking to build an application that displays annotations in a mapview (zoomed in on current user location). I want the applications to come from some sort of database rather than manually inputting all the annotations (which is what I'm currently doing) What would be my application type? tab based? window based? i want a tab for a tableview with a list of my annotations and a mapview tab that will show my database of annotations but with the map zoomed in on current location. In a perfect world, it would be great if the user could add favourites from these annotations and keep them in a favourites tableview tab. I'm desperate to work this out and create a fully functional app for a final uni project. i have a working application already but it's nothing like what i am trying to achieve, any help would be much appreciated!!!! Jon (if looked through countless tutorials and as of yet found nothing i can understand to achieve a project like this. Some would call me too ambitious, I just want to make a decent app)

    Read the article

  • Django: cannot pass variable to included template?

    - by duy
    Hi, I got a problem where I want to use template including in Django. Here is the real example: I got 3 file: home.html (will get the context variable passed from Views), base.html (the skeleton template file) and the header.html (included by base.html). If if put the code below directly in base.html without including the header.html, the {{title}} variable passing from home is correctly called. But if I include the header.html in base.html, the {{title}} variable's value cannot be called. <title>{% block title %}{% endblock %} | {{ SITE_INFO_TITLE }}</title> Is there any solution to this problem? Thanks.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >