Why is my format validation failing for permalinks?
I have written an rspec test for checking invalid characters in my permalink:
describe "formatting permalinks when creating a page" do
it "does not allow crazy characters" do
page = create(:page, permalink: '#$%^&*first-title')
expect(page).to have(1).errors_on(:permalink)
end
end
In my page.rb model, I have this validation implemented to make it pass:
class Page < ActiveRecord::Base
validates :permalink, format: {:with => /\A[a-zA-Z-]+\Z/, :on => :save!}
before_create :create_slug
def create_slug
self.permalink = self.permalink.parameterize
end
end
But I get his error:
expected 1 errors on :permalink, got 0
What am I doing wrong? How do I fix this?
Saturday, 31 August 2013
Setting a general collation in SQL databases?
Setting a general collation in SQL databases?
I've worked a bit with mySQL through phpMyAdmin and Chive interfaces and
everytime I set the DB collation to UTF-something, I will always find
tables or fields with latin1_swedish_ci set.
Why does this happen? Neither my mySQL install or OS are in swedish, so
what would be the reason?
I've worked a bit with mySQL through phpMyAdmin and Chive interfaces and
everytime I set the DB collation to UTF-something, I will always find
tables or fields with latin1_swedish_ci set.
Why does this happen? Neither my mySQL install or OS are in swedish, so
what would be the reason?
memcmp multiple BYTEs, data type used?
memcmp multiple BYTEs, data type used?
Im trying to memcmp multiple BYTE's from ASM Instructions but my scanner
keeps coming up with nothing. The returning value from my function
indicates that the BYTEs are not being found.
Called with
const BYTE Pattern[] = {0x33,0xC0,0xF2,0xAE};
DWORD Address = FindPattern(Pattern,sizeof(Pattern));
Function(Shortend)
DWORD FindPattern(const BYTE* Pattern,SIZE_T PatternSize)
{
...
for(int i = 0;i < (ModuleSize - PatternSize);i++)
{
if(memcmp((void*)(ModuleBase + i),Pattern,PatternSize) == 0)
return ModuleBase + i;
}
return 0;
}
Im trying to memcmp multiple BYTE's from ASM Instructions but my scanner
keeps coming up with nothing. The returning value from my function
indicates that the BYTEs are not being found.
Called with
const BYTE Pattern[] = {0x33,0xC0,0xF2,0xAE};
DWORD Address = FindPattern(Pattern,sizeof(Pattern));
Function(Shortend)
DWORD FindPattern(const BYTE* Pattern,SIZE_T PatternSize)
{
...
for(int i = 0;i < (ModuleSize - PatternSize);i++)
{
if(memcmp((void*)(ModuleBase + i),Pattern,PatternSize) == 0)
return ModuleBase + i;
}
return 0;
}
adding namespace in IDL
adding namespace in IDL
I'm trying to add namespace in ATL server project via MIDL. To nest
classes definition generated by wizard in namespace I used MIDL feature
cpp_quote("some string") that MIDL injects into generated files. To build
project I did following:
added cpp_quote("namespace ns {") before first interface declaration in
the IDL file;
added cpp_quote("}") at the end of the idl file;
nested generated by wizard coclasses in the same ns namespace.
added ns:: to LIBID_* name in generated dllmain.h.
What are cons of this approach ?
I'm trying to add namespace in ATL server project via MIDL. To nest
classes definition generated by wizard in namespace I used MIDL feature
cpp_quote("some string") that MIDL injects into generated files. To build
project I did following:
added cpp_quote("namespace ns {") before first interface declaration in
the IDL file;
added cpp_quote("}") at the end of the idl file;
nested generated by wizard coclasses in the same ns namespace.
added ns:: to LIBID_* name in generated dllmain.h.
What are cons of this approach ?
Display matrix in two dimension array
Display matrix in two dimension array
I am newbie in c and trying to display an array in matrix form. I have
seen tutorials, but most of them deal with for loop to apply matrix
concept in a 2-D array. i m using while loop and examining it in my way.
It is although displaying in matrix form but it is not displaying the
accurate output. If i insert numbers 1,2..,9, it must show in the form as
below:
1 2 3
4 5 6
7 8 9
but it is displaying as :
1 2 4
4 5 7
7 8 9
I am unable to understand why it is happening.
#include<stdio.h>
#include<conio.h>
void main()
{
int i=0,j=0;
int arr[2][2];
clrscr();
while(i<=2)
{
j=0;
while(j<=2)
{
scanf("%d",&arr[i][j]);
j++;
}
i++;
}
i=0;
while(i<=2)
{
j=0;
while(j<=2)
{
printf("%d ",arr[i][j]);
//printf("%c",k);
j++;
//k++;
}
printf("\n");
i++;
}
printf("%d",arr[0][2]);
getch();
I am newbie in c and trying to display an array in matrix form. I have
seen tutorials, but most of them deal with for loop to apply matrix
concept in a 2-D array. i m using while loop and examining it in my way.
It is although displaying in matrix form but it is not displaying the
accurate output. If i insert numbers 1,2..,9, it must show in the form as
below:
1 2 3
4 5 6
7 8 9
but it is displaying as :
1 2 4
4 5 7
7 8 9
I am unable to understand why it is happening.
#include<stdio.h>
#include<conio.h>
void main()
{
int i=0,j=0;
int arr[2][2];
clrscr();
while(i<=2)
{
j=0;
while(j<=2)
{
scanf("%d",&arr[i][j]);
j++;
}
i++;
}
i=0;
while(i<=2)
{
j=0;
while(j<=2)
{
printf("%d ",arr[i][j]);
//printf("%c",k);
j++;
//k++;
}
printf("\n");
i++;
}
printf("%d",arr[0][2]);
getch();
Using callIFrameFunction to send multiple args Flex
Using callIFrameFunction to send multiple args Flex
I'm using IFrame to load an gmaps page in my Flex application. I need to
pass latitude and longitude to my javascript function in the html loaded
by the Frame. These are my functions.
Flex:
private function createMarker(event:MouseEvent):void{
var position : Array = [-25, 130];
IFrame.callIFrameFunction('putMarker', position);
}
JS:
document.putMarker= function(latitude,longitude){
var myLatlng = new google.maps.LatLng(longitude, longitude);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Hello World!'
});
}
When i send just one of argument the function works fine, but when i try
to send two or more arguments i fail.
Can anyone help me?
I'm using IFrame to load an gmaps page in my Flex application. I need to
pass latitude and longitude to my javascript function in the html loaded
by the Frame. These are my functions.
Flex:
private function createMarker(event:MouseEvent):void{
var position : Array = [-25, 130];
IFrame.callIFrameFunction('putMarker', position);
}
JS:
document.putMarker= function(latitude,longitude){
var myLatlng = new google.maps.LatLng(longitude, longitude);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Hello World!'
});
}
When i send just one of argument the function works fine, but when i try
to send two or more arguments i fail.
Can anyone help me?
How to show/hide labels customizely in highcharts
How to show/hide labels customizely in highcharts
I have drawn a graph using highcharts.js library. I want the xAxis a
little bit customized. I want to show labels in xAxis but i want to show
one lables then hide next label then again show next label. I mean i want
to show labels like 1,3,5 etc. Number 2.4.6 will be drawn but just the
label won't be shown for this.
I have drawn a graph using highcharts.js library. I want the xAxis a
little bit customized. I want to show labels in xAxis but i want to show
one lables then hide next label then again show next label. I mean i want
to show labels like 1,3,5 etc. Number 2.4.6 will be drawn but just the
label won't be shown for this.
vb.net find and replace inside wmf files
vb.net find and replace inside wmf files
I am struggling to open wmf files and run a simple ascii find and replace
to look for certain characters in the metadata and replace with different
values. any idea can this be done? I have a wmf editor that shows me the
text inside the image is a proper windows font and not combination of
lines and arcs. any ideas are welcome!
I am struggling to open wmf files and run a simple ascii find and replace
to look for certain characters in the metadata and replace with different
values. any idea can this be done? I have a wmf editor that shows me the
text inside the image is a proper windows font and not combination of
lines and arcs. any ideas are welcome!
Friday, 30 August 2013
Accessing Quandl data call from SAS using url method
Accessing Quandl data call from SAS using url method
I was trying accessing Quandl(http://www.quandl.com) data. Quandl is an
open website from where we can download readiliy available curated
time-series data on many financial and economic topics. They have build it
in such a manner that you can call it through R/Matlab/Eviews/Python etc.
I was trying from SAS. When I tried website Normal csv download call for
Quandl data "FRED/MSWP5" without any date condition it works fine and I am
able to create SAS dataset. code is as below:
filename DAAA url "http://www.quandl.com/api/v1/datasets/FRED/MSWP5.csv?";
data BY_AAA(drop=dd);
length dd $10;
format date date9.;
infile DAAA dlm="," dsd;
input dd$ value;
date=input(dd,yymmdd10.);
if not missing(date) then output;
run;
success log:
NOTE: The data set WORK.BY_AAA has 152 observations and 2 variables.
NOTE: DATA statement used (Total process time):
real time 0.88 seconds
cpu time 0.03 seconds
But when I am trying to pass date condition with the same query it is
giving error: new SAS code is as below: But I am able to achieve desired
results with R/ Python/ Matlab with their respective code.
filename DAAA url "http://www.quandl.com/api/v1/datasets/FRED/MSWP5.csv?
&trim_start=2000-07-01&trim_end=2013-02-01&sort_order=desc";
data BY_AAA(drop=dd);
length dd $10;
format date date9.;
infile DAAA dlm="," dsd;
input dd$ value;
date=input(dd,yymmdd10.);
if not missing(date) then output;
run;
it gives below error:
not working due to "&" sign is coming so SAS is saying
WARNING: Apparent symbolic reference TRIM_START not resolved.
WARNING: Apparent symbolic reference TRIM_END not resolved.
WARNING: Apparent symbolic reference SORT_ORDER not resolved.
I understand that this is an issue related to escape character handle. Can
any body help me...
I was trying accessing Quandl(http://www.quandl.com) data. Quandl is an
open website from where we can download readiliy available curated
time-series data on many financial and economic topics. They have build it
in such a manner that you can call it through R/Matlab/Eviews/Python etc.
I was trying from SAS. When I tried website Normal csv download call for
Quandl data "FRED/MSWP5" without any date condition it works fine and I am
able to create SAS dataset. code is as below:
filename DAAA url "http://www.quandl.com/api/v1/datasets/FRED/MSWP5.csv?";
data BY_AAA(drop=dd);
length dd $10;
format date date9.;
infile DAAA dlm="," dsd;
input dd$ value;
date=input(dd,yymmdd10.);
if not missing(date) then output;
run;
success log:
NOTE: The data set WORK.BY_AAA has 152 observations and 2 variables.
NOTE: DATA statement used (Total process time):
real time 0.88 seconds
cpu time 0.03 seconds
But when I am trying to pass date condition with the same query it is
giving error: new SAS code is as below: But I am able to achieve desired
results with R/ Python/ Matlab with their respective code.
filename DAAA url "http://www.quandl.com/api/v1/datasets/FRED/MSWP5.csv?
&trim_start=2000-07-01&trim_end=2013-02-01&sort_order=desc";
data BY_AAA(drop=dd);
length dd $10;
format date date9.;
infile DAAA dlm="," dsd;
input dd$ value;
date=input(dd,yymmdd10.);
if not missing(date) then output;
run;
it gives below error:
not working due to "&" sign is coming so SAS is saying
WARNING: Apparent symbolic reference TRIM_START not resolved.
WARNING: Apparent symbolic reference TRIM_END not resolved.
WARNING: Apparent symbolic reference SORT_ORDER not resolved.
I understand that this is an issue related to escape character handle. Can
any body help me...
Thursday, 29 August 2013
Remove uniqueness of index in PostgreSQL
Remove uniqueness of index in PostgreSQL
In my PosgreSQL DB I have a unique index created this way:
CREATE UNIQUE INDEX my_index ON my_table USING btree (my_column)
Is there way to alter the index to remove unique constraint? I looked
thorugh ALTER INDEX documentation but it doesn't seem to do what I need.
I know I can remove index and create another one. But I'd like to find a
better way if it exists.
In my PosgreSQL DB I have a unique index created this way:
CREATE UNIQUE INDEX my_index ON my_table USING btree (my_column)
Is there way to alter the index to remove unique constraint? I looked
thorugh ALTER INDEX documentation but it doesn't seem to do what I need.
I know I can remove index and create another one. But I'd like to find a
better way if it exists.
Replacing property dynamically based on environments in ANT scripts
Replacing property dynamically based on environments in ANT scripts
I want to develop ant script which replaces application properties with
environment specific properties. My requirement is that i will have all
environment properties in single env.properties file. During building the
application i need to replace with whatever in env.properties file. Ant
replace works well when i have property files for each environment.
Sample : env.properties
dev.AddNETWORK_USER=devUser
dev.ADDPASS=devPass
sit.AddNETWORK_USER=situser
sit.ADDPASS=sitPass
This needs be replaced in mule.properties as for DEV environment:
dev.AddNETWORK_USER=devUser
dev.ADDPASS=devPass
for SIT environment:
AddNETWORK_USER=sitUser
ADDPASS=sitPass
Thanks for the Help.
I want to develop ant script which replaces application properties with
environment specific properties. My requirement is that i will have all
environment properties in single env.properties file. During building the
application i need to replace with whatever in env.properties file. Ant
replace works well when i have property files for each environment.
Sample : env.properties
dev.AddNETWORK_USER=devUser
dev.ADDPASS=devPass
sit.AddNETWORK_USER=situser
sit.ADDPASS=sitPass
This needs be replaced in mule.properties as for DEV environment:
dev.AddNETWORK_USER=devUser
dev.ADDPASS=devPass
for SIT environment:
AddNETWORK_USER=sitUser
ADDPASS=sitPass
Thanks for the Help.
git: How to ignore changes to a file when committing?
git: How to ignore changes to a file when committing?
I did search for the solution, yet I believe my situation is a bit
different than those I read about.
I am working on a particular branch and forgot myself, having edited a
file in a way that is unrelated to the theme of the branch, and now want
these changes to not make it into the commit. I do not want to loose these
changes, as I will try to commit them on another branch later, in one way
or another.
I tried git rm --cached but then I see status deleted in my git status -
will the file be removed from the repository? I don't want that - I want
it to stay unchanged from whatever it is in previous commit on my working
branch.
I did search for the solution, yet I believe my situation is a bit
different than those I read about.
I am working on a particular branch and forgot myself, having edited a
file in a way that is unrelated to the theme of the branch, and now want
these changes to not make it into the commit. I do not want to loose these
changes, as I will try to commit them on another branch later, in one way
or another.
I tried git rm --cached but then I see status deleted in my git status -
will the file be removed from the repository? I don't want that - I want
it to stay unchanged from whatever it is in previous commit on my working
branch.
Wednesday, 28 August 2013
Hi i'm a android begineer. Was just going through an example and the rest of the project is fine just an error While using fragment manager
Hi i'm a android begineer. Was just going through an example and the rest
of the project is fine just an error While using fragment manager
package com.c2.layoutsdemo;
import java.util.ArrayList;
import android.app.Activity;
import android.app.FragmentManager;
import android.os.Bundle;
import android.widget.ArrayAdapter;
public class ToDoListActivity extends Activity implements
NewItemFragment.OnNewItemAddedListener {
// 1- also if i make arraylist and addar adapter final as per example, i
get additinal errors regarding initialization of arraylist.
ArrayList todoItems; ArrayAdapter aa;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_to_do_list);
FragmentManager fm= getFragmentManager();
ToDoListFragment todolistFragment =
(ToDoListFragment)fm.findFragmentById(R.layout.ToDoListFragment);
// 2- The above line gives error : ToDoListFragment cannot be resolved or
is not a field
todoItems = new ArrayList<String>();
aa = new
ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,todoItems);
todolistFragment.setListAdapter(aa);
}
@Override
public void onNewItemAdded(String newItem) {
todoItems.add(newItem);
aa.notifyDataSetChanged();
}
}
of the project is fine just an error While using fragment manager
package com.c2.layoutsdemo;
import java.util.ArrayList;
import android.app.Activity;
import android.app.FragmentManager;
import android.os.Bundle;
import android.widget.ArrayAdapter;
public class ToDoListActivity extends Activity implements
NewItemFragment.OnNewItemAddedListener {
// 1- also if i make arraylist and addar adapter final as per example, i
get additinal errors regarding initialization of arraylist.
ArrayList todoItems; ArrayAdapter aa;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_to_do_list);
FragmentManager fm= getFragmentManager();
ToDoListFragment todolistFragment =
(ToDoListFragment)fm.findFragmentById(R.layout.ToDoListFragment);
// 2- The above line gives error : ToDoListFragment cannot be resolved or
is not a field
todoItems = new ArrayList<String>();
aa = new
ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,todoItems);
todolistFragment.setListAdapter(aa);
}
@Override
public void onNewItemAdded(String newItem) {
todoItems.add(newItem);
aa.notifyDataSetChanged();
}
}
Replace string from PHP include file
Replace string from PHP include file
Let's say I have an include file, foo.php, and it contains the text "this
file is foo".
So, when I load the include using <?php include 'foo.php'; ?>, I want to
be able to replace a string from the include before displaying the text it
contains.
So let's say I want to replace "foo" from the include with "cool".
Make sense?
Let's say I have an include file, foo.php, and it contains the text "this
file is foo".
So, when I load the include using <?php include 'foo.php'; ?>, I want to
be able to replace a string from the include before displaying the text it
contains.
So let's say I want to replace "foo" from the include with "cool".
Make sense?
sql construct condition with if statement mysql
sql construct condition with if statement mysql
I want to construct such sql condition. I have a table car, it has such
fields id_status, id_category and storage_address. I need to select cars
which are id_status in (2,4) and if id_category = 4 I need to check field
storage_address to be not null or empty. How could I make it? should I use
sql if statement? I need something like:
select * from car where id_status in (2,4) and if(id_category =
4,storage_address is NOT NULL,'1=1')
I want to construct such sql condition. I have a table car, it has such
fields id_status, id_category and storage_address. I need to select cars
which are id_status in (2,4) and if id_category = 4 I need to check field
storage_address to be not null or empty. How could I make it? should I use
sql if statement? I need something like:
select * from car where id_status in (2,4) and if(id_category =
4,storage_address is NOT NULL,'1=1')
Tuesday, 27 August 2013
Finally block does not set values of variable in java
Finally block does not set values of variable in java
I have the below code.
public static void main(String[] args) {
// TODO Auto-generated method stub
try{
System.out.println("Hardik::"+testFinnalyBlock());
}catch(Exception e){
System.out.println("hhh");
}
}
public static int testFinnalyBlock() throws Exception{
int a=5,b=10;
int sum=0;
try{
sum = a+b;
System.out.println("sum==="+sum);
return sum;
}catch(Exception e){
System.out.println("In Catch");
}finally{
sum = a+30;
System.out.println("sum==="+sum);
// return 1;
}
return 1;
}
The output of above code it Hardik::15, While i think it should be
Hardik::35.
Can Anyone tell me how it works. Thanks.
I have the below code.
public static void main(String[] args) {
// TODO Auto-generated method stub
try{
System.out.println("Hardik::"+testFinnalyBlock());
}catch(Exception e){
System.out.println("hhh");
}
}
public static int testFinnalyBlock() throws Exception{
int a=5,b=10;
int sum=0;
try{
sum = a+b;
System.out.println("sum==="+sum);
return sum;
}catch(Exception e){
System.out.println("In Catch");
}finally{
sum = a+30;
System.out.println("sum==="+sum);
// return 1;
}
return 1;
}
The output of above code it Hardik::15, While i think it should be
Hardik::35.
Can Anyone tell me how it works. Thanks.
How to animate text in Foundation 4 so it works in IE and other browsers
How to animate text in Foundation 4 so it works in IE and other browsers
I'm building a website using Foundation 4 and we need to animate some text
on the home page. I intended to use textillate
http://jschr.github.io/textillate/ BUT since Foundation 4 is loading Zepto
for browsers that support it, I found that only IE would run it. When I
tried to load the latest version of jquery in addition to Zepto, it broke
a bunch of Foundation stuff and therefore wouldn't run the textillate
scripts (since I was loading them after).
My question is, what would be the best way to handle this? Do I have to
write two functions to get this done -- one in Zepto and one in Jquery?
I'm really confused with this Zepto stuff. If it doesn't work in IE, why
is Zurb relying on it? Seems like all my clients use IE so I have to make
it work there too.
I'm building a website using Foundation 4 and we need to animate some text
on the home page. I intended to use textillate
http://jschr.github.io/textillate/ BUT since Foundation 4 is loading Zepto
for browsers that support it, I found that only IE would run it. When I
tried to load the latest version of jquery in addition to Zepto, it broke
a bunch of Foundation stuff and therefore wouldn't run the textillate
scripts (since I was loading them after).
My question is, what would be the best way to handle this? Do I have to
write two functions to get this done -- one in Zepto and one in Jquery?
I'm really confused with this Zepto stuff. If it doesn't work in IE, why
is Zurb relying on it? Seems like all my clients use IE so I have to make
it work there too.
MooseX::Getopt - canonical way to specify usage message
MooseX::Getopt - canonical way to specify usage message
What's the usual way to include "usage" text in a program using
MooseX::Getopt? (i.e. running myprog --usage should print something like
"myprog: make everything great")
The MooseX::Getopt documentation says:
"If Getopt::Long::Descriptive is installed and any of the following
command line params are passed, the program will exit with usage
information. You can add descriptions for each option by including a
documentation option for each attribute to document."
but I'm having trouble parsing that last sentence.
What's the usual way to include "usage" text in a program using
MooseX::Getopt? (i.e. running myprog --usage should print something like
"myprog: make everything great")
The MooseX::Getopt documentation says:
"If Getopt::Long::Descriptive is installed and any of the following
command line params are passed, the program will exit with usage
information. You can add descriptions for each option by including a
documentation option for each attribute to document."
but I'm having trouble parsing that last sentence.
Pin-it Button loading in same window & image not working
Pin-it Button loading in same window & image not working
I while back I created a custom little div tag that make it possible for
me to put a pin-it button over another image. Recently Pin-It has changed
around their website and recently we upgraded Joomla 1.5 to Joomla 2.5. I
am not sure where it went broken however...
The Pin-it image is no longer working and is showing a "1" instead. Even
putting in the code straight from pin-it website doesn't load an image or
the pop-up correctly.
Can anyone tell me if there is a problem with 2.5 Joomla and Pin-it? Or is
Pin-it broken? An example is below...its the "1" that's right under the
dog on the red stretcher image.
http://www.handicappedpets.com/dog-stretcher.html
I while back I created a custom little div tag that make it possible for
me to put a pin-it button over another image. Recently Pin-It has changed
around their website and recently we upgraded Joomla 1.5 to Joomla 2.5. I
am not sure where it went broken however...
The Pin-it image is no longer working and is showing a "1" instead. Even
putting in the code straight from pin-it website doesn't load an image or
the pop-up correctly.
Can anyone tell me if there is a problem with 2.5 Joomla and Pin-it? Or is
Pin-it broken? An example is below...its the "1" that's right under the
dog on the red stretcher image.
http://www.handicappedpets.com/dog-stretcher.html
Powershell ISE Crashes on Launch
Powershell ISE Crashes on Launch
Not sure why, but today my workstation refuses to load the Powershell ISE.
I can load Powershell just fine and my cmdlets work. I've tried loading
both the 32bit and 64bit ISE's and both crash for the same reason.
This is the crashdump
Problem signature: Problem Event Name: PowerShell NameOfExe:
PowerShell_ISE.exe FileVersionOfSystemManagementAutomation: 6.1.7600.16385
InnermostExceptionType: System.Xml.XmlException OutermostExceptionType:
System.Reflection.TargetInvocation DeepestPowerShellFrame:
indows.PowerShell.GuiExe.Internal.GPowerShell.Main DeepestFrame:
indows.PowerShell.GuiExe.Internal.GPowerShell.Main ThreadName: unknown OS
Version: 6.1.7600.2.0.0.256.48 Locale ID: 1033
Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
If the online privacy statement is not available, please read our privacy
statement offline: C:\Windows\system32\en-US\erofflps.txt
I couldn't find anything on google on this crash so I'm hoping someone
here has some guidance.
Not sure why, but today my workstation refuses to load the Powershell ISE.
I can load Powershell just fine and my cmdlets work. I've tried loading
both the 32bit and 64bit ISE's and both crash for the same reason.
This is the crashdump
Problem signature: Problem Event Name: PowerShell NameOfExe:
PowerShell_ISE.exe FileVersionOfSystemManagementAutomation: 6.1.7600.16385
InnermostExceptionType: System.Xml.XmlException OutermostExceptionType:
System.Reflection.TargetInvocation DeepestPowerShellFrame:
indows.PowerShell.GuiExe.Internal.GPowerShell.Main DeepestFrame:
indows.PowerShell.GuiExe.Internal.GPowerShell.Main ThreadName: unknown OS
Version: 6.1.7600.2.0.0.256.48 Locale ID: 1033
Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
If the online privacy statement is not available, please read our privacy
statement offline: C:\Windows\system32\en-US\erofflps.txt
I couldn't find anything on google on this crash so I'm hoping someone
here has some guidance.
UIWebView and click link
UIWebView and click link
I know that most likely the answer is very obvious, but I've looked
everywhere on the internet and I have not found anything. I use this
method to see if the user presses on the WebView
-(BOOL)webView:(UIWebView *)webView
shouldStartLoadWithRequest:(NSURLRequest *)request
navigationType:(UIWebViewNavigationType)navigationType; {
I can assure you that it works.
What I want to do is to make different actions according to the id
es
<a id="hello" href="..."><img src="..." /></a>
once the delegate detect "touch click" on the img with the "hello" id, I
would do some custom stuff, like [self callSomething];
Could you show me how to do it using a sample code? thanks
I know that most likely the answer is very obvious, but I've looked
everywhere on the internet and I have not found anything. I use this
method to see if the user presses on the WebView
-(BOOL)webView:(UIWebView *)webView
shouldStartLoadWithRequest:(NSURLRequest *)request
navigationType:(UIWebViewNavigationType)navigationType; {
I can assure you that it works.
What I want to do is to make different actions according to the id
es
<a id="hello" href="..."><img src="..." /></a>
once the delegate detect "touch click" on the img with the "hello" id, I
would do some custom stuff, like [self callSomething];
Could you show me how to do it using a sample code? thanks
How to show a url content in asp.net
How to show a url content in asp.net
Let's say i want my default.aspx page to present the content of
www.google.com (for example).
Is it a Redirect? or can it be "Embedded"?
The goal is to see the content of the Web page, and get a response from it.
In more details, I want to authenticate a user according to GoogleDrive SDK.
I ALREADY have the Auth Url from another place.
So here I want to run this Url, wait for the user to accept the app, and
to receive the response tokens (Access token, Refresh token) from the
Google authorization page.
I hope I could explain it clearly.
*I must say, the whole auth process is working well in WinForms, but I
need to split the process. I'm getting the Url from there, but need to get
the response in a different webform app.
Is it possible?
Let's say i want my default.aspx page to present the content of
www.google.com (for example).
Is it a Redirect? or can it be "Embedded"?
The goal is to see the content of the Web page, and get a response from it.
In more details, I want to authenticate a user according to GoogleDrive SDK.
I ALREADY have the Auth Url from another place.
So here I want to run this Url, wait for the user to accept the app, and
to receive the response tokens (Access token, Refresh token) from the
Google authorization page.
I hope I could explain it clearly.
*I must say, the whole auth process is working well in WinForms, but I
need to split the process. I'm getting the Url from there, but need to get
the response in a different webform app.
Is it possible?
Monday, 26 August 2013
Is there a fix to the Ubuntu 13.04 Wi-Fi connection woes?
Is there a fix to the Ubuntu 13.04 Wi-Fi connection woes?
My brand new desktop running 13.04 has endless problems with wireless.
Dozens of others are flooding forums with reports of the same problems.
I have 5+ devices all able to connect without any trouble at all,
including iPhone, Android phone, 3DS, multiple game consoles, a laptop
running windows 7, and even a second desktop machine running Ubuntu 12.04
sitting right behind the 13.04 machine. All other devices have full
wireless bars displayed (strong signals).
At any moment, one of the following is happening, and it changes randomly:
Trying to connect forever, but never establishing a connection. Wireless
icon constantly animating.
Finds no wireless networks at all. (There are 12+ in range according to
other devices.)
Will not try to connect to the network. If I use the icon to connect, it
will display "Disconnected" within a few seconds.
Will continuously ask for the network password. Typing it in correctly
does not help.
Wireless is working fine. This happens sometimes. It can work for days at
a time, or only 10 mins at a time.
Various things that usually do nothing but sometimes fix the problem:
Reboot. This has the best chance of helping, but it usually takes 5+ times.
Disable/re-enable Wi-Fi using the wireless icon.
Disable/re-enable Networking using the wireless icon.
Use the icon to try and connect to a network (if found).
Use the icon to open Edit Connections and delete my connection info,
causing it to be recreated (once it's actually found again).
Various things that seem to make no difference:
Changing between using Linux headers in grub at bootup, between 3.10.0,
3.9.0, or 3.8.0.
Move the wireless router very close to the desktop.
Running sudo rfkill unblock all (I dunno what this is supposed to do.)
I've used Ubuntu for 6 years and I've never had a problem with networking.
Now I'm spending all my time reading through endless problem reports and
trying all the answers. None of them have helped. I am doing this instead
of getting work done, which is defeating the whole purpose of using
Ubuntu. It's heartbreaking to be honest.
In the current state of "no networks are showing up", here are outputs
from the random things that other people are usually asked to run:
lspic
00:00.0 Host bridge: Intel Corporation Haswell DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Haswell PCI Express x16 Controller
(rev 06)
00:14.0 USB controller: Intel Corporation Lynx Point USB xHCI Host
Controller (rev 04)
00:16.0 Communication controller: Intel Corporation Lynx Point MEI
Controller #1 (rev 04)
00:19.0 Ethernet controller: Intel Corporation Ethernet Connection I217-V
(rev 04)
00:1a.0 USB controller: Intel Corporation Lynx Point USB Enhanced Host
Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation Lynx Point High Definition Audio
Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation Lynx Point PCI Express Root Port #1
(rev d4)
00:1c.2 PCI bridge: Intel Corporation 82801 PCI Bridge (rev d4)
00:1d.0 USB controller: Intel Corporation Lynx Point USB Enhanced Host
Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation Lynx Point LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation Lynx Point 6-port SATA
Controller 1 [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation Lynx Point SMBus Controller (rev 04)
01:00.0 VGA compatible controller: NVIDIA Corporation GF119 [GeForce GT
610] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GF119 HDMI Audio Controller (rev a1)
03:00.0 PCI bridge: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI
Bridge (rev 03)
lsmod
Module Size Used by
e100 41119 0
nls_iso8859_1 12713 1
parport_pc 28284 0
ppdev 17106 0
bnep 18258 2
rfcomm 47863 12
binfmt_misc 17540 1
arc4 12573 2
rt2800usb 27201 0
rt2x00usb 20857 1 rt2800usb
rt2800lib 68029 1 rt2800usb
rt2x00lib 55764 3 rt2x00usb,rt2800lib,rt2800usb
coretemp 13596 0
mac80211 656164 3 rt2x00lib,rt2x00usb,rt2800lib
kvm_intel 138733 0
kvm 452835 1 kvm_intel
cfg80211 547224 2 mac80211,rt2x00lib
crc_ccitt 12707 1 rt2800lib
ghash_clmulni_intel 13259 0
aesni_intel 55449 0
usb_storage 61749 1
aes_x86_64 17131 1 aesni_intel
joydev 17613 0
xts 12922 1 aesni_intel
nouveau 1001310 3
snd_hda_codec_hdmi 37407 1
lrw 13294 1 aesni_intel
gf128mul 14951 2 lrw,xts
mxm_wmi 13021 1 nouveau
snd_hda_codec_realtek 46511 1
ablk_helper 13597 1 aesni_intel
wmi 19256 2 mxm_wmi,nouveau
snd_hda_intel 44397 5
ttm 88251 1 nouveau
drm_kms_helper 49082 1 nouveau
drm 295908 5 ttm,drm_kms_helper,nouveau
snd_hda_codec 190010 3
snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_intel
cryptd 20501 3 ghash_clmulni_intel,aesni_intel,ablk_helper
snd_hwdep 13613 1 snd_hda_codec
snd_pcm 102477 3
snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel
btusb 18291 0
snd_page_alloc 18798 2 snd_pcm,snd_hda_intel
snd_seq_midi 13324 0
i2c_algo_bit 13564 1 nouveau
snd_seq_midi_event 14899 1 snd_seq_midi
snd_rawmidi 30417 1 snd_seq_midi
snd_seq 61930 2 snd_seq_midi_event,snd_seq_midi
bluetooth 251354 22 bnep,btusb,rfcomm
snd_seq_device 14497 3 snd_seq,snd_rawmidi,snd_seq_midi
lpc_ich 17060 0
snd_timer 29989 2 snd_pcm,snd_seq
mei 46588 0
snd 69533 20
snd_hda_codec_realtek,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_seq,snd_rawmidi,snd_hda_codec,snd_hda_intel,snd_seq_device
psmouse 97838 0
microcode 22923 0
soundcore 12680 1 snd
video 19467 1 nouveau
mac_hid 13253 0
serio_raw 13215 0
lp 17799 0
parport 46562 3 lp,ppdev,parport_pc
hid_generic 12548 0
usbhid 47346 0
hid 101248 2 hid_generic,usbhid
ahci 30063 3
libahci 32088 1 ahci
e1000e 207005 0
ptp 18668 1 e1000e
pps_core 14080 1 ptp
sudo lshw -c network
00:00.0 Host bridge: Intel Corporation Haswell DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Haswell PCI Express x16 Controller
(rev 06)
00:14.0 USB controller: Intel Corporation Lynx Point USB xHCI Host
Controller (rev 04)
00:16.0 Communication controller: Intel Corporation Lynx Point MEI
Controller #1 (rev 04)
00:19.0 Ethernet controller: Intel Corporation Ethernet Connection I217-V
(rev 04)
00:1a.0 USB controller: Intel Corporation Lynx Point USB Enhanced Host
Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation Lynx Point High Definition Audio
Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation Lynx Point PCI Express Root Port #1
(rev d4)
00:1c.2 PCI bridge: Intel Corporation 82801 PCI Bridge (rev d4)
00:1d.0 USB controller: Intel Corporation Lynx Point USB Enhanced Host
Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation Lynx Point LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation Lynx Point 6-port SATA
Controller 1 [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation Lynx Point SMBus Controller (rev 04)
01:00.0 VGA compatible controller: NVIDIA Corporation GF119 [GeForce GT
610] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GF119 HDMI Audio Controller (rev a1)
03:00.0 PCI bridge: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI
Bridge (rev 03)
sudo iwconfig
eth0 no wireless extensions.
lo no wireless extensions.
wlan0 IEEE 802.11bgn ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:on
sudo iwlist scan
eth0 Interface doesn't support scanning.
lo Interface doesn't support scanning.
wlan0 No scan results
NOTE: This dmesg was done after a reboot where the network manager was
continuously displaying the "disconnected" message over and over. So it
must have been trying to connect at this time. My network was displayed in
the list of options, as the only option despite other devices picking up
12+ access points. The router channel is set to auto.
dmesg | tail -30
[ 187.418446] wlan0: associated
[ 190.405601] wlan0: disassociated from 00:14:d1:a8:c3:44 (Reason: 15)
[ 190.443312] cfg80211: Calling CRDA to update world regulatory domain
[ 190.443431] wlan0: deauthenticating from 00:14:d1:a8:c3:44 by local
choice (reason=3)
[ 190.451635] cfg80211: World regulatory domain updated:
[ 190.451643] cfg80211: (start_freq - end_freq @ bandwidth),
(max_antenna_gain, max_eirp)
[ 190.451648] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300
mBi, 2000 mBm)
[ 190.451652] cfg80211: (2457000 KHz - 2482000 KHz @ 20000 KHz), (300
mBi, 2000 mBm)
[ 190.451656] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300
mBi, 2000 mBm)
[ 190.451659] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300
mBi, 2000 mBm)
[ 190.451662] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300
mBi, 2000 mBm)
[ 191.824451] wlan0: authenticate with 00:14:d1:a8:c3:44
[ 191.850608] wlan0: send auth to 00:14:d1:a8:c3:44 (try 1/3)
[ 191.884604] wlan0: send auth to 00:14:d1:a8:c3:44 (try 2/3)
[ 191.886309] wlan0: authenticated
[ 191.886579] rt2800usb 3-5.3:1.0 wlan0: disabling HT as WMM/QoS is not
supported by the AP
[ 191.886588] rt2800usb 3-5.3:1.0 wlan0: disabling VHT as WMM/QoS is not
supported by the AP
[ 191.889556] wlan0: associate with 00:14:d1:a8:c3:44 (try 1/3)
[ 192.001493] wlan0: associate with 00:14:d1:a8:c3:44 (try 2/3)
[ 192.040274] wlan0: RX AssocResp from 00:14:d1:a8:c3:44 (capab=0x431
status=0 aid=3)
[ 192.044235] wlan0: associated
[ 193.948188] wlan0: deauthenticating from 00:14:d1:a8:c3:44 by local
choice (reason=3)
[ 193.981501] cfg80211: Calling CRDA to update world regulatory domain
[ 193.984080] cfg80211: World regulatory domain updated:
[ 193.984082] cfg80211: (start_freq - end_freq @ bandwidth),
(max_antenna_gain, max_eirp)
[ 193.984084] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300
mBi, 2000 mBm)
[ 193.984085] cfg80211: (2457000 KHz - 2482000 KHz @ 20000 KHz), (300
mBi, 2000 mBm)
[ 193.984085] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300
mBi, 2000 mBm)
[ 193.984086] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300
mBi, 2000 mBm)
[ 193.984087] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300
mBi, 2000 mBm)
The router uses MAC filtering, and security is WPA PSK with cipher as auto.
So, any ideas? Or is the solution just to not use 13.04 unless you have a
wired connection? (I don't have this option.) If so, please just tell me
straight. I survived 9.04 Jaunty, and I can survive 13.04 Raring.
Thanks for your help.
My brand new desktop running 13.04 has endless problems with wireless.
Dozens of others are flooding forums with reports of the same problems.
I have 5+ devices all able to connect without any trouble at all,
including iPhone, Android phone, 3DS, multiple game consoles, a laptop
running windows 7, and even a second desktop machine running Ubuntu 12.04
sitting right behind the 13.04 machine. All other devices have full
wireless bars displayed (strong signals).
At any moment, one of the following is happening, and it changes randomly:
Trying to connect forever, but never establishing a connection. Wireless
icon constantly animating.
Finds no wireless networks at all. (There are 12+ in range according to
other devices.)
Will not try to connect to the network. If I use the icon to connect, it
will display "Disconnected" within a few seconds.
Will continuously ask for the network password. Typing it in correctly
does not help.
Wireless is working fine. This happens sometimes. It can work for days at
a time, or only 10 mins at a time.
Various things that usually do nothing but sometimes fix the problem:
Reboot. This has the best chance of helping, but it usually takes 5+ times.
Disable/re-enable Wi-Fi using the wireless icon.
Disable/re-enable Networking using the wireless icon.
Use the icon to try and connect to a network (if found).
Use the icon to open Edit Connections and delete my connection info,
causing it to be recreated (once it's actually found again).
Various things that seem to make no difference:
Changing between using Linux headers in grub at bootup, between 3.10.0,
3.9.0, or 3.8.0.
Move the wireless router very close to the desktop.
Running sudo rfkill unblock all (I dunno what this is supposed to do.)
I've used Ubuntu for 6 years and I've never had a problem with networking.
Now I'm spending all my time reading through endless problem reports and
trying all the answers. None of them have helped. I am doing this instead
of getting work done, which is defeating the whole purpose of using
Ubuntu. It's heartbreaking to be honest.
In the current state of "no networks are showing up", here are outputs
from the random things that other people are usually asked to run:
lspic
00:00.0 Host bridge: Intel Corporation Haswell DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Haswell PCI Express x16 Controller
(rev 06)
00:14.0 USB controller: Intel Corporation Lynx Point USB xHCI Host
Controller (rev 04)
00:16.0 Communication controller: Intel Corporation Lynx Point MEI
Controller #1 (rev 04)
00:19.0 Ethernet controller: Intel Corporation Ethernet Connection I217-V
(rev 04)
00:1a.0 USB controller: Intel Corporation Lynx Point USB Enhanced Host
Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation Lynx Point High Definition Audio
Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation Lynx Point PCI Express Root Port #1
(rev d4)
00:1c.2 PCI bridge: Intel Corporation 82801 PCI Bridge (rev d4)
00:1d.0 USB controller: Intel Corporation Lynx Point USB Enhanced Host
Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation Lynx Point LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation Lynx Point 6-port SATA
Controller 1 [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation Lynx Point SMBus Controller (rev 04)
01:00.0 VGA compatible controller: NVIDIA Corporation GF119 [GeForce GT
610] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GF119 HDMI Audio Controller (rev a1)
03:00.0 PCI bridge: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI
Bridge (rev 03)
lsmod
Module Size Used by
e100 41119 0
nls_iso8859_1 12713 1
parport_pc 28284 0
ppdev 17106 0
bnep 18258 2
rfcomm 47863 12
binfmt_misc 17540 1
arc4 12573 2
rt2800usb 27201 0
rt2x00usb 20857 1 rt2800usb
rt2800lib 68029 1 rt2800usb
rt2x00lib 55764 3 rt2x00usb,rt2800lib,rt2800usb
coretemp 13596 0
mac80211 656164 3 rt2x00lib,rt2x00usb,rt2800lib
kvm_intel 138733 0
kvm 452835 1 kvm_intel
cfg80211 547224 2 mac80211,rt2x00lib
crc_ccitt 12707 1 rt2800lib
ghash_clmulni_intel 13259 0
aesni_intel 55449 0
usb_storage 61749 1
aes_x86_64 17131 1 aesni_intel
joydev 17613 0
xts 12922 1 aesni_intel
nouveau 1001310 3
snd_hda_codec_hdmi 37407 1
lrw 13294 1 aesni_intel
gf128mul 14951 2 lrw,xts
mxm_wmi 13021 1 nouveau
snd_hda_codec_realtek 46511 1
ablk_helper 13597 1 aesni_intel
wmi 19256 2 mxm_wmi,nouveau
snd_hda_intel 44397 5
ttm 88251 1 nouveau
drm_kms_helper 49082 1 nouveau
drm 295908 5 ttm,drm_kms_helper,nouveau
snd_hda_codec 190010 3
snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_intel
cryptd 20501 3 ghash_clmulni_intel,aesni_intel,ablk_helper
snd_hwdep 13613 1 snd_hda_codec
snd_pcm 102477 3
snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel
btusb 18291 0
snd_page_alloc 18798 2 snd_pcm,snd_hda_intel
snd_seq_midi 13324 0
i2c_algo_bit 13564 1 nouveau
snd_seq_midi_event 14899 1 snd_seq_midi
snd_rawmidi 30417 1 snd_seq_midi
snd_seq 61930 2 snd_seq_midi_event,snd_seq_midi
bluetooth 251354 22 bnep,btusb,rfcomm
snd_seq_device 14497 3 snd_seq,snd_rawmidi,snd_seq_midi
lpc_ich 17060 0
snd_timer 29989 2 snd_pcm,snd_seq
mei 46588 0
snd 69533 20
snd_hda_codec_realtek,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_seq,snd_rawmidi,snd_hda_codec,snd_hda_intel,snd_seq_device
psmouse 97838 0
microcode 22923 0
soundcore 12680 1 snd
video 19467 1 nouveau
mac_hid 13253 0
serio_raw 13215 0
lp 17799 0
parport 46562 3 lp,ppdev,parport_pc
hid_generic 12548 0
usbhid 47346 0
hid 101248 2 hid_generic,usbhid
ahci 30063 3
libahci 32088 1 ahci
e1000e 207005 0
ptp 18668 1 e1000e
pps_core 14080 1 ptp
sudo lshw -c network
00:00.0 Host bridge: Intel Corporation Haswell DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Haswell PCI Express x16 Controller
(rev 06)
00:14.0 USB controller: Intel Corporation Lynx Point USB xHCI Host
Controller (rev 04)
00:16.0 Communication controller: Intel Corporation Lynx Point MEI
Controller #1 (rev 04)
00:19.0 Ethernet controller: Intel Corporation Ethernet Connection I217-V
(rev 04)
00:1a.0 USB controller: Intel Corporation Lynx Point USB Enhanced Host
Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation Lynx Point High Definition Audio
Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation Lynx Point PCI Express Root Port #1
(rev d4)
00:1c.2 PCI bridge: Intel Corporation 82801 PCI Bridge (rev d4)
00:1d.0 USB controller: Intel Corporation Lynx Point USB Enhanced Host
Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation Lynx Point LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation Lynx Point 6-port SATA
Controller 1 [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation Lynx Point SMBus Controller (rev 04)
01:00.0 VGA compatible controller: NVIDIA Corporation GF119 [GeForce GT
610] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GF119 HDMI Audio Controller (rev a1)
03:00.0 PCI bridge: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI
Bridge (rev 03)
sudo iwconfig
eth0 no wireless extensions.
lo no wireless extensions.
wlan0 IEEE 802.11bgn ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:on
sudo iwlist scan
eth0 Interface doesn't support scanning.
lo Interface doesn't support scanning.
wlan0 No scan results
NOTE: This dmesg was done after a reboot where the network manager was
continuously displaying the "disconnected" message over and over. So it
must have been trying to connect at this time. My network was displayed in
the list of options, as the only option despite other devices picking up
12+ access points. The router channel is set to auto.
dmesg | tail -30
[ 187.418446] wlan0: associated
[ 190.405601] wlan0: disassociated from 00:14:d1:a8:c3:44 (Reason: 15)
[ 190.443312] cfg80211: Calling CRDA to update world regulatory domain
[ 190.443431] wlan0: deauthenticating from 00:14:d1:a8:c3:44 by local
choice (reason=3)
[ 190.451635] cfg80211: World regulatory domain updated:
[ 190.451643] cfg80211: (start_freq - end_freq @ bandwidth),
(max_antenna_gain, max_eirp)
[ 190.451648] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300
mBi, 2000 mBm)
[ 190.451652] cfg80211: (2457000 KHz - 2482000 KHz @ 20000 KHz), (300
mBi, 2000 mBm)
[ 190.451656] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300
mBi, 2000 mBm)
[ 190.451659] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300
mBi, 2000 mBm)
[ 190.451662] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300
mBi, 2000 mBm)
[ 191.824451] wlan0: authenticate with 00:14:d1:a8:c3:44
[ 191.850608] wlan0: send auth to 00:14:d1:a8:c3:44 (try 1/3)
[ 191.884604] wlan0: send auth to 00:14:d1:a8:c3:44 (try 2/3)
[ 191.886309] wlan0: authenticated
[ 191.886579] rt2800usb 3-5.3:1.0 wlan0: disabling HT as WMM/QoS is not
supported by the AP
[ 191.886588] rt2800usb 3-5.3:1.0 wlan0: disabling VHT as WMM/QoS is not
supported by the AP
[ 191.889556] wlan0: associate with 00:14:d1:a8:c3:44 (try 1/3)
[ 192.001493] wlan0: associate with 00:14:d1:a8:c3:44 (try 2/3)
[ 192.040274] wlan0: RX AssocResp from 00:14:d1:a8:c3:44 (capab=0x431
status=0 aid=3)
[ 192.044235] wlan0: associated
[ 193.948188] wlan0: deauthenticating from 00:14:d1:a8:c3:44 by local
choice (reason=3)
[ 193.981501] cfg80211: Calling CRDA to update world regulatory domain
[ 193.984080] cfg80211: World regulatory domain updated:
[ 193.984082] cfg80211: (start_freq - end_freq @ bandwidth),
(max_antenna_gain, max_eirp)
[ 193.984084] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300
mBi, 2000 mBm)
[ 193.984085] cfg80211: (2457000 KHz - 2482000 KHz @ 20000 KHz), (300
mBi, 2000 mBm)
[ 193.984085] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300
mBi, 2000 mBm)
[ 193.984086] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300
mBi, 2000 mBm)
[ 193.984087] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300
mBi, 2000 mBm)
The router uses MAC filtering, and security is WPA PSK with cipher as auto.
So, any ideas? Or is the solution just to not use 13.04 unless you have a
wired connection? (I don't have this option.) If so, please just tell me
straight. I survived 9.04 Jaunty, and I can survive 13.04 Raring.
Thanks for your help.
C# Array and Memory References
C# Array and Memory References
Sadly the book had no "diagram" of memory.....so My only "instinct" is
that the actual array values in the heap are being changed, so when we
writeline again we are still using the old values? But basically I don't
understand why the second "Writeline" is giving such values?
class MyClass
{
public void ListInts(params int[] inVals)
{
if ((inVals != null) && (inVals.Length != 0))
for (int i = 0; i < inVals.Length; i++) // Process the array.
{
inVals[i] = inVals[i] * 10;
Console.WriteLine("{0}", inVals[i]); // Display new value.
}
}
}
class Program
{
static void Main()
{
int[] myArr = new int[] { 5, 6, 7 }; // Create and initialize array.
MyClass mc = new MyClass();
mc.ListInts(myArr); // Call method to print the values.
foreach (int x in myArr)
Console.WriteLine("{0}", x); // Print out each element.
}
}
/*
This code produces the following output:
50
60
70
50
60
70
*/
Sadly the book had no "diagram" of memory.....so My only "instinct" is
that the actual array values in the heap are being changed, so when we
writeline again we are still using the old values? But basically I don't
understand why the second "Writeline" is giving such values?
class MyClass
{
public void ListInts(params int[] inVals)
{
if ((inVals != null) && (inVals.Length != 0))
for (int i = 0; i < inVals.Length; i++) // Process the array.
{
inVals[i] = inVals[i] * 10;
Console.WriteLine("{0}", inVals[i]); // Display new value.
}
}
}
class Program
{
static void Main()
{
int[] myArr = new int[] { 5, 6, 7 }; // Create and initialize array.
MyClass mc = new MyClass();
mc.ListInts(myArr); // Call method to print the values.
foreach (int x in myArr)
Console.WriteLine("{0}", x); // Print out each element.
}
}
/*
This code produces the following output:
50
60
70
50
60
70
*/
Rake error RepeatedConditional
Rake error RepeatedConditional
I have below error:
tests @action.placed.!=(true) at least 3 times (RepeatedConditional)
Generated from below code:
def left
super unless @action.placed != true
end
def right
super unless @action.placed != true
end
def move_forward
super unless @action.placed != true
end
How would we get rid of this repeat?
I have below error:
tests @action.placed.!=(true) at least 3 times (RepeatedConditional)
Generated from below code:
def left
super unless @action.placed != true
end
def right
super unless @action.placed != true
end
def move_forward
super unless @action.placed != true
end
How would we get rid of this repeat?
Event Handler Null
Event Handler Null
In the MainWindow() I register an event handler
public partial class MainWindow : Window, INotifyPropertyChanged
{
public MainWindow()
{
InitializeComponent();
pageViewDocText = new PageViewDocText();
framePageDocFieldDetail.Content = pageViewDocText;
pageViewDocText.NewPageIRPRO += new
GabeLib.SearchCls.DocEventHandler(ViewIPRO);
}
protected void ViewIPRO(string IRPOlink)
public partial class PageViewDocText : Page, INotifyPropertyChanged
{
public event GabeLib.SearchCls.DocEventHandler NewPageIRPRO;
But in PageViewDocText NewPageIRPRO is null
What am I doing wrong?
From PageViewDocText I want to call MainWindow.ViewIPRO
In the MainWindow() I register an event handler
public partial class MainWindow : Window, INotifyPropertyChanged
{
public MainWindow()
{
InitializeComponent();
pageViewDocText = new PageViewDocText();
framePageDocFieldDetail.Content = pageViewDocText;
pageViewDocText.NewPageIRPRO += new
GabeLib.SearchCls.DocEventHandler(ViewIPRO);
}
protected void ViewIPRO(string IRPOlink)
public partial class PageViewDocText : Page, INotifyPropertyChanged
{
public event GabeLib.SearchCls.DocEventHandler NewPageIRPRO;
But in PageViewDocText NewPageIRPRO is null
What am I doing wrong?
From PageViewDocText I want to call MainWindow.ViewIPRO
What's the right way to pronounce "Louis"?
What's the right way to pronounce "Louis"?
The name of the comedian Louis C.K. is pronounced LU-EE-SEE-KAY.
Is the S pronounced as a part of the given name "Louis", or just the first
constant of the of the letter C?
Is there a canonical way to pronounce the English name "Louis", or is the
pronunciation dependent in geographic location or origin?
Credit: this tweet (Hebrew).
The name of the comedian Louis C.K. is pronounced LU-EE-SEE-KAY.
Is the S pronounced as a part of the given name "Louis", or just the first
constant of the of the letter C?
Is there a canonical way to pronounce the English name "Louis", or is the
pronunciation dependent in geographic location or origin?
Credit: this tweet (Hebrew).
Android AppCompat display overflow button on ActionBar - API level 8
Android AppCompat display overflow button on ActionBar - API level 8
I'm trying to display overflow button on ActionBar on devices using API
level 8. I was trying do it according this post but I can't see overflow
button on ActionBar. Can someone give me an advice? Thank you for
response.
I'm trying to display overflow button on ActionBar on devices using API
level 8. I was trying do it according this post but I can't see overflow
button on ActionBar. Can someone give me an advice? Thank you for
response.
jquery typeahead and address picker?
jquery typeahead and address picker?
With the release of bootstrap 3.0 the typeahead plugin has been removed
and replaced with Twitters typeahead plugin. Any idea how I can use this
in conjunction with the addresspicker plugin.
My old code worked like this:
$('#location').addressPicker({
boundElements: {
'#wizard .Country': function(data) {
var result = '';
$.each(data.address_components, function (index, value) {
if (value.types.indexOf('country') !== -1) {
result = value.long_name;
}
});
return result;
},
'#wizard .State': 'administrative_area_level_1',
'#wizard .City': 'locality',
'#wizard .PostalCode': 'postal_code',
'#wizard .Lat': 'lat',
'#wizard .Lng': 'lng'
}
});
The event trigger for the new type ahead looks like this:
$('#location').typeahead({
/* ??? */
});
With the release of bootstrap 3.0 the typeahead plugin has been removed
and replaced with Twitters typeahead plugin. Any idea how I can use this
in conjunction with the addresspicker plugin.
My old code worked like this:
$('#location').addressPicker({
boundElements: {
'#wizard .Country': function(data) {
var result = '';
$.each(data.address_components, function (index, value) {
if (value.types.indexOf('country') !== -1) {
result = value.long_name;
}
});
return result;
},
'#wizard .State': 'administrative_area_level_1',
'#wizard .City': 'locality',
'#wizard .PostalCode': 'postal_code',
'#wizard .Lat': 'lat',
'#wizard .Lng': 'lng'
}
});
The event trigger for the new type ahead looks like this:
$('#location').typeahead({
/* ??? */
});
Cannot install gettext [on hold]
Cannot install gettext [on hold]
I have tried installing the gettext GNU package through macports, brew and
source and all the times it hangs right after:
libtool: link: (cd ".libs" && rm -f "libgettextlib.dylib" && ln -s
"libgettextlib-0.18.3.dylib" "libgettextlib.dylib")
where it seems that a grep command is running endlessly. I am running OSX
10.9 DP6. Any suggestion? Thank you in advance!
I have tried installing the gettext GNU package through macports, brew and
source and all the times it hangs right after:
libtool: link: (cd ".libs" && rm -f "libgettextlib.dylib" && ln -s
"libgettextlib-0.18.3.dylib" "libgettextlib.dylib")
where it seems that a grep command is running endlessly. I am running OSX
10.9 DP6. Any suggestion? Thank you in advance!
How to extract information from self-closing xml elements in vb.net in asp.net?
Tomcat blocking when handle huge HTTPS connections
Tomcat blocking when handle huge HTTPS connections
We use HTTPS to do file upload from client to tomcat web server, sometimes
we will met the tomcat blocking issue, but don't know why this happens, in
normal case, file can be uploaded successfully.
When tomcat is blocking, all the https connections can't be created, after
about 5 minutes, some https connections will be released.
Not sure what trigger the tomcat go blocking, and how to avoid this,
helps!!!Thanks!
We use HTTPS to do file upload from client to tomcat web server, sometimes
we will met the tomcat blocking issue, but don't know why this happens, in
normal case, file can be uploaded successfully.
When tomcat is blocking, all the https connections can't be created, after
about 5 minutes, some https connections will be released.
Not sure what trigger the tomcat go blocking, and how to avoid this,
helps!!!Thanks!
Sunday, 25 August 2013
Execute/Call a script file from inside of an imacro file
Execute/Call a script file from inside of an imacro file
I have a visual basic script file which needs to be called in an imacro
file. Is that possible? If yes, could anybody please provide an example !
Badly in search of the answer :(
Thanks in advance !! :) :)
I have a visual basic script file which needs to be called in an imacro
file. Is that possible? If yes, could anybody please provide an example !
Badly in search of the answer :(
Thanks in advance !! :) :)
A program to mutate Nested Lists
A program to mutate Nested Lists
Could someone help me do to things:
Review the code and see if it could be written in a better way.
Finish this program. I got stuck in trying to put the list back the way it
is. i.e. a nested list of lists.
Here we go:
t = ['a', 'b', ['c', 'd'], ['e'], 'f']
def capitalize_list(t):
L = []
N = []
for i in range(len(t)):
if type(t[i]) == str:
L.append(t[i].capitalize())
if type(t[i]) == list:
L.extend(t[i])
for s in L:
N.append(s.capitalize())
print N
capitalize_list(t)
This code prints:
['A', 'B', 'C', 'D', 'E', 'F']
I need it to print:
['A', 'B', ['C', 'D'], ['E'], 'F']
Could someone help me do to things:
Review the code and see if it could be written in a better way.
Finish this program. I got stuck in trying to put the list back the way it
is. i.e. a nested list of lists.
Here we go:
t = ['a', 'b', ['c', 'd'], ['e'], 'f']
def capitalize_list(t):
L = []
N = []
for i in range(len(t)):
if type(t[i]) == str:
L.append(t[i].capitalize())
if type(t[i]) == list:
L.extend(t[i])
for s in L:
N.append(s.capitalize())
print N
capitalize_list(t)
This code prints:
['A', 'B', 'C', 'D', 'E', 'F']
I need it to print:
['A', 'B', ['C', 'D'], ['E'], 'F']
How to rewrite /?blabla to another url?
How to rewrite /?blabla to another url?
How to rewrite with .htaccess
?p_action=user_profile to /user
It seems to ignore the "?" character and I dont know what to do....
Thanks
How to rewrite with .htaccess
?p_action=user_profile to /user
It seems to ignore the "?" character and I dont know what to do....
Thanks
Python List filled with duplicates
Python List filled with duplicates
Here is the code.
x=0
result=[]
for n in range(1,5):
x=x+n;
for i in range(1,10):
if x%i==0:
result.append(i)
print(x,result)
Here I have generated triangular numbers.I want to find the divisors of
each triangular number.but when I execute the code I am getting the
following output.
1 [1]
3 [1, 1]
3 [1, 1, 3]
6 [1, 1, 3, 1]
6 [1, 1, 3, 1, 2]
6 [1, 1, 3, 1, 2, 3]
6 [1, 1, 3, 1, 2, 3, 6]
10 [1, 1, 3, 1, 2, 3, 6, 1]
10 [1, 1, 3, 1, 2, 3, 6, 1, 2]
10 [1, 1, 3, 1, 2, 3, 6, 1, 2, 5]
Also same triangular number is repeated for several times.So I need an
output looks like,
1 [1]
3 [1, 3]
6 [1, 2, 3, 6]
10 [1, 2, 5]
How can I get the output like this?thank you.
Here is the code.
x=0
result=[]
for n in range(1,5):
x=x+n;
for i in range(1,10):
if x%i==0:
result.append(i)
print(x,result)
Here I have generated triangular numbers.I want to find the divisors of
each triangular number.but when I execute the code I am getting the
following output.
1 [1]
3 [1, 1]
3 [1, 1, 3]
6 [1, 1, 3, 1]
6 [1, 1, 3, 1, 2]
6 [1, 1, 3, 1, 2, 3]
6 [1, 1, 3, 1, 2, 3, 6]
10 [1, 1, 3, 1, 2, 3, 6, 1]
10 [1, 1, 3, 1, 2, 3, 6, 1, 2]
10 [1, 1, 3, 1, 2, 3, 6, 1, 2, 5]
Also same triangular number is repeated for several times.So I need an
output looks like,
1 [1]
3 [1, 3]
6 [1, 2, 3, 6]
10 [1, 2, 5]
How can I get the output like this?thank you.
Saturday, 24 August 2013
change text color on change of selection in dropdown list for each row
change text color on change of selection in dropdown list for each row
1 down vote favorite
I have a dropdown list of different colors on one row, and when list
selected, i would like to change a value of text color on that row to the
value of the selection. Each row have one field of dropdown list,
everytime user select dropdown list all the field on that will change the
same color. Thanks in advance,
<html>
<head>
<script type="text/javascript">
function updateTextColour(value) {
if (dropdownList.value > 0) {
dropdownList.style.color = 'red';
//document.body.style.color = '#' + value;
} }
</script>
<style type="text/css">.style1 {color: #FF0000;}</style
</head>
<body>
<form>Change the text color: <br>
<table>
<tr>
<td id="1" style="width:40px">1</td>
<td id="1" style="width:180px" class="style7">
<span class="style1"><span class="style1">
<select name="backGround" size="1"
onChange="updateTextColour(this.value);"><!--changeColor(this.selected);"-->
<option value="FF0400" style="color:red">[Red]</option>
<option value="05EF00" style="color:Green">[Green]</option>
<option value="0206FF" style="color:Blue">[Blue]</option>
<option value="000000" selected>[black]</option>
</select></span></span></td>
<td "width:auto" class="style8">Need to change to color row 1</td>
<br><br></tr>
<table>
<tr>
<td id="2" style="width:40px">2</td>
<td id="2" style="width:180px" class="style7">
<span class="style1"><span class="style1">
<select name="backGround2" size="1"
onChange="updateTextColour(this.value);"><!--changeColor(this.selected);"-->
<option value="000000">[Black]</option>
<option value="FF0400" style="color:red">[Red]</option>
<option value="EFE800" style="color:Yellow">[Yellow]</option>
<option value="05EF00" style="color:Green">[Green]</option>
<option value="0206FF" style="color:Blue">[Blue]</option>
<option value="FFFFFF" selected>[White]</option>
</select></span></span> </td>
<td "width:auto" class="style8">Need to change to color row 2</td>
</tr>
</table></table>
</form>
</body>
1 down vote favorite
I have a dropdown list of different colors on one row, and when list
selected, i would like to change a value of text color on that row to the
value of the selection. Each row have one field of dropdown list,
everytime user select dropdown list all the field on that will change the
same color. Thanks in advance,
<html>
<head>
<script type="text/javascript">
function updateTextColour(value) {
if (dropdownList.value > 0) {
dropdownList.style.color = 'red';
//document.body.style.color = '#' + value;
} }
</script>
<style type="text/css">.style1 {color: #FF0000;}</style
</head>
<body>
<form>Change the text color: <br>
<table>
<tr>
<td id="1" style="width:40px">1</td>
<td id="1" style="width:180px" class="style7">
<span class="style1"><span class="style1">
<select name="backGround" size="1"
onChange="updateTextColour(this.value);"><!--changeColor(this.selected);"-->
<option value="FF0400" style="color:red">[Red]</option>
<option value="05EF00" style="color:Green">[Green]</option>
<option value="0206FF" style="color:Blue">[Blue]</option>
<option value="000000" selected>[black]</option>
</select></span></span></td>
<td "width:auto" class="style8">Need to change to color row 1</td>
<br><br></tr>
<table>
<tr>
<td id="2" style="width:40px">2</td>
<td id="2" style="width:180px" class="style7">
<span class="style1"><span class="style1">
<select name="backGround2" size="1"
onChange="updateTextColour(this.value);"><!--changeColor(this.selected);"-->
<option value="000000">[Black]</option>
<option value="FF0400" style="color:red">[Red]</option>
<option value="EFE800" style="color:Yellow">[Yellow]</option>
<option value="05EF00" style="color:Green">[Green]</option>
<option value="0206FF" style="color:Blue">[Blue]</option>
<option value="FFFFFF" selected>[White]</option>
</select></span></span> </td>
<td "width:auto" class="style8">Need to change to color row 2</td>
</tr>
</table></table>
</form>
</body>
Why is an Entity Framework 5 TransactionScope transaction subject to the Machine.Config System.Transaction timeout?
Why is an Entity Framework 5 TransactionScope transaction subject to the
Machine.Config System.Transaction timeout?
As I understand TransactionScope transactions, a transaction may be be
elevated to the distributed transaction controller under certain
circumstances.
According to this question and this post there was an issue when using
Entity Framework and SQL Server 2005 where transactions would be elevated,
but it should not happen when using SQL Server 2008 or above.
I am using EF5 and SQL 2008 and my transaction was timing out after 10
minutes. I could extend this timeout only by changing the
System.Transaction timeout value in my machine config.
I thought that System.Transaction timeout was only the timeout value for
the DTC.
So my question: Would the System.Transaction timeout set the value for all
transactions, not just a distributed one, or is my transaction been
elevated?
Machine.Config System.Transaction timeout?
As I understand TransactionScope transactions, a transaction may be be
elevated to the distributed transaction controller under certain
circumstances.
According to this question and this post there was an issue when using
Entity Framework and SQL Server 2005 where transactions would be elevated,
but it should not happen when using SQL Server 2008 or above.
I am using EF5 and SQL 2008 and my transaction was timing out after 10
minutes. I could extend this timeout only by changing the
System.Transaction timeout value in my machine config.
I thought that System.Transaction timeout was only the timeout value for
the DTC.
So my question: Would the System.Transaction timeout set the value for all
transactions, not just a distributed one, or is my transaction been
elevated?
How to remove trailing slash from URL in nginx only if directory doesn't exist?
How to remove trailing slash from URL in nginx only if directory doesn't
exist?
I am running a server on nginx 1.4.1 with PHP-FastCGI. Currently I have it
setup so that it removes trailing slashes from my URLs. However, when I
visit a directory that exists, I am forced into a redirect loop. My
current document root looks like this:
- index.php (app)
- webgrind
- index.php
- static
- css
Currently I cannot visit example.com/webgrind or any other directory. My
access logs repeatedly read similar to:
GET /webgrind/ HTTP/1.1" 301 178 "-"
GET /webgrind HTTP/1.1" 301 178 "-"
This is the server block in my nginx.conf:
server {
listen 80;
server_name example.com;
location / {
try_files $uri $uri/ /index.php?$args;
root /var/www/example/public;
index index.php index.html index.htm;
}
rewrite ^/(.*)/$ /$1 permanent;
location = /favicon.ico {
access_log off;
log_not_found off;
}
location ~ \.php$ {
try_files $uri $uri/ /index.php?$args;
root /var/www/example/public;
index index.php index.html index.htm;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
/var/www/example/public$fastcgi_script_name;
fastcgi_param APPLICATION_ENV testing;
fastcgi_param PATH /usr/bin:/bin:/usr/sbin:/sbin;
fastcgi_intercept_errors on;
include fastcgi_params;
}
}
I am aware that rewrite ^/(.*)/$ /$1 permanent; is the offending line. If
I remove it and visit example.com/webgrind, a 301 is issued for me to
redirect to example.com/webgrind/ since it is a directory. However, my
application will accept both trailing and non-trailing slashes (i.e.
example.com/users/ and example.com/users) and this is not what I want.
Wrapping the 'if' directive around my rewrite as follows still creates a
redirect loop for my directories (if is evil, apparently, but a rewrite
directive in this case is considered safe):
if (!-d $request_filename) {
rewrite ^/(.*)/$ /$1 permanent;
}
(I know that visiting webgrind/index.php would solve my problem, but I'd
like to avoid costly and unprofessional redirect loops when my production
directories are pushed live.)
So how can I conditionally strip trailing slashes only for resources that
don't exist (my web application paths)?
exist?
I am running a server on nginx 1.4.1 with PHP-FastCGI. Currently I have it
setup so that it removes trailing slashes from my URLs. However, when I
visit a directory that exists, I am forced into a redirect loop. My
current document root looks like this:
- index.php (app)
- webgrind
- index.php
- static
- css
Currently I cannot visit example.com/webgrind or any other directory. My
access logs repeatedly read similar to:
GET /webgrind/ HTTP/1.1" 301 178 "-"
GET /webgrind HTTP/1.1" 301 178 "-"
This is the server block in my nginx.conf:
server {
listen 80;
server_name example.com;
location / {
try_files $uri $uri/ /index.php?$args;
root /var/www/example/public;
index index.php index.html index.htm;
}
rewrite ^/(.*)/$ /$1 permanent;
location = /favicon.ico {
access_log off;
log_not_found off;
}
location ~ \.php$ {
try_files $uri $uri/ /index.php?$args;
root /var/www/example/public;
index index.php index.html index.htm;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
/var/www/example/public$fastcgi_script_name;
fastcgi_param APPLICATION_ENV testing;
fastcgi_param PATH /usr/bin:/bin:/usr/sbin:/sbin;
fastcgi_intercept_errors on;
include fastcgi_params;
}
}
I am aware that rewrite ^/(.*)/$ /$1 permanent; is the offending line. If
I remove it and visit example.com/webgrind, a 301 is issued for me to
redirect to example.com/webgrind/ since it is a directory. However, my
application will accept both trailing and non-trailing slashes (i.e.
example.com/users/ and example.com/users) and this is not what I want.
Wrapping the 'if' directive around my rewrite as follows still creates a
redirect loop for my directories (if is evil, apparently, but a rewrite
directive in this case is considered safe):
if (!-d $request_filename) {
rewrite ^/(.*)/$ /$1 permanent;
}
(I know that visiting webgrind/index.php would solve my problem, but I'd
like to avoid costly and unprofessional redirect loops when my production
directories are pushed live.)
So how can I conditionally strip trailing slashes only for resources that
don't exist (my web application paths)?
SQL count limiting results
SQL count limiting results
I'm having an issue with following query:
SELECT
badge.name AS badge_name, badge.description, badge.type, badges.time,
user.name AS user_name
FROM
badges LEFT JOIN badge ON badges.badge_name = badge.name LEFT JOIN user
ON user.id=badges.user_id
WHERE
user.name IS NOT NULL
ORDER BY badges.time DESC
LIMIT 5
Now, I'd like to check that the amount of results is not 0, so I check
like I always do with by adding this after the SELECT: count(1) AS
counter. However, this influences the results.
How it should be.
How it is with the count.
I've seen that this might be an issue due to also having a LIMIT, but
what's the most efficient way to circumvent this? I just want to check
whether there are any results returned or not, to display a proper message
it there are no results. I'm using PDO, but since it's a SELECT i can't
use the ->rowCount() to check the amount of rows returned.
EDIT:
I want to determine whether there are any results, yes or no. My normal
way of doing so is using count(1) AS counter, and checking the value of
the counter as follows:
while($row['counter'] = $STH->fetch()){
if($row['counter'] == 0){
// Error message
}else{
echo $row['badge_name'] . "etc...";
}
}
However, this seems to mess up the results due to the LIMIT (check the
SQLFiddles).
So: how can I check this, preferably in a single query?
I'm having an issue with following query:
SELECT
badge.name AS badge_name, badge.description, badge.type, badges.time,
user.name AS user_name
FROM
badges LEFT JOIN badge ON badges.badge_name = badge.name LEFT JOIN user
ON user.id=badges.user_id
WHERE
user.name IS NOT NULL
ORDER BY badges.time DESC
LIMIT 5
Now, I'd like to check that the amount of results is not 0, so I check
like I always do with by adding this after the SELECT: count(1) AS
counter. However, this influences the results.
How it should be.
How it is with the count.
I've seen that this might be an issue due to also having a LIMIT, but
what's the most efficient way to circumvent this? I just want to check
whether there are any results returned or not, to display a proper message
it there are no results. I'm using PDO, but since it's a SELECT i can't
use the ->rowCount() to check the amount of rows returned.
EDIT:
I want to determine whether there are any results, yes or no. My normal
way of doing so is using count(1) AS counter, and checking the value of
the counter as follows:
while($row['counter'] = $STH->fetch()){
if($row['counter'] == 0){
// Error message
}else{
echo $row['badge_name'] . "etc...";
}
}
However, this seems to mess up the results due to the LIMIT (check the
SQLFiddles).
So: how can I check this, preferably in a single query?
Using a footnote in the full name of an acronym
Using a footnote in the full name of an acronym
I would like to use a footnote in the full name of an acronym. Here is the
minimal (not) working example:
\documentclass{report}
\usepackage{acronym}
\usepackage{footnote}
\begin{document}
\begin{acronym}[ABC]
\acro{ABC}{Alphabet\footnote{this does not work}}
\end{acronym}
The \ac{ABC}\footnote{this works}.
\end{document}
I'm already using the acronym package to link acronyms with publications:
\acro{ABC}{Alphabet\cite{publication2013abc}}
But sometimes there is either no publication or a web site is more
appropriate:
\acro{ABC}{Alphabet\footnote{\url{http://website-for-abc.example.org}}}
Any hints?
Best regards, Alex
I would like to use a footnote in the full name of an acronym. Here is the
minimal (not) working example:
\documentclass{report}
\usepackage{acronym}
\usepackage{footnote}
\begin{document}
\begin{acronym}[ABC]
\acro{ABC}{Alphabet\footnote{this does not work}}
\end{acronym}
The \ac{ABC}\footnote{this works}.
\end{document}
I'm already using the acronym package to link acronyms with publications:
\acro{ABC}{Alphabet\cite{publication2013abc}}
But sometimes there is either no publication or a web site is more
appropriate:
\acro{ABC}{Alphabet\footnote{\url{http://website-for-abc.example.org}}}
Any hints?
Best regards, Alex
Classification using LibSVM
Classification using LibSVM
I am using LibSVM to carry out some multi-class classifications. I trained
the model using the MATLAB interface of LibSVM. I then saved this model in
a format that would be recognized in C. I now want to classify using
svm_predict in C. I am having trouble being able to reproduce the results
that I saw in MATLAB. In fact I get the same class output irrespective of
what test vector I feed in (even a vector of zeros) I think the issue is
with the way I am loading the test vector x into the svm_node structure.
Below is the code snippet. Do let me know if this is correct way or if I
am missing something.
struct svm_model *libsvm_model = svm_load_model('mymodel.svm');
struct svm_node x[2001]; // this is for one feature vector of size 2000x1
int index = 1;
int i = 0;
for (i = 0; i < features.size(); i++) {
x[i].index = index;
x[i].value = features.at(i);
index = index + 1;
}
x[i+1].index = -1;
x[i+1].value = '?';
double result = svm_predict(libsvm_model, x);
I am using LibSVM to carry out some multi-class classifications. I trained
the model using the MATLAB interface of LibSVM. I then saved this model in
a format that would be recognized in C. I now want to classify using
svm_predict in C. I am having trouble being able to reproduce the results
that I saw in MATLAB. In fact I get the same class output irrespective of
what test vector I feed in (even a vector of zeros) I think the issue is
with the way I am loading the test vector x into the svm_node structure.
Below is the code snippet. Do let me know if this is correct way or if I
am missing something.
struct svm_model *libsvm_model = svm_load_model('mymodel.svm');
struct svm_node x[2001]; // this is for one feature vector of size 2000x1
int index = 1;
int i = 0;
for (i = 0; i < features.size(); i++) {
x[i].index = index;
x[i].value = features.at(i);
index = index + 1;
}
x[i+1].index = -1;
x[i+1].value = '?';
double result = svm_predict(libsvm_model, x);
Friday, 23 August 2013
jquery ajax asynchronous requests error
jquery ajax asynchronous requests error
at the beginning I would like to say sorry for my bad english.
jquery v2.0.0 in Google Chrome, Mozilla Firefox, Opera last versions
Today I had a problem
timer_multy_update = setInterval(
function()
{
$.get(
'test.php',
function (result){
parseAndUpdateData(result);
},
"json"
);
}, 500)
The problem is that if the server hangs (I don't know how to say it
correctly), i.e. time to get answer from the server more the 0,5 second,
but timer not stay and continues to send request, so before the server
answer it can be send 2-4 request, all this answer return for a little
time and, now a problem, in firebug all request correct, but variable
result contains only one answer from the first answer from the server.
maybe I did not express myself clearly, I want to say that 2-4 request to
the server return different answer, but in result gets all 2-4 times the
first answer from the server, and it is big problem.
I tried to find information on the Internet, but found nothing.
I do not know why but the first thought was that the error in jquery, I
began to look at the source code, and found some mention about heder and
it's hashes. So i try to change my script and find to way
$.get
(
'/php/mine/update_cells.php',
't='+Math.random(),
function (result)
{
parseAndUpdateData(result);
},
"json"
);
it works correctly so I want to now, bug it is or my mistake and not
understanding
at the beginning I would like to say sorry for my bad english.
jquery v2.0.0 in Google Chrome, Mozilla Firefox, Opera last versions
Today I had a problem
timer_multy_update = setInterval(
function()
{
$.get(
'test.php',
function (result){
parseAndUpdateData(result);
},
"json"
);
}, 500)
The problem is that if the server hangs (I don't know how to say it
correctly), i.e. time to get answer from the server more the 0,5 second,
but timer not stay and continues to send request, so before the server
answer it can be send 2-4 request, all this answer return for a little
time and, now a problem, in firebug all request correct, but variable
result contains only one answer from the first answer from the server.
maybe I did not express myself clearly, I want to say that 2-4 request to
the server return different answer, but in result gets all 2-4 times the
first answer from the server, and it is big problem.
I tried to find information on the Internet, but found nothing.
I do not know why but the first thought was that the error in jquery, I
began to look at the source code, and found some mention about heder and
it's hashes. So i try to change my script and find to way
$.get
(
'/php/mine/update_cells.php',
't='+Math.random(),
function (result)
{
parseAndUpdateData(result);
},
"json"
);
it works correctly so I want to now, bug it is or my mistake and not
understanding
Is a 2d array set up in memory contiguously similar to a 1d array simulating a 2d one?
Is a 2d array set up in memory contiguously similar to a 1d array
simulating a 2d one?
Consider the 2 type of array declarations:
T *x = new T[rows * cols]; // type 1
T *y = new T[rows][cols]; // type 2
I usually use the first type ( type 1) where then I know to index using
x[row * cols + col]
however if I want to copy a 2d array into a 1d array simulating a 2d array
ie: copy type2 -> type1. If these are guaranteed to be laid out the same
way in memory can I just do a memcpy of one to the other? Currently I have
a loop as such but if the memory is the same layout in both I am thinking
I can just do a memcpy. Consider the following public constructor below.
public:
// construct a matrix from a 2d array
template <unsigned int N, unsigned int M>
Matrix ( T (&twoDArray)[N][M] ) : rows_(N), cols_(M), matrixData_(new
T[rows_*cols_])
{
// is there a refactor here? Maybe to memcpy?
for ( unsigned int i = 0; i < rows_ ; ++i )
{
for ( unsigned int j = 0; j < cols_ ; ++j )
{
matrixData_[ i * cols_ + j ] = twoDArray[i][j];
}
}
}
private:
unsigned int rows_;
unsigned int cols_;
T* matrixData_;
simulating a 2d one?
Consider the 2 type of array declarations:
T *x = new T[rows * cols]; // type 1
T *y = new T[rows][cols]; // type 2
I usually use the first type ( type 1) where then I know to index using
x[row * cols + col]
however if I want to copy a 2d array into a 1d array simulating a 2d array
ie: copy type2 -> type1. If these are guaranteed to be laid out the same
way in memory can I just do a memcpy of one to the other? Currently I have
a loop as such but if the memory is the same layout in both I am thinking
I can just do a memcpy. Consider the following public constructor below.
public:
// construct a matrix from a 2d array
template <unsigned int N, unsigned int M>
Matrix ( T (&twoDArray)[N][M] ) : rows_(N), cols_(M), matrixData_(new
T[rows_*cols_])
{
// is there a refactor here? Maybe to memcpy?
for ( unsigned int i = 0; i < rows_ ; ++i )
{
for ( unsigned int j = 0; j < cols_ ; ++j )
{
matrixData_[ i * cols_ + j ] = twoDArray[i][j];
}
}
}
private:
unsigned int rows_;
unsigned int cols_;
T* matrixData_;
command export is not in $PATH, yet it can be executed
command export is not in $PATH, yet it can be executed
bash command export can not be found in $PATH, yet it is available to
execute. Similar to that is source. Why is it this way ? Thanks for any
noble answer...
bash command export can not be found in $PATH, yet it is available to
execute. Similar to that is source. Why is it this way ? Thanks for any
noble answer...
What is MasterCard Virtual Payment Client 2-Party Payment Model POST URL
What is MasterCard Virtual Payment Client 2-Party Payment Model POST URL
Alright Just to give you a some background MasterCard VPC. I am working on
Merchant Integration for a client that uses a bank in Taiwan. They use
this MasterCard VPC for direct API integration with my web client/api.
Below is direct quote from there documentation:
"Party Payment Model The 2-Party Payment Model can be used for any payment
application, except where Verifed by Visa™ and MasterCard SecureCode™
Authentication is required. • Data is sent via a form POST to "https:// V
P C _ UR L/vpcdps" • Does not support GET data transfer. The request will
be rejected."
I have used the "" and the response is always host not found. Am I
supposed to know this VPC_URL part? Is it specific to the bank I am
integrating with? This is using a known POST response method that does
work ( for 30 other merchants). Also even if the data I am passing to
through the POST is wrong I should still get a response.
Note: Captured Response from Fiddler
HTTP/1.1 502 Fiddler - DNS Lookup Failed Date: Fri, 23 Aug 2013 15:30:32
GMT Content-Type: text/html; charset=UTF-8 Connection: close Timestamp:
10:30:32.165
[Fiddler] DNS Lookup for "vpc_url" failed. No such host is known
PS: First time asking a question for stackoverflow!
Alright Just to give you a some background MasterCard VPC. I am working on
Merchant Integration for a client that uses a bank in Taiwan. They use
this MasterCard VPC for direct API integration with my web client/api.
Below is direct quote from there documentation:
"Party Payment Model The 2-Party Payment Model can be used for any payment
application, except where Verifed by Visa™ and MasterCard SecureCode™
Authentication is required. • Data is sent via a form POST to "https:// V
P C _ UR L/vpcdps" • Does not support GET data transfer. The request will
be rejected."
I have used the "" and the response is always host not found. Am I
supposed to know this VPC_URL part? Is it specific to the bank I am
integrating with? This is using a known POST response method that does
work ( for 30 other merchants). Also even if the data I am passing to
through the POST is wrong I should still get a response.
Note: Captured Response from Fiddler
HTTP/1.1 502 Fiddler - DNS Lookup Failed Date: Fri, 23 Aug 2013 15:30:32
GMT Content-Type: text/html; charset=UTF-8 Connection: close Timestamp:
10:30:32.165
[Fiddler] DNS Lookup for "vpc_url" failed. No such host is known
PS: First time asking a question for stackoverflow!
Why does CORS apply on localhost when using 'lvh.me'?
Why does CORS apply on localhost when using 'lvh.me'?
I was having an issue with CORS in my Rails App and my JS front-end app,
before I used rack-cors (https://github.com/cyu/rack-cors).
The JS front-end app will be a subdomain of my Rails app. So I should not
be having this issue in production. However on local, I am running my
front-end app on a server with:
python -m SimpleHTTPServer
I then access it via http://dashboard.lvh.me:8000. All calls are made to
the backend rails app to api.lvh.me:3000.
When doing requests without handling CORS, I get a CORS error. Why am I
getting a CORS error when both are on the same subdomain (lvh.me)? This
happened in all browsers.
Why do I need to use rack-cors? Will this also happen in production? Right
now, I am just running rails s. When using nginx, will this go away when
both are on the same domain, but different subdomains?
I was having an issue with CORS in my Rails App and my JS front-end app,
before I used rack-cors (https://github.com/cyu/rack-cors).
The JS front-end app will be a subdomain of my Rails app. So I should not
be having this issue in production. However on local, I am running my
front-end app on a server with:
python -m SimpleHTTPServer
I then access it via http://dashboard.lvh.me:8000. All calls are made to
the backend rails app to api.lvh.me:3000.
When doing requests without handling CORS, I get a CORS error. Why am I
getting a CORS error when both are on the same subdomain (lvh.me)? This
happened in all browsers.
Why do I need to use rack-cors? Will this also happen in production? Right
now, I am just running rails s. When using nginx, will this go away when
both are on the same domain, but different subdomains?
Open Source VPN Client for Mac?
Open Source VPN Client for Mac?
Hello i am looking for a good open source VPN client(MAC) which has made
its source code available so that i can modify it to redirect all HTTP
port 80 traffic to specific configured IP. I have tried
tunnelblick(tunnelblick github) but its source code wont run on xCode 4.6
citing Unsupported compiler 'GCC 4.2' selected for architecture 'i386'
issue. Can any one tell me how to successfully redirect particular port
traffic to a configured IP or any good open source VPN client which can be
modified?
Hello i am looking for a good open source VPN client(MAC) which has made
its source code available so that i can modify it to redirect all HTTP
port 80 traffic to specific configured IP. I have tried
tunnelblick(tunnelblick github) but its source code wont run on xCode 4.6
citing Unsupported compiler 'GCC 4.2' selected for architecture 'i386'
issue. Can any one tell me how to successfully redirect particular port
traffic to a configured IP or any good open source VPN client which can be
modified?
Thursday, 22 August 2013
RowDefinition not working Properly in VIewBox in Windows8
RowDefinition not working Properly in VIewBox in Windows8
I have created a ViewBox in which I am designing my screen Xaml is like
this->
<Viewbox x:Name="viewbox" Stretch="Fill" >
<Grid>
<Grid.Background>
<ImageBrush ImageSource="/JumblerGame/Images/asd.png" Stretch="Fill"
AlignmentX="Left" AlignmentY="Top"/>
</Grid.Background>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="3*" />
</Grid.RowDefinitions>
<Grid Grid.Row="1" VerticalAlignment="Bottom">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Image Source="/JumblerGame/Images/qwe.png" Stretch="None" Margin="10"
x:Name="imageplay" Tapped="imageplay_Tapped" />
</Grid>
<Grid Grid.Row="1">
<Image Source="/JumblerGame/Images/bnm.png" Stretch="Uniform" Margin="10"
x:Name="imagesetting"/>
</Grid>
<Grid Grid.Row="2">
<Image Source="/JumblerGame/Images/zxc.png" Stretch="Uniform"
Margin="10,10,10,10" x:Name="imagehelp"/>
<Image Source="/JumblerGame/Images/yu.png" Stretch="Uniform"
VerticalAlignment="Bottom" HorizontalAlignment="Left"
Margin="100,50,100,40" />
<Image Source="/JumblerGame/Images/info.png" Stretch="Uniform"
VerticalAlignment="Bottom" HorizontalAlignment="Left"
Margin="130,50,100,60" />
</Grid>
</Grid>
</Grid>
</Viewbox>
As you can see I have Defined 2 RowDefinitions(Height=2*,Height=3*) for
the Grid and I am working on Row 1 of the Grid but this Row is Taking Full
screen(Space of row 0 too).I want it to be in Row 1 only.
How can I resolve this.???
I have created a ViewBox in which I am designing my screen Xaml is like
this->
<Viewbox x:Name="viewbox" Stretch="Fill" >
<Grid>
<Grid.Background>
<ImageBrush ImageSource="/JumblerGame/Images/asd.png" Stretch="Fill"
AlignmentX="Left" AlignmentY="Top"/>
</Grid.Background>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="3*" />
</Grid.RowDefinitions>
<Grid Grid.Row="1" VerticalAlignment="Bottom">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Image Source="/JumblerGame/Images/qwe.png" Stretch="None" Margin="10"
x:Name="imageplay" Tapped="imageplay_Tapped" />
</Grid>
<Grid Grid.Row="1">
<Image Source="/JumblerGame/Images/bnm.png" Stretch="Uniform" Margin="10"
x:Name="imagesetting"/>
</Grid>
<Grid Grid.Row="2">
<Image Source="/JumblerGame/Images/zxc.png" Stretch="Uniform"
Margin="10,10,10,10" x:Name="imagehelp"/>
<Image Source="/JumblerGame/Images/yu.png" Stretch="Uniform"
VerticalAlignment="Bottom" HorizontalAlignment="Left"
Margin="100,50,100,40" />
<Image Source="/JumblerGame/Images/info.png" Stretch="Uniform"
VerticalAlignment="Bottom" HorizontalAlignment="Left"
Margin="130,50,100,60" />
</Grid>
</Grid>
</Grid>
</Viewbox>
As you can see I have Defined 2 RowDefinitions(Height=2*,Height=3*) for
the Grid and I am working on Row 1 of the Grid but this Row is Taking Full
screen(Space of row 0 too).I want it to be in Row 1 only.
How can I resolve this.???
Heroku Postgre Crane DB vs Linode 1GB with Postgre installed
Heroku Postgre Crane DB vs Linode 1GB with Postgre installed
I'm trying to decide between using the Heroku Crane PostgreSQL database
($50/month - https://postgres.heroku.com/pricing) or setting up a Linode
1GB Ram / 8 CPU / 48GB Storage / 2TB Transfer instance with PostgreSQL
installed ($20/month - https://www.linode.com/).
I know that from a management perspective, using Heroku Crane Postgre
would be much easier, as everything is managed with security and backups
taken care of.
What I was curious about is how performance of the two databases would
compare. With the Linode 1GB / 8 CPU instance, only my database will be
used on it. I see with Heroku Crane that it says it only gets 400 MB RAM.
It also isn't clear with Heroku Crane how many CPU's I get and whether its
a dedicated instance.
Does the Heroku DB manages the RAM/Cache of the DB more efficiently? Its
unclear to me whether the Linode Postgre instance would automatically use
the 1GB RAM available to it efficiently, or if it would require custom
setup on my part to ensure the DB is loaded into RAM.
If it is that the Heroku DB would be less performant for the money, but is
a better deal because security, backups and management are taken care of,
that is probably acceptable, I just want to understand the tradeoffs.
Thanks for any info people can provide. I'm new to DB management, and have
been using a Linode 1GB instance with Postgre installed for development
and testing, but now that I'm going to production, am questioning whether
to move over to Heroku Crane. Also, not sure if this matters, but my
server is hosted through Heroku web instances.
I'm trying to decide between using the Heroku Crane PostgreSQL database
($50/month - https://postgres.heroku.com/pricing) or setting up a Linode
1GB Ram / 8 CPU / 48GB Storage / 2TB Transfer instance with PostgreSQL
installed ($20/month - https://www.linode.com/).
I know that from a management perspective, using Heroku Crane Postgre
would be much easier, as everything is managed with security and backups
taken care of.
What I was curious about is how performance of the two databases would
compare. With the Linode 1GB / 8 CPU instance, only my database will be
used on it. I see with Heroku Crane that it says it only gets 400 MB RAM.
It also isn't clear with Heroku Crane how many CPU's I get and whether its
a dedicated instance.
Does the Heroku DB manages the RAM/Cache of the DB more efficiently? Its
unclear to me whether the Linode Postgre instance would automatically use
the 1GB RAM available to it efficiently, or if it would require custom
setup on my part to ensure the DB is loaded into RAM.
If it is that the Heroku DB would be less performant for the money, but is
a better deal because security, backups and management are taken care of,
that is probably acceptable, I just want to understand the tradeoffs.
Thanks for any info people can provide. I'm new to DB management, and have
been using a Linode 1GB instance with Postgre installed for development
and testing, but now that I'm going to production, am questioning whether
to move over to Heroku Crane. Also, not sure if this matters, but my
server is hosted through Heroku web instances.
Reading all arrays
Reading all arrays
Im making a simple validation form system (over my raw php MCV framework)
on PHP but Im having an issue I cant fix
I have this code
$credentials = array('name' => 'required', 'password' =>
'required|between');
$validator = new Validation;
if (!$validator->check($credentials, array(5, 10)))
Redirect::to('/login', 'error', $validator->msg);
Then my class calidator looks like
public function check($fields, $size)
{
foreach ($fields as $key => $val)
{
$rule = explode('|', $val);
if (in_array('required', $rule))
{
if (empty($_POST[$key]))
{
$this->msg = 'Field '.$key.' is required';
$this->final = false;
}
}
elseif (in_array('between', $rule))
{
if (strlen($_POST[$key]) < $size[0])
{
$this->msg = 'Filed '.$key.' must be between '.$size[0].'
and '.$size[1].' chars';
$this->final = false;
}
if (strlen($_POST[$key]) > $size[1])
{
$this->msg = 'Filed '.$key.' must be between '.$size[0].'
and '.$size[1].' chars';
$this->final = false;
}
}
}
if (!$final)
{
return false;
}
else
{
return true;
}
}
The thing is that when I send the array like this ( with just 1 rule )
$credentials = array('name' => 'required', 'password' => 'between');
It works fine but if I add more rules (required|between ...) my function
will just work with the first one so in this case the between rule is
ignored...
Im making a simple validation form system (over my raw php MCV framework)
on PHP but Im having an issue I cant fix
I have this code
$credentials = array('name' => 'required', 'password' =>
'required|between');
$validator = new Validation;
if (!$validator->check($credentials, array(5, 10)))
Redirect::to('/login', 'error', $validator->msg);
Then my class calidator looks like
public function check($fields, $size)
{
foreach ($fields as $key => $val)
{
$rule = explode('|', $val);
if (in_array('required', $rule))
{
if (empty($_POST[$key]))
{
$this->msg = 'Field '.$key.' is required';
$this->final = false;
}
}
elseif (in_array('between', $rule))
{
if (strlen($_POST[$key]) < $size[0])
{
$this->msg = 'Filed '.$key.' must be between '.$size[0].'
and '.$size[1].' chars';
$this->final = false;
}
if (strlen($_POST[$key]) > $size[1])
{
$this->msg = 'Filed '.$key.' must be between '.$size[0].'
and '.$size[1].' chars';
$this->final = false;
}
}
}
if (!$final)
{
return false;
}
else
{
return true;
}
}
The thing is that when I send the array like this ( with just 1 rule )
$credentials = array('name' => 'required', 'password' => 'between');
It works fine but if I add more rules (required|between ...) my function
will just work with the first one so in this case the between rule is
ignored...
Selecting non-tagged text in div
Selecting non-tagged text in div
I have a huge page with a lot of text not specifically tagged within a
text tag (h3, h1, p, whatever). So, stuff like this:
<div class="class">Here's some text that really should be in a p tag, but
oh well</div>
I would like to be able to select all this text at once using jQuery, but
I don't know how to select the text that isn't in a text-specific tag. Is
there some implied tag or something, so that I can go like $('text') and
call it a day?
I have a huge page with a lot of text not specifically tagged within a
text tag (h3, h1, p, whatever). So, stuff like this:
<div class="class">Here's some text that really should be in a p tag, but
oh well</div>
I would like to be able to select all this text at once using jQuery, but
I don't know how to select the text that isn't in a text-specific tag. Is
there some implied tag or something, so that I can go like $('text') and
call it a day?
Communicate between server and client
Communicate between server and client
I have a controller action which imports an uploaded excel file into a
database. The import can take several minutes. How can I report the
progress of the import to the client? I know that I have to use ajax but I
could not find any clean code which would be ideal to report a progress.
I am quite new to mvc4 and asp.net. So I would like to hear your
advices/approaches to solve my problem. I would like to write a solid and
clean solution but I really don't know how to start.
Would be very nice if anyone would have any experience in reporting the
progress to the client.
I have a controller action which imports an uploaded excel file into a
database. The import can take several minutes. How can I report the
progress of the import to the client? I know that I have to use ajax but I
could not find any clean code which would be ideal to report a progress.
I am quite new to mvc4 and asp.net. So I would like to hear your
advices/approaches to solve my problem. I would like to write a solid and
clean solution but I really don't know how to start.
Would be very nice if anyone would have any experience in reporting the
progress to the client.
Get GLSL linker error description on Windows
Get GLSL linker error description on Windows
It seems that glGetProgramInfoLog (and a matching function pointer type
PFNGLGETPROGRAMINFOLOGARBPROC) are undefined in Windows' OpenGL header and
the function also seems to be missing from the DLL – I didn't find the
string "wglGetProgram" in opengl32.dll.
Is there another way to get the same functionality on Windows?
glGetInfoLogARB seems to be an alternative but always returns empty
strings on mobile platforms, so i guess there's a difference to
glGetProgramInfoLog?!
It seems that glGetProgramInfoLog (and a matching function pointer type
PFNGLGETPROGRAMINFOLOGARBPROC) are undefined in Windows' OpenGL header and
the function also seems to be missing from the DLL – I didn't find the
string "wglGetProgram" in opengl32.dll.
Is there another way to get the same functionality on Windows?
glGetInfoLogARB seems to be an alternative but always returns empty
strings on mobile platforms, so i guess there's a difference to
glGetProgramInfoLog?!
Is it $\sigma$-ring?
Is it $\sigma$-ring?
Is it true that if a (not empty) class of sets is closed under the
symmetric differences ($A\Delta B:=(A-B)\cup(B-A)$) and countable
intersections, then it is a $\sigma$-ring? I proved that ring. I have
problem with the countable infinite union.
Is it true that if a (not empty) class of sets is closed under the
symmetric differences ($A\Delta B:=(A-B)\cup(B-A)$) and countable
intersections, then it is a $\sigma$-ring? I proved that ring. I have
problem with the countable infinite union.
Wednesday, 21 August 2013
How to configure multiple domain on single hosting
How to configure multiple domain on single hosting
I would multiple domain on single hosting. My project files inside this
hosting plan. I run same server.
How to multiple hosting (vhost) acccess to my project files?
For example: my project files in:
/var/www/virtual/myproject.com/htdocs
and clients...
/var/www/virtual/myclient1.com/htdocs
/var/www/virtual/myclient2.com/htdocs
When access to www.myclient1.com run project file.
Please help me.
I would multiple domain on single hosting. My project files inside this
hosting plan. I run same server.
How to multiple hosting (vhost) acccess to my project files?
For example: my project files in:
/var/www/virtual/myproject.com/htdocs
and clients...
/var/www/virtual/myclient1.com/htdocs
/var/www/virtual/myclient2.com/htdocs
When access to www.myclient1.com run project file.
Please help me.
Testing icon change for app update
Testing icon change for app update
I'm getting ready to submit an update for an app, and this is how I'm
testing the update on my devices before I submit it:
Download the app from the App Store, run it and close out of it
Build from XCode to the device
On the iPad, when the app builds, the old icon is replaced with the new
icon. On the iPhone, there is no change to the icon. The app running is
the new version, but the icon stays the same.
I've tried running "Clean", restarting the device, restarting Xcode,
restarting my Mac, deleting all the files in the "build" folder of the
app's directory, and also renaming the icon files to be the same file
names as were in the original version (that was suggested in another
stackoverflow thread). All the icon file names are correctly listed in the
.plist file. I'm using Xcode 4.6.3
Anybody else have this issue with the icon not updating on an iPhone? As I
said, the icon DOES update properly on the iPad, so it seems like a fluke
issue...
Thanks in advance!
I'm getting ready to submit an update for an app, and this is how I'm
testing the update on my devices before I submit it:
Download the app from the App Store, run it and close out of it
Build from XCode to the device
On the iPad, when the app builds, the old icon is replaced with the new
icon. On the iPhone, there is no change to the icon. The app running is
the new version, but the icon stays the same.
I've tried running "Clean", restarting the device, restarting Xcode,
restarting my Mac, deleting all the files in the "build" folder of the
app's directory, and also renaming the icon files to be the same file
names as were in the original version (that was suggested in another
stackoverflow thread). All the icon file names are correctly listed in the
.plist file. I'm using Xcode 4.6.3
Anybody else have this issue with the icon not updating on an iPhone? As I
said, the icon DOES update properly on the iPad, so it seems like a fluke
issue...
Thanks in advance!
Web.Config doesn't recognize my class
Web.Config doesn't recognize my class
The goal
Make the Web.Config recognize my MembershipUserProvider class.
The problem
Take a look in my Web.Config:
<membership defaultProvider="MembershipUserProvider">
<providers>
<clear/>
<add name="MembershipUserProvider"
type="App.Security.MembershipUserProvider"
applicationName="/"
passwordFormat="Encrypted"/>
</providers>
</membership>
When I run my application, I get the following error:
Description: An error occurred during the processing of a configuration
file required to service this request. Please review the specific error
details below and modify your configuration file appropriately.
Parser Error Message: This method cannot be called during the
application's pre-start initialization phase.
Why doesn't Web.Config recognize my class?
The goal
Make the Web.Config recognize my MembershipUserProvider class.
The problem
Take a look in my Web.Config:
<membership defaultProvider="MembershipUserProvider">
<providers>
<clear/>
<add name="MembershipUserProvider"
type="App.Security.MembershipUserProvider"
applicationName="/"
passwordFormat="Encrypted"/>
</providers>
</membership>
When I run my application, I get the following error:
Description: An error occurred during the processing of a configuration
file required to service this request. Please review the specific error
details below and modify your configuration file appropriately.
Parser Error Message: This method cannot be called during the
application's pre-start initialization phase.
Why doesn't Web.Config recognize my class?
jQuery not sliding correctly
jQuery not sliding correctly
jQuery isn't sliding when the first checkbox is clicked. I believe it is
the correct syntax, but I am not sure. I have looked at it in multiple
browsers, even uploading it to a website. but all to no avail. What is
wrong with my code?
<!DOCTYPE html>
<html>
<title>Test</title>
<head><script
src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</script>
<script>$(document).ready(function(){
$('#test1').click(function(){
if ($(this).attr('checked')) {
$('#test12').slideUp('fast');
} else {
$('#test12').slideDown('fast');
}
});
});
</script>
</head>
<body>
<h1>form test</h1>
<span><input id="test1" type="checkbox">Hello<br></span>
<span><input id="test12" type="checkbox">Yo</span>
</body>
</html>
jQuery isn't sliding when the first checkbox is clicked. I believe it is
the correct syntax, but I am not sure. I have looked at it in multiple
browsers, even uploading it to a website. but all to no avail. What is
wrong with my code?
<!DOCTYPE html>
<html>
<title>Test</title>
<head><script
src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</script>
<script>$(document).ready(function(){
$('#test1').click(function(){
if ($(this).attr('checked')) {
$('#test12').slideUp('fast');
} else {
$('#test12').slideDown('fast');
}
});
});
</script>
</head>
<body>
<h1>form test</h1>
<span><input id="test1" type="checkbox">Hello<br></span>
<span><input id="test12" type="checkbox">Yo</span>
</body>
</html>
Constructing examples
Constructing examples
Problem1. Help me. Construct a sequence of continuous functions $\Phi_n$
satisfying the conditions 1. supp $\Phi_n \subset (1, n)$. 2. $0 \leq
\Phi_n \leq 1$. 3. $\lim\limits_{n \to \infty}\int_1^n
\dfrac{\Phi_n(\tau)}{\tau}d\tau = \infty$.
Problem 2. Construct a sequence $f_n(t)$ of bounded functions on $[0,1]$
converging to zero in $L^1$ so that $f_n$ converges at no point in
$[0,1]$.
Problem1. Help me. Construct a sequence of continuous functions $\Phi_n$
satisfying the conditions 1. supp $\Phi_n \subset (1, n)$. 2. $0 \leq
\Phi_n \leq 1$. 3. $\lim\limits_{n \to \infty}\int_1^n
\dfrac{\Phi_n(\tau)}{\tau}d\tau = \infty$.
Problem 2. Construct a sequence $f_n(t)$ of bounded functions on $[0,1]$
converging to zero in $L^1$ so that $f_n$ converges at no point in
$[0,1]$.
cakephp access through models
cakephp access through models
I try to code a order system and it is my first cake project.
i have a order, a user and a useraddress.
//Order model
public $belongsTo = array(
'User' => array(
'className' => 'User'
));
//User model
public $hasOne = array(
'Useradr' => array(
'className' => 'Useradr',
'foreignKey' => 'user_id',
'order' => ''
)
);
//maybe not necessary Useradr model
public $belongsTo = 'User';
Now i want to access the useraddress while i add/edit a voucher.
I can access the User in the voucher edit view:
echo $this->Form->input('User.email',array(
'label' => 'Email',
));
But not the Useraddress. What iam doing wrong ?
Thank you very much!
Julius
I try to code a order system and it is my first cake project.
i have a order, a user and a useraddress.
//Order model
public $belongsTo = array(
'User' => array(
'className' => 'User'
));
//User model
public $hasOne = array(
'Useradr' => array(
'className' => 'Useradr',
'foreignKey' => 'user_id',
'order' => ''
)
);
//maybe not necessary Useradr model
public $belongsTo = 'User';
Now i want to access the useraddress while i add/edit a voucher.
I can access the User in the voucher edit view:
echo $this->Form->input('User.email',array(
'label' => 'Email',
));
But not the Useraddress. What iam doing wrong ?
Thank you very much!
Julius
How to create demo video for a startup like as in google+
How to create demo video for a startup like as in google+
I have a new startup which I want to show to my users. I need to
demonstrate basic idea of the project and show how to use it. I like
google+ video I want create the similar for my startup :) Is there any
software for making that video as simple as possible?
I have a new startup which I want to show to my users. I need to
demonstrate basic idea of the project and show how to use it. I like
google+ video I want create the similar for my startup :) Is there any
software for making that video as simple as possible?
Tuesday, 20 August 2013
Instantiating objects within result sets... best practices?
Instantiating objects within result sets... best practices?
I'm developing an intranet site for reporting on data. I've developed
various classes for Customer, Order, Item, Invoice, etc that all relate to
each other in one way or another. Each class constructor queries a MySQL
database (multiple queries) and populates the properties accordingly.
Currently, to try and keep code convenient and consistent, I'm relying a
lot on instantiating classes in my reporting. The problem is, each class
constructor may have a bunch of MySQL queries within them, pulling or
calculating relevant properties from various sources. This causes a
performance hit because of all the queries within loops. It's usable, and
I wont ever have a ton of users at once.. but it could be much faster.
For example, let's say I'm listing the last 50 orders from a customer. The
way I'm doing it now, I'll typically write a simple query that returns the
50 order ID's alone for that customer. Then while looping through the
results, I'll instantiate a new order for each results. Sometimes I may
even go one level deeper and then instantiate a new object for each item
within the order.
Some pseudocode to give the idea....
$result = mysql_query("SELECT DISTINCT id FROM orders WHERE customer =
1234 LIMIT 50");
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
$order = new Order($row['id']); // more MySQL queries happen in
constructor
// All of my properties are pre-calculated and formatted
// properly within the class, preventing me from having to redo it
manually
// any time I perform queries on orders
echo $order->number;
echo $order->date;
echo $order->total;
foreach($order->items as $oitem) {
$item = new Item($oitem); // even more MySQL queries happen here
echo $item->number;
echo $item->description;
}
}
I may only use a few of the object properties in a summary row, but when I
drill down and view an order in more detail, the Order class has all the
properties I need ready to go, nice and tidy.
What's the best way this is typically handled? For my summary queries,
should I try to avoid instantiating classes and get everything in one
query that's separate from the class? I'm worried that will cause me to
have to manually do a lot of background work I typically do within the
class every single time I do a result set query. I'd rather make a change
in one spot and have it reflect on all the pages that I'm querying the
effected classes/properties.
What are other ways to handle this appropriately?
I'm developing an intranet site for reporting on data. I've developed
various classes for Customer, Order, Item, Invoice, etc that all relate to
each other in one way or another. Each class constructor queries a MySQL
database (multiple queries) and populates the properties accordingly.
Currently, to try and keep code convenient and consistent, I'm relying a
lot on instantiating classes in my reporting. The problem is, each class
constructor may have a bunch of MySQL queries within them, pulling or
calculating relevant properties from various sources. This causes a
performance hit because of all the queries within loops. It's usable, and
I wont ever have a ton of users at once.. but it could be much faster.
For example, let's say I'm listing the last 50 orders from a customer. The
way I'm doing it now, I'll typically write a simple query that returns the
50 order ID's alone for that customer. Then while looping through the
results, I'll instantiate a new order for each results. Sometimes I may
even go one level deeper and then instantiate a new object for each item
within the order.
Some pseudocode to give the idea....
$result = mysql_query("SELECT DISTINCT id FROM orders WHERE customer =
1234 LIMIT 50");
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
$order = new Order($row['id']); // more MySQL queries happen in
constructor
// All of my properties are pre-calculated and formatted
// properly within the class, preventing me from having to redo it
manually
// any time I perform queries on orders
echo $order->number;
echo $order->date;
echo $order->total;
foreach($order->items as $oitem) {
$item = new Item($oitem); // even more MySQL queries happen here
echo $item->number;
echo $item->description;
}
}
I may only use a few of the object properties in a summary row, but when I
drill down and view an order in more detail, the Order class has all the
properties I need ready to go, nice and tidy.
What's the best way this is typically handled? For my summary queries,
should I try to avoid instantiating classes and get everything in one
query that's separate from the class? I'm worried that will cause me to
have to manually do a lot of background work I typically do within the
class every single time I do a result set query. I'd rather make a change
in one spot and have it reflect on all the pages that I'm querying the
effected classes/properties.
What are other ways to handle this appropriately?
What's one thing you always wanted to learn about computer programming but were afraid to? [on hold]
What's one thing you always wanted to learn about computer programming but
were afraid to? [on hold]
What's one thing you always wanted to learn about computer programming but
were afraid to?
Personally for me it's the floating point numbers. I get freaked out by
things like precision, rounding, representation, base, exponent, and all
the other floating point things. So I've never mastered it and I don't
even know what's the difference between float and double.
were afraid to? [on hold]
What's one thing you always wanted to learn about computer programming but
were afraid to?
Personally for me it's the floating point numbers. I get freaked out by
things like precision, rounding, representation, base, exponent, and all
the other floating point things. So I've never mastered it and I don't
even know what's the difference between float and double.
TCP Client - loop in communication
TCP Client - loop in communication
I am writing a program which goal is to communicate with the weight
terminal using TCP client. I'm sending specified messages (eg. checking
status) and depending on the replies I'm making some another process.
First, some code. Connection:
public static void PolaczZWaga(string IP, int port)
{
IP = IP.Replace(" ", "");
KlientTCP = new TcpClient();
KlientTCP.Connect(IPAddress.Parse(IP), port);
}
Sending message (eg. checking status)
public static string OdczytDanychZWagi(byte[] WysylaneZapytanie)
{
// Wysy³ka komunikatu do pod³¹czonego serwera TCP
byte[] GotoweZapytanie =
KomunikatyWspolne.PoczatekKomunikacji.Concat(WysylaneZapytanie).Concat(KomunikatyWspolne.KoniecKumunikacji).ToArray();
NetworkStream stream = KlientTCP.GetStream();
stream.Write(GotoweZapytanie, 0, GotoweZapytanie.Length);
// Otrzymanie odpowiedzi
// Buffor na odpowiedz
byte[] odpowiedz = new Byte[256];
// String do przechowywania odpowiedzi w ASCII
String responseData = String.Empty;
// Odczyt danych z serwera
Int32 bytes = stream.Read(odpowiedz, 0, odpowiedz.Length);
responseData = System.Text.Encoding.ASCII.GetString(odpowiedz, 0,
bytes);
return responseData;
}
After Form1 open I make an connection and checking status
string odp =
KomunikacjaSieciowa.OdczytDanychZWagi(OdczytZWagi.Kom_RejestrStatusu);
char status = odp[0];
switch(status)
{
case 'B':
KomunikacjaSieciowa.WysylkaDoWyswietlaczaWagi_4linie(WysylkaDoWyswietlacza_Komunikaty.LogWitaj,
WysylkaDoWyswietlacza_Komunikaty.LogZaloguj,
WysylkaDoWyswietlacza_Komunikaty.PustaLinia,
WysylkaDoWyswietlacza_Komunikaty.LogNrOperatora);
string NrOperatora =
KomunikacjaSieciowa.OdczytDanychZWagi(OdczytZWagi.Kom_ZatwierdzoneF1);
//int NrOperatora_int = Convert.ToInt32(NrOperatora);
break;
// here goes next case etc
Here starts my problem - communication takes place only once and the
operation requires data on the terminal. Before the operator enters data
program ends. How to change the code / loop / add a timer to repeated
communication to achieve a certain status? More specifically, as in this
passage:
case 'B':
KomunikacjaSieciowa.WysylkaDoWyswietlaczaWagi_4linie(WysylkaDoWyswietlacza_Komunikaty.LogWitaj,
WysylkaDoWyswietlacza_Komunikaty.LogZaloguj,
WysylkaDoWyswietlacza_Komunikaty.PustaLinia,
WysylkaDoWyswietlacza_Komunikaty.LogNrOperatora);
string NrOperatora =
KomunikacjaSieciowa.OdczytDanychZWagi(OdczytZWagi.Kom_ZatwierdzoneF1);
repeat "string NrOperatora" depending on the returned data?
Where's the best place to make loop?? Maybe I should use thread??
I am writing a program which goal is to communicate with the weight
terminal using TCP client. I'm sending specified messages (eg. checking
status) and depending on the replies I'm making some another process.
First, some code. Connection:
public static void PolaczZWaga(string IP, int port)
{
IP = IP.Replace(" ", "");
KlientTCP = new TcpClient();
KlientTCP.Connect(IPAddress.Parse(IP), port);
}
Sending message (eg. checking status)
public static string OdczytDanychZWagi(byte[] WysylaneZapytanie)
{
// Wysy³ka komunikatu do pod³¹czonego serwera TCP
byte[] GotoweZapytanie =
KomunikatyWspolne.PoczatekKomunikacji.Concat(WysylaneZapytanie).Concat(KomunikatyWspolne.KoniecKumunikacji).ToArray();
NetworkStream stream = KlientTCP.GetStream();
stream.Write(GotoweZapytanie, 0, GotoweZapytanie.Length);
// Otrzymanie odpowiedzi
// Buffor na odpowiedz
byte[] odpowiedz = new Byte[256];
// String do przechowywania odpowiedzi w ASCII
String responseData = String.Empty;
// Odczyt danych z serwera
Int32 bytes = stream.Read(odpowiedz, 0, odpowiedz.Length);
responseData = System.Text.Encoding.ASCII.GetString(odpowiedz, 0,
bytes);
return responseData;
}
After Form1 open I make an connection and checking status
string odp =
KomunikacjaSieciowa.OdczytDanychZWagi(OdczytZWagi.Kom_RejestrStatusu);
char status = odp[0];
switch(status)
{
case 'B':
KomunikacjaSieciowa.WysylkaDoWyswietlaczaWagi_4linie(WysylkaDoWyswietlacza_Komunikaty.LogWitaj,
WysylkaDoWyswietlacza_Komunikaty.LogZaloguj,
WysylkaDoWyswietlacza_Komunikaty.PustaLinia,
WysylkaDoWyswietlacza_Komunikaty.LogNrOperatora);
string NrOperatora =
KomunikacjaSieciowa.OdczytDanychZWagi(OdczytZWagi.Kom_ZatwierdzoneF1);
//int NrOperatora_int = Convert.ToInt32(NrOperatora);
break;
// here goes next case etc
Here starts my problem - communication takes place only once and the
operation requires data on the terminal. Before the operator enters data
program ends. How to change the code / loop / add a timer to repeated
communication to achieve a certain status? More specifically, as in this
passage:
case 'B':
KomunikacjaSieciowa.WysylkaDoWyswietlaczaWagi_4linie(WysylkaDoWyswietlacza_Komunikaty.LogWitaj,
WysylkaDoWyswietlacza_Komunikaty.LogZaloguj,
WysylkaDoWyswietlacza_Komunikaty.PustaLinia,
WysylkaDoWyswietlacza_Komunikaty.LogNrOperatora);
string NrOperatora =
KomunikacjaSieciowa.OdczytDanychZWagi(OdczytZWagi.Kom_ZatwierdzoneF1);
repeat "string NrOperatora" depending on the returned data?
Where's the best place to make loop?? Maybe I should use thread??
How to code a one webpage website?
How to code a one webpage website?
So i am completely new to web design and just recently was introduced to
html.
I found this webpage and tried to code it but i am struggling although I
know quite a bit about HTML.
Can someone please guide me through the steps, I want to make sure i am
doing things right.
At the moment I am struggling with centering the content area, which uses
an article tag.
This is the website so far
http://www.flickr.com/photos/100638499@N08/9557737748/ I would like to say
that i am not asking for someone to do this for me but to guide me if that
is not too much to ask.
This is my css so far
body {
background: url('index1.jpg') no-repeat center;
margin-top:300px;}
article{
background:white;
width:650px;
height:325px;
border:1px solid;
margin:auto;
}
So i am completely new to web design and just recently was introduced to
html.
I found this webpage and tried to code it but i am struggling although I
know quite a bit about HTML.
Can someone please guide me through the steps, I want to make sure i am
doing things right.
At the moment I am struggling with centering the content area, which uses
an article tag.
This is the website so far
http://www.flickr.com/photos/100638499@N08/9557737748/ I would like to say
that i am not asking for someone to do this for me but to guide me if that
is not too much to ask.
This is my css so far
body {
background: url('index1.jpg') no-repeat center;
margin-top:300px;}
article{
background:white;
width:650px;
height:325px;
border:1px solid;
margin:auto;
}
Graphical glitching
Graphical glitching
(http://imgur.com/e4ehrGi,Zn3ABdx) sometimes when i open programs, i get a
graphical glitch where a weird pattern keeps repeating. these images show
the glitch, it happened when i tried to open supertux 2, but it often
happen with firefox. It i am running freshly installed ubuntu 13.04, with
the non-propieatary driver. For some reason, booting to recovery mode from
grub under advanced options, then clicking boot normally keeps the glitch
from happening. My computer runs an amd athlon 2 processor, and a nvida
non-geforce 5600 graphics card. Sorry for the bad typing, im typing this
on an ipad.
(http://imgur.com/e4ehrGi,Zn3ABdx) sometimes when i open programs, i get a
graphical glitch where a weird pattern keeps repeating. these images show
the glitch, it happened when i tried to open supertux 2, but it often
happen with firefox. It i am running freshly installed ubuntu 13.04, with
the non-propieatary driver. For some reason, booting to recovery mode from
grub under advanced options, then clicking boot normally keeps the glitch
from happening. My computer runs an amd athlon 2 processor, and a nvida
non-geforce 5600 graphics card. Sorry for the bad typing, im typing this
on an ipad.
Relational or NoSQL for monitoring data and time related queries?
Relational or NoSQL for monitoring data and time related queries?
I am considering data backend for the monitoring system I am building. It
will receive regular reports from multiple users. I would get record from
each user agent every 5s. The system would analyze the data and calculate
statistics over it. The statistics are the value for a user. He should be
able to view them live or they could be pre-calculated on regular basis.
The system would require mostly time related queries. Most of the data
would be read only. I want to easily scale in the number of users. I would
also like to make cross analyses over the data of all users.
Which data backend would you recommend? Relational or some NoSQL
alternative? Do you have any experience with temporal databases? Is there
anything dedicated for such system?
I used relational database in similar systems before and I wasn't very
happy with them. I found time based queries in SQL cumbersome. I
investigated MongoDB but I am not quite sure if it matches my needs.
I am considering data backend for the monitoring system I am building. It
will receive regular reports from multiple users. I would get record from
each user agent every 5s. The system would analyze the data and calculate
statistics over it. The statistics are the value for a user. He should be
able to view them live or they could be pre-calculated on regular basis.
The system would require mostly time related queries. Most of the data
would be read only. I want to easily scale in the number of users. I would
also like to make cross analyses over the data of all users.
Which data backend would you recommend? Relational or some NoSQL
alternative? Do you have any experience with temporal databases? Is there
anything dedicated for such system?
I used relational database in similar systems before and I wasn't very
happy with them. I found time based queries in SQL cumbersome. I
investigated MongoDB but I am not quite sure if it matches my needs.
PHP: user declared variable overwrites variable in $GLOBALS
PHP: user declared variable overwrites variable in $GLOBALS
I declared a variable ($bonus) in my code and assigned a value to it.
After this, $GLOBALS['bonus'] contains the same value.
Why does this happen?
I declared a variable ($bonus) in my code and assigned a value to it.
After this, $GLOBALS['bonus'] contains the same value.
Why does this happen?
Monday, 19 August 2013
Bulk update in rails with mongodb
Bulk update in rails with mongodb
I have a scenario where I need to update some 7k records in mongodb. The
query is
Document.all.each do |d|
d.pages_enabled_count = d.pages.where(:disabled => false).count
d.pages_enabled_to_query_count = d.pages.where(:disabled => false ,
:to_query => true).count
d.pages_enabled_to_rescan_count = d.pages.where(:disabled => false ,
:to_rescan => true).count
d.pages_enabled_to_retag_count = d.pages.where(:disabled => false ,
:to_retag => true).count
d.save
This takes about 5 mins to complete the query. Is there a way to do update
without looping i.e. bulk update in one go?
I have a scenario where I need to update some 7k records in mongodb. The
query is
Document.all.each do |d|
d.pages_enabled_count = d.pages.where(:disabled => false).count
d.pages_enabled_to_query_count = d.pages.where(:disabled => false ,
:to_query => true).count
d.pages_enabled_to_rescan_count = d.pages.where(:disabled => false ,
:to_rescan => true).count
d.pages_enabled_to_retag_count = d.pages.where(:disabled => false ,
:to_retag => true).count
d.save
This takes about 5 mins to complete the query. Is there a way to do update
without looping i.e. bulk update in one go?
Upload photo with jQuery Dialog in ASP.NET MVC site
Upload photo with jQuery Dialog in ASP.NET MVC site
I'm building an ASP.NET MVC 3 application, and I'm trying to use a jQuery
Dialog to upload a photo. Here is my code, but the problem is that the
HttpPostedFileBase object of my model (witch represent the file to upload)
is always null on the server side (HttpPost method).
My controller
public ActionResult AddProductPhoto(int id)
{
var model = new UploadImageModel {ProductId = id};
return PartialView("_UploadFile", model);
}
[HttpPost]
public ActionResult AddProductPhoto(UploadImageModel model)
{
// model.File is always null
return Json(new { Success = true });
}
The model
public class UploadImageModel
{
public int ProductId { get; set; }
[FileExtensions(Extensions = "jpg, jpeg, png")]
public HttpPostedFileBase File { get; set; }
}
The upload partial view (_UploadFile)
@model DalilCompany.Models.UploadImageModel
@using (Html.BeginForm("AddProductPhoto", "Product", FormMethod.Post,
new { id = "uploadProductPhotoForm", enctype =
"multipart/form-data" }))
{
@Html.ValidationSummary(true)
@Html.HiddenFor(m => m.ProductId)
<div>
@Html.LabelFor(m => m.File)
@Html.TextBoxFor(m => m.File, new { type = "file" })
</div>
}
main view
<span productId ="@Model.ProductId" id="add_product_photo_link">
Upload photo
</span>
<div id="AddPhotoDlg" title="" style="display: none"></div>
<script type="text/javascript">
$(function () {
$("#AddPhotoDlg").dialog({
autoOpen: false,
width: 550,
height: 250,
modal: true,
buttons: {
"Upload": function () {
$.post("/Product/AddProductPhoto",
$("#uploadProductPhotoForm").serialize(),
function () {
$("#AddPhotoDlg").dialog("close");
alert('upload success');
});
},
"Close": function () { $(this).dialog("close"); }
}
});
});
$("#add_product_photo_link").click(function () {
var id = $(this).attr("productId");
$("#AddPhotoDlg").html("")
.dialog("option", "title", "Ajouter une photo")
.load("/Product/AddProductPhoto/" + id,
function () { $("#AddPhotoDlg").dialog("open"); });
});
</script>
I'm building an ASP.NET MVC 3 application, and I'm trying to use a jQuery
Dialog to upload a photo. Here is my code, but the problem is that the
HttpPostedFileBase object of my model (witch represent the file to upload)
is always null on the server side (HttpPost method).
My controller
public ActionResult AddProductPhoto(int id)
{
var model = new UploadImageModel {ProductId = id};
return PartialView("_UploadFile", model);
}
[HttpPost]
public ActionResult AddProductPhoto(UploadImageModel model)
{
// model.File is always null
return Json(new { Success = true });
}
The model
public class UploadImageModel
{
public int ProductId { get; set; }
[FileExtensions(Extensions = "jpg, jpeg, png")]
public HttpPostedFileBase File { get; set; }
}
The upload partial view (_UploadFile)
@model DalilCompany.Models.UploadImageModel
@using (Html.BeginForm("AddProductPhoto", "Product", FormMethod.Post,
new { id = "uploadProductPhotoForm", enctype =
"multipart/form-data" }))
{
@Html.ValidationSummary(true)
@Html.HiddenFor(m => m.ProductId)
<div>
@Html.LabelFor(m => m.File)
@Html.TextBoxFor(m => m.File, new { type = "file" })
</div>
}
main view
<span productId ="@Model.ProductId" id="add_product_photo_link">
Upload photo
</span>
<div id="AddPhotoDlg" title="" style="display: none"></div>
<script type="text/javascript">
$(function () {
$("#AddPhotoDlg").dialog({
autoOpen: false,
width: 550,
height: 250,
modal: true,
buttons: {
"Upload": function () {
$.post("/Product/AddProductPhoto",
$("#uploadProductPhotoForm").serialize(),
function () {
$("#AddPhotoDlg").dialog("close");
alert('upload success');
});
},
"Close": function () { $(this).dialog("close"); }
}
});
});
$("#add_product_photo_link").click(function () {
var id = $(this).attr("productId");
$("#AddPhotoDlg").html("")
.dialog("option", "title", "Ajouter une photo")
.load("/Product/AddProductPhoto/" + id,
function () { $("#AddPhotoDlg").dialog("open"); });
});
</script>
cannot passing anonymous variable c# by a parameter on the method LINQ
cannot passing anonymous variable c# by a parameter on the method LINQ
I need do something like this
public class carros {
public int id { get; set; }
public string nome { get; set; }
public carros(int _id, string _nome)
{
id = _id;
nome = _nome;
}
}
public void listar_carros()
{
List<carros> Lcars = new List<carros>();
Lcars.Add(new carros(1, "Fusca"));
Lcars.Add(new carros(2, "Gol"));
Lcars.Add(new carros(3, "Fiesta"));
var qry = from q in Lcars where q.nome.ToLower().Contains("eco")
orderby q.nome select new {q.nome, q.id};
doSomething(qry)
}
public void
{
foreach (carros ca in qry)
{
Response.Write(ca.nome);
Response.Write(" - ");
Response.Write(ca.id);
//Response.Write(ca);
Response.Write("<br />");
}
}
I need pass this variable "qry" for function doSomething. i try do a
dynamic type, List, object nothing works
I need do something like this
public class carros {
public int id { get; set; }
public string nome { get; set; }
public carros(int _id, string _nome)
{
id = _id;
nome = _nome;
}
}
public void listar_carros()
{
List<carros> Lcars = new List<carros>();
Lcars.Add(new carros(1, "Fusca"));
Lcars.Add(new carros(2, "Gol"));
Lcars.Add(new carros(3, "Fiesta"));
var qry = from q in Lcars where q.nome.ToLower().Contains("eco")
orderby q.nome select new {q.nome, q.id};
doSomething(qry)
}
public void
{
foreach (carros ca in qry)
{
Response.Write(ca.nome);
Response.Write(" - ");
Response.Write(ca.id);
//Response.Write(ca);
Response.Write("<br />");
}
}
I need pass this variable "qry" for function doSomething. i try do a
dynamic type, List, object nothing works
How to hide/show the content of a div with dynamic hieght?
How to hide/show the content of a div with dynamic hieght?
I am trying to develop a small module (like the collapse component of
twitter bootstrap).
I don't know how to treat the content of the div which is growing up/down,
it could take me many descriptions, nothing's better than an example:
Collapse deployment.
You can see a div.container which is the block destined to grow up/down.
Here i declare height: 50px to illustrate a state of the deployment.
Is there a way to hide the content (here a part of the text) that is out
of the height of a parent div ?
I like the idea that we can access a content only by deploying another
one, but i don't really don't understand how to make it happen properly in
CSS.
I am trying to develop a small module (like the collapse component of
twitter bootstrap).
I don't know how to treat the content of the div which is growing up/down,
it could take me many descriptions, nothing's better than an example:
Collapse deployment.
You can see a div.container which is the block destined to grow up/down.
Here i declare height: 50px to illustrate a state of the deployment.
Is there a way to hide the content (here a part of the text) that is out
of the height of a parent div ?
I like the idea that we can access a content only by deploying another
one, but i don't really don't understand how to make it happen properly in
CSS.
Email Service With Differently Encoded Attachments
Email Service With Differently Encoded Attachments
I'm trying to make an emailer service that sends out attachments that has
been processed elsewhere in our system. The requirements for this is that
the client is expecting a specific encoding specified in the settings for
a job. In a test app, I'm trying to send out emails with attachments in
different encodings, but when I view in IE or notepad++ I get a bunch of
question marks, instead of a correctly encoded file. What am I not doing
right?
var current_month = @"<?xml version=""1.0"" encoding=""utf-8""?>
<test>
ABCDEFGHIJKLMNOPQRSTUVWXYZ /0123456789
abcdefghijklmnopqrstuvwxyz £©µÀÆÖÞßéöÿ
–—'""„†•…‰™œŠŸ
ΑΒΓΔΩαβγδω
АБВГДабвгд
∀∂∈ℝ∧∪≡∞
↑↗↨↻⇣
┐┼╔╘░►☺♀
fi�⑀₂ἠḂӥẄɐː⍎אԱა
Οὐχὶ
ταὐτὰ
παρίσταταί
μοι
γιγνώσκειν,
ὦ
ἄνδρες
᾿Αθηναῖοι,
ὅταν τ᾿
εἰς τὰ
πράγματα
ἀποβλέψω
καὶ
ὅταν
πρὸς
τοὺς
λόγους
οὓς
ἀκούω·
τοὺς
μὲν γὰρ
λόγους
περὶ
τοῦ
τιμωρήσασθαι
Φίλιππον
ὁρῶ
γιγνομένους,
τὰ δὲ
πράγματ᾿
εἰς
τοῦτο
προήκοντα,
ὥσθ᾿
ὅπως μὴ
πεισόμεθ᾿
αὐτοὶ
πρότερον
κακῶς
σκέψασθαι
δέον.
οὐδέν
οὖν
ἄλλο
μοι
δοκοῦσιν
οἱ τὰ
τοιαῦτα
λέγοντες
ἢ τὴν
ὑπόθεσιν,
περὶ ἧς
βουλεύεσθαι,
οὐχὶ
τὴν
οὖσαν
παριστάντες
ὑμῖν
ἁμαρτάνειν.
ἐγὼ δέ,
ὅτι μέν
ποτ᾿
ἐξῆν τῇ
πόλει
καὶ τὰ
αὑτῆς
ἔχειν
ἀσφαλῶς
καὶ
Φίλιππον
τιμωρήσασθαι,
καὶ
μάλ᾿
ἀκριβῶς
οἶδα·
ἐπ᾿
ἐμοῦ
γάρ, οὐ
πάλαι
γέγονεν
ταῦτ᾿
ἀμφότερα·
νῦν
μέντοι
πέπεισμαι
τοῦθ᾿
ἱκανὸν
προλαβεῖν
ἡμῖν
εἶναι
τὴν
πρώτην,
ὅπως
τοὺς
συμμάχους
σώσομεν.
ἐὰν γὰρ
τοῦτο
βεβαίως
ὑπάρξῃ,
τότε
καὶ
περὶ
τοῦ
τίνα
τιμωρήσεταί
τις καὶ
ὃν
τρόπον
ἐξέσται
σκοπεῖν·
πρὶν δὲ
τὴν
ἀρχὴν
ὀρθῶς
ὑποθέσθαι,
μάταιον
ἡγοῦμαι
περὶ
τῆς
τελευτῆς
ὁντινοῦν
ποιεῖσθαι
λόγον.
</test>";
var newEncoding = Encoding.UTF8;
var bytes = Encoding.Default.GetBytes(current_month);
var newBytes = Encoding.Convert(Encoding.Default, newEncoding,
bytes);
var msCurrent = new MemoryStream(newBytes);
var attachment = new Attachment(msCurrent, "testattachment3.xml",
MediaTypeNames.Text.Xml);
attachment.ContentType = new ContentType("text/xml");
var message = new MailMessage("them", "me");
message.BodyEncoding = newEncoding;
message.Attachments.Add(attachment);
new SmtpClient("192.168.6.25")
{
UseDefaultCredentials = true
}.Send(message);
I'm trying to make an emailer service that sends out attachments that has
been processed elsewhere in our system. The requirements for this is that
the client is expecting a specific encoding specified in the settings for
a job. In a test app, I'm trying to send out emails with attachments in
different encodings, but when I view in IE or notepad++ I get a bunch of
question marks, instead of a correctly encoded file. What am I not doing
right?
var current_month = @"<?xml version=""1.0"" encoding=""utf-8""?>
<test>
ABCDEFGHIJKLMNOPQRSTUVWXYZ /0123456789
abcdefghijklmnopqrstuvwxyz £©µÀÆÖÞßéöÿ
–—'""„†•…‰™œŠŸ
ΑΒΓΔΩαβγδω
АБВГДабвгд
∀∂∈ℝ∧∪≡∞
↑↗↨↻⇣
┐┼╔╘░►☺♀
fi�⑀₂ἠḂӥẄɐː⍎אԱა
Οὐχὶ
ταὐτὰ
παρίσταταί
μοι
γιγνώσκειν,
ὦ
ἄνδρες
᾿Αθηναῖοι,
ὅταν τ᾿
εἰς τὰ
πράγματα
ἀποβλέψω
καὶ
ὅταν
πρὸς
τοὺς
λόγους
οὓς
ἀκούω·
τοὺς
μὲν γὰρ
λόγους
περὶ
τοῦ
τιμωρήσασθαι
Φίλιππον
ὁρῶ
γιγνομένους,
τὰ δὲ
πράγματ᾿
εἰς
τοῦτο
προήκοντα,
ὥσθ᾿
ὅπως μὴ
πεισόμεθ᾿
αὐτοὶ
πρότερον
κακῶς
σκέψασθαι
δέον.
οὐδέν
οὖν
ἄλλο
μοι
δοκοῦσιν
οἱ τὰ
τοιαῦτα
λέγοντες
ἢ τὴν
ὑπόθεσιν,
περὶ ἧς
βουλεύεσθαι,
οὐχὶ
τὴν
οὖσαν
παριστάντες
ὑμῖν
ἁμαρτάνειν.
ἐγὼ δέ,
ὅτι μέν
ποτ᾿
ἐξῆν τῇ
πόλει
καὶ τὰ
αὑτῆς
ἔχειν
ἀσφαλῶς
καὶ
Φίλιππον
τιμωρήσασθαι,
καὶ
μάλ᾿
ἀκριβῶς
οἶδα·
ἐπ᾿
ἐμοῦ
γάρ, οὐ
πάλαι
γέγονεν
ταῦτ᾿
ἀμφότερα·
νῦν
μέντοι
πέπεισμαι
τοῦθ᾿
ἱκανὸν
προλαβεῖν
ἡμῖν
εἶναι
τὴν
πρώτην,
ὅπως
τοὺς
συμμάχους
σώσομεν.
ἐὰν γὰρ
τοῦτο
βεβαίως
ὑπάρξῃ,
τότε
καὶ
περὶ
τοῦ
τίνα
τιμωρήσεταί
τις καὶ
ὃν
τρόπον
ἐξέσται
σκοπεῖν·
πρὶν δὲ
τὴν
ἀρχὴν
ὀρθῶς
ὑποθέσθαι,
μάταιον
ἡγοῦμαι
περὶ
τῆς
τελευτῆς
ὁντινοῦν
ποιεῖσθαι
λόγον.
</test>";
var newEncoding = Encoding.UTF8;
var bytes = Encoding.Default.GetBytes(current_month);
var newBytes = Encoding.Convert(Encoding.Default, newEncoding,
bytes);
var msCurrent = new MemoryStream(newBytes);
var attachment = new Attachment(msCurrent, "testattachment3.xml",
MediaTypeNames.Text.Xml);
attachment.ContentType = new ContentType("text/xml");
var message = new MailMessage("them", "me");
message.BodyEncoding = newEncoding;
message.Attachments.Add(attachment);
new SmtpClient("192.168.6.25")
{
UseDefaultCredentials = true
}.Send(message);
Sunday, 18 August 2013
processing camera frames as bitmaps at set intervals
processing camera frames as bitmaps at set intervals
I'm trying to do something very different with my android app: I need to
grab the image of the camera as a bitmap at timed intervals (every 2
seconds or so). I don't want it in real time because I need to run several
heavy processes on the bitmap once I have it, and for efficiency I don't
want to run those dozens of times a second. I also don't need to save it
as a file, I just need it in currentBitmap.
This is the code where I try to make it happen:
public class MainActivity extends Activity {
private Camera camera;
private CameraPreview camPreview;
private FrameLayout camLayout;
// The app will process the camera frame on intervals instead of constantly
private static final long PROCESS_TIME = 2000; //(in milliseconds)
private static final long START_TIME = 2000;
private Timer timer;
// I want the bitmap in this instance
private Bitmap currentBitmap;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
camLayout = (FrameLayout) findViewById(R.id.camera_preview);
setupCameraPreview();
// Set up the timer
timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
TimerMethod();
}
}, START_TIME, PROCESS_TIME);
}
private void TimerMethod()
{ // Run Timer_Action on the same thread as the UI
this.runOnUiThread(Timer_Action);
}
private Runnable Timer_Action = new Runnable() {
public void run() {
// Process each bitmap here
try {
camera.takePicture(null, null, pictureCallback);
} catch (NullPointerException e) {
e.printStackTrace();
}
Toast.makeText(getApplicationContext(),
"Photo capture attempted",
Toast.LENGTH_SHORT).show();
}
};
private Camera.PictureCallback pictureCallback = new
Camera.PictureCallback() {
@Override
public void onPictureTaken(byte[] data, Camera camera) {
try {
currentBitmap = BitmapFactory.decodeByteArray(data, 0,
data.length);
Toast.makeText(getApplicationContext(),
"Photo capture successful", Toast.LENGTH_SHORT).show();
} catch (NullPointerException e) {
e.printStackTrace();
}
}
};
private void setupCameraPreview() {
try { // Try to initialize the camera
camera = Camera.open(Camera.CameraInfo.CAMERA_FACING_FRONT);
camPreview = new CameraPreview(this, camera);
camLayout.addView(camPreview);
} catch (Exception e) {
e.printStackTrace();
camera = null;
camPreview = null;
}
}
What happens when I run is that the camera preview and timer seem to run
fine. But the pictureCallback, data[], and currentBitmap all stay null, so
the try blocks throw their exceptions and the app moves on. My guess is
that pictureCallback isn't getting data from the camera, but how would I
fix that? and if that's not the problem than what is?
All help is very appreciated.
I'm trying to do something very different with my android app: I need to
grab the image of the camera as a bitmap at timed intervals (every 2
seconds or so). I don't want it in real time because I need to run several
heavy processes on the bitmap once I have it, and for efficiency I don't
want to run those dozens of times a second. I also don't need to save it
as a file, I just need it in currentBitmap.
This is the code where I try to make it happen:
public class MainActivity extends Activity {
private Camera camera;
private CameraPreview camPreview;
private FrameLayout camLayout;
// The app will process the camera frame on intervals instead of constantly
private static final long PROCESS_TIME = 2000; //(in milliseconds)
private static final long START_TIME = 2000;
private Timer timer;
// I want the bitmap in this instance
private Bitmap currentBitmap;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
camLayout = (FrameLayout) findViewById(R.id.camera_preview);
setupCameraPreview();
// Set up the timer
timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
TimerMethod();
}
}, START_TIME, PROCESS_TIME);
}
private void TimerMethod()
{ // Run Timer_Action on the same thread as the UI
this.runOnUiThread(Timer_Action);
}
private Runnable Timer_Action = new Runnable() {
public void run() {
// Process each bitmap here
try {
camera.takePicture(null, null, pictureCallback);
} catch (NullPointerException e) {
e.printStackTrace();
}
Toast.makeText(getApplicationContext(),
"Photo capture attempted",
Toast.LENGTH_SHORT).show();
}
};
private Camera.PictureCallback pictureCallback = new
Camera.PictureCallback() {
@Override
public void onPictureTaken(byte[] data, Camera camera) {
try {
currentBitmap = BitmapFactory.decodeByteArray(data, 0,
data.length);
Toast.makeText(getApplicationContext(),
"Photo capture successful", Toast.LENGTH_SHORT).show();
} catch (NullPointerException e) {
e.printStackTrace();
}
}
};
private void setupCameraPreview() {
try { // Try to initialize the camera
camera = Camera.open(Camera.CameraInfo.CAMERA_FACING_FRONT);
camPreview = new CameraPreview(this, camera);
camLayout.addView(camPreview);
} catch (Exception e) {
e.printStackTrace();
camera = null;
camPreview = null;
}
}
What happens when I run is that the camera preview and timer seem to run
fine. But the pictureCallback, data[], and currentBitmap all stay null, so
the try blocks throw their exceptions and the app moves on. My guess is
that pictureCallback isn't getting data from the camera, but how would I
fix that? and if that's not the problem than what is?
All help is very appreciated.
Subscribe to:
Comments (Atom)