Monday, 26 August 2013

Notification redirecting to the last visible Activity

Notification redirecting to the last visible Activity

I have an App with some Activities, where MyActivity is the main, and I
use this code to show a Notification from a Service:
Intent intent = new Intent(this, MyActivity.class);
intent.setAction(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0,
intent, 0);
/*
* Set up removteView
*/
mBuilder = new NotificationCompat.Builder(this)
.setContentIntent(pendingIntent);
mNotiMan = (NotificationManager)
getSystemService(Context.NOTIFICATION_SERVICE);
mNoti = mBuilder.build();
mNoti.flags = Notification.FLAG_NO_CLEAR;
mNotiMan.notify(NOTI_ID, mNoti);
The part of interest is the Intent and the PendingIntent. If I click the
Notification from the Homescreen or another App, I will be redirected to
the last visible Activity of my App.
I would expect that a click on the Notification would only redirect me to
MyActivity, starting it if it's actually not in the ActivityStack. But it
doesn't matter which Activity was the last visible one when I left the
App, I will be redirected to it. This is exactly what I need but I don't
know why this is possible.
Can someone please explain this to me?

Sunday, 25 August 2013

How to run asp.net 4.0 websites on asp.net 3.5.?

How to run asp.net 4.0 websites on asp.net 3.5.?

i have an application developed in 4.0 asp.net. and i want to make some
changes but i am using 3.5 asp.net.
is it possible? or i will have to download 4.0 version.
i modified the web config file according to 3.5 version........but it does
not work.

No warnings for that function int f() doesn't return any value?

No warnings for that function int f() doesn't return any value?

struct A
{
int f()
{} // Notice here!
};
int main()
{
A a;
a = a;
}
My compiler is the latest VC++ compiler (Visual Studio 2013 Preview)
The function A::f doesn't return any value; but no compiler warnings or
errors! Why?

PHP free file content analyzer library / function

PHP free file content analyzer library / function

I was wondering if you know about any good and accurate PHP library or
file I can include in my script in order to analyse the content of X file
and then check if it is an especific type like .doc, .docx .jpg, etc.
I know PHP offers a big number of libraries that we could use to check
them, but they're not that accurate at all, some just checks the file
extension or the file header (they don't even know if the file is broken
or not)
What I request is for something very accurate, simple and faster (probably
I'm requesting too much) but any link or suggestion will be accepted and
appreciated, Thank you!

Problems updating HP laptop graphics driver

Problems updating HP laptop graphics driver

So since I installed 64 bit Windows 7 on my HP laptop I have problem
finding updated drivers for my graphics card. The only driver that works
is the old driver I found on HP website
My laptop has Radeon 7470M and Intel 3000.
Every time I want to install a newer beta driver my laptop boots in
1024x768 resolution so it simply doesn't work.
I did uninstall the old driver before I installed the new one but it still
doesn't work.
I saw something about this saying that you have replace old installer with
new one or something like that. Can you tell me how?

Access 2013 on SharePoint 2013 Online - Wow and Duh?

Access 2013 on SharePoint 2013 Online - Wow and Duh?

Very long time since I even look at Access.. but on SPO, with a database
on Azure it seems really nice ... wondering tho..
Any way to remove that left pane with the Databases from the UI?
Set a list button to go to a URL formatted using selected column fields in
the row?
Join in oData datasource like SharePoint Online List?
Any file upload control and upload to a sharePoint Library? A way to add
metadata to a file and do some validation - like does file exist with this
metadata. Dynamically rename files to some unique string.
Perform complex field validation
Secure the application and database to SharePoint groups.
What's the business language of choice? Not clear on how to edit and save
macros. Can it make calls to webservices?
Any way to change that obsure url you get for the App in SharePoint 2013
Online?

Saturday, 24 August 2013

First ever script (Python) - feedback appreciated

First ever script (Python) - feedback appreciated

I have just managed to get my first ever script written, in any language
(apart from 'hello world', and other practise scripts!). I've only
self-taught, so I'm sure I've broken many rules, and gone about things in
an inefficient way, so feel free to be critical and suggest how I could
have done it better. It basically does what I want it to do, but the only
unresolved problem I have is that the output.xlsx file has written every
value as [u'Value], and I can't figure out how to write it simply as
Value. Also...I downloaded pyscripter and at the top was:
def main():
pass
if __name__ == '__main__':
main()
and I had no idea what I was supposed to do with that...so I just wrote
below it. Am I supposed to write inside it? Here is my working code...have
at it, and probably have laugh at the same time, at how I've done it! I
really appreciate it...
'''grab the file and declare some variables'''
import xlrd, os.path
data_folder = r"C:\users\hopkinsj\desktop\Python Projects\wus"
filename = r"original.xlsx"
workbook = xlrd.open_workbook(os.path.join(data_folder,filename))
sheet = workbook.sheet_by_index(0)
r = sheet.nrows
i = 1
employees = {}
'''import the employees into the employees dictionary'''
while i < r:
hrid = sheet.row_values(i,0,1)
name = sheet.row_values(i,1,2)
wuid = sheet.row_values(i,2,3)
wuname = sheet.row_values(i,3,4)
wum = sheet.row_values(i,4,5)
parentwuid = sheet.row_values(i,5,6)
employees[i] = hrid, name, wuid, wuname, wum, parentwuid
i += 1
'''put the unique workunits (wuids) as keys in a dictionary, and include
some values.
Where there's' more than one employee assigned to the same wuid, append their
name to the list of names for the given work unit'''
workunits = {}
for k, v in employees.iteritems():
if str(v[2]) not in workunits.keys():
print "Adding to %s to the list of Work Units" % (v[2])
workunits[str(v[2])] = v[3], v[4], v[5], [v[1]]
else:
workunits[str(v[2])][3].append(v[1])
'''put the keys and values of work units dictionary into an excel file'''
import xlwt
output = xlwt.Workbook()
outputsheet = output.add_sheet("output data")
r = 1
for k in workunits:
c = 0
outputsheet.write(r,0,[k])
for val in workunits[k]:
outputsheet.write(r,c+1,str(workunits[k][c]))
c += 1
r += 1
output.save('output.xls')