Posts

Showing posts from January, 2014

android - Presentation Display: wrong DPI's -

my application runs in phone & uses presentation display render scene. the phone samsung galaxy s4 around 480dpi's. i connect 40" tv mhl/hdmi adapter. seen in logcat metrics: {"hdmi screen": 1920 x 1080, 60.000004 fps, density 320, 320.0 x 320.0 dpi, touch external, rotation 0, type hdmi, flag_secure, flag_supports_protected_buffers, flag_presentation} my problem is, dpi's of secondary display wrong! density much, lower 320dpi. wonder value comes from, , if adjustable. i'd use value in mdpi land font rendered smaller. if you're looking @ dpi in displaymatrics class- isn't accurate. depends on field being set oem when build android, field isn't set causes no bugs isn't used anywhere. can't trust native screen device built with. trusting outside screen less right.

android - Listview with button OnItemClickListener is not calling -

i create custom listview textview , 2 imagebutton . onitemclicklistner not calling. here code police_station_list = (listview) findviewbyid(r.id.police_station_listview_xml); adapter = new arrayadapter<string>(this, r.layout.coustome_listview, r.id.district_listview_xml1, police_station_name); psadapter = new police_station_adapter(this); police_station_list.setadapter(psadapter); police_station_list.setonitemclicklistener(psadapter); here custom arrayadapter class: public class police_station_adapter extends arrayadapter<string> implements onitemclicklistener{ context context; public police_station_adapter(context context) { //super(context, r.layout.police_station_listview, r.id.police_station_listview_textview, police_station_name); super(context, r.layout.police_station_listview, police_station_name); this.context = context; } private class viewholder { textview tv; imagebutton mobile, phone; public viewholder

html - Is it possible to place a character on a border line displayed in a table? -

is possible place character on border line displayed in table? i trying discover way re-create musical staff notation webpages using html rather inserting images. i have got staff render fine, 5 horizontal lines divided vertical bars using in css header: table.musstaff{border-collapse:collapse;} .trms{border-bottom:2px solid black;} .tdms{border-left:2px solid black;} and need render musical staff: <table class="musstaff"> <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td></tr> <tr class="trms"><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td></tr> <tr class="trms"><td>&nbsp;&nbsp;&nbsp;&nbs

jasperserver - retrieving the report's parameters dynamically -

Image
is there way retrieve jasperreports 's report parameters? which means don't have know parameters retrieve report in our application.the parameters prompts can embedded in our application. once report embedded in our application , if want run it, parameters prompts displayed automatically if in jasperrepoprts server . this called jasper http api ( link ) you build url jasper report. assuming hosting jasper reports server. can use url via iframe in html. if see parameters below, can choose skin report (which remove components), add themes suit application etc. can pass parameters via rest format e.g.. &projectid=221 if want pop up: in jrs, go edit report. in controls , resources, can add control input, if want. this show popup , can enter value. hope looking for.

haskell - Representing sum types in sql with Persistent, and Esqueleto joins -

i have been trying figure out sensible way represent haskell sum types in sql backend using persistent. my target haskell data type along lines of data widget = foowidget int | barwidget t.text data helement = helement { name :: t.text , widget :: widget } i modeling these using following persistent data types: element name t.text foo elementid elementid size int bar elementid elementid colour t.text there ever either foo or bar each element, never both. i want use left outer join select elements , corresponding foo or bar. esqueleto expression is: select $ $ \(elem `leftouterjoin` foo `leftouterjoin` bar) -> on (just (elem ^. elementid) ==. foo ?. fooelementid) on (just (elem ^. elementid) ==. bar ?. barelementid) return (elem, foo, bar) however, when execute code, error: user error (postgresql.withstmt': bad result status fatalerror (("pgres_fatal_error","error: missing from-clause entry table if rem

ios - How to pause (and resume) background location monitoring when low battery? -

i'm writing location tracking application ios 7.1 (iphone) requires stop or pause background location monitoring when battery 30% , lower. location monitoring should resume in background when battery improves. how can this? i'm using significant location change update (cllocationmanager api methods) background location monitoring. thanks! as per documentation of startmonitoringsignificantlocationchanges: if start service , application subsequently terminated, system automatically relaunches application background if new event arrives. in such case, options dictionary passed application:didfinishlaunchingwithoptions: method of application delegate contains key uiapplicationlaunchoptionslocationkey indicate application launched because of location event. upon relaunch, must still configure location manager object , call method continue receiving location events. when restart location services, current event delivered delegate immediately.

mysql - Best way to insert all the combinations -

i have been thinking quite bit , can't seem figure out way in plain mysql. i have list of words (size not fixed): word11 word21 word31 word41 for each 1 of words, have list of synonyms (size not fixed). word11, intance: word12 word13 word14 word15 word16 my goal different possibibilities: word11 word21 word31 word41 word12 word21 word31 word41 word13 word21 word31 word41 word14 word21 word31 word41 ... word11 word21 word31 word417 word11 word21 word31 word418 i thought using temporary table store different results. for each word, , each result stored in temporary table, insert new synonyms instead. the first iteration word11 give word11 word21 word31 word41 word12 word21 word31 word41 word13 word21 word31 word41 word14 word21 word31 word41 word15 word21 word31 word41 word16 word21 word31 word41 for iteration 2, each 1 of these entries, insert synonyms replacing word21 synonyms. but seems tedious , there might better way (not sur

php - DELETE multiple rows in PDO -

i'm rookie in pdo , i've done search issue i'm facing , wasn't able find answers it. can see below, have function: function deleteinfo($id){ $pdo = connpdo(); $deleteinfo = $pdo -> prepare("delete game_locais_zumbis id_zumbi in (:id)"); $deleteinfo -> bindvalue(":id", $id, pdo::param_str); $deleteinfo -> execute(); $pdo = null; } after that, have following code: while($row = $listinfo -> fetch(pdo::fetch_assoc)){ $ids[] = $row['ids']; } $ids = implode(',', $ids); deleteinfo($ids); when echo $ids, get: 1,2,3,4,5 but delete function not deleting 5 rows in db first one, "1". when run same delete function in db, replacing ":id" "1,2,3,4,5", work! know what's mistake here? appreciate help. i this: $query = "delete game_locais_zumbis id_zumbi in (".str_repeat("?,", count($ids) - 1)."?)"; $stmt = $conn->prepar

html - Most 'elegant' way to make 2x2 box of divs -

Image
i've built "buzzfeed-like" quiz app 4 answer choices each question. on mobile i'm pleased layout (a 2x2 box). however, on desktop answers displaying 4 choices horizontally across screen. main issue i'm using angular generate questions , answer choices, makes styling bit trickier. ideas on how 'elegantly' code html/css displays answer choices 2x2 box? i've attempted use media queries, feels putting bandaid on large wound. current code , images below: html: <div class="jumbotron text-center" ng-hide="quizcomplete"> <h3>{{ questions[number].ask }}</h3> <div class="row"> <div ng-repeat="answer in questions[number].answers" class="choice"> <div ng-click="recordchoice(answer.points)"> <span class="centerer"></span> <span class="centered">{{ answer.choice }}&

How to send float through serial port in c#? -

this question has answer here: how convert float binary in c#? 1 answer i have 2 float now,say f1 , f2. want send them micro controller through computer serial port, how should it? understanding need convert f1 , f2 binary first,then send micro, after cnvert float again. confused how convert float binary before send them out? code b1 = system.bitconverter.getbytes(f1); b2 = system.bitconverter.getbytes(f2); it depends on endianness of microcontroller's architecture. speaking need this: convert float 4-byte array. you're on right track, although c# rusty. send them 1 one microcontroller if microcontroller supports floating point representation cast four-byte array float: byte array[4]; // pre-allocate array getbytesfromserial(array); // fill array values serial port float converted = 0; memcpy(&converted, array, 4); /** "c

for loop - In Java, why do we need to subtract some numbers in boolean expression? -

i'm having difficulty in figuring out why subtract numbers in boolean expression part of loop. example 1: goal count numbers of same 2 length long substrings of each string. public int stringmatch(string a, string b) { int len = math.min(a.length(), b.length()); int count = 0; for(int c = 0; c < len-1; c++) { string sub1 = a.substring(c, c + 2); string sub2 = b.substring(c, c + 2); if(sub1.equals(sub2)) count++; } return count; } example 2: goal return true if array contains {1, 2, 3}(in order) indexes. public boolean array123(int[] nums) { for(int = 0; < nums.length -2; a++) { if(nums[a] == 1 && nums[a+1] == 2 && nums[a+2] == 3) return true; } return false; } array indices start @ 0. if have array has 10 values stored in first value stored in array[0] second in array[1] way array[9]. int len = math.min(a.length(), b.length()) sets len variable number of characters in whichever string shorter (a or b). so if ha

c++ - Application compiles in Eclipse, but has 'undefined reference errors' in Qt -

i building application uses mysql , needs graphical user interface. because more comfortable eclipse, , seems have better organization , 'pop-up references', decided develop main engine in eclipse, , transfer qt (using qt creator 3.1.2, based on qt 5.3.1) gui. engine compiles in eclipse fine (and command-line test in eclipse runs well), when include files in qt project, undefined reference errors. i error ( undefined reference 'sql::mysql::get_driver_instance' ) anywhere have code: sql::mysql::mysql_driver* driver = sql::mysql::get_driver_instance(); i have relevant headers included (since eclipse sees no problem it): #include "mysql_driver.h" #include "mysql_connection.h" #include < cppconn/driver.h> #include < cppconn/connection.h> #include < cppconn/statement.h> #include < cppconn/prepared_statement.h> #include < cppconn/resultset.h> #include < cppconn/me

jquery - Moving modal to body leaves table behind -

i using bootstrap django project , have modals inside templatetags. use code below move modals document body. however, table inside modal-body remains modal while modal moved document body. experienced before? <script> $(document).ready(function() { $(document.body).append($('.modal').detach()); }); </script> before move modal: <div class="modal"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"></div> <div class="modal-body"> <table> ... </table> </div> </div> </div> </div> after i've moved modal: <table> ... </table> <div class="modal"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-heade

c++ - Error with Merge Sort -

i trying create merge sort algorithm in c++ takes vector of generic type input , sorts elements in vector. except getting [run] bus error (core dumped) error everytime try test algorithm. my code merge sort follows: template <typename t> void merge_sort(std::vector<t>& vector) { typename std::vector<t>::iterator middle_value = vector.begin()+vector.size()/2; std::vector<t> left_side(vector.begin(), middle_value); std::vector<t> right_side(middle_value,vector.end()); merge_sort(left_side); merge_sort(right_side); std::vector<t> merged; int i,j; while(i<left_side.size() && j<right_side.size()) { if(left_side.at(i)<right_side.at(j)) { merged.push_back(left_side.at(i)); i++; } else { merged.push_back(right_side.at(j)); j++; } } while(i<left_side.size()) { merged.push_back(left_side.at(i)); i++; }

c++ - Correct movement to exact position when using floats -

in pathfinding game, have following code: void dot::move( tile *tiles[], float timestep ) { mvelx = (points[currentpoint].x * tile_width) + (tile_width / 2 - dot_width / 2)- mbox.x; mvely = (points[currentpoint].y * tile_height) + (tile_height / 2 - dot_height / 2) - mbox.y; mbox.x += mvelx * dot_vel * timestep; mbox.y += mvely * dot_vel * timestep; } mbox position. points refers solution of pathfinder. dot has no problem moving tile tile, it's "off center". http://i.stack.imgur.com/6jszz.png some solutions i've considered: create tiny bounding box in center of each tile. "misses" collision. use epsilon value. unfortunately leads trial , error , imprecise results. the other issue easing (for example adding friction). dot "slide" way longer needs until reaches center. results in awkward movements. if can make circle's "position" center of ci

ios - Tracking which UIAlert button is clicked to change UILabel -

i'm complete beginner , looking learn how start coding build own apps. i've been messing around classic "hello world" design , trying improve on based on limited knowledge have managed gather in past week i've got stuck , hope can me out! so far have uitextfield user enter name, label display name , button update display. understand uialertviews better have included alert if name entered chris (or chris) , alert if name entered not chris. functioning fine far. i'm looking track button pressed on incorrectname uialertview , update uilabel "chris" if click "i want called chris" button. have build app similar before tutorial , have copied across code thought should function same doesnt seem work. here .m file far #import "solo1viewcontroller.h" @interface solo1viewcontroller () @end @implementation solo1viewcontroller @synthesize setmessage; @synthesize username; -(void)alertview:(uialertview *)alertview clickedbutto

url rewriting - Complex routing WSO2 API resourse uri template -

short version. trying create api handle /goals/risks /goals/types /goals/{goalid} so far have isn't quite looking for. gives me /goals/goal/{goalid} <api xmlns="http://ws.apache.org/ns/synapse" name="goalapi" context="/goals"> <resource methods="get" uri-template="/risks" faultsequence="returnerror">...</resource> <resource methods="get" uri-template="/types" faultsequence="returnerror">...</resource> <resource methods="get" uri-template="/goal/{goalid}" faultsequence="returnerror">...</resource> </api> goalid match /^\d+$/ if can route somehow work. want add /goals/{goalid}/item , /goals/{goalid}/items/{itemid} believe easy enough once figure out first step. if there no way here, there way can rewrite url inside wso2 before reaches resource , able replace /goals/(\d+.*) /goals/goal/$1? know r

css - Jquery animate enlarge/shrink a div on click (2 clicks) -

i trying make code stop after first half, when click again shrinks. so, 2 clicks. how achieve this? $('#container').click(function () { $(this).animate({ 'width': '400px', 'height': '400px', 'left': '90px', 'top': '90px' }, 200); $(this).animate({ 'width': '200px', 'height': '200px', 'left': '90px', 'top': '90px' }, 200); }); js fiddle i have looked through questions related on stack overflow , none of them allowed click on item resized. if want toggle effect, there couple different ways achieve this. the first way keep track of "state" of image in application. var enlarged = false; $('#container').click(function () { $(this).stop(true, false).animate({ width: enlarged ? 200 : 400, height: enlarged ? 200 : 400,

scrapy: how to have a response parsed by multiple parser functions? -

i'd special each 1 of landing urls in start_urls , , spider'd follow nextpages , crawl deeper. code's this: def init_parse(self, response): item = myitem() # extract info landing url , populate item fields here... yield self.newly_parse(response) yield item return parse_start_url = init_parse def newly_parse(self, response): item = myitem2() newly_soup = beautifulsoup(response.body) # parse, return or yield items return item the code won't work because spider allows return item, request or none yield self.newly_parse , how can achieve in scrapy? my not elegant solution: put init_parse function inside newly_parse , implement is_start_url check in beginning, if response.url inside start_urls , we'll go through init_parse procedure. another ugly solution separate out code # parse, return or yield items happens , make class method or generator, , call method or generator both inside init_parse , newly_parse

apache - Problems with CAS validation and mod_auth_cas -

so have apache server running mod_auth_cas module. i'm trying have secure directory protected. load module in httpd.conf file: loadmodule auth_cas_module /usr/lib64/php/modules/mod_auth_cas.so and have of configuration loaded cas.conf file: casversion 1 casdebug on casrootproxiedas http://something.com/secure casloginurl https://secure.its.somewhere.edu/cas/login casvalidateurl https://secure.its.somewhere.edu/cas/servlet/validate cascookiepath /var/www/webroot/cas/ <directory /var/www/webroot/root/secure> authtype cas require valid-user </directory> when visit secure directory, website redirect me cas login page, , send me ticket after i've logged in. 401 authorization required page. looked through apache logs , i've found: [debug] mod_auth_cas.c(2026): [client ] entering cas_authenticate() [debug] mod_auth_cas.c(575): [client ] cas service 'http%3a%2f%2fsomething.com%2fsecure%2fsecure' [debug] mod_auth_cas.c(523): [client ] e

system cannot find the specified file python subprocess -

i trying run simple command in python: from subprocess import * check_output("ls") when run raises error: windowserror: [error 2] system cannot find file specified ls doesn’t exist on windows; dir does. furthermore, may need pass shell=true , since it’s built in cmd.exe . if it’s not test , want contents of directory, use os.listdir instead.

javascript - AMD modules with transitive dependencies -

suppose want create amd module depends on other amd module. doesn't matter what, tangible, suppose new kind of date-picker widget depends on moment.js so setup bower.json looks this: { "name": "samplelib", "version": "0.0.1", "description": "test", "main": "mycontrol.js", "moduletype": [ "amd" ], "dependencies": { "moment": "~2.8.1" } } ok, cool. no problem there. my question how gets consumed... see 2 options, neither of love: option one concat code , moment.js unified script, , publish that. easy clients consume since have depend on module. in scenario: is moment.js devdependency, because clients don't have download it? if client depends on module also transitively depends on moment.js, there way around client loading library twice? option two don't concat code , keep moment.js declared dep

ruby method to convert a hash to a string -

please me make method named hash_string takes hash , make string key/value pairs. example: hash_string({id: 8, name: 'marry'}) # should return "id = 8, name = marry" i've tried same way before, are: def hash_string(hash) hash.to_s end and def hash_string(hash) set_value = hash.each {|key, value| puts "#{key} = #{value}" } # set_value.join(",") end but did not work. please explain me, how can that? replace each map , return value instead of outputting it, , you're done. def hash_string(hash) set_value = hash.map {|key, value| "#{key} = #{value}" } set_value.join(",") end

video - How to make FFmpeg use output codec and pix_fmt same with input -

i'm trying write batch process shell script resizing videos, of unpredictable codecs , containers. expected resized video should same original 1 except image sizes. means video png codec in mov container should output png codec not h264. but realized keeping extension names same not enough. ffmpeg tends use default encoder associated extension name rather trying keep same input. is there magical parameter tell ffmpeg try use input codec instead of guessing output file name? running ffmpeg twice information in advance last choice, because make script lot more complicated. get codecs ffprobe , , specify them on ffmpeg command, pseudocode like: output = parse_json( `ffprobe -v quiet -show_streams -print_format json output.mp4` ) stream_args = "" stream in output['streams']: stream_args += " -codec:0:" + stream['index'] + " " + stream['codec_name'] ffmpeg_cmd = "ffmpeg -i input.mp4 " + stream_ar

python - regex between some character -

input: [1] string1 [2] string 2[3]string3 [5]string4 output: string1 string 2 string 4 how resolve case "input" , result "output" "regex" python? your instructions bit vague, said - using example input provided: import re line = '[1] string1 [2] string 2[3]string3 [5]string4' matches = re.match(r'\[1\] (.*?)\[2\] (.*?)\[3\](.*?)\[5\](.*)', line) print matches.group(1) # prints string1 print matches.group(2) # prints string 2 print matches.group(3) # prints string3 print matches.group(4) # prints string4

html5 - Creating two columns grid layout in Bootstrap -

Image
i'm trying create 2 columns grid following image: to achieve it, i've written following code: <div class="row"> <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 content-summary"> <a href="#" class="center-block text-center"> <img class="img-responsive img-thumbnail center-block" src="http://placehold.it/300x200&text=title" alt="title" /> </a> <h2 class="text-justify"><a href="#">title</a></h2> <p class="text-justify" style="direction: rtl; height: 165px; overflow:hidden;">summary of content</p> <div class="row text-right"> <span class="fa fa-image fa-lg"></span> 12 images &nbsp;&nbsp;&nbsp; <span class="fa fa-file-movie-o fa-lg"></span> 2 vid

verilog - Delay between two instantiations of same module -

i want run following code: module (input a1 ,clock, reset, output aout); ---- ---- ---- key k1(a1,clock,reset,k1out); // takes around 40 cycles complete key k2(k1out,clock,reset,k2out); endmodule k1out displayed correctly, k2out not. in fact getting k2out xxxxx . there way provide delay between these 2 instantiations executed in order , can output correctly? your describing hardware, 2 instances exist in parallel. you either control clock each block execute sequentially, or build state machine sequence them. with clock gating (internal key): module (input a1 ,clock, reset, output aout); ---- ---- ---- logic [6:0] state; @(posedge clock or posedge reset) begin if (reset) begin state <= 'b0; end else begin if (state >= 7'd80) begin state <= 'b0 ; end else state <= state + 1'b1; end end wire k1_enable = (state < 7'd40 ); wire k2_enable = (state >= 7'd40); key k1(a1, clock,rese

spring - Handling Typos and Soundex conditions While Searching a String in Java without Interacting Database -

my application uses hibernate search handle possible search criteria. however, there need me obtain collection of objects database , based upon user inputs, need perform search on obtained collection. system should able handle typos , sound-ex conditions too. manner in interact database in condition through hibernate criteria can serve purpose , cannot use hibernate search here. is there way can use hibernate search along hibernate criteria? requirement hibernate search should done on results obtained criteria, not on db. guess doing in dao not possible , hence thinking of handling in service layer. have library similar hibernate search, apache lucene perform search(including typos , soundex) on collection of objects.

php - MySQL query working fine but not printing the record -

i want search data doctor table. have 1 record in doctor table , searching record , want echo data not working. my query working fine not coming if statement. code this <?php if(isset($_post['search']) && !empty($_post['search'])) { $province_option = $_post['province']; echo $province_option; $city_option = $_post['city']; echo $city_option; $specilization_option = $_post['specilization']; echo $specilization_option; $query = "select * doctor doc_specilization = '$specilization_option' , doc_city = '$city_option' , doc_province = '$province_option' "; echo "</br>"; echo $query; $result = mysqli_query($connection,$query); $count = mysqli_num_rows($result); if($co

git - gitk "package require Tk" -

on starting gitk cli on ubuntu m getting error vihaan@trojan :~$ gitk application-specific initialization failed: unknown color name "s_base3" error in startup script: unknown color name "s_base3" (database entry "-background" in widget ".") invoked within "load /usr/lib/x86_64-linux-gnu/libtk8.6.so tk" ("package ifneeded tk 8.6.1" script) invoked within "package require tk" (file "/usr/bin/gitk" line 10) how fix ? this pretty tricky, old school x11 stuff. your xrdb contains specification background colour gitk main window s_base3 , nothing knows how parse colour name, neither tk nor xserver, means error during toplevel widget creation when gitk application trying create main window (it's trying parse xrmdb entry , doing software equivalent of exclaiming “wat!?”). the xrdb way of specifying defaults various attributes of gui applications. 1 of attributes backgro

osx - Problems setting application icon with QT 5.3 on Mac -

i've been trying set application's icon following directions here: http://qt-project.org/doc/qt-5/appicon.html if understand correctly, process should simple: create icon file ( flysightviewer.icns ) using iconutil. followed directions here: https://stackoverflow.com/a/20703594/443822 . add icon = flysightviewer.icns .pro file. however, when follow these steps, icon remains default qt application icon. i've tried deleting app bundle , build folder, since i've read these not rebuilt through usual process. doesn't seem resolve issue. looking bit deeper, when run qmake qt creator, generated makefile contains several instances of flysightviewer.icns , including line: @$(copy_file) ../flysight-viewer-qt/src/flysightviewer.icns flysightviewer.app/contents/resources/flysightviewer.icns the file ../flysight-viewer-qt/src/flysightviewer.icns seems right expect be. however, when build project , inside app bundle, icon found. thing in resources folder e

c# - Use Regex in this Linq query? -

i using linq find highest int in list, can increment , add end of next string: var cablenumber = clist.select(v => int.parse(v.cablenumber.substring(n))).max(); however, because strings aren't fixed length, thinking of inserting regex.match in there, possibly like: n = regex.match(cablenumber, @"\d{3}", regexoptions.righttoleft); to specify; format input strings follow have 3 digit number on end, possibly followed single letter. examples: cp1-p-cp2-001 (001) mot1psp2023a (023) tksp3-c-flt2-234-a (234) how implement this? there better way? the following uses regex pattern inside linq query: string[] strings = { "cp1-p-cp2-001 (001)","mot1psp2023a (023)", "tksp3-c-flt2-234-a (234)", "invalidstring" }; int? maxvalue = strings.max(x => { var match = regex.match(x, @"\d{3}(?=\d*$)"); return match.success ? (int?) int.parse(match.value) : null; }); the int? can

php - Xampp Access Denied (HY000|1045), permissions set -

i developing php site using xampp , having trouble accessing mysql database. following error: warning: mysqli_connect(): (hy000/1045): access denied user 'guest'@'localhost' (using password: yes) in c:\xampp\htdocs\clothing\index.php on line 24 here php code connect database: $conn = mysqli_connect('localhost', 'guest', 'change01&', 'clothing') all credentials such username , password correct, have reset password in phpmyadmin thousand times , still error. have made sure guest user has permissions set. else problem here ? might worth mentioning have changed default ports apache not mysql.

Tables in control-m, are they unique -

table names in control-m jobs mentioned under 1 control-m instance, need have unique names? table names need unique under 1 instance ctm server. so, naming standard set - this ensures under 1 application, table names unique. if try create new table same name, not let save table, , throw message table same name ex: if table1 common table (name) in both application app1 , app2, - app1_p_table1 / app2_p_table1 this helps in classification. additional features 'group name' , 'application' helps classification, used while giving access users.

raspberry pi - Reload page if 'not available'? -

i've standalone raspberry pi shows webpage server. it reloads after 30 minutes via javascript on webpage. in cases, server isn't reachable short time , chromium shows usual this webpage not available message, , stops reloading (because no javascript page triggers reload). in case, how can still reload webpage after few seconds? now had idea fetch website results via ajax , replace in current page if available. rather refreshing webpage every few minutes, can ping server using javascript ( pingjs nice library can that) now, if ping successful, reload page. if not successful, wait 30 more seconds , ping again. doing continuously, make wait until server open again (i.e. can ping it) i think simpler method compared making own java browser , making browser plugin. extra info : should use exponential function or timeout checking avoid unnecessary processing overhead. i.e. first time out find ping fails, wait 30 seconds, second time wait 30*(2^1) sec, 3

opencv - detecting geometric shapes in UML, flowcharts -

i looking ways automatically image-process state-machine diagram (eg. finite state machine or see sample @ http://www.artima.com/designtechniques/images/trafficlight.gif ) , turn state-transition table. told solved problem -- in there multiple automatic image processing solutions out there process diagrams , turn them internal notation. true? also, there similar solutions flow charts or other uml diagrams (like message sequence charts) also? fyi, image processing using opencv on windows. text recognition (i.e. ocr), have found tessract useful. before finding own mechanism automatically processing state-machines, wish know if solved problem.

Hide lables, textboxes and combo boxes on MS Access form -

i using ms access 2007. how can hide labels, text boxes , combo boxes in form when click button on form? here have tried getting error: application-defined or object-defined error: private sub cmdadd_click() form!frmdetails!label105.visible = false form!frmdetails!combo110_label.visible = false form!frmdetails!combo110.visible = false form!frmdetails!label27.visible = false form!frmdetails![first name].visible = false form!frmdetails![second name].visible = false form!frmdetails!lastname.visible = false form!frmdetails![id type_label].visible = false form!frmdetails!combo43.visible = false form!frmdetails![id no].visible = false form!frmdetails!label33.visible = false form!frmdetails!address.visible = false form!frmdetails!address2.visible = false form!frmdetails!address3.visible = false form!frmdetails!label39.visible = false form!frmdetails![contact no].visible = false form!frmdetails!label112.visible = false form!frmdetails!combo113.visible = false form!frmdetails!label11

php - SQL query to Google's JSON format -

i have posted code snippet few days ago this problem . try examine problem side. so , have query , fill in json file output. contains more records, not one. problem is, code, have found / have wrote paste first record file cols. think there no existing tutorial problem. update: sample output: array ( [cols] => array ( [0] => array ( [id] => [label] => name [pattern] => [type] => string ) [1] => array ( [id] => [label] => start [pattern] => [type] => date ) [2] => array ( [id] => [label] => end [pattern] => [type] => date ) ) [rows] => array ( [0] => array ( [c] => array

mysql - user access level in PHP -

my problem maybe simple problem whom expert, still cant understand put loop code where should put : while($row=mysql_fetch_array($query)) { if($row['level']==1) { header('location: home.php'); } else if($row['level']==2) { header('location: home2.php'); } else if($row['level']==3) { header('location: home3.php'); } } in : `<?php session_start(); $id = mysql_real_escape_string($_post['id']); $katalaluan = mysql_real_escape_string($_post['katalaluan']); mysql_connect("localhost", "root","") or die(mysql_error()); //connect server mysql_select_db("sistem_laporan") or die("cannot connect database"); //connect database $query = mysql_query("select * profil id='$id'"); //query profil table if there matching rows equal $id $exists = mysql_num_rows($query); //checks if id exists $table

google play services - Android device won't wake up on long idle with push notifications -

we building app receives push notifications google play services (transferred gcm few days ago). our problem on devices, after sleeping more 15 min push not arriving, if wifi , 3g on. no matter - flags on server(time_to_live, delay on idle etc.), transferring gcm play services, checking right permissions in app manifest. nothing helps. when device not in sleep mode notifications comes fine. this issue disturbs much. will glad or suggestions. thanks, noam since needs rather sporadic, holding wake lock, partial one, bad choice in terms of battery usage. better approach set alarm periodically wake , run small service check messages. suspect if waited long enough, else wake device , you'd message. edit 1: that said, still might need android.permission.wake_lock permission keep device awake long enough process message before going sleep. @ least apparently did gcm. edit 2: might experiencing results of apparent bug heartbeat interval affects users carr

vb.net 2010 - How to insert ALL items in combobox to mysql one column? -

all items on combobox should go database. should appear when after form1 load. code in inserting not working. hope me private sub form1_load(byval sender system.object, byval e system.eventargs) handles mybase.load dim 1 string conn.open() query = "select * dbgradeslip.student" cmd = new mysqlcommand(query, conn) dr = cmd.executereader while dr.read dim fn = dr.getstring("firstname") + ", " dim mn = dr.getstring("middlename") + " " dim ln = dr.getstring("lastname") 1 = ln.substring(0, 1) 2 = combobox6.items.add(fn + mn + one) end while = 0 combobox6.items.count query = "insert student (fullname) values ('" & combobox6.items.tostring & "')" cmd = new mysqlcommand(query, conn) da.selectcommand = cmd next conn.close() end sub you should call executenonquery on mysqlcommand

multithreading - Threading in C# issue -

i have piece of code runs 1 method , runs same method again different parameters. method takes 45 seconds complete minute , half in total. looks like: //start dbinfopackage migrateddata = runfirstqueries(connectsqlserver, log); dbinfopackage nonmigrateddata = runfirstqueries(connectoracle, log); //end is possible run methods @ same time using threading? just since people giving lower-level answers, using system.threading.thread , whatnot, i'd do: task<dbinfopackage> migrateddatatask = task.run<dbinfopackage>(() => runfirstqueries(connectsqlserver, log)); task<dbinfopackage> nonmigrateddatatask = task.run<dbinfopackage>(() => runfirstqueries(connectoracle, log)); task.waitall(migrateddatatask, nonmigrateddatatask); var migrateddata = migrateddatatask.result; var nonmigrateddata = nonmigrateddatatask.result; that'll run them in 2 concurrent tasks, wait them both finish, , grab results. you'll want add in error handling, th

Vaadin GWT Widget Modification -

i need modify gwt code of vaadin table widget. how begin ?. can find gwt code of table widget? thanks vaadin widgetset sources included in .jar file since gwt compiler needs java source code generate javascript. hence can access sources in ide, instance in eclipse pushing f3 on method o class name in code. in vaadin, server components bundled in vaadin-server.jar, , client widget implementations in vaadin-client.jar. have original code available @ https://github.com/vaadin/vaadin/ normally easier option modifying vaadin widget copying code of classes want modify in project, using same namespace, compiler use them because of classpath preference. remember have compile widgetset each time make modifications in client code. but recommended option extends classes involved in widget (server component, client classes) , use own widgetset implementation. have more info in book of vaadin: https://vaadin.com/book/vaadin7/-/page/clientside.widget.html