Posts

php - Improving Ajax auto-complete to return better result -

i using ajax & php fetch elements matches keys(letters) entered user elements resembling database. for e.g database contain manufacturer names as: hydfloo, rexflex, easton, vickters, ever gush, thomas hydraulics, avt pumps and example user has entered letter "h" input box. receive hydfloo return , not thomas hydraulics along it. if "p" typed wd expect see "avt pumps". changes need make php in order able have values returned matches either first or second word of manufacturer name. php code <?php require('../config/connection.php'); if(!$dbc) { echo 'could not connect database.'; } else { if(isset($_post['querystring'])) { $querystring = mysqli_real_escape_string($dbc, $_post['querystring']); if(strlen($querystring) >0) { $query = mysqli_query($dbc, "select distinct name prdct_subcat name '$querystring%' limit 10"); echo '<ul>'; w...

java - How to generate n random numbers with a sum of m in public static void main (scanner)? -

i'm trying generate 4 different numbers second else if statement ( life_1.equals(a) , random integer third else if statement ( life_1.equals(c) without changing public static void main myscanner. answering , sorry if question doesnt make sense @ :/ system.out.println("do want use lifeline now? (y - yes or n - no)"); answer =myscanner.nextline(); boolean life=false; if (answer.equals("y")) { { system.out.println("alright. 1 of lifelines use?( f-fifty-fifty , a-ask audience, c-call friend)"); life_1= myscanner.nextline(); if (life_1.equals("f") && lifeline_5050 !=0){ system.out.println(" answer not b or d"); lifeline_5050 = lifeline_5050 - 1; life=true; } else if (life_1.equals("a") && lifeline_ask != 0) { system.out.println("the audeince answers are: a."+randomnum1+ "b. "+randomnum2+"c. "+randomnum3+ "d. "+ran...

Having trouble with using C++ library in C# -

so i'm writing program uses 3rd party dll written in c++. i'd write program in c#, since know thing or 2 language , never did in c++. got library called ciusblib in pack of files: .dll, .h, .lib, .ext. program meant target computer (win7 32bit), different i'm developing on (win10 , win8 both 64bit) - have limited access target computer. i'm using visual studio 2015 , according vs's object browser dll contains classes several methods want use. found there 3 methods available - reference library in c# project, p/invoke (using dllimport) , c++/cli wrapper. so first tried referencing library in c# project, directly crashes on instantiating class on both dev computers , throws accessviolationexception on target computer. wasn't able figure out why it's happening blamed on library's code being unmanaged. after doing research found dllimport can't used on methods closed in class. tried c++/cli wrapper, realized referencing c++ library in visual...

javascript - How do i prevent subfolders access via anonymous http-url-path inspite of password-protected aspx.default file on parent-folder? -

could info on how keep files , folders free anonymous http access, besides i've done. aspx project-folder gateway/default file aspx.net/vb.net password protected web-page, works well. if knows , types full url path html-file or subfolder within, still gain access (bypassing aspx password page). here's i've done far==== ---utilizing settings of iis-7 server, i've attempted rendering subfolders not accessible anonymous browsers, after doing aspx password page becomes ineffective in redirecting subfolders , htl files within. after putting in correct password on aspx password page, run 404-unauthorized access error msg, means password authorized access disabled when turn off anonymous access subfolders. could have fact aspx password entry page submit-button not pointing aspx page rather, pointing html pages within subfolder? i believe using web.sitemap xml configuration file can you. https://msdn.microsoft.com/en-us/library/ms178428.aspx

c++ - Black screen while trying to display drawing on screen -

i started learn opengl, , im stuck on problem, when try make resizable window, object not showing on window, , cant figure why. if can take quick wrong of big help. best regards. #include <stdio.h> #include <stdlib.h> #include <gl/glut.h> void initlights(); void reshape(int width, int height); void display(); void renderscene(); int w; int h; int main(int argc, char** argv) { glutinit(&argc, argv); //metodi se predaje dva argumenta - andresa varijable koja sadrži broj argumenata iz komandne linije, te polje tih argumenata glutinitdisplaymode(glut_double); glenable(gl_lighting); glutinitwindowsize(w, h); //dimenzije prozora u pikselima glutinitwindowposition(0, 0); //pozicija gornjeg lijevo kuta u kojem će se scena iscrtati, prvi argument je x, drugi y glutcreatewindow("primjer 1"); //stvaranje prozora u kojem će se iscrtati scena ("naziv prozora") glutdisplayfunc(display); //registracija metode display, vraća podatak tipa ...

How to scrape html table only after data loads using Python Requests? -

i trying learn data scraping using python , have been using requests , beautifulsoup4 libraries. works normal websites. when tried data out of websites table data loads after delay, found empty table. examples this webpage the script i've tried routine one. import requests bs4 import beautifulsoup response = requests.get("http://www.oddsportal.com/soccer/england/premier-league/everton-arsenal-tnwxil2o#over-under;2") soup = beautifulsoup(response.text, "html.parser") content = soup.find('div', {'id': 'odds-data-portal'}) the data loads in table odds-data-portal in page code doesn't give me that. how can make sure table loaded data , first? you need use selenium html. though continue use beautifulsoup parse follows: from bs4 import beautifulsoup operator import itemgetter selenium import webdriver url = "http://www.oddsportal.com/soccer/england/premier-league/everton-arsenal-tnwxil2o#over-under;2" b...

c# - Creating a List of Unity Objects -

i'm trying create strip of sprites. created list of game objects , seems work ok. except have duplicate object in game view, seemed need destroy "template object". when looks fine, when try move them says i'm trying access object has been destroyed. can explain issue? seems i'm confused on instantiate , how works exactly. under impression object isn't created in game view until instantiate. why duplicate object? input. using unityengine; using system.collections; using system.collections.generic; public class reelstrip : monobehaviour { public list <sprite> image = new list<sprite>(); public list <int> index = new list<int>(); public list <gameobject> symbol = new list<gameobject> (); public int reelnumber; public float symbolheight = 1.74f; public float symbolwidth = 2.00f; public float speed = 0.01f; // use initialization void start () { reelnumber = 0; l...