Posts

Showing posts from May, 2015

java - Error: the method getId() is undefined for the type List<Product> -

i have method create list of objects of class public list<product> initproducts(){ list<product> product = new arraylist<product>(); product prod = new product(product.getid(),product.getitemname(),product.getprice(),product.getcount()); product.add(prod); return product; } my product class is: public class product { int itemcode; string itemname; double unitprice; int count; /** * initialise fields of item. * @param name name of member of product. * @param id number of member of product. * @param price price of member of product. */ public product(int id, string name, double price, int c) { itemcode=id; itemname=name; unitprice=price; count = c; } public int getid() { return this.itemcode; } public string getitemname() { return this.itemname; } public double getprice() { return this.unitprice; } public int getcount() { return this.count; } /** * print details members of product class text...

c# - Hyperlink - content binding -

i have textbox user inputs uri. becomes navigateuri property of hyperlink, allowing user click on link open page. <!-- input textbox --> <textbox x:name="linkbox" width="175" text="{binding path=docref, mode=twoway}" /> <!-- hyperlink --> <textblock> <hyperlink datacontext="{binding elementname=linkbox}" navigateuri="{binding path=text}" requestnavigate="hyperlink_requestnavigate"> <textblock datacontext="{binding elementname=linkbox}" text="{binding path=text}" /> </hyperlink> </textblock> this works inputting whole (absolute) uri in textbox. however, user wants input 'document.extn' bit of uri, , have application prepend rest of resource (ie, ' http://www.example.com/ ' bit). how set base part of uri , append document reference (preferably in xaml)? came across hyperlink's ba...

php - MYSQL getting error when using correct syntax and also logged in as a restricted anonymous user -

i have searched on internet , asked several people @ work how resolve issue i'm ready give up... installed mysql on laptop can't log in user. raymunds-macbook-pro:~ raymundsinlao$ /usr/local/mysql/bin/mysql welcome mysql monitor. commands end ; or \g. mysql connection id 2149 server version: 5.6.13 mysql community server (gpl) copyright (c) 2000, 2013, oracle and/or affiliates. rights reserved. oracle registered trademark of oracle corporation and/or affiliates. other names may trademarks of respective owners. type 'help;' or '\h' help. type '\c' clear current input statement. mysql> -u root -p; error 1064 (42000): have error in sql syntax; check manual corresponds mysql server version right syntax use near '-u root -p' @ line 1 mysql> when try login tells me syntax wrong. have tried ton of different possible ways , doesn't work. my other problem anonymous user can't access databases other information_schema , test....

testing - How to mock Perl module Time::HiRes -

there great perl module time::hires . heavily use in library , want write tests. have found 2 cpan modules mocks perl time() function, both of them don't support time::hires : time::mock test::mocktime how can mock time::hires sub gettimeofday() ? ps want fix tests module time::eta . use ugly hack sleep "mock", sometimes works , not . you can write own module with blackjack , hookers mock gettimeofday. modifications of test::mocktime wrote: #!/usr/bin/perl package mymocktime; use strict; use warnings; use exporter qw( import ); use time::hires (); use carp; our @fixed = (); our $accel = 1; our $otime = time::hires::gettimeofday; our @export_ok = qw( set_fixed_time_of_day gettimeofday restore throttle ); sub gettimeofday() { if ( @fixed ) { return wantarray ? @fixed : "$fixed[0].$fixed[1]"; } else { return $otime + ( ( time::hires::gettimeofday - $otime ) * $accel ); } } sub set_fix...

css - Magento Grid - Products Collapsed Vertically -

i have added many products in magento site when user clicks on category products more 3 items collapsed vertically, can 1 suggest me solution? http://onlyresult.com/ec/mag2/mag/index.php/keyboard.html?limit=9 thanks in advance.

I can't add new options to "select" element using jQuery -

i have mvc application , there's view javascript code. data service , return json string (not object). here'e controller code: public jsonresult getdatatableasjson() { return json(mobileserviceclient.getallcashdesks(), jsonrequestbehavior.allowget); } the javascript code in view: $.ajax({ ... html.push('<select id="options">'); html.push('</select>'); $.ajax({ url: hostname + 'search/getdatatableasjson', contenttype: "application/json; charset=utf-8", datatype: "json", crossdomain: "true", async: false, success: function (data1) { var dt = json.parse(data1); $.each(dt, function(key, value) { $('#options').append($("<option></option>").attr("value", value.cityname).text(value.cityname)); ... what happen? list empty, there should items...

performancecounter - DTLB miss number counting discrepency -

i running linux on 32-nm intel westmere processor. have concern seemingly conflicting data on dtlb miss numbers performance counters. ran 2 experiments random memory access test program (single-threaded) follows: experiment (1): counted dtlb misses using following performance counter dtlb_misses.walk_completed ((event 49h, umask 02h) experimt (2) counted dtlb misses summing following 2 counter value mem_load_retired.dtlb_miss (event cbh, umask 80h) and mem_store_retired.dtlb_miss (event 0ch, umask 01h) i expected output of these experiments similar. found numbers reported in experiment (1) twice of in experiment (2). @ loss why case. can shed light on apparent discrepancy? thanks arka that expected since first event counts number of misses tlb levels caused possible reasons (load, store, pre-fetch), including memory accesses performed speculatively, while other 2 events count retired (that is, non-speculative) load , store operations, , among them didn’...

symfony - Does anyone know how to add popup window in sonata admin for create/add route? -

does know how add popup window in sonata admin create/add route? if need add more categories while creating item, there should button "add new" along category selection box, when click on "add new" should appear popup window add new category. you should @ documentation regarding types provides sonata admin bundle : the sonata_type_collection should asked. ref : http://sonata-project.org/bundles/doctrine-orm-admin/master/doc/reference/form_field_definition.html#advanced-usage-one-to-many

sql - MySQL trigger to delete old record and insert new one -

i have table below table name: sda_user_eform_data ack_no name description 1 name1 name1 2 name2 name2 3 name3 name3 i have table sda_user_eform_data_bckup has same structure sda_user_eform_data. want store 5 rows(latest rows) in sda_user_eform_data , whenever ackno greater 5 old values should moved second(sda_user_eform_data_bckup) table. for first have copied rows sda_user_eform_data table sda_user_eform_data_bckup table. have created following trigger have checked ack_no , if greater 5 deleted oldest ack_no , insert new value bckup table. delimiter $$ create trigger 'copy_eform_data' after insert on asdb.sda_user_eform_data each row begin if (select count(s.ack_no) asdb.sda_user_eform_data s)>5 delete asdb.sda_user_eform_data old.ack_no=(select min(s.ack_no) asdb.sda_user_eform_data s); insert asdb.sda_user_eform_data_bckup select * asdb.sda_user_eform_data ack_no=select max(s.ack_no) asdb.sda_user_eform_...

java - Definition TableModel removeRow() method -

this question has answer here: tablemodel removerow() definition [closed] 1 answer this tablemodel: public class d9 extends abstracttablemodel { arraylist<string> cols = new arraylist<>(); arraylist<arraylist<string>> data = new arraylist<>(); public d9() { ... int c = resultset.getmetadata().getcolumncount(); while (resultset.next()) { arraylist<string> eachrow = new arraylist<>(); (int = 1; <= c; i++) { eachrow.add(resultset.getstring(i)); } data.add(eachrow); } ... } @override public int getrowcount() { return data.size(); } @override public int getcolumncount() { return cols.size(); } @override public object getvalueat(int rowindex, int columnindex) { arraylist<string> selectedrow = data.get(rowindex); return selectedrow.ge...

javascript - Regex error on Visual studio? -

Image
i'm using url regex rfc-3986 and written here : ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))? it working me here but when add under visual studio , see : and chrome developer toolbar shows me : what doing wrong ? p.s. thought there maybe hidden chars - pasted in cmd , re-copied , still.... escape occurrences of / \/ . then, vs not complain. var basicregexpatterns = { urlpattern: /^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/i }; see escaping forward slash in regular expression .

vb.net - Calling a method inside the class from a method list -

ok have class this public notinheritable class helper private function a(a string) boolean return true end function private function b(a string) boolean return true end function end class now want call string name want get list of methods inside of instantiated object of class (if can returned array fine) dim h new helper() 'so list '[0] - '[1] - b and want acquire name of 2nd method(which method b ) , call using name dim methodobj methodinfo methodobj = type.gettype("common.validation.helper").getmethod(returnafunction(1)) methodobj.invoke(new helper(), params)) is possible? if not how can make closer on want? thanks given instance h : dim h new helper() you can use getmethods() : dim yourprivatemethods = h.gettype() _ .getmethods(bindingflags.nonpublic or bindingflags.instance) _ .where(function(m) not m.ishidebysig) _ .toarray...

android - Rotate text when drawing it on a bitmap -

i want rotate text 180 degrees when drawing on bitmap. bitmap rotated there nothing else drawn on other text. isn't clear me though should using in code below rotate text: imageview, canvas, paint, bitmap??? imageview ivimage = (imageview)findviewbyid(r.id.ivimage); displaymetrics metrics = getresources().getdisplaymetrics(); int width = metrics.widthpixels; int height = metrics.heightpixels; bitmap.config conf = bitmap.config.argb_8888; bitmap bitmap = bitmap.createbitmap(width, height, conf); canvas canvas = new canvas(bitmap); paint paint = new paint(paint.anti_alias_flag); paint.setcolor(color.red); paint.settextsize((int) (200 * 1)); // draw text canvas center rect bounds = new rect(); paint.settextalign(align.center); string text = "help"; paint.gettextbounds(text, 0, text.length(), bounds); int x = bitmap.getwidth() / 2; // (bitmap.getwidth() - bounds.width())/2; int y = bitmap.getheight() / 2; // (bitmap.getheight() +...

android - Row from Database Cant be Display -

for many times, have encountered problem , need help. im trying id data activity , pass activity, , works. problem there no error data id, passed second activity wont show. here first activity : lv.setonitemclicklistener(new onitemclicklistener() { public void onitemclick(adapterview<?> arg0, view arg1, int arg2,long arg3) { // intent newi = new intent(this,pdetail.class); intent newi = new intent (create.this, pdetail.class); newi.putextra("value", arg3); startactivity (newi); // db.getlist(arg3); }}); and here second activity : public void get() { bundle bundle = getintent().getextras(); long count = bundle.getlong("value"); textview xview; //toast.maketext(getapplicationcontext(), count, toast.length_short).show(); xview = (textview) findviewbyid(r.id.textview1); //xview.settext("number: " + count); db.open(); cursor z = db.getlist(count); z.movetofirst(); string = z....

javascript - Auto highlighting part of word -

Image
i'm trying build "search in shown elements" function jquery , css. here's got far: http://jsfiddle.net/jonigiuro/wtjzc/ now need add little feature , don't know start. basically, when write in search field, corresponding letters should highlighted in list (see screenshot, blue highlighted part) here's script far: var filterparticipants = function(options) { this.options = options; this.participantlist = []; this.init = function() { var self = this; //generate participants opbject for(var = 0; < this.options.participantbox.length ; i++) { this.participantlist.push({ element: this.options.participantbox.eq(i), name: this.options.participantbox.eq(i).find('.name').text().tolowercase() }) } //add event listener this.options.searchfield.on('keyup', function() { self.filter($(this).val()); }) ...

html - How to Count XSL Nodes? -

Image
i have nodes generated after automation run xsl file need count (testcases - passed , failed) in suite node structured appear in below image this link have xsl file https://sites.google.com/site/feras13545646/report.xsl?attredirects=0&d=1 you need use count function within xsl file count number of nodes contain particular value, in case count how many times "pass" or "fail" appear. example snippet below: <table border='0' width='100%'> <tr><td><b>total tests passed:</b></td><td><xsl:value-of select="count(path/to/testresult[value = 'pass'])"/></td></tr> <tr><td><b>total tests failed:</b></td><td><xsl:value-of select="count(path/to/testresult[value = 'fail'])"/></td></tr> </table> the main node in here below: <xsl:value-of select="count(pa...

applescript - How to detect if user is away in OSX? -

i want start script when user goes away or returns computer. there built-in method in applescript check user's state? if not else can use in osx? here's command might work you. tell how long it's been since mouse moved or keystroke pressed. set idletime shell script "ioreg -c iohidsystem | awk '/hididletime/ {print $nf/1000000000; exit}'" so might assume if no key pressed or mouse moved period of time user not using computer. clever tracking of idletime can tell when user left computer , when returned. this. save applescript application , check "stay open after run handler" checkbox. can quit time right-clicking on dock icon , choosing quit. global timebeforecomputerisnotinuse, computerisinuse, previousidletime on run set timebeforecomputerisnotinuse 300 -- 5 minutes set computerisinuse true set previousidletime 0 end run on idle set idletime (do shell script "ioreg -c iohidsystem | awk '/hididletim...

vb.net - How to capture mouse right click paste function in Winforms -

i know how capture right click , paste option through mouse click. winforms application. modifying contents of clipboard before pasting. able perform through ctrl+v not able find way handle mouse right click. i have tried far: private const wm_paste integer = &h302 protected overrides sub wndproc(byref msg message) if msg.msg = wm_paste andalso clipboard.containstext() clipboard.settext(clipboard.gettext().replace(vbcrlf, " ")) end if mybase.wndproc(msg) end sub you have process wm_paste windows message using wndproc (a list of messages can found here ). for example, textbox print text pasted (no matter how) console instead of displaying itself: class capturepastebox inherits textbox protected overrides sub wndproc(byref m message) if m.msg = &h302 andalso clipboard.containstext() dim text = clipboard.gettext() '' text console.writeline(te...

jquery - absolute position issue on Chrome 28.0.1500.72 -

for reason re elements on homepage shifting page 25px. browser happens in google chrome version 28.0.1500.72. every other browser fine. is there way can check if user on version , change styles version only? the code fine know it's wrong browser version, jquery way can think of can resolved type of jquery function: var browser = // ever browser ; if(// browser version ...){ $(".example").css('top', '25px'); } thanks in advance answers, has been irritating it's literally version. works in ie6 through 10. i see on fiddle, think else, you: if(navigator.appversion.match(/chrome\/28.0.1500.72/))

how to animate marginTop of a div with click -

i want animate div marign-top property.initially set margin-top:10%.on click reduce margin-top 5% , reveals next div content(with toggle()). #login { margin:10% auto; ...... } $("#login").click(function() { $( "#outer_wrapper" ).toggle( "clip",300); $("#login").animate({margintop:'5%'}); } that works fine.but how initial "margin-top:10%" when clicked "#login" again? in css3, can common animation transition properties. example .test{ -webkit-transition: .5s ease; -moz-transition: .5s ease; } and directly set margin top style of element (as using jquery) $('.test').css('margin-top','5%'); then apply animation automatically. 'linear' animation can take effect on css changes such width, height, background color, etc.

jasper reports - Dynamic row counter -

i'm trying create dynamic row number in ireport there way create variable changes according following rules: -increments according row number -stops incrementing if field of type (e.g. xxx in example below) i.e. ------------------ s/n  fieldtype  amount  cost ------------------ 1     zzz           123         $34 2     yyy           111         $85 2     xxx           222         $24 3     yyy           111         $66 4     zzz...

gwt - Google Not Indexing AJAX URLs -

i have submitted sitemap ajax web application google via webmaster tools. submitted urls of form: http://www.mysite.com/#!myscreen;id=object-id http://www.mysite.com/#!myotherscreen;id=another-id however, though more week has passed since sitemap submission, google has not indexed urls. google states sitemap has been processed, states 60 urls have been detected, states no errors occurred, not index of urls. i have implemented ajax crawlability contract on server side, requests containing _escaped_fragment_ responded snapshot. any help/info regarding why google not indexing urls appreciated. see gwt se friendly application suggestions include following guide @ http://code.google.com/web/ajaxcrawling/ .

android - Get dimension of screen area used by activity -

how determine dimensions (width , height) of activity during oncreate. dimension must not of entire screen of area used activity. few methods tried posted on end giving device's maximum screen sizes. have tried (not oncreate): activityrootview = findviewbyid(r.id.yourrootview); activityrootview.getviewtreeobserver().addongloballayoutlistener(new ongloballayoutlistener() { @override public void ongloballayout() { //activityrootview.getheight(); //... } } }); and ofcourse, activitys main layout has match parent or fill content

How to run multiple Scripts one by one in a powershell script -

i have 8 scripts in powershell run 1 one. let's call scripts: script1.bat, script2.bat, .., script8.bat . now need script runs scripts.bat 1 one, not simultaneously. , there way check, if each script successful? ./script1.bat ./script2.bat ./script3.bat ... you'll picture, guess. run them in sequence. determine whether sucessful or not depends on how batch files signal errors or sucessful completion. if exit exit /b 234 or similar on error can use $lastexitcode or $? determine that. whether changes made batch files done, of there no other way of figuring out whether sucessful.

c# - Datareader, not all paths returns a value -

i want make function returns string: public string lienbasedeconnaissance(string entreprise) { sqlconnection cnx = new sqlconnection("/* connection string */"); cnx.open(); sqlcommand requeteexiste = new sqlcommand("sp_sel_lien_baseconnaissance_extranet_client", cnx); requeteexiste.commandtype = commandtype.storedprocedure; sqlparameter parameter = requeteexiste.parameters.add("@nom_entreprise", sqldbtype.nvarchar, 15); parameter.value = entreprise; string lienbaseconnaissance; sqldatareader _readerlines = requeteexiste.executereader(); while (_readerlines.read()) { if (_readerlines["parstrp1"].tostring() != null) { lienbaseconnaissance = _readerlines["parstrp1"].tostring(); return lienbaseconnaissance; } else { return null; } } cnx.close(); } i select data stored procedure , return string . pr...

php - Get array elements dynamically based on checkbox checked? -

i've got problem can't solve. partly because can't explain right terms. i'm new sorry clumsy question. below can see overview of goal. i have products along check boxes.if checked check box index value should store in new array(should perform push() operation here),if in case again unchecked check box means should perform pop() operation. <form method="post"> <input type="checkbox" name="options[]" value="politics"/> politics<br/> <input type="checkbox" name="options[]" value="movies"/> movies<br/> <input type="checkbox" name="options[]" value="world "/> world<br/> <input type="submit" value="go!" /> may 1 duplicate question give me sorry any ideas ? you're using check-boxes, can't use pop, since might unchecked in different order. so maybe use jquery store link javascr...

C# Application.ExecutablePath on WPF Framework 3.5 -

this line fine in winform framework3.5 not in wpf framework3.5. path.getdirectoryname(application.executablepath); how can exe path on wpf app ? there several ways exe path. try next: application.startuppath path.directoryname(environment.getcommandlineargs()[0]) path.directoryname(system.diagnostics.process.getcurrentprocess().mainmodule.filename) path.directoryname(assembly.getentryassembly().location) system.reflection.assembly.getentryassembly().location

ruby - rails validation regular expression for www and http -

i want validate form input http:// , www not allowed. regex work? for example: allowed google.com not allowed www.google.com http://google.com http://www.google.com model valid_domain_regex = ??? validates :domain, format: { with: valid_domain_regex } since http:// contains many forward slashes, use ruby's %r{} regex literal syntax. def has_forbidden_prefix?(string) string =~ %r{^(http://|www)} end this return nil, falsy, if string not start http:// or www . it return 0, truthy (the offset of first match) if string does. you can use validate :some_method_name call custom validation method in model, structure follows model mything validate :no_forbidden_prefix private def has_forbidden_prefix?(string) string =~ %r{^(http://|www)} end def no_forbidden_prefix if has_forbidden_prefix?(uri) errors.add :domain, 'the uri cannot start "http://" or "www"' end end end

javascript - CSS by data-attribute will not refresh/repaint -

in html5/js application have view styles depending on data-attribute of elements: like <li data-level="0"></li> or <li data-level="1"></li> css li[data-level^="1"] { /* styles */ } this seems work fine everywhere on page reload . but when data-attribute set programmatically via js, css properties rendered in relevant desktop browsers, not in mobile safari. js part looks this: this.$el.attr('data-level', this.model.getlevel()) any ideas on how force apply properties (refresh/repaint something) ? i avoid using class attribute , different classes things more complex shown here... ok, changing data attributes doesn't seem trigger redraw of element in browsers !? changing class attribute does. kind of workaround, trick. this.$el .attr('data-level', this.model.getlevel()) .addclass('force-repaint') .removeclass('force-repaint'); as see...

sql server - SQL Merge statement not working in Stored Procedure -

the following code not seem work. if address not exist, not insert new record. however, if address exist, updated. alter procedure [users].[updateaddress] @userid int, @address1 varchar(100), @address2 varchar(100), @town varchar(100), @county varchar(50), @postcode varchar(50), @country varchar(50), @type int merge [users].[addresses] target using (select userid [users].[addresses] userid = @userid) source on (source.userid = target.userid) when matched update set target.address1 = @address1, target.address2 = @address2, target.town = @town, target.county = @county, target.postcode = @postcode, target.country = @country when not matched target insert ([userid], [address1], [address2], [town], [county], [postcode], [country], [modified], [type]) values(@userid, @address1, @address2, @town, @county, @postcode, @country, getdate(), @type); you're source shouldn't rely upon target table. try instead: ...

configure - common.gypi not found error in node.js -

i trying "node-gyp configure" try ms sql server driver. however, said binding.gypi missing or effect. saying common.gypi not found. created text document relabelled common.gypi , pasted code file common.gypi found in github repository file , saved , closed , ran "node-gyp configure". output. d:\node\sqlserverconnector\node-sqlserver-master>node-gyp configure gyp info worked if ends ok gyp info using node-gyp@0.10.6 gyp info using node@0.10.15 | win32 | ia32 gyp info spawn python gyp info spawn args [ 'c:\users\suresh\appdata\roaming\npm\node_modules\n ode-gyp\gyp\gyp', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'msvs', gyp info spawn args '-g', gyp info spawn args 'msvs_version=auto', gyp info spawn args '-i', gyp info spawn args 'd:\node\sqlserverconnector\node-sqlserver-master\buil d\config.gypi', gyp info spawn args '-i', gyp info spawn args ...

iphone - Change Current Location from within the app -

i stuck in problem user current location. i have app in show events occur near of user current location. fine till have implement functionality change city. if change city near events change respectively. want know able change current location within app. or in other words can change location in settings of phone within app. suggestion helpful. thanks you can't change current location settings. if want save selected city current location save selected city's longitude , latitude , pass current location method gets near events should work current location. you can save selected city lat n long in preference file (or .plist). , when location updates can check if user have selected city pass lat , long of selected city otherwise current location lat long. easier you. hope helps!!

git - Selectively importing other people's pull requests in your own Github fork -

ok haven't find better way title question. explaining scenario easier. remember this github question , not prototype-js question (please don't add tag me) the scenario i'm working on prototype-based web application. found 1.7.1 (no blame author) has few bugs annoying us. these bugs have, fortunately us, publicly available fix through pull request has been accepted master branch. my boss , discussed choice between patching prototype 1.7.1 each incompatibility find , agreed using "development" version in soon-to-be production application not best choice, our idea patch our version of prototype. i responsible this. since want track changes company applies prototype (even if i'm who'll touch js file), want in efficient way can left posterity. github allows fork project own workspace can play as wish. keep track of patches import prototype linking them existing pull requests made original project. the general question given generic open sourc...

jquery - elastislide move one at a time -

i'd move 1 image @ time elastislide plugin put can't figure out. read on plugin comments can change line 295 this: var amount = this.fitcount * this.itemw, val; this: var amount = this.itemw; code has been updated since post in 2012 , no longer works. can please me. update code : var amount = this.fitcount * itemspace; to var amount = 1 * itemspace;

c - Is it possible to link against a Windows .dll+.lib file combination using gcc/g++ under Cygwin? -

i know how link against libraries in unix-ish contexts: if i'm working .a or .so files, specify root search directory -l/my/path/to/lib/ , libmylib add -lmylib . but if have a .dll (e.g. in windows\system32 directory)? a .dll (in windows\system32 ) , .lib (someplace else)? these dlls other party; don't have access sources - have access corresponding include files, against manage compile. if can link against .lib in cygwin or mingw, can (indirectly) link against dll. in msvc world, not unusual create import library along dll. static library ( .lib ) loads dll , wraps interface of dll. call wrapper functions in (static) import library , let import library dll-related things. for windows api, there import libraries in windowssdk. for own msvc dlls, msvc can automatically generate import libraries when build dll. for third party dll, can build static wrapper library based on corresponding header files. linking against .lib file in cygwin ...

Different PHP and MySQL date time -

i facing issue regarding date time returned php , mysql . checked php date, using echo date("y-m-d h:m:s"); it returned 2013-07-31 01:07:37 then executed query in mysql console(phpmyadmin/sqlyog) query select now() date_time it resulted 2013-07-31 15:40:36 firslty want both should result dame date time, secondly how can set 1 of them match other one. note: checked on local , live server both apart typo in format codes, seems mysql , php not configured use same time zone. how find out? in mysql : mysql> select @@session.time_zone; +---------------------+ | @@session.time_zone | +---------------------+ | system | +---------------------+ 1 row in set (0.00 sec) (in example, system means "the time zone of host machine".) in php : <?php echo date_default_timezone_get(); // europe/madrid

python - Pymunk Memory leak and/or Hangs -

i've been writing game in python requires being able add , remove lot of objects physics engine. in extreme testing scenarios can run out of memory seconds. in normal cases take while accumulate. after 2 days of work found small test scenario displays whats happening. platform windows 7 64x. import pymunk import time os import system space=pymunk.space() width=5 height=5 poly=[(-width/2.0,-height/2.0),(-width/2.0,height/2.0),(width/2.0,height/2.0),(width/2.0,-height/2.0)] while(true): #time.sleep(.5) # system("pause") bodys=[pymunk.body(mass=5,moment=pymunk.moment_for_poly(5, poly)) in range(200)] #num of objects here print "1" shapes=[pymunk.poly(bod, poly) bod in bodys] print "2" space.add(bodys) print "3" space.add(shapes) print "4" space.step(.5) #step has no effect on leak print "5" space.remove(space.bodies) print "6" space.remove(space.shape...

animation - Which Method invoked whenever the marker is detected in MetaIO SDK -

i newbie augmented reality(ar) i using metaio sdk unity, planning play animation when model loaded. idea have animation played whenever metaioman set active. i've searched in google , unable help. please guide me have animation played whenever 3d object seen thank you

Google maps API v3 user interface -

Image
i have small stylistic problem in google maps. i using google maps api v3 , problem left slider looks this: i can't understand why or searched web didn't made changes map config how did happen. should this: you need check css / stylesheets , rule interfering map layout. what describe here happened me because of rule defined in component of bootstrap framework ( http://getbootstrap.com/ )

android - org.apache.cordova.api doesn't exist. PhoneGap 3.0 -

i'm trying add videoplayer plugin ( https://github.com/macdonst/videoplayer ) phonegap android app. while compiling problem: videoplayer.java:25: error: package org.apache.cordova.api not exist" line 25: import org.apache.cordova.api.cordovaplugin; change import to: import org.apache.cordova.cordovaplugin;

networking - ping with tcpflow and tcpdump -

when use tcpflow icmp , ping have no answer, when use tcpdump icmp aand ping i'm getting answer. wrong tcpflow configuration or should that? when use tcpflow icmp , ping have no answer uh... how this: tcpflow captures data tcp connections , icmp messages (e.g., pings & etc) not part of tcp connections.

sass - How do you handle compiled files from pre-processors in git commits? -

we meta languages sass/scss, less, coffeescript, etc. when comes git commits there 1 question: should compiled files source files repo or better ignore them? problem is, when ignoring files, 1 not use repository out of box. you've compile first (to right location) before using it. kinda bad way, because not using pre-processors. how deal it? git used source-tracking system, , such meant use developers of project. people development on project need able build source files generated files. in case not having generated files in repository doesn't impose additional burden on them. to useful end-users, may want periodic releases of project. these typically done archives of necessary files. include generated files, , quite-possibly exclude source files. end-user git seen unnecessary tool. including generated files in repository doesn't either of class of people, , makes more difficult see being changed each commit.

html5 - jQuery (or CSS3) Switch between content sections on scroll -

i hope can point me in right direction. i replicate navigation, similar 1 on website: http://vsamarehorosho.ru/ basically, idea don't allow user have different sections of website on screen @ same time. so, if section larger screen scrolls until reach bottom of section. if scroll further, jump onto next section. if section smaller screen size, see main section @ top , part of next section down bottom, when try scroll, next section jumps top , 1 after shows down bottom if 1 smaller screen size. on example, slides 100% height, that's not achievable. hope can me. wrap sections in div height of 100%; this way, if section under 100% height, wrapper ensure 1 sections shows on page. if section height on 100%, scrolling can occur on wrapper, rather on page.

How to assign a PHP variable value to JavaScript variable -

in code posting have 1 problem. want php variable stored in javascript variable shows error. code below. <?php $name="anurag singh"; echo ' <html> <head> <script type="text/javascript" src="jquery-2.0.2.js"></script> <script type="text/javascript"> $(document).ready(function(){ var name1=.$name.";" $.post("main_page.php",{input1: name1}, function(msg){ alert("hi "+msg); }); }); </script> </head> <body> <h1>this demo!</h1> <h2>in echo can add more 1 statements</h2> </body> </html> '; ?> now when assigning $name variable name1 syntax error. please let me k...

knockout.js options binding not reflecting added item -

the page shows original list of advisers properly. however, when attempt use push() method array, list size updates, select option list on page not update. need tell knockout update or something? here sample code: function updatestudentadviserlist(student) { var list = viewmodel.studentadvisers(); if (student.isstudentadviser() == "true" || student.isstudentadviser() == true) { var alreadyinlist = false; (var = 0; < list.length; i++) { alert(list[i].id); if (list[i].id == student.id()) { return; } } list.push(student); alert('new size: ' + list.length); } else { (var = 0; < list.length; i++) { alert(list[i].id); if (list[i].id == student.id()) { list.splice(i, 1); alert('new size: ' + list.length); break; } } } } function viewmodel(da...

c# Oracle Dynamic Connection string solution -

i have application connects specific oracle user & database data provided user through 1 little form. user inputs username, password , host address , can connect user defined locally, in oracle client's file: tnsnames.ora. works fine, have problem when designing reports devexpress (or other reports designer tool) same application. all devexpress reports communicating database tables through dataset uses fixed, hardcoded values defined in connection string in app.config. the problem can't have hardcoded values connecting database, because user can every time enter different values , connect different user on database, through little connection form, when application running. know best way deal this? i don't know, maybe replacing connection string in app.config every time when user inputs connection data? you have static connection string reports , separate 1 oracle db/user connection.

ios - Too much boiler plate code - Methods -

i have simple uiviewcontroller 9 uiimageviews . when each uiimageview pressed method (or function) called. works fine problem have boiler plate code now. in viewdidload method have 9 uitapgesturerecognizer detect when of 9 uiimageviews pressed. call method run. here code: uitapgesturerecognizer *tap1 = [[uitapgesturerecognizer alloc] initwithtarget:self action:@selector(imagepressed1:)]; [picview_1 addgesturerecognizer:tap1]; uitapgesturerecognizer *tap2 = [[uitapgesturerecognizer alloc] initwithtarget:self action:@selector(imagepressed2:)]; [picview_2 addgesturerecognizer:tap2]; uitapgesturerecognizer *tap3 = [[uitapgesturerecognizer alloc] initwithtarget:self action:@selector(imagepressed3:)]; [picview_3 addgesturerecognizer:tap3]; uitapgesturerecognizer *tap4 = [[uitapgesturerecognizer alloc] initwithtarget:self action:@selector(imagepressed4:)]; [picview_4 addgesturerecognizer:tap4]; uitapgesturerecognizer *tap5 = [[uitapgesturerecognizer alloc] initwithtarget:self...

c++ - Apple LLVM 4.2 segfaults using range-based loops with references -

i'm not sure whether actual bug of llvm comes xcode 4.6.3 (4h1503) or if i'm doing not kosher. snippet of code follows for(auto &a : matrix[j]) { = false; } where matrix vector of vector s containing booleans. i've been developing visual studio 2012 while , didn't seem problem, application needs run on mac went on , tested it... , bit surprised couldn't compile. upon closer inspection, i've discovered getting full blown segfault clang itself, indication of bad shenanigans going on. isolated piece of code , changed loop more peasant's version using integer index , jazz. works charm. am correct in assuming original loop supposed working (i've seen similar things here in so, , besides vs2012 didn't have say, really) or making gross mistake , not supposed use references that? i'd know before reporting bug apple. edit #include <vector> using namespace std; int main(void) { vector<vector<bool>> matrix =...

sqlite - Receive update from web server to iOS App and synchronize data -

i'm writing app manage sqlite database, , have write web server, want user register in web server username , password, know how make request ios app server , receive response, want enable synchronization of sqlite database other device, core data can use icloud synchronization, prefer use sqlite, , find way synchronize it, example want create this: make change in sqlite in iphone app; the app send change server user; then server have send update other device connected @ user; and can't go over, how server can send change other device? device has listen server? or there way send update directly device , handle it? apple push notification? edit: if it's possible use apple push notification this, doesn't want alert text sound , badge user, send "silent notification" it's possible? as high-level there few different ways approach this, of have pros , cons. 2 name 2 examples can polling method, active push or hybrid approach. polling: @ ...

c# - Internal Implementation of AsEnumerable() in LINQ -

i have 2 questions: question 1 background : noticed when looking @ implementation of 'asenumerable()' method in linq microsoft, was: public static ienumerable<tsource> asenumerable<tsource>(this ienumerable<tsource> source) { return source; } question 1: expecting kind of casting or here , returns value passed. how work ? question 2/3 background : have been trying understand covariance , contravariance , invariant. think, have vague understanding 'in' , 'out' keywords determine polymorphic behavior when assigning subtype parent type. question 2: know reading ienumerable covariant, , list invariant why not possible : list<char> content = "teststring".asenumerable(); question 3: if ilist implements ienumerable why not possible : ienumerable<char> content1 = "teststring"; ilist<char> content2 = content1; please me understanding, thank in advance. the input argument k...

r - ggplot in function using environment variables: arguments imply differing number of rows -

i have function print , save charts using ggplot. data frame being used plots has nas in of columns - subset data first (and not in ggplot). when run function first time, works (and when run code in r line-by-line , not function, works inputs). however, when try run function second time input, receive error: error in data.frame(x = c(1, 21, 41, 53, 75, 80, 87, 100), y = c(1000, : arguments imply differing number of rows: 8, 6 after research, i'm convinced i'm not calling out correct data frame somewhere in ggplot layers, , environment variable getting used instead of input variable. but, cannot pinpoint error. i've listed sample data works in function. smpl_data <- data.frame(c(2011,2011,2011,2011,2012,2012,2012,2012),c(1,21,41,53,75,80,87,100),c(1000,1100,1200,1300,950,1050,1150,1250),c(2100,na,2200,2300,2050,2150,na,2350)) names(smpl_data) <- c("year","date_rank","modws_00x_3","modws_53x_3") #the following ...

.net - JSON decoding: Unexpected token: StartArray -

i'm using json.net decode json string , find error: exception in 'newtonsoft.json.jsonreaderexception' en newtonsoft.json.dll información adicional: error reading string. unexpected token: startarray. path 'mentions', line 3, position 3. the json string this: { "mentions": [ { "id":"1234", "alert_id":123, "title":"bla bla bla", "url":"http:\/\/www.example.com\/", "unique_id":"123", "published_at":"2013-07-30t11:26:36.92131100+00:00", "created_at":"2013-07-30t11:27:08.0+00:00", "updated_at":"2013-07-30t11:27:09.0+00:00", "favorite":false, "trashed":false, "trashed_set_by_user":false, "read":fa...

php - How can I scale an image using tcpdf? -

i've got image of size 490 x 630 drawn in corel. it's supposed have 41.3 mm (wide) , 52.3 mm . the unit i'm using in tcpdf class "mm". i'm having trouble trying acomplish this. what value should put on setimagescale() ? thanks ! i using image of format ".png". ".png" format had trouble trying display image correctly on pdf. opened image in paint , save ".jpg" , use instead. once i've changed format display image correctly without complication. think there's bug on pcdf related ".png" images.

weblogic - How do you implement ExitOnOutOfMemoryError parameter on JRockit R28? -

my weblogic servers use jrockit jvm r28. need have weblogic jvms configured automatically shutdown/kill/exit when outofmemoryerror occurs. a jrockit jvm parameter called "exitonoutofmemory" let accomplish this. oracle documentation provides incorrect , conflicting information. 1.) http://docs.oracle.com/cd/e13150_01/jrockit_jvm/jrockit/jrdocs/refman/optionxx.html says put " -xxexitonoutofmemory " startup scripts. however, jrockit doesnt "recognize" parameter. 2.) http://docs.oracle.com/cd/e15289_01/doc.40/e15062/optionxx.htm#babcdaib says put " -xx:+exitonoutofmemoryerror " startup scripts. jrockit not recognize configuration either. believe mistakenly copied hotspot documentation. how implement parameter? -xx:+exitonoutofmemoryerror works expected jrockit r28.2.2: $ jrockit-jdk1.6.0_29/bin/java -xmx20m -xx:+exitonoutofmemoryerror oom java.lang.outofmemoryerror: alloclargeobjectorarray: [b, size 40976 @ jrockit/vm/al...

events - Android App on Multiple Devices -

i have been developing concept android application doctors use, , involves use of android mobile phone , tablet in operation theater. have clickwheel sort of menu on app running on phone, , instance of app running on tablet. when user selects option using wheel, event has trigger rendering of view on tablet. i'm quite new android development, on how implemented great! thanks in advance! krishna you'll have devices on same network (of sort). , device sort of communications whereby phone can send selected choice on network tablet, , tablet can react updating ui. this communication achieved in many different ways: bluetooth, or wifi think easiest 2 implement. 1 fits use case better wouldn't know without more information though.