Hi,
Just moved a symfony project from local (win) to server (linux), and the icons in the web debug toolbar have disappeared. Only the image alts remain so I guess it's a path issue with the images. Basically, I see "Time 300ms" instead of "[icon] 300ms" for each of the items.
I'm a little worried that some other paths aren't broken as well that are going to be a pain to find.
Has anyone had/resolved this issue?
Thank you.
I need encrypt data using exactly the PKCS#1 V2.0 encryption method (defined in item 7.2.1 of the PKCS#1V2 specification).
Is it already implemented for Java?
I'm thinking in something like just pass a parameter to javax.crypto.Cipher specifying "PKCS#1V2", I wonder if there is something like this?
Hey, can someone please show me how i can write the output of OnCreateFile to a GUI? I thought the GUI would have to be declared at the bottom in the main function, so how do i then refer to it within OnCreateFile?
using System;
using System.Collections.Generic;
using System.Runtime.Remoting;
using System.Text;
using System.Diagnostics;
using System.IO;
using EasyHook;
using System.Drawing;
using System.Windows.Forms;
namespace FileMon
{
public class FileMonInterface : MarshalByRefObject
{
public void IsInstalled(Int32 InClientPID)
{
//Console.WriteLine("FileMon has been installed in target {0}.\r\n", InClientPID);
}
public void OnCreateFile(Int32 InClientPID, String[] InFileNames)
{
for (int i = 0; i < InFileNames.Length; i++)
{
String[] s = InFileNames[i].ToString().Split('\t');
if (s[0].ToString().Contains("ROpen"))
{
//Console.WriteLine(DateTime.Now.Hour+":"+DateTime.Now.Minute+":"+DateTime.Now.Second+"."+DateTime.Now.Millisecond + "\t" + s[0] + "\t" + getProcessName(int.Parse(s[1])) + "\t" + getRootHive(s[2]));
Program.ff.enterText(DateTime.Now.Hour + ":" + DateTime.Now.Minute + ":" + DateTime.Now.Second + "." + DateTime.Now.Millisecond + "\t" + s[0] + "\t" + getProcessName(int.Parse(s[1])) + "\t" + getRootHive(s[2]));
}
else if (s[0].ToString().Contains("RQuery"))
{
Console.WriteLine(DateTime.Now.Hour + ":" + DateTime.Now.Minute + ":" + DateTime.Now.Second + "." + DateTime.Now.Millisecond + "\t" + s[0] + "\t" + getProcessName(int.Parse(s[1])) + "\t" + getRootHive(s[2]));
}
else if (s[0].ToString().Contains("RDelete"))
{
Console.WriteLine(DateTime.Now.Hour + ":" + DateTime.Now.Minute + ":" + DateTime.Now.Second + "." + DateTime.Now.Millisecond + "\t" + s[0] + "\t" + getProcessName(int.Parse(s[0])) + "\t" + getRootHive(s[1]));
}
else if (s[0].ToString().Contains("FCreate"))
{
//Console.WriteLine(DateTime.Now.Hour+":"+DateTime.Now.Minute+":"+DateTime.Now.Second+"."+DateTime.Now.Millisecond + "\t" + s[0] + "\t" + getProcessName(int.Parse(s[1])) + "\t" + s[2]);
}
}
}
public void ReportException(Exception InInfo)
{
Console.WriteLine("The target process has reported an error:\r\n" + InInfo.ToString());
}
public void Ping()
{
}
public String getProcessName(int ID)
{
String name = "";
Process[] process = Process.GetProcesses();
for (int i = 0; i < process.Length; i++)
{
if (process[i].Id == ID)
{
name = process[i].ProcessName;
}
}
return name;
}
public String getRootHive(String hKey)
{
int r = hKey.CompareTo("2147483648");
int r1 = hKey.CompareTo("2147483649");
int r2 = hKey.CompareTo("2147483650");
int r3 = hKey.CompareTo("2147483651");
int r4 = hKey.CompareTo("2147483653");
if (r == 0)
{
return "HKEY_CLASSES_ROOT";
}
else if (r1 == 0)
{
return "HKEY_CURRENT_USER";
}
else if (r2 == 0)
{
return "HKEY_LOCAL_MACHINE";
}
else if (r3 == 0)
{
return "HKEY_USERS";
}
else if (r4 == 0)
{
return "HKEY_CURRENT_CONFIG";
}
else return hKey.ToString();
}
}
class Program : System.Windows.Forms.Form
{
static String ChannelName = null;
public static Form1 ff;
Program() // ADD THIS CONSTRUCTOR
{
InitializeComponent();
}
static void Main()
{
try
{
Config.Register("A FileMon like demo application.", "FileMon.exe", "FileMonInject.dll");
RemoteHooking.IpcCreateServer<FileMonInterface>(ref ChannelName, WellKnownObjectMode.SingleCall);
Process[] p = Process.GetProcesses();
for (int i = 0; i < p.Length; i++)
{
try
{
RemoteHooking.Inject(p[i].Id, "FileMonInject.dll", "FileMonInject.dll", ChannelName);
}
catch (Exception e)
{
}
}
}
catch (Exception ExtInfo)
{
Console.WriteLine("There was an error while connecting to target:\r\n{0}", ExtInfo.ToString());
}
}
}
}
Switching aged 2003 SRV to 2008 caused my Asp.net 2 application fail: The application is no more loading the required library DLL from /bin/ folder anymore.
What should I change in my code or web.config to make this webapp load OK also in new 2008 server?
Now I receive this error when I access the application: This type is in IMPORTS ( Dll ).
Compiler Error Message: BC30002: Type
'Facebook.Entity.User' is not defined.
Hi everyone.
I'm writing a class, and this doubt came up. Is this undef. behaviour? On the other hand, I'm not sure its recommended, or if its a good practice. Is it one if I ensure no exceptions to be thrown in the init function?
//c.h
class C{
float vx,vy;
friend void init(C& c);
public:
C();
};
//c.cpp
C::C()
{
init(*this);
}
void init(C& c) //throws() to ensure no exceptions ?
{
c.vx = 0;
c.vy = 0;
}
Thanks in advance
Imagine I have a Map[String, String] in Scala.
I want to match against the full set of key–value pairings in the map.
Something like this ought to be possible
val record = Map("amenity" -> "restaurant", "cuisine" -> "chinese", "name" -> "Golden Palace")
record match {
case Map("amenity" -> "restaurant", "cuisine" -> "chinese") => "a Chinese restaurant"
case Map("amenity" -> "restaurant", "cuisine" -> "italian") => "an Italian restaurant"
case Map("amenity" -> "restaurant") => "some other restaurant"
case _ => "something else entirely"
}
The compiler complains thulsy:
error: value Map is not a case class constructor, nor does it have an unapply/unapplySeq method
What currently is the best way to pattern match for key–value combinations in a Map?
I'm attempting to load up an XML document (specifically an RSS feed) via an Ajax request, parse it, and insert some information based on said feed into my page. The code works fine in Firefox, Opera, Chrome, and Safari, but not IE7. Go figure.
After doing some initial debugging, I've found that the XML string is being retrieved via the request, and the specific node type I'm getting when trying to parse nodes out of the document is HTMLUnknownElement.
Here's the relevant code:
$.get('feed.php', function(oXmlDoc) {
var titles = $(oXmlDoc).find('title');
var dates = $(oXmlDoc).find('pubDate');
for(var i = 0; i < 5; i++) {
parseNodes(titles[i].firstChild.nodeValue, dates[i].firstChild.nodeValue));
}
});
The parseNodes function is never actually being hit because IE cannot access firstChild and, consequently, nodeValue.
Thanks in advance for any ideas and/or suggestions on how to address this.
Hi,
I have series of records in a table called 'hits' and each record has the current_timestamp (ie. 2010-04-30 10:11:30) in a column called 'current_time'.
What I would like to do is query these records and return only the records from the current month. I cannot seem to get this to work.
I have tried a range of queries that don't work such as -
Select * FROM hits WHERE MONTH(FROM_UNIXTIME(current_time)) = 4
I don't know if I am even on the right lines!
Can anyone point me in the right direction?
Cheers.
I'm really not sure what else to say about this:
Random r = new Random();
class SomeClass {
public SomeClass(){
new SomeClass(r.nextInt(5));
}
public SomeClass(int i){
...
Throws a NullPointerException where r.nextInt(5) is called. Any ideas?
do you got the solution for your problem ?
im working on the exact same thing and cant get it to work...
if u could post the solution, it would be much appreciated :o
greetingz
msn: [email protected]
steam : [email protected]
In Eclipse, the Java Method Override Indicator is the little upwards arrow next to a method in the Type Hierarchy view.
A solid arrow means a method overrides an existing method lower in the hierarchy.
What does the hollow arrow mean?
Do annotations effect either arrow?
I have a word press theme with a theme options dialog
I'd like to add a feature to upload a logo via the theme options page and then display it on the front end in the header as the logo. How would I do this. I would like to use the wordpress media uploaded, but if this is not possible or an alternative is available Id appreciate that also
I am taking over someone elses code. What are some good ways to learn what that programmer did as quickly as possible? I have been running it, stepping through it and looking at the callstack. What else can I do?
Sorry I forgot to mention, but there is little documentation and I have been trying to fix simple problems. Thanks!
I have a class with a methodcalled GetEnemiesLua. I have bound this class to lua using SWIG, and I can call this method using my lua code.
I am trying to get the method to return a lua table of objects.
Here is my current code:
void CSpringGame::GetEnemiesLua(){
std::vector<springai::Unit*> enemies = callback->GetEnemyUnits();
if( enemies.empty()){
lua_pushnil(ai->L);
return;
} else{
lua_newtable(ai->L);
int top = lua_gettop(ai->L);
int index = 1;
for (std::vector<springai::Unit*>::iterator it = enemies.begin(); it != enemies.end(); ++it) {
//key
lua_pushinteger(ai->L,index);//lua_pushstring(L, key);
//value
CSpringUnit* unit = new CSpringUnit(callback,*it,this);
ai->PushIUnit(unit);
lua_settable(ai->L, -3);
++index;
}
::lua_pushvalue(ai->L,-1);
}
}
PushIUnit is as follows:
void CTestAI::PushIUnit(IUnit* unit){
SWIG_NewPointerObj(L,unit,SWIGTYPE_p_IUnit,1);
}
To test this I have the following code:
t = game:GetEnemiesLua()
if t == nil then
game:SendToConsole("t is nil! ")
end
The result is always 't is nil', despite this being incorrect. I have put breakpoints in the code and it is indeed going over the loop, rather than doing lua_pushnil.
So how do I make my method return a table when called via lua?
Hello SO;
I'm trying to convert xml elements whose content is a csv list of identifiers, the exact form doesn't matter. I want to exclude every item that contains the character "/". The best I've come up with is
translate(./someElement, ",*/*", "")
but this has at least two problems; I'm pretty sure that xsl doesn't accept wildcards, and "," is an illegal character in xpaths.
Is there a straightforward way to do this sort of thing?
To begin with, I just can say that I have always been programming by my own. I use php mostly. So, can you explain me why I should learn Zend Framework or other framework? Why just don't write a pure code by own?
I'm trying to add a button onclick event to a button tag when I load my Fancybox popup using the following code:
var processOrder = function(id) {
$('#processPopupLink').fancybox({
'hideOnContentClick': false,
'frameWidth': 850,
'frameHeight': 695
}).click();
$('#processComplete').click(function() {
alert('debug');
});
}
However, it's not showing the message box when I click the button, I have no idea why it is not working, any help would be appreciated.
Hi!
I'm a web developper/objective-c developper and I'd like to learn quickly to make some apps for windows.
I say quick because I'm used to learning many languages and I don't need any overview on concepts, patterns, etc.
Any answers will be very appreciated :)
Thanks!
The IBM Toolkit for MPEG-4 comes with the following paragraph in its licence:
Rights In Data
You assign to IBM all right, title,
and interest (including ownership of
copyright) in any data, suggestions,
and written materials that 1) is
related to Your use of the Program and
2) You provide to IBM. If IBM requires
it, You will sign an appropriate
document to assign such rights.
Neither party will charge the other
for rights in data or any work
performed as a result of this
Agreement.
Correct me if I am wrong, but I'm understanding that I cannot use their toolkit without give them rights on my software?
I'm sure I'm simply overlooking something in the Facebook API docs. Basically, after I've loaded the FB Graph, I need to know if the session is active... I cannot simply assume they're logged out and simply re-render if they're logged in once the 'auth.statusChange' event is triggered. I need to know right off the bat.
Below is the code that I've used. Most importantly the FB.getLoginStatus/getAuthResponse/getAccessToken don't work like I'd expect; essentially where it indicates, when invoked, whether they're logged in or out.
(function(d) {
// Create fb-root
var fb_root = document.createElement('div');
fb_root.id = "fb-root";
document.getElementsByTagName('body')[0].appendChild( fb_root );
// Load FB Async
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
// App config-data
var config = {
appId : XXXX,
cookie: true,
status: true,
frictionlessRequests: true
};
window.fbAsyncInit = function() {
// This won't work.
// I can't assume they're logged out and rely on this to tell me they're logged in.
FB.Event.subscribe('auth.statusChange', function(response) {});
// Init
FB.init(config);
// These do not inidicate if the user is logged out :(
FB.getLoginStatus(function(response) { });
FB.getAuthResponse(function(response) { });
FB.getAccessToken(function(response) { });
};
}(document));
Any help is much appreciated. :)
When I use the annotation:
@XmlRootElement(name="RootElement", namespace="namespace")
class RootElement {
to create xml file from java, it creates the root element as:
<ns2:RootElement xmlns:ns2="namespace">
but I wanted to create without the "ns2", like:
<RootElement xmlns="namespace">
Any idea how to fix it?
Reletad link (example I used to create the xml):
http://www.java2s.com/Code/JavaAPI/javax.xml.bind.annotation/XmlRootElementname.htm
Hi,
I have a string in PHP for example $string = "Blabla [word]";
I would like to filter the word between the '[' brackets.
The result should be like this $substring = "word";
thanks
Fist of all, when I say "run a desktop app in a applet" I mean do a Applet application that runs off-line, instead of a Desktop application that runs inside a JFrame.
The little I know about applets (and maybe something I say is wrong, please correct me) is that applets have all permitions not granted by default. Also, the applets run inside a Sandbox, that does not allow information in or out without explicity permition.
So, if I am focused on security in my application, its best to run it inside an applet (off-line, for a desktop application) then inside a JFrame. Is it right?