can one map all the application's objects to a UML map (maybe parsing through the code base) so one can have the objects visualized and see all the relations and the design patterns used?
I am looking for more complete sample code on how TeeFilter of Logback can be used to log HTTP messages.
I am trying to add this support to my Spring 3 (MVC)/Hibernate 3/Annotations Maven2 project. I have the config and xml files but I need to know where and how I can trigger this Filter to do the job for me in the Spring MVC framework.
Any help will be greatly appreciated.
I have been struggling in fixing this code, wonder what is wrong at all...
var tips = "<p class="adobe-reader-download">Most computers will open PDF documents automatically, but you may need to download <a title='Link to Adobe website-opens in a new window'";
tips +=" href='http://www.adobe.com/products/acrobat/readstep2.html' target='_blank'>Adobe Reader</a>.</p>";
if($("div#maincontent a[href*='.pdf']").length>0){
$("div#maincontent").children(":last-child").after(tip);
SELECT *
(
SELECT *
FROM `table1`
WHERE `id` NOT IN (
SELECT `id` FROM `table2`
WHERE `col4` = 5
)
group by `col2` having sum(`col3`) > 0
UNION
SELECT *
FROM `table1`
WHERE `id` NOT IN (
SELECT `id` FROM `table2`
WHERE `col4` = 5
)
group by `col2` having sum(`col3`) = 0
) t1;
For readability and performance reasons, I think this code could be refactored. But how?
hello
I was wondering how to assign a style via code in adroid.
suppose I have a TextView created with the following snippet:
TextView myText = new TextView(this);
how do I assign the class xxx so that myText will be styled like an hard coded TextView like this:
<TextView style="@style/xxx" />
thanks
hey in my application i use web browser component on a windows form and display any website that user types in say "google.com"
but that website does not fit in properly with the screen size
how can i do that through code?
i cant find any property of windows mobile...
can somebody help!
Hi,
Just wondering, would the following code arrangement cause any issues when calling mysql_connect, i.e.:
public function connect() {
mysql_connect($this->host,
$this->username,
$this->password)
or die("Could not connect. " . mysql_error());
or does it need to be all on one line, i.e.:
mysql_connect($this->host,$this->username,$this->password) or die("Could not connect. " . mysql_error());
Thanks.
I'm working on a data mining research project and use code from a big svn.
Apparently one of the methods I use from that svn uses randomness somewhere without asking for a seed, which makes 2 calls to my program return different results. That's annoying for what I want to do, so I'm trying to locate that "uncontrolled" randomness.
Since the classes I use depend on many other, that's pretty painful to do by hand. Any idea how I could find where that randomness comes from ?
I am new to iPhone development. I just registered with Apple for the iPhone Developer Program. When I try to build, I am receiving an error:
Code Sign error: a valid provisioning profile matching the application’s identifier could not be found
I'm not sure what is wrong. I tried browsing the Internet but I get confused. Can anyone help me with what I should do?
We are trying to install:
http://www.activecampaign.com/activespell/
But are getting this JS error:
[CPAINT Error] invalid HTTP response code '404'
It seems the ajax is unable to access something, but not sure what or why, anyone experienced this problem before?
I was wondering how to select number oflines from a certain text file. As an example: I have a text file containing the following lines:
branch 27 : rect id 23400
rect: -115.475609 -115.474907
31.393650 31.411301
branch 28 : rect id 23398
rect: -115.474907 -115.472282
31.411301 31.417351
branch 29 : rect id 23396
rect: -115.472282 -115.468033
31.417351 31.427151
branch 30 : rect id 23394
rect: -115.468033 -115.458733
31.427151 31.438181
Non-Leaf Node: level=1 count=31 address=53
branch 0 : rect id 42
rect: -115.768539 -106.251556
31.425039 31.717550
branch 1 : rect id 50
rect: -109.559479 -106.009361
31.296721 31.775299
branch 2 : rect id 51
rect: -110.937401 -106.226143
31.285870 31.771971
branch 3 : rect id 54
rect: -109.584412 -106.069092
31.285240 31.775230
branch 4 : rect id 56
rect: -109.570961 -106.000954
31.296721 31.780769
branch 5 : rect id 58
rect: -115.806213 -106.366188
31.400450 31.687519
branch 6 : rect id 59
rect: -113.173859 -106.244057
31.297440 31.627750
branch 7 : rect id 60
rect: -115.811478 -106.278252
31.400450 31.679470
branch 8 : rect id 61
rect: -109.953888 -106.020111
31.325319 31.775270
branch 9 : rect id 64
rect: -113.070969 -106.015968
31.331841 31.704750
branch 10 : rect id 68
rect: -113.065689 -107.034576
31.326300 31.770809
branch 11 : rect id 71
rect: -112.333344 -106.059860
31.284081 31.662920
branch 12 : rect id 73
rect: -115.071083 -106.309677
31.267879 31.466850
branch 13 : rect id 74
rect: -116.094414 -106.286308
31.236290 31.424770
branch 14 : rect id 75
rect: -115.423264 -106.286308
31.229691 31.415510
branch 15 : rect id 76
rect: -116.111656 -106.313110
31.259390 31.478300
branch 16 : rect id 77
rect: -116.247467 -106.309677
31.240231 31.451799
branch 17 : rect id 78
rect: -116.170792 -106.094543
31.156429 31.391781
branch 18 : rect id 79
rect: -116.225723 -106.292709
31.239960 31.442850
branch 19 : rect id 80
rect: -116.268013 -105.769913
31.157240 31.378111
branch 20 : rect id 82
rect: -116.215424 -105.827202
31.198441 31.383421
branch 21 : rect id 83
rect: -116.095734 -105.826439
31.197460 31.373819
branch 22 : rect id 84
rect: -115.423264 -105.815018
31.182640 31.368891
branch 23 : rect id 85
rect: -116.221527 -105.776512
31.160931 31.389830
branch 24 : rect id 86
rect: -116.203369 -106.473831
31.168350 31.367611
branch 25 : rect id 87
rect: -115.727631 -106.501587
31.189100 31.395941
branch 26 : rect id 88
rect: -116.237289 -105.790756
31.164780 31.358959
branch 27 : rect id 89
rect: -115.791344 -105.990044
31.072620 31.349529
branch 28 : rect id 90
rect: -115.736847 -106.495079
31.187969 31.376900
branch 29 : rect id 91
rect: -115.721710 -106.000130
31.160351 31.354601
branch 30 : rect id 92
rect: -115.792236 -106.000793
31.166620 31.378811
Leaf Node: level=0 count=21 address=42
branch 0 : rect id 18312
rect: -106.412270 -106.401367
31.704750 31.717550
branch 1 : rect id 18288
rect: -106.278252 -106.253387
31.520321 31.548361
I just want those lines which are in between Non-Leaf Node level=1 to Leaf Node Level=0 and also there are a lot of segments like this and I need them all.
Under WindowsCE, C++ project, I'd like to get CPU utilization and memory allocation data real time - for logging and troubleshooting. Is there a library or activeX available that i could include in my code and use [without bringing my process to a halt, preferably], anyone knows?
thanks much for any insight!
O.
function checkLength(obj,url){
//alert("URL="+url+" OBJ="+obj);
if(obj) {
var params = 'query='+obj;
var myAjax = new Ajax.Request(url, {
method: 'post', parameters: params, onComplete: loadResponse
});
}
}
The code isn't working, but I don't know why. I think I need to include other files, but I don't know which
TinyMCE not working in ie with this js code. How can I solve the problem. Thanks in advance
<script type="text/javascript">
tinyMCE.init({
theme : "advanced",
mode : "textareas",
plugin : "tinyBrowser, media",
file_browser_callback : "tinyBrowser",
});
function toggleEditor(id) {
if (!tinyMCE.get(id))
tinyMCE.execCommand("mceAddControl", false, id);
else
tinyMCE.execCommand("mceRemoveControl", false, id);
}
</script>
Hi .. i am a beginner and i have a problem :
this code doesnt compile :
main.cpp:
#include <stdlib.h>
#include "readdir.h"
#include "mysql.h"
#include "readimage.h"
int main(int argc, char** argv) {
if (argc>1){
readdir(argv[1]);
// test();
return (EXIT_SUCCESS);
}
std::cout << "Bitte Pfad angeben !" << std::endl ;
return (EXIT_FAILURE);
}
readimage.cpp
#include <Magick++.h>
#include <iostream>
#include <vector>
using namespace Magick; using namespace std;
void readImage(std::vector<string> &filenames) {
for (unsigned int i = 0; i < filenames.size(); ++i) {
try {
Image img("binary/" + filenames.at(i));
for (unsigned int y = 1; y < img.rows(); y++) {
for (unsigned int x = 1; x < img.columns(); x++) {
ColorRGB rgb(img.pixelColor(x, y));
// cout << "x: " << x << " y: " << y << " : " << rgb.red() << endl;
}
}
cout << "done " << i << endl;
} catch (Magick::Exception & error) {
cerr << "Caught Magick++ exception: " << error.what() << endl;
}
} }
readimage.h
#ifndef _READIMAGE_H
#define _READIMAGE_H
#include <Magick++.h>
#include <iostream>
#include <vector>
#include <string>
using namespace Magick;
using namespace std;
void readImage(vector<string> &filenames)
#endif /* _READIMAGE_H */
If want to compile it with this code :
g++ main.cpp Magick++-config --cflags
--cppflags --ldflags --libs readimage.cpp
i get this error message :
main.cpp:5: error: expected
initializer before ‘int’
i have no clue , why ? :(
Can somebody help me ? :)
I want to load third-party jni library in runtime.
I've tried to load directly from sdcard. It expectedly failed.
I've tried to copy library from sdcard to /data/data/app/ and then
System.load(/data/data/libjni.so)
It works on HTC HERO, but fails on HTC Legend with Android 2.1.
it fails during execution of native code and write to log uninformative stack trace
Any other way to do it?
I know i can simulate a memory warning on the simulator by selecting 'Simulate Memory Warning' from the drop down menu of the iPhone Simulator. I can even make a hot key for that.
But this is not what I'd like to achieve. I'd like to do that from the code by simply, lets say doing it every 5 seconds. Is that possible?
Does anyone know of a Windows Mobile 7 device aimed at business use?
I’m looking for something with bar code scanning capability.
Psion, hand held, and honeywell only offer 6.5 at the moment.
Granted, Windows Mobile 7 just barely came out and these sorts of devices usually lag a bit behind consumer toys...but hopefully someone can help.
I'm a bit perplexed by some code I'm currently writing. I am trying to preform a specific gradient descent (main loop included below) and depending on the initial conditions I will alternatively get good looking results (perhaps 20% of the time) or everything becomes NaN (the other 80% of the time). However it seems to me that none of the operations in my code could produce NaN's when given honest numbers!
My main loop is:
// calculate errors
delta = m1 + m2 - M;
eta = f1 + f2 - F;
for (int i = 0; i < numChildren; i++) {
epsilon[i] = p[i]*m1+(1-p[i])*m2+q[i]*f1+(1-q[i])*f2-C[i];
}
// use errors in gradient descent
// set aside differences for the p's and q's
float mDiff = m1 - m2;
float fDiff = f1 - f2;
// first update m's and f's
m1 -= rate*delta;
m2 -= rate*delta;
f1 -= rate*eta;
f2 -= rate*eta;
for (int i = 0; i < numChildren; i++) {
m1 -= rate*epsilon[i]*p[i];
m2 -= rate*epsilon[i]*(1-p[i]);
f1 -= rate*epsilon[i]*q[i];
f2 -= rate*epsilon[i]*(1-q[i]);
}
// now update the p's and q's
for (int i = 0; i < numChildren; i++) {
p[i] -= rate*epsilon[i]*mDiff;
q[i] -= rate*epsilon[i]*fDiff;
}
This behavior can be seen when we have
rate = 0.01;
M = 30;
F = 30;
C = {15, 25, 35, 45};
with the p[i] and q[i] chosen randomly uniformly between 0 and 1, m1 and m2 chosen randomly uniformly to add to M, and f1 and f2 chosen randomly uniformly to add up to F.
Does anyone see anything that could create these NaN's?
Hi
this is my code which will not work correctly ! what is wrong with its data type :( thanks
CREATE TABLE T1 (A INTEGER NOT NULL);
CREATE TABLE T3 (A SMALLINT NOT NULL);
INSERT T1 VALUES (32768.5);
SELECT * FROM T1;
INSERT T3 SELECT * FROM T1;
SELECT * FROM T3;
I'm creating a ZK Web application which uses Spring Security for authentication and I'm trying to implement a create user function, where the administrator supplies the details and the user account is created. I've got to the part where I want to put this data into the database, but now I'm thinking I shouldn't hard code the connection to the database, there must be a way to get the connection details from the Spring Security configuration. Is there? If so how?
I know there are tools like Salamander that can compile a .NET WinForms apps to fully native code with no need for the CLR/.NET Framework to be on a machine. Is this possible for WPF apps as well?
I've been thinking if there's a way how to speed up freeing memory in .NET. I'm creating a game in .NET (only managed code) where no significant graphics is needed but still I would like to write it properly in order to not to lose performance for nothing.
For example is it useful to assign null value to objects that are not longer needed? I see this in a few samples over Internet.
Thanks for answers!