When reading 20+ columns horizontally, it gets hard on the eyes. I've been trying to find a way to display output of a single search result row as a scrollable vertical columnName:columnValue list:
+-------------------------+-+
| First_Name | John | |
| Last_Name | Doe | |
| Birthdate | 01011970 | |
| Last_login | 01012015 |X|
+-------------------------+-+
Is this possible?
This is functionality you can push to the database. For example if your DB is oracle 11g, you can use the unpivot feature.
Create a multicolumn list box with the below query.
select column_name,column_values from customers
unpivot
(column_values for column_name in ("FIRST_NAME" ,"LAST_NAME"))
Related
I'm creating a simple application, there is a table with file names, and a column with IDs of users allowed to read it, for example:
|FILES |USERS |
|my.txt|1,3,5 |
|fo.txt|3,4,17|
|ba.jpg|13,31 |
Is it right this way for creating user groups?
What is the right SQL statement to retrieve files allowed to user "3"?
You shouldn't combine multiple values in one field.
Normal approach is:
|FILES |USERS|
|my.txt|1 |
|my.txt|3 |
|my.txt|5 |
|fo.txt|3 |
|fo.txt|4 |
|fo.txt|17 |
|ba.jpg|13 |
|ba.jpg|31 |
So if you want a list of files for user 3, you do:
SELECT Files FROM Table WHERE User='3';
To check users for a file,
SELECT Users FROM Table WHERE File='my.txt';
Also common is to avoid repeating long strings, creating a new table CREATE TABLE FileNames (ID INTEGER PRIMARY KEY, Filename) and always referring ID instead of names in other tables. But that should be a performance evaluation made by you.
You should normalize the database. So you'll have
|FILE |USER|
|my.txt| 1|
|my.txt| 3|
|my.txt| 5|
|fo.txt| 3|
...
That is simple normalization of the table you've shown. It does not involve any groups, but your original table didn't either.
You should add separate 'groups' table:
|OID|group_id|user_id|
| 1| 1| 1|
| 2| 1| 2|
and reference this group in your files table. If you want to check specific user, it would be something like
select FILES from files join groups on files.group_id = groups.group_id where groups.user_id = 3
I would like to see the data on Demographic -> Language grid grouped by ISO 3316 language, without differences between the (optional) ISO639 country code national variant.
For example, instead of seeing:
| Language | Visits |
|----------|--------|
| it | 56,027 |
| it-it | 35,130 |
| en-us | 5,878 |
| en | 1,211 |
| es | 897 |
| es-es | 576 |
| ... | ... |
I would like to see something like this:
| Language | Visits |
|----------|--------|
| it | 91,157 |
| en | 7,089 |
| es | 1473 |
|----------|--------|
Is it possible?
You can do an advanced filter at the profile level that will search and replace the language input field and keep only the first 2 letters.
If you want to keep the original language variations in your reports, you'll need to define your own dimension and use the tracking code (or Google Tag Manager) to fill it from the browser's language setting:
// this will extract 'it' from 'it-IT' or 'it-CH'
var primaryLanguage = navigator.language.match(/[^-]+/)[0];
ga('set', 'dimension1', primaryLanguage);
https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets
HTTP uses the IEFT Language Tag, so the primary language can be provided in different standards. It can consist of up to 8 letters. This usually won't be the case, but if you need to account for this, you need some extra logic to group languages from different standards.
I want to create an static drawing (say any animals like giraffe) using some points, lines, drawing etc. Now i want to update the drawing by passing the parameters say height of his legs, its width or its color.
The parameters are supplied from the web page. The image will be a 2D image
I am searching on which technology should i implement this for more than 10 hours but cannot find any perfect solution.
Right now i am thinking i can use Adobe flash in which i can do some programming to create an drawing and change the drawing by passing the parameters to a Flash file, i think we can pass it when we embed an flv.
Whether i am right? Or there is any other solution. I have no knowledge of any thing except asp.net
Please help.
Any help is appreciated
I'd like to build on the previous post - you could also incorporate svg graphics into the mix. This would allow you control over color, width, and height. You can manipulate SVG files with javascript (Dynamic SVG). You'll probably get that going faster than learning action script.
If you just want to be able to stretch or recolor parts of an image, you could do that using ordinary HTML parameters. Just create a giraffe image, break it into the chunks that you want to be able to resize independently, and use CSS layout or tables to assemble them. Here's an artistic rendering:
___________________________
|image 1 V__ <<|
|head |oo | <<| <--- delicious acacia leaves
| | < <<<|
---------------------------
|image 2 | | |
|neck |o| |
| | | |
---------------------------
|image 3 / | |
|body /------/ \ |
| | \ |
---------------------------
|image 4| | | | | | | | |
|legs | | | | | | | | |
| \_/ \_/ \_/ \_/ | <--- I do not know what giraffe feet look like
---------------------------
If you want to give your giraffe a short neck without changing anything else about it, you can just alter the height attribute of the second image, like so:
___________________________
|image 1 V__ <<|
|head |oo | <<|
| | < <<<|
---------------------------
|image 2 | | |
---------------------------
|image 3 / | |
|body /------/ \ |
| | \ |
---------------------------
|image 4| | | | | | | | |
|legs | | | | | | | | |
| \_/ \_/ \_/ \_/ |
---------------------------
Obviously, changing the width of just one image would cause the boundaries to no longer match up, so you'd need to change them all to the same value.
To handle color changes, you can make use of image transparency. Each image would be white, with a transparent region representing the giraffe. Then, you'd set the background color of the div or table cell to the color you want the giraffe to appear. Again, this is clunky, but it would let you do what you want without needing anything other than static GIF / PNG images and basic HTML.
From the get go: sorry if I'm not using the proper emacs terminology -- I'm relatively wet behind the ears in the emacs world.
Most of my work in emacs is for programming R, and I'm using ESS and ECB to do so quite happily. I'd like to build a custom ECB layout which uses the entire bottom of the screen as my R console, while putting some ECB-specific buffers on the left.
Using ECB-esque layout diagrams, I'd like my layout to look like pretty much exactly like "left13", except I'd like the entirety of the "compilation" buffer to be my running R console (or any shell, for that matter):
-------------------------------------------------------
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| Directories | Edit |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
-------------------------------------------------------
| |
| R Console |
| |
-------------------------------------------------------
If I can just split my buffer in two (vertically), then call ecb-activate from the top buffer (and not allow it to touch my bottom buffer), I'm imagining it could work (hence the subject of my question).
That doesn't work, though, and I don't know how to get an entier "bottom pane" out of a layout to work in the way I like using trying to use ECB's customize layout functionality.
Does anybody know if/how I can do this?
Short answer: No.
Longer answer: Unfortunately, ECB completely takes over Emacs "window" management at a very low level. So it's all or nothing. You can't comfortably combine it with regular window splitting. What you might be able to do, is to adjust the layout ECB gives you or to program a custom layout. (Some assembly required.)
Ok, not too sure where to start...
I'm putting myself together a blogger, completely gutting it's css and just using it as a simple content manager. here is the test site i've been working with
http://jamesparishtestblog.blogspot.com/
Ignore the header, its broken, but I know what I'm doing there. My problem is with the film reviews (stolen from apple trailers as temp content). As you resize the page, they flow fluidly into rows of different lengths. Great! Trouble is, the second row (and thus third, fourth, etc.) aligns itself vertically to the bottom of the longest (lowest) div in the above row. However, I want each div to fit neatly below the one above, 15px apart, and to flow neatly if another div is expanded (by clicking read more...).
Placing the divs in a column is ruled out, because I want the top row to contain the most recent posts side by side (with a column they would be below one another on the left hand side).
Set heights for the divs is ruled out too, because the articles need to expand, and for the full desired design, be mis-matched intentionally.
This has been troubling me for hours. I hope I've explained myself clearly, and that someone will can help.
Thanks for your time.
So you want this?
--------------------------
| __________ _______ |
| | | | | |
| | | | | |
| | | | | |
| ---------- | | |
| __________ | | |
| | | |_____| |
| | | _______ |
| | | | | |
| ---------- | | |
| ------- |
|________________________|
Without using columns you can't do it relying on CSS alone. You'd need to use some javascript or server side stuff to put things in the right place. Essentially you want a collage, too bad there's no "display: collage"!
Of course, I could be completely misunderstanding you.
Edit:
"any suggestions on the javascript front?"
I use mootools for almost all my sites. I'll define a bit there first:
dispose : takes an element out of the dom and stores it in a variable.
inject : plops an element into the dom.
I'd load these into columns, then dispose all the ones in the "recent" column and inject them back in to the top of the rest of the columns, one for each column. In other words, all the layout is done with CSS, the only javascript going on is putting your "recent" stuff as the top "row".