Posts

Autohotkey: modify text file without ever opening -

i'll start off saying i've sat around trying figure out 8hrs , i'm coming here ask help. i want able have text file starts @ 0 , increase 1 every time press hotkey. want happen without having file open. used counter. ken made point regard knowing initial value. if want add number @ bottom can use: fileappend, %counter%`n, c:\temp\counter.txt or if want have 1 number: filedelete, c:\temp\counter.txt fileappend, %counter%, c:\temp\counter.txt if want store variable, can use .ini files store various variables. iniwrite, %textcounter%, %a_scriptdir%\counter.ini, counter, nr iniread, textcounter, %a_scriptdir%\counter.ini, counter, nr

html - dynamic drop down form using JavaScript -

i'd have drop down form using javascript. need create question essentially. how works: person, home page, click "create question" , go create question page. on page, first question asks person "what type of question ask?" , then, via few radio buttons, can select type want, either "multiple choice", "select best" or "short answer". point, more of form appears…in other words, depending on type of question want ask, different set of criteria asked them fill out before submitting server question they'd ask. make sense? here form far: <!doctype html> <html> <head> <title>quick bump</title> <link href="styles.css" type="text/css" rel="stylesheet" /> </head> <body> <div class="center"> <h1 class="welcomeheader">create question:</h1> ...

activerecord - Rails many_to_many table not updating -

i'm not able many_to_many table update when create new site record. sites table updated, not sites_users. i'm expecting user_id , site_id added sites_users table when site created. my migration: class createtablesiteuser < activerecord::migration def create_table :sites_users, :id => false |t| t.integer :site_id t.integer :user_id end models: user.rb class user < activerecord::base attr_accessible :name, :email, :password, :password_confirmation, :user_id has_secure_password has_and_belongs_to_many :sites site.rb class site < activerecord::base attr_accessible :name, :site_key, :organization_id, :user_id, :site_id belongs_to :organization has_and_belongs_to_many :users sites_controller.rb def create @site = site.new(params[:site]) @site.organization_id = organization.where(:user_id => current_user.id) @user_id = current_user.id if @site.save flash[:success] = "new site created!" redir...

Access an array value within an object in PHP -

i'm new php , trying access value of "contactid" following: object(stdclass)#2 (4) { ["contacts"]=> array(1) { [0]=> object(stdclass)#3 (18) { ["email"]=> string(24) "joewilliams@icontact.com" ["firstname"]=> string(3) "joe" ["lastname"]=> string(8) "williams" ["prefix"]=> string(3) "mr." ["suffix"]=> string(3) "jr." ["fax"]=> string(0) "" ["phone"]=> string(10) "8668039462" ["street"]=> string(21) "2365 meridian parkway" ["street2"]=> string(0) "" ["city"]=> string(6) "durham" ["state"]=> string(2) "nc" ["postalcode"]=> ...

C++ delete calls overloaded operator inside dylib (Xcode) -

i'm using xcode build c++ code where-in i'm calling delete destroy memory, have external lib loaded has delete operator overloaded, when call delete delete operator of lib called though not intended so. anybody has clue how prevent this? i have found decorated name operator delete lib, how tell xcode symbols? if define own operator delete in project code doesn't compile because of duplicate symbol error? anybody has clue on this? in advance help.

java - Recursion Driver Methods -

public class findsum { private static int sum(int n) { if (n==1) return 1; else return n + sum (n-1); } public static int getsum(int n) { if (n>0) return sum(n); else { throw new illegalargumentexception ("error: n must positive"); } } } according book, tests n>0 before execution. don't understand why case if test "if (n>0)" comes after algorithm. shouldn't 2 methods flipped in order accomplish test? the order they're written in doesn't matter, rather order of execution critical. since getsum explicitly calls sum if check successful, there's no worry check getting missed, long call getsum .

asp.net mvc - Why are changes made in my .NET MVC-4 solution not showing in the browser preview? -

so i'm running visual studio 2012 (win7) on vmware fusion. 50% of time change view not render in browser preview. drive me crazy. solution found kill webview.webserver40 app launches when click view in browser web build. seems issue working on mac virtual machine, running on pc doesn't have issue. if else has better solution great. it's annoying workflow @ least i'm yelling @ it. -- update if comes across this, found solution here: caching in asp.net development server also: http://support.microsoft.com/kb/911272 edit registry key: hklm\software\microsoft\asp.net\defaultdocumentinstalled 1 2 -- update #2 so fix worked moment , may have quirk. me installing iis express via microsoft web platform installer worked magic. no more issue. jesus. http://www.microsoft.com/web/gallery/install.aspx?appid=webmatrix