join on two merges hive
Hi am trying to join two tables in Hive. The two tables are like
Select r.count as edits ,d.views as views
From(
Select substr(r.time,1,6) as Time, count(r.revisionID) as
count,collect_set(p.title)[0] as title
from pages p
join revisions r on p.pageID = r.pageID
where p.namespace = 0
group by substr(r.time,1,6) ) r join views d on d.time =r.Time and r.title
= d.title
The table from the subquery should be somthing like:
200812,121,Germany
....
The second one (the views) is something like
200812,99,Germany
Now I am trying to join the both and the match should only happen when the
title AND the time is equal. But the query above does not work. Any help
would be really appreciated!
Monday, 19 August 2013
Is it possible to export data from Facebook's graph search?
Is it possible to export data from Facebook's graph search?
I'm trying to find a way of getting the location of friends of friends
(town/city and country) and plot them on a map.
I can easily search for "Friends of my friends" but is there a way of
exporting the results to CSV, json, or some other easily parsed format?
I'm trying to find a way of getting the location of friends of friends
(town/city and country) and plot them on a map.
I can easily search for "Friends of my friends" but is there a way of
exporting the results to CSV, json, or some other easily parsed format?
Sunday, 18 August 2013
have problems in Linking multiple JComboBox in JTable one time
have problems in Linking multiple JComboBox in JTable one time
I got a quite tricky problem when I do some code on JTable
I need to add one line In JTable when I click "Add" button, and I want one
of the columns to render as a JComboBox
the problem is that when I only add one line, it works fine. but when I
add multiple lines a time, no matter which combobox I choose item from, It
will always trigger the last comboBox's event(seems always the same
combobox since I have printed the hashcode of jComboBox in
MyComboxActionListener class. it's the same).
why is that happens , I can't figure it out. Since It's totally a new
comboBox and a new listener when I add one line.
Following is the code.
Thanks in advance.
private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {
ProducedProcedure_new addedProducedProcedure = new
ProducedProcedure_new(); // the new item
componentProcedureTableModel.getWorks().add(addedProducedProcedure);
//add one line to the table
componentProcedureTableModel.fireTableRowsInserted(componentProcedureTableModel.getRowCount()-1,
componentProcedureTableModel.getRowCount()-1);
jTable1.changeSelection(componentProcedureTableModel.getRowCount()-1,0,
false, false);
List<String> procedureNames =
produceCardManager.getProcedureNames(componentIdTextField.getText().trim(),false);
//get the items added to combobox
renderColumnAsCombox(1,procedureNames,addedProducedProcedure);
//-------------------------------------------
}
void renderColumnAsCombox(int columnIndex , List<String>
items,ProducedProcedure_new producedProcedure) {
TableColumn col = jTable1.getColumnModel().getColumn(columnIndex);
JComboBox comboBox = new JComboBox();
for(String item : items) {
comboBox.addItem(item);
}
MyComboxActionListener myComboxActionListener = new
MyComboxActionListener(columnIndex,comboBox,producedProcedure);
comboBox.addActionListener(myComboxActionListener);
col.setCellEditor(new DefaultCellEditor(comboBox));
}
class MyComboxActionListener implements ActionListener { // listen for
the select event of the combobox
private JComboBox jComboBox;
private ProducedProcedure_new producedProcedure;
private int columnIndex;
public MyComboxActionListener(int columnIndex,JComboBox
jComboBox,ProducedProcedure_new producedProcedure) {
this.columnIndex = columnIndex;
this.jComboBox = jComboBox;
this.producedProcedure = producedProcedure;
}
@Override
public void actionPerformed(ActionEvent e) {
String selectedItem = (String)jComboBox.getSelectedItem();
producedProcedure.getProcedure().setProcedureName(selectedItem);
producedProcedure.getProcedure().setProcedureId(String.valueOf(produceCardManager.getProcedureId(selectedItem)));
producedProcedure.getProcedure().setFactor(produceCardManager.getProcedureFactor(selectedItem));
//automately update the factor
((ComponentProcedureTableModel_new)jTable1.getModel()).fireTableDataChanged();
}
}
I got a quite tricky problem when I do some code on JTable
I need to add one line In JTable when I click "Add" button, and I want one
of the columns to render as a JComboBox
the problem is that when I only add one line, it works fine. but when I
add multiple lines a time, no matter which combobox I choose item from, It
will always trigger the last comboBox's event(seems always the same
combobox since I have printed the hashcode of jComboBox in
MyComboxActionListener class. it's the same).
why is that happens , I can't figure it out. Since It's totally a new
comboBox and a new listener when I add one line.
Following is the code.
Thanks in advance.
private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {
ProducedProcedure_new addedProducedProcedure = new
ProducedProcedure_new(); // the new item
componentProcedureTableModel.getWorks().add(addedProducedProcedure);
//add one line to the table
componentProcedureTableModel.fireTableRowsInserted(componentProcedureTableModel.getRowCount()-1,
componentProcedureTableModel.getRowCount()-1);
jTable1.changeSelection(componentProcedureTableModel.getRowCount()-1,0,
false, false);
List<String> procedureNames =
produceCardManager.getProcedureNames(componentIdTextField.getText().trim(),false);
//get the items added to combobox
renderColumnAsCombox(1,procedureNames,addedProducedProcedure);
//-------------------------------------------
}
void renderColumnAsCombox(int columnIndex , List<String>
items,ProducedProcedure_new producedProcedure) {
TableColumn col = jTable1.getColumnModel().getColumn(columnIndex);
JComboBox comboBox = new JComboBox();
for(String item : items) {
comboBox.addItem(item);
}
MyComboxActionListener myComboxActionListener = new
MyComboxActionListener(columnIndex,comboBox,producedProcedure);
comboBox.addActionListener(myComboxActionListener);
col.setCellEditor(new DefaultCellEditor(comboBox));
}
class MyComboxActionListener implements ActionListener { // listen for
the select event of the combobox
private JComboBox jComboBox;
private ProducedProcedure_new producedProcedure;
private int columnIndex;
public MyComboxActionListener(int columnIndex,JComboBox
jComboBox,ProducedProcedure_new producedProcedure) {
this.columnIndex = columnIndex;
this.jComboBox = jComboBox;
this.producedProcedure = producedProcedure;
}
@Override
public void actionPerformed(ActionEvent e) {
String selectedItem = (String)jComboBox.getSelectedItem();
producedProcedure.getProcedure().setProcedureName(selectedItem);
producedProcedure.getProcedure().setProcedureId(String.valueOf(produceCardManager.getProcedureId(selectedItem)));
producedProcedure.getProcedure().setFactor(produceCardManager.getProcedureFactor(selectedItem));
//automately update the factor
((ComponentProcedureTableModel_new)jTable1.getModel()).fireTableDataChanged();
}
}
Kinivo BTD-300 Bluetooth 3.0 dongle driver driver NOT on Kinivo site
Kinivo BTD-300 Bluetooth 3.0 dongle driver driver NOT on Kinivo site
Relevant Specs:
OS: Win7 Home Premium
Machine: Acer Aspire 6676-7739g w/RAM upgraded to 8GB
Preamble:
I purchased a few months ago a Kinivo BTD-300 Bluetooth 3.0 USB dongle,
and thus far have had very little issue with it. Today however, the thing
didn't want to connect to my Bluetooth headset like it's been doing ever
since I bought it, so I removed the headset from Bluetooth devices
intending to re-pair it. However, the system wouldn't find the headset,
despite being right next to each other and both devices being
discoverable. In my very-pissed-off-from-something-else state, I've no
idea why I thought uninstalling the dongle would be a good idea, but I
did, and now when I try reinstalling, the system DOES NOT recognize the
dongle, and the Kinivo support site DOES NOT offer the files in the
mini-CD that comes with the device.
The "fun" part is that for reasons unrelated to this question, I no longer
have the box/blister where the device came when I bought it, which had the
disc with the drivers inside.
The Question:
Does anybody here happen to have the same BT dongle that can facilitate me
a copy of the files in the included CD for this device via ISO or some
other way? I realize this is partly my own fault for not backing up the
drivers from the included disc, but considering that I had saved the box
with all its contents, even the instruction manual until my work room got
"cleaned up" by the maid, I did not even come close to suspecting I'd EVER
lose that box. Now I'm stuck with a completely useless dongle that Win7
won't install, and despite my extensive Google-fu, these drivers
apparently don't exist ANYWHERE on the internet.
Relevant Specs:
OS: Win7 Home Premium
Machine: Acer Aspire 6676-7739g w/RAM upgraded to 8GB
Preamble:
I purchased a few months ago a Kinivo BTD-300 Bluetooth 3.0 USB dongle,
and thus far have had very little issue with it. Today however, the thing
didn't want to connect to my Bluetooth headset like it's been doing ever
since I bought it, so I removed the headset from Bluetooth devices
intending to re-pair it. However, the system wouldn't find the headset,
despite being right next to each other and both devices being
discoverable. In my very-pissed-off-from-something-else state, I've no
idea why I thought uninstalling the dongle would be a good idea, but I
did, and now when I try reinstalling, the system DOES NOT recognize the
dongle, and the Kinivo support site DOES NOT offer the files in the
mini-CD that comes with the device.
The "fun" part is that for reasons unrelated to this question, I no longer
have the box/blister where the device came when I bought it, which had the
disc with the drivers inside.
The Question:
Does anybody here happen to have the same BT dongle that can facilitate me
a copy of the files in the included CD for this device via ISO or some
other way? I realize this is partly my own fault for not backing up the
drivers from the included disc, but considering that I had saved the box
with all its contents, even the instruction manual until my work room got
"cleaned up" by the maid, I did not even come close to suspecting I'd EVER
lose that box. Now I'm stuck with a completely useless dongle that Win7
won't install, and despite my extensive Google-fu, these drivers
apparently don't exist ANYWHERE on the internet.
Sencha Touch - Marker on current location
Sencha Touch - Marker on current location
I have added a marker to my current location. But because I used
centerchange I have to turn off draggable. Otherwise I get a lot of
markers everytime I'm dragging the map. Is there a other simple solution
to avoid that?
var refreshMap = function(themap) {
var marker = new google.maps.Marker({
position: themap.center,
title: 'Deine Position',
map: themap
})
}
map = new Ext.Map({
title: 'Map',
useCurrentLocation: true,
listeners: {
centerchange: function(comp, map){
refreshMap(map);
}
},
mapOptions: {
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: new google.maps.LatLng(52.2799112, 8.0471788),
mapTypeControl: false,
zoomControl: true,
overviewMapControl: false,
panControl: false,
rotateControl: false,
scaleControl: false,
controlPosition: false,
navigationControl: false,
streetViewControl: false,
backgroundColor: 'transparent',
disableDoubleClickZoom: true,
zoom: 14,
draggable: false,
keyboardShortcuts: false,
scrollwheel: false
}
});
I have added a marker to my current location. But because I used
centerchange I have to turn off draggable. Otherwise I get a lot of
markers everytime I'm dragging the map. Is there a other simple solution
to avoid that?
var refreshMap = function(themap) {
var marker = new google.maps.Marker({
position: themap.center,
title: 'Deine Position',
map: themap
})
}
map = new Ext.Map({
title: 'Map',
useCurrentLocation: true,
listeners: {
centerchange: function(comp, map){
refreshMap(map);
}
},
mapOptions: {
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: new google.maps.LatLng(52.2799112, 8.0471788),
mapTypeControl: false,
zoomControl: true,
overviewMapControl: false,
panControl: false,
rotateControl: false,
scaleControl: false,
controlPosition: false,
navigationControl: false,
streetViewControl: false,
backgroundColor: 'transparent',
disableDoubleClickZoom: true,
zoom: 14,
draggable: false,
keyboardShortcuts: false,
scrollwheel: false
}
});
How to understanding shopping cart exit rate in goal visualization
How to understanding shopping cart exit rate in goal visualization
We have a goal funnel set up with
(simplified)
Shopping Cart (not required)
Checkout
Checkout Completed
(It's possible that someone adds an item to their cart, goes back and
finds another product to add to their cart.)
Right now the Cart exit rate is being reported at, say, 60%. Does this
mean that 60% of customers bailed on the Cart and never came back (because
if they had gone through, Google would 'backfill' this 'exit' out of the
process) or could it mean that some of those 60% left, added another
product and then continued forward (meaning Google reports the 1st cart
visit as an exit, and the second as a completion)
We have a goal funnel set up with
(simplified)
Shopping Cart (not required)
Checkout
Checkout Completed
(It's possible that someone adds an item to their cart, goes back and
finds another product to add to their cart.)
Right now the Cart exit rate is being reported at, say, 60%. Does this
mean that 60% of customers bailed on the Cart and never came back (because
if they had gone through, Google would 'backfill' this 'exit' out of the
process) or could it mean that some of those 60% left, added another
product and then continued forward (meaning Google reports the 1st cart
visit as an exit, and the second as a completion)
How to remove titlebar when maximising youtube videos in awesome 3.5?
How to remove titlebar when maximising youtube videos in awesome 3.5?
Since I migrated from awesome 3.4 to 3.5 I am unable to remove titlebar
from youtube videos when maximising fullscreen.
In awesome 3.4 I used to put:
{ rule = { instance = "plugin-container" },
properties = { floating = true } },
and that works. However in version 3.5 the titlebar "plugin-container"
remains. I even tried the following without much success:
{ rule = { instance = "plugin-container" },
properties = { floating = true } ,
callback = function (c) awful.titlebar(c, {size = 0}) end },
However the function works when I hooked it to a keybinding:
awful.key({ modkey, }, "w",
function (c) awful.titlebar(c, {size = 0}) end
I know for sure that the rule works because it makes the window floating
but does not execute the call to the function, so I am really perplexed to
what is the issue here.
Thank you,
Since I migrated from awesome 3.4 to 3.5 I am unable to remove titlebar
from youtube videos when maximising fullscreen.
In awesome 3.4 I used to put:
{ rule = { instance = "plugin-container" },
properties = { floating = true } },
and that works. However in version 3.5 the titlebar "plugin-container"
remains. I even tried the following without much success:
{ rule = { instance = "plugin-container" },
properties = { floating = true } ,
callback = function (c) awful.titlebar(c, {size = 0}) end },
However the function works when I hooked it to a keybinding:
awful.key({ modkey, }, "w",
function (c) awful.titlebar(c, {size = 0}) end
I know for sure that the rule works because it makes the window floating
but does not execute the call to the function, so I am really perplexed to
what is the issue here.
Thank you,
Subscribe to:
Posts (Atom)