Saturday, 31 August 2013

how to screen count in sql server

how to screen count in sql server

in my sql server i am able to open three window at a time.. in Google
chrome i can open lot of window.i f i open new window automatically
decrees the size of rest of all window.like that i want to sett my sql
server.now only three window is showing my sq l server. if i open new
window i want to show that in sql server(but tab size should decrees),is
there any setting for that? if any one know how to do that.please help me
to find out..

implementing a "findM" in Haskell?

implementing a "findM" in Haskell?

I am looking for a function that basically is like mapM on a list -- it
performs a series of monadic actions taking every value in the list as a
parameter -- and each monadic function returns m (Maybe b). However, I
want it to stop after the first parameter that causes the function to
return a Just value, not execute any more after that, and return that
value.
Well, it'll probably be easier to just show the type signature:
findM :: (Monad m) => (a -> m (Maybe b)) -> [a] -> m (Maybe b)
where b is the first Just value. The Maybe in the result is from the
finding (in case of an empty list, etc.), and has nothing to do with the
Maybe returned by the Monadic function.
I can't seem to implement this with a straightforward application of
library functions. I could use
findM f xs = fmap (fmap fromJust . find isJust) $ mapM f xs
which will work, but I tested this and it seems that all of the monadic
actions are executed before calling find, so I can't rely on laziness
here.
ghci> findM (\x -> print x >> return (Just x)) [1,2,3]
1
2
3
-- returning IO (Just 1)
What is the best way to implement this function that won't execute the
monadic actions after the first "just" return? Something that would do:
ghci> findM (\x -> print x >> return (Just x)) [1,2,3]
1
-- returning IO (Just 1)
or even, ideally,
ghci> findM (\x -> print x >> return (Just x)) [1..]
1
-- returning IO (Just 1)

VB Script to launch the site and change the cookie value

VB Script to launch the site and change the cookie value

I need a VB script to launch a website and change its JESSIONID(which is
available in the cookie editor). It has to contentiously change the value
and launch the website.

Trying to INSERT in db but keep getting Keyword not supported: 'metadata'

Trying to INSERT in db but keep getting Keyword not supported: 'metadata'

I've read all the postings that have to do with this but can't figure it
out. I imagine my problem is in the web.config. Any help would really be
appreciated. Still getting the hang of .NET
Here's the error:
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.ArgumentException: Keyword not supported:
'metadata'.
Source Error:
Line 20: {
Line 21: string connString =
System.Configuration.ConfigurationManager.ConnectionStrings["CateringAuthorizationEntities"].ConnectionString;
Line 22: SqlConnection conn = new SqlConnection(connString);
Line 23: string sql = "INSERT INTO tbBooking (BookingName) VALUES "
Line 24: + " (@BookingName)";
C# Code:
private void ExecuteInsert(string name)
{
string connString =
System.Configuration.ConfigurationManager.ConnectionStrings["CateringAuthorizationEntities"].ConnectionString;
SqlConnection conn = new SqlConnection(connString);
string sql = "INSERT INTO tbBooking (BookingName) VALUES "
+ " (@BookingName)";
try
{
conn.Open();
SqlCommand cmd = new SqlCommand(sql, conn);
SqlParameter[] param = new SqlParameter[1];
//param[0] = new SqlParameter("@id", SqlDbType.Int, 20);
param[0] = new SqlParameter("@BookingName",
System.Data.SqlDbType.VarChar, 50);
param[0].Value = name;
for (int i = 0; i < param.Length; i++)
{
cmd.Parameters.Add(param[i]);
}
cmd.CommandType = System.Data.CommandType.Text;
cmd.ExecuteNonQuery();
}
catch (System.Data.SqlClient.SqlException ex)
{
string msg = "Insert Error:";
msg += ex.Message;
throw new Exception(msg);
}
finally
{
conn.Close();
}
}
protected void BtnCatering_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
//call the method to execute insert to the database
ExecuteInsert(BookingName.Text);
Response.Write("Record was successfully added!");
}
}
Web.Config:
<connectionStrings>
<add name="ApplicationServices" connectionString="data
source=.\SQLEXPRESS;Integrated
Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User
Instance=true" providerName="System.Data.SqlClient"/>
<add name="CateringAuthorizationEntities"
connectionString="metadata=res://*/App_Code.CateringAuthorization.csdl|res://*/App_Code.CateringAuthorization.ssdl|res://*/App_Code.CateringAuthorization.msl;provider=System.Data.SqlClient;provider
connection string=&quot;data source=xxxxxx;initial
catalog=CateringAuthorization;integrated
security=True;multipleactiveresultsets=True;App=EntityFramework&quot;"
providerName="System.Data.EntityClient"/>

PHP Division with variables, not working

PHP Division with variables, not working

I am having some difficulties dividing a cart total on an e-commerce site,
in order to create a deposit amount for a customer to pay.
As you'll see below, I am trying to display 25% of the order total as a
deposit amount. however, I have tried many variations of this, and all
return "0".
If I echo any of the variable independently, they echo the correct value,
but when dividing one by the other the result is "0" everytime.
Any help is appreciated, I feel like I am missing something very simple..
Thanks
<?php $amount = $woocommerce->cart->get_total(); ?>
<?php $percent = 4; ?>
<?php $deposit = $amount / $percent; ?>
<strong><?php echo $deposit; ?></strong>

Best Framework for web service which receive messages

Best Framework for web service which receive messages

Hello I am new to web services in JAVA. I am creating a 2 way SMS
Service.So whenever someone reply to my number the gateway will ping my
service like:
http://userip:port/urlpattern?userid=userid&oa=replynumber&da=receipientno&dtime=datetime&msgtxt=message][1]
How to create such a web service in java which will accept this parameter.
Any tutorial will be really helpful.
And what king\d of web service will it be?REST

Chrome's back button bug

Chrome's back button bug

everyone!
I have problem with "Back" button in Chrome (version 29.0.1547.62 m). The
problem only appears on some sites (not on all sites).
1) Go to site.com
2) Then go to site.com/1
3) Then go to site.com/2
4) Press "Back" button - get to site.com/1
5) Press "Back" again - get to site.com/2 (but must get site.com)
How to fix this? Thanks!

hide and show layout based on conditions in android

hide and show layout based on conditions in android

i am new to android.i want to hide and show Linearlayout based on if else
conditions.in my application i have taken 1 spinner. baesd on selected
spinner values i want my next layout hide or visible. but if it is once
gone .it not comes visible again please help me guys...
my code is...
public class Expense extends Activity{
Spinner datype;
public void onCreate(Bundle b){
super.onCreate(b);
setContentView(R.layout.expense);
mainlayout=(LinearLayout)this.findViewById(R.id.layout1);
datype=(Spinner)findViewById(R.id.da_type);
List<String>data1=new ArrayList<String>();
data1.add("Local");
data1.add("Ex-Station Double Side");
data1.add("Ex-Station Single Side");
data1.add("Out-Station Double Side");
data1.add("Out-Station Single Side");
ArrayAdapter<String>adapter=new
ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,data1);
adapter.setDropDownViewResource(android.R.layout.simple_list_item_single_choice);
datype.setAdapter(adapter);
if(datype.getSelectedItem().toString().equals("Local")){
mainlayout.setVisibility(LinearLayout.GONE);
}
else
mainlayout.setVisibility(LinearLayout.VISIBLE);
}
}
if any one tell me proper solution for my problem..... it is urgent

Friday, 30 August 2013

How can you access a controller that is 3 layers deep in Laravel 3?

How can you access a controller that is 3 layers deep in Laravel 3?

So it seems like this is a routing issue, but I cannot access my
controller from another controller. Here is my controller structure:
controllers --api ----v1 ------exercises.php ------helpers.php
------routines.php --groups ----admin.php ----users.php --reports.php
--totals.php
So the issue is accessing any of my api controllers from another
controller. I can hit any of them just fine by hitting a url like
mysite.com/index.php/api/v1/routines/routine/1, but I accessing them from
another controller is out of the question.
Here's an example:
If I want to access method() from the Groups_Users controller, using my
Reports controller, all I would do is this:
Groups\Users::method()
However, if I want to access api_method() from the Api_V1_Exercises
controller, using any other controller, I would think that it would be the
same, like this:
Api\V1\Exercises::api_method()
This DOES NOT work, and I have NO idea why... I've tried doing the
underscores instead of using the back slash character, but no help there
either.
What am I doing wrong? I really could use some help figuring this one out.

Thursday, 29 August 2013

Right click drag drop not working

Right click drag drop not working

I used to be able to right click and drag and drop into a new folder.
To move a group of files into a new folder using tortoisehg source control.
The right click drag drop doesn't seem to be working.
On doing some research people are suggesting that a window management
addon breaks right click drag.
I don't think I have installed anything like this.
Any tips to help diagnose why right click drag drop is not working.

Wednesday, 28 August 2013

Error 112 and Error 113 after adding foreign keys to database

Error 112 and Error 113 after adding foreign keys to database

This is my table ( part of the whole thing ) :

After adding foreign key and update my model from database in my visual
studio , it came up this 2 error :
Error 2 Error 112: The types of all properties in the Dependent Role of a
referential constraint must be the same as the corresponding property
types in the Principal Role. The type of property 'ActivityID' on entity
'istellarModel1.singalong' does not match the type of property
'ActivityID' on entity 'istellarModel1.activity' in the referential
constraint 'FK_singalong_activity'.
and
Error 1 Error 113: Multiplicity is not valid in Role 'activity' in
relationship 'FK_singalong_activity'. Because all the properties in the
Dependent Role are nullable, multiplicity of the Principal Role must be
'0..1'.
I checked my ActivityID in singalong have the same type as activity
table's Activity ID , and i don't understand what error 113 actually means
, i am new to database , at first i have many tables that don't link so i
link them up after sometime and update my model in visual studio ( using
entity framework ) and it gave me errors .
Any guidance on this please?

Convert this function from php to ruby

Convert this function from php to ruby

I have this function and I tried to convert it to ruby 1.9.3 (to be used
on ruby on rails 3.2.13) but I can't get the same hash that this php
function returns.
this what I am using in ruby so far:
keypair = OpenSSL::PKey::RSA.new(File.open(Rails.root.join('sec',
'private_key.pem'))) @encrypted_string =
keypair.sign(OpenSSL::Digest::MD5.new, @data) @encrypted_string =
Base64.encode64(@encrypted_string)
This is the function in php:
function SignData($text, $privateKeyFile) {
$private_cert = $privateKeyFile;
$f = fopen($private_cert,"r");
if($f)
$private_key = fread( $f, filesize($private_cert) );
else
return "";
fclose($f);
$private_key = openssl_get_privatekey($private_key);
if(openssl_private_encrypt(md5($text), $crypt_text, $private_key))
{
base64_url_encode($crypt_text) . "\n";
}
return "";
}
This is the hash returned in php:
xJCl3YZVEkXjt_pTPHl9FjpebpDcdMtgZzGFo0LsO_PFyQ8lwdUpKxR_XhK1DGfywVr4-hPxtDqSOHMcp7fM-eYK5GqGVasUh80qRiVLjw6Zeh4NPCk1qxsSm4X3gl0sv13dBb5FvDwV6QcLyo7vyNweqUH_Cpq_WmWrNY3px5Y,
This is the one I got in ruby:
DTilW98pHOep/5qc7H+iBYPdbFNZGKWW0c0XFo5YfrWfqKLPzzLTygRQAiFY
whVX8+I0FYAOg3+QqyH0jpcGaFbSVQefU7gDIfT+tHKqSCKmLZwVQas5SQ3j
o+m8V+iv/ZgGuHD0U8dNZwO4zkqJAPMPJFvdOeHJVxb77lCBtNU=
Maybe I need to remove the header and footer in the .pem file?

Best way to backup NFS server

Best way to backup NFS server

I'm using ubuntu as a nfs host for my virtual machines running on xenserver.
Can I use lvm snapshots to backup the whole volume? then export it?
will my virtual machines suffer from data corruption when starting them
after lvm restore?
Thank you

formatting a string in c#

formatting a string in c#

I have a string which i have initialized to empty and building the string
as seen below i have also got the preferred output i would like, whats the
best mathod of doing this as this would be sent as an email. tak into
account company names will be off different length.
string being buit
emailBody += s + " Success" + Environment.NewLine;
Ouput of String
CompanyName Success
CompanyName Success
CompanyName Success
CompanyName Success
CompanyName Success
CompanyName Success
CompanyName Success
Would like output like below
_______________________________________
CompanyName | Success
CompanyName | Success
CompanyName | Success
CompanyName | Success
CompanyName | Success
CompanyName | Success
CompanyName | Success

Tuesday, 27 August 2013

Rename base DN in OpenLDAP

Rename base DN in OpenLDAP

I currently have an LDAP directory (OpenLDAP), which does authentication
for a bunch of services running across a number of servers.
Let's say the base DN is dc=oldcompany,dc=com.
I'd now like to change that to dc=newcompany,dc=com with minimal downtime
on services that depend on it.
Is there some way of setting up an "alias" or something so that my
services can access the directory through both the old and new DN while
I'm reconfiguring everything?
What other alternatives should I consider? Is there any good documentation
around for others doing such a rename? My Google-foo is failing to find
anything.

show class when scroll down between ID=A and ID=B

show class when scroll down between ID=A and ID=B

I have this script but it won't work in FOUNDATION because the pixels
values. I need to show a div when user scroll down between two ID's
var cvHeight = $("#CV").css.height();
var cvStart = $("#TOP").css.height() + $("#NAV").css.height() +
$("#PIX").css.height() + $("#DATO_UR").css.height() +
$("#TEASER").css.height() + $("#TIPS").css.height() +
$("#REFERENCER").css.height();
var cvEnd = cvStart + cvHeight;

// pixel values 1800 & 5550
$(window).scroll(function () {
if ($(this).scrollTop() > cvStart && $(this).scrollTop() < cvEnd) {
$("#cvBoxWrap").fadeIn();
} else {
$("#cvBoxWrap").fadeOut();
}
});

Adding buttons to available list in TToolBar customize

Adding buttons to available list in TToolBar customize

TToolBar has a property called Customizable which when set to true enables
customize editor - by double-clicking TToolBar (which opens ToolBar
Customize window).
I have some issues with that window:
How can I add buttons to list on the left (available buttons), tried
modifying properties of already added buttons but haven't found property
that may control this. MSDN explains I need to add buttons myself but
doesn't specify how.
Is there a way to set initial position and size of the customize window?
Is there a way to add some drop-downs (e.g. "position of text", "icon
size" dropdowns)?

Vectorized solution to assignment to specific rows by columns in R

Vectorized solution to assignment to specific rows by columns in R

I have three matrices:
a<-sapply(1:300, function(x) sample(1:100,100*0.8,replace=F))
b<-sapply(1:300, function(x) sample(1:2,100*0.8, replace=TRUE))
c<-matrix(data=NA, nrow=100, ncol=300)
I would like to assign to do the following assignment:
select those rows in c[,1] that are in a[,1] and assign b[,1] to them.
do this for all c[,1:300], a[,1:300], b[,1:300]
For one column I would do:
c[a[,1],1]<-b[,1]
but I would like to do this for all columns.
Is there a vectorized solution to this?

Not receiving any email notifications from jenkins

Not receiving any email notifications from jenkins

I am using Jenkins 1.520 In Ubuntu and Email-ext plugin 2.32. I didn't see
like editable email notification options in configure system. Is it
possible to add editable email notifications. i can able to send test
emails. or is it possible by down grading the email plugins. do let me
know how to downgrade the email-ext plugin

Keep the text in its place when translating

Keep the text in its place when translating

How to keep the text from moving out of line when translating i want the
text to be centered not to go out of line and how to make a option menu
that shows the language settings and changing them when the user pressed
the settings menu

12 Days Of Christmas C Program in Functions

12 Days Of Christmas C Program in Functions

A C program that contains a function that outputs the lyrics of the
traditional Christmas song "Twelve Days of Christmas." Do not print the
entire lyrics manually.
So I made a code and there were errors but I finally fixed it. My Twelve
Days of Christmas Song prints well with the looping.
But I have another problem. Is my code possible to be separated or
dissected as functions?
The instruction says, "Your function will just be invoked in the main()
function and will not return anything." So I guess I'll be using void? In
what way?
#include <stdio.h>
#include <conio.h>
int main() // Main Function
{
int days, counter, num;
printf("\n\t\t* * * TWELVE DAYS OF CHRISTMAS * * *\n");
printf("\t\t_____________________________________\n\n\n");
for (counter=1; counter<=12; counter++) {
printf("\tOn the ");
switch(counter){
case 1:
printf("1st");
break;
case 2:
printf("2nd");
break;
case 3:
printf("3rd");
break;
default:
printf("%dth", counter);
break;
}
printf(" day of Christmas my true love sent to me\n\n");
switch(counter) {
case 12: printf("\t\tTwelve Drummers Drumming\n\n");
case 11: printf("\t\tEleven Pipers Piping\n\n");
case 10: printf("\t\tTen Lords a Leaping\n\n");
case 9: printf("\t\tNine Ladies Dancing\n\n");
case 8: printf("\t\tEight Maids a Milking\n\n");
case 7: printf("\t\tSeven Swans a Swimming\n\n");
case 6: printf("\t\tSix Geese a Laying\n\n");
case 5: printf("\t\tFive Golden Rings\n\n");
case 4: printf("\t\tFour Calling Birds \n\n");
case 3: printf("\t\tThree French Hens\n\n");
case 2: printf("\t\tTwo Turtle Doves\n\n");
case 1: printf("\t\t");if (counter > 1 ) printf("And ");printf("A
Partridge in a Pear Tree\n\n");
// case 1: printf("\t\tA Partridge in a Pear Tree\n\n");
}
}
getchar(); return 0; }
Tried executing this and works fine with the printing. Do you have any
suggestions to imporove my code? Having trouble with functions.

Monday, 26 August 2013

Notepad++: Mark a word and insert command

Notepad++: Mark a word and insert command

How can I mark a word in notepad++ and can easily insert a command, with
the marked word as argument? E.g.: I have a text with the word "WORD1", I
want to mark "WORD1" with the mouse, and after press any button/shortcut,
or quick contextmenu with the right mouse-button, or anything like that,
and it will make it to "\command{WORD1}".
Of course, I want to specify "\command", e.g. I can choose the needed
command in a dropdown of the context menu, or choose a specific
button/shortcut for any command.
Is that possible?

Beginner javascript

Beginner javascript

I'm new to javascript and web design in general, and I don't understand
why this doesn't work. There are two problems. 1)The title of my page
doesn't work, and instead in the browser title bar what is displayed is
"myHtml.html". The title only works if i take the declaration of the
script out.
2)I want the text generated by javascript to be blue, is there a way to do
that?
HTML:
<!DOCTYPE html>
<html>
<head class = "Header">
<title>JavaScript Test</title>
<meta charset = "UTF-8">
<link rel = "stylesheet" type = "text/css" href = "myCSS.css" >
<script type= text/javascript src= myJavaScript.js></script>
</head>
<body class = "Body" onload = "testJavaScript()">
<p>
<noscript>
Your javascript is disabled
</noscript>
</p>
</body>
</html>
Javascript:
function testJavaScript(){
var message = "You Have Javascript!!";
document.writeln(message);
}
CSS:
@charset "UTF-8";
head.Header{
font-family:sans-serif;
color:green;
}
body.Body{
font-family:sans-serif;
color:blue;
}

Rails: create lots of almost-duplicate records

Rails: create lots of almost-duplicate records

I want to write a method that creates a bunch of almost-duplicate records,
just with one or two parameters changed. I'll make a form to control those
parameters, I'm just wondering about how best to write the method, and
where do keep it.
Presently in my document.rb I've written this:
def self.publish(brand, components, template)
brand.users.each do |user|
Document.create(:component_ids => components, :message => 'Message.',
:template_id => template.id, :user_id => user.id)
end
end
It doesn't feel right though. Is there a better way to do this?
Thanks!

How can I best manage root passwords for many servers=?iso-8859-1?Q?=3F_=96_security.stackexchange.com?=

How can I best manage root passwords for many servers? –
security.stackexchange.com

Lets say I have two racks with about 40 nix servers in them. I don't want
to set all of the root user passwords all the same do I? If not how do you
manage and keep up with all of the passwords? Is …

How to determine what kind of Cauchy sequences lie in a given space=?iso-8859-1?Q?=3F_=96_math.stackexchange.com?=

How to determine what kind of Cauchy sequences lie in a given space? –
math.stackexchange.com

I understand the main principles of Cauchy sequences and metric spaces,
but I have a particular question about determining whether or not a space
is a complete space. If a space has all cauchy ...

Remove all blocks from Magento template

Remove all blocks from Magento template

I want to remove all default blocks from the template/layout file of my
custom Magento module. Currently I have used individual removes like
<module_cart_index>
<remove name="head" />
<remove name="header" />
<remove name="footer" />
<remove name="right"/>
<remove name="left"/>
<remove name="cart_sidebar" />
<remove name="checkout.cart" />
<remove name="sale.reorder.sidebar" />
<reference name="content">
<block type="checkout/cart" name="cp.cart"
template="module/cart.phtml" />
</reference>
</module_cart_index>
I want that the output from cart.phtml should not contain any code from
Magento but it should only contain the code written in it.
Right now when I run http://127.0.0.1/mag/index.php/module/cart/ it
outputes a complete HTML page with <html>, <head>, <body> and all other
tags. How can I remove these tags? I want to get only the content written
on module/cart.phtml.
Is there any way to remove/prevent the default layout rendering in Magento?

Where can I farm legendary loot midgets in Borderlands 2?

Where can I farm legendary loot midgets in Borderlands 2?

I would like to farm legendary loot midgets to get better weapons.
However, I have no idea where they would spawn. Do they spawn in
particular boxes? If so, where can I find these boxes.
A linked video (if you can make one) would be much appreciated

String to java.sql.Date

String to java.sql.Date

I realize this has been asked a lot. I did actually look. I've spent hours
looking around and trying to figure this out. I'm supposed to be making a
program that stores what amounts to a list of appointments in a database,
with a description, date, start time, and end time. It has to take input
from the user to add or cancel appointments, so as far as I know that
means I need to convert a string to a date.
These are my imports: import java.io.File; import java.io.IOException;
import java.sql.Connection; import java.sql.Date; import
java.sql.PreparedStatement; import java.sql.ResultSet; import
java.sql.ResultSetMetaData; import java.sql.SQLException; import
java.sql.Time; import java.text.DateFormat; import
java.text.ParseException; import java.text.SimpleDateFormat; import
java.util.ArrayList; import java.util.Scanner;
As you can see, no java.util.Date there. Here is the bit where I'm getting
the error:
private static java.sql.Date getDay()
{
Scanner in = new Scanner(System.in);
String input;
Date apptDay = null;
DateFormat df = new SimpleDateFormat("yyyy/MM/dd");
java.sql.Date sqlDate;
System.out.println("\nPlease enter the date of the appointment,
format: yyyy/mm/dd");
while(apptDay == null)
{
try
{
input = in.next();
apptDay = (Date) df.parse(input);
}
catch(ParseException e)
{
System.out.println("Please enter a valid date! Format is
yyyy/mm/dd");
}
}
sqlDate = new Date(apptDay.getTime());
return sqlDate;
}
I've added java.sql.Dates to it and mucked about with it a bunch trying to
get it to work, but it's still giving me this:
Exception in thread "main" java.lang.ClassCastException: java.util.Date
cannot be cast to java.sql.Date at Calendar.getDay(Calendar.java:47)
Any ideas on what I'm doing wrong or how to make this work would be very
much appreciated.

Sunday, 25 August 2013

IE onpropertychange event doesn't fire

IE onpropertychange event doesn't fire

<a href="javascript:void(0)" id="select-handler">select</a>
<input type="file" id="real-file-input" style="display:none" />
$('#select-handler').click(function(){
$('#real-file-input').click();
});
$('#real-file-input').bind('propertychange', function(){
alert('changed');
});
it's weird that when I use .click() the propertychange won't be fired.

diablo2 window mode using ubuntu script

diablo2 window mode using ubuntu script

I have Diablo 2 installed on one of my drives which I would like to run in
Ubuntu, but I don't want to have to go through Terminal, every time, to
start it up. I was trying to create a shell script that would just open it
for me when I wanted to play it.
This is what I came up with:
#! /bin/bash
wine /media/84964ADD964ACF7C/"Program Files (x86)"/Diablo\ II/Diablo\
II.exe -w
When I run it I get a /bin/bash^M: bad interpreter: No such file or
directory error. What am I doing wrong?
I have changed the permissions to be 755 and
I run it through the command line but it will not run
Oh, I forgot to put in my answer, that when I run the command above in the
command line it works just fine, but when I run my script it doesn't work

[ Lesbian, Gay, Bisexual, and Transgendered ] Open Question : WHY do drag queens think they can sing and make music?

[ Lesbian, Gay, Bisexual, and Transgendered ] Open Question : WHY do drag
queens think they can sing and make music?

Drag queens are very talented people and I respect them soooo much, but
why does it seem like almost every queen that's been on Drag Race think
they have any business releasing "music"? It's absolutely crap, and if you
don't agree, I don't know what to say. It's the only true flaw about the
drag community seemingly: The fact that many release embarrassingly awful
music. Thoughts? Thanks.

Saturday, 24 August 2013

Gimp (GAP) on Ubuntu 10.04

Gimp (GAP) on Ubuntu 10.04

HELP PLEASE! There's a picture of what comes up. >1
This comes up every time I try to extract videorange. I've tried .mp4,
.MPG, and .flv files and it says the same thing each time. I looked it up
on youtube, and .mp4 worked for someone else. I'm pretty sure that the
problem must be beyond that but I don't know what it is.

Capturing form submit events using enter in backbone

Capturing form submit events using enter in backbone

My backbone.js form has a single textfield (no submit button). I need to
capture submit event (using enter key) in the view. Below is the sample
code. Somehow the submit method is not called on pressing enter. Instead
the form goes for a reload.
<script>
var FormView = Backbone.View.extend({
el : '#form',
events: {
"submit":"submit",
},
initialize: function() {
console.log("initialize");
},
submit : function(e) {
e.preventDefault();
console.log("submit");
}
});
new FormView();
</script>
<form id="form">
<input type="text"/>
</form>

how to remove shop in the url

how to remove shop in the url

my website looks like this website.com/shop/shoes/myproduct and I have
lots of products so the end url changes.
How do I remove the shop part What do I edit my .htaccess to?
current htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Can I hide the default.aspx from URL?

Can I hide the default.aspx from URL?

I seem to be getting different behavior when running my site on the Visual
Studio Development Server and running it on IIS.
When I request http://example.com
The development server seems to enforce showing
http://example.com/default.aspx in the URL, whereas IIS will allow
http://example.com.
I'm presently using an HttpModule to perform some SEO optimizations
(lowercase URLs, simplifying requests that contain queries, removing the
.aspx extension, etc).
I'd like to force a request to http://example.com/default.aspx to either
404 or redirect to http://example.com. Is there a typical/standard way to
do this, and will it behave the same when ran locally and when ran on IIS?

How do I use JQuery in coordination with an anchor tag to move the screen to a location?

How do I use JQuery in coordination with an anchor tag to move the screen
to a location?

I've never worked with this before so I am not sure if I apologize if I am
using too many words to define what I am looking for.
I want to create a navigation menu in the header where upon clicking a
link the screen should slowly move down to that section of the page.
Code structure:
<div class="header">
<a href="#about" class="link">About</a>
<a href="#contact" class="link">Contact</a>
</div>
<div class="container">
Some content
</div>
<div class="section2">
About
</div>
<div class="section3">
Contact
</div>
So if a user clicked on About how do I use JQuery to slowly drag them to
that section and the same for contact?

i am looking for netfx20wrapper?

i am looking for netfx20wrapper?

Recently i have been given a task to program on vb 6(its an ActiveX
Component). I am looking for way to a background worker in vb6 or more
specifically multitasking . There is a article for this
Here is [a link from
microsoft]http://msdn.microsoft.com/en-us/library/aa719109(v=vs.71).aspx
There it is mentioned the use of netfx20wrapper. anyone who can tell me
where i can get this.searching on google is not helping.
I am not aware about this netfx20wrapper.

Google Chrome USB API to access epson thermal printer

Google Chrome USB API to access epson thermal printer

In my EPSON Thermal Printer the Vendor & Product IDs has string, so im
getting error when loading my package files to google chrome extensions
The USB API supports only integer for Vendor & Product IDs
"optional_permissions": [ {"usbDevices": [{"vendorId": 04B8, "productId":
0202}]}]
Please help me to solve this issue

My PC won't display anything on monitor?

My PC won't display anything on monitor?

Anyone can help me? My computer is didn't display anything,it has power
but no display I tried all this.
Put to Built In/ On board VGA = No display
CMOS CLR = No display
Remove Memory = No display
Remove Hard Disk Drive = No display
PSU = Good
Any ideas? is there a way to fix this problem?

Friday, 23 August 2013

Nginx reverse proxy shows my server internal ip address

Nginx reverse proxy shows my server internal ip address

i have setup reverse proxy in my server for all domains and then created
ip table to redirect all traffic from port 80(apache) to 81(nginx ip)
Now every time i see logs and also in geoip it shows my server's ip
instead of clients ip.
My nginx config is as below.
# /usr/local/etc/nginx/nginx.conf
user apache;
worker_processes 2; # how many processors or how many hard disks you have
error_log /usr/local/nginx/logs/error.log;
events {
worker_connections 8192;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] $request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
tcp_nopush on;
keepalive_timeout 75 20;
gzip on;
server_names_hash_bucket_size 64;
reset_timedout_connection on;
client_max_body_size 100m;
#------------------
#fullproxy for all
server {
listen 81;
server_name $hostname |IP|; # "_" is for handle all hosts that
are not described by server_name
charset off;
index index.html index.htm index.php;
access_log off;
#access_log /var/log/nginx/access.log main;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/local/www/nginx-dist;
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://myipaddress:80; # apache here
client_max_body_size 16m;
client_body_buffer_size 128k;
proxy_buffering off;
#proxy_buffering on;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 120;
#proxy_buffer_size 8k;
#proxy_buffers 32 32k;
#proxy_busy_buffers_size 64k;
#proxy_temp_file_write_size 64k;
error_page 502 503
/usr/local/www/nginx-dist/50x.html;
}
}
}
IP table rules that i added to redirect from apache to nginx.
iptables -t nat -A PREROUTING -p tcp -s ! myipaddress --dport 80 -j
REDIRECT --to-ports 81
iptables -t nat -A PREROUTING -p tcp -s ! myipaddress --dport 80 -j
REDIRECT --to-ports 81

how to detect moving to a new tab in Mobile Safari

how to detect moving to a new tab in Mobile Safari

I would like to know how to get the equivalent of a $(window).blur event
in mobile safari on iOS 6+. I would like this for the purpose of detecting
when a tab is no longer onscreen. This has been asked a few times before
(Detect moving to a new tab in Mobile Safari), however, all the answers
either no longer work, or only give a $(window).focus event, rather than a
$(window).blur event. Also, will $(window).blur fire on closing of safari?

Why Syntax error appears on the following if condition

Why Syntax error appears on the following if condition

Hi I have a following if condition in java
if ((i%3)==0)
do some work
else if ((i%3 || i%5)==0)----syntax error appears on this line
do some work
And it is showing me following syntax error... Multiple markers at this
line - The operator || is undefined for the argument type(s) int, int -
Syntax error on token "OR", . expected - i cannot be resolved or is not a
field
can any one please tell me how can i fix this one ??

Make shortcuts to directories via terminal

Make shortcuts to directories via terminal

My problem is: whenever I'm coding I work inside folders that are inside
other folders and it's a long way to type:
cd /folder1/folder2/.../folderN
I know it's possible to make a shortcut to the folder using alias. So it
would be:
alias ep="cd /Users/thi/Dropbox/CurrentProject"
My question is, where should I put this alias? Inside /etc/bashrc? Or
should I create a file called ~/.profile and place it there? Where should
I put it?

ios: how to detect if a custom url scheme link failed?

ios: how to detect if a custom url scheme link failed?

I have an HTML page containing a link to a custom URL scheme, displayed on
iPhone .e.g myapp://localhost/
Assuming the user clicks it, but there is no app that can respond to this
scheme, how do I catch this in javascript (that the link cannot be
opened)?
tnx

Java 8: Where is TriFunction (and kin) in java.util.function? Or what is the alternative?

Java 8: Where is TriFunction (and kin) in java.util.function? Or what is
the alternative?

I see java.util.function.BiFunction, so I can do this:
BiFunction<Integer, Integer, Integer> f = (x, y) -> { return 0; };
What if that is not good enough and I need TriFunction? It doesn't exist!
TriFunction<Integer, Integer, Integer, Integer> f = (x, y, z) -> { return
0; };

Java XML Bean and XML xml parser

Java XML Bean and XML xml parser

I have never used XMl perser directly.When i was going through xml beans i
got a doubt which may be stupid(apologies for that) and here it goes
Use of xml parser is to parse through a xml and store its values.
User of xml beans is to represent a xml as a java bean and make it simple
(i think it iwill take schema as a input).
In a way both are used for same purpose (xml parsing) can i say that java
xml beans is a advanced and sopisticated way of parsing a xml?
Thanks KD

Thursday, 22 August 2013

Number of zeros with positive real part

Number of zeros with positive real part

How many zeros does the polynomial $z^4 + 3z^2 + z + 1$ have in the right
half-plane?
This question is from a previous exam and I am not sure how to solve it.
The other questions in this section are applications of Rouché's theorem.
I tried to change this to a question about the unit disc, using the map $z
\mapsto \frac{z-1}{z+1}$, which (I think) maps $\{z : \mathfrak{Re}(z) >
0\}$ bijectively to the unit disc and turns rational functions into
rational functions. In this way I could reduce to counting the zeros of
$4z^4 + 2z^3 + 6z^2 - 2z + 6$ on the unit disc. This looks like a standard
Rouché's theorem problem, but I don't see how to do it.
Is it possible that there is a better solution?

c++: even more curiously recurring template pattern

c++: even more curiously recurring template pattern

and thanks for your help. Probably everyone knows CRTP in C++ and its pros
and cons. Suppose I have BaseObject, Object and Int classes, where Object
is a template class used to perform CRTP. In Object there are defined
operators like operator signed short() const, which all return result from
virtual function Int cast_int() const, which is later proceeded to signed
signed short type, using overloaded Int::operator signed short() const
function. everything goes well when I derive from class like this: class
Child: public Object<Child>. What if I want to derive from Int? Is there a
way to.show that I want to use not Int::cast_int() const, but
Child::cast_int() const to cast to Int and then to signed short?
If it will be necessary, I'll post the code. I've already tried virtual
operator signed short() const { return this->cast_int(); } variant, but
all derived from Int classes act as if they cast from Int, not from Child.
Do I always need to explicitly derive like class Child: public
Object<Child>, public Int>? I can't use C++11, if it plays any role.
Thanks in advance!

Formula to find the last " \ " in a filepath and remove all after that

Formula to find the last " \ " in a filepath and remove all after that

So I have an excel task that involves taking filepaths (C:\foo...) and
getting just the path (that is, removing the actual file name from the
path). I can't seem to get the SEARCH/FIND function to work since it is
always finding the first "\" in the file path (after the drive
designation) and only removes 3 or so characters.
Is there a formula that will allow me to trim after the last "\" in the
filepath?
Thanks in advance for any help!

Google Plus api access

Google Plus api access

I have a WEB APP running on Google APP Engine.
I want the APP to ask users to give permission to let the WEB APP post to
to their Google Plus page.
I have this working for Facebook and Twitter - I get the access KEy and
store it against their user.
I have read on the Web that Google Plus API does NOT allow updates. Is
this true or can I achieve what I am trying to do.
I have it so the user logs on each time at present - a bit poor!

How to install Poppler on Windows

How to install Poppler on Windows

The most recent version of scraperwiki depends on Poppler (or so the
github says). Unfortunately it only specifies how to get it on OSX and
Linux, not Windows. A quick google turned up nothing too promising so does
anyone know how to get Poppler on Windows for scraperwiki?

Explain this c++ code

Explain this c++ code

Wednesday, 21 August 2013

installation of ubuntu 12.04 along side windows 8 in sony vaio svf15218sn

installation of ubuntu 12.04 along side windows 8 in sony vaio svf15218sn

I have installed ubuntu 12.04 along side windows 8 in sony vaio svf15218sn
but not able boot ubuntu , disabled secure boot option , Please suggest
some solutions...

Formatting Date from server time to local time using NSTimeZone and Dateformatter

Formatting Date from server time to local time using NSTimeZone and
Dateformatter

I am receiving a date/time as a NSString from my server where I am
converting that time into a NSDate to the users local time using
NSTimeZone. After which I try to reformat this NSDate into a better more
readable NSString using the new NSDateFormatter format, however when I try
to apply this new format it reverts the resulting dateString back to the
original Server time.
I would like to know what I am doing wrong, I would like to show the
converted time in the new format.
this is the code I am using
// set date format
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.dateFormat = @"yyyy-MM-dd HH:mm:ss";
// change time to systemTimeZone
NSTimeZone *timeZone = [NSTimeZone systemTimeZone];
[dateFormatter setTimeZone:timeZone];
NSDate *localTime = [dateFormatter
dateFromString:[singleInstanceActivationHistoryDictionay
objectForKey:@"ActivationTime"]];
// reformat converted Time to readable format
NSDateFormatter *dateFormat1 = [[NSDateFormatter alloc] init];
[dateFormat1 setDateFormat:@"dd/MM/yy - hh:mm a"];
NSString *dateWithNewFormat = [dateFormat1 stringFromDate:localTime];
NSLog(@"TimeZone - %@", timeZone);
NSLog(@"UTC ServerTime - %@",
[singleInstanceActivationHistoryDictionay
objectForKey:@"ActivationTime"]);
NSLog(@"UTC to deviceTimeZone - %@", localTime);
NSLog(@"NewFormat - %@", dateWithNewFormat);
This is an example of my output
TimeZone - Pacific/Auckland (NZST) offset 43200
UTC ServerTime - 2013-08-22 01:45:59
UTC to deviceTimeZone - 2013-08-21 13:45:59 +0000
NewFormat - 22/08/13 - 01:45 AM
any help would be greatly appreciated

getchars() sequence off by 1byte

getchars() sequence off by 1byte

I set up a test example of getchars() call and the returns the bytes are
off sequence by 1. byte [] readBufA = new byte [] {1,2,3,4,5,6,7}; Test
array
I then run the getchar and the result is off by 1.
String strIncom = new String(readBufA, 0, 7);
// create string from bytes array
// String strIncom = new String(readBuf, 0, msg.arg1);
// create string from bytes array
sb.append(strIncom); // append string
int counter = sb.length(); // Get length of string
if (counter == 7){
getChars(0,7,readBufA,0);
Log.d(TAG, "Data " + sb + " Size " + (char)readBuf[0] + " " +
(char)readBuf[1] + " " + (char)readBuf[2] + " " + (char)readBuf[3] + " " +
(char)readBuf[4] + " " + (char)readBuf[5] + " " + (char)readBuf[6] +" " +
(char)readBuf[7]+ " " + counter);// receive massage
The log.d retuns (2,3,4,5,6,7,-,-,7) counter is correct but dont see the
correct return

Populating text box with string date-time without the time

Populating text box with string date-time without the time

I have a table that holds a datetime field. I have put that into a datakey
and on pageload and select from gridview it will populate the textbox with
the datetime from the table in the database. I do not want the time. In
the grid view I have already gotten rid of the time but when i populate
the textbox I can not get rid of it. Any suggestions? here is my code: (I
need both the PurchaseDate and WarrantyDate to show only the date without
the time)
private void PopulateForm(int index)
{
var dataKey = grdvwAssetGrid.DataKeys[index];
if (dataKey != null)
AssetId = (int)dataKey["Id"];
if (dataKey != null)
LocationId = (int)dataKey["LocationId"];
if (dataKey != null)
txtVendor.Text = (string)dataKey["Vendor"];
if (dataKey != null)
txtSerialNumber.Text = (string)dataKey["SerialNumber"];
if (dataKey != null)
txtDescription.Text = (string)dataKey["Description"];
if (dataKey != null)
txtType.Text = (string)dataKey["Type"];
if (dataKey != null)
txtPrimaryUser.Text = (string)dataKey["PrimaryUser"];
if (dataKey != null)
txtPurchaseDate.Text = dataKey["PurchaseDate"].ToString();
if (dataKey != null)
txtWarrantyDate.Text = dataKey["WarrantyExpDate"].ToString();
}
In the gridview I did this to change the datetime to only the date:
<asp:BoundField DataField="PurchaseDate" HeaderText="Purchase Date"
InsertVisible="False" ReadOnly="True" DataFormatString="{0:d}" />
<asp:BoundField DataField="WarrantyExpDate" HeaderText="Warranty Date"
InsertVisible="False" ReadOnly="True" DataFormatString="{0:d}" />

Markov Chain Monte Carlo in plain English

Markov Chain Monte Carlo in plain English

I barely know what a markov chain is (I had a terrible teacher) and I
probably have an idea of what a stationary distribution is... but I don't
know how a Monte Carlo method works and I don't know how a Markov Chain
Monte Carlo algorithm works.
Can someone please explain it to me in plain English and very simple terms?

How to return static file in Laravel?

How to return static file in Laravel?

I have a laravel-project where my root should return static html (it's an
ajax app).
I concider putting my static html in the public-folder and then use routes
to return it. Is this a good approach? If so, how do I return a file in
php?

Send binary data via POST methos in cURL

Send binary data via POST methos in cURL

I am writing a script. I want to upload a pdf file with cURL. But I get
the error message in browser "PDF document didn't upload."
<?php
$service_url = "http://sample";
$curl = curl_init($service_url);
$filename = "foo.pdf";
$curl_post_data = array("fname" => "nabukkad", "lname" => "nezzar",
"email" => "n@n.com", "phone" => "05050505", "file" => "@" .
realpath($filename));
curl_setopt($curl, CURLOPT_URL, $service_url);
curl_setopt($curl, CURLOPT_HEADER, 1);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data);
$curl_response = curl_exec($curl);
header("Content-Transfer-Encoding: UTF-8");
header("Content-Type: application/pdf");
echo $curl_response;
?>

Tuesday, 20 August 2013

Singleton Variable not Changing iOS

Singleton Variable not Changing iOS

I have created a variable in a class called User its not a global variable
but it gets changed when a method is called from another class. Here is
the User class:
User.h:
@interface User : NSObject{
BOOL twitterLoggedIn;
BOOL facebookLoggedIn;
BOOL instagramLoggedIn;
BOOL googleLoggedIn;
BOOL linkedinLoggedIn;
}
+ (instancetype)data;
-(BOOL)returnInstagramState;
-(BOOL)returnTwitterState;
-(BOOL)returnFacebookState;
-(BOOL)returnGoogleState;
-(BOOL)returnLinkedinState;
-(void)setInstagramLogged:(BOOL *)turtle;
-(BOOL)returnAllOff;
@end
Method in User.m which changes the Variable + Where the Variable is Defined:
+(instancetype)data {
static User *_data = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
_data = [[User alloc] init];
});
return _data;
}
- (id)init {
if (self = [super init]) {
instagramLoggedIn = NO;
twitterLoggedIn = NO;
googleLoggedIn = NO;
facebookLoggedIn = NO;
linkedinLoggedIn = NO;
}
return self;
}
-(void)setInstagramLogged:(BOOL *)turtle{
instagramLoggedIn = turtle;
}
Where I call for the value to be changed
-(void)authenticateWithTwitter{
self.twitterClient = [[AFOAuth1Client alloc] initWithBaseURL:[NSURL
URLWithString:@"https://api.twitter.com/"]
key:@"You
dont wanna
know that"
secret:@"Thats a
Seceret"];
[self.twitterClient
authorizeUsingOAuthWithRequestTokenPath:@"oauth/request_token"
userAuthorizationPath:@"oauth/authorize"
callbackURL:[NSURL
URLWithString:@"floadt://success"]
accessTokenPath:@"oauth/access_token"
accessMethod:@"POST"
scope:nil
success:^(AFOAuth1Token
*accessToken, id
response) {
NSLog(@"%@",accessToken);
self.accessToken
= accessToken;
[[User data]
setInstagramLogged:YES];
}
failure:^(NSError
*error) {
NSLog(@"Error:
%@", error);
}];
}

404 page not found just in one page

404 page not found just in one page

I got an error 404 page not found but it only happens in one page to
upload files using ckeditor and when I use the host. when I was using
localhost before it's work well, and I use codeigniter. is that related
with htaccess file? any suggest why that happen just in one page? thank
you for advice.

python module variable confusion

python module variable confusion

Here is my code :
a module settings.py:
My_KEY = ""
and I am using this MY_KEY in another module
my_module.py
from settings import My_KEY
def function_a():
MY_KEY = "abcd"
def function_b():
function_a();
print My_KEY
I expect to see a "abcd" in output when I call function_b(), but how come
I get empty string. I am totally lost

struts2 losing cookies when calling other action

struts2 losing cookies when calling other action

after creating several cookies in one action and placing them on the
response, when i try to access those cookies in another action the request
is blank. here's the code that created the cookies(portion of code) :
Cookie cookie;
cookie = new Cookie("cookieUserId", cookieUserId);
cookie.setPath(getText("cp.cookieDirectory"));
if (getText("cp.cookieDomain") != null
&& getText("cp.cookieDomain").length() > 0) {
cookie.setDomain(getText("cp.cookieDomain"));
}
response.addCookie(cookie);
cookie = new Cookie("iwif_web_sso_timer",
getText("cp.cookieSessionIdleTimeout"));
cookie.setPath(getText("cp.cookieDirectory"));
if (getText("cp.cookieDomain") != null
&& getText("cp.cookieDomain").length() > 0) {
cookie.setDomain(getText("cp.cookieDomain"));
}
response.addCookie(cookie);
here is the code (in another action) that should retrieve the cookies, yes
the action is implementing ServletResponseAware and ServletRequestAware:
Cookie[] cookies = request.getCookies();
when i inspect what is returned to cookies, the cookies array is blank.
WHY? any help would be much appreciated. thankx!

Relative URL in JQuery Post Call

Relative URL in JQuery Post Call

I have the following situation.
I developed my first MVC Asp.Net application. it runs on my server at the
following adress
http://localhost:59441/
I wrote some JQuery Post Methods that looked like this
$.ajax({
type: "POST",
url: "/CeduleGlobale/UpdateCheckBox", ...
CeduleGlobale is my ControllerName and UpdateCheckBox is my methodName
When I put the Application on the testServer, it was put in a
VirtualDirectory
hence the application is now
http://testServer/JprApplication/
no more port to specify and also an application Name
When I started to test, I quickly noticed my JQuery Post calls didn't work
anymore...
I modified them so now the URL is
/JprMvc/CeduleGlobale/UpdateCheckBox
the problem is 2 fold.
this makes it hard to test on my development machine because IIS Express
doesn't allow me to specify a virtual Directory.
I don't like hardCoding the Virtual Directory Name in the JQuery because I
dont know what name the Application will have in the production
environment and therefore i will have to modify my script before i can
install the application in production.
I am sure I am missing some basic thing to simplify this.
Thanks

How to select top 20 rows from a dataset in asp.net C#

How to select top 20 rows from a dataset in asp.net C#

DataSet ds = gn.fillGrid_with_param_DAL("Allotment_Distribution_view",
paramchk);
grd_Search.DataSource = ds.Tables[0].Select("Top 20");
grd_Search.DataBind();
I want to get top 20 rows from the dataset. In my dataset I am getting
records from database. I just need to select top 20 rows. Above is my code
that I am trying to bind top 20 rows to my grid but I am getting error as
missing operand after 20

Does this explain why the Borel construction is called the *homotopy orbit space*?

Does this explain why the Borel construction is called the *homotopy orbit
space*?

Let $X$ be a CW-complex and $G$ a topological group acting on $X$ by
$\sigma:G\times X\to X$.
Is the Borel construction $EG\times_G X$ weakly equivalent to
$\operatorname{hocolim}\left(G\times X
{\overset{\sigma}{\to}\atop\underset{pr}{\to}}X\right)$?
If not, is this at least true for a free action $\sigma$?
This would explain why the Borel construction is called the homotopy orbit
space.
The space $EG\times_G X$ can be defined as the orbit space $(EG\times
X)/G$ which is in turn defined by $$\operatorname{colim}\left(G\times
(EG\times X) {\overset{\tau}{\to}\atop\underset{pr}{\to}}EG\times
X\right)$$ and the action $\tau$ is the diagonal action on the factors
$EG$ and $X$.

Monday, 19 August 2013

Amazon mws response is not the same with the one i received

Amazon mws response is not the same with the one i received

i am working on mws's Inteface of GetMatchingProductForId. the document of
mws said that there will be an Element named ,actually i can not find this
Element from the response of the mws server. searching for help. any help
will be appreciated.

Font awesome selector color

Font awesome selector color

I was wondering if it was possible to change the selector color of the
font awesome icon
I know its possible to change it of everything except the font awesome by
using this code
::selection{
background: #ffb7b7 !important; /* Safari */
}
::-moz-selection {
background: #ffb7b7; /* Firefox */
}

Running Visual Studio devenv to build current solution dependencies

Running Visual Studio devenv to build current solution dependencies

On my C# Build Events -> Pre-build event command line, I have the following:
call "$(DevEnvDir)..\Tools\vsvars32.bat"
"$(DevEnvDir)devenv.exe" "$(SolutionDir)..\MySolution\MySolution.sln"
/build $(Configuration)
which is supposed to build DLLs and EXEs to be used by the current
project. I am stuck on this simple building command on visual studio...
The following is the output of the command:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1063,5):
error MSB3073: call "C:\Program Files (x86)\Microsoft Visual Studio
10.0\Common7\IDE..\Tools\vsvars32.bat"
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1063,5):
error MSB3073: "C:\Program Files (x86)\Microsoft Visual Studio
10.0\Common7\IDE\devenv.exe"
"C:\files\tempWorkfiles\MySolution\MySolution.sln" /build Debug" exited
with code 1.
There doesn't seem to be anything wrong with the batch file (call
"$(DevEnvDir)..\Tools\vsvars32.bat") because if I take that out, it
successfully builds. My guess is the last argument to build with devenv. I
quoted everything to take care of spaces too..
Any other suggestions or links as guidance?
Thanks!

Windows Phone 7 and GMTP : failed to open session

Windows Phone 7 and GMTP : failed to open session

I am trying to use a Lumia 800 (WP7) with Ubuntu.
I have installed gmtp to use it. It installed properly but when connecting
to the phone by clicking 'connect' in gmtp, the following error shows up
in terminal :
Device 0 (VID=045e and PID=04ec) is a Microsoft Lumia 800. ignoring
libusb_claim_interface() = -6PTP_ERROR_IO: failed to open session, trying
again after resetting USB interface LIBMTP libusb: Attempt to reset device
I compiled libgmtp with this line in music-player.h :
{ "Microsoft", 0x045e, "Lumia 800", 0x04ec,
DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL},
I can't find any workaround by myself and I don't want to use a virtual
machine to connect the phone... Any idea?

Picard group of $G(k, n)$ saying about automorphisms

Picard group of $G(k, n)$ saying about automorphisms

Let $G(k, n)$ be the Grassmannian of $k$-dimensional subspaces of $k^{n}$,
$k$ a field, embedded in $\mathbb{P}^{N}$ by the Plücker embedding. In
Harris' Algebraic Geometry, A First Course, Theorem 10.19 states that
$$\mathrm{Aut}(G(k, n)) = \mathrm{Aut}(G(k, n), \mathbb{P}^{N}),$$ where
$\mathrm{Aut}(G(k, n), \mathbb{P}^{N}) := \{ T \in
\mathrm{Aut}(\mathbb{P}^{N}) \mid T(G(k, n)) = G(k, n) \}$. In its proof,
Harris says that it comes down to the assertion that every codimension $1$
subvariety of $G(k, n)$ is the intersection of $G(k, n)$ with a
hypersurface in $\mathbb{P}^{N}$. In other words, $\mathrm{Pic}(G(k, n))
\cong \mathrm{Pic}(\mathbb{P}^{N})$, right? How such information can say
about the automorphism group of these varieties?
Thank you!

Sunday, 18 August 2013

How to create hybrid MBR/GPT partition on USB drive?

How to create hybrid MBR/GPT partition on USB drive?

Can you please tell me how to create a hybrid MBR/GPT partition on the USB
drive? I need the MBR for the boot as my BIOS doesn't boot GPT partitions.

animation delay not working

animation delay not working

Okay, I have this text that I want to appear after 20s. I am using the
animation-delay property but it is not working. Perhaps, I am doing
something wrong.
Please help me out to get to right track..
Here is my code..
@import url(http://fonts.googleapis.com/css?family=Economica);
#text{
font-family:'Economica', sans-serif;
font-weight:bold;
position:absolute;
left:50%;
top:50%;
margin-left:-20px;
margin-top:-25px;
animation:fade-in 5s;
animation-delay:15s;
-webkit-animation-delay:15s;
-webkit-animation:fade-in 5s;
}
@keyframes fade-in{
from { opacity:0;}
to {opacity:1;}
}
@-webkit-keyframes fade-in{
from {opacity:0;}
to {opacity:1;}
}
Here is the link on Fiddle
Thank You for everything!
EDIT ONE:
After changing the order of the animation properties, and adding the
opacity:0 in the text, I got the following
#text{
font-family:'Economica', sans-serif;
position:absolute;
left:50%;
top:50%;
opacity:0;
margin-left:-20px;
margin-top:-25px;
animation:fade-in 2s;
animation-delay:3s;
-webkit-animation:fade-in 2s;
-webkit-animation-delay:3s;
-o-animation:fade-in 2s;
-o-animation-delay:3s;
}
@keyframes fade-in{
from { opacity:0;}
to {opacity:1;}
}
@-webkit-keyframes fade-in{
from {opacity:0;}
to {opacity:1;}
}
But if I leave the opacity to 0 in the #text, the text will disappear once
the animation is over.
How can I keep the text visible after the animation is done??
Thank you!

Using ActionBarSherlock Tabs inside an existing View or Layout in the current Activity

Using ActionBarSherlock Tabs inside an existing View or Layout in the
current Activity

I'm trying to make a swipe-able view with tabs using the ActionBarSherlock
and I managed to do so, but I have some stuff that I want to show before
the these tabs..

I want to add these elements before the ActionBar tabs or view the whole
SherlockFragmentActivity inside a relativeLayout below the upper header of
a parent activity
thanks in advance ..

CSS Change font size only on one level without propagating change

CSS Change font size only on one level without propagating change

I'm messing around with some css grid systems based on
display:inline-block. I don't like the solution with negative 0.25em
margins that are supposed to fix whitespace problem that makes columns to
pop in a new row.
It would be much nicer to set font size to 0 but that change propagates on
child elements and than I have to reset font size for all direct children
and that makes my code less maintainable.
Is there any way to stop this propagation?
Something in the lines of .row > *:parent {font-size:0}
I searched but couldn't find much on this exact topic.

How poll deal with closed pipe

How poll deal with closed pipe

I want to konw:
When a pipe close , what status poll will set for the pipe's file descriptor?
I try the code below, After child process close all file descriptor , the
poll just think all file descriptor can read! Is that right? Or just I
make some mistake in this code?
I use SUSE and gcc .
#include <stdio.h>
#include <unistd.h>
#include "../../../myInclude/apue.h"
#include <sys/poll.h>
int main(int argc, char **argv)
{
int fd1[2]; int fd2[2]; int fd3[2];
pid_t pid;
if(pipe(fd1)<0 ||pipe(fd2)<0 ||pipe(fd3) <0)
err_sys("pipe error");
if((pid = fork()) <0)
err_sys("fork() error");
else if(pid == 0)
{
close(fd1[0]);
close(fd2[0]);
close(fd3[0]);
if(write(fd1[1],"hello fd1 write!",17)!= 17)
err_sys("write 1error ");
sleep(2);
if(write(fd2[1],"hello fd2 write!",17)!=17)
err_sys("write 2error");
sleep(2);
if(write(fd3[1],"hello fd3 write!",17)!= 17)
err_sys("write 3error");
sleep(2);
close(fd1[1]);
close(fd2[1]);
close(fd3[1]);
}
else
{
close(fd1[1]);
close(fd2[1]);
close(fd3[1]);
struct pollfd fd[3];
fd[0].fd = fd1[0];
fd[1].fd = fd2[0];
fd[2].fd = fd3[0];
fd[0].events = POLLIN;
fd[1].events = POLLIN;
fd[2].events = POLLIN;
while(poll(fd,3,3000) >0)
{
printf("now I come \n");
int i = 0,n;
char line[MAXLINE];
for(; i< 3; i++)
{
if(fd[i].revents = POLLIN)
if ((n =read(fd[i].fd,line,MAXLINE))< 0)
err_sys("read error : %d",i);
else
{
line[n] = 0;
printf("read from pipe %d : %s\n",i,line);
}
}
}
close(fd1[0]);
close(fd2[0]);
close(fd3[0]);
}
return 0;
}

How to declare a variable as thread local portably?

How to declare a variable as thread local portably?

C11 introduces the _Thread_local storage class specifier that can be used
in combination with the static and extern storage class specifiers to
declare a variable as thread local. The GNU C compiler suite implements a
storage class specifier __thread with the same same semantics.
Unfortunately I did not find any compiler (I tried gcc, clang and SUN
studio) that actually implements the _Thread_local keywords. I currently
use the following construct to declare a keyword thread_local:
/* gcc doesn't know _Thread_local from C11 yet */
#ifdef __GNUC__
# define thread_local __thread
#elif __STDC_VERSION__ >= 201112L
# define thread_local _Thread_local
#else
# error Don't know how to define thread_local

How to clear boot data

How to clear boot data

Recently I bought laptop,While Windows 7 istalization time battery was
died.So I plug-in charger and re-installed windows 7 home basic from
starting.after completion of procedure.I have 2 windows folders in my C
drive,so I deleted old windows folder.
The problem is, While booting time it showing 2 windows 7 options.Already
I deleted old Windows folder.Still It showing 2 Windows 7 options while
booting time.How can I remove old Windows 7 option from my boot.
I hope, you guys understand what I am saying.
Thanks.

Saturday, 17 August 2013

tkinter - Expanding a Listbox inside a Notebook

tkinter - Expanding a Listbox inside a Notebook

As the title says, I'm trying to make a Listbox object occupy all space
that is inside a Notebook pane.
Here is a screenshot of what I have so far:

What I want to do is to expand the Listbox to occupy all the space that's
on the right. I know that if I say listbox['width'] = value to a high
enough value, the Notebook panes' titles will not bug this. However I am
looking for alternative ways to do this, either resorting to grid() (what
I'm using in this project) or pack().

get multiple items chosen in a listbox and populate new list with the values, using Tkinter

get multiple items chosen in a listbox and populate new list with the
values, using Tkinter

I am trying to take the selection from a listbox and populate a new list
with it, and it will be multiple items. I can't figure this out, here's
what i have so far:
def execute(*events):
UsrFCList = []
selctd_indices = lbox.curselection()
lst_select = list(selctd_indices)
for i in lst_select:
lbox.get(i)
UsrFCList.append(i)
lbox.quit()
fc_lb = Tk()
scrollbar = Scrollbar(fc_lb)
scrollbar.pack(side=RIGHT, fill=Y)
lbox = AutoSzLB(fc_lb,selectmode=EXTENDED)
for item in lb_list:
lbox.insert(END, *item)
button = Button(fc_lb, text="Analyze selected feature classes",
command=execute)
lbox.autowidth(250)
lbox.pack()
button.pack()
lbox.config(yscrollcommand=scrollbar.set)
scrollbar.config(command=lbox.yview)
mainloop()

HBO GO doesn't work

HBO GO doesn't work

Does anybody know how to get hbo go to work on ubuntu?
I have installed hal. Tried it with and without pepperflash.
Deleted the flash player folder. None of that works.

Does Minecraft have an API?

Does Minecraft have an API?

I'm now sure if this is the correct place for this question (or something
like StackOverflow) but I'll ask it here first in any case. Does Minecraft
have an API for obtaining information about it's craftable items?

if function f is continuous on $\mathbb R$ then f is uniform continuous on every bounded interval of $\mathbbR

if function f is continuous on $\mathbb R$ then f is uniform continuous on
every bounded interval of $\mathbbR

if function f is continuous on $\mathbb R$ then f is uniform continuous on
every bounded interval of $\mathbbR

watch.liverpool-vs-stoke-city-live-stream.online.free.tv.link by Oxq

watch.liverpool-vs-stoke-city-live-stream.online.free.tv.link by Oxq

Liverpool vs Stoke City Live Streaming Barclays Premier League
Copy this Link >>>>>>>
http://online-sports-tv-onpc-tv.blogspot.com/2013/08/watch-liverpool-vs-stoke-city-live.html
Click HerE >>>>>>>>>>>
http://online-sports-tv-onpc-tv.blogspot.com/2013/08/watch-liverpool-vs-stoke-city-live.html
Watch the match Liverpool vs Stoke City on live streaming in high
definition directly from this website. The match Liverpool vs Stoke City
live sports streaming online and we are going to provide you with the
fastest and highest quality online stream! CLICK TO START WATCHING LIVE HD
Match Schedule:
Teams: Liverpool vs Stoke City
League: Barclays Premier League
Date: Sat, Aug 17, 2013
Kick off Time: 11:45 GMT
Our live HD streams will go directly online when the match starts. You can
find our live streams below and you can start streaming the match directly
from your PC, Mac our Mobile device. You can watch the match Liverpool vs
Stoke City directly from your home or wherever you are as long as you have
an Internet connection.
Don't miss the match Liverpool vs Stoke City and start watching it via
Internet feeds on broadcast online TV. The HD streaming for this match
will start on the scheduled starting time above.

Friday, 16 August 2013

How to call chrome.app.runtime in backgroundjs?

How to call chrome.app.runtime in backgroundjs?

this is my code in background.js to get me the channel id for push messages:
chrome.app.runtime.onLaunched.addListener(function(launchData) {
chrome.pushMessaging.getChannelId(true, channelIdCallback);
});
//This is called when the extension is installed.
chrome.runtime.onInstalled.addListener(function()
{
console.log("Push Messaging Sample Client installed!");
chrome.pushMessaging.getChannelId(true, channelIdCallback);
});
chrome.extension.onMessage.addListener(function(message, sender,
sendResponse) {
console.log(message)
});
//After Receiving Channel ID, listen for Push Messages
function channelIdCallback(message) {
console.log("Background Channel ID callback seen, channel Id is " +
message.channelId);
ListenForMessages();
//Show channel Id to user
chrome.app.window.create("PushHome.html?channelId="+message.channelId);
}
function ListenForMessages()
{
console.log("Listening for messages");
//Start listening for Push Messages.
chrome.pushMessaging.onMessage.addListener(messageReceived);
}
function messageReceived(message) {
var notification = window.webkitNotifications.createNotification(
'icon.jpg', 'Push Message',
message.payload +" [" + message.subchannelId + "]");
notification.show();
//Show it to user.
notification.show();
}
I get a Uncaught TypeError: Cannot read property 'onLaunched' of undefined
everytime I launch my application.
I understand that in my manifest I've defined it as browser_action and not
an "app".
But I'm creating an browser extension and not a chrome app. Hence how do I
do this and get rid of this error?

urllib.request and urllib2 both not working

urllib.request and urllib2 both not working

I am trying to learn python and I was trying to learn modules. The python
version I am using is python 2.7.4. The module I was trying to learn was
urllib. But whenever I am trying to run the code below I am getting an
error called 'no import named request'. The code is given below.
import urllib.request
class App():
def main(self):
inp = raw_input('Please enter a string\n')
print(inp)
inp = input('Please enter a value\n')
print(inp)
if __name__ == '__main__':
App().main()
Then I tried using urllib2. So I changed the first line with
import urllib2
But then it say 'IndentationError: expected an indented block'. But if I
write
import urllib
then I don't get any error. But then I can't use any of the functions of
that library. Please help me. I am stuck since last night. Thanks in
advance.

Saturday, 10 August 2013

xcodebuild cannot find header in embedded projects

xcodebuild cannot find header in embedded projects

I have a project embed another project, and the xcode GUI build was
successful, but in command line xcodebuild failed as such. fatal error:
'OHAttributedLabel/OHAttributedLabel.h' file not found #import ^ 1 error
generated.
but I had this in the project HEADER SEARCH PATH (where the h is located)
${PROJECT_DIR}/MyProject/Vendor/OHAttributedLabel/Source
the problem is the header is located in the "OHAttributedLabel/Source"
folder, while the import statement is looking for header under
OHAttributedLabel folder, I don't want to touch the embedded project
directory structure, but if

Too many lines on the page and too many characters in the lines

Too many lines on the page and too many characters in the lines

I have converted a word document to Tex using Word2Tex. With the tex
document in 12 point, the corresponding pdf document has 38 lines on each
page, and about 77 characters per line. However, I would prefer it if
there were fewer lines on each page and fewer characters in each line. How
can I achieve this?

Friday, 9 August 2013

replacing spaces with %20 in c program

replacing spaces with %20 in c program

I have written the following program to replace spaces with %20.It works
fine. But it prints some garbage values for the pointer variable ptr
though it might have been limited to 8 characters as the malloc assigns it
8 bytes of memory.
Can anyone tell me where did I go wrong here ? Or is there any in place
algorithm ?
void replaceSpaces(char *inputStr )
{
char *ptr;
int i,length, spaceCount=0;
int newLength,j;
for (length=0; *(inputStr+length)!='\0';length++ )
{
if (*(inputStr+length)==' ')
{
spaceCount++;
}
}
newLength = length + 2*spaceCount;
ptr = (char *)malloc(newLength*sizeof(char));
for ( i = length-1; i >=0; i--)
{
if (*(inputStr+i)==' ')
{
*(ptr+newLength-1)='0';
*(ptr+ newLength-2)='2';
*(ptr+newLength-3)='%';
newLength = newLength -3;
}
else
{
*(ptr+newLength-1) = *(inputStr+i);
newLength = newLength -1;
}
}
for ( i = 0; *(ptr+i)!='\0'; i++)
{
printf("%c",*(ptr+i));
}
}

Can a variable be produced from an if else statement?

Can a variable be produced from an if else statement?

hrefCan I change a variables value based on an if/else statement in
javascript?
var $nextLink = $this.next().attr('href'),
$currentLink = $this.attr('href');
if ($currentLink == $nextLink){ // Check if next link is same
as current link
var $nextLoad = $this.eq(2).attr('href'); // If so, get the next link
after the next
}
else {var $nextLoad = $nextLink;}

#EANF#

#EANF#

#EANF#

Excel: Row value to columns

Excel: Row value to columns

I have the following table:
Name Group
John 2A
John 1B
Barry 2A
Ron 1B
Ron 2A
Ron 2C
I wanted to know if there was any utility in Excel where I can separate
the group column into a new column of for each instance.
Expected Result
Name Group1 Group2 Group3
John 2A 1B
Barry 2A
Ron 1B 2A 2C
In this example I know that the max Groups are 3. So I made Group1,
Group2, and Group3 columns.

Installing gems results in error

Installing gems results in error

ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
gem 2.0.3
sudo gem install travis
Building native extensions. This could take a while...
ERROR: Error installing travis:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot
load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:4:in `<main>'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/ffi-1.9.0 for
inspection.
Results logged to /var/lib/gems/1.9.1/gems/ffi-1.9.0/ext/ffi_c/gem_make.out
Also encountering this when trying to install other gems. I'm not a Ruby
user, and googling the error did not get me any working solution.

converting python program into executable

converting python program into executable

So now, I have a python program which I would like to convert into an
executable(preferably a single file). Right now the target systems are
only RedHat(and CentOS) and Debian(and Ubuntu).
First, I've tried the PyInstaller but after running it, it creates a .spec
file and 2 folders called build and dist. I have no idea how to proceed
from there.
Second, I tried the freeze.py which ships with python. I understand the
usage is as follows:
python /path/to/freeze.py /path/to/myfile.py
This throws an error ***Test Failed*** 2 failures and NameError: name
'testdata' is not defined
The full error is as follows:
**********************************************************************
File "/usr/lib/python2.6/site-packages/freeze.py", line 117, in
__main__.freeze
Failed example:
testdata = json.loads(
gzip.open("testdata.json.gz", "r").read().decode()
)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python2.6/doctest.py", line 1253, in __run
compileflags, 1) in test.globs
File "<doctest __main__.freeze[3]>", line 2, in <module>
gzip.open("testdata.json.gz", "r").read().decode()
File "/usr/lib64/python2.6/gzip.py", line 33, in open
return GzipFile(filename, mode, compresslevel)
File "/usr/lib64/python2.6/gzip.py", line 79, in __init__
fileobj = self.myfileobj = __builtin__.open(filename, mode or 'rb')
IOError: [Errno 2] No such file or directory: 'testdata.json.gz'
**********************************************************************
File "/usr/lib/python2.6/site-packages/freeze.py", line 121, in
__main__.freeze
Failed example:
freeze(testdata) == freeze_fast(testdata)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python2.6/doctest.py", line 1253, in __run
compileflags, 1) in test.globs
File "<doctest __main__.freeze[4]>", line 1, in <module>
freeze(testdata) == freeze_fast(testdata)
NameError: name 'testdata' is not defined
**********************************************************************
1 items had failures:
2 of 8 in __main__.freeze
***Test Failed*** 2 failures.
I'd like some help to using either of the 2 (or any other tool which will
help me achieve the same result).
Thanks.

Thursday, 8 August 2013

converting array in two dimension

converting array in two dimension

i have this result as a mysql_fetch_row function which return rows from
database...
Array
(
[firstname] => abc
[lastname] => xyz
[password] => abc
[gender] => female
[city] => malborne
[email] => abc@gmail.com
[address] => abc
)
i want this array as
Array
(
[0] array(
[firstname] => abc
[lastname] => xyz
[password] => abc
[gender] => female
[city] => malborne
[email] => abc@gmail.com
[address] => abc
)
)

UIApplicationDidBecomeActiveNotification notification is confusing

UIApplicationDidBecomeActiveNotification notification is confusing

I'm confused about UIApplicationDidBecomeActiveNotification. I can
register an observer for this notification, and receive signals when the
app becomes active from the background or when being launched. However,
when I pull down the hidden top popup view (for general information:
notifications, weather, stock market) then pull up to hide it, the signal
is also generated. I use a callback method hooked with this signal to
refresh my app, so this can be annoying for users of my app.
Can anybody help me differentiate these cases?

$.ajax seems to not call the error: callback in jQuery 2.x e.g. due to page reloads. Fantastic! But why?

$.ajax seems to not call the error: callback in jQuery 2.x e.g. due to
page reloads. Fantastic! But why?

I've seen in jQuery 1.10.1 that if an $.ajax request is underway when a
page unload occurs (e.g. due to user clicking a link or reloading the
page), the error: callback is called.
That seems not be the case in jQuery 2.0.0 or 2.0.2. And that is fantastic.
There are 7 questions at least here on SO, that ask about error: being
called when navigating. E.g. handle ajax error when a user clicks refresh
See this jsfiddle - it starts out running 1.10.1 but you can change it to
2.0.2 in the controls on the left. Essentially:
$.ajax({
type: "POST",
url: "/echo/json/",
data: {
json: JSON.stringify({
a: 23
}),
delay: 30
},
cache: false,
success: function (json) {
$('#result').text(JSON.stringify(json));
},
error: function () {
alert("error callback called");
}
});
Notice how the alert is shown for 1.10.1 but not for 2.0.2.
However, I don't see anything in the "jQuery 2.0 Released" announcement to
that effect.
Can I rely on this being fixed/changed or is this an accident that could
be browser-dependent or something? It seems to have been fixed at least in
FF, Chromium and Safari on iPad.
I'm looking for a source of the fix, so I can see if I can get 1.x to stop
calling the error handler or at least detect in the error callback whether
this is due to user action / navigation. Especially because the best
solution I've seen so far is to use beforeunload to detect page unload at
the time of the error: callback. Problem is, that beforeunload doesn't
work in mobile safari.

How to copy numeric Fancybox v2 title to img alt value

How to copy numeric Fancybox v2 title to img alt value

Fancybox 2.
I am using for my images the special script for the numeric titles.
Is it any way to copy this title values as the img alt values?
HTML:
<p>Group 1.</p>
<a class="fancybox" rel="group1"
href="http://fancyapps.com/fancybox/demo/1_b.jpg"><img
src="http://fancyapps.com/fancybox/demo/1_s.jpg" alt=""/></a>
<a class="fancybox" rel="group1"
href="http://fancyapps.com/fancybox/demo/2_b.jpg"><img
src="http://fancyapps.com/fancybox/demo/2_s.jpg" alt=""/></a>
<p>Group 2.</p>
<a class="fancybox" rel="group2"
href="http://fancyapps.com/fancybox/demo/3_b.jpg"><img
src="http://fancyapps.com/fancybox/demo/3_s.jpg" alt=""/></a>
<a class="fancybox" rel="group2"
href="http://fancyapps.com/fancybox/demo/4_b.jpg"><img
src="http://fancyapps.com/fancybox/demo/4_s.jpg" alt=""/></a>
<p>Single.</p>
<a class="fancybox" href="http://fancyapps.com/fancybox/demo/5_b.jpg"><img
src="http://fancyapps.com/fancybox/demo/5_s.jpg" alt=""/></a>
JavaScript:
$(document).ready(function() {
$(".fancybox").fancybox({
helpers : {
title : { type : 'inside' }
}, // helpers
beforeShow : function() {
this.title = (this.title ? '' + this.title + '<br />' : '') + 'Image '
+ (this.index + 1) + ' of ' + this.group.length;
} // beforeShow
}); // fancybox
}); // ready
Example: JSFIDDLE

Populating a combobox in the XAML vs codebehind

Populating a combobox in the XAML vs codebehind

I've got a combobox where the list of items will NEVER change. I'm curious
where the population of said combobox should happen: the xaml or the
codebehind. Is there any substantial reason to choose one over the other?

Users are unable to download my app from play store

Users are unable to download my app from play store

I am in a strange situation. I have put an update for my app last night.
After the update, users are unable to download my app. When I tried to
download from my test devices (Samsung S Advance & ASUS Transformer
Tablet) i am getting the error "App could not be downloaded due to an
error (497)". I have attached the screen shot of the same. Kindly let me
know if any of you faced this issue and know the possible resolution.
Thanks, Nagraj

Execute batch files from JAVA and capture batch environment

Execute batch files from JAVA and capture batch environment

I need a solution that allows to capture the batch file exit code and the
resultant environment - by this I mean that I need to retrieve the system
environment + variables set within the batch e.g. "SET VAR=VAL" - I need
that VAR=VAL on batch exit.
First thing I thought about is a ProcessBuilder but in the end it does not
return batch internal variables. I need this solution to be universal -
good for any batch.

java Ternary operator some questions

java Ternary operator some questions

hiCI encountered a problem in worksCthe question like this:

Integer test1=null;
Integer test2=null;
i call them like this:

test2=(test1==null?test1:(test1+1));
test2=(test1==null?test1:-1);
then the java throw a NullPointerException,so iwrite another code like this:
test2=(test1==null?test1:test1);
this code is ok.
but,why? who can tell me,thanks.

Closed point and base change of scheme.

Closed point and base change of scheme.

Let $k$ be a field and $K/k$ be a field extension. For a scheme $X$ of
finite type over $k$, denote $X_K:=X\times_k \text{Spec}K$. Let $x\in X$
be a closed point and $x'\in X_K$ be a point lying over $x$. In this
situation, is $x'$ also a closed point? (This is true for $K/k$ is purely
inseparable extension since two schemes are homeomorphic.)

Wednesday, 7 August 2013

How to get project made on mvc4

How to get project made on mvc4

Hi this is Deepak. and i'm new to MVC4 i'm willing to make my career on
MVC4 in order to understand mvc well i googled it out. but i'm finding a
lot of difference between the tutorials and the real time project. so
could anyone please tell me that how can i get a real time project to
study in more professional way. could anyone please upload or send me any
kind of project on mvc4

How to place an image inside of a link?

How to place an image inside of a link?

I'm trying something really simple, inside a link I want there to be text
and an image.
= link_to 'NVidia Graphics', inventory_url, class: 'lato' do
= image_tag 'list-highlighter.png'
I'd like the output to be something like:
<a href="/inventory">
NVidia Graphics
<img src="list-highlighter.png" />
</a>
How can I achieve this using Slim? My current code causes the website to
crash.
undefined method `stringify_keys' for "http://foobar.com/inventory":String

Global variables won't change unless more time is given

Global variables won't change unless more time is given

I'm trying to run a program that gets a global variable from one script
and returns it in the next. I'm using this method to do it.
When I attempt to get the global variable for my next function, it will
only return if I first run an alert (If I include the variable in the
alert, it returns null). I suspect it's because it needs more time to
write the variable in the previous function but the first js file is
$(document).ready and the next is $(window).load which should run after
all ready() calls are made. Here's my relevant code for the second
function:
alert(window.userid); //returns null
alert(window.userid); //returns value if previous alert is there
alert(getMessages(window.userid)); //runs properly if the alert(s) are
included

Extracting sequences from a fasta file by ID number in header

Extracting sequences from a fasta file by ID number in header

I have a fasta file with multiple sequences with headers that look like this:
>1016BSA34080.1
MTHSVRIITVTVNFLQHRFFIDYMSEIGLLDGEIEQMVSALQEQVHIVARARTLPEMKNLERDTHVIVKT
LKKQLTAFHSEVKKIADSTQRSRYEGKHQTYEAKVKDLEKELRTQIDPPPKSVSEKHMEDLMGEGGPDGS
GFKTTDQVLRAGIRIQNDA
>1038BSA81955.1
MQQQQARRRMEEPTAAAATASSTTSFAAQPLLSRSVAPQAASSPQASARLAESAGFRSAAVFGSAQAAVG
GRGRGGFGAPPGRGGFGAPPAAGFGAAPAFGAPPTLQAFSAAPAPGGFGAPPAPQGFGAPRAAGFGAPPA
PQAFSAVAPASSTAIPLDVTTYLGDTFGSAPTRGPP
The 4 digit number at the start of the header is a unique ID for the
sequence.
Could you help me write a python script to extract sequences by the 4
digit ID (in a text file with one ID per line)?
I tried modifying this script (I found on this website: Extract sequences
from a FASTA file based on entries in a separate file) to suit my purpose
(in vain):
f2 = open('accessionids.txt','r')
f1 = open('fasta.txt','r')
f3 = open('fasta_parsed.txt','w')
AI_DICT = {}
for line in f2:
AI_DICT[line[:-1]] = 1
skip = 0
for line in f1:
if line[0] == '>':
_splitline = line.split('|')
accessorIDWithArrow = _splitline[0]
accessorID = accessorIDWithArrow[1:-1]
# print accessorID
if accessorID in AI_DICT:
f3.write(line)
skip = 0
else:
skip = 1
else:
if not skip:
f3.write(line)
f1.close()
f2.close()
f3.close()
I'm new to Python, any help will be greatly appreciated! Thanks -Divya

Wordpress: being loaded out of nowhere

Wordpress: being loaded out of nowhere

Website:
http://ramprate.com/design1/
You'll find a script tag inside <head>
<script type="text/javascript"
src="http://ramprate.com/design1?ver=1.10.2"></script>
I don't know where this is coming from. I deactivated all the plugins one
at a time, and the tag was still being loaded after every deactivation. I
removed wp_head() from the header file, but the tag was still being loaded
inside the <body>
I spent a lot of time trying to figure out where it's being queued but
couldn't. I found that the version of jQuery on this wordpress
installation is 1.10.2 ( WP Version 3.6 ) - so I guess it's related to
loading jQuery. A grep for 1.10.2 inside wp-content yields no result
either.
Any thoughts on where this is coming from?

C# Count Vowels

C# Count Vowels

I am learning to program C# and I am trying to count the vowels. I am
getting the program to loop through the sentence, but instead of returning
vowel count, it is just returning the length of the string. Any help would
be greatly appreciated.
static void Main()
{
int total = 0;
Console.WriteLine("Enter a Sentence");
string sentence = Console.ReadLine().ToLower();
for (int i = 0; i < sentence.Length; i++)
{
if (sentence.Contains("a") || sentence.Contains("e") ||
sentence.Contains("i") || sentence.Contains("o") ||
sentence.Contains("u"))
{
total++;
}
}
Console.WriteLine("Your total number of vowels is: {0}", total);
Console.ReadLine();
}