Monday, 30 September 2013

Give a broom to anyone who completes 10 close queue reviews successfully in a 24 hour period – meta.stackoverflow.com

Give a broom to anyone who completes 10 close queue reviews successfully
in a 24 hour period – meta.stackoverflow.com

Remember Winter Bash? How fun was that? I propose that we give a virtual
broom to everyone who completes 10 reviews in any 24 given hour period.
The broom would only last for 24 hours, so to keep …

How to check that cache is working on current page=?iso-8859-1?Q?=3F_=96_drupal.stackexchange.com?=

How to check that cache is working on current page? –
drupal.stackexchange.com

Some modules silently turn off caching on certain pages. How is the
easiest way to check that this is the case and also identify problematic
module?

Oracle forms migrated from 10g to 11g

Oracle forms migrated from 10g to 11g

Once exported from oracle 10g to 11g, It is saying some java beans are
missing in the form. Is there something we need to change the FORM beans
path in new version.If not, Where are we mentioning the path for java
beans in reports.

How to populate select options dynamically from Model Collection

How to populate select options dynamically from Model Collection

I have a model as defined below class Colors extends Backbone.Model name:
-> [@get("name")] value: -> [@get("value")]
Collection as defined below class @ColorsCollection extends
Backbone.Collection model: Colors
Select tag as define below %select{name: "colorslist" type: "hidden"
value: "" }
Upon an event, I want to dynamically populate the colors select options
with data fetched from ColorsCollection.
I have been looking into select2 documentation but unable to find any
relevant examples.

Sunday, 29 September 2013

Issues in django deployment with two subdomains using Apache auth

Issues in django deployment with two subdomains using Apache auth

I'm deploying a Django 1.5 with two sites, each one is independent from
the other one (each one has its own database), but these two sites are
subdomains: one is new.mydomain.com and the other dev.mydomain.com. I'm
using Apache with mod_wsgi.
The problem is: I'm Authenticating against Django's user database from
Apache correctly, but when I try to use Django groups with the Apache
authentication I get the following situation:
I can login to one of the subdomains e.g. new without problems, but if I
try to login to the other one (dev) I can't. Apache says that the user
isn't in the allowed groups. Then if I restart Apache and try to login to
dev (which was impossible before) then there is no problem here, but now
it's impossible to login with the other subdomain new!
To sum up: I can't login to the two sudomains at the same time, no matter
which (allowed) users I use.
The virtualhost for new subdomain is (the other one looks like this one
changing paths):
<VirtualHost *:80>
ServerName new.mydomain.com
ServerAlias www.new.mydomain.com
ServerAdmin caumons@gmail.com
Alias /robots.txt
/var/www/sites/master/EurekaStart.git/EurekaStart/robots.txt
Alias /favicon.ico
/var/www/sites/master/EurekaStart.git/EurekaStart/static_collected/img/favicon.ico
Alias /static/
/var/www/sites/master/EurekaStart.git/EurekaStart/static_collected/
<Directory
/var/www/sites/master/EurekaStart.git/EurekaStart/static_collected>
Order deny,allow
Allow from all
</Directory>
Alias /media/ /var/www/sites/master/EurekaStart.git/EurekaStart/media/
<Directory /var/www/sites/master/EurekaStart.git/EurekaStart/media>
Order deny,allow
Allow from all
</Directory>
WSGIDaemonProcess eureka-startups.com
python-path=/var/www/sites/master/EurekaStart.git:/var/www/sites/master/EurekaStart.git/env/lib/python2.7/site-packages
WSGIProcessGroup eureka-startups.com
WSGIScriptAlias /
/var/www/sites/master/EurekaStart.git/EurekaStart/wsgi.py
<Directory /var/www/sites/master/EurekaStart.git/EurekaStart>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
<Location "/">
AuthType Basic
AuthName "Enter your guest user & password"
Require group guest
Require valid-user
AuthBasicProvider wsgi
WSGIAuthUserScript
/var/www/sites/master/EurekaStart.git/EurekaStart/wsgi.py
WSGIAuthGroupScript
/var/www/sites/master/EurekaStart.git/EurekaStart/wsgi.py
</Location>
ErrorLog /var/www/sites/master/EurekaStart.git/logs/apache/error.log
TransferLog /var/www/sites/master/EurekaStart.git/logs/apache/access.log
</VirtualHost>
The wsgi.py file for new subdomain looks like (the wsgi file for dev is
exactly like this one):
import os
import sys
from django.core.handlers.wsgi import WSGIHandler
# We need to add the site's root path to sys.path when using Django
Authentication for WSGI
SITE_PKG_PATH = os.path.abspath(os.path.dirname(__file__))
SITE_ROOT_PATH = os.path.abspath(os.path.join(SITE_PKG_PATH, '..'))
sys.path.append(SITE_ROOT_PATH)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "EurekaStart.settings")
# This import MUST be done after setting `DJANGO_SETTINGS_MODULE`
import django.contrib.auth.handlers.modwsgi as modwsgi
def check_password(environ, user, password):
return modwsgi.check_password(environ, user, password)
def groups_for_user(environ, user):
return modwsgi.groups_for_user(environ, user)
application = WSGIHandler()

Using Parse.com to retrieve a new array iOS

Using Parse.com to retrieve a new array iOS

I'm trying to use the parse.com data browser to inset a new string array
into my code.
So if I've got a code with an array of @"blue", @"yellow", @"black", nil
then how can I change it to @"white", @"gold", @"brown", nil ?
In the app, I have the user press a button and one of said string value
appears at random. I would like to put a new array on a backend to have
new values so that I don't have to update the app every time.
Is there an example of how to do this? I haven't been able to get the Data
Browser to replace the array in my code with the array in the data
browser.
I've got:
PFQuery *query = [PFQuery queryWithClassName:@"colorArray"];
self.colors = [query findObjects];
But it crashes when I try to retrieve the values of the array when it gets
to this part of the code in a later method -
NSUInteger index = arc4random_uniform(self.colors.count];
self.colorLabel.text = [self.colors objectAtIndex:index];
self.colors, by the way, is synthesized from the header file as an array.
It looks like the code doesn't understand the "index" part of the equation
when it tries to set the self.colorLabel.text using the obectAtIndex
Am I doing this right? Thanks for any help anyone can give.

ORA-00902: invalid datatype

ORA-00902: invalid datatype

I am getting the above error when I run the following query
create table customer (
cust_fname varchar2(15) NOT NULL,
cust_lname varchar2(15) NOT NULL,
cust_id number(9,0) NOT NULL,
address varchar2(40) NOT NULL,
city varchar2(14) NOT NULL,
postal_code number(6,0) NOT NULL,
country varchar2(14) NOT NULL,
phone_no number(12,0) NOT NULL,
e-mail varchar2(30) NOT NULL,
password varchar2(10) NOT NULL,
primary key(cust_id),
check(e-mail like '_%@_%._%')
);
Please tell what is the problem.

The Next palindrome

The Next palindrome

I am tryting to solve this next palindrome problem using
C++(http://www.spoj.com/problems/PALIN/) Even after getting the answer
correctly on my compiler I am getting a wrong answer on spoj.Even if
somebody could tell me any test case where this program fails will be
greatly useful.
#include<iostream>
#include<cmath>
using namespace std;
bool palin(int a)
{
int rev=0,d=a;
while(a!=0)
{
rev=(rev*10)+(a%10);
a=a/10;
}
if(rev==d)
{return true;}
else
{return false;}
}
int main()
{
int t;
cin>>t;
int c[t];
for(int i=0;i<t;i++)
{
int a;
cin>>a;
a++;
while(!palin(a))
{
a++;
}
c[i]=a;
}
cout<<endl;
for(int i=0;i<t;i++)
{cout<<c[i]<<endl;}
return 0;
}

Saturday, 28 September 2013

(Dependency Walker) missing explicit type on function

(Dependency Walker) missing explicit type on function

Apologies in advance for noob mistakes. This is my first question here.
First, some background:
I am trying to create a module for a program using dependency walker to
find C++ functions in a .dll that I don't have the lib or any source code
for. You can also assume that I can't get support from the original
developer. Basically, I checked another file that accesses it to see what
the minimum functions were to get it working. Here is an example of the
undecorated names that are output:
void foo::bar::baz(float)
float foo::bar::qux(void)
foo::bar::bar(void)
class foo::bar & foo::bar::operator=(class foo::bar const &)
The top two functions obviously take float or void and return float or
void. I got a similar function working using something like:
HINSTANCE THEDLL = LoadLibrary("C:\\dllFolder\\theDll.dll");
typedef float (*quxType)(void);
quxType qux = (quxType)GetProcAddress(THEDLL, "quxMangledName");
So those are not a problem.
Now, the third on the list looks like another function that takes void,
but it doesn't have an explicit return type. Does this mean I should just
use an implicit type for it, is it void, or is it not really a function?
If not, what is it?
I have no idea what to do with the fourth one. Is it even possible to
handle without the associated .h file?
I looked around, but I couldn't find any information on what to do when
the function doesn't look like a normal function with an explicit return
type. Despite using basically the same code that I used to get a function
working in a similar .dll, I keep getting an access violation crash when I
try to use function #2 here (I really just need function #2). So I am
guessing that the .dll needs more information or needs something
initialized first, which is why I am interested in the others on the list.
I realize this is a complicated problem, so there probably won't be a
"Right answer" solution to get it working, but if I am making any obvious
mistakes, or if there are any general suggestions for how to attack the
problem (even alternatives to dependency walker), let me know.

Java Program which gets queried data returned from Facebook=?iso-8859-1?Q?=2C_and_does_something_with_it=85?=

Java Program which gets queried data returned from Facebook, and does
something with it…

I apologize in advanced if the question sounds/is ridiculous, however
pertains to an assignment I currently have and I am really need help with
the basics on how to approach this.
The specifications are simple and open-ended, as the assignment is only
meant to demonstrate a working knowledge of data scrapping basics.
I need to develop a program in Java that gathers all queried results from
a search of Facebook and then does "something" with that data.
One idea listed as an example is Eg. Search String "San Diego" then parses
that data . Eg. Get the name and ID of everyone who posted under the
articles then get the gender of everyone who posted.
As you can see the requirements are very open-ended. What I really need is
some advice on where to start. A basic template would be great as I could
learn and add functionality to the program as I went. For Java development
I am using Jcreator Pro.
Thank you again for any help.

Why does this code work perfectly well in Python 3.3 but not in Python 2.7?

Why does this code work perfectly well in Python 3.3 but not in Python 2.7?

I have following code (produces an elementary cellular automaton):
def cellular_automaton(init_string,pattern,gens):
values=[128,64,32,16,8,4,2,1]
pattern_list=[]
k=0
while k<len(values):
if values[k]+sum(pattern_list)<=pattern:
pattern_list.append(values[k])
k=k+1
i=0
j=0
b=[]
f=''
pos_init=[0,1,0]
pos_interm=[]
pos_init=[[n,n+1,n] for n in range(len(init_string)-1)]
pos_interm.append(pos_init)
pos_interm[-1][-1].append(len(init_string)-1)
pos_interm[-1][-1].append(0)
pos_interm[0][0].insert(0,len(init_string)-1)
pos_interm2=[val for subl in pos_interm for val in subl]
pos=[val for subl in pos_interm2 for val in subl]
b.append(pos)
while j<gens:
pos=[i+len(init_string) for i in pos]
b.append(pos)
j=j+1
c=[val for subl in b for val in subl]
while i<len(c):
if init_string[c[i]]=='.' and init_string[c[i+1]]=='.' and
init_string[c[i+2]]=='.':
if 1 in pattern_list:
init_string=init_string+'x'
else:
init_string=init_string+'.'
elif init_string[c[i]]=='.' and init_string[c[i+1]]=='.' and
init_string[c[i+2]]=='x':
if 2 in pattern_list:
init_string=init_string+'x'
else:
init_string=init_string+'.'
elif init_string[c[i]]=='.' and init_string[c[i+1]]=='x' and
init_string[c[i+2]]=='.':
if 4 in pattern_list:
init_string=init_string+'x'
else:
init_string=init_string+'.'
elif init_string[c[i]]=='.' and init_string[c[i+1]]=='x' and
init_string[c[i+2]]=='x':
if 8 in pattern_list:
init_string=init_string+'x'
else:
init_string=init_string+'.'
elif init_string[c[i]]=='x' and init_string[c[i+1]]=='.' and
init_string[c[i+2]]=='.':
if 16 in pattern_list:
init_string=init_string+'x'
else:
init_string=init_string+'.'
elif init_string[c[i]]=='x' and init_string[c[i+1]]=='.' and
init_string[c[i+2]]=='x':
if 32 in pattern_list:
init_string=init_string+'x'
else:
init_string=init_string+'.'
elif init_string[c[i]]=='x' and init_string[c[i+1]]=='x' and
init_string[c[i+2]]=='.':
if 64 in pattern_list:
init_string=init_string+'x'
else:
init_string=init_string+'.'
elif init_string[c[i]]=='x' and init_string[c[i+1]]=='x' and
init_string[c[i+2]]=='x':
if 128 in pattern_list:
init_string=init_string+'x'
else:
init_string=init_string+'.'
i=i+3
return init_string[(len(pos_interm2)+1)*-2:(len(pos_interm2)+1)*-1]
The output is produced is as follows:
print cellular_automaton('.x.x.x.x.', 17, 2)
This code works perfectly well in Python 3.3.2 but produces a 'string
index out of range' error in Python 2.7:
Traceback (most recent call last):
File "vm_main.py", line 33, in <module>
import main
File "/tmp/vmuser_trwqmlfqgq/main.py", line 143, in <module>
print cellular_automaton('.x.x.x.x.', 17, 2)
File "/tmp/vmuser_trwqmlfqgq/main.py", line 95, in cellular_automaton
if init_string[c[i]]=='.' and init_string[c[i+1]]=='.' and
init_string[c[i+2]]=='.':
IndexError: string index out of range
I'm not so familiar with the differences between Py2 and Py3, so I'd be
glad if anyone could help me find out what is to be done to make it work
in Python 2.7 as well. How come it produces this Index error in Py2?
Thanks in advance to everyone who is willing to help.

Passing arguments in c functions

Passing arguments in c functions

I'm newbie in c. I have written a function in c and passes the arguments
to it but I got different answers as I expect.
The function is
void GridDim(float long1, float long2, float dx,
float lat1, float lat2, float dy,
float depth1, float depth2, float dh,
int *m, int *n, int *k)
{
*m = (int) ((long2-long1)/dx+1);
*n = (int) ((lat2-lat1)/dy+1);
*k = (int) ((depth2-depth1)/dh+1);
}
I used gcc to compile it: gcc -c GridDim.c
then I used the object file for a main file and compile that file
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
int m,n,k;
GridDim(20.0,30.0,0.1,10.0,15.0,0.1,5.0,20.0,5.0,&m,&n,&k);
printf("m= %d\nn= %d\nk= %d\n", m, n, k);
return 1;
}
gcc test.c -o test GridDim.o
but I did not get the correct answer. Does anybody know why?
the answer should be m=101 n=51 k=4 but I got m=1 n=1 k=-12blahblah

Friday, 27 September 2013

How to convert XML (rss.php) to html?

How to convert XML (rss.php) to html?

I'm new to XML, I got rss feed from website.com/rss.php containing XML
<rss version="0.91">
<channel>
<title>News</title>
<description>Powered by website.com</description>
<link>http://www.website.com/</link>
<language>en-gb</language>
<item>
<title>
Product Title 1
</title>
<link>
http://www.website.com/link-to-product-page.html
</link>
<pubDate>Fri, 27 Sep 2013 17:40:29 +0100</pubDate>
<description>
<![CDATA[
<img src="http://www.website.com/images/product_image_1.jpg"/> Product
Description 1 ]]>
</description>
</item>
<item>
<title>
(...)
</description>
</item>
</channel>
</rss>
I would like to convert this to html. Any advice? :)

jQuery File Upload with HttpHandler - Run web service call first?

jQuery File Upload with HttpHandler - Run web service call first?

I'm trying to use jQuery-File-Upload to upload one file to my server using
an ASP.net HttpHandler on the server-side. The upload works, but now I
need to run a web service call BEFORE I upload, then pass the data
returned from the web service call along with the upload so the file is
named according to the returned data. Here's the basic requirements:
Upload must be triggered by Javascript function (rather than the "add" event)
Run web service call first, send returned data to upload function
Restrict upload to one file
I'm not quite sure if this can be done, or how to do it. I believe I will
need to make use of the callbacks built into jQuery-File-Upload, but I've
been working on it for a couple days and haven't been able to get it to
work. Any tips or guidance as to how to get this accomplished?
Here's my exiting code, which I don't think is even close:
$('#upload').fileupload({
url: 'Handler/Upload.ashx',
xhrFields: { withCredentials: true },
dataType: 'json',
autoUpload: false,
maxNumberOfFiles: 1,
acceptFileTypes: /(\.|\/)(pdf|gif|jpe?g|png)$/i,
maxFileSize: 5000000, // 5 MB
formData: { "ActivityId": $.cookie("ActivityId") },
add: function (e, data) {
$("#icon").show().css('cursor', 'pointer')
.on('click', function () {
$("#filename").text("");
$(this).hide();
});
data.context = $("#btnSubmitForm").click(function () {
data.submit(); });
},
}).bind('fileuploadsubmit', function (e, data) {
var ActivityId = $.cookie("ActivityId");
if (ActivityId) {
data.formData = {"ActivityId" : ActivityId};
return true;
}
});

Footer DIV comes up on Container DIV having two children DIVs

Footer DIV comes up on Container DIV having two children DIVs

Container : relative positioned. Have two child div left and right column
having 60% and 30% width of container.
Left child : absolute positioned . *Top:0; Left:0;* width: 60%; Right
child : absolute positioned . Top:0; right:0; width: 30%;
Footer: Relative positioned.
But footer comes up. Code Given below.
<style type="text/css">
#container {
position: relative;
margin:0 auto;
width: 1000px;
background: #C63;
padding: 10px;
height:auto;
}
#leftCol {
position: absolute;
top:10px;
left:10px;
background: #e8f6fe;
width: 60%;
}
#rightCol {
position: absolute;
top:10px;
right:10px;
width:30%;
background: #aafed6;
}
.box {
position:relative;
clear:both;
background:#F39;
}
</style>
<div id="container">
<div id="leftCol">
<p>Lorem ipsum dolor sit amet,consectetuer adipiscing elit. Phasellus
varius eleifend. Lorem ipsum dolor sit amet, consectetuer adipiscing
elit.Phasellus varius eleifend.</p>
<p>Lorem ipsum dolor sit amet,consectetuer adipiscing elit. Phasellus
varius eleifend. Lorem ipsum dolor sit amet, consectetuer adipiscing
elit.Phasellus varius eleifend.</p>
<p>Lorem ipsum dolor sit amet,consectetuer adipiscing elit. Phasellus
varius eleifend. Lorem ipsum dolor sit amet, consectetuer adipiscing
elit.Phasellus varius eleifend.</p>
<p>Lorem ipsum dolor sit amet,consectetuer adipiscing elit. Phasellus
varius eleifend. Lorem ipsum dolor sit amet, consectetuer adipiscing
elit.Phasellus varius eleifend.</p>
</div>
<div id="rightCol">
<p>Lorem ipsum dolor sit amet,consectetuer adipiscing elit. Phasellus
varius eleifend. Lorem ipsum dolor sit amet, consectetuer adipiscing
elit.Phasellus varius eleifend.</p>
<p>Lorem ipsum dolor sit amet,consectetuer adipiscing elit. Phasellus
varius eleifend. Lorem ipsum dolor sit amet, consectetuer adipiscing
elit.Phasellus varius eleifend.</p>
</div>
</div>
<div class="box">
<p>Lorem ipsum dolor sit amet,consectetuer adipiscing elit. Phasellus
varius eleifend. Lorem ipsum dolor sit amet, consectetuer adipiscing
elit.Phasellus varius eleifend.</p>
<p>Lorem ipsum dolor sit amet,consectetuer adipiscing elit. Phasellus
varius eleifend. Lorem ipsum dolor sit amet, consectetuer adipiscing
elit.Phasellus varius eleifend.</p>
<p>Lorem ipsum dolor sit amet,consectetuer adipiscing elit. Phasellus
varius eleifend. Lorem ipsum dolor sit amet, consectetuer adipiscing
elit.Phasellus varius eleifend.</p>
</div>

CMake errors (windows gui)

CMake errors (windows gui)

I have been trying long time to fix this problem with no success .
I want to configure and generate a source ; When I try to do that , I
receive a couple of errors.
This is the results :





CMake Error at C:/Program Files (x86)/CMake
2.8/share/cmake-2.8/Modules/FindBoost.cmake:1106 (message): Unable to find
the requested Boost libraries.
Boost version: 1.54.0
Boost include path: C:/Program Files (x86)/boost_1_54_0
The following Boost libraries could not be found:
boost_serialization
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost. Call Stack (most recent call first): CMakeLists.txt:6
(find_package)
IRRLICHT_INCLUDE_DIR = IRRLICHT_INCLUDE_DIR-NOTFOUND IRRLICHT_LIBRARY =
IRRLICHT_LIBRARY-NOTFOUND Could NOT find IRRLICHT (missing:
IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR) CMake Warning (dev) at
CMakeLists.txt:16 (link_directories): This command specifies the relative
path
IRRLICHT_LIBRARY-NOTFOUND
as a link directory.
Policy CMP0015 is not set: link_directories() treats paths relative to the
source dir. Run "cmake --help-policy CMP0015" for policy details. Use the
cmake_policy command to set the policy and suppress this warning. This
warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:16 (link_directories): This command
specifies the relative path
as a link directory.
Policy CMP0015 is not set: link_directories() treats paths relative to the
source dir. Run "cmake --help-policy CMP0015" for policy details. Use the
cmake_policy command to set the policy and suppress this warning. This
warning is for project developers. Use -Wno-dev to suppress it.





Thank you a lots

Rails connects to MySQL from WEBrick but not from Passenger

Rails connects to MySQL from WEBrick but not from Passenger

I just created a new Rails 4 app with MySql as follows:
rails new mysqltest -d mysql
And modified the database.yml with the right credentials.
I generated a sample contoller and updated the routes for root route.
When I start using WEBrick in production,
rails s -e production
The site works. I see the index page.
When I start using Passenger without 3000 port, I see the following error:
database configuration does not specify adapter
(ActiveRecord::AdapterNotSpecified)
Passsenger is running in Production environment

Ensuring same Image format after creating a new Bitmap

Ensuring same Image format after creating a new Bitmap

I am currently working on some image re size task.
here are my method of resize,
private Bitmap ReSizeImageKeepingAspectRation(string imageFilePath, double
scale)
{
Bitmap resizedImage = null;
if (File.Exists(imageFilePath) && scale != 0)
{
Image originalImage = null;
FileStream imageStream = null;
try
{
imageStream = new FileStream(imageFilePath,
FileMode.Open);
originalImage = Image.FromStream(imageStream);
Size newImageSize = new Size((int)(originalImage.Width
* scale), (int)(originalImage.Height * scale));
resizedImage = new Bitmap(newImageSize.Width,
newImageSize.Height);
Graphics g = Graphics.FromImage(resizedImage);
g.DrawImage(originalImage, 0, 0, newImageSize.Width,
newImageSize.Height);
g.Dispose();
g = null;
}
catch (Exception ex)
{
}
finally
{
if (imageStream != null)
{
imageStream.Close();
imageStream.Dispose();
}
}
}
return resizedImage;
}
But you can see in this line
resizedImage = new Bitmap(newImageSize.Width, newImageSize.Height);
i unable to provide image format. that's why i am getting the inputted
image format is different from the newly created returned image format.
So my question is it possible to remain the same image format for returned
image as inputted image?

Change the process of an code dependent on an variable

Change the process of an code dependent on an variable

Im trying to change the process of an code dependent on an variable req
how you can see here:
@res = @conn.post do |request| if req == 'post'
@res = @conn.get do |request| if req == 'get'
The problem is that this seems to raise an error:
stack.rb:89: syntax error, unexpected end-of-input, expecting keyword_end
user2.send_csr
My question is, what do i have to change to avoid this problem? If you
need more information about my code:
def send(req,ww,text1=nil,text2=nil)
@conn = Faraday.new 'https://zombo.de/rest', :ssl => {:verify => false}
@conn.basic_auth(@username,@password)
@res = @conn.post do |request| if req == 'post'
@res = @conn.get do |request| if req == 'get'
request.url ww
request.headers['Content-Type'] = text1 unless text1 == nil
request.body = text2 unless text2 == nil
end
puts @res.body
end
def send_csr
send('post','csr','text/plain',"#{File.read(@csr[0..-5])}")
end
user2.send_csr

Thursday, 26 September 2013

Pointers and Arrays of Structs

Pointers and Arrays of Structs

I understand this is a commonly asked question but i've still yet managed
to find a solution.
I have create an array of a struct path called location path
location[numLevels*levelSize];
I am also using a stack of paths called start.
The problem is transferring the proper location in the array to a
function, having it create a new path to put in the array, than send it
back.
bool moveLocationStack(const vector <vector<path> > &spaceStation,const
int x,const int y,path *square){
char c=spaceStation.at(y).at(x).type;
if(c!='#'){
if(!spaceStation.at(y).at(x).visit and !spaceStation.at(y).at(x).inPath)
square->type=spaceStation.at(y).at(x).type;
square->type=spaceStation.at(y).at(x).visit;
square->type=spaceStation.at(y).at(x).inPath;
square->type=spaceStation.at(y).at(x).level;
return 1;
}
return 0;
}
The pointer square should point to the next location of the array sent to
it by the function call I try to be
if(moveLocationStack(spaceStation,possibleX,possibleY,location[currentLocation])){
}
It has an issue with sending the specific array section i want pointed to
indexed by a variable elsewhere in the code currentLocation. If I just
write location it works but I'm pretty sure it won't point to the next
available space in the array everytime its called even if i increment
currentLocations.
Any way to explain this so I can understand the error?

Wednesday, 25 September 2013

Why is there a key lookup even though I have non clustered index?

Why is there a key lookup even though I have non clustered index?

I am facing an issue where key lookup is shown in query plan even though I
have created indexes on IsGrantor and IsGrantee. Please see the attached
screenshot and output list.


The table roughly contains about 0.5 million records.
Any help would be appreciated.

Thursday, 19 September 2013

Twitter Bootstrap theme & iTunes app header

Twitter Bootstrap theme & iTunes app header

I am using twitter bootstrap for a one page site at
uniqueamb.biz/flyersaredead and the itunes smart app disappears on an ipad
or iphone after a second because twitter bootstrap automatically scrolls
down. How do I stop the automatic scroll to keep the app header in place?

How to declare two classes such that A has members of B and B marks members of A as friends?

How to declare two classes such that A has members of B and B marks
members of A as friends?

I am attempting to do exercise 7.32 from C++ Primer 5th Edition. That
exercise asks the following:
Define your own versions of Screen and Window_mgr in which clear is a
member of Window_mgr and a friend of Screen.
Here are the definitions for Screen, Window_mgr and clear given in the text.
class Screen
{
public:
using pos = std::string::size_type;
Screen(pos ht, pos wd, char c) : height(ht), width(wd), contents(ht *
wd, c) { }
private:
pos height = 0, width = 0;
std::string contents;
};
class Window_mgr
{
public:
using ScreenIndex = std::vector<Screen>::size_type;
void clear(ScreenIndex);
private:
std::vector<Screen> screens{Screen(24, 80 ' ')};
};
void Window_mgr::clear(ScreenIndex i)
{
Screen &s = screens[i];
s.contents = std::string(s.height * s.width, ' ');
}
Now those two classes, if defined Screen first than Window_mgr work as I
expect. Now, the exercise asks me to make clear a friend of Screen and
define clear. To make clear a member a friend, if I understand correctly,
Window_mgr must be defined. To define Window_mgr, Screen must be defined.
This seems impossible to me.
The text gives the following hints:
Making a member function a friend requires careful structuring of our
programs to accommodate interdependencies among the declarations and
definitions. In this example, we must order our program as follows:
First, define the Window_mgr class, which declares, but does not define,
clear. Screen must be declared before clear can use members of Screen.
Next, define class Screen, including a friend declaration for clear.
Finally, define clear, which can now refer to members in Screen.
The order in which I attempted to solve this exercise was ultimately this:
class Screen;
class Window_mgr
{
public:
using ScreenIndex = std::vector<Screen>::size_type;
void clear(ScreenIndex);
private:
std::vector<Screen> screens{Screen(24, 80 ' ')};
};
class Screen
{
friend Window_mgr::clear(Window_mgr::ScreenIndex);
public:
using pos = std::string::size_type;
Screen(pos ht, pos wd, char c) : height(ht), width(wd), contents(ht *
wd, c) { }
private:
pos height = 0, width = 0;
std::string contents;
};
void Window_mgr::clear(ScreenIndex i)
{
Screen &s = screens[i];
s.contents = std::string(s.height * s.width, ' ');
}
This obviously would not work, due to the vector in Window_mgr that needs
Screen to be a complete type. This seems like an unsolvable exercise,
unless the authors do not intend one to use Screen and Window_mgr classes
they present earlier.
Has anyone else solved this exercise from C++ Primer. If so, how? Any help
how this can be done, or as my gut tells me, cannot be done?

IMAP Email webclient in c#

IMAP Email webclient in c#

I am trying to create a simple web email client in C#/ASP.NET. I am trying
to use Aspose.Email DLL to connect the to the email server via IMAP and
show the emails to the user. Now I am thinking of storing the fetched
emails on the filesystem/database or simply fetching and showing these
emails on each request.
I think storing email body for all users might increase my database size,
but then users would want to page through the results. What is the best
strategy to handle emails once fetched via IMAP?

continue or cancel java

continue or cancel java

Ok, so I'm pretty new to programming and I'm making a very basic tax
program. I cannot use jQuery. I need to make a method that returns either
stop or continue from the user. Then I need:
while (answer equals continue){
code
code
code
call a method that returns either stop or continue from the user
}//end of while
I tried using JOptionPane in a method but I couldn't figure out how to use
that method in the 'while' portion.
Thank you for your help!

using vector::erase for the whole range

using vector::erase for the whole range

Is
v.erase(v.begin(), v.end());
Just as fast as
v.clear();
?
I don't care about little overheads such as extra function calls etc, the
compiler will inline that stuff.
The reason I ask is because I have code like the following:
v.erase(v.begin(), last_it);
last_it will usually be the end iterator, but not always. I know that
erasing a vector not from the end has a cost, because later elements in
the vector will need to be copied down. In the case where last_it is not
the end iterator (rare), I can live with that. But I don't want to
introduce such overhead when I basically want to clear the vector. So I
considered writing my code like this:
if (last_it == v.end())
{
v.clear();
}
else
{
v.erase(v.begin(), last_it);
}
I would like to know whether this is necessary to avoid a performance
penalty for erasing the whole vector. I would prefer to keep my code clear
and use a single-line statement if there is no penalty.

In Nitrous.io, how do you open a file in the IDE from the console?

In Nitrous.io, how do you open a file in the IDE from the console?

The Nitrous.io IDE appears to have 4 parts. There's a file browser, a text
editor, a console/terminal, and a chat window. It appears that the only
way to open a file in the text editor is from the file browser. This only
allows me to open files within my home directory. Is there any way to open
files in the text editor from the console?

Using grep to find string with brackets

Using grep to find string with brackets

I have some problems with the grep command. I have the following two files
in my folder:
test.dat:
fdf bla(fd_bla_bla) =& bdf bla
test2.dat
fd fd fij d bla(fdf)
fdjk bla
Now I search for the bla having brackets after it with grep 'bla(*)' *,
but it just gives me the entry of the first file...Do you have an idea
why?

Wednesday, 18 September 2013

Sharing object between nodejs instances (high i/o)

Sharing object between nodejs instances (high i/o)

Im building a nodejs/socket.io based game and Im trying to implement node
clustering to take advantage on multicore machines. I figured out that
memcache will be nice solution, but Im not completely sure if it'll
survive high load, because each game will do about 50 write/read per
second. Also what will be the best solution to broadcast message to all
clients while they're connected to different servers. For example player X
is connected to node 1, he do a simple action and how I can broqdcast the
action to player Y which is connected to node 2.

Broken images after download using php curl

Broken images after download using php curl

I have a class that allows me to download images using php curl. My class
looks like this:
function getImage($img, $path) {
$fullpath = basename($img);
$ch = curl_init($img);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
$rawData = curl_exec($ch);
curl_close($ch);
if(file_exists($fullpath)) {
unlink($fullpath);
}
$fp = fopen($path.$fullpath, "w+");
fwrite($fp, $rawData);
fclose($fp);
}
This works okay for most images but there are also instances in which I
get broken images instead. I've tried checking the path of the image from
the website and it's correct. My question is, why is this happening and
how can I prevent images being downloaded broken?

self.title not working iOS 7

self.title not working iOS 7

For some reason, when I used to just have
self.title = @"Title";
to get the title bar to show up... but now in iOS 7 it won't show anything.
I've been working on this for about 2 hours... and I can't even get the
title bar up and running.
I've also tried
self.navigationController.navigationBar.topItem.title = @"Title";
self.navigationItem.title = @"Title";
none of the above work.
Here is my code:
- (void)viewDidLoad
{
[super viewDidLoad];
self.title = @"Title";
self.navigationItem.title = @"Title";
self.navigationController.navigationBar.topItem.title = @"Title";
// Do any additional setup after loading the view.
}
I don't know what else to try, I just downloaded the latest version of iOS
7 and I used the tab template

How do i get the size of a multi-dimensional cv::Mat? (Mat, or MatND)

How do i get the size of a multi-dimensional cv::Mat? (Mat, or MatND)

I am creating a multi-dimensional MAT object, and would like to get the
size of the object - e.g.,
const int sz[] = {10,10,9};
Mat temp(3,sz,CV_64F);
std::cout << "temp.dims = " << temp.dims << " temp.size = " << temp.size()
<< " temp.channels = " << temp.channels() << std::endl;
I believe the resulting MAT to be 10x10x9, and I'd like to confirm, but
the COUT statement gives:
temp.dims = 3 temp.size = [10 x 10] temp.channels = 1
I was hoping to see either:
temp.dims = 3 temp.size = [10 x 10 x 9] temp.channels = 1
Or:
temp.dims = 3 temp.size = [10 x 10] temp.channels = 9
How can I get the dimensionality of this Mat object? I didn't see any
methods in Mat::Mat or MatND

PHP. Addition two string floats

PHP. Addition two string floats

I have such piece of code:
$a = '100.00'; //from db
$b = '1.01'; //from form
So,
echo $a+$b;
gives me 101 floatval and doubleval doesn't help.

spss IBM. Binary code

spss IBM. Binary code

I have a little operative problem with spss. I have a data set in with I
have 200 customers male and female. I will do a logistic study about this
customers but the problem is that I have to convert in Binary code Male
customer (1) and female customer (0), for logistic regression. How can I
do that? Thanks.

Include SSRS report image into SSIS send mail task

Include SSRS report image into SSIS send mail task

I have SSRS reports that are attainable from url.
I would like to include this report into SSIS's Send mail task body.
Actually I simply put the link of a report into mail's body and clicking
on it I can access to the report. But I would like to see that report
directly into email body like an image/snapshot of the report.
Is it possible? Thanks

radio button is not working

radio button is not working

<form method="POST"/>
FATHER<input type="radio" name="r" value="father">
MOTHER<input type="radio" name="r" value="mother ">
KID<input type="radio" name="r" value="kid ">
<input type="submit" name="submit" value="Submit">
</form>
<?php
if (isset($_POST['submit']) && $_POST['submit']=='Submit') {
if(!empty($_POST['r']) || !empty($_POST['r']))
{
$h=$_POST['r'];
}else {
$h='';
}
if($h =="father" )
{
echo "1";
} else if($h =="mother" ) {
echo "2";
} else if($h =="kid" ) {
echo "3";
}
}
I have 3 radio button id kid , father and mother , when the user clicked
on any of the radio button , i have assigned some value for father ,
mother and kid . When i clicked on the father , its showing me the result
but when i click on the mother and kid button , it showing me nothing .
Please can anybody help me .

Tuesday, 17 September 2013

Return name of the employ who having top salary with join

Return name of the employ who having top salary with join

here is situation . i have two tables , one is table Tbl_employ , second
is tbl_details .
Tbl_employ
id name
1 Ravi
2 ram
3 sham
4 john
Tbl_details
id salary emp_id
1 500 1
2 200 2
3 400 3
4 501 4
I wanna return the name of the employ who having top salary in tbl_detail .
What will be the join query for this condition . Please somebody give some
suggestion .I need it.
Thanks in advance ..

create new tables: how to uses examples/create_tables.sql

create new tables: how to uses examples/create_tables.sql

phpMyAdmin configuration storage
(phpMyAdmin/doc/html/setup.html#linked-tables) says
[..] and then create new tables by importing examples/create_tables.sql
This is not explicit. Where do I 'import' this file? Is it an SQL script I
have to execute? how? Where will these tables be created?

Difference between a function layer and an interface

Difference between a function layer and an interface

What's the difference between doing this:
class UserRepository extends DAO
{
public function GetAllUsers()
{
return $this->Select();
}
public function GetUserById( $id )
{
return $this->Select( $id );
}
}
class MockUserRepository extends MockDAO
{
public function GetAllUsers()
{
return $this->Select();
}
public function GetUserById( $id )
{
return $this->Select( $id );
}
}
class UserController
{
private $userRepository;
function __Construct( $repo )
{
$this->userRepository = $repo;
}
public function ListUsers()
{
$users = $this->userRepository->AnUndeclaredMethod();
// ...
}
}
$repo = new MockUserRepository();
$controller = new UserController( $repo );
and this:
interface IUserRepository
{
public function GetAllUsers();
public function GetUserById( $id );
}
class UserRepository extends DAO implements IUserRepository
{
public function GetAllUsers()
{
return $this->Select();
}
public function GetUserById( $id )
{
return $this->Select( $id );
}
}
class MockUserRepository extends MockDAO implements IUserRepository
{
public function GetAllUsers()
{
return $this->SelectUsers();
}
public function GetUserById( $id )
{
return $this->SelectUsers( $id );
}
}
class UserController
{
private $userRepository;
public function __Construct( IUserRepository $repo )
{
$this->userRepository = $repo;
}
public function ListUsers()
{
$users = $this->userRepository->AnUndeclaredMethod();
// ...
}
}
$repo = new MockUserRepository();
$controller = new UserController( $repo );
If a function was used in the controller that wasn't declared in one of
the repositories, it would throw an error anyway, why is it better to use
an interface for this type of task? What do I benefit from?

Elements become blurry in Flexslider

Elements become blurry in Flexslider

Using Flexslider, although this likely applies elsewhere, sometimes all
the elements become blurry/fuzzy. This includes text and borders. It's
when flexslider decides they need to be offset by .5 of a pixel, I assume.
Is there a way to prevent this effect taking place, or the sub-pixel
offset? I've tried all the text-rendering.
Also, going into Chrome Dev Tools and removing the .5 pixels doesn't seem
to fix it.
One fix appears to be disabling the CSS animations, but then they go
really laggy on mobile and don't really work properly (it doesn't stick to
your finger, it only updates after the swipe is finished).

MYSQL show only the last 8 rows

MYSQL show only the last 8 rows

On my index page i have the "latest work" which shows 8 portfolio pieces
and i need it to only grab the ones that have active = 1 as well and i
have something like this:
$sql = 'SELECT * FROM portfolio WHERE active = 1';
I tried doing this but its not working and i get errors when i try to pass
it in phpmyadmin as well.
$sql = 'SELECT * FROM portfolio
WHERE active = 1
WHERE [id] > SELECT
MAX([id]) - 8 FROM portfolio';
Any ideas?

Handlebars.js - Global Contexts

Handlebars.js - Global Contexts

Say I have a static list of users cached somewhere in my application like
App.Users. I'll probably have the need to list my users in several dozen
places in my application. Conventionally, I'll just need to pass my list
in with my context to the template.
var tmpl = Handlebars.templates['TemplateName'];
var html = tmpl({
model: model,
users: App.Users
});
But this approach requires some wiring in both the template and the
javascript. What I would like to do is specify this in the template alone
so I don't need to remember this in my scripts. Consider something like
this...
{{#each {{users}}}}
<li> ... </li>
{{/each}}
...Where users is a helper function that just returns my App.Users.
Wouldn't that be nice?
So that totally doesn't compile. What is another solution?

Sunday, 15 September 2013

IIS MVC c# Http header Connection

IIS MVC c# Http header Connection

Is there a way to edit the Http header "connectiom" in MVC. I tried to
"Add" or "AppendHeader" functions. THey all work but you can not edit the
connection header. I know that mvc provides certain standard http headers
to be modified by making some of the header values a public variable of
that request so you can edit such as StatusCode.
But is there a way to edit the Connection.

Don't execute setTimeout if condition changes

Don't execute setTimeout if condition changes

I have the following code, that changes the class of a div when you scroll
down. The problem is if you scroll very fast (or if I put links to a div
in my menu) the timeout function doesn't execute just the last condition
but all of them as a sequence. What I want to do is if the condition
changes while the function is within the timeout to skip the function and
check for the next condition.
$(document).scroll(function() {
var about = jQuery('#hh1').position().top;
var portfolio = jQuery('#hh2').position().top;
var services = jQuery('#hh3').position().top;
var workingprocess = jQuery('#hh4').position().top;
var clients = jQuery('#hh5').position().top;
var blog = jQuery('#hh6').position().top;
var contact = jQuery('#hh7').position().top;
var scroll = $(this).scrollTop();
if (scroll >= hh1-90 && scroll < hh3-90 || scroll >= hh5-90 && scroll <
hh6-90)
{setTimeout('$(".div").addClass("MyClass")',3440);}
else
{
setTimeout('$(".div").removeClass("MyClass")',3440);
}
});

Swing GUI freezes for unknown reason

Swing GUI freezes for unknown reason

I'm creating a java program that creates lineups for Grand Prix/Pinewood
Derby like races and then once scores are entered finds the finalists and
assigns them a lane/heat number.
So far everything in the program does exactly what I want it to do until I
reach the part where I'm trying to create the finalists. After I click the
button/press enter to enter in the final score, my GUI freezes. Here is
the code right before the freeze:
//allows user to enter the places for each car in each heat in each round
void enterScores() {
if(indexCount == 0 || (indexCount) % numLanes == 0) {
textArea.append("\nRound " + (roundCount + 1) + " Heat " +
(heatCount+1) + ": ");
}
userResponse.setText("");
prompt.setText(holderNameArray[roundCount][indexCount] + ": ");
textArea.append("\n" + holderNameArray[roundCount][indexCount] + ": ");
userResponse.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
holderScoreArray[roundCount][indexCount] =
Integer.parseInt(userResponse.getText());
textArea.append("" + holderScoreArray[roundCount][indexCount]);
indexCount++;
for(ActionListener act : enter.getActionListeners()) {
enter.removeActionListener(act);
}
for(ActionListener act : userResponse.getActionListeners()) {
userResponse.removeActionListener(act);
}
repeatEnterScores();
}
});
enter.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
holderScoreArray[roundCount][indexCount] =
Integer.parseInt(userResponse.getText());
textArea.append("" + holderScoreArray[roundCount][indexCount]);
indexCount++;
for(ActionListener act : enter.getActionListeners()) {
enter.removeActionListener(act);
}
for(ActionListener act : userResponse.getActionListeners()) {
userResponse.removeActionListener(act);
}
repeatEnterScores();
}
});
}
//helps repeat enterScores() due to anon class restrictions
//checks to change the number of heats/rounds
void repeatEnterScores() {
if((indexCount) % numLanes == 0 || indexCount == numCars) {
heatCount++;
}
if(indexCount == numCars) {
indexCount = 0;
heatCount = 0;
roundCount++;
}
if(roundCount < numRounds) {
enterScores();
} else {
textArea.setText("You may now click the Scores tab to see the
scores you have just entered.");
scoresPanelSetup();
}
}
It used to not freeze and continue, but would freeze in a later place
instead. I'm a beginner so I'm not sure why it's freezing here now. If you
need any more code/information, please let me know. Whenever I debug it
steps through all of my code fine, it's just the gui having problems.
Thanks!

page refresh using mechanize, python

page refresh using mechanize, python

I want to track a page using mechanize. I am new to python and mechanize,
here are the steps that I am doing. Setup the browser using mechanize
(done only once in the start of the program)
br = mechanize.Browser()
br.set_handle_refresh(mechanize._http.HTTPRefreshProcessor(), max_time=1)
br.addheaders = [('User-agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US;
rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1')]
Refresh the page after every 3 seconds. I am doing this by br.open(url) in
a loop with sleep of 3 seconds. Each time I open the url I parse it for
some information using BeautifulSoup.
The program works fine, but the issue is that when it is executing
br.open(url) on the 12th iteration of the loop. It gives this error:
File "filename.py", line 20, in subroutine_name br.open(url) File
"/Library/Python/2.7/site-packages/mechanize/_mechanize.py", line 203, in
open return self._mech_open(url, data, timeout=timeout) File
"/Library/Python/2.7/site-packages/mechanize/_mechanize.py", line 255, in
_mech_open raise response mechanize._response.httperror_seek_wrapper: HTTP
Error 403: Forbidden
I am not sure what the issue is, is there a better way to refresh a page
rather than opening it again and again in a loop, or should I initialize
the browser each time during the loop ?
Thanks for the help !

New level wen finished

New level wen finished

I've made this little code:
if (levelnum > 3) {
levelnum = 0;
}
[[NSUserDefaults standardUserDefaults] setInteger:levelnum
forKey:@"LevelNum"];
NSLog(@"Levelnum is now %i",levelnum);
//3 load the level, fire up the game
self.controller.level = [Level levelWithNum:levelnum];
[self.controller dealRandomAnagram];
This code is loading up an level linked to an integer. If the integer is
5, it loads up level 5. I don't want that users can skip an level by
closing the app and open it up again. So, how can i make the integer
"LeveNum" one bigger when the level is finished? I am saving and loading
this integer.
I can simple add levelnum=levelnum +1; But than the level is not correct
saved. Thanks for all your help!

Bootstrap thumbnail grid not starting a new row correctly

Bootstrap thumbnail grid not starting a new row correctly

I have a grid of thumbnails oin my rails app but I am having trouble
getting bootstrap to display the grid correctly! As you can see below
however it is not starting a new row correctly! not sure what to do here.
I've included my HTML below and as far as I can see it conforms with the
bootstrap examples.
<div id="image-grid" class="col-lg-10">
<div class="row">
<div class="col-sm-6 col-md-2">
<a class="thumbnail text-center" href="/images/1">
<img alt="Img 0259"
src="/system/images/images/000/000/001/thumb/IMG_0259.JPG?1369368826">
2013-05-24
</a> </div>
<div class="col-sm-6 col-md-2">
<a class="thumbnail text-center" href="/images/3">
<img alt="Img 0034"
src="/system/images/images/000/000/003/thumb/IMG_0034.JPG?1369649370">
2013-05-27
</a> </div>
<div class="col-sm-6 col-md-2">
<a class="thumbnail text-center" href="/images/2">
<img alt="Img 0008"
src="/system/images/images/000/000/002/thumb/IMG_0008.jpg?1369649198">
2013-05-27
</a> </div>
<div class="col-sm-6 col-md-2">
<a class="thumbnail text-center" href="/images/4">
<img alt="Rsz 1971061 10153145204760484 336557482 n"
src="/system/images/images/000/000/004/thumb/rsz_1971061_10153145204760484_336557482_n.jpg?1377656209">
2013-08-28
</a> </div>
<div class="col-sm-6 col-md-2">
<a class="thumbnail text-center" href="/images/5">
<img alt="Digital radiograph1"
src="/system/images/images/000/000/005/thumb/digital_radiograph1.jpg?1377659810">
2013-08-28
</a> </div>
<div class="col-sm-6 col-md-2">
<a class="thumbnail text-center" href="/images/6">
<img alt="Pamo"
src="/system/images/images/000/000/006/thumb/pamo.jpg?1377659876">
2013-08-28
</a> </div>
<div class="col-sm-6 col-md-2">
<a class="thumbnail text-center" href="/images/7">
<img alt="Tooth x ray 1"
src="/system/images/images/000/000/007/thumb/tooth-x-ray_1.jpg?1377659952">
2013-08-28
</a> </div>
<div class="col-sm-6 col-md-2">
<a class="thumbnail text-center" href="/images/8">
<img alt="Fig9b"
src="/system/images/images/000/000/008/thumb/fig9b.jpg?1377664192">
2013-08-28
</a></div>
<div class="col-sm-6 col-md-2">
<span class="glyphicon glyphicon-plus">
<a href="/images/new">Upload New Image</a>
</span>
</div>
</div>
</div>

Stored procerdure returns null as output parameter

Stored procerdure returns null as output parameter

I have stored procedure, which works great in MS SQL management studio.
When I try to use it in VS rows returns fine, but value of output
parameters is NULL.
SqlCommand cmd = new SqlCommand("proc_name", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter("@p_SomeVal", SqlDbType.Int));
cmd.Parameters["@p_SomeVal"].Direction = ParameterDirection.Output;
rdr = cmd.ExecuteReader();
//...process rows...
if (cmd.Parameters["@p_SomeVal"].Value != null)
SomeVal = (int)cmd.Parameters["@p_SomeVal"].Value;

Saturday, 14 September 2013

I need a specific HTML5 text editor.

I need a specific HTML5 text editor.

I have read all the posts I can find and have not yet found what I want
and need. I need to build a page that has multiple divs on it. When I
click on a div, an editor needs to pop up around it. I have seen several
that do this (snap editor, aloha, etc) but none I have found support the
following:
Must NOT require text area. Div is better since I have to be able to drag
them around the screen.
Color (more than basic 16)
Google loaded fonts
Must be dynamically attachable to any element on the page (using jquery)
Does anyone know of such a beast?

htaccess 301 redirect blog/username to user/username

htaccess 301 redirect blog/username to user/username

I know this must have been answered on here before so I apologize in
advance, but despite my numerous searches - I couldn't find a suitable
answer.
I have an url, for instance: www.domain.com/blog/username which I'd like
to redirect to www.domain.com/users/username
I've tried: Rewriterule ^blog/(.+)$ ./users/$1
But it's not quite right and results in a 404.
I also want www.domain.com/blog to redirect to www.domain.com/users

MvcContrib Grid shows error on sorting Northwind Order table

MvcContrib Grid shows error on sorting Northwind Order table

I am learning MVC 3, MvcContrib grid and when tried to create a view using
grid with sort and paging options, I got error. "Could not find a property
called 'Customer.CompanyName' on type MvcApplication5.Models.Order" on
this line
orders = orders.OrderBy(sort.Column, sort.Direction);
Please let me know whats wrong as the code for Customer table is working
correctly may be its just one table and Order table query includes 3
tables?
Controller code is below
public ActionResult Index(GridSortOptions sort, int? page)
{
IEnumerable<Order> orders = db.Orders.Include(o =>
o.Customer).Include(o => o.Employee).Include(o => o.Shipper);
if (sort.Column != null)
{
orders = orders.OrderBy(sort.Column, sort.Direction);
}
//orders = orders.AsPagination(page ?? 1, 25);
ViewData["sort"] = sort;
return View(orders);
}
View Code is here
@model IEnumerable<MvcApplication5.Models.Order>
@using MvcContrib.UI.Grid;
@using MvcContrib.UI.Pager;
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
<p>
@Html.ActionLink("Create New", "Create")
</p>
@Html.Grid(Model).Sort((GridSortOptions)ViewData["sort"]).Columns(col => {
col.For(o =>
o.Customer.CompanyName).Named("Customer").Sortable(true).SortColumnName("Customer.CompanyName");
col.For(o => o.Employee.LastName).Named("Employee");
col.For(o => o.OrderDate).Named("Order Date");
col.For(o => o.RequiredDate).Named("Required Date");
col.For(o => o.ShippedDate).Named("Shipped Date");
col.For(o => o.Shipper.CompanyName).Named("Shipper");
col.For(o => o.Freight).Named("Frieght");
col.For(o => o.ShipName).Named("Ship Name");
col.For(o => o.ShipAddress).Named("Ship Address");
col.For(o => o.ShipCountry).Named("Ship Country");
col.For(o => @Html.ActionLink("Edit", "Edit", new { id = o.OrderID }));
col.For(o => @Html.ActionLink("Details", "Details", new { id =
o.OrderID }));
col.For(o => @Html.ActionLink("Delete", "Delete", new { id = o.OrderID
}));
})

Ubuntu Boots, But Stays In Shell

Ubuntu Boots, But Stays In Shell

I have a Dell Optiplex 160L and I'm booting Ubuntu 13.04 from a
LinuxLiveKey USB. It loads all the way through the purple Ubuntu loading
screen then goes back to shell. then it gets stuck on
ubuntu@ubuntu:~$
Also could it be a problem that I'm using a 1 GB USB? Is there a reason
why it doesn't boot? Or is my hardware to crappy for it?

set on less than error - MIPS

set on less than error - MIPS

Ok, So I'm familiar with x86 Microsoft assembly but am super new to MIPS
assembly, I've chose MARS assembler but things aren't going really good..
main:
li $s0, 0
li $s1, 0
li $s5, 100
Loop: slti $t0, $S0, 100
beq $S3, $zero, Fin
add $s1, $S1, $s0
addi $S0, $s0, 1
j Loop
There's no single line without errors.. but I really can't figure why..
The code is right or that is what I believe..
Error in /home/****/Desktop/Ex.asm line 9 column 18: "$S0": operand is of
incorrect type
Error in /home/****/Desktop/Ex.asm line 10 column 12: "$S3": operand is of
incorrect type
Error in /home/****/Desktop/Ex.asm line 11 column 17: "$S1": operand is of
incorrect type
Error in /home/****/Desktop/Ex.asm line 12 column 12: "$S0": operand is of
incorrect type
I tested this on another Windows machine.. and it worked.. :? using Debian
here

Execute only one Talend Component

Execute only one Talend Component

In Talend Open Studio, how do I execute only one of my components? If I
click Run, all active components will run. So far the only way I know to
execute a single component is to deactivate all others in the Job.
How can I execute one component or subjob without having to deactivate all
the other components in the job?

Replace ColdFusion code in a jQuery Mobile project

Replace ColdFusion code in a jQuery Mobile project

I am working on a cross platform mobile app using jQuery Mobile and Aptana
Studio IDE. As I am newbie on this field I checked this very helpful
tutorial and my question is with what should I replace ColdFusion code? I
want to keep the same structure and functionality but I don't use
ColdFusion. Is there any alternative?

Friday, 13 September 2013

How to transfer code from old version of xcode to the newest verision?

How to transfer code from old version of xcode to the newest verision?

I have an xcode project for an app i made a while ago but its on xcode 4,
how can i easily transfer the project to the newer version of xcode?
I have tried manually transferring each file of the project to the new
version but was not very successful with that.
Is there an easier/more automated way of doing this?

format '%s' expects argument of type 'char *', but argument 2 has type 'char **'

format '%s' expects argument of type 'char *', but argument 2 has type
'char **'

I have this C code:
#include <stdio.h>
#include <stdlib.h>
int main(){
char *bitstr;
printf("Enter a bitstring or q for quit: ");
scanf("%s", &bitstr);
return 0;
}
I keep receive the following error. What am I doing wrong?
warning: format '%s' expects argument of type 'char *', but
argument 2 has type 'char **' [-Wformat]

Now I have been stuck by an error which shows the following error in the internet explorer

Now I have been stuck by an error which shows the following error in the
internet explorer

type Exception reportmessage description The server encountered an
internal error () that prevented it from fulfilling this request.exception
java.lang.NumberFormatException: null java.lang.Integer.parseInt(Unknown
Source) java.lang.Integer.parseInt(Unknown
Source)AgeCheck.doGet(AgeCheck.java:16)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722) note The full
stack trace of the root cause is available in the Apache Tomcat/7.0.14
logs. enter code here public class AgeCheck extends HttpServlet{public
void doGet(HttpServletRequest req,HttpServletResponse res)throws
ServletException,IOException{res.setContentType("text/html");PrintWriter
out=res.getWriter();int
age;age=Integer.parseInt(req.getParameter("age"));out.print("
Welcome To Age Check Page
");RequestDispatcher rd; if(age>=20){rd
=eq.getRequestDispatcher("Major");rd.include(req,res); }else{rd =
req.getRequestDispatcher("Minor");rd.forward(req,res);}out.print("
Re-Welcome ToSame Class
");}}

getting 2 item instead of 1 mysql database

getting 2 item instead of 1 mysql database

i have problem i am using below script for merge tables and get data from
mysql
$myboxexi=mysql_query('select
box.id,box.page_name,box.title,box.connect,box.type,box.uid,box.description,box.image,box.url,box.status,box.date,box.time
from boxes as box left join page_boxes as pages on box.uid=pages.uid and
pages.uid="'.$session_id.'"');
while($my_boxi=mysql_fetch_array($myboxexi)){
//data here.
}
its working fine but problem is i am getting double item like if i have 1
item then i get 2 item how can i solve this issue ?

PHP obect that contains an array of objects JavaScript JSON

PHP obect that contains an array of objects JavaScript JSON

I have a question regarding JSON and encoding objects. The below Catalog
object contains an array of objects amongst other things. Once the object
is constructed on the server side using an AJAX request, I would like to
pass the object back to JavaScript as a response, so I can further use it.
The following approach results in a ReferenceError: catalog is not defined
error. The object is successfully created on the server side, so I suppose
something went wrong with the way I am using json_encode. I appreciate any
suggestions.
Thnaks in advance!
JavaScript
$.ajax({
url: "invoice-get-data.php?loadCatalog=1",
dataType: "json",
success: function(catalog){
alert(catalog.item[2].name);
}
});
AJAX / PHP
$catalog = new Catalog();
json_encode((object) $catalog);
Catalog Object Structure
public $item = Array();
public $itemCount;
//mySQL connection...
//populate catalog
foreach($results as $row){
$this->item[] = new Item($row['id'], $row['prod_name'], $row['price'],
$row['img_path']);
}
Item Object Structure

When I try to install any gem I get this error

When I try to install any gem I get this error

My Ruby Version is 1.9.2 and Rails version is 3.2.13. My OS is Windows XP
I am using pik for managing multiple ruby versions.
When I tried to install curb it gives me the following error.
ERROR: While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
I already tried to install gem by using the following command
gem install curb --platform=ruby -- --with-curl-lib="C:/curl/bin"
--with-curl-include="C:/curl/include"
Still I am not getting any success.

Thursday, 12 September 2013

button action crashes the application

button action crashes the application

Hi i created a button like "Save Notes" on the main menu .... But now when
i launch the application and click on it my complete application crashes .
Rest buttons are woking fine on the main menu .
MainMenu class



public class NUGA_MainMenuActivity extends Activity {
SoundPool mpool;
int mlogon;
Button mBtn1;
Button mBtn2;
Button mBtn3;
Button mBtn4;
Button mBtn5;
Button mHistoryButton;
Animation anim = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.mainmenu);
mHistoryButton=(Button) findViewById(R.id.takeashot);
mBtn1 = (Button) findViewById(R.id.BtnDisplay);
mBtn2 = (Button) findViewById(R.id.BtnSlave);
mHistoryButton.setOnClickListener(mClickListener);
mBtn3=(Button) findViewById(R.id.takehelp);
mBtn4=(Button) findViewById(R.id.aboutus);
mBtn5=(Button) findViewById(R.id.savenotes);
mBtn1.setOnClickListener(mClickListener);
mBtn2.setOnClickListener(mClickListener);
mBtn3.setOnClickListener(mClickListener);
mBtn4.setOnClickListener(mClickListener);
mBtn5.setOnClickListener(mClickListener);
mpool = new SoundPool(1, AudioManager.STREAM_MUSIC, 0);
mlogon = mpool.load(this, R.raw.logon, 1);
anim = new AlphaAnimation(0, 1);
anim.setDuration(1500);
mBtn1.startAnimation(anim);
mBtn2.startAnimation(anim);
mBtn3.startAnimation(anim);
mBtn4.startAnimation(anim);
mBtn5.startAnimation(anim);
mpool.play(mlogon, 1, 1, 0, 0, 1);
}
Button.OnClickListener mClickListener = new View.OnClickListener() {
Animation anim = null;
@Override
public void onClick(View v) {
Vibrator vibe = (Vibrator)
getSystemService(Context.VIBRATOR_SERVICE);
vibe.vibrate(60);
switch (v.getId()) {
case R.id.BtnDisplay:
mpool.play(mlogon, 1, 1, 0, 0, 1);
anim = new ScaleAnimation(0, 1, 0, 1,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
anim.setDuration(100);
mBtn1.startAnimation(anim);
Intent intent = new Intent(NUGA_MainMenuActivity.this,
FileSiganlDisplay.class);
startActivity(intent);
//overridePendingTransition(R.anim.zoom_enter,R.anim.zoom_exit);
overridePendingTransition(R.anim.fade, R.anim.hold);
break;
case R.id.BtnSlave:
mpool.play(mlogon, 1, 1, 0, 0, 1);
anim = new ScaleAnimation(0, 1, 0, 1,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
anim.setDuration(100);
mBtn2.startAnimation(anim);
Intent intent1 = new Intent(NUGA_MainMenuActivity.this,
BTSmartSlavemodule.class);
startActivity(intent1);
//overridePendingTransition(R.anim.zoom_enter,
R.anim.zoom_exit);
overridePendingTransition(R.anim.fade, R.anim.hold);
break ;
case R.id.takeashot:
//snapFunction();
Intent intent2=new
Intent(NUGA_MainMenuActivity.this,ImagesActivity.class);
startActivity(intent2);
break;
case R.id.takehelp :
mpool.play(mlogon, 1, 1, 0, 0, 1);
anim = new ScaleAnimation(0, 1, 0, 1,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
anim.setDuration(100);
mBtn3.startAnimation(anim);
Intent intent3=new
Intent(NUGA_MainMenuActivity.this,HelpActivity.class);
startActivity(intent3);
overridePendingTransition(R.anim.fade, R.anim.hold);
break;
case R.id.aboutus:
mpool.play(mlogon, 1, 1, 0, 0, 1);
anim = new ScaleAnimation(0, 1, 0, 1,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
anim.setDuration(100);
mBtn4.startAnimation(anim);
Intent intent4=new
Intent(NUGA_MainMenuActivity.this,AboutDevice.class);
startActivity(intent4);
overridePendingTransition(R.anim.fade, R.anim.hold);
break;
case R.id.savenotes:
mpool.play(mlogon, 1, 1, 0, 0, 1);
anim = new ScaleAnimation(0, 1, 0, 1,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
anim.setDuration(100);
mBtn4.startAnimation(anim);
Intent intent5=new
Intent(NUGA_MainMenuActivity.this,NotesList.class);
startActivity(intent5);
overridePendingTransition(R.anim.fade, R.anim.hold);
break;
default:
break;
}
}
};
public void snapFunction()
{
Date currentTime = new Date();
final SimpleDateFormat sdf =
new SimpleDateFormat("yyyy-MM-dd-HH.mm.ss");
// Give it to me in GMT time.
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
//System.out.println("GMT time: " + sdf.format(currentTime));
String ss=sdf.format(currentTime);
Log.v("current time", ss);
View mContent=findViewById(R.id.screenLayout);
mContent.setDrawingCacheEnabled(true);
Bitmap bitmap = mContent.getDrawingCache();
File sdCardDirectory =
Environment.getExternalStorageDirectory();
File image = new File(sdCardDirectory, ss+".jpg");
name=ss;
// File file = new
File("/sdcard/"+String.valueOf(currentId)+".png");
{
if(!image.exists())
{
try {
image.createNewFile();
FileOutputStream ostream = new
FileOutputStream(image);
bitmap.compress(CompressFormat.PNG, 10, ostream);
ostream.close();
mContent.invalidate();
DB.insert(ss);
Cursor cursor=DB.retrieveFav();
if(cursor!=null)
if(cursor.moveToFirst())
new
Toast(NUGA_MainMenuActivity.this).makeText(NUGA_MainMenuActivity.this,
"DB
contains:"+cursor.getCount()+"images",
Toast.LENGTH_LONG).show();
cursor.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
static String name="";
}



AndroidManifest file



<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="hellog.diwesh.NugaBest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="11" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:name="helog.diwesh.NugaBest.MyApplication"
android:debuggable="true"
android:icon="@drawable/nuga"
android:label="@string/app_name" >
<activity
android:name="helog.diwesh.NugaBest.NUGA_HealthCareActivity_Intro"
android:configChanges="orientation|keyboardHidden"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
// 4. Layout Management
<activity
android:name="helog.diwesh.NugaBest.FileSiganlDisplay"
android:label="FileSiganlDisplay" />
<activity
android:name="helog.diwesh.NugaBest.NUGA_WebJoinActivity"
android:label="NUGA_WebJoinActivity"
android:windowSoftInputMode="stateHidden" />
<activity
android:name="helog.diwesh.NugaBest.NUGA_MainMenuActivity"
android:label="NUGA_MainMenuActivity" />
<activity
android:name="helog.diwesh.NugaBest.BTSmartSlavemodule"
android:configChanges="orientation|keyboardHidden"
android:label="SmartSlavemodule" />
<activity
android:name="helog.diwesh.NugaBest.BTDeviceListActivity"
android:configChanges="orientation|keyboardHidden"
android:label="@string/select_device"
android:theme="@android:style/Theme.Dialog" />
<activity
android:name="helog.diwesh.NugaBest.SnapActivity"
android:label="@string/title_activity_snap" >
</activity>
<activity
android:name="helog.diwesh.NugaBest.ImagesActivity"
android:label="@string/title_activity_images" >
</activity>
<activity
android:name="helog.diwesh.NugaBest.HelpActivity"
android:label="@string/Help" >
</activity>
<activity
android:name="helog.diwesh.NugaBest.AboutDevice"
android:label="@string/aboutus" >
</activity>
// Notepad Application
<provider android:name="NotePadProvider"
android:authorities="com.google.provider.NotePad"
android:exported="false">
<grant-uri-permission android:pathPattern=".*" />
</provider>
<activity android:name="NotesList"
android:label="@string/title_notes_list">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />
<action android:name="android.intent.action.PICK" />
<data
android:mimeType="vnd.android.cursor.dir/vnd.google.note"
/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:mimeType="vnd.android.cursor.item/vnd.google.note"
/>
</intent-filter>
</activity>
<activity android:name="NoteEditor"
android:theme="@android:style/Theme.Holo.Light"
android:screenOrientation="sensor"
android:configChanges="keyboardHidden|orientation"
>
<!-- This filter says that we can view or edit the data of
a single note -->
<intent-filter android:label="@string/resolve_edit">
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />
<action
android:name="helog.diwesh.NugaBest.action.EDIT_NOTE" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:mimeType="vnd.android.cursor.item/vnd.google.note"
/>
</intent-filter>
<!-- This filter says that we can create a new note inside
of a directory of notes. The INSERT action creates an
empty note; the PASTE action initializes a new note from
the current contents of the clipboard. -->
<intent-filter>
<action android:name="android.intent.action.INSERT" />
<action android:name="android.intent.action.PASTE" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:mimeType="vnd.android.cursor.dir/vnd.google.note"
/>
</intent-filter>
</activity>
<activity android:name="TitleEditor"
android:label="@string/title_edit_title"
android:icon="@drawable/ic_menu_edit"
android:theme="@android:style/Theme.Holo.Dialog"
android:windowSoftInputMode="stateVisible">
<!-- This activity implements an alternative action that can be
performed on notes: editing their title. It can be used as
a default operation if the user invokes this action, and is
available as an alternative action for any note data. -->
<intent-filter android:label="@string/resolve_title">
<!-- This is the action we perform. It is a custom action we
define for our application, not a generic VIEW or EDIT
action since we are not a general note viewer/editor.
-->
<action
android:name="helog.diwesh.NugaBest.action.EDIT_TITLE" />
<!-- DEFAULT: execute if being directly invoked. -->
<category android:name="android.intent.category.DEFAULT" />
<!-- ALTERNATIVE: show as an alternative action when the
user is
working with this type of data. -->
<category
android:name="android.intent.category.ALTERNATIVE" />
<!-- SELECTED_ALTERNATIVE: show as an alternative action
the user
can perform when selecting this type of data. -->
<category
android:name="android.intent.category.SELECTED_ALTERNATIVE"
/>
<!-- This is the data type we operate on. -->
<data
android:mimeType="vnd.android.cursor.item/vnd.google.note"
/>
</intent-filter>
</activity>
<activity android:name="NotesLiveFolder"
android:label="@string/live_folder_name"
android:icon="@drawable/live_folder_notes">
<intent-filter>
<action
android:name="android.intent.action.CREATE_LIVE_FOLDER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>



LogCat Error
[2013-09-13 11:10:59 - NotesList] ------------------------------
[2013-09-13 11:10:59 - NotesList] Android Launch!
[2013-09-13 11:10:59 - NotesList] adb is running normally.
[2013-09-13 11:10:59 - NotesList] Performing
com.example.android.notepad.NotesList activity launch
[2013-09-13 11:10:59 - NotesList] Failed to find an AVD compatible with
target 'Google APIs'.
[2013-09-13 11:11:01 - NotesList] Still no compatible AVDs with target
'Google APIs': Aborting launch.
[2013-09-13 11:11:01 - NotesList] Performing
com.example.android.notepad.NotesList activity launch
[2013-09-13 11:11:02 - NotesList] Launching a new emulator with Virtual
Device 'Testing'
[2013-09-13 11:11:05 - Emulator] emulator: warning: opening audio output
failed
[2013-09-13 11:11:05 - Emulator]
[2013-09-13 11:11:05 - NotesList] New emulator found: emulator-5554
[2013-09-13 11:11:05 - NotesList] Waiting for HOME
('android.process.acore') to be launched...
[2013-09-13 11:12:00 - NotesList] HOME is up on device 'emulator-5554'
[2013-09-13 11:12:00 - NotesList] Uploading NotesList.apk onto device
'emulator-5554'
[2013-09-13 11:12:00 - NotesList] Installing NotesList.apk...
[2013-09-13 11:12:31 - NotesList] Success!
[2013-09-13 11:12:31 - NotesList] Starting activity
com.example.android.notepad.NotesList on device emulator-5554
[2013-09-13 11:12:32 - NotesList] ActivityManager: Starting: Intent {
act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER]
cmp=com.example.android.notepad/.NotesList }
[2013-09-13 11:44:51 - NotesList] ------------------------------
[2013-09-13 11:44:51 - NotesList] Android Launch!
[2013-09-13 11:44:51 - NotesList] adb is running normally.
[2013-09-13 11:44:51 - NotesList] Performing
com.example.android.notepad.NotesList activity launch
[2013-09-13 11:44:51 - NotesList] Failed to find an AVD compatible with
target 'Google APIs'.
[2013-09-13 11:44:52 - NotesList] Still no compatible AVDs with target
'Google APIs': Aborting launch.
[2013-09-13 11:44:52 - NotesList] Performing
com.example.android.notepad.NotesList activity launch
[2013-09-13 11:44:56 - NotesList] Launching a new emulator with Virtual
Device 'Testing'
[2013-09-13 11:44:56 - Emulator] emulator: warning: opening audio output
failed
[2013-09-13 11:44:56 - Emulator]
[2013-09-13 11:44:56 - NotesList] New emulator found: emulator-5554
[2013-09-13 11:44:56 - NotesList] Waiting for HOME
('android.process.acore') to be launched...
[2013-09-13 11:45:29 - NotesList] HOME is up on device 'emulator-5554'
[2013-09-13 11:45:29 - NotesList] Uploading NotesList.apk onto device
'emulator-5554'
[2013-09-13 11:45:29 - NotesList] Installing NotesList.apk...
[2013-09-13 11:45:57 - NotesList] Success!
[2013-09-13 11:45:57 - NotesList] Starting activity
com.example.android.notepad.NotesList on device emulator-5554
[2013-09-13 11:45:59 - NotesList] ActivityManager: Starting: Intent {
act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER]
cmp=com.example.android.notepad/.NotesList }
[2013-09-13 11:56:44 - NotesList] ------------------------------
[2013-09-13 11:56:44 - NotesList] Android Launch!
[2013-09-13 11:56:44 - NotesList] adb is running normally.
[2013-09-13 11:56:44 - NotesList] Performing
com.example.android.notepad.NotesList activity launch
[2013-09-13 11:56:44 - NotesList] Failed to find an AVD compatible with
target 'Google APIs'.
[2013-09-13 11:56:45 - NotesList] Still no compatible AVDs with target
'Google APIs': Aborting launch.
[2013-09-13 11:56:45 - NotesList] Performing
com.example.android.notepad.NotesList activity launch
[2013-09-13 11:56:47 - NotesList] Launching a new emulator with Virtual
Device 'Testing'
[2013-09-13 11:56:48 - Emulator] emulator: warning: opening audio output
failed
[2013-09-13 11:56:48 - Emulator]
[2013-09-13 11:56:48 - NotesList] New emulator found: emulator-5554
[2013-09-13 11:56:48 - NotesList] Waiting for HOME
('android.process.acore') to be launched...
[2013-09-13 11:57:20 - NotesList] HOME is up on device 'emulator-5554'
[2013-09-13 11:57:20 - NotesList] Uploading NotesList.apk onto device
'emulator-5554'
[2013-09-13 11:57:20 - NotesList] Installing NotesList.apk...
[2013-09-13 11:57:50 - NotesList] Success!
[2013-09-13 11:57:50 - NotesList] Starting activity
com.example.android.notepad.NotesList on device emulator-5554
[2013-09-13 11:57:51 - NotesList] ActivityManager: Starting: Intent {
act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER]
cmp=com.example.android.notepad/.NotesList }
[2013-09-13 13:47:46 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
W/ResourceType( 9556): ResXMLTree_node header size 0 is too small.
[2013-09-13 13:47:46 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
W/ResourceType( 9556): Bad XML block: node attributes use 0x7814 bytes,
only have 0x14 bytes
[2013-09-13 13:47:46 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
D:\Latest try\Nuga Hellog Final\Nuga Hellog
Final\res\menu\editor_options_menu.xml:3: error: Error: No resource found
that matches the given name (at 'icon' with value
'@drawable/ic_menu_save').
[2013-09-13 13:47:46 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
D:\Latest try\Nuga Hellog Final\Nuga Hellog
Final\res\menu\editor_options_menu.xml:8: error: Error: No resource found
that matches the given name (at 'icon' with value
'@drawable/ic_menu_revert').
[2013-09-13 13:47:46 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
D:\Latest try\Nuga Hellog Final\Nuga Hellog
Final\res\menu\editor_options_menu.xml:11: error: Error: No resource found
that matches the given name (at 'icon' with value
'@drawable/ic_menu_delete').
[2013-09-13 13:47:46 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
D:\Latest try\Nuga Hellog Final\Nuga Hellog
Final\res\menu\list_options_menu.xml:4: error: Error: No resource found
that matches the given name (at 'icon' with value
'@drawable/ic_menu_compose').
[2013-09-13 13:47:46 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
D:\Latest try\Nuga Hellog Final\Nuga Hellog
Final\res\menu\list_options_menu.xml:11: error: Error: No resource found
that matches the given name (at 'icon' with value
'@drawable/ic_menu_compose').
[2013-09-13 13:50:39 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
W/ResourceType( 9284): ResXMLTree_node header size 0 is too small.
[2013-09-13 13:50:39 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
W/ResourceType( 9284): Bad XML block: node attributes use 0x7814 bytes,
only have 0x14 bytes
[2013-09-13 13:50:39 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
D:\Latest try\Nuga Hellog Final\Nuga Hellog
Final\res\menu\editor_options_menu.xml:3: error: Error: No resource found
that matches the given name (at 'icon' with value
'@drawable/ic_menu_save').
[2013-09-13 13:50:39 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
D:\Latest try\Nuga Hellog Final\Nuga Hellog
Final\res\menu\editor_options_menu.xml:8: error: Error: No resource found
that matches the given name (at 'icon' with value
'@drawable/ic_menu_revert').
[2013-09-13 13:50:39 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
D:\Latest try\Nuga Hellog Final\Nuga Hellog
Final\res\menu\editor_options_menu.xml:11: error: Error: No resource found
that matches the given name (at 'icon' with value
'@drawable/ic_menu_delete').
[2013-09-13 13:50:39 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
D:\Latest try\Nuga Hellog Final\Nuga Hellog
Final\res\menu\list_options_menu.xml:4: error: Error: No resource found
that matches the given name (at 'icon' with value
'@drawable/ic_menu_compose').
[2013-09-13 13:50:39 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
D:\Latest try\Nuga Hellog Final\Nuga Hellog
Final\res\menu\list_options_menu.xml:11: error: Error: No resource found
that matches the given name (at 'icon' with value
'@drawable/ic_menu_compose').
[2013-09-13 14:16:33 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
------------------------------
[2013-09-13 14:16:33 - NUGA_HealthCare_bluetooth_ver4_PID_verICS] Android
Launch!
[2013-09-13 14:16:33 - NUGA_HealthCare_bluetooth_ver4_PID_verICS] adb is
running normally.
[2013-09-13 14:16:33 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
Performing helog.diwesh.NugaBest.NUGA_HealthCareActivity_Intro activity
launch
[2013-09-13 14:16:33 - NUGA_HealthCare_bluetooth_ver4_PID_verICS] Failed
to find an AVD compatible with target 'Google APIs'.
[2013-09-13 14:16:34 - NUGA_HealthCare_bluetooth_ver4_PID_verICS] Still no
compatible AVDs with target 'Google APIs': Aborting launch.
[2013-09-13 14:16:34 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
Performing helog.diwesh.NugaBest.NUGA_HealthCareActivity_Intro activity
launch
[2013-09-13 14:16:36 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
Launching a new emulator with Virtual Device 'Testing'
[2013-09-13 14:16:41 - Emulator] emulator: warning: opening audio output
failed
[2013-09-13 14:16:41 - Emulator]
[2013-09-13 14:16:41 - NUGA_HealthCare_bluetooth_ver4_PID_verICS] New
emulator found: emulator-5554
[2013-09-13 14:16:41 - NUGA_HealthCare_bluetooth_ver4_PID_verICS] Waiting
for HOME ('android.process.acore') to be launched...
[2013-09-13 14:17:40 - NUGA_HealthCare_bluetooth_ver4_PID_verICS] HOME is
up on device 'emulator-5554'
[2013-09-13 14:17:40 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
Uploading NUGA_HealthCare_bluetooth_ver4_PID_verICS.apk onto device
'emulator-5554'
[2013-09-13 14:17:53 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
Installing NUGA_HealthCare_bluetooth_ver4_PID_verICS.apk...
[2013-09-13 14:18:32 - NUGA_HealthCare_bluetooth_ver4_PID_verICS] Success!
[2013-09-13 14:18:32 - NUGA_HealthCare_bluetooth_ver4_PID_verICS] Starting
activity helog.diwesh.NugaBest.NUGA_HealthCareActivity_Intro on device
emulator-5554
[2013-09-13 14:18:34 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
ActivityManager: Starting: Intent { act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER]
cmp=hellog.diwesh.NugaBest/helog.diwesh.NugaBest.NUGA_HealthCareActivity_Intro
}
[2013-09-13 14:18:34 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
ActivityManager: Warning: Activity not started, its current task has been
brought to the front
[2013-09-13 14:24:57 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
------------------------------
[2013-09-13 14:24:57 - NUGA_HealthCare_bluetooth_ver4_PID_verICS] Android
Launch!
[2013-09-13 14:24:57 - NUGA_HealthCare_bluetooth_ver4_PID_verICS] adb is
running normally.
[2013-09-13 14:24:57 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
Performing helog.diwesh.NugaBest.NUGA_HealthCareActivity_Intro activity
launch
[2013-09-13 14:24:57 - NUGA_HealthCare_bluetooth_ver4_PID_verICS] Failed
to find an AVD compatible with target 'Google APIs'.
[2013-09-13 14:24:59 - NUGA_HealthCare_bluetooth_ver4_PID_verICS] Still no
compatible AVDs with target 'Google APIs': Aborting launch.
[2013-09-13 14:24:59 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
Performing helog.diwesh.NugaBest.NUGA_HealthCareActivity_Intro activity
launch
[2013-09-13 14:25:01 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
Launching a new emulator with Virtual Device 'Testing'
[2013-09-13 14:25:01 - Emulator] emulator: warning: opening audio output
failed
[2013-09-13 14:25:01 - Emulator]
[2013-09-13 14:25:02 - NUGA_HealthCare_bluetooth_ver4_PID_verICS] New
emulator found: emulator-5554
[2013-09-13 14:25:02 - NUGA_HealthCare_bluetooth_ver4_PID_verICS] Waiting
for HOME ('android.process.acore') to be launched...
[2013-09-13 14:25:35 - NUGA_HealthCare_bluetooth_ver4_PID_verICS] HOME is
up on device 'emulator-5554'
[2013-09-13 14:25:35 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
Uploading NUGA_HealthCare_bluetooth_ver4_PID_verICS.apk onto device
'emulator-5554'
[2013-09-13 14:25:47 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
Installing NUGA_HealthCare_bluetooth_ver4_PID_verICS.apk...
[2013-09-13 14:26:26 - NUGA_HealthCare_bluetooth_ver4_PID_verICS]
Installation error: INSTALL_FAILED_CONFLICTING_PROVIDER
[2013-09-13 14:26:26 - NUGA_HealthCare_bluetooth_ver4_PID_verICS] Please
check logcat output for more details.
[2013-09-13 14:26:26 - NUGA_HealthCare_bluetooth_ver4_PID_verICS] Launch
canceled!