Awesome: Best Way to Implement/Use Shifty?

Howdy-ha, folks.  Here's my situation: Currently, I use Eminent to hide tags which aren't in use in the taglist, as I typically don't have more than two or three tags open.  Eminent does a decent job, but while most of my tags are dedicated categories or tasks, I have about a half-dozen apps I'd like to open in their own tags.  Now, while Eminent does what it does well enough, the problem I see is that it requires one to use the pre-defined tag scheme, which a) is limited the total of 9 tags; and b) hard-codes those tags to number keys in the order they're listed in rc.lua.  Since I'm dealing with either full-screen apps or groups of tiled apps, this would mean flipping from, say, tag 2 to tag 7, which with Eminent can get tedious, whereas with Shifty I could create a list of more than 9 tags that will be created and destroyed as necessary, and switch between two tags using "Mod + 1" and "Mod + 2."  Or at least, this is my understanding. 
The problem is that the Awesome wiki page on Shifty is outdated, with the last update coming in a full year ago (someone was polite enough to edit the page to state just that, without actually noting the changes that need to be made).  The instructions aren't at all clear to me (does "Remove all the existing tag creation/settings code from your rc.lua" mean every instance of the term "tag" that appears?  Because there whole sections seem to depend on a single instance of that term).  Moreover, most of the links on the page are dead, save for the link to bioe007's github, which contains shifty.rc.lua--which also appears outdated (as evidenced by the keybinding syntax and the fact that using it as the default config file results in Awesome returning to fallback mode, with "awesome -k" reporting no errors).  So how might I go about implementing this?  The closest thing to a real guide I've found so far is this; I've tried using that as a stand-in for my own config, I've tried diffing that as well as other configs on the Awesome wiki and shifty.rc.lua into my own config--no luck.  The closest I've come is just pasting the code on the Shifty page into my rc.lua, which results in the first "init = true" Shifty tag being created, plus my predefined tags, with no apparent extra functionality.  What's the best advice on going about this?  Am I just looking at this all wrong, or should I maybe just stick with Eminent for now, until I build my Lua chops?

Thanks for the feedback bioe007; over the past couple days I've managed to get Shifty working to a usable degree.  I did so by taking the example rc.lua you linked to and inserting bits of my config piecemeal; it was a little tedious, but it works well enough for now until I can get everything "just so." I do have a couple follow-up questions, for anyone able to help.
Firstly, I can't resize or move floating clients, or rearrange tiled clients, using "Modkey + [relevant mouse button]".  As near as I can tell, the relevant code for this is
{match = { "" }, buttons = {
awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
awful.button({ modkey }, 1, function (c) awful.mouse.client.move() end),
awful.button({ modkey }, 3, awful.mouse.client.resize ), }, },
but merely inserting it into my config file under the tag assignments (as per the Awesome wiki) has no effect.  What  am I missing here?  Here's my rc.lua for reference:
-- default rc.lua for shifty
-- Standard awesome library
require("awful")
-- Theme handling library
require("beautiful")
-- Notification library
require("naughty")
-- shifty - dynamic tagging library
require("shifty")
require("scratch")
require("revalation")
-- useful for debugging, marks the beginning of rc.lua exec
print("Entered rc.lua: " .. os.time())
-- {{{ Variable definitions
-- Themes define colours, icons, and wallpapers
-- The default is a dark theme
beautiful.init("/home/anoknusa/.config/awesome/themes/yum/theme.lua")
theme.wallpaper_cmd = { "/usr/bin/nitrogen --restore" }
awesome.font = ("anorexia 10")
-- Actually load theme
beautiful.init(theme_path)
-- This is used later as the default terminal and editor to run.
browser = "chromium"
terminal = "terminator"
editor = os.getenv("EDITOR") or "nano"
editor_cmd = terminal .. " -e " .. editor
-- Default modkey.
-- Usually, Mod4 is the key with a logo between Control and Alt.
-- If you do not like this or do not have such a key, I suggest you to remap
-- Mod4 to another key using xmodmap or other tools. However, you can use
-- another modifier like Mod1, but it may interact with others.
modkey = "Mod4"
-- Table of layouts to cover with awful.layout.inc, order matters.
layouts =
awful.layout.suit.tile,
awful.layout.suit.tile.left,
awful.layout.suit.tile.bottom,
awful.layout.suit.tile.top,
awful.layout.suit.fair,
awful.layout.suit.fair.horizontal,
awful.layout.suit.max,
awful.layout.suit.max.fullscreen,
awful.layout.suit.magnifier,
awful.layout.suit.floating
-- Define if we want to use titlebar on all applications.
use_titlebar = false
--{{{ Shifty configured tags.
shifty.config.tags = {
["[Chromium]"] = {
layout = awful.layout.suit.max,
mwfact = 0.70,
exclusive = false,
solitary = false,
position = 1,
init = true,
screen = 1,
persist = false,},
["[Util]"] = {
layout = awful.layout.suit.tile.bottom,
mwfact = 0.50,
exclusive = true,
solitary = true,
persist = false,
position = 2,},
["[Work]"] = {
layout = awful.layout.suit.tile.bottom,
mwfact = 0.50,
exclusive = false,
solitary = false,
persist = false,
position = 3,
slave = true},
["[What]"] = {
layout = awful.layout.suit.tile,
exclusive = false,
solitary = false,
persist = false,
position = 4},
["[Amarok]"] = {
layout = awful.layout.suit.maximum,
persist = false,
position = 4},
["[Okular]"] = {
layout = awful.layout.suit.maximum,
persist = false,
position = 4},
["[Comix]"] = {
layout = awful.layout.suit.maximum,
persist = false,
position = 4},
["[Media]"] = {
layout = awful.layout.suit.tile,
persist = false,
position = 4},
["[Media]"] = {
layout = awful.layout.suit.tile,
persist = false,
position = 4},
--{{{SHIFTY: application matching rules
-- order here matters, early rules will be applied first
shifty.config.apps = { buttons = clientbuttons,
{match = {"Chromium"}, honorsizehints = false, tag = "[Chromium]"},
{match = {"Dolphin", "Transmission", "Gpartedbin", "luckybackup"}, tag = "[Util]", nopopup = true},
{match = {"Meld", "Gtg"}, tag = "[Work]", slave = true},
{match = {"Kate", "lowriter"}, tag = "[Work]", nopopup = true},
{match = {}, tag = "[Work]",},
{match = {"Soundkonverter", "Easytag", "Audacity"}, tag = "[What]", nopopup = true},
{match = {"Comix", "Okular"}, tag = "[Reader]", nopopup = true},
{match = {"Vlc", "K9copy"}, tag = "[Media]", nopopup = true},
{match = {"Amarok"}, tag = "[Amarok]", nopopup = true},
{match = {"Gimp"}, tag = "[Gimp]", nopopup = true},
{match = {"Tomboy"}, slave = true},
{match = {terminal}, honorsizehints = false, slave = true},
{match = { "" }, buttons = {
awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
awful.button({ modkey }, 1, function (c) awful.mouse.client.move() end),
awful.button({ modkey }, 3, awful.mouse.client.resize ), }, },
--{{{SHIFTY: default tag creation rules
-- parameter description
-- * floatBars : if floating clients should always have a titlebar
-- * guess_name : should shifty try and guess tag names when creating
-- new (unconfigured) tags?
-- * guess_position: as above, but for position parameter
-- * run : function to exec when shifty creates a new tag
-- * all other parameters (e.g. layout, mwfact) follow awesome's tag API
shifty.config.defaults = {
layout = awful.layout.suit.tile.bottom,
ncol = 1,
mwfact = 0.60,
floatBars = false,
guess_name = true,
guess_position = true,
-- {{{Wibox
-- Create a textclock widget
mytextclock = awful.widget.textclock({ align = "right" }, "%a %b %d - %I:%M", 59)
-- Separator/Spacer icons
separator = widget({ type = "textbox", align = "left"})
separator.text = '<span color="#ab7c00"> || </span>'
space = widget({ type = "textbox" })
space.text = " "
-- Status Labels
c1 = widget({ type = "textbox" })
c1.text = "(1)"
c2 = widget({ type = "textbox" })
c2.text = "(2)"
rlabel = widget({ type = "textbox" })
rlabel.text = "Root:"
hlabel = widget({ type = "textbox" })
hlabel.text = "Home:"
vlabel = widget({ type = "textbox" })
vlabel.text = "<span color='#ab7c00'>Vol:</span>"
wlabel = widget({ type = "textbox" })
wlabel.text = "<span color='#ab7c00'>WiFi:</span>"
-- Separator/Spacer icons
separator = widget({ type = "textbox", align = "left"})
separator.text = '<span color="#ab7c00"> || </span>'
space = widget({ type = "textbox" })
space.text = " "
-- Status Labels
c1 = widget({ type = "textbox" })
c1.text = "(1)"
c2 = widget({ type = "textbox" })
c2.text = "(2)"
rlabel = widget({ type = "textbox" })
rlabel.text = "Root:"
hlabel = widget({ type = "textbox" })
hlabel.text = "Home:"
vlabel = widget({ type = "textbox" })
vlabel.text = "<span color='#ab7c00'>Vol:</span>"
wlabel = widget({ type = "textbox" })
wlabel.text = "<span color='#ab7c00'>WiFi:</span>"
-- Create a laucher widget and a main menu
myawesomemenu = {
{"manual", terminal .. " -e man awesome"},
{"edit config",
editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua"},
{"restart", awesome.restart},
{"quit", awesome.quit}
mymainmenu = awful.menu(
{items = {{"awesome", myawesomemenu, beautiful.awesome_icon},
{"open terminal", terminal}}
mylauncher = awful.widget.launcher({image = image(beautiful.awesome_icon),
menu = mymainmenu})
-- Create a systray
mysystray = widget({type = "systray", align = "right"})
-- Create a wibox for each screen and add it
mywibox = {}
mypromptbox = {}
mylayoutbox = {}
mytaglist = {}
mytaglist.buttons = awful.util.table.join(
awful.button({ }, 1, awful.tag.viewonly),
awful.button({ modkey }, 1, awful.client.movetotag),
awful.button({ }, 3, awful.tag.viewtoggle),
awful.button({ modkey }, 3, awful.client.toggletag),
awful.button({ }, 4, awful.tag.viewnext),
awful.button({ }, 5, awful.tag.viewprev)
mytasklist = {}
mytasklist.buttons = awful.util.table.join(
awful.button({ }, 1, function (c)
if c == client.focus then
c.minimized = true
else
if not c:isvisible() then
awful.tag.viewonly(c:tags()[1])
end
-- This will also un-minimize
-- the client, if needed
client.focus = c
c:raise()
end
end),
awful.button({ }, 3, function ()
if instance then
instance:hide()
instance = nil
else
instance = awful.menu.clients({ width=250 })
end
end),
awful.button({ }, 4, function ()
awful.client.focus.byidx(1)
if client.focus then client.focus:raise() end
end),
awful.button({ }, 5, function ()
awful.client.focus.byidx(-1)
if client.focus then client.focus:raise() end
end))
for s = 1, screen.count() do
-- Create a promptbox for each screen
mypromptbox[s] =
awful.widget.prompt({layout = awful.widget.layout.horizontal.leftright})
-- Create an imagebox widget which will contains an icon indicating which
-- layout we're using. We need one layoutbox per screen.
mylayoutbox[s] = awful.widget.layoutbox(s)
mylayoutbox[s]:buttons(awful.util.table.join(
awful.button({}, 1, function() awful.layout.inc(layouts, 1) end),
awful.button({}, 3, function() awful.layout.inc(layouts, -1) end),
awful.button({}, 4, function() awful.layout.inc(layouts, 1) end),
awful.button({}, 5, function() awful.layout.inc(layouts, -1) end)))
-- Create a taglist widget
mytaglist[s] = awful.widget.taglist.new(s,
awful.widget.taglist.label.all,
mytaglist.buttons)
-- Create a tasklist widget
mytasklist[s] = awful.widget.tasklist.new(function(c)
return awful.widget.tasklist.label.currenttags(c, s)
end,
mytasklist.buttons)
-- Create the wibox
mywibox[s] = awful.wibox({position = "top", height = 16, screen = s})
-- Add widgets to the wibox - order matters
mywibox[s].widgets = {
mylauncher, space,
mytaglist[s],
mypromptbox[s],
layout = awful.widget.layout.horizontal.leftright
mylayoutbox[s],
mytextclock,
s == 1 and mysystray or nil,
mytasklist[s],
layout = awful.widget.layout.horizontal.rightleft
mywibox[s].screen = s
end
--{{{SHIFTY: initialize shifty
-- the assignment of shifty.taglist must always be after its actually
-- initialized with awful.widget.taglist.new()
shifty.taglist = mytaglist
shifty.init()
-- {{{Mouse bindings
root.buttons({
awful.button({}, 3, function() mymainmenu:toggle() end),
awful.button({}, 4, awful.tag.viewnext),
awful.button({}, 5, awful.tag.viewprev)
-- disable startup-notification globally
local oldspawn = awful.util.spawn
awful.util.spawn = function (s)
oldspawn(s, false)
end
-- {{{ Key bindings
globalkeys = awful.util.table.join(
awful.key({ modkey, }, "Left", awful.tag.viewprev ),
awful.key({ modkey, }, "Right", awful.tag.viewnext ),
awful.key({ modkey, }, "Escape", awful.tag.history.restore),
awful.key({ modkey, }, "j",
function ()
awful.client.focus.byidx( 1)
if client.focus then client.focus:raise() end
end),
awful.key({ modkey, }, "k",
function ()
awful.client.focus.byidx(-1)
if client.focus then client.focus:raise() end
end),
awful.key({}, "Menu", function () mymainmenu:show({keygrabber=true}) end),
awful.key({ modkey }, "b", function ()
mywibox[mouse.screen].visible = not mywibox[mouse.screen].visible
end),
-- Shifty: keybindings specific to shifty
awful.key({modkey, "Shift"}, "d", shifty.del), -- delete a tag
awful.key({modkey}, "/", shifty.send_next), -- client to next tag
awful.key({modkey, "Control"}, "n", function()
shifty.tagtoscr(awful.util.cycle(screen.count(), mouse.screen + 1))
end), -- move client to next tag
awful.key({modkey}, "a", shifty.add), -- creat a new tag
awful.key({modkey,}, "r", shifty.rename), -- rename a tag
awful.key({modkey, "Shift"}, "a", -- nopopup new tag
function()
shifty.add({nopopup = true})
end),
awful.key({modkey,}, "j",
function()
awful.client.focus.byidx(1)
if client.focus then client.focus:raise() end
end),
awful.key({modkey,}, "k",
function()
awful.client.focus.byidx(-1)
if client.focus then client.focus:raise() end
end),
awful.key({modkey,}, "w", function() mymainmenu:show(true) end),
-- Volume Control
awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer set Master 2+") end),
awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("amixer set Master 2-") end),
-- Power Management
awful.key({ }, "XF86PowerOff", function () awful.util.spawn("obshutdown") end),
awful.key({modkey, }, "XF86PowerOff", function () awful.util.spawn("sudo pm-suspend") end),
-- Brightness Control
awful.key({modkey }, "F6", function () awful.util.spawn("xbacklight -dec 50") end),
awful.key({modkey }, "F7", function () awful.util.spawn("xbacklight -inc 50") end),
-- Dmenu
--awful.key({modkey }, "space", function()
--awful.util.spawn_with_shell( "dmenu_run -p 'Arch Linux' -nf '#838383' -nb '#1b1b1b' -sf '#B50000' -sb '#838383'")
--end),
awful.key({ modkey }, "space", function ()
awful.util.spawn("dmenu_run -i -p 'Arch Linux' -nb '" ..
beautiful.bg_normal .. "' -nf '" .. beautiful.fg_normal ..
"' -sb '" .. beautiful.bg_focus ..
"' -sf '" .. beautiful.fg_focus .. "'") end),
-- Lock Screen
awful.key({modkey }, "F1", function () awful.util.spawn("slimlock") end),
-- Turn off touchpad
awful.key({modkey, "Shift" }, "x", function () awful.util.spawn("touchoff") end),
-- Revalation
awful.key({ modkey }, "e", revelation.revelation),
-- Drop-down terminal
awful.key({}, "F12", function () scratch.drop("terminator", "top", "center", 1, .70) end),
-- Print Screen
awful.key({ }, "Print", function () awful.util.spawn("ksnapshot") end),
-- Layout manipulation
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end),
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end),
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end),
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end),
awful.key({ modkey, }, "u", awful.client.urgent.jumpto),
awful.key({ modkey, }, "Tab",
function ()
awful.client.focus.history.previous()
if client.focus then
client.focus:raise()
end
end),
-- Standard program
awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end),
awful.key({ modkey, "Control" }, "r", awesome.restart),
awful.key({ modkey, "Shift" }, "q", awesome.quit),
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end),
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end),
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end),
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end),
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end),
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end),
awful.key({ modkey, }, ",", function () awful.layout.inc(layouts, 1) end),
awful.key({ modkey, }, ".", function () awful.layout.inc(layouts, -1) end),
awful.key({ modkey, "Control" }, "n", awful.client.restore),
-- Prompt
awful.key({ modkey, }, "r", function () mypromptbox[mouse.screen]:run() end),
awful.key({ modkey }, "x",
function ()
awful.prompt.run({ prompt = "Run Lua code: " },
mypromptbox[mouse.screen].widget,
awful.util.eval, nil,
awful.util.getdir("cache") .. "/history_eval")
end)
clientkeys = awful.util.table.join(
awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end),
awful.key({ modkey }, "F4", function (c) c:kill() end),
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ),
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
awful.key({ modkey, }, "o", awful.client.movetoscreen ),
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end),
awful.key({ modkey, }, "n",
function (c)
-- The client currently has the input focus, so it cannot be
-- minimized, since minimized clients can't have the focus.
c.minimized = true
end),
awful.key({ modkey, }, "m",
function (c)
c.maximized_horizontal = not c.maximized_horizontal
c.maximized_vertical = not c.maximized_vertical
end)
-- SHIFTY: assign client keys to shifty for use in
-- match() function(manage hook)
shifty.config.clientkeys = clientkeys
shifty.config.modkey = modkey
-- Compute the maximum number of digit we need, limited to 9
for i = 1, (shifty.config.maxtags or 9) do
globalkeys = awful.util.table.join(globalkeys,
awful.key({modkey}, i, function()
local t = awful.tag.viewonly(shifty.getpos(i))
end),
awful.key({modkey, "Control"}, i, function()
local t = shifty.getpos(i)
t.selected = not t.selected
end),
awful.key({modkey, "Control", "Shift"}, i, function()
if client.focus then
awful.client.toggletag(shifty.getpos(i))
end
end),
-- move clients to other tags
awful.key({modkey, "Shift"}, i, function()
if client.focus then
t = shifty.getpos(i)
awful.client.movetotag(t)
awful.tag.viewonly(t)
end
end))
end
-- Set keys
root.keys(globalkeys)
-- {{{ Naughty settings
naughty.config.notify_callback = function(args)
awful.util.spawn("twmnc -c '" .. args.text .. "' -t '" .. args.title .. "'")
return nil
end
-- {{{Hooks
-- Hook function to execute when focusing a client.
client.add_signal("focus", function(c)
if not awful.client.ismarked(c) then
c.border_color = beautiful.border_focus
end
end)
-- Hook function to execute when unfocusing a client.
client.add_signal("unfocus", function(c)
if not awful.client.ismarked(c) then
c.border_color = beautiful.border_normal
end
end)
-- Naughty / TWMN
naughty.config.notify_callback = function(args)
awful.util.spawn("twmnc -c '" .. args.text .. "' -t '" .. args.title .. "'")
return nil
end
-- vim: fdm=marker:tw=80:
The second issue is that, when switching tags, a client won't grab focus unless I pass the mouse pointer over its entry in the tasklist; even clicking on the window has no effect.  I have no idea what the issue may be there.
Thanks in advance to anyone who can help.

Similar Messages

  • Best way to implement m to n relation?

    Could you please give me some advice on the best way to implement m-n relations in apex?
    Example: I want to store server and database info. A server can have multiple database of course. But in case of a RAC database, the database can be running on multiple servers. So I have tables:
    create table SERVERS (id number primary key, name varchar2(30));
    create table DATABASES(id number primary key, name varchar2(30))
    and an m-to-n table
    create table SERV_DB(serv_id number references SERVERS(id), db_id number references DATABASES(id), instance_name varchar2(30))
    So the table SERV_DB can tell me e.g. that database PROD is running on server 'prdsrv1' with instance PROD1 and on server 'prdsrv2' with instance name PROD2
    How would you design an apex page to maintain this information (adding relations, updating instance names, etc)? I have a solution using checkboxes and 2 for-loops over htmldb_application.g_f40 (to process checkboxes) and g_f41 (to process text fields with instance names) and some delete statements but the logic behind it looks too complex for me. I am convinced that this can be done more simpler. Seems like a common problem to me, so I wonder if there is no out-of-the-box solution in apex for this?
    Could you please show me or create a small demo application with the solution that looks most elegant to you?
    Thanks,
    Geert

    Thanks for your reply. You modified the question slightly, but conceptually it is still the same. What you call the instances table corresponds with my serv_db table. I understand the solution you propose using the tabular report. If I see it correctly, you would have an insert button above the tabular report for each new relation (instance - server) you would want to add. This is ok for the case i used (databases, servers, instances) because there are relatively few relations. However I would not like this solution for other cases. E.g.:
    case: you have a list of persons and a list of tasks. You want to assign tasks to persons in a way that each person has multiple tasks to do and each task can be assigned to multiple persons.
    Suppose you add a new person, and you want to assign 15 tasks to him. The solution above (with the tabular report) would be quite some work because you would have to click 15 times on the insert button and on each click select a task from the select list. In this case it would be more appropriate to, after selecting the new person, see a list of all tasks (e.g. 30 tasks) with a checkbox in front, so you can mark 15 out of the 30 checkboxes and press submit. It gets more complex when you want to assign also an attribute to the relation, i.e. showing the list with all tasks, a checkbox in front and a select list next to each task where you can choose from e.g. "priority high" or "priority low" to indicate that this task is high or low priority for that person. Is there an easy way to implement that?

  • Displaying Multiple Values on GUI components - best way to implement

    Hi,
    my program needs to implement a basic function that most commercial programs use very widely: If the program requires that a GUI component (say a JTextField) needs to display multiple values it either goes <blank> or say something more meaningfull like "multiple values". What is the best way of implementing it?
    In particular:
    My data is a class called "Student" that among other things has a field for the student name, like: protected String name; and the usual accessor methods (getName, setName) for it.
    Assuming that the above data (i.e. Student objects) is stored in a ListModel and the user can select multiple "Students", if a JTextField is required to display the user selection (blank for multiple selections, or the student "name" for a single selection), what is the best (OO) way of implementing it? Is there any design pattern (best practice) for this basic piece of functionality? A crude way is to have the JTextField check and compare all the time the user selections one by one, but I'm sure there must be a more OO/better approach.
    Any ideas much appreciated.
    Kyri.

    Ok, I will focus on building a solution on 12c.
    right now I have used a USER_DATASTORE with a procedure to glue all the field together in one document.
    This works fine for the search.
    I have created a dummy table on which the index is created and also has an extra field which contains the key related to all the tables.
    So, I have the following tables:
    dummy_search
    contracts
    contract_ref
    person_data
    nac_data
    and some other tables...
    the current design is:
    the index is on dummy_search.
    When we update contracts table a trigger will update dummy_search.
    same configuration for the other tables.
    Now we see locking issues when having a lot of updates on these tables as the same time.
    What is you advice for this situation?
    Thanks,
    Edward

  • What is the best way to implement a cluster-wide object ID generator?

    What is the best way to implement a cluster-wide object ID generator?

    What is the best way to implement a cluster-wide
    object ID generator?Always use 3 because it is prime.
    Alternatively more information about the system and the needs of the system might prompt alternative ideas some of which are likely to be better than others for your particular implementation and system constraints.

  • Best way to implement this code in labview

    Hi
    What is the best way to implement this code in labview programming.
    I have an analogue input which triggers a boolean light when it reaches a certain voltage. but at the same time i would like it to enable two other outputs one for a set period of time and the other stay on until another statement becomes true.
    For example
    case 1:
    Set output high
    Delay(2000ms)
    Set output low
    Case 2:
    Set output high
    If statement 2 is true
    then set out put low
    if not then repeat until statement is true
    Thanks for your help

    Hi David,
    The code you posted will work, although note that the front panel becomes 'unresponsive' - as changes in the controls are only read once per iteration.  The wait function is an example of an execution timing VI, however if we want to do software timing (like a 2 hour wait) - we should use software timing VIs.
    Check out the following example (note we can stop execution during run-time):
    Regards,
    Peter D
    Attachments:
    SoftwareTiming.vi ‏26 KB

  • Best way to implement FREE purchase?

    Hi,
    I have purchases that are free for logged in users. What's the best way to implement a no-payment solution? Would having the payment fields hidden and COD auto-selected if the amount field is 0.00 a good idea? Is there a better way anyone has implemented this? And how about security flaws?

    Hi
    Here is an article about "no cost" orders
    COD payment method will not work for zero value orders , you will need to use the Free payment method described
    in this article http://kb.worldsecuresystems.com/893/bc_893.html
    Hope this helps!

  • What is the best way to implement Carousel i.e. web part in a site page on office 365 site?

    We can implement the Carousel web part in many ways like content By Query Web Part , jquery (nivo) plugin or content search web part etc. But among these which one is the best way to implement to get best performance of the page?
    Thanks

    content search web part always provides best performance because it uses the search. only consideration you need to take is, it does not display the changes immediately and you need to wait for the incremental crawl to happen.
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • Best way to implement service in 3-tier webarchitecture

    Hi,
    What would be the best way to implement a service in the following 3-tier TopLink architecture: no ejb and a webclient (jsp/servlets)?
    Currently I have a server session type and a service pojo using a singleton SessionFactory. The service pojo is used by the jsp/servlets.
    Should the service pojo be a singleton? Should a SessionManager be used?
    In the examples on OTN a clientsession is directly acquired in the jsp/servlets.
    Thanks,
    Ronald

    Ronald,
    There are numerous ways to do this. I would recommend using the SessionFactory. The SessionFactory makes use of the SessionManager, which holds onto the singleton Server session. You can then acquire client sessions using the oracle.toplink.sessions.Session interface from the SessionFactory. There is no need to hold the SessionFactory in a singleton yourself and you do not need to reference the ClientSession directly either.
    We have introduced this latest approach to simplify coding. It will work in both the web architecture with JSP/Servlets accessing the sessions as well as within an EJB tier (Session/Message Driven beans).
    Doug

  • What is the best way to implement writable many-to-many relations

    As everyone knows, the many-to-many associations provided by BC4J are quite good to read many-to-many associations, but they are not able to write such associations.
    There are other solutions using composite associations or cascading-delete foreign keys, but as I was tought now, they are also quite problematic. See thread Internal error: Entity.afterRollback.status_dead   -- What does this mean? for more details.
    So I ask you: What is the best way to implement writable many to many associations? Do you really have to manage them "by hand"?
    Thanks for your ideas
    Frank

    I'd appreciate any hint
    Thanks

  • Event Structures​-best way to implement this UI?

    I am trying to write a VI to control & read data from 4 different "channels" (each measuring a DUT) at once.  I have written all the VI's for initializing instruments, communicating with the devices (VISA, GPIB), setting bias, reading data, etc...that has all completed. I just need to write the overall program with the user interface to allow the user to control these 4 channels & display the measured data.....as it turns out, this is the tricky part! My head is spinning from trying to figure out how to handle all the possible events.
    Basically for each channel, I want the user to be able to
    -enable/disable it  for measurement (e.g. if  there is no device loaded in Ch.3, we don't want to measure Ch.3..maybe disable/grey everything)
    -set bias conditions (only if channel enabled). Allow user to change bias "in real-time" by increment/decrementing (e.g. incrementing from 5.00 V to 5.01 V, for example).
    -turn biasing on/off (again, only if channel is enabled)
    Also,  I want each channel to display its measured data (e.g current, temperature reading)..every second or so. No graphs or anything fancy (for now! ), just numeric indicator. 
    Honestly, this all sounds so simple but I'm having trouble figuring out the best way to implement this, due to the fact that 1) there are multiple channels needing to be monitored for events  2) large number of user events that could occur (seems like at least 4 per channel - enabling/disabling, turning bias on/off, incrementing/decrementing bias values, etc ), Also the if a channel IS enabled, i want to be continously reading/displaying the data.  What is the best way to handle this? Should i have 4 separate while loops, each with an event structure to handle events for that particular channel..or will that give me grief somewhre? 
    Also, I have another nagging question. Pretty much all the examples I see re: Event Structures and booleans involve latched booleans, eg. buttons that are just pressed once and pop back up...e.g. buttons you press to tell it to complete a task (e.g. "Acquire Data" or "Stop") , and once it's pressed it's over and reset.  In my case, some of the booleans would not be latched...e.g. the "Enable Ch.2" button would be 'TRUE" as long as i want Ch. 2 to be read....does that make sense? Then, say hours later,  if i did want to disable that channel,  i would change it to "FALSE" and while that would be an "value change", the new value would not be "TRUE"..does that make sense? So  not sure if that would be dealt with the same way in an Event Structure. 
    Hope this all makes sense and many thanks in advance for any help!!!

    You're halfway there. I'd say the best solution is a producer/consumer structure, the event structure is used to generate queued commands to the consumer loop.
    All data is handled in the consumer loop, where you among other things have an array of clusters of channel/instrument settings. (I usually have several cluster, one for test data, one for instrument settings, one for general settings and so on)
    The event structure can have a 1 sec timeout, in which you queue up a Measure command.
    In the consumer, in the measure state you loop through your instruments and if enabled you measure them and update their indicators.
    The general (smart) way to setup the queue is with a cluster containing 2 elements, a typedef'd Command and a variant.
    This way you can send data with the command in any form which is then interpreted in the consumer.
    If, e.g. you press the Enable button on a channel, you can enqueue Enable and the channel number.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • Best way to implement DataGrid in JSP

    Hi,
    Can anyone please guide me as to what is the best way to implement a DataGrid in JSP ?
    Thanks in advance.
    -Sharada

    Thanks James.
    I guess I can use the JSP Datagrid taglib as well.
    My main purpose is to have the functionality of updating the cells, resetting cells, ability to perform aggregate of rows and columns.
    Also, I have another table which will have rows that are an aggregate of all the rows in above datagrid.
    Please let me know if you have any other ideas.
    Thanks,
    Sharada

  • Best way to implement connection pooling with tomcat4.0?

    Hi all!
    I need your help:
    What's the best way to implement connection pooling (Oracle Database) with tomcat 4.0?
    I only found ways to implement it in tomcat 4.1, not in 4.0....
    Thanks!
    Michael

    You can use a Datasource managed by tomcat. Earlier versions of tomcat used Exolab's Tyrex for the implementation of the Datasource API which uses connection pooling. Current version uses commons-dbcp and commons-pool (jakarta projects) I think.
    You've got to declare the Datasource in server.xml and then in web.xml of your web app.

  • Best way to implement request-response and still reliability

              HI,
              what is the best way to implement a request -response paradigm and still have
              the reliability that message will be 100% processed and give response...do i need
              to create the permanant queues with storage..
              anybody gives suggestions..
              Akhil
              

    Hi Akhil,
              Temporary destinations can only store non-persistent messages
              as per JMS spec - so they are not useful for reliable for holding
              responses that must survive longer than the life of the
              interested client. For persistence, you will need to use configured
              queues or durable subscriptions. For detailed
              discussion of request/response, I suggest reading the "WebLogic JMS
              Performance Guide" white-paper on dev2dev.bea.com. If you
              have many clients, or expect large message back-logs,
              there can be a performance impact when using selectors...
              FYI: There is a new pub/sub subscriber index enhancement
              that is available in 8.1 and
              in the latest service-packs for 6.1, 7.0.
              "Indexing Topic Subscriber Message Selectors To Optimize Performance"
              http://edocs.bea.com/wls/docs81/jms/implement.html#1294809
              This may be useful.
              Tom, BEA
              Akhil Nagpal wrote:
              > HI,
              > what is the best way to implement a request -response paradigm and still have
              > the reliability that message will be 100% processed and give response...do i need
              > to create the permanant queues with storage..
              >
              > anybody gives suggestions..
              > Akhil
              

  • Best way to implement auto increment in JPA.

    What is the best way to implement auto increment in JPA so that it will support all databases such as MySQL, MSSQL Server, Oracle etc. ? Or is there any way to set auto increment strategy in common place such as persistence.xml? Please help...

    All JPA strategies require something (like a table or sequence object) be in the database, with table sequencing being the most portable, though EclipseLink does allow custom sequence stratgies where you could use something else, such as the UUID. Sequencing is described here described here http://wiki.eclipse.org/EclipseLink/Examples/JPA/PrimaryKey with a custom UUID example shown here http://wiki.eclipse.org/EclipseLink/Examples/JPA/CustomSequencing .

  • Best way to implement Aperture on a shared Mac

    I'm looking for some suggestions on the best way to implement Aperture on my work computer.  It's a 15" MacBook Pro Retina.  Since I don't own the laptop, can I just run Aperture from an external drive in case I have to give the computer up on short notice?  I have a 1 TB Lacie drive (USB 3.0) that currently holds a copy of all of my images.  I don't currently have Aperture, so this would be a completely new install.
    I know I can keep the images on the external drive as Referenced files, but what about the Library?  Can (or should) it be stored on the external drive?  If not, would a backup copy on the external drive (perhaps using Vault) be sufficient for portability?  For example, if I have to give the laptop back could I simply hook the Lacie up to a new MacBook, install Aperture, restore the latest Vault backup and be up and running?
    Any thoughts (pro & con) would be appreciated.

    If you use a fast drive with a relatively fast port (Thunderbolt, USB 3) you can keep your Aperture library on the external volume. But I would keep the Aperture application on the internal drive. If you buy Aperture from the AppStore, your licence would entitle you to install Aperture on any Mac you own or control - for private purposes. So while you have the work computer and control it, you can use Aperture there - for private purposes. Simply delete the app when you return it and unplug your external drive.
    For example, if I have to give the laptop back could I simply hook the Lacie up to a new MacBook, install Aperture, restore the latest Vault backup and be up and running?
    That would work.
    Make sure, your Lacie drive is formatted MacOS X Extended (Journaled), and set the "Ignore Ownership on this volume" flag. I assume, you are using different account names on the two macs.
    You should be able to download Aperture again to your new MacBook, if you use the same AppleID.

Maybe you are looking for

  • Add section title to header/footer? Using Pages 5.2 (or later)

    I couldn't find a way to automatically have the title of the current section in the header or footer of a document. Potentially I am missing something, I haven't tried to do this before, but it seems like a basic function of having a TOC in the first

  • Resolution for 15.4 inch screen laptop pro?

    Anyone know the natural resolution for the 15.4 inch screen. When I was browsing the different sizes it didn't give me a chance to restore it back to the way it was. I went to System preferences and display. I'm guessing it's 1440 by 900, is this cor

  • XE Oracle Database Express  Beta

    I've just downloaded the new beta Oracle XE database. Database up and running but having trouble accessing the HTMLDB app (see error below). Maybe this is not the appropriate forum but am unable to connect to the XE specific Tom Kyte forum using my O

  • Should I install Windows 7 as 32-bit or 64-bit?

    I just purchased a mid 2011 MacBook Air. (11" 1.6GHz Core i5, 4 GB RAM, Lion 10.7.1.) My ultimate goal is to run PowerPoint and an TurningPoint audience response system that plugs into PowerPoint.  TurningPoint says it runs as either 32-bit or 64-bit

  • Hey guys.... quick question about Restoring..

    I presently have a blackberry pearl 8100 for tmobile. And I just bought a  BB Curve 8320..which should be arriving some time next week..My question is..can I use my present restores or backups on my bb curve? because i have alot of text messages I wa