Posts

Showing posts from September, 2013

c# - Expression Tree Serializer -

i want use linq expressions on client side, serialize them , execute them on server side. for want use: http://expressiontree.codeplex.com/ but want execute them agains own wcf call. that means have call on wcf side: imagedto[] getimages(xelement exp); i want have iqueryable on client side (on can execute linq expressions), , have iqueryable on serverside (from data acess layer, on wich want execute serialized expression). but i'm not sure how this, , don't find examples... on client side think should implement query in class, class tell in constructor use implementation of queryprovider (from call wcf service). i'm not sure if correct... maybe can example. there's implementation of iqueryable<t> in framework - msdn: enumerablequery<t> if can use on client build query, can whole expression tree iqueryable<t>.expression property. you'll have test see if works expression tree serializer. var iqueryable = new enume

javascript - Ajax simple example not working -

i haven't used ajax in while , can't simple program work, doing wrong ? <script type = "text/javascript" src = "jquery-1.9.1.min.js"></script> <script type = "text/javascript"> alert(""); var count = 0; $.ajax({ url: 'get.php', datatype: 'json', success: function () { alert(""); } }); alert(""); </script> <?php echo "yay"; ?> thanks setting datatype "json" means response get.php parsed json. if it's not valid json or response empty, request fail. if url incorrect (can't found...http 404 error), request fail. the default type of request "get", if get.php doesn't allow "get" (for reason), return http error, , request fail. if there's error

visual studio - Create a Sharepoint site populated with default settings for an existing team project in TFS 2012 -

has microsoft addressed difficulty of creating sp site after creating team project in tfs 2012? aware of methods outlined here , hoping had come slicker in new version. if not, know of better method or tool 1 suggested in previous link? the tfs power tools has command tfpt addprojectportal create sharepoint site after team project has been created. need know process template used create team project. able find options need command using /? switch.

oauth 2.0 - Google+ Sign-In - stop requesting people you're connected with -

is there way make google+ sign-in not request user's "list of people you're connected on google+"? my goal use g+ sign in authentication purposes today, , in future use social sharing functionality. owner/operator of service requesting sign in don't care in user's circles. is possible remove request of people user connected with? missing this? example if didn't request of user's connected people user no longer able share them? i'm aware of google openid sign in functionality, doesn't provide functionality i'd future. whenever use google+ sign-in button, scope plus.login added. such, request "know on google+" , "list of people connected with". few notes on this: the user has control on people share if don't want share information, it's within control. if you're interested in information in future - using existing connections people have great way make site better - access available y

java - How to deselect an item in a jList after a certain ammount of milliseconds on a mouseExit event -

i have jlist called todolist when user click on item in list, stays selected. selected item in list deselect "by itself" after 400 milliseconds when mouse exits jlist. this must run if there selected in list. i using netbeans ide , have tried far: private void todolistmouseexited(java.awt.event.mouseevent evt) { if (!todolist.isselectionempty()) { thread thread = new thread(); try { thread.wait(400l); todolist.clearselection(); } catch (interruptedexception ex) { system.out.println(ex); } } } and private void todolistmouseexited(java.awt.event.mouseevent evt) { if (!todolist.isselectionempty()) { thread thread= thread.currentthread(); try { thread.wait(400l); todolist.clearselection(); } catch (interruptedexception ex) { system.out.println(ex);

PHP check for valid function return -

i have code: $myvariable = somerandomfunction($blah) the problem somerandomfunction() might return array, object, empty array, boolean value or null. what if best way check $myvariable has data? right i'm doing this: !empty($myvariable ) will cover cases? or maybe should ($myvariable != null && !empty($myvariable )) ? update* by 'some data' mean true if bool, not empty array, , value other null var_dump(empty(null)); // returns bool(true) empty enough. if boolean no data, check !is_bool. ( empty(false) returns true ) or better, use if ($result) ; should enough. or call "some data"? update: need: php > var_dump(!empty([])); bool(false) php > var_dump(!empty("")); bool(false) php > var_dump(!empty(false)); bool(false) php > var_dump(!empty(true)); bool(true) php > var_dump(!empty(null)); bool(false

GeoServer WMS crashes -

i'm using winxp (sp3), geosever 2.3.0 jre 1.6 , trying layer displayed wms. using layer preview feature of geoserver admin web interface (geoserver/web), causes geoserver throw exception of wms formats. fresh install of geoserver. have tried jre 1.7 no change in behavior. insight appreciated. request: getmap filters = null palette = null tiled = false srs = epsg:26713 featureversion = null styles = [styleimpl[ name=capitals]] layers = [org.geoserver.wms.maplayerinfo@6f893642] maxfeatures = null bbox = referencedenvelope[590223.4382724703 : 608462.4604629107, 4914107.882513998 : 4920523.89081033] remoteowstype = null remoteowsurl = null env = {} formatoptions = {} angle = 0.0 cqlfilter = null elevation = [] featureid = null startindex = null viewparams = null crs = projcs["nad27 / utm zone 13n", geogcs[&qu

wpf c# button wait for a button press -

ok i'm begginer @ coding so i'm trying button gonna wait for user click on 1 of multiple other button continue void mainbutton() { //the program run throw method //wait user choose 1 button (i made numeric pad buttons) //then use information work } i know english isnt lot try this: bool gotresponse = false; //you need run maintask in different thread thread thread = new thread(new threadstart(dowork)); thread.start(); void dowork() { //do work //when else needed user popup message messagebox.show("say whatever need say"); while(!gotresponse) { //note: loop doesn't stop until gotresponse = true; } //do rest of work } private button_click(object sender, routedeventargs e) { gotresponse = true; }

php - What is user_data in CodeIgniter session used to? -

when in codeigniter run var_dump($this->session->all_userdata()); prints array (size=5) 'session_id' => string '3403084ad9f5e2582a8d9269ceb68fb7' (length=32) 'ip_address' => string '127.0.0.1' (length=9) 'user_agent' => string 'mozilla/5.0 (compatible; msie 10.0; windows nt 6.1; trident/6.0)' (length=64) 'last_activity' => int 1365456079 'user_data' => string '' (length=0) since these automatically filled in values ci, i'm wondering if could/should overwrite user_data index, e.g 'user_data' => $username. if ci keep update index, not work. must store session-data own indexes. experience on ci knows fixed index in session array used for. there no documentation it. the user_data field used session params once want put session value use do: $this->session->set_userdata('x','y'); the userdata('x') stored in user_data

python - Running Boto on Google App Engine (GAE) -

i'm new python , hoping on how 'import boto.ec2' on gae python application control amazon ec2 instances. i'm using pydev/eclipse , have installed boto on mac, using 'import boto' not work (i get: : no module named boto.ec2). i've read boto supported on gae haven't been able find instructions anywhere. thanks! it sounds haven't copied boto code root of app engine directory. boto works gae google doesn't supply code. once copy root of gae directory, dev server should work, , after next upload work on prod server well.

JSON Fields are Undefined (Javascript) -

Image
i'm getting json servlet , turning responsetext json object using json.parse(). chrome developer tools shows json object having data want, when try access bunch of 'undefined's. am not interpreting data correctly? screenshot of chrome developer tools: and briefly, code output data: (var = 0, len = jsonobj.length; < len; ++i) { // setup result... var resultrow = document.createelement("tr"); resultstable.appendchild(resultrow); var result = jsonobj[i]; // name var covercell = resultrow.insertcell(0); covercell.innerhtml = result.name; } jsondata seen in screenshot passed output function jsonobj. the key trying access seems have @ character @ front. since @ character not valid identifier , therefore can't use dot-notation, can retrieve value using bracket notation: covercell.innerhtml = result['@name'];

css - Mix two SASS variables inside a loop -

this question has answer here: creating or referencing variables dynamically in sass 5 answers i have few scss variables looks : $box-bg1: #7a8360; $box-bg2: #918261; $box-bg3: #6a8177; $box-bg4: #686f5e; i want use these variables inside for, : @for $i 1 through 4 { .locationbox:nth-child(#{$i}) { background: $box-bg#{$i}; } } after compiling code error : syntax error: undefined variable: "$box-bg", looks #{$i} variable not make sense code. there way use variable inside loop this? note : use compass sass not support variable variables. programatically create selectors, have using lists: $box-bg: #7a8360, #918261, #6a8177, #686f5e; @for $i 1 through length($box-bg) { .locationbox:nth-child(#{$i}) { background: nth($box-bg, $i); } } output: .locationbox:nth-child(1) { background: #7a8360; } .locationbox:nth-child(2) { b

Strange issue with In App-purchase system IOS, sandbox and live App Store environments -

i have developed in app-purchase system ios app. have tested in apple sandbox-environment , works great. far have made simple solution saving receipt locally in app after being purchased. but once live @ app store strange bug occurred. if user purchased app , shuts down (the app) , restarts again receipt gets lost, reason?. since not able recreate bug in sandbox-environment can not debug code , not know start. i find scenario odd , confusing, if ever experienced similar or have built many in-app purchase systems within ios, please share knowledge or ideas.

php - Mysql query with many join's takes long time to load -

Image
i using query record select * (`content` c) left join `content_assets` ca on `ca`.`contentid` = `c`.`id` left join `assets` on `a`.`act_id` = `ca`.`actorid` inner join `content_gens` cg on `cg`.`contentid` = `c`.`id` inner join `gens` g on `cg`.`genid` = `g`.`gen_id` left join `live_data` l on `l`.`contentid` = `c`.`id` left join `live_type` lt on `lt`.`lt_id` = `l`.`live_type` left join `returned` r on `r`.`content_id` = `c`.`id` `c`.`id` = '14175' my live_data table main issue here causing load time, contains 200k records , taking 20-40 seconds load page. if dont join table fine. using file based caching cache result above query know if above query can optimized more. edit: table indexes can seen here. -- phpmyadmin sql dump -- version 3.4.5 -- http://www.phpmyadmin.net -- -- host: localhost -- generation time: apr 08, 2013 @ 11:07 pm -- server version: 5.5.16 -- php version: 5.3.8 set sql_mode="no_auto_value_on_zero"; set time_zone = "+00:00&quo

css - Element losing "hover" status when a child <select>'s options are hovered -

i have mega menu on (currently private) site. inside 1 of dropdowns <select> element enough options when they're expanded, list goes below bottom of mega dropdown. in ff & chrome, dropdown stays expanded. in ie though dropdown no longer thinks it's being hovered over, , hides see effect here: http://jsfiddle.net/ehsf8/ . the menu shown , hidden css (so no event munging think). have support down ie8. can use javascript , jquery if absolutely necessary. any ideas? the <select> type of control browser, means, doesn't follow dom structure components. though technically on #tohover , expanded <select> doesn't convey browser. this not case internet explorer. checking in chrome, same, in when click on <select> , go ahead hovering options, hover state removed. solution you can think of replacing whole thing ul , li , make mouse on css menu, works well. html <ul class="nav"> <li>

java - How to read XML returned by HTTP POST request? -

not duplicate of other question. i sending post request this: string urlparameters = "a=b&c=d"; string request = "http://www.example.com/"; url url = new url(request); httpurlconnection connection = (httpurlconnection) url.openconnection(); connection.setdooutput(true); connection.setdoinput(true); connection.setinstancefollowredirects(false); connection.setrequestmethod("post"); connection.setrequestproperty("content-type", "application/x-www-form-urlencoded"); connection.setrequestproperty("charset", "utf-8"); connection.setrequestproperty("content-length", "" + integer.tostring(urlparameters.getbytes().length)); connection.setusecaches(false); dataoutputstream wr = new dataoutputstream(connection.getoutputstream()); wr.writebytes(urlparameters); wr.flush

css - Invalid Property value in Safari but working in Chrome -

i'm getting invalid property value on image in safari following: sidebar-first{ padding-left:10px; background: url(images/arrow-lrg-right@2x.png) no-repeat scroll 2px 6px / 5px 9px transparent; -moz-background-size:5px 9px; -ie-background-size:5px 9px; -o-background-size:4px 9px; -webkit-background-size:5px 9px; background-size:5px 9px; } it works fine in chrome , others not sure issue can else see it? cheers.

jquery - Javascript not executed? -

i not understand why 'alert' javascript not executed on page... when clicking on first step menu, second 1 displayed expected point no more javascript executed , not alert displayed. this simple page using jquery remove/add class. here code: <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>hello world jquery</title> <link href="style.css" rel="stylesheet" type="text/css"> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript"> function displaystep2() { $("#searchstep1").addclass("displaynone"); $("#searchstep2").removeclass("displaynone"); } function displaystep3() { alert('hello, world!');step } </script> </head> <body>

ios - XCode 4.6 OpenGL|ES integrated performance tools with custom build script -

i have large ios project complex custom build script written in jam. app compiled through run script build phase. when run app on device xcode performance tray fps counter under debug navigator doesn't show up. for simple xcode opengl|es sample application performance tray shows fine. is there can check/do integrated opengl|es performance tools work properly? the answer turns out going product->scheme->edit scheme , in options tab changing opengl es frame capture automatically enabled enabled.

objective c - URL-encode a nested NSDictionary in AFNetworking -

i'm trying perform http request passing along normal nsdictionary contains mix of primitive types array of nested nsdictionarys. i'm passing in dictionary getpath method of afnetworking, , fails error code this: afnetworkingoperationfailingurlrequesterrorkey=http://eatup.herokuapp.com/create/event?description=asfasf&host=100002448015520&locations%5b%5d%5bfriendly_name%5d=qdoba%20mexican%20grill&locations%5b%5d%5blat%5d=40.4413066&locations%5b%5d%5blink%5d=http%3a%2f%2fwww.yelp.com%2fbiz%2fqdoba-mexican-grill-pittsburgh&locations%5b%5d%5blng%5d=-79.95717399999999&locations%5b%5d%5bnum_votes%5d=0&timestamp=1365471302803.915&title=as>, nserrorfailingurlkey=http://eatup.herokuapp.com/create/event?description=asfasf&host=100002448015520&locations[][friendly_name]=qdoba%20mexican%20grill&locations[][lat]=40.4413066&locations[][link]=http%3a%2f%2fwww.yelp.com%2fbiz%2fqdoba-mexican-grill-pittsburgh&locations[][lng]=-79.9

c++ - Making my do while loop neater by removing repeating code -

hi here question. write program uses do-while statement. reads in integer n keyboard. if n not in range 1 10 makes audible “beep” , asks integer. if n in correct range, writes out “you have input n” , exits. here answer. #include <iostream> #include <windows.h> using namespace std; void main() { int number = 0; { cout << "enter integer." << endl; cin >> number; if (!(number >= 1 && number <= 10)) { beep(400, 400); } } while (!(number >= 1 && number <= 10)); cout << "you have input " << number << endl; system("pause"); } you can see line (!(number >= 1 && number <= 10)) is repeated. there workaround this? #include <iostream> #include <windows.h> using namespace std; void main() { int number = 0; bool invalid_input = true; { cout << "

php cross-domain error - need to replace string? -

i'm using php script pass json data domain javascript file. code works fine responses. however, in few cases there longer values lines broken "\r\n\r\n", , in cases error when try parse results. think maybe "\r\n\r\n" causing error, , hoping replace string space in php script before passing on javascript, i'm not sure how - i'm newbie. php script: echo "var forecast='"; include(' http://ws1.airnowgateway.org/gatewaywebservicerest/gateway.svc/forecastbyzipcode?zipcode= ' . $zipcode . '&format=json&key=[mykey]'); echo "';"; javascript code: $(document).ready(function() { $.get(url, function(data) { mydata = json.parse(forecast); ... etc. i hoping use str_replace within php script, know i've set wrong, because it's replacing within url itself, not response data: echo "var forecast='"; include(str_replace("\r\n"," &qu

Improve Performance of Grouped UITableView -

i experiencing long loading time grouped uitableview. read through other posts on topic , not able find improve performance. looking point me in right direction in re-engineering code. there 8 sections , 32 cells. cells belong 1 of 5 different custom uitableview cell sub classes. subclasses contain subviews , put using ib. the tableview data generated plist contains information on cell type, label , view controller link pushed uinavigationcontroller. sample of xml file shown below. complicated plist part of problem? <dict> <key>header</key> <string>property information</string> <key>data</key> <array> <dict> <key>tableview</key> <string>informationtable</string> <key>link</key> <string>roipropertyinfouiviewcontroller</string> <key>entity</key&g

google app engine - Improving database record retrieval throughput with appengine -

using appengine python , hrd retrieving records sequentially (via indexed field incrementing integer timestamp) 15,000 records returned in 30-45 seconds. (batching , limiting used.) did experiment doing queries on 2 instances in parallel still achieved same overall throughput. is there way improve overall number without changing code? i'm hoping can pay more , better database throughput. (you can pay more bigger frontends didn't affect database throughput.) we changing our code store multiple underlying data items in 1 database record, there short term workaround. edit: these log records being downloaded system. fix in future , know how so, i'd rather work on more important things first. try splitting records on different entity groups. might force them go different physical servers. read entity groups in parallel multiple threads or instances. using cache mght not work large tables.

cloudfoundry - Does Cloud Foundy platform supports SIP and RTP? -

there conferencing application want build on top of cloud foundry. cloud foundry support sip , rtp protocols? inbound cloud foundry supports http , https through router component, routing traffic on other port application not work.

Google chrome developer tools messed up -

Image
i having issue google chrome developer tools, have become unusable, don't think have done cause this. ideas how can fix it? google chrome 26.0.1410.43 on ubuntu 12.10 i doubt appropriate place ask this, don't know else can? extensions installed: adblock plus 1.4 any.do 1.0.2.5 apt-linker 1.2.2 betterchrome - browse 15% faster 1.0.8 chromify-osd 2.3.0 dilandau 1.1.2 edit cookie 1.2.1 fb unseen 0.1.4 fvd video downloader 5.0.3 google dictionary (by google) 3.0.17 google docs 0.5 google quick scroll 2 invisiblehand 3.8.31 jsonview 0.0.32 mightytext - send/receive sms text messages 9.4 novell moonlight 3.99.0.3 outlook.com notifier 0.1 pendule 1.0.0 postman - rest client 0.8.0.4 rapportive 1.4.1 search image (by google) 1.4.2 straight search 1.17.8 tampermonkey 2.12.3124.133 wappalyzer 2.20 webpage & webcam screenshot 7.3.2 xml tree 1.9.2.1

Javascript while loop variable -

i bit confused why mycounter = mycounter + 1; not require var declared before statement itself. var mycounter=0; var linebreak='<br>'; while (mycounter <= 5) { document.write('hello world' + linebreak); mycounter = mycounter + 1; } the variable initialized on first line. var mycounter=0; this same variable used other 2 lines reference it while (mycounter <= 5) { document.write('hello world' + linebreak); mycounter = mycounter + 1; } if not initialized @ top (missing var keyword) considered 'global' variable. bad practice of course , should define variables in scope need them in. can put "use strict"; statement @ top of file throw exceptions when variables aren't defined.

javascript - Performance vs readability: multiple selectors vs. multiple statements in jQuery/JS -

i'm writing jquery code hides or displays numerous table columns large table @ same time. wanted know if faster use code this: $("selector 1, selector 2, selector 3").css("display", "none"); or code this: $("selector 1").css("display", "none"); $("selector 2").css("display", "none"); $("selector 3").css("display", "none"); so used jsperf.com create performance test case . established first type of code (which uses 1 long string multiple selectors) faster second type of code (which hides columns 1 @ time) 53%. however, time i'm done writing it, borderline unreadable, looking this: $("#table tr *:nth-child(4), #table tr *:nth-child(5), #table tr *:nth-child(6), #table tr *:nth-child(7), #table tr *:nth-child(8), #table tr *:nth-child(9), #table tr *:nth-child(10), #table tr *:nth-child(11), #table tr *:nth-child(12)").css("display

xml - Initial Data Django Fixtures Issue: Installed 0 object(s) from 0 fixture(s) -

i having little trouble importing initial data through xml files. example name file in myapp/fixtures/initial_data.xml: <?xml version="1.0" encoding="utf-8"?> <rows> <row> <model>myapp.nutrition</model> <name>asiago cheese bagel</name> <calories>370</calories> <protein >17</protein > <carbs>56</carbs> <fats>8</fats> <restaurant >au bon pain</restaurant > <price>1.29</price> </row> </rows> and model file looks like: from django.db import models class nutrition(models.model): name= models.charfield(max_length=100) calories= models.integerfield() protein= models.integerfield() carbs= models.integerfield() fats= models.integerfield() restaurant= models.charfield(max_length=100) price= models.decimalfield(decimal_places=2, max_digits=10) when run manage.py loaddata

excel vba followhyperlink method when no workbook is open -

i created custom ui in excel 2007 part of xlam add-in. custom tab includes button opens website when clicked. i used thisworkbook.followhyperlink "address" the add-in password protected causes excel crash whenever click on button while in xlam add-in. works fine when use in .xlsm file. i think problem in thisworkbook being password protected. use activeworkbook instead app crash when there no workbook open. any suggestions how work around this? (unprotecting file not option) including information comment + assumption need work when activeworkbook open... try change thisworkbook activeworkbook in way this: sub followinghyperlink() 'check if there open if not activeworkbook nothing activeworkbook.followhyperlink "http://www.stackoverflow.com" else 'if not... depends have , need 'you open new workbook '**this part of code edited** 'or use technique navigate page using ie: dim ieapp set ieap

java - Servlet 3.0 without a WAR file? -

is possible launch webapp altogether with: 1) no war file: http://stephenh.github.io/2009/01/10/war-less-dev-with-jetty.html http://www.jamesward.com/2011/08/23/war-less-java-web-apps 2) no web.xml (i.e., servlet-3.0) 3) embedded web container (e.g., tomcat or jetty...) example project: https://github.com/jetty-project/embedded-servlet-3.0 you'll still need web-inf/web.xml , it can empty . servlet support level , metadata-complete flags can known. example: empty servlet 3.0 web.xml <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" metadata-complete="false" version="3.0"> </web-app> then can follow embedme.java example on how set up. public class

html5 - Handling canvas.drawImage errors when image.src is unavailable -

what efficient , proper way handle calling drawimage on canvas context when image's src url unavailable. example: myimage.src = "imagedoesnotexist"; canvasctx.drawimage(myimage,0,0); // 0x80004005 - javascript runtime error: unspecified error. thanks! in addition image.onload there image.onerror these occasions var img = new image(); img.onload = function(){ context.drawimage(img,0,0); }; img.onerror = function(){ alert("oops, bad stuff happened while loading image."); }; img.src = "imagedoesnotexist";

android - Not able to scroll Google map with API v2 Horizontally -

i developing application in have integrated google map api v2 . there sliding menu have added @ runtime using horizontalscrollview . problem able scroll map vertically, try scroll horizontally horizontalscrollview gets touch event. this how make layout. layoutinflater inflater = layoutinflater.from(this); view menu = inflater.inflate(r.layout.menu, null); horizontalscrollview hsv = new horizontalscrollview(this) { @override public boolean ontouchevent(motionevent ev) { if (menu_displayed) { return false; } else { return true; } } linearlayout li_body = new linearlayout(this); li_body.setlayoutparams(new layoutparams(layoutparams.wrap_content, layoutparams.match_parent)); li_body.setorientation(0); li_body.setbackgroundcolor(color.transparent); hsv.addview(li_body); textview placeholder = new textview(this); placeholder.settextcolor(colo

c# - Select Contains With CSV But Keep Sort Order -

i have scenario have ilist<guid> in variable called csv in specific order need keep. doing select contains can topics based in list of guids have. the guids lucene search ordered original score each luceneresult. why need keep them in order. var results = _context.topic .where(x => csv.contains(x.id)); however. lose order guids came in this. idea how can keep same order hand list of guids context , topics in same order based on topid.id? i have tried following mentioned below, doing join still come out in same order? please note paging these results too. var results = _context.topic .join(csv, topic => topic.id, guidfromcsv => guidfromcsv, (topic, guidfromcsv) => new { topic, guidfromcsv } ) .where(x => x.guidfromcsv == x.topic.id) .skip((pageindex - 1)*pagesize)

php - Validating Dynamically generated field arrays in codeigniter -

i have form fields dynamically generated. <table class="insideform"> <tr> <td> <script> $(document).ready(function() { $('#addrange').click(function(){ var value = '<tr><td><input type="number" size="10" id="from" name="from[]" value=""></td>'; value += '<td><input type="text" size="10" id="to" name="to[]" value=""></td>'; value += '<td><input type="text" id="disprice" name="disprice[]" /></td>';

iphone - resize image 600x600 to 100x100 programmatically -

Image
i have image height 600 , width 600 want display image programmatically in uiimageview 100x100. try image not original image add screen shoot of image first 100x100 , second 200x200. second fine.but first 1 not original image. idea please in.h @interface viewcontroller : uiviewcontroller { iboutlet uiimageview *imageview1; iboutlet uiimageview *imageview2; } @end in.m - (void)viewdidload { [super viewdidload]; imageview1.frame=cgrectmake(100, 50, 100, 100); imageview2.frame=cgrectmake(50, 200, 200, 200); imageview1.image = [uiimage imagenamed:@"untitled-7.png"]; imageview2.image = [uiimage imagenamed:@"untitled-7.png"]; } please try this uiimage *originalimage = [uiimage imagenamed:@"5.png"]; cgsize destinationsize = cgsizemake(100, 100); uigraphicsbeginimagecontext(destinationsize); [originalimage drawinrect:cgrectmake(0,0,destinationsize.width,destinationsize.height)];

.net - Mono.Cecil Import List Enumerator -

i'm doing bit of il weaving mono.cecil, , i'm running issue: member 'system.collections.generic.list`1/enumerator' declared in module , needs imported how go importing module has list enumerator? i have typereference (system.collections.generic.list`1< blah >) i'm using enumerator, so: var instancetype = (typereference genericinstancetype); var list = instancetype.resolve(); methoddefinition getenumerator; if (!list.trygetmethod("getenumerator", out getenumerator)) throw ... ... trygetmethod custom extension searches type in question method name. i use getenumerator further down in code, so: instructions.add(instruction.create(opcodes.callvirt, getenumerator)); what doing wrong? i figured out. enumerator list, need methodreference getenumerator method, so: type listtype = typeof (list<>); methodreference getenumerator = moduledefinition .import(listtype.getmethod("getenumerator"));

Proccess HTML tags to Spring MVC View -

i'm struggling following problem. in spring web application have different content types (e.g. text, images or code). depending on content type need display in different ways: text : <p>some text</p> image : <img src="path/to/my.img" /> code <pre>some code</pre> the html tags should concatened actual content. problem is, if build output text in java class, html tags won't resolved in view, <p>some text</p> displayed. is somehow possible html tags can resolved in view? if it's escaping part problem, use: <c:out value="${model.snippets.html12}" escapexml="false" /> (i assuming html string in model.snippets.html12). of course, whole idea bad. not affiliated mvc police, point of using mvc framework if feel it's idea generate html inside controller , pass it, string - view? point of view it's bit of schizophrenia. you can save lot of sanity rendering whole thing

objective c - How to process multiple SLRequest to get friends list in twitter? -

i m using following twitter api friends list: https://api.twitter.com/1.1/friends/list.json ? and using [slrequest performrequestwithhandler:^(nsdata *responsedata, nshttpurlresponse *urlresponse, nserror *error) response data, , perform ui changes , model data changes in performrequestwithhandler block. but single request @ maximum retrieves 20 friends.(if set cursor parameter in api -1). i can use cursor parameter of api send request next 20 friends , on until cursor value 0. cursor parameter can set 'next_cursor' parameter in response data of previous request. but m not aware of how call slrequest in performrequestwithhandler of previous request, until 'next_cursor' value in response data of previous request 0. can tell me how friends using slrequest or using other way. any appreciated. thank you. u can call next request in request handler after response of twitter friends. sorry not elaborating. thought understand. here code. acac

Is there a way to see all the project using a maven dependency? -

i working on research project , need find case studies test tool. great way find such case studies projects use given maven dependency. is there website can query example "all projects depending on guava"? mvnrepository.com list artifacts directly depend upon artifact.

sql server - To use or not to use computed columns for performance and maintainability -

i have table storing startingdate in datetime column. once have startingdate value, supposed calculate number_of_days, number_of_weeks number_of_months , number_of_years all startingdate current date. if going use these values in 2 or more places in application , care applications response time, rather make calculations in view or create computed columns each can query table directly? computed columns easy maintain , provide ideal solution problem – have used such solution recently. however, aware values calculated when requested (when selected), not when row inserted table – performance might still issue. might acceptable if can off-load work application server database server. views don’t exist until requested (unless materialised) so, again, there overhead @ runtime, but, again it’s on database server, not application server.

javascript - Position iframe Overtop of Images/JS Loaded Images, Now iFrame is Under the Image -

having problem, on site call iframe using hidden in div when iframe shows images of site cover iframe. i need way able position iframe top of page/overtop of images blocking part of iframe. you can see coding here on domain: www.seo.mobi to access see iframe need on keyboard enter: ↑↑↓↓←→←→ba↵ each of images in slideshow has z-index set. <image style="z-index:6"/> <image style="z-index:5"/> <image style="z-index:4"/> <image style="z-index:3"/> <image style="z-index:2"/> <image style="z-index:1"/> your pop-up div has z-index:2 images z-index above 2 positioned above iframe. <div id="popupcontact">...</div> #popupcontact{ z-index:2; } a quick fix give pop-up div higher z-index other elements.

android - Importing Maps.jar in eclipse -

this question has answer here: is possible use google api maps.jar in console app? 1 answer i unable find , import jar file of google maps android. how import google maps api maps.jar file in eclipse.? please help, thanks in advance first of update sdk->google play services , find path in computer : ...\android-sdk-windows\add-ons\addon-google_apis-google-17\libs\maps.jar add jar using add external jar ... i have solved problem above solution.. thank you...

.htaccess - Multi language basic php website without subdomain or sub-folders -

right have website uses 2 languages english , german. there no sub folders or sub-domains used. correct language shown using $_session[lang] , , gettext function. example.com/about-us.php if '$_session[lang]' = en page shown in english , if '$_session[lang]' = de page shown in dutch but not seo freindly. want keep structure of folders same , want add paramenter in url specify language. example.com/en/about-us.php for english , example.com/de/about-us.php for german. "both pages example.com/en/about-us.php , example.com/de/about-us.php should point file root/webspace/about-us.php, is, folders /en , /de virtual (should not exist in reality avoid code redundance). inside file about-us.php should able know virtual folder called (/en or /de) able define session variable define gettext's language. how can accomplish this? reply

JSONObject in org.json lib: utf-8 encoding issue -

i'm following unicode - how characters right? post. the issue have jsonobject encoding (i'm using org.json lib). the issue arises when put string àòùè쀀 , example, in jsonobject. system.out.println(entry.getvalue()); jsonobject temp = new jsonobject(); temp.put("values", entry.getvalue(); system.out.println(temp.tostring()); i obtain àòùè쀀 , {"values":"àòùèì\u20ac\u20ac"} instead of {"values":"àòùè쀀"} . edit by passing hashtable jsonobject, extended utf-8 encoding used. example, hashtable {€Ã¨Ã²Ã Ã¹Ã¬€Ã¹=èòàù€Ã¬, €Ã²Ã Ã¨Ã¹Ã¬€=èòàù€Ã¬Ã§§$} becomes jsonobject {"\u20acòàèùì\u20ac":"èòàù\u20acìç§$","\u20acèòàùì\u20acù":"èòàù\u20acì"} they equal, unicode escaping taking bit more space. writing \u004a in java same writing a . if correctness concern, doesn't matter. and won't take considerable amount of space either unless of text between 0x2000 - 0x20ff:

android - Can we use a EditText for creating hyperlinks? -

we can use textview for adding hyperlinks various methods, using attribute autolink, or using setmovementmethod() . can same using , edittext widget? trying create notepad, in if such text entered, url, email, number or similar, should hyperlink click on , open browser. please help. thanks all. as of android api level 8 there web_url pattern. quoting source, "match[es] part of rfc 3987". if target lower api level copy pattern source , include in application. assume know how use patterns , matchers, i'm not going more details here. also class urlutil provides useful methods, e.g: ishttpurl() isvalidurl() descriptions of methods not elaborate, therefore best of looking @ source , figuring out 1 fits purpose best. as when trigger validation check, there multiple possibilities: use edittext callback functions onfocuschanged() , or ontextchanged() or use textwatcher , think better. i hope helps, best regards,

ruby - How to merge matchers in rspec? -

this specs: "should convert doc successfully" @response = sharpoffice::office.process(file.expand_path("spec/fixture/test.doc")) @response[:status].should == 'ok' file.exist?(@response[:pdf_path]).should be_true file.exist?(@response[:swf_path]).should be_true file.exist?(@response[:cover_path]).should be_true end "should convert ppt successfully" @response = sharpoffice::office.process(file.expand_path("spec/fixture/test.ppt")) @response[:status].should == 'ok' file.exist?(@response[:pdf_path]).should be_true file.exist?(@response[:swf_path]).should be_true file.exist?(@response[:cover_path]).should be_true end "should convert xls successfully" @response = sharpoffice::office.process(file.expand_path("spec/fixture/test.xls")) @response[:status].should == 'ok' file.exist?(@response[:pdf_path]).should

Listview with Textview and 2 Edittext in a single row in android -

i want have single "textview" , 2 "edittext" in single row.i have tried following code: xml: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" > <textview android:id="@+id/vegtext" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <edittext android:id="@+id/vegquantity" android:hint="qty" android:layout_width="100dp" android:layout_height="100dp" android:layout_weight="1" /> <edittext android:id="@+id/vegprice" android:layout_width="100dp&quo

c# - Make a pdf conforming PDF/A with only images using iTextSharp -

i'm using itextsharp generate pdf-a documents images. far i've not been successful. edit: i'm using itextsharp generate pdf all try make pdf-a document (1a or 1b, whatever suits), images. code i've come far, keep getting errors when try validate them pdf-tools or validatepdfa . this errors pdf-tools (using pdf/a-1b validation): edit: markinfo , color space arn't yet working. rest okay validating file "0.pdf" conformance level pdfa-1a key markinfo required missing. device-specific color space (devicergb) without appropriate output intent used. document not conform requested standard. document contains device-specific color spaces. document doesn't provide appropriate logical structure information. done. main flow var output = new memorystream(); using (var iccprofilestream = new filestream("topdfconverter/colorprofiles/srgb_v4_icc_preference_displayclass.icc", filemode.open)) { var document = new document(new rectangle(page