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

Thursday, August 29, 2013

Updating foreign key references on the DbContext ChangeTracker

Posted on 7:07 AM by Unknown
Updating foreign key references on the DbContext ChangeTracker



I work with EF 5.0, DB first in a web project.

For our service layer, we use Agatha with AutoMapper, so all data arrives

in the service layer as POCO objects.

I have a data structure that look like this:

public class FirstClass

{

public int Id { get; set; }

public int? SelectedSecondClassId { get; set; }

public SecondClass SelectedSecondClass { get; set; }

public ICollection<SecondClass> MySecondClasses { get; set; }

//other properties go here

}

public class SecondClass

{

public int Id { get; set; }

public int ParentSecondClassId { get; set }

public SecondClass ParentSecondClass { get; set; }

//other properties go here

}

Now imagine I try to update a FirstClass object and do the following in 1 go:

Create 2 new Secondclass objects in the MySecondClasses collection (both

with id 0)

Set one of these newly created objects as the SelectedSecondClass

Then EF refuses to play ball. I can't get it to work. If I look in the

changetracker, I see that the SelectedSecondClass on the entity is empty

again, but the SelectedSecondClassId is set to 0. And that's something he

can't resolve, because there are 2 objects with Id 0, before they are

properly created.

If I do this, I can get stuff fixed:

var newId = -1;

foreach (var newSecondClass in firstClass.MySecondClasses.Where(x => x.Id

<= 0))

{

newSecondClass.Id = newId;

newId --;

}

if (firstClass.SelectedSecondClass != null)

{

firstClass.SelectedSecondClassId = firstClass.SelectedSecondClass.Id;

}

// Send the updates to EF

As you understand, I feel like this is a bit hacked together and it would

be easy for another developer to forget something like this. I would like

to have a better way of doing this. Preferably in a way that I can 'fix'

situations like this just before a SaveChanges() in my DbContext wrapper.

Can anybody point me in the right direction?
Read More
Posted in | No comments

Convert string to DateTime and format

Posted on 4:51 AM by Unknown
Convert string to DateTime and format



Can i convert the string below to DateTime

Friday, 27th September 2013

This is what i want to achieve:

String tmpDate="Friday, 27th September 2013";

closingDate = Convert.ToDateTime(tmpDate).ToString("yyyy-MM-dd");

Doing above i get error:

The string was not recognized as a valid DateTime. There is an unknown

word starting at index 10.
Read More
Posted in | No comments

Wednesday, August 28, 2013

call function on click outside of a particular div

Posted on 10:54 PM by Unknown
call function on click outside of a particular div



I am having a html structure as

<div class="abc">

<div id="test">

<label>Name</label>

<input type="checkbox">

<label>Name</label>

<input type="checkbox">

<label>Name</label>

<input type="checkbox">

</div>

</div>

I want that when i click outside of div id test, a particular function can

be called. and also no event shall be triggered when inside the div id

test i.e when I click the checkboxes, no event shall be triggered.

Any help will be really appreciated.
Read More
Posted in | No comments

OperationalError when inserting into sqlite 3 in Python

Posted on 2:10 PM by Unknown
OperationalError when inserting into sqlite 3 in Python



I'm populating a database with data that I parse from JSON. When I execute

my INSERT statement, I get an error: sqlite3.OperationalError: no such

column: None. Some of the JSON data returns null, which would cause Python

to insert None into the table, but I believe this should be fine? Does

anyone know what the problem is?

Traceback: Traceback (most recent call last): File

"productInfoScraper.py", line 71, in <module> ")")

My INSERT statement in Python:

cursor.execute("INSERT INTO ProductInfo VALUES(" +

str(data["data"]["product_id"]) + ", " +

"'" + str(data["data"]["product_name"]) + "'" + ", " +

"'" + str(data["data"]["ingredients"]) + "'" + ", " +

"'" + str(data["data"]["serving_size"]) + "'" + ", " +

str(data["data"]["calories"]) + ", " +

str(data["data"]["total_fat_g"]) + ", " +

str(data["data"]["total_fat_percent"]) + ", " +

str(data["data"]["fat_saturated_g"]) + ", " +

str(data["data"]["fat_saturated_percent"]) + ", " +

str(data["data"]["fat_trans_g"]) + ", " +

str(data["data"]["fat_trans_percent"]) + ", " +

str(data["data"]["cholesterol_mg"]) + ", " +

str(data["data"]["sodium_mg"]) + ", " +

str(data["data"]["sodium_percent"]) + ", " +

str(data["data"]["carbo_g"]) + ", " +

str(data["data"]["carbo_percent"]) + ", " +

str(data["data"]["carbo_fibre_g"]) + ", " +

str(data["data"]["carbo_fibre_percent"]) + ", " +

str(data["data"]["carbo_sugars_g"]) + ", " +

str(data["data"]["protein_g"]) + ", " +

str(data["data"]["vitamin_a_percent"]) + ", " +

str(data["data"]["vitamin_c_percent"]) + ", " +

str(data["data"]["calcium_percent"]) + ", " +

str(data["data"]["iron_percent"]) + ", " +

"'" + str(data["data"]["micro_nutrients"]) + "'" + ", " +

"'" + str(data["data"]["tips"]) + "'" + ", " +

str(data["data"]["diet_id"]) + ", " +

"'" + str(data["data"]["diet_type"]) + "'" +

")")

My CREATE TABLE statement:

cursor.execute("CREATE TABLE ProductInfo(product_id INT, product_name TEXT,\

ingredients TEXT, serving_size TEXT, calories INT, total_fat_g INT,\

total_fat_percent INT, fat_saturated_g INT, fat_saturated_percent INT,\

fat_trans_g INT, fat_trans_percent INT, cholesterol_mg INT, sodium_mg\

INT, sodium_percent INT, carbo_g INT, carbo_percent INT, carbo_fibre_g\

INT, carbo_fibre_percent INT, carbo_sugars_g INT, protein_g INT,\

vitamin_a_percent INT, vitamin_c_percent INT, calcium_percent INT,\

iron_percent INT, micro_nutrients TEXT, tips TEXT, diet_id INT, diet_type\

TEXT)")
Read More
Posted in | No comments

Trying to print a string character by character with delay between two character print

Posted on 12:20 PM by Unknown
Trying to print a string character by character with delay between two

character print



I've tried with code below. please guide me where i am wrong??? The

desired output is like..

m(delay)e(delay)s(delay)s(delay)a(delay)g(delay)e.

import java.util.*;

import java.applet.*;

import java.awt.*;

/*<applet code="MessageWithDelay" width=400 height=200>

</applet>*/

public class MessageWithDelay extends Applet implements Runnable {

Thread t;

//char msg[] ={"m","e","s","s","a","g","e"};

String str = "message";

Graphics bufferg;

Image buffer;

int counter=0,x=str.length(),i=0;;

public void init() {

//initializa the thread

t = new Thread(this);

t.start();

Dimension d = getSize();

buffer = createImage(d.width,d.height);

}

public void run() {

try {

while(true)

{

//requesting repaint

repaint();

if(counter==x)

{

Thread.sleep(200);

counter=0;

i=0;

}

else

{

Thread.sleep(400);

}

}

}

catch(Exception e) {

}

}

public void update(Graphics g) {

paint(g);

}

public void paint(Graphics g) {

if(bufferg == null) {

Dimension d = getSize();

bufferg.setColor(Color.green);

g.setFont(new Font("Comic Sans MS",Font.BOLD,36));

bufferg.drawString(str.charAt(i)+"",20,20);

counter++;

i+=1;

//update screen

g.drawImage(buffer,0,0,this);

}

}

}

I am working on command prompt and its giving me bunch of different

errors. I want to know why the errors occurring if anyone could explain me

by trying it. Thanx in advance.
Read More
Posted in | No comments

I need to make my JPanel resize dynamically as new components are being added to it

Posted on 9:38 AM by Unknown
I need to make my JPanel resize dynamically as new components are being

added to it



I need to let users add more text fields to my JFrame so once the size of

the frame has exceeded its original value a scroll pane would step in.

Since I cannot add JScrollPane to JFrame in order to enable scrolling I

decided to put the JPanel on the JFrame and pass the JPanel object into

the JScrollPane constructor. Scrolling now works fine but only until it

has reached the borders of the JPanel. The thing is the size of JPanel

stays as is and is not stretching dynamically. What happens is the buttons

in my code are using up all the space of the JPanel being the size of

300x300 but what I want to do is have JPanel stretch once these controls

have used up its original space. Please advise.

import java.awt.Dimension;

import java.awt.FlowLayout;

import java.awt.GridLayout;

import java.awt.Rectangle;

import javax.swing.JButton;

import javax.swing.JFrame;

import javax.swing.JPanel;

import javax.swing.JScrollPane;

import javax.swing.JTable;

import javax.swing.ScrollPaneConstants;

public class Skrol {

public static void main(String[] args) {

JFrame f = new JFrame();

f.setLayout(new FlowLayout());

f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

JPanel p = new JPanel();

p.setPreferredSize(new Dimension(400,400));

JScrollPane jsp = new JScrollPane(p);

jsp.setPreferredSize(new Dimension(300,300));

jsp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);

jsp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);

for(int i=0;i<100;i++)

{

JButton b = new JButton("Button "+i);

p.add(b);

}

f.add(jsp);

f.setSize(new Dimension(600,600));

f.setLocation(300, 300);

f.setVisible(true);

}

}
Read More
Posted in | No comments

How to retrieve images from cache memory?

Posted on 6:40 AM by Unknown
How to retrieve images from cache memory?



I am using picasso library for loading images .In default picasso, It uses

internal cache memory for loading images.But as per my app configuration

,i have to use external cache memory(Cache on Disk). so i used this code

for Cache on Disk

File httpCacheDir = new

File(getApplicationContext().getExternalCacheDir(),"http");

long httpCacheSize = 10 * 1024 * 1024; // 10 MiB

HttpResponseCache.install(httpCacheDir, httpCacheSize);}

Picasso is flexible. So now it caches images in external Sd card..

The caches is stored in sdcard/android/data/packagename/cache/http The

caches are stored in ".1" ,".0". formats so i just opened them and changes

into ".1" to ".jpg".it gives exact images what i need. But how to do in

programatically? but picasso itself caches my memory in to my app for

loading image into imageview.but i have to download images from cache

memory..any help?
Read More
Posted in | No comments

how to add jscrollpane to jframe?

Posted on 12:10 AM by Unknown
how to add jscrollpane to jframe?



I have following source code...Can someone please give me an advice how to

add jscrollpane onto jframe? I tried several time to add it to jframe but

without any progress. It is not even showing.

public class Form3 {

JFrame jframe = new JFrame("Etiket print.");

JPanel panel1 = new JPanel();

JPanel panel2 = new JPanel();

JPanel panel3 = new JPanel();

JPanel panel4 = new JPanel();

JScrollPane scrollFrame = new JScrollPane(panel2);

Color myBlue1Color = new Color(168, 175, 247);

Color myBlue2Color = new Color(139, 146, 255);

public Form3(){

jframe.setMinimumSize(new Dimension(1280, 1000));

panel2.setLayout(new BoxLayout(panel2, BoxLayout.Y_AXIS));

panel2.setAutoscrolls(true);

jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

//---------------------------------Header

panel1 = createSquareJPanel(Color.YELLOW, 600,200);

panel3 = createSquareJPanel(Color.GREEN, 400,200);

panel4 = createSquareJPanel(Color.white, 280,200);

JPanel container = new JPanel();

JPanel container1 = new JPanel();

JPanel container2 = new JPanel();

container.setLayout(new BoxLayout(container,

BoxLayout.Y_AXIS));

container1.setLayout(new BoxLayout(container1,

BoxLayout.Y_AXIS));

container2.setLayout(new BoxLayout(container2,

BoxLayout.X_AXIS));

container1.add(panel1);

container2.add(container1);

container2.add(panel3);

container2.add(panel4);

container.add(container2);

container.add(panel2);

{

for (int i=0; i<25; i++){

JPanel harnessPanel= new JPanel();

harnessPanel.setMinimumSize(new Dimension(1280, 70));

harnessPanel.setMaximumSize(new Dimension(1280, 70));

harnessPanel.setPreferredSize(new Dimension(1280,

70));

if(i%2==0) {

harnessPanel.setBackground(myBlue1Color);

}

else {

harnessPanel.setBackground(myBlue2Color);

}

panel2.add(harnessPanel);

harnessPanel.repaint();

harnessPanel.validate();

}

panel2.repaint();

panel2.validate();

}

jframe.add(scrollFrame);

jframe.add(container);

jframe.pack();

jframe.setLocationRelativeTo(null);

jframe.setVisible(true);

}

private JPanel createSquareJPanel(Color color, int size1, int

size2)

{

JPanel tempPanel = new JPanel();

tempPanel.setBackground(color);

tempPanel.setMinimumSize(new Dimension(size1, size2));

tempPanel.setMaximumSize(new Dimension(size1, size2));

tempPanel.setPreferredSize(new Dimension(size1, size2));

return tempPanel;

}

public static void main (String args[]){

SwingUtilities.invokeLater(new Runnable() {

@Override

public void run() {

Form3 myF=new Form3();

}

});

};

}

picture of my app:
Read More
Posted in | No comments

Tuesday, August 27, 2013

Query on how to Select Date before the latest Date in MySQL

Posted on 9:06 PM by Unknown
Query on how to Select Date before the latest Date in MySQL



I need help on mysql query with regards to date.

I want to select the date before the latest date in mysql query. For

example the dates are:

2013-01-29, 2013-02-28, 2013-03-29

The output must be 2013-02-28.

What sql clause must be used to return the said output?

Thanks in advance.
Read More
Posted in | No comments

Does archive size of tar, zip and rar effect the time it takes to delete a file from it?

Posted on 3:56 PM by Unknown
Does archive size of tar, zip and rar effect the time it takes to delete a

file from it?



Does it take a longer time to delete files from a large tar zip and rar

archive than a smaller one? I would think that for a file to be deleted

from an archive, all the data that exists after the deleted file would

have to be re-written to the archive, thus taking longer as opposed to a

smaller archive where the amount of data to re-write is less... if not,

how are these archives able to remove data from the middle of the archive

without re-writing the rest of the data?
Read More
Posted in | No comments

How do I make a DOM object follow a circular path with jQuery?

Posted on 1:32 PM by Unknown
How do I make a DOM object follow a circular path with jQuery?



I'm trying to make a DOM object follow a circular path with jQuery.

So far, I'm trying to find the path by re-arranging a simple formula to

determine a circle, so in pseudocode:

x = whatever. y = abs(sqrt(constant) -x)

This is what I have so far:

$(window).on('scroll', function()

{

//get intitial ratio

vRatio = (sky.dHeight - sky.height ) / (sky.height - 100)

hRatio = (sky.dHeight - sky.height ) / (sky.width - 100)

rawX = $(window).scrollTop() / hRatio;

x = rawX - sky.width/2;

y = Math.abs(Math.sqrt(sky.width/2) - x);

console.log(x)

console.log(y)

sun.ob.css({left : rawX, top: y})

})

Currently, it's following a triangular path rather than the gentle

circular flow I was seeking with my eyes.

Just to give some context, this is on a parallax style document where the

height is 000's of px tall (hence the ratios).
Read More
Posted in | No comments

how to use for loop for my issue

Posted on 5:42 AM by Unknown
how to use for loop for my issue



I have 2560 sample points. I want to calculate mean variance skewness

kurtosis for first 512 points, next 512 so on. so totally 5 sets of output

data .I want to plot 5 sets of values of mean , var , skew , kur in a

graph.

I read a data from excel consisting of 2560 points

x=xlsread('dta.xls');

i=1:512;

y=x(i)

m=mean(y);

v=var(y);

i=513:1024;

y=x(i)

m=mean(y);

v=var(y);

i=1025:1536

y=x(i)

m=mean(y);

v=var(y);

plot(m)

plot(v)

like this my code s going. I tried using for loop but I couldn't able to

make it.
Read More
Posted in | No comments

AngularJS - Pass variable from a controller & update from directive

Posted on 3:40 AM by Unknown
AngularJS - Pass variable from a controller & update from directive



I've set one Plnkr. I want to dynamically add input fields in a directive.

The input fields are to be built by a collection from a controller. And

change the values of the inputs. But the main problem is that I can't edit

the values in input fields generated by the directive.

Please help. Thanks in advance.
Read More
Posted in | No comments

Windows 2012: how to make power button work in every cases?

Posted on 2:04 AM by Unknown
Windows 2012: how to make power button work in every cases?



I need some Windows 2012 servers to be shutdown properly with the power

button.

If nobody is logged, the power button correctly shuts down the server

If somebody is logged without a blocking program, it's okay too

But:

if a session is locked, the power button does nothing

if somebody is logged with a blocking program, the button does nothing too

With previous Windows versions I was used to configure the power button

behaviour with the GUI and modify a registry key

(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system\shutdownwithoutlogon)

but this seems not any more relevant.

Does anyone knows the "offical" way, or a trick ?
Read More
Posted in | No comments

Monday, August 26, 2013

IN OBOUT grid, how to move from first grid to another grid by clicking a row in first grid

Posted on 11:34 PM by Unknown
IN OBOUT grid, how to move from first grid to another grid by clicking a

row in first grid



Im using OBOUT GRID

im getting data from database and displaying it in grid1 . now in client

side in the grid1 if they select any row ,i should get that id and search

it in database retrieve the data similar to that id and i should display

in grid2. how can i do it?.. please help me

Thanks in advance..

Here my javascript

function onSelect() {

for (var i = 0; i < Grid1.PageSelectedRecords.length; i++) {

var record = Grid1.PageSelectedRecords[i];

var text = document.getElementById("TextBox1");

text.value = record.order_id;

alert(PageMethods.second(record.order_id));

}

}

here my HTML

<asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true"

EnablePartialRendering="true" runat="server" />

<cc1:Grid ID="Grid1" AllowRecordSelection="true"

AllowMultiRecordSelection="true" runat="server">

<ClientSideEvents OnClientSelect="onSelect" />

</cc1:Grid>

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

here my code behind

[WebMethod]

public void second(int oid)

{

Response.Write(oid);

MySqlConnection con = new MySqlConnection("server=localhost;

database=db1; uid=root;");

con.Open();

MySqlCommand sel1cmd = new MySqlCommand("select

order_id,firstname,lastname from api where order_id=@oid", con);

sel1cmd.Parameters.AddWithValue("@oid", oid);

sel1cmd.ExecuteNonQuery();

MySqlDataAdapter da1 = new MySqlDataAdapter(sel1cmd);

DataSet ds1 = new DataSet();

da1.Fill(ds1);

DataTable dt1 = new DataTable();

da1.Fill(dt1);

Grid1.DataSource = ds1.Tables[0];

Grid1.DataBind();

}

Please help me
Read More
Posted in | No comments

Am I using the form action correctly?

Posted on 3:17 PM by Unknown
Am I using the form action correctly?



I am just beginning to use smartystreets. I am trying to use LiveAddress

API. Am I on the right track for submitting the request and getting back

the address components?

<?php

$authid = 'myauthid';

$authToken = 'myauthtoken';

$street = $_POST['street'];

$city = $_POST['city'];

$state = $_POST['state'];

$zipcode = $_POST['zipcode'];

$req =

"https://api.smartystreets.com/street-address/?street={$street}&city={$city}&state={$state}&zipcode={$zipcode}&auth-id={$authId}&auth-token={$authToken}";

// GET request and turn into associative array

$result = json_decode(file_get_contents($req));

$result = json_decode(file_get_contents($req),true);

echo "<pre>";

print_r($result);

echo "</pre>";

?>

<form

action="https://api.smartystreets.com/street-address/?street={$street}&city={$city}&state={$state}&zipcode={$zipcode}&auth-id={$authId}&auth-token={$authToken}"

method="post">

<input type="hidden" id="" value="" />

<input type="text" id="street" value="" />

<input type="text" id="city" value="" />

<input type="text" id="state" value="" />

<input type="text" id="zipcode" value="" />

<input type="submit" value="submit" id="submit-button" />

</form>
Read More
Posted in | No comments

Increasing the font size of a webview conflict with UIScrollView

Posted on 9:10 AM by Unknown
Increasing the font size of a webview conflict with UIScrollView



i have a UIWebView inside a UIScrollView. I am using this code to increase

the font size of the UIWebView:

int fontSize = 150;

NSString *jsString = [[NSString alloc]

initWithFormat:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust=

'%d%%'", fontSize];

[LabelNewsContent stringByEvaluatingJavaScriptFromString:jsString];

NSString *size = [LabelNewContent

stringByEvaluatingJavaScriptFromString:@"return Math.max( \

document.body.scrollHeight, document.documentElement.scrollHeight, \

document.body.offsetHeight, document.documentElement.offsetHeight, \

document.body.clientHeight, document.documentElement.clientHeight \

);"];

scrollview.contentSize = CGSizeMake(scrollview.contentSize.width, [size

floatValue]);

The font increase happens without any errors but only half of the text

inside the UIWebView is visible.
Read More
Posted in | No comments

quicktags "link" button doesn't work, but all other buttons do

Posted on 7:14 AM by Unknown
quicktags "link" button doesn't work, but all other buttons do



I've added quicktags to a plain ol' textarea field which sits inside a

metabox on a custom post type page.

I can see the link button on the toolbar, along with the rest of the

buttons, but when clicked, the link button does nothing. Using WP 3.6. All

the other buttons work except the link button, and there's no errors in

the firebug console. Have also tried with chrome.

function my_admin_print_footer_scripts() { ?>

<script type="text/javascript">/* <![CDATA[ */

var id = "textarea_id"; // textarea's id

settings = {

id : id,

buttons: 'strong,em,link,ul,ol,li,code' // have tried with

default settings

}

quicktags(settings);

/* ]]> */</script>

<?php }

add_action( 'admin_print_footer_scripts', 'my_admin_print_footer_scripts' );



Is there another bit of code I need to write or another JS file to

enqueue? I presume the link button must popup a box for the user to enter

the link.
Read More
Posted in | No comments

Cannot access local variables using systemtap

Posted on 4:41 AM by Unknown
Cannot access local variables using systemtap



I am just getting started using systemtap. On my 64bit Ubuntu 13.04

system, I installed systemtap and dependencies + systemtap-doc and

elfutils then added the ddep repository to my apt/sources.list and

installed the dbgsym package for my kernel (3.8.0-29.42).

I then tried running the examples in

/usr/share/doc/systemtap-doc/examples/general (e.g., key.stp), but I got

semantic error: not accessible at this address [man error::dwarf] ...

identifier '$event_type' at key.stp:8:7

I then ran the "Work around broken dbgsym file layount..."-script as

described at wiki.ubuntu.com/Kernel/Systemtap

Still the same error and similar errors occur running the other scripts

whenever a local variable is accessed.

So I wrote a little script following section "Determine local variables at

probe point" on the same page to give me a list of local variables in

kbd_event.

probe begin {

printf ("probe installed")

}

probe kernel.function("kbd_event") {

printf ("%s locals [%s]\n", probefunc(), $$locals)

exit()

}

which gives me

probe installed

kbd_event locals []

So it looks like stap doesn't see any local variables and this is where I

am stuck.

Any ideas what I am missing or what I could try next?

Thanks!
Read More
Posted in | No comments

Sunday, August 25, 2013

Remove/avoid adding target link to URL

Posted on 10:01 PM by Unknown
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 it around the web.

Case

I have a link at the bottom of a page that says Back to Top, the link is

simply a target link like this:

<a href="#top" class="standard">Back to Top</a>

So when you click it, it jumps to the top of page. Simple.

Problem

When the target link is clicked, the id #top is added to the URL of the

page, ie:

http://website.com/about-us/#top

Question

Is there a way to remove or avoid getting that id #top added to the URL of

the page but retain the functionality of the page jumping to the top?

Any help with this is greatly appreciated.
Read More
Posted in | No comments

Left-justified equations with left tags (so it looks like an enumeration)

Posted on 10:46 AM by Unknown
Left-justified equations with left tags (so it looks like an enumeration)



I want to make a math enivornment (preferably a customized align/flalign

environment) with left-justified/left-aligned equations (as it is possible

with the flalign environment) and left-aligned tags (instead of the

default right alignment) but with the same indent handling flalign offers

when using right-aligned equations with default right-aligned tags.

I've added a screenshot and a MWE for clarification.

I'd appreciate any help :-)



\documentclass[twoside]{scrbook}

\parindent0pt

\parskip6pt

\usepackage[ngerman]{babel}

\usepackage[utf8]{inputenc}

\usepackage[T1]{fontenc}

\usepackage{amsmath, amssymb, enumitem, color}

\newcommand{\red}{\color{red}}

\newcommand{\set}[1]{\left\lbrace #1 \right\rbrace}

\newcommand{\script}[1]{\mathcal{#1}}

\renewcommand{\complement}{\mathcal{C}}

\makeatletter

\newenvironment{lalign}{\tagsleft@true\flalign}{\endflalign}

\makeatother

\begin{document}

\textbf{Definition} \quad ($\sigma$-field)

\begin{align}

& \Omega \in \script{A} \tag{SF1}\label{SF1} \\

& A \in \script{A} \Rightarrow \complement A \in \script{A}

\tag{SF2}\label{SF2} \\

& A_1, A_2, \ldots \in \script{A} \Rightarrow \bigcup_{i=1}^\infty A_i \in

\script{A} \tag{SF3}\label{SF3}

\end{align}

\textbf{Exercise} \quad Is $\script{A}$ a $\sigma$-field?

\begin{enumerate}[label=(\roman*)]

\item $\Omega$ arbitrary, $\script{A} = \set{\emptyset, \Omega}$.

\item $\ldots$

\end{enumerate}

\textbf{Solution} \quad

\begin{enumerate}[label=(\roman*)]

\item Let $\Omega$ be arbitrary and $\script{A} = \set{\emptyset, \Omega}$.

{\red It should be like this, but just the other way round:}

\begin{flalign}

&& \Omega \in \script{A} & \tag{\ref{SF1}} \\

&& \emptyset \in \script{A} \Rightarrow \complement \emptyset = \Omega \in

\script{A} \tag{\ref{SF2}} \\

&& \Omega \in \script{A} \Rightarrow \complement \Omega = \emptyset \in

\script{A} \notag \\

&& \emptyset, \Omega \in \script{A} \Rightarrow \emptyset \cup \Omega =

\Omega \in \script{A} \tag{\ref{SF3}}

\end{flalign}

{\red This happens when I set \texttt{tagsleft@true} and use

\texttt{flalign} for left-aligned equations:}

\begin{lalign}

& \Omega \in \script{A} & \tag{\ref{SF1}} \\

& \emptyset \in \script{A} \Rightarrow \complement \emptyset = \Omega \in

\script{A} \tag{\ref{SF2}} \\

& \Omega \in \script{A} \Rightarrow \complement \Omega = \emptyset \in

\script{A} \notag \\

& \emptyset, \Omega \in \script{A} \Rightarrow \emptyset \cup \Omega =

\Omega \in \script{A} \tag{\ref{SF3}}

\end{lalign}

{\red I don't want centered equations because it should look like an

enumeration:}

\begin{lalign}

& \Omega \in \script{A} \tag{\ref{SF1}} \\

& \emptyset \in \script{A} \Rightarrow \complement \emptyset = \Omega \in

\script{A} \tag{\ref{SF2}} \\

& \Omega \in \script{A} \Rightarrow \complement \Omega = \emptyset \in

\script{A} \notag \\

& \emptyset, \Omega \in \script{A} \Rightarrow \emptyset \cup \Omega =

\Omega \in \script{A} \tag{\ref{SF3}}

\end{lalign}

{\red As it should look like (dirty coded, I want the code to be

universally usable):}

\begin{lalign}

& \hspace*{1.2cm} \Omega \in \script{A} & \tag{\ref{SF1}} \\

& \hspace*{1.2cm} \emptyset \in \script{A} \Rightarrow \complement

\emptyset = \Omega \in \script{A} \tag{\ref{SF2}} \\

& \hspace*{1.2cm} \Omega \in \script{A} \Rightarrow \complement \Omega =

\emptyset \in \script{A} \notag \\

& \hspace*{1.2cm} \emptyset, \Omega \in \script{A} \Rightarrow \emptyset

\cup \Omega = \Omega \in \script{A} \tag{\ref{SF3}}

\end{lalign}

\item $\ldots$

\end{enumerate}

\end{document}
Read More
Posted in | No comments

[ Marriage & Divorce ] Open Question : My boyfriend sent a picture of his hard **** to his co-worker's wife?

Posted on 8:12 AM by Unknown
[ Marriage & Divorce ] Open Question : My boyfriend sent a picture of his

hard **** to his co-worker's wife?



and she responded with a picture of her vagina and tits. I am not a

jealous person by any means. Yesterday his co-worker told me that this

happened and emailed me with proof. I was in utter shock and digusted. My

boyfriend never sends me any naked pictures. My dirt bag bf says he meant

to send it to me. My name on his phone is Baby the other girl's starts

with a L. If his co-worker woudn't have told me I don't even know if I

would have ever found out. And if it was a so-called mistake why did you

reply with a picture? They both denied it to my bf's co-worker at first.

They late told him it was a mistake. One knows what you send and what you

don't send. My bf called me a million times apologizing. I spoke to him

and the girl. They apologized and said it was a mistake. We have been

together for three years. How the ^&* is this a mistake? I am not sure

what to feel but hate and anger. I know many of you will tell me leave

him, which I am thinking about. But if we do get back together, how can I

ever look past this? Has this ever happened to anyone? What did you do to

overcome this?
Read More
Posted in | No comments

livetv2pc)))WaTch (Rugby) Australia vs New Zealand live Bledisloe Cup 2013 Game 2 free online Broadcast video PC2TV on Saturday 08 2013

Posted on 12:47 AM by Unknown
livetv2pc)))WaTch (Rugby) Australia vs New Zealand live Bledisloe Cup 2013

Game 2 free online Broadcast video PC2TV on Saturday 08 2013



everybody Welcome to Watch and enjoy rugby championship 2013 match between

Australia vs New Zealand live streaming HD satellite tv coverage. Now

watch and enjoy Australia vs New Zealand live stream rugby championship to

your PC. Australiavs New Zealandlive online. Australia vs New Zealand live

Online Broadcast. Any where you can watch this exclusive match Australia

vs New Zealand live without any additional software. JUST FOLLOW OUR TV

LINK PC, laptop, notebook, i phone, i pad, Android, PlayStation, Safari,

smartphone Linux, Apple, ios, Tablet etc, from this site With HD quality.

3500 satellite TV- TV on PC & MAC(OSX)!bundle the ultimate TV experience

with internet on all device 78 SPORTS + 3500 CHANNELS AVAILABLE, ANYWHERE,

ANYTIME, 24 X 7.

Click To Watch Australia vs New Zealand live online rugby championship2013

http://tinyurl.com/3500TVChannel

How to Free watch Australia vs New Zealand live rugby championship 2013

match online? You can watch Australia vs New Zealand live game in our

digital online TV. Rugby championship 2013 live stream. Australia vs New

Zealand live. Australiavs New Zealand live streaming. Rugby live streaming

Australia vs New Zealand. Don't worry you can still watch rugby

championship 2013 from your PC TV. You don't have to look else anywhere.

Just follow our tv link on this page and enjoy watch your favorite TV

channels. We offer you to watch live internet broadcasting Sports TV

Software from across the world. undefined :-Match Details:- The Rugby

Championship 2013 Australia vs New Zealand Live Day & Date: Saturday, 24

August, 2013 Time: 19:35 local, 07:35 GMT, 13:35 BDT Where: WestPac

Stadium, Wellington, New Zealand Watch: Sky Sports (UK), Fox Sports (AUS)

http://tinyurl.com/3500TVChannel

Stats: Live Watch Australia vs New Zealand Rugby Championship Match Live

on your PC tumblr_inline_mrh8nyomPC1qz4rgp You can watch the favorite tv

channel on this way. Fine tv picture tube and clean motive. Also i say

that you find cheap tv processing program. Enjoy this season live

Australia vs New Zealand Rugby Championship Match match like free

broadcast with exclusive entertainment page. Don't miss this game tomorrow

with HD online here.Match preview,Score,Exclusively 24/7. Also Entertain

4500 HD Channel Full of different type of Program. There is no any

hardware purchases required ever, no Monthly charges and no Bandwidth

limits.It's is worldwide TV Channel coverage and no TV Streaming

restrictions.

Click Here To Watch Live Rugby Online TV 02RuanPienaar_try1_UlstervTreviso

Hope That You can watch Australia vs New Zealand Rugby Championship Match

Live on your PC by click the link. You are insured that this is a very

fast, chief and 100% HD video quality link. All times of this match will

be very exclusive and memorable. Most visitor are through that this two

teams will show their extra performance. Visitor we are ready for you. So

keep watching and enjoy your time.Let's go watch and enjoy Australia vs

New Zealand live. Watch Australia v New Zealand Live Streaming online,

Australia v New Zealand Live Rugby Championship 2013, Australia v New

Zealand Live Tv Coverage, Australia v New Zealand Live Satellite Tv,

Australia v New Zealand Live Broadcast, Australia v New Zealand Live

Instant Access, Australia v New Zealand Live Video Coverage, Australia v

New Zealand Live Enjoy & many more
Read More
Posted in | No comments

Saturday, August 24, 2013

The Google Visualization API Query Language: Query parse error: Encountered " "," ", "" at line 1, column 24. Was expecting one of:

Posted on 10:27 PM by Unknown
The Google Visualization API Query Language: Query parse error:

Encountered " "," ", "" at line 1, column 24. Was expecting one of:



I am trying to use google Visualization API function "drawVisualization"

in my JS programme to query google spreadsheet data, but getting "Query

parse error" message with following command:

'query':'select I where J = UP, sum(E) group by I',

This function works fine without "where" option as in following command:

'query':'select I , sum(E) group by I',

I have tried multiple combinations with "where" option, but giving error.

Please suggest. Function code is:

function drawVisualization() { var wrap = new

google.visualization.ChartWrapper({ 'chartType':'ColumnChart',

'dataSourceUrl':'https://docs.google.com/spreadsheet/ccc?key=#gid=0',

'containerId':'visualization', 'query':'select I where J = UP, sum(E)

group by I', 'options': {'title':' Capacity KW/H Requirement)',

'legend':'none'} });

Thanks Vivek
Read More
Posted in | No comments

iOS 7 phone-number link doesn't work when webpage is on the home screen

Posted on 2:17 PM by Unknown
iOS 7 phone-number link doesn't work when webpage is on the home screen



I have phone number links as +xx-xxx-xxxxxx on my webpage. In iOS 7 it

works as long as it is viewed in mobile safari. As soon as I've added the

webpage to my homescreen (standalone webapp-mode) the links don't work

anymore. Has anyone an idea?
Read More
Posted in | No comments

Cross-browser textarea maxlength

Posted on 11:07 AM by Unknown
Cross-browser textarea maxlength



What is a cross-browser way to set the maximum number of characters in a

textarea? maxlength does not work on Opera and IE9 and below.

Once the character limit is reached, the textarea should not allow more

characters to be entered. Text pasted either with Ctrl+V or the

right-click context menu should be cut off at the character limit. This

means a solution that uses only onkey___ events is not sufficient.
Read More
Posted in | No comments

candied mints storage and transporting long distance

Posted on 4:44 AM by Unknown
candied mints storage and transporting long distance



I'm making mints for my nephew's wedding (containing powdered sugar,

butter, white syrup). The wedding is in August. I have to travel more than

1,000 miles to wedding. I have two questions:

If I make them ahead of time, how do I store them to keep them fresh?

How do I transport them in an automobile?
Read More
Posted in | No comments

how to convert objectHTML into html

Posted on 2:08 AM by Unknown
how to convert objectHTML into html



i have create an image object in javascript as follows

var imgVal = new Image(); imgVal.src= 'resources/img/def.png';

now i want to have some function which converts above imgVal object into

html i.e.

<img scr="resources/img/def.png" />

i am using sencha touchso if is there any existing function available then

please do tell me
Read More
Posted in | No comments

Friday, August 23, 2013

Mellin transform definition

Posted on 11:30 PM by Unknown
Mellin transform definition



is thre a possible meaning or definition to the Mellin transform

$$ \int_{0}^{\infty} \frac{dt}{t-1}t^{s-1}= F(s) $$

i know that $$ \int_{0}^{\infty} \frac{dt}{t+1}t^{s-1}= F(s)=

\frac{\pi}{sin(\pi s)} $$

howver can one overcome the pole at $ t=1 $ ?
Read More
Posted in | No comments

Multiple Google Calendars with one Google Cal ID

Posted on 9:16 PM by Unknown
Multiple Google Calendars with one Google Cal ID



I have a Google Calendar account that has multiple shared calendars and a

main calendar. The shared calendars can be edited by other users to put

events into each one of those calendars. I would then like to be able to

use the main calendar's Google Cal ID to link others to the main calendar

and have them see all the events from the other shared calendars

overlayed. Is there any way I can do this?
Read More
Posted in | No comments

Dell PowerEdge 2950 PCIe Training Error -- No PCIe cards inside

Posted on 5:02 PM by Unknown
Dell PowerEdge 2950 PCIe Training Error -- No PCIe cards inside



So I recently found myself an old PowerEdge 2950, and when I turned it on

(after me almost having a heart attack by the sound of it starting up),

during post it halted with an error of PCIe Training Error : Internal PCIe

Card. The weird thing there, is that there aren't any PCIe cards in the 3

slots. The rightmost (bottom, in the picture) slot however, seems to come

out of the board as an expansion of some sort? Could that be a problem? In

case I'm missing something really obvious, I've included a shot of the

whole system.
Read More
Posted in | No comments

Reset Disk - Windows Storage Server 2012

Posted on 12:52 PM by Unknown
Reset Disk - Windows Storage Server 2012



I set up windows storage server 2012 and have 6 SATA drives in a raid

configuration.

Prior to production use I tested by removing drive and adding a spare and

rebuilding. That went fine.

Now I see that the original drive can not be reused in the array (and the

spare in a different drive slot) unless I presume it is re initialized.

In the same server I had one more sata connector so I am using that and

trying to "reset" or "format" the original drive or the spare.. but the

format option does not illuminate 9it is disabled) offline option doesn't

take off line but I can toggle from dynamic disk and static disk...

How can I reset the drive w/o finding a different PC?
Read More
Posted in | No comments

Windows Phone 8 - Keeping background location tracking active beyond four hours

Posted on 8:40 AM by Unknown
Windows Phone 8 - Keeping background location tracking active beyond four

hours



I'm in the process of developing a WP8 app that makes use of the

background location tracking abilities provided by the OS. The idea is to

monitor the users position and to notify them when they are near certain

types of places.

So far it all seems to work fine and when running the location tracking

works as I would expect.

The problem is, it seems that the phone times out background apps after

around four hours, stopping the location tracking.

I can understand why Microsoft did it, to preserve battery life etc. But

there's not much point having a background location tracking app that has

to be manually restarted every four hours! If a user chooses to run this

app and is made aware of the potential battery hit, surely it should be

able to run indefinitely - to a point of course, if the system runs out of

resources or similar then that's fair enough.

Does anyone have any experience with this? There must be hundreds of

others apps in the store that have run into this issue I would have

thought? And presumably there must be some way of keeping the location

tracking running?

I've tried periodically updating the live tile (using a DispatcherTimer)

while the tracking is running but this doesn't seem to be enough to keep

the app alive either :(

Anyone have any ideas?

Thanks.
Read More
Posted in | No comments

Django forms design suggestiom

Posted on 4:37 AM by Unknown
Django forms design suggestiom



I want to create an app which will allow users to answer multiple choice

questions. So i have a db structure something like: Quiz(name)

->Page(number)->Question(statement)->Answer(text).

As far as I can see this doesn't fit in any built-in django form so I'm

thinking to create a view function having a quiz id , then, on each page

to display the question and the list of answers. I will use POST and html

forms to submit the answers... and so on.

Is there a django built-in way to handle this thing ?

(Something like SessionWizardView , but i'm not really sure it will work,

since i'm not trying to fill simple models with data, but to select an

answer for each quiz)
Read More
Posted in | No comments

Magento Upgrade, getting error with tier prices from 1.4.0.2 to 1.7.0.2

Posted on 1:18 AM by Unknown
Magento Upgrade, getting error with tier prices from 1.4.0.2 to 1.7.0.2



Getting the following error:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update

a child row: a foreign key constraint fails

(`catalog_product_entity_tier_price`, CONSTRAINT

`FK_6E08D719F0501DD1D8E6D4EFF2511C85` FOREIGN KEY (`customer_group_id`)

REFERENCES `customer_group` (`customer_group_id`) ON DEL)

Not sure how to fix this. Any help????

When I check database, customer_group has four rows just like any other

magento installation where as catalog_product_entity_tier_price is totally

empty.

customer_group table dump:

CREATE TABLE IF NOT EXISTS `customer_group` (

`customer_group_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT

'Customer Group Id',

`customer_group_code` varchar(32) NOT NULL COMMENT 'Customer Group Code',

`tax_class_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Tax Class Id',

PRIMARY KEY (`customer_group_id`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Customer Group'

AUTO_INCREMENT=5 ;

--

-- Dumping data for table `customer_group`

--

INSERT INTO `customer_group` (`customer_group_id`, `customer_group_code`,

`tax_class_id`) VALUES

(1, 'General', 3),

(2, 'Wholesale', 3),

(3, 'Retailer', 3),

(4, 'NOT LOGGED IN', 3);

catalog_product_entity_tier_price dump:

--

-- Table structure for table `catalog_product_entity_tier_price`

--

CREATE TABLE IF NOT EXISTS `catalog_product_entity_tier_price` (

`value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value ID',

`entity_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID',

`all_groups` smallint(5) unsigned NOT NULL DEFAULT '1' COMMENT 'Is

Applicable To All Customer Groups',

`customer_group_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT

'Customer Group ID',

`qty` decimal(12,4) NOT NULL DEFAULT '1.0000' COMMENT 'QTY',

`value` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Value',

`website_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Website

ID',

PRIMARY KEY (`value_id`),

UNIQUE KEY `E8AB433B9ACB00343ABB312AD2FAB087`

(`entity_id`,`all_groups`,`customer_group_id`,`qty`,`website_id`),

KEY `IDX_CATALOG_PRODUCT_ENTITY_TIER_PRICE_ENTITY_ID` (`entity_id`),

KEY `IDX_CATALOG_PRODUCT_ENTITY_TIER_PRICE_CUSTOMER_GROUP_ID`

(`customer_group_id`),

KEY `IDX_CATALOG_PRODUCT_ENTITY_TIER_PRICE_WEBSITE_ID` (`website_id`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Catalog Product Tier Price

Attribute Backend Table' AUTO_INCREMENT=4 ;

--

-- Constraints for dumped tables

--

--

-- Constraints for table `catalog_product_entity_tier_price`

--

ALTER TABLE `catalog_product_entity_tier_price`

ADD CONSTRAINT `FK_6E08D719F0501DD1D8E6D4EFF2511C85` FOREIGN KEY

(`customer_group_id`) REFERENCES `customer_group` (`customer_group_id`)

ON DELETE CASCADE ON UPDATE CASCADE,

ADD CONSTRAINT `FK_CAT_PRD_ENTT_TIER_PRICE_ENTT_ID_CAT_PRD_ENTT_ENTT_ID`

FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity`

(`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,

ADD CONSTRAINT `FK_CAT_PRD_ENTT_TIER_PRICE_WS_ID_CORE_WS_WS_ID` FOREIGN

KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE

CASCADE ON UPDATE CASCADE;

Please help me how to fix this issue. (using magento 1.7.0.2)

Thank You.
Read More
Posted in | No comments

Thursday, August 22, 2013

Bouncing between "Adapter is detached" and "No wrapped connection" with HttpClient

Posted on 9:46 PM by Unknown
Bouncing between "Adapter is detached" and "No wrapped connection" with

HttpClient



So as i said i'm bouncing back and forth between these two errors when

trying to run HttpClient.execute(HttpPost). Getting IllegalStateException

public class NetMethods {

private static HttpClient client = new DefaultHttpClient();

public static void getStuff() {

ArrayList<Alarm> alarms = new ArrayList<Alarm>();

HttpPost post = HttpPostFactory.getHttpPost("GetStuff");

StringBuilder builder = new StringBuilder();

HttpResponse response = client.execute(post); // Exception thrown here

...

Also, my MttpPostFactory just has this

import org.apache.http.client.methods.HttpPost;

public class HttpPostFactory {

private static final String url = "http://example.com/ExampleFolder/";

public static HttpPost getHttpPost(String s) {

return new HttpPost(url + s);

}

}
Read More
Posted in | No comments

How to create overlapping - not stacking - shapes with canvas?

Posted on 6:24 PM by Unknown
How to create overlapping - not stacking - shapes with canvas?



I'm trying to create an array of shapes that overlap. But I'm having

difficulty preventing those shapes stacking on top of one-another.

I guess I want them to mesh together, if that makes sense?

Here's the code:

var overlap_canvas = document.getElementById("overlap");

var overlap_context = overlap_canvas.getContext("2d");

var x = 200;

var y = x;

var rectQTY = 4 // Number of rectangles

overlap_context.translate(x,y);

for (j=0;j<rectQTY;j++){ // Repeat for the number of rectangles

// Draw a rectangle

overlap_context.beginPath();

overlap_context.rect(-90, -100, 180, 80);

overlap_context.fillStyle = 'yellow';

overlap_context.fill();

overlap_context.lineWidth = 7;

overlap_context.strokeStyle = 'blue';

overlap_context.stroke();

// Degrees to rotate for next position

overlap_context.rotate((Math.PI/180)*360/rectQTY);

}

And here's my jsFiddle: http://jsfiddle.net/Q8yjP/

And here's what I'm trying to achieve: http://postimg.org/image/iio47kny3/

Any help or guidance would be greatly appreciated!
Read More
Posted in | No comments

Enclosing capsules around list based arrays [on hold]

Posted on 2:58 PM by Unknown
Enclosing capsules around list based arrays [on hold]



You are about to be provided with information to

start your own Google.

Some people posted comments and said this can not

be done because google has 1 million servers and we do not.

The truth is, google has those many servers for trolling

purposes (e.g. google +, google finance, youtube the bandwidth consuming

no-profit making web site, etc ).

all for trolling purposes.

if you wanted to start your own search engine...

you need to know few things.

1 : you need to know how beautiful mysql is.

2: you need to not listen to people that tell you to use a framework

with python, and simply use mod-wsgi.

3: you need to cache popular searches when your search engine is running.

3: you need to connect numbers to words. maybe even something like..

numbers to numbers to words.

in other words let's say in the past 24 hours people searched for

some phrases over and over again.. you cache those and assign numbers

to them, this way you are matching numbers with numbers in mysql.

not words with words.

in other words let's say google uses 1/2 their servers for trolling

and 1/2 for seaYou are about to be provided with information to

start your own Google.

Some people posted comments and said this can not

be done because google has 1 million servers and we do not.

The truth is, google has those many servers for trolling

purposes (e.g. google +, google finance, youtube the bandwidth consuming

no-profit making web site, etc ).

all for trolling purposes.

if you wanted to start your own search engine...

you need to know few things.

1 : you need to know how beautiful mysql is.

2: you need to not listen to people that tell you to use a framework

with python, and simply use mod-wsgi.

3: you need to cache popular searches when your search engine is running.

3: you need to connect numbers to words. maybe even something like..

numbers to numbers to words.

in other words let's say in the past 24 hours people searched for

some phrases over and over again.. you cache those and assign numbers

to them, this way you are matching numbers with numbers in mysql.

not words with words.

in other words let's say google uses 1/2 their servers for trolling

and 1/2 for search engine.

we need technology and ideas so that you can run a search engine

on 1 or 2 dedicated servers that cost no more than $100/month each.

once you make money, you can begin buying more and more servers.

after you make lots of money.. you probably gonna turn into a troll

too like google inc.

because god is brutal.

god is void-state

it keeps singing you songs when you are sleeping and says

"nothing matters, there is simply no meaning"

but of course to start this search engine, you need a jump start.

if you notice google constantly links to other web sites with a

trackable way when people click on search results.

this means google knows which web sites are becoming popular

are popular, etc. they can see what is rising before it rises.

it's like being able to see the future.

the computer tells them " you better get in touch with this guy

before he becomes rich and becomes un-stopable "

sometimes they send cops onto people. etc.

AMAZON INC however..



will provide you with the top 1 million web sites in the world.

updated daily in a cvs file.

downloadable at alexa.com

simply click on 'top sites' and then you will see the downloadable

file on the right side.

everyday they update it. and it is being given away for free.

google would never do this.

amazon does this.

this list you can use to ensure you show the top sites first in your

search engine .

this makes your search engine look 'credible'

in other words as you start making money, you first display things

in a "Generic" way but at the same time not in a "questionable" way

by displaying them based on "rank"

of course amazon only gives you URLS of the web sites.

you need to grab the title and etc from the web sites.

the truth is, to get started you do not need everything from web sites.

a title and some tags is all you need.

simple.

basic.

functional

will get peoples attention.

i always ask questions on SO but most questions get deleted. here's

something that did not get deleted..

How do I ensure that re.findall() stops at the right place?

use python, skrew php, php is no good.

do not use python frameworks, it's all lies and b.s. use mod-wsgi

use memcache to cache the templates and thus no need for a template engine.



always look at russian dedicated servers, and so on.

do not put your trust in america.

it has all turned into a mafia.



google can file a report, fbi can send cops onto you, and next thing you know

they frame you as a criminal, thug, mentally ill, bipolar, peadophile, and

so on.

all you can do is bleed to death behind bars.

do not give into the lies of AMERICA.

find russian dedicated servers.

i tried signing up with pw-service.com but i couldn't do it due to

restrictions with their russian payment systems and so on..

again, amazon's web site alexa.com provides you with downloadable

top 1 mil web sites in the form of a cvs file.

use it.

again, do not give into python programmers suggesting frameworks for python.

it's all b.s. use mod_wsgi with memcache.

again, american corporations can ruin you with lies and all you can do is

bleed to death behind bars

again, a basic search engine needs : url, title, tags, and popular searches

can be "cached" and words can be connected to "numbers" within the mysql.

mysql has capabilities to cache things as well.

cache once, cache twice, and you will not need 1 million servers in order

to troll.

if you need some xdotool commands to deal with people calling you a troll

here it is;

xdotool key ctrl+c

xdotool key Tab Tab Tab Return

xdotool type '@'

xdotool key ctrl+v

xdotool type --clearmodifiers ', there can not be such thing as a `troll`

unless compared to a stationary point, if you are complaining, you are not

stationary. which means you are the one that is trolling.'

xdotool key Tab Return

create an application launcher on your gnome-panel, and then select the

username in the comments section that called you a 'troll' and click the

shortcut on the gnome-panel.

it will copy the selected username to the clipboard and then hit TAB TAB

TAB RETURN

which opens the comment typing box. and then it will type @ + username +

comma, and then the rest. rch engine.

we need technology and ideas so that you can run a search engine

on 1 or 2 dedicated servers that cost no more than $100/month each.

once you make money, you can begin buying more and more servers.

after you make lots of money.. you probably gonna turn into a troll

too like google inc.

because god is brutal.

god is void-state

it keeps singing you songs when you are sleeping and says

"nothing matters, there is simply no meaning"

but of course to start this search engine, you need a jump start.

if you notice google constantly links to other web sites with a

trackable way when people click on search results.

this means google knows which web sites are becoming popular

are popular, etc. they can see what is rising before it rises.

it's like being able to see the future.

the computer tells them " you better get in touch with this guy

before he becomes rich and becomes un-stopable "

sometimes they send cops onto people. etc.

AMAZON INC however..



will provide you with the top 1 million web sites in the world.

updated daily in a cvs file.

downloadable at alexa.com

simply click on 'top sites' and then you will see the downloadable

file on the right side.

everyday they update it. and it is being given away for free.

google would never do this.

amazon does this.

this list you can use to ensure you show the top sites first in your

search engine .

this makes your search engine look 'credible'

in other words as you start making money, you first display things

in a "Generic" way but at the same time not in a "questionable" way

by displaying them based on "rank"

of course amazon only gives you URLS of the web sites.

you need to grab the title and etc from the web sites.

the truth is, to get started you do not need everything from web sites.

a title and some tags is all you need.

simple.

basic.

functional

will get peoples attention.

i always ask questions on SO but most questions get deleted. here's

something that did not get deleted..

How do I ensure that re.findall() stops at the right place?

use python, skrew php, php is no good.

do not use python frameworks, it's all lies and b.s. use mod-wsgi

use memcache to cache the templates and thus no need for a template engine.



always look at russian dedicated servers, and so on.

do not put your trust in america.

it has all turned into a mafia.



google can file a report, fbi can send cops onto you, and next thing you know

they frame you as a criminal, thug, mentally ill, bipolar, peadophile, and

so on.

all you can do is bleed to death behind bars.

do not give into the lies of AMERICA.

find russian dedicated servers.

i tried signing up with pw-service.com but i couldn't do it due to

restrictions with their russian payment systems and so on..

again, amazon's web site alexa.com provides you with downloadable

top 1 mil web sites in the form of a cvs file.

use it.

again, do not give into python programmers suggesting frameworks for python.

it's all b.s. use mod_wsgi with memcache.

again, american corporations can ruin you with lies and all you can do is

bleed to death behind bars

again, a basic search engine needs : url, title, tags, and popular searches

can be "cached" and words can be connected to "numbers" within the mysql.

mysql has capabilities to cache things as well.

cache once, cache twice, and you will not need 1 million servers in order

to troll.

if you need some xdotool commands to deal with people calling you a troll

here it is;

xdotool key ctrl+c

xdotool key Tab Tab Tab Return

xdotool type '@'

xdotool key ctrl+v

xdotool type --clearmodifiers ', there can not be such thing as a `troll`

unless compared to a stationary point, if you are complaining, you are not

stationary. which means you are the one that is trolling.'

xdotool key Tab Return

create an application launcher on your gnome-panel, and then select the

username in the comments section that called you a 'troll' and click the

shortcut on the gnome-panel.

it will copy the selected username to the clipboard and then hit TAB TAB

TAB RETURN

which opens the comment typing box. and then it will type @ + username +

comma, and then the rest.

................................................................................
Read More
Posted in | No comments

Identifying Switch case argument (Perl)

Posted on 11:29 AM by Unknown
Identifying Switch case argument (Perl)



Is there any way in Perl to see with value triggered case in Switch

statement if argument to case is a list?

For example

case [21...29] {.*Can I know which value triggered case??*...}
Read More
Posted in | No comments

asp.net ModalPopupExtender not behaving properly

Posted on 7:53 AM by Unknown
asp.net ModalPopupExtender not behaving properly



I have the following code on a .aspx file:

<cc1:ModalPopupExtender BehaviorID="mdlPopup" runat="server"

TargetControlID="btn"

ID="mdl1" PopupControlID="pnlPopup" OkControlID="LinkButton1"

BackgroundCssClass="modalBackground" />

<asp:Panel ID="pnlPopup" runat="server" CssClass="confirm-dialog"

Style="display: none;">

<div class="inner">

Work Order #: <asp:TextBox ID="txtWorkOrder" runat="server"

Width="285" Text=""></asp:TextBox><br /><br />

Please Enter Corrective Actions<br />

<asp:TextBox ID="TextBox2" runat="server" Height="150"

Width="285" TextMode="MultiLine"

Text=""></asp:TextBox>

<asp:Button ID="btnOK" runat="server" Font-Bold="true"

Text="Submit" OnClick="click"

Width="150" />

<asp:LinkButton ID="LinkButton1" runat="server"

CssClass="close" OnClick="cancel" />

</div>

</asp:Panel>

<asp:Button ID="btn" runat="server" Style="display: none;" />

<asp:Label ID="id" runat="server" Text="Label"

Visible="false"></asp:Label>

The problem that I am having is that the page just hangs when I have this

code in the .aspx file. Is there anything I should do. It does not even

get to the Page_Load.

I am calling this page that has the above code with the following:

string url = "Alerts.aspx?";

url += "ID=" + id.Text;

Response.Redirect(url);
Read More
Posted in | No comments

fanotify unable monitor entire system for FAN_OPEN_PERM event by multi-threaded program, and to ignore directories

Posted on 4:21 AM by Unknown
fanotify unable monitor entire system for FAN_OPEN_PERM event by

multi-threaded program, and to ignore directories



I want to monitor whole system for FAN_OPEN_PERM | FAN_CLOSE_WRITE events

by a multi - threaded program, and ignore some directories (say

/home/mydir). I used fanotify_init() and fanotify_mark() in main() as:

//Is there any way to use FAN_GLOBAL_LISTENER?

fd = fanotify_init(FAN_CLOEXEC| FAN_NONBLOCK | FAN_CLASS_CONTENT |

FAN_UNLIMITED_QUEUE | FAN_UNLIMITED_MARKS, O_RDONLY | O_LARGEFILE) ...

//Marking "/" (doesn't work as multi-threaded program) or "/home" (works

fine)

fanotify_mark(fd, FAN_MARK_ADD | FAN_MARK_MOUNT, FAN_OPEN_PERM |

FAN_CLOSE_WRITE | FAN_EVENT_ON_CHILD, AT_FDCWD, "/") ....

//Now, to ignore directory

fanotify_mark(fd, FAN_MARK_ADD | FAN_MARK_ONLYDIR | FAN_MARK_IGNORED_MASK

| FAN_MARK_IGNORED_SURV_MODIFY, FAN_OPEN_PERM | FAN_CLOSE_WRITE |

FAN_EVENT_ON_CHILD, AT_FDCWD, "/home/mydir")

In my program, main() reads events and pass it to multiple threads to

process further.

Problems : 1) System hangs for this multi-threaded program in case of

monitoring "/", but works fine for "/home". 2) Still I am getting

notifications for "/home/mydir" (marked "/home" & ignored "/home/mydir").

How to mark entire system without any problem with multi-threaded program?

How to use ignore mask to ignore entire directory (recursively)? (Kernel

2.6.38-8-generic)
Read More
Posted in | No comments

Jquery UI datepicker inline "onclick" handler causes CSP violations

Posted on 12:51 AM by Unknown
Jquery UI datepicker inline "onclick" handler causes CSP violations



According to this link I didn't get any solution. How can I modify the

date picker to be able to use click event. thanks
Read More
Posted in | No comments

Wednesday, August 21, 2013

URL constantly results in a badbox

Posted on 9:12 PM by Unknown
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 clickable. However, Kile constantly tells me that it

results in a badbox. It is strange, since, well, these urls do not have to

look good, so it could split them in any place and it would still be good.

I tried a few solutions, here, on TeX exchange, using URL package, sloppy,

adding some manual hyphenation rule and so on. Nothing works. Sometimes it

produces a different hyphenation pattern, but it is still marked by

badbox.

Is there any sensible reason to do it? I want to show the whole url, btw,

so link shorteners are no good (and they aren't answer anyway.)
Read More
Posted in | No comments

Split values over multiple rows with different delimiter meaning

Posted on 5:39 PM by Unknown
Split values over multiple rows with different delimiter meaning



Hi I have table Table1, this table are connected with others 4 tables:

Dim1, Dim2, Dim3, Dim4. In Table1 are different delimeter types:

No delimeter - (X_TEA) nothing to do

.. - (AGEN..XOGI) need to split row with values from AGEN to XOGI from

that dimension table

| - (24|25|LV_11..LV_25) split row in 3 rows with 24 , 25 and LV_11..LV_25

values.

<> - (<>17&<>36&<>61&<>63) split, multiple row with all values from that

dimension where they are not equal to 17, 36, 61, 63

*SQLFiddle*

Table1

| SCHEDULE NAME | LINE NO_ | ROW NO_ | ACCOUNT | DIMENSION 1 TOTALING |

DIMENSION 2 TOTALING | DIMENSION 3 TOTALING | DIMENSION 4

TOTALING |

------------------------------------------------------------------------------------------------------------------------------------------------------------

| MARKETING | 370000 | 1270 | 6 1010 | (null) |

11|12|13|24|25|LV_11..LV_25 | (null) |

(null) |

| MARKETING | 470000 | 1355 | 5 0100 | AGEN..XLIT|XOGI..WIND |

(null) | (null) |

(null) |

| MARKETING | 460000 | 1350 | 5 0103 | (null) |

(null) | (null) |

<>X_MARK_EST&<>ZZ_ZZMARK_BEL |

| MARKETING | 610000 | 1445 | 5 0102 | <>XLIT |

LV_63..LV_72 | (null) |

(null) |

| BIGSALES | 750000 | 1538 | 5 0908 | (null) |

(null) | (null) |

X_TEA |

| REVENUE | 275000 | 1250 | 5 0920 | (null) |

11|25|17|72 | (null) |

(null) |

Dim1

| CODE |

---------

| 11 |

| ACEN |

| AGEN |

| DIDEN |

| GADEN |

| LABEN |

| PADEN |

| XLIT |

| XOGI |

| WIND |

Dim2 (full in sqlfiddle)

| CODE |

---------

| 1 |

|.......|

| 28 |

| 61 |

| 63 |

| 72 |

| LV_11 |

| LV_22 |

| LV_25 |

| LV_63 |

| LV_72 |

Dim4

| CODE |

-----------------

| A_GIGI |

| G_TIGI |

| L_PIM |

| X_MARK_EST |

| X_TEA |

| ZZ_ZZMARK_BEL |

So how to split values over multiple rows with different delimiter

meaning? There probably would need use functions or some other sql server

components...

Desired Result:

| SCHEDULE NAME | LINE NO_ | ROW NO_ | ACCOUNT | DIMENSION 1 TOTALING |

DIMENSION 2 TOTALING | DIMENSION 3 TOTALING | DIMENSION 4

TOTALING |

------------------------------------------------------------------------------------------------------------------------------------------------------------

| MARKETING | 370000 | 1270 | 6 1010 | (null) |

11 | (null) |

(null) |

| MARKETING | 370000 | 1270 | 6 1010 | (null) |

12 | (null) |

(null) |

| MARKETING | 370000 | 1270 | 6 1010 | (null) |

13 | (null) |

(null) |

| MARKETING | 370000 | 1270 | 6 1010 | (null) |

24 | (null) |

(null) |

| MARKETING | 370000 | 1270 | 6 1010 | (null) |

25 | (null) |

(null) |

| MARKETING | 370000 | 1270 | 6 1010 | (null) |

LV_11 | (null) |

(null) |

| MARKETING | 370000 | 1270 | 6 1010 | (null) |

LV_22 | (null) |

(null) |

| MARKETING | 370000 | 1270 | 6 1010 | (null) |

LV_25 | (null) |

(null) |

| MARKETING | 470000 | 1355 | 5 0100 | AGEN |

(null) | (null) |

(null) |

| MARKETING | 470000 | 1355 | 5 0100 | DIDEN |

(null) | (null) |

(null) |

| MARKETING | 470000 | 1355 | 5 0100 | GADEN |

(null) | (null) |

(null) |

| MARKETING | 470000 | 1355 | 5 0100 | LABEN |

(null) | (null) |

(null) |

| MARKETING | 470000 | 1355 | 5 0100 | PADEN |

(null) | (null) |

(null) |

| MARKETING | 470000 | 1355 | 5 0100 | XLIT |

(null) | (null) |

(null) |

| MARKETING | 470000 | 1355 | 5 0100 | XOGI |

(null) | (null) |

(null) |

| MARKETING | 470000 | 1355 | 5 0100 | WIND |

(null) | (null) |

(null) |

| MARKETING | 460000 | 1350 | 5 0103 | (null) |

(null) | (null) | A_GIGI

|

| MARKETING | 460000 | 1350 | 5 0103 | (null) |

(null) | (null) | G_TIGI

|

| MARKETING | 460000 | 1350 | 5 0103 | (null) |

(null) | (null) | L_PIM

|

| MARKETING | 460000 | 1350 | 5 0103 | (null) |

(null) | (null) | X_TEA

|

| MARKETING | 610000 | 1445 | 5 0102 | 11 |

LV_63 | (null) |

(null) |

| MARKETING | 610000 | 1445 | 5 0102 | ACEN |

LV_63 | (null) |

(null) |

| MARKETING | 610000 | 1445 | 5 0102 | AGEN |

LV_63 | (null) |

(null) |

| MARKETING | 610000 | 1445 | 5 0102 | DIDEN |

LV_63 | (null) |

(null) |

| MARKETING | 610000 | 1445 | 5 0102 | GADEN |

LV_63 | (null) |

(null) |

| MARKETING | 610000 | 1445 | 5 0102 | LABEN |

LV_63 | (null) |

(null) |

| MARKETING | 610000 | 1445 | 5 0102 | PADEN |

LV_63 | (null) |

(null) |

| MARKETING | 610000 | 1445 | 5 0102 | XOGI |

LV_63 | (null) |

(null) |

| MARKETING | 610000 | 1445 | 5 0102 | WIND |

LV_63 | (null) |

(null) |

| MARKETING | 610000 | 1445 | 5 0102 | 11 |

LV_72 | (null) |

(null) |

| MARKETING | 610000 | 1445 | 5 0102 | ACEN |

LV_72 | (null) |

(null) |

| MARKETING | 610000 | 1445 | 5 0102 | AGEN |

LV_72 | (null) |

(null) |

| MARKETING | 610000 | 1445 | 5 0102 | DIDEN |

LV_72 | (null) |

(null) |

| MARKETING | 610000 | 1445 | 5 0102 | GADEN |

LV_72 | (null) |

(null) |

| MARKETING | 610000 | 1445 | 5 0102 | LABEN |

LV_72 | (null) |

(null) |

| MARKETING | 610000 | 1445 | 5 0102 | PADEN |

LV_72 | (null) |

(null) |

| MARKETING | 610000 | 1445 | 5 0102 | XOGI |

LV_72 | (null) |

(null) |

| MARKETING | 610000 | 1445 | 5 0102 | WIND |

LV_72 | (null) |

(null) |

| BIGSALES | 750000 | 1538 | 5 0908 | (null) |

(null) | (null) |

X_TEA |

| REVENUE | 275000 | 1250 | 5 0920 | (null) |

11 | (null) |

(null) |

| REVENUE | 275000 | 1250 | 5 0920 | (null) |

25 | (null) |

(null) |

| REVENUE | 275000 | 1250 | 5 0920 | (null) |

17 | (null) |

(null) |

| REVENUE | 275000 | 1250 | 5 0920 | (null) |

72 | (null) |

(null) |

PS. MS SQL SERVER 2008. For this problem I'm using split function in this

answer to split lines over | Split values over multiple rows . But after

that need to split over rest delimeters what I maybe can do... But with

this string <>X_MARK_EST&<>ZZ_ZZMARK_BEL I don't know how to split this

row. And basically I need solution without using some temporaliy tables.
Read More
Posted in | No comments
Newer Posts 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