Spartan

0

votes
1

answer
27

views

How to execute a bitwise logical expression which is a string and the operator isn't known before hand

I have to execute a logical expression which is a string. For example : string s = "2
Spartan
1

votes
2

answer
4.1k

views

LogParser Error: Syntax Error: extra token(s) after query: 'Files\Apache'

I am trying to run LogParser to dump all contents from access.log into an equivalent CSV file: C:\Program Files\Log Parser 2.2>LogParser "select * into foo.csv from C:\Program Files\Apache Software Foundation\Apache2.2\logs\access.log" -i:ncsa -o:csv However, I keep getting this error: Error: Synta...
Angry Spartan
1

votes
1

answer
2.6k

views

How to assign to workers a proxy that requires user name - password and a custom user agent?

How to assign to workers a proxy that requires user name - password and a custom user agent using Selenium, PhantomJS driver with Python bindings. I've had good success with creating many workers traversing my test website. I can also assign a user agent or a proxy that does not require authorizati...
Jim Spartan
1

votes
1

answer
568

views

Windows Batch File to Delete Audio Files, with Length Requirement

and thank you for any help. I have tried searching for an example on how to accomplish the following, but haven't found anything. Any help would be appreciated as I have no experience in creating a BAT file! I have a third party program that records audio, and generates an .mp3 file from it. Every 2...
John Spartan
1

votes
2

answer
50

views

Display Folder Contents External of CFWheels Influence

My host provider has CFWheels set up as the root www folder I can access. However, I am trying to add a folder that is independent of the framework. In folder foo/ I added a blank application.cfc as told here in the folder. But, when I upload the folder and try to view it on mywebsite.com/foo I get...
Angry Spartan
1

votes
1

answer
396

views

Click on “this” in a backbone view

I am a newbie with backbone and i have a little problem with it events system. I have a view who represents an li element, and i want to do something when i click on it. Here is my code : var IndicatorView = Backbone.View.extend({ tagName: 'li', className: 'indicator', initialize: function(options){...
spartan_b18
0

votes
0

answer
42

views

User Inputs in Tic-Tac-Toe and board boundaries in Java

So I'm having trouble trying to get the already user inputs for the player names in and need help on how to get them to take turns. While I need to do that, I also need to have appropriate lines for the board so that no player can already overwrite a square. Here is my code: import java.util.Scanne...
Spartan Noah- 458
0

votes
0

answer
14

views

Tic-Tac-Toe Two Player inputs in Java

So here's my problem: I'm trying to get John and Jill to mark their X on the board, I know HOW, I just have trouble trying to make sure they don't overwrite each other because it's illegal and to make sure everything goes well. Should I get a method to check if the board is available or not taken or...
Spartan Noah- 458
1

votes
1

answer
2.5k

views

Editing Par in Design Mode Causes JavaScript Error

I have no idea how this happened, but clicking Edit in design mode for par (text component) generates a script error in widget.js. All other components work fine in when you click to edit them. Here are console dumps of the errors: Firefox: Error: TypeError: this.items.items[(i + 1)] is undefined S...
Angry Spartan
5

votes
3

answer
14.5k

views

Unparseable date using DateFormat.parse()

I followed a few other solutions on this site to this dilemma, and I do not have Joda Time installed, but I'm still at a loss as to why this is failing. I also tried removing the colons, as one solution stated, but that did not help. currentNode.getProperty("jcr:created").getString() = 2013-03-07T11...
Angry Spartan
2

votes
1

answer
88

views

Rendering a listview backbone js

I want to have this thing as a result: group 1 indicator 1 indicator 2 group 2 indicator 1 indicator 2 I have the Indicator model and view: var IndicatorModel = Backbone.Model.extend({ defaults: { name: "unset" } }); var IndicatorView = Backbone.View.extend({ tagName: 'li...
spartan_b18
2

votes
3

answer
5.8k

views

how to require a class in node.js

my code that works.. var express=require("express"), app=express(); class bar { constructor() { this.user_name=null; this.user_surname=null; this.user_age=null; } name(user_name) { this.user_name=user_name; return this; } surname(user_surname) { this.user_surname=user_surname; return this; } age(use...
Spartan Troy
4

votes
1

answer
125

views

Get Number of Occurrences Based on Date Range and Set Days of Week

I am trying to calculate the total number of events that would occur based on the following known parameters start date end date Days of the week frequency of weeks (every week, every 2 weeks, etc) For example, based on the following example data: 05/01/2017 05/31/2017 1,4 (Sunday, Wednesday) Every...
Angry Spartan
2

votes
2

answer
714

views

How to make an image behave like <p:selectBooleanCheckbox> in Primefaces?

I am trying to change the style of a in to a checkable image like in this exemple, my problem is how to choose the right CSS classes to modify the style the Primefaces component with my new style because in the HTML output in the browser I found many CSS classes my CSS style: .checkimage{ display...
Spartan
2

votes
2

answer
320

views

ReplaceAll replacing everything but what I specify

I wish to replace all instances of a pipe in a specific string with something else. However, not only is it not replacing the specified string but instead replacing all blank spaces. Example: String cleanTitle = StringEscapeUtils.escapeHtml("Bacon is | good"); out.println(cleanTitle.replaceAll("|",...
Angry Spartan
2

votes
4

answer
816

views

Git repo sync - connection lost

I'm trying to download android source (Cyanogenmod). i have spent more than 12hrs to download 2.5GB files, Now my connection lost for a while, it shows error: RPC failed; result=56, HTTP code = 200 fatal: The remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed fatal: unable to...
Spartan
2

votes
3

answer
2.3k

views

Is There Aspect Ratio Cropping in CQ5, Not Just Free Crop?

The image component allows Free Ratio cropping out of the box. I'm a bit baffled at why there is no Aspect Ratio option (keeping height and width constrained to each other), which would work much better for us. Is this an existing feature that can be enabled, or a custom task in Java? I am using CQ...
Angry Spartan
1

votes
2

answer
1.7k

views

how to get countries list alphabetically arranged with the correct names

I am trying to find all of the name of countries. I tried to get them from java.util.Locale but I found that there is some countries with wrong names and the list is not alphabetically arranged. to get the list from java.util.Locale I used this code private List countriesList = new ArrayList(); publ...
Spartan
1

votes
3

answer
77

views

Order of evaluation for function calls

Suppose I have a function like this: int *calculator(int *pointer1, int *pointer2) { int *pointer3 = malloc(15); return pointer3; //not an actual return, just an example function } and then in main, I have multiple calls to it: int main(void) { int array[40]; int *ptr, *ptr2, *ptr3, *ptr4; ptr = ptr...
Spartan 117
12

votes
2

answer
24.9k

views

align-self property in flexbox is not working?

I am trying to understand flex box: I want to make the “first” block stretched to match the full width of the browser, and the ”second” block of fixed size and aligned to left. So I used align-items: flex-end in the parent() and tried to stretch the first block using align-self: stretch in...
Spartan
12

votes
2

answer
1.7k

views

What does shopt -s dirspell do?

I cannot figure it out, i understand shopt -s cdspell but cannot find out what shopt -s dirspell does. The Bash Reference Guide says: dirspell If set, Bash attempts spelling correction on directory names during word completion if the directory name initially supplied does not exist. I tried several...
Spartan
2

votes
1

answer
189

views

Finding child of previous sibling in jQuery

I am modifying existing code, so I can only affect the elements that exist rather an building it right. I am iterating over all spans that have the class reqd, and if so, I'm either taking the immediate previous sibling (example 1) or the previous sibling's first child of type input (example 2) and...
Angry Spartan
4

votes
3

answer
18.8k

views

10.0.2.2:8080 in web browser in emulator is not working

I have a wamp server in localhost. I tried to make http request from my android app. But cannot get it right. Many said 10.0.2.2:8080 will point to localhost from emulator. So i tried to open it in web browser from emulator. i typed in url as "10.0.2.2/cifi/test.php". But emulator popped error as "n...
Spartan
2

votes
3

answer
1.5k

views

Accessing Text From Custom Component Without Using <cq:text>

I have a custom component that contains two distinct text dialog tabs, text1 and text2. Normally, you output using , but I need to determine if text2 contains content before outputting. So I'm trying to assign it to a local variable first. However, I get the error: text2 cannot be resolved Am I miss...
Angry Spartan
3

votes
4

answer
5.3k

views

Child Float Divs Breaking out of Parent Div

I've read through a lot of other posts on here about this issue to no effect. I wish to have a background graphic extend the whole length of the page, but it only goes 2/3 of the way down. html, body { height: 100%; } div#body-wrapper { height:100%; position:relative; } nav#side-navigation { height:...
Angry Spartan
3

votes
3

answer
4.4k

views

Get url minus current filename in JSP or CQ5

I wish to get the current url minus the file name that is being currently referenced. Whether the solution is in JSP or CQ5 doesn't matter. However, I am trying to use the latter more to get used to it. I'm using this documentation but it's not helping. CQ5 Docs. The example I found retrieves the fu...
Angry Spartan
1

votes
2

answer
54

views

why is the below code has time complexity of o(logn)

I have tried to understand the time complexity of the below code. When I try to calculate the timecomplexity myself it is coming out to be o(n). Because the "NO_OF_BITS" is always same for any int and therefore the loop doesn't increase/decrease with the input. I was not sure about the bitwise opera...
Spartan
2

votes
3

answer
901

views

NetBeans 8.0 unable to locate Android SDK

I've installed the Android SDK into NetBeans 8.0 in Ubuntu 13.10 and I've specified the SDK location in Tools>Option>Miscellaneous>Android and key loaded too. But when i create new Android project it says to me that the SDK location is not specified How can i resolve this problem ?!
Spartan
4

votes
4

answer
7.9k

views

How To Retrieve First PAR Node from Content Page

I am iterating through all child pages to display their titles and links. But I also need to display the first paragraph node, if it exists. For example, wow would I retrieve the first PAR node from the following content page? /content /foo /jcr:content /title /par
Angry Spartan
2

votes
0

answer
55

views

Local Instance Issue With Mach-II

I'm running mach-ii v1.8 on my local machine with CF10 installed on Win7. I copied a site down from production (which works) and is throwing an error of which I am unable to search for much help on. Expected structure key - received .; StructGet cannot be executed. The error occurred in /web/framewo...
Angry Spartan
2

votes
3

answer
48.3k

views

How to show text typed in by a user via text box in JavaScript/HTML

I currently have this within my JavaScript code: Form var input = document.getElementById('textbox'); function namet() { alert(textbox.value); } var input2 = document.getElementById('location'); function namet2() { alert(location.value); } Your name:
Spartan Man
5

votes
2

answer
243

views

Why do thread behave different with different run method body?

This code is from Effective Java (Item 66): (without sync or volatile this never ends) public class ThreadPractice { static boolean canrunstatic; public static void main(String[] args) throws InterruptedException { Thread backgroundThread = new Thread(new Runnable() { public void run() { int i = 0;...
Spartan
2

votes
1

answer
918

views

Comparing Coldfusion and PHP timestamp in milliseconds

I'm creating a timestamp in CF8 using a custom function. It's then being passed via query string to PHP and compared, again, to the current timestamp (using time()). Since CF8 doesn't have a built-in millisecond option for DateDiff(), I appended 3 zeroes to the end of the returned value (which is...
Angry Spartan
2

votes
2

answer
913

views

JSP Reference Books [closed]

There seems to be a dearth of fresh JSP reference books to purchase. Most are from between 1999 and 2003, with almost nothing after that. There are still lots of Java books, and while most of the syntax is easily swapped, I'd rather have a reference book specifically for the dynamic browser aspect...
Angry Spartan
2

votes
2

answer
10.9k

views

How to confirm a radio button selection with an alert box

So i have this code: Form function showConfirmationDialog() { var textbox = document.getElementById('textbox'); var location = document.getElementById('location'); alert('You chosen:'+'\n'+'\n'+'Name: '+textbox.value +'\n'+'Address: ' +location.value+'\n'); } function formfocus() { document.getEle...
Spartan Man
4

votes
2

answer
156

views

Why can't value constructors take type variables WITHOUT parameterizing the type?

As a beginner, it's not obvious to me why this is not allowed: data Pair = Pair a b That is, why do Pair 5 "foo" and Pair 'C' [] HAVE to produce different types? Why is it not allowed for them both to create values of type Pair? I'm learning from "Learn you a", RWH, and the Haskell WikiBook, but hav...
spartan_dev
2

votes
1

answer
6.4k

views

How to use mapPartitions in Spark Scala?

I have DocsRDD : RDD[String, String] val DocsRDD = sc.wholeTextFiles("myDirectory/*" , 2) DocsRDD: Doc1.txt , bla bla bla .....\n bla bla bla \n bla ... bla Doc2.txt , bla bla bla .....bla \n bla bla \n bla ... bla Doc3.txt , bla bla bla .....\n bla bla bla \n bla ... bla Doc4.txt , bla bla \n .......
Spartan
2

votes
1

answer
1.3k

views

Sorting with Insertion Sort, Selection Sort, and Merge Sort

Now I am in grade 12 at high school taking a programming course in Java. Now I have a test tomorrow, and I am trying to study. The test is a practical test, and I have to take either primitive data or an object and sort them using Insertion Sort, Selection Sort, and Merge sort into either primitiv...
Spartan
4

votes
2

answer
212

views

Codeigniter Failing on Object Property Named 'State'

I have an array of objects to loop through, and one public property keeps causing a notice error for CodeIgniter. From what I read, 'state' is not a reserved word in PHP. Part of the object dump array (size=1) 0 => object(stdClass)[15] public 'ID' => int 107292435 (length=9) public 'RegTypeID' => i...
Angry Spartan
2

votes
3

answer
277

views

Google OAuth Code Contains Hashtag

In my attempts to get the necessary code so I can generate my refresh token, I ran this URL: https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/drive.file&redirect_uri=--mywebsite--&response_type=code&client_id=--myclientid-- And my received code contains a trailing hash...
Angry Spartan

View additional