|
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. |
On April 19 2015 08:10 betaflame wrote: Hi guys, I have a good amount of experience with LAMP stack, php, mvc frameworks, jquery, javascript and such and I am looking into learning "MEAN" and I have a couple questions:
From my own research, there seems to be 2 main "frameworks" for MEAN but by itself, you could technically work with just mongodb, expressjs, angular and node on its own together. So is there any point in really going with those advertised "MEAN" stacks? Like what do they offer versus just using the 4 together by myself?
Also, coming from a LAMP background, I originally started with procedural php programming before learning about mvc frameworks and all that jazz that made my life easier, would you recommend diving straight into working with frameworks (express) or just work with just node and angular instead (without express)?
I don't see why you would learn MEAN if you are already versed in LAMP. You can use MongoDB also with LAMP, while with MEAN you cannot even switch database. The main draw to MEAN is the single language which shouldn't be a factor if you already know LAMP.
|
On April 19 2015 14:49 catplanetcatplanet wrote:hey guise i'm not an advanced programmer or anything but i'm convinced my lab partner is a moron ![[image loading]](http://i.imgur.com/zAr3t8a.png) what can i do to stop him from doing dumb stuff like this
code reviews
also choose your own partner
|
alright i'll try to get through to him in some way this week lol
meanwhile i'm having a problem with std::vector... my program involves a hashtable implemented as an array of vectors (this is how they told us to do it). checkLegal is supposed to check if the input key is in the dictionary which is indexed in a hashtable. basically the first time i call checkLegal it works fine but the second time it always segfaults in the containsKey method on vector::size() (line 96) even though it doesn't alter any of the vectors as far as I can tell. always the second time
The cout are for debugging because we didn't spend more than 10 minutes on gdb
we're not really too familiar with vectors, they just introduced them this week and told us to look at the stl documentation
this is the hash table method
91 template <typename K, typename V> 92 bool HashTable<K,V>::containsKey(K key) { 93 cout << "a" << endl; 94 int index = hash(key, capacity); 95 cout << "b" << endl; 96 cout << table[index].size(); 97 cout << "c" << endl; 98 for(int c=0; c < table[index].size(); c++) { 99 if(table[index].at(c).first == key) { 100 return true; 101 } 102 } 103 return false; 104 }
this is the method in the actual program which calls containKey dict is a hash table of word keys with meaningless int values
63 void checkLegal(HashTable<string, int> dict) { 64 string str; 65 cout << endl << "Enter the word you wish to play: "; 66 cin >> str; 67 if(dict.containsKey(str)) { 68 cout << "Congratulations, you have found a legal play!" << endl; 69 } 70 else { 71 cout << "That's not a word! What were you thinking?!" << endl; 72 } 73 }
any input would be appreciated!
|
am i supposed to do anything special to put my java web application onto a web server?
its supposed to be super simple, i export my project to a plain zip file , then in the server (Jelastic cloud) click Upload, then Deploy, then Open in browser
but i get
type Status report
message /
description The requested resource is not available.
Apache Tomcat/7.0.55
am i supposed to change anything in my application before uploading it ? do certain files need to be in the top of the zip folder ? do i need to configure it to run using Apache Tomcat instead of glassfish before zipping and uploading it?
edit OK theres a glassfish 4.1 setting option for my server environment setup, so i changed it from tomcat to that. it still 404ed tho
EDIT i changed my
[2015-04-19T23:57:07.392+0000] [glassfish 4.1] [WARNING] [] [javax.enterprise.system.container.web.com.sun.web.security] [tid: _ThreadID=30 _ThreadName=http-listener-1(4)] [timeMillis: 1429487827392] [levelValue: 900] [[ Context path from ServletContext: differs from path from bundle: /]]
[2015-04-19T23:57:15.132+0000] [glassfish 4.1] [SEVERE] [] [org.apache.jasper.servlet.JspServlet] [tid: _ThreadID=28 _ThreadName=http-listener-1(2)] [timeMillis: 1429487835132] [levelValue: 1000] [[ PWC6117: File "null" not found]]
servlet-controller from /g5 to g5 (and it added a glassfish-web.xml file to my project) but it still doesnt run
now i think i should have a .jar file in the project file.
i have been exporting my project to zip but i think you might be supposed to "Package" it instead
in netbeans , i rightclick my project and Propteries->Build tab. There is supposed to be a Package tab there but i have ONLY a Compile tab
am i supposed to add a plugin to netbeans that lets me Package ?
|
On April 20 2015 07:11 catplanetcatplanet wrote:alright i'll try to get through to him in some way this week lol meanwhile i'm having a problem with std::vector... my program involves a hashtable implemented as an array of vectors (this is how they told us to do it). checkLegal is supposed to check if the input key is in the dictionary which is indexed in a hashtable. basically the first time i call checkLegal it works fine but the second time it always segfaults in the containsKey method on vector::size() (line 96) even though it doesn't alter any of the vectors as far as I can tell. always the second time The cout are for debugging because we didn't spend more than 10 minutes on gdb we're not really too familiar with vectors, they just introduced them this week and told us to look at the stl documentation this is the hash table method 91 template <typename K, typename V> 92 bool HashTable<K,V>::containsKey(K key) { 93 cout << "a" << endl; 94 int index = hash(key, capacity); 95 cout << "b" << endl; 96 cout << table[index].size(); 97 cout << "c" << endl; 98 for(int c=0; c < table[index].size(); c++) { 99 if(table[index].at(c).first == key) { 100 return true; 101 } 102 } 103 return false; 104 }
this is the method in the actual program which calls containKey dict is a hash table of word keys with meaningless int values 63 void checkLegal(HashTable<string, int> dict) { 64 string str; 65 cout << endl << "Enter the word you wish to play: "; 66 cin >> str; 67 if(dict.containsKey(str)) { 68 cout << "Congratulations, you have found a legal play!" << endl; 69 } 70 else { 71 cout << "That's not a word! What were you thinking?!" << endl; 72 } 73 }
any input would be appreciated!
bool containsKey(K& key); void checkLegal(HashTable<string, int>& dict)
Use references for passing. Otherwise, you call the copy constructor implicitly.
If you can use Visual Studio, you can easily set break points for debugging.
|
ahh okay i see why it segfaulted then. thanks!
why would it work fine the first time, though?
|
+ Show Spoiler +am i supposed to add a plugin to netbeans that lets me Package my web application? i have just been exporting it to zip instead. there is no Package option in my project menu where it is supposed to be , i have only a Compile tab. i'm looking at random plugins but idk . my project is already a maven project
all "fixed" now:
OK since i am in a maven project (and for some reason cant enable my Java Web and EE plugin nomatter what type of project i create, although i dont think that has anything to do with anything) i had to rightclick my pom file -> maven -> goal -> type in package and click go. this created a snapshot jar for me to use. LUCKILY someone told me this otherwise how in FUCKS name are you supposed to figure that out. its not even a dropdown, you literally type in any random word and click go apparently. there was no way in hell i could have known it was due to me being in maven. especially when im staring down a plugin named EE "inactive" and no way to activate it.
when i make a regular java application i get the Package menu just fine.
my web app is online. going to have a break
question: to install java EE do you
1) install java sdk 2) download "java EE sdk" which is NOTHING except the glassfish4 folder 3) delete your current glassfish4.1 folder 4) paste the glassfish4 folder where that was 5) configure your IDE to use glassfish4.1 again
is that it? is javaEE literally glassfish?
fucks sake i was gonna go to the shop but after all this shit its 3am already
2nd question: i cant see any file upload/storage button on the Jeslastic cloud server. do i need to register with a regular web server instead or something? (ie not jeslastic)?? probably not but wheres the fucking file system
|
On April 19 2015 15:42 fancyClown wrote:Show nested quote +On April 19 2015 08:10 betaflame wrote: Hi guys, I have a good amount of experience with LAMP stack, php, mvc frameworks, jquery, javascript and such and I am looking into learning "MEAN" and I have a couple questions:
From my own research, there seems to be 2 main "frameworks" for MEAN but by itself, you could technically work with just mongodb, expressjs, angular and node on its own together. So is there any point in really going with those advertised "MEAN" stacks? Like what do they offer versus just using the 4 together by myself?
Also, coming from a LAMP background, I originally started with procedural php programming before learning about mvc frameworks and all that jazz that made my life easier, would you recommend diving straight into working with frameworks (express) or just work with just node and angular instead (without express)?
I don't see why you would learn MEAN if you are already versed in LAMP. You can use MongoDB also with LAMP, while with MEAN you cannot even switch database. The main draw to MEAN is the single language which shouldn't be a factor if you already know LAMP.
Well the purpose would be to learn angular for front end and also node backend for prospective jobs and also node would probably benefit some applications better than others in terms of speed and stuff. Express just happens to fall along with node and mongodb as a nosql db alternative which I agree isn't necessarily the big draw here (but again, nosql can be useful in some cases over mysql or other sql)
|
ok so far i spent 6 hours trying to host my web application to fix it i need to do "appcfg.py update --no_cookies MyProjectDirectory/" but i think the problem is i dont know how to find my project directory where the file is located. see stack overflowed thread
|
On April 20 2015 15:05 FFGenerations wrote:ok so far i spent 6 hours trying to host my web application to fix it i need to do "appcfg.py update --no_cookies MyProjectDirectory/" but i think the problem is i dont know how to find my project directory where the file is located. see stack overflowed thread
http://aws.amazon.com/ec2/
Free hosting of small servers, if you don't need a db that's > 5GB and very fast server this is the thing for you.
|
thanks its been 8 hours trying to just host it
right now i transferred my project to eclipse , fixed the stuff like having to manually add the correct jdk to properties because glassfish was greyed out with no error warning,
i have spent the last hour wondering why, when in eclipse, i try to run my JSP index file it gives a 404 and the console says
2015-04-20T10:06:23.011+0100|Severe: PWC6117: File "null" not found
in netbeans obviously it works fine
just before i gave up i thought to type in http://localhost:8080/animelist1/ into the browser and this worked.
why does it work in Netbeans as only http://localhost:8080/index.jsp
but in Eclipse as only http://localhost:8080/animelist1/ ?
|
Are the variables of a class in java public of private by default?
|
spastic attack i got it online i had to downgrape to jdk1.7 because google app engine doesnt support 1.8 some gnashing of teeth did occur not only when eclipse failed to load even after i restored its ini file (fixed by using the main exe instead of my desktop shortcut) but also after i suddenly failed to compile and was being told that my "nashorn" import no longer worked on this version (fixed by seeing it wasnt even used in my netbeans version so i removed it)
i cant fucking cope
that was 12 solid hours if not more just to deploy my app online
now i have to go fix the bits up , hope they just "work" (FAT FUCKING CHANCE), then make one more parse , then i think thats it
oh no its not actually working it just loaded the page
|
On April 20 2015 19:52 FFGenerations wrote: spastic attack i got it online i had to downgrape to jdk1.7 because google app engine doesnt support 1.8 some gnashing of teeth did occur not only when eclipse failed to load even after i restored its ini file (fixed by using the main exe instead of my desktop shortcut) but also after i suddenly failed to compile and was being told that my "nashorn" import no longer worked on this version (fixed by seeing it wasnt even used in my netbeans version so i removed it)
i cant fucking cope
that was 12 solid hours if not more just to deploy my app online
now i have to go fix the bits up , hope they just "work" (FAT FUCKING CHANCE), then make one more parse , then i think thats it
oh no its not actually working it just loaded the page
You can't just keep throwing shit at it and hoping that it will work. At some point you are going to have to stop and understand what you are doing.
To deploy a web application you need to create a war file. It's pretty much the same as a zip except that it does have a certain structure. You can go find the structure.
Maven is not magic. The reason you type package is because of the maven life cycle. You can look up the maven life cycle to try to understand what its doing. You run goals against maven, which is what package is.
Why did you switch from netbeans to eclipse. When you use netbeans to get going, especially the EE version, it has a lot of handy stuff for you as you have found out, like deploying your stuff to glassfish automatically. Unfortunately, as you have also found out, it hides a lot of stuff from you as well, like the fact that its starting a glassfish container and deploying your files.
Glassfish is not EE, EE is the set of specifications that make enterprise life easier, like servlet, jsp, jaxrs, jms, etc... Glassfish is just an EE container. Tomcat is not an EE container, it is a servlet container. You can run some of the things from java EE like jsp, and servlet, but it doesn't provide out of the box functionality like JaxRs support and JMS.
|
On April 20 2015 19:50 sabas123 wrote: Are the variables of a class in java public of private by default? Are you even allowed to not declare that?
|
On April 20 2015 19:50 sabas123 wrote: Are the variables of a class in java public of private by default? If it's anything like C++ or C# they're private until proven protected or public.
|
|
On a sidenote, FFG you could also look into turning your app into a .war file. Deploying to Tomcat is really easy then.
|
ive been deloying it either as a war (much earlier) or straight to google app engine , but functionality is broken in eclipse/jdk1.7 . i get
javax.naming.NameNotFoundException: Name [main.SearchServlet/annj] is not bound in this Context. Unable to find [main.SearchServlet].
and dont know how to fix it.
do i have to add context something to tomcat context.xml or server.xml?
i dont think i do coz im using the @ annotation to do that already like it works in netbeans
i have a feeling i have to re-specify my main/root/starting place tho for some reason, coz in eclipse it takes me to /animelist1 and plain http://localhost:8080/ doesnt work. i need to do http://localhost:8080/animelist1 or http://localhost:8080/animelist1/index.jsp
let me rephrase it. coz i think this might be the answer ...
In netbeans version i access the jsp by going to localhost:8080 or localhost:8080/index.jsp , whereas in eclipse version i need to go to localhost:8080/animelist1.index.jsp or localhost:8080/animelist1 . For eclipse, going to localhost:8080 404s . Why might this be?
adding <context root>/<context root> to the server.xml file moved the accessibility of the page up one level from http://localhost:8080/animelist1/index.jsp to http://localhost:8080/animelist1/ but this tells me there's something different i need to configure to get it starting at http://localhost:8080/ .... what could that be?
|
|
|
|
|