Monday, 30 September 2013

How do I purge the Steam Installer?

How do I purge the Steam Installer?

From the related question here the first I did was purging Steam
How do I remove Steam?
The next step would then be to also remove related files in
~/.local/share/Steam and in addition to the answers from above ~/.steam.
One thing makes me believe there still will be more to do. The reason I
purged Steam in the first place was that on other user's account we get a
message to install Steam on every login:

This will definitely not come from files in my home directory, and can
also not be from a system-wide Steam package, as this was purged as can be
seen from the Synaptic window in the background of the shot above. Also in
the other user's accounts there is no ~/.steam or ~/.local/share/Steam
directory. Autostart applications in ~/.config/autostart/ or
/etc/xdg/autostart have no Steam related entries.
Where do I have to look for this "installer" to also remove it? Will there
be any other Steam-related files cluttering my drives?
Here is running 12.04 LTS amd64 on a productive desktop. Steam was
installed initially from the Software Center.

"Violation of the Florida Atlantic University Honor Code"– meta.stackoverflow.com

"Violation of the Florida Atlantic University Honor Code" –
meta.stackoverflow.com

In the review queue for Suggested Edits, I bumped into this edit. There is
a newly registered user with only 1 reputation that suggests removing the
code in the answer because of "violation of the ...

GUI get displayed as a blank window

GUI get displayed as a blank window

Please have a look at the following code
activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<TableLayout
android:id="@+id/gameBoard"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
></TableLayout>
</RelativeLayout>
game_buttons.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/buttonLayout" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="34dp"
android:layout_marginTop="18dp"
android:text="Button" />
</RelativeLayout>
MainActivity.java
package com.ace.ticktacktoe;
import android.os.Bundle;
import android.app.Activity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.widget.Button;
import android.widget.GridView;
import android.widget.RelativeLayout;
import android.widget.TableLayout;
import android.widget.TableRow;
public class MainActivity extends Activity {
private LayoutInflater inflater;
private TableLayout gameBoard;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
createUI();
//Create the user interface
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is
present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
private void createUI()
{
gameBoard = (TableLayout)findViewById(R.id.gameBoard);
inflater = getLayoutInflater();
RelativeLayout layout =
(RelativeLayout)inflater.inflate(R.layout.game_buttons, null);
//Add the buttons
TableRow tableRow = new TableRow(this);
Button btn = (Button)layout.findViewById(R.id.button1);
((RelativeLayout)btn.getParent()).removeView(btn);
tableRow.addView(btn);
gameBoard.addView(tableRow);
}
}
When I run this code, the added button should be displayed. But, my
display is totally blank! What am I doing wrong here? Please help.

how to is any variable accessed outside the block when "return" is used?

how to is any variable accessed outside the block when "return" is used?

i am beginner in c and have started writing code in c.I am having doubt
regarding scope of variable .when any variable is written inside the block
then its scope is inside that block.but when return word is used how is
accessed outside the block?
for eg:
int add(int a, int b)
{
int c;//scope of c is within this block
c=a+b;
return c;
}//it ends here
void main()
{
int answer;
answer=add(2,3);//how we gets value of "c " here
printf("%d",answer);
}

Sunday, 29 September 2013

Uncaught TypeError: Cannot call method 'appendChild' of null?

Uncaught TypeError: Cannot call method 'appendChild' of null?

I.m using pagedown editor in my project.
My HTML code:
<div style="padding-top:20px;" class="control-group">
<div class="controls">
<textarea class="wmd-input"
id="wmd-input"></textarea>
</div>
</div>
<div style="padding-top:20px;" class="control-group">
<label for="signature" class="control-label
user-label">ѧУרҵ</label>
<div class="controls">
<div id="wmd-preview" class="wmd-panel
wmd-preview"></div>
</div>
</div>
and my javascript code:
<script type="text/javascript">
$(function()
{
var converter1 = Markdown.getSanitizingConverter();
var editor1 = new Markdown.Editor(converter1);
editor1.run();
});
</script>
google chrome browser throw out an error "Uncaught TypeError: Cannot call
method 'appendChild' of null ?", what's wrong in my code?

Commit failed by using SVN Can't open file '/svnlokal/db/txn-current-lock': Permission denied

Commit failed by using SVN Can't open file
'/svnlokal/db/txn-current-lock': Permission denied

using Jenkins i receive following mistake, if i try to make release using
maven-release-plugin. The mistake looks like:
......mavenExecutionResult exceptions not empty
message : Failed to execute goal
org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli) on
project My project: Unable to commit files
Provider message:
The svn command failed.
Command output:
svn: E000013: Commit failed (details follow):
svn: E000013: Can't open file '/home/kobv/svnlokal/db/txn-current-lock':
Permission denied
cause : Unable to commit files
Provider message:
The svn command failed.
Command output:
svn: E000013: Commit failed (details follow):
svn: E000013: Can't open file '/home/kobv/svnlokal/db/txn-current-lock':
Permission denied
Stack trace :
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute
goal org.apache.maven.plugins:maven-release-plugin:2.0:prepare
(default-cli) on project kobv-albert-frontend-dkfz: Unable to commit files
Provider message:
The svn command failed.
Command output:
svn: E000013: Commit failed (details follow):
svn: E000013: Can't open file '/home/kobv/svnlokal/db/txn-current-lock':
Permission denied
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at
org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:100)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:66)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.maven.plugin.MojoFailureException: Unable to commit
files
Provider message:
The svn command failed.
Command output:
svn: E000013: Commit failed (details follow):
svn: E000013: Can't open file '/home/kobv/svnlokal/db/txn-current-lock':
Permission denied
at
org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:219)
at
org.apache.maven.plugins.release.PrepareReleaseMojo.execute(PrepareReleaseMojo.java:181)
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 26 more
Caused by: org.apache.maven.shared.release.scm.ReleaseScmCommandException:
Unable to commit files
Provider message:
The svn command failed.
Command output:
svn: E000013: Commit failed (details follow):
svn: E000013: Can't open file '/home/kobv/svnlokal/db/txn-current-lock':
Permission denied
at
org.apache.maven.shared.release.phase.ScmCommitPhase.checkin(ScmCommitPhase.java:133)
at
org.apache.maven.shared.release.phase.ScmCommitPhase.execute(ScmCommitPhase.java:109)
at
org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:203)
at
org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:140)
at
org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:103)
at
org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:211)
... 29 more
channel stopped
Finished: FAILURE
In this example i use a local SVN. This SVN has following settings: in
conf/authz:
* =
name = rw
in passwd:
[users]
name = password
in svnserve.conf
anon-access = read
auth-access = write
password-db = passwd
authz-db = authz
realm = My local repo
The svnlokal order has following structure:
drwxr-xr-x 2 root root 4096 Sep 29 00:19 conf
drwxr-sr-x 6 root root 4096 Sep 29 00:17 db
-r--r--r-- 1 root root 2 Sep 29 00:12 format
drwxr-xr-x 2 root root 4096 Sep 29 00:12 hooks
drwxr-xr-x 2 root root 4096 Sep 29 00:12 locks
-rw-r--r-- 1 root root 229 Sep 29 00:12 README.txt
and svnlokal/db:
-rw-r--r-- 1 root root 2 Sep 29 00:17 current
-r--r--r-- 1 root root 22 Sep 29 00:12 format
-rw-r--r-- 1 root root 1959 Sep 29 00:12 fsfs.conf
-rw-r--r-- 1 root root 5 Sep 29 00:12 fs-type
-rw-r--r-- 1 root root 2 Sep 29 00:12 min-unpacked-rev
-rw-r--r-- 1 root root 471040 Sep 29 00:17 rep-cache.db
drwxr-sr-x 3 root root 4096 Sep 29 00:12 revprops
drwxr-sr-x 3 root root 4096 Sep 29 00:12 revs
drwxr-sr-x 2 root root 4096 Sep 29 00:17 transactions
-rw-r--r-- 1 root root 2 Sep 29 00:17 txn-current
-rw-r--r-- 1 root root 0 Sep 29 00:12 txn-current-lock
drwxr-sr-x 2 root root 4096 Sep 29 00:17 txn-protorevs
-rw-r--r-- 1 root root 37 Sep 29 00:12 uuid
-rw-r--r-- 1 root root 0 Sep 29 00:12 write-lock
I tried to find answer in stackoverflow in the same questions, but it
doesn't help. I tried to change user, but it doesn't help too. I tried to
delete or to rename 'txt-current-lock file', but it doesn't help. Jenkins
tries to open this file even if it doesn't exist. I use following tools: -
Jenkins 1.509 - SVN 1.7 - Archiva 1.3.6 - Maven 3.0.5
Thanks for any suggestions and answers.

RequestTimeout in WEBrick, after loooong time of request processing

RequestTimeout in WEBrick, after loooong time of request processing

All of a sudden, i had this issue with any request to my local server
after looooong time of processing, but its ok with the staging server...
any help???
===========================
RestClient::RequestTimeout - Request Timeout: (gem)
rest-client-1.6.7/lib/restclient/request.rb:184:in rescue in transmit'
(gem) rest-client-1.6.7/lib/restclient/request.rb:140:intransmit' (gem)
rest-client-1.6.7/lib/restclient/request.rb:64:in execute' (gem)
rest-client-1.6.7/lib/restclient/request.rb:33:inexecute' (gem)
rest-client-1.6.7/lib/restclient.rb:72:in post' (gem)
tire-0.5.8/lib/tire/http/client.rb:19:inpost' (gem)
tire-0.5.8/lib/tire/index.rb:143:in store' (gem)
tire-0.5.8/lib/tire/model/search.rb:148:inblock in update_index' (gem)
activesupport-3.2.12/lib/active_support/callbacks.rb:403:in
_run__1874713149948212873__update_elasticsearch_index__2683693579255723637__callbacks'
(gem)
activesupport-3.2.12/lib/active_support/callbacks.rb:405:in__run_callback'
(gem) activesupport-3.2.12/lib/active_support/callbacks.rb:385:in
_run_update_elasticsearch_index_callbacks' (gem)
activesupport-3.2.12/lib/active_support/callbacks.rb:81:inrun_callbacks'
(gem) tire-0.5.8/lib/tire/model/search.rb:144:in update_index' (gem)
tire-0.5.8/lib/tire/model/callbacks.rb:21:inblock in included' (gem)
activesupport-3.2.12/lib/active_support/callbacks.rb:449:in
_run__1874713149948212873__save__2683693579255723637__callbacks' (gem)
activesupport-3.2.12/lib/active_support/callbacks.rb:405:in__run_callback'
(gem) activesupport-3.2.12/lib/active_support/callbacks.rb:385:in
_run_save_callbacks' (gem)
activesupport-3.2.12/lib/active_support/callbacks.rb:81:inrun_callbacks'
(gem) activerecord-3.2.12/lib/active_record/callbacks.rb:264:in
create_or_update' (gem)
activerecord-3.2.12/lib/active_record/persistence.rb:84:insave' (gem)
activerecord-3.2.12/lib/active_record/validations.rb:50:in save' (gem)
activerecord-3.2.12/lib/active_record/attribute_methods/dirty.rb:22:insave'
(gem) activerecord-3.2.12/lib/active_record/transactions.rb:259:in block
(2 levels) in save' (gem)
activerecord-3.2.12/lib/active_record/transactions.rb:313:inblock in
with_transaction_returning_status' (gem)
activerecord-3.2.12/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in
transaction' (gem)
activerecord-3.2.12/lib/active_record/transactions.rb:208:intransaction'
(gem) newrelic_rpm-3.5.8.72/lib/new_relic/agent/method_tracer.rb:491:in
block in transaction_with_trace_ActiveRecord_self_name_transaction' (gem)
newrelic_rpm-3.5.8.72/lib/new_relic/agent/method_tracer.rb:240:intrace_execution_scoped'
(gem) newrelic_rpm-3.5.8.72/lib/new_relic/agent/method_tracer.rb:486:in
transaction_with_trace_ActiveRecord_self_name_transaction' (gem)
activerecord-3.2.12/lib/active_record/transactions.rb:311:inwith_transaction_returning_status'
(gem) activerecord-3.2.12/lib/active_record/transactions.rb:259:in block
in save' (gem)
activerecord-3.2.12/lib/active_record/transactions.rb:270:inrollback_active_record_state!'
(gem) activerecord-3.2.12/lib/active_record/transactions.rb:258:in save'
(gem)
devise-2.1.2/lib/devise/models/trackable.rb:30:inupdate_tracked_fields!'
(gem) devise-2.1.2/lib/devise/hooks/trackable.rb:7:in block in <top
(required)>' (gem) warden-1.2.1/lib/warden/hooks.rb:14:incall' (gem)
warden-1.2.1/lib/warden/hooks.rb:14:in block in _run_callbacks' (gem)
warden-1.2.1/lib/warden/hooks.rb:9:ineach' (gem)
warden-1.2.1/lib/warden/hooks.rb:9:in _run_callbacks' (gem)
warden-1.2.1/lib/warden/manager.rb:53:in_run_callbacks' (gem)
warden-1.2.1/lib/warden/proxy.rb:179:in set_user' (gem)
warden-1.2.1/lib/warden/proxy.rb:323:in_perform_authentication' (gem)
warden-1.2.1/lib/warden/proxy.rb:104:in authenticate' (gem)
devise-2.1.2/lib/devise/controllers/helpers.rb:56:incurrent_individual'
app/controllers/shared/shared_controller.rb:50:in
his_entities_and_latest_posts' (gem)
activesupport-3.2.12/lib/active_support/callbacks.rb:484:inrun_3623636613210358831__process_action_3715467131744981871_callbacks'
(gem) activesupport-3.2.12/lib/active_support/callbacks.rb:405:in
__run_callback' (gem)
activesupport-3.2.12/lib/active_support/callbacks.rb:385:in_run_process_action_callbacks'
(gem) activesupport-3.2.12/lib/active_support/callbacks.rb:81:in
run_callbacks' (gem)
actionpack-3.2.12/lib/abstract_controller/callbacks.rb:17:inprocess_action'
(gem) actionpack-3.2.12/lib/action_controller/metal/rescue.rb:29:in
process_action' (gem)
actionpack-3.2.12/lib/action_controller/metal/instrumentation.rb:30:inblock
in process_action' (gem)
activesupport-3.2.12/lib/active_support/notifications.rb:123:in block in
instrument' (gem)
activesupport-3.2.12/lib/active_support/notifications/instrumenter.rb:20:ininstrument'
(gem) activesupport-3.2.12/lib/active_support/notifications.rb:123:in
instrument' (gem)
actionpack-3.2.12/lib/action_controller/metal/instrumentation.rb:29:inprocess_action'
(gem)
actionpack-3.2.12/lib/action_controller/metal/params_wrapper.rb:207:in
process_action' (gem)
activerecord-3.2.12/lib/active_record/railties/controller_runtime.rb:18:inprocess_action'
(gem)
newrelic_rpm-3.5.8.72/lib/new_relic/agent/instrumentation/rails3/action_controller.rb:34:in
block in process_action' (gem)
newrelic_rpm-3.5.8.72/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:268:inblock
in perform_action_with_newrelic_trace' (gem)
newrelic_rpm-3.5.8.72/lib/new_relic/agent/method_tracer.rb:240:in
trace_execution_scoped' (gem)
newrelic_rpm-3.5.8.72/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:263:inperform_action_with_newrelic_trace'
(gem)
newrelic_rpm-3.5.8.72/lib/new_relic/agent/instrumentation/rails3/action_controller.rb:33:in
process_action' (gem)
actionpack-3.2.12/lib/abstract_controller/base.rb:121:inprocess' (gem)
actionpack-3.2.12/lib/abstract_controller/rendering.rb:45:in process'
(gem) actionpack-3.2.12/lib/action_controller/metal.rb:203:indispatch'
(gem)
actionpack-3.2.12/lib/action_controller/metal/rack_delegation.rb:14:in
dispatch' (gem)
actionpack-3.2.12/lib/action_controller/metal.rb:246:inblock in action'
(gem) actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:73:in
call' (gem)
actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:73:indispatch'
(gem) actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:36:in
call' (gem)
actionpack-3.2.12/lib/action_dispatch/routing/mapper.rb:42:incall' (gem)
journey-1.0.4/lib/journey/router.rb:68:in block in call' (gem)
journey-1.0.4/lib/journey/router.rb:56:ineach' (gem)
journey-1.0.4/lib/journey/router.rb:56:in call' (gem)
actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:601:incall'
(gem) newrelic_rpm-3.5.8.72/lib/new_relic/rack/error_collector.rb:8:in
call' (gem)
newrelic_rpm-3.5.8.72/lib/new_relic/rack/agent_hooks.rb:14:incall' (gem)
newrelic_rpm-3.5.8.72/lib/new_relic/rack/browser_monitoring.rb:12:in call'
(gem)
newrelic_rpm-3.5.8.72/lib/new_relic/rack/developer_mode.rb:24:incall'
(gem) mongoid-3.0.9/lib/rack/mongoid/middleware/identity_map.rb:33:in
block in call' (gem)
mongoid-3.0.9/lib/mongoid/unit_of_work.rb:39:inunit_of_work' (gem)
mongoid-3.0.9/lib/rack/mongoid/middleware/identity_map.rb:33:in call'
(gem) sass-3.2.7/lib/sass/plugin/rack.rb:54:incall' (gem)
warden-1.2.1/lib/warden/manager.rb:35:in block in call' (gem)
warden-1.2.1/lib/warden/manager.rb:34:incatch' (gem)
warden-1.2.1/lib/warden/manager.rb:34:in call' (gem)
actionpack-3.2.12/lib/action_dispatch/middleware/best_standards_support.rb:17:incall'
(gem) rack-1.4.5/lib/rack/etag.rb:23:in call' (gem)
rack-1.4.5/lib/rack/conditionalget.rb:35:incall' (gem)
actionpack-3.2.12/lib/action_dispatch/middleware/head.rb:14:in call' (gem)
actionpack-3.2.12/lib/action_dispatch/middleware/params_parser.rb:21:incall'
(gem) actionpack-3.2.12/lib/action_dispatch/middleware/flash.rb:242:in
call' (gem) rack-1.4.5/lib/rack/session/abstract/id.rb:210:incontext'
(gem) rack-1.4.5/lib/rack/session/abstract/id.rb:205:in call' (gem)
actionpack-3.2.12/lib/action_dispatch/middleware/cookies.rb:341:incall'
(gem) activerecord-3.2.12/lib/active_record/query_cache.rb:64:in call'
(gem)
activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:incall'
(gem) actionpack-3.2.12/lib/action_dispatch/middleware/callbacks.rb:28:in
block in call' (gem)
activesupport-3.2.12/lib/active_support/callbacks.rb:405:inrun_1579072322385182133_call_2683693579255723637__callbacks'
(gem) activesupport-3.2.12/lib/active_support/callbacks.rb:405:in
__run_callback' (gem)
activesupport-3.2.12/lib/active_support/callbacks.rb:385:in_run_call_callbacks'
(gem) activesupport-3.2.12/lib/active_support/callbacks.rb:81:in
run_callbacks' (gem)
actionpack-3.2.12/lib/action_dispatch/middleware/callbacks.rb:27:incall'
(gem) actionpack-3.2.12/lib/action_dispatch/middleware/reloader.rb:65:in
call' (gem) rack-1.4.5/lib/rack/sendfile.rb:102:incall' (gem)
actionpack-3.2.12/lib/action_dispatch/middleware/remote_ip.rb:31:in call'
(gem)
better_errors-0.8.0/lib/better_errors/middleware.rb:84:inprotected_app_call'
(gem) better_errors-0.8.0/lib/better_errors/middleware.rb:79:in
better_errors_call' (gem)
better_errors-0.8.0/lib/better_errors/middleware.rb:56:incall' (gem)
actionpack-3.2.12/lib/action_dispatch/middleware/debug_exceptions.rb:16:in
call' (gem)
actionpack-3.2.12/lib/action_dispatch/middleware/show_exceptions.rb:56:incall'
(gem) railties-3.2.12/lib/rails/rack/logger.rb:32:in call_app' (gem)
railties-3.2.12/lib/rails/rack/logger.rb:16:inblock in call' (gem)
activesupport-3.2.12/lib/active_support/tagged_logging.rb:22:in tagged'
(gem) railties-3.2.12/lib/rails/rack/logger.rb:16:incall' (gem)
actionpack-3.2.12/lib/action_dispatch/middleware/request_id.rb:22:in call'
(gem) rack-1.4.5/lib/rack/methodoverride.rb:21:incall' (gem)
rack-1.4.5/lib/rack/runtime.rb:17:in call' (gem)
activesupport-3.2.12/lib/active_support/cache/strategy/local_cache.rb:72:incall'
(gem) rack-1.4.5/lib/rack/lock.rb:15:in call' (gem)
actionpack-3.2.12/lib/action_dispatch/middleware/static.rb:62:incall'
(gem) railties-3.2.12/lib/rails/engine.rb:479:in call' (gem)
railties-3.2.12/lib/rails/application.rb:223:incall' (gem)
rack-1.4.5/lib/rack/content_length.rb:14:in call' (gem)
railties-3.2.12/lib/rails/rack/log_tailer.rb:17:incall' (gem)
rack-1.4.5/lib/rack/handler/webrick.rb:59:in service'
/Users/Mhmoud/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/webrick/httpserver.rb:138:inservice'
/Users/Mhmoud/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/webrick/httpserver.rb:94:in
run'
/Users/Mhmoud/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/webrick/server.rb:191:inblock
in start_thread'

Saturday, 28 September 2013

segmentation fault when I return

segmentation fault when I return

this code segfaults when it returns. I have tried to put the code inline
in main however it fails when it leaves the while loop. Any help you have
is appreciated!
code is called from here
if (inputType == 'M')
{
ReadMap(holder, LvlSize, Levels, start);
}
else if (inputType == 'L')
{
LmodeInput(holder, LvlSize, Levels, start);
}
//code should read in coordinate and initialize a map based on
coordinates
void LmodeInput(vector<vector <square> > &holder,int size, int
levels,square&start)
{
int row = 10;
int column = 10;
int level = 10;
char x = '1';
string trash = "10";
initializeVector(holder, size, levels); //initialize all to .
while (1)
{
if (!(cin >> x))
{
cout << "this should execute";
printMap(holder, size, levels);
cout <<endl;
cout << "break should execute" <<endl;
break;
}
if (x == '/')
{
getline(cin, trash);
continue;
}
cin >> row;
cin>>x;
cin>>column;
cin >>x;
cin>>level;
if (row > (size - 1) || column > (size - 1))
{
cout << "out of bounds" <<endl;
exit(1);
}
else if ( row < 0 || column < 0)
{
cout << "out of bounds" <<endl;
exit(1);
}
else if (level > 10 || level < 0)
{
cout << "out of bounds" <<endl;
exit(1);
}
cin >> x; //,
cin >> x;
if (x == '#' || x== 'E' || x == 'S' || x== 'H' ||x == '.')
{
holder[size*((levels-1)-level) + row][column].type = x;
if (x == 'S')
{
start = holder[size*((levels-1)-level) + row][column];
}
}
else
{
cout << "Invalid character" <<endl;
exit(1);
}
cin >> x;
}
cout << "return will execute";
return
}
this function segfaults when it hits the return statement. all gdb tells
me is that the segfault is in the return
valgrind provides this output:
Invalid write of size 1
==26557== at 0x401776: main (project1.cpp:188)
==26557== Address 0x20 is not stack'd, malloc'd or (recently) free'd
==26557==
==26557==
==26557== Process terminating with default action of signal 11 (SIGSEGV)
==26557== Access not within mapped region at address 0x20
==26557== at 0x401776: main (project1.cpp:188)
==26557== If you believe this happened as a result of a stack
==26557== overflow in your program's main thread (unlikely but
==26557== possible), you can try to increase the size of the
==26557== main thread stack using the --main-stacksize= flag.
==26557== The main thread stack size used in this run was 10485760.

Making a Class Based on Arrays Enumerable in C#

Making a Class Based on Arrays Enumerable in C#

Okay, I have made an earnest effort to understand this over the past hour
or so. So I am wondering if someone can explain this to me.
I'm trying to make a class in C# be Enumerable. Specifically, I'm trying
to make it work with a foreach loop. I have a test going with a simple
class, with takes in characters into the constructor.
EmployeeArray ArrayOfEmployees = new EmployeeArray('a','b','c');
foreach(char e in EmployeeArray) //Nope, can't do this!
{
Console.WriteLine(e);
}
//---Class Definition:---
class EmployeeArray
{
private char[] Employees;
public EmployeeChars(char[] e)
{
this.Employees = e;
}
//Now for my attempt at making it enumerable:
public IEnumerator GetEnumerator(int i)
{
return this.Employees[i];
}
}

PHP - number_format fails with math operations

PHP - number_format fails with math operations

The PHP function number_format produces weird results when using it with
math operations.
Run this...
echo number_format(32545000 - 24343400) . '<br>';
echo number_format(32545000) - number_format(24343400);
Why does the second one produce an answer of "8" instead of the correct
answer?

in scringo API for android how i can catch the tap on custom tab

in scringo API for android how i can catch the tap on custom tab

i am using scringo API for android in my App. I want to know that how to
implement the click event on custom tabs? I have made some custom tabs
from Scringo Admin Panel on web.

Friday, 27 September 2013

Does a jQuery object have a property that points to a corresponding JavaScript object

Does a jQuery object have a property that points to a corresponding
JavaScript object

Being curious. jQuery is written on top of JavaScript. So, for a given
selected DOM element, does jQuery keep a property (attribute) that acts as
a handle to the corresponding (internal) JavaScript DOM object? If so,
what property in the jQuery object acts as a handle to the corresponding
JavaScript object.
To facilitate further, I have quickly written an example at jsfiddle:
http://jsfiddle.net/mMvaD/1/ . The example basically retrieves a DOM
object using both jQuery and prints its (enumerable) properties. Could
someone point me to the property in the jQuery object points to a
JavaScript object, if we have one? For the sake of completeness, I have
also shown properties belonging to a corresponding JavaScript object.
Here is the code:
<html>
<script type="text/javascript"
src="https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<body>
<div id="idDiv"></div>
<script type="text/javascript">
$(document).ready(function() {
$("body").append("jQuery Object:<br>");
elem1 = $("#idDiv");
for (var item in elem1) {
$("body").append(item + ", ");
}
$("body").append("<br><br>JavaScript Object:<br>");
elem2 = document.getElementById("idDiv");
for (var item in elem2) {
$("body").append(item + ", ");
}
});
</script>
</body>
</html>

C# EF Code First Seeding Data - Keeps Adding (Instead of updating)

C# EF Code First Seeding Data - Keeps Adding (Instead of updating)

I have a list of type User and when I try to seed my db to reflect
updates, it is simply adding all the entries again. I will share my code I
am executing in my Seed() method. I wish to just update the records (but
keep the add functionality), if they already exist. Any thoughts?
List<User> users = new List<User>();
users.Add(new User { FirstName = "Dee", LastName = "Reynolds" });
users.Add(new User { FirstName = "Rickety", LastName = "Cricket" });
users.ForEach(b => context.Users.AddOrUpdate(b));

Detecting Javascript as Part of Validation?

Detecting Javascript as Part of Validation?

Like everyone else who develops forms, I worry about validation and
preventing users from entering malicious data. Javascript validation is so
much more immediate and neat, but of course there is the issue that
someone can just turn off Javascript.
What I've wondering, is it a legitimate option to disable forms for users
who have Javascript disabled? Does it work, or can malicious visitors get
around it anyway? Is it a bad idea for other reasons?
I've seen older discussions on this general topic:
How to detect if JavaScript is disabled?
How do I know if Javascript has been turned off inside browser?
What are the current methods and thinking on this?

How can I make a drawn shape extends with the component?

How can I make a drawn shape extends with the component?

I'm drawing lines using Graphics2D. I'm starting at y = 0, but I want the
end of the line to be as maximum as frame it's contained in. So if the
user stretches the frame, I want the lines to also stretch. How can I do
that?
I include the current look of what I did:

public class DrawingApp {
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater( new Runnable() {
@Override
public void run() {
createAndShowGUI();
}
} );
}
private static void createAndShowGUI() {
JFrame frame = new JFrame("Drawing App");
frame.setPreferredSize( new Dimension(700, 500));
frame.setLayout( new BorderLayout() );
frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
DrawingApp app = new DrawingApp();
GraphAreaTest area = app.new GraphAreaTest();
frame.getContentPane().add(area);
frame.pack();
frame.setVisible(true);
}
class GraphAreaTest extends Component {
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
g2.drawLine(50, 0, 50, 100);
}
}
}

how to adding parameters to razor helpers

how to adding parameters to razor helpers

I want to know how write HTML Helper like @Html.TextBoxFor(model =>
model.signature) to have data-id parameter in produced input like below by
helper.
<input type="text" name="signature" data-id="No Signature" />
Note 1: parameter like dataId is work by htmlAttributes because it is a
simple variable.
Note 2: I know extended method and use attribute like @{var attributes =
new Dictionary<string, object>{{ "data-id", "blah" }};}
I feel that there is better way to solve this. Any idea...
Tnx a lot.

Thursday, 26 September 2013

Create a drawable with rounded top corners and a border on bottom

Create a drawable with rounded top corners and a border on bottom

This is what I came up with.
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape android:shape="rectangle" >
<solid android:color="@color/grey" />
<padding
android:bottom="1dp" />
<corners
android:radius="0dp"/>
</shape>
</item>
<item>
<shape android:shape="rectangle" >
<solid android:color="@color/white" />
<corners
android:radius="1dp"
android:bottomRightRadius="0dp"
android:bottomLeftRadius="0dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp"/>
</shape>
</item>
</layer-list>
This is working however the bottom radius is showing up whatever values I
place on it.

Wednesday, 25 September 2013

the below function is not working in IE version

the below function is not working in IE version

function chooseFreqMenu(freqValues,freqTexts) { var cf = document.myform;
alert(freq1);// displaying freq1 value is "d" (ex:selected 'd' in html
dropdown)
// checking some condition for freqValues.
for(var i=4;i<freqValues.length;i++)
selectStr += '<option value="'+freqValues[i]+'">'+freqTexts[i]+'\n';
}
selectStr += '</select>';
//Its working fine in IE=10 browsers but not in less
document.getElementById("freq").innerHTML= selectStr;

Thursday, 19 September 2013

Creating a form with jquery. Cannot append after input element

Creating a form with jquery. Cannot append after input element

Here is the HTML version form I need to create using jquery...
<form id="loginForm" class="loginLabel" action="login/login.php"
method="post">
Username : <input type="text" name="Username" ><br>
Password : <input type="password" name="Password" ><br>
<input type="Submit" name="login_Submit" value="Login">
</form>
And here is the jquery I have written for it...
var loginForm = document.createElement("form");
var userInput = document.createElement("input");
$(userInput).attr("id", "userInput")
.attr("type", "text")
.attr("name", "Username");
var br = document.createElement('br');
var passInput = document.createElement("input");
$(passInput).attr("id", "passInput")
.attr("type", "text")
.attr("name", "Password");
$(loginForm).attr("id","loginForm" )
.attr("class", "loginLabel")
.text("Username : ")
.append(userInput)
.append(br)
.text("Password : ")
.append(passInput);
$(loginWrapper).append(loginForm);
Unfortunately, jquery overwrites the username input (userInput) with the
password input (passInput). I checked the CSS and there is plenty of room
to go around.

How create WebSocket-server and WebSocket client at objective-C?

How create WebSocket-server and WebSocket client at objective-C?

I'm working in small IT-company, and I got a new project. This project is
application for IOS. But, I'm never programmed for iOS. Therefore now, I'm
learning objective-c and programming for iOS. And for our project, we need
use WebSocket protocol. In GitHub i can found project SocketRocket. But I
can't understand how its work. Maybe anybody can send to me the working
test example or tell me, how i can create the easy echo-server?

Having trouble making a background image (line) span screen width with horizontal scroll

Having trouble making a background image (line) span screen width with
horizontal scroll

I need to create a red line that spans the entire screen.
http://jsfiddle.net/k86gc/
<!DOCTYPE html>
<head>
<style type="text/css">
#redBar{ width: 100%; height: 10px; z-index: -1; margin-top: 80px;
background: #D2232A;}
#heading{ width: 768px; margin-left: auto; margin-right: auto; margin-top:
80px;}
</style>
</head>
<body>
<div id="redBar"></div>
<div id="heading"> Heading</div>
</body>
</html>
Notice that when you scroll to the right with the horizontal scroll bar
the red bar does not show up.

Access Denied OAuth 2.0 Google Adwords

Access Denied OAuth 2.0 Google Adwords

I am using a console application I am not able to authenticate the Oauth
2, it's access denied, is there any way to get authentication on console
application project without accessing the url? because my code console
will turn a windows service.
Follow the example of my code:
AdsOAuthProviderForApplications oAuth2Provider =
(user.OAuthProvider the AdsOAuthProviderForApplications);
oAuth2Provider.RedirectUri = null; oAuth2Provider.RefreshToken =
"1/3R_SwvsHk4sFg01RTlSVNmBx8sR7okB7NmBrefvG81E";
oAuth2Provider.RefreshAccessTokenInOfflineMode ();
Thanks

How to encode audio in AAC-LC, AAC-HE-V1, AAC-HE-V2 using libavcodec?

How to encode audio in AAC-LC, AAC-HE-V1, AAC-HE-V2 using libavcodec?

I am trying to encode audio in AAC-LC,AAC-HE-V1, AAC-HE-V2 using
libavcodec/ffmpeg APIs.
But when I am using the following configuration and API calls.It says
"invalid AAC profile."
AVCodecContext *encoder_ctx;
encoder_ctx->codec_id = AV_CODEC_ID_AAC;
encoder_ctx->sample_fmt = AV_SAMPLE_FMT_S16;
encoder_ctx->profile = FF_PROFILE_AAC_HE;
encoder = avcodec_find_encoder(encoder_ctx->codec_id);
avcodec_open2(encoder_ctx, encoder, NULL);
Could you please explain what is wrong with this?

PRC REPORT: Carriage Return in Column to add to concatenated fields

PRC REPORT: Carriage Return in Column to add to concatenated fields

I'm created a PROC REPORT that has a number of columns that are in the
input dataset and some others that are created in COMPUTE blocks. Some of
the columns are created using cats() to concatenate the values of others
etc.
Is it possible to insert a carriage return into a column using ods
escapechar='^' ;? I haven't been successful in doing this. For one of the
columns, I would like to do this, but I can't make it work: _C4_ =
cats(_C2_,"^", _C3); Columns C2 and C3 are computed, numeric columns.
Thanks for any help.

Determining the source of the click event dynamically

Determining the source of the click event dynamically

I have a set of buttons that are added dynamically. As the user keeps
clicking the buttons, new buttons are added to the window. I am using a
winforms. I am binding the onclick event of all these buttons to the same
function. I am using the following code.
System.EventHandler myEventHandle= new
System.EventHandler(this.Button_Clicked);
Once a new dynamic button is created I add the event handler with the
following code:
b1.Click += myEventHandle;
Now in the function Button_Clicked() I want to get the Button which
invoked this event. I want to disable this Button so that it cannot be
clicked again and I want the name of the Button that was clicked as I want
to do various actions depending on button name. I am newbie in C# can you
please help me out. Its urgent.

Wednesday, 18 September 2013

iOS 7 status bar overlapping UI

iOS 7 status bar overlapping UI

I recently upgraded to xcode 5 and when I run my app in the iOS simulator
the splash screen overlaps the status bar and when you are in the app the
status bar overlaps onto elements on my app, like a back button I have on
the top left hand corner of my app. I build my app using phonegap 2.9. Any
ideas how i can get this to render correctly.

Is there a way to put grid lines on top of a contour plot?

Is there a way to put grid lines on top of a contour plot?

I am using the contourf function to create a contour plot:

I would like to get grid lines to appear on top of the plane that shows
the contours.
I came across one solution, but it only works in 2D (that is when you view
the contour plot in 2D) which involved the following two commands:
grid on
set(gca,'layer','top');
However, the grid lines do not appear when viewing the axes in 3D. Is
there any way to do this simply?

Getting list of files in a directory WITHOUT paths in Ruby

Getting list of files in a directory WITHOUT paths in Ruby

(I can't believe how long I've spent on this so I'm just gonna ask it...)
Given a directory path, how do I get the list of the file names underneath
it excluding the path prefix. Yeah I could strip them off but I feel like
I'm missing a cleaner way?
Specifically, I want all the files under the /config directory in Rails:
files = Dir[Rails.root.join("config").to_s + "/*"]
files = Dir.glob(Rails.root.join("config").to_s + "/*")
Each of these returns full-path file names...

Export string to CSV not working

Export string to CSV not working

I am trying to download a string into CSV file with the following code:
string attachment = "attachment; filename=Test.csv";
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ClearHeaders();
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.AddHeader("content-disposition",
attachment);
HttpContext.Current.Response.ContentType = "text/csv";
HttpContext.Current.Response.AddHeader("Pragma", "public");
HttpContext.Current.Response.Write("my,csv,file,contents");
HttpContext.Current.Response.End();
My Fiddler capture gave me the following:
HTTP/1.1 200 OK
Server: ASP.NET Development Server/10.0.0.0
Date: Wed, 18 Sep 2013 22:06:19 GMT
X-AspNet-Version: 4.0.30319
content-disposition: attachment; filename=Test.csv
Pragma: public
Cache-Control: private
Content-Type: text/csv; charset=utf-8
Content-Length: 20
Connection: Close
my,csv,file,contents
But, the browser is not downloading any CSV file. Please help. Thanks,

Multi entity manager, wrong database selected

Multi entity manager, wrong database selected



Hello, i'm using multiple entity managers in Symfony 2, but during a form
validation, the handleRequest method use the wrong one.
Here is my ORM configuration :
dbal:
default_connection: customer_database
connections:
customer_database:
driver: %database_driver%
host: %database_host%
port: %database_port%
dbname: %database_name%
user: %database_user%
password: %database_password%
charset: UTF8
shared_database:
driver: %shared_database_driver%
host: %shared_database_host%
port: %shared_database_port%
dbname: %shared_database_name%
user: %shared_database_user%
password: %shared_database_password%
orm:
auto_generate_proxy_classes: %kernel.debug%
default_entity_manager: customer_em
entity_managers:
shared_em:
connection: shared_database
mappings:
KnFEngineBundle:
type: "annotation"
dir: "Entity/Shared"
customer_em:
connection: customer_database
mappings:
KnFEngineBundle:
type: "annotation"
dir: "Entity/Customer"
KnFModTextBundle: ~
KnFModMapBundle: ~
KnFModFormBundle: ~
And the function in my controller that validate the form :
public function addAction( $isLink )
{
$kernel = $this->container->get( 'knf_engine.kernel' );
$form = $this->createForm( new PageType( $isLink,
$kernel->getAvailablePageOwner() ) );
$request = $this->get( 'request' );
if( $request->getMethod() == 'POST' )
{
$page = new Page( $isLink );
$form->setData( $page );
$form->handleRequest( $request ); //the function call that throw
error
if( $form->isValid() )
{
$kernel->addPage( $page );
return $this->redirect( $this->generateUrl(
'knf_engine_admin_page' ) );
}
}
$args = array( 'form' => $form->createView(),
'url' => $this->getURL(),
'isLink' => $isLink );
if( $request->isXmlHttpRequest() )
{
return $this->render(
'KnFEngineBundle:admin:includes/pageadd_modal.html.twig', $args );
}
else
{
return $this->render( 'KnFEngineBundle:admin:pageadd.html.twig',
$args );
}
}
And the error :
An exception occurred while executing 'SELECT t0.id AS id1, t0.isLink AS
isLink2, t0.externalLink AS externalLink3, t0.isPopup AS isPopup4,
t0.address AS address5, t0.position AS position6, t0.title AS title7,
t0.active AS active8, t0.owner_id AS owner_id9 FROM Page t0 WHERE
t0.address = ?' with params ["dhfg"]:
SQLSTATE[42S02]: Base table or view not found: 1146 Table
'kreanet_framework_global.page' doesn't exist
But the entity is "Page" is defined in the Entity/Customer folder, that is
mapped to the customer entity manager (default em). As you can see,
doctrine try to access the data in the other entity manager.
After investigation, i understood that doctrine bind the form with the
database in the handleRequest() method (i used bind() before but is now
deprecated). I really don't know why doctrine is looking in that database.
Thanks for reading and sorry for my english, it's not my native language
but i hope you can understand my problem.

How to find the longest string in a column with Ruby on Rails?

How to find the longest string in a column with Ruby on Rails?

Is there a function in Ruby to find the longest string, i.e. the one with
the most digits, in a column?
Thanks for any help.

loading indicator when drawing too many objects on the canvas

loading indicator when drawing too many objects on the canvas

I have too many objects on canvas to draw and I want to have some loading
indicator while drawing. My browser waiting and somethimes get frozen for
a while and I need to show loading.gif. Usually aproach doesn't work,
show() div on start and hide() on the end of drawing.

is there a reason for math.round *1000 /1000 doesn't make sense

is there a reason for math.round *1000 /1000 doesn't make sense

I am looking at this line of code and I cannot make sense of it. This
particular code is javascript, but I eventually would like to make a java
android app.
$("#TxtHalfDot").val(Math.round((60000/bpm)*3*1000)/1000);
//bpm being a user entered value
I understand the process of the math and have been through it with a
calculator many times. However, I can not make sense of the *1000 followed
by /1000.
My Question
Is this a strange behavior of the "math.round" function or is it just
simply not needed. I have seen it a lot but when I look at it I feel it
can be omitted, but I am not a computer...
(60000/bpm) * 3 gives the same result ((60000/bpm) *3*1000)/1000

OpenSSL retrieving data from a certificate

OpenSSL retrieving data from a certificate

I am trying to enable https protocol in my local website. I have
implemented uploading mechanism of the certificates and it works like
charm. The next thing that I want to implement is to show some key
information which are retrieved from the uploaded certificate. By this way
the user can see that the certificate is successfully uploaded and
working. So for example, I want to show the organization name, expiry
date. I tried the following but it returns all the name information. I
want to pick the organization name up from this list. Can anyone guide me
through?
$certInfo = openssl_x509_parse(file_get_contents($cert_directory .
'ssl.pem'));
echo $certInfo['name'];
Another question is, what information would be meaningful for the user to
see? I am planning to show organization name and expiry date but perhaps
it would be useful to show some other information as well. Can you comment
on this?

Tuesday, 17 September 2013

Change X,Y Coordinates of image in ireport on base of Parameter

Change X,Y Coordinates of image in ireport on base of Parameter

I have this problem that x,y coordinates of images are coming from db, I
have to show image on the screen I know the image but the position will be
given by parameters at runtime. Is there anyway I can achieve this. Any
help will be appreciated.

How do I create a prefix like jQuery does?

How do I create a prefix like jQuery does?

How do I create a prefix like the one jQuery uses? For example, in jQuery
I can use:
$(".footer").css('display', 'none');
and I'd like to enable a similar syntax, like this:
google('.footer').chrome('display', 'none');
I have searched Google for an answer, but couldn't find it.

How to use XPDM driver on Windows Vista/7?

How to use XPDM driver on Windows Vista/7?

I want to start out by saying that I know XPDM drivers are not meant for
Windows Vista and 7 and that they need to be following the WDDM model.
With that said, I have been doing alot of looking into display drivers and
alot of these driver development companies that are providing these
display drivers have said they have came up with a permanent work around
to use these drivers on windows Vista and 7 and that they are actually
XPDM drivers. How exactly are they doing this? I have requested some
samples to further analyze what is different, but it seems like more than
one company is doing this.
So I am wondering if anyone may know the technique they are using? I would
love to be able to use an XPDM display driver without having to port it
over to WDDM.

Get localized short date pattern as String?

Get localized short date pattern as String?

I'd like to get the pattern of a "short date" as a String that is
customized to the user's locale (e.g. "E dd MMM"). I can easily get a
localized DateFormat-object using
DateFormat mDateFormat =
android.text.format.DateFormat.getDateFormat(mContext);
but DateFormat doesn't have a .toPattern()-method.
If I use
SimpleDateFormat sdf = new SimpleDateFormat();
String mDateFormatString = sdf.toPattern();
I don't know how to only get the short date pattern String instead of the
full M/d/yy h:mm a

NullPointerException (etc) from Parcel.readException

NullPointerException (etc) from Parcel.readException

Exceptions that look like this are confusing:
FATAL EXCEPTION: main
java.lang.NullPointerException
at android.os.Parcel.readException(Parcel.java:1437)
at android.os.Parcel.readException(Parcel.java:1385)
at
com.yourpackage.ipc.IYourClass$Stub$Proxy.yourMethod(IYourClass.java:488)
at com.yourpackage.ipc.YourClassShim.yourMethod(YourClassShim.java:269)
I found a bunch of related questions for this, but none with the answer to
"how do you debug this". So I'm making this Question/Answer.
By looking at the android source here and here you'll see that it can be
throwing any of these (the NullPointerException is just what I had):
SecurityException(msg);
BadParcelableException(msg);
IllegalArgumentException(msg);
NullPointerException(msg);
IllegalStateException(msg);
RuntimeException("Unknown exception code: " + code + " msg " + msg);
But what's causing these?

Xively extract current datastream value

Xively extract current datastream value

I'm able to extract the latest value of the datastream using the following
code BUT the problem is that if I change the value or update the value at
the Xively dashboard console then the code isn't able to capture the
change but still remains displaying the old value!
# main program entry point - runs continuously updating our datastream
with the
def run():
print "Starting Xively tutorial script"
feed = api.feeds.get(FEED_ID)
datastream = get_datastream(feed)
datastream.max_value = None
datastream.min_value = None
while True:
if DEBUG:
print "Updating Xively feed with value: %s"
datastream.at = datetime.datetime.utcnow()
datastream.update()
check_point = datastream.current_value
print "AAGYa: %s" % check_point
if check_point == '50':
outPin = file("/sys/class/gpio/gpio44/value", "w")
outPin.write("1")
elif check_point == '':
outPin = file("/sys/class/gpio/gpio44/value", "w")
outPin.write("1")
elif check_point == '':
outPin = file("/sys/class/gpio/gpio44/value", "w")
outPin.write("1")
run()
THE code is in PYTHON

Sunday, 15 September 2013

Re-installing jenkins in Ubuntu

Re-installing jenkins in Ubuntu

Well, I forgot my password for Jenkins and I tried(for one full day) with
all usual passwords, failed in all attempts. Hence, I wanted to reinstall
jenkins from scratch, luckily I was just setting up and I had no jobs
configured yet.
So I removed (rm -Rf) of jenkins folder from tomcat webapps directory, and
restarted tomcat. To my surprise Jenkins asks for login again.
What is the proper way to remove and reinstall jenkins? I have jenkins.war
and I installed it by just copying it over to tomcat webapps.
Well either - I want to reset my password because I am the only admin or I
want to reinstall jenkins from scratch. I have sudo access to the machine,
could someone point me on how I can do this?

custom font in my android listview

custom font in my android listview

How can I use a custom font in an android ListView?
This is my code:
MainActivity.java
package com.sj.customlistview;
import java.util.ArrayList;
import java.util.List;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.AdapterView;
public class MainActivity extends ListActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initView();
}
private void initView() {
List<Application> apps = populateSampleApplication();
AppAdapter adapter = new AppAdapter(this, apps);
setListAdapter(adapter);
}
private List<Application> populateSampleApplication(){
String[] apps = new String[] {
"Google,3502,5,google",
"Apple,3502,4,apple",
"Twitter,3502,3,twitter",
"Skype,3502,0,skype",
"Facebook,500560,1,facebook"
};
List<Application> list = new ArrayList<Application>();
for(String app:apps) {
String[] rApp = app.split(",");
Application ap = new Application();
ap.setTitle(rApp[0]);
ap.setTotalDl(Integer.parseInt(rApp[1]));
ap.setRating(Integer.parseInt(rApp[2]));
ap.setIcon(rApp[3]);
list.add(ap);
}
return list;
}
}
Application.java
package com.sj.customlistview;
public class Application {
private String title;
private long totalDl;
private int rating;
private String icon;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public long getTotalDl() {
return totalDl;
}
public void setTotalDl(long totalDl) {
this.totalDl = totalDl;
}
public int getRating() {
return rating;
}
public void setRating(int rating) {
this.rating = rating;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
}
ArrayAdapter.java
package com.sj.customlistview;
import java.text.NumberFormat;
import java.util.List;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
public class AppAdapter extends ArrayAdapter<Application>{
private List<Application> items;
public AppAdapter(Context context, List<Application> items) {
super(context, R.layout.app_custom_list, items);
this.items = items;
}
@Override
public int getCount() {
return items.size();
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
if(v == null) {
LayoutInflater li = LayoutInflater.from(getContext());
v = li.inflate(R.layout.app_custom_list, null);
}
Application app = items.get(position);
if(app != null) {
ImageView icon = (ImageView)v.findViewById(R.id.appIcon);
TextView titleText = (TextView)v.findViewById(R.id.titleTxt);
LinearLayout ratingCntr =
(LinearLayout)v.findViewById(R.id.ratingCntr);
TextView dlText = (TextView)v.findViewById(R.id.dlTxt);
if(icon != null) {
Resources res = getContext().getResources();
String sIcon = "com.sj.customlistview:drawable/" +
app.getIcon();
icon.setImageDrawable(res.getDrawable(res.getIdentifier(sIcon,
null, null)));
}
if(titleText != null) titleText.setText(app.getTitle());
if(dlText != null) {
NumberFormat nf = NumberFormat.getNumberInstance();
dlText.setText(nf.format(app.getTotalDl())+" dl");
}
if(ratingCntr != null && ratingCntr.getChildCount() == 0) {
/*
* max rating: 5
*/
for(int i=1; i<=5; i++) {
ImageView iv = new ImageView(getContext());
if(i <= app.getRating()) {
iv.setImageDrawable(getContext().getResources().getDrawable(R.drawable.start_checked));
}
else {
iv.setImageDrawable(getContext().getResources().getDrawable(R.drawable.start_unchecked));
}
ratingCntr.addView(iv);
}
}
}
return v;
}
}

Java MySQL JDBC Slow/Taking turns

Java MySQL JDBC Slow/Taking turns

We're currently trying to make our server software use a connection pool
to greatly reduce lag however instead of reducing the time queries take to
run, it is doubling the time and making it even slower than it was before
the connection pool.
Are there any reasons for this? Does JDBC only allow a single query at a
time or is there another issue?

Blackberry (BBOS) Webworks error: java.io.FileNotFoundException initialization.log

Blackberry (BBOS) Webworks error: java.io.FileNotFoundException
initialization.log

I developed a basic Hello World application. When trying to launch the app
on the simulator I got this error:

config.xml
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Hello World</title>
</head>
<body>
<p>Hello World!</p>
</body>
</html>
index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Hello World</title>
</head>
<body>
<p>Hello World!</p>
</body>
</html>

BinaryReader throws NullReferenceException when being disposed

BinaryReader throws NullReferenceException when being disposed

I have a class MyClass that needs data from a file that will be used
throughout the run of the program. To read in the data I have another
class OpenFileService that derives from IDisposable and uses a
BinaryReader to read in all the data:
internal class OpenFileService : IDisposable
{
#region disposing data
bool disposed = false;
public void Dispose()
{
if (!disposed)
{
Dispose(true);
GC.SuppressFinalize(this);
disposed = true;
}
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
br.Dispose();
}
}
~OpenFileService()
{
Dispose(false);
}

Deny access to folders and content in it, lying in my Website folder

Deny access to folders and content in it, lying in my Website folder

I short, i don't want a user to access folders and the data or files in
it....
I searched a bit and i come up with "deny from all" but it is not working
when i put it on ftp.....but on localhost its working... I write the below
given code in my upload folder
# .htaccess mod_rewrite
RewriteEngine On
deny from all

TokenHelper - Could not find token mapped to token name struts.token

TokenHelper - Could not find token mapped to token name struts.token

If I add the "execAndWait" interceptor, it gives me the above error.
"TokenHelper - Could not find token mapped to token name struts.token"
<action name="flightsearch" method="getFlightResult"
class="com.test.FlightSearchAction">
<interceptor-ref name="execAndWait">
<param name="delay">500</param>
<param name="delaySleepInterval">500</param>
</interceptor-ref>
<!-- <interceptor-ref name="token">
<param name="excludeMethods">getFlightResult</param>
</interceptor-ref> -->
<result name="wait" type="tiles">flightwait</result>
<result name="success" type="tiles">flightsearchresult</result>
</action>
<interceptors>
<interceptor-stack name="tokenCheck">
<interceptor-ref name="token" />
<interceptor-ref name="defaultStack" />
<interceptor-ref name="basicStackHibernate" />
</interceptor-stack>
<interceptor-stack name="loggingRequired">
<interceptor-ref name="defaultStack" />
<interceptor-ref name="basicStackHibernate" />
</interceptor-stack>
</interceptors>
As I have read, some says this is an warning, and we can avoid it by
changing the TokenHelper class. If so how to do that?
Thanks.

Saturday, 14 September 2013

select from string field , separated SqlServer

select from string field , separated SqlServer

i have table1 that has field contains value separated with ','
name value
--------------------------
test 1,2
flower 3
car 4,2
dog 2
i want select command that find rows contains specific value in this column
string @value = 2
select * from table1 where ?
name value
--------------------------
test 1,2
car 4,2
dog 2

How to use regex for multiple line pattern in shell script

How to use regex for multiple line pattern in shell script

I want to write a bash script that finds a pattern in a html-file which is
going over multiple lines.
File for regex:
<td class="content">
some content
</td>
<td class="time">
13.05.2013 17:51
</td>
<td class="author">
A Name
</td>
Now I want to find the content of <td>-tag with the class="time".
So in principle the following regex:
<td class="time">(\d{2}\.\d{2}\.\d{4}\s+\d{2}:\d{2})</td>
grep seems not to be the command I can use, because...
It only returns the complete line or the complete result using -o and not
only the result inside the round brackets (...).
It looks only in one line for a pattern
So how is it possible that I will get only a string with 13.05.2013 17:51?

Count vowels, consonsants, digits, and other char in a entered string of text

Count vowels, consonsants, digits, and other char in a entered string of text

Can someone please look at my code? I need to count the characters and
have them display in the correct label box. I did have the digit one
working and them messed it up working on the vowels. I am so frustrated.
Thanks, Tish
int consCount = 0;
int vowelCount = 0;
int digitCount = 0;
int otherCount = 0;
string inputString;
inputString = this.entryTextBox.Text.ToLower();
char[] vowels = new char[] {'a', 'e', 'i', 'o', 'u'};
string vow = new string(vowels);
for (int index = 0; index < inputString.Length; index++)
{
if (char.IsLetterOrDigit(inputString[index]))
{
if (inputString.Contains(vow))
vowelCount++;
}
}
else if (char.IsDigit(inputString[index]))
{
digitCount++;
}
this.voweldisplayLabel.Text = vowelCount.ToString();
this.digitsdisplayLabel.Text = digitCount.ToString();
this.constdisplayLabel.Text = consCount.ToString();

Position without using position relative?

Position without using position relative?

I have a problem where I can't seem to position things on my site with out
position relative, certain things I can position with float left and
margin (right, left, bottom and top) but some I need to use position
relative and the problem is that I have a big gap I can't get ride of at
the bottom.
I've tried using height but then it dis aligns where something's are. Is
there any way of doing this with out position relative?

Sorting using jQUery

Sorting using jQUery

Please help sort the html code below using jQUery when the page is loaded.
<table class="productlist">
<tbody>
<tr>
<td class="productItem" id="catProdTd_5437359">
<div class="shop-product-small clear">
<div class="image">
<a
href="/dining/bambury-microfibre-dish-drying-mat-range"><img
border="0" alt="Bambury Microfibre Dish Drying Mat Range"
src="/images/products/bambury-microfibredishdryingmat-sm.jpg"
id="catsproduct_5437359"></a><br>
<p class="custom2">Linux</p>
</div>
</div>
</td>
<td class="productItem" id="catProdTd_5437366">
<div class="shop-product-small clear">
<div class="image">
<a
href="/dining/bambury-microfibre-terry-tea-towel-range"><img
border="0" alt="Bambury Microfibre Terry Tea Towel Range"
src="/images/products/bambury-microfibreteatowel-sm.jpg"
id="catsproduct_5437366"></a><br>
<p class="custom2">Apple</p>
</div>
</div>
</td>
<td class="productItem" id="catProdTd_3328776">
<div class="shop-product-small clear">
<div class="image">
<a
href="/dining/hyde-park-buzz-off-140x140cm-food-cover-range"><img
border="0" alt="Hyde Park Buzz Off 140x140cm Food Cover
Range" src="/images/products/hydepark-buzzoffs-sm.jpg"
id="catsproduct_3328776"></a><br>
<p class="custom2">Windows</p>
</div>
</div>
</td>
</tr>
</tbody>
</table>

CoreData - TableView init with Objects?

CoreData - TableView init with Objects?

It is easy to create tableView with some data already using NSMutableArray
and initWithObjects method.
However, is it possible to do the same when using core data?
i.e. let's say that entity is called MyEntity and Attributes are name and
value.
table cell has identifiew myCell.

Google Drive SDK login with email address and password

Google Drive SDK login with email address and password

I was able to upload a picture to my Google Drive with this example based
on the Google Drive SDK. My problem now is that the user has to select an
account on the phone at the beginning. I want to give my users the option
to login with an other account as they have on the phone. So I want that
my user can login with a gmail address and the password. Is that possible
or do I have to go over the account chooser?

Friday, 13 September 2013

How to have the option of having a user add an image in android

How to have the option of having a user add an image in android

I am developing an android application for the first time and I was
wondering how can I have a option of having the user upload an image. Like
for example, in a contact manager the user has the option of uploading an
image of a contact. I was wondering how can I do that in my android
application. Any help would be appreciated.

Raspbery pi to regularly update time from network

Raspbery pi to regularly update time from network

I have a raspberry pi on the wheezy distribution with ntpdate installed,
this later runs on boot time and updates the time from the internet.
However my pi runs without reboot for an extended time and as such the
clock does not become accurate overtime.
I am wondering if there is a code i can run (i.e. crojob) or something so
that the time is update say every couple of hours.

Passing Multiple Parameters in SSRS Called from Stored Procedure Returns Blank

Passing Multiple Parameters in SSRS Called from Stored Procedure Returns
Blank

I've created two datasets.
Dataset1 (from a stored procedure):
CREATE PROCEDURE [dbo].[usp_GetPerson](
@Category varchar(20))
AS
BEGIN
SELECT FirstName, LastName, Category
FROM tblPerson
WHERE (Category IN (@Category))
END
Dataset2:
SELECT DISTINCT Category
FROM tbl Person
In SSRS, I've edited the parameter to allow multiple values and to pull
available values from Dataset2.
I've tried filtering based on Dataset1 alone, but receive all the inputs
which are repetitive (which is why I opted using dataset 2).
When I use the stored procedure, I can't seem to select multiple values.
I'm only able to select single values, otherwise the report goes blank.
So I recreated Dataset1, but did not use the stored procedure. Instead I
just wrote the SQL statement in the text editor, and I'm able to select
the multiple values just fine.
Does anyone know why this happens and could help me fix this?
Note: I'm using stored procedures for when my SQL statements become more
complex where I will be joining multiple databases. I tried doing this in
SSRS, but it was much faster using stored procedures.
Thank you!

JQuery string 'randomizer' clustering characters

JQuery string 'randomizer' clustering characters

I'm trying to create a password generator based on the options provided by
the user. My current script allows users to select uppercase, lowercase,
numeric and special characters. This works perfectly and strings are
generated to to the user's required length however upon generation,
numbers cluster at the string with letters clustering at the beginning. A
single special character parts the two. Do you have any suggestions on how
to improve the process?
$('document').ready(function() {
$('button').click(function() {
var lower = "";
var upper = "";
var numeric = "";
var special = "";
var string_length = "";
if($('#12').is(':checked')) { string_length = 12; };
if($('#16').is(':checked')) { string_length = 16; };
if($('#18').is(':checked')) { string_length = 18; };
if($('#22').is(':checked')) { string_length = 22; };
if($('#24').is(':checked')) { string_length = 24; };
if($('#custom').is(':checked')) { $('#custom').show();
$('#custom').val(); } else { $('#custom').hide(); };
if($('#ch1').is(':checked')) { lower = "abcdefghijklmnopqrstuvwxyz"; }
else { lower = ""; };
if($('#ch2').is(':checked')) { upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; }
else { upper = ""; };
if($('#ch3').is(':checked')) { numeric = "0123456789"; } else {
numeric = ""; };
if($('#ch4').is(':checked')) { special = "!£$%^&*()_-+={};:@~#?/"; }
else { special = ""; };
var chars = lower + upper + numeric + special;
var randomstring = '';
var charCount = 0;
var numCount = 0;
for (var i=0; i<string_length; i++) {
if((Math.floor(Math.random() * 2) == 0) && numCount < 3 ||
charCount >= 5) {
var rnum = Math.floor(Math.random() * 10);
randomstring += rnum;
numCount += 1;
} else {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum,rnum+1);
charCount += 1;
}
}
$('span.string').html(randomstring);
});
});
The options 16 length, lowercase, uppercase, numeric and special
characters returns something like e046pzw%65760294.

Joining formatted lists

Joining formatted lists

I am trying to join two formatted lists of information:
Get-WmiObject -class Win32_OperatingSystem | Format-List Caption
Get-WmiObject -class Win32_Processor | Format-wide
Name,Manufacturer,MaxClockSpeed
When I use these two commands I get the following output (Whitespace
included):
Caption : Microsoft Windows 8 Pro
Name : Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz
Manufacturer : GenuineIntel
MaxClockSpeed : 2201
Is there any easy way to join these two lists, thus reducing the
whitespace and getting somewhat the same spacing between the colon and the
strings?

Rails Render Partial in Helper

Rails Render Partial in Helper

I have been trying to render one of my partials in a helper function
located within my controller.
The first issue I encountered was that the helper was returning the each
loop instead of the result of the loop. To remedy this I attempted to have
it return a string containing the results of the loop.
def display_replies(comment)
if comment.replies.count > 0
string = ""
comment.replies.each do |reply, index|
string = string + (render partial: "comment", locals: {index:
index}).to_s.html_safe
end
string
end
Called in View with <%= display_replies(reply) %>
When I look at my view, what is returned and displayed is HTML, however it
is escaped and thus plain text, it looks something like this:
["<div class='c comment'>\n<div class='profile'>\n<img
src='/assets/profile_image_sample.jpg'>\n</div>\n<div
class='message'>\n<div class='username'>Will Leach</div>\nLorem ipsum
dolor sit amet, consectetur adipiscing elit. Vivamus adipiscing purus et
mi aliquet malesuada. Curabitur porttitor varius turpis eget sollicitudin.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut dapibus
consectetur tortor, nec aliquet lacus tempus vitae. Sed felis massa,
dapibus in arcu sit amet, rhoncus condimentum eros. Etiam rutrum lectus in
malesuada aliquam. Mauris vitae diam vel felis accumsan vulputate vel nec
tortor. Nunc pretium hendrerit est, ut cursus ipsum commodo sit
amet.\n<div class='reply-link'>\n<a href='#'>Reply to
Comment</a>\n</div>\n</div>\n</div>\n"]
I would simply like this to be regular unescaped HTML. I read somewhere
that adding html_safe would fix this, but alas it hasn't.
Where to go from here?

Thursday, 12 September 2013

SSIS data transforamtion

SSIS data transforamtion

I am importing excel file tables into SQL Server using SSIS. While
importing i need to change the data of particular column. When and how it
can be achieved?
Eg: My Excel contains a column "Country" with values like "India", "United
States", "Russia". However When transfering the data to SQL server, I want
it to be stored as "IND", "USA", "RU"

Data inside tableview are mixed-up after scrolling

Data inside tableview are mixed-up after scrolling

I've read many questions and tried the solutions but I still couldn't
resolve the problem with my tableview.
After scrolling, the data in the rows of the tableview got interchanged
and sometimes missing.
Here's my code:
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *modifierCheckCell = @"BGMModifierCheckCell";
BGMModifierCheckCell *cell = nil;
cell = (BGMModifierCheckCell *)[tableView
dequeueReusableCellWithIdentifier:modifierCheckCell];
if (cell == nil) {
NSArray* topLevelObjects = [[NSBundle mainBundle]
loadNibNamed:modifierCheckCell owner:self options:nil];
for (id currentObject in topLevelObjects) {
if ([currentObject isKindOfClass:[UITableViewCell class]]) {
cell = (BGMModifierCheckCell *)currentObject;
break;
}
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
NSArray *optionIds = [[[arrayInsideDict
objectAtIndex:indexPath.section] objectForKey:@"optnItem"]
objectAtIndex:indexPath.row];
BGMOptnCats *optnCat = [BGMOptnCats
MR_findFirstByAttribute:@"iOptnCatId" withValue:[[arrayInsideDict
objectAtIndex:indexPath.section] objectForKey:@"optnCatId"]];
[optionIds enumerateObjectsUsingBlock:^(id obj, NSUInteger idx,
BOOL *stop) {
__block int optnTag = [obj intValue];
BGMItemDayOptns *item = [BGMItemDayOptns
MR_findFirstByAttribute:@"iItemDayOptnId" withValue:obj];
[item.optns.optnLangs enumerateObjectsUsingBlock:^(id obj,
BOOL *stop) {
BGMOptnLangs *lang = (BGMOptnLangs *)obj;
if ([lang.sLangCode isEqualToString:@"en"]) {
NSString *optn = [NSString stringWithFormat:@"%@",
lang.sOptnName];
if ([optnCat.sOptnType isEqualToString:@"single"]) {
RadioButton *rb1 = [[RadioButton
alloc] initWithFrame:CGRectMake(0, 0, 200, 40)];
[rb1 setGroupID:indexPath.section AndID:optnTag
AndTitle:optn];
rb1.delegate = self;
if (idx == 0) {
[cell.firstOption addSubview:rb1];
} else if (idx == 1) {
[cell.secondOption addSubview:rb1];
} else if (idx == 2) {
[cell.thirdOption addSubview:rb1];
}
} else if ([optnCat.sOptnType
isEqualToString:@"multiple"]) {
SSCheckBoxView *checkBox = [[SSCheckBoxView alloc]
initWithFrame:CGRectMake(0, 0, 200, 40)
style:kSSCheckBoxViewStyleMono checked:NO];
checkBox.tag = optnTag;
[checkBox setStateChangedTarget:self
selector:@selector(checkBoxViewChangedState:)];
[checkBox setText:@""];
[checkBox setText:optn];
if (idx == 0) {
[cell.firstOption addSubview:checkBox];
} else if (idx == 1) {
[cell.secondOption addSubview:checkBox];
} else if (idx == 2) {
[cell.thirdOption addSubview:checkBox];
}
}
}
}];
}];
}
return cell;
}
Please help me out with this. Thank you!!! :)

How can I verify linked libraries?

How can I verify linked libraries?

I am having lots of trouble getting a specific set of drivers working,
called libnifalcon.
I am pretty sure that the installation was successful, but when I try to
compile the example programs I get the errors:
mars@marslab:~/Documents/libnifalcon-1.0/examples/findfalcons$ g++
findfalcons.cpp
/tmp/cc8TtfGn.o: In function `runFalconTest()':
findfalcons.cpp:(.text+0x6b): undefined reference to
`libnifalcon::FalconDevice::FalconDevice()'
findfalcons.cpp:(.text+0xdd): undefined reference to
`libnifalcon::FalconDevice::getDeviceCount(unsigned int&)'
findfalcons.cpp:(.text+0x1bd): undefined reference to
`libnifalcon::FalconDevice::open(unsigned int)'
findfalcons.cpp:(.text+0x224): undefined reference to
`libnifalcon::FalconDevice::isFirmwareLoaded()'
findfalcons.cpp:(.text+0x2ac): undefined reference to
`libnifalcon::FalconFirmware::loadFirmware(bool, unsigned int const&,
unsigned char*)'
findfalcons.cpp:(.text+0x33b): undefined reference to
`libnifalcon::FalconDevice::isFirmwareLoaded()'
findfalcons.cpp:(.text+0x3dd): undefined reference to
`libnifalcon::FalconDevice::runIOLoop(unsigned int)'
findfalcons.cpp:(.text+0x504): undefined reference to
`libnifalcon::FalconDevice::runIOLoop(unsigned int)'
findfalcons.cpp:(.text+0x512): undefined reference to
`libnifalcon::FalconDevice::close()'
findfalcons.cpp:(.text+0x52b): undefined reference to
`libnifalcon::FalconDevice::~FalconDevice()'
findfalcons.cpp:(.text+0x53f): undefined reference to
`libnifalcon::FalconDevice::~FalconDevice()'
/tmp/cc8TtfGn.o: In function `void
libnifalcon::FalconDevice::setFalconFirmware<libnifalcon::FalconFirmwareNovintSDK>()':
findfalcons.cpp:(.text._ZN11libnifalcon12FalconDevice17setFalconFirmwareINS_23FalconFirmwareNovintSDKEEEvv[void
libnifalcon::FalconDevice::setFalconFirmware<libnifalcon::FalconFirmwareNovintSDK>()]+0x1d):
undefined reference to
`libnifalcon::FalconFirmwareNovintSDK::FalconFirmwareNovintSDK()'
collect2: ld returned 1 exit status
How can I verify the libraries are linked correctly? What can I do if they
aren't?

Wide Character Font Rendering in Windows Browsers

Wide Character Font Rendering in Windows Browsers

I made a custom font to display text so that it looks like the keys on a
computer keyboard and embedded it in a website.
https://googledrive.com/host/0B9zaRHzo-vktWUZUcVptR1M0OWM/test2.html
All is good on MacOS, but the wide characters render incorrectly on
Chrome, IE and FF on Windows. Is this a bug with the browsers? Is
something wrong with the font?
Thanks!

How To Get Bootstrap-Slider Working

How To Get Bootstrap-Slider Working

I had no problem working with bootstrap-slider
(http://www.eyecon.ro/bootstrap-slider/) work using the simplest example
provided on that site. However, I was intending to use one in a bootstrap
popover as part of a more extended set of settings. The simplest example I
could think of is here:
<html>
<head>
<title></title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/slider.css">
<script src="js/vendor/jquery-1.9.1.js"></script>
<script src="js/vendor/less-1.4.1.min.js"></script>
<script src="js/vendor/bootstrap.js"></script>
<script src="js/vendor/bootstrap-slider.js"></script>
<script>
$(function () {
$('#rangeSlider').slider({
formater: function(value) {
return 'Current value: '+value;
tooltip: 'show';
}
});
$("#popoverbutton").popover({
html: true,
placement: 'bottom',
title: 'Options',
content: function(){
return
$("#popover-content").html();
}});
});
</script>
</head>
<body>
<h4> This is a test! </h4>
<div class="row">
<a href="#" id="popoverbutton" class="btn btn-inverse"
rel="popover"><i class="icon-cog icon-white"></i></a>
</div>
<div id="popover-content" class="hide">
<div class="well"> Range: <input type="text" class="span2"
value="50"id="rangeSlider" data-slider-min="10"
data-slider-max="100" data-slider-step="5"
data-slider-value="50">
</div>
</div>
</body>
</html>
As you can see, if you try to load this, it doesn't work. The slider is
rendered correctly, but cannot be interacted with, no tooltip appears,
etc.
A diff between the generated html for the slider component inside and
outside of a popup reveals them to be identical, so I fail to understand
the holdup. Anyone have experience with this particular issue?

Where is jar.exe in Java Developmen Kit?

Where is jar.exe in Java Developmen Kit?

I installed JDK
(http://download.oracle.com/otn-pub/java/jdk/7u40-b43/jdk-7u40-windows-x64.exe)
in "c:\jdk.1.7.0", set variable path to "c:\jdk.1.7.0", but using command
for example:
jar xvf ..\src.zip
Gives me this error:
'jar' is not recognized as an internal or external command,
operable program or batch file.
I'm reading Core Java volume 1 (9th edition). So here it stated to run
firstly command:
javac -version
Then I got that same error. And in bin directory there were no javac.exe
too, but I found java.exe and it worked. So does jar.exe is also changed
to some another name or it somewhere else? It seems strange that this book
is released this year and even names of files do not match in newest
version or am I missing something here?..
P.S. I'm using windows 7 64 bit.

Can you run Twitter Storm on YARN

Can you run Twitter Storm on YARN

Can Twitter Storm be managed and run as a YARN application? Further, is it
sensible to do this? I'm hoping to build a YARN-based library that manages
batch and streaming processes within the metaphor of pipes. E.g. faucets
(sources), pipes (connectors and filters), tanks (batch processes), and
drains (sinks to FS, database, etc.).

Spreading Load on SQL Server database

Spreading Load on SQL Server database

We have an enterprise application that uses Microsoft SQL Server as the
database backend. We have been coming across a fair few instances where
the customer has grown the application into a huge db and some of the
queries being run are causing locks and performance issues for themselves
and the other users.
We have tried to apply as many indexes as possible and perf tuned all
queries too the limit but we have one application that must suit a lot of
different customer types so its hard to create one solution that fits
all.We dont have the resources to apply customer specific
indexing/performance for every customer.
We know the main queries that are causing issues are the ones that are
generated to drive reports and kpi's.
My question is, is there a way that we can spread the load of the
application so the day to day use isn't hampered by the report/kpi
generation. i.e. Could we someway mirror/duplicate the db so that day to
day actions are sent to SQL Entity A and the data intense queries and sent
to SQL Entity B? Therefore the data intense queries have no effect on the
day to day side of things and we could queue the queries going to SQL
Entity B.
In this scenario SQL Entity A and B will need to be kept in alignment at
all times, but SQL Entity B will always be read only.
Can anyone suggest any paths we could try to accomplish this? Or is there
another method I should be looking at to get us performance wins.
Thanks

"class JavaLaunchHelper is loacted in two places..." is shown when launching java web start in mac 10.8.x

"class JavaLaunchHelper is loacted in two places..." is shown when
launching java web start in mac 10.8.x

"Class JavaLaunchHelper is implemented on both /Library/Internet
Plug-ins/JavaAppletPlugin.plugin/Contents/Home/bin/java and
Library/Internet
Plug-ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib . One
of the two will be used. Which one is undefined." error is shown when
running the command(javaws "jnlp-file") in terminal in Mac 10.8.x with
latest jre 7 update 40
Any command execution with javaws shows the same error message and to
avoid this either of them specified in the path should be deleted(But its
not an user scenario)
Is there any other way to avoid this. Below is my code
final StringBuffer info = new StringBuffer();
final StringBuffer error = new StringBuffer();
final Process process = Runtime.getRuntime().exec(javaws
<jnlp-file>);
final StreamPumper outPumper = new
StreamPumper(process.getInputStream(), info);
final StreamPumper errPumper = new
StreamPumper(process.getErrorStream(), error);
outPumper.start();
errPumper.start();
process.waitFor();
outPumper.join();
errPumper.join();

Wednesday, 11 September 2013

How to install Visual Basic in Visual Studio ultimate 2012?

How to install Visual Basic in Visual Studio ultimate 2012?

OS: Windows 8. I have VS2012 Ultimate with only Visual C++ in it. I can't
create a Visual Basic project with it. Did installation go wrong? Does VB
come with it? If not, how to add Visual Basic into it?

How to add complex header/footer to list report in Cognos?

How to add complex header/footer to list report in Cognos?

I want to build a list report with complex footer and header, the issue
is: if the column number of footer is bigger than the list body.it seems
difficult to add more column to the footer. If I add list footer, the
column number is just as same as the list body, I can merge,but can't
split a cell. Please tell me how to achieve this. I know I can add a table
to the tail of that list, and fix the width of list and table, but I don't
think it is a good idea, because the table wound not repeat in every page.