Posts

Showing posts from February, 2015

Outlook VSTO C# Make post to html url -

i making plugin outlook 2010 using vs2010 c#. the objective of plugin grab to, cc, bc new email when custom button pressed ribbon , post external url (which takes in post request). similar how forms in html/jsp can post inputs different page(url). so far, can grab to,cc,bc , store in string variable. don't know how make post external url. any appreciated. thanks. here code function far: public void makepost(object item, ref bool cancel) { outlook.mailitem myitem = item outlook.mailitem; if (myitem != null) { string emailto = myitem.to; string emailcc = myitem.cc; string emailbcc = myitem.bcc; if (emailto == null && emailcc == null && emailbcc == null) { messagebox.show("there no recipients check."); } else { string emailadresses = string.concat(emailto, "; ", emailcc, "; ", emailbcc); //do here post string(ema

c# - Console application immediately exits after setting RedirectStandardOutput to true -

i have process needs update console in realtime based on output. not working. console opens , closes, , process runs in background. can not figure out doing wrong. here code: private static stringbuilder sortoutput = null; static void main(string[] args) { process process; process = new process(); process.startinfo.filename = "c:\\ffmbc\\ffmbc.exe"; //process.startinfo.arguments = "-i new5830df.mxf -an "; process.startinfo.useshellexecute = false; process.startinfo.createnowindow = true; process.startinfo.redirectstandardoutput = true; sortoutput = new stringbuilder(""); process.outputdatareceived += new datareceivedeventhandler(outputhandler); process.exited += new eventhandler(myprocess_exited); process.startinfo.redirectstandardinput = true; process.start(); process.beginoutputreadline(); } private static void outputhandler(object sender, datareceivedeventargs outline) { string line; l

Crystal Reports - Check for specific record in grouped detail records and suppress image in Group Header if present -

using crystal reports bundled visual studio.net 2003 in old .net 1.1 app i have invoice report detail records showing each item on invoice. report uses 1 dataset , grouping detail records rather sub report. anyway in main part of invoice have image needs visible if detail record id "pnp2" present. so imagine in format editor of image ole object, can write code against suppress method - think somehow need loop detail records check each value maybe there better way... can help? wing this should work, assuming image in group-header section. create formula: // {@is_pnp2} if not(isnull({table.id})) , {table.id}="pnp2" 1 else 0 add following image's conditional-suppression logic: sum({@is_pnp2},{table.grouped_field})>0

excel vba - Conditional If statement to set cells equal to 0 -

i have spreadsheet on 6000 rows , 300 columns. need know how write code in vba allow me read cells in column , if says "no" sets 3 cells right of equal zero. there no error when debug it, error in cell.offset line. thoughts? thank in advance sub macro1() dim rng range dim cell object sheets("sheet1") set rng = .range("c1:c6000") each cell in rng if cell.value = "no" cell.offset(0, 1).value = 0 exit end if next end end sub borrowing chuff's code: sub setto0ifno() dim rng range dim lastrow long dim cell range sheets("sheet1") lastrow = .range("a" & .rows.count).end(xlup).row set rng = .range("a1:a" & lastrow) each cell in rng if cell.value = "no" 'cell.offset(0, 3).value = 0 cell.range("b1:d1").value = 0 end if

learning java but running into problems -

so learning program in java, , feeling going fine, when got website codingbat, problem don't understand question. example: given string name, e.g. "bob", return greeting of form "hello bob!". helloname("bob") → "hello bob!" helloname("alice") → "hello alice!" helloname("x") → "hello x!" so think wants me write says hello bob! so wrote string x = "bob"; string y = "alice"; system.out.println("hello " + x + "!"); but apparently wrong, pretty demotivating. so question here is, stupid understand problem or question vague on kind of answer want, if there places present me practice things java, because reading , watching tutorials goes in , out head. excuse me if not in right place this, don't know else go. it wants this: public string helloname(string input) { return "hello " + input + "!"; } th

websocket - Nginx 1.4.1 + Socket.io couldn't work. Handshake authorized but not working -

i using nginx 1.4.1 , trying configure work socket.io websockets. think have done correctly since see 'handshake authorized', after few seconds socket.io starts using xhr-polling, jsonp-polling , couldn't work. my node.js express app runs on localhost:3002. , use nginx reverse proxy app. socket.io listening on same port. i tried follow many guides in , elsewhere couldn't work. need experts. i've placed error log in here, not sure if help. nginx.conf: upstream instaneous { server 127.0.0.1:3002; } server { listen 80; server_name instaneous.pin.gs; access_log logs/instaneous.access.log; error_log logs/instaneous.error.log; location / { proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_set_header host $http_host; proxy_set_header x-nginx-proxy true; proxy_pass h

html5 - Crop video part using popcorn.js -

i've read popcorn.js docs , can't seem found way removing parts of video. any appreciated i don't think library gives function crop video. although, if want solution popcorn.js, notice it offers "sequence" feature use skip parts of video , simulate you're looking for.

delphi - TStringHelper is not returning the correct results -

i'm using tstringhelper in win32 application, when try access particular char or substring values returned not same if use equivalent old string functions. {$apptype console} {$r *.res} uses system.sysutils; var : integer; s : string; begin try i:=12345678; writeln(i.tostring().chars[1]); // returns 2 writeln(i.tostring().substring(1)); //returns 2345678 s:=inttostr(i); writeln(s[1]); //returns 1 writeln(copy(s,1,length(s)));//returns 12345678 except on e: exception writeln(e.classname, ': ', e.message); end; readln; end. the question why tstringhelper functions not equivalent old string functions? this because methods , properties of system.sysutils.tstringhelper 0 based index, helper compiler {$zerobasedstrings on} directive. can find more info in system.sysutils.tstringhelper documentation.

keyboard shortcuts - How do you refer to the mac command key in the String version of Java's KeyStroke.getKeystroke? -

the documentation keystroke.getkeystroke(string) (e.g., getkeystroke("control delete") ) not provide example of how access macintosh command key, , can't find reference lists spellings of various words modifiers "control" function accepts. syntax command key? for reference, here's documentation getkeystroke: parses string , returns keystroke . string must have following syntax: <modifiers>* (<typedid> | <pressedreleasedid>) modifiers := shift | control | ctrl | meta | alt | altgraph typedid := typed <typedkey> typedkey := string of length 1 giving unicode character. pressedreleasedid := (pressed | released) key key := keyevent key code name, i.e. name following "vk_". if typed, pressed or released not specified, pressed assumed. here examples: "insert" => getkeystroke(keyevent.vk_insert, 0); "control delete" => getkeystroke(keyevent.vk_delete, inputevent.ctrl_mask);

c# - asp:SqlDataSource SelectCommand property does not persist when paging -

i have gridview (gvpart) sqldatasource (sdsparts) data source. on gvpart , have property allowpaging="true" . have textbox (txtpartsearch) , button used enter , exectue search through gvpart . this, have following in code behind: protected void partsearch(object sender, eventargs e) { string query = txtpartsearch.text; string selectcmd = "select ... partnum '" + query + "%' ... "; // have cut out of statement clarity sdsparts.selectcommand = selectcmd; gvpart.databind(); } the intent of allow user enter part number, , have gvpart display parts match query instead of entire list. the first page of gvpart after above method expected. however, if select statement results in more 1 page in gvpart , clicking page 2 in footer show second page, data page 2 of original data (that is, data pulled before search, default selectcommand in sdsparts ). it seems paging "resets" sqldatasource , uses selectcommand writ

SDMs in R problems with Java Memory ` -

i have tried using command increase memory availability running maxent in r : options( java.parameters = "-xmx1g" ) as suggested dismo pacakge increase access ram leads new error: "error in .jinit() : cannot create java virtual machine (-1)" has resolved issue? advice help. cheers israel the problem here work machine running 32 bit operating system , run rjava need 64 system set up.

jquery - Edit image 'src' vs replace 'img' tag in a Div? -

var rightnow=0; var highone=8; $(document).ready(function(){ $("#next-img").click(function(){ rightnow=rightnow+1; if (rightnow>highone) {rightnow=1;}; $(".img-class").attr('src',"http://example.com/images/abc_"+rightnow+".jpg"); starttime = new date().gettime(); }); }); function doneloading() { var loadtime1 = new date().gettime() - starttime; $("#stats span").html(loadtime1); <img class="img-class" height="300" src="" onload="doneloading()"/> i using code display image on screen. each time 'next' button clicked, changes 'src' of img tag display next image. div containing image never goes empty. doneloading() function helps me calculate time of image load. previous image stays on screen till next image loads(the window not go blank). looking add these features: 1) when 'next' clicked, fade or remove present image whi

objective c - XCode Header Search Paths for global struct -

i created struct called pointint 2 integers (like cgpoint ints) , want global struct cgpoint. created category nsvalue this. i've looked on internet , seems build settings -> header search paths way go. however, have no idea values put it. i've tried $(project_dir)/pointint/** , bunch of similar strings compiler not recognize it. how #import .h file struct, .h , .m category? , there else has done? add header file struct prefix header. 1 have been automatically created when created project called [project]-prefix.pch in "supporting files" directory. add in between #ifdef __objc__ , #endif . it available throughout project.

android - EditText request focus not working -

i have edittext , button . on click of button want open edittext keyboard , @ same time request focus on edittext , user directly start typing in keyboard , text appears in edittext . in case when click button open keyboard, won't set focus on edittext , because of user has click edittext again write on it. issue. or suggestion. code on click of button m_searchedittext.requestfocus(); inputmethodmanager inputmethodmanager=(inputmethodmanager)getsystemservice(context.input_method_service); inputmethodmanager.togglesoftinputfromwindow(m_searchedittext.getapplicationwindowtoken(), inputmethodmanager.show_forced, 0); ensure edittext focusable in touch mode. can 2 way. in xml: android:focusableintouchmode="true" in java: view.setfocusableintouchmode(true); personally don't trust xml definition of param. request focus these 2 lines of code: view.setfocusableintouchmode(true); view.requestfocus(); the keyboard shoul appear on without need ca

How do you properly nest multiple ArrayLists / Maps in Java? -

i trying run simple program, , i'm stuck on basics of declaring nested lists , maps. i'm working on project requires me store polynomials arraylist. each polynomial named, want key/value map pull name of polynomial (1, 2, 3 etc.) key, , actual polynomial value. now actual polynomial requires key values because nature of program requires exponent associated coefficient. so example need arraylist of polynomials, first 1 simple: polynomial 1: 2x^3 the array list contains whole thing map, , map contains key: polynomial 1 , value: map... 2 , 3 being key/values. the code have below i'm not 100% on how format such nested logic. public static void main(string[] args) throws ioexception{ arraylist<map> polynomialarray = new arraylist<map>(); map<string, map<integer, integer>> polynomialindex = new map<string, map<integer, integer>>(); string filename = "polynomials.txt"; scanner file = ne

ios - Check if app is ad-hoc|dev|app-store build at run time -

i'd check build information in debugging screen. there way check @ runtime? i realize set compiler flags builds or similar, if there existing method leverage i'd take advantage of that. while agree abhi beckert runtime wrong time doing (use preprocessor directives , build settings!), wanted clarify of details , speculations in previous answer/comments , shine light on things could do. bear me, going longer answer... there bunch of pieces of data go under generic umbrella of 'build information'. non-exhaustive list of such things include: build configuration, code signing identity, build time, build date, marketing version number, scm revision number, scm branch name, provisioning profile team identity, provisioning profile expiration, ci build number...the list goes on , on. assuming moment question narrowly focused on gaining information type of ios certificate , provisioning profile used build, have go firm 'no' answer question: is there

android - NPE on clicking button in fragments and app crashes after that -

i calling fragment 1 of activities , has login button in fragment itself. giving npe, moment click button.i have tried permutation , combination make work. here's code @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { super.oncreate(savedinstancestate); setuservisiblehint(true); view rootview = inflater.inflate(r.layout.fragment1, container, false); button button = (button) rootview.findviewbyid(r.id.bt_login); button.setonclicklistener(new view.onclicklistener(){ public void onclick(view v) { // perform action on click edittext username = (edittext)v.findviewbyid(r.id.username); string user_name = username.gettext().tostring(); edittext password = (edittext)v.findviewbyid(r.id.password); string user_password = password.gettext().tostring(); if(user_name.length()== 0 || user_password.

javascript - Horizontal Scrolling Div -

i'm interested in putting horizontal sliding div screenshots of app on website. trying similar done here . this relevant html find: <div id="screenshot_container" class="screenshot_container"> <div id="screens" class="screenshots" style="left: 0px;"> <img alt="screenshot of iou (i owe you)debt calculator" class="screen2" src="http://lh3.ggpht.com/np-fuq6p_rwh62edpb4btiqoeounriiacdi8-kxmcr28hkrdwu0_nnj3nqqnk1gismqipzw3yy_ptg5ccf7hqu5x=h200" id="screen1"> <img alt="screenshot of iou (i owe you)debt calculator" class="screen2" src="http://lh3.ggpht.com/s02i2hmnirbe6ms6pbylljew5rcxhwuj3wz25tp5zomigygidy6211ihd6mjuvuism-rwpejb-fykbi5mupxbvq=h200" id="screen2"> <img alt="screenshot of iou (i owe you)debt calculator" class="screen2" src="h

android - Set icon on button center position through programatically -

Image
i want set icon on button on center place through programatically above diagram please 1 me... may helps you.. set background image button in drawable folder use below code: btn.setbackgroundresource(r.drawable.image); or btn.setbackgrounddrawable(getresources().getdrawable(r.drawable.image)); or use: setcompounddrawablewithintrinsicbounds(). look more regarding setcompounddrawablewithintrinsicbounds() in documentation : click here edit: try way: setcompounddrawablewithintrinsicbounds(r.drawables.minus,0,0,0); add line in xml: android:paddingleft="100dp"

ios - UIWebview doesen't display PDF -

i have used code displaying pdf on webview. webview=[[uiwebview alloc]initwithframe:cgrectmake(0, 0, 320, 480)]; nsstring *path = [[nsbundle mainbundle] pathforresource:@"fonts1" oftype:@"pdf"]; nslog(@"%@",path); nsurl *targeturl = [nsurl fileurlwithpath:path]; nsurlrequest *request = [nsurlrequest requestwithurl:targeturl]; [webview loadrequest:request]; webview.scalespagetofit=yes; [self.view addsubview:webview]; pdf in bundle pdf correctly. what wrong in code. try below one uiwebview *webview = [[uiwebview alloc] initwithframe:cgrectmake(10, 10, 200, 200)]; nsstring *path = [[nsbundle mainbundle] pathforresource:@"document" oftype:@"pdf"]; nsurl *targeturl = [nsurl fileurlwithpath:path]; nsurlrequest *request = [nsurlrequest requestwithurl:targeturl]; [webview loadrequest:request]; [self.view addsubview:webview]; [webview release];

Linux Bash Shell Script: How to "ls" a directory and check some output string? -

i'm newbie linux shell scripting. need know is, in command line, use: # ls /var/log audit consolekit cups maillog messages ntpstats secure-20130616 spooler-20130623 vsftpd.log-20130616 boot.log cron dmesg maillog-20130616 messages-20130616 prelink secure-20130623 spooler-20130701 vsftpd.log-20130623 ... . . . .. then # ls /var/aaaaaaaaaaaaaaa ls: cannot access /var/aaaaaaaaaaaaaaa: no such file or directory so shell script: how can run command: # ls /var/aaaaaaaaa and detect if there output string ls: cannot access or not? note : may ask me whether want detect failure. or output string. i'm keen know both way. thank you. to check directory: if [ ! -d '/var/aaaaaaa' ]; echo 'no dir!' fi for file: if [ ! -f '/var/aaaaaaa' ]; echo 'no file!' fi to check output: if ls '/var/aaaaaaa' 2>&1 | grep 'no such';

python - AttributeError: 'module' object has no attribute '__all__' when running django-maintenancemode -

i running error when trying run middleware in django. https://github.com/shanx/django-maintenancemode it returning attributeerror: 'module' object has no attribute '__all__'. is there doing wrong? trying test out in localhost environment within virtualenv. have placed middleware settings file , error returned regardless of whether have mode set true or false. have placed 503.html template within templates folder want serve. traceback traceback (most recent call last): file "c:\python27\lib\wsgiref\handlers.py", line 85, in run self.result = application(self.environ, self.start_response) file "c:\users\deep.c\.virtualenvs\dcwebdev\lib\site-packages\django\contrib\staticfiles\handlers.py", line 72, in __call__ return self.application(environ, start_response) file "c:\users\deep.c\.virtualenvs\dcwebdev\lib\site-packages\django\core\handlers\wsgi.py", line 236, in __call__ self.load_middleware() file "

php - How to create a SQL query for the given scenario? -

there table named user_transaction has following structure: transaction_id mediumint(6) unsigned (pk) transaction_no varchar(55) transaction_cc_avenue_no varchar(55) transaction_card_category varchar(100) transaction_user_id varchar(32) transaction_user_name varchar(255) transaction_user_email_id varchar(255) transaction_deal_code varchar(10) transaction_dc_id smallint(4) transaction_amount float(10,2) transaction_discount float(10,2) transaction_total_amount float(10,2) transaction_data_assign enum('0', '1') transaction_status enum('success', 'inprocess', 'fail', 'cancelled') transaction_date bigint(12) transaction_update_date bigint(12) transaction_update_user_id varchar(32) i'm using unix timestamp values in fields transaction_date , transaction_update_date store dates. issue i'm getting today's date in format dd/mm/yyyy say(11/07/2013) form in php. aft

c++ - reading Binary files -

i want read binary file , print numbers on screen printing weird characters. generated binary file matlab. how can display data properly? #include <iostream> #include <fstream> using namespace std; ifstream::pos_type size; char * memblock; int main () { ifstream file ("seg.bin", ios::in|ios::binary|ios::ate); if (file.is_open()) { size = (int)file.tellg(); memblock = new char [size]; file.seekg (0, ios::beg); file.read (memblock, size); file.close(); cout << "the complete file content in memory"; (int i=0;i<size;i++) { cout<<memblock[i]<<endl; } } else cout << "unable open file"; return 0; } you're printing char s output, representation of char in output character, , if character you're sending std::cout isn't printable you'll see nothing or in cases you'll see weird char

Magento: Product dynamic price change on add to cart -

i'd have product calculator, build in javascript. want add cart process grab generated price page , submit cart - far have got. i've created observer hook checkout_cart_product_add_after event , update quote item price based on field value in submitted form, works. the problem have that, if add second or multiple versions of item different prices, updates other versions in cart same price - can never have multiples of same item in cart different prices. anyone have ideas? here's code in observer: public function modifyprice(varien_event_observer $observer) { $customprice = $_post["customprice"]; $item = $observer->getquoteitem(); $item = ( $item->getparentitem() ? $item->getparentitem() : $item ); if ($customprice > 0) { $item->setcustomprice($customprice); $item->setoriginalcustomprice($customprice); $item->getproduct()->setissupermode(true); } } i think way working

Clone instead of move in jquery ui and angular js -

currently working on project angular js . creating 2 div drag , drop here jsfiddle what need when drag div should clone intead of move. means drag , drop element should remain in both divs. how can ? try code in drop function : $(this).append(ui.draggable.clone()); see fiddle : http://jsfiddle.net/zhzxp/1/

c# - Saving iTextSharp pdf into byte and download with save dialog -

i'm trying create pdf using itextsharp , convert byte , download pdf file save dialog. have used memorystream convert pdf byte , used httpresponse page method download pdf file don't seem working. don't not have error , nothing happen after clicking button.(using chrome, firefox) me out , check part did did wrongly. thanks! protected void btnpdf_click(object sender, eventargs e) { byte[] pdfbytes; using (var ms = new memorystream())c { var doc1 = new document(); pdfwriter writer = pdfwriter.getinstance(doc1, ms); doc1.open(); pdfptable table = new pdfptable(1); table.totalwidth = 585f; table.lockedwidth = true; itextsharp.text.pdf.pdfpcell imgcell1 = new itextsharp.text.pdf.pdfpcell(); var logo = itextsharp.text.image.getinstance(server.mappath("~/image/logo.jpg")); doc1.add(logo); var titlefont = fontfactory.getfont("arial", 15, font.bold); doc1.add(new paragraph("official report. member rep

asp.net - Format integer to date in eval function in RadGrid Template -

this item template <asp:label id="lbldf" runat="server" text='<%# eval("datelong","{0:d}")%>'></asp:label> how can convert datelong (which returns int) date format(mm/dd/yyyy) ? know there workaround in codebehind. possible using other functions inside code block? thanks in advance you can try this... <asp:label id="lbldf" runat="server" text='<%#convert.todatetime( eval("datelong")).tostring("mm/dd/yyyy") %>'></asp:label> edit datelong in integer.. <asp:label id="lbldf" runat="server" text='<%# datetime.parseexact(eval("datelong").tostring(), "yyyymmdd",//specify format in date stored in database system.globalization.cultureinfo.invariantculture).tostring("mm/dd/yyyy"); %>'></asp:label> edit2 datelong in formate of difference of days given defa

php - query() Dosent Work Inside a Function -

this question has answer here: reference: variable scope, variables accessible , “undefined variable” errors? 3 answers i'm making script using php , pdo syntax. , before start wanted make shortcuts me. $db->query() = qr() , $string->fetch(pdo::fetch_obj) = fet($string) but problem pops on page, query() doesn't work inside function ( fatal error : call member function query() on non-object ) here's code // $db->query() = qr() function qr($str) { return $db->query($str); } // $string->fetch(pdo::fetch_obj) = fet($string) function fet($dbq) { return $dbq->fetch(pdo::fetch_obj); } $qr = qr("select * example"); $fet = fet($qr); echo "".$fet->example.""; because $db not available in function. have pass via function parameter. function qr($db, $str) { return $db->quer

How can compile and run java programme in php? -

this question has answer here: how can execute java program within php script? 4 answers this java file. hello.java class hello { public static void main(string args[]) { system.out.println("hello"); } } i want compile , run file in php. php file. index.php. <?php exec('java'.hello.java, $output); if ($resultcode) { echo "result: " . $resultcode . "\n"; //echo implode("\n", $output); } ?> create jar file source , php, run exec() command , run command: java -jar myjar.jar

ImageView click event in Android -

i have images under gallery. when launch application loads gallery bottom of screen. after, click particular image gallery image display in center of screen large size. after click large size image need display suitable images large size images. code: <gallery android:id="@+id/gallery1" android:layout_margintop="100dp" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <imageview android:id="@+id/image1" android:layout_width="200dp" android:layout_height="200dp" android:layout_margintop="70dp" android:scaletype="matrix" /> images: integer[] imageids = { r.drawable.img, r.drawable.img1, r.drawable.img2, r.drawable.img3, r.drawable.img4,

tsql - SQL Server how to get Count of a field for the current Quarter from Date? -

i have hard time assembling sql statement. scenario/requirement this: need count of field in current quarter. select count(fieldname) hits tablename dateposted = (current quarter) i no of hits/count current quarter. is possible? select count(fieldname) hits tablename datepart(q,dateposted) = datepart(q,getdate()) , year(dateposted) = year(getdate())

java - Uploading videos not working while images and text files uploaded in Android -

i trying upload video php server on localhost. have uploaded images , text files same code not work videos. please tell me what's wrong code. here server side script: <?php $mysql_host = "localhost"; $mysql_database = "test"; $mysql_user = "root"; $mysql_password = ""; $con = mysql_connect($mysql_host, $mysql_user, $mysql_password); mysql_select_db($mysql_database) or die("unable select database"); $target_path = "uploads/"; $target_path = $target_path . basename( $_files['uploadedfile']['name']); echo $target_path; if(move_uploaded_file($_files['uploadedfile']['tmp_name'], $target_path)) { echo "the file ". basename( $_files['uploadedfile']['name']). " has been uploaded"; $sql="insert images set url='$target_path'"; mysql_query($sql); } else{ echo "there error uploading file, please try again!"; } ?> here clie

Paypal REST API app status Need more info -

i have verified paypal account , created rest api app mobile sdk integration type. my app status still says "need more info", , i'm not sure next since sandbox account not processing payment. is there way have more complete app status. thanks.

css3 - Twitter Bootstrap when mobile smaller margin for container -

yesterday started first bootstrap dev day. designer looks 1 super framework work have 1 problem: as app designer know how important readability on mobile devices. bootstrap framework autosize container on mobile devices apply less margin edges text have larger lines (and less scrolling). how apply this? thanks in advance. hope helps. from source code. bootstrap-responsive@line 803 body { padding-right: 20px; padding-left: 20px; } modify value more space.

php - Post Modified date in a formated way in WordPress -

getting post_modified date is: 2013-07-11 01:45:40 . i don't need time (01:45:40) here. i need date portion displayed as: july 11, 2013 . i'm aware php date & time function, , aware wordpress date , time functions . but i'm afraid can't understand how easily. you can use php's strtotime() along date() . converts given date timestamp , back. code: <?php $date = "2013-07-11 01:45:40"; $timestamp = strtotime($date); echo date('f d, y', $timestamp); //output: july 11, 2013 ?>

javascript - wordpress mobile applications with phonegap -

i'm reading tutorial , i'm having problems examples... tried run examples in localhost i'm encountering errors , don't know be. should getting first post of wp, instead of i'm getting error uncaught referenceerror: url not defined . sugestions??? thanks! <!doctype html> <html> <header> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script> (url,target_div) { var url = url jquery.ajax({ url: url, datatype: 'json', success: function(data) { jquery(target_div).html(data.post.content); } }); } jquery(document).ready(function() { jquery("#title").html("<h1>hello world</h1>"); varurl = "http://localhost/phonegap/?json=get_post&dev=1&p=1"; vartarget_div = "#contents"; readsinglepost(url, target_div); }); </script> </header> <body> <div id="main"> <div id="title">

java - Is there any API to read SOLR config parameters? -

i want read 1 parameters (maxbooleanclauses) specified in solrconfig.xml @ client side. tried check if there api that, didn't find any. can please help? while there not way individual settings options in solrconfig.xml file there schema (via schema rest api ). can configure solr make entire solrconfig.xml file "gettable" via the admin/gui section settings. allow retrieve file , parse determine value of maxbooleanclauses setting.

php - headers_sent() return false, but headers were sent -

my code simple: <!doctype html> <html> <head> ... <?php var_dump(headers_sent()); ?> it returns false. shouldn't headers sent after printed? after first < character. it depends if output_buffering directive in php.ini file. if off output_buffering = off then echo headers_sent() should output 1 in other cases, headers_sent() won't output results because false. headers won't sent because output buffered. if want around , force-send headers, can use flush() . hope helps!

ios - Changing device orientation settings by Device in Rubymotion -

i have universal app using rubymotion, , ui setup differs between iphone version , ipad version. the main being, in iphone supports portrait, , ipad supports landscape. i want this, if possible setting on rakefile, understand alternative in delagate method, if possible set orientation settings in settings file. motion::project::app.setup |app| #app settings app.name = 'xxxxx' app.version = "0.xxxx" app.device_family = [:iphone, :ipad] app.interface_orientations = [:portrait] end edit: some updates on how jamon's answer worked out. having shouldautorotate return false in uinavigation resulted in odd occurrences on ipad version, having parts of ipad version show view content portrait though orientation set landscape, worked out when returned true shouldautorotate. you won't able in rakefile, far know. need specify provide both orientations , programmatically tell ios whether orientation supported or not. your uiviewcontrollers

excel - CSV universal date format for all cultures -

is there universal date format csv can exported , translated in eg. excel (with different cultures: us, uk, india etc.) ? my system renders csv file date format excel in other cultures can't handle it. maybe possible convert time ticks. i think answer no, if because excel may use either 1900 or 1904 date system. best bet may write date/time index .csv (today noon 42005.5 in more common 1900 date system) , have end user format suit themselves.

c++ - regex 1 character and space only -

hi learning regex.. trying make regex expression following conditon: any letter in sequence given below - c-mpstv-xz condition should not repeated. this letter can have 1 blank space in front or ie can " c" or "c " [c-mpstv-xz{1} ]{2} i trying above expression {1} expected 1 character , space after allowing 1 space only. @ end of string put {2} 2 character . i expecting regex_match false input "xx" not working. appreciate help. \s?[c-mpstv-xz]\s? . if using std::regex_match , shouldn't need else, since regex_match requires match on entire string.

java - how to set custom tabhost style without TabActivity -

i set tab without tabactivity, tabhost has error. please tell me how do. thanks. private void setuptab(class<?> ccls, string name, string label, integer iconid) { intent intent = new intent().setclass(this, ccls); view tab = layoutinflater.from(this).inflate(r.layout.custom_tab, null); imageview image = (imageview) tab.findviewbyid(r.id.icon); textview text = (textview) tab.findviewbyid(r.id.text); if (iconid != null) { image.setimageresource(iconid); } text.settext(label); tabspec spec = tabhost.newtabspec(name).setindicator(tab) .setcontent(intent); tabhost.addtab(spec); } i read android tab-host earn it can't build. i'm run error tabhost cannot resolved.

Targeting multiple screen sizes in android...How to? -

i creating layouts targeting application screen sizes , densities (including tablets 7,9.1 , 10 inches). have few queries haven't been able understand though after reading documentation. currently, have made 4 layouts namely layout-large ,* normal *, small ,* -sw320dp * , -sw480dp . confused images densities. i referring image android provides default ( ic_launcher.png under drawable-hdpi , drawable-ldpi , drawable-mdpi , drawable-xhdpi , drawable-xxhdpi .) have made sample layout taken image view , given src ic_launcher.png . however, image not displayed on device or emulator. do need specify different sized images? if so, in folders? because layouts larger screens should take larger images. do hdpi , ldpi , , mdpi imply similar sized images different density or images different sizes only? also in case of layout larger screen, should refer drawables large sized images (if taking small, medium, large images), or android take drawable-hdpi ? you need put i

.net - Queuing work items to the thread pool using System.Threading.Task -

i'd know (if any) straightforward way of queuing work items (delegates) thread pool in .net 4.5 using system.threading.task objects. want replicate queuing functionality of threadpool.queueuserworkitem() method task s. please correct me if i'm wrong, far know work items enqueued using method guaranteed executed in order enqueued (maybe i'm wrong multi-processor scenarios). have write code behaves same, using task s. i working on portable class library, that's why can't use threadpool.queueuserworkitem() , instead have rely on task s objective. technique suggest? default task scheduler suitable requirement? what ask tasks already. task wrapper around lambda default gets queued execute on threadpool. on top of that, tasks add continuations, exception handling, cancellation , many convenience functions make multi-threading lot easier. if don't want use threadpool, can create own taskscheduler , use when creating new task. taskscheduler receives

java - Why is paintComponent() continuously and asynchronously being called without explicit repaint() call? -

so question has 2 parts, think may related, , it's abstract. briefly, here's i'm doing: i have jframe jpanel , child jpanels each 3 jbuttons on it. created jcomponent called glasspanel jframe (i.e. myjframe.setglasspane(glasspanel) ), allows me paint on jpanels , buttons. (1) triggered clicking 3 buttons on jpanel , glasspanel set visible (which appears call paintcomponent() ). relates first question. (2) in paintcomponent() draw , paint rectangles , images, using double buffer , onto glasspanel . relates second question. here's relevant glasspanel class code (this not sscce because abstract question now): import java.awt.basicstroke; import java.awt.color; import java.awt.graphics; import java.awt.graphics2d; import java.awt.geom.line2d; import javax.swing.jcomponent; public class glasspanel extends jcomponent { @override protected void paintcomponent(graphics g) { super.paintcomponent(g); setdoublebuffered(true);