Posts

Showing posts from August, 2010

eclipse - android - Scala OnClickListener AlertDialog -

i create alertdialog android in scala ide plugin eclips, want change activity after clicking on no button couldn't change it, don't have error!! would please give me hints, if wrote wrong thanks in advance! first android app in scala new alertdialog.builder(this) .settitle("exit camera") .setmessage("do want try again?") .setpositivebutton("no", new view.onclicklistener { println("nooooo print") def onclick(dialog: view) { println("no print"); val intent = new intent(claimbookactivity.this, classof[homeactivity]); startactivity(intent); println("no class"); } }) .setnegativebutton("yes", new view.onclicklistener { println("yes print"

python - Receiving unexpected syntax error in absolute value calculator -

code: print ("welcome calculator") print ("calculators: absolute value [av]") load = int(input("enter calculator code here: ")) if load == av: import cmath import math avnum2 = int(input("enter number have it's absolute value found: ") **avsol** = cmath.fabs (avnum2) print ("the solution (absolute value) is: ", avsol) there syntax error on avsol, , yes, imported cmath. avnum2 = int(input("enter number have it's absolute value found: ") ^ you're missing closing ) on line.

html - How do I fix CSS padding issues between Firefox & Chrome? -

been @ hours. i've been using excellent ui toolkit: http://getuikit.com , far it's been great. the problem styling results between chrome , firefox set padding , achieve result in chrome: http://i.imgur.com/dmv13xw.png can see text nicely aligned start of input field. but in firefox this: http://imgur.com/hzryakg i've started it's frustrating run such intractabilities on! the html markup result bit is: <div class="results-sec`enter code here`tion"> <div id="results-container" class="uk-container uk-container-center uk-width-1-2"> <div class="result"> <a class="result_title" href="#">bhutan travel advice</a> <div class="result-url">https://www.gov.uk/foreign-travel-advice/bhutan</div> <p class="result-summary">latest travel advice bhutan including safety , security, entry requirements, travel warning

html - How to wrap text on a 100% width div? -

Image
i have 3 div display property set table-cell. div 1 fixed width (22px). div 2 needs take rest of available space. div 3 needs pinned right side , take as text in it. so issue having when contents of div 2 big pushes div 3 off screen. this mobile web application. ideally happen text in div 2 clip if going push bold totals of screen. in javascript, don't think should have to. here template code list item: <div class="licontainer"> <div class="cell a"><img src="badge.png" width="20px"/></div> <div class="cell b">{title}</div> <div class="cell c"><b>{total}</b></div> </div> here css: .cell{ display: table-cell; vertical-align: middle; } .a{ width: 22px; padding-right: 15px; } .b{ width: 100%; } .c{ text-align: right; } .licontainer{ width: 100%; display: table-row; } edit: result of emplo

plot - figure margins STILL too large even after minimizing in R -

i want classify individuals clusters using model based hierarchical agglomerative clustering via r package "mclust". i have 1229 observations (i.e. individuals) , 65 variables (i.e. snps). i ran function mclust() having difficult time plotting results. can plot "bic" when plot "classification", "density", , "uncertainty", r returns "error in plot.new() : figure margins large". i shrank margin sizes $mar [1] 4.5 2.5 2.5 1.5 to $mar [1] 1e-05 1e-05 1e-05 1e-05 and continue same error message. are there other methods can circumvent issue? suggestions appreciated.

android - Disabling (fade in and fade out) dialog box animation -

i'm novice programmist , have problem disabling dialog box animation (fade in , fade out). i tried to using empty style , set changing final alertdialog.builder builder = new alertdialog.builder(getactivity()); into final alertdialog.builder builder = new alertdialog.builder(new contextthemewrapper(getactivity(), r.style.noanimation)); background of dialog box became black, positive , negatice button changed <2.1 - 4.0) android style, fade in , fade out animation effect remained... my style: <style name="dialognoanimation"> <item name="android:windowenteranimation">@anim/enter</item> <item name="android:windowexitanimation">@anim/exit</item> </style> <style name="noanimation" parent="@android:style/theme.dialog"> <item name="android:windowanimationstyle">@style/dialognoanimation</item> </style> any ideas how can eliminate animat

wsh - getting expected identifier error in windows script host using vbscript -

i'm writing windows script host code on login , logout session. when user logs system, timestamp being recorded , when user logs out again timestamp being recorded. have mentioned code below getting error expected identifier , i'm finding difficult resolve it. rem login script: for /f "tokens=2 delims=[]" %%i in ('ping -n 1 "%computername%"') set ip=%%i echo %username% logged on %computername%, ip=%ip% @ %time% %date% >> f:\$\%username%.txt rem logoff script: echo %username% logged off %computername% @ %time% %date% >> f:\$\%username%.txt rem startup script: for /f "tokens=2 delims=[]" %%i in ('ping -n 1 "%computername%"') set ip=%%i echo started up, ip=%ip% @ %time% %date% >> f:\$\%computername%.txt rem shutdown script: echo shutdown @ %time% %date% >> f:\$\%computername%.txt

layout - Codename one label text wraping -

is there way how wrap text in label multiple rows ( using boxlayout y container )? always, text overflow hidden. long text should split 2 or more lines. i working textarea component , textarea.row set 2 or more. width little bit tricky. how can set label or textarea width or height? the label single line label solution based on text area should work fine if doesn't suggest making sure added on edt (you can activate edt violation detection in simulator menu) , if added component after form shown should use revalidate(). there no need define row count. just completeness here how work: textarea lbl = new textarea("my long string should break lines because really really long , won't end"); lbl.seteditable(false); lbl.setfocusable(false); lbl.setuiid("label");

android - Wierd results while trying to build an URI for HTTPGET -

i'm trying build url adding parameters baseurl : problem parameters added baseurl in disorder, , characters é replaced weird stuffs %c3%a9 string baseuri="mybaseuri"; void getparameters() { hashmap<string, string> map=new hashmap<string, string>(); final string login = ((edittext)alertdialogregister.findviewbyid(r.id.reglogin)).gettext().tostring(); final string password= ((edittext)alertdialogregister.findviewbyid(r.id.regpassword)).gettext().tostring(); final string passwordconfirm= ((edittext)alertdialogregister.findviewbyid(r.id.regpasswordconfirm)).gettext().tostring(); final string firstname= ((edittext)alertdialogregister.findviewbyid(r.id.regprenom)).gettext().tostring(); final string lastname= ((edittext)alertdialogregister.findviewbyid(r.id.regnom)).gettext().tostring(); final string sexe=((radiobutton)alertdialogregister.findviewbyid(((radiogroup)alertdialogregister.findviewbyid(r.id.regsexe)).getchec

javascript - How can I check if a JS file has been included already? -

i have split javascript in different files. want prevent, javascript files loaded twice. how can that? here's test see if script has been included based on path js file: function isscriptalreadyincluded(src){ var scripts = document.getelementsbytagname("script"); for(var = 0; < scripts.length; i++) if(scripts[i].getattribute('src') == src) return true; return false; } it work scripts not loaded through ajax, though may want modify if have jsonp code running.

java - Android app with traditional and SL4A portions -

i looking integrate 2 components work. 1 traditional java android app, , other python script. have python 1 working fine in sl4a, , looking call python script java based android app , process output in app. tl;dr: there way me call python script android app , output? while have no experience personally, have read kivy can handle running python script on android.

java - JMenuItem accelerator not working when menu bar is hidden -

this question follow-up this question . i have jmenubar behavior menu bars in firefox , itunes. is, menu bar hidden, when press alt , menu bar appears. the answer other question solved problem of achieving functionality, brought another issue: jmenuitem accelerators not working when jmenubar not visible. in other words, must press alt before ctrl+f (the installed accelerator) work. this not supposed case, though, because setaccelerator() method states following: public void setaccelerator(keystroke keystroke) sets key combination invokes menu item's action listeners without navigating menu hierarchy. ui's responsibility install correct action. note when keyboard accelerator typed, work whether or not menu displayed. so, i'm wondering if java bug? sscce (to menu appear, press alt , , installed accelerator ctrl+f "find" brings dummy joptionpane input): import javax.swing.jframe; import javax.swing.jmenu; import javax.swing.jmenu

cocoa - Exception thrown in NSOrderedSet generated accessors -

Image
on lion app, have data model: the relationship subitems inside item is ordered . xcode 4.1 (build 4b110) has created me file item.h , item.m , subitem.h , subitem.h . here content (autogenerated) of item.h : #import <foundation/foundation.h> #import <coredata/coredata.h> @class subitem; @interface item : nsmanagedobject { @private } @property (nonatomic, retain) nsstring * name; @property (nonatomic, retain) nsorderedset *subitems; @end @interface item (coredatageneratedaccessors) - (void)insertobject:(subitem *)value insubitemsatindex:(nsuinteger)idx; - (void)removeobjectfromsubitemsatindex:(nsuinteger)idx; - (void)insertsubitems:(nsarray *)value atindexes:(nsindexset *)indexes; - (void)removesubitemsatindexes:(nsindexset *)indexes; - (void)replaceobjectinsubitemsatindex:(nsuinteger)idx withobject:(subitem *)value; - (void)replacesubitemsatindexes:(nsindexset *)indexes withsubitems:(nsarray *)values; - (void)addsubitemsobject:(subitem *)value; - (voi

winapi - In win32 C++ programming how can I duplicate a window style? -

let's i've hwnd of window in win32 c++ programming. how can create window same styles programmatically? know i'll have use createwindowex how find parameters of existing window pass createwindowex ? getwindowinfo should retrieve need original window. returns windowinfo structure following: typedef struct tagwindowinfo { dword cbsize; rect rcwindow; rect rcclient; dword dwstyle; dword dwexstyle; dword dwwindowstatus; uint cxwindowborders; uint cywindowborders; atom atomwindowtype; word wcreatorversion; } windowinfo, *pwindowinfo, *lpwindowinfo;

commandButton with ajax=false using primefaces-mobile doesn't navigate correctly -

i noticed commandbutton ajax=false not working in primefaces mobile. want make non-ajax call navigate different url when user press button. if remove ajax=false, hits bean manager class not navigate different page. fix this? ui:composition template="/mobile/templates/masterlayout.xhtml" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:cc="http://java.sun.com/jsf/composite/composite" xmlns:pm="http://primefaces.org/mobile"> <ui:define name="center"> <pm:page title="test"> <pm:view id="main"> <pm:header title="test" swatch="b" /> <pm:content> <p:messages />

apache - Mod rewrite, append directory as parameter -

i'm wondering how directory rewriting directory gets appended parameter regardless of remaining url. for example, if have urls these: example.com/peter/lois/stewie.php example.com/peter/lois/brian.php?drinks=martinis example.com/peter/lois/quagmire/meg.php and need them rewrite to example.com/lois/stewie.php?person=peter example.com/lois/brian.php?drinks=martinis&person=peter example.com/lois/quagmire/meg.php?person=peter how go doing that? thanks! edit so have implemented in sites-available file: rewriterule ^/([a-z0-9]+)/lois(.*) /lois$2?person=$1 [qsa,l] but instead of returning like example.com/lois/stewie.php?person=peter it's returning like example.com/peter/lois/stewie.php?person=peter so it's putting parameter @ end of url should, it's not dropping earlier directory. mod_rewrite work this: rewriteengine on rewriterule ^([a-z0-9]+)/(.*\.php) /$2?person=$1 [qsa,l]

sqlite3 - SQL WHERE statements, where column may be value or may be NULL -

i have sql table (in sqlite3) in trying aggregate information several other tables, , records in 1 table may or may not have corresponding record in table. query supposed include in aggregate table both records , without linked information. example: create table all_households select pop.uid pop_uid, pop.surname, pop.given, pop.age, pop.real_property, farm.uid farm_uid, farm.improved_acres, farm.unimproved_acres, farm.cash_value, farm.corn, farm.cotton pop, farm pop.farm_id = farm.uid; this looking @ data census schedules. in census have basic pop information -- surname, given name, value of real property -- not has farm. individuals have value in farm_id column on pop , corr

Marker colour stays black Google Maps API -

i wrote script change marker colour depending on score between 0 , 1 on google maps api, marker colour @ moment black, have attached contents of javascript file below: function initialize() { var mapoptions = { zoom: 7, center: new google.maps.latlng(52.63506336920521, -1.8656949083418475), maptypeid: google.maps.maptypeid.roadmap } map = new google.maps.map(document.getelementbyid("map-canvas"), mapoptions); writeplacemarkers(); } console.log("1"); function placemarker(lat, long, name, score) { var pincolor = get_colour(score); var pinimage = new google.maps.markerimage("http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%e2%80%a2|" + pincolor, new google.maps.size(21, 34), new google.maps.point(0, 0), new google.maps.point(10, 34)); var pinsh

regex - Find all lines with a length greater than N -

this first question here. beginning powershell. let's have text file , want match lines length greater 10 characters. made simple regex. $reg = "^\w{0,10}$" and use notmatch operator. $mytextfile | select-string -notmatch $reg this not working. tried $reg = "^[a-za-z0-9]{0,10}$" but not working either. any clue me? lot! you don't need regex match. this: get-content $mytextfile | ?{$_.length -gt 10} if want regex, dot matches character. work... get-content $mytextfile | select-string -notmatch '^.{0,10}$' ...but simpler: get-content $mytextfile | select-string '.{11,}'

java - toString() method and recursion -

Image
i creating class implements generic set using binary search tree. implementing tostring() method displays parenthetic expression, having trouble getting work. example, here basic binary tree: i want tostring method output binary tree such: (10 (5 (4 () ()) (6 () ())) (20 (15 () ()) (25 () ()))) where () signifies empty tree. here class tostring method. appreciated! // allow short name access following classes import csc143.data_structures.*; public class myset<e> implements simpleset<e> { // root of "tree" structures set private btnode root; // current number of elements in set private int numelems; public myset() { root = null; numelems = 0; } /** * add element set. * * @param e element added set. * @return <tt>true</tt> if operation updated contents of set. */ public boolean add(e e) { try { root = addtosubtree(root, (comparable) e); return true; } catch(dupli

select - SQL Anywhere Syntax error near @ -

i working in asa 11 store procedures. example: create procedure "dba"."pa_select_employ"( @cod nvarchar(10), @name nvarchar(15) output) begin select @name=name_employ employ //the line 6 cod_employ=@cod end send variable @cod , need result @name output can't save shows message: the procedure 'xxx' not modified in database. syntax error near '@name' on line 6 [sybase][odbc driver][sql anywhere]syntax error near '@name' on line 6 sqlcode: -131 sqlstate: 42000 in interactive sql select ok. declare @name varchar(15) select @name=name_employ employ cod_employ='333333' please me find syntax error? (i speak spanish.) try changing procedure definition to: create procedure "dba"."pa_select_employ"( in @cod nvarchar(10), out @name nvarchar(15)) begin select @name=name_employ employ //the line 6 cod_employ=@cod end

haskell - Is there a aggregation version of Sequences exists already? -

consider have sequence of monoid elements, data.sequence great inserting, changing elements in positions. i'm concerned following query, sum j sequence , returns mconcat of elements position i j . can done using fingertree measure contain both index , mconcat result in o(log n) time. is there implementation of in haskell library? or have implement data.sequence again ability data.fingertree ? ( sequence expose little internal structure effectively.)

java - javax.sql.datasource getconnection returns null -

can please show me how fix code below not throw error? the following line of code giving me null pointer exception: return datasource.getconnection(); note datasource instance of javax.sql.datasource specified in web.xml, , works fine when called other code. here actual method in dataaccessobject.java null pointer occurring: protected static connection getconnection(){ try { return datasource.getconnection(); // } catch (sqlexception e) { throw new runtimeexception(e); } } the preceding method being called line of code: connection = getconnection(); which located in following method in class called coursesummarydao follows: public list<coursesummary> findall(long sid) { linkedlist<coursesummary> coursesummaries = new linkedlist<coursesummary>(); resultset rs = null; preparedstatement statement = null; connection connection = null; try { connection = getconnection(); // string sql = &q

caching - git credential.helper=cache never forgets the password? -

i want password forgotten, have type again. i have setup this: git config credential.helper 'cache --timeout=600' but later on, several days, still remembers password , not ask me again... git version 1.7.10.4 (at ubuntu) did run bug? (as see similar questions none found answers this...) edit: or missing something? edit: know commit local, , push remote. commits (with rabbitvcs git nautilus addon) seem performing push remote repo being updated... when issue push , asks password... commit command not ask , perform remote update; checked 4 hours ago commit updated remote server :( problem 1 : "want password forgotten" git problem 2 (implied) : contradictory configuration settings answer : git config --unset-all credential.helper git config --global --unset-all credential.helper git config --system --unset-all credential.helper explanation: git configuration specified in 3 places: (repository_home)/.git/config..................

c# - Deploy and start .NET service on multiple Windows Server 2012 -

i have service written in c# relies on features in .net 4.5 not yet supported in version of mono, have use windows servers. in other cases deploy network service scp jar/tar/whatever on , ssh on deployment process, , can made part of sh script can distribute wherever. because windows, don't have tools , i'm @ bit of loss how deploy 20 (or more) different servers. so see there publish process in msvs 2012, seems make use of windows file shares or else i'm supposed send website of kind(???) doesn't has way of starting if figure out how there. is there product in windows or easier me install ssh server? have remote desktop access, prefer not have deploy manually on them. thank you! try using powershell wmi. [this question] ( https://superuser.com/questions/337810/how-can-i-remotely-install-or-uninstall-a-service-on-windows-server-2008-r2 ) discussed approaches install windows service remotely.

android - How to consistantly and efficiently refresh a listview feed of content -

i have several fragment tabs , each feed of user statuses, being have 100 other users posting accounts there new data every few minutes. users choice switch fragments , fourth entire fragment reload sends http request , returns new data old data user had. doesnt seem efficient, know there has better way. can give me overview of efficient way keep data fresh without having user switch tabs , fourth? is using sqlite and/or services comes play? though developers , designers argue between if content should refreshed automatically of not, argue content streams shouldn't refreshed automatically unless expecting less incoming data. i have used twitter4j stream tweets , refresh automatically in 1 of test app, twitter4j has listener lets know when new tweets received. first pushed data listview new feeds received , kind of flashy but, efficient. queued data until reached threshold , pushed data listview, bit better. thought enough but, when monitored "data usage"

git stash - Git - How to get latest fix while working on a new feature? -

i'm using git , i'm new it. have latest code of project, , i'm working on new feature while i'm working on new feature received email of fix need commited not have yet. unfortunately can't 'get latest version' svn (and merge if needed) new feature file seem blocking pull if new feature file not common fix need get. best way both scenario: 1) have no common files modified new file need, scenario 2) have common file modified (i want quick local merge svn)? w shall stash, pull fix, , continue work on feature? , pop stash when i'm done? the original poster asks: shall stash, pull fix, , continue work on feature? , pop stash when i'm done? that's 1 option have. other options follows: the original poster asks: what best way both scenario: i have no common files modified new file need? i have common file modified (i want quick local merge svn)? if new file have ready commit, can commit it, merge or rebas

python - How can I find which tests are running slowly in nosetests? -

this question has answer here: how measure execution time of python unit tests nosetests? 2 answers we've got test suite of 2000 tests distributed on 50-60 files, run nosetests. best way figure out tests running slowly? add start/stop timer setup method of every test, cumbersome add every file. the nosetests prof documentation provides details on how profile application. easiest way is: nosetests --with-profile

c++ - MAC OSX LION: gcc on mac not compiling wget -

i trying install lynx / wget on mac. , installation requires gcc compile. have gcc in /usr/local/bin dir. see there. spankincubus:downloads spankincubus$ gcc -v using built-in specs. collect_gcc=gcc collect_lto_wrapper=/usr/local/libexec/gcc/x86_64-apple-darwin11.0.0/4.6.1/lto- wrapper target: x86_64-apple-darwin11.0.0 configured with: ../gcc-4.6.1/configure --enable-languages=fortran,c++ thread model: posix gcc version 4.6.1 (gcc) but when run configure utility wget, error. idea?? i'm not gcc expert record. checking whether make sets $(make)... no checking build system type... i386-apple-darwin11.4.2 checking host system type... i386-apple-darwin11.4.2 checking gcc... gcc checking whether c compiler works... no **configure: error: in `/usr/local/bin/wget-1.14': configure: error: c compiler cannot create executables see `config.log' more details** this how gcc lo

Revit Type Library formula comparison against family type -

Image
if have property in revit family type library family type there way can reference type selected in property use in formulas. say example have parameter "bolt washer (default)" parameter name , value have set in value field "washer : 50x50x3". i able have value of parameter in type changed based on selected value in value field of bolt washer parameter. for example: if (bolt washer = "50x50x3", 3, if(bolt washer = "65x65x6", 6, 10)) unfortunately, there no way you'd like. also, can't reference text of parameter either. example can't use formula of: if(bolt text='text',0,1) you're best best make bolt washer thickness , bolt washer type parameters.

magento - Collection not supported in Layer.php -

i have written magento query, $productcollection = mage::getresourcemodel('reports/product_collection') ->addcategoryfilter($category) ->addorderedqty($from, $to) ->addattributetoselect('*') ->setstoreid($storeid) ->addstorefilter($storeid) ->setorder('ordered_qty', 'desc'); $productcollection->getselect()->limit( $limit ); this works , gives me required result, when used in catalog/model/layer.php, i'm getting error. think supports mage::getmodel('catalog/product') how rewrite query , make work in layer.php. great.

How to remove Single Remote notification in iphone -

i developing game have support of server side push notification of score , winning notification, user game request. all working fine notification read , response store device side. when notification pushing notification center. when click on notification @ time remove push notification notification center following code: [[uiapplication sharedapplication] setapplicationiconbadgenumber:1]; [[uiapplication sharedapplication] setapplicationiconbadgenumber:0]; [[uiapplication sharedapplication] cancelalllocalnotifications]; but want remove selected remote notification notification center. is there way remove single remote notification.please me. thanks in advance. to cancel local notifications if have means obtain reference specific uilocalnotification instance want cancel, can call cancellocalnotification: on it. try traversing scheduled notifications in order obtain reference going through: nsarray *schedulednotifications = [[uiapplication sharedapplication

php - https://stackexchange.com/oauth/access_token not redirecting back to my redirect_uri -

i trying implement stackexchange using oauth 2.0 , able code but, when trying access_token through below code <?php if(isset($_get['code'])) { ?> <form method="post" action="https://stackexchange.com/oauth/access_token" enctype="application/x-www-form-urlencoded"> <input type="hidden" name="client_secret" value="aaaaaaaaaaaaaaaaaaaaaaaa" /> <input type="hidden" name="code" value="<?php echo $_get['code'];?>" /> <input type="hidden" name="client_id" value="0000" /> <input type="hidden" name="redirect_uri" value="http%3a%2f%2fmysite.com%2fmypage.php" /> <input type="submit" name="submit" value="stack" /> </form> <a href="https://stackexchange.com/oauth/access_token?client_id=0000&client_secret=aaaaaaaaa

floating point - A more accurate data type than float or double? C++ -

does c++ have more accurate data type float or double, or have settle fact calculations off? edit: mr. lister has pointed out, question regarding precision. it's bit frustrating when add 2 floats/doubles , number off half time comparing calculation done hand. in compilers, , on architectures, "long double" give give more precision double. if on x86 platform x87 fpu has "extended" 80-bit floating point format. gcc , borland compilers give 80 bit float value when use "long double" type. note visual studio not support this (the maximum supported msvc double precision, 64 bit). there called " double double " software technique implementing quad-precision 128-bit floating point. can find libraries implement it. you investigate libraries arbitrary precision arithmetic . for calculations 64 bit integer better choice 64 bit floating point value. but if question built-in types in current c++ compilers on common platforms answ

php - Page not redirect to any other page during download -

i have web page in there option download file. download fine during downloading, page not redirecting till download completed. the code used download file below: header("content-type: application/force-download"); header("content-type: application/octet-stream"); header("content-disposition: inline; filename=nri legal services_".$row['document_path']); header("expires: ".gmdate("d, d m y h:i:s", mktime(date("h")+2, date("i"), date("s"), date("m"), date("d"), date("y")))." gmt"); header("last-modified: ".gmdate("d, d m y h:i:s")." gmt"); header("cache-control: no-cache, must-revalidate"); header("pragma: no-cache"); header('content-transfer-encoding: binary'); header('connection: keep-alive'); header('expires: 0'); header('cache-control: must-revalidate, post-check=0, pre-chec

asp.net mvc 2 - Download the file mvc2 using actionlink -

i want upload , download resume using asp.net mvc2. created codings. uploaded successfully. when try download file have issue.. showing empty page.. controller: [handleerrorwithajaxfilter] public actionresult uploadresume(httppostedfilebase filedata) { stream fromstream = filedata.inputstream; stream tostream = new filestream(server.mappath("~/content/resumes/") + filedata.filename, filemode.create); loggedincandidate.resumefilename = filedata.filename; //_repository.save(); _userrepository.save(); return json(new jsonactionresult { success = true, message = "resume has been uploaded." }); //return json("resume has been uploaded."); } view: <input id="resume" type="file" name="resume" /> download: <p> <% var link = url.content("~/content/resumes/") + mo

css - Shrink the content div if floated sidebar exists to keep side-by-side -

i have 'container' has either 1 or 2 div's in it: think 'content area' optional 'sidebar'. the sidebar on right, content area on left. when sidebar appears fixed width. how can shrink content container keep columns side-by-side without using javascript, , without putting additional tags or styles in html on fly? here's basic code: <div id='container'> <div id='content-area'> ... </div> <div id='sidebar' style='width: 200px;'> ...</div> </div> i tried floating 1 left, other right, in case content still retains full-width, , laid out once clear of sidebar. if knew pages sidebar going appear on give container class (on pages only) , give class fixed width. don't know pages sidebar appear on! by using css adjacent sibling selector #sidebar + #content-area target content area , apply right margin if sidebar exists within container: example here #side

php - update query, updating multiple data -

i want update multiple data using code, problem is, when tried it, updates whole data has same category id , supposed update individually. solution. please help. in advance :) <?php if (isset($_get['pid'])){ $view=""; $targetid = $_get['pid']; $sql = mysql_query("select specs, category_id, price specs category_id='$targetid'"); $productcount = mysql_num_rows($sql); if($productcount > 0){ while($row = mysql_fetch_array($sql)){ $specs = $row["specs"]; $category_id = $row["category_id"]; $price = $row["price"]; $view .= '<div class="control-group"> <label class="control-la

wordpress - Responsive Site works like as on computer -

recently had decided make wordpress website responsive. took non-responsive theme (evolve) , made http://gopuc.com . on website when shorten window website looks great. but, when try use on phone site looks on computer. let me know doing wrong , how fix this. thanks in advance. fort making site responsive site please eneter give html , css code in site. html <title>my cool site huzzah</title> <?php if (!$_get['resp'] == 'no') { ?> <meta name="viewport" content="width=device-width"> <?php } ?> </head> <body class="<?php if (!$_get['resp'] == 'no') { echo "resp"; } ?>"> and css code .page-wrap { width: 80%; } @media (max-width: 600px) { .resp .page-wrap { width: 100%; } } and check site more suggestion regarding responsive theme

android - Check Uses Network Location and Alert -

i have simple need. want check if user has enabled use network location checkbox. if enabled, want pass user activity called locationpage. if network location not enabled, want display alert. this sounds simple going absolutely crazy trying figure out. seems work find if remove check , pass user directly locationpage activity. ideas helpful. thank you! package com.appname.app; import android.app.activity; import android.app.alertdialog; import android.content.context; import android.content.dialoginterface; import android.content.intent; import android.location.locationmanager; import android.os.bundle; public class main extends activity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.gpsoff); thread logotimer = new thread(){ public void run() { try{ int logotimer = 0; while (logotimer<6000){

java - Is it good practice to Store Age of a Person in Google App Engine? -

i need search through thousands of records of type 'person' , fetch ones, say: age between 25 , 30. practice if store age @ write time , run scheduler update age on every persons bday. scheduler runs everday person having birthday day. know wrong relational database. experienced in gae/j guide me on this. my proposal might bit off topic, make job simpler. having non-normalized db schema might make sense use case. believe can achieve without background job. i'd store dates integers in db: for example 2011-01-01 store: 20110101 ... afterwards you'd between this: let's today 20130810 , search 1 year old people: so you'd end like: between (20110811, 20120810) the problem you'd between each time search (so no database index involved), if search age intervals anyway, should not hurt queries skip indexes anyway

ubuntu - Logstash and iptables -

Image
i've installed logstash on ubuntu server according this tutorial i've iptables allowed 80 , 22 ports only. when logstash started following iptables error in logs. what 224.2.2.4 address , what's should need prevent error? you should check iptables rules (mostly filter table) see if there rule prevents transfer: thigs u should check: source ip destination ip packet type (tcp/udp) network interface further more may check source-ip , destination-ip well

c++ - std::vector.push_back() throwing badalloc exception -

Image
i started writing lexer, , made following file test far working okay: main.cpp #include <iostream> #include "lexer.h" #include "token.h" int main(void) { std::string str(""); // i'll use test expressions lexer lexer(str); std::vector<token> tokens = lexer.lex(); for(auto = tokens.begin(); != tokens.end(); ++it) { std::string str; switch(it->type) { case tokentype::_eof: str = "eof"; break; case tokentype::error: str = "error"; break; case tokentype::semicolon: str = "semicolon"; break; case tokentype::plus: str = "plus"; break; case tokentype::less_than: str = "less_than"; break; case tokentype::greater_than: str = "greater_than"; break;

android - Passing an associative array from Java to PHP -

i trying pass associative array java php. getting "can not serialize exception." the backend php code(soap call) this: function gettrips($data) { foreach($data $key => $value) { ... } } i making java client call this: hashmap<string, string> data = new hashmap<string, string>(); data.put("start_date", dateformat.format(date)); data.put("end_date", dateformat.format(date)); data.put("loc", "1"); request.addproperty("data",data ); soapserializationenvelope envelope = new soapserializationenvelope(soapenvelope.ver11); envelope.setoutputsoapobject(request); httptransportse androidhttptransport = new httptransportse(url); androidhttptransport.call(soap_action, envelope); i tried namevaluepair code this: list<namevaluepair> namevaluepairs = new arraylist<namevaluepair>(6); namevaluepai

c# 4.0 - Mixed wave stream to mp3 using Lame -

....... ....... var mixer = new wavemixerstream32(); mixer.autostop = true; var messageoffset = background.totaltime; var messageoffsetted = new waveoffsetstream(message, timespan.fromseconds(10), timespan.zero,message.totaltime.subtract(timespan.fromseconds(10))); var background32 = new wavechannel32(background); background32.padwithzeroes = false; background32.volume = 0.6f; mixer.addinputstream(background32); var message32 = new wavechannel32(messageoffsetted); message32.padwithzeroes = false; message32.volume = 0.3f; mixer.addinputstream(message32); var ws = new wave32to16stream(mixer); we trying mix multiple mp3's , wave files create single mp3 finally. example: 5 sources files (3 mp3's, 2 wave files) we giving input of each stream wavemixerstream32 , converting using wave32to16stream we need final stream converted mp3. using lame , passing stre

jquery - Slideshow lacks Javascript animation -

i found beautiful website ( http://soworldwide.org/ ) , want create similar slideshow. after i've spend lot of time make work, still can't figure out. right it's looking this: http://bit.ly/1bktxcx wait undtil last picture , can see how slideshow refreshes. can me, same animation theirs? i'm using same jquery plugin way. thank in advance. you're setting top of list-begin image 0 @ same time you're starting animation list-end image. because zindex of list-begin image 3, you're causing list-begin image hide animation of list-end image. recommend dynamically updating zindex each image when animation. slides hidden (by setting top negative value, you're doing), can ignore zindex. before set top 0 next image, set zindex curr 1 , zindex next 0. edit: figured out using chrome js debugger , liberal use of console.log() . maybe did right things , still couldn't find problem, , needed second set of eyes. if didn't right things,