Bitnami Redmine Unable to connect: Adaptive Server - sql-server

I am trying to install Bitnami Redmine 4.1.1-8 on a MS SQL 2107 server from a Windows 10 Pro computer.
This is a clean computer with no other versions of Redmine. Unfortunately, every time I try to execute the command bundle exec thin -e production start I get this error:
C:\Bitnami\redmine-4.1.1-8\apps\redmine\htdocs> bundle exec thin -e production start
Using rack adapter
Traceback (most recent call last):
86: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/bin/thin:23:in <main>'
85: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/bin/thin:23:inload'
84: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/thin-1.7.2-x64-mingw32/bin/thin:6:in <top (required)>'
83: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/thin-1.7.2-x64-mingw32/lib/thin/runner.rb:159:inrun!'
82: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/thin-1.7.2-x64-mingw32/lib/thin/runner.rb:203:in run_command'
81: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/thin-1.7.2-x64-mingw32/lib/thin/controllers/controller.rb:74:instart'
80: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/thin-1.7.2-x64-mingw32/lib/thin/controllers/controller.rb:170:in load_adapter'
79: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/thin-1.7.2-x64-mingw32/lib/rack/adapter/loader.rb:42:infor'
78: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/thin-1.7.2-x64-mingw32/lib/rack/adapter/loader.rb:33:in load'
77: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/thin-1.7.2-x64-mingw32/lib/rack/adapter/loader.rb:33:ineval'
76: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/config.ru:1:in <main>'
75: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/config.ru:1:innew'
74: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/rack-2.2.3/lib/rack/builder.rb:125:in initialize'
73: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/rack-2.2.3/lib/rack/builder.rb:125:ininstance_eval'
72: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/config.ru:3:in block in <main>'
71: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/config.ru:3:inrequire'
70: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/config/environment.rb:16:in <top (required)>'
69: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.2/lib/rails/application.rb:361:ininitialize!'
68: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.2/lib/rails/initializable.rb:60:in run_initializers'
67: from C:/Bitnami/redmine-4.1.1-8/ruby/lib/ruby/2.5.0/tsort.rb:205:intsort_each'
66: from C:/Bitnami/redmine-4.1.1-8/ruby/lib/ruby/2.5.0/tsort.rb:226:in tsort_each'
65: from C:/Bitnami/redmine-4.1.1-8/ruby/lib/ruby/2.5.0/tsort.rb:347:ineach_strongly_connected_component'
64: from C:/Bitnami/redmine-4.1.1-8/ruby/lib/ruby/2.5.0/tsort.rb:347:in call'
63: from C:/Bitnami/redmine-4.1.1-8/ruby/lib/ruby/2.5.0/tsort.rb:347:ineach'
62: from C:/Bitnami/redmine-4.1.1-8/ruby/lib/ruby/2.5.0/tsort.rb:349:in block in each_strongly_connected_component'
61: from C:/Bitnami/redmine-4.1.1-8/ruby/lib/ruby/2.5.0/tsort.rb:431:ineach_strongly_connected_component_from'
60: from C:/Bitnami/redmine-4.1.1-8/ruby/lib/ruby/2.5.0/tsort.rb:350:in block (2 levels) in each_strongly_connected_component'
59: from C:/Bitnami/redmine-4.1.1-8/ruby/lib/ruby/2.5.0/tsort.rb:228:inblock in tsort_each'
58: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.2/lib/rails/initializable.rb:61:in block in run_initializers'
57: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.2/lib/rails/initializable.rb:32:inrun'
56: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.2/lib/rails/initializable.rb:32:in instance_exec'
55: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.2/lib/rails/application/finisher.rb:69:inblock in '
54: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.2/lib/rails/application/finisher.rb:69:in each'
53: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.2/lib/rails/engine.rb:356:ineager_load!'
52: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.2/lib/rails/engine.rb:475:in eager_load!'
51: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.2/lib/rails/engine.rb:475:ineach'
50: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.2/lib/rails/engine.rb:477:in block in eager_load!'
49: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.2/lib/rails/engine.rb:477:ineach'
48: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.2/lib/rails/engine.rb:478:in block (2 levels) in eager_load!'
47: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:246:inrequire_dependency'
46: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:334:in depend_on'
45: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:356:inrequire_or_load'
44: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:37:in load_interlock'
43: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies/interlock.rb:13:inloading'
42: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/concurrency/share_lock.rb:151:in exclusive'
41: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies/interlock.rb:14:inblock in loading'
40: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:37:in block in load_interlock'
39: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:378:inblock in require_or_load'
38: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:291:in require'
37: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:257:inload_dependency'
36: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:291:in block in require'
35: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:291:inrequire'
34: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/app/models/issue_query.rb:20:in <top (required)>'
33: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/app/models/issue_query.rb:36:in'
32: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/app/models/issue_query.rb:36:in new'
31: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/app/models/query.rb:31:ininitialize'
30: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/app/models/query.rb:91:in groupable'
29: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/app/models/user.rb:816:incurrent'
28: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/app/models/user.rb:822:in anonymous'
27: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.2/lib/active_record/scoping/default.rb:34:inunscoped'
26: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.2/lib/active_record/core.rb:287:in relation'
25: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.2/lib/active_record/inheritance.rb:84:infinder_needs_type_condition?'
24: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.2/lib/active_record/inheritance.rb:78:in descends_from_active_record?'
23: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.2/lib/active_record/model_schema.rb:336:incolumns_hash'
22: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.2/lib/active_record/model_schema.rb:456:in load_schema'
21: from C:/Bitnami/redmine-4.1.1-8/ruby/lib/ruby/2.5.0/monitor.rb:235:inmon_synchronize'
20: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.2/lib/active_record/model_schema.rb:459:in block in load_schema'
19: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.2/lib/active_record/attribute_decorators.rb:51:inload_schema!'
18: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.2/lib/active_record/attributes.rb:234:in load_schema!'
17: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.2/lib/active_record/model_schema.rb:466:inload_schema!'
16: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.2/lib/active_record/connection_handling.rb:90:in connection'
15: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.2/lib/active_record/connection_handling.rb:118:inretrieve_connection'
14: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:1033:in retrieve_connection'
13: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:382:inconnection'
12: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:538:in checkout'
11: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:814:inacquire_connection'
10: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:853:in try_to_checkout_new_connection'
9: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:874:incheckout_new_connection'
8: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:830:in new_connection'
7: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-sqlserver-adapter-5.2.1/lib/active_record/sqlserver_base.rb:13:insqlserver_connection'
6: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-sqlserver-adapter-5.2.1/lib/active_record/sqlserver_base.rb:13:in new'
5: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-sqlserver-adapter-5.2.1/lib/active_record/connection_adapters/sqlserver_adapter.rb:64:ininitialize'
4: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-sqlserver-adapter-5.2.1/lib/active_record/connection_adapters/sqlserver_adapter.rb:365:in connect'
3: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-sqlserver-adapter-5.2.1/lib/active_record/connection_adapters/sqlserver_adapter.rb:379:indblib_connect'
2: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/activerecord-sqlserver-adapter-5.2.1/lib/active_record/connection_adapters/sqlserver_adapter.rb:379:in new'
1: from C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/tiny_tds-2.1.3-x64-mingw32/lib/tiny_tds/client.rb:60:ininitialize'
C:/Bitnami/redmine-4.1.1-8/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/tiny_tds-2.1.3-x64-mingw32/lib/tiny_tds/client.rb:60:in `connect': Unable to connect: Adaptive Server is unavailable or does not exist (127.0.0.1) (TinyTds::Error)
Here's my full database/yml file:
production:
adapter: sqlserver
host: 127.0.0.1
port: 1433
database: DATABESE
username: user
password: "passwordpassword"
encoding: utf8
I am trying to install the program on a production MS SQL server of our company so that we can keep track of the employees activities, and I would be grateful for any help.

Quite by accident, I managed to solve this problem myself.
It is necessary to specify the DNS server name, and not its IP, as I did.
After making all the changes to the adapter and connecting to the SQL server, you must run the procedure bundle update
After this shut dawn all server connections from Bitnami Stack Manager Tool
Run bundle exec rake db:migrate RAILS_ENV=production
Re-start all server connections from Bitnami Stack Manager Tool
And that's all about it.

Related

OAMulator (print highest score of 7)

I am trying to write a program in OAMulator that is reflective of this Pseudo-code.
Set highest to 0
Set count to 7
While count > 0
Get newScore
Print newScore
If newScore > highest
Set highest to newScore
Set count to count - 1
Print highest
Stop
This is what I've come up with. We have to use 7 scores and get the highest and print only the highest score. We also have to use a count loop. I entered 0 as a control to start the inputs along with 7 other scores. TO BE CLEAR I AM NOT LOOKING FOR THE AWNSER OR SOLUTION. i am looking to learn why this isnt working and how to make a count loop work with a higherthan loop.
INPUT LIST
0
60
70
80
90
83
76
95
Then I wrote the code as best as I could, but the issue I run into is the count and new score run off the Accumulator. I tried writing another loop to change it but then the two loops don't always run and the count gets messed up or the scores don't get tallied right.
SET 7 #set count to 7
count, STA 100 #store count to slot 100
loopstart, LDA 0 #start loop, load 0
STA 101 #store 0 in slot 101
LDA 0 #load 60
STA 102 #store in slot 102
LDA 101 #load 60
SUB 102 #subract 70
BRP loopstart #if pos then loop, if not go on.
LDA 100 #load count
DEC # count -1
BRP count #if count <0 loop to count
print, STA 102 #print highest
HLT
here is the trace and memory
TRACE
0: PC=1 IR=[?????] AR=? ACC=? B=?
1: PC=2 IR=[SET 7] AR=1 ACC=7 B=?
2: PC=3 IR=[STA 100] AR=100 ACC=7 B=?
3: PC=4 IR=[LDA 0] AR=0 ACC=0 B=?
4: PC=5 IR=[STA 101] AR=101 ACC=0 B=?
5: PC=6 IR=[LDA 0] AR=0 ACC=60 B=?
6: PC=7 IR=[STA 102] AR=102 ACC=60 B=?
7: PC=8 IR=[LDA 101] AR=101 ACC=0 B=?
8: PC=9 IR=[SUB 102] AR=102 ACC=-60 B=60
9: PC=10 IR=[BRP 3] AR=9 ACC=-60 B=60
10: PC=11 IR=[LDA 100] AR=100 ACC=7 B=60
11: PC=12 IR=[DEC] AR=11 ACC=6 B=60
12: PC=2 IR=[BRP 2] AR=12 ACC=6 B=60
13: PC=3 IR=[STA 100] AR=100 ACC=6 B=60
14: PC=4 IR=[LDA 0] AR=0 ACC=70 B=60
15: PC=5 IR=[STA 101] AR=101 ACC=70 B=60
16: PC=6 IR=[LDA 0] AR=0 ACC=80 B=60
17: PC=7 IR=[STA 102] AR=102 ACC=80 B=60
18: PC=8 IR=[LDA 101] AR=101 ACC=70 B=60
19: PC=9 IR=[SUB 102] AR=102 ACC=-10 B=80
20: PC=10 IR=[BRP 3] AR=9 ACC=-10 B=80
21: PC=11 IR=[LDA 100] AR=100 ACC=6 B=80
22: PC=12 IR=[DEC] AR=11 ACC=5 B=80
23: PC=2 IR=[BRP 2] AR=12 ACC=5 B=80
24: PC=3 IR=[STA 100] AR=100 ACC=5 B=80
25: PC=4 IR=[LDA 0] AR=0 ACC=90 B=80
26: PC=5 IR=[STA 101] AR=101 ACC=90 B=80
27: PC=6 IR=[LDA 0] AR=0 ACC=83 B=80
28: PC=7 IR=[STA 102] AR=102 ACC=83 B=80
29: PC=8 IR=[LDA 101] AR=101 ACC=90 B=80
30: PC=9 IR=[SUB 102] AR=102 ACC=7 B=83
31: PC=3 IR=[BRP 3] AR=9 ACC=7 B=83
32: PC=4 IR=[LDA 0] AR=0 ACC=76 B=83
33: PC=5 IR=[STA 101] AR=101 ACC=76 B=83
34: PC=6 IR=[LDA 0] AR=0 ACC=95 B=83
35: PC=7 IR=[STA 102] AR=102 ACC=95 B=83
36: PC=8 IR=[LDA 101] AR=101 ACC=76 B=83
37: PC=9 IR=[SUB 102] AR=102 ACC=-19 B=95
38: PC=10 IR=[BRP 3] AR=9 ACC=-19 B=95
39: PC=11 IR=[LDA 100] AR=100 ACC=5 B=95
40: PC=12 IR=[DEC] AR=11 ACC=4 B=95
41: PC=2 IR=[BRP 2] AR=12 ACC=4 B=95
42: PC=3 IR=[STA 100] AR=100 ACC=4 B=95
Error: Attempt to read missing input
43: PC=4 IR=[LDA 0] AR=0 ACC=? B=95
Abort: 43 instructions executed.
MEMORY
1. SET 7
2. STA 100
3. LDA 0
4. STA 101
5. LDA 0
6. STA 102
7. LDA 101
8. SUB 102
9. BRP 3
10. LDA 100
11. DEC
12. BRP 2
13. STA 102
14. HLT
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100. 4
101. 76
102. 95
I figured it out. It took me hours. almost days.
SET 8 #set count to 8
STA 100 #store in slot 100
SET 0
STA 102 #slot 0 as highest
loopstart, LDA 100 #Load count
DEC #count -1
BRZ print # if count is 0 print
STA 100 # if count is more than 1 store
LDA 0 #load ACC
STA 101 #store ACC in 101
LDA 101 #load Number
SUB 102 #subract highest
BRP while
BR loopstart
print, LDA 102
STA 0
HLT
while, LDA 101
STA 102 #if ACC is positive store as highest
BR loopstart
There doesn't seem to be much help on the internet for OAM assembly language so i posted the answer for others in the future.

BASH remove leading and trailing spaces in array

I've got data coming from mysql and some values have leading or trailing spaces.
This is the code I have:
IFS=$':' res=(${vals//$'\t'/:})
for (( i=0 ; i<${#res[#]} ; i++ )); do
echo "$i: ${res[i]}*"
done
is there a simple effective way to ensure there are no leading or trailing space in res[i] ?
Thanks
EDIT
This is the result of my MYSQL query before it goes through IFS.
ZnbMF0 9RrO7 1 SiteA password password 12 1234 1234 456 456 0 0 0 0 0 0 0 0 test#domain.com test user 5 2222 0 0 0 0 server address 0 0 test#domain.com 0 0 0 0 0 0 0 0 0 0 0 0 0 NULL
In MySQL the email addresses have leading and trailing spaces.
Processing through IFS and then Looping though it as :
for (( i=0 ; i<${#res[#]} ; i++ )); do
echo "$i: ${res[i]}*"
done
Results in:
0: ZnbMFO*
1: 9RrO7*
2: 1*
3: SiteA*
4: password*
5: password*
6: 12*
7: 1234*
8: 1234*
9: 456*
10: 456*
11: 0*
12: 0*
13: 0*
14: 0*
15: 0 *
16: 0*
17: 0*
18: 0*
19: test#domain.com *
20: test*
21: user*
22: 5*
23: 2222 *
24: 0*
25: 0 *
26: 0*
27: 0*
28: server*
29: address*
30: 0*
31: 0*
32: test#domain.com *
33: 0*
34: 0*
35: 0*
36: 0*
37: 0*
38: 0*
39: 0 *
40: 0*
41: 0*
42: 0*
43: 0 *
44: 0*
45: 0*
46: NULL*
The * is there just to highlight the trailing space.
Thanks
Let's say you have an array as this one:
arr=('foo bar' 'test#domain.com ' \
' test#domain.com ' ' test#domain.com ')
To check array content using printf:
printf '[%s]\n' "${arr[#]}"
This will show:
[foo bar]
[test#domain.com ]
[ test#domain.com ]
[ test#domain.com ]
Now for leading and trailing space removal:
shopt -s extglob # turn on extended glob
arr=( "${arr[#]/#+([[:blank:]])/}" ) # remove leading space/tab from each element
arr=( "${arr[#]/%+([[:blank:]])/}" ) # remove trailing space/tab from each element
Now if you print array again:
printf '[%s]\n' "${arr[#]}"
It will show:
[foo bar]
[test#domain.com]
[test#domain.com]
[test#domain.com]
Not sure if you would call it simple, but you can use sed:
echo "${res[i]}" | sed 's/^ *\| *$//g'
vals=$' a \t c d'
IFS=$':' res=(${vals//$'\t'/:})
for (( i=0 ; i<${#res[#]} ; i++ )); do
echo X${res[i]}X
res[$i]=$(echo "${res[i]}" | sed 's/^ *\| *$//g')
echo X${res[i]}X
done
Output:
X a X
XaX
X c dX
Xc dX

C Array acting strange when it pass the number of arguments

I was implementing Command-line arguments with C , And I shocked when the Arguments Array start acting strange when it passes the number of the argument given. here is the code :
#include <stdio.h>
int main(int a, char *arra[]){
/*
for(int i = 1;i<a;i++){
printf("Arguments N%d -> %s\n",i+1,arra[i]);
}
printf("Totale Arguments:%d\n",a-1);
*/
for(int i = 0;i<=49 ;i++){
printf("%d: -> %s\n--------------------------------------
------\n",i,arra[i]);
}
return 0;
}
My question is how did the array have access to the Linux Terminal variable like the Path variable PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
And the Output was like :
0: -> ./list
--------------------------------------------
1: -> hi
--------------------------------------------
2: -> 234
--------------------------------------------
3: -> hello
--------------------------------------------
4: -> (null)
--------------------------------------------
5: -> LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
--------------------------------------------
6: -> XDG_MENU_PREFIX=gnome-
--------------------------------------------
7: -> LANG=en_US.UTF-8
--------------------------------------------
8: -> GDM_LANG=en_US.UTF-8
--------------------------------------------
9: -> DISPLAY=:1
--------------------------------------------
10: -> COLORTERM=truecolor
--------------------------------------------
11: -> USERNAME=root
--------------------------------------------
12: -> XDG_VTNR=2
--------------------------------------------
13: -> SSH_AUTH_SOCK=/run/user/0/keyring/ssh
--------------------------------------------
14: -> XDG_SESSION_ID=7
--------------------------------------------
15: -> USER=root
--------------------------------------------
16: -> DESKTOP_SESSION=gnome
--------------------------------------------
17: -> GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/bbdf3fc7_241a_437d_86d0_982594cbb92d
--------------------------------------------
18: -> PWD=/root/Documents/Programming/c
--------------------------------------------
19: -> HOME=/root
--------------------------------------------
20: -> SSH_AGENT_PID=1581
--------------------------------------------
21: -> QT_ACCESSIBILITY=1
--------------------------------------------
22: -> XDG_SESSION_TYPE=x11
--------------------------------------------
23: -> XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/
--------------------------------------------
24: -> XDG_SESSION_DESKTOP=gnome
--------------------------------------------
25: -> GJS_DEBUG_OUTPUT=stderr
--------------------------------------------
26: -> GTK_MODULES=gail:atk-bridge
--------------------------------------------
27: -> WINDOWPATH=2
--------------------------------------------
28: -> TERM=xterm-256color
--------------------------------------------
29: -> SHELL=/bin/bash
--------------------------------------------
30: -> VTE_VERSION=5202
--------------------------------------------
31: -> XDG_CURRENT_DESKTOP=GNOME
--------------------------------------------
32: -> GPG_AGENT_INFO=/run/user/0/gnupg/S.gpg-agent:0:1
--------------------------------------------
33: -> GNOME_TERMINAL_SERVICE=:1.67
--------------------------------------------
34: -> SHLVL=1
--------------------------------------------
35: -> XDG_SEAT=seat0
--------------------------------------------
36: -> GDMSESSION=gnome
--------------------------------------------
37: -> GNOME_DESKTOP_SESSION_ID=this-is-deprecated
--------------------------------------------
38: -> LOGNAME=root
--------------------------------------------
39: -> DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus
--------------------------------------------
40: -> XDG_RUNTIME_DIR=/run/user/0
--------------------------------------------
41: -> XAUTHORITY=/run/user/0/gdm/Xauthority
--------------------------------------------
42: -> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
--------------------------------------------
43: -> GJS_DEBUG_TOPICS=JS ERROR;JS LOG
--------------------------------------------
44: -> SESSION_MANAGER=local/FXMACO:#/tmp/.ICE-unix/1529,unix/FXMACO:/tmp/.ICE-unix/1529
--------------------------------------------
45: -> _=./list
--------------------------------------------
46: -> OLDPWD=/root/Documents/Books
--------------------------------------------
47: -> (null)
--------------------------------------------
Segmentation fault
for(int i = 0;i<=49 ;i++){
as we see here your argument list is shorter than 50 elements
It is good to use standard names and to take into the account number of arguments passed (that is the reason of the argc)
int main(int argc char *argv[])
{
for(int i = 0;i < argc ;i++){

HandlebarsJS - How to split up data

I have this Backbone App whehre I have an API which gives me information about Bands Album and its relevant tracks from a MySQL database. When I do the classic {{#each this}}-thing, I get all data listed in one big <ol>-and you cannot see which Album the tracks belong to. What I want to achieve is a structure like this:
<album>
<tracks>
<album>
<tracks>
...etc
So right now, my code looks like this:
<div>
{{#each this}}
<div class="pc33">
<img src="{{cover_image}}" />
</div>
<section>
<h2>{{album_title}}</h2>
</section>
<section class="tl pc66 floatright">
<div>
<ol>
{{#each this}}
<li>{{track_title}}<span>{{track_duration}}</span></li>
{{/each}}
</ol>
</div>
</section>
{{/each}}
</div>
But that doesnt work - each track gets the album cover and starts with 1. track title...
My console spits out the JSON
0: {pro_id:507, album_title:I Care 4 U, track_title:…}
1: {pro_id:507, album_title:I Care 4 U, track_title:…}
2: {pro_id:507, album_title:I Care 4 U, track_title:…}
3: {pro_id:507, album_title:I Care 4 U, track_title:…}
4: {pro_id:508, album_title:Miss You, album_genre:R & B, cover_image:…}
5: {pro_id:509, album_title:One In A Million, track_title:…}
6: {pro_id:509, album_title:One In A Million, track_title:…}
7: {pro_id:509, album_title:One In A Million, track_title:…}
8: {pro_id:509, album_title:One In A Million, track_title:…}
9: {pro_id:509, album_title:One In A Million, track_title:…}
10: {pro_id:509, album_title:One In A Million, track_title:…}
11: {pro_id:510, album_title:Aaliyah, track_title:…}
12: {pro_id:510, album_title:Aaliyah, track_title:…}
13: {pro_id:510, album_title:Aaliyah, track_title:…}
14: {pro_id:510, album_title:Aaliyah, track_title:…}
15: {pro_id:510, album_title:Aaliyah, track_title:…}
16: {pro_id:510, album_title:Aaliyah, track_title:…}
So again, I want to have the structure like mentioned above. How can I do this?
thanks in advance

linux kernel module dies after 100000 interrupts

I'm working on a kernel module for the 2.6.39 kernel. (I know this is out of date, but it's what came with my evaluation board and I wanted to get this working before moving to the 3.x series.)
My module is very simple at the moment. It listens for a 200us pulse on a GPIO pin, then increments a counter which resets it every 25089 iterations. (25089 is the size of a buffer to be used later.) Strangely enough though, my module dies after exactly 100000 interrupts every time I use it, and I'm really at a loss. I looked at changing the kernel jiffy frequency, but that seems like it's unrelated. I also tried using a tickless kernel, and that doesn't seem to have an effect either. I can't find much of anything on google about this problem either. Has anyone else seen this issue?
I'm building for an Atmel AT91 processor if that is important. I'll list my crash message below.
root#at91:~# irq 56: nobody cared (try booting with the "irqpoll" option)
[<c0036804>] (unwind_backtrace+0x0/0xec) from [<c006eca4>] (__report_bad_irq+0x34/0xa0)
[<c006eca4>] (__report_bad_irq+0x34/0xa0) from [<c006eed0>] (note_interrupt+0x1c0/0x22c)
[<c006eed0>] (note_interrupt+0x1c0/0x22c) from [<c006d904>] (handle_irq_event_percpu+0x168/0x19c)
[<c006d904>] (handle_irq_event_percpu+0x168/0x19c) from [<c006d960>] (handle_irq_event+0x28/0x38)
[<c006d960>] (handle_irq_event+0x28/0x38) from [<c003ace0>] (gpio_irq_handler+0x74/0x98)
[<c003ace0>] (gpio_irq_handler+0x74/0x98) from [<c002b078>] (asm_do_IRQ+0x78/0xac)
[<c002b078>] (asm_do_IRQ+0x78/0xac) from [<c00313d4>] (__irq_svc+0x34/0x60)
Exception stack(0xc04b1f70 to 0xc04b1fb8)
1f60: 00000000 0005317f 0005217f 60000013
1f80: c04b0000 c04b61cc c04b5ffc c04e1224 20000000 41069265 20025cbc 00000000
1fa0: 600000d3 c04b1fb8 c0032cc8 c0032cd4 60000013 ffffffff
[<c00313d4>] (__irq_svc+0x34/0x60) from [<c0032cd4>] (default_idle+0x38/0x40)
[<c0032cd4>] (default_idle+0x38/0x40) from [<c0032af8>] (cpu_idle+0x70/0xc8)
[<c0032af8>] (cpu_idle+0x70/0xc8) from [<c00089c0>] (start_kernel+0x284/0x2e4)
[<c00089c0>] (start_kernel+0x284/0x2e4) from [<20008038>] (0x20008038)
handlers:
[<c01eb660>] (grab_spi_data+0x0/0x6c)
Disabling IRQ #56
root#at91:~# cat /proc/interrupts
CPU0
1: 1387 AIC at91_tick, at91_rtc, ttyS0
12: 39 AIC atmel_mci.0
13: 0 AIC atmel_spi.0
14: 0 AIC atmel_spi.1
17: 1804 AIC tc_clkevt
20: 7520 AIC at_hdmac
21: 0 AIC at_hdmac
22: 1 AIC ehci_hcd:usb1, ohci_hcd:usb2
23: 0 AIC atmel_usba_udc
24: 136 AIC eth0
26: 0 AIC atmel_mci.1
56: 100000 GPIO quicklogic_ready
80: 0 GPIO atmel_usba_udc
142: 0 GPIO mmc-detect
143: 1 GPIO mmc-detect
Err: 0
My interrupt handler is called grab_spi_data, which you can see is that the bottom of the backtrace, and I'm watching IRQ 56. I am really stumped.
Looks like you're not handling the IRQs.
Linux gets upset after 100,000 times - See the comment above __report_bad_irq and find this magic number.
Your interrupt handler probably never returns IRQ_HANDLED, which is what it should do after handling the interrupt.

Resources