Jump to content

rain13

Members
  • Posts

    346
  • Joined

  • Last visited

rain13's Achievements

Member

Member (2/7)

7

Reputation

  1. Thanks. It works. How does this[this.config.branch](); exactly work? Basically calling string()? I mean normally, "alert"() wouldnt work but this.config.branch is also string. why is there this and then square brackets?
  2. Hi! Sorry if it is wrong word in the title. I am not sure how to call it in english if I do var x = functionName and then x() to call it. Just to clarify this is what I meant bycalling by pointer. What I just described works normally. For example you can do x = alert and then use x() to actually call alert. Now In my case I want to get the same thing work in class. How do I do that? class MyClass { constructor(){ this.config = {"branch": this.branchA}; this.classVar = {"a":1} } main(){ this.classVar["b"] = 2; this.branchB(); this.config.branch(); } branchA(){ alert(this.classVar["a"]); } branchB(){ alert(this.classVar["b"]); } } var myClass = new MyClass(); myClass.main(); myClass.config.branch = myClass.branchB; myClass.main(); // I want this.classVar to be accessible in both branchB calls In this example first call from main to branchB works as I want but 2nd call complains that TypeError: this.classVar is undefined. How do I fix that? Basically I want to have main method that has code that gets executed every time and then n possible alternations which are decided by configuration.
  3. Hi! I have strange problem that I did not have before with my host. I have this php script <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); include_once "./incltest.php"; setcookie('Session', 'val23', 1577840461, '/'); exit(0); ?> And the contents of incltest.php is: <?php ?> The cookie does not set and the message i get it: I figured that if I remove closing tag ?> from php file that I include then *I no longer get this error. So far I've always used closing tags at the end of my php scripts and it has worked that ways. Are there any new php standards out there that now it doesn't work anymore? To me it looks strange to have starting tag <?php at the beginning of my file but not ending tag. Should I now change all my php files or would it be better to set some php ini value?
  4. Hi! I want to use Imagick to resize images. I have one problem. Script finishes immediately despite of fact that original file is about 10 MB which should take some time to process. An other thing is that no errors or warnings are printed. So for debugging purposes I printed version number but it also didnt show anything. <?php error_reporting(E_ALL); print(imagick::getVersion()); $im = new Imagick(); print($im->::getVersion()); $im->readImage( "./uploads/0YZSQJErNxtcb2Dc.jpg" ); $im->resizeImage(1008, 756,Imagick::FILTER_LANCZOS,1); $im->writeImage('./uploads/small.jpg'); $im->destroy(); ?> Any ideas what could possibly be wrong?
  5. Ok, now the left side of green block starts where blue ends. But I needed right side of green to end where right side of blue ends. Edit: Got it solved. Trick was to add span around 2 inner spans with display inline block and then inside this I was able align right. Btw, your example was also interesting. I havent seen such alignment before.
  6. What do you mean by update git? I have already latest git version. Or you mean run some command line command? Can you see screenshot when you follow this link: https://s1.postimg.org/85bw8veqxr/Capture.png
  7. Hi! It looks like a simple thing but right now I couldnt find any way to do it: I need text to be aligned center and then an other text below it. But the text that is below it must be aligned so that it's right side is at same place where previous line's right side. <div style="text-align: center; width: 864px; background-color: red"> <span style="background-color: blue">Some long text that takes more space that is nicely centered</span> <br> <span style="background-color: green">aligned to right</span> </div> right now the green and blue are both centered. I need the green block end where blue block ends.
  8. Hi! I have settings.php in root directory (same directory as my .gitignore). I have tried everything. But settings.php still shows up when I commit stuff and when I change it it shows modified as status. I have tried everything: .idea/ settings.php /settings.php ./settings.php Interesting is that it successfully ignores .idea directory but it doesnt ignore my settings file. Any ideas? Below is screenshot that shows that settings.php is green right now.
  9. Hi! I try to use HSQL database manager to create 2 views. I want to create intermediate view first and then use the intermediate view in new view. Like create view a as .... . And then create view b as select x, ... from a. If I write those 2 statements in HSQL database manager and hit 'Execute' query then it tells me user lacks privilege or object not found. However if I enter first create view statement, click "Execute SQL" and then write 2nd SQL statement ans click "Execute SQL" then it works. The same happens when I migrate date from .sql files. If I put these 2 create view statements in separate .sql files it works but if I put them in same .sql file the 2nd one fails because first view is not created yet (the same error I showed before) However I have these statements separated with semicolon so it should not be issue. Any ideas what it is? And how I could make it so that I could have only one .sql file that has both statements instead of having 2 separate files?
  10. Hi. How do I reliably detect input change? At first I tried on change but it didnt work. Now I try onkeypress but it also doesnt work. You always have to press key twice before button changes state. If the input is empty and button is disabled, you have to type either 2 digit number or work around hack is that you type in 1 digit number and then hit one of the arrow keys. The same is when next button is enabled and you delete the text from input. when delete all digits from the input, it will not disable next button until you have pressed something else. Could anyone explain why I always have to key press at least 2 times before it reacts? And how could I fix it so that it would immediately react when it changes? <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script> function valueChanged(){ var inputValue = $("#interval_size").val(); if (inputValue == "") { $("#generalization_next").prop("disabled", true); } else { $("#generalization_next").prop("disabled", false); } } </script> </head> <body> <input type="number" id="interval_size" onkeypress="valueChanged()"> <input id="generalization_next" type="button" value="Next" disabled="disabled"> </body> </html>
  11. Hello! I want to create my own window in html/css/js which I managed. Now I want to have status bar at the bottom of that window. I am stuck with this because I dont know how to make it consume all width of window (not talking about browser's window but about window I created myself). As I have understood I need position: absolute; to make it stick to bottom. I tried to play with left and right property and even width 100% but nothing helped me. I also dont quite understand why adding position: absolute made my div not to consume all available space. Basically I want my red div to be as wide as it would be without position: absolute; but stick at bottom. The reason for position: absolute; attribute was that bottom didnt work with out it. How should I solve my issue? <!DOCTYPE html> <html> <head> <title>My cool web app</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <script src="./jquery.js"></script> <script src="./jquery-ui.js"></script> <link rel="stylesheet" type="text/css" href="./jquery-ui.css"> </head> <body> <p>Some content in web page</p> <div id="win" style="border: 1px solid rgb(66, 138, 255); position: fixed; left: 552.25px; top: 233.75px; width: 170px; height: 130px; background: rgb(219, 237, 255) none repeat scroll 0% 0%; right: auto; bottom: auto;" class="ui-draggable"> <div style="background:#9CF" id="titlebar" class="ui-draggable-handle"> Window Title <div style="float:right; text-align: left;" onclick="$('#win').remove();"> <img class="icon24" src="./lib/acp/close.png"> </div> <div style="clear:both;"> </div> </div> <div id="wincontent" style="height: 100%; overflow:auto;"> Window content <div style="bottom: 0px; left: 0px; right:0ox; position: absolute; width 100%; background:red;"> Status bar <div></div> </div> <script> $("#win").draggable({ containment: 'window', scroll: false, handle: '#titlebar' }); </script> </body> </html>
  12. You mean to create 2 divs on top of each other? I dont know how to exactly do that. I have tried different examples, but never figured it out. Could you show me minimalistic example?
  13. Hi Right now I have background image with background color but only image gets displayed. I have to remove image if I want color. How do I draw background color on image so that I could get profir from half transparent bg? color: rgb(187, 187, 187); background-color: rgba(255, 81, 81, 0.46); background-image: url(http://orig01.deviantart.net/293b/f/2013/308/7/e/kali_linux_wallpaper_by_blur212-d6szsz7.png); background-repeat: no-repeat; background-attachment: fixed; background-position: center;
  14. Ok after over hour of googling I decided to post here. I get Forbidden You don't have permission to access /test.php on this server. Apache/2.4.18 (Ubuntu) Server at localhost Port 80 in my apache2.conf is: <Directory /> Options FollowSymLinks AllowOverride None Order allow,deny Require all granted Allow from all </Directory> in my 00-default.conf I have DocumentRoot /home/rain/www/ <Directory /home/rain/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> What do I need to do to get access?
×
×
  • Create New...