Demián

0

votes
2

answer
26

views

set a variable to a negative value on mousedown

in my code right now i've got a lot of strings and dots which are getting pulled to the position of my cursor but what im trying to do right now is that when i do a mouseclick that the variable changes to a negative value so the strings and dots are getting pushed away. Im new to JS and i simply don...
Demian Väth
0

votes
0

answer
22

views

jQuery event when specific option is selected with Ajax HTML structure

I would like to create a jQuery event when a particular option is selected. I am familiar how to do this with a general dropdown structure, but mine is a but unusual and it doesn't work: HTML Select a country… Belgium Netherlands Belgium My jQuery attempt: jQuery('#country').change(function(){ jQu...
Demian
5

votes
1

answer
32

views

Order of picked up meta tags in the html-head

I was wondering if someone could explain how social media rich previews define which og:title to pick. I use wordpress and for certain pages I insert php echo strings to inject them into the . I choose to do that to change certain titles and descriptions into more commercial texts. What obvisouly ha...
Demian
1

votes
5

answer
3.4k

views

What is the best today php framework to build my own CMS?

My scope of knowledge on php Frameworks is limited to 4, CakePHP, Symphony, Zend and CodeIgniter (sort by preference) I want to know which one I could choose to build my personal CMS (which suits best for that purpose) .. Best,
demian
1

votes
1

answer
221

views

LWUIT: Which subset of html and css can the htmlcomponent read?

I noticed it can't read/parse everything you throw at it. It reads normal html, because i can see that, but i can't see the css that i use to make it look nice. although in the docs they say that css is possible. So i wonder, which part of css can it show?
Demian Kasier
1

votes
1

answer
211

views

How to call the native browser from a j2me application

I want to go to a webpage, when I click a button inside my app. I am using J2ME.
Demian Kasier
1

votes
1

answer
339

views

How to share an attribute between multiple Moose objects?

I am in need of guidance. I've been switching my lifestyle over to Moose as of late. Overall, I've found that moose makes life much more interesting and fun. At the same time, I still haven't gotten to a point where I feel more productive... probably because I keep losing myself in abstraction and s...
Demian
1

votes
1

answer
516

views

How can I load a .pod File from an URL in COCOS3D

I am making an app and I want to load some 3d models who are stored in a server. I can easily acces them in the browser with a link. The idea of the app is that you have a menu and you can select which model do you want to see.
1

votes
2

answer
35

views

jQuery select parent of element and use prependTo() for it

I am trying to restructure elements. The problem I face is that the elements do not have unique classes or IDs. So if, for example, a .prependTo is being called, it moves obviously all matching elements. HTML looks like this (important: real scenario contains hundreds of elements): example example...
Demian
1

votes
2

answer
523

views

awk problems: problems summing non-integers?

So i'm writing a bash script that has to figure out how much CPU is being used in total according to the command 'ps u'. I'm trying to use awk like so: TOTAL_CPU=$(ps u | awk '{sum = sum + $3}; END {print sum}') Typical output from the command 'ps u' has 11 columns, the 3rd being CPU usage. The prob...
Demian Dawid
1

votes
2

answer
802

views

How to run Mersenne Twister inside a function?

I have a short piece of code which runs the Mersenne Twister PRNG and it works great: std::random_device randDev; std::mt19937 twister(randDev()); std::uniform_int_distribution dist(0,99); for (int i = 0; i < 10; i++) { std::cout
Demian Wright
0

votes
0

answer
5

views

Override dateFormat in existing jQuery UI DatePicker

Due to a very extensive plugin I do not want to mess in the core files to change the dateFormat. Calling the dateFormat in an alternative script is not bringing any changes, so I am looking for an alternative solution. This is my case: Based on this thread and answer I wanted to change the existing...
Demian
16

votes
3

answer
15.6k

views

What is a good security framework or API? [closed]

Is there a framework to be used when you build an application with security? (Preferably in Java.)
Demian Kasier
19

votes
3

answer
3.2k

views

Excluding abstractproperties from coverage reports

I have an abstract base class along the lines of: class MyAbstractClass(object): __metaclass__ = ABCMeta @abstractproperty def myproperty(self): pass But when I run nosetests (which coverage) on my project, it complains that the property def line is untested. It can't actually be tested (AFAIK) as i...
Demian Brecht
19

votes
9

answer
21.5k

views

what are the most significant disadvantages of using UML?

UML is a great language to model software for business requirements, but there is a growing community that points some disadvantages for some lacking features. What are the most significant disadvantages that you find crucial for UML and what could it be a good alternative to solve this lacking feat...
demian
2

votes
2

answer
4.6k

views

how to deserialize json to a dictionary or keyvaluepair?

I have to deserialize a JSON object like this [{'Key':{'id':0, 'Name':'an Object'}, 'Value':true}, {'Key':{'id':0, 'Name':'an Object'}, 'Value':true}] I know how to deserialize arrays and singleobjects or variables. but I'm in the blue about dictionaries. I'm using the following to read an array Net...
Demian Kasier
3

votes
2

answer
990

views

How to derive with respect to a Matrix element with Sympy

Given the product of a matrix and a vector A.v with A of shape (m,n) and v of dim n, where m and n are symbols, I need to calculate the Derivative with respect to the matrix elements. I haven't found the way to use a proper vector, so I started with 2 MatrixSymbol: n, m = symbols('n m') j = t...
11

votes
4

answer
7.5k

views

how to render multiple children without JSX

How to write this without using JSX? var CommentBox = React.createClass({ render: function() { return ( Comments ); } }); This comes from the react.js tutorial: http://facebook.github.io/react/docs/tutorial.html I know I can do the following: return ( React.createElement('div', { className: 'comment...
Demian Kasier
4

votes
1

answer
195

views

Publishing build artifacts fails with error EEXIST: file already exists

we are using the VSTS task 'Publish Artifact'. Recently it started to randomly give an error: Publishing build artifacts failed with an error: Unable to create directory. EEXIST: file already exists. This happens when the task is about to create the directory where to publish. Here are some of the l...
11

votes
2

answer
21.1k

views

How to calculate distance based on phone acceleration

I want to build something like this but using an android phone: http://www.youtube.com/watch?v=WOt9mb5QqRs I've already built an app that sends sensor information via socket (still looking for a good websocket implementation for android). I intend to use that information to interact with a web app,...
Demian
2

votes
1

answer
35

views

Deleting “has” files

Title pretty much sums it up: Is there a way to delete 'has' state on a Perforce server after a sync has been done without using -p?
Demian Brecht
1

votes
1

answer
2.9k

views

ExtJS - convert json to Model

I have a json string that I need to map into a Model, I've been checking this json reader, Ext.data.reader.JsonView, but it seems that it only wokrs with a proxy, I need to pass a string (which contains the json) and map it to my model. Is that possible? Thanks, Angelo.
Demian
2

votes
0

answer
367

views

Triggering validation of <rich:calendar> client side?

I have a rich:calendar on a jsf page like this: This succesfully validates that the user didn't write some nonsense into the date field like '12456' or something. The problem is, this validation is only triggered when the form is submitted. I would like to have this checked as soon as the date field...
Demian Dawid
2

votes
5

answer
1.3k

views

OOP - How to choose a possible object candidate?

I 'm concern about what techniques should I use to choose the right object in OOP Is there any must-read book about OOP in terms of how to choose objects? Best,
demian
6

votes
3

answer
13.1k

views

get the first (or n'th) element in a jq json parsing

I can get the 1st element in a json inside [] $ echo '[{'a':'x', 'b':true}, {'a':'XML', 'b':false}]' | jq '.[1]' { 'a': 'XML', 'b': false } But if the json is already disassembled (for instance, after filtering entries using 'select'), how can I choose a single entry and avoid the error seen here? $...
Demian Glait
6

votes
2

answer
2.7k

views

Optional URL variables

Is there a way to define URLs with optional URL params in Flask? Essentially, what I'd like to do is define rules that allow for optionally specified languages: / /de -> matches / (but doesn't collide with /profile) /profile /de/profile I think I've figured out a way to do it, but it involves eithe...
Demian Brecht
6

votes
2

answer
432

views

Convert columns to rows keeping the name of the column

Is there any way in R to Convert columns to rows keeping the name of the column? Example input: A B 1 1 2 3 3 4 44 5 Output Group Number A 1 A 2 A 3 A 44 B 1 B 3 B 4 B 5
Demian Asborn
2

votes
1

answer
124

views

PHP 5.4.21 on IIS 7 dropping “<” and “</” in tags

I am generating XML data using a PHP script on an IIS 7 server with PHP 5.4.21. I noticed the data was not passing XML validation because seemingly random tags would have their '
Maxamilian Demian
3

votes
4

answer
211

views

operating on AoAs stored in hash. PDL vs no PDL

I have a hash of AoAs: $hash{$key} = [ [0.0,1.0,2.0], 10.0, [1.5,9.5,5.5], ]; that I need to crunch as follows: $err += (($hash{$key}[0][$_]-$hash{key}[2][$_])*$hash{$key}[1])**2 foreach (0 .. 2); calculating the squared weighted difference between the two arrays. Since my hash is large, I was hop...
Demian
1

votes
1

answer
1.2k

views

YouTube-Player-iOS-Helper in Swift not working but no error

I am using this library: https://github.com/youtube/youtube-ios-player-helper I have imported the YTPlayerView.h, YTPlayerView.m & YTPlayerView-iframe-player.html into my project. I made sure that the HTML file is in my Copy Bundle Resources. I have included the .h in my Bridging header. I added a U...
Maxamilian Demian
2

votes
1

answer
682

views

iOS/Swift programmatic equivalent of Android TableLayout/TableRow

I am working on an iOS version of an Android application I wrote and I am having trouble figuring out the best way to display tabular data. Android has TableLayout and TableRow, making the task fairly simple. The extra caveat is that however I create the data table, it needs to be created programmat...
2

votes
1

answer
161

views

How to set up an AoArrayrefs attribute with coercion from scalar into arrayref?

I would like to set up an attribute that is an array of arrayrefs with coercion of nonarrayrefs to array refs. eg. [ 0, [ 0, 0, 0 ], [1,2,3] ] into [ [0], [ 0, 0, 0 ], [1,2,3] ] also, I'd like to be able to push or set elements to the AoA with coercion as well. Here is my attempt: { package MyArr...
Demian
2

votes
2

answer
177

views

Showing ajax Django error

I am working on a Django project that contains a lot of ajax calls. Since i am still developing my website the ajax call sometimes return an Django error, but since these error's are formatted in HTML they are almost impossible read. Is there any way that i easily read the ajax error's, like opening...
Demian
2

votes
1

answer
119

views

(Seemingly) redundant naming of functions in classes

I've seen various patterns in object creation, but upon diving into some Firefox framework Javascript, I'd noticed that they're using a convention that I haven't seen before and I'm hoping that someone here can either confirm my assumption or correct me: When building a class, I've done this (and va...
Demian Brecht
2

votes
2

answer
495

views

Actionscript 3 - Script Libraries

I'm attempting to load the resulting swf of a swc build manually. Due to my particular environment, we have a need to segregate class definitions into swcs (where it makes sense) to remove redundant code from output swfs. In a nutshell, I'm defining a class (LibA) in a swf that I'm building with com...
Demian Brecht
2

votes
1

answer
590

views

Using computed fields in admin

I'm trying to use a runtime-computed field in my admin page. This works fine, but I'd like to allow sorting based for that field. Using Django 1.5 (dev), is this possible? I've been scouring the interweb but can't find anything indicating that it is possible. class Guest(models.Model) email = models...
Demian Brecht
7

votes
3

answer
3.9k

views

what are the main differences between all the mysql engines?

I want to make a summary of the main differences between all the Mysql engines and of course the most populars also. And what criteria should I use to determine which engine to use?
demian
33

votes
3

answer
19.3k

views

What is a SPATIAL INDEX and when should I use it?

Like most of the average PHP web developers I use MySql as a RDBMS. MySql (as other RDBMS also) offers SPATIAL INDEX features, but I'm don't get it very well. I have googled for it but didn't find clear real world examples to clarify my bad knowledge about it. Could someone explain me a little bit w...
demian
2

votes
1

answer
397

views

Activate virtualenv in Ant

Is there a way to activate a newly created virtualenv within an Ant script such that any calls to (site-packages lookups etc) uses the virtualenv and not the global shared path? I should note that a solution must work on Windows, Linux and Mac.
Demian Brecht
2

votes
2

answer
232

views

Python - packaging a source distribution

I'm currently writing a python program and I want to distribute it to some en users (and developers). I would like to reduce the number of necessary steps to run the program to a minimum. My use case is relatively simple. I'd like the process/tool/whatever to: A) Download the list of packages requ...
Demian

View additional