Posts

Showing posts from February, 2010

ios - reload UIPickerView on uncurl/dismiss of modal segue; partial curl -

i have viewcontroller uipickerview , settingsviewcontroller called modal segue partial curl. i need able pass [examplepicker reloadallcomponents] when segue dismissed, methods have tried, either have no effect or stop animation , leave me stuck on settingsviewcontroller.

php - get file path in joomla from any other directory -

i working on joomla modules facing problems. create more 7 modules , every 1 had on dbcon.php file contain connection db code. problem let suppose change password have change password in every dbcon.php file in every module not correct way. want place general dbcon.php file every module , include file in every module when ever need change credentials have chage dbcon.php file once each , every custom module. so purpose put dbcon.php file inside modules folder , try file that include( juri::base().'modules/dbcon.php'); which return me path http://localhost/jmd_tests/modules/dbcon.php which correct gives me warnings , module not working. here warning messages warning: include() [<a href='function.include'>function.include</a>]: http:// wrapper disabled in server configuration allow_url_include=0 in c:\wamp\www\jmd_tests\modules\mod_stune_cat_indians\helper.php on line 74 warning: include(http://localhost/jmd_tests/modules/dbcon.php) [...

ios - how to specify height of row? -

i want implement tableview shows expandable cell specific row, create custom table cell expanded if setting expandcontent following: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"cell"; customcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; nsstring *shouldexpand = [self.datasource objectatindex:indexpath.row]; if([shouldexpand isequaltostring:@"expand"]){ [cell setexpandcontent:@"expand"]; } else{ [cell settitle:@"a line"]; } return cell; } however, in order tell tableview row height, need implement following code: - (cgfloat)tableview:(uitableview *)tableview heightforrowatindexpath:(nsindexpath *)indexpath { customcell *cell = [self tableview:tableview cellforrowatindexpath:indexpath]; return [cell cellheight]; } the problem heightforrowatindexpath method ca...

app store - how can i approve my app that is usable only for my country ,on appstore -

Image
how can approve app usable country, on appstore. upload app several times but every time got message: we found app contains content - or facilitates, enables, or encourages activity - not legal in locations in app available, not in compliance app store review guidelines. specifically, application iranian bank app , not in compliance 22.1 guideline. i tankful if me matter. there 3 steps change country application follows, ease have attached screenshots well. click on rights , pricing click on specific stores deselect unwanted country , save. hope helps.

Import everything in a Python module inside a function -

i construct function emulates from package_name import * . while this question answers how 1 might modifying globals() . globals() , however, local module function defined in. for example, suppose define following function in first_package.py , import imp def load_contents(path): """load package""" module = imp.load_source('', path) k in dir(module): if not '__' in k: # ignore __xxx__ private variables globals()[k] = getattr(module, k) then run following code in second_package.py import first_package first_package.load_contents('third_package.py') nothing happen. how can fix this? the trick use sys._getframe go call stack 1 step, retrieve globals of caller. precise code is, def load_contents(path): """load contents of configuration file""" module = imp.load_source('', path) glob = sys._getframe(1).f_globals # globals of calling module k in...

my .live function not firing and giving me error using jquery 1.10.1 -

here html code: <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>insert title here</title> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css"/> <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> <script src="js/lib/cordova-2.7.0.js"></script> <script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script> <script type="text/javascript" charset="utf-8" src="js/converter/temperature.js"></script> <script type="text/javascript" charset="utf-8" src="js/converter/temperaturecontents.js"></script> <script type="text/javascript"> $(document).ready(function() { alert("fgfgf"); }); </script> </head...

cocoa - SimpleFTPUpload on Mac Os X -

i reading post [3334:303] file read error error while trying upload files via simpleftp source code. experiencing same problem, using simpleftpupload on mac os x project. file exists when gets to bytesread = [self.filestream read:self.buffer maxlength:ksendbuffersize]; bytesread returns -1 , apps gives "[3334:303] file read error" error. did happen find solution ? many thanks, alfonso tesauro mac os developer from you've said, take simpleftp opensource project. in code project, for: file read error and see what's in region. another idea add a: nslog(@"%@", errorreason); where errorreason whatever holding error number @ time. without details on simpleftp scripts, 1 can't ascertain what's going on. file read error is ambiguous error , isn't standard debugger error.

javascript - Google closure - non overlapping tiled rectangles -

i'm trying use google closure write application covers region of plane non-overlapping rectangles. 1 requirement have able take point on plane (potentially floating-point coordinates) , identify single rectangle covers point. unfortunately, has led problem using closure's rectangle class. consider, example, 2 unit-dimensioned rectangles top-left corners located @ (0,0) , (1,1). consider these rectangles non-overlapping, closure's rectangle class tells me both contain point (1,1). is there way can make closure consider these rectangles not overlap? or way generate rectangles include possible coordinates not overlap (e.g. way of specifying size of 1 side of rectangle largest number smaller 1)? to questions: can not make closure consider these rectangles not overlap. , can not generate rectangles cover space not overlap. but going on wrong way. define of edges belong square – e.g. each square owns top , left border. use closure rectangles touch give poin...

java - 500 Internal server when trying to upload image to server -

i working on application allows user upload image server. getting 500 internal server error .i cant seem find related error solve problem. code follows: class retreivefeedtask extends asynctask<string, void, string> { protected string doinbackground(string... url){ try { bytearrayoutputstream bos = new bytearrayoutputstream(); bitmapdrawable drawable = (bitmapdrawable) imageview.getdrawable(); bitmap bitmap = drawable.getbitmap(); bitmap.compress(compressformat.jpeg, 50, bos); byte[] data = bos.tobytearray(); httpclient httpclient = new defaulthttpclient(); httppost postrequest = new httppost("http://10.155.103.167:9090/restserver/rest/todos"); string filename = string.format("file_%d.jpg", new date().gettime()); bytearraybody bab = new bytearraybody(data, filename); contentbody mimepart = bab; // file file= ne...

javascript - How do I arrange these objects by their number properties in arrays -

var person = function(name,video,twitter,facebook,number){ this.name=name; this.video=video; this.twitter=twitter; this.facebook=facebook; this.likes= number; this.dislike=0; this.addlike=addlike; this.adddislike=adddislike; var x=0; function addlike(){var cap = x +=1; this.likes= cap;} function adddislike(){var cap = x +=1; this.dislike = cap;} } these objects made object constructor: var nana = new person("shirley","g-ma stuff", "shirley tweet","shirley face",100); var rj = new person("ronald ", "java", "ronald tweet","ronald" , 72); var tori = new person( "toir ", "cars","mom tweet","mom face",48); var ronald = new person("ronald","bear","ronald twitter","ronald facebook",12); this array made , assigned positions in array: var array = []; array[0]=ronald;...

html - CSS order of applying bug -

html: <div id="outer"> <div id="inner"></div> <div id="..."></div> </div> css: #outer div { margin: 0 auto; } #inner { margin-top: 10px; } my problem inner div style. seems margin: 0 auto more important margin-top. same when put #outer div {...} below #inner {...} i know how fix without using important. idea? this not bug. #outer div more specific selector #inner . can think of css specificity points based system. in case each of 2 rules gets 10 points referencing id. first rule (which includes div element) gets 1 point. makes #outer div have 11 points , #inner left 10. means #outer div rule applied element. #outer #inner { margin-top: 10px; } the above rule have 20 points , applied element.

tooltip - javascript hide dropdown when click anywhere -

hello want hide droppdown tool tip when click on out side div, below code // tooltip function function ddtooltip(){ document.getelementbyid("ddtooltip").style.visibility='visible'; }; function removetooltip(){ document.getelementbyid("cancel").style.visibility='hide'; } do this: document.getelementbyid("cancel").style.visibility='hidden'; instead of: document.getelementbyid("cancel").style.visibility='hide'; you can refer css visibility documentation

javascript - How to show just the content from the div tag -

in following div tag, want store content " bank towers, commissariat road, m g road bangalore " variable. how possible ? <div class="infowindow1"> <div class="infowindow"> bank towers, commissariat road, m g road bangalore </div> . <br/> <br/> <div class="infowindow"> <b>working hours: </b> <br/> 08:30 - 21:00 </div> </div> thanks in advance !! var variable = document.getelementbyid('yourdivid').innerhtml;

ruby - Triggering ajax requests/responses before parsing a webpage with Mechanize/Nokogiri -

i parsing through website contains buyers feedback of customers. want collect name of each buyer , feedback or has given. my issue few feedbacks given on first page. next page triggered clicking button, , website responds ajax. how new feedbacks ajax response mechanize page object? want click ajax trigger button many times possible, many feedbacks there available. my code looks this: require 'mechanize' require 'nokogiri' log_file = "log_file.txt" log = file.open(log_file, 'w') www = "http://www.trustpilot.dk/review/www.fona.dk" agent = mechanize.new page = agent.get(www) reviews = page.search(".clear") reviews.each |r| doc = nokogiri::html::document.parse(r.to_html) log << "####################### new review #######################\n\n" name = r.at_css(".profileinfo a").text.strip log << "customer name: #{name}\n" rating = doc.at("//meta[@itemprop = 'rati...

Rails controller create action difference between Model.new and Model.create -

i'm going through few rails 3 , 4 tutorial , come across love insights on: what difference between model.new , model.create in regards create action. thought use create method in controller saving eg. @post = post.create(params[:post]) looks i'm mistaken. insight appreciated. create action using post.new def new @post = post.new end def create @post = post.new(post_params) @post.save redirect_to post_path(@post) end def post_params params.require(:post).permit(:title, :body) end create action using post.create def new @post = post.new end def create @post = post.create(post_params) @post.save redirect_to post_path(@post) end def post_params params.require(:post).permit(:title, :body) end i have 2 questions is rails 4 change? is bad practice use @post = post.create(post_params) ? model.new the following instantiate , initialize post model given params: @post = post.new(post_params) you have run save in order persis...

c - culagesvd() in CULA -

i want use culadgesvd() function compute svd matrix. not clear me how use in c/c++ info in documentation. give me complete small c program, template, show how function used? couple of lines (with stuff culainitialize() , culashutdown() ) do, need see how function can run without error. i thought svd not included in free version (it though). below example qr decomposition. put in .cpp file: #include<cula.h> #include<iostream> int main() { float x[] = {1, 2, 3, 4}; int n_rows = 2, n_cols = 2; float scale[n_cols]; culainitialize(); culasgeqrf(n_rows, n_cols, &(x[0]), n_rows, &(scale[0])); culashutdown(); for(int ii = 1; ii < n_rows; ii++) { for(int jj = 0; jj < n_cols; jj++) { if(ii > jj) { x[ii + jj * n_rows] *= scale[jj]; } } } for(int ii = 0; ii < n_rows * n_cols; ii++) { std::cout << x[ii] << std::endl; } return 0; ...

How do i resolve this HTML Doctype errors -

this doctype doesn't support following attributes produce errors on w3 validations there no attribute "type" <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> you don't need stuff. should suffice without errors: <!doctype html> <html> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

JavaScript: Cursor position in prompt box -

Image
the default behaviour of prompt box selects entire text when opened. can behaviour changed custom position of mouse cursor within box? prompt('please choose left window:', document.url); for example want cursor pointed directly after // . have @ example in jsfiddle main idea remove selection following: $input.focus(); $input.val($input.val()); first focusing input, resetting it's value. it's dom based, , not work prompt window. based on authors comment question.

I want Drag and Drop to my Hsv Alert Dialog Color picker in Android -

i using hsv color picker project.i couldn't drag , drop color picker.is possible drag alert dialog box in android?how can this. colorpicker link http://www.buzzingandroid.com/2012/11/hsv-color-picker-dialog/ . help me...

jsp - how to avoid repeated data is getting displayed in struts2 when I refresh the page,I am using S2 anchor tag ..not using form -

i struck in problem....i have link in anchor tag mapped action , when click on on link display rows of 1 of table's data database...and in jsp using s2 iterator tag display contents.so when refresh page again action executing results in repeated data getting displayed in jsp page....i came know in forms can use token tag this... want using anchor tag please me. struts.xml code: <action name="displaymails" class="com.money.action.displaymailaction"> <result name="success" type="redirect"> </result> </action> <html> <head> <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> <script> $(document).ready(function() { window.history.pushstate("","", location.href); }); </script> </head> <body> <!-- stuff --> </body...

Does php Date mktime() Function show different value on End of the month? -

to list months in dropdown used php function <select name="month" class="span3"> <?php for($m = 1;$m <= 12; $m++){ $month = date("f", mktime(0, 0, 0, $m));?> <option value="<?php echo $m; ?>"><?php echo $month; ?></option> <?php } ?> </select> it working fine when check today (i.e 31-07-2013) showing month <select class="span3" name="month"> <option value="1">january</option> <option value="2">march</option> <option value="3">march</option> <option value="4">may</option> <option value="5">may</option> <option value="6">july</option> <option value="7">july</option> <option value=...

swing - Get all selected checkboxes in Java -

i have dialog in java presents ~ 15 checkboxes user. there way names of checked checkboxes @ once? currently, i'm looking 1 one if selected, isn't fancy of solution. i'm looking similar getting selected checkboxes in array in java when adding checkboxes dialog keep reference in collection of sort. when want see checked can iterate on collection , check state of each of them. can name calling gettext on it.

Android Multipane ListView Search(List Filter) -

i developed application multipane .i need give listview filtering.i have modified @android:layout/list_content file.but didn't show edittext . my code : activity_invoice_twopane.xml <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <tablelayout android:layout_width="match_parent" android:layout_height="wrap_content" > <tablerow android:id="@+id/tablerow1" android:layout_width="wrap_content" android:layout_height="wrap_content" > <textview android:id="@+id/invretname" android:layout_width="240dp" android:lay...

I lose data when i navigate between Fragments Android -

i don't know i'm doing wrong. have activity contain listview , fragment, when press item listview replaces fragment fragment. problem when add views fragment , replace fragment , if return first fragment don't find views added. there code: @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view addreport = inflater .inflate(r.layout.add_report, container, false); listview listview = (listview) addreport.findviewbyid(r.id.list); // listview.addheaderview(padding); listview.setdivider(new gradientdrawable(orientation.left_right, colors)); listview.setdividerheight(1); remplirlistofreport(); reportadaptor reportschedule = new reportadaptor(getactivity(), r.layout.report_item_format, listofreports); listview.setadapter(reportschedule); // inflate root layout myinflater = (layoutinflate...

javascript - Make HTML content not react on search (Ctrl+F) -

in web app have layer static html content displays text. when search on page (ctrl+f) , type text contained in layer mentioned above text highlighted. is possible make content not react on search @ all? or remove search function page app opens if could. the option not reveal on search make image or external media flash. generic browser feature (ctrl + f) displays text, if exists on screen highlighted.

php - eWay Shared Payment error Currency is not valid or not allowed; -

i adding eway shared payment gateway site , testing sanbox details have set should service response not allowing me pass through : here response : http/1.1 200 ok cache-control: private content-length: 127 content-type: text/html; charset=utf-8 server: microsoft-iis/7.5 p3p: cp="noi adm dev psai com nav our otr stp ind dem" set-cookie: asp.net_sessionid=qwfm2j0wpkt35tm0eunu0v2y; path=/; httponly x-aspnet-version: 4.0.30319 x-powered-by: asp.net date: wed, 31 jul 2013 08:14:27 gmt falsecurrency not valid or not allowed; as can see last line of response saying : currency not valid or not allowed; here code eway integration : // eway payment in php $pathvalue="http://localhost/eway/test_hosted/"; if($_get['action']=="payment") { $ewayurl.="?customerid=92539274"; $ewayurl.="&username=ravi.soni@ideavate.com.sand"; $ewayurl.="&amount=".$_post['amount']; $eway...

android - the child has also got selected while pressing parent in listview? -

Image
when press list ,the imageview has got selected .. for imageview <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="@drawable/btn_default_pressed_holo_light" /> < <item android:drawable="@android:color/transparent" /> </selector>

unix - IPCS message passing related queries -

i dealing message passing ipcs method. have few question regarding this: key field in ipcs -q shows me 0x00000000 means ? can see messsage passes using msqid ? if 2 entries present (for particular user) after executing command ipcs -q . means 2 messages passed particular user ? if used-bytes , message fields set 0 mean? is there away see if message queue full or not? how many queues can have 1 particular user? i tried goggling, not able find answer these questions. please 1. " key " field of shared memory segments 0x00000000 . indicates ipc_private key specified during creation of shared memory segment. manual of shmget() contains more details. 2. afaik, cannot done. if msg "de-queued" msgq, intended receiver not see it. 3. 2 entries in list of message queues indicates there 2 active message queues on system identified corresponding unique keys. creating additional msgq : ipcmk -q deleting existing msgq : ipcrm -q <unique-ke...

layout - WPF keep control from affecting scrollviewer width? -

is there way prevent wrap panel (or other control) participating in scrollviewers width calculation? example below, i'd wrap panel stay within width created other controls not directly affect width calculation. (i.e.) i'd behavior similar if auto off, still allow horizontal scrolling of other content gets wider. <window x:class="mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="350" width="525"> <grid> <scrollviewer horizontalscrollbarvisibility="auto"> <grid> <grid.columndefinitions> <columndefinition width="100" /> <columndefinition width="1*" /> </grid.columndefinitions> <grid.rowdefinitions> <rowdefinition height="...

floating point - PHP & Base 2. Which Floats give a precise Value? -

apologies poor maths skills, i've tried understand answer own query i'm not convinced. we know php doesn't store floats in base 10 base 2. i have series of calculations using 0.5 float, , in trying understand if stored 0.500001 or 0.4999999 (for rounding purposes there big difference!!!) have come understand 0.5 stored precisely in base2. my queries a have understood correctly? b other floats stored precisely in base2? eg 0.25? any multiple of 1/pow(x, 2) can precisely represented float. that means x/2, x/4, x/8, x/16 ...ect. can accurately represented. for more information on how floating point numbers store see http://kipirvine.com/asm/workbook/floating_tut.htm gmp library high precision math.

operating system - Azure: List OS Images -

Image
im new windows azure, ive looked documentation , me works, listing images on gallery. https://management.core.windows.net/subscription-id/services/images but isnt im looking for, there way list images on account , not images on gallery. if run powershell cmdlet get-azurevmimage , you'll see all images. stated @gaurav, ones correlate my images have publishername of user . so, again, using powershell, here's how see images piping where-object : get-azurevmimage | where-object { $_.publishername -eq 'user' } if wanted see image names in console, pipe foreach-object : get-azurevmimage | where-object { $_.publishername -eq 'user' } | foreach-object { write-host $_.imagename } note: if image's publishername empty, use category -eq 'user' instead. here's sample output, subscription: edit if you're using mac/linux cli, you'd run different command: azure vm image list or, return json: azure vm image list --js...

java - I am getting this error org.springframework.beans.factory.BeanCreationException -

i trying rectify error not since 3 days me out please..! i'm using spring2.5 , hibernate3 , struts2-2.1.6 getting error when deploying application tomcat 7. flowing applicationcontext.xml file thanks in advance.. <bean id ="registrationbeanid" class="com.xxxx.click.action.registration.registrationcontroller"> <property name="newregistration" ref="newregistration"/> </bean> <bean id="newregistration" class="com.xxxxx.click.service.addregistration.newregistrationmanager"> <property name="webresourcemodule" ref="webresourcemodule"/> </bean> <bean id ="webresourcemodule" class="com.seeinfobiz.click.daoimpl.wrm.wrmdaoimpl"> <property name="sessionfactory" ref="sessionfactory"/> </bean> <bean id ="fileuploadbeanid" class="com.xxxx.click.action.fileupload.fileuploadcontrol...

regex - Regular expression to check us dollar and german currency format -

i trying find piece of regex match currency value. if price 1000 in usd need validate in format 1,000.00 in case of german opposite 1.000,00 need validate entered amount in usd format or german format need save value in db removing both comma , dot 1000.00 try this: /^((\d{1,3}\,)*\d{3}|\d{1,3})\.\d{2}$|^((\d{1,3}\.)*\d{3}|\d{1,3})\,\d{2}$/ it match 20.00 1,000.00 1.000,00 1.000.000.000,00 1,000,000,000.00 but not 1,000,000,00.00 ,000,000,00.00 100000000.00 1,000,000,000,00 etc.

.net - Wizard Control Disable Buttons -

how can disable , confirm buttons in 'final' step of wizard control ? <asp:wizard id="wizard" runat="server" displaycancelbutton="true" steppreviousbuttontext="back" finishpreviousbuttontext="back" finishcompletebuttontext="confirm" > <wizardsteps> ..... <asp:wizardstep id="confirmstep" runat="server" title="confirm request" steptype="finish" > <asp:wizardstep> .... </wizardsteps> </asp:wizard> protected sub wizard_finishbuttonclick(byval sender object, byval e system.web.ui.webcontrols.wizardnavigationeventargs) handles wizard.finishbuttonclick ....... 'i want disable confirm , button here after displaying error message. e.cancel = true end sub thanks. select wizard , convert startnavigationtempltae. , in aspx page <startnavigationtemplate> <asp:button id="startnextbutton" runat="server...

asp.net mvc - Uncaught TypeError: Object has no method 'addClass' - jquery.mobile-1.2.0.min.js:2 when dropdownlist source is empty -

i message in chrome's console. page keeps loading sign, nothing happens, freezes there, ui doesn't displayed. , happens when source of dropdownlistfor has no elements. if has any, works fine. here code: viewmodelfactory: specialoffersrep specialoffersrep = new specialoffersrep(); ienumerable<specialofferbo> specialoffers = specialoffersrep.getfordropdown(); list<selectlistitem> specialoffersfordropdown = new list<selectlistitem>(); foreach (specialofferbo sp in specialoffers) { specialoffersfordropdown.add(new selectlistitem { text = sp.specialoffername, value = sp.specialofferid.tostring() }); } ordervm.specialoffers = specialoffersfordropdown; return ordervm; so error when specialoffersfordropdown has no items. and in view have this: <tr> <td> @html.labelfor(m => m.specialofferid, new { @class = "label" }) </td> <td> @html.dropdownlistfor(m => m.specialofferid, model.specialoffe...

3-dimensional Array and assignment of an additional variable with python and numpy -

i want create 3 dimensional array standard distance 1 in each direction, receive, x=10; y=10; z=10; 1000 cells, example. in next step, want assign additional variable "e" each cell worth consist of gaussian distribution mean 1 , variance 0,1. i have tried create multidimensional array using: import numpy np x = np.array([[range(11)],[range(11)],[range(11)]],dtype=int) aswell as: x,y,z = mgrid[0:11, 0:11, 0:11] but not know if kind of type looking , how add variable each cell of it. i pretty new programming , python. additional modules want use numpy, scipy , matplotlib. thanks help! best regards. import numpy np e = np.random.normal(size=(1000, 1000, 1000)) * 0.1 print(e.shape) # (1000, 1000, 1000) print(e.var()) # 0.0100944667935 this creates 3-dimensional array, elements random variates sampled normal distribution (mean 0, variance 0.1). i don't understand first part of question. can give small concrete example of values want in arra...

android share on facebook sdk 3.0.2 -

i want share sometext on facebook using android facebook sdk 3.0.2 i tried this: bundle params = new bundle(); params.putstring("caption", "test"); params.putstring("message", "test"); params.putstring("link", "https://www.google.com"); // params.putstring("picture", "picture_url"); request request = new request(session.getactivesession(), "me/feed", params, httpmethod.post); request.setcallback(new request.callback() { @override public void oncompleted(response response) { if (response.geterror() == null) { toast.maketext(about.this, "successfully posted", toast.length_long).show(); } else ...

c++ - Invoking member of an object from another one by using `std::function` -

i'm trying create communication system between objects, in controller object keeps vector of member functions of other objects, , calls/invokes them when needed. read several articles usage of std::function , couldn't find 1 covers use case. my code is: #include <functional> #include <windows.h> class callable { }; class classa : public callable { public: double callthis(double x, int y) const { messageboxw(null, l"callthis() called.", l"in classa", mb_iconinformation); return x + y; } }; class classb : public callable { public: double callme(double x, int y) const { messageboxw(null, l"callme() called.", l"in classb", mb_iconinformation); return x + y; } }; class caller { public: void addsubscriber( const callable & objecttocall, const std::function<double(const c...

forms - Can't access post in php -

here's code in short way. code can't access post , don't know why. if ($_post) { echo 'post girdim'; } ?> <html> <head> </head> <body> <form action="" method="post"> <input type="submit"> </form> </body> set input name like: <input name="submit" type="submit" />

Direct run the product URL it redirect to cookies page first time IN Magento -

i want directly open this url . but gets redirect cookies page first time, , second time works fine. what run first time itself? you can disable cookie redirect in backoffice : system / configuration / general / web / browser capabilities detection / redirect cms-page if cookies disabled => no

android - AndroidPlot Simple XY Plot doesn't show -

Image
i'm implementing androidplot example website: http://androidplot.com/docs/quickstart/ when implementing on android 2.3.3 (samsung s+), white screen follows. the other demo pages androidplot work fine, including more complicated dynamic plots , charts. using same code android ice cream sandwich works fine. so causing white screen glitch , how change code fix it?

Setup SVN repository on AWS for asp.net MVC 2 website -

i new amazon web services (aws). have asp.net mvc 2 website. want setup svn repository on aws. need this. installed aws toolkit visual studio ( http://aws.amazon.com/visualstudio/ ). used amazon services rds ( http://aws.amazon.com/rds/ ) setup database instance , create database. got backup script of database local system , run on newly created amazon database. changed connectionstrings in code , deployed code amazon using aws elastic beanstalk( http://aws.amazon.com/elasticbeanstalk/ ). related deployment. there better way deploy asp.net mvc 2 website on aws. need use ec2 ? purpose ? how can setup svn repository on aws? please suggest i wouldn't bother setting svn - there plenty of preconfigured amazon machine images have done - example https://aws.amazon.com/marketplace/pp/b007i9ke5c https://aws.amazon.com/amis/bitnami-subversion-stack-1-6-6-0-ebs just install these, , boom - works. as far deployment goes, if you're new aws, i'd stay elastic bean...

drupal - Showing extra menu when viewing Views -

Image
i making site. i've managed make views slideshow of photo's. manually made menu want link other views. the problem is, menu isnt showed when viewing views slideshow. other standard menu items showing... extra menu shows when not in slideshow: extra menu doesnt show when in slideshow:

oracle - Double 'at' symbol meaning in PL/SQL -

i know @ symbol followed path means executing script in pl/sql. @@ followed path mean? @@{url | file_name[.ext] } [arg...] runs script. command identical @ ("at" sign) command. when running nested scripts looks nested scripts in same path or url calling script. url form supported in isql*plus. @@ command functions @ , start. ref : http://docs.oracle.com/cd/b19306_01/server.102/b14357/ch12003.htm

firewall - Port 8082 not available -

i installed jenkins server on port 8080. installed gitblit, takes port 8080 too, changed port 8082. on machine can call localhost:8082, remote 192.168.178.3:8082 not available. jenkins response works on 192.168.178.3:8080 i opened port on hardware firewall. still no response. the last thing image windows firewall, after opening port tcp in , out not working? or think problem is? if using gitblit go, default config gitblit go bind localhost , unreachable machine. check out server.httpbindinterface , server.httpsbindinterface .

video - Media trans-coding using directshow -

i've used directshow sample grabber grabbing video frame , playing. time trans-code 1 video format other. i'm again planning use directshow this. filter graph this. source filter ---> sample grabber --> file writer. know above graph ok, or need add else. also while going through msdn, found windows media foundation going replace directshow. if switching media foundation idea or not. thanks pradeep sample grabber let's copy , inplace modify data coming through. typically insufficient transcoding because cannot inject new data pipeline. if source file playable, time might fine readily available filter without need write own: build pipeline , started graph transcoding. windows media foundation going replace directshow. if switching media foundation idea or not. mf supersede dshow years ago: migrating directshow media foundation -- july 2006 . 7 years passed, , mf still not on par directshow on desktop... these 2 apis coming side side: use w...

How do I split this string using JavaScript? -

i have string (<<b>>+<<10>>)*<<c>>-(<<x>>+<<y>>) using javascript, fastest way parse into [b, 10, c, x, y] var str = '(<<b>>+<<10>>)*<<c>>-(<<x>>+<<y>>) '; var arr = str.match(/<<(.*?)>>/g); // arr ['<<b>>', '<<10>>', '<<c>>', '<<x>>', '<<y>>'] arr = arr.map(function (x) { return x.substring(2, x.length - 2); }); // arr ['b', '10', 'c', 'x', 'y'] or can use exec capture groups directly: var regex = /<<(.*?)>>/g; var match; while ((match = regex.exec(str))) { console.log(match[1]); } this regular expression has benefit can use in string, including other alphanumerical characters, without having them matched automatically. tokens in << >> matched.

using multiple LIKE in mysql on multiple JOIN -

i wondering if syntax of mysql query: joining multiple tables search term (like %%). works fine: select * table1 join table2 table1.town=table2.town , table1.car=table2.car , `name` "%search-term%" until add 'like': or `car` "%search-term%" which appends 'car' results in table1. , or works me when using 1 table confuses when on 2 or more joined tables.. appreciated try this: edit: select * table1 join table2 table1.town=table2.town , table1.car=table2.car , ( table1.name "%search-term%" or table2.car "%search-term%" ) order table1.name

internet explorer - Jquery SetInterval Not Working Correctly in Chrome and IE but is fine in FireFox -

i have jquery/javascript below works fine in firefox doesn't work in chrome , ie <script type="text/javascript"> (function($) { $(document).ready(function() { setinterval(function() { $.ajax({ type: 'get', url: "/items/xml/?page={{ pageno }}", datatype: 'html', success: function(html, textstatus) { $('table.items').replacewith(html); }, error: function(xhr, textstatus, errorthrown) { if (xhr.status != 0) { $('table.items').replacewith("<p />an error occurred: " + ( errorthrown ? errorthrown : xhr.status )); } } }); }, 1000); }); })(jquery); </scr...

jquery - How to extract from JSON to create a new JSON files -

i have json data coming database dynamically, see below: [["15","0.027","0.137","0.353","0.044","0.111","0.024","2013-07-30 17:45:06"],["17","0.027","0.137","0.353","0.044","0.111","0.024","2013-07-30 17:50:14"],["19","0.017","0.137","0.353","0.044","0.111","0.024","2013-07-30 17:55:35"],["21","0.017","0.137","0.353","0.044","0.111","0.024","2013-07-30 18:00:34"],["23","0.017","0.137","0.353","0.044","0.111","0.024","2013-07-30 18:05:10"],["25","0.017","0.137","0.353","0.044","0.111","0.024","2013-07-30 18:10:07...

regex - Matching all the numbers -

i asked in topic matching numbers 123. narrow , deeper regex see have define anything. asked exponential notation , got answer in this post : /^keyword\s+(-?(?:\d+|\d*\.\d*)(?:[ee]-?(?:\d+|\d*\.\d*))?)/ . tried understand failed far. so ask more specific now. need match numbers, give examples here: 13 -999 83.12300 .151 -.213 1e14 124e2 -9e-4 you got it, regular math stuff. and more specific give perl code this. searching keyword on line , need value line. i'd value in 1 regex because workaround or-statement || seems cause problems. my $value; open(file,"data.dat") or die "error on opening data: $!\n"; while (my $line = <file>) { if (($line =~ /^keyword\s+(-?(?:\d+|\d*\.\d*)(?:[ee]-?(?:\d+|\d*\.\d*))?)/x) || ($line =~ /^keyword\s*(\d*\.\d*)/)) { $value = $1; }; } close(file); edit thx hints far. there way this, , don't need regular expressions it. can use looks_like_number scalar::util her...

internet explorer 7 - out of present range bug javascript IE 7 -

hey guys have following javascript below for(var k in style){ if(style.hasownproperty(k)){ this.elem.style[k]=style[k]; } } where style object e.g {'maxheight':'50px','maxwidth':'50px'} in ie 7 getting out of present range error because of this.elem.style[k]=style[k]; any other way can set style using object oriented way thanks i setting zindex 9999999999 guess ie 7 not support the highest z-index ie7 supports 999999999 , i.e. 9 digits.