Reading/Writing to w1 device [RPi] - raspberry-pi

I've been toying around with this DS2433 chip (SO), trying to get it to connect to my Raspberry Pi. From what I've gathered, w1 devices are supposed to appear in /sys/bus/w1/devices/ with a serial number in a format such as 28-xxxxxxxxxxxx, however, I get several devices such as 00-400000000000 and 00-c00000000000. I do not know if this is correct, but I doubt it is. Is there something I'm doing wrong? Pin layout is as follows:
___________ ___________
| | Pin 7 | |
| | (GPIO4) ----- DATA |_ |
| RPi | _| DS2433 |
| | GND --------- GND | |
|___________| |___________|
Everything seems to be okay with the devices that are connected. I'm just confused as to why there is two. I have absolutely no idea how to read or write from this device, but I am doing some research. Any little bit helps. Thanks. Oh yeah, also, Raspberry Pi 3 Model B.

Related

Typo3: remove Email attachment size limit

I have an contact form on the website with the possibility to add an attachment to the email. It's a normal form configured like this:
Position* | *Position=input
Name* | *Name=input
Vorname* | *Vorname=input
Firma | Firma=input
Strasse | Strasse=input
PLZ / Ort | PLZ_Ort=input
Land | Land=input
Telefon G | Telefon_G=input
Telefon P | Telefon_P=input
Mobile | Mobile=input
Email* | *Email=input
Website | Homepage=input
Ihre Nachricht | Ihre_Nachricht=textarea,,5
CV | attachment1=file, 4096000
| formtype_mail=submit
| html_enabled=hidden | 1
| subject=hidden | Kontaktformular Internet
The problem now is, that the files aren't attached to the email, if they are bigger than 2MB. The upload doesn't have a problem, if I add 2 or more attachments, which are smaller than 2 MB. Also the formmailMaxAttachmentSize shouldn't be the problem, because it's set to 25000000.
I've searched for solutions on the internet but didn't find anything that would help me solve this issue.
The version of TYPO3 is 4.4.2
Some operating systems (like Debian) come with a default upload size of 2 MB for PHP uploads.
Please check the configuration settings "upload_max_filesize" and "post_max_size" in the php.ini of your webserver.
Do both contain a value greater than 2 MB? If not, please set the limits to a value greater than 2 MB. The example below sets the upload limit to 10 MB.
upload_max_filesize = 10M
post_max_size = 10M
When the problem came up it really was because of the php.ini file, but it also didn't work after I changed the limit to 20M, because of a simple problem. Every time when I tested the formular I was logged in, in the backend. I don't know why, but if you use the preview feature it seems, that the formular doesn't work. So I simple had to log off from the backend and then test it again.

Making applications for different monitor sizes

I have been developing an application with the following layout (greatly simplified):
+----------------------------------+
| +----------------+ |
| Main | | Info |
| | Interactive | |
| Actions | | And |
| | Graph | |
| Go | | Forms |
| | (Resizable) | |
| Here | | |
| +----------------+ |
+----------------------------------+
With a screen resolution of 1440x900. There are some minimum widths set for buttons etc to make them more beautiful (so for example the label inside has some distance from the button borders). Now if I resize the window to about 800x600, it becomes like this:
+----------------------+
| +----+ |
| Main | | Info |
| Actions | | And |
| | | |
| Go | | Forms |
| Here | | |
| +----+ |
+----------------------+
Which is not so beautiful. The reason the middle panel gets so small is that the labels on either sides cannot be shrunk.
The question is, how can I tell gtk to scale everything (e.g. images, fonts etc) inside a window?
If such a functionality doesn't exist, what choice do I have for making everything inside the window (or at least the font sizes) smaller or bigger, without having to manually change every widget?
Gtk doesn't allow you to "scale" anything automatically in a window. It would also be a bad idea, as you don't know how little the window will be (not only because of the screen resolution, but because of the user manually resizing the window).
I'd suggest you to redesign your layout. It's complicated to suggest a solution without a real screenshot, but maybe the Main Actions could be replaced in the top part of the window.
Use a toolbar with your main actions, and put other actions in a menu bar. This will give more space to the interactive graph. Info and forms, if not required at every moment, may be in a tabbed view, or in a popup. Hard to tell more without a screenshot.

Multiple SQLite Queries on iOS

I have more than 3 views. My database looks like this:
Category:
CatID | CatTitle
----------------
1 | XYZ
2 | Sample
Content:
ItemID | ItemCatID | ItemText | ItemText2 | ItemText3 | ItemText4
-----------------------------------------------------------------
1 | 1 | Test | Bla | Sample | MoreContent
2 | 1 | Test2 | BlaBla | Sample2 | Other Content
3 | 2 | Test3 | BlaBla2 | Sample3 | Other Content2
I want a view where first page category, second page list (ItemText), third page detail.
I'm not sure how to go about accomplishing that. If I use JOIN should I define "sqlite3_stmt *compiledStatement" in triple?
I think it can be done with 'For', "get parent,child" (like a cursor in java)?
Any advice welcome.
I'm not sure what you want.
Can you be more specific?
I can give you two tips though, first SQLite does not support stored procedures and has a very limited support for PL/SQL:http://www.sqlite.org/whentouse.html
if you REALLY MUST use it I suggest looking at this, I never tried it but it may work:
http://chriswolf.heroku.com/articles/2011/01/26/adding-stored-procedures-to-sqlite
Second, you usually wanna use a Wrapper around SQLite c functions so you worry about the SQL itself more and less about the c functions, examples:
Best Cocoa/Objective-C Wrapper Library for SQLite on iPhone
Hope this helps

How to use default org-mode spreadsheet auto-sum behavior ?

In this example:
| | num |
|---+-----|
| | 5 |
| | 6 |
| | 4 |
|---+-----|
| # | 15 |
| ^ | sum |
#+TBLFM: $sum=vsum(#2..#-1);
Every time you press "tab" in the sum area or C-c C-c in the table formula area below the table it recalculates the sum area. The problem is after it recalculates this area it adds this new sum to the current sum that's already in the area. (Try it in your emacs).
I've created this basic test to show issues I've encountered in creating complex spreadsheets in org. Until I find a solution I can't trust the sums emacs gives me because I may occasionally press C-c C-c twice and it's inconvenient to have to go and zeo out all sum values in my form every time I recalculate.
If anyone knows a solution, please let me know.
Turns out it was a bug with the Org-mode version I was using:
release 5.23a is from Apr 23 10:17:27 2008
Kudos to Thumper_ in freenode #org-mode for pointing it out.
Be sure to update to the newest version of Org-mode, folks! :)
Maybe it's more clear to use vsum(#I..#II) to indicate the rows between the 2 hlines.
I cannot reproduce your accumulation problem; and just read your answer about the bug!!

How can I adjust the display of IO ports on a subsystem block in Simulink?

I'm developing an 8-input digital multiplexer in Simulink and created a subsystem which implements a multiplexer operation with 3 enable inputs.
I would like to display the input channels (I0-I7) on the left of the subsystem block, the 3 enable inputs (S0-S2) on the bottom of the subsystem block, and the output port on the right of the subsystem block, like this:
--------------
| |
I0----> | |
I1----> | |
I2----> | |
I3----> | |------>X
I4----> | |
I5----> | |
I6----> | |
I7----> | |
--------------
^ ^ ^
| | |
S0 S1 S2
However, in Simulink the block is always displayed with all the input ports on one side and all the output ports on the opposite side.
Does anyone have any ideas for how I can display input ports on more than one side? Having all my input ports on one side makes it harder to visually distinguish them.
One option is to use a Mux (or perhaps a bus) signal to collect the input channels into just one input. With fewer inputs, it will be easier to distinguish them if they are all on the same side. Also, don't forget to label your input ports.