Hello
I want to make a simple bat file in Windows 7 but the command (route) only works in admin mode so I would have to ask for admin premissions. How do I do this in a bat file?
Thank you
Hello
I want to make a simple bat file in Windows 7 but the command (route) only works in admin mode so I would have to ask for admin premissions. How do I do this in a bat file?
Thank you
Im trying to modify where “sales_flat_quote_item_option” is modified (more so inserted). I want to add some code so I can write it to a file as well.
Where is this done?
Thank you
Magento is good indeed.
Worst eCommence in your life to deal with. IMO, its like Linux: When it came out, it was impossible but over the years it (will) improve.
(The answers for getting a reply for this HERE are near null but might as well give it a shot....)
Hello
My products have a item option that is stored in “sales_flat_quote_item_option”. This happens when I select this option for the product and I add the product to that cart.
I want to modify the Magento’s core so that besides doing that (inserting into Magento’s database that item option), I want it to do something else as well.
Where can I see this behavior so I can write some more code in there and change it up a bit?
If I am not clear, please ask for some more information.
Thank you
Anything at all??
Riahc3, it was mentioned earlier you can quote using the '>' character at the start of the quoted sentence. No need for writing out lots of quote tags :)
I tried this. But lets say I quote you using '>', line break, and then I start typing; It still sees WHAT I AM TYPING as a quote. I dont know if this is a IE9/W7 bug....
The only way I can split quotes is a lot of line breaks then highlighting and quote.
Then you should take the two minutes it takes to learn how to do it. Since the last changes (which were made following suggestions from the users) I no longer have a problem quoting either manually or with the Quote button
The only way to do it and have the correct output is copy, hit the quote button, erase the double quote it automatically does for some unknown reason and continue....
From what I understand (I don't have to work with the code), trying to "pretty up" the frontend of VBulletin was like putting lipstick on a pig. IMO you start with a solid foundation then build on that. You don't spend your time playing whack-a-mole with a crappy code base.
Here is the thing: Users love the lipstick. They dont care if there is a pig behind it. Thats the developers problem.
What we have currently here is a great body (backend) with a malformed face (frontend). Users are …
I originally quoted Dani entirely because its a pain to quote her post part by part
I could have made all the "quote" tags I want copying and pasting them (if theyd work) and copy paste the parts I wanted to address.....but again, since the posting system is horrible.....
And Ive read that Im the only one complaining; There are a couple of other threads relating similar things but you dont hear most because most come here, post their code, someone fixes it, and they go on their way. I come and go from this site every few months, personally.
BTW, I am not trolling. Im not pointing these things out to waste my time or the rest of the members' time. If you feel this way, please leave the thread.
My apologies for taking so long to post ...
Thank you for your time Dani. As you can see, quoting you is near imposible and since you use Javascript to do it, this post Im writing appers with a lag that is horrible. Nonetheless, you took the time and Ill try to take the time to reply to your post...
Ive read this on several occasions: The backend of vBulletin was a mess and the frontend was good, but now this new system, the backend is nice but the frontend??? Ultimitly your site is directed towards users who use the site. I mean yeah its nice that its easier for you but you made it harder for the users. The users should come first and then the backend.
I know that you have limited resources as most programmers working on this site work for free and do it in their free time, but it has been months now and I dont see any improvement over the system. I cant say it gets worst either (except bugs/glitches but those are expected in some way) but most importantly it doesnt get better. I come to this site, I read a reply and think "man this is going to be painful to quote and copy code" I am never expirenced that with ANY site.
Ive posted on Github and Stack Overflow and I have never felt the way I feel about your site as I described above. I mind it alot …
What do I call in my main program when calling this function? What paramaters should I pass?
I believe I should pass the main file and the directory its going to. Am I right?
...did it just magically turn one of my quotes into code? Id even consider this stuff funny sometimes. Unprofessional, but funny.
Read the full sentence before getting insulted. Nobody can seem to reproduce the issues to the severity that you suggest.
Man Im really trying to stay calm but your stupidity grows and grows.....
pritaeas reproduced the exact issue with the severity that I suggested. He shows screenshots. What else do you want? Pay me a plane ticket and Ill show it on your PC if thats what you need!
Oh, the irony.
The curious thing is that you can "read everything" but you dont understand a picture....
In IE only, which we've confirmed and are working on
In this thread, in that post if the only moment you confirmed it and are working on it. If its in another thread, I apoligize.
However, you say it happens all the time regardless of browser, which I cannot reproduce or find anyone aside from you who can do so. I'll also note that the confirmed problem is only a subset of the problems you claim work together to make Daniweb completely unusable for you. I'm truly sorry, but I can't fix a bug that I can't reproduce. At this point (and until there are reproduction steps) I can only conclude one of two things, neither of which you'll like: You're exaggerating about the severity of the problems, and it's really nothing more than the confirmed cursor bug in IE. The problems as stated are real, and as bad as you say, but they're environmental in …
Ctrl+A, Right-Click + Select All, work as intended.
Once again, no. They do not work.
Blaim Microsoft, not DaniWeb.
Blaim Microsoft? Is this a new company? Blaim sounds like such a powerful word!
Dont BLAME anyone/anything on the site's errors and incorrect programming. The fault is the programmers working on DaniWeb.
Let's try this again. What OS and browser are you using and what versions? You've said you're having problems with Chrome, Firefox, and IE, but there's definitely something else going on because nobody can seem to reproduce the issues to the severity that you suggest. Surely you don't think that we'd release something as bad as the above and claim that it's not broken. :rolleyes:
Noone can seem to reproduce the issueS? Excuse me? pritaeas mentioned in this thread that one of the bugs happens to him as well. Read everything, not only the things you want to....
This happens on Windows 7 Ultimate SP1. My main browser is IE9 but Ive tried to see if my experience on this site is better with Chrome and Firefox (a good site is good on ALL browsers but....) yet these same bugs appear.
It looks good then?
Any comments, please?
Thank you.
Just to get more information and with this more help, this is the main program (originalcode):
if (writejpg==1)
{
ftp.subidaftp(ip, "Anonymous", "pass", nombreprograma+".bmp", "/PROGRAMAS1_W/");
}
else
{
ftp.subidaftp(ip, "Anonymous", "pass", nombreprograma+".jpg", "/PROGRAMAS1_W/"+nombreprograma+"/");
}
ftp.hacercarpetaftp(ip, "Anonymous", "pass", nombreprograma);
ftp.subidaftp(ip, "Anonymous", "pass", nombreprograma+".bin", "/PROGRAMAS1_W/"+nombreprograma+"/");
ftp.subidaftp(ip, "Anonymous", "pass", "Path1.bin", "/PROGRAMAS1_W/"+nombreprograma+"/");
Those functions "hacercarpetaftp" and "subidaftp" are these:
hacercarpetaftp:
public void hacercarpetaftp(String ip, String usuario, String pass, String carpeta)
{
FTPClient client = new FTPClient();
try
{
client.connect(ip);
client.login(usuario, pass);
//String dir=client.printWorkingDirectory();
boolean existe=client.changeWorkingDirectory(carpeta);
if (existe==false)
{
client.makeDirectory("/PROGRAMAS1_W/"+carpeta);
//client.changeWorkingDirectory("/PROGRAMAS1_W/");
client.logout();
}
}
catch (SocketException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
finally
{
try
{
client.disconnect();
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
subidaftp
subidaftp(String ip, String usuario, String pass, String fichero, String directorio)
{
FTPClient client = new FTPClient();
FileInputStream fis = null;
try
{
client.connect(ip);
client.login(usuario, pass);
try
{
client.setFileType(FTP.BINARY_FILE_TYPE);
}
catch (IOException e1)
{
System.out.println("ERROR: No se ha podido cambiar el fichero a tipo binario ( " +e1.getLocalizedMessage()+" )");
}
String filename = fichero;
fis = new FileInputStream(filename);
boolean existe=client.changeWorkingDirectory(directorio);
if (existe==false)
{
client.makeDirectory(directorio);
client.storeFile(filename, fis);
client.rename(filename, directorio + filename);
}
else
{
client.storeFile(filename, fis);
client.rename(filename, directorio + filename);
}
client.logout();
}
catch (IOException e)
{
if (e.getLocalizedMessage().equals("Connection refused")==true)
{
System.out.println("La maquina a la que me he intentado conectar, me ha rechazado la conexion. Su IP es " + ip + " Revisa su configuracion y …
I spend forever tabbing code on StackOverflow.... DaniWeb isn't the only one.
But it isnt the hell that tabbing code on here is....
I'm not looking at how it works, but I will give you some thought about what may happens.. 1)Line 13, do you know that a file name can contain most character (if not all)? For example, you could have a file name "abcd.efg.doc" especially on Windows. The way you extracting a file extension may give you an unexpected result. What you should do is to find the last index of the full stop '.' using lastIndexOf() instead.
2)Line 17, it could throw a NPE (NullPointerException) if your directorio is null. Then you do not have a proper catch clause to handle it and that may cause an unexpected behavior later on.
3)Lines 87 and 120, do you also know that the file extension is case-sensitive on Linux/Unix? I'm not sure about Mac though because I don't have one to work with yet (thinking about buying one). For example, apic.JPG is not equal to apic.jpg. If you are testing the extension without ignoring case, I assume you expect the kind of result I mentioned above (case-sensitive). Just my two cents...I'm not looking at how it works, but I will give you some thought about what may happens.. 1)Line 13, do you know that a file name can contain most character (if not all)? For example, you could have a file name "abcd.efg.doc" especially on Windows. The way you extracting a file extension may give you an unexpected result. What you should do is to find the last …
A great example just happened to me of the shitty posting system here.....
I typed up a long post and for some reason, Daniweb logged me out. First, why does Daniweb allow me to write a post if I cant post unless Im logged it? Flaw. Anyways....
I noticed this and I tried to "Select All.........Copy" the textbox. ITS IMPOSSIBLE TO DO. Keyboard shortcuts, select with mouse and right click select/copy, edit select all copy, etc. IT DOESNT SELECT IT AND/OR COPY. And now I have to rewrite the entire post again.
And now a new bug is happening, when I post code, if I click on a certain area in the reply box, text Ive typed before, moves around to the bottom. Its just horrible.....
No, what matters first and foremost is the code is doing the job it set out to do. Everything else (good design, efficiency etc.) comes after that.
I disagree. What matter first is that the code is clear to the programmer (or programmers better yet) then second making sure the code is doing the job its suppose to do.
If you do that first, then second is much easier.
The best way without is the first method.
If Id write the second method, Id just go all out:
if (something) { do something} else { do another thing}
If Im going to make code unclear with the second method, I just make it 100% sloppy instead of 50%. The second method is not clear at all. If you are programming PERSONALLY, then whatever you want to use, but if it is a open source project, then the first method is better.
This is a continuation of the last thread. I insert 3 files: Two bins (path and a number) and either a jpg or a bmp This does the following.
1: Connects to FTP and changes to C:/ (/)
2: It checks if a webfolder exists. If it is, goes to it. If it isnt, it creates it and goes to it.
3: It checks if a folder with the current date exists. If it exists, it checks if it has more than/equal to 44 files, if it does 3a. If it doesnt, 3b
3a: If 3a, it makes the current date but with a "_2". For example, today the folder would be 20121211 but since it has more than/equal to 44 files, it would be 20121211_2 if it doesnt have more/equal to 44 files, if not continue to 3, 4, etc. It would then change to this folder and continue to 3b
3b: Since it doesnt have less than 44, i go inside the folder. if i am inserting a bmp, i create the bmp inside this folder and then make a new folder with the name being the number and insert the path bin and the number bin. if i am inserting a jpg, i make a new folder with the name being the number, and insert the path bin, the number bin, and the jpg.
4: I then disconect.
The code is big and I dont think Ill translate much. That being said …
So how can I do this?
2GB of ram isn't going to give you much data space. Do you have to load the entire file at once or can you load it in parts?
Im going to be adding/deleting files to and from the ISO. You tell me :)
Using a loop is a waste of time. Arrays contain multiple methods for searching built in:
BinarySearch()
Exists()
Find()
FindAll()
FindIndex()
FindLast()
FindLastIndex()
IndexOf()
LastIndexOf()
There are 1000s of efficient more ways but the way I showed him is something standard in programming....
Yes im fairly new but would say i have a basic understanding i have built a program which generates 20 random integers from 0-9 on the form load and when the user types in a number between i need to find the first occurence of that number within the array but all i can do at the mo is print out how many times it appears eg if the number 7 appears 3 times within the 20 random numbers it prints out 777 but i need to display the position its at in the array or an error message saying not found! im close but not quite there
Did you even try what I put? It does what you said; You just have to change a few things (if you want the guess to come from a input box) and add one little thing to the message box.
What database is this going against?
returns lots Configuration Error.
"Lots of" configuration errors doesnt tell us much....
I can provide any code that that may be helpful
I am 101% positive that if you posted all the code, people would have saw the flaw A LOT faster......
I can't figure out where in the loops to place my ExecuteNonQuerys and how to structure my sqlcommands
My recommendation is to make subfunctions such as
(Psuedocode)
function insert(string table, string data, string whereclause)
{
//comands to insert structured correctly
}
This make life a lot more simpler when you are going to be working a lot with databases.
int[] yourarray;
String guess = "4";
for (int j=0; j < yourarray.Length;j++ )
{
if (yourarray[j].ToString()==guess)
{
MessageBox.Show("Guessed!");
break;
}
}
Are you new to C#? This is a example but I think this more or less shows you how to do it.
Mark as solved please :)
This is something I would like to do as well in the future.
BUT
I decided against it for several reasons
1: You can copy/paste things of course, but it seems you are working with XML files. Thats different in C#
2: Java web services USUALLY go against something like Apache Tomcat. C# web services USUALLY go against IIS. Therfore you would have to change what you are going against as well.
How big is the file? You are limited by how much memory you have on your system, and the 2GB data limit (if you are using .NET 4.0 or lower).
It will be a .ISO file. Max is 1GB. I dont think Ill go over that. Im running on 2GB of RAM. Im using .NET 4.5 to develop this so that limit wont exist :)
Yup, it looks like it works :)
This afternoon Ill start to port this base over to the main program.
Remove line 99 which changes back to parent directory before it create a new directory. The reason is that your program has already switched to the parent directory when it found
the folder but the folder is full (from line 87).
I feel stupid; I didnt see that line :S
It looks like it is working (Ill do some more test now). This is just the base because now I have to port this small portion to a bigger program that deals with more subfolders/files. With this base, I could mold it to the bigger program but, like always, things never work out the first time....
Ill problably be back in a few days.
Thanks a lot for helping out Taywin.
Hey
I want to Load/read/write a big file (ISO) in C#. Ive tried various combinations (FileStream, BinaryStream, etc) but all of them give me a "OutOfMemory" exception. What is the best way to load a big file into C# to work with it?
Ill be using the DiscUtils library if its any help.
Still doesnt put it correctly :(
New code:
public static void main(String[] args) throws SocketException, IOException
{
int counter=1;
FTPFile found;
int done=0;
//System.out.println(h.hello);
FTPClient f=new FTPClient();
System.out.println("Trying");
f.connect("192.168.100.2");
f.login("Anonymous","");
System.out.println("YES!");
File e=new File("test2.txt");
e.createNewFile();
FileInputStream s=new FileInputStream(e);
//FTPFile[] list = f.listFiles();
String cai="CARPETAINTERNET"; //folder I want to use
f.changeWorkingDirectory("/");
if (f.changeWorkingDirectory("webfolder")==false)
{
f.makeDirectory("webfolder");
f.changeWorkingDirectory("webfolder");
}
FTPFile[] list = f.listFiles();
while (done==0)
{
found=null;
if (counter==1)
{
cai="CARPETAINTERNET";
///f.makeDirectory(cai);
//f.changeWorkingDirectory(cai);
}
else
{
cai="CARPETAINTERNET"+Integer.toString(counter);
//f.makeDirectory(cai);
//f.changeWorkingDirectory(cai);
}
for (int i=0;i<list.length;i++)
{
if ((list[i].getType() == FTPFile.DIRECTORY_TYPE) && (list[i].getName().equals(cai)))
{
found=list[i];
break;
}
}
if (found!=null)
{
//f.changeWorkingDirectory("/"+found.getName());
//f.changeWorkingDirectory("/webfolder/"+found.getName());
f.changeWorkingDirectory(found.getName());
FTPFile[] list2 = f.listFiles();
int archivos=0; //number of files
for (int x=0;x<list2.length;x++)
{
if (list2[x].getType()==FTPFile.FILE_TYPE)
{
archivos=archivos+1;
}
}
System.out.println("Working with "+f.printWorkingDirectory()+"/"+e.getName());
System.out.println("Total file: "+archivos);
if (archivos<44)
{
f.setFileTransferMode(FTP.ASCII_FILE_TYPE);
f.setFileType(FTP.ASCII_FILE_TYPE);
f.storeFile(f.printWorkingDirectory()+"/"+e.getName(), s);
done=1;
}
else
{
f.changeToParentDirectory();
//f.changeWorkingDirectory("/webfolder/");
counter=counter+1;
}
}//end if found not null
else //if found equals null
{
//f.makeDirectory("/"+cai);
//f.changeWorkingDirectory("/"+cai);
f.changeToParentDirectory();
f.makeDirectory(cai);
f.changeWorkingDirectory(cai);
f.storeFile(f.printWorkingDirectory()+"/"+e.getName(), s);
done=1;
}
}//end while
} //end main
This does the following:
I have webfolder created (c:/webfolder)
then I have c:/webfolder/carpetainternet with 60 files inside.
It detects it. your print comes out saying:
Working with /webfolder/CARPETAINTERNET/test2.txt
Total file: 60
BUT
it does C:/CARPETAINTERNET2/test2.txt when it should do c:/webfolder/carpetainternet2/text2.txt
Must be somewhere Im going back to the parent directory more than once....Right now I cant see it. Ill keep looking but if you see it before, please comment :)
Thanks for the help
Either of the "serious" IDEs (Netbeans and Eclipse) is so functional that there's bound to be a massive learning curve. In both cases the first few days are going to be discouraging, but stick with it...
I currently use MyEclipse as my standard IDE.....
Since you're a bit past the beginner stage, how about Netbeans? It's the one that the
Oracle Java tutorials use. http://docs.oracle.com/javase/tutorial/uiswing/learn/index.html
I think I tried it out but for some reason I didnt like it.........Ill retry it now and see...
Yes, you already said that in your first post.
The code you have posted in not valid Java. It won't compile, and therefore cannot be executed. So how about posting the actual code that gave you the error?
I could have sworn I commented that....
I gave you what I THINK it could be......if you dont post the entire code, we have no idea.
Is there any easy IDE that lets you build a easy GUI with Java? I wish you could comply native Java using VS! :P
I wont try to be as rude as stultuske
Lets say you have:
public class soemthing
{
class hi
{
String hello="i say hello";
}
class bye
{
String goodbye="i say goodbye";
}
public static void main(String[] args)
{
hi h=new hi();
System.out.println(h.hello);
bye b=new bye();
System.out.println(b.goodbye);
}
}
(BTW, dont copy and paste the code above as it doesnt work. It is a example)
As you can see I have two (variable) objects based off two classes. The first one (h) only has access to the variable hello because its inside the class and nonvisible. Same thing for the other.
I am looking for a java code
Noone is going to give you code here. Look around and when you have looked at something and/or written SOME code, then we will help you out.
I looked at this library: http://htmlparser.sourceforge.net/ and it seems to have what you want/need.
Looks like you should use 149.....
Remember positions start at 0 and end at one less of your declared value.
Example:
int[] hi=new int[5];
Has these positions:
hi[0]
hi[1]
hi[2]
hi[3]
hi[4]
ets get this straight... every forum has its own pros and cons.......
No doubt. Its just that most forums have more pro than cons. This one is the few that you notice more quirks than amazing features (I perfer not to call them pro and cons :) )
Windows 8 maybe that will happen, but for now it's impossible to have the same experience on both PC and mobile platform simply because mobile doesn't have the real-estate necessary to view DaniWeb like you do on PC. I tried it on a tablet -- very very difficult to do. Some web sites have a mobile version of the PC web site and the user experience are definitely different on the two. Maybe with Windows 8 and beyond that will change so that the experience will be identical on both. But for now, that isn't possible.
I was referring to a simple forum. Forums dont use anything flashy or resource intensive to have a different expierence. You hit with your finger the textbox where you want to type, type, and click on Post. Same expirece: Finger (click), type (type), and finger (click).
I repeat that I have the same expirence on most forum sites except daniweb. Hell, I actually load the desktop version on most forum sites because the mobile version is too stripped.
That was funny. Was it supposed to be?
No, if you think it was funny, you need professional help :)
New code:
public static void main(String[] args) throws SocketException, IOException
{
int counter=1;
FTPFile found;
int done=0;
FTPClient f=new FTPClient();
System.out.println("Trying");
f.connect("192.168.100.2");
f.login("Anonymous","");
System.out.println("YES!");
File e=new File("test2.txt");
e.createNewFile();
FileInputStream s=new FileInputStream(e);
FTPFile[] list = f.listFiles();
String cai="CARPETAINTERNET"; //folder I want to use
f.changeWorkingDirectory("/");
if (f.changeWorkingDirectory("webfolder")==false)
{
f.makeDirectory("webfolder");
f.changeWorkingDirectory("webfolder");
}
while (done==0)
{
found=null;
if (counter==1)
{
cai="CARPETAINTERNET";
f.makeDirectory(cai);
f.changeWorkingDirectory(cai);
}
else
{
cai="CARPETAINTERNET"+Integer.toString(counter);
f.makeDirectory(cai);
f.changeWorkingDirectory(cai);
}
for (int i=0;i<list.length;i++)
{
if ((list[i].getType() == FTPFile.DIRECTORY_TYPE) && (list[i].getName().equals(cai)))
{
found=list[i];
break;
}
}
if (found!=null)
{
//f.changeWorkingDirectory("/"+found.getName());
//f.changeWorkingDirectory("/webfolder/"+found.getName());
f.changeWorkingDirectory(found.getName());
FTPFile[] list2 = f.listFiles();
int archivos=0; //number of files
for (int x=0;x<list2.length;x++)
{
if (list2[x].getType()==FTPFile.FILE_TYPE)
{
archivos=archivos+1;
}
}
System.out.println("Working with "+f.printWorkingDirectory()+"/"+e.getName());
System.out.println("Total file: "+archivos);
if (archivos<44)
{
f.setFileTransferMode(FTP.ASCII_FILE_TYPE);
f.setFileType(FTP.ASCII_FILE_TYPE);
f.storeFile(f.printWorkingDirectory()+"/"+e.getName(), s);
done=1;
}
else
{
f.changeToParentDirectory();
//f.changeWorkingDirectory("/webfolder/");
counter=counter+1;
}
}//end if found not null
else //if found equals null
{
//f.makeDirectory("/"+cai);
//f.changeWorkingDirectory("/"+cai);
f.makeDirectory(cai);
f.changeWorkingDirectory(cai);
f.storeFile(f.printWorkingDirectory()+"/"+e.getName(), s);
done=1;
}
}//end while
} //end main
What this does is, if there are more than 44 files, it does
C:/webfolder/CARPETAINTERNET/CARPETAINTERNET/test2.txt
It should insert it into
C:/webfolder/CARPETAINTERNET2/test2.txt
It never reaches your working with and total files println.....
I take it you're going to air your dirty laundry every few months just to remind us that you're unhappy with the new system?
I could have sworn I made this thread before. I looked around and could not find it. I apoligize.
But Im not sure if it was you or another user that said you get use to it if you learn how to use it. I tried and I tried and I just cant because other forums are not like that.
You can use spaces too, or the Code button on the editor. Or you could not use an old DOS box because extreme examples are often stupid. And let's be honest here, if you're posting from a phone or a tablet, you shouldn't really expect the same experience as you would from a computer. We may even provide a mobile version of Daniweb in the future. Having used forums from a tablet before, I recognize that there are usability issues. But it's not unique to Daniweb. I think the problem is that you've become used to vBulletin based forums and simply don't like being forced to learn new workarounds.
Thanks for the space tip but "tabbing" with the space bar is like using Windows 95 in 2012; Yes you can do it but you shouldnt. Ill give it you that the DOS box was a extreme example but a mobile platform? Im sorry but no; A forum should have the same expirence …
Ive started my program by doing this:
f.changeWorkingDirectory("/");
if (f.changeWorkingDirectory("/webfolder/")==false)
{
f.makeDirectory("/webfolder/");
f.changeWorkingDirectory("/webfolder/");
}
Do I have to put that / at the end of webfolder or is it
f.makeDirectory("/webfolder");
?