Posts

Showing posts from April, 2013

php - Parsing a value from a JSON webpage -

using either javascript or php, how can value webpage? json attempting parse: {"error":[""],"templatehtml":"", "_visitor_conversationsunread":"0","_visitor_alertsunread":"0"} i trying value of "_visitor_alertsunread". how go doing this? thank you! you either parse using regex, using json decoding, or simple indexing. however, of these three, json clean , correct way go. 1) json decoding: $page = file_get_contents($url); $json_arr = json_decode($string,true); return $json_arr['_visitor_alertsunread']; 2) regular expression: $page = file_get_contents($url); $pattern = ".*?_visitor_alertsunread\\\":\\\"(\\d)\\\""; preg_match($pattern, $page, $matches); return $matches[1]; 3) indexing: $page = file_get_contents($url); $needle = "_visitor_alertsunread"; $startpos = strrpos($page, $needle) + strlen($needle) + 3; $endpos = ...

android - Is it possible to disable scroll on a listView? -

i dynamically add items listview , want make items visible, without scrolling. layout code: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/recipe_inside" android:orientation="vertical" > <scrollview android:layout_width="match_parent" android:layout_height="wrap_content" > <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" > <imageview android:id="@+id/imageview1" android:layout_width="match_parent" android:layout_height="16dp" android:src="@drawable/head_cella...

image processing - FernDescriptorMatch - how to use it? how it works? -

how use fern descriptor matcher in opencv? take input keypoints extracted algrithm (sift/surf?) or calculates itself? edit: i'm trying apply database of images fernmatcher->add(all_images, all_keypoints); fernmatcher->train(); there 20 images, in total less 8mb, extract keypoints using surf. memory usage jumps 2.6gb , training takes knows how long... fern not different rest of matchers. here sample code using fern key point descriptor matcher. int octaves= 3; int octavelayers=2; bool upright=false; double hessianthreshold=0; std::vector<keypoint> keypoints_1,keypoints_2; surffeaturedetector detector1( hessianthreshold, octaves, octavelayers, upright ); detector1.detect( image1, keypoints_1 ); detector1.detect( image2, keypoints_2 ); std::vector< dmatch > matches; ferndescriptormatcher matcher; matcher.match(image1,keypoints_1,image2,keypoints_2,matches); mat img_matches; drawmatches( templat_img, keypoints_1,tempimg, keypoints_2,matches, img...

css - Vertically centering an image within a fixed sized element: offset on the top -

i want display thumbnail images within fixed sized square containers, centering thumbnails horizontally , vertically. using height , line-height , vertical-align css properties, can achieve it, there's small offset on top ( 2px in example) , i'd understand why . as workaround, can set negative top margin image, i'd avoid if possible (more prone breaking across browsers?). i'm surprised need -4px top margin counteract 2px offset. any hint? the fiddle: http://jsfiddle.net/glauberrocha/n6rme/ hey think want remove margin -minus , add border in ul , li live demo http://jsfiddle.net/n6rme/5/

facelets - Why sometimes there are multiple JSF life cycles invoked? -

i connected simple jsf lifecycle listener webbapp: public class lifecyclelistener implements phaselistener { @override public phaseid getphaseid() { return phaseid.any_phase; } @override public void beforephase(phaseevent event) { system.out.println("start phase " + event.getphaseid()); } @override public void afterphase(phaseevent event) { system.out.println("end phase " + event.getphaseid()); } } on 1 of pages have smth this: <h:form> <h:commandlink id="avdertaddedtomainpage" action="#{topview.showmainpage}"> main page </h:commandlink> </h:form> where topview simple bean configured in faces-config request-scoped: public class topview { public topview() { } public string showaddadvert() { return "addadvert"; } public string showmainpage() { return "itemlist"; } } what makes me wonder that, if click above link, seems work properly, according licecyc...

mysql - Remote Database Access Hosts - Wild Cards -

i'm trying enable computer remotely access mysql database. the website not letting me enter ip address is, need start address % wildcard.(reasons restrictions on free hosting). ip: 192.168.0.78 remote access: %.168.0.% will setting allow ip connect database? 192. * * ip within personal network @ home. go http://www.whatsmyip.org/ . find ip , go there. as wildcard charater, i've never tried it, seems logically correct. try correct ip.

android - uninstall app silently with system privileges -

my app have system privileges. inside firmware, it's located @ /system/app i able install apps silently post install / uninstall apks programmatically (packagemanager vs intents) example app works http://paulononaka.wordpress.com/2011/07/02/how-to-install-a-application-in-background-on-android/ but still can't uninstall apps same way. tried use reflection in installation example. public applicationmanager(context context) throws securityexception, nosuchmethodexception { observer = new packageinstallobserver(); pm = context.getpackagemanager(); class<?>[] types = new class[] {uri.class, ipackageinstallobserver.class, int.class, string.class}; class<?>[] uninstalltypes = new class[] {string.class, ipackageinstallobserver.class, int.class}; method = pm.getclass().getmethod("installpackage", types); uninstallmethod = pm.getclass().getmethod("deletepackage", uninstalltypes); } public void uninstallpackage(s...

Get checkbox values in array according to parent div ;jquery -

i have 3 divs checkboxes in it. <div id="mydiv1"> <input type="checkbox" name="newcheckboxes" value="1" /> <input type="checkbox" name="newcheckboxes" value="2" /> <input type="checkbox" name="newcheckboxes" value="3" /> </div> <div id="mydiv2"> <input type="checkbox" name="newcheckboxes" value="1" /> <input type="checkbox" name="newcheckboxes" value="2" /> <input type="checkbox" name="newcheckboxes" value="3" /> </div> i have working code values in array function updatetextarea() { var allvals = []; var parent = $(this).parent("div"); $('#c_b :checked').each(function () { allvals.push($(this).val...

php - problems with links and submit buttons on a FB app in some browsers -

i'm developing fb application php. it's working browsers. however there problem when press image link or button, happens entire page reloads , stays in same page. if i'm in index.php , link it's set next.php, page reloads , continues in index.php. happens in ie 9, weird thing happens in firefox of friend of mine uses same version on mac (i tested in pcs , worked fine in on firefox, chrome , opera). this problem happened in safari to, able solve change relative urls absolute urls, problem still persists on ie , appears on firefox... i valided code in http://validator.w3.org/ . i'm using win 7. any or suggestions in it's welcome, @ point i'm clueless. here's code: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <?php session_start(); $_session = array(); require_once "configuration/config.php"; $friends = $facebook->api(...

java - Caching singleton in memcache -

i developing in google app engine since 1 year ago , understanding how important warmup time instances. ended idea: possible cache singleton in memcache? example using singleton pattern jdo persistencemanagerfactory. here actual code (as described in documentation): private static persistencemanagerfactory pmfinstance = jdohelper.getpersistencemanagerfactory(<my-name>); does have sense extend jdohelper , write function one: public static persistencemanagerfactory getpersistencemanagerfactorycached(string name) { memcacheservice cache = memcacheservicefactory.getmemcacheservice();; persistencemanagerfactory staticpmf= null; if (cache.contains("jdo_pmf")) { staticpmf = (persistencemanagerfactory) cache.get("jdo_pmf"); } else { staticpmf = jdohelper.getpersistencemanagerfactory(name); cache.put("jdo_pmf", staticpmf); } return staticpmf; } my idea should cache persistencemanagerfactory spe...

r - actual graph missing without error message -

i started trying visualize data using ggplot2 package in r , got point, looks fine. meaning, axis labeled correctly, having right tick-marks etc. the problem although receive no error messages when running code below, actual graph inside plot not showing up. makes kind of hard me figure out, went wrong. suggestions on why (not) happening appreciated much. time <- seq(as.date("2010-04-01"), as.date("2012-02-01"), = "2 months") the vector of dates, used tick-marks. mark every 2nd month beginning earliest date in data until bit after last date. qplot(date, sums/1000, data=sums[(sums$lake=="gollinsee") & (sums$maize=="no maize"),] ,color=location, group=location, main="gollinsee without maize") + geom_line(size=0.7) + geom_point(size=3) + labs(x="date", y=expression("total c [" * g %.% m^-3 * "]")) + scale_x_date(breaks=(time), limits=c(min(time), max(time)), labels=...

sql - foreign key: conflicted with foreign key constraint -

so have 2 tables related each other fk appointment {id, dept.id, datetime, sometable.id, sometableagain.id} task {id, appointment.id, deptlead.id, taskname} deptlead {id, name} so had alter appointment table foreignkey table. dropped keys (task_appointment_fk, appointment_sometable_fk, appointment_sometableagain_fk) altered table add new field , added again everything. last 2 got added no problems. while other 1 (task_appointment_fk) kept giving me message : "alter table statement conflicted forien key constraint "dept_appointment". cconflict occurred in database "mydb" , table "appointment", column "id" so found solutions states there might rows on task has appointmentid value not exist on appointment table. tried inserting rows have same value right. still gives me same thing. thing , want delete rows task make easier doing have drop fks again , same thing on over other tables, , have lot of other tables.. need advice. ...

ios - Simple Cocos2d Iphone Game. Just some basic questions -

i'm making app, sprite has run across screen pressing buttons , jumping , ducking. kind of line runner. anyways, i'm using cocos2d. should using. if is, how make it. im not asking code, basic objectives , should do! much! cocos2d 1 of best platform make game think want can done cocos2d , need know how move object(sprite) across scene , how detect collation. there lots of way move sprite across screen can move cocos2d built in methods. search move method you.

c# - Possible way to make the page session expired in ASP MVC 3? ("Press Back Button after Logout issue" -

i working on mvc3 website user authentication. i have security issue whereby want prevent user relogin pressing button after log out page. i had research many solutions, not understand how apply project. possible in mvc3? you not re-logging, viewing page browser cache. if try debug, see no code executed on button on browser. if try click after logging out , pressing back, redirected login page(if left default mvc3 app behavior). there several solutions, , take: you can make custom actionfilterattribute, prevent caching on controllers, or/and actions this, apply action/controller: public class noclientcache : actionfilterattribute { public override void onresultexecuting(resultexecutingcontext filtercontext) { filtercontext.httpcontext.response.cache.setexpires(datetime.utcnow.adddays(-1)); filtercontext.httpcontext.response.cache.setvaliduntilexpires(false); filtercontext.httpcontext.response.cache.setrevalidation(httpcacherevalid...

c# - External Web page is not loading everytime in htmlagility pack -

i using htmlagilitypack scrape part of webpage. getting actual output not always. htmlagilitypack.htmlweb web = new htmlweb(); web.useragent = "mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.8.0.4) gecko/20060508 firefox/1.5.0.4"; htmlagilitypack.htmldocument doc = web.load(url); var resultpricetable = doc.documentnode.selectnodes("//div[@class='resultsset']//table"); resultpricetable coming null in cases(nearly 50%).from debugging found htmlagilitypack.htmldocument doc = web.load(url); is causing issue. not loading url. how fix issue ? thanks in advance. try load page via webclient or httpwebrequest/httpwebresponse , send result htmlagilitypack this code sample try download page 5 time if empty string or webexception in production code don't skip exceptions, need handle (or @ least log it) sample: string html = string.empty; int tries = 5; while (tries > 0) { u...

Android layouts view scrolable texts in a page with other buttons -

i new @ android , try make page scrollable texts. using relative layout linear layout , scroll. somehow texts not paint begining. the first 3 lines not drawn (title1,title2, title3) because outside scroll area. why? scroll works/shows fine in specified area 2 buttons below: set here android:layout_below="@id/button_s" android:layout_above="@id/button_c" margins of scroll still text displays outside margins. wrong? why linear layout lin2 in draw texts starts top of screen? set android:layout_below. here code: main.xml: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/relative_layout" android:layout_width="fill_parent" android:layout_height="fill_parent"> <textview android:id="@+id/tv" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignparenttop="...

c# - About mouse move event in WP7 Phonegap -

i trying create application phonegap windows phone 7.1. there no touch event supported in ie9 mobile (browser in wp7.1). mouse events have use instead. fine till have click button, or link. if have use plugins phonegap scroll or slider or drag , drop elements, doesn't work. found mousedown , mousemove events call @ same time. i have downloaded thumbs.js https://issues.apache.org/jira/browse/cb-112 but didn't help. i have tried : function onbodyload() { document.getelementbyid('divtest').attachevent('onmousemove', mouseeventmove); } function mouseeventmove(e) { document.getelementbyid('divtest').innerhtml = e.clientx + " & " + e.clienty; } but mouseeventmove() called after combination of mousedown , mouseup, i.e. click. after adding thumbs.js , replacing onbodyload() function onbodyload() { document.getelementbyid('divtest').attachevent('ontouchmove', mouseeventmove); ...

java - Is teneo / hibernate allow me to delete subtree out of the box? -

i have rather complex domain model, implemented in emf , persisted teneo/hibernate/mysql. have subtree of model (subtree in sense of 'containment') no element of subtree referenced outside subtree (only references elements 'contained' in subtree other elements 'contained' in subtree). i want delete subtree , remove root element collection conatained in. expect work without problems references inside subtree. anyway exceptions mysql foreign key violations encountered. hence deletion fails. deletion process expected work? or teneo/hibernate not clever remove elements in correct order? the exception message: com.mysql.jdbc.exceptions.jdbc4.mysqlintegrityconstraintviolationexception: cannot add or update child row: foreign key constraint fails (`ide`.`equip_equipment`, constraint `equip_equipment_usagedomain` foreign key (`component_ud_id`) references `ud_component` (`id`)) update: cascade policies follows: hibernateproperties.setproperty(persistenceo...

Targeting in Ajax/jQuery tab system -

i'm planning ajax tab system using jquery based on code @ this website (see demo here ). it's foundation i've been able work despite rather limited knowledge. however, i'm wondering if has ideas how extend functionality slightly, allow tabs targeted within content container. for example: tab 1 has text associated it, , i'd able include hyperlink within text switch tab 3 (much if you'd clicked on "tab 3" itself). thanks in advance. just assign link tab, targeting. assign link element, on want set link. jquery-ui tabs easily, alongwith other great functionalities well.. i recommend should using jquery-ui tabs. let me know if clear.

ruby on rails 3 - wrong number of arguments (2 for 1) -

what error? argumenterror in brandscontroller#index wrong number of arguments (2 1) code index in controller is: def index @brands = brand.all #@brands = brand.paginate :page => params[:page],:per_page => 6 respond_to |format| format.html format.xml { render :xml => @brands.to_xml } end end my code view of index.html.haml is: - content_for :title listing brands - content_for :div listing brands - content_for :subnav #navigation-search /= yield :brand_img %img{:src => "images/lifestyle.gif", :height => "35"} /= link_to 'change brand', new_brand_path %a.metro-16{:href => new_brand_path, :title => "change brand"} change brand = render :partial => 'updatemesg' - content_for :brand_img %img{:src => "images/lifestyle.gif", :height => "35"} -# - content_for :subnav #navigation-search %form #{yield :brand_...

how to do multiple facebook accounts login in android? -

i creating android application user can post messages , updates status on facebook different facebook accounts possibility multiple facebook login same(my) app, please provide me suggestions how can in android. thanks.. if using fb android sdk authentication login bound logged in user in main facebook app (katana) on mobile device (in case it's installed). even if sign user out application next time opens application same user still used since logged in using facebook app. if user logs out of facebook app , logs in using different account, app able use account. what can authenticate user without sso. in case, case in facebook app not installed on device, authentication happening using sdk opens oauth dialog. problem approach user needs enter e-mail , password, not fun task mobile devices. if decide go approach read thread: how disable facebook single sign on android - facebook-android-sdk

bluetooth - Hcitool scan detect mobile but Bluez Inquiri not -

i'm trying rssi of android , apple mobiles. i can detect them hcitool scan when run program bluez inquisitor can't detect must recent mobiles. old nokia , apple mouse, program can detect others no... i'm using bluez 3.36... should detect rssi value of newest mobiles?

How do I use a C# reserved keyword as a property name without the @ prefix? -

i need design class 1 property name has return , when create property name return error. after research found out 1 can use reserved keyword property or variable name adding @ prefix in c#, or enclosing in square brackets [] in vb.net. example: var @class = new object(); so here class design code. public class person { string _retval; public string @return { { return _retval; } set { _retval = value; } } } ... person p = new person(); p.@return = "hello"; now not getting error, when try access property name return need write name @return , don't want. want access property name p.return = "hello"; instead of p.@return = "hello"; i'd know if there way that? you can't. reserved keyword . means "you can't". contrast "contextual keywords" means "we added later, needed work in pre-existing scenarios". the moderate answer here is: use @return . a bett...

java - Hibernate querying -

i'm sorry maybe foolish question. have products , orders tables (with many-to -many relationship), have user table. , want product count user_id , special field "order_satus". can make 2 queries order special criteria , size of product in order. not optimal @ all. when use jdbctemplate did lot of joins , 1 query. here entities: @entity @table(name = "shop.order") public class order { @id @column(name = "order_id") @generatedvalue(strategy = generationtype.auto) private long orderid; private long user_id; @column(name = "databegin") private date datebegin; @column(name = "dataend") private date dateend; @manytoone(fetch = fetchtype.lazy) @joincolumn(name = "user_id", insertable = false, updatable = false) private user user; @manytomany(fetch = fetchtype.lazy) @jointable(name = "order_product", joincolumns = { @joincolumn(name = "order_id") }, inversejoincolumns = { @joincolumn(name = "p...

How to check out specific version of a submodule using git submodule? -

how go adding git submodule specific tag or commit? submodule repositories stay in detached head state pointing specific commit. changing commit involves checking out different tag or commit adding change parent repository. $ cd submodule $ git checkout v2.0 previous head position 5c1277e... bumped version 2.0.5 head @ f0a0036... version 2.0 git-status on parent repository report dirty tree: # on branch dev [...] # # modified: submodule (new commits) add submodule directory , commit store new pointer.

javascript - Loop through a list and get an elements image id? -

$('#newsimagegallery li').each(function() { alert($(this)); }); in each of li have image id, how can alert images id? $('#newsimagegallery li').each(function() { alert($(this).find("img").attr("id")); }); or of course, without find: $('#newsimagegallery li img').each(function() { alert($(this).attr("id")); }); and pointy mentions underneath, if use jquery 1.6+ you're better off using .prop instead of .attr: $('#newsimagegallery li img').each(function() { alert($(this).prop("id")); });

java - How to exclude date stored in database to a range? -

i have table "holidays" in database, contains range of days when it's holidays, defined 2 column : start & end. holidays (id, name, start, end) now, if have in input, 2 dates (from & to), i'd list dates not in holidays. suppose holidays 2012/06/05 2012/06/20 , , request : from=2012/06/01, to=2012/06/10 ; result 01, 02, 03, 04 from=2012/06/01, to=2012/06/22 ; result 01, 02, 03, 04, 21, 22 from=2012/06/15, to=2012/06/22 ; result 21, 22 but can't figure out how list of "opened" days without hitting database every days requested in range from->to. how do? thanks help! there many solutions, pretty depends on how many entries have in database , how many requests do. if making lot of request, can thing this: -> create boolean array determine if day holiday or not; first element points predefined date (e.g. 1.1.2012), second element 2.1.2012, etc. -> initialize array 0 -> each holiday -> make loop...

assert - JavaScript contracts and assertions -

this has bugged me while. throw exception on assertion failure, helpful if can catch exception (in case alert user). if can't catch exception, then i'm relying on browser notify user there's been internal error (the browser may nothing, user never finds out there's problem), and i don't look-in, , can't clean up. so, there way handle assertion errors in javascript? there way catch uncaught exceptions? note i'm not interested in unit testing, user errors, , on - i'm concerned contract programming, both user , developer need know there has been error. for assertions, there console.assert() . log message , go on. with html5 possible catch unhandled exceptions using window.onerror handler. there's excellent article on dev.opera how can used show fancy error messages user , log exceptions server. if can't use that, you're left wrapping try-catch-clauses around (especially "execution entry points" event handlers...

java - Controlling when object is created -

suppose need create object follows , set values filemetadata filemeta = filecontainer.getmetadata(); filemeta.setfilename("file name"); filemeta.setserver("my box"); filemeta.setdirectory("/path/to/dir"); filemeta.setfiletype(filetype.properties); i later intend use object reference useful. i'd recognize fact possible user of system not set fields, instance, 1 may forget filemeta.setdatemodified(12345); is somehow possible guarantee (or specific) fields set before making object available? there nothing in language enforce (except having lone visible constructor takes required parameters), can idiomatically, variation on builder pattern , method chaining: filemetadata filemeta = new filemetadatabuilder(filecontainer.getmetadata()) .setfilename("file name") .setserver("my box") .setdirectory("/path/to/dir") .setfiletype(filetype.properties) .build(); the...

android - Start Activity Using Custom Action -

i looking start activity in app using custom action. have found few answers try throws java.lang.runtimeexception saying no activity found handle intent { act=com.example.foo.bar.your_action }. this activity in manifest file: <activity android:name=".feedbackactivity" > <intent-filter> <action android:name="com.example.foo.bar.your_action" /> </intent-filter> </activity> and how i'm starting activity: intent intent = new intent("com.example.foo.bar.your_action"); startactivity(intent); any appreciated. i think creating intent wrong. try this: string custom_action = "com.example.foo.bar.your_action"; //intent = new intent(this, feedbackactivity.class); // <--- might need way. intent = new intent(); i.setaction(custom_action); startactivity(i);

redistributable - Redistribute dll files -

i reading manual , found following information: your application should: link against assembly “streamsdk_dotnet.dll”. redistribute: “streamsdk_dotnet.dll” “streamsdk_cpp.dll” “microsoft.vc8.crt” (x86) or “microsoft.vc9.crt” (x64). have .net framework 2.0 or later installed. the managed code in assembly requires unmanaged code in c++ sdk i not sure how redistribute dll files in program. suggestion? well, zip files together, , distribute that, or use program create installers stuff such this: http://www.advancedinstaller.com/ , include dll files parts of program, install , can give out single installer msi package.

java - Find app's CPU usage on Android -

is there android api provides cpu, memory usage of running app? tune processing in app on fly based on cpu usage. this question has been answered here . can listing using adb follows, adb shell top -m 10

java - App Engine Channel API Connection and Disconnection -

i have read section, tracking client connections , disconnections , in channel api java documentation. it has following code: // in handler _ah/channel/connected/ channelservice channelservice = channelservicefactory.getchannelservice(); channelpresence presence = channelservice.parsepresence(req); how create handler _ah/channel/connected/ or _ah/channel/disconnected ? want notify or alert connected users when user disconnected. you create handlers other handler. put in app.yaml like: - url: /_ah/channel/connected/ servlet: com.[my_app].server.channel.channelconnected name: channelconnected - url: /_ah/channel/disconnected/ servlet: com.[my_app].server.channel.channeldisconnected name: channeldisconnected

android - how to expand a list in expanded list when user click on a button in the list -

i have expandablelistview containing groupviews , childviews. groupviews contains 3 textviews , 2 imageviews. onclick of second imageview grouprow should expanded child rows should displayed.. how should this..? can 1 please me? hi here answer of question find link it possible. there lot of ways it. example visit android - accordion widget

c# - Get all users, only when they don't occur in another table -

i have 2 tables. 1 user table , 1 table in results placed of test. when user takes test result , user_id placed in results table. when user never took test user_id won't in results table. i need users not in results table. there way in 1 query? (entity framework) getting users easy. need way link results table see of users want in result set. (from u in entity.users [where not in results table..??] select u); fully working example, using mock objects: using system; using system.collections.generic; using system.linq; using system.text; namespace consoleapplication1 { class program { static void main(string[] args) { var userstakentest = new list<string>() { "bob", "jim", "angel" }; var allusers = new list<string> { "bob", "jim", "angel", "mike", "jimbobhouse" }; var users = user in allusers ...

500 Internal Server Error when using .htaccess for PHP Settings -

when using .htaccess following php settings, getting 500 internal server error while accessing website. the code in .htaccess file: php_flag display_errors off php_flag log_errors on the file permission .htaccess file 644 i know code above correct. when showed me 500 internal server error , tried different code (most wrong) too, nothing worked. different code tried are: php_value display_errors off php_value log_errors on and php_value display_errors 0 php_value log_errors 1 what can cause of 500 internal server error ? after learning comments on question, found php settings on .htaccess not work fastcgi. so, change php settings, need modify php.ini or need in php code. there alternate way, when don't have access modify php.ini file , don't want individually modify php files? like comments above said: need run php module dynamic shared object make work, described in apache php request hanlding documentation dso considerations: l...

Open Type / Resource in Eclipse .jars through shortcuts? -

Image
so in eclipse, i'm aware if have included sources in maven dependencies, jdk, can open type see it's implementation (type ctrl+t ): this great .java classes, don't appear have quick shortcut open resources other java .class es. instance, clojure , jruby , both .jar sources, sources themselves. is there way ctrl+t or "open resource" equivalent ( ctrl+shift+r ) open resources held in .jar files? no. per knowledge, there no keyboard shortcuts in eclipse open resource file jar. classes can accessed ctrl+t . have use package explorer navigate contents in jar file.

c# - Declaring an empty Queryable? -

how declare such variable? var rdata = nc in ctx.newsletter_clients join ni in ctx.newsletter_indices on nc.index_num equals ni.index_num select new { clientid = nc.client_id, email = nc.client_email_address, index = nc.index_num, mainclass = ni.main_class, subclass = ni.sub_class, app1 = ni.value_1, app2 = ni.value_2, app3 = ni.value_3, app4 = ni.value_4 }; // need declare on variable named fdata under function scope, // can later use it: var fdata = ...; //what declare here? if(x) fdata = fdata.concat(rdata.where(u =>...

ms access - SQL: Using Textbox value in "LIKE" query condition -

sql: so, i'm trying make query condition comparing "row" values value of textbox placed in form (using ms access '10) use of wildcards, , line propably wrong in bold part , got little idea do: select table.* table (((table.row) like '%"[forms]![someform]![texbox1]"%')); ideas? somehow (((table.row)=[forms]![someform]![textbox1])); works search full string. where table.row alike '%' & [forms]![someform]![texbox1] & '%' in ansi 89 mode ... where table.row '*' & [forms]![someform]![texbox1] & '*' in ansi 92 mode ... where table.row '%' & [forms]![someform]![texbox1] & '%' or use instr() instead of like comparison. where instr(1, table.row, [forms]![someform]![texbox1]) > 0

android - How take a photo without saving it? -

hey i'm trying use android's camera without saving image sd card. want user able take photo (with preview), preform modifications , choose if save or not. now in this question did work around deleting image after it's saved, dosen't seem right choice me. how can achive this? isn't there built in option that? this looks nice sample of taking image camera preview without file being created: http://marakana.com/forums/android/examples/39.html do note image taken can quite large , memory used might large . should consider sampling in such cases .

c# - Linq + foreach loop optimization -

so found myself writing loop similar one: var headers = new dictionary<string, string>(); ... foreach (var header in headers) { if (string.isnullorempty(header.value)) continue; ... } which works fine, iterates through dictionary once , need do. however, ide suggesting more readable / optimized alternative, disagree: var headers = new dictionary<string, string>(); ... foreach (var header in headers.where(header => !string.isnullorempty(header.value))) { ... } but wont iterate through dictionary twice? once evaluate .where(...) , once for-each loop? if not, , second code example iterates dictionary once, please explain why , how. the code continue twice fast. i ran following code in linqpad, , results consistently clause continue twice fast. void main() { var headers = enumerable.range(1,1000).todictionary(i => "k...

graph - gnuplot to plot muliple data set from a file and group all this bars -

Image
i want plot column 3 , 4 bars each data set in file, data set identified multiple newline , referred using index show in script below. can draw data "linespoint". graph looks my graph . want plot data "boxes" i want graph this . x-axis have column 3 (1,2,3) , y-axis have column 4, each value of x (1,2,3) there should 2 bars, 1 index 0 , second index 1. data file looks like: 2-100 2 100 1 3.10 249 2 100 2 3.41 250 2 100 4 3.70 249 3-100 3 100 1 3.10 252 3 100 2 3.48 252 3 100 4 3.72 254 2-100 3-100 used title "first row of block , first column", first 4 lines read "index o" in script , second 4 lines "index 1" script used: plot \ "$1" index 0 using 3:4 boxes fs solid title columnhead(1),\ "$1" index 1 using 3:4 boxes fs solid title columnhead(1) i've reformatted datafile little bit (at least, if underst...

omniauth - OAuthException 101 in rails 3.2 app -

i error in app { "error": { "message": "missing client_id parameter.", "type": "oauthexception", "code": 101 } } what i've done: - have config/initializers/omniauth.rb file containing: rails.application.config.middleware.use omniauth::builder provider :facebook, env['my app id:'], env['my app secret'] end i have view containing link_to "log in facebook", "/auth/facebook" my app not embeded in facebook , error happens in online app (not localhost) here gemfile gem 'rails', '3.2.2' gem 'fbgraph' gem 'omniauth' gem 'omniauth-facebook' gem 'mysql2' gem 'less-rails' group :assets gem 'less-rails' gem 'coffee-rails', '~> 3.2.1' gem 'twitter-bootstrap-rails' gem 'therubyracer' gem 'uglifier', '>= 1.0.3' end gem 'jque...

vb.net - menustrip menu dropdown items names appear blank in msgbox -

i have on form load add items menu dropdown item. from within same sub try output menustrip dropdown items in msgbox blank response items. private sub populateloadchildmenu() msitemload.dropdownitems.clear() dim fi fileinfo if directory.getfiles(_playlistpath).length > 1 msitemload.enabled = true end if each fi in _files msitemload.dropdownitems.add(path.getfilenamewithoutextension(_playlistpath & fi.name)) next each mymenuitem toolstripmenuitem in msitemload.dropdownitems txblist.text = txblist.text & ", " & mymenuitem.tag next end sub i use in sub this private sub formload(byval sender system.object, byval e system.eventargs) handles mybase.load dim fi fileinfo msitemload.enabled = false if directory.getfiles(_playlistpath).length = 1 each fi in _files loadplaylist(_playlistpath & fi.name) next end if populateloadchildmenu() end sub ...

c++ - Every time I try to build a simple "hello world" I always get 2 errors -

i'm using visual studio 2010. every time try build simple "hello world" 2 errors. here's code:: #include <iostream> using namespace std; int main () { cout << "hello world!"; return 0; } error 2 error lnk1120: 1 unresolved externals c:\users\hershell kurt\documents\visual studio 2010\projects\test\release\test.exe test error 1 error lnk2001: unresolved external symbol _winmain@16 c:\users\hershell kurt\documents\visual studio 2010\projects\test\test\msvcrt.lib(crtexew.obj) test how fix this? strange, created empty project , pasted code , works fine me. make sure created project win32 console application , in window appears click next , select "empty project".

c++ - How do you save objects with variable length members to a binary file usefully? -

i'm working c++ , writing budget program (i'm aware many available--it's learning project). i want save call book object contains other objects such 'pages'. pages contain cashflows , entries. issue there can amount of entries or cashflows. i have found lot of information on saving data text files not want do. i have tried looking using boost library i've been told serialization might solution problem. i'm not entirely sure functions boost going or proper ways use boost. most examples of binary files have seen objects have fixed size members. example, point might contain x value , y value both doubles. case simple use sizeof(point). so, i'm either looking direct answers question or useful links information on how solve problem. please make sure links specific question. i've posted same question on cplusplus in general, there 2 methods store variable length records: store size integer first, followed data. store data, app...

html - How I can set the background image to table cells that have a colspan? -

i use css set background cell not apply whole cell. i trying set background image first , last <tr> , it's showing this. i trying apply .first class property first , last <tr> . should applies tr? <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>untitled document</title> <style type="text/css"> .excel{ background:url(smallimage/excel.jpg); background-size:24px 24px; background-repeat:no-repeat; position: relative; margin:3px; left: 2px; top: 1px; } td.yellostar{ background-image: url(smallimage/yellowstar.jpg); /* forward slash path */ width: 20px; /* use own image size; */ height: 20px; /* use own image size; */ background-repeat: no-repeat; background-posit...