In some cases i have faced the operation at that time,

We can use the both HashMap or Model Class (POJO) as a <Key,Value> references for List.

Can you suggest me which is the better for memory vise, performances vise.

I know both are the better in it place, but i just want to know if i have option to take both alternative.... which is the best ?

I have an android STB and I'd like to know if there is any library with I can use the built in DVB-T tuner?

Thanks in advance!

Can something like this be achieved in Android? my guess is not since you can specify 2 different layouts one for the ActionBar and one for the Activity, but I may also be mistaken

enter image description here

I am trying to implement a SlidingTabsLayout in my application. I took help from SlidingTabsBasic Android Developer.It works fine. I want to display an icon instead of text as navigation tabs as with Facebook.

I'm working through the example code of chapter 4 of Core Servlets and JavaServer Pages (http://volume1.coreservlets.com/archive/Chapter4.html) and I get the above error when I try to compile the BeanUtilities.java file. I thought initially it was my classpath but that seems to include the required .jar files (looking at the starttomcat prompt). I think I have the .jar files in the correct directory ($CATALINA_HOME/lib/ I'm running tomcat 7 on fedora). Any advice? Thanks & I hope your day is going better than mine, sigh.

I'm starting a web design club at my school next year and I need some ideas for some projects to get the kids interested. So far I have creating a rudimentary social media profile, a movie dedication page, a Halloween-themed page, an animated Christmas card, and an "advertisement." Hopefully, the challenges get harder as time goes on. If not, please tell me how I could reordered them or make them more challenging. But the main thing I need is eight more challenges. Thanks!

P.S.- This post was originally on StackOverflow, but someone suggested I ask it here.

I have implemented a PageRank algorithm in java correctly and want to adjust its weights.

But the problem is if the iteration size of PageRank is more than 3, changing the weights does not affect the results anymore. If it is 1,2 or three, then the results are changed by changing the weights.

What is the reason of this problem and how can it be fixed?

I have multiple mp3 files saved in a 4GB USB. These mp3 files are a mixture of songs, announcements, and greetings. The USB is plugged into an amplifier. However, the amplifier is turned on at different times of the day.

The problem is, among the mp3 files I have mentioned, I have Morning and Evening greetings set to play at the start and end of the list of audio files. So if the amplifier would be turned on at say 3pm in the afternoon, listeners would be greeted with a Good Morning Message.

Is there a way to have individual audio files play at specific times of the day to avoid this problem?

I have a class written on a project I'm working on that I've been told is using the module pattern, but it's doing things a little differently than the examples I've seen. It basically takes this form:

(function ($, document, window, undefined) {

    var module = {
        foo : bar,

        aMethod : function (arg) {
            className.bMethod(arg);
        },
        bMethod : function (arg) {
            console.log('spoons');
        }
    };
    window.ajaxTable = ajaxTable;

})(jQuery, document, window);

I get what's going on here. But I'm not sure how this relates to most of the definitions I've seen of the module (or revealing?) module pattern. like this one from briancray

var module = (function () {
    // private variables and functions
    var foo = 'bar';

    // constructor
    var module = function () {
    };

    // prototype
    module.prototype = {
        constructor: module,
        something: function () {
        }
    };

    // return module
    return module;
})();

var my_module = new module();

Is the first example basically like the second except everything is in the constructor? I'm just wrapping my head around patterns and the little things at the beginnings and endings always make me not sure what I should be doing.

Not the first time this happens to me. I am a programmer hobbyist (self learnt), and once in a while I like to make games and interactive scripts (nowadays mostly in JavaScript for its ease). Sometimes I start long projects that end up being forgotten because of other things I have to do. Sometimes a project gets really big and hard coded (say, 3000 lines is a huge deal to me), but my code is mostly uncommented, unorganized, and unoptimised. So some projects are never finished, and my question is: what can be done with those?

I wish I had the time to program every software/game/app idea I have. Sometimes I even feel they could turn out to be big rentable products. I know some stuff can be done through collaborative funding, but is there any community of programmers that would freely code a design based merely on the idea? I am afraid of giving away the ideas so they won't be stolen, how to proceed and undertake projects? (Maybe this question goes also beyond the programming and extends to inventions in general, but I hope you can help.)

In Java, just by clicking the classes in Eclipse, I can go to that specific class being referenced. In C, how can I do that? As far as I can remember I wasn't able to do that in Eclipse. I had hard times manually finding where externs are declared/defined etc.

date.php
<?php 
@require_once 'config/config.php';
?>
<script>
            $(document).ready(function(){
                $( "#startDate , #endDate" ).datepicker({
                    dateFormat: 'dd-mm-yy',
                    showOn: "button",
                    buttonImage: "images/calendar.gif",
                    buttonImageOnly: true,
                        changeMonth: true,
                        changeYear: true,
                        yearRange: "-30"
                });
            });
            function sales_report_fn() 
{ 
 window.open("Ac.php?startDate="+$('#startDate').val()+"&endDate="+$('#endDate').val(),"myNewWinsr","width=620,height=800,toolbar=0,menubar=no,status=no,resizable=yes,location=no,directories=no,scrollbars=yes"); 

}
        </script>
        <form id="formSubmit" method="post" >

                                      <input type="hidden" name="type" value="view" />
                                      From:
                                      <input type="text" class="validate[required]" readonly="readonly"  name="startDate" id="startDate" />
                                      &nbsp;&nbsp;To:
                                      <input type="text" class="validate[required]" readonly="readonly"  name="endDate" id="endDate" />
                                      &nbsp;&nbsp;
                                      <input name="submit" type="button" value="&nbsp;&nbsp;Show&nbsp;&nbsp; " onClick='sales_report_fn();'>
                                    </p>
                                </form>

                                AC.php
                             <?php
@require_once 'config/config.php'; 
            $selected_date=$_GET['startDate'];
            $selected_date=strtotime( $selected_date );
            $mysqldate = date( 'Y-m-d H:i:s', $selected_date );
$fromdate=$mysqldate;
            $selected_date=$_GET['endDate'];
            $selected_date=strtotime( $selected_date );
            $mysqldate = date( 'Y-m-d H:i:s', $selected_date );
$todate=$mysqldate;
?>
<script type="text/javascript">
function printpage() {
document.getElementById('printButton').style.visibility="hidden";
window.print();
document.getElementById('printButton').style.visibility="visible";  
}
</script>
<?php echo  $age = $db->queryUniqueValue("SELECT sum(Rec_Amt) FROM patients_detail where date BETWEEN '$fromdate' AND '$todate' ");?>
<?php echo  $age = $db->queryUniqueValue("SELECT count(opd_no) FROM patients_detail where date BETWEEN '$fromdate' AND '$todate' ");?>
<?php echo $_GET['startDate']; ?>
<?php echo $_GET['endDate']; ?>
 <?php 
              $result = $db->query("SELECT * FROM patients_detail where date BETWEEN '$fromdate' AND '$todate' ");
while ($line = $db->fetchNextObject($result)) {
?>
<tr>
            <td><?php  $mysqldate=$line->date;
    $phpdate = strtotime( $mysqldate );
    $phpdate = date("d/m/Y",$phpdate);
    echo $phpdate; ?></td>
            <td><?php echo $line->EmpID; ?></td>
            <td><?php echo $line->EmpName; ?></td>
            <td><?php echo $line->opd_no; ?></td>
            <td><?php echo $line->Rec_no; ?></td>
            <td><?php echo $line->Rec_Amt; ?>/-</td>
          </tr>

I'm a junior developer in a small company (in a team of 2 developers). Everytime we are asked to implement a new feature:

  • the deadline is set so that we just have time to do the development : there is no error margin (if something takes a little bit more time than expected, we are late) ; almost no time for tests (we are pretty sure there will be bugs) ; no time to refactor anything

  • we are asked to start the development before the features are completely specified, so new things to do show up but the deadline stays as it is

The result is that we deliver software that has bugs and the technical debt keeps growing. We use technology that was considered as a recent version in 2006 or so.

There was one release that I remember very well. When we did a demonstration to the boss, he told us "What!?? You took two weeks to produce that?!" and all we could answer was "No, in fact it took us three weeks". I had a meeting with him and an other junior developper (that quit the company because of this said meeting!), and he basically told us that he was not happy because what we released was crap.

The technical debt and the need to refactor were so big in the parts that we had to modify (but we were told not to refactor because we have no time) that:

  • we had to add a layer of bad code on top of the already bad code;
  • we took much time to try understand a completely ununderstandable code.

I don't feel like I'm responsible for this bad release, I think that it's the boss' responsibility to hire good developers that, at least, understand the basic principles of OOP. But hiring juniors is so much less expensive...

He is already saying that we are late for the development I'm working on at the moment. He spent more than one year to "redesign" a tool that was already present in our application, but now he wants us to implement it in two weeks. I personally think that if we want to do it correctly, we need at least one month, or maybe even 6 weeks.

I don't know what to do, because I think that the boss thinks that we are just slow and ineffective. That's not the way I will get the raise I think I deserve.

My question is: is it always like that? Are the deadlines always short? Do developers always have to work under stress and have to deal with bad code written in urgency? If the answer is yes, why is it so? If the answer is no, is there something I can do about it?

I am implementing the Douglas, Peucker's Line Simplification algorithm in Python. I started with this implementation. However, it fails to run in Python due to Maximum Recursion Depth being hit. How can I convert this algorithm to a iterative one? I am not able to imagine this problem in an iterative view.

My expectation is to get approach/hint which can be used rather than actual code. Is it possible to use some internal stack to resolve the stack overflow (or avoid the maximum recursion depth)?

I am trying to think of the most sensible way to design the architecture of a data generation system with several steps.

Data in the system goes through several transformations which can be divided into separate steps (from the business logic point of view).

I would like the system to keep this modular design, in a such a way that each module represents a step in the data transformation.

A module's input should be the previous module's output.

  1. What are some good ways to orchestrate this flow?
  2. How should modules communicate with each other?
  3. In each step, where should the input come from, and where should the output go?
  4. Is it a good idea to use a database as the source and target of data consumption / generation for each module?
  5. Should modules be built as separate scripts / executables which only directly communicate with the database?

Edit:

The system will be implemented by several people. Each developer will be assigned a module. I would like the architecture to simplify the workflow by allowing each developer to work independently; and make assumptions only about the data their specific module consumes.

we have seen the following problem: at the end of the iteration we give the android app to our customer to test.

our tests run fine, but they come back with problems that we cannot reproduce on our devices.

we have a set of 5 devices that both ourselves and the customer uses to do a first round of tests.

after that we plan to move into crowdtesting phase - were probably there will be again bugs that we cannot reproduce.

so, how should we deal with this? are there any tools that we can use?

Is there a common way to name your client facing and admin facing APIs?

I have a system where administrators access a web application to define and structure mobile apps that they own. The mobile apps are used by a different set of users - end users downloading them from the app stores.

What might be common names to distinguish between the API I am making available to administrators and the API I am making available to the end users?

Am I right in thinking the most common naming is: "Back end" vs "Front end"?

I have received an unexpected error while trying to load my Activity Single Item activity. In brief, this activity is suppose to populate JSON data into the application.

Below is the logcat message recieved:

08-06 21:49:11.711: E/AndroidRuntime(3006): FATAL EXCEPTION: main
08-06 21:49:11.711: E/AndroidRuntime(3006): Process: com.dooba.beta, PID: 3006
08-06 21:49:11.711: E/AndroidRuntime(3006): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dooba.beta/com.dooba.beta.EventSingleItemActivity}: java.lang.NullPointerException: uriString
08-06 21:49:11.711: E/AndroidRuntime(3006):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
08-06 21:49:11.711: E/AndroidRuntime(3006):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
08-06 21:49:11.711: E/AndroidRuntime(3006):     at android.app.ActivityThread.access$800(ActivityThread.java:135)
08-06 21:49:11.711: E/AndroidRuntime(3006):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
08-06 21:49:11.711: E/AndroidRuntime(3006):     at android.os.Handler.dispatchMessage(Handler.java:102)
08-06 21:49:11.711: E/AndroidRuntime(3006):     at android.os.Looper.loop(Looper.java:136)
08-06 21:49:11.711: E/AndroidRuntime(3006):     at android.app.ActivityThread.main(ActivityThread.java:5017)
08-06 21:49:11.711: E/AndroidRuntime(3006):     at java.lang.reflect.Method.invokeNative(Native Method)
08-06 21:49:11.711: E/AndroidRuntime(3006):     at java.lang.reflect.Method.invoke(Method.java:515)
08-06 21:49:11.711: E/AndroidRuntime(3006):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
08-06 21:49:11.711: E/AndroidRuntime(3006):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
08-06 21:49:11.711: E/AndroidRuntime(3006):     at dalvik.system.NativeStart.main(Native Method)
08-06 21:49:11.711: E/AndroidRuntime(3006): Caused by: java.lang.NullPointerException: uriString
08-06 21:49:11.711: E/AndroidRuntime(3006):     at android.net.Uri$StringUri.<init>(Uri.java:467)
08-06 21:49:11.711: E/AndroidRuntime(3006):     at android.net.Uri$StringUri.<init>(Uri.java:457)
08-06 21:49:11.711: E/AndroidRuntime(3006):     at android.net.Uri.parse(Uri.java:429)
08-06 21:49:11.711: E/AndroidRuntime(3006):     at com.dooba.beta.EventSingleItemActivity.onCreate(EventSingleItemActivity.java:26)
08-06 21:49:11.711: E/AndroidRuntime(3006):     at android.app.Activity.performCreate(Activity.java:5231)
08-06 21:49:11.711: E/AndroidRuntime(3006):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
08-06 21:49:11.711: E/AndroidRuntime(3006):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
08-06 21:49:11.711: E/AndroidRuntime(3006):     ... 11 more

Below is the Event Single Item Activity code

public class EventSingleItemActivity extends Activity {

    // Declare Variables
    String list_item_name;
    String list_item_description;
    String list_item_price;
    String single_list_item_description;




    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_events_single_item);

        Intent i = getIntent();
        Uri urisingle = Uri.parse(i.getStringExtra("single_list_item_bac"));
        list_item_name = i.getStringExtra("list_item_name");
        single_list_item_description = i.getStringExtra("single_list_item_description");
        list_item_price = i.getStringExtra("list_item_price");

        TextView txtname = (TextView) findViewById(R.id.name);
        TextView txtsdescription = (TextView) findViewById(R.id.sdescription);
        TextView txtprice = (TextView) findViewById(R.id.price);

        // Set results to the TextViews
        txtname.setText(list_item_name);
        txtsdescription.setText(single_list_item_description);
        txtprice.setText(list_item_price);


    }
}

Below is the main activity page

public class EventsActivity extends Activity{

    private static final String URL_WEB_SERVICE = "http://dooba.ca/analytics/ed.php";
    private GridView gv;
    private ArrayList<Events_List> container;
    private ArrayList<Events_List> items;
    public Uri list_item_bac;
    public Uri single_list_item_bac;
    public String list_item_name;
    public String list_item_description;
    public String single_list_item_description;
    public String list_item_price;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.events_list_layout);
        gv = (GridView) findViewById(R.id.gridview);
        container = new ArrayList<Events_List>();
        //download JSON
        listDownload();


        GridView s = (GridView) findViewById(R.id.gridview);
        s.setOnItemClickListener(new OnItemClickListener(){

            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                Intent intent = new Intent(EventsActivity.this,EventSingleItemActivity.class);
                intent.putExtra("single_list_item_bac",container.get(position).getSingle_list_item_bac());
                intent.putExtra("list_item_name", container.get(position).getList_item_title());
                intent.putExtra("single_list_item_description", container.get(position).getSingle_list_item_description());
                intent.putExtra("list_item_price",container.get(position).getList_item_price());

                startActivity(intent); //start Activity
            }
        });
    }
    public void listDownload(){
        RequestQueue volley = Volley.newRequestQueue(this);
        JsonObjectRequest json = new JsonObjectRequest(Method.GET, URL_WEB_SERVICE, null, ResponseListener(), ErrorListener());
        volley.add(json);
    }

    private Response.Listener<JSONObject> ResponseListener() {
        return new Response.Listener<JSONObject>() {
            @Override
            public void onResponse(JSONObject response) {
                try {
                    //your JSON Array
                    JSONArray array = response.getJSONArray("list_item");
                    for(int i = 0; i < array.length(); i++){
                        container.add(convertirAnuncio(array.getJSONObject(i)));
                    }
                } catch (JSONException e) {
                    e.printStackTrace();
                }
                gv.setAdapter(new AdapterEvents(getApplicationContext(),container));
                }
            };
        };


    private Response.ErrorListener ErrorListener() {
        return new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) { }
        };
    }

    //object JSON
    private final Events_List convertirAnuncio(JSONObject obj) throws JSONException {
        long id = obj.getLong("id"); //id 
        String list_item_name = obj.getString("list_item_name"); 
        String list_item_description = obj.getString("list_item_description");
        String list_item_price = obj.getString("list_item_price");
        String single_list_item_description = obj.getString("single_list_item_description");
        Uri uri = Uri.parse(obj.getString("list_item_bac"));
        return new Events_List(id,single_list_item_description,single_list_item_bac, list_item_name,list_item_description,list_item_price, uri);
    }
}

Below is the event list code

public class Events_List {
public long id;
public String list_item_title;
public String list_item_price;
public Uri single_list_item_bac;
public String list_item_description;
public String single_list_item_description;

public Uri url;

public Events_List(long id, String single_list_item_description, Uri single_list_item_bac, String list_item_title, String list_item_description, String list_item_price, Uri url){
    this.id = id;
    this.list_item_title = list_item_title;
    this.list_item_description = list_item_description;
    this.single_list_item_description = single_list_item_description;
    this.list_item_price = list_item_price;
    this.single_list_item_bac = single_list_item_bac;
    this.url = url;
}

public String getList_item_title()
{
    return this.list_item_title;
}

public Uri getSingle_list_item_bac()
{
    return this.single_list_item_bac;
}

public String getList_item_price()
{
    return this.list_item_price;
}

public String getList_item_description()
{
    return this.list_item_description;
}

public String getSingle_list_item_description()
{
    return this.single_list_item_description;
}


}

Any help would be greatly appreciated.

When using the cocos IDE the app compiles in the mac and HTML environment but crashes when ran on an android phone.enter link description here

org.eclipse.core.runtime.CoreException: Error in remove file on runtime.
    at org.ccdt.common.resource.UploadManager.removeFileByRelativePath(UploadManager.java:319)
    at org.ccdt.common.resource.UploadManager.initResourceToRuntime(UploadManager.java:294)
    at org.ccdt.debug.internal.jsbinding.connect.AndroidConnector.uploadResouceToRuntime(Unknown Source)
    at org.ccdt.debug.internal.jsbinding.connect.AttachConnector.doLaunch(Unknown Source)
    at org.ccdt.debug.internal.core.launching.RemoteCocosLaunchDelegate$1.run(Unknown Source)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.RuntimeException: Runtime disconnected
    at org.ccdt.common.ccconsole.CCConsole.handleException(CCConsole.java:259)
    at org.ccdt.common.ccconsole.CCConsole.sendRequest(CCConsole.java:228)
    at org.ccdt.common.ccconsole.CCConsole.removeFiles(CCConsole.java:189)
    at org.ccdt.common.resource.UploadManager.removeFileByRelativePath(UploadManager.java:316)
    ... 5 more
Caused by: java.io.IOException: The end of the socket stream has been reached
    at org.ccdt.common.ccconsole.CCSocketConnection.readPacket(CCSocketConnection.java:106)
    at org.ccdt.transport.packet.PacketReceiveManager.a(Unknown Source)
    at org.ccdt.transport.packet.PacketReceiveManager.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:745)

I'm implementing linked in functionaities in my app and getting this error:

Error java.lang.ClassNotFoundException: com.google.code.linkedinapi.client.impl.LinkedInApiXppClient

on this line of code:

LinkedInLoginDialog.factory.createAsyncLinkedInApiClient(accessToken);

Someone please help me!