Saturday, 31 August 2013

Python modules with submodules and functions

Python modules with submodules and functions

I had a question on how libraries like numpy work. When I import numpy,
I'm given access to a host of built in classes, functions, and constants
such as numpy.array, numpy.sqrt etc.
But within numpy there are additional submodules such as numpy.testing.
How is this done? In my limited experience, modules with submodules are
simply folders with a init.py file, while modules with functions/classes
are actual python files. How does one create a module "folder" that also
has functions/classes?

How would i create an array of object reference Variables?

How would i create an array of object reference Variables?

So i'm working on a program in Java, and whenever i run it, i get an error
"Exception in thread "main" java.lang.NullPointerException". When i look
at it closely, it appears that its caused by array of Reference Variables.
Here's the code causing the problem:
public class agendafunctions {
static String input = "true";
agendaitem item[] = new agendaitem[5];
public agendafunctions() {
item[0].name = "one";
item[1].name = "two";
item[2].name = "three";
item[3].name = "four";
item[4].name = "five";
}
name is a variable in class agendaitem. From what i've read elsewhere, the
error is caused by the program trying to use variables with a null value.
But when i add a value, it says it can't convert from String or whatever
to type agendaitem. Can anyone help?

Char to Integer coversion in c++

Char to Integer coversion in c++

I am trying to convert a Char to Int in my c++ program,followed some of
the answers from this site but its still not working . I have a input file
with following data in file ld.txt
4
8 2
5 6
8 2
2 3
./LD
int main()
{
using namespace std;
std::vector<int> nums;
int i,k;
char j;
for(i=0;;i++)
{
j=fgetc(stdin);
int l =j - 48;
if(feof(stdin))
break;
nums.push_back(l);
cout<<nums[i]<<endl;
}
}
O/p- 4 -38 8 -16 2 -38 5 -16 6 -38 8 -16 2 -38 2 -16 3 -38
Not sure why i am getting the -ve numbers

View not attached to window manager exception even isfinishing is called

View not attached to window manager exception even isfinishing is called

I keep getting this exception "View not attached to window manager"
reports from ACRA and it is always happening around my dialog.dismiss() in
my async task. I have searched SO and I added the (!isFinishing())
condition but I still get it. Can you please tell me how I can solve it?
Here is a sample code where it happens
private class MyAsyncTask extends AsyncTask<String, Void, Void> {
private ProgressDialog dialog;
private PropertyTask asyncTask;
public MyAsyncTask (PropertyTask task){
this.asyncTask = task;
}
@Override
protected void onPreExecute() {
dialog = ProgressDialog.show(ListTasksActivity.this, "Please
wait..", "working..", true);
}
@Override
protected Void doInBackground(String... params) {
//Some DB work here
return null;
}
@Override
protected void onPostExecute(Void result) {
if(!isFinishing()){
dialog.dismiss(); <-------- Problem happens
}
}
}

sphinx returns less matches in comparison a sql like search

sphinx returns less matches in comparison a sql like search

im using Sphinx to make searchs in my web, but i have a thing, when i
search in phpmyadmin using
LIKE '%19.628%'
returns the data that im looking for (8 matches), but when i use the
sphinx returns less matches (3 matches) in comparison a sql LIKE search.
here the PHP code
$sp->SetMatchMode(SPH_MATCH_ANY);
$sp->SetArrayResult(true);
$sp->SetLimits(0,1000000);
$results = $sp->Query($query, 'data_base');
why?
regards

Using header(), does the header get sent instantly, or after the full script has run?

Using header(), does the header get sent instantly, or after the full
script has run?

I'm working with an external service that polls data from my app. A
requirement of this external service is that I have to let it know that
its request was successful after a maximum of 10 seconds. The problem is
that the script this service connects to might take more than 10 seconds
to execute.
My question is: When I sent the headers via header('HTTP/1.0 200 OK',
true, 200);, will the external service receive this response immediately,
or only after my script has executed completely? Example:
header('HTTP/1.0 200 OK', true, 200);
some_function_that_takes_20_seconds()
Will the response header be sent immediately or only after 20 seconds?

ASP.MVC db Find(), but with non-primary key parameter

ASP.MVC db Find(), but with non-primary key parameter

How does one get a list of results by using a key that is not the primary
key? To be more specific, I have a composite primary key where I would
like to retrieve all the matches with one column's parameter.
I would think, in an ActionResult in the Controller, it's something like
tableModel tbmodel = db.tableModels.Find(i => i.partialPK == parameter)
but that's not the case, since Find() only works with the entire PK.
I declared my PKs in the entity model class as:
[Key]
[Column(Order = 0)]
public int PK1 { get; set; }
[Key]
[Column(Order = 1)]
public string PK2 { get; set; }

Friday, 30 August 2013

Java .equals between String and StringBuilder

Java .equals between String and StringBuilder

class returntest
{
public static void main(String...args)
{
String name1 = "Test";
String s = new String("Test");
StringBuilder sb = new StringBuilder("Test");
System.out.println(name1.equals(sb)); //Line 1
System.out.println(name1.equals(s)); //Line 2
System.out.println(s.equals(sb)); // Line 3
System.out.println(s.equals(name1)); //Line 4
}
}
The following is the output
false
true
false
true
Line 1 returns and Line 3 returns false.
I dont understand why compiler does not think "name1" and "sb" as
containing the same value
Similarly compiler does not think "s" and "sb" as containing the same
string (both are non-primitives).
Can someone explain the line1 and line3 output ?

Thursday, 29 August 2013

python : IndexError: list index out of range

python : IndexError: list index out of range

I copy this copy this code from github and try to run it on python. I got
the following error. Im new to python and raspberry pi. Please someone
sort this out?
Error:
if(bool(sys.argv[1]) and bool(sys.argv[2])): IndexError: list index out of
range
coding:
import time
import RPi.GPIO as GPIO
import sys
GPIO.cleanup()
GPIO.setmode(GPIO.BCM)
Passed = 0
pulseWidth = 0.01
if(bool(sys.argv[1]) and bool(sys.argv[2])):
try:
motorPin = int(sys.argv[1])
runTime = float(sys.argv[2])
powerPercentage = float(sys.argv[3]) / 100
Passed = 1
except:
exit
if Passed:
# Set all pins as output
print "Setup Motor Pin"
GPIO.setup(motorPin,GPIO.OUT)
GPIO.output(motorPin, False)
counter = int(runTime / pulseWidth)
print "Start Motor"
print "Power: " + str(powerPercentage)
onTime = pulseWidth * powerPercentage
offTime = pulseWidth - onTime
while counter > 0:
GPIO.output(motorPin, True)
time.sleep(onTime)
GPIO.output(motorPin, False)
time.sleep(offTime)
counter = counter - 1
print "Stop Motor"
GPIO.output(motorPin, False)
else:
print "Usage: motor.py GPIO_Pin_Number Seconds_To_Turn
Power_Percentage"
GPIO.cleanup()

Wednesday, 28 August 2013

Creating MySQL leaderboard

Creating MySQL leaderboard

I'm quite new to programming and certainly to anything that is website
related. I'm 16 years old, so don't make it too complicated :)
I'm trying to make a leaderboard made out of MySQL data. The MySQL data
comes from a plugin on a minecraft server. So I linked the plugin's data
to a MySQL database, called iConomy
In the database I made 2 tables atm: iconomy and bitcoin
The meaning is that a leaderboard would be displayed on the website as:
Rank Number | Username | Bitcoin | Balance
1. |Nicolas | xxxxxxx | 1500
So 1 would be the rank number, Nicolas my username, bitcoin my bitcoin
adress. And balance my current money in game. That data gets provided by
the plugin that I succesfully linked into the MySQL database that I
mentioned.
Reading through a few posts and copying a bit of code, I came to this php
code:
<?php
$result = mysql_query("SELECT username, balance, adress FROM iconomy,
bitcoin ORDER BY balance DESC");
$rank = 1;
if (mysql_num_rows($result)) {
while ($row = mysql_fetch_assoc($result)) {
echo "<td>{$rank}</td>
<td>{$row['username']}</td>
<td>{$row['balance']}</td>
<td>{$row['adress']}</td>";
$rank++;
}
}
?>
So as you can see i have the username, balance, adress which i get from
the tables iconomy and bitcoin (thats where the adresses would be stored).
I don't know if this code is right, thats why I came posting here.
But if it is (this will sound stupid), how do i make a decent webpage of it.
How do I succesfully link that php file into a webpage?
Thanks in advance!

On SQL2005 and trying to load an XML file into a table column of XMLtype with variable file name. The result is the xml column is null

On SQL2005 and trying to load an XML file into a table column of XMLtype
with variable file name. The result is the xml column is null

USE [PS_RS_DEV]
GO
/****** Object: StoredProcedure [dbo].[ps_create_rentals] Script Date:
08/27/2013 18:00:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ps_create_rentals1]
@xmlfile varchar(40)
AS
/******************************************************************************
** File: ps_create_rentals.sql
** Name: ps_create_rentals
** Desc: Stored Procedure
**EXEC ps_create_rentals 'D-RE-1-07252013040105'
**
********************************************************************************/
SET NOCOUNT ON
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
DECLARE
@sql NVARCHAR(MAX),
@inputPath VARCHAR(255),
@inputFile VARCHAR(40),
@requestType VARCHAR(45)
SET @inputFile = @xmlfile + '.xml'
--SET @inputFile = 'A-RE-1-03232013012346.xml'
SET @inputPath = 'D:\DE_OPS\DE_Trans\Inbound\Decrypted\'
SET @requestType = 'CreateRentalContractRequest'
SET @sql = N'INSERT INTO dbo.TRXN_Load_Raw(RawData, LoadedDateTime,
RequestType, InputFile)
SELECT CONVERT(XML, BulkColumn) AS BulkColumn, GETDATE(),
''' + @requestType + ''',''' + @inputFile + '''
FROM OPENROWSET(BULK ''' + @inputPath + @inputFile + ''',
SINGLE_BLOB) AS x;'
print @inputFile
print @xmlfile
print @sql
EXECUTE sp_executesql @sql

FAT filesystem error obtained many times in console

FAT filesystem error obtained many times in console

I have an embedded board which runs linux, i have partitioned file system
and additionally. I have also added a partition(mtdblock5) such that
whenever I attach a pendrive to the embedded board, it automatically
mounts it with some settings such as RO, NOEXEC flags set. But I am
getting some issue related to the FAT filesystem error.
FAT: Filesystem error (dev mtdblock5)
fat_bmap_cluster: request beyond EOF (i_pos 5063)
This error message is shown in the output screen sometimes repeatedly in
the console. Information related to the board are : ARM controller, UBIFS
type root filesystem. I don't know why I am getting this error and how to
debug it? Any help would be helpful.

how to pass ref variable to a SQL stored Procedure using ADO.NET?

how to pass ref variable to a SQL stored Procedure using ADO.NET?

i have that code using LINQ to call a stored procedure to save some data
into database then return two variables from the stored procedure.
[ASP.NET code]
dbDataContext dbo = new dbDataContext();
dbo.AddNewDoctor(doctorName, email, password, ref DocId, ref result);
[SQL]
create PROCEDURE [dbo].[AddNewDoctor]
@doctorname nvarchar(100),
@email nvarchar(100),
@password nvarchar(MAX),
@docId int out,
@Result int out
AS
BEGIN
SET NOCOUNT ON;
declare @idCounter int
select @idCounter = count(*) from dbo.doctors
if EXISTS (select * from dbo.doctors where e_mail = @email)
begin
SET @Result = -1
set @docId= 0
end
else
begin
INSERT INTO [dbo].[doctors]
([doctor_id]
,[doctorname]
,[e_mail]
,[password]
VALUES
((@idCounter +1)
,@docotorname
,@email
,@password
)
SET @Result = 1
set @docId= (@idCounter + 1)
end
END
this code work very well what i want to do now to use ADO instead of LINQ,
the problem with me is that i can't pass the ref variable as in LINQ so
how can i do it using ADO

Tuesday, 27 August 2013

Check database table if row exists, then create it if not

Check database table if row exists, then create it if not

I am trying to check the database if data for a specific date exists. If
it does not exist, then a new row needs to be inserted into the database
for that date. Here's my code so far in php/sql (after db login info), but
I can't get it to work:
// gets two data points from form submission
$tablename = $_GET['tablename'];
$date = $_GET['date'];
//Fetching from your database table.
$query = "IF NOT EXISTS (SELECT * FROM $tablename WHERE date = $date)
BEGIN Insert into $tablename (date, var1, var2) VALUES ('$date', '', '');
END"
$result = mysql_query($query);
Please HELP...

CICOCheckedOutInOtherSession CSOM Project 2013

CICOCheckedOutInOtherSession CSOM Project 2013

I'm trying to edit a custom field using CSOM, but I'm getting a
CICOCheckedOutInOtherSession exception.
Here's a piece of my code:
PublishedProject proj2Edit = projContext.Projects.GetByGuid(new Guid("X"));
projContext.Load(proj2Edit);
projContext.ExecuteQuery();
DraftProject projChechedOut = proj2Edit.CheckOut().IncludeCustomFields;
projChechedOut.SetCustomFieldValue(GetCustomField(fieldName).InternalName,
"Hello");
QueueJob qJob = projChechedOut.Publish(true);
JobState jobState = projContext.WaitForQueue(qJob, timeoutSeconds); <---
ERROR
private static Guid GetCustomFieldId(string fieldName)
{
var cfList = projContext.LoadQuery(projContext.CustomFields.Where(cf
=> cf.Name == fieldName));
projContext.ExecuteQuery();
return cfList.First().Id;
}

how to check equality of dates RAILS

how to check equality of dates RAILS

I have a set of objects and I want to check on which day they are all
available, I started my controller action, but I'm a bit confused about
how i can check it.
this is the piece of code
def add_object
@object = object.find(params[:id])
@object.availabilities.each do |d|
end
do you have any ideas?

javascript funtion need to be continue after settimeout

javascript funtion need to be continue after settimeout

I have a java script funtion.. from that am calling a delay funtion..
function(){
...
...
doDelay();
some other functionality....
}
doDelay(){
setTimeout(function() {alert("after wait");}, 10000);
}
after waiting 10secs alert is coming after wait. but its not again
continue the some other functionality.... of my main function.. After
delay i want to execute the remaining functionality... can you please help
me out

Monday, 26 August 2013

namespace ads not bound

namespace ads not bound

I am trying to add admob to my android app in android studio. I almost
there but am getting the error of:
Namespace 'ads' not bound
Here is also my xml with the ad:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="MY_AD_UNIT_ID"
ads:adSize="BANNER"
ads:testDevices="TEST_EMULATOR,
TEST_DEVICE_ID"
ads:loadAdOnCreate="true"/>
<TextView
android:id="@+id/beerTitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:textSize="20sp"
android:textStyle = "bold"
android:padding="5dip"
>
</TextView>
<ImageView android:id="@+id/image"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:layout_margin="10dip"/>
<TableLayout
android:id="@+id/tableLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:shrinkColumns="*"
android:stretchColumns="*">
<TableRow
android:id="@+id/tableStatTitles"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dip" >
<TextView
android:id="@+id/abvTitle"
android:text="ABV"
android:gravity="center"
android:textStyle = "bold"
android:textSize="20sp"
android:layout_weight="1"
></TextView>
<TextView
android:id="@+id/IBUTitle"
android:text="IBU"
android:gravity="center"
android:textStyle = "bold"
android:textSize="20sp"
android:layout_weight="1"
></TextView>
<TextView
android:id="@+id/glassTitle"
android:text="Glass"
android:gravity="center"
android:textStyle = "bold"
android:textSize="20sp"
android:layout_weight="1"
android:layout_width="wrap_content"
></TextView>
</TableRow>
<TableRow
android:id="@+id/tableStat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dip" >
<TextView
android:id="@+id/abv"
android:text=""
android:gravity="center"
android:textSize="15sp"
android:layout_width="wrap_content"
></TextView>
<TextView
android:id="@+id/IBU"
android:text=""
android:gravity="center"
android:textSize="15sp"
android:layout_width="wrap_content"
></TextView>
<TextView
android:id="@+id/glass"
android:text=""
android:gravity="center"
android:textSize="15sp"
android:layout_width="wrap_content"
></TextView>
</TableRow>
</TableLayout>
<View
android:layout_width="1dp"
android:layout_height="30dp">
</View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Average Rating: "
android:textStyle = "bold"
android:textSize="20sp"
/>
<TextView
android:id="@+id/beerRating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="20sp"
/>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="30dp">
</View>
<Button
android:id="@+id/buttonBrewery"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dip"
android:text=""
android:onClick="viewBrewery"
/>
<Button
android:id="@+id/buttonStyle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dip"
android:text=""
android:onClick="viewStyle"
/>
<View
android:layout_width="1dp"
android:layout_height="30dp">
</View>
<TextView
android:id="@+id/yourPortfolio"
android:textStyle = "bold"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:textSize="20sp"
android:text="Your Portfolio:"
android:padding="5dip"
></TextView>
<LinearLayout
android:id="@+id/addBeerLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
</LinearLayout>
<TextView
android:id="@+id/beerDescriptionTitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:padding="5dip"
android:text="Description:"
android:textSize="20sp"
android:textStyle="bold" >
</TextView>
<TextView
android:id="@+id/beerDescription"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:textSize="15sp"
android:padding="5dip"
></TextView>
<Button
android:id="@+id/buttonTasteTag"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dip"
android:text="Taste Profile"
android:onClick="viewTasteTags"
/>
</LinearLayout>
</ScrollView>

Excel Save Notification for a Shared File

Excel Save Notification for a Shared File

I have a shared file in excel. This is how it was defined in VBA when it
was created:
AccessMode:=xlShared,
ConflictResolution:=Excel.XlSaveConflictResolution.xlLocalSessionChanges
When a user makes a change to the shared file and saves it, I would like
make a program which makes a pop up msg or something to notify all users
immediately that the file has been changed. How is this possible?

Random Questions in Quiz system using Random function in C#

Random Questions in Quiz system using Random function in C#

I am working on quiz system in C# and I want to show random questions for
different users. If I am using a SQL database on the backend how would I
go about doing this?

Iframe FancyBox 2.1.4 in Firefox

Iframe FancyBox 2.1.4 in Firefox

I have problems with the Firefox. It opens a FancyBox but no with the
original dimensions. Please Can you help me?

Get Tap action on push

Get Tap action on push

I am showing push notification in my application. Now i want to make some
actions only when user tap on push notification in the notification drop
down screen. So can anyone guide me how to get tap action on push
notification. I cannot use given below method because it is called when a
push is received.
- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo
Thanks in advance.

MenuItemCompat.getActionView always returns null

MenuItemCompat.getActionView always returns null

I just implemented the v7 AppCompat support library but the
MenuItemCompat.getActionView always return null in every Android version I
tested (4.2.2, 2.3.4 ....)
The SearchView is displayed in action bar but it doesn't respond to touch
actions and doesn't expand to show its EditText and is just like a simple
icon.
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, menu);
MenuItem searchItem = menu.findItem(R.id.action_search);
SearchView searchView = (SearchView)
MenuItemCompat.getActionView(searchItem);
if (searchView != null) {
SearchViewCompat.setOnQueryTextListener(searchView,
mOnQueryTextListener);
searchView.setIconifiedByDefault(false);
Log.d(TAG,"SearchView not null");
} else
Log.d(TAG, "SearchView is null");
return super.onCreateOptionsMenu(menu);
}
Menu.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/action_search"
app:showAsAction="always|collapseActionView"
android:icon="@drawable/abc_ic_search"
android:title="@string/action_bar_search"
android:actionViewClass="android.support.v7.widget.SearchView"
/>
<item android:id="@+id/action_refresh"
android:icon="@drawable/refresh"
android:title="@string/action_bar_refresh"
app:showAsAction="ifRoom"
/>
</menu>

Sunday, 25 August 2013

Boot from a partition (Windows 8)

Boot from a partition (Windows 8)

I'm currently running Windows 8 on an HP Pavilion g7 laptop and I tried
installing Ubuntu 13.04 from my flash drive just recently.
Installation went as normal and I created a 50 GB partition for it. At the
end it said I needed to reboot so I pressed OK. A few seconds later an
error message popped up and said there was an error and I needed to reboot
(or I could stay at the desktop and debug or something). I clicked stay at
desktop but it kicked me out into a command line and I really couldn't do
anything there so I just held the power button and shut it off. Now I have
the partition made (it shows up in Windows as the G: drive), I just have
no way to access it without booting from live disk/usb.
Is there some way I can pick which partition to boot from when I power my
laptop on?
Edit: Don't know if it helps much but I remember my caps lock key flashing
when I was stuck at the command line thing. (Maybe someone will know what
I was at from this?)

Image does not appear in JPanel using BufferedImage

Image does not appear in JPanel using BufferedImage

I have a GUI with a created JPanel and a "Start" button. All I need is
when I click "Start", an image will be loaded and appear on that JPanel.
But my problem is when I click "Start", nothing happens. Can anyone help
me fix this problem? Here is my code:
private BufferedImage image;
public class ImagePanel extends JPanel {
public ImagePanel() {
try {
image = ImageIO.read(new
File("C:\\Users\\HienTran\\Desktop\\Miranda-Kerr-16-240x320.jpg"));
} catch (IOException ex) {
// handle exception...
}
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.drawImage(image, 0, 0, null);
}
}
private void startBtnActionPerformed(java.awt.event.ActionEvent evt) {
stopBtn.setEnabled(true);
startBtn.setEnabled(false);
imageArea.add(new ImagePanel()); // imageArea is the JPanel in the GUI
}
When I replace 2 lines of imageArea by creating a new JFrame as below,
that JFrame shows up with the image I added.
private void startBtnActionPerformed(java.awt.event.ActionEvent evt) {
stopBtn.setEnabled(true);
startBtn.setEnabled(false);
JFrame test = new JFrame("Window");
test.add(new ImagePanel());
test.setSize(image.getWidth(), image.getHeight() + 30);
test.setVisible(true);
}

Math problem homework

Math problem homework

Hey I got this homework to do, and I am not sure on how to solve it.
How can you solve it with everything being variables and no equals value?
$$-2b(a-3b)+(b-a)b$$
Is it possible?

Trying to store an object in localStorage

Trying to store an object in localStorage

I'm trying to save some data to localStorage but for some reason all I get
is an empty array.
var saveData = JSON.parse(localStorage.saveData || null) || {};
function saveGame() {
saveData.buildings = "buildings";
saveData.resources = resources;
saveData.time = new Date();
localStorage.saveData = JSON.stringify(saveData);
}
JSON.stringify(saveData) returns [] and
SaveData returns something weird when I put it on watch:
Array[0]
- buildings: "buildings"
- length: 0
- resources: Object
- time: <time>
- __proto__: Array[0]
What am I doing wrong?

How to store images in FireMonkey?

How to store images in FireMonkey?

In VLC I had ImageList to store images. In FireMonkey there is no
ImageList control. How do I store images in FireMonkey for later use?

Saturday, 24 August 2013

get contents of div and post to db from ajax Actionlink mvc4

get contents of div and post to db from ajax Actionlink mvc4

This code retrieves clicked items and updates a div on a page that has a
submit button in it. How do I get the contents of that div, post to db and
return to previous page?
I know it's a lot but I can't get a grip on posting with Ajax.
$(".ITA").on("click", "li", function () {
var div = $("#AddedItems");
var parent = $(this).closest("ul");
var itemtoadd = parent.find("[data-id]").attr("data-id");
var name = parent.find("[data-name]").attr("data-name");
alert(itemtoadd + name);
//how to get these and post to db?
var itemtoadd = ("<li class = " + itemtoadd + ">" + name + "</li>");
alert(itemtoadd); //for debug
$(itemtoadd).appendTo(div);
});
I didn't get far with the link
@Ajax.ActionLink(
"Submit", "PostToDb",
new AjaxOptions {
HttpMethod = "POST",
//what to do with data:?
})

NullPointerException on addPropertyChangeListener

NullPointerException on addPropertyChangeListener

I have created a simple LED that receives an input from any of a number of
digital components such as switches/gates. The problem is that when trying
to implement the PropertyChangeListener interface I get a
NullPointerException. With the code below if I just add this to a JFrame
form and try and run it I get this exception. I have implemented the LED
the same as I did for gates/switches however for some reason my code
generates an error. Any help appreciated.
package Digital;
import java.awt.Image;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
public class LED extends javax.swing.JPanel implements
PropertyChangeListener {
private Image led_on;
private Image led_off;
private Image image;
private Terminal input;
private transient PropertyChangeSupport propertyChangeSupport = new
PropertyChangeSupport(this);
public LED() {
java.net.URL url_on = getClass().getResource("images/LED_on.gif");
led_on = new javax.swing.ImageIcon(url_on).getImage();
this.setSize(led_on.getWidth(null), led_on.getHeight(null));
java.net.URL url_off = getClass().getResource("images/LED_off.gif");
led_off = new javax.swing.ImageIcon(url_off).getImage();
this.setSize(led_off.getWidth(null), led_off.getHeight(null));
this.image = led_off;
}
@Override
public void paintComponent(java.awt.Graphics g) {
g.drawImage(image, 0, 0, null);
}
public static final String PROP_INPUT = "input";
public Terminal getInput() {
return input;
}
public void setInput(Terminal input) {
if (input != null) {
input.addPropertyChangeListener(this);
this.addPropertyChangeListener(this);
}
Terminal oldInput = this.input;
this.input = input;
propertyChangeSupport.firePropertyChange(PROP_INPUT, oldInput,
input);
}
public void addPropertyChangeListener(PropertyChangeListener listener) {
propertyChangeSupport.addPropertyChangeListener(listener);
}
public void removePropertyChangeListener(PropertyChangeListener
listener) {
propertyChangeSupport.removePropertyChangeListener(listener);
}
public boolean Recalculate(Terminal input) {
if (input!=null) {
return input.getValue();
} else {
return false;
}
}
public void ledChange(boolean ledValue) {
if (ledValue) {
image = led_on;
} else {
image = led_off;
}
repaint();
}
public void propertyChange(PropertyChangeEvent pce) {
boolean terminalValue = Recalculate(input);
ledChange(terminalValue);
}
}

Android - BroadcastReceiver doesn't receive custom intent

Android - BroadcastReceiver doesn't receive custom intent

I have:
MyApp extends Application with onCreate:
sendBroadcast(refreshAlarm);
Log.d(TAG, "broadcast sent with intent " + refreshAlarm);
Log.d(TAG, "onCreate");
where
static final Intent refreshAlarm = new Intent(ACTION_REFRESH_RECEIVER);
public static final String ACTION_REFRESH_RECEIVER =
"com.example.myapp.REFRESH_RECEIVER";
BroadcastReceiver with on Receive:
Log.d(TAG, "broadcast received with intent " + intent);
// do some work here
declared in manifes:
<receiver android:name="com.example.myapp.RefreshReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="com.example.myapp.REFRESH_RECEIVER" />
</intent-filter>
</receiver>
It seems to me that I have all I need to make this work. Broadcast is send
in onCreate (I can see in log it is indeed send). Broadcast is declared
with intent filter to receive refreshAlarm intent, but it doesn't receive
it and I cannot figure out why. Do I need anything else?

How to restore SVN after IDEA crash during commit?

How to restore SVN after IDEA crash during commit?

During commit to the SVN server, my IDEA was forcibly killed by the OS
(Ubuntu got frozen and I had to restart the system). After restart, I got
a task-bar message like SVN changes update error or something like that.
I've noticed this error at the very end and it disappeared after a few
seconds.
After that I lost all SVN icons. I cannot either updater or commit to SVN.
How to restore this so that IDEA can again recognize .svn folder in my
sources?
I can only guess that some lock file remained undeleted but I was not able
to find and delete it.

Wordpress custom plugin widget jQuery val function not updating DOM

Wordpress custom plugin widget jQuery val function not updating DOM

I've got below code:
<form action="" method="post">
<div class="widget-content">
<p>
Youtube video will be displayed in this area. Please ensure
you input Youtube ID. Default width and height will be applied
if no values are provided on these fields.
</p>
<p>
<label for="widget-commstrat-youtube-2-title">Title:</label>
<input id="widget-commstrat-youtube-2-title"
name="widget-commstrat-youtube[2][title]" value=""
style="width:90%;">
</p>
<p>
<label for="widget-commstrat-youtube-2-youtube_id">Youtube
ID:</label>
<input id="widget-commstrat-youtube-2-youtube_id"
name="widget-commstrat-youtube[2][youtube_id]" value=""
style="width:90%;">
</p>
<p>
<label for="widget-commstrat-youtube-2-width">Width:</label>
<input id="widget-commstrat-youtube-2-width"
name="widget-commstrat-youtube[2][width]" value=""
style="width:90%;">
</p>
<p>
<label for="widget-commstrat-youtube-2-height">Height:</label>
<input id="widget-commstrat-youtube-2-height"
name="widget-commstrat-youtube[2][height]" value=""
style="width:90%;">
</p>
<p>
<input id="upload_image" type="text" size="36"
name="widget-commstrat-youtube[2][image_url]" value="http://">
<input id="upload_image_button" class="button" type="button"
value="Upload Image">
<br>Enter a URL or upload an image
</p>
</div>
<input type="hidden" name="widget-id" class="widget-id"
value="commstrat-youtube-2">
<input type="hidden" name="id_base" class="id_base"
value="commstrat-youtube">
<input type="hidden" name="widget-width" class="widget-width"
value="200">
<input type="hidden" name="widget-height" class="widget-height"
value="350">
<input type="hidden" name="widget_number" class="widget_number"
value="2">
<input type="hidden" name="multi_number" class="multi_number" value="">
<input type="hidden" name="add_new" class="add_new" value="">
<div class="widget-control-actions">
<div class="alignleft">
<a class="widget-control-remove" href="#remove">Delete</a> |
<a class="widget-control-close" href="#close">Close</a>
</div>
<div class="alignright">
<input type="submit" name="savewidget"
id="widget-commstrat-youtube-2-savewidget" class="button
button-primary widget-control-save right" value="Save">
<span class="spinner"></span>
</div>
<br class="clear">
</div>
</form>
I use jQuery('#upload_image').val('test'); to update but DOM is never
getting updated. This means I cannot see the change in the clientside on
my browser. All other fields get updated with same method without any
issues.
What could be wrong with this?

How to disable slashdot autorefresh?

How to disable slashdot autorefresh?

It has annoyed me for ages that when I'm reading the slashdot main page,
from time to time new stories are automatically loaded, pushing down the
one I'm reading and making me lose my place. Recently it's gotten worse -
instead of using AJAX to update the display it actually loads a whole new
page, http://slashdot.org/?source=autorefresh.
Is there any setting or preference on the site to turn off this annoyance
and put me back in control? (I'd prefer not to resort to installing a
browser extension or using a modifying http proxy)

jQureyRotate plugin set delay

jQureyRotate plugin set delay

$("#image").rotate({ angle:0, center: ["50%", "100%"], duration:5000,
animateTo:15 });
I want to set delay to this.

Friday, 23 August 2013

Store WDRM license with license response

Store WDRM license with license response

how to store a license DRM by using this class
<head>
<script type="text/javascript">
function StoreLic()
{
var license = "<LICENSERESPONSE></LICENSERESPONSE>"
netobj.StoreLicense(license);
}
</script>
</head>
<body onLoad="StoreLicense();">
<object id="netobj"
classid="clsid:A9FC132B-096D-460B-B7D5-1DB0FAE0C062"></object>
You have received your license
</body>
</html>
////* The license response string is too large that's why i have not
posted it
WHENE I EXECUTE THIS USING INTERNET EXPLORER IT SAYS THAT ERROR ON LINE :
netobj.StoreLicense(license);
it does not understand the function that store the lisence
may i add some library to ASP .net page or somethings???
thanks for your helps !

Implicit dependency between BeanNameAutoProxyCreator and imported configuration

Implicit dependency between BeanNameAutoProxyCreator and imported
configuration

At my company, we're working on an aspect-oriented trace interceptor,
similar to DebugInterceptor. We're configuring a
CustomizableTraceInterceptor and using a BeanNameAutoProxyCreator to
auto-proxy beans for AOP.
The problem we're facing is that, when we introduce the
BeanNameAutoProxyCreator in the configuration:
@Configuration
@Import(BConfig.class)
@EnableAspectJAutoProxy
public class AConfig {
@Bean
public static BeanNameAutoProxyCreator beanNameAutoProxyCreator() {
BeanNameAutoProxyCreator beanNameAutoProxyCreator = new
BeanNameAutoProxyCreator();
beanNameAutoProxyCreator.setInterceptorNames(new String[]
{DEBUG_INTERCEPTOR_NAME});
beanNameAutoProxyCreator.setBeanNames(new String[]
{BEANS_NAMES_EXPRESSION});
return beanNameAutoProxyCreator;
}
}
We get a org.springframework.beans.factory.NoSuchBeanDefinitionException:
No qualifying bean of type [X], where X is a Resteasy Proxy. This Resteasy
Proxy is declared in BConfig.
Now, if I move the Resteasy Proxy bean configuration up to AConfig, this
issue is solved, and @DependsOn solves the issue too.
My questions are 3: when is Spring able to resolve dependencies between
beans? Why using a BeanNameAutoProxyCreator changes this behavior? What is
the recommended way of solving this issue (BeanPostProcessor, @DependsOn,
etc.).

Directory For C# Library Download

Directory For C# Library Download

I am trying to set up the MongoDB c# plugin on my computer. I use visual
studio 2010 to code. Where is the best place to save the extracted zip
file? In the folder that I use for development or is their a specific file
path for this type of library?
Thanks in advance.

Filter a list inside an observablecollection

Filter a list inside an observablecollection

How to filter a list inside an observablecollection with the following code:
Addresses.Repopulate((Repository.Addresses).Where(x => x.Types.));
Types can only contain id 7 or id 8.
Any Idea's?
Greets

system of 1st order ODE's

system of 1st order ODE's

Given is the system of first order ODEs with initial value:
$x'(t)=\left(\begin{matrix}2 & 0 & 0\\ 1 & \alpha & \beta\\ 3 & \gamma > &
>
\alpha\end{matrix}\right)x(t)+\left(\begin{matrix}e^{3t}\\e^{3t}\\-e^{3t}\end{matrix}\right),x(0)=\left(\begin{matrix}1\\2\\-2\end{matrix}\right)$
Determine $\alpha,\beta, \gamma\in\mathbb{Z}$ so that
$\left(\begin{matrix}0\\e^{3t}cos(t)\\-e^{3t}sin(t)\end{matrix}\right)$ is
a solution of the homogeneus system.
Determine the solution of the initial value problem, with the
$\alpha,\beta, \gamma\in\mathbb{Z}$ from question 1.
Find a solution to the initial value problem using the solution in
question 2.
$x'(t)=\left(\begin{matrix}2 & 0 & 0 & 0\\ 1 & \alpha & 0 &\beta\\ >
\frac{9}{(t+1)^{2}} & 0 & -\frac{3}{(t+1)} & 0\\ 3 & \gamma & 0 & >
\alpha\end{matrix}\right)x(t)+\left(\begin{matrix}e^{3t}\\e^{3t}\\0\\-e^{3t}\end{matrix}\right),x(0)=\left(\begin{matrix}1\\2\\3\\-2\end{matrix}\right)$
Notice that the matrix has non-constant coëfficiënts on the 3th row, and
column 3 of the matrix contains zeros except on the 3th place in this row.
My solution:
question 1:
$x'(t)=\left(\begin{matrix}2 & 0 & 0\\ 1 & \alpha & \beta\\ 3 & \gamma &
\alpha\end{matrix}\right)x(t)$
$x(t)=\left(\begin{matrix}0\\e^{3t}cos(t)\\-e^{3t}sin(t)\end{matrix}\right)\longrightarrow
x'(t)=\left(\begin{matrix}0\\3e^{3t}cos(t)-e^{3t}sin(t)\\-3e^{3t}sin(t)-e^{3t}cos(t)\end{matrix}\right)$
so
$x'(t)=A\cdot x(t)$
and
$0=2\cdot 0$
$3e^{3t}cos(t)-e^{3t}sin(t)=1\cdot 0+\alpha\cdot e^{3t}cos(t) -\beta\cdot
e^{3t}sin(t)$
$-3e^{3t}sin(t)-e^{3t}cos(t)=3\cdot 0 + \gamma\cdot e^{3t}cos(t) -
\alpha\cdot e^{3t}sin(t)$
That gives us: $\gamma =-1$, $\alpha=3$ and $\beta=1$
and
$A=\left(\begin{matrix}2 & 0 & 0\\ 1 & 3 & 1\\ 3 & -1 & 3\end{matrix}\right)$
Question 2:
First i find the solution to the homogeneous problem:
the eigenvalues and eigenvectors for the matrix A are:
$r_{1}=2$, $\varepsilon_{1} =\left(\begin{matrix}2\\
2\\-1\end{matrix}\right)$, $r_{2}=3-i$,
$\varepsilon_{2}=\left(\begin{matrix}0\\ 1\\i\end{matrix}\right)$,
$r_{3}=3+i$, $\varepsilon_{3}=\left(\begin{matrix}0\\
1\\-i\end{matrix}\right)$
Then i transform $\varepsilon_{2}e^{r_{2}t}$ and
$\varepsilon_{3}e^{r_{3}t}$ to real functions. The solution of the
homogeneous problem is:
$\left(\begin{matrix}x_{1}(t)\\x_{2}(t)\\x_{3}(t)\end{matrix}\right)=C1\cdot\left(\begin{matrix}2\\2\\-1\end{matrix}\right)\cdot
e^{2t}+C2\cdot\left(\begin{matrix}0\\cos(t)\\-sin(t)\end{matrix}\right)\cdot
e^{3t}+C3\cdot
\left(\begin{matrix}0\\sin(t)\\cos(t)\end{matrix}\right)\cdot e^{3t}$
How do i find the particular solution to this problem??
question 3:
How do i solve this problem?? It is obvious that i have to do something
with that 3th row, but still i do not have a clue...

Thursday, 22 August 2013

string manipulation to split and display in reverse order. [on hold]

string manipulation to split and display in reverse order. [on hold]

pEasy way to display this string (Hopkins, John) into (John Hopkins). Easy
solution in C# will be appreciated. Looking for a generic method call that
can split and present this data in the format looking for. /p

Switch Statement not working?

Switch Statement not working?

I know im doing something wrong but I really cant figure out what it is,
What I am trying to accomplish is have the switch statement know if One
ImageView is gone then let me know one is gone. and move to number 2 if
two image views are gone then move to number three. It works with number
one but doesn't move two number two if a write this code here
WORKING CODE
if (numOne == ImageView.GONE) {
Toast.makeText(.......).show()
}
if (numTwo == ImageView.GONE + 2) {
Toast.makeText(.......).show()
}
I understand that it wont flow through the if statement if the first
statement is true, and that's why I need a switch statement so it goes
through all of them
here is my SWITCH STATEMENT
int numOne = ImageView.GONE;
int numTwo = ImageView.GONE + 2;
int numThree = ImageView.GONE + 3;
int numFour = ImageView.GONE + 4;
int numFive = ImageView.GONE + 5;
int numSix = ImageView.GONE + 6;
int numSeven = ImageView.GONE + 7;
int numEight = ImageView.GONE + 8;
int numNine = ImageView.GONE + 9;
int numTen = ImageView.GONE + 10;
switch (iGone = 0){ //tried using switch (ImageView.GONE) didn't work
case 1:
if (numOne == ImageView.GONE) {
Toast.makeText(this, "One Gone Now Put two in the
basket", Toast.LENGTH_LONG).show();
};
break;
case 2:
if (numTwo == ImageView.GONE + 2){
Toast.makeText(this, "Two Gone Now Put Three in the basket",
Toast.LENGTH_LONG).show();
};
break;
case 3:
if (numThree == ImageView.GONE + 3) {
Toast.makeText(this, "Three Gone Now Put Four in the
basket", Toast.LENGTH_LONG).show();
}
break;
case 4:
if (numFour == ImageView.GONE + 4){
Toast.makeText(this, "Four Gone Now Put Five in the basket",
Toast.LENGTH_LONG).show();
}
break;
case 5:
if (numFive == ImageView.GONE + 5) {
Toast.makeText(this, "Five Gone Now Put two in the basket",
Toast.LENGTH_LONG).show();
}
break;
}
again what I am trying to accomplish is When one ImageView is gone let me
know and tell me that one is gone then move on two starting from 0 and
counting up to TWO, then once you finish number two start at 0 again and
count to number 3 ect......

why the "open" command runs under the home directory?

why the "open" command runs under the home directory?

Under Mac OSX (Mountain Lion), I have a shell script "a":
#!/bin/bash
open -a Terminal b
which run another shell script "b" using Terminal:
echo `pwd`
Something interesting is that, no matter where my running scripts are
located, the pwd command in "b" always returns the home directory.
Questions:
Why does this happen?
How to set the running environment to be the working instead home
directory (ie, return the working directory when arriving at pwd)

Wrong result in takePicture callback method of cordova camera API

Wrong result in takePicture callback method of cordova camera API

I have build one worklight application in Worklight v6 which uses cordova
API version 2.6
I used the sample provided at this location
http://docs.phonegap.com/en/2.6.0/cordova_camera_camera.md.html#Camera
navigator.camera.getPicture(OnSuccess,OnFail,
{quality:50,destinationType:Camera.DestinationType.NATIVE_URI,sourceType:Camera.PictureSourceType.CAMERA,saveToPhotoAlbum:true});
Even when I am using NATIVE_URI result I am getting in OnSuccess method is
file:// uri instead of content://uri as written on documentation.
Camera.DestinationType = {
DATA_URL : 0, // Return image as base64 encoded string
FILE_URI : 1, // Return image file URI
NATIVE_URI : 2 // Return image native URI (eg.
assets-library:// on iOS or content:// on Android)
};

Create a XML-File in an exception safe and memory friendly way?

Create a XML-File in an exception safe and memory friendly way?

i want to write a Logger/Bug-Tracker (XML) for my current project. I'm
sorry if it should be a duplicate, but the proposals were not useful and i
did not found a good google solution too.
1: My first question is about exception safety.
If i use a XmlDocument the loggs are stored in memory till i call save.
That means i could lose everything in case of an exception.
If i use a XmlWriter it's not stored in memory (afaik) but i have to close
the writer and all elements / nodes which may be a lack in case of an
exception too. Can i close and re-open the writer (with the pointer at the
end of the document) ?
What's the best solution for an exception-safe XML creation ? (I only need
a hint)
2: My second question is about memory usage.
Because it's a tracing tool the output can be very huge. Therefore i can't
use XmlDocument. In my opinion the XmlWriter would be the best solution
for this. Am i right with this ?
3: My last [minor] question is about time consumption.
Is it a good or bad idea to use a XML file for tracing? How much does it
slow down my program ?
I hope you can help me.
Best regards Alex

GET CRASH LOG THROUGH INSTRUMENTS

GET CRASH LOG THROUGH INSTRUMENTS

I'm running some scripts in UIAutomation(Instrumnets /terminal). Assume on
clicking on table cell in a UITableView the app crashes.
Currently the script is stopped since the app is crashed. My question here
is how to get crash log info through instrumnets using JavaScripts
Is there any possibility to export the logs and save in location
automatically ?
P.S I understand that crash log can viewed manually in Xcode. We can also
cross verify using time stamp.

Wednesday, 21 August 2013

IIS bandwidth Monitoring

IIS bandwidth Monitoring

I have a public MS CRM 2011 install and one of my remote users reported
using about 10gig of data from there outlook client.
Is it possible in real time to see connected users in IIS and how much
data they are consuming ? (Dedicated server no other users on it)
I don't have access to the external firewall so all monitoring would have
to be taken off the local IIS server. Perfmon I think can do this but
wanted to see if there where any other ways of doing this.

illegal call of non-static member function

illegal call of non-static member function

I'm having trouble with this function below:
char* GetPlayerNameEx(int playerid)
{
char Name[MAX_PLAYER_NAME], i = 0;
GetPlayerName(playerid, Name, sizeof(Name));
std::string pName (Name);
while(i == 0 || i != pName.npos)
{
if(i != 0) i++;
int Underscore = pName.find("_", i);
Name[Underscore] = ' ';
}
return Name;
}
declaration:
char* GetPlayerNameEx(int playerid);
usage:
sprintf(string, "%s", CPlayer::GetPlayerNameEx(playerid));
Now my problem here is
"c:\users\tom\documents\visual studio 2010\projects\surreal
roleplay\surreal roleplay\surreal roleplay.cpp(31): error C2352:
'CPlayer::GetPlayerNameEx' : illegal call of non-static member function
c:\users\tom\documents\visual studio 2010\projects\surreal
roleplay\surreal roleplay\player.h(5) : see declaration of
'CPlayer::GetPlayerNameEx'"
If this has anything to do whith it which I doubt it does, this function
is contained within a "Class" header (Declartion).
Also I have no idea why but I can't get the "Code" box to fit over correctly.

FInd a US street address in text (preferably using Python regex)

FInd a US street address in text (preferably using Python regex)

Disclaimer: I read very carefully this thread: Street Address search in a
string - Python or Ruby and many other resources.
Nothing works for me so far.
In some more details here is what I am looking for is:
The rules are relaxed and I definitely am not asking for a perfect code
that covers all cases; just a few simple basic ones with assumptions that
the address should be in the format:
a) Street number (1...N digits); b) Street name : one or more words
capitalized; b-2) (optional) would be best if it could be prefixed with
abbrev. "S.", "N.", "E.", "W." c) (optional) unit/apartment/etc can be any
(incl. empty) number of arbitrary characters d) Street "type": one of
("st.", "ave.", "way"); e) City name : 1 or more Capitalized words; f)
(optional) state abbreviation (2 letters) g) (optional) zip which is any 5
digits.
None of the above needs to be a valid thing (e.g. an existing city or zip).
I am trying expressions like these so far:
pat = re.compile(r'\d{1,4}( \w+){1,5}, (.*), ( \w+){1,5}, (AZ|CA|CO|NH),
[0-9]{5}(-[0-9]{4})?', re.IGNORECASE)
>>> pat.search("123 East Virginia avenue, unit 123, San Ramondo, CA, 94444")
Don't work, and for me it's not easy to understand why. Specifically: how
do I separate in my pattern a group of any words from one of specific
words that should follow, like state abbrev. or street "type ("st., ave.)?
Anyhow: here is an example of what I am hoping to get: Given def
ex_addr(text): # does the re magic # returns 1st address (all addresses?)
or None if nothing found
for t in [
'The meeting will be held at 22 West Westin st., South Carolina, 12345 on
Nov.-18',
'The meeting will be held at 22 West Westin street, SC, 12345 on Nov.-18',
'Hi there,\n How about meeting tomorr. @10am-sh in Chadds @ 123 S.
Vancouver ave. in Ottawa? \nThanks!!!',
'Hi there,\n How about meeting tomorr. @10am-sh in Chadds @ 123 S.
Vancouver avenue in Ottawa? \nThanks!!!',
'This was written in 1999 in Montreal',
"Cool cafe at 420 Funny Lane, Cupertino CA is way too cool",
"We're at a party at 12321 Mammoth Lane, Lexington MA 77777; Come have a
beer!"
] print ex_addr(t)
I would like to get: '22 West Westin st., South Carolina, 12345' '22 West
Westin street, SC, 12345' '123 S. Vancouver ave. in Ottawa' '123 S.
Vancouver avenue in Ottawa' None # for 'This was written in 1999 in
Montreal', "420 Funny Lane, Cupertino CA", "12321 Mammoth Lane, Lexington
MA 77777"
Could you please help?

C++ Circular Linked List : remove element

C++ Circular Linked List : remove element

I am done with insertion, search in circular linked list but for removal I
am getting compiler errors...
Following is my structure for nodes.
struct node
{
int p_data;
struct node* p_next;
node(node* head, int data)
{
p_next = head;
p_data = data;
}
explicit node(int data)
{
p_next = nullptr;
p_data = data;
}
};
node* remove_circular(node* head, node* target)
{
if (head == target->p_next)
{
delete head;
return nullptr;
}
auto next_pointer = target->p_next;
target->p_data = next_pointer->p_data;
target->p_next = next_pointer->p_next;
delete p_next;
return target;
}
and in main function I call
head = remove_circular(head, head);
head = remove_circular(head, temp);
this is to remove head element and another element that temp points to.
But I am getting errors
Anybody has any idea to remove one element from circular list??

What can normal users do to protect sensitive content?

What can normal users do to protect sensitive content?

Given it's 2013 and we're thrown into the 'Post-Snowden' era, I'd like to
know
a) if there are simple yet effective measures that can be taken to protect
sensitive content/communication, where 'protect' basically means 'no-one
except the content producer and eventually the communicatee should be able
to read the content, ever'
b) if there is already a potential risk with the way the
content/cummunication happens now.
Here are a couple of examples of content/communication:
design documents etc now stored on Dropbox
code now stored on a private git server (basic ssh public key ath) and
also pushed to BitBucket
some stuff is stored on google Drive and SkyDrive as well
copies of all of the above reside on multiple machines, all with
unencrypted harddrives
copies of most of the above are also accessed by smartphones, so stored
there as well by the corresponding apps
sometimes sensitive information gets sent over SMS
mail is sent using a variety smartphone apps/webmail/desktop apps. The
apps connect through TLS (not even sure if that matters) but the mails
themselves are always unecrypted and using apps means it gets also stored
as plain text on a lot of machines (eg Opera mail stores a ton of mbs
files containing plain html of every mail)
from time to time we use a plain usb/firewire drive to pass content

Is standard C mktime thread safe on linux?

Is standard C mktime thread safe on linux?

The man page of mktime didn't mention thread safety of mktime, but it did
mention this which make it look like thread unsafe:
Calling mktime() also sets the external variable tzname with information
about the current time zone.
I know on Linux mktime calls tzset to set tzname, which is a char*[]:
extern char *tzname[2];
and tzset will read environment variable TZ and file /etc/localtime. So
unless mktime uses a mutex to protect all these operations, I can't see
how it can be thread safe.

How to define a global directive that can work like ng-model?

How to define a global directive that can work like ng-model?

The most related question I can find on SO is "How to share a single
Directive across multiple modules in AngularJS". But I need something a
little different. I need something that can work more or less like
ng-model. The page does not need to have a named ng-app.
Here is the real problem I want to solve: I would like to define some
template as samples that shows good accessibility. For example, the label
for a required form field, should have arterisk (*). However, I don't want
to force the users to define a named module in the JS file. Instead, they
can just add ng-app(without name) to the html or body tag and include my
JS file.

Tuesday, 20 August 2013

how to use method inside method of a constructor?

how to use method inside method of a constructor?

method.getTotalDays = function(){
return (this.longi-this.age)*365;
}
method.eatPercent = function(){
return this.eat/24;
}
In my next method within this constructor, I want to calculate the days
that "eating process" costs in my life. For example, I want to have a
method like this:
method.getEatingDays = function(){
var days = 0;
days = eatPercent*totalDays; //How do I get eatPercent and totalDays by
using the established
//methods?
}

Store PHP Page output in Memcached

Store PHP Page output in Memcached

I'm generating user profile using a PHP Script - post PHP processing its
all HTML.
How can I direct this output into memcached?
I know how to save a PHP variable into memcached using set but how to I
save a large snippet of HTML?
Do I somehow save this HTML to a variable and then set this into Memcached?
thanks

Trying to get the first match as a username with a RewriteRule

Trying to get the first match as a username with a RewriteRule

I can't find the way to get the first mach after the slash as a user in
every URL request, for example:
http://mysite.com/USER/modules/test/script.php
to --> http://mysite.com/modules/test/script.php?u=USER
or
http://mysite.com/USER/modules/test/path/to/other/script.php
to http://mysite.com/modules/test/path/to/other/script.php?u=USER
I dont know if it's possible, but I think it must be. This is my .htaccess
after several tries:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^http://mysite\.com/(.+?)$
RewriteRule ^.*$ http://mysite.com/$0?u=%1 [R,L]
Where %1 is the username after the first slash, and $0 is the variable
real path to each script.
Thanks in advance and sorry for my poor inglish!

Float right is floating left?

Float right is floating left?

I have two arrow nav items that I want to float left and right and they
are positioned absolutely and have a higher z-index than everything on the
page. But I'm having an issue.
<div id="slider-nav">
<a href="#" id="next"></a>
<a href="#" id="prev"></a>
</div>
Then I have the CSS where I want the two items to float left or right.
#next {
display: block;
width: 8px;
height: 12px;
background-image:url(images/next.png);
z-index: 999;
position: absolute;
float: right;
}
#prev {
display: block;
width: 8px;
height: 12px;
background-image:url(images/prev.png);
z-index: 999;
position: absolute;
float: left;
}
#slider-nav {
width: 100%;
height: 12px;
position: absolute;
z-index: 100;
}
What happens is that the block that SHOULD float right ends up floating
left on top of the left floating block. I tried adding the clear fix after
the floating elements and inside the container div to no avail.

Issue with RackTables Browser Install

Issue with RackTables Browser Install

I am currently working on a project of installing a RackTables
application. I started off by building a LAMP Server on Linux Ubuntu 12.04
LTS. I followed the instructions from the RackTables Wiki. When it came to
the part of browser install where one enters http://ip.address/racktables,
the web server shows directory paths and folders instead of RackTables
installation steps of 1 - 6.
Any ideas on what I missed out? Your response and assistance will be
greatly appreciated.

Refreshing eclipse-project at the end of a maven build

Refreshing eclipse-project at the end of a maven build

Is there a possibility to refresh the files and folders of a project
within eclipse at the end of a maven build automatically.

Monday, 19 August 2013

How to add Header and Subheader in Gridview

How to add Header and Subheader in Gridview

Could Anyone explain How to add Header and Subheader in Gridview shown in
the below picture!!

Object has no method sort

Object has no method sort

Hello all i am having an issue with php to java and then sorting i have
the following js script
function sortby(param, data)
{
switch (param)
{
case "aplha":
console.log(data);
data.sort();
break;
}
}
The array this is passing is through json_encode and the array looks like so
Array ( [0] => Array ( [Name] => 123456 [Clean_Name] => 123456
[CreateDate] => 1372479841 ) [1] => Array ( [Name] => 123456 [Clean_Name]
=> 123456 [CreateDate] => 1372479841 ) )
However i get the above error when i try to pass it as data.sort() any
ideas ? so stuck

AJAX form submit Codeigniter

AJAX form submit Codeigniter

I'm trying to submit a form using ajax / jquery from a view to my code
igniter model. If a post value has been passed to the model it returns
true.
My view is showing the success message regardless. Could someone please
point out where i'm going wrong?
Here is the function from my controller:
function bookings(){
$this->load->helper('url');
if($_POST):
echo $_POST["name"];
// do database stuff here to save the comment.
// return false if db failed
// else
return true;
endif;
}
Here is the relevant javascript & form from the view:
<div id="booking-form-container" class="fb-dialogue">
<div id="info">Entery your details below to make a group
booking:</div>
<!-- This will hold response / error message from server -->
<div id="response"></div>
<form id="bookingsform" method="post"
action="eventguide/bookings">
<label class="description" for="element_1">Full Name:
</label>
<div>
<input id="name" name="name" class="element text
medium" type="text" maxlength="255" value="<?php echo
$me['first_name'] . ' ' . $me['last_name']; ?>"/>
</div>
<label class="description" for="element_2">Email: </label>
<div>
<input id="element_2" name="element_2" class="element
text medium" type="text" maxlength="255" value="<?php
echo $me['email']; ?>"/>
</div>
<label class="description" for="element_3">Mobile Number:
</label>
<div>
<input id="element_3" name="element_3" class="element
text medium" type="text" maxlength="255" value=""/>
</div>
<label class="description" for="element_5">Choose You're
Event: </label>
<div>
<select class="element select medium" id="element_5"
name="element_5">
<option value="" selected="selected"></option>
<option value="1" >First option</option>
<option value="2" >Second option</option>
<option value="3" >Third option</option>
</select>
</div>
<label class="description" for="element_4">Group Size:
</label>
<div>
<input id="element_2" name="element_4" class="element
text medium" type="number" value="10"/>
</div>
<label class="description" for="element_6">Questions or
Special Requirements? </label>
<div>
<textarea id="element_6" name="element_6"
class="element textarea medium"></textarea>
</div>
</form>
</div>
<script type="text/javascript">
var mydetails = $("#booking-form-container").dialog({autoOpen:
false, modal: true, draggable: true, resizable: false,
bgiframe: true, width: '400px', zIndex: 9999, position:
['50%', 100]});
function showDetailsDialog() {
$("#booking-form-container").dialog("option", "title",
"Group Bookings");
$("#booking-form-container").dialog({buttons: {
"Close": {text: 'Close', priority: 'secondary',
class: 'btn', click: function() {
$(this).dialog("close");
}},
"Confirm Booking": {text: 'Confirm Booking',
priority: 'primary', class: 'btn btn-primary',
click: function() {
$('#bookingsform').submit();
}}
}
});
$("#booking-form-container").dialog("open");
}
$("#bookingsform").submit(function(event) {
event.preventDefault();
dataString = $("#bookingsform").serialize();
$.ajax({
type: "POST",
url: "<?php echo base_url(); ?>eventguide/bookings",
data: dataString,
success: function(data){
alert('Successful!');
}
});
return false; //stop the actual form post !important!
});
</script>

I need to add a custom form size to the local Print Server through code

I need to add a custom form size to the local Print Server through code

I need to add a custom form size to the local Print Server through code. I
would like to do it in a bat file or in C#, or possibly in something else
I can run when running my InstallShield installer.
To better explain, to do this manually, open Devices and Printers and
click on a printer. Then click Print Server Properties. The form below
will open, and you can view/add/delete Forms. I would like to add a new
one here through code (then eventually select this new paper size in the
printers Advanced options).

node.js setTimeout resolution is very low and unstable

node.js setTimeout resolution is very low and unstable

I got a problem with resolution of setTimeout. When I set it to 50 ms, it
varies from 51 to even 80 ms. When I use sleep module, I am able to get
resolution like 50 µs, so what is the setTimeout function problem to get
at least 1 ms? Is there any way to fix/avoid that? The problem with sleep
is that it delays everything even when callback function should be shoot,
it waits... Is there an alternative solution to shoot some events in delay
of exactly 50 ms?

Get all the rows from query result

Get all the rows from query result

I have a stored procedure that returns a boolean. (0 or 1). It returns
multiple rows. my question is how to iterate through all the result.
using (SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["DBReader"].ConnectionString))
{
using (SqlCommand com = new
SqlCommand("Reader.usp_CheckerIsStopped", con))
{
com.CommandType = CommandType.StoredProcedure;
com.Parameters.Add("@fld_UserID", SqlDbType.Int).Value =
this.UserID;
con.Open();
SqlDataReader dr = com.ExecuteReader();
if (dr.Read() == 1)
{
return true;
}
else
{
return false;
}
}
}
It has a error in "dr.Read() == 1".
Error: "Operator == cannot be applied to type bool to int"

Sunday, 18 August 2013

free backup software for windows server [on hold]

free backup software for windows server [on hold]

I'm looking for a free backup software for windows server 2008. I always
have trouble with the built in Windows Server backup 2008 and I'd prefer
to use a free backup software instead.
I'm not too worried about the backup of the OS but I do want to make sure
the data gets revisions and I'll be able to access the drive from another
computer (if possible from a MAC even better).
Any recommendations much appreciated.

what is "virtual box"

what is "virtual box"

I have a "PC" computer and i want to make apps for my iPod touch but apple
wont make it compatible with windows. I was searching the web for how to
run a mac program on a "PC" and I came across this " virtualbox.org" its
basically a virtual mac. but this is my family's "PC" I was wondering if
any has tried it?
if so how much space does it take up (CPU,RAM), is it any good, is there a
virus or not on it, AND most of all will it act like just like another
program, I DON'T WANT TO MESS WITH THE BOOT MENU, will it work for
developing apps
Thanks :)

undefined reference to `soup_session_new'

undefined reference to `soup_session_new'

I am trying to make a get request in vala following this:
https://wiki.gnome.org/Vala/LibSoupSample. I do exactly what it says and
the compiler throws this:
Connection.vala.c:(.text+0x76): undefined reference to `soup_session_new'
collect2: ld returned 1 exit status
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)
And this is the result from pkg-config --libs --cflags libsoup-2.4
-pthread -I/usr/include/libsoup-2.4 -I/usr/include/libxml2
-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
-lsoup-2.4 -lgio-2.0 -lgobject-2.0 -lglib-2.0
I have vala 0.20.1. runing on elementaryos (the newest stable version).
Any ideas?

appcfg.cmd java version; 1.7 installed; 1.6 in path; tells me it needs 1.6 ti yokiad

appcfg.cmd java version; 1.7 installed; 1.6 in path; tells me it needs 1.6
ti yokiad

I try to use this command to deploy my application to appspot.google.com:
c:\a\appeng\bin\appcfg.cmd --use_java7 update c:\a\u3e
Generates the error messsage.
C:\a>c:\a\appeng\bin\appcfg.cmd --use_java7 update c:\a\u3e
Registry key 'Software\JavaSoft\Java Runtime Environment\CurrentVersion'
has value '1.7', but '1.6' is required. Error: could not find java.dll
Error: could not find Java SE Runtime Environment.
I tried setting the path to use the Java 1.6 SDK we downloaded but that
did not help or change any thing.

The web resources talk about what version of Java is used by the
application once it appears on Google's servers; I did not see anything
about the Java version for the upload process including
developers.google.com/appengine/docs/java/gettingstarted/uploading and
developers.google.com/appengine/docs/java/tools/uploadinganapp#Command_Line_Arguments
as well as searching this site specifically and checking google.
Can I deploy an application from the computer in my house without
deinstalling the Java 1.7 I use for other purposes?
Dr. Laurence Leff Associate Professor of Computer Science,
Western Illinois University, Macomb IL 61455 on sabbatical

Youtube api v2: paid-content param not filtering

Youtube api v2: paid-content param not filtering

This has been asked before but not answered afaik. The op of that question
was using js and I am using php, but the problem is the same: the
paid-content parameter does not seem filter out paid-content results.
http://gdata.youtube.com/feeds/api/videos?v=2&q=something&paid-content=false&hl=en&region=US
This "charts" one does seem to filter correctly:
http://gdata.youtube.com/feeds/api/charts/movies/most_recent?v=2&max-results=10&paid-content=false&hl=en&region=US
Perhaps it says somewhere in the api docs that paid-content is meant to
filter only the charts but not videos feeds, and I missed it?

Can I introduce some endnotes from one section at the end of that section and some at the end of another section?

Can I introduce some endnotes from one section at the end of that section
and some at the end of another section?

I want some notes (personal observations or whatever) from each section to
appear at the end of each of those sections. The numbering on these would
be reset at the beginning of each section.
Alongside these, I'd like to have some other endnotes (short biographies
of the people I mention, for instance) that are continuously numbered
throughout all of the document and each of its sections, and that would
appear at the end of one other section (like a "notes" section). I don't
want these to appear at the end of the document.
Is there anyway I can do this?
EDIT
I found this helpful, as it allows me to do what I explained in the second
paragraph.
However, it doesn't seem to be possible to conjugate this with having some
other notes at the end of each section.
I thought that, since these are endnotes, maybe there was a way to put
footnotes at the end of the section, instead of the end of each page. This
would make it possible to do everything that I want. However, it does not
seem to be possible.

Saturday, 17 August 2013

how to extract NSStrings from objective-c code

how to extract NSStrings from objective-c code

I want to extract all the Strings from my codebase and put in an excel
sheet. What is the best way to do that? And how can I do that?
To add on it. I am able to search all the strings in my project using the
following expression:
@"(any)"
where (any) is the pattern available in Xcode search. I am able to search
all the strings. I want to extract all those and put it in a list/excel
sheet. How should I do that?
===EDIT===
2nd Part of my question. I have a string @"abc", How can I replace it to
NSLocalizedString(@"abc", @"abc", nil) using Find/Replace in Xcode?

Javascript referance

Javascript referance

Javascript reference Object please explain this below code

Consider variables
var x,y;
x=5;
console.log(x);//x is 5
y=x;
y=6;
console.log(x);//x is still 5
console.log(y);//y is 6
Out put
x:5
x:5
y:6
But in Object
var x={},y={};
x.a=5;
console.log(x);// x is {a:5}
x=y;
y.a=6;
console.log(x);// x is {a:6} changing y, x is also changed
console.log(y);// y is {y:6}
Output
x:{a:5}
x:{a:6}
y:{a:6}

How to improve selection sort?

How to improve selection sort?

This is more of an academic/homework question?
Would it be better to change
if (index_outer !== index_min) {
$P.swap(arr, index_outer, index_min);
}
to
$P.swap(arr, index_outer, index_min);
and always swap, as this is the special case when index_outer does have
the smallest value? It would be a swap that does nothing, but at the same
time it would not break anything. Because this does not happen often I
suppose, it would reduce the amount of times an if check was used.
$P.swap = function (arr, i, j) {
var temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
};
$P.selectionSort = function (arr) {
var index_outer,
index_inner,
index_min,
length = arr.length;
for (index_outer = 0; index_outer < length; index_outer++) {
index_min = index_outer;
for (index_inner = index_outer + 1; index_inner < length;
index_inner++) {
if (arr[index_inner] < arr[index_min]) {
index_min = index_inner;
}
}
if (index_outer !== index_min) {
$P.swap(arr, index_outer, index_min);
}
}
return arr;
};

Skyrim-Disenchanting [duplicate]

Skyrim-Disenchanting [duplicate]

This question already has an answer here:
Is there a difference in disenchanting strong items vs. weak ones?
[duplicate] 1 answer
not sure how to word this so i will use an example.
Lets say i disenchant a weapon that dose 5 points of stamina damage. i
will be able to add that effect to other weapons but the effect in my
enchantment table will say "5 points of stamina damage"
dose this restrict my potential for the enchantment at all?
Like if i disenchanted a weapon that dose 20 points of stamina damage
instead will my enchantments then be more powerful? or is the power of the
effect based purely on your skill and spent perks in the skill?

Python object oriented design concepts

Python object oriented design concepts

I'm just getting back to programming after a 20 year gap. I thought Python
looked fairly straightforward and powerful, so I have done an online
course and some reading.
I'm now looking at some simple projects to get familiar with the language.
One of the challenges is getting my head around object oriented
programming, which was not around when I last wrote a program.
My first project was to read in a data file containing information about a
share portfolio, do some calculations on each and print a report. I have
this working.
So now I am looking at something more advanced, reading in the data and
storing it, then using the data to provide answers to interactive
questions. My question is how to store the data so it can be accessed
easily.
My first thought was to make a list of lists, eg,
companies = [ ['AMP', 1000, 2.50], ['ANZ', 2000, 17.00], ['BHP', 500,
54.30] ]
This can be accessed in loops easily enough, but the access methods are
not exactly friendly - numbers as indexes instead of names:
companyqty = companies[1][1]
Or for loops:
for company in companies:
if company[0] == 'BHP':
companyqty = company[1]
Then I thought about a dictionary, with the value being a list:
companies = {'AMP':[1000, 2.50], 'ANZ':[2000, 17.00], 'BHP':[500, 54.30] }
companyqty = companies['BHP'][0]
This provides immediate access to any given company, but is still stuck
with the numeric indexes.
So I am wondering how to structure this in an object oriented manner so as
to be able to hold a list of companies and all the associated data, and be
able to access the values conveniently. All my ideas so far just look like
lists or dictionaries as above.
Or is this sort of problem not really suited to an object oriented approach?
Thanks

Possible to start and stop recording audio in xcode on detecting sound through the microphone?

Possible to start and stop recording audio in xcode on detecting sound
through the microphone?

I have trawled a lot of the threads but i cannot find a solution to this
problem.
Im trying to write an app in Xcode 4 where the app listens for sound ,
when it detects it , it records it and when it doesnt detect sound it
stops the recording.
Is this possible?

Issues with proper displaying of a form without border with transparent png through a custom class

Issues with proper displaying of a form without border with transparent
png through a custom class

I was trying to write a class which let me do read and write operation on
multiple files (like 5-10) while locking them from any kind of access.
Everytime I access a file (doesn't matter if for read or write) a new file
with the same name and a different extension is created, so other threads
(belonging to different applications) are notified of the lock (ex.
message.msg -> lock file message.lock created).
Every instance of the application will write in it's own file and read in
all other applications files (including its).
Unfortunately, when I start several instances (like 3-4) of the
application which uses this class, even if at first they look like they're
working, then in a matter or seconds / maybe a couple of minutes it looks
like one thread fails to release a file. This of course blocks the other
threads too which are unable to read that specific file.
I say this because when everything app freezes I can see a permanent .lock
file.
Of course I could put a Lock expire time (which probably would work in
this scenario), but why is this happening? To me this code looks
reasonable, but of course I'm still a newbie...so...is there any mayor
flaw in my ratio?
(Don't be scared by the length of this, they're only 2 functions and they
do pretty much the same thing, except than for the central part)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading;
namespace y3kMessenger
{
static class FileLockAccess
{
public static string[] readAllLines(string path)
{
bool isLocked = false;
string[] toReturn;
string lockPath = path.Replace(Global.msgExtension,
Global.lockExtension);
StreamWriter w;
//locking ...
while (!isLocked)
{
if (!File.Exists(lockPath))
{
try
{
using (w = new StreamWriter(lockPath))
{
w.WriteLine(" ");
}
isLocked = true;
}
catch (Exception e) { }
}
Thread.Sleep(10);
}
//locked, proceed with read
toReturn = File.ReadAllLines(path);
//release the lock
while (isLocked)
{
try
{
File.Delete(lockPath);
}
catch (Exception e) { }
isLocked = false;
}
return toReturn;
}
public static void writeLine(string path, string text, bool append)
{
bool isLocked = false;
string lockPath = path.Replace(Global.msgExtension,
Global.lockExtension);
StreamWriter w;
//locking ...
while (!isLocked)
{
if (!File.Exists(lockPath))
{
try
{
using (w = new StreamWriter(lockPath))
{
w.WriteLine(" ");
}
isLocked = true;
}
catch (Exception e) { }
}
Thread.Sleep(10);
}
//locked, proceed with write
using (w = new StreamWriter(path, append))
w.WriteLine(text);
//release the lock
while (isLocked)
{
try
{
File.Delete(lockPath);
}
catch (Exception e) { }
isLocked = false;
}
}
}
}

Friday, 16 August 2013

more efficient to create static local objects c++

more efficient to create static local objects c++

I'm wondering if the following
void foo()
{
static A var; //A is a class with a constructor
... //stuff done with var
}
is more efficient than
void foo()
{
A var; //A is a class with a constructor
... //stuff done with var
}
since the former would call A's constructor and destructor once rather
than the latter which does it per call of foo. I ask this question
generally across all local objects.

Saturday, 10 August 2013

Where to download dreamweaver with jquerry mobile library (free download) for mac?

Where to download dreamweaver with jquerry mobile library (free download)
for mac?

Today I saw one video in which the guy using dreamweaver with jquery
mobile And he is able to make page quickly and check his work on live .But
He don't give any information from where user can download dreamweaver for
mac ..
Can you please provide a link where I can download dreamweaver free
.Please provide key also so that I can use this good functionality.

headScript()->appendFile has the same behaviour as headScript()->prependFile from view

headScript()->appendFile has the same behaviour as
headScript()->prependFile from view

I ran into some problem. appendFile does not seem to work from the view.
It has the same behaviour if I change it to prependFile.
layout.phtml
<!doctype html>
<html lang="en" dir="ltr">
<head>
<?php
$this->headScript()->appendFile('http://code.jquery.com/ui/1.10.3/jquery-ui.js');
$this->headScript()->appendFile('/theme/javascripts/application.js');
$this->headScript()->appendFile('/js/own.js');
?>
</head>
<body>
<?php echo $this->layout()->content; ?>
<?php echo $this->headScript() ?>
</body>
</html>
index.phtml
<?php $this->headScript()->appendFile('/js/another.js') ?>
output
<!doctype html>
<html lang="en" dir="ltr">
<head>
</head>
<body>
<script type="text/javascript" src="/js/another.js"></script>
<script type="text/javascript"
src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script type="text/javascript"
src="/theme/javascripts/application.js"></script>
<script type="text/javascript" src="/js/own.js"></script>
</body>
</html>
As you can see /js/another.js will be the first js. That's not what I
want, I want to put it as last. Anyone knows what's wrong ?

How to get all meetups I've been to

How to get all meetups I've been to

On Meetup, how can I get a list of meetups I have attended in the past?
Those meetups are the ones for which I have RSVPed with YES.

Friday, 9 August 2013

In Thunderbird how can I use an S/MIME client certificate if it doesn't match my primary account name?

In Thunderbird how can I use an S/MIME client certificate if it doesn't
match my primary account name?

In my Thunderbird settings I have a number of email addresses @domain.tld.
My email provider, however, is @domain2.tld and in order to send emails
from the @domain.tld I connect to my own SMTP server.
Now recently I received an S/MIME client certificate and would like to
make use of it for at least communication with the issuer and whenever the
email address is used to talk with users of the software (the email alias
is a role alias for code signing).
It's no problem to import the client certificate into Thunderbird's
certificate store. It is also possible to configure this under "Account
Settings". See the screenshot:

Now if I configure the client certificate for signing@domain.tld to be
used here, this is bound to the incoming server and all its settings.
However, since the email alias (or "identity") for which the certificate
is valid only exists on the outgoing SMTP server, I don't see how this is
going to help.
Also, when trying to send an S/MIME-signed message via the email alias, I
get the following message box:

I keep getting that message box despite the fact that I configure the
primary account's "Security" with this certificate. So my guess is that
this should be a separate setting somewhere.
Question: how can an email identity for which no incoming server
configuration exists be assigned an S/MIME certificate to use for signing
and encryption?