Traevel 216 Light Poster

If you look at the call()

else
    strassenMatrixMultiplication(A,B);
return C;

Nothing is being done with the result of strassenMatrixMultiplication(A,B).

All your P# = future#.get()'s are 0.

A few general remarks:

  • Variable names should be lower case in Java, uppercase implies Objects.
  • Always use { and } in if/else statements and loops to improve readability and avoiding mistakes, even if it's only one line.
  • When you have to declare 7 different P's you're probably hard coding too much (and should use collections), although in this particular case it might make it easier to follow. Keep it in mind though.
Traevel 216 Light Poster

I don't know why it does that. You can try checking the content of pathItems and see if it actually contains anything, but I don't know if you can do that from within the program you're writing the script in. I have no experience in writing scripts with Adobe.

Traevel 216 Light Poster

this.age = (this.age * increment) + this.age;

So if I am 40 and the increment is 5 I would be (40 * 5) + 40... talk about time flying. Why not just add increment to age?

Also, as a rule of convention: Person Kail = new Person the variable name Kail should be lowercase kail.

Traevel 216 Light Poster

What is the content of fillrmv[i] ? Maybe it doesn't have a property filled.

Is this scripting for Adobe Illustrator btw? Because I have no idea where you get things like app.activeDocument.pathItems from.

Traevel 216 Light Poster

Not a functional language, but Prolog is pretty cool.

hanoi(1,FROM,TO,_) :- write('disk from '),
                      write(FROM),
                      write(' to '),
                      write(TO),
                      nl.
hanoi(N,FROM,TO,X) :- N > 1,
                      NMIN1 is N - 1,
                      hanoi(NMIN1,FROM,X,TO),
                      hanoi(1,FROM,TO,_),
                      hanoi(NMIN1,X,TO,FROM).
hanoi(N) :- hanoi(N,a,c,b).

Would solve the tower of hanoi problem for any number of disks. You would run it with a command like:

hanoi(3,left,right,center). 

And it would print:

disk from left to right
disk from left to center
disk from right to center
disk from left to right
disk from center to left
disk from center to right
disk from left to right

true

Its true power however lies in generation. Like generating a sudoku (live example) in what's technically 3 lines.

rproffitt commented: Remember Borland and all the compilers they had? Prolog was one of them. +12
Traevel 216 Light Poster

Change var fillrmv = curDoc.pathItems[0]; to var fillrmv = curDoc.pathItems; because you want it to be all the items and not just the first one. And change for (i=0;i>fillrmv.length;i++) { to for (i=0;i<fillrmv.length;i++) { because you want it to run for all the items (< instead of >).

diafol commented: Patience +1 :) +15
Traevel 216 Light Poster

I don't think you need fillrmv at all. Unless you want to store the .length in there or something.

Traevel 216 Light Poster

Yes, but, from that page:

All it takes is the right configuration (to send mail using a local or a remote server)

So make sure that you include those configurations when you notify your tutor. Or it won't work on their machine.

You don't need PEAR (it only makes things easier and has more options) but you do need to specify an SMTP if you're running your page from localhost. If you're running it on an online host it will depend on their settings.

Traevel 216 Light Poster

Well even the official PHP mail page makes references to the PEAR package and encourages its use. Down in the comments there are some people who tinker with the php.ini and sendmail.ini to get it to use google smtp, but your tutor wouldn't have those either. If possible I would try to send him/her the entire package of your code, including any libraries.

Traevel 216 Light Poster

Correct me but isn't that what the code is doing ?

It's not.

if (app.activeDocument.pathItems[0].filled.length == true) {

This is saying, if the length of the "array" of the filled property (which might be an array according to JS, it doesn't know better) equals true, then execute the statement. If that length happens to be 1 (which it is because it's not an array and only has 1 element) the statement will be true because in JS 1 equals true. It basically becomes if (1 == true) {.

for (i=0;i>fillrmv;i++) {

This literally means: start with a variable i that equals 0. As long as i is larger than fillrmv (which is a boolean value mind you) then keep increasing i with 1.

var fillrmv = curDoc.pathItems[0].filled = false;

Here you are saying that fillrmv should be set to the value of curDoc.pathItems[0].filled which should be set to false;
So you are setting the first element's filled property in curDoc.pathItems to false. But fillrmv is also set to false.

I think the main issue here is that JavaScript is very "relaxed" when it comes to variables. In other languages you would get errors that help you out, but JS allows for a lot of weird things. You normally can't put a boolean in a for loop, comparing a number to a boolean usually results in a mismatch. However, JS just assigns a truth value to the number (using vague rules that are very difficult to …

Traevel 216 Light Poster

Are you sure you are allowed to send mail from your server? Localhost can't on its own and most hosts block it. Maybe look into using an smtp server with PHP to send mails, for instance, with your google account.

PS, to the mod that edited OP's snippet: feel free to censor my post as well.

Traevel 216 Light Poster

Not so much what you're doing wrong is explained in the videos but why it doesn't blow up when you do that. Because in most languages it will blow up and won't let you do that.

What I'm doing wrong

I think the start of your issue is this bit:

var fillrmv = curDoc.pathItems[0].filled = false;

It's pretty much always a bad idea to assign variables this way. In JavaScript it's sort of ok, because here there are no references, but in a lot of languages this would mean that fillrmv is a reference to filled which is set to false. If you then changed filled to true you'd expect fillrmv to stay false (and in JavaScript it does) but it would actually refer to filled and be true.

and set each object in the array to false

In order to do that you'd set fillrmv to the length of the pathItems array. Then inside your for loop you would say something like:

curDoc.pathItems[i].filled = false;

You can retrieve the length of an array by calling the length property. For instance:

var arr = ['one', 'two', 'three'];
for (var i = 0; i < arr.length; i++) {
    arr[i] = 'changed_'+i;
}

Edit: Keeping my answer slightly on the vague side because it looks a bit like homework, if it's not let us know.

Traevel 216 Light Poster

if (app.activeDocument.pathItems[0].filled = true) {

A single = is used to assign a value, a double == or triple === is used to check a value. So basically in this statement you are assigning true to filled instead of checking whether filled is true.

Also, in your for loop for (i=0;i>fillrmv;i++) { you are saying to continue as long as i is larger than fillrmv, but in var fillrmv = curDoc.pathItems[0].filled = false; you're assigning a boolean value to fillrmv. This is where "silly" JavaScript kicks in. Under water it's assigning truth values to things. If you ask JavaScript "is 1 larger than false" it will say "yep". If you ask it "is 1 smaller than false" it will say "nope". (because '0' is 'falsy' and '1' is 'truthy' and true is "larger than" false)

For a good laugh I recommend this (slightly dated) video about some funny quirks JavaScript has.

For an explanation on why JavaScript is so quirky I strongly suggest this video.

One of the things it explains is why, in JavaScript, this:

function() {

}

...is the only correct way and this:

function()
{

}

is a wrong way.

And many more things that are just a little different in JavaScript.

Traevel 216 Light Poster

I don't any edit button on the post?

If you could edit it would still be a risk. Google will have indexed the page by now so people can still view the cached versions. If it's a database that's runned by the university maybe contact someone from tech support and see if they can change the password for you.

Traevel 216 Light Poster

You can't send e-mail from localhost without an smtp server running and a lot of (free) hosts have it disabled by default. The free ones usually require a tiny payment to enable email as a way to discourage spammers.

Also, change your mariadb user name and password because you seem to have posted them:

$username = "s100042374";
$pass = "081292";
Traevel 216 Light Poster

Tesseract 3.0+ should have Arabic support. It's in C but there are wrappers for other languages, including two for .NET.

If that proves too hard there is also a JavaScript port of Tesseract that supports Arabic. You'll need node.js though.

rproffitt commented: Was thinking Tessaract but didn't check language support. Bad me. Have used. Can be fun (as in image processing required.) +0
Traevel 216 Light Poster

Same for Android

But since it's a paid service, perhaps drop a message in their support box as well? They should be willing to help their customers I'd reckon.

rproffitt commented: IOW, get your money's worth. +12
Traevel 216 Light Poster

I followed your suggestion and tried to send just the xml (without envelop). Bad luck.

No no, my point was that you might be signing the envelope and only verifying the body, or signing the envelope which later gets expanded and then trying to verify it.

I can't reproduce your code myself (mostly because I haven't downloaded Rider yet) but these are the things I would try:

  • Remove one of the signedXml.ComputeSignature(); (the first one if you worry about the ds addition).
  • Remove the part you added with the X509Certificate2 to see if it works without.
  • Revert the code back to the original tutorial to see if that one works for you (i.e. without the ds addition, without the certificate). Perhaps check in a new project, copy the tutorial and if that works slowly start adding your changes until it breaks.
  • Remove the signing completely and ensure you can actually send the xml across normally.

Other things that might be happening:

  • a newline \n or \r\n is/are being added to the xml along the way (thus failing the signature)
  • whitespaces might be added along the way
  • the character encoding of the xml has changed along the way
Traevel 216 Light Poster

You are computing signedXml.ComputeSignature(); on line 26 and on line 30. Is that intentional?

I take it you mean these tutorials on verifying and signing. I only see it being used once there.

From the documentation:

The ComputeSignature method creates an XML digital signature and constructs many of the XML elements needed. You must set the data to be signed and the SigningKey property before calling this method.

So doing it twice might mess things up.

Disclaimer: I'm not an expert in C#

Edit: I just found your StackOverflow question and there I see you mention SoapUI. A "common" issue in Java with signed xml not verifying is that you sign the entire SOAP envelope instead of just the body. But I can't tell if that's what you're trying to do here.

Traevel 216 Light Poster

It does but not while typing or while in preview. Maybe I'm remembering it wrong and it never did that. I liked to select the language myself though. Unless I'm remembering that wrong as well. I also remember using LaTeX here but now I'm not sure about that either. Yet this is pretty much the only Q&A style website I've ever spent real time on.

human(dani).
human(traevel).
mortal(X) :- human(X).

Will it highlight? *drumroll*

Traevel 216 Light Poster

I mean that it's pointless typing in code longer than a few lines. There's a code block but that's it. No highlighting anymore, not even in preview. You can't select the language yourself anymore. It's really easy to overlap code boxes, or introduce line breaks in the code that you don't want. Getting the indentation right is also harder to do.

It has improved for normal conversations, but not for code in my opinion.

Traevel 216 Light Poster

That happens a lot when you give them cookies right before bed time. It's something to do with the sugar, rookie parent mistake.

Also check for running processes that cause nightmares, preventing a good night's sleep. You can check by running powercfg -requests from an admin command prompt.

Traevel 216 Light Poster

This

$stmt->bind_param('ssssss', strval($title), strval($vacancy), strval($keywords), strval($location), strval($industry), strval($area));
$stmt = $conn->prepare("INSERT INTO 'job_detail' ('job_title', 'vacancies', 'keywords', 'location', 'industry_type', 'functional_area') values('$title','$vacancy','$keywords','$location','$industry','$area')");

Needs to be

$stmt = $conn->prepare("INSERT INTO 'job_detail' ('job_title', 'vacancies', 'keywords', 'location', 'industry_type', 'functional_area') values(?,?,?,?,?,?)");
$stmt->bind_param('ssssss', strval($title), strval($vacancy), strval($keywords), strval($location), strval($industry), strval($area));

Also, you should be getting a general PHP error because in if($conn->query($sqli) == true) you're sending an object that doesn't exist anymore: $sqli;

Did you add a line like display_errors = on to your php.ini? Otherwise you won't see errors of any kind.

Traevel 216 Light Poster

Now you went back a step again, directly inserting the $_POST variables into the query. Replace the variables in the query with ? and bind them like:

$stmt->bind_param('ssssss', strval($title), strval($vacancy), strval($keywords), strval($location), strval($industry), strval($area));

Is it still not working without giving you errors?

Traevel 216 Light Poster

Is it supposed to be a feature that you can use the editor to edit multiple lines at the same time?

By doing a ctrl-click you can get new cursor instances. Useful for code, but the editor isn't very code friendly anymore so I'm not sure if it's at all needed.

Traevel 216 Light Poster

In your insert statement I'm seeing indutry_type, which I think should be industry_type and Functional_Area which should probably be functional_area.

It's even better if instead of mysqli_real_escape_string you used prepared statements.

Like:

// prepare the query statement
$stmt = $conn->prepare("INSERT INTO 'job_detail' ('job_title', 'vacancies', 'keywords', 'location', 'industry_type', 'functional_area') values(?, ?, ?, ?, ?, ?)");

// 6 string params, so 6 times 's' and 'strval'
$stmt->bind_param('ssssss', strval($title), strval($vacancy), strval($keywords), strval($location), strval($industry), strval($area));

// execute the query statement
$stmt->execute();

// close statement
$stmt->close();
Traevel 216 Light Poster

You're inserting user input directly into the database. In other words, any user who uses that form can do whatever they want inside your database. You should use mysqli or PDO instead of mysql.

You're also inserting into the jobposting table, but selecting from the job_detail table. Also, we can't see what's in include ("../connection.php");. But because it's using the unsafe mysql there's no real point in fixing this issue until you've switched to either mysqli or PDO. A lot of people here will help you with that if you run into problems converting to one of the two safer methods.

Traevel 216 Light Poster

We commit to fairly repayment the money, in case of any awkwardness with assignment papers or you're not satisfied with our revision policies. Our professionals put all efforts to make your assignments purely plagiarism free and meet with all your universities requierments.

I know my English isn't the best around, but this is hilarious LOL

Traevel 216 Light Poster

Then Doubleclick was acquired by Google. Suddenly I needed a Google account to log into Doubleclick.

Because Google (Dazah) was bigger and better known than Doubleclick (DaniWeb). I had never heard of Doubleclick until you mentioned it just now.

For you it happened that way, but for me the reverse is true. I wouldn't mind going to Doubleclick now because I have a Google account anyway.

DaniWeb is part of the Dazah network of communities: Sign in with Dazah to access DaniWeb

I like that addition as well. After all, I'm not signing up for Dazah but for DaniWeb with Dazah.

Traevel 216 Light Poster

I think if I wanted to sign up for DaniWeb any sort of redirect would put me off. I've been thinking about it and it seems to me it's about where you enter the network. Were I to enter through Dazah, because it's a network of communities for me to chose from, I would sign up. Were I to enter on DaniWeb, or one of the other communities a redirect to Dazah would confuse me.

Compare it to google. There used to be gmail. You signed up because you wanted free e-mail with large storage. Then along came other services, for instance google+. When I made my gmail account, I didn't want google+. Yet I had one, because it was all the same account. Fine by me, I never use it. Now that there are so many services on offer it's shifted from "gmail" account to "google" account. It's however very clear that gmail belongs to google. Dazah and DaniWeb? Not so much. And the Dazah name carries no weight yet, so if anything it's going to be a barrier, not an advantage.

The difference I guess is this: started with gmail, then created google+, then said "hey, you know that gmail account you have? you can use it to log in to google+".

So a better way, in my opinion, would be to promote the other communities on eachothers sites and tell users they can use the same account for all. Until then, I wouldn't mention …

Traevel 216 Light Poster

If using js you may hit CORS problems with accessing external files.

You're right. I didn't check if it was his own xml file he wanted read.

Traevel 216 Light Poster

though you might want to open up a new question if you hit any issues

Did you hit any issues with the libraries then? If so you might want to mention them.

Traevel 216 Light Poster

Do you mean Java or JavaScript? Both is yes by the way.

I'm guessing you mean JavaScript, have a look at the jQuery library and specifically its XML functions. It also supports Ajax calls to get to that text file, though you might want to open up a new question if you hit any issues so that knowledgeable people can help you deal with them. They might not always find it if it's not tagged with JavaScript.

It's easier to get a PHP host than a Java host, but you could have a look at OpenShift. Last time I read they offered a small free option, but I'm not sure if they still do that.

In Java you would basically load the XML into an object. A Vogella tutorial is usually a good place to start when learning the basics.

Traevel 216 Light Poster

First of all, @jeffersonalomia, you probably don't want to use Neo4J. I still strongly suggest trying out Dazah.

@Dani,

I already mentioned the facebook bit to you so I won't repeat that, however regarding Neo4J there is something I'd like to add.

not ideal for scaling realtime applications such as chat

It's highly scalable for real time applications. Walmart uses it for real time product recommendations, as does Adidas. Global 500 uses it for real time routing, as does Ebay.

Recently this stackoverflow user posted his conclusion after a speed comparison between MySQL and Neo4J. The final verdict: given 100K nodes / 10M relations, a recursive query going down 4 levels of relationship took 40s in Neo4J and 24s in MySQL. Sounds like a solid experiment, and if you look around the Neo4J Google Group you'll discover it was actually written as part of a master thesis and that it wasn't quite the result he was expecting.

Luckily for his hypothesis, a good reply came in shortly after. With some query optimization and the use of Roaring bitmaps the Neo4J performance had slightly improved: 2.7s, one laptop, one thread.

Twice as slow became ten times faster.

This doesn't mean Neo4J is automatically suited for a chatting application. It does however handle graph data better than a relational DBMS, after all that's what it's designed for. To put it in perspective, MySQL predates Neo4J only by a decade.

Long story …

Traevel 216 Light Poster

How do facebook, twitter, and other social media app store the data of the user's chat history or chat log?

You don't want to know (nor is it all public, billions of dollars rely on that technology), you can't replicate that. Facebook, for instance, uses a customized combination of HBase, Hadoop and Zookeeper. They are far too large to be considered an example.

I see you tagged this thread with mysql which might be an option, but also consider NoSQL. HBase is a column based storage, so is Cassandra. If you want to store user-relations, or other types of relations (for instance user X liked post Y, user X added user Y as a friend) you can use a graph based database like Neo4J.

As it so happens, you could also integrate with the Dazah network (the network you signed up with for DaniWeb). It powers DaniWeb as well, and was also made by Dani. She will no doubt help you out with that if you have any questions on how to get that set up.

Traevel 216 Light Poster

I don't think $rowucfirst is a function, and if it were it shouldn't start with a $. Were you trying to just do echo "<tr><td>".ucfirst($fetch_user['user_name']) perhaps?

Traevel 216 Light Poster

If you remove the; in $rowucfirst($fetch_user['user_name']);."</td><td>" it should go away.

Traevel 216 Light Poster

You can edit within the hour, after that it's locked.

The only other guess I had was that the splitting had gone wrong, but since you've printed those variables that's probably not it. If you change columns = line.split() (which splits on space) to columns = line.split('|') you would have all the columns in the proper place, but you've already worked that bit out by adjusting and recombining the columns.

Traevel 216 Light Poster

I don't know if I can answer, but it would help others as well if you could post an example of a line that you're trying to parse.

In the documentation page regarding strptime it states that %p is locale dependent.

Locale’s equivalent of either AM or PM.
AM, PM (en_US);
am, pm (de_DE)

Other than that I have no new ideas, sorry.

Traevel 216 Light Poster

Hi,

Until someone who knows Python gets here...

ValueError: time data '01:11 PM' does not match format '%I:%M%p'

Perhaps it's because 01:11 PM has a space and %I:%M%p doesn't. Maybe try %I:%M %p?

Because from the official page:

dt.strftime("%A, %d. %B %Y %I:%M%p")
'Tuesday, 21. November 2006 04:30PM'

Traevel 216 Light Poster

but before you RAGE!!!!!

Why would I rage?

its still letting dups through

It will always happen until you address that issue in the database itself.

I'm not a MySQL expert, but in the reference manual I found this bit:

The default behavior for UNION is that duplicate rows are removed from the result.

Since you only select the sec_id I'm guessing there would never be more than one result, unless you use UNION ALL.

This query building is hiding the problem that you are having. You didn't post the actual INSERT statements, so it could also be going wrong there. This code will/can create thousands and because of the nested structure even millions of calls to your database as time goes on for every "unique" id it needs to generate (again, with multiple GUI's you will still get duplicates no matter what you do in the PHP code).

I would create a view of all the separate tables so that you have everything in a single view. Then ensure there are no duplicates there. At least then you can run a select query on that single view instead of all these unions, and maybe pinpoint the problem.

because my "so called" boss

Be aware that this is a public forum and even though your username might be untraceable, the code you posted is fairly specific and will lead back to here, and thus you. For instance, a …

Traevel 216 Light Poster

I much prefer being in a situation where I can just send it back to the vendor when anything doesn't work.

Hear, hear. Whenever I tell someone I don't want to build my own, they always reply: "but it's not hard to do".

Depending on the type of games, an SSD can make a lot of difference though. You can go for a smaller SSD and a large HDD. The OS will probably be pre-installed on the SSD, but there should be room left for games (there might be a couple of games that go up to 50GB-100GB, but not a lot of them). Steam doesn't make it easy, but you could move around the game files back and forth from the HDD to the SSD, and keep the SSD smaller that way and save the rest of the budget for the other things. It does mean that your son would have to move stuff around when he wants to switch some of the games (and depending on where he lets Steam install, whenever a new game needs downloading).

Oh, before you go overboard on memory, there are a lot of games that won't even make use of 64-bit, so they're stuck on 4GB memory anyway. But that would really depend on the game, might be worth checking though.

Traevel 216 Light Poster

Using my magical powers I've tried to telepathically deduce the error message you forgot to post and I think if you remove the ' around '".$_SESSION['last_id']."' it might solve your issue. Since your user_id column is defined as integer and those single quotes make it a string.

Also, although I think we've had that discussion before, I'd pray that Bobby Tables never signs up. You really shouldn't put $_POST variables directly into the query, but if you're set on using mysqli at least use prepared statements.

Edit: also do what cereal is saying.

Edit2: I should also learn to read titles, because you did post the error, sorry.

cereal commented: hip hip for bobby tables! ;D +14
diafol commented: I mentioned ps to her many many times - never listens - heh heh - she's working on swingers' site - you'd think she'd take member security seriously. +15
Traevel 216 Light Poster

2017-02-24--1487972728_872x593_scrot.png

This post has no text-based content.
Traevel 216 Light Poster

Well, where it says lines[1] you put in lines[0], replace lines[2] with lines[1] and so on.

Change the check for >5 to ==5.

And finally, don't split on : on the first line or it will throw an error. I don't think you meant to split that line anyway.

Traevel 216 Light Poster

Arrays in C# have a zero-based index. That means lines[0] will get you the first line, lines[1] the second, and so on.

30 General Conference of Arab Pharmaceutical Unions
UserName : khalid ramzy
Country : Saudia
Membership : part
Serial : 1014

You posted 5 lines in your output example, but in your check if (lines.Length > 5) you won't start splitting until there are more than 5 lines. Note that label2.Text = lines[5].Substring(lines[5].IndexOf(":") + 1); will try to perform operations on a 6th line, which according to the example doesn't exist.

However, if you only changed those lines to go from 0-4 instead of 1-5 you would run into another problem:

There is no : in the first line, so when you want a substring to start on the index position of a : it won't be able to find that. Note that in the documentation for IndexOf it specifies

from the start of the current instance if that string is found, or -1 if it is not.

And that Substring will throw an exception if it gets passed -1:

ArgumentOutOfRangeException - startIndex is less than zero or greater than the length of this instance.

Traevel 216 Light Poster

Hip hip!

Traevel 216 Light Poster

Can you give an example of what the list looks like? (using fake names and such, but the general structure or format)

The reason I ask is because you probably won't have to buy any software to sort it for you. If you want to keep track of payments you could for instance use the free LibreOffice or OpenOffice office suites. Both have a spreadsheet tool similar to Excel. If you were to keep payments in a spreadsheet, not only would you be able to sort and filter them, but you could also perform calculations or create overviews.

Traevel 216 Light Poster

I managed to find the github page, but that's about it. All the links you posted are not pointing anywhere. Secondly, I don't think that is a free e-book. It's being sold actively.

From what I read on that github page angular-seed is a backbone project to get your own project started on. The reason I'm phrasing it that way is because there are scaffolding tools, like Yeoman that will set up a project for you. It's as easy as running yo angular MyProjectName. The major difference being that it doesn't become useless after that. For instance, do you want to add a new directive: simply run yo angular:directive myDirective, and it will create one in your existing project. I don't know which IDE you're using, but I know that Webstorm/PhpStorm/IntelliJ has a yeoman plugin that you can run straight from the embedded console.

Disclaimer: I'm not an expert on AngularJS, I merely dabble... when forced... at gunpoint.

Traevel 216 Light Poster

I'll give an example of why I think there should be a possibility of locking threads, and then I'll promise to shut up about it.

Someone replied to this post, saying he had the same problem. The post was obviously never seriously replied to in the first place. I think that makes people think no one knows the answer. I think that is why he replied, stating he still has that same problem. The framework used in the question was abandoned in 2006. Which should have been the answer to the original poster 5 years ago. So I think, that not only is it implying DaniWeb does not have knowledge on that topic, but also that it is encouraging the usage of outdated code.

I agree with you that there are posts that could have a rebirth. Topics that were once relevant can, for whatever reason, become relevant again. But I also think there are some posts worthy of a time constraint.