Daily Archives

Articles indexed Tuesday November 27 2012

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

  • Dual Booting Windows 8 and Ubuntu 12.10 - thinkpad x230

    - by user110703
    I am having problems getting grub to load Windows 8 properly after installing Ubuntu 12.10 and Windows 8 on a solid state drive. Here's what I did: Fresh install of Windows 8 using USB recovery drive (partitioned SSD for UEFI) -- Tested windows install and it worked fine Built bootable USB with Ubuntu 12.10 64bit and installed Ubuntu -- Used Ubuntu's installer to partition the Windows 8 partition and install there Reboot - try to load windows 8 from grub -- Ubuntu loads correctly; windows load reports various problems with permissions and not being able to find files - I'll update what the actual errors are Tried to fix the boot problem using boot-repair: -- here's the output: http://paste.ubuntu.com/1384522/ So, this is my first time trying to setup a dual boot system and I think that UEFI is the main culprit in getting this to work correctly. What do I need to

    Read the article

  • choppy streaming audio

    - by user88503
    I could use some help troubleshooting choppy streaming audio. The problem is jerky playback regardless of audio or video with audio. Both Chromium and Firefox have the problem, however files played directly on the machine with Rhythmbox sound just fine. I'm running 12.04 LTS on a C2D T9300. Most of the audio problems others ask about seem to be hardware related, so the following information might be relevant. sudo lshw -c multimedia *-multimedia description: Audio device product: 82801H (ICH8 Family) HD Audio Controller vendor: Intel Corporation physical id: 1b bus info: pci@0000:00:1b.0 version: 03 width: 64 bits clock: 33MHz capabilities: pm msi pciexpress bus_master cap_list configuration: driver=snd_hda_intel latency=0 resources: irq:48 memory:f8400000-f8403fff

    Read the article

  • high performance with xen, vmware or virtualbox

    - by Marchosius
    I was wondering which is the best method to go about if I want to play win based games. I do not want to go with the dual boot method as this will cost me time to restart, login and run a os to do my work or pass the time, and some of my apps rely on win and my graphics to run. for example Daz3d, Photoshop, Flash etc. Now I read about HVM(hardware virtual machines) and then I know about the 3D virtualisation of VMware and VirtualBox. How ever the 2 later virtualise the 3D not using the full power of the GPU. So this option wont perform perfect for latest games like D3. I was wondering if anyone have experience in HVM(like xen if i am not mistaken) and tried something similar to access the full power of the GPU and successfully run newer games and other products relying on the GPU? Will be the first time setting up a HVM, no experience in this so don't know what to expect. This will help a lot as I do not want to revert back to win or as mentioned do dual boot.

    Read the article

  • 3G Huawei E220 cannot connect to the Net Ubuntu 12.04

    - by user60786
    I've upgraded from 10.10 to 12.04. The situation: I plug the dongle in and enter the password. If I click 'Enable Mobile Broadband' and I get a notice on the top right saying 'GSM network. You are now registered on the home network'. At this stage I have not actually connected and when I click my broadband connection i see that 'Enable Mobile Boardband' is unticked AGAIN and I cannot connect to my broadbnad connection when I click it.

    Read the article

  • MAMP like tool for ubuntu

    - by hrishikeshp19
    I am from mac os x background. To control my apache, mysql, and php, I used to use MAMP tool available for mac os x. On my ubuntu, I have installed all the required softwares but, I want a good UI tool to control my apache. To be specific, I change my document root too often, so I want a GUI tool to where I can just browse for desired document root, and restart the server. Is there any such tool available?

    Read the article

  • Valid robots.txt? [closed]

    - by psot
    I am waiting for Google to crawl my site and display the results in search. Is my robots.txt alright and will it let google, bing etc crawl my site? Thanks! User-agent: * Disallow: /cgi-bin/ Disallow: /wp-admin/ Disallow: /wp-includes/ Disallow: /wp-content/ Disallow: /build/ Disallow: /css/ Disallow: /trackback/ Disallow: /comments Disallow: /assets/graphics/ Disallow: /assets/visual/ Disallow: /category/*/* Disallow: */trackback Disallow: */feed Disallow: */comments Disallow: /*?* Disallow: /*? User-agent: Slurp Disallow: / User-agent: Baiduspider Disallow: / User-agent: ia_archiver Disallow: / User-agent: duggmirror Disallow: / User-agent: Yandex Disallow: / Sitemap: http://example.com/sitemap.xml.gz

    Read the article

  • Move projectile in direction the gun is facing

    - by Manderin87
    I am attempting to have a projectile follow the direction a gun is facing. When using the following code I am unable to make the projectile go in the right direction. float speed = .5f; float dX = (float) -Math.cos(Math.toRadians(degree)) * speed; float dY = (float) Math.sin(Math.toRadians(degree)) * speed; Can anyone tell me what I am doing wrong? The degree is the direction the gun is facing in degree's.

    Read the article

  • How can I attach a model to the bone of another model?

    - by kaykayman
    I am trying to attach one animated model to one of the bones of another animated model in an XNA game. I've found a few questions/forum posts/articles online which explain how to attach a weapon model to the bone of another model (which is analogous to what I'm trying to achieve), but they don't seem to work for me. So as an example: I want to attach Model A to a specific bone in Model B. Question 1. As I understand it, I need to calculate the transforms which are applied to the bone on Model B and apply these same transforms to every bone in Model A. Is this right? Question 2. This is my code for calculating the Transforms on a specific bone. private Matrix GetTransformPaths(ModelBone bone) { Matrix result = Matrix.Identity; while (bone != null) { result = result * bone.Transform; bone = bone.Parent; } return result; } The maths of Matrices is almost entirely lost on me, but my understanding is that the above will work its way up the bone structure to the root bone and my end result will be the transform of the original bone relative to the model. Is this right? Question 3. Assuming that this is correct I then expect that I should either apply this to each bone in Model A, or in my Draw() method: private void DrawModel(SceneModel model, GameTime gametime) { foreach (var component in model.Components) { Matrix[] transforms = new Matrix[component.Model.Bones.Count]; component.Model.CopyAbsoluteBoneTransformsTo(transforms); Matrix parenttransform = Matrix.Identity; if (!string.IsNullOrEmpty(component.ParentBone)) parenttransform = GetTransformPaths(model.GetBone(component.ParentBone)); component.Player.Update(gametime.ElapsedGameTime, true, Matrix.Identity); Matrix[] bones = component.Player.GetSkinTransforms(); foreach (SkinnedEffect effect in mesh.Effects) { effect.SetBoneTransforms(bones); effect.EnableDefaultLighting(); effect.World = transforms[mesh.ParentBone.Index] * Matrix.CreateRotationY(MathHelper.ToRadians(model.Angle)) * Matrix.CreateTranslation(model.Position) * parenttransform; effect.View = getView(); effect.Projection = getProjection(); effect.Alpha = model.Opacity; } } mesh.Draw(); } I feel as though I have tried every conceivable way of incorporating the parenttransform value into the draw method. The above is my most recent attempt. Is what I'm trying to do correct? And if so, is there a reason it doesn't work? The above Draw method seems to transpose the models x/z position - but even at these wrong positions, they do not account for the animation of Model B at all. Note: As will be evident from the code my "model" is comprised of a list of "components". It is these "components" that correspond to a single "Microsoft.Xna.Framework.Graphics.Model"

    Read the article

  • STL for games, yea or nay?

    - by munificent
    Every programming language has its standard library of containers, algorithms, and other helpful stuff. With languages like C#, Java, and Python, it's practically inconceivable to use the language without its standard lib. Yet, on many C++ games I've worked on, we either didn't use the STL at all, used a tiny fraction of it, or used our own implementation. It's hard to tell if that was a sound decision for our games, or one simply made out of ignorance of the STL. So... is the STL a good fit or not?

    Read the article

  • hibernate sybase db power function

    - by Vipin Thomas
    We are trying to use sybase function power to do mathematical calculation for one of the DB columns. The hibernate is generating power function as pow(?, xyzo0_.AmtScale) whereas sybase supports power function as Syntax POWER( numeric-expression-1, numeric-expression-2 ) We have tried modifying the hibernate.dialect. Have tried org.hibernate.dialect.SybaseASE15Dialect org.hibernate.dialect.Sybase11Dialect org.hibernate.dialect.SybaseAnywhereDialect but all dialects generate the power function as pow(?, xyzo0_.AmtScale). Is this hibernate issue or are we missing something?

    Read the article

  • Alert dialog is gone before the user see anything

    - by Android Developer
    PopIt("Exit Application", "Are you sure you want to exit?"); public void PopIt( String title, String message ){ new AlertDialog.Builder(this) .setTitle( title ) .setMessage( message ) .setPositiveButton("YES", new OnClickListener() { public void onClick(DialogInterface arg0, int arg1) { //do stuff onclick of YES finish(); } }).setNegativeButton("NO", new OnClickListener() { public void onClick(DialogInterface arg0, int arg1) { //do stuff onclick of CANCEL Toast.makeText(getBaseContext(), "You touched CANCEL", Toast.LENGTH_SHORT).show(); } }).show(); } this alert dialog gone so fast as I cant read or click on it !! why is that ?

    Read the article

  • how do i add images from drable folder instead of url in this code

    - by hayya anam
    i used the following URL https://github.com/jgilfelt/android-mapviewballoons source in my application is show image by using url how do i give images form my own drawable folder?? i found this mapview url which show images inbaloon but is show images by url i wanna show myown iamges how i do? howi give my own images from my folder public class CustomMap extends MapActivity { MapView mapView; List<Overlay> mapOverlays; Drawable drawable; Drawable drawable2; CustomItemizedOverlay<CustomOverlayItem> itemizedOverlay; CustomItemizedOverlay<CustomOverlayItem> itemizedOverlay2; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mapView = (MapView) findViewById(R.id.mapview); mapView.setBuiltInZoomControls(true); mapOverlays = mapView.getOverlays(); // first overlay drawable = getResources().getDrawable(R.drawable.marker); itemizedOverlay = new CustomItemizedOverlay<CustomOverlayItem>(drawable, mapView); GeoPoint point = new GeoPoint((int)(51.5174723*1E6),(int)(-0.0899537*1E6)); CustomOverlayItem overlayItem = new CustomOverlayItem(point, "Tomorrow Never Dies (1997)", "(M gives Bond his mission in Daimler car)", "http://ia.media-imdb.com/images /M/MV5BMTM1MTk2ODQxNV5BMl5BanBnXkFtZTcwOTY5MDg0NA@@._V1._SX40_CR0,0,40,54_.jpg"); itemizedOverlay.addOverlay(overlayItem); GeoPoint point2 = new GeoPoint((int)(51.515259*1E6),(int)(-0.086623*1E6)); CustomOverlayItem overlayItem2 = new CustomOverlayItem(point2, "GoldenEye (1995)", "(Interiors Russian defence ministry council chambers in St Petersburg)", "http://ia.media-imdb.com/images M/MV5BMzk2OTg 4MTk1NF5BMl5BanBnXkFtZTcwNjExNTgzNA@@._V1._SX40_CR0,0,40,54_.jpg"); itemizedOverlay.addOverlay(overlayItem2); mapOverlays.add(itemizedOverlay); // second overlay drawable2 = getResources().getDrawable(R.drawable.marker2); itemizedOverlay2 = new CustomItemizedOverlay<CustomOverlayItem> (drawable2, mapView); GeoPoint point3 = new GeoPoint((int)(51.513329*1E6),(int)(-0.08896*1E6)); CustomOverlayItem overlayItem3 = new CustomOverlayItem(point3, "Sliding Doors (1998)", "(interiors)", null); itemizedOverlay2.addOverlay(overlayItem3); GeoPoint point4 = new GeoPoint((int)(51.51738*1E6),(int)(-0.08186*1E6)); CustomOverlayItem overlayItem4 = new CustomOverlayItem(point4, "Mission: Impossible (1996)", "(Ethan & Jim cafe meeting)", "http://ia.media-imdb.com/images /M/MV5BMjAyNjk5Njk0MV 5BMl5BanBnXkFtZTcwOTA4MjIyMQ@@._V1._SX40_CR0,0,40,54_.jpg"); itemizedOverlay2.addOverlay(overlayItem4); mapOverlays.add(itemizedOverlay2); final MapController mc = mapView.getController(); mc.animateTo(point2); mc.setZoom(16); } @Override protected boolean isRouteDisplayed() { return false; } }

    Read the article

  • How to get an xml node element value using XDocument?

    - by Krishnan
    Here I am listing an xml. < ? xml version="1.0" encoding="utf-8" ? < data < dataitemqqqqqqq< / dataitem < templatedata < Year2001< /Year < /templatedata < mailmergedata < row < facilitynameABC Corporation< /facilityname < dueamount200.00< /dueamount < /row < row < facilitynameXYZ Corporation< /facilityname < DueAmount50.00< /DueAmount < /row < /mailmergedata < /data I want to retrive the value of the node facilityname Anybody pls help Thanks & Regards Krishnan

    Read the article

  • MySQL: SELECT highest column value when WHERE finds similar entries

    - by Ike
    My question is comparable to this one, but not quite the same. I have a database with a huge amount of books, with different editions of some of the same book titles. I'm looking for an SQL statement giving me the highest edition number of each of the titles I'm selecting with a WHERE clause (to find specific book series). Here's what the table looks like: |id|title |edition|year| |--|-------------------------|-------|----| |01|Serie One Title One |1 |2007| |02|Serie One Title One |2 |2008| |03|Serie One Title One |3 |2009| |04|Serie One Title Two |1 |2001| |05|Serie One Title Three |1 |2008| |06|Serie One Title Three |2 |2009| |07|Serie One Title Three |3 |2010| |08|Serie One Title Three |4 |2011| |--|-------------------------|-------|----| The result I'm looking for is this: |id|title |edition|year| |--|-------------------------|-------|----| |03|Serie One Title One |3 |2009| |04|Serie One Title Two |1 |2001| |08|Serie One Title Three |4 |2011| |--|-------------------------|-------|----| The closest I got was using this statement: select id, title, max(edition), max(year) from books where title like "serie one%" group by name; but it returns the highest edition and year and includes the first id it finds: |--|-----------------------|-------|----| |01|Serie One Title One |3 |2009| |04|Serie One Title Two |1 |2001| |05|Serie One Title Three |4 |2011| |--|-----------------------|-------|----| This fancy join also comes close, but doesn't give the right result: select b.id, b.title, b.edition, b.year from books b inner join (select name, max(edition) as maxedition from books group by title) g on b.edition = g.maxedition where b.title like "serie one%" group by title; Using this I'm getting unique titles, but mostly old editions.

    Read the article

  • Dont know how to stop element in certain point

    - by user713190
    Im beginner and im experimenting on a website with fixed and relative postions, what i want to do is to stop bottom part when the two bottom lines(div .top_divider_line) touches nav menu(div .top_holder) here is the preview from site where im stuck. http://elexoj.com/test/ I think making it with jquery will be lot easier but i've no idea how to do it, i'll really appreciate your help. Thank You!

    Read the article

  • ORA-30036: unable to extend segment by 8 in undo tablespace 'UNDO'

    - by Nitin Gurram
    I am trying to update the table which has millions of records. However my update query will update around 2-3 millions of records. I am facing below error on executing the update query. I googled and found that I need to update the Table Space as DBA But is there any work around for executing the update without actually extending the UNDO table space or something dba is not required UPDATESERVICE SET CREATION_TIME = LAST_UPDATE_TIME WHERE CREATION_TIME is null

    Read the article

  • searching map by value

    - by Mariusz Chw
    I have 2 elements (for now) map: #define IDI_OBJECT_5001 5001 #define IDI_OBJECT_5002 5002 /.../ ResourcesMap[IDI_OBJECT_5001] = "path_to_png_file1"; ResourcesMap[IDI_OBJECT_5002] = "path_to_png_file2"; I'm trying to implement method for searching this map. I'm passing string argument (file path) and method return int (key value of map) int ResFiles::findResForBrew(string filePath) { string value = filePath; int key = -1; for (it = ResourcesMap.begin(); it != ResourcesMap.end(); ++it) { if (/*checking if it->second == value */) { key = it->first; break; } } return key; } How I could check when it-second- == value, and then return that key? I would be grateful for some help. Thanks in advance.

    Read the article

  • Limit the model data fields serialized by Web API based on the return type Interface

    - by Stevo3000
    We're updating our architecture to use a single object model for desktop, web and mobile that can be used in the MVVM pattern. I would like to be able to limit the data fields that are serialized through Web API by using interfaces on the controllers. This is required because the model objects for mobile are stored in HTML5 local storage so don't carry optional data while a thin desktop client would be able to store (and work with) more data. To achieve this a model will implement the different interfaces that define which data fields should be serialized and there will be a controller specific to the interface. The problem is that the Web API always serializes every field in the model even if it is not part of the interface being returned. How can we only serialize fields in the returned interface?

    Read the article

  • IO operation taking long time for files in remote server

    - by user841311
    I have files of size 150 MB each in a remote server in a different domain in the network. I am accessing them thorugh UNC path. I want to read the file content and perform a basic string search. When I try reading the files line by line, the operation just don't finish and takes long time, more than 30 minutes. However when I copy those files to my local machine, the same code reads and performs the string search in less than 5 seconds. I don't have .NET framework installed in the server so I have to do this from my machine. I want to perform all this through C# code in .NET framework 3.5 so I don't want to explictly ftp all the files to my machine before performing this operation. Sample Code DirectoryInfo dir = new DirectoryInfo(@strFilePath); FileInfo[] fiArray = dir.getFiles("*.txt"); foreach (FileInfo fi in fiArray) { //reading file content from server takes long time but fast in local machine //perform string search } Let me know if my requirement is not clear. Thanks in advance!

    Read the article

  • graph with database

    - by Flip_novidade
    I need to make two graphs with data coming from the database. I do not know where I am going wrong. If someone can show me the correct way, or provide any examples. must be two graphs, a graph of a specific student another graph of all students thank you public class NotasBean { private Notas notas; private Notas selectedNotas; private List<Notas> filtroNotass; public Notas getNotas() { return notas; } public void setNotas(Notas notas) { this.notas = notas; } public Notas getSelectedNotas() { return selectedNotas; } public void setSelectedNotas(Notas selectedNotas) { this.selectedNotas = selectedNotas; } public List<Notas> getFiltroNotass() { return filtroNotass; } public void setFiltroNotass(List<Notas> filtroNotass) { this.filtroNotass = filtroNotass; } public void prepararAdicionarNotas(){ notas = new Notas(); } public void adicionarNotas(){ dao.NotasDao obj_dao = new dao.NotasDao(); obj_dao.save(notas); } } package dao; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.Statement; import java.util.ArrayList; import java.util.List; import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; import model.Aluno; import model.Notas; import model.Notas; public class NotasDao { private Conexao obj_conexao; public NotasDao() { obj_conexao = new Conexao(); } public List<Notas> list() { List<Notas> array_registros = new ArrayList<Notas>(); try { String sql = "Select alu_in_ra, dis_st_sigla, ald_fl_p1, ald_fl_p2, ald_fl_p3, ald_fl_trab1, ald_fl_trab2 from cad_aluno_disciplina"; Statement comando_sql = (Statement) obj_conexao.getConexao() .createStatement(); ResultSet obj_result = comando_sql.executeQuery(sql); while (obj_result.next()) { Notas obj_notas = new Notas(); obj_notas.setAlura(obj_result.getInt("alu_in_ra")); obj_notas.setDiscsigla(obj_result.getString("dis_st_sigla")); obj_notas.setP1(obj_result.getInt("ald_fl_p1")); obj_notas.setP2(obj_result.getInt("ald_fl_p2")); obj_notas.setP3(obj_result.getInt("ald_fl_p3")); obj_notas.setTrb1(obj_result.getInt("ald_fl_trab1")); obj_notas.setTrb2(obj_result.getInt("ald_fl_trab2")); array_registros.add(obj_notas); } } catch (Exception e) { System.out.println("Erro no select" + e.getMessage()); } finally { obj_conexao.fecharConexao(); } return array_registros; } public void select(Aluno obj_aluno){ FacesContext mensagem = FacesContext.getCurrentInstance(); try{ String comando_sql = "Select alu_in_ra, dis_st_sigla, ald_fl_p1, ald_fl_p2, ald_fl_p3, ald_fl_trab1, ald_fl_trab2 from cad_aluno_disciplina where alu_in_ra=?"; PreparedStatement obj_sql = (PreparedStatement) obj_conexao.getConexao().prepareStatement(comando_sql); obj_sql.setInt(1, obj_aluno.getRa()); obj_sql.executeUpdate(); mensagem.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN, "Erro ao selecionar aluno!","Snif")); }catch(Exception e){ mensagem.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "Erro na inclusão: "+e.getMessage()," Ocoreu o erro: "+e.getMessage())); }finally{ obj_conexao.fecharConexao(); } return; } }//fecha a classe package model; import java.io.Serializable; public class Notas implements Serializable{ private static final long serialVersionUID = 1L; private int alura; private String discsigla; private float p1; private float p2; private float p3; private float trb1; private float trb2; public Notas() { } public Notas (int alura, String discsigla, float p1, float p2, float p3, float trb1, float trb2){ super(); this.alura=alura; this.discsigla=discsigla; this.p1=p1; this.p2=p2; this.p3=p3; this.trb1=trb1; this.trb2=trb2; } public int getAlura() { return alura; } public void setAlura(int alura) { this.alura = alura; } public String getDiscsigla() { return discsigla; } public void setDiscsigla(String discsigla) { this.discsigla = discsigla; } public float getP1() { return p1; } public void setP1(float p1) { this.p1 = p1; } public float getP2() { return p2; } public void setP2(float p2) { this.p2 = p2; } public float getP3() { return p3; } public void setP3(float p3) { this.p3 = p3; } public float getTrb1() { return trb1; } public void setTrb1(float trb1) { this.trb1 = trb1; } public float getTrb2() { return trb2; } public void setTrb2(float trb2) { this.trb2 = trb2; } } <p:panel header="Grafico Notas Aluno" style="width: 550px"> <p:lineChart id="linear" value="#{notasDao.aluno.alura}" var="notas" xfield="#{notas.alura}" height="300px" width="500px" style="chartStyle"> <p:chartSeries label="Prova 1" value="#{notas.p1}" /> <p:chartSeries label="Prova 2" value="#{notas.p2}" /> <p:chartSeries label="Prova 3" value="#{notas.p3}" /> <p:chartSeries label="Trabalho 1" value="#{notas.trb1}" /> <p:chartSeries label="Trabalho 2" value="#{notas.trb2}" /> </p:lineChart> </p:panel> <p:panel header="Grafico Notas" style="width: 550px"> <p:lineChart id="linear" value="#{notasDao.natas}" var="notas" xfield="#{notas.p1}" height="300px" width="500px" style="chartStyle"> <p:chartSeries label="Prova 1" value="#{notas.p1}" /> <p:chartSeries label="Prova 2" value="#{notas.p2}" /> <p:chartSeries label="Prova 3" value="#{notas.p3}" /> <p:chartSeries label="Trabalho 1" value="#{notas.trb1}" /> <p:chartSeries label="Trabalho 2" value="#{notas.trb2}" /> </p:lineChart> </p:panel>

    Read the article

  • JSON parse data in javascript from php

    - by Stefania
    I'm trying to retrieve data in a javascript file from a php file using json. $items = array(); while($r = mysql_fetch_array($result)) { $rows = array( "id_locale" => $r['id_locale'], "latitudine" => $r['lat'], "longitudine" => $r['lng'] ); array_push($items, array("item" => $rows)); } ECHO json_encode($items); and in the javascript file I try to recover the data using an ajax call: $.ajax({ type:"POST", url:"Locali.php", success:function(data){ alert("1"); //var obj = jQuery.parseJSON(idata); var json = JSON.parse(data); alert("2"); for (var i=0; i<json.length; i++) { point = new google.maps.LatLng(json[i].item.latitudine,json[i].item.longitudine); alert(point); } } }) The first alert is printed, the latter does not, it gives me error: Unexpected token <.... but I do not understand what it is. Anyone have any idea where am I wrong? I also tried to recover the data with jquery but with no positive results.

    Read the article

  • Error using Ksoap2 library in Android

    - by Joseph82
    I'm trying to use KSoap2 library. I put the file Ksoap2-android-assembly-2.5.7-jar-with-dependencies.jar in the directory workspace myproject libs Then I setted it in build path. (libraries) I have error just when I run the application: 11-27 10:32:56.260: E/dalvikvm(1593): Could not find class 'org.ksoap2.serialization.SoapObject', referenced from method associated to this code line: SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); I tried also with the steps suggested in this thread exception while using ksoap2 library for android whitout success

    Read the article

  • Why thread in background is not waiting for task to complete?

    - by Haris Hasan
    I am playing with async await feature of C#. Things work as expected when I use it with UI thread. But when I use it in a non-UI thread it doesn't work as expected. Consider the code below private void Click_Button(object sender, RoutedEventArgs e) { var bg = new BackgroundWorker(); bg.DoWork += BgDoWork; bg.RunWorkerCompleted += BgOnRunWorkerCompleted; bg.RunWorkerAsync(); } private void BgOnRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs runWorkerCompletedEventArgs) { } private async void BgDoWork(object sender, DoWorkEventArgs doWorkEventArgs) { await Method(); } private static async Task Method() { for (int i = int.MinValue; i < int.MaxValue; i++) { var http = new HttpClient(); var tsk = await http.GetAsync("http://www.ebay.com"); } } When I execute this code, background thread don't wait for long running task in Method to complete. Instead it instantly executes the BgOnRunWorkerCompleted after calling Method. Why is that so? What am I missing here? P.S: I am not interested in alternate ways or correct ways of doing this. I want to know what is actually happening behind the scene in this case? Why is it not waiting?

    Read the article

  • urllib2 misbehaving with dynamically loaded content

    - by Sheena
    Some Code headers = {} headers['user-agent'] = 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0' headers['Accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' headers['Accept-Language'] = 'en-gb,en;q=0.5' #headers['Accept-Encoding'] = 'gzip, deflate' request = urllib.request.Request(sURL, headers = headers) try: response = urllib.request.urlopen(request) except error.HTTPError as e: print('The server couldn\'t fulfill the request.') print('Error code: {0}'.format(e.code)) except error.URLError as e: print('We failed to reach a server.') print('Reason: {0}'.format(e.reason)) else: f = open('output/{0}.html'.format(sFileName),'w') f.write(response.read().decode('utf-8')) A url http://groupon.cl/descuentos/santiago-centro The situation Here's what I did: enable javascript in browser open url above and keep an eye on the console disable javascript repeat step 2 use urllib2 to grab the webpage and save it to a file enable javascript open the file with browser and observe console repeat 7 with javascript off results In step 2 I saw that a whole lot of the page content was loaded dynamically using ajax. So the HTML that arrived was a sort of skeleton and ajax was used to fill in the gaps. This is fine and not at all surprising Since the page should be seo friendly it should work fine without js. in step 4 nothing happens in the console and the skeleton page loads pre-populated rendering the ajax unnecessary. This is also completely not confusing in step 7 the ajax calls are made but fail. this is also ok since the urls they are using are not local, the calls are thus broken. The page looks like the skeleton. This is also great and expected. in step 8: no ajax calls are made and the skeleton is just a skeleton. I would have thought that this should behave very much like in step 4 question What I want to do is use urllib2 to grab the html from step 4 but I cant figure out how. What am I missing and how could I pull this off? To paraphrase If I was writing a spider I would want to be able to grab plain ol' HTML (as in that which resulted in step 4). I dont want to execute ajax stuff or any javascript at all. I don't want to populate anything dynamically. I just want HTML. The seo friendly site wants me to get what I want because that's what seo is all about. How would one go about getting plain HTML content given the situation I outlined? To do it manually I would turn off js, navigate to the page and copy the html. I want to automate this. stuff I've tried I used wireshark to look at packet headers and the GETs sent off from my pc in steps 2 and 4 have the same headers. Reading about SEO stuff makes me think that this is pretty normal otherwise techniques such as hijax wouldn't be used. Here are the headers my browser sends: Host: groupon.cl User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-gb,en;q=0.5 Accept-Encoding: gzip, deflate Connection: keep-alive Here are the headers my script sends: Accept-Encoding: identity Host: groupon.cl Accept-Language: en-gb,en;q=0.5 Connection: close Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 User-Agent: User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0 The differences are: my script has Connection = close instead of keep-alive. I can't see how this would cause a problem my script has Accept-encoding = identity. This might be the cause of the problem. I can't really see why the host would use this field to determine the user-agent though. If I change encoding to match the browser request headers then I have trouble decoding it. I'm working on this now... watch this space, I'll update the question as new info comes up

    Read the article

  • Add 1.6.0 Cordova plugin to 2.2.0 Cordova project

    - by BlackFlam3
    How do I add a cordova plugin made on 1.6.0 to a 2.2.0 cordova project for iOS? Upgrade the 1.6.0 project to 1.7.0, then 1.8.0 and so on (doesn't feel right)? Or how do I resolve the current callback signature on the new Cordova(2.2.0) that uses "(CDInvokedURL *)command" as parameter instead of (NSDictionary *)options? More specifically, I am trying to add the Calendar Plugin for iOS to a Cordova 2.2.0 project.

    Read the article

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