Saturday, 31 August 2013

how to retrieve the orderID from custom list view in Android

how to retrieve the orderID from custom list view in Android

Can any one help me in retrieving the order id from custom list view with
check box. I need to get the order id, which are checked, when the show
button is clicked, i need to get the order id which is added to the
mopenOrders array list . the checked/selected order id's from the custom
list view i must retrieve, below is the List view and my code
My main activity:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.Activity;
import android.content.res.AssetManager;
import android.os.Bundle;
import android.util.Log;
import android.util.SparseBooleanArray;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ListView;
import android.widget.Toast;
public class MainActivity extends Activity implements OnClickListener {
ListView mListView;
Button btnShowCheckedItems;
ArrayList<Product> mProducts;
ArrayList<OpenOrders> mOpenOrders;
MultiSelectionAdapter<OpenOrders> mAdapter;
public String serverStatus =null;
private InputStream is;
private AssetManager assetManager;
ArrayList<String> order_Item_Values =new
ArrayList<String>();
int mMAX_ORDERS_TOBEPICKED; //Parameter passed from
server for the selection of max order
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
assetManager=getAssets();
bindComponents();
init();
addListeners();
}
private void bindComponents() {
// TODO Auto-generated method stub
mListView = (ListView) findViewById(android.R.id.list);
mListView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
btnShowCheckedItems = (Button)
findViewById(R.id.btnShowCheckedItems);
}
private void init() {
// TODO Auto-generated method stub
try {
is = assetManager.open("open_order_item_details.txt");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String jString = getStringFromInputStream(is);
String fileContent=jString;
JSONObject jobj = null;
JSONObject jobj1 = null;
JSONObject ItemObj=null;
try {
jobj = new JSONObject(fileContent);
} catch (JSONException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try {
System.out.println("READ/PARSING JSON");
serverStatus = jobj.getString("SERVER_STATUS");
System.out.println("serverStatusObj: "+serverStatus);
JSONArray serverResponseArray2=jobj.getJSONArray("SERVER_RESPONSE");
for (int m = 0; m < serverResponseArray2.length(); m++) {
String SERVER_RESPONSE = serverResponseArray2.getString(m);
JSONObject Open_Orders_obj = new JSONObject(SERVER_RESPONSE);
mMAX_ORDERS_TOBEPICKED =
Open_Orders_obj.getInt("MAX_ORDERS_TOBEPICKED");
JSONArray ja =
Open_Orders_obj.getJSONArray("ORDER_ITEM_DETAILS");
order_Item_Values.clear();
mOpenOrders = new ArrayList<OpenOrders>();
for(int i=0; i<ja.length(); i++){
String ORDER_ITEM_DETAILS = ja.getString(i);
// System.out.println(ORDER_ITEM_DETAILS);
jobj1 = new JSONObject(ORDER_ITEM_DETAILS);
String ORDERNAME = jobj1.getString("ORDERNAME");
String ORDERID = jobj1.getString("ORDERID");
mOpenOrders.add(new OpenOrders(ORDERID,ORDERNAME));
}
}
} catch (JSONException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
mAdapter = new MultiSelectionAdapter<OpenOrders>(this, mOpenOrders);
mListView.setAdapter(mAdapter);
}
private void addListeners() {
// TODO Auto-generated method stub
btnShowCheckedItems.setOnClickListener(this);
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if(mAdapter != null) {
SparseBooleanArray checked = mListView.getCheckedItemPositions();
for (int i = 0; i < checked.size(); i++) {
if (checked.valueAt(i)) {
int pos = checked.keyAt(i);
Object o = mListView.getAdapter().getItem(pos);
// do something with your item. print it, cast it, add
it to a list, whatever..
Log.d(MainActivity.class.getSimpleName(), "cheked Items: " +
o.toString());
Toast.makeText(getApplicationContext(), "chked Items:: "
+o.toString(), Toast.LENGTH_LONG).show();
}
}
ArrayList<OpenOrders> mArrayProducts = mAdapter.getCheckedItems();
Log.d(MainActivity.class.getSimpleName(), "Selected Items: " +
mArrayProducts.toString());
}
}
private static String getStringFromInputStream(InputStream is) {
BufferedReader br = null;
StringBuilder sb = new StringBuilder();
String line;
try {
br = new BufferedReader(new InputStreamReader(is));
while ((line = br.readLine()) != null) {
sb.append(line);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (br != null) {
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return sb.toString();
}
}
MultiSelectionAdapter.java
import java.util.ArrayList;
import android.content.Context;
import android.util.SparseBooleanArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.TextView;
public class MultiSelectionAdapter<T> extends BaseAdapter{
Context mContext;
LayoutInflater mInflater;
ArrayList<T> mList;
SparseBooleanArray mSparseBooleanArray;
public MultiSelectionAdapter(Context context, ArrayList<T> list) {
// TODO Auto-generated constructor stub
this.mContext = context;
mInflater = LayoutInflater.from(mContext);
mSparseBooleanArray = new SparseBooleanArray();
mList = new ArrayList<T>();
this.mList = list;
}
public ArrayList<T> getCheckedItems() {
ArrayList<T> mTempArry = new ArrayList<T>();
for(int i=0;i<mList.size();i++) {
if(mSparseBooleanArray.get(i)) {
mTempArry.add(mList.get(i));
}
}
return mTempArry;
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return mList.size();
}
@Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return mList.get(position);
}
@Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return position;
}
@Override
public View getView(final int position, View convertView, ViewGroup
parent) {
// TODO Auto-generated method stub
if(convertView == null) {
convertView = mInflater.inflate(R.layout.row, null);
}
TextView tvTitle = (TextView) convertView.findViewById(R.id.tvTitle);
tvTitle.setText(mList.get(position).toString());
CheckBox mCheckBox = (CheckBox)
convertView.findViewById(R.id.chkEnable);
mCheckBox.setTag(position);
///mCheckBox.setTag(mList.get(position).toString());
mCheckBox.setChecked(mSparseBooleanArray.get(position));
mCheckBox.setOnCheckedChangeListener(mCheckedChangeListener);
return convertView;
}
OnCheckedChangeListener mCheckedChangeListener = new
OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean
isChecked) {
// TODO Auto-generated method stub
mSparseBooleanArray.put((Integer) buttonView.getTag(), isChecked);
}
};
}
OpenOrders.java
public class OpenOrders {
private String orderID;
private String orderName;
private String itemID;
private String itemName;
public OpenOrders(String orderID, String orderName) {
super();
this.orderID = orderID;
this.orderName = orderName;
}
public String getOrderID() {
return orderID;
}
public void setOrderID(String orderID) {
this.orderID = orderID;
}
public String getOrderName() {
return orderName;
}
public void setOrderName(String orderName) {
this.orderName = orderName;
}
@Override
public String toString() {
return this.orderName;
}
public void OpenOrderItems(String itemID, String itemName) {
this.itemID = itemID;
this.itemName = itemName;
}
public String getItemID() {
return itemID;
}
public void setItemID(String itemID) {
this.itemID = itemID;
}
public String getItemName() {
return itemName;
}
public void setItemName(String itemName) {
this.itemName = itemName;
}
}
My json: { "SERVER_STATUS": "1", "SERVER_RESPONSE": [ {
"MAX_ORDERS_TOBEPICKED":3, "ORDER_ITEM_DETAILS": [ { "ORDERNAME":
"ORDER1", "ORDERID": "1", "ITEMS": [ { "ITEMNUMBER": 1, "ITEMNAME":
"APPLE-LAPTOP", "CATEGORY":"ELECTRONICS", "ORDERQUANTITY": "5",
"PICKEDQUANTITY": "", "PRICE": "4500 DHMS", "SHOPNAME": "Indico Icon Kits
403", "ITEMIMAGEURL":
"http://s0.geograph.org.uk/photos/43/03/430378_cc40fae8.jpg",
"ITEMIMAGEFULLVIEWURL":
"http://s0.geograph.org.uk/photos/43/03/430378_cc40fae8.jpg" }, {
"ITEMNUMBER": 2, "ITEMNAME": "DEL-LAPTOP", "CATEGORY":"ELECTRONICS",
"ORDERQUANTITY": "5", "PICKEDQUANTITY": "", "PRICE": "4500 DHMS",
"SHOPNAME": "Indico Icon Kits 403", "ITEMIMAGEURL":
"http://www.dubaidutyfree.com/Content/upload/products/20130731094558Victorinox%20Aug%204.JPG",
"ITEMIMAGEFULLVIEWURL":
"http://www.dubaidutyfree.com/Content/upload/products/20130731094558Victorinox%20Aug%204.JPG"
}, { "ITEMNUMBER": 3, "ITEMNAME": "FUJI-LAPTOP", "CATEGORY":"ELECTRONICS",
"ORDERQUANTITY": "5", "PICKEDQUANTITY": "", "PRICE": "4500 DHMS",
"SHOPNAME": "Indico Icon Kits 403", "ITEMIMAGEURL":
"http://www.dubaidutyfree.com/Content/upload/products/20130731122832COLLECTOR-ENSEMBLE-RVB%204.JPG",
"ITEMIMAGEFULLVIEWURL":
"http://www.dubaidutyfree.com/Content/upload/products/20130731122832COLLECTOR-ENSEMBLE-RVB%204.JPG"
} ] }, { "ORDERNAME": "ORDER2", "ORDERID": "2", "ITEMS": [ { "ITEMNUMBER":
4, "ITEMNAME": "APPLE-LAPTOP", "CATEGORY":"ELECTRONICS", "ORDERQUANTITY":
"5", "PICKEDQUANTITY": "", "PRICE": "4500 DHMS", "SHOPNAME": "Indico Icon
Kits 403", "ITEMIMAGEURL":
"http://www.dubaidutyfree.com/Content/upload/products/20130731122312DG_INTENSE_EDP_100ML_conv%204.jpg",
"ITEMIMAGEFULLVIEWURL":
"http://www.dubaidutyfree.com/Content/upload/products/20130731122312DG_INTENSE_EDP_100ML_conv%204.jpg"
}, { "ITEMNUMBER": 5, "ITEMNAME": "DEL-LAPTOP", "CATEGORY":"ELECTRONICS",
"ORDERQUANTITY": "5", "PICKEDQUANTITY": "", "PRICE": "4500 DHMS",
"SHOPNAME": "Indico Icon Kits 403", "ITEMIMAGEURL":
"http://www.dubaidutyfree.com/Content/upload/products/20130731125233Boss%204.JPG",
"ITEMIMAGEFULLVIEWURL":
"http://www.dubaidutyfree.com/Content/upload/products/20130731125233Boss%204.JPG"
}, { "ITEMNUMBER": 6, "ITEMNAME": "FUJI-LAPTOP", "CATEGORY":"ELECTRONICS",
"ORDERQUANTITY": "5", "PICKEDQUANTITY": "", "PRICE": "4500 DHMS",
"SHOPNAME": "Indico Icon Kits 403", "ITEMIMAGEURL":
"http://www.dubaidutyfree.com/Content/upload/products/20130731122312DG_INTENSE_EDP_100ML_conv%204.jpg",
"ITEMIMAGEFULLVIEWURL":
"http://www.dubaidutyfree.com/Content/upload/products/20130731122312DG_INTENSE_EDP_100ML_conv%204.jpg"
} ] }, { "ORDERNAME": "ORDER3", "ORDERID": "3", "ITEMS": [ { "ITEMNUMBER":
7, "ITEMNAME": "APPLE-LAPTOP", "CATEGORY":"ELECTRONICS", "ORDERQUANTITY":
"5", "PICKEDQUANTITY": "", "PRICE": "4500 DHMS", "SHOPNAME": "Indico Icon
Kits 403", "ITEMIMAGEURL":
"http://www.dubaidutyfree.com/Content/upload/products/20130731122312DG_INTENSE_EDP_100ML_conv%204.jpg",
"ITEMIMAGEFULLVIEWURL":
"http://www.dubaidutyfree.com/Content/upload/products/20130731122312DG_INTENSE_EDP_100ML_conv%204.jpg"
}, { "ITEMNUMBER": 8, "ITEMNAME": "DEL-LAPTOP", "CATEGORY":"ELECTRONICS",
"ORDERQUANTITY": "5", "PICKEDQUANTITY": "", "PRICE": "4500 DHMS",
"SHOPNAME": "Indico Icon Kits 403", "ITEMIMAGEURL":
"http://www.dubaidutyfree.com/Content/upload/products/20130731122312DG_INTENSE_EDP_100ML_conv%204.jpg",
"ITEMIMAGEFULLVIEWURL":
"http://www.dubaidutyfree.com/Content/upload/products/20130731122312DG_INTENSE_EDP_100ML_conv%204.jpg"
}, { "ITEMNUMBER": 9, "ITEMNAME": "FUJI-LAPTOP", "CATEGORY":"ELECTRONICS",
"ORDERQUANTITY": "5", "PICKEDQUANTITY": "", "PRICE": "4500 DHMS",
"SHOPNAME": "Indico Icon Kits 403", "ITEMIMAGEURL":
"http://s0.geograph.org.uk/photos/43/03/430378_cc40fae8.jpg",
"ITEMIMAGEFULLVIEWURL":
"http://s0.geograph.org.uk/photos/43/03/430378_cc40fae8.jpg" } ] }, {
"ORDERNAME": "ORDER4", "ORDERID": "4", "ITEMS": [ { "ITEMNUMBER": 10,
"ITEMNAME": "AsusE-LAPTOP", "CATEGORY":"ELECTRONICS", "ORDERQUANTITY":
"5", "PICKEDQUANTITY": "", "PRICE": "4500 DHMS", "SHOPNAME": "Indico Icon
Kits 403", "ITEMIMAGEURL":
"http://www.dubaidutyfree.com/Content/upload/products/20130731122312DG_INTENSE_EDP_100ML_conv%204.jpg",
"ITEMIMAGEFULLVIEWURL":
"http://www.dubaidutyfree.com/Content/upload/products/20130731122312DG_INTENSE_EDP_100ML_conv%204.jpg"
}, { "ITEMNUMBER": 11, "ITEMNAME": "hp-LAPTOP", "CATEGORY":"ELECTRONICS",
"ORDERQUANTITY": "5", "PICKEDQUANTITY": "", "PRICE": "4500 DHMS",
"SHOPNAME": "Indico Icon Kits 403", "ITEMIMAGEURL":
"http://s0.geograph.org.uk/photos/43/03/430378_cc40fae8.jpg",
"ITEMIMAGEFULLVIEWURL":
"http://s0.geograph.org.uk/photos/43/03/430378_cc40fae8.jpg" }, {
"ITEMNUMBER": 12, "ITEMNAME": "FUJI-LAPTOP", "CATEGORY":"ELECTRONICS",
"ORDERQUANTITY": "5", "PICKEDQUANTITY": "", "PRICE": "4500 DHMS",
"SHOPNAME": "Indico Icon Kits 403", "ITEMIMAGEURL":
"http://s0.geograph.org.uk/photos/43/03/430378_cc40fae8.jpg",
"ITEMIMAGEFULLVIEWURL":
"http://s0.geograph.org.uk/photos/43/03/430378_cc40fae8.jpg" } ] }, {
"ORDERNAME": "ORDER5", "ORDERID": "5", "ITEMS": [ { "ITEMNUMBER": 13,
"ITEMNAME": "Asus-k-LAPTOP", "CATEGORY":"ELECTRONICS", "ORDERQUANTITY":
"5", "PICKEDQUANTITY": "", "PRICE": "4500 DHMS", "SHOPNAME": "Indico Icon
Kits 403", "ITEMIMAGEURL":
"http://s0.geograph.org.uk/photos/43/03/430378_cc40fae8.jpg",
"ITEMIMAGEFULLVIEWURL":
"http://s0.geograph.org.uk/photos/43/03/430378_cc40fae8.jpg" }, {
"ITEMNUMBER": 14, "ITEMNAME": "wio-LAPTOP", "CATEGORY":"ELECTRONICS",
"ORDERQUANTITY": "5", "PICKEDQUANTITY": "", "PRICE": "4500 DHMS",
"SHOPNAME": "Indico Icon Kits 403", "ITEMIMAGEURL":
"http://s0.geograph.org.uk/photos/43/03/430378_cc40fae8.jpg",
"ITEMIMAGEFULLVIEWURL":
"http://s0.geograph.org.uk/photos/43/03/430378_cc40fae8.jpg" }, {
"ITEMNUMBER": 15, "ITEMNAME": "Accer-LAPTOP", "CATEGORY":"ELECTRONICS",
"ORDERQUANTITY": "5", "PICKEDQUANTITY": "", "PRICE": "4500 DHMS",
"ITEMIMAGEURL":
"http://s0.geograph.org.uk/photos/43/03/430378_cc40fae8.jpg",
"ITEMIMAGEFULLVIEWURL":
"http://s0.geograph.org.uk/photos/43/03/430378_cc40fae8.jpg" } ] } ] } ],
"ERROR_STATUS": "0", "ERROR_RESPONSE": [ { "ERROR_MESSAGE": "" } ] }

iOS block release and self retain cycle

iOS block release and self retain cycle

Im doing some research on blocks, the code here
typedef NSString* (^MyBlock)(void);
@property(copy,nonatomic) MyBlock block1;
in viewdidload
self.block1 = ^{
self
NSLog(@"do block");
return @"a";
};
of course the self is retained, then I do a
self.block = nil;
by checking the retain count of self, I found it reduced by 1, no retain
cycle.
I believe this is the correct situation, the block retains self, when
release the block, self gets released. retaincount reduced.
I made a litte change, and things coms strange: make block a local variable.
in viewdidload
MyBlock block1 = ^{
self
NSLog(@"do block");
return @"a";
};
[block copy]; // retain count of self gets added.
[block release]; // retain count of sell still the same
why? I tried Block_release(), its the same. and when putting a local
variable like NSArray in the block, the retain count fellows the same rule
as self.
there must be some thing different inside of @property, anyone researched
this before? pls help.
Additionally, I do this in ARC, a local variable block will made the
retain cycle, and a instance variable didnt, due to the autorelease, it
holds the self, and few seconds later, it released and self object get
released normally.
is it because the instance variable and local variable are alloc on
different parts in memory? stack ? heap?, are they both copied to heap
when do a [block copy]?
EDIT : not instance variable and local variable. using @property makes it
different, any explanations?

Path for file in Directory

Path for file in Directory

I have an 'css' folder and am trying to access an image in there. I am in
the parent directory and the images folder is in there. How do I write the
path? Nothing I do is working..
<img src="..\images\final2.gif" class="stretch" alt="" />

Unabel to retrieve variables from ajax post in codeignighter

Unabel to retrieve variables from ajax post in codeignighter

I am new to using ajax and i am having trouble with posting variable and
accessing those variables in my controllers.
Here is the Controller Code
class autocomplete extends CI_Controller {
// just returns time
function workdammit()
{
$product = $this->input->post('productName');
/* $this->load->model('product_model');
$q = 'SELECT quantity FROM products WHERE productName = "BC20BA"';
$data = $this->product_model->get_record_specific($q);
echo json_encode($data[0]->quantity);
*/
echo $product;
}
function index()
{
$this->load->view('autocomplete_view');
}
}
If i change the echo to a string inside single quotes like this 'Hello
World' it will return the hello world back to the view correctly. But it
will not do the same if I try it as it currently is. Also if i use echo
json_encode($product); it then returns false.
Here is view code with ajax.
$( document ).ready(function () {
// set an on click on the button
$('#button').click(function () {
$.ajax({
type: "POST",
url: "<?php echo site_url('autocomplete/workdammit'); ?>",
dataType: "json",
data: 'productName',
success: function(msg){
alert(msg);
}
});
});
});
</script>
</head>
<body>
<h1> Get Data from Server over Ajax </h1>
<br/>
<button id="button">
Get posted varialbe
</button>

Using jsoup how to get anchor tags that are within div tags with class that have display none style

Using jsoup how to get anchor tags that are within div tags with class
that have display none style

I have a document from which I am trying to extract the a tags. Some of
them are within tags that have the class attribute and the class has the
display:none property set. I want to eliminate those.

C# I need a algorithmic for Lock-by-value

C# I need a algorithmic for Lock-by-value

You have a function Foo(long x) which is called by many threads. You want
to prevent threads from executing the method simultaneously for the same
value of x. If two methods call it with x=10, one should block and wait
for the other to finish; but if one thread calls it with x=10 and another
with x=11, they should run in parallel. X can be any long value. You must
not keep in memory all the values with which the function was called in
the past, but free them once all threads with that value exit the function
(you may wait for GC to free them). Extra: if two threads, with different
values of X, do not contend for any shared lock (such as a static
management lock) when entering or leaving the function, and only threads
with the same values of X can ever block and wait.

Create select options and get the current values for month and date

Create select options and get the current values for month and date

<select name="year"><?=options(date('Y'),1900)?></select>
<select name="month"><?php echo
date('m');?><?=options(1,12,'callback_month')?></select>
<select name="day"><?php echo date('d');?><?=options(1,31)?></select>
PHP
function options($from,$to,$callback=false)
{
$reverse=false;
if($from>$to)
{
$tmp=$from;
$from=$to;
$to=$tmp;
$reverse=true;
}
$return_string=array();
for($i=$from;$i<=$to;$i++)
{
$return_string[]='<option
value="'.$i.'">'.($callback?$callback($i):$i).'</option>';
}
if($reverse)
{
$return_string=array_reverse($return_string);
}
return join('',$return_string);
}
function callback_month($month)
{
return date('m',mktime(0,0,0,$month,1));
}
What should i make to get the current month and date in the corresponding
dropdowns as starting values, as it is the case with years (2013).

Using LIKE CONCAT with wildcard

Using LIKE CONCAT with wildcard

I'm using the standard LAMP environment. I've taken an example directly
from mysql.com website and adapted it to my table structure.
$sql = 'SELECT cat_name
FROM cats
WHERE cat_name LIKE concat('%', 'Artist', '%') ';
But this does not work... the screen is just blank and even "view source"
in the browser is blank
My issue is that, even though all of the examples I've found on
StackOverflow and other forums use single quotes ('%') it only works if I
use double quotes like this ("%").

Friday, 30 August 2013

Is there any world wide real estate api?

Is there any world wide real estate api?

Does anyone know world wide real estate api which I can get the list of
pricing of real estate for searching with location? I tried to look for
google api or yahoo api. Also, I checked Zillow api but it was only for
US.

Thursday, 29 August 2013

google+ - change layout and delete multiple photos

google+ - change layout and delete multiple photos

Do you know how to select multiple photos in Google+ Photos? (not only one
by one, but multiselection with Shift)
I found these help -
https://support.google.com/plus/answer/1407859?hl=en-GB but in my account
there is no option Move to bin.
How can I change layout of the Photos as you can see in the Joe's account
(from tutorial on Youtube - Deleting individual photos from Google+
Albums)?
Illustration: http://s22.postimg.org/leq53frs1/ilustration.jpg
Images description: Joe's account - Organize albums | Joe's account -
there IS a button to move to bin or another album | My account - Organize
albums | My account - there is no button to move to bin or another album.

DB: map to another data model

DB: map to another data model

I have 2 data models with different amount of tables in MySQL, but both
designed for the same purpose. I need to have mechanism which will migrate
data from model #1 to model #2. It can be stored procedure, a set of
SQL-scripts, or Java-code.
It would be best to create mappings visually (e.g. drag from
Table1M1.field1 to Table1M2.field5).
Is there any tool for this exists?

sonar 3.5.1 installation error in tomcat 6.0.32 plugin name org.sonar.l10n.gwt

sonar 3.5.1 installation error in tomcat 6.0.32 plugin name
org.sonar.l10n.gwt

After deploying jenkins successfully into tomcat on Linux RED HAT 6.1
(64b), I tried to deploy war sonar file (3.5.1 version)
Sonar doesn't start because of a resource bundle error:
2013.08.29 10:37:04 ERROR o.s.s.p.Platform Can't find bundle for base
name org.sonar.l10n.gwt, locale en
java.util.MissingResourceException: Can't find bundle for base name
org.sonar.l10n.gwt, locale en at
java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1539)
~[na:1.6.0_20]
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1278)
~[na:1.6.0_20]
I searched on a Codehaus repo and I found various versions of
org.soanr.l10n.gwt (Spanish, Japanese, French, Chinese) but no en version.
I think that's a problem. I tried to force locale to French in catalina.sh
but this doesn't work:
if [ -z "$LOGGING_MANAGER" ]; then
JAVA_OPTS="$JAVA_OPTS
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Duser.language=fr -Duser.region=FR"
else
JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER -Duser.language=fr -Duser.region=FR"
fi

Wednesday, 28 August 2013

String modification in java

String modification in java

Hi i am having string like " MOTOR PRIVATE CAR-PACKAGE POLICY " . Now i
want remove last two words and add hyphen between words finally i want
string like " MOTOR-PRIVATE-CAR' . I tried many times using string methods
in java but could not find exactly. Can anyone give a solution for that .
Give me a code is plus for me.
Thanks in advance
public class StringModify {
/**
* @param args
*/
public static void main(String[] args) {
try {
String value="MOTOR PRIVATE CAR-PACKAGE POLICY";
System.out.println("Value-------------------->"+value.replaceFirst("\\s*\\w+\\s+\\w+$",
""));
} catch (Exception e) {
e.printStackTrace();
}
}
}

xml parse error ajax request

xml parse error ajax request

I'll go to straight to the point.
I have this ajax request on a function:
$.ajax({
url: 'f_func.php?f=g_tv&adm=1',
dataType: 'xml',
data: {},
async:false,
success:function(result){
if($(result).find('error').length>0){
alert($(result).find('error').first().text());
}else{
if ($(result).find('tvalor').length >0 ) {
$(result).find('tvalor').each(
function(i){
alert($(result).find(idtvalor).first().text());
}
);
}
}
},
error:function(XMLHttpRequest, textStatus, errorThrown){
alert(errorThrown);
}
});
the output is:
<?xml version='1.0' encoding='utf-8'?>
<tvalores>
<tvalor>
<idtvalor>1</idtvalor>
<nombtvalor>valag1</nombtvalor>
<puntaje>259</puntaje>
<estado>1</estado>
</tvalor>
<tvalor>
<idtvalor>2</idtvalor>
<nombtvalor>valag2</nombtvalor>
<puntaje>500</puntaje>
<estado>1</estado>
</tvalor>
</tvalores>
the error says it's a parsing xml error and I've been reading other topics
but they changed to JSon or the dataType from xml to text and eliminate
the header of the xml... I'm looking for a real fix on this...
if anyone can help me with this... thank you so much

Derived ClaimsAuthorizationManager.CheckAccess Returning False in ASP.net MVC Web API

Derived ClaimsAuthorizationManager.CheckAccess Returning False in ASP.net
MVC Web API

Sources say that if a child class of ClaimsAuthorizationManager's
CheckAccess returns false, by framework design, it throws a security
exception.
There seems to be no way to catch this error if I want to decorate an
ApiController's function with (for example)
[ClaimsPrincipalPermission(SecurityAction.Demand, Operation="Read",
Resource="Something")].
I already created a sample AuthorizationManager, deriving
ClaimsAuthorizationManager, and registered it in web.config. This
configuration part works.
public class AuthorizationManager : ClaimsAuthorizationManager
{
public override bool CheckAccess(AuthorizationContext context)
{
return false; // just to show that it will throw the security
exception
}
}
So, I set up authorization to fail no matter what, but I want to return a
401 response back to the user instead of that "invasive" 500 (Security
exception returned as Internal Server Error).
Nobody seems to have an answer for this anywhere, and it seems like we'll
just settle for the 500 to communicate unauthorized access to clients.

SQL - insert row values from second column ( to new table as column data)

SQL - insert row values from second column ( to new table as column data)

while having the result set:
Name Values
PRODUCT FILLER888 LOT_NUMBER CG 00063 0 SHIFT_SUPERVISOR covaliu l
KGH_ALL_SET 90 KGH_ALL_REAL 133.183883666992 KGH_F1_SET 90 KGH_F1_REAL
133.183883666992 K_F1 33 SCREW_RPM_SET 400 SCREW_RPM_REAL 399.452606201172
TORQUE 19.6692142486572 CURRENT 71.0029983520508 KW_KG 0.0553370267152786
KW 7.36999988555908 MELT_PRESSURE 0 MELT_TEMPERATURE 140 PV1 141 SP1 140
PV2 160 SP2 160 PV3 160 SP3 160 PV4 160 SP4 160 PV5 160 SP5 160 PV6 150
SP6 150 PV7 150 SP7 150 PV8 154 SP8 150 PV9 150 SP9 150 PV10 160 SP10 160
PV11 180 SP11 180
i would like into a second table which is defined as the rows of the 1st :
CREATE TABLE #ZSK402temp ( PRODUCT varchar(25), LOT_NUMBER varchar(25),
SHIFT_SUPERVISOR varchar(25), KGH_ALL_SET decimal, KGH_ALL_REAL decimal,
KGH_F1_SET decimal, KGH_F1_REAL decimal, K_F1 decimal, SCREW_RPM_SET
decimal, SCREW_RPM_REAL decimal, TORQUE decimal, [CURRENT] decimal, KW_KG
decimal, KW decimal, MELT_PRESSURE decimal, MELT_TEMPERATURE decimal, PV1
decimal, SP1 decimal, PV2 decimal, SP2 decimal, PV3 decimal, SP3 decimal,
PV4 decimal, SP4 decimal, PV5 decimal, SP5 decimal, PV6 decimal, SP6
decimal, PV7 decimal, SP7 decimal, PV8 decimal, SP8 decimal, PV9 decimal,
SP9 decimal, PV10 decimal, SP10 decimal, PV11 decimal, SP11 decimal )
to insert the values from the 1st table as column data in the second table.
Any help is kindly apreciated.
thanks in advance, will keep an eye here.

Tuesday, 27 August 2013

Not able to run jquery fiddle code

Not able to run jquery fiddle code

Guys I was trying to run code from a fiddle on my local asp.net page but
its not working for me.Please see where i am going wrong.I am not able to
get hover effect on my page.
fiddle url: http://jsfiddle.net/VcGXL/
My code:
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="WebForm1.aspx.cs" Inherits="EPaperWeb.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type ="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
<script type ="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
<script type="text/javascript">
$('#ImgMap').mapster(
{
fillColor: 'ff0000'
}); </script>
</head>
<body>
<form id="form1" runat="server">
<div>
<img id="mapimage"
src="http://www.groupswelcome.co.uk/maps/uk_map.gif" usemap="#map"
type="image/png" title="Join your local network"></div>
<map id="map" name="map">
<area shape="poly" id="northern" alt="Northern" title="Northern"
coords="123,248,134,271,139,294,141,301,156,321,167,317,183,307,180,288,188,298,205,302,225,290,239,289,248,274,211,229,199,208,176,170,168,170,148,207,123,238"
href="#" target="" />
<area id="wales" shape="poly" alt="Wales" title="Wales"
coords="100,302,92,332,110,338,111,355,64,374,88,400,133,398,154,404,164,384,161,372,144,364,145,344,154,321,143,302,103,293"
href="#" target="" />
<area id="westmidlands" shape="poly" alt="West Midlands"
title="West Midlands"
coords="181,368,195,360,206,351,189,326,182,305,149,321,142,358,147,369,163,376"
href="#" target="" />
<area id="eastmidlands" shape="poly" alt="East Midlands"
title="East Midlands"
coords="215,365,233,341,233,328,254,320,238,284,210,293,192,304,177,290,184,320,204,353,203,366"
href="#" target="" />
<area id="london" shape="poly" alt="London" title="London"
coords="227,385,235,398,244,402,255,391,259,384,239,379,230,383"
href="#" target="" />
<area id="east" shape="poly" alt="East" title="East"
coords="260,315,287,316,288,364,271,389,259,390,246,377,225,382,222,368,217,357,235,327"
href="#" target="" />
<area id="southwest" shape="poly" alt="South West" title="South
West"
coords="61,468,88,475,104,456,139,462,153,437,180,441,192,436,196,396,188,363,162,375,152,405,142,404,109,408,87,440"
href="#" target="" />
<area id="southeast" shape="poly" alt="South East" title="South
East"
coords="209,445,224,429,259,429,284,409,276,386,254,391,241,405,226,388,215,363,194,369,199,401,192,436"
href="#" target="" />
<area id="northernireland" shape="poly" alt="Northern Ireland"
title="Northern Ireland"
coords="46,270,56,267,81,244,58,215,33,203,1,237,0,252,9,268"
href="#" target="" />
</map>
</form>
</body>
</html>

Three.js WaterDemo port form r48 to r60

Three.js WaterDemo port form r48 to r60

I'm trying to port this demo
(http://www.chromeexperiments.com/detail/waterstretch) from three.js r48
to r60. But on even r49 I'm struggling to get it work. The demo just shows
a blank screen and no errors console. In the changelog from r48 to r49 I
couldn't find anything helpful.
thanks in advance

Can Maven Deploy a Module to JBoss?

Can Maven Deploy a Module to JBoss?

We have a Maven project that we are using to deploy several wars to a
JBoss server. We recently noticed that one of the jars that a couple of
our wars depend on, uses Xerial. When Xerial starts it tries to load up a
native driver, but only the first one successfully loads the native driver
and the rest fail and fall back on a pure Java implementation because the
native driver is already in a classloader. We would really like to gain
the performance back by being able to load the native driver on all the
wars.
It looks to me like the best way to do this would be add the jar we depend
on to the JBoss server as a module, and then have the services depend on
it.
My question is, is there a way we can get our Maven build to do this? Or
are we going about this in the completely wrong way?

Get User Control Variable

Get User Control Variable

Using Visual Studio 2008
I have a user control. The button calls a folder browser dialog. I am
trying to pass the path to the parent form and it's just not getting
there. I need a little input....
User Control:

public partial class FolderSelectDDL : UserControl
{
public delegate void ButtonClickedEventHandler(object sender,
EventArgs e);
public static event ButtonClickedEventHandler OnUserControlButtonClicked;
private string folderPath;
public string FolderPath
{
get { return folderPath; }
set { folderPath = value; }
}
public FolderSelectDDL()
{
InitializeComponent();
}
private void btnSaveToPath_Click(object sender, EventArgs e)
{
string path;
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
path = folderBrowserDialog1.SelectedPath;
if (OnUserControlButtonClicked != null)
OnUserControlButtonClicked(this, e);
folderPath = path;
}
}
}
And the form:
public partial class ImportCreateExcel : Form
{
FolderSelectDDL uc = new FolderSelectDDL();
public ImportCreateExcel()
{
FolderSelectDDL.OnUserControlButtonClicked += new
FolderSelectDDL.ButtonClickedEventHandler(btnSaveToPath_Click);
InitializeComponent();
}
private void btnSaveToPath_Click(object sender, EventArgs e)
{
MessageBox.Show(uc.FolderPath); //blank
//MessageBox.Show(uc.folderBrowserDialog1.SelectedPath); //blank
}
}
The path is always blank, whether it's from the dialog which is set to
public, or the variable FolderPath.

Any input is always welcome.
Thanks!

how to use multiple copies of any Subview(created in xib) from xib file

how to use multiple copies of any Subview(created in xib) from xib file

I am using xib to create view for my project. The condition is:
I have multiple UIView IBoutlet's Object.
IBOutlet UIView *viewOpenDoor;
IBOutlet UIView *viewOpenDoor_Second;
viewOpenDoor is only connected to one of the view in xib. Now i am using
this code to reuse the same view multiple times in viewdidload method-
[viewOpenDoor setFrame:CGRectMake(30, 80, viewOpenDoor.frame.size.width,
viewOpenDoor.frame.size.height)];
[self.view addSubview:viewOpenDoor];
viewOpenDoor.layer.borderColor = [UIColor blackColor].CGColor;
viewOpenDoor.layer.borderWidth = 0.9f;
viewOpenDoor.layer.cornerRadius = 6.0f;
[viewOpenDoor setHidden:YES];
viewOpenDoor_Second = [[UIView alloc] init];
viewOpenDoor_Second = [viewOpenDoor copy];
[viewOpenDoor_Second setFrame:CGRectMake(184, 80,
viewOpenDoor.frame.size.width, viewOpenDoor.frame.size.height)];
[self.view addSubview:viewOpenDoor_Second];
it's giving exception-
-[UIView copyWithZone:]: unrecognized selector sent to instance 0x95ba140
Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[UIView copyWithZone:]: unrecognized selector sent to instance
0x95ba140'
So, my question is how can i reuse this one IBOutlet object created in
xib, multiple times with different instances?

JAR and jnlp (webstart) fail to launch or display correctly

JAR and jnlp (webstart) fail to launch or display correctly

I'm trying to get a Java Web Start application to launch, JamochaMUD.
However, I never get a window for it. I get:

and then

and finally:

I've tried both the jnlp (Java Web Start) and JAR options, same result.
However, other Java applications, Netbeans and FreeCol, work fine.

Monday, 26 August 2013

how to include fabric.js file in script

how to include fabric.js file in script

i want to try basic fabric plugin file ,when i copy code and run nothing
is displayed on screen.
<!DOCTYPE html>
<html lang="en">
<head>
<script></script>
<script src="js/jquery-1.9.1.js"></script>
<script src="js/fabric.js"></script>
<script>
$(document).ready(function(){
var circle = new fabric.Circle({
radius: 20, fill: 'green', left: 100, top: 100
});
var triangle = new fabric.Triangle({
width: 20, height: 30, fill: 'blue', left: 50, top: 50
});
canvas.add(circle, triangle);
});
</script>
</head>
<body>
<div>
<header>
<h1>canvas</h1>
</header>
</body>
</html>
this is the code i have copied , but it is displayoing nothing .

Set loading bitmap to spinner in progress dialog

Set loading bitmap to spinner in progress dialog

I used a tutorial that showed me how to load bitmaps in an async task and
set them to an imageview and in the tutorial before the bitmap is loaded
the imageview is set to black with this piece of code
static class DownloadedDrawable extends ColorDrawable {
private final WeakReference<DownloadImageTask> bitmapDownloaderTaskReference;
public DownloadedDrawable(DownloadImageTask bitmapDownloaderTask) {
super(Color.BLACK);
bitmapDownloaderTaskReference =
new WeakReference<DownloadImageTask>(bitmapDownloaderTask);
}
public DownloadImageTask getBitmapDownloaderTask() {
return bitmapDownloaderTaskReference.get();
}
}
How can I change the imageview so that before it is loaded it is the
spinner in the progress dialog.
Thanks in advance.

What is the difference between a Linked Server retruning the message "Out of memory" and "MySQL client ran out of memory"

What is the difference between a Linked Server retruning the message "Out
of memory" and "MySQL client ran out of memory"

we have a Microsoft SQL Server running a bunch of jobs every hour, half
the jobs call local stored procedures while the other half calls stored
procedures on a MySQL Database
in the past we normally get
[SQLSTATE 01000] (Error 0) OLE DB provider "MSDASQL" for linked server
"LNKSVR" returned message "Out of memory.".
when we get these we can't can't run any code that relies on the Linked
Server, to fix this we normally reset the server, not too much of a
problem as it's a testing server
recently, we got this error
[SQLSTATE 01000] (Error 0) OLE DB provider "MSDASQL" for linked server
"LNKSVR" returned message "[######][#######][###############]MySQL client
ran out of memory".
now according the jobs, one job fired off the top error, 1 hour later it
worked fine then the hour after that it returned the second error, now
none of the jobs will suceed because they can't seem to open the tables on
the linked server, also when i try and do a SELECT * FROM LNKSVR...table
in Microsoft SQL Server Management Studio it says it can't open the table
however if i go into the MySQL Database using phpmyadmin and run the same
query (minus the LNKSVR...) i get the table fine
now to me, the solution to this would be to just do like we always do and
reset the MSSQL Server however it's that second message that's bugging me,
so i am wondering, is there a difference between these two errors and if
so what is it?

Force mySQL queries to be characters not numeric in R

Force mySQL queries to be characters not numeric in R

I'm using RODBC to interface R with a MySQL database and have encountered
a problem. I need to join two tables based on unique ID numbers (IDNUM
below). The issue is that the ID numbers are 20 digit integers and R wants
to round them. OK, no problem, I'll just pull these IDs as character
strings instead of numeric using CAST(blah AS CHAR).
But R sees the incoming character strings as numbers and thinks "hey, I
know these are character strings... but these character strings are just
numbers, so I'm pretty sure this guy wants me to store this as numeric,
let me fix that for him" then converts them back into numeric and rounds
them. I need to force R to take the input as given and can't figure out
how to make this happen.
Here's the code I'm using (Interval is a vector that contains a beginning
and an ending timestamp, so this code is meant to only pull data from a
chosen timeperiod):
test = sqlQuery(channel, paste("SELECT CAST(table1.IDNUM AS
CHAR),PartyA,PartyB FROM
table1, table2 WHERE table1.IDNUM=table2.IDNUM AND
table1.Timestamp>=",Interval[1],"
AND table2.Timestamp<",Interval[2],sep=""))

Table Layout - Bootstrap Progress Bar

Table Layout - Bootstrap Progress Bar

I am trying to get the following effect:
Essentially what I have done is make a div with
display: table;
and then populated it with divs containing Font Awesome icons with
display: table-cell;
JS Fiddle: http://jsfiddle.net/abehnaz/wCHbc/1/
My problem right now is that I can't figure out how to get the line to go
from the center of one table-cell to the center of the other table cell.
Can anyone point me in the right direction?

MySQL - SUM for one table is joining another table

MySQL - SUM for one table is joining another table

I have 2 tables:
1.items
+-------+---------+
|itemID | itemName|
+-----------------+
|1 | Item1 |
|2 | Item2 |
+-------+---------+
2.purchases
+-----------+--------+--------+-----------+
|purchaseID | userID | itemID | itemAmount|
+-----------+--------+--------+-----------+
|1 | 1 | 1 | 3 |
|2 | 2 | 1 | 4 |
|3 | 1 | 2 | 5 |
+-----------+--------+--------+-----------+
A simplified version of my MySQL code is this:
SELECT
items.itemID,
SUM(purchases.itemAmount)
FROM items
LEFT OUTER JOIN purchases ON items.itemID = purchases.itemID
I would like the result to be this:
itemID | itemAmount
1 | 7 2 | 5
But instead, this is the result:
itemID | itemAmount
1 | 12
Why is this, and how can I fix it? Thanks :)

Woocommerce auto post products social media

Woocommerce auto post products social media

I want to add an action whenever the admin publishes a product.
Automatically publish to social media like twitt*r or something else.
There is any recommendation?plugins or customization?

Mounting LVM2 volume gives me 'mount: you must specify the filesystem type'

Mounting LVM2 volume gives me 'mount: you must specify the filesystem type'

I have a LVM2 Volume Group 'vgXEN' with a Logical Volume in it called
'test-disk'.
This is the output of lvdisplay:

--- Logical volume ---
LV Path /dev/vgXEN/test-disk
LV Name test-disk
VG Name vgXEN
LV UUID lHSgfx-wnY2-OtRO-zw7l-9SFA-mnht-KgK9MO
LV Write Access read/write
LV Creation host, time DRAKE, 2013-08-26 12:02:08 +0200
LV Status available
# open 0
LV Size 10.00 GiB
Current LE 2560
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 4096
Block device 253:4
And this is the output of lvscan:
ACTIVE '/dev/vgXEN/test-disk' [10.00 GiB] inherit
Now when i try to mount this logical volume with the command i get an error:
mount /dev/vgXEN/test-disk /mnt/test
mount: you must specify the filesystem type
My operating system is 'Linux DRAKE 3.2.0-4-amd64 #1 SMP Debian
3.2.41-2+deb7u2 x86_64 GNU/Linux'.
Searched the Internet but couldn't find anything useful. Can anybody point
me in the right direction please ? Thx !

Difference between network interfaces

Difference between network interfaces

What is difference between p1p1, eth0, lo and other interfaces? What do
they exactly stand for? Can u suggest a book that explain all such basic
topics in detail

Sunday, 25 August 2013

dns sub domain not work on my first OVH dedicate

dns sub domain not work on my first OVH dedicate

i have new OVH dedicate from ovh.com/us I using Plesk panel on this but I
met problem with subdomain. I have added new domain ivietsoft.com to this
server and it work, but all sub domain for it are not work.
Eg: test.ivietsoft.com
DNS Zone for sub domain is depend master dns zone of ivietsoft.com
Please advice or tell me something
Thank in Advance

[ Other - Yahoo! Mail ] Open Question : what is the file to make yahoo my default mail?

[ Other - Yahoo! Mail ] Open Question : what is the file to make yahoo my
default mail?

i have the latest yahoo toolbar but no option to make yahoo mail my
default but there is a small file that will help

How do high traffic sites service more than 65535 TCP connections?

How do high traffic sites service more than 65535 TCP connections?

If there is a limit on the number of ports one machine can have and a
socket can only bind to an unused port number, how do servers experiencing
extremely high amounts (more than the max port number) of requests handle
this? Is it just done by making the system distributed, i.e., many servers
on many machines?

Corona sdk: Small Lua coding issue

Corona sdk: Small Lua coding issue

I was watching this Corona tutorial
The code that I want to ask about is this
mine1 = display.newImage("mine.png")
mine1.x = 500
mine1.y = 100
mine1.speed = math.random(2,6)
mine1.initY = mine1.y
mine1.amp = math.random(20,100)
mine1.angle = math.random(1,360)
physics.addBody(mine1, "static", {density=.1, bounce=0.1, friction=.2,
radius=12})
screenGroup:insert(mine1)
mine2 = display.newImage("mine.png")
mine2.x = 500
mine2.y = 100
mine2.speed = math.random(2,6)
mine2.initY = mine2.y
mine2.amp = math.random(20,100)
mine2.angle = math.random(1,360)
physics.addBody(mine2, "static", {density=.1, bounce=0.1, friction=.2,
radius=12})
screenGroup:insert(mine2)
mine3 = display.newImage("mine.png")
mine3.x = 500
mine3.y = 100
mine3.speed = math.random(2,6)
mine3.initY = mine3.y
mine3.amp = math.random(20,100)
mine3.angle = math.random(1,360)
physics.addBody(mine3, "static", {density=.1, bounce=0.1, friction=.2,
radius=12})
screenGroup:insert(mine3)
Now when the plan goes up, it blows, i don't want it to blow no matter how
high it goes, i just want to to blow if it hits a mine, how to do so?

Saturday, 24 August 2013

Owned form and mdi parent

Owned form and mdi parent

this is my scenario and hope you can solve it for me
I have a MDI container form called "MainForm". In MainForm there is a
simple form call "Form1". In Form1 there is a button. every time you
pushed it, It open a new form which instance of "Form2". The followng code
is click button event.
Button_Click(){
Form2 frm=new Form2();
frm.mdiparnt=this.MdiParent;
this.addOwnedForm(frm);
frm.Visible=true;
}
and the following code tries to close owned forms when the user close Form1
Form1_CloseEvent(){
foreach(var item in this.ownedForm){
item.close();
}
}
But when the debugger steps into close event, just close Form1, and the
form2 instances remain open. what should I do to solve it

Error when trying to use the subcaption package

Error when trying to use the subcaption package

When I try to use the subcaption package (\usepackage{subcaption}), I get
some errors. However, using the subfigure package
(\usepackage{subfigure}), the compilation is successful with no errors. I
cannot figure out what is wrong...
here is a code example:
\documentclass[12pt, a4paper, oneside]{book}
\usepackage{fullpage}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{alltt}
\usepackage{latexsym}
\usepackage{exscale}
\usepackage[numbers, sort&compress]{natbib}
\usepackage{rotating}
\usepackage{changepage}
%\usepackage{notoccite}
%a useful package if you write url addresses:
%\usepackage{url}
\usepackage[labelfont=bf]{caption}
\usepackage{subcaption}
\usepackage{epsfig}
\begin{document}
\begin{figure}[htb]
\centering
\subfigure[]
{
\label{fig: Image1}
\includegraphics[width=76mm,height=60mm]{CordicStruc.pdf}
}
\subfigure[]
{
\label{fig: Image2}
\includegraphics[width=76mm,height=60mm]{Diagram1.pdf}
}
\caption{\textbf{(a) Block diagram of floating-
point CORDIC co-processor architecture.} \textbf{(b) Pre-Process module in
CORDIC co-processor.}}
\end{figure}
\end{document}

Free Watch Denver Broncos vs St. Louis Rams live streaming NFL Preseason NFL Football now online free TV how?

Free Watch Denver Broncos vs St. Louis Rams live streaming NFL Preseason
NFL Football now online free TV how?

Welcome to Watch and enjoy the live telecast NFL Football Preseason match
between Denver Broncos vs St. Louis Rams Live Streaming NFL Football HD
Satellite TV Coverage. Now watch and enjoy Denver Broncos vs St. Louis
Rams Live Stream NFL Football to your PC Denver Broncos vs St. Louis Rams
Live online. Denver Broncos vs St. Louis Rams Live Online Broadcast. Any
where you can watch this exclusive match between Denver Broncos vs St.
Louis Rams Live without any additional software. JUST FOLLOW OUR TV LINK
PC, laptop, notebook, i phone, i pad, Android, PlayStation, Safari,
smartphone Linux, Apple, ios, Tablet etc, from this site With HD
quality.3500 satellite TV- TV on PC & MAC(OSX)!bundle the ultimate TV
experience with internet on all device 78 SPORTS + 3500 CHANNELS
AVAILABLE, ANYWHERE, ANYTIME, 24 X 7. Watch NFL live Match Click Here To:
Watch Denver Broncos vs St. Louis Rams
http://watch-nfl-live-tv-link.blogspot.com/
http://watch-nfl-live-tv-link.blogspot.com/
Denver Broncos vs St. Louis Rams MATCH DETAILS Date : Saturday, August 24,
2013 Competition: NFL live Live / Repeat:Live 8:00 pm EDT
How to Free watch Denver Broncos vs St. Louis Rams live NFL Preseason,
2013 match online? If you can not follow the Denver Broncos vs St. Louis
Rams live game on your TV. NFL Live Stream Denver Broncos vs St. Louis
Rams. Live Streaming NFL Denver Broncos vs St. Louis Rams. NFL Live
Streaming Denver Broncos vs St. Louis Rams. Don't worry you can still
watch NFL Football games online from your PC TV. You don't have to look
else anywhere. JUST FOLLOW OUR LIVE TV LINK on this page and enjoy watch
your favorite TV channels. We offer you to watch live internet
broadcasting Sports TV Software from across the world.
!HD! watch-live-tv-link HD

pyside qapplication exec with while loop

pyside qapplication exec with while loop

Basically I have a program that will create a basic hello world program in
PySide qt framework. The difference is that it does print("loop") in a
while loop before exec_() is called. The problem with that the loop won't
finish until the user is done with the program, so it will only call
exec_() when the loop's done.
My problem is that if you run it like this, print("loop") will run, but
the window won't respond, and doesn't display "Hello, loop!"). If you
indent qt_app.exec_() under while running:, then the window will respond,
but print("loop") only executes once before closing the window, and
executes only once after closing it.
I need to be able to have the main window be responding while its printing
"loop" to the console multiple times.
import sys
from PySide.QtCore import *
from PySide.QtGui import *
qt_app = QApplication(sys.argv)
label = QLabel('Hello, loop!')
label.show()
running = True #only set to False when user is done with app in the real
code.
while running:
#I am handling connections here that MUST be in continual while loop
print("loop")
qt_app.exec_()

How can I improve the presentation of the food I serve?

How can I improve the presentation of the food I serve?

Cooking great tasting food is an art of it's own, but to create a
restaurant quality dish requires the food to be professionally presented.
I have no formal training in cooking and really struggle trying to make my
dishes look as stunning as you would see on the food channels or gourmet
magazines, so I ask:
What simple techniques or tips exist that a novice chef could use to
enhance the presentation of a dish (i.e. make it more visually appealing?)
For example: balancing colours of food, drizzling this or that, stacking
items vertically.

Using chart with angularjs

Using chart with angularjs

I'm in a php project which need to show the chart. I intend to use
Morrisjs to show which use Jquery. But I find out the angularjs is more
interesting. Is there person can show me how can I use chart on angularjs
with Ajax with data from php return.

Ituen's want to delet my books [on hold]

Ituen's want to delet my books [on hold]

I have just lost my laptop the one that i use to sync all my books my i
book size is 2.5g an my i cloud account can support 15g I tried to backup
my iBooks it shows only 750mb that are backup When I try to sync my books
in the ituens wants to delet all my books I did not purchase any from
ituens because they don't sell books in my store what can I do my iOS
6.1.3 my ituens is the last version

Friday, 23 August 2013

rsync algorithm in perl

rsync algorithm in perl

For one of my project, I want to create rsync based file transfer using IO
sockets, I cannot use native rsync has it is blocked in most of the
servers. The code was intended to be created in perl . Before inventing
the wheel I went through the CPAN and did research to find resuable one
but I am not in success.
Following things are planning to add in the code.
Find directory and files
Find the mtime , md5 checksum and weak rolling checksum ( both local and
remote)
Use IO sockets to transfer
anything I am missing. Any pointer will be highly appreciated.

jquery plugin method ands callbacks

jquery plugin method ands callbacks

I have a basic plugin that populates an array within the plugin. How can I
get that array via a method call with parameters. This is my first plugin
so please go easy on me if this is a dumb question.
basic Plugin
(function($) {
$.fn.myPlugin = function() {
return this.each(function(){
tagArray = []; // my array that is populated
//code that does stuff to populate array
});
}
})(jQuery);
I would like to get the tagArray like so...
var arr = $('.className').myPlugin("getArray");
Where I can then use that array elsewhere. How can I accomplish this?
Thank you for any help.

Get Time difference between group of records

Get Time difference between group of records

I have a table with the following structure
ID ActivityTime Status
19 2013-08-23 14:52 1
19 2013-08-23 14:50 1
19 2013-08-23 14:45 2
19 2013-08-23 14:35 2
19 2013-08-23 14:32 1
19 2013-08-23 14:30 1
19 2013-08-23 14:25 2
19 2013-08-23 14:22 2
53 2013-08-23 14:59 1
53 2013-08-23 14:56 1
53 2013-08-23 14:57 1
53 2013-08-23 14:52 2
53 2013-08-23 14:50 2
53 2013-08-23 14:49 2
53 2013-08-23 14:18 2
53 2013-08-23 14:30 1
I want to calculate the total time difference for each ID against Status
2. For example ID 19 stayed on Status 2 from 14:35 To 14:50 (15 minutes),
then 14:22 to 14:30 (8 minutes). So the total ID 19 stayed on Status 2 is
23 minutes. (In both cases I considered the minimum time for status 2 to
status 1) The problem is how do I only include difference between Status
where they are different in next row.
For example I would exclude the first record in the table with the status
1 and pick the second row. Same is the case with Status 2. I would pick
the minimum time, calculate their difference and then add them up for
multiple groups of status against each channel.
I have tried using CURSOR but can't seem to make it work. I am also pretty
confident that I can achieve that in C# after getting all the data and
then looping through it. But I am just wondering if there is a direct way
of getting the information without a loop. I also created a SQL fiddle
with data, but I can't seem to make it work. I am coming from C#
background with basic knowledge of SQL. Would be glad if someone can help
me out.

Controller requires a value for one parameter - Internal server error 500

Controller requires a value for one parameter - Internal server error 500

Does implementing of AJAX with Symfony2 is so difficult as I see it now?
My goal is to implement a one-page application that displays a form for
creating posts (each post has a post title and a post content). When the
form is submitted, AJAX takes in charge displaying the post below the form
in the div#output.
My template looks like:
{% extends '::base.html.twig' %}
{% block body %}
<form action="{{ path('post_creates', { 'id': entity.id }) }}"
id="form_ajax" method="post" {{ form_enctype(form) }}>
{{ form_widget(form) }}
<p>
<input type="submit" value="create" />
</p>
</form>
<ul class="record_actions">
<li>
<a href="{{ path('post') }}">
Back to the list
</a>
</li>
</ul>
<div id="output"></div>
{% endblock %}
{% block javascripts %}
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script
src="http://jwpsrv.com/library/leLjogZ6EeOBvCIACusDuQ.js"></script>
<script src="{{ asset('bundles/testblog/js/test2.js') }}"></script>
<script>
$("#form_ajax").submit(function(){
tinyMCE.get("test_bundle_blogbundle_posttype_postContent").save();
var content= $("#test_bundle_blogbundle_posttype_postContent").val();
var title = $("#test_bundle_blogbundle_posttype_postTitle").val();
$.ajax({
type: "POST",
url: "{{ path('post_creates', { 'id': entity.id }) }}",
data: {datas:title, date:content},
cache: false,
success: function(data){
$('#output').html(data);
}
});
return false;
});
</script>
{% endblock %}
The controller is:
public function createsAction(Request $request, $id)
{
$request = $this->container->get('request');
$entity = new Post();
if($request->isXmlHttpRequest())
{
$title = $request->request->get('datas');
$content = $request->request->get('date');
$em = $this->container->get('doctrine')->getEntityManager();
if($title != '')
{
$entity->setPostContent($content);
$entity->setPostTitle($title);
$id=$entity->getId();
$em = $this->getDoctrine()->getManager();
$em->persist($entity);
$em->flush();
$post = $em->getRepository('TESTBlogBundle:Post')->find($id);
}
else {
$post = $em->getRepository('TESTBlogBundle:Post')->find($id);
}
$deleteForm = $this->createDeleteForm($id);
return
$this->container->get('templating')->renderResponse('TESTBlogBundle:Post:show.html.twig',
array(
'entity' => $post, 'id' => $id,
'delete_form' => $deleteForm->createView(),
));
}
else {
return $this->indexAction();
}
}
I have a the following problem:
Controller requires that you provide a value for the "$id" argument
(because there is no default value or because there is a non optional
argument after this one).
When I var_dump the $id inside my controller, I always have null. My
controller works fine if I pass a value to it in function arguments. My
knowledge in Symfony2 doesnt allow me to find what I am missing. Your help
is really appreciated.

Greek alternate/variant letters

Greek alternate/variant letters

Some letters of the greek alphabet include alternative letters. For
instance, we have \Phi, \phi and \varphi.
What is the purpose of the variant versions of these letters? Why are
these not available for the entire greek alphabet?
Information about these symbols:
https://en.wikibooks.org/wiki/LaTeX/Mathematics#Greek_letters. The
Comprehensive LaTeX Symbol List from CTAN does not mention their purpose
either.

Google Maps v3 image tile overlay incorrectly positioned

Google Maps v3 image tile overlay incorrectly positioned

I have created a complete world image overlay with gdal2tiles.py, and had
to look at many different sources only to make it work for Google Maps v3
API (main code from here). Unfortunately, there are several issues (see
example here). The main issue I have is the following.
On loading, the map shows zoom level 1 and the tiles for the earth in the
center are placed incorrect ('shifted'). However, the tiles on the earth
on the left and right are correct. Panning to the sides shows the tiles
correctly, however zooming out and zooming in again (or opposite) will
cause the overlay to be incorrectly placed again. I can't pinpoint the
reason why it does this. Additionally, Google wants to load tiles with
coordinates that are impossible (x=0, x=-1, y=0, y=-1) in seemingly random
occasions (as seen through the file not available errors).
I found this to be occurring in both Google Chrome and Firefox. Is my code
incorrect, or is this actually a bug?

Thursday, 22 August 2013

Why wont this shout box slider work properly?

Why wont this shout box slider work properly?

I added this shout box from
http://www.saaraan.com/2013/04/creating-shout-box-facebook-style a live
demo of it can be seen here
http://www.saaraan.com/2013/04/creating-shout-box-facebook-style
I have everything working properly except the slider itself. Every time I
try to scroll up, it automatically scrolls back down. It wont stay in the
up position. I think the problem is here.
// load messages every 1000 milliseconds from server.
load_data = {'fetch':1};
window.setInterval(function(){
$.post('shout.php', load_data, function(data) {
$('.message_box').html(data);
var scrolltoh = $('.message_box')[0].scrollHeight;
$('.message_box').scrollTop(scrolltoh);
});
}, 1000);
//method to trigger when user hits enter key
$("#shout_message").keypress(function(evt) {
if(evt.which == 13) {
var iusername = $('#shout_username').val();
var imessage = $('#shout_message').val();
post_data = {'username':iusername, 'message':imessage};
//send data to "shout.php" using jQuery $.post()
$.post('shout.php', post_data, function(data) {
//append data into messagebox with jQuery fade effect!
$(data).hide().appendTo('.message_box').fadeIn();
//keep scrolled to bottom of chat!
var scrolltoh = $('.message_box')[0].scrollHeight;
$('.message_box').scrollTop(scrolltoh);
//reset value of message box
$('#shout_message').val('');
More specifically here
var scrolltoh = $('.message_box')[0].scrollHeight;
$('.message_box').scrollTop(scrolltoh);
and here
//keep scrolled to bottom of chat!
var scrolltoh = $('.message_box')[0].scrollHeight;
$('.message_box').scrollTop(scrolltoh);
I have changed the 0 to 1 and other numbers and it fixes the scroll to
work right but it doesn't show the latest shout, it will show shout 25
which is the last shout to be seen before deletion. Im not sure if this
makes any sense but any help would be great.
The first link from top shows the whole code, the second link shows the
example

How to do a POST with XML API?

How to do a POST with XML API?

Here we see:
https://developers.google.com/youtube/2.0/developers_guide_protocol_comments#Adding_a_comment
I need to do a request with XML API.
POST /feeds/api/videos/VIDEO_ID/comments HTTP/1.1
Host: gdata.youtube.com
Content-Type: application/atom+xml
Content-Length: CONTENT_LENGTH
Authorization: Bearer ACCESS_TOKEN
GData-Version: 2
X-GData-Key: key=DEVELOPER_KEY
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:yt="http://gdata.youtube.com/schemas/2007">
<content>This is a crazy video.</content>
</entry>
What should I use for this?

Run windows program by use CygwinTerminal

Run windows program by use CygwinTerminal

I would ask if it possible run Windows program by use CygwinTerminal. For
example (Notepad++) I'd run notepad.exe file (so that I want see Notepad++
window in my Windows). I've tried several ways such as: cmd /c notepad.exe
cygstart notepad.exe execute bat scripts But it didn't work. How I could
run my program from CygwinTerminal level? I broad perspective I'd create
remote connection beetwen my linux and windows machines and can remote
ivoking programs on my windows from linux (I'll plan use ssh + Cygwin).
Perhaps someone have better ideas how I can do it? Best Regards.

How to draw closed spline 3D (closed curve 3d) through unordered list of points3D. How to arrange points3D?

How to draw closed spline 3D (closed curve 3d) through unordered list of
points3D. How to arrange points3D?

Hello I have a problem which I believe is very difficult to solve, I was
searching everywhere for solution but I didn't find anything.
I want to draw profiles from list of points.
My problem is:
I have a list of Points3D from text file, they arent in any order, just
like random points. Of course I added them to List. I draw those points in
3D space using small 3D Ellipses. So far so good.
Now I want to draw a 3D spline going through all the points from list. So
i created class Spline3D which is using cubic interpolation to determine
positions of points of curve between given points from text file. In my
spline I calculate say like 400 new points then I am drawing small 3D
Cylinders between each pair of points: point i and point i+1 have small
cylinder betwen them + the cylinders are rotated properly so everything is
looking like real spline (in theory).
The main problem is that points are unordered so if I am just doing that I
get spline like this:
img5.imageshack.us/img5/4659/2b61.jpg
the raw points draw in space look like this:
http://img194.imageshack.us/img194/9016/hv8e.jpg
img5.imageshack.us/img5/659/nsz1.jpg
So i figure out that I have two solutions
Put points in some sort of order, then add them to Spline3D and calculate
spline.
Calculate spline in some other way, which probably lead to order points in
some way, so basically it still lead me to 1.
So I tried some kinds of reordering methods.
1. a) Nearest neighbor of point
int firstIndex = (new
Random().Next(pointsCopy.Count));//0;//pointsCopy.Count / 2;//(new
Random().Next(pointsCopy.Count));
NPoint3D point = pointsCopy[firstIndex];
pointsCopy.Remove(point);
spline3D.addPoint(point.ToPoint3D());
NPoint3D closestPoint = new NPoint3D();
double distance;
double nDistance;
Point3D secondPoint = new Point3D();
bool isSecondPoint = true;
while (pointsCopy.Count != 0)
{
distance = double.MaxValue;
for (int i = 0; i < pointsCopy.Count; i++)
{
nDistance = point.distanceToPoint(pointsCopy[i]);
if (nDistance < distance)
{
distance = nDistance;
closestPoint = pointsCopy[i];
}
}
if (isSecondPoint)
{
isSecondPoint = false;
secondPoint = closestPoint.ToPoint3D();
}
spline3D.addPoint(closestPoint.ToPoint3D());
point = closestPoint;
pointsCopy.Remove(closestPoint);
}
spline3D.addPoint(points[firstIndex].ToPoint3D()); //first point is also
last point
This was my first idea, I thought that this will became ultimate solution
to my problem. I choose randomly one point from list of points and this
point became first point to spline. Then I find the closest point to this
previous point I add him to spline and remove from list and so on...
img18.imageshack.us/img18/3650/mik0.jpg
img706.imageshack.us/img706/3834/u97b.jpg
Sadly sometimes (especially near edges of my profile) point down is closer
then point near, so spline became there crooked.
2. b) TSP
distanceMatrix = new TSP.DistanceMatrix(pointsCopy,
NPoint3D.distanceBetweenTwoPoints);
int[] indexes = TSP.Algorithms.TSPgreedySearch(distanceMatrix);
for (int i = 0; i < indexes.Length; i++)
spline3D.addPoint(pointsCopy[indexes[i]].ToPoint3D());
spline3D.addPoint(pointsCopy[indexes[0]].ToPoint3D());
Basically I use traveling salesman problem algorithm to determine shortest
spline (shortest path) through all the points. Sadly this problem is
NP-Hard, so to get good performance I use some heuristics.
img198.imageshack.us/img198/714/xiqy.jpg
http://img839.imageshack.us/img839/9530/exnu.jpg
Spline looks better than in 1.a but still it isn't enough.
3. c) Some weird methods using two splines
Some of my friends told me that I should split profile in two parts
(upper-part and lower-part) and then calculate and draw two splines. Sadly
I dont know how to do that, I mean I don't know how to determine if point
should be in upper-part or lower-part. Please help me.
So how could I solve this problem? Any ideas?

How to set scroll for div in ember.js

How to set scroll for div in ember.js

i am displaying multiple name within one div and then that div should be
scrollable.
<script type="text/x-handlebars" data-template-name="index">
Display Names
</script>
when i click on display name i have to display all name so i have created
another one template like this
<script type="text/x-handlebars" data-template-name="names">
<div class="container">

<div>
</div>
</script>
i have to apply scroll for container div if children of that div height is
more than that div.
i have done in ember.js file like this
App.Router.map(function()
{
this.resource('names');
});
App.NamesRoute=Ember.Route.extend({
model:function()
{
return namedetails;
}
});
it is displaying but i don't know how to set scroll for that container div
in ember.js
how to set ?

Ubuntu boots from some computers but not others

Ubuntu boots from some computers but not others

I have recently come across a strange problem regarding booting from a USB
Ubuntu installation. When i insert my pen drive with ubuntu on it and boot
into a computer it almost always boots fine into Ubuntu. However, recently
i have been working on 3 computers, all the same specs and none of them
accept a Ubuntu USB boot, USB is enabled in the bios, the keyboard and
mouse are both USB and they work fine in the dos environment, and "USB
device" is set as the primary boot option.
Has anyone else come across this issue?

NSDictionary : second object must be non nil

NSDictionary : second object must be non nil

After a lot of searching i found various solution but nothing works in my
case. I am getting this error when binding data in NSDictionary . Crash
Logs are :
Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '+[NSDictionary
dictionaryWithObjectsAndKeys:]: second object of each pair must be
non-nil. Or, did you forget to nil-terminate your parameter list?'
*** First throw call stack:
code :
while(sqlite3_step(select_statement) == SQLITE_ROW)
{
// const char* recipeID = (const
char*)sqlite3_column_text(select_statement, 1);
// const char* recipename = (const
char*)sqlite3_column_text(select_statement, 0);
// const char* recipepicname = (const
char*)sqlite3_column_text(select_statement, 3);
// const char* chapterid = (const
char*)sqlite3_column_text(select_statement, 4);
// const char* recipedesc = (const
char*)sqlite3_column_text(select_statement, 2);
//
//
// srtRecipestepId = recipeID == NULL ? nil : [[NSString
alloc]initWithUTF8String:recipeID];
// strRecipeName = recipename == NULL ? nil : [[NSString
alloc]initWithUTF8String:recipename];
// NSString *recipePicName = recipepicname == NULL ? nil :
[[NSString alloc]initWithUTF8String:recipepicname];
// strRecipeIntro = recipedesc == NULL ? nil : [[NSString
alloc]initWithUTF8String:recipedesc];
// NSString *strchapterId = chapterid == NULL ? nil :
[[NSString alloc]initWithUTF8String:chapterid];
srtRecipestepId=[NSString stringWithUTF8String:(char
*)sqlite3_column_text(select_statement, 1)];
strRecipeName=[NSString stringWithUTF8String:(char
*)sqlite3_column_text(select_statement, 0)];
// RecipestepPics = [[NSData alloc]
initWithBytes:sqlite3_column_blob(select_statement, 3)
length:sqlite3_column_bytes(select_statement, 3)];
NSString *recipePicName = [NSString stringWithUTF8String:(char
*)sqlite3_column_text(select_statement, 3)];
strRecipeIntro = [NSString stringWithUTF8String:(char
*)sqlite3_column_text(select_statement, 2)];
NSString *strchapterId = [NSString stringWithUTF8String:(char
*)sqlite3_column_text(select_statement, 4)];
[arrreturnRecipefinder addObject:[NSDictionary
dictionaryWithObjectsAndKeys:srtRecipestepId,@"RecipestepId",strRecipeName,@"RecipeName",recipePicName,@"RecipestepPics",strRecipeIntro,@"RecipeIntro",strchapterId,@"RecipeChapterId"]];
}

Wednesday, 21 August 2013

why getQueryString() does not work in jsf backing bean with h:commandButton

why getQueryString() does not work in jsf backing bean with h:commandButton

I have build a login snippet of code that is on the top of menu bar. If a
user is in any of the page by navigating and presses all of sudden the
login button, I'll like to see that person authenticated and at the same
time stay on the page where he originally comes from. so I used this on
the backing bean:
HttpServletRequest request = (HttpServletRequest)
FacesContext.getCurrentInstance().getExternalContext().getRequest();
then if there is let say mypage.htm?a=2&b=2 get a=2&b=2 with the
request.getQueryString()
but getQueryString returns null, how can I can have the original URL
entirely from the backing bean?

how to split a string column into 4 string columns?

how to split a string column into 4 string columns?

I have definition column of a medication. I want the definition to be
split into [product name(PN)], [doseform(DF)], [total dose(TD)] and
[units]. Eg:
BENADRYL: MYLANTA 1:1 SOLUTION(Benadryl
mylanta(PN),Sol(DF),1:1(TD),NULL(units))
MASK AND SPACER (Mark and Spacer(PN),NUll,NUll,NUll)
BL VITAMIN B-6 50 MG TABS(BL Vitamin(PN),Tabs(DF),50(TD),MG(Units))

Firing onchange event when Ember.Select option is changed

Firing onchange event when Ember.Select option is changed

I have been trying to bind an event to select element generated via
Ember.Select but I am having no luck. I created a select view like :
AS.ClientSelectView = Ember.Select.extend({
contentBinding:"AS.customerController",
selectionBinding:"AS.SelectedClient.client", optionLabelPath :
"content.name", optionValuePath : "content.id", change: function () {
console.log(AS.SelectedClient.client.get('name')); } }); but when the
change event fires, it does not show the currently selected element's
value but it shows the prior selected options value. Here is the jsbin
link : http://jsbin.com/iSiCUmU/2 Any help will be much appreciated.
Thanks.

Jquery file uplaod fail showing

Jquery file uplaod fail showing

Hi I am using jquery file upload showing fail i have tried with diffeerent
datatype but still showing fail, i can show my image uploaded but done
event is not firing, fail event is firing.
$('#frmsettings').fileupload({
type: 'POST',
dataType: 'application/json',
url: '/Settings/UploadUiLogo',
add: function (e, data)
{
data.submit();
},
progressall: function (e, data)
{
},
done: function (e, data)
{
$.each(data.files, function (index, file)
{
alert("Done called");
});
},
fail: function (e, data)
{
alert("Fail : Called");
//window.location = JsErrorAction;
}
});
Controller
======================================
public ContentResult UploadUiLogo()
{
try
{
if (Request.Files != null)
{
foreach (string file in Request.Files)
{
HttpPostedFileBase hpf = Request.Files[file] as
HttpPostedFileBase;
if (hpf.ContentLength == 0)
continue;
string savedFileName =
Path.Combine(Server.MapPath("~/Content/uploadlogo"),
Path.GetFileName(Guid.NewGuid() + hpf.FileName));
hpf.SaveAs(savedFileName);
return Content("{\"name\":\"" + savedFileName +
"\"", "application/json");
}
}
return null;
}
catch (Exception ex)
{
throw ex;
}
}
Please any one help me on it asap.

What is the state of new format packages (pkgng) in recent FreeBSD

What is the state of new format packages (pkgng) in recent FreeBSD

So, I was searching around with no results about what is the state with
new format packages on FreeBSD. As I understand after this spring's
security issue package building has been postponed. And they are not
available to current date, right? Any idea when new package's repositories
will be available?
Thanks.

How to run muliple bugzilla instances in same machine

How to run muliple bugzilla instances in same machine

I am already having an instance of bugzilla running in mu unix machine. I
want to run another instance of bugzilla in the same machine which uses
different DB. How can I dot it? Please help.

Tuesday, 20 August 2013

Clear cookie value and recreate the new cookie

Clear cookie value and recreate the new cookie

I am using the below code to delete the old cookie and create a new
cookie. Error here HttpContext.Current.Request.Cookies[name] having old
cookie value in first load. if i refresh the page means it set new cookie
public void Set_Cookie(string name, string value, ref string retmsg)
{
string str_retval = string.Empty;
try
{
//Delete Old Cookie
if (HttpContext.Current.Request.Cookies[name] == null)
return;
var mycookie = new HttpCookie(name) { Expires =
DateTime.Now.AddDays(-1d) };
HttpContext.Current.Response.Cookies.Add(mycookie);
//Create New Cookie
HttpCookie cookie = new HttpCookie(name);
cookie.Values.Add(name, value.Trim());
HttpContext.Current.Response.Cookies.Add(cookie);
if (HttpContext.Current.Request.Cookies[name] != null)
{
//Error here HttpContext.Current.Request.Cookies[name] having old cookie
value in first load. if i refresh the page means it set new cookie
//HttpCookie cookie_value =
HttpContext.Current.Request.Cookies[name];
if
(HttpContext.Current.Request.Cookies[name].Values[name]
== value.Trim())
{
retmsg = "true";
}
else
{
retmsg = "Invalid Details.Please Try Again.";
}
}
else
{
retmsg = "Invalid Details";
}
}
catch (Exception ex)
{
throw;
}
}

What is missing to make my cascading DropDownList work

What is missing to make my cascading DropDownList work

Very easy case displayed here: http://jsbin.com/ahoYoPi/3/edit
I need to specify that the child's inner field to filter (eq) against the
parent's value field is "category_id"... Of course, Kendo's documentation
doesn't say anything about how to do that... Or is it something so super
obvious it doesn't deserve to be explained ?
var categoriesList = new Array (
{"id":"1","categoryName":"Fruits"},
{"id":"2","categoryName":"Vegetables"} );
var productsList = new Array(
{"id":"1","categorie_id":"1","productName":"Apples"},
{"id":"2","categorie_id":"1","productName":"Oranges"},
{"id":"3","categorie_id":"2","productName":"Carottes"},
{"id":"4","categorie_id":"2","productName":"Patatoes"});
$("#categories").kendoDropDownList({
dataTextField: "categoryName",
dataValueField: "id",
dataSource: categoriesList,
optionLabel: "----------------" ,
change: function() {
$("#products").data("kendoDropDownList").value(0);
}
});
$("#products").kendoDropDownList({
cascadeFrom: "categories",
dataTextField: "productName",
dataValueField: "id",
dataSource: productsList,
optionLabel: "----------------" ,
});

What do "it doesn't work" and "phrase" mean?

What do "it doesn't work" and "phrase" mean?

I'm confused with these two and their usages.

VS2010 WPF DataGrid Sorts Improperly

VS2010 WPF DataGrid Sorts Improperly

I am using a WPF DataGrid with procedurally (C#, VS 2010) generated, bound
columns, and the DataGrid will not sort data correctly.
CanUserSortColumns is set to true. SortMemberPath is set to the same
property as the text displayed in the grid.
Regardless of which column the user sorts, and despite the sort icon being
displayed over the appropriate column, the DataGrid merely alternates the
sort order of the first column.
column.Header = departmentColumn.ColumnHeader;
column.Width = departmentColumn.ColumnWidth;
column.Binding = new Binding("Cells[" +
departmentColumn.Ordinal.ToString() + "]");
column.SortMemberPath = "DisplayString";
I have no problems with any other data being displayed or used incorrectly
by the DataGrid, so I am stumped. Why would the sort only consider text in
the first column, when everything else binds to data from the appropriate
column?

Is the following set in $\mathbb R^2$ connected?

Is the following set in $\mathbb R^2$ connected?

Is the following set in $\mathbb R^2$ connected?: $A=\{(x, y) : x^2y^2 = 1\}$
My attempt: $f:\mathbb R^2\to\mathbb R:(x,y)\mapsto xy$ is continuous and
$f(A)=\{-1,1\}.$ Since $f(A)$ is disconnected so is $A.$
Please tell me if it's correct or not.