Wednesday, 21 August 2013

WebResource.axd not loaded when using latest Google Chrome Browser

WebResource.axd not loaded when using latest Google Chrome Browser

I'm having a strange issue:
I can't login at http://maskatel.info/login, when I try to click the login
button (the blue button that says Connexion), nothing happens at all.
So I opened up the developer tools in Chrome (f12) and saw the following
javascript error everyime I click the button: Uncaught ReferenceError:
WebForm_PostBackOptions
I then found out that this fuction should be in WebResource.axd, I then
went to the Resources tab in the developers tool and found out that this
'file' is not there and it is not loaded in the HTML source.
I tried a lot of different things without any succes and finally tried
another browser and it works fine in any other browsers. That same page
was working perfectly previously in Chrome on the same computer in the
past.
So then I tried to click the small gear in the Chrome developer tools and
went to the overrides section and changed the UserAgent to something else
and refreshed the page and it works perfectly with any other UserAgent
string. The correct UserAgent when not overriden for my browser is
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/29.0.1547.57 Safari/537.36
So right now I really don't know what to do next:
Is this issue related to the latest version of Chrome? I have not found
any information on release dates for chrome.
It could also be a DotNetNuke problem but I doubt it since nothing there
changed before and after the problem
It could aslo be asp.net related (I renamed App_Browsers to App_Browsers2
and still no luck.
Any help would be appreciated.

XEN Hypervisor migration

XEN Hypervisor migration

I know that there is no Type 2 hypervisor solution to run on an existing
OS, what I'm wondering is, is there a server or a way to spin up and image
localy on some sort of work station for devalopement then Migrate it over
to an Xen server?
Any information on this would be gratly appriciated.
Regards Tea

glDrawArrays() not working on Mac OS X

glDrawArrays() not working on Mac OS X

I am practicing the usage of VBOs in OpenGL with Java and LWJGL (using
this tutorial, and basically copying it's code:
http://www.arcsynthesis.org/gltut/index.html) and right now something
really weird is happening.
I have a window set up and this is my render() function, called inside the
main loop:
public void render() {
FloatBuffer buffer = BufferUtils.createFloatBuffer(3 * 3);
buffer.put(-1);
buffer.put(-1);
buffer.put(0);
buffer.put(0);
buffer.put(1);
buffer.put(0);
buffer.put(1);
buffer.put(-1);
buffer.put(0);
buffer.flip();
int vbo = glGenBuffers();
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glBufferData(GL_ARRAY_BUFFER, buffer, GL_STATIC_DRAW);
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 3, GL_FLOAT, false, Vertex.SIZE * 4, 0);
glDrawArrays(GL_TRIANGLES, 0, 3);
glDisableVertexAttribArray(0);
}
As you can see, it's very simple code which should draw a triangle. But
what I get on a Mac OS X Mountain Lion laptop, running Intel HD 4000
graphics is this:
And what I get on Windows 7, running AMD HD 6850 graphics is this:
Why is that? I really see no reason for this to happen, both of the video
cards support OpenGL 2.0, which is what I'm using, right?

Setting up CredSSP properly for powershell multi-hop issue

Setting up CredSSP properly for powershell multi-hop issue

I've encountering the double-hop issue with a script I'm writing. Issue
right now is that when I get to New-PSSession on the computer remoting in.
I get the following error:
Image Link if its too hard to read

Here's the code that runs on the original server:
$password = ConvertTo-SecureString "password" -AsPlainText -Force
$cred= New-Object System.Management.Automation.PSCredential
("domain\admin", $CApassword)
$sesh = new-pssession -computername "MSSCA" -credential $CAcred
-Authentication CredSSP
This $sesh variable comes back null and throws the error above.
Server executing powershell script/remoting is set to delegate fresh
credentials to mssca, and likewise mssca is set to receive.
Any ideas how I can fix this?

Node.js returning result from MySQL query

Node.js returning result from MySQL query

I have the following function that gets a hexcode from the database
function getColour(username, roomCount)
{
connection.query('SELECT hexcode FROM colours WHERE precedence = ?',
[roomCount], function(err, result)
{
if (err) throw err;
return result[0].hexcode;
});
}
My problem is that I am returning the result in the callback function but
the getColour function doesn't return anything. I want the getColour
function to return the value of result[0].hexcode.
At the moment when I called getColour it doesn't return anything

Winforms TreeView Serialization which includes Node Tag-attribute objects

Winforms TreeView Serialization which includes Node Tag-attribute objects

How can I (binary) serialize a "WinForm Treeview" into a file, so that
also objects, which are assigned to the "Node-Tag-Attribute" are also
saved. I need serialization and deserialization (into the treeview again).
I have tried the following solution: Saving content of a treeview to a
file and load it later, but after deserialization all tag attributes,
which consists of objects original treeview, are now = null.

rails ,paginate, sort and more than one table

rails ,paginate, sort and more than one table

I'm new to rails,i want to know how to paginate and sort by a particular
column. I can do this within one table,but when there are more than one
,like query between three or more tables,and the sorted column not in the
main table,i tried many times but failed ,and i also searched the web ,but
also in vain. now I need your help...help please!
while paginate i'm using this `# encoding: utf-8 module Pagination class
Paginator attr_reader :item_count, :per_page, :page, :page_param
def initialize(*args)
if args.first.is_a?(ActionController::Base)
args.shift
ActiveSupport::Deprecation.warn "Paginator no longer takes a
controller instance as the first argument. Remove it from #new
arguments."
end
item_count, per_page, page, page_param = *args
@item_count = item_count
@per_page = per_page
page = (page || 1).to_i
if page < 1
page = 1
end
@page = page
@page_param = page_param || :page
end
def offset
(page - 1) * per_page
end
def first_page
if item_count > 0
1
end
end
def previous_page
if page > 1
page - 1
end
end
def next_page
if last_item < item_count
page + 1
end
end
def last_page
if item_count > 0
(item_count - 1) / per_page + 1
end
end
def first_item
item_count == 0 ? 0 : (offset + 1)
end
def last_item
l = first_item + per_page - 1
l > item_count ? item_count : l
end
def linked_pages
pages = []
if item_count > 0
pages += [first_page, page, last_page]
pages += ((page-2)..(page+2)).to_a.select {|p| p > first_page && p <
last_page}
end
pages = pages.compact.uniq.sort
if pages.size > 1
pages
else
[]
end
end
def items_per_page
ActiveSupport::Deprecation.warn "Paginator#items_per_page will be
removed. Use #per_page instead."
per_page
end
def current
ActiveSupport::Deprecation.warn "Paginator#current will be removed.
Use .offset instead of .current.offset."
self
end
end
# Paginates the given scope or model. Returns a Paginator instance and
# the collection of objects for the current page.
#
# Options:
# :parameter name of the page parameter
#
# Examples:
# @user_pages, @users = paginate User.where(:status => 1)
#
def paginate(scope, options={})
options = options.dup
finder_options = options.extract!(
:conditions,
:order,
:joins,
:include,
:select
)
if scope.is_a?(Symbol) || finder_options.values.compact.any?
return deprecated_paginate(scope, finder_options, options)
end
paginator = paginator(scope.count, options)
collection = scope.limit(paginator.per_page).offset(paginator.offset).to_a
return paginator, collection
end
def deprecated_paginate(arg, finder_options, options={})
ActiveSupport::Deprecation.warn "#paginate with a Symbol and/or find
options is depreceted and will be removed. Use a scope instead."
klass = arg.is_a?(Symbol) ? arg.to_s.classify.constantize : arg
scope = klass.scoped(finder_options)
paginate(scope, options)
end
def paginator(item_count, options={})
options.assert_valid_keys :parameter, :per_page
page_param = options[:parameter] || :page
page = (params[page_param] || 1).to_i
per_page = options[:per_page] || per_page_option
Paginator.new(item_count, per_page, page, page_param)
end
module Helper
include Redmine::I18n
# Renders the pagination links for the given paginator.
#
# Options:
# :per_page_links if set to false, the "Per page" links are not
rendered
#
def pagination_links_full(*args)
pagination_links_each(*args) do |text, parameters, options|
if block_given?
yield text, parameters, options
else
link_to text, params.merge(parameters), options
end
end
end
# Yields the given block with the text and parameters
# for each pagination link and returns a string that represents the links
def pagination_links_each(paginator, count=nil, options={}, &block)
options.assert_valid_keys :per_page_links
per_page_links = options.delete(:per_page_links)
per_page_links = false if count.nil?
page_param = paginator.page_param
html = ''
if paginator.previous_page
# \xc2\xab(utf-8) = &#171;
text = "\xc2\xab " + l(:label_previous)
html << yield(text, {page_param => paginator.previous_page}, :class
=> 'previous') + ' '
end
previous = nil
paginator.linked_pages.each do |page|
if previous && previous != page - 1
html << content_tag('span', '...', :class => 'spacer') + ' '
end
if page == paginator.page
html << content_tag('span', page.to_s, :class => 'current page')
else
html << yield(page.to_s, {page_param => page}, :class => 'page')
end
html << ' '
previous = page
end
if paginator.next_page
# \xc2\xbb(utf-8) = &#187;
text = l(:label_next) + " \xc2\xbb"
html << yield(text, {page_param => paginator.next_page}, :class =>
'next') + ' '
end
html << content_tag('span',
"(#{paginator.first_item}-#{paginator.last_item}/#{paginator.item_count})",
:class => 'items') + ' '
if per_page_links != false && links = per_page_links(paginator, &block)
html << content_tag('span', links.to_s, :class => 'per-page')
end
html.html_safe
end
# Renders the "Per page" links.
def per_page_links(paginator, &block)
values = per_page_options(paginator.per_page, paginator.item_count)
if values.any?
links = values.collect do |n|
if n == paginator.per_page
content_tag('span', n.to_s)
else
yield(n, :per_page => n, paginator.page_param => nil)
end
end
l(:label_display_per_page, links.join(', ')).html_safe
end
end
def per_page_options(selected=nil, item_count=nil)
options = Setting.per_page_options_array
if item_count && options.any?
if item_count > options.first
max = options.detect {|value| value >= item_count} || item_count
else
max = item_count
end
options = options.select {|value| value <= max || value == selected}
end
if options.empty? || (options.size == 1 && options.first == selected)
[]
else
options
end
end
end
end end `