ICE

-2

votes
1

answer
18

views

why dont show the result? syntax error not found in PyCharm [on hold]

def findsmallest(arr): smallest = arr[0] smallest_index = 0 for i in range(1, len(arr)): if arr[i] < smallest: smallest = arr[i] smallest_index = 1 return smallest_index def selectionsort(arr): newArr = [] for i in range(len(arr)): smallest = findsmallest(arr) newArr.append(arr.pop(smallest)) return...
Ice Tweak
0

votes
0

answer
4

views

Cannot convert from Discord.ActivityType to Discord.IActivity C# Discord.Net

This is the command that i will use when setting the activity but im not quite sure how to set it. [Command("watch")] [RequireOwner] public async Task SetBotWatching([Remainder] string video) { await XyntaxBot.Client.SetActivityAsync(ActivityType.Watching); await ReplyAsync("Set Activity"); }
Ice
1

votes
2

answer
203

views

Lua registry for environment(s)?

I'm trying to read the windows registry to figure out what scripting environments are installed and where the stand alone interpreter executables are available. When I did python, for example, I searched for HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/InstallPath This gives me the install path for...
Add the Ice
1

votes
1

answer
287

views

Fetching data from Stackmob using javascript

I am a beginner to javascript and stackmob. How can I fetch data from stackmob for my webpage(dashboard) using javascript? I was also trying to update data but i was unsuccessful. Here is my code for updating the value of 'done' from 'false' to 'true' : StackMob.init({publicKey: "my_key",apiVersion...
Ice
1

votes
2

answer
2.3k

views

Allow all developers to only do merge requests to master

I wish to do the following: Nobody can push directly to master, any attempt would get rejected. Merge Requests can be made by anyone but not approved by anyone, just admins. Essentially, master is something I want nobody to be able to push to directly, only via pull requests, which only the administ...
Molten Ice
1

votes
2

answer
184

views

Checking to have only One vertical bar | in a string ? using regex

So I am having the same example here that is been asked, which is xml containing things like the following mediawiki markup: " ...collected in the 12th century, of which [[Alexander the Great]] was the hero, and in which he was represented, somewhat like the British [[King Arthur|Arthur]]" using thi...
COLD ICE
1

votes
1

answer
188

views

How would I go back to a certain line Visual Basic 2013?

I am currently using visual basic to create a project and am stuck on a certain point... I am trying to get back to a certain point once the selected operation was completed. I would like to repeat the Button1_Click sub if that's possible. Heres my code so far. Private Sub Button1_Click(sender As Ob...
TRSB Ice
1

votes
1

answer
465

views

Abstract methods not-implemented error is not being thrown

So i was just trying to learn java coming from a C++ background, as part of a quick ramup I just implemented a base class from a abstract class as below abstract class my_abstract_class { abstract void my_abstract_function(); } class my_concrete_class extends my_abstract_class { } public class Concr...
Desert Ice
1

votes
3

answer
1.7k

views

Why does telnet send data only on a Enter?

I was playing around with Java sockets and telnet seemed like a good program to simulate a tcp client. What i don't understand is why does telnet send data only on a enter? I am not looking for hacks to make it send the data immediately(as that is available ( Send data over telnet without pressing e...
Desert Ice
1

votes
1

answer
55

views

Unexpected use of ( batch file

In the following code I want to terminate ABClient.exe and ABClientMonitor.exe if it is found running. However when trying to run the code I get a Unexpected use of ( error Code: @echo off color 0b :loop tasklist | find /i "ABClient.exe" > nul set processFound1=%errorlevel% tasklist | find /i "ABCli...
Ice
3

votes
1

answer
1.3k

views

Diffie Hellman Key Exchange in Android

I was thinking of implementing Diffie-Hellman on android mobile systems. In this application two sides say A and B generate keys which are later exchanged to get the common secret key.Android provides support for generating the keys but i want to know what would be the most secure to conduct the exc...
Desert Ice
1

votes
1

answer
502

views

Angular 5 error 404 when copying dist to webserver

I made a simple Angular 5 cover to say that I'm still constructing this website. ng serve works fine locally, but now I wanted to host this on my schools website here and I get all these 404 resources not found and all I did was copy whats in the dist/ folder after running ng build --prod to the www...
Burst of Ice
4

votes
2

answer
3.5k

views

c# wpf datagrid add row

I need to insert values in a table that have different columns from time to time. The columns and row data are updated from MySql. Each row values are in single MySql cells with the following format: ColumnName{Delimiter}Value{BigDelimiter}Column2Name{Delimiter}Value2... So I split the cell strings...
ice 13
17

votes
2

answer
10.1k

views

How to catch the output of a DBCC-Statement in a temptable

I tried the following on SQL-Server: create table #TmpLOGSPACE( DatabaseName varchar(100) , LOGSIZE_MB decimal(18, 9) , LOGSPACE_USED decimal(18, 9) , LOGSTATUS decimal(18, 9)) insert #TmpLOGSPACE(DatabaseName, LOGSIZE_MB, LOGSPACE_USED, LOGSTATUS) DBCC SQLPERF(LOGSPACE); ...but this rises an syn...
Ice
1

votes
4

answer
1.1k

views

Avoid writing SAME string to a text file when updating python

I have a text file("Memory.txt") that contains the following string: 111111111 11111111 111111 1111111111 11111111111 111111111111111 1111111111111 I'm pretty new to python and also new here but I wonder if there is a way I can add another string(e.g '111111111111') to this same file (only if the st...
Just Ice
1

votes
3

answer
360

views

Start new thread instead of put to queue

From javadoc for ThreadPoolExecutor: When a new task is submitted in method execute(java.lang.Runnable) .... If there are more than corePoolSize but less than maximumPoolSize threads running, a new thread will be created only if the queue is full. How can I make ThreadPool that will start new threa...
ice
18

votes
2

answer
2.8k

views

RAII design pattern in Java

Coming from a C++ background, I am a huge fan of the RAII pattern. I have used it extensively to handle memory management and lock management along with other use cases. With Java 1.7 I see that i can use the try-with-resources pattern to create a RAII pattern. I created a sample application using R...
Desert Ice
1

votes
2

answer
207

views

How these Jquery, ExtJs framework overwrite native Javascript

I have seen the tutorial from ExtJs using the code as below: var myDiv = Ext.get('myDiv'); myDiv.highlight(); where is hightlight() function from? Is it from native Javascript or ExtJs framework? I have done simple search but could not find it in API doc. If hightlight() is from ExtJs framework,...
skyrim.ice
2

votes
1

answer
520

views

Resizing Concurrent Hash Map

What is the amount of memory penalty for a Concurrent Hash Map resize. Specifically what I am looking for are Q1. Does the size of the concurrent hash map double? What I have read indicates the resize is done per bucket, but does not indicate what is the increase in the number of buckets Q2. If the...
Desert Ice
5

votes
1

answer
24.4k

views

Min Heapify method- Min heap algorithm

I am trying to build a min heap. I have already done the insert, delete,swap, up-heap, down-heap and it is working correctly. However, I am trying to write a method for Min-Heapify. Here is my Input: {20,14,9,6,4,5,1} The output I expected would be for the min heap: {1,5,4,20,9,6,14} But What I got...
COLD ICE
2

votes
1

answer
1k

views

What to consider if using triggers on tables in a sql-server merge replication

i am driving since some years a sql-server2000 merge-replication over three locations. Triggers do a lot of work in this database. i got no troubles. Now migrating these database to a brand new sql2008, i got some issues about the triggers. They are firing even if the merge-agent does his work. Is t...
Ice
2

votes
5

answer
2.1k

views

Java: I get a class cast exception error pointing to class I didn't even import

my problem is simple, I have the code I have written to first scale the image down and then crop to desired dimensions (obtained by the Constants class). if(image != null){ Image originalImage = image.getImage(); int width = Constants.width; //Algorithm: get the original width and divide with desire...
Molten Ice
5

votes
1

answer
243

views

Using cfqueryparam with constants

We religiously use cfqueryparam in our SQL queries. Some of my predecessors seem to have been a little overzealous when using it with direct values rather than variables. Isn't record_is_deleted_bt = overkill? I mean, there's no chance for SQL injection and I don't think that using a bind variable...
Fish Below the Ice
2

votes
3

answer
3k

views

Get position of list-item in an unordered list (ie. 3rd list item is 3)

I have an unordered list, with a couple list-items inside. Inside each of those is a link. What I want to do is find the position of the list-item when someone clicks the link inside it. For example, if someone clicks the link inside the 3rd list-item, it gives me a value of 3. I already have the cl...
Ark-of-Ice
2

votes
9

answer
85

views

How do you make sure an array is empty in PHP?

Im writing a page in HTML/PHP that connects to a Marina Database(boats,owners etc...) that takes a boat name chosen from a drop down list and then displays all the service that boat has had done on it. here is my relevant code... if(isset($_POST['form1'])){//if there was input data submitted $form1...
grublets on ice
2

votes
2

answer
954

views

Android @Override issues

I was using Java 1.7 for my Libgdx application, however i found i was getting a lot of "@Override" errors. So after searchin around online, i found out i should run with Java 1.6 compatibility to prevent this error. After going to window->preferences->java->compiler and changing the compatibility to...
Ice Phoenix
3

votes
1

answer
246

views

Android - Change in language using locale on lollipop

this is my code :- SplashActivity.java public class SplashActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash);`langData = "hi"` setLocale(langData); new Handler().postDelayed(...
ice spirit
5

votes
1

answer
12.4k

views

Send an image from Android to an ASP.NET Web Service

I'm developing an Android App that should send an image to my ASP.NET Web Service where the image will be saved as a file. I've seen a couple of ways to do this and I went for this one: convert the image to a byte array -> convert the byte array to a string -> send the string to the web service usin...
ice
2

votes
1

answer
43

views

Deleted a Git Branch and it changed my HEAD, How do I change it back?

I'm not entirely sure of my process here, not too sure what I did or how it happened. But we've locally deleted the master branch on accident. And now the HEAD of the project has changed to a different branch. I've tried to run the command-line of: git remote set-head origin master But this isn't...
Andrew Ice
5

votes
1

answer
6.6k

views

Check if a string contains substring at the end

I would like to check if a variable contains a substring at the end. For example: text = 'lord_of_pizzas_DFG' if ???: print('You shall pass') else: print('You shall not pass') I want to know how to check if "DFG" is at the end of the string. What do I write instead of ??? to make the code print "You...
Ice_giant
5

votes
3

answer
8.2k

views

Can I sync up multiple image onload calls?

I want a function to run when specific images are loaded, but I don't know how to wait for both to load before running. I only know how to chain them, like below: Image1 = new Image(); Image1.src = 'image1-link.jpg'; Image2 = new Image(); Image2.src = 'image2-link.jpg'; Image1.onload = function() {...
Ark-of-Ice
1

votes
4

answer
80

views

Java: How to check if a generated level is possible?

I've created a text based game which automatically generates a map with 10x10 rooms, a few of the rooms are blocked by various debris and I couldn't work out the most efficient way to check if a player can still reach a key and get to the exit without them being cut off from the map. Currently there...
Fluidic Ice
1

votes
3

answer
665

views

hyphen in MySQL order by clause

I have a MySQL query with this line ORDER BY -order_line_groups.sequence DESC, order_line_groups.id; I'm trying to find out what the hyphen is for just after the order by. I have tried executing with and without it but it does not seem to make a difference. I have also looked at it with explain and...
Cryptographic_ICE
1

votes
1

answer
935

views

undoing interrupted 'mv' (move) command [closed]

I hope this is the right place to ask this question. While trying to move a big directory "mydirname" (abt900GB), in a remote linux server, from /abc/source to /xyz/target ; I used the following command in sourcedirectory, mv mydirname /xyz/target/ & However, after a while the process got interrup...
Polar.Ice
2

votes
0

answer
25

views

How to prevent ARKit collecting dynamic objects which will make the anchor point incorrectly adjusted

I'm developing an app that load ARWorldMap and all the anchor in it. I found that if I scanned some dynamic objects (like people, display, doors open/close ) and saving WorldMap, Next time when i load this WorldMap the anchors will be adjusted to the wrong position. So how can i prevent ARKit colle...
ice.hu
1

votes
5

answer
643

views

How can I get a <td> to go from inline to block within an email template

On the desktop email clients, I want my td elements to show up side by side. Which they do, that's originally what a td is built to do. // These sit side by side in the email client on Desktop content content However, on the mobile view. Using a Media Query. I want to take these and make them full...
Andrew Ice
2

votes
2

answer
300

views

Game Jitters on xBox360

Ok i've got my game nearing completion, everything is working perfectly in it and it runs fairly well on my computer (running at around 99Mb RAM). But when i run it on my xBox, i tend to get occasional jitters of the main player character. I do have explosions and billboard effects inside my game ho...
Ice Phoenix
3

votes
1

answer
5k

views

Google ocr api for android(Image to text conversion)

I tried doing this by tesseract but the apk file generated is of 8 mb. I have seen Goggles app in Play and its quite efficient. I wonder how to integrate that technique.I haven't seen in any tutorial for that. If any one knows how to do that,please respond. Also How can I improve the quality of Tess...
Ice Box
4

votes
2

answer
1.6k

views

How to deduce from synthesis report

I had coded the 80c51 architecture in VHDL using xilinx. In an attempt to increase the clock frequency, I had pipelined all the 80c51 instructions. The instructions were able to execute as desired, for eg. when the 1st instruction is being processed, the second instruction gets fetched. However, I o...
Ice
2

votes
3

answer
294

views

Is there a way to access an index within a vector

i need to access an index (individual value) within a vector. I assumed it would be similar to: v1
Ice Phoenix

View additional