Dell Released

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Saturday, August 31, 2013

Should I make multiple SQLite databases for better concurrency?

Posted on 11:16 PM by Unknown
Should I make multiple SQLite databases for better concurrency?



I'm very new to SQL and relational databases (just started learning last

week) and I'm in the process of upgrading my website and currently keep

all my data in XML files. It works, but the new site would be better

suited from what I hear a relational database can do, and it looks like

SQLite is best for me. One of my concerns is concurrency, even though 99%

of the data will be read-only (which I understand SQLite is pretty good

at) 99% of the time. Other things, like page view counters for certain

pages will constantly require small writes. I'm still learning database

design and want to do it right. Would it make sense to make separate

databases for things that get written to a lot, that way making the main

database far less susceptible to concurrency issues? Is it possible to do

a "foreign key" type reference (I still haven't used foreign keys yet, but

think I understand them) across databases? As each view count would point

to some primary key in the main database. Thanks for any help!
Read More
Posted in | No comments

Difference between Nil and nil and Null in Objective-C

Posted on 8:25 PM by Unknown
Difference between Nil and nil and Null in Objective-C



I am a relatively experienced iOS developer, however one thing has always

bothered me, what is the difference between Nil(Capital) and

nil(lowercase) and NULL (if any) in terms of performance and usage? I am

absolutely sure that there is a difference between them otherwise why

would they be defined as separately in the first place...
Read More
Posted in | No comments

Cannot connect to SQL Server 2012

Posted on 5:36 PM by Unknown
Cannot connect to SQL Server 2012



I'm trying to connect to a SQL Server 2012 database using C#, both the

server and program are on the same computer. When I try to connect I get

an exception:

A network-related or instance-specific error occurred while establishing a

connection to SQL Server. The server was not found or was not accessible.

Verify that the instance name is correct and that SQL Server is configured

to allow remote connections. (provider: SQL Network Interfaces, error: 25

- Connection string is not valid)

There is an inner exception simply saying {"The parameter is incorrect"}.

I'm trying to connect using this

SqlConnection sql = new

SqlConnection("Server=(local)\\MSSQLSERVER;Database=Test;User

ID=logger;Password=logger;Trusted_Connection=False");

sql.Open();

I have a SQL login called logger with the same text as the password and it

is mapped the database Test. I believe I have the server set up to take

remote logins.

Any ideas as to what I am missing?
Read More
Posted in | No comments

Android - error opening file just created

Posted on 2:46 PM by Unknown
Android - error opening file just created



I'm new to android developement and trying to do some file IO. Whenever I

run this block of code:

File meta = new File(context.getAppContext().getFilesDir(),"meta");

meta.mkdirs();

File dir = new File(meta,"subdir");

File imageFile = new File(dir,"filename");

Log.d("test",imageFile.getAbsolutePath());

FileOutputStream outputStream = new FileOutputStream(imageFile);

I get this error:

java.io.FileNotFoundException:

/data/data/com.example.android.networkusage/files/meta/Greg and The

Morning Buzz/artwork30.jpg: open failed: ENOENT (No such file or

directory)

at libcore.io.IoBridge.open(IoBridge.java:406)

at java.io.FileOutputStream.<init>(FileOutputStream.java:88)

at java.io.FileOutputStream.<init>(FileOutputStream.java:73)

at

com.example.android.networkusage.Podcast.downloadArtworkFromUrl(Podcast.java:117)

at com.example.android.networkusage.Podcast.<init>(Podcast.java:93)

at com.example.android.networkusage.JSONParser.parse(JSONParser.java:113)

at

com.example.android.networkusage.NetworkActivity.loadXmlFromNetwork(NetworkActivity.java:240)

at

com.example.android.networkusage.NetworkActivity.access$100(NetworkActivity.java:65)

at

com.example.android.networkusage.NetworkActivity$DownloadXmlTask.doInBackground(NetworkActivity.java:203)

at

com.example.android.networkusage.NetworkActivity$DownloadXmlTask.doInBackground(NetworkActivity.java:198)

at android.os.AsyncTask$2.call(AsyncTask.java:264)

at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)

at java.util.concurrent.FutureTask.run(FutureTask.java:137)

at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)

at

java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)

at

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)

at java.lang.Thread.run(Thread.java:856)

Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such

file or directory)

at libcore.io.Posix.open(Native Method)

at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)

at libcore.io.IoBridge.open(IoBridge.java:390)

... 16 more

The log even prints out the file's path as directed, so the file must

exist! Why is this happening?

Also, my app has internal and external write priviledges.
Read More
Posted in | No comments

PHP SimpleXML doesn't output anything

Posted on 11:48 AM by Unknown
PHP SimpleXML doesn't output anything



I'm trying to read an XML file that I created. I'm using this code, but

getting nothing out except 'the file was loaded successfully'. I've tried

xpath and many others, but it just doesn't output. It is possible there is

something wrong with my XML because I created the file by hand and I've

never made an XML file before.

Ultimately, my goal is to be able to read an extension attribute and get

the description, class, and icon.

<?php

if(!$xml = simplexml_load_file('formats.xml')) {

echo 'the file was loaded successfully';

print_r($xml);

}

else {

echo 'the file was not loaded';

}

?>

Here is the XML:

<?xml version="1.0"?>

<group class="doc" icon="./.images/doc.png" />

<type extension="doc" description="Legacy Word Document" />

<type extension="docx" description="XML Word Document" />

<type extension="ppt" description="Legacy PowerPoint" />

<type extension="pptx" description="XML PowerPoint" />

<type extension="pps" description="Legacy PowerPoint Show" />

<type extension="ppsx" description="XML PowerPoint Show" />

<type extension="docm" description="Macro Enabled Word Document" />

<type extension="dot" description="Legacy Word Template" />

<type extension="dotx" description="XML Word Template" />

<type extension="dotm" description="Macro Enabled Word Template" />

<type extension="log" description="A Log File" />

<type extension="msg" description="A Message File" />

<type extension="odt" description="OpenOffice Document" />

<type extension="pages" description="Apple Pages Document" />

<type extension="rtf" description="Rich Text Format" />

<type extension="tex" description="LaTeX Document" />

<type extension="wpd" description="Word Perfect Document" />

<type extension="ini" description="Settings File" />

<type extension="cfg" description="Config File" />

<type extension="conf" description="Config File" />

<type extension="nfo" description="Information File" />

<type extension="inf" description="Autorun File" />

<type extension="wps" description="Works Document" />

</group>

<group class="video" icon="./.images/video.png" />

<type extension="asf" description="Advanced Streaming Format" />

<type extension="asx" description="Windows Media Playlist" />

<type extension="avi" description="Audio-Video Interleave" />

<type extension="flv" description="Flash Player Video" />

<type extension="mkv" description="Matroska Video" />

<type extension="mov" description="Apple Movie" />

<type extension="mp4" description="MPEG 4 Video" />

<type extension="mpg" description="MPEG Video" />

<type extension="rm" description="RealMedia Video" />

<type extension="srt" description="Subtitles File" />

<type extension="swf" description="Flash Animation" />

<type extension="vob" description="DVD Video File" />

<type extension="wmv" description="Windows Media Video" />

<type extension="mpeg" description="Motion Picture Experts Video" />

</group>
Read More
Posted in | No comments

Memory leak (igraph, watts.strogatz.game, get.all.shortest.paths)

Posted on 8:55 AM by Unknown
Memory leak (igraph, watts.strogatz.game, get.all.shortest.paths)



I try to make a quite simple computation but I get an out of memory

message whose origin is not clear to me. Here is what I want: for the

small-world model (watts.strogatz.game) and several p-values I create

nsamp many graphs and compute the distance between the first node and the

opposite node at n/2. When nsamp = 1, everything works fine. Setting it to

100 or larger gives an "out of memory" error right in the first round

(i=1, j=5), i.e., for the smallest p-value (0.01). Setting nsamp=10 gives

no error (huh?? Shouldn't that include i=1, j=5?). I tried to explicitly

remove all the larger objects (graph, len) but to no avail. Any ideas

here? Here is the code:

require(igraph)

probs <- c(1:25)*0.01

n = 1000

target <- n/2

nsamp = 100

for(i in c(1:length(probs))){

for(j in c(1:nsamp)){

graph <- watts.strogatz.game(dim=1, size=n, p=probs[i], nei=4)

shortest.paths(graph, v=V(graph)[1], to=V(graph)[target])

len <- get.all.shortest.paths(graph, from=V(graph)[1])

rm(graph)

#The number of shortest paths between 1 and target can be found in

numbPathsBetw1AndTarget <- len$nrgeo[target]

#In len$res there are all shortest paths between node 1 and all other

#nodes. It comes as a list which at each point contains a vector of

#so we need to use lapply to find out which of

#the lists are of interest to us.

lengths <- unlist(lapply(len$res, function(x) length(x)))

rm(len)

}

}

I am aware that I can increase the memory, but it bugs me that for nsamp

being small everything is fine. It seems to be a memory leak but I do not

there where it comes into play.

Edit: it is so unreproducible that I suspect it is not a memory leak but

rather a bad configuration of the graph. It always happens for i=1 but for

different j. Thus: is there an intrinsic, upper limit on the diameter of

the graph to apply get.all.shortest.paths or on the number of shortest

paths?
Read More
Posted in | No comments

Friday, August 30, 2013

How do I position a div on top of another div

Posted on 11:49 PM by Unknown
How do I position a div on top of another div



The post on my website are set to show information regarding the post when

the mouse hovers over it.

Currently when I hover over a post the information shows to the right, and

I would like it to show on top of the post. I want to be able to margin

the information to show ontop of the post in the center but nothing I

input is working. After everything I tried didn't work I went back and set

them to blank and that still didn't work. You can see a live version at

http://fallbackryleighamor.tumblr.com/

This is the current css. Any idea how I can edit it to make it work?

#info #date{ color:#000; border: 2px #000 solid;

text-transform: uppercase; letter-spacing: 2px; font: 10px Consolas;}

#info a{ color: #000;}

#date a { width: 280px; color: #000;}

#posts{ position:;}

#date #info{position:;} #date #info{float:;}

{background: rgba(0, 0, 9, 0.1); float:left; width: auto; height: auto;

margin-top: ;}

#textpost #photopost #photosetpost #quotepost #quotelink #audiopost

#videopost{background: rgba(0, 0, 9, 0.1); float:left; width: auto;

height: auto; margin-top: ;}

#date { display:none;}

#posts:hover #date {display:block;}

#textpost:hover #photopost:hover #photosetpost:hover #quotepost:hover

#quotelink:hover

#audiopost:hover #videopost:hover{display:block;}

#date #info{

margin-top:0px;

margin-bottom:0px;

margin-right:0px;

margin-left:0px;

}

#date #info{

padding-top:0px;

padding-bottom:0px;

padding-right:0px;

padding-left:0px;

}

#date #info{

z-index:;}
Read More
Posted in | No comments
Older Posts Home
Subscribe to: Comments (Atom)

Popular Posts

  • The Google Visualization API Query Language: Query parse error: Encountered " "," ", "" at line 1, column 24. Was expecting one of:
    The Google Visualization API Query Language: Query parse error: Encountered " "," ", "" at line 1, column 24. ...
  • fanotify unable monitor entire system for FAN_OPEN_PERM event by multi-threaded program, and to ignore directories
    fanotify unable monitor entire system for FAN_OPEN_PERM event by multi-threaded program, and to ignore directories I want to monitor whole s...
  • URL constantly results in a badbox
    URL constantly results in a badbox I am trying to insert a long url into a latex document. I'm using hyperref package to make them click...
  • How to properly provide data for ?
    How to properly provide data for ? I am serving binary data for HTML5 audio thorough .aspx page. The file can be played but there is a probl...
  • filtration on the cohomology of a complex
    filtration on the cohomology of a complex Let $K^\bullet$ be a complex and let $F_I$ and $F_{II}$ be two filtrations on it. suppose $F_I^i K...
  • Should I make multiple SQLite databases for better concurrency?
    Should I make multiple SQLite databases for better concurrency? I'm very new to SQL and relational databases (just started learning last...
  • How do I position a div on top of another div
    How do I position a div on top of another div The post on my website are set to show information regarding the post when the mouse hovers ov...
  • Udated Streak 7 Manual & Quick Start Guide With Honeycomb
    For those of you who bought the Streak 7 before the Honeycomb 3.2 update, you have in your possession an out of date Manual & Quick Star...
  • Remove/avoid adding target link to URL
    Remove/avoid adding target link to URL This one may be simple for the jQuery/JavaScript gurus here, but I just can't find a solution for...
  • Cannot connect to SQL Server 2012
    Cannot connect to SQL Server 2012 I'm trying to connect to a SQL Server 2012 database using C#, both the server and program are on the s...

Categories

  • Games
  • News
  • Streak 5
  • Streak 7
  • Tips

Blog Archive

  • ▼  2013 (124)
    • ▼  August (124)
      • Should I make multiple SQLite databases for better...
      • Difference between Nil and nil and Null in Objecti...
      • Cannot connect to SQL Server 2012
      • Android - error opening file just created
      • PHP SimpleXML doesn't output anything
      • Memory leak (igraph, watts.strogatz.game, get.all....
      • How do I position a div on top of another div
      • Updating foreign key references on the DbContext C...
      • Convert string to DateTime and format
      • call function on click outside of a particular div
      • OperationalError when inserting into sqlite 3 in P...
      • Trying to print a string character by character wi...
      • I need to make my JPanel resize dynamically as new...
      • How to retrieve images from cache memory?
      • how to add jscrollpane to jframe?
      • Query on how to Select Date before the latest Date...
      • Does archive size of tar, zip and rar effect the t...
      • How do I make a DOM object follow a circular path ...
      • how to use for loop for my issue
      • AngularJS - Pass variable from a controller & upda...
      • Windows 2012: how to make power button work in eve...
      • IN OBOUT grid, how to move from first grid to anot...
      • Am I using the form action correctly?
      • Increasing the font size of a webview conflict wit...
      • quicktags "link" button doesn't work, but all othe...
      • Cannot access local variables using systemtap
      • Remove/avoid adding target link to URL
      • Left-justified equations with left tags (so it loo...
      • [ Marriage & Divorce ] Open Question : My boyfrien...
      • livetv2pc)))WaTch (Rugby) Australia vs New Zealand...
      • The Google Visualization API Query Language: Query...
      • iOS 7 phone-number link doesn't work when webpage ...
      • Cross-browser textarea maxlength
      • candied mints storage and transporting long distance
      • how to convert objectHTML into html
      • Mellin transform definition
      • Multiple Google Calendars with one Google Cal ID
      • Dell PowerEdge 2950 PCIe Training Error -- No PCIe...
      • Reset Disk - Windows Storage Server 2012
      • Windows Phone 8 - Keeping background location trac...
      • Django forms design suggestiom
      • Magento Upgrade, getting error with tier prices fr...
      • Bouncing between "Adapter is detached" and "No wra...
      • How to create overlapping - not stacking - shapes ...
      • Enclosing capsules around list based arrays [on hold]
      • Identifying Switch case argument (Perl)
      • asp.net ModalPopupExtender not behaving properly
      • fanotify unable monitor entire system for FAN_OPEN...
      • Jquery UI datepicker inline "onclick" handler caus...
      • URL constantly results in a badbox
      • Split values over multiple rows with different del...
      • How to aggregate data without group by
      • Angular $scope.$watch on (for in... ) don't work
      • Using Modernizr to test browser support for css ca...
      • Content overlapping in navigation menu?
      • cls file - multiple files
      • Differences between "fortification nouns"
      • filtration on the cohomology of a complex
      • Problems with every aspect of facebook that involv...
      • Extract data from last line in a text file using PHP
      • How to properly provide data for ?
      • ConditionalPanel doesn't support variables with do...
      • Frequent out of memory issues
      • Undefine reference for libraries, so How could I f...
      • radio buttons checked with jquery not holding prop...
      • How to modify bash command to change permissions
      • header(Content-type: image/jpeg) not working
      • Removing smart quotes from an SQL server text column
      • Getting out of sync server response
      • thesis work" vs "thesis
      • php radio post wrong same value after submit
      • Several questions about trigonometry and functions
      • A div that adapts to its background
      • Why are there two different versions of the mean a...
      • Restore only some volumes from a multiOS system image
      • system of pde (solid mechanics)
      • Application or Object defined error - VBA Excel 2013
      • Deleting the last few revisions: SVN best practice
      • Choose blackberry 10 platform to use call logs, me...
      • Procedure or function usp_logout has too many argu...
      • how can i use combination of unix signals (like SI...
      • Basic Javascript Countdown Timer Taking Longer Tha...
      • WordPress Guest Author - How can I use custom fiel...
      • button to generate html delete method?
      • socket.io redis ECONNREFUSED
      • Can one http request call multiple css files?
      • .htaccess related codeigniter. why error 404 page ...
      • Undefined symbols error from static framework
      • XML Sitemap Generator for URL with 1.5 million pages?
      • How do I prevent Microsoft DNS from reporting vers...
      • Solve the equation for x, y and z: $\sqrt{x-y+z}=\...
      • A basic doubt on linear dependence of vectors
      • mysql charsets, can I perform the conversion in py...
      • Mirrors Edge video settings are locked
      • Receiving null messages on android, how to fix it?
      • changing an onEdit function to run onOpen
      • Handle Multiple Form tag in asp.net page?
      • Getting click event on parent page of button in frame
      • Fix column width with tabularx
      • best software to use to make a website
  • ►  2012 (6)
    • ►  February (2)
    • ►  January (4)
  • ►  2011 (10)
    • ►  December (1)
    • ►  November (2)
    • ►  October (7)
Powered by Blogger.

About Me

Unknown
View my complete profile