Search Results

Search found 579 results on 24 pages for 'cam jackson'.

Page 3/24 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • how to store JSON into POJO using Jackson

    - by user2963680
    I am developing a module where i am using rest service to get data. i am not getting how to store JSON using Jackson and store it which has Queryparam also. Any help is really appreciated as I am new to this.I am trying to do server side filtering in extjs infinte grid which is sending the below request to rest service. when the page load first time, it sends http://myhost/mycontext/rest/populateGrid?_dc=9999999999999&page=1&start=0&limit=500 when you select filter on name and place, it sends http://myhost/mycontext/rest/populateGrid?_dc=9999999999999&filter=[{"type":"string","value":"Tom","field":"name"},{"type":"string","value":"London","field":"Location"}]&page=1&start=0&limit=500 I am trying to save this in POJO and then sending this to database to retrieve data. For this on rest side i have written something like this @Provider @Path("/rest") public interface restAccessPoint { @GET @Path("/populateGrid") @Produces({MediaType.APPLICATION_JSON}) public Response getallGridData(FilterJsonToJava filterparam,@QueryParam("page") String page,@QueryParam("start") String start,@QueryParam("limit") String limit); } public class FilterJsonToJava { @JsonProperty(value ="filter") private List<Filter> data; .. getter and setter below } public class Filter { @JsonProperty("type") private String type; @JsonProperty("value") private String value; @JsonProperty("field") private String field; ...getter and setters below } I am getting the below error The following warnings have been detected with resource and/or provider classes: WARNING: A HTTP GET method, public abstract javax.ws.rs.core.Response com.xx.xx.xx.xxxxx (com.xx.xx.xx.xx.json.FilterJsonToJava ,java.lang.String,java.lang.String,java.lang.String), should not consume any entity. com.xx.xx.xx.xx.json.FilterJsonToJava, and Java type class com.xx.xx.xx.FilterJsonToJava, and MIME media type application/octet-stream was not found [11/6/13 17:46:54:065] 0000001c ContainerRequ E The registered message body readers compatible with the MIME media type are: application/octet-stream com.sun.jersey.core.impl.provider.entity.ByteArrayProvider com.sun.jersey.core.impl.provider.entity.FileProvider com.sun.jersey.core.impl.provider.entity.InputStreamProvider com.sun.jersey.core.impl.provider.entity.DataSourceProvider com.sun.jersey.core.impl.provider.entity.RenderedImageProvider */* -> com.sun.jersey.core.impl.provider.entity.FormProvider ...

    Read the article

  • Cam being used by another application

    - by w35t
    On my laptop doesn't work any camera. I get error: "Camera being used by another application"". I don`t known which program using it. I tried use software like "SplitCam" or "ManyCam". Also I reinstalled K-lite codec to newest, but still getting this error. I get the same error when I turn my Canon video camera to laptop using firewire cable. OS: Windows 7 x64 Camera: Creative (i don`t find which model) Laptop: DELL inspiron 1520 Error when I tried open SplitCam: http://f.imagehost.org/0759/Clipboard03.png SplitCam error when repair it: http://i.imagehost.org/0607/split.png ManyCam just not responding. SonyVegas error: http://f.imagehost.org/0227/Clipboard05.png Sorry for my English. Thanks for any help.

    Read the article

  • CAM XML Editor version 2.2.1 now available.

    - by drrwebber
    CAM Editor v2.2.1 release is now available. Lots of nice enhancements, CAMV performance boost and important bug fixes for DoD, NIEM and LEXS schema. Download is available from the CAM XML Editor Resource Site. The CAM editor is the leading open source XML Editor/Validation/Schema designer for rapidly building and deploying complete XML information exchanges. Provides a visual WYSIWYG structure with rule entry wizards and drag and drop dictionary components. Will import, analyze and refactor existing XML Schema. Oracle is a proud sponsor of the project and its use on the NIEM.gov initiative.Creates XSD schema + JAXB bindings, Mindmap or UML models (XMI), XML test suite examples, HTML documentation + spreadsheets (NIEM IEPDs). XSD schema export in default, flatten, NIEM, and OASIS modes. Generates canonical component dictionaries from schema sets, ERwin models, or spreadsheets.

    Read the article

  • Broadcast live video from web-cam via plug-in

    - by Freebrainz
    Hello guys! Could you please suggest me what kind of software should I use to broadcast live video from webcam? Web-cam is connected via USB to my server. I want to broadcast video from my webcam on my web-page (HTML, ASP.NET - doesn't matter). I don't want to develop video broadcasting from the beginning - it takes a lot of time to implement good system. I'm looking for ready-to-use plug-in/widget for my site. I found ustream.tv, but live video start playing with delay about 2 seconds... You know, it's not real-time. I need something like Skype/icq/ooVoo... plug-in/widget for my web-site. Are these plug-ins exists in internet? P.S. I know that VideoLAN has ActiveX control. Does VLC provide me with real-time video broadcasting from webcam without any delays like Skype? Thank you!

    Read the article

  • Make @JsonTypeInfo property optional

    - by Mark Peters
    I'm using @JsonTypeInfo to instruct Jackson to look in the @class property for concrete type information. However, sometimes I don't want to have to specify @class, particularly when the subtype can be inferred given the context. What's the best way to do that? Here's an example of the JSON: { "owner": {"name":"Dave"}, "residents":[ {"@class":"jacksonquestion.Dog","breed":"Greyhound"}, {"@class":"jacksonquestion.Human","name":"Cheryl"}, {"@class":"jacksonquestion.Human","name":"Timothy"} ] } and I'm trying to deserialize them into these classes (all in jacksonquestion.*): public class Household { private Human owner; private List<Animal> residents; public Human getOwner() { return owner; } public void setOwner(Human owner) { this.owner = owner; } public List<Animal> getResidents() { return residents; } public void setResidents(List<Animal> residents) { this.residents = residents; } } public class Animal {} public class Dog extends Animal { private String breed; public String getBreed() { return breed; } public void setBreed(String breed) { this.breed = breed; } } public class Human extends Animal { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } } using this config: @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@class") private static class AnimalMixin { } //... ObjectMapper objectMapper = new ObjectMapper(); objectMapper.getDeserializationConfig().addMixInAnnotations(Animal.class, AnimalMixin.class); Household household = objectMapper.readValue(json, Household.class); System.out.println(household); As you can see, the owner is declared as a Human, not an Animal, so I want to be able to omit @class and have Jackson infer the type as it normally would. When I run this though, I get org.codehaus.jackson.map.JsonMappingException: Unexpected token (END_OBJECT), expected FIELD_NAME: missing property '@class' that is to contain type id (for class jacksonquestion.Human) Since "owner" doesn't specify @class. Any ideas? One initial thought I had was to use @JsonTypeInfo on the property rather than the type. However, this cannot be leveraged to annotate the element type of a list.

    Read the article

  • SQL to XML open data and NIEM training video posted

    - by drrwebber
    Learn how to build a working XML query/response system with SQL database accessing and XML components from example NIEM schema and dictionary. Software development practitioners, business analysts and managers will find the materials accessible and valuable in showing the decision making processes that go into constructing a working XML exchange. The 22 minute video available online shows how to build a fully working ULEXS-SR exchange using a Vehicle license search example.  Also included are aspects of NIEM training for assembling an IEPD schema with data models. Materials are focused on practical implementers, after viewing the instruction material you can use the open source tools and apply to your own SQL to XML use cases and information exchange projects. All the SQL and XML code, editor tools, dictionary and instructions that accompany the tutorial video are also available for download so you can try everything yourself.  See http://www.youtube.com/user/TheCameditor to run the video. And the open source project web site (sponsored by Oracle) contains all the resources, downloads and supplemental materials. Enjoy.

    Read the article

  • Getting problem in accessing web cam.

    - by Chetan
    Hi... I have written code in Java to access web cam,and to save image... I am getting following exceptions : Exception in thread "main" java.lang.NullPointerException at SwingCapture.(SwingCapture.java:40) at SwingCapture.main(SwingCapture.java:66) how to remove this exceptions. here is the code: import javax.swing.*; import javax.swing.event.; import java.io.; import javax.media.; import javax.media.format.; import javax.media.util.; import javax.media.control.; import javax.media.protocol.; import java.util.; import java.awt.; import java.awt.image.; import java.awt.event.; import com.sun.image.codec.jpeg.; public class SwingCapture extends Panel implements ActionListener { public static Player player = null; public CaptureDeviceInfo di = null; public MediaLocator ml = null; public JButton capture = null; public Buffer buf = null; public Image img = null; public VideoFormat vf = null; public BufferToImage btoi = null; public ImagePanel imgpanel = null; public SwingCapture() { setLayout(new BorderLayout()); setSize(320,550); imgpanel = new ImagePanel(); capture = new JButton("Capture"); capture.addActionListener(this); String str1 = "vfw:iNTEX IT-308 WC:0"; String str2 = "vfw:Microsoft WDM Image Capture (Win32):0"; di = CaptureDeviceManager.getDevice(str2); ml = di.getLocator(); try { player = Manager.createRealizedPlayer(ml); player.start(); Component comp; if ((comp = player.getVisualComponent()) != null) { add(comp,BorderLayout.NORTH); } add(capture,BorderLayout.CENTER); add(imgpanel,BorderLayout.SOUTH); } catch (Exception e) { e.printStackTrace(); } } public static void main(String[] args) { Frame f = new Frame("SwingCapture"); SwingCapture cf = new SwingCapture(); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { playerclose(); System.exit(0);}}); f.add("Center",cf); f.pack(); f.setSize(new Dimension(320,550)); f.setVisible(true); } public static void playerclose() { player.close(); player.deallocate(); } public void actionPerformed(ActionEvent e) { JComponent c = (JComponent) e.getSource(); if (c == capture) { // Grab a frame FrameGrabbingControl fgc = (FrameGrabbingControl) player.getControl("javax.media.control.FrameGrabbingControl"); buf = fgc.grabFrame(); // Convert it to an image btoi = new BufferToImage((VideoFormat)buf.getFormat()); img = btoi.createImage(buf); // show the image imgpanel.setImage(img); // save image saveJPG(img,"\test.jpg"); } } class ImagePanel extends Panel { public Image myimg = null; public ImagePanel() { setLayout(null); setSize(320,240); } public void setImage(Image img) { this.myimg = img; repaint(); } public void paint(Graphics g) { if (myimg != null) { g.drawImage(myimg, 0, 0, this); } } } public static void saveJPG(Image img, String s) { BufferedImage bi = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_RGB); Graphics2D g2 = bi.createGraphics(); g2.drawImage(img, null, null); FileOutputStream out = null; try { out = new FileOutputStream(s); } catch (java.io.FileNotFoundException io) { System.out.println("File Not Found"); } JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out); JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(bi); param.setQuality(0.5f,false); encoder.setJPEGEncodeParam(param); try { encoder.encode(bi); out.close(); } catch (java.io.IOException io) { System.out.println("IOException"); } } }

    Read the article

  • JsonParseException on Valid JSON

    - by user2909602
    I am having an issue calling a RESTful service from my client code. I have written the RESTful service using CXF/Jackson, deployed to localhost, and tested using RESTClient successfully. Below is a snippet of the service code: @POST @Produces("application/json") @Consumes("application/json") @Path("/set/mood") public Response setMood(MoodMeter mm) { this.getMmDAO().insert(mm); return Response.ok().entity(mm).build(); } The model class and dao work successfully and the service itself works fine using RESTClient. However, when I attempt to call this service from Java Script, I get the error below on the server side: Caused by: org.codehaus.jackson.JsonParseException: Unexpected character ('m' (code 109)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') I have copied the client side code below. To make sure it has nothing to do with the JSON data itself, I used a valid JSON string (which works using RESTClient, JSON.parse() method, and JSONLint) in the vars 'json' (string) and 'jsonData' (JSON). Below is the Java Script code: var json = '{"mood_value":8,"mood_comments":"new comments","user_id":5,"point":{"latitude":37.292929,"longitude":38.0323323},"created_dtm":1381546869260}'; var jsonData = JSON.parse(json); $.ajax({ url: 'http://localhost:8080/moodmeter/app/service/set/mood', dataType: 'json', data: jsonData, type: "POST", contentType: "application/json" }); I've seen the JsonParseException a number of times on other threads, but in this case the JSON itself appears to be valid (and tested). Any thoughts are appreciated.

    Read the article

  • Web-Cam Video frames to System.Drawing.Bitmap

    - by Hooch
    Hello. I'm using AForge.NET framework to process some data from webcam. My Image processor is working. class WebProc { public void Process(System.Drawing.Bitmap image) { .... } } I know how to send image from HDD. I was thinking about something like that: private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { while(!backgroundWorker1.CancellationPending) { Bitmap Frame GetVidoFrameSomeWay(); WebProc.Process(Frame); } } Can you help me with those questions? How to get frame from webcam? How to list all available webcam for user to chose from? How to open Webcam setting window? Is there a way to set frame size to 640x480 o user size?

    Read the article

  • HOW TO GET WEB CAM IMAGES IN C#

    - by SR Dusad
    Hi I m working on online video conferencing project in c# and .Net4.0 I want a library or code which i can used for collecting web camera inges per second in diferent form. I try this by using the AVICAP32, in which we send Messages for diferent purpose like copy or edit frames.but in this we have to pass a reference of picturebox while creating handler as given below mCapHwnd = capCreateCaptureWindowA("0", 268435456 | 1073741824, 0, 0, 640, 480,picturebox1.Handle.ToInt32(), 0); usiing these commands i m able to capture images but the problem comes when i minimize the picturebox form . at that time doesn't create new image . I think this is happened because i minimize the form and when it copy the image from this clipboard it doesn't shhow anything. How can i solve this problem . Any type of help will be appreciated. Thanks srdusad

    Read the article

  • Turning a JSON list into a POJO

    - by Josh L
    I'm having trouble getting this bit of JSON into a POJO. I'm using Jackson configured like this: protected ThreadLocal<ObjectMapper> jparser = new ThreadLocal<ObjectMapper>(); public void receive(Object object) { try { if (object instanceof String && ((String)object).length() != 0) { ObjectDefinition t = null ; if (parserChoice==0) { if (jparser.get()==null) { jparser.set(new ObjectMapper()); } t = jparser.get().readValue((String)object, ObjectDefinition.class); } Object key = t.getKey(); if (key == null) return; transaction.put(key,t); } } catch (Exception e) { e.printStackTrace(); } } Here's the JSON that needs to be turned into a POJO: { "id":"exampleID1", "entities":{ "tags":[ { "text":"textexample1", "indices":[ 2, 14 ] }, { "text":"textexample2", "indices":[ 31, 36 ] }, { "text":"textexample3", "indices":[ 37, 43 ] } ] } And lastly, here's what I currently have for the java class: protected Entities entities; @JsonIgnoreProperties(ignoreUnknown = true) protected class Entities { public Entities() {} protected Tags tags; @JsonIgnoreProperties(ignoreUnknown = true) protected class Tags { public Tags() {} protected String text; public String getText() { return text; } public void setText(String text) { this.text = text; } }; public Tags getTags() { return tags; } public void setTags(Tags tags) { this.tags = tags; } }; //Getters & Setters ... I've been able to translate the more simple objects into a POJO, but the list has me stumped. Any help is appreciated. Thanks!

    Read the article

  • How do i render a web cam filter instead of video file in directshow?

    - by Mr Bell
    How do i render a web cam filter instead of video file? I am looking at the vmr9compositor example included in the directshow sdk. It renders a video file. I would like to stream in the feed from the webcam. It SEEMS like this should be possible, but I dont have much of a grasp on directshow. It uses this method call currently: hr = g_graph->RenderFile( pFileName, NULL ); Looking at the playcap example in the sdk which can display the web cam feed in a window, I see that it uses hr = g_pCapture->RenderStream (&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, pSrcFilter, NULL, NULL)); to display the web cam stream. pSrcFilter is an IBaseFilter. How can I can swap the video file in the vmr app with the web cam feed? Windows XP, Visual Studio 2008 C++

    Read the article

  • Why is my Android app camera preview running out of memory on my AVD?

    - by Bryan
    I have yet to try this on an actual device, but expect similar results. Anyway, long story short, whenever I run my app on the emulator, it crashes due to an out of memory exception. My code really is essentially the same as the camera preview API demo from google, which runs perfectly fine. The only file in the app (that I created/use) is as below- package berbst.musicReader; import java.io.IOException; import android.app.Activity; import android.content.Context; import android.hardware.Camera; import android.os.Bundle; import android.view.SurfaceHolder; import android.view.SurfaceView; /********************************* * Music Reader v.0001 * Still VERY under construction. * @author Bryan * *********************************/ public class MusicReader extends Activity { private MainScreen main; @Override //Begin activity public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); main = new MainScreen(this); setContentView(main); } class MainScreen extends SurfaceView implements SurfaceHolder.Callback { SurfaceHolder sHolder; Camera cam; MainScreen(Context context) { super(context); //Set up SurfaceHolder sHolder = getHolder(); sHolder.addCallback(this); sHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); } public void surfaceCreated(SurfaceHolder holder) { // Open the camera and start viewing cam = Camera.open(); try { cam.setPreviewDisplay(holder); } catch (IOException exception) { cam.release(); cam = null; } } public void surfaceDestroyed(SurfaceHolder holder) { // Kill all our crap with the surface cam.stopPreview(); cam.release(); cam = null; } public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { // Modify parameters to match size. Camera.Parameters params = cam.getParameters(); params.setPreviewSize(w, h); cam.setParameters(params); cam.startPreview(); } } }

    Read the article

  • Warning: This class was probably produced by a broken compiler.

    - by Michal Dymel
    I have added Jacson libs to my android project and now I am getting such warnings in console: warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.) I've tried to recompile libs, but it didn't help. Warnings are gone when I remove these libs from project. Everything is working fine on the device, but this annoys me ;) Do you know any solution?

    Read the article

  • How to get the ObjectId value from MongoDB?

    - by LVarayut
    I'm using Jongo with Play framework 2, java. I added some data into my MongoDB. {"_id" : ObjectId("538dafffbf6b562617252178"), ... } However, when I fetched the ObjectId from the database, it gave me like: de.undercouch.bson4jackson.types.ObjectId@484431ff instead of 538dafffbf6b562617252178. I don't quite understand how can I get the ObjectId value. My class is defined as following: public class Product { @JsonProperty("_id") protected String id; ... public Product() { } public String getId() { return id; } public void setId(String id) { this.id = id; } } EDIT In order to fetch the data, I simply use find() function provided by Jongo as following: public static Iterable<Product> findAll(){ return products().find().as(Product.class); }

    Read the article

  • Grails and googleJsonAPIService

    - by Calahad
    I am using the googleJsonAPIService to manipulate users (CRUD). This is how I get the Directory instance: def getBuilder() { def builder def httpTransport = googleJsonAPIService.makeTransport() def jsonFactory = googleJsonAPIService.makeJsonFactory() def requestInitialiser = googleJsonAPIService.getRequestInitialiser() builder = new Directory.Builder(httpTransport, jsonFactory, requestInitialiser); return builder } Directory getGoogleService() { Directory googleService = getBuilder().build() return googleService; } Once I have this service, I use it to get a user's details (in my own service) for example: def query = getGoogleService().users().get(id) return handleException { query.execute() } I manually populate a DTO with the result of that query, and this is where my question comes: Is there an elegant way to have this mapping (object returned to DTO) done automatically so all I have to do is pass the class of the object to be returned? This is the structure of the object returned by google : ["agreedToTerms":true,"changePasswordAtNextLogin":false, "creationTime":"2013-11-04T04:33:35.000Z", "emails":[{"address":"[email protected]","primary":true}],...]

    Read the article

  • Can I use my old Sony Handycam TRV815 as a web cam?

    - by Optimal Solutions
    Has anyone ever used their old Sony Handycam (or maybe any older hand-held camcorder) as a web cam? As in streaming the live video from the cam to a web server (local or remote/Internet). My TRV815 has a pretty darn good picture quality for its time.. Via USB or Ethernet. It has S-Video but I think that is input. It has RCA out (white/red for audio and yellow for video) and I have used that to display to my TV. I have web cams already but was wondering if I could put this one to use also just for kicks..

    Read the article

  • how to configure IP cam to stream using right network card?

    - by robin hood
    I have IP cam that supports RTSP streaming. It's connected to router with 2 network cards with IP1 and IP2 addresses. I make 2 connections to IP cam by IP1 and IP2 addresses from the same IP and I need to receive corresponding streams thru correct network card, but both streams (RTP over UDP) go thru IP1. How this can be resolved? I don't know if RTSP server binds UDP sockets to corresponding IP and I don't know what IP stack is in IP cam (weak end system or strong end system). I haven't found anything interesting in router configuration. As I understand, routing table cannot help me cos I'm connected from the same IP, is it right? Also Sorry for incomplete info but it's all I have at the moment. Thanks for your time.

    Read the article

  • IP Camera working on lan but not on internet

    - by Kevin Boyd
    My IP cam model is Genius 350TR, I tested the cam at home on lan and internet and it worked. Then I shifted it to an office. It works on the office lan setup but I cannot connect to the ip cam from home. The IP cam is configured for port 192.168.0.30:7070 and it has a port forwarded to publicIP:7071 When I telnet to that public IP it connects to that port. However when I try to access the ip cam from a web browser it only shows me the configuration page and settings and the video is blank and it says connecting for some time and then says disconnected. The cam is configured for HTTP on internet and UDP on Lan. The office setup is ISP --- WifiRouter --- PC With Wifi card --- Switch --- IP CAM Is there a way to debug this problem?

    Read the article

  • addchild not displaying content

    - by Rajeev
    In the following code i dont have any error but why is that the addchild(video); i.e, the the video captured by webcam is not displayed <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> <![CDATA[ import org.com.figurew; import mx.controls.Button; import mx.controls.Alert; import flash.display.InteractiveObject; import flash.display.Sprite; import flash.media.*; import flash.net.*; public function addBody():void { var ret:Number = figurew.getInstance().getparam(); if( ret == 1) { Alert.show("Camera detected"); } if(ret == 0) { Alert.show("No camera detected"); } var cam:Camera = Camera.getCamera(); if(cam != null) { cam.setMode(640, 480, 30); var video:Video = new Video(30, 40); video.attachCamera(cam); addChild(video); } else { trace("No Camera Detected"); } } ]]> </mx:Script> <mx:Button label="Test camera" click="addBody();" x="99" y="116"/> </mx:Application > figurew.as package org.com { import flash.display.InteractiveObject; import flash.display.Sprite; import flash.media.*; import flash.net.*; public class figurew extends Sprite { public function figurew() { //getparam(); var cam:Camera = Camera.getCamera(); if(cam != null) { cam.setMode(640, 480, 30); var video:Video = new Video(300, 450); video.attachCamera(cam); addChild(video); } else { trace("No Camera Detected"); } } public function getparam():Number { var cam:Camera = Camera.getCamera(); if(cam != null) { cam.setMode(640, 480, 30); var video:Video = new Video(300, 450); video.attachCamera(cam); addChild(video); return 1; } else { return 0; trace("No Camera Detected"); } } private static var _instance:figurew = null; public static function getInstance():cldAS { if(_instance == null) { trace("No instance found"); _instance = new cldAS(); } return _instance; } } }

    Read the article

  • LINQ OrderBy: best search results at top of results list

    - by p.campbell
    Consider the need to search a list of Customer by both first and last names. The desire is to have the results list sorted by the Customer with the most matches in the search terms. FirstName LastName ---------- --------- Foo Laurie Bar Jackson Jackson Bro Laurie Foo Jackson Laurie string[] searchTerms = new string[] {"Jackson", "Laurie"}; //want to find those customers with first, last or BOTH names in the searchTerms var matchingCusts = Customers .Where(m => searchTerms.Contains(m.FirstName) || searchTerms.Contains(m.LastName)) .ToList(); /* Want to sort for those results with BOTH FirstName and LastName matching in the search terms. Those that match on both First and Last should be at the top of the results, the rest who match on one property should be below. */ return matchingCusts.OrderBy(m=>m); Desired Sort: Jackson Laurie (matches on both properties) Foo Laurie Bar Jackson Jackson Bro Laurie Foo How can I achieve this desired functionality with LINQ and OrderBy / OrderByDescending?

    Read the article

  • Video Streaming

    - by Josephe
    First I need to state that I am not the developer so I will state the issue in business terms but please respond with a technical solution as I will be passing on your posts to the developer. We are building a web based application in SilverLight and WPF that consists of communication between a customer service rep and a customer. The application will inlcude a webcam that will provide the customer with the ability to see the customer service rep and the rep will also be able to see an image of themselves but will not be able to see the customer. Similar functionality to a live web chat with video component. There could potentially be bandwidth issues and we do not want the customer to have to download anything. Any recommendations on how to do this?

    Read the article

  • How to capture video from webcam(in java)?

    - by user243680
    I want to develop an application in java to capture video from webcam and store it onto a particular location.Can anyone provide me the working code? What type(usb,ip etc..) of webcam is the best in order to develop the application. Please help me. how to proceed?

    Read the article

  • C# 2D Camera Max Zoom

    - by Craig
    I have a simple ship sprite moving around the screen along with a 2D Camera. I have zooming in and out working, however when I zoom out it goes past the world bounds and has the cornflower blue background showing. How do I sort it that I can only zoom out as far as showing the entire world (which is a picture of OZ) and thats it? I dont want any of the cornflower blue showing. Cheers! namespace GamesCoursework_1 { /// <summary> /// This is the main type for your game /// </summary> public class Game1 : Microsoft.Xna.Framework.Game { GraphicsDeviceManager graphics; SpriteBatch spriteBatch; // player variables Texture2D Ship; Vector2 Ship_Position; float Ship_Rotation = 0.0f; Vector2 Ship_Origin; Vector2 Ship_Velocity; const float tangentialVelocity = 4f; float friction = 0.05f; static Point CameraViewport = new Point(800, 800); Camera2d cam = new Camera2d((int)CameraViewport.X, (int)CameraViewport.Y); //Size of world static Point worldSize = new Point(1600, 1600); // Screen variables static Point worldCenter = new Point(worldSize.X / 2, worldSize.Y / 2); Rectangle playerBounds = new Rectangle(CameraViewport.X / 2, CameraViewport.Y / 2, worldSize.X - CameraViewport.X, worldSize.Y - CameraViewport.Y); Rectangle worldBounds = new Rectangle(0, 0, worldSize.X, worldSize.Y); Texture2D background; public Game1() { graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = CameraViewport.X; graphics.PreferredBackBufferHeight = CameraViewport.Y; Content.RootDirectory = "Content"; } /// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here base.Initialize(); } /// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here Ship = Content.Load<Texture2D>("Ship"); Ship_Origin.X = Ship.Width / 2; Ship_Origin.Y = Ship.Height / 2; background = Content.Load<Texture2D>("aus"); Ship_Position = new Vector2(worldCenter.X, worldCenter.Y); cam.Pos = Ship_Position; cam.Zoom = 1f; } /// <summary> /// UnloadContent will be called once per game and is the place to unload /// all content. /// </summary> protected override void UnloadContent() { // TODO: Unload any non ContentManager content here } /// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { // Allows the game to exit if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) this.Exit(); // TODO: Add your update logic here Ship_Position = Ship_Velocity + Ship_Position; keyPressed(); base.Update(gameTime); } /// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); // TODO: Add your drawing code here spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null,null, cam.get_transformation(GraphicsDevice)); spriteBatch.Draw(background, Vector2.Zero, Color.White); spriteBatch.Draw(Ship, Ship_Position, Ship.Bounds, Color.White, Ship_Rotation, Ship_Origin, 1.0f, SpriteEffects.None, 0f); spriteBatch.End(); base.Draw(gameTime); } private void Ship_Move(Vector2 move) { Ship_Position += move; } private void keyPressed() { KeyboardState keyState; // Move right keyState = Keyboard.GetState(); if (keyState.IsKeyDown(Keys.Right)) { Ship_Rotation = Ship_Rotation + 0.1f; } if (keyState.IsKeyDown(Keys.Left)) { Ship_Rotation = Ship_Rotation - 0.1f; } if (keyState.IsKeyDown(Keys.Up)) { Ship_Velocity.X = (float)Math.Cos(Ship_Rotation) * tangentialVelocity; Ship_Velocity.Y = (float)Math.Sin(Ship_Rotation) * tangentialVelocity; if ((int)Ship_Position.Y < playerBounds.Bottom && (int)Ship_Position.Y > playerBounds.Top) cam._pos.Y = Ship_Position.Y; if ((int)Ship_Position.X > playerBounds.Left && (int)Ship_Position.X < playerBounds.Right) cam._pos.X = Ship_Position.X; Ship_Position += new Vector2(tangentialVelocity, 0); if (!worldBounds.Contains(new Point((int)Ship_Position.X, (int)Ship_Position.Y))) Ship_Position -= new Vector2(tangentialVelocity * 2, 0.0f); Ship_Position += new Vector2(-tangentialVelocity, 0.0f); if (!worldBounds.Contains(new Point((int)Ship_Position.X, (int)Ship_Position.Y))) Ship_Position -= new Vector2(-tangentialVelocity * 2, 0.0f); Ship_Position += new Vector2(0.0f, -tangentialVelocity); if (!worldBounds.Contains(new Point((int)Ship_Position.X, (int)Ship_Position.Y))) Ship_Position -= new Vector2(0.0f, -tangentialVelocity * 2); Ship_Position += new Vector2(0.0f, tangentialVelocity); if (!worldBounds.Contains(new Point((int)Ship_Position.X, (int)Ship_Position.Y))) Ship_Position -= new Vector2(0.0f, 2 * tangentialVelocity); } else if(Ship_Velocity != Vector2.Zero) { float i = Ship_Velocity.X; float j = Ship_Velocity.Y; Ship_Velocity.X = i -= friction * i; Ship_Velocity.Y = j -= friction * j; if ((int)Ship_Position.Y < playerBounds.Bottom && (int)Ship_Position.Y > playerBounds.Top) cam._pos.Y = Ship_Position.Y; if ((int)Ship_Position.X > playerBounds.Left && (int)Ship_Position.X < playerBounds.Right) cam._pos.X = Ship_Position.X; Ship_Position += new Vector2(tangentialVelocity, 0); if (!worldBounds.Contains(new Point((int)Ship_Position.X, (int)Ship_Position.Y))) Ship_Position -= new Vector2(tangentialVelocity * 2, 0.0f); Ship_Position += new Vector2(-tangentialVelocity, 0.0f); if (!worldBounds.Contains(new Point((int)Ship_Position.X, (int)Ship_Position.Y))) Ship_Position -= new Vector2(-tangentialVelocity * 2, 0.0f); Ship_Position += new Vector2(0.0f, -tangentialVelocity); if (!worldBounds.Contains(new Point((int)Ship_Position.X, (int)Ship_Position.Y))) Ship_Position -= new Vector2(0.0f, -tangentialVelocity * 2); Ship_Position += new Vector2(0.0f, tangentialVelocity); if (!worldBounds.Contains(new Point((int)Ship_Position.X, (int)Ship_Position.Y))) Ship_Position -= new Vector2(0.0f, 2 * tangentialVelocity); } if (keyState.IsKeyDown(Keys.Q)) { if (cam.Zoom < 2f) cam.Zoom += 0.05f; } if (keyState.IsKeyDown(Keys.A)) { if (cam.Zoom > 0.3f) cam.Zoom -= 0.05f; } } } }

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >