« first day (1012 days earlier)      last day (4162 days later) » 

13:06
hi
i have a doubt
can ayone help?
@Manoj Yes!
i get a output like the one stated below
Amazon_Marketplace_Reports_ListInventoryReport_Results Object
(
[outputArray:protected] => Array
(
[ReportRequestId] => 7602145812
[GeneratedReportId] => 11788887823
[Report] => sku asin price quantity
0010900 B005KDEHB0 5.99 33
0011023 B002C0ANW6 47.33 60
0033720 B003BHWVOM 81.70 3
0042119 B000IJSSKC 79.27 18
0057307 B001ET6WFI 2000.00 289
wrehouseKZ519 B000BC2GGS 60.00 0

[ReportProcessingStatus] => _DONE_
)

[lowercaseKeyMap:protected] => Array
(
[reportrequestid] => ReportRequestId
user895378
@igorw hmm ... interesting. I've never considered stream wrappers for that purpose.
@salathe
13:12
> This is a comparison of mail servers: mail transfer agents, mail delivery agents, and other computer software which provide e-mail services.
@PeeHaa >.<
They call everything that handles sending of mail a mail server
@Manoj I recommend you to go learn the basics.
;-)
@PeeHaa ok so if I want to send mail what would you recommend?
13:13
i tried using preg_split but no hope.... @salathe
i know the basics
@Manoj whoa, crazy sense of déjà vu
@tereško is it that hard to setup? O_0
@salathe i used this
$lines = preg_split('#[\r\n]+#', $string);
$headers = explode(' ', $lines[0]);
for($i=1;$i<count($lines);$i++){
$results[] = array_combine($headers, explode(' ', $lines[$i]));

}
but no hope
@Manoj that explodes on spaces, you need to split on the tab character
@crypticツ At home I am using zimbra (which is a full package). Includes everything you need, but is very very resource hungry
Otherwise I would use exim
13:15
@Manoj P.S. Yesterday I pasted some code showing a better approach than preg_split/explode.
can u show me that please @salathe
@Manoj You can find it for yourself, the entire history of this room is available
Hi guys. Can anybody help me to solve his problem? stackoverflow.com/questions/17823531/…
@PeeHaa kk, I'll do a comparison between sendmail what @tereško suggested and exim and see which would be easier to setup and be less resource hungry. thanks
user895378
@Baba FYI I pushed some changes to the websocket endpoint interface so that it now uses a similar structure to ModProtocol. You now get a $socketId reference instead of a Client instance. All the websocket example code (including the ModProtocol demo) has been updated to reflect the changes.
13:17
22 hours ago, by salathe
@HamZa https://eval.in/private/402319d962f61b
@rdlowrey Good Morning ..... Let me get to work then ...
@salathe thank you very much
@rdlowrey I asked a question before .... why does it take so long as much as 200 sec to run this simple code :
$max = 1000000000 ;
$total = 0 ;

$start = microtime(true);

for($i = 0; $i < $max; $i++)
{
	$total += $i ;
}

printf("%s\n",number_format($max));
printf("%s\n",number_format($total));
printf("%s\n",microtime(true) - $start);
user895378
@Baba Because PHP is slow? :)
13:21
@rdlowrey lol ...
user895378
Although when I just ran it it executed in ~45 seconds
@rdlowrey maybe i forgot to disable xdebug .. one moment
user895378
xdebug would probably slow it down, though there are no function calls so I'm not sure.
@rdlowrey running .. one moment
@Baba I wonder if a good C compiler will optimize the code away to $total = $max * ($max + 1) / 2 ^^
13:25
@NikiC I would give it a try
@rdlowrey 70sec
user895378
@Baba Returning briefly to the websocket changes ... The new interface is simpler, faster, eliminates some unnecessary classes and allows you to send the same data to many ws clients at once more easily from inside your Endpoint class:
user895378
$this->websocket->sendText($arrayOfSocketIds, $anyStringOrStreamResource);
@rdlowrey you could also try with opcache and enable_cli. The optimizations might actually make a difference in this case ^^
user895378
@NikiC Is opcache not enabled for CLI by default? I didn't know this.
@rdlowrey no
user895378
13:26
I guess that makes sense.
@salathe the code u showed me returns array()
or at least, I don't think so ^^
its null
@rdlowrey Trying to pull it at the moment .... how to you overwrite local version with git ?
@rdlowrey I get :
user895378
@Baba it'll do it automatically unless there are merge conflicts.
13:29
Updating 2fd1037..f47858d
error: Your local changes to the following files would be overwritten by merge:
        src/Aerys/Mods/Protocol/ModProtocol.php
Please, commit your changes or stash them before you can merge.
Aborting
user895378
@Baba Then do:
@rdlowrey Yeap .... i modified some files ..
user895378
$ git checkout -- src/Aerys/Mods/Protocol/ModProtocol.php
$ git pull
user895378
Unless you want to keep your changes to ModProtocol (unlikely)
@rdlowrey nope
@rdlowrey Thanks .... done
13:34
@rdlowrey I'm more a fan of git reset --hard - has a higher chance of loosing code you still needed :P
@rdlowrey Nice ... can we also make the config uniform
user895378
@NikiC hehe
@NikiC I seem to remember a discussion on internals about having the option to enable it, but disabled by default.
 '/echo' => [
            'endpoint' => 'WebsocketEndpoint' // <-- class implementing Aerys\Handlers\Websocket\Endpoint
        ]
@rdlowrey ^^^
@rdlowrey why the name /echo
@Manoj No it doesn't. The code you took and tried to use returns array().
13:35
@NikiC lol
@rdlowrey Why not just handlers .. just like protocol
user895378
@Baba Unfortunately, no -- and there's a very good reason for this.
user895378
@Baba Websockets ride on top of HTTP. You actually have to make an HTTP request to an actual HTTP URI to upgrade to a websocket connection.
@salathe this is how i use
$tsv = $string;

$lines = explode("\n", $tsv);

$headers = str_getcsv(array_shift($lines), "\t");

$rows = array();
foreach ($lines as $line) {
$rows[] = array_combine($headers, str_getcsv($line, "\t"));
}

var_export($rows);

but returns array()
$string contains the result
user895378
@Baba Websockets aren't like a custom protocol that's not tied to a URI and doesn't have to follow HTTP.
13:37
@rdlowrey Ok .. why /echo ?? Can i have /print and /dance ??
@Manoj please use something like eval.in to show us running examples... I'm going to guess that $string doesn't contain what you/I think it contains.
user895378
@Baba Yeah, I just called it "/echo" because the demo script "echoed" back everything you sent to it. You can name the actual URI whatever you want. Just remember to update any javascript files that connect to the websocket endpoint with the new URI :)
@rdlowrey Oh i see what you mean uriScheme + '://' + window.location.host + '/echo';
user895378
@Baba exactly.
@salathe i used print_r() to check the $string... it contains the result.... but after i execute the code u showed me .. it displays array()..
13:39
@rdlowrey wow .. Just realized it can power more than 1 websocket at the same time
@rdlowrey +100
@Manoj Great, now show me an example where it doesn't work.
user895378
@Baba Yep, that's why it's an array. You can setup a whole network of endpoints for specific individual purposes on the same host.
@rdlowrey Multiple endpoints multiple options ws or wss ... Nice nice .. add it to documentation and examples please .... Good selling point
in general, when is it right to use namespace?
user895378
@Baba Yeah I will ... I'm getting very close to "feature freeze." With the latest websocket endpoint interface changes the API should be finished changing. It's time to focus on getting more test coverage and writing the tons of documentation it'll take to cover the huge scope of the project.
13:43
@salathae

kitchenhomegoods.com/amazonmws/amazondatasync.php
@rdlowrey I think you should make it public first .... get other constructive criticism and contribution before you make that freeze
@Manoj So $string prints nothing...
it prints the result
@salathe wait a sec i ll show you
user895378
@Baba I don't. I need to get to v0.1.0 first. Then changes can be incremental and atomic as opposed to the massive rewrites that happen now. There are some things that just aren't up for debate (like protocol implementations). RFC 2616 and 6455 aren't changing for example. I need a baseline to start from before making things public.
gist: 6070718, 2013-07-24 13:45:37Z
$string prints this::::: 

Salathes code result:::array (
)
Anonymous
13:46
why do protected properties during inheritance throw of an error, when referenced from an object context
@rdlowrey i see your point ... any hope we would get the fast cgi mod before you lunch
user895378
@Baba Why would you need that when you can reverse proxy to a server using fast CGI?
user895378
For example ...
@rdlowrey I mean reverse proxy .php extension to fast-cgi , .go . pl etc
user895378
@Baba I gave this some thought -- I don't know that it actually makes sense to do that. Why not use the reverse proxy as the primary application handler for the host and then just register mods to intercept the specific traffic you want on top of it? What's your reason for not doing that?
13:49
hi everyone
i am using a tiny editor
I just bought this gfx card :D
user895378
@Baba Also, what do you want to layer on top of the regular fast-cgi application other than websockets and protocol implementations?
hi jimbo
Hey is it okay to ask basic questions here?
@Shawn yes
13:50
i am using tiny editor the code is as follows but my tinyeditor is not posted
0
Q: echo-ing tiny editor contents sent to the database using php

BobigalAm in need of help, please i need some help. I tried using the tinyeditor jquery in my webpage, the contents of the editor submits to the database successfully but with the html markups. Now when i tried to retrieve the data from the database and display it on another page, it brings the content ...

@rdlowrey Good Point .....
user895378
@Baba I guess what I'm saying is that whatever functionality you're looking for is likely already supported but you just don't realize it. If you'll tell me exactly what you're trying to do I can probably put together an example to show you how to do it now :)
pls help me @jimbo
@Baba Does php -r 'class Stack extends Stackable { public function run() {} } $s = new Stack; $s[] = [1]; var_dump($s->chunk(1));' segfault for you too?
@jimbo if i remove id="tinyeditor" in the textarea it is posted
13:52
@bwoebi I was thinking of still using aerys to serve static files while other php app runs directly on fast cgi ... but i get what you mean
@bwoebi one moment let me give it a try
@Baba wrong ping?
ok, so I know people have asked this before I just can't find an answer that I can understand. I have a string of html that contains images that I would like to extract the url of and store in an array. (using php) I only have a basic understanding of php though
@bwoebi ok
urls plural I mean
@Baba what ok????
user895378
13:53
@bwoebi lol yeah I think he meant to ping me with that :)
yeah.
@bwoebi you just said wrong ping is that message for someone else
@jimbo here is my post values Array ( [template_message] => [templatename] => aaaa [tinyeditor] => [Submit_x] => 48 [Submit_y] => 22 ) Array ( [template_message] => [templatename] => aaaa [tinyeditor] => [Submit_x] => 48 [Submit_y] => 22 )
tiny editor is empty
@Baba no. I mean this message: chat.stackoverflow.com/transcript/message/10813113#10813113 (I asked you if you pinged the wrong)
boring day... YaWn
13:54
@bwoebi lol .. my head is messed up now ... lol
@Baba I had pinged the right: you ;-P
@Baba lol... tym for a beer
@Mr.Alien exactly what i need
@Baba does it now segfault for you too? or not?
@Baba ya so go, get some ;)
13:56
@MR.Alien pls help the above which i posted
@SivaShanker Ya so how you are creating that array?
@bwoebi Am not using the updated version .... getting PHP Fatal error: Call to undefined method Stack::chunk()
@DaveRandom If possible could you send me something to read about the better JS class pattern, so that I can understand it?
@rdlowrey quick question
user895378
@Baba sure
13:58
@Danack After I looked at your codez it'll be a pretty big job to implement it. But I'll do you and example now, one sec.
wb
@rdlowrey 500MB with 1 Billion Phone records , PHP , GO , Aerys How would you structure it
with namespaces, is the idea to use separate files for each class but just add the top clarify the namespace? Or add all the classes in the same file under the same namespace?
@Baba oh. okay.
@bwoebi need to update
@bwoebi buzz you as soon as i do that
13:59
@DaveRandom Yeah - I at least partly went with the current class pattern as it was the least work, which is one of my favourite things.
user895378
@Baba 500MB of what exactly?
guys pls help me i still can not solve this problem :(
@rdlowrey CSV .. call logs
@MR.Allien like this $poem=$_POST['tinyeditor'];
print_r($_POST);
or maybe this is more clear I made a fiddle and my question is commented in it phpfiddle.org/main/code/6u4-7fb I think its something simple I just don't usually work in php
user895378
14:01
@Baba How is your application using the data? Are you searching it? Acting as a data clearing house to send/receive the messages and store them in realtime?
if anyone can help me Id appreciate it
@rdlowrey I need to parse file and do some analysis before going to database .... Note that i can not trust input from the files so i can not import directly ...
@rdlowrey the data originated from a telecom company as a CSV file
@baba pls help me
@SivaShanker help you with what
@baba with the above post
14:03
@SivaShanker what above post
Q: echo-ing tiny editor contents sent to the database using php
@salathae

kitchenhomegoods.com/amazonmws/amazonaction.php
@baba here is the post echo-ing tiny editor contents sent to the database using php
I've ignored my first ever user, yay!
14:04
Congratulations!!
@SivaShanker ok .. am working on Aerys at the moment .. would look at it when am done
idk why anyone helps that guy but that must be the reason he keeps coming back
@Jimbo lol
get the garlic necklaces out!
Started using vim lately, and one irritating problem has appeared - sometimes git diff shows incremented tabulation, desite when I observe file in vim - everything's ok. My vimrc is here Any ideas?
14:11
# WTF?!?!!?

root# php -r 'class Stack extends Stackable { public function run() {} } $s = new Stack; $s->merge(array_fill(0, 1, true)); var_dump($s->chunk(1));'
array(1) {
  [0]=>
  bool(true)
}
root# php -r 'class Stack extends Stackable { public function run() {} } $s = new Stack; $s->merge([true]); var_dump($s->chunk(1));'
Segmentation fault: 11 (core dumped)
what type of weird behaviour is THIS?!
no idea
@ircmaxell you don't maintain pthreads, you're excused :-P
still
and why as root?
user895378
@bwoebi I still have some scripts that create pthreads segfaults on every execution. I just haven't had time to simplify them into reproducible scripts to make debugging the pthreads problem easier.
user895378
14:18
Also, I've asked this question before but didn't receive an answer that I found satisfactory ...
user895378
Q: Is it possible for a worker thread to notify the main thread after it completes some task?
@rdlowrey what I do is just writing to some stackable and loop in the main thread (every ms for example) and check if there's something new. but there's no notify() possibility
no possibility?
use a socket pair
@ircmaxell I meant no notify in pthreads
sockets are always possible
or have a locking mediator which handles it (so notification would issue a global lock, but only for the queing of the notification)
user895378
14:24
@ircmaxell I've used socket pairs to this point, but I was wondering if there were some facility in the threading implementation.
It's still ugly as sin but the code you produce is more efficient and you can reproduce more features
goes to get another coffee first
The only thing you can't do is private/protected properties. But you need to assign any initial array properties in the constructor
It would require a lot more analysis of the input code than you are doing though
and the .call() private/protected method pattern can get a bit mind melting and unreadable
user895378
I haven't tried it yet, but it would be really nice if the php -> js conversion would give you exceptions if you try to convert things that aren't possible (like non-public accessibility on class properties or references). Because otherwise morons like me will just be like, "WTF this thing doesn't work."
Another thing you might consider doing is looking at the TypeScript "compiler", since it provides classes which are in many ways similar to PHP
@rdlowrey tbh I'm not a fan of the whole idea (not as-implemented, anyway, and probably not in general).
If you need to convert your code from one language to another, learn both languages and rewrite it.
2
14:29
quick question, because I'm being lazy - if a trigger on a mysql table performs an action that the user doesn't have GRANTed, does the trigger fail?
user895378
@DaveRandom probably smart :)
@Leigh If the answer isn't "yes" I'm not impressed.
@DaveRandom "The only thing you can't do is private/protected properties" that would be a little bit annoying. @rdlowrey The access rules are currently the same as PHP with some small exceptions (e.g. static class variables get promoted to public).
@DaveRandom :/ I want to give a user SELECT, INSERT, UPDATE, DELETE on all tables except history/archive tables, which they only have SELECT on. And I want INSERT UPDATE, DELETE to trigger updates on those history/archive tables. Obviously the trigger needs INSERT on the table, but the user wont have it
@DaveRandom And yes, the whole idea is possibly a bad one - though it fun.
14:32
@Danack See the only difference there is you promote static vars, I promote instance vars. But the pattern I outlined gives you much more flexibility in terms of protected members.
Well I'll have a look at it.
> A column named with OLD is read only. You can refer to it (if you have the SELECT privilege), but not modify it. You can refer to a column named with NEW if you have the SELECT privilege for it. In a BEFORE trigger, you can also change its value with SET NEW.col_name = value if you have the UPDATE privilege for it.
I know that's refering to the rows being affected by the op that caused the trigger and not an arbitrary write op, but to me that suggests that it won't work
(gdb) bt
#0  zend_hash_del_key_or_index (ht=0x102722700, arKey=0x65532f7364616572 <Address 0x65532f7364616572 out of bounds>, nKeyLength=4294967295, h=0, flag=0) at zend_hash.c:470
#1  0x00000001016c3f24 in pthreads_store_chunk (object=0x106e01628, size=1, preserve=0 '\0', chunk=0x102880760, tsrm_ls=0x1027232e0) at /var/root/pth/pthreads/src/store.c:285
[...] Current language:  auto; currently c
(gdb) frame 1
#1  0x00000001016c3f24 in pthreads_store_chunk (object=0x106e01628, size=1, preserve=0 '\0', chunk=0x102880760, tsrm_ls=0x1027232e0) at /var/root/pth/pthreads/src/store.c:282
@ircmaxell do you have any idea under which circumstances the values/pointers passed in frame 1 are other than the arguments in frame 0?
or is gdb just lying to me?
what do you mean?
remember that gdb and threads are very different than gdb without threads
@ircmaxell I'm not accessing gloabals here?
they're local variables… or how do you mean?
14:39
not even from a global perspective
> In a multi-threaded program, gdb by default shows the backtrace only for the current thread. To display the backtrace for several or all of the threads, use the command thread apply (see thread apply). For example, if you type thread apply all backtrace, gdb will display the backtrace for all the threads; this is handy when you debug a core dump of a multi-threaded program
I am in the right thread...
btw. in my case there's just one thread
php -r 'class Stack extends Stackable { public function run() {} } $s = new Stack; $s->merge([true]); var_dump($s->chunk(1));' remains in the main-thread (a Stackable is no thread)
@ircmaxell do you see my problem?
then run the problem script yourself?
14:48
@DaveRandom Having other problems... privs are flushed, but.. uh..
| Grants for test@localhost                                                                                      |
+----------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'test'@'localhost' IDENTIFIED BY PASSWORD
| GRANT SELECT, INSERT, UPDATE, DELETE ON `test`.`test` TO 'test'@'localhost'                                    |
| GRANT SELECT ON `test`.`test_history` TO 'test'@'localhost'                                                    |
@Leigh Umm... you're definitely authenticated as test@localhost when you do that?
@DaveRandom can you help me to solve this problem stackoverflow.com/questions/17823531/…
@DaveRandom Yessir, maybe I need to refresh the session, even after privs flushed
@Leigh I must be honest I've always made blind faith assumption that privs would work as I configured them, maybe that was a bad plan...
14:53
@DaveRandom Ok reconnecting the console did it. Trigger worked and inserted the value, cannot manually insert/delete
@Someone glob() - glob($baseDir . '/*')
Also please don't ping random people with your problems, see room description
@Leigh I'm a little surprised about that, I wonder if it runs as the user who created the trigger?
now, how to negative match table names with a grant :P
@bwoebi I don't believe in threads
@DaveRandom No clue, but feels like the create trigger grant is a bypass to other privs, if not
@ircmaxell Every time someone says that, a thread dies. You're killing off Java apps with over-zealous threading, one at a time.
14:56
> The DEFINER clause specifies the MySQL account to be used when checking access privileges at trigger activation time. If a user value is given, it should be a MySQL account specified as 'user_name'@'host_name' (the same format used in the GRANT statement), CURRENT_USER, or CURRENT_USER(). The default DEFINER value is the user who executes the CREATE TRIGGER statement. T
Useful to know, triggers created by root will have access to things the current user does not
yay!
@Leigh can not will
@Leigh Interesting. Must be careful never to give TRIGGER priv to anyone who doesn't need it.
@ircmaxell Yes sorry, can, depending on what the trigger does.
Next up, checking if grants with wildcard table names have any kind of rules on whether most/least restrictive is applied
I some how managed not to write LOL so here I go LOL
-7
Q: How to change the url every day in php?

user2615067I want when the cron job run every day the php file update the url in mysql table. For example. 1st day = mysite1.com 2nd day = mysite2.com 3rd day = mysite1.com 4th day = mysite2.com and so on

15:01
^ Voluntarily removed, lol
@Jimbo It happens often that I click on delete and boom, it's deleted, I feel like SO god, but than I refresh and see... sigh self delete
@Baba @rdlowrey updated: github.com/bwoebi/http-websocket (see includes/db.php and includes/databases/* for the new things)
@rdlowrey I really want to have some feedback, especially what concerns everything in includes/databases and includes/db.php. It's the first time I try such a thing, don't know if it's well done etc.…
user895378
@bwoebi Okay -- I will. I held off on it last night because you said you were still working on your gateway implementation. I'll look at it today, but it'll be sometime later.
15:10
are there text editors on *nix command line that can open really large files without too much issues? Like can vim open really large (in gigabytes) files and navigate in them with easy ?
It's not too much code: find . -name "*.php" -exec cat '{}' \; | wc -l outputs 1504
(i'll try it out soon enough)
@bwoebi nice ....
@AnthonyHatzopoulos Just don't use nano for them. If you use nano and you go a few minutes away, your system will be unresponsive^^
@Baba Did you already look at it?
@bwoebi yes but i did not run it ye because of function kill () { posix_kill(DAEMON_PID, SIGKILL); } ... am the one that gave you the only star you have :)
15:15
@Baba the problem is, when I use die() or exit(), pthreads sometimes just segfaults
but I use here just kill() on errors… if your script terminates with an undefined function call or with a sigkill, there must have been an error.
kill() is just to terminate more properly
user895378
@bwoebi Could you not register a shutdown function to handle those cases without the posix_kill?
user895378
(just a thought, and would make windows use more viable)
@rdlowrey yes. But on errors I really want to terminate (does it make sense to let scripts which throw errors continue?)
@rdlowrey I really have no idea about php under windows, never tried.
user895378
No it doesn't make sense. So you also register a custom error handler in the thread to throw on any error. In tandem with the shutdown function you get the same effect and you don't eliminate all potential for use in windows.
6 mins ago, by bwoebi
@Baba the problem is, when I use die() or exit(), pthreads sometimes just segfaults
It also segfaults on normal fatal errors sometimes
but I just could modify my kill() function to use die() on windows?
user895378
15:24
If I remember correctly was able to manage it with the combination of a custom shutdown function and custom error handler without segfaults. I'm just opposed to only supporting *nix or windows in development.
@rdlowrey I don't want to exclude windows, I just don't know what windows doesn't support.
user895378
I have yet to encounter a reason why I couldn't support both besides my own laziness. I don't personally think "extension X is only available for posix" is a good excuse :)
@rdlowrey can you show me your implementation of this?
user895378
But don't let me bully you into doing lots of extra work for people who can't bother to use a real OS :)
user895378
@bwoebi I don't think I have it around anymore tbh. I just remember specifically I had a problem with segfaults when capturing fatals in a worker thread and gracefully terminating via a custom shutdown function and @JoeWatkins pushed a fix that eliminated my issue. I think it's worth a try if that posix_kill call is the only part of your code that won't work in windows.
15:29
@rdlowrey Yes, it sometimes randomly segfaults on exit; I wasn't yet able to get under which conditions… It might be possible that the current implementation won't segfault if I'd replace the posix_kill() by a die(). no idea.
@rdlowrey Just do a test; I have no windows here.
user895378
@bwoebi hehe, me neither :)
good morning
@rdlowrey oh. which os do you use? os x?
15:31
hi guys! why I can't set this string like that: $var = "'* * *\n#Ahpain\n\n# A First Level Header\n\n## A Second Level Header\n\n'"; TY in advance!
user895378
@bwoebi Fedora at the moment, always *nix though.
user895378
@bwoebi How likely it is that we'll be able to get to a place with pthreads where the segfaults aren't a common problem? I mean, is it possible that php's engine just won't ever completely play nice with threads or will we get there eventually as people keep using/testing it?
@acasanovas That is a perfectly valid assignment... your problem is elsewhere.
@rdlowrey and when people create reproduce scripts, @JoeWatkins may also fix it… maybe it'll work completely once.
@Orangepill you are right, thak you! So I'm passing it to JS wrong... :'(
@Orangepill you are right! So my problem is passing it to JS.. :'(
@acasanovas maybe you are forgetting to echo ?
@acasanovas you might want to search SO for "passing php variables to javascript" there is a few answered questions regarding that.
@Orangepill hum, I'm doing it like: echo "fileContent = \"".$var."\";"; perhaps it's more easy with <?php echo $var; ?>
@Orangepill I'll check!!
the "how" seems to be wrong'ish
i also suspect there "where" might be wrong too
Try
echo "fileContent =".json_encode($var).";";
This will handle proper escaping for you
15:43
@ircmaxell you are right. That's all what I have to say about this.
@ircmaxell (you are also right that figuring out how to solve is far more interesting than the implementation itself, hunting @%&#! typos and little logic errors (but this is really not the point of the article, just a side notice))
@Orangepill wow! it worked! then I just need to remove the single quotes of the content :D
@rdlowrey it's like trying to turn a screen door into a boat by patching the holes. Sure, it may work, but it's a waste of time. You're better using a boat that was designed to be a boat...
@ircmaxell rewriting PHP to be the boat is a bit too much work…
@Orangepill thank you very much! now every thing works as I expected. You made me the day!
@bwoebi if every tool you have is a hammer, then every problem looks like a nail
@acasanovas wat ?
someone found out the solution of base64 images in gmail ?
@tereško tell me
15:54
@Alucard we require 25% down-payment
@ircmaxell I'd say that nails are probably the thing I've used hammers for least in my life...

« first day (1012 days earlier)      last day (4162 days later) »