Posts

Showing posts from September, 2012

php - HTML table to pdf -

i generating class schedule out of sql queries concerning more 1 tables database. schedule displayed in html table on web page, along there 1 line details schedule besides table. want user able print information/ save in pdf format. how able ? i think php or html code not necessary answering this. thank in advance.. use tcpdf include("tcpdf.php"); $html = "html code"; $pdf = new tcpdf(); $pdf->addpage(); $pdf->writehtml($html)

c++ - System() call returns 255, but executes afterwards -

i running mongoose 3.7 server on qnx system. i receive http request upgrade firmware. on request, use, system() call in request handler upgrade firmware. but, strangely, system() returns 255. same call working before mongoose 2.0. even more strange, command issued through system() call works after returned 255. i using wexitstatus know error system() returns any idea why happening? i found issue.. the issue mongoose call thread issues system() command not wait return status becuase of line: on mg_start() function, starts server thread, have included line: mg_start() line no 5159: (void) signal(sigchld, sig_ign); they have done inorder not create zombie process. ref: http://www.win.tue.nl/~aeb/linux/lk/lk-5.html but, according qnx documentation, “setting signal action sig_ign signal that's pending causes pending signal discarded, whether or not blocked. if process sets action sigchld signal sig_ign , behavior unspecified.” c

Entity Framework with Model-First and Oracle -

i'm trying use entity framework model-first on oracle database. have installed odp.net , oracle visual studio tools file odtwithodac1120320_32bit.zip , version 11.2.0.3.20 . i made small test model, set connection string oracle db, changed code generation templates of model generate oracle via t4 (tpt).xaml , ssdltooracle.tt . code generations working, generated sql not usable: create table "dbo"."entity1set" ( "id" uniqueidentifier not null, "nvarcharproperty" nvarchar(max) not null ); neither uniqueidentifier nor nvarchar valid oracle keywords. furthermore, oracle handles schemas differently sql server, "dbo". stuff won't work. how handle that? changing sql after every code generation? are there other ways use ef oracle , model-first? looks model generated sqlserver , passed ssdltooracle.tt. ssdltooracle.tt file not check if dealing oracle specific storeitemcollection , uses gets results in ge

regex - Detect quoted strings in sql query -

i writing bash script using detect classes of strings in sql query (like upper-case, lowercase, numeric characters, etc...). before doing classification, want extract quoted strings. having trouble getting regex extract quoted strings query string. example, take query tpch benchmark: select o_year, sum(case when nation = 'japan' volume else 0 end) / sum(volume) mkt_share ( select extract(year o_orderdate) o_year, l_extendedprice * (1 - l_discount) volume, n2.n_name nation part, supplier, lineitem, orders, customer, nation n1, nation n2, region p_partkey = l_partkey , s_suppkey = l_suppkey , l_orderkey = o_orderkey , o_custkey = c_custkey , c_nationkey = n1.n_nationkey , n1.n_regionkey = r_regionkey , r_name = 'asia' , s_nationkey = n2.n_nationkey , o_orderdate between date '1995-01-0

c# - WebClient SSL Single Sign on Proxy -

i'm building ajax proxy page pull information ssl single sign on site. unfortunately feel i'm getting stuck. i've tried using webclient , httpwebrequest can't seem past initial page. i'm catch link click action , passing url of link proxy page. $("#frame").load("/proxyajax?url=" + serializeddata); and executing following code string redirecturl = server.urldecode(request.querystring["url"]); uri myuri = new uri(redirecturl); webclient wc = new webclient(); wc.headers.add("cookie", request.headers["cookie"]); vd.string = wc.downloadstring(redirecturl); have page i'm calling executing redirect , stuck somewhere between. ideas of how resolve this?

php - How do I setup a live data feed that will update tyre prices and stock? -

i have been asked create site mobile tyre business. want have online ordering system live data feed update prices of tyres , quantity on daily basis. my problem think can done php , mysql database don't know how populate/update mysql database data .csv spreadsheet. can me set up, or point me in direction of service me set up? it possible php , mysql. you can refer question explains reading csv , storing in mysql read csv file , store mysql database also following tutorials might useful. http://css-tricks.com/snippets/php/import-csv-into-mysql/ http://www.infotuts.com/import-csv-file-data-in-mysql-php/

HTML row fill vertical space -

just doing experiments html, wonder, why second line not fill remaining space. why table not stretched vertically? <table width="100%" border="1" height="100%"> <tr> <td align=center>line 1 </td> </tr> <tr height="90%" > <td>line 2 </td> </tr> </table> block elements, table being 1 of them, expand size of contents. 100% has no context in case. give value in numbers.

find date range containing today mysql join -

i have 2 tables, restaurants , orders, each restaurant has many orders restaurants table id name orders table id restaurant_id date status if date there no order - means there no row in orders table. if there order, status can 0, 1 or 2. each row in orders table represents 1 day. i need find restaurants that, between 2013-08-15 , 2013-08-25 (that includes current day - 2013-08-19 ) not have orders @ (which means there no appropriate row in orders table), or have order status 0 or 1, along these conditions order today should have status - 2. so, if restaurant not have order today or status not 2 - restaurant should not listed in result, if order today exists , status 2 result should contain restaurant orders list above-mentioned date range. by query result without part of today's condition. select r.`id`, r.`name` restaurants r left join orders o on r.id = o.restaurant_id , o.date between '2013-08-15' , '2013-08-25' o.id null or o.`status` = 0 or o.

php - Looking for advice/best practice on building objects from query results -

im going try best explain myself. not 100% sure how word this. have data in multiple tables like tbl_rooms tbl_tables tbl_people_sitting_at_table all these tables have there linking id's , want build "room" object , not query db in loops. right have pseudocode foreach ($rooms $room) { $room->tables = get_all_the_table_by_room_id($room->room_id); ..... foreach ($room->tables $table) { $table->people_sitting_at_table = get_all_the_people_by_table_id($table->table_id); what have work don't amount of queries required build object. heres example looking send back stdclass object ( [id] => 15 [room_name] => room_name [tables] => array ( [0] => stdclass object ( [id] => 34 [table_name] => table_name [people_sitting_at_table] => array ( [0] => stdclass object (

Durandal 2.0 Router - how to specify Id? -

i have working in durandal 1.2: durandal routing: mapping route id? { url: 'test', hash: '#/test', moduleid: 'viewmodels/folder', name: 'specific folder', visible: false, settings: { id: 2 } } however appears router no longer supports settings specification: http://durandaljs.com/documentation/conversion-guide/ how can achieved in 2.0? i don't think possible new router, unfortunately. however, if goal value activate method of viewmodel during navigation (which settings did), not need router that. assuming value isn't hard coded, determined something. make "something* available viewmodel, , call inside of activate method. as long you're going, right?

javascript - Getting parent class of a div when the div is rendered -

i have: <div class="foo"> <div class="bar"> </div></div> when "bar" rendered, i'd check if "bar" in "foo", , if so, class name is. what not working: <div class="foo"> <div class="bar"> <script type="text/javascript"> $(this).load(function(){ var parentclass= $(this).parent().attr('class'); }); </script> </div></div> if "bar" in "foo", want hide "bar", if not, display it, would: if(parentclass.indexof('foo') > -1) $(this).hide(); if "bar" in "foo", want hide "bar": just target child .bar of .foo ? $('.foo .bar').hide();

Java 2d array with Icon names -

do can fill 2d array icon file names this? im getting error says type mismatch: cannot convert string icon so question is, imposible fill 2d array icon file names, or made small error here? keep getting error on array. public icon cards[][] = {{"diamonds 2.png", "diamonds 3.png", "diamonds 4.png", "diamonds 5.png", "diamonds 6.png", "diamonds 7.png", "diamonds 8.png", "diamonds 9.png", "diamonds 10.png", "diamonds jack.png", "diamonds queen.png", "diamonds king.png", "diamonds ace.png"}, {"hearts 2.png", "hearts 3.png", "hearts 4.png", "hearts 5.png", "hearts 6.png", "hearts 7.png", "hearts 8.png", "hearts 9.png", "hearts 10.png", "hearts jack.png", "hearts queen.png", "hearts king.png&q

php - Incorrect Value Being Retrieved from the Database -

situation: created cron job. add orders entered customers api. set run after every 1 minute. problem: sometimes, when there many pending orders, second cron job being called before first 1 gets ended. resulting in duplicate orders sent through api. solution: created table named cron_jobs in database. has 2 columns, id , status. when cron job runs, checks whether status 0 or not. if status 0, updates status 1. completes process , marks status again 0. if status of job 1 (it means running), , hit again, operation terminated. unexpected trouble: solution seems logically correct. when implemented it, results shocking. when job run, status updated. when invoked again, database still returns status 0 , keeps on executing. have used sleep method have enough time investigate issue. database returns incorrect value can see using phpmyadmin. please no think might have committed stupid mistakes. second instance of file fetching incorrect value before first instance invoked. have @ co

php - Recursive function to get the parent caegory description -

i have created recursive function, , need parent category description , term_id of product. function desc_pro($parent) { $term = get_term_by('parent', $parent, 'product_cat'); $description = $term->description; while($description == null) { $desc = desc_pro($term->parent); return $desc; } return $description; } now when run code, correct description. if remove of return not work. shows blank. (this okay? think code wrong?) second: need term_id , when create array, send sub category ids well. wrong. need id has description. i think code wrong? or there other problem? this array me: (what send parent category php page. call function get_desc(48);) it give me first object, have test description available or not? if yes stop , return description , it's term_id. if not available grab parent id , check again. continues, until description found. stdclass object ( [term_id] => 48 [name] => cereal

python - Is NumPy Messing Up CX_Freeze? -

i'm trying run frozen python game i've coded error when try run exe. believe because of numpy i'm not quite sure. error: traceback (most recent call last): file "c:\python27\lib\site-packages\cx_freeze\initscripts\console.py", line 27 , in <module> exec code in m.__dict__ file "game.py", line 1, in <module> file "c:\python27\lib\site-packages\pygame\__init__.py", line 251, in <module> try: import pygame.surfarray file "c:\python27\lib\site-packages\pygame\surfarray.py", line 69, in <module> import pygame._numpysurfarray numpysf file "c:\python27\lib\site-packages\pygame\_numpysurfarray.py", line 48, in <m odule> import numpy file "c:\python27\lib\site-packages\numpy\__init__.py", line 147, in <module> core import * attributeerror: 'module' object has no attribute 'sys' does know whats going on here cause cant figure out? a

How does the Facebook "profile" access request provide age information? -

Image
i looking facebook docs on permission arrays, , understand in order obtain user's birthday information must explicitly requested via user_birthday . however, noticed app such 1 screencapped below not ask birthday information, vaguely asks "profile", , yet able obtain exact birthday in age (not age range). wondering how still accomplished? thanks! note translates following: @daspianist, i've put sample (based on fb's graph api sample app) app git at: https://github.com/brewmium/facebook-ios-graphexplorerqueryrunner.git you can ask permissions 1 one, on ios device, , run complex graph api queries generated from: https://developers.facebook.com/tools/explorer i wrote (heavily modified) because output web based explorer queries return different results when run on ios sdk. while @ it, wrote little permissions request interface, it's easy modify permissions testing queries (like on web version). when removing permissions, it's be

datasource - SSIS - one data file from two data sources -

is possible write data 2 data sources single flat file, 1 data flow? i have process 3 data flows - run sp record count. write dates , record count flat file. run sp again , write data flat file. is there more efficient way of doing this?

database - android and cloud data storage -

my application needs database. cheap in size implementation sqlite, 1 of friends told me can store db on cloud, if put db in cloud need internet service access db can store db cloud on device? when user can db cloud storage , automatically 'download' db cloud device run offline. assuming need images (pretty small) app effective? how? why? i looking @ www.parse.com store db. if data 'is cheap in size' saying, suggest keep within application. keeping dependency on internet unnecessary saying want run application in offline mode.

zeromq - What is the proper way to do multiple ZMQ publishers with IPC? -

i have zeromq pub/sub architecture in addition epgm, want able "broadcast" on ipc (thus avoiding sending messages off box when local pub/sub processes present). i've read on internet (and found through experience) multiple processes can't call bind on same ipc endpoint (e.g. "ipc:///tmp/myipc.ipc"), i've read it's possible have multiple publishers on same ipc endpoint. with said, "proper" way have multiple publishers on same ipc endpoint if multiple bind calls break things?

iphone - How to check if string in nsdictionary is null -

i'm working on twitter app , trying implement tweet location. want display name of country , display on map if tweet has location. whatever i've tried displays country of first tweet or if it's null app crashes. don't understand i'm doing wrong. can help? thank you! here's code: // location (nsdictionary *dic in self.datasource) { nsstring *str = [dic valueforkeypath:@"place.name"]; if(str) { cell.button.hidden = no; cell.location.text = [dic valueforkeypath:@"place.full_name"]; self.coordinates = [dic valueforkeypath:@"geo.coordinates"]; break; } else { cell.button.hidden = yes; cell.location.hidden = yes; break; } } and nslog output: 2013-08-20 00:04:42.269 twitterapplication[10011:c07] <null> 2013-08-20 00:04:42.269 twitterapplication[10011:c07] downtown 2013-08-20 00:04:

php - Database connection when using offline editing GIT project -

when working on project offline, checked out git repository, how manage database connection. i know set local copy of database seems sensible correct way manage switching between different connection details in code or there option i'm not considering?

php - How to set to database current date time in this form? -

the code working can't find code set date&time plz here code work in way? mysql_query("insert comments set name='$name', fb='$fb', msg_id_fk='1', date_time='$date', comments='$comments'") or die(mysql_error()); ` try code $today = date("f j, y, g:i a"); `

mysql - ERROR 1052 (23000): Column 'course_id' in where clause is ambiguous -

i'm new mysql please tell me if question missing information, i have query works fine: select au.email, sm.created, sm.grade, sm.max_grade auth_user au, courseware_studentmodule sm sm.student_id = au.id , course_id = 'mycourse' , sm.module_type = 'problem'; but when want add column different table: select au.email, sm.created, sce.created , sm.grade, sm.max_grade auth_user au, courseware_studentmodule sm, student_courseenrollment sce sm.student_id = au.id , sm.student_id = sce.id , course_id = 'mycourse' , sm.module_type = 'problem'; i error error 1052 (23000): column 'course_id' in clause ambiguous anyone know why? thanks this because column course_id present in more 2 tables. write sm.course_id or sce.course_id , work.

php - PDO Excute with multiple OR -

below code using dynamically load news articles web page. $dbconn->execute fires correctly when passing single where (select * newsitem subcategoryid=12 order posted desc) but fails return result when passing (select * newsitem subcategoryid=1 || subcategoryid=12 || subcategoryid=27 || subcategoryid=27 || subcategoryid=28 || subcategoryid=29 || subcategoryid=30 || subcategoryid=31 || subcategoryid=32 || subcategoryid=43 order posted desc) this code behind generates above queries: `$strhtml = ""; $strhtml .= ""; if(strpos($params['subcatid'], "|") < 0){ $q = "select * newsitem subcategoryid=".$params['subcatid']." order posted desc"; } else { $q = "select * newsitem "; $idarr = explode("|", $params['subcatid']); for($i = 0; $i < count($idarr); $i++){ $q .= "subcategoryid=".$idarr[$i]." || ";

android - java.net.URLEncoder.encode encodes space as + but I need %20 -

this question has answer here: urlencoder not able translate space character 11 answers as title says: encoder give me space %20 opposed + ? need android. java.net.urlencoder.encode gives + android has it's own uri class use. e.g. string url = uri.parse("http://www.google.com").buildupon() .appendqueryparameter("q", "foo bar") .appendqueryparameter("xml", "<hellö>") .build().tostring(); results in http://www.google.com?q=foo%20bar&xml=%3chell%c3%b6%3e uri encodes characters in given string '%'-escaped octets using utf-8 scheme. leaves letters ("a-z", "a-z"), numbers ("0-9"), , unreserved characters ("_-!.~'()*") intact. note: _-.* considered unreserved characters urlencoder . !~'() converted %21%7e%27%28%29

Eclipse doesn't run my project -

in eclipse tried run project ctrl + f11 (button run in menu checked). coming android device chooser, choose phone , wait app running. nothing happens. checked project, , works good, application running in phone. why happen? thanks. in eclipse @ out put console , logcat.

actionscript 3 - snapshot from webcam white border -

using flash, i'm talking picture user's webcam , saving image. the image ends white borders on right , bottom edges, however. i tried follow this solution , made white borders smaller, better, want them gone. here code draws white borders. vd1 = new video(); vd1.width = 400; vd1.height = 300; mycam = camera.getcamera(); mycam.setmode(400,300,15); vd1.attachcamera(mycam); var screenshot:bitmapdata = new bitmapdata(400,300,false); var m:matrix = new matrix(); m.scale(400/(mycam.width),300/(mycam.height)); screenshot.draw(vd1,m); i can like: m.scale(400/(mycam.width-40),300/(mycam.height-25)); to temporarily remove white borders, webcams, on macbook, doesn't work. how rid of these white borders? try capturing video @ other resolutions: mycam.setmode(320,240,15); i think want find "sweet spot" work nicely w/most web cams. default capture resolution 160x120. try resolutions multiples of this: 640x480, 480x360, etc. if tell flash pla

What does "@" mean in a C/C++'s macro? -

i cross-compiled firmware openwrt , , file strange named libbfd.h , compiling failed, have ever seen it. in libbfd.h line 83: 79 #define bfd_host_64bit_long @bfd_host_64bit_long@ 80 #define bfd_host_64bit_long_long @bfd_host_64bit_long_long@ 81 #if @bfd_host_64_bit_defined@ 82 #define bfd_host_64_bit @bfd_host_64_bit@ 83 #define bfd_host_u_64_bit @bfd_host_u_64_bit@ 84 typedef bfd_host_64_bit bfd_int64_t; 85 typedef bfd_host_u_64_bit bfd_uint64_t; 86 #endif here bfd_host_u_64_bit defined @bfd_host_64_bit@ , what's mean "@", tested in test file, can't compiling. me? thx! @variables@ replaced values during configuration on target system. see this page of autoconf manual . did typical: ./configure make to build it? should have constant values.

android - how to capture an image with camera and save in a folder -

in application need capture images , save them in folder option rename it. , sorry bad english ..... , tried not work, saves 1 image snap more photos, why? :d public class testpress extends activity { public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.prova); final string direct = this.getintent().getstringextra("key"); // todo auto-generated method stub button p = (button) findviewbyid(r.id.button2); p.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { intent camera= new intent(android.provider.mediastore.action_image_capture); uri urisavedimage=uri.fromfile(new file("/sdcard/cameratest/flashcropped.png")); camera.putextra(mediastore.extra_output, urisavedimage); startactivityforresult(camera, 1); } });

mongodb - Meteor: Relating Items -

i'm using meteor , mongodb, suggested documentation. coming relational database background, want understand strategies modeling data in nosql stores. the scenario have users , , each user has 1 vin . pretty standard , possible 1 collection. if want find highest vin display anonymous information purchased car, construct find like: users.find({}, sort: {vin_number: -1}) or there better way model it? if given user has more 1 vin ? in relational world, that's "has many" relationship. if embed array of vins in user document, how extract highest number. as can see, wrestling fundamental shift modeling things tables embedded documents. any appreciated, , (although know it's not way) i'd love pointers places gentle migration relational modeling patterns schema-less ones. you use transform highest vin list of vins: users.find({}, {sort: {vin_number: -1}, transform: function(doc) { doc.vin_number = _.max(doc.vin_number_array); return

c++ - Segfault caused by std::ostream::sentry in this overload of stream operator -

my goal overload << operator objects of param class printed appropriately standard out. the param class defined in globals.h , globals.cpp files. below these files, there main.cpp test program. further below 3 text input files myparam__lb , myparam__mid , , myparam_ub . put of these files same directory, , it's reduced-size version of real case in question. here backtrace real case: #0 0x00007ffff772811e in std::ostream::sentry::sentry(std::ostream&) () /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #1 0x00007ffff7728829 in std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long) () /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #2 0x00007ffff7728c0f in std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<cha

c# - removing text from richtextbox -

i have richtextbox1 , want remove "user1". below , if sentence starts alter table , consists "user1". best way using c# my text on richtextbox drop index xie2tbl_a; drop index xpktbl_a; alter table "course" drop constraint "crse_crse_fk"; alter table "enrollment" drop constraint "enr_stu_fk"; alter table "enrollment" drop constraint "enr_sect_fk"; alter table "enrollment" add constraint "enr_stu_fk" foreign key ("student_id") references "user1"."student"("student_id") enable; alter table "enrollment" add constraint "enr_sect_fk" foreign key ("section_id") references "user1"."section"("section_id") enable; alter table "grade" drop constraint "gr_enr_fk"; alter table "grade" drop constraint "gr_grtw_fk"; alter table "grade"

elisp - How to make a long word get displayed as a shorter word in an emacs buffer? -

i reading source of rainbow-delimiters.el , trying replace word rainbow-delimiters rd using code got somewhere replaces word lambda greek letter. this code came , doesn't want. (defun my-simplify-prefix (prefix) ;; (interactive "sprefix: ") (interactive (list "rainbow-delimiters")) (font-lock-add-keywords nil `((,(rx-to-string `(group ,prefix)) (0 (progn (compose-region (match-beginning 1) (match-end 1) "rd") nil))))) (font-lock-fontify-buffer)) what instead replaces rainbow-delimiters 1 letter combination of r , d. (defun my-simplify-prefix (prefix) (interactive "sprefix: ") (font-lock-add-keywords nil `((,(rx-to-string `(group ,prefix)) (0 (progn (put-text-property (match-beginning 1) (match-end 1) 'display "rd") nil))))) (font-lock-fontify-buffer)

css - Pixel in media query doesn't match my browser -

i'm adding media query asp.net webapp. i'm trying make webapp change , different based on different type of mobile phone. show codes of media query , weird problem received. /*media query*/ @media screen , (max-width: 1024px) { #homebutton input[type=image] { position:absolute; left:0%; top:0%; margin: 0px; height:1000px; width:50%; } } @media screen , (max-width: 800px) { #homebutton input[type=image] { position:absolute; left:50%; top:0%; margin: 0px; height:70px; width:50%; } } based on understanding, whenever browser has size between 801px - 1024px, run @media screen , (max-width: 1024px) code. , when browser has size of 0px - 800px, should run line of css code @media screen , (max-width: 800px) however, when try extend browser width 802px, homebutton still show size of homebutton in media query css 800px instead of 1024px. why so? code wrong itself, or misunderstanding of media query logic on part. hope can me on this. regards. try use 79

java - NullPointerException when dialog positive button onClick calls interface -

i'm trying use interface send click event alertdialog.builder.setpositivebutton's onclick event. please me out. i've been looking on similar problem use guidance. the npe @ line: mlistener.onsetbalancedialogpositiveclick(setbalancedialog.this); here logcat: 08-19 20:05:50.469: e/androidruntime(5795): fatal exception: main 08-19 20:05:50.469: e/androidruntime(5795): java.lang.nullpointerexception 08-19 20:05:50.469: e/androidruntime(5795): @ com.smb.allowance.setbalancedialog$2.onclick(setbalancedialog.java:75) 08-19 20:05:50.469: e/androidruntime(5795): @ com.android.internal.app.alertcontroller$buttonhandler.handlemessage(alertcontroller.java:159) 08-19 20:05:50.469: e/androidruntime(5795): @ android.os.handler.dispatchmessage(handler.java:99) 08-19 20:05:50.469: e/androidruntime(5795): @ android.os.looper.loop(looper.java:123) 08-19 20:05:50.469: e/androidruntime(5795): @ android.app.activitythread.main(activitythread.java:3683) 08-1

java - Wait for a key to be pressed inside loop -

Image
i have java application , want wait key pressed perform action. till have found: public void keypressed(keyevent e) { if (e.getkeycode() == keyevent.vk_right ) { //right arrow key code } } but want inside loop or waits until key matches. please help. update: i want program waiting until key pressed , when pressed want trigger action. example: public void something(){ //do wait until key pressed if( key pressed arrow key){ something(); }else{ wait key pressed } } public void dootherthing(){ //do other thing } i working in swing , don't want gui irresponsible. i.e. when call dootherthing click of button. should , waiting should over. swing (and guis) event driven environments. is, happens, react it. having loop waiting kind of action kind of counter intuitive (imho). generally speaking, should avoid keylistener s if can. have issues key focus. key bindings api has ways on come limitation. it allows register keystrok

php - How to make Joomla SEBLOD RTL? -

i'm using joomla 3.1.1. , came accross problem while using seblod extention. whate php code have use (template override) in order make website rtl ? take code example, need use in order make rtl ? websitename/templates/ seb_one /positions/mycontentname/content/ mainbody.php : <?php // no direct access defined( '_jexec' ) or die; ?> <p><?php echo $cck->renderfield('test'); ?></p>

QuickBlox custom table -- Create relation and getting related records on iOS -

how create relation between 2 custom tables ios sdk? do set parentid on qbcocustomobject create it? on rest doc there way multiple related records, how do quickblox ios sdk? there parentid field. how works: example have 2 entities: movies & comments. each comment has parentid=movieid. if delete movie - comments deleted also. to related records use extendedrequest param nsmutabledictionary *getrequest = [nsmutabledictionary dictionary]; [getrequest setobject:@"31212412a1269123" forkey:@"_parent_id"]; [qbcustomobjects objectswithclassname:@"comment" extendedrequest:getrequest delegate:self];

geospatial - Google maps and data storage -

i don't have understanding of big data libraries/spatial data. can demystify how google maps, bing maps (any maps) store data internally? if want image @ latitude 'x' , longitude 'y' @ zoom factor, how data stored efficient retrieval? also, there quite bit of information associated @ every point in cell, how data stored? links relevant pages or blogs of great help. thanks you can check out elasticsearch . open source search engine extensively used bigdata technologies. can perfrom geospatial queries on top of huge data in elasticsearch high efficiency.

python - How to extract the URL from this HTML tag? -

i'm trying urls id='revsar' html tag below, using python regex: <a id='revsar' href='http://www.amazon.com/altec-lansing-inmotion-mobile-speaker/product-reviews/b000edkp8u/ref=cm_cr_dp_see_all_summary?ie=utf8&showviewpoints=1&sortby=byrankdescending' class='txtsmall notextdecoration'> see 136 customer reviews </a> i tried code below, it's not working (it prints nothing): regex = b'<a id="revsar" href="(.+?)" class="txtsmall notextdecoration">(.+?)</a>' pattern=re.compile(regex) rev_url=re.findall(pattern,txt) print ('reviews url: ' + str(rev_url)) you try like (_, url), = re.findall(r'href=([\'"]*)(\s+)\1', input) print url however, i'd rather use html parsing library beautifulsoup task this.

javascript - How to change the option item when I click on the fist option label? -

i'm setting 7 option item on webpage. how change option item when click on fist option label? (image of code) ■option1 a, b, c □option2 (a:10, b:20, c:30) □option3 (a:15, b:25, c:35) ... □option7 (a:18, b:28, c:38) (result) in case of choosing button of option1 option2 ->10 option3 ->15 ... option7 ->18 (real codesample) selection of a, b, c <select name="preset" id="saveaccount3" type="submit" value="option1" /> <option value="a">a</option> <option value="b">b</option> <option value="c">c</option> </select> <ul id="measureid"> <li><label for="creditcardmonth">option2</label> <select id="measureidsize1" name="measure1" class="chkselect"> <option value="10&qu

php - How do I generate SVG qrcode with image? -

i have code generating qrcode in jpeg , png format want generate svg qrcode background image in php. using qrlib.php generating jpeg , png format. qrlib.php support svg, doesn't it? https://github.com/t0k4rt/phpqrcode require_once(__dir__.'/phpqrcode-master/qrlib.php'); echo qrcode::svg('hello');

qt - Create sub-directory and inserting file in it -

i've tried create folder , insert file in or create file in it. here code snippit: qdir dir; qstring filepath(qcoreapplication::applicationdirpath() + "/" + dir.mkdir("logs")+ "/" + "file.txt"); qfile* file = new qfile(filepath); qtextstream stream; stream.setdevice(file); bool check = file->open(qiodevice::writeonly | qiodevice::text | qiodevice::append); if(check) { stream << "....text....\n"; stream.flush(); file->close(); } delete file; there no error while compiling rather, creates folder without file in it. how can that? qstring filepath(qcoreapplication::applicationdirpath() + "/" + dir.mkdir("logs")+ "/" + "file.txt"); i suspect line, dir.mkdir("logs"), create directory , return true or false. not sure final path. i suggest following. if(!dir.mkdir("logs")){ //error return ; } qstring f

php - Why is isset($_POST['submit1']) equal to FALSE? -

this follow-up of question posted few hours ago ( php post method apparently not working ). code still not should, code , question have changed prefer post new question (also considering questions seem read after have been posted). i’ll try close earlier question (still new here). on question then: why is, in code given below, isset($_post['submit1']) equal false when tested? in other words, why $_post['submit1'] equal null? believe that’s need know. here code, consists of 2 files. file ‘form.php’ (copied literally jquery-site: http://www.visualjquery.net/category/ajax/jquery.post , see last example) contains following code: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jquery.post demo</title> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> </head> <body> <form action="formprocessing.php" name="formpje&quo

c++ - MultiByteToWideChar conversion -

i have visual c++ application on visual studio 9.0 . have built application using "unicode character set" character set . using windows api a2t conversions , multibyte characters(korean text) not getting converted correctly . saw code a2t , , using cp_thread_acp first parameter multibytetowidechar . when used cp_utf8 same api correct results . per comment cp_thread_acp mentions "current thread's ansi code page " not sure though have built code unicode character set why a2t function not use utf8 the "unicode character set" means windows apis use wchar_t , , communicate program using utf-16. if program uses "narrow" char strings, must perform conversion convert whatever character set input utf-16. "unicode character set" not cause interpreted utf-8.

PHP mail adds ';' to URL -

we got cronjob running in our mail server gives url code (of url) is: <a href=\"http://domain.com/?page=show_user&id=".$account->id."\">http://domain.com/?page=show_user&id=".$account->id."</a> when cronjob progresses , mail, url shows like: http://domain.com/?page=show_user&id;=1 so cron adds additional ; code don't want. i tried already: http://domain.com/?page&#61;show_user&id&#61; but still no succes, anyway 'strip' semicolon or prevent it? i think problem cron job tries handle &id html entity (which should end ";"). maybe should use html entities in html code, cron job recognize them. url should <a href=\"http://domain.com/?page=show_user&amp;id=".$account->id."\">http://domain.com/?page=show_user&amp;id=".$account->id."</a>

javascript - 307 redirect - mime type issue -

we have authentication procees in our application whenever server gets request client not authenticated (cookie missing) returns 307 response , client should redirected login page (which might on domain). i've bumped following problem: when delete cookie , main index.html page cached , open web page 307 first time when js file requested (there script tag in index.html). in case browser tries redirect , i'm getting following error: resource interpreted script transferred mime type text/html: "https://win-7-64-server:8443/cas-server/login?service=http://172.30.2.25:81%2f172.30.2.25%3a8182%2fshunra%2fcommon%2fjs%2flibs%2frequire%2frequire.js". this original javascript url: http://172.30.2.25:8182/shunra/common/js/libs/require.js obviously don't control redirect. ideas? edit: i thought problem , problem browser gets 307 http code , thinks javascrip file redirected while in reality want redirect entire website - ideas how that?

python - Weird error when importing matplotlib with eclipse -

when trying import matplotlib.pyplot in python console on eclipse, gives me error: object of type 'nonetype' has no len() but if import matplotlib.pyplot in console python offers, can imported successfully. have tried importing matplotlib.pylab, alias pyplot? , if still error eclipse syntax check, try run it.

Debugging DSP Application Remotly With GDB and QT Creator -

i have image processing application uses qt , ti video decoder example, runs on ti davinci, dm6446. i using qt creator , compile process gives me 2 binaries, 1 arm core, 1 dsp. dsp binary has extension of ".x64p". there no problem if start app directly target board.but if start using gdb on host, can see debug messages on arm side, however, crashes immediately, because not able open dsp binary. is there way debug arm+dsp application without using ti ccs or jtag device ? ok can see have 3 "apps" here main app arm side the codec the server dsp side if right can use linux os (if have virtual machine known child , parent has ubuntu can find @ ti website) run vm and build codec (make command) build server (make build_server command) build app (make command) hope help but wanna ask how can make using ccs, can build separate project dsp or arm wanna build whole system.. help me if can ...regards

Enum of days in Java with Calendar -

i know if there existing enum containing week days in java. i'm using calendar treat time logic didn't see (i create myself 'd rather use existing). saw threeten project it's still in alpha. since enum containing days of week trivial it's shown sun in enum documentation, thinking may exist. ideas ? you want new dateformatsymbols().getweekdays() .

php - Toggle function: Remember the position -

i used function toggle if refresh page, remember position of toggle. try use session can't find way update session (when user want see more or less). here code: <script language="javascript"> function toggle(showhidediv, switchimgtag) { var ele = document.getelementbyid(showhidediv); var imageele = document.getelementbyid(switchimgtag); if(ele.style.display == "block") { ele.style.display = "none"; imageele.innerhtml = '<img src="more.png"">'; }else { ele.style.display = "block"; imageele.innerhtml = '<img src="less.png">'; } } </script> <?php if(empty($_session["toggle"])){ $_session["toggle"] = 'show'; }?> <a id="imagedivlink" href="javascript:toggle('contentdivimg', 'imagedivlink')

Java Swing - Unable access jTable from different function -

i've created jtable per below: public void reftable(string jobno) { report rp = new report(); final string nojob = jobno; map<integer, string> jmap = rp.getreportinfo(jobno); map<integer, string> sortedmap = new treemap<integer, string>(jmap); string[] row = new string[sortedmap.size()]; integer[] no = new integer[sortedmap.size()]; string[] stat = new string[sortedmap.size()]; boolean[] dev = new boolean[sortedmap.size()]; string[] remark = new string[sortedmap.size()]; boolean[] rem = new boolean[sortedmap.size()]; string userremark[] = new string[sortedmap.size()]; tabsize = sortedmap.size(); int = 0; (integer key : sortedmap.keyset()) { no[i] = key; string []val = sortedmap.get(key).split("###"); if (val[0].trim().equals("dev")) { stat[i] = "fail";

android - Opening gallery as app programmatically -

i want open gallery when user presses button. code use this: intent resimgaleri = new intent(); resimgaleri.settype("image/*"); resimgaleri.setflags(intent.flag_activity_new_task); main.this.startactivity(resimgaleri); however, in code, when user presses button open gallery, android asks 'complete action using', want open gallery directly without asking. can following code: startactivity(new intent("com.android.gallery3d")); but i'm not sure if all devices use 'com.android.gallery3d' or not. possible or there other way that? not devices have com.android.gallery3d, while of them do. can query package manager intent action view mime type image/* list of activities. , through list find correct one. final intent = new intent(intent.action_view, null); i.settype("image/*"); final list<resolveinfo> apps = packagemanager.queryintentactivities(i, 0); if(apps != null) { for(resolveinfo info : apps) { if(

Generate a sequence in mysql -

i want enter value/sequence mysql field automatically. here sequence: 2342/abc/2013/08/01 the last 1 sequence 01 , 02 , 03 , , on. the rule when month changes in above month 08 when 09 want start sequence again 01 , 02 , on. i have table table1(id,user_name,sq_number) i use this insert table1('user_name') values('bill') it insert sequence automatically use before insert trigger, (below create sequence current date), add logic (it's not clear me). create trigger insert_processor before insert on table1 each row begin set new.sq_number = concat('2342','/','abc','/', date_format(now(),'%y/%m/%d')); end$$ if need unique sequence it's practice create table , use select in trigger.

c# - only get the src value -

i have in database field have tag. , lots of text.. for example: hey there.. whats up? <img src="http://cdn.theatlantic.com/static/infocus/ngpc112812/s_n01_nursingm.jpg" alt="" /> .. , photo!.. i need between src i tried : public string linkpiccorrect(string path) { //string input = "[img]http://imagesource.com[/img]"; string pattern = @"\<img>([^\]]+)\\/>"; string result = regex.replace(path, pattern, m => { var url = m.groups[1].value; // url here // return replace value return @"<img src=""" + url + @""" border=""0"" />"; }, regexoptions.ignorecase); result = "<img src='" + result + "'/>"; return result; } but i've got parsing error : exception details: system.argumentexception: parsing "\([^]]+)\/>" - referen

apache - Web - can't open index page -

i'm having prob. i've made website in easyphp, runs ok on localhost. problem came out after uploaded files on vps webserver, same prob. on webhosting. cannot open index.php file, everytime redirects me login.php - administration. without index.php or login.php web doesn't work @ all. content of index file simple, couple php script show content, function query sql... no redirection. thnks help the index.php supposed default file if access website without pointing specific file. may can try removing login.php (or rename login.php.whatever) , access website , see whether index.php invoked. if works, configuration in apache (or webserver) needs changed index.php etc. hope helps.

asp.net - How to open aspx page in internet explorer -

im using devexpress reportviever , report toolbar.find button cant work across browser because used activex can work internet explorer.my questons how aspx page open internet explorer?for example after redirection page open in internet explorer. thank of members you can't switch browsers between page navigation have no control on that. server serves content, browsing client side , limited same browser. if have use internet explorer have warn users when land in website/page.

arrays - ByteBuffer in java returning data when nothing is written to it, doesn't throw exception -

i have wrapper around bytebuffer class (because in code, underlying structure entity). want bytebuffer store fixed sized entries in , return null or throw exception if try read @ offset nothing written. i've written following code: private static final int size = 16; //bytes private static final int bbsize = 48 * size; bytebuffer blockmap = bytebuffer.allocatedirect(bbsize); byte[] readatoffset(final int offset) throws bufferunderflowexception, indexoutofboundsexception { byte[] dataread = new byte[size]; blockmap.position(offset); blockmap.get(dataread); return dataread; } void writeatoffset(final int offset, final byte[] data) throws bufferoverflowexception, indexoutofboundsexception, readonlybufferexception { if (data.length != size) { throw new illegalargumentexception("invalid data received"); } blockmap.position(offset); blockmap.put(data); } public sta